@digital-realty/ix-grid 1.4.1-alpha.1 → 1.4.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ix-grid.min.js +5 -5
- package/package.json +4 -4
- package/rollup.config.mjs +32 -6
- package/src/IxGrid.d.ts +148 -0
- package/src/IxGrid.js +784 -0
- package/src/IxGrid.js.map +1 -0
- package/src/IxGridNav.d.ts +2 -0
- package/src/IxGridNav.js +8 -0
- package/src/IxGridNav.js.map +1 -0
- package/src/components/IxGridColumnFilter.d.ts +35 -0
- package/src/components/IxGridColumnFilter.js +249 -0
- package/src/components/IxGridColumnFilter.js.map +1 -0
- package/src/components/IxGridDownloadMenu.d.ts +17 -0
- package/src/components/IxGridDownloadMenu.js +98 -0
- package/src/components/IxGridDownloadMenu.js.map +1 -0
- package/src/components/IxGridNav.d.ts +16 -0
- package/src/components/IxGridNav.js +103 -0
- package/src/components/IxGridNav.js.map +1 -0
- package/src/components/IxGridNoRows.d.ts +10 -0
- package/src/components/IxGridNoRows.js +74 -0
- package/src/components/IxGridNoRows.js.map +1 -0
- package/src/components/IxGridRowFilter.d.ts +55 -0
- package/src/components/IxGridRowFilter.js +441 -0
- package/src/components/IxGridRowFilter.js.map +1 -0
- package/src/components/IxPagination.d.ts +14 -0
- package/src/components/IxPagination.js +107 -0
- package/src/components/IxPagination.js.map +1 -0
- package/src/components/grid-column-filter-styles.d.ts +1 -0
- package/src/components/grid-column-filter-styles.js +89 -0
- package/src/components/grid-column-filter-styles.js.map +1 -0
- package/src/components/grid-row-filter-styles.d.ts +1 -0
- package/src/components/grid-row-filter-styles.js +311 -0
- package/src/components/grid-row-filter-styles.js.map +1 -0
- package/src/components/ix-grid-no-rows.d.ts +1 -0
- package/src/components/ix-grid-no-rows.js +2 -0
- package/src/components/ix-grid-no-rows.js.map +1 -0
- package/src/components/pagination-styles.d.ts +1 -0
- package/src/components/pagination-styles.js +84 -0
- package/src/components/pagination-styles.js.map +1 -0
- package/src/grid-view-styles.d.ts +1 -0
- package/src/grid-view-styles.js +283 -0
- package/src/grid-view-styles.js.map +1 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -0
- package/src/ix-grid-copy.d.ts +12 -0
- package/src/ix-grid-copy.js +12 -0
- package/src/ix-grid-copy.js.map +1 -0
- package/src/ix-grid-nav.d.ts +1 -0
- package/src/ix-grid-nav.js +2 -0
- package/src/ix-grid-nav.js.map +1 -0
- package/src/ix-grid-no-rows.d.ts +1 -0
- package/src/ix-grid-no-rows.js +2 -0
- package/src/ix-grid-no-rows.js.map +1 -0
- package/src/ix-grid.d.ts +1 -0
- package/src/ix-grid.js +2 -0
- package/src/ix-grid.js.map +1 -0
- package/src/models/IxGridDownloadMenuItemModel.d.ts +7 -0
- package/src/models/IxGridDownloadMenuItemModel.js +1 -0
- package/src/models/IxGridDownloadMenuItemModel.js.map +1 -0
- package/src/test/ix-grid-column-filter.test.js +41 -0
- package/src/test/ix-grid-row-filter.test.js +281 -0
- package/src/test/ix-grid.test.js +391 -0
- package/src/test/ix-pagination.test.js +58 -0
- package/web-test-runner.config.mjs +1 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import { expect, fixture, oneEvent } from '@open-wc/testing';
|
|
3
|
+
// eslint-disable-next-line import/no-duplicates
|
|
4
|
+
import '../components/IxPagination.js';
|
|
5
|
+
describe('IxPagination', () => {
|
|
6
|
+
it('renders pagination', async () => {
|
|
7
|
+
const el = await fixture(html `<ix-pagination></ix-pagination>`);
|
|
8
|
+
expect(el).to.not.be.null;
|
|
9
|
+
});
|
|
10
|
+
it('renders pagination page size select', async () => {
|
|
11
|
+
var _a;
|
|
12
|
+
const el = await fixture(html `<ix-pagination
|
|
13
|
+
.pageSizes=${[1, 2, 3]}
|
|
14
|
+
></ix-pagination>`);
|
|
15
|
+
const pageSizeSelect = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('ix-select-option');
|
|
16
|
+
expect(pageSizeSelect === null || pageSizeSelect === void 0 ? void 0 : pageSizeSelect.length).to.equal(3);
|
|
17
|
+
});
|
|
18
|
+
it('renders pagination range info', async () => {
|
|
19
|
+
var _a;
|
|
20
|
+
const el = await fixture(html `<ix-pagination
|
|
21
|
+
pageSize="10"
|
|
22
|
+
page="2"
|
|
23
|
+
recordCount="99"
|
|
24
|
+
></ix-pagination>`);
|
|
25
|
+
const pageRangeInfo = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('p')[1];
|
|
26
|
+
expect(pageRangeInfo === null || pageRangeInfo === void 0 ? void 0 : pageRangeInfo.innerText).to.equal('11 - 20 of 99');
|
|
27
|
+
});
|
|
28
|
+
it('calculates new page when page size increases', async () => {
|
|
29
|
+
var _a, _b, _c;
|
|
30
|
+
const el = await fixture(html `<ix-pagination
|
|
31
|
+
.pageSizes=${[10, 20, 50, 100]}
|
|
32
|
+
pageSize="50"
|
|
33
|
+
page="5"
|
|
34
|
+
recordCount="600"
|
|
35
|
+
></ix-pagination>`);
|
|
36
|
+
const listener = oneEvent(el, 'updatePagination');
|
|
37
|
+
const ixSelect = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("ix-select-option[value='100']");
|
|
38
|
+
(_c = (_b = ixSelect === null || ixSelect === void 0 ? void 0 : ixSelect.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('li')) === null || _c === void 0 ? void 0 : _c.click();
|
|
39
|
+
const event = await listener;
|
|
40
|
+
expect(event.detail.page).to.equal(3);
|
|
41
|
+
expect(event.detail.pageSize).to.equal(100);
|
|
42
|
+
});
|
|
43
|
+
it('calculates new page when page size decreases', async () => {
|
|
44
|
+
var _a, _b, _c;
|
|
45
|
+
const el = await fixture(html `<ix-pagination
|
|
46
|
+
.pageSizes=${[10, 20, 50, 100]}
|
|
47
|
+
pageSize="50"
|
|
48
|
+
page="5"
|
|
49
|
+
recordCount="600"
|
|
50
|
+
></ix-pagination>`);
|
|
51
|
+
const listener = oneEvent(el, 'updatePagination');
|
|
52
|
+
const ixSelect = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector("ix-select-option[value='20']");
|
|
53
|
+
(_c = (_b = ixSelect === null || ixSelect === void 0 ? void 0 : ixSelect.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector('li')) === null || _c === void 0 ? void 0 : _c.click();
|
|
54
|
+
const event = await listener;
|
|
55
|
+
expect(event.detail.page).to.equal(11);
|
|
56
|
+
expect(event.detail.pageSize).to.equal(20);
|
|
57
|
+
});
|
|
58
|
+
});
|