-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(grid): add selection aggregates visual tests
- Loading branch information
Showing
2 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
packages/html/src/grid/tests/grid-selection-aggregates.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en" class="k-no-animations"> | ||
<head> | ||
<title>Grid Selection Aggregates</title> | ||
<meta charset="utf-8" /> | ||
<link rel="stylesheet" data-role="kendo-theme" href="/packages/default/dist/all.css"/> | ||
<link rel="stylesheet" href="/packages/html/assets/styles.css"/> | ||
<script src="/packages/html/assets/scripts.js"></script> | ||
</head> | ||
<body id="app" class="k-body"> | ||
<script src="/packages/html/dist/grid/tests/grid-selection-aggregates.js"></script> | ||
</body> | ||
</html> |
192 changes: 192 additions & 0 deletions
192
packages/html/src/grid/tests/grid-selection-aggregates.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,192 @@ | ||
import ReactDOM from 'react-dom/client'; | ||
import { Pager } from '../../pager'; | ||
|
||
const root = ReactDOM.createRoot( | ||
document.getElementById('app') as HTMLElement | ||
); | ||
|
||
root.render( | ||
<> | ||
<div id="test-area" className="k-d-grid k-grid-cols-2"> | ||
|
||
<span className="col-2">Grid with selection aggregates container</span> | ||
<section className="col-2"> | ||
<div className="k-grid k-grid-md k-grid-no-scrollbar"> | ||
<div className="k-grid-header"> | ||
<div className="k-grid-header-wrap"> | ||
<table className="k-table k-table-md k-grid-header-table"> | ||
<colgroup> | ||
<col style={{ width: "100px" }} /> | ||
<col /> | ||
</colgroup> | ||
<thead className="k-table-thead"> | ||
<tr className="k-table-row"> | ||
<th className="k-table-th k-header"> | ||
<span className="k-cell-inner"> | ||
<span className="k-link"> | ||
<span className="k-column-title">100px</span> | ||
</span> | ||
</span> | ||
</th> | ||
<th className="k-table-th k-header"> | ||
<span className="k-cell-inner"> | ||
<span className="k-link"> | ||
<span className="k-column-title">no width</span> | ||
</span> | ||
</span> | ||
</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
</div> | ||
</div> | ||
<div className="k-grid-content"> | ||
<table className="k-table k-table-md k-grid-table"> | ||
<colgroup> | ||
<col style={{ width: "100px" }} /> | ||
<col /> | ||
</colgroup> | ||
<tbody className="k-table-tbody"> | ||
<tr className="k-table-row"> | ||
<td className="k-table-td">1</td> | ||
<td className="k-table-td">Row</td> | ||
</tr> | ||
<tr className="k-table-row k-table-alt-row k-alt"> | ||
<td className="k-table-td k-selected">2</td> | ||
<td className="k-table-td k-selected">Alt row</td> | ||
</tr> | ||
<tr className="k-table-row"> | ||
<td className="k-table-td k-selected">3</td> | ||
<td className="k-table-td"> | ||
This text continues to the end of the grid to test overflow behavior of row contents, as well as line height and vertical alignment. | ||
</td> | ||
</tr> | ||
<tr className="k-table-row k-table-alt-row k-alt"> | ||
<td className="k-table-td k-selected">4</td> | ||
<td className="k-table-td"><span className="k-placeholder-line"></span></td> | ||
</tr> | ||
<tr className="k-table-row"> | ||
<td className="k-table-td">5</td> | ||
<td className="k-table-td"><span className="k-placeholder-line"></span></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div className="k-selection-aggregates k-grid-selection-aggregates"> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Sum: </span> | ||
<span className="k-selection-aggregates-item-value">9.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Avg: </span> | ||
<span className="k-selection-aggregates-item-value">3.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Min: </span> | ||
<span className="k-selection-aggregates-item-value">2.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Max: </span> | ||
<span className="k-selection-aggregates-item-value">4.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Count: </span> | ||
<span className="k-selection-aggregates-item-value">4</span> | ||
</div> | ||
</div> | ||
<Pager className="k-grid-pager" /> | ||
</div> | ||
</section> | ||
|
||
<span className="col-2">Grid with selection aggregates container (RTL)</span> | ||
<section className="col-2 k-rtl"> | ||
<div className="k-grid k-grid-md k-grid-no-scrollbar"> | ||
<div className="k-grid-header"> | ||
<div className="k-grid-header-wrap"> | ||
<table className="k-table k-table-md k-grid-header-table"> | ||
<colgroup> | ||
<col style={{ width: "100px" }} /> | ||
<col /> | ||
</colgroup> | ||
<thead className="k-table-thead"> | ||
<tr className="k-table-row"> | ||
<th className="k-table-th k-header"> | ||
<span className="k-cell-inner"> | ||
<span className="k-link"> | ||
<span className="k-column-title">100px</span> | ||
</span> | ||
</span> | ||
</th> | ||
<th className="k-table-th k-header"> | ||
<span className="k-cell-inner"> | ||
<span className="k-link"> | ||
<span className="k-column-title">no width</span> | ||
</span> | ||
</span> | ||
</th> | ||
</tr> | ||
</thead> | ||
</table> | ||
</div> | ||
</div> | ||
<div className="k-grid-content"> | ||
<table className="k-table k-table-md k-grid-table"> | ||
<colgroup> | ||
<col style={{ width: "100px" }} /> | ||
<col /> | ||
</colgroup> | ||
<tbody className="k-table-tbody"> | ||
<tr className="k-table-row"> | ||
<td className="k-table-td">1</td> | ||
<td className="k-table-td">Row</td> | ||
</tr> | ||
<tr className="k-table-row k-table-alt-row k-alt"> | ||
<td className="k-table-td k-selected">2</td> | ||
<td className="k-table-td k-selected">Alt row</td> | ||
</tr> | ||
<tr className="k-table-row"> | ||
<td className="k-table-td k-selected">3</td> | ||
<td className="k-table-td"> | ||
This text continues to the end of the grid to test overflow behavior of row contents, as well as line height and vertical alignment. | ||
</td> | ||
</tr> | ||
<tr className="k-table-row k-table-alt-row k-alt"> | ||
<td className="k-table-td k-selected">4</td> | ||
<td className="k-table-td"><span className="k-placeholder-line"></span></td> | ||
</tr> | ||
<tr className="k-table-row"> | ||
<td className="k-table-td">5</td> | ||
<td className="k-table-td"><span className="k-placeholder-line"></span></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<div className="k-selection-aggregates k-grid-selection-aggregates"> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Sum: </span> | ||
<span className="k-selection-aggregates-item-value">9.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Avg: </span> | ||
<span className="k-selection-aggregates-item-value">3.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Min: </span> | ||
<span className="k-selection-aggregates-item-value">2.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Max: </span> | ||
<span className="k-selection-aggregates-item-value">4.00</span> | ||
</div> | ||
<div className="k-selection-aggregates-item"> | ||
<span className="k-selection-aggregates-item-text">Count: </span> | ||
<span className="k-selection-aggregates-item-value">4</span> | ||
</div> | ||
</div> | ||
<Pager className="k-grid-pager" /> | ||
</div> | ||
</section> | ||
|
||
</div> | ||
</> | ||
); |