@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.
Files changed (65) hide show
  1. package/dist/ix-grid.min.js +5 -5
  2. package/package.json +4 -4
  3. package/rollup.config.mjs +32 -6
  4. package/src/IxGrid.d.ts +148 -0
  5. package/src/IxGrid.js +784 -0
  6. package/src/IxGrid.js.map +1 -0
  7. package/src/IxGridNav.d.ts +2 -0
  8. package/src/IxGridNav.js +8 -0
  9. package/src/IxGridNav.js.map +1 -0
  10. package/src/components/IxGridColumnFilter.d.ts +35 -0
  11. package/src/components/IxGridColumnFilter.js +249 -0
  12. package/src/components/IxGridColumnFilter.js.map +1 -0
  13. package/src/components/IxGridDownloadMenu.d.ts +17 -0
  14. package/src/components/IxGridDownloadMenu.js +98 -0
  15. package/src/components/IxGridDownloadMenu.js.map +1 -0
  16. package/src/components/IxGridNav.d.ts +16 -0
  17. package/src/components/IxGridNav.js +103 -0
  18. package/src/components/IxGridNav.js.map +1 -0
  19. package/src/components/IxGridNoRows.d.ts +10 -0
  20. package/src/components/IxGridNoRows.js +74 -0
  21. package/src/components/IxGridNoRows.js.map +1 -0
  22. package/src/components/IxGridRowFilter.d.ts +55 -0
  23. package/src/components/IxGridRowFilter.js +441 -0
  24. package/src/components/IxGridRowFilter.js.map +1 -0
  25. package/src/components/IxPagination.d.ts +14 -0
  26. package/src/components/IxPagination.js +107 -0
  27. package/src/components/IxPagination.js.map +1 -0
  28. package/src/components/grid-column-filter-styles.d.ts +1 -0
  29. package/src/components/grid-column-filter-styles.js +89 -0
  30. package/src/components/grid-column-filter-styles.js.map +1 -0
  31. package/src/components/grid-row-filter-styles.d.ts +1 -0
  32. package/src/components/grid-row-filter-styles.js +311 -0
  33. package/src/components/grid-row-filter-styles.js.map +1 -0
  34. package/src/components/ix-grid-no-rows.d.ts +1 -0
  35. package/src/components/ix-grid-no-rows.js +2 -0
  36. package/src/components/ix-grid-no-rows.js.map +1 -0
  37. package/src/components/pagination-styles.d.ts +1 -0
  38. package/src/components/pagination-styles.js +84 -0
  39. package/src/components/pagination-styles.js.map +1 -0
  40. package/src/grid-view-styles.d.ts +1 -0
  41. package/src/grid-view-styles.js +283 -0
  42. package/src/grid-view-styles.js.map +1 -0
  43. package/src/index.d.ts +3 -0
  44. package/src/index.js +3 -0
  45. package/src/index.js.map +1 -0
  46. package/src/ix-grid-copy.d.ts +12 -0
  47. package/src/ix-grid-copy.js +12 -0
  48. package/src/ix-grid-copy.js.map +1 -0
  49. package/src/ix-grid-nav.d.ts +1 -0
  50. package/src/ix-grid-nav.js +2 -0
  51. package/src/ix-grid-nav.js.map +1 -0
  52. package/src/ix-grid-no-rows.d.ts +1 -0
  53. package/src/ix-grid-no-rows.js +2 -0
  54. package/src/ix-grid-no-rows.js.map +1 -0
  55. package/src/ix-grid.d.ts +1 -0
  56. package/src/ix-grid.js +2 -0
  57. package/src/ix-grid.js.map +1 -0
  58. package/src/models/IxGridDownloadMenuItemModel.d.ts +7 -0
  59. package/src/models/IxGridDownloadMenuItemModel.js +1 -0
  60. package/src/models/IxGridDownloadMenuItemModel.js.map +1 -0
  61. package/src/test/ix-grid-column-filter.test.js +41 -0
  62. package/src/test/ix-grid-row-filter.test.js +281 -0
  63. package/src/test/ix-grid.test.js +391 -0
  64. package/src/test/ix-pagination.test.js +58 -0
  65. 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
+ });
@@ -22,7 +22,7 @@ export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
22
22
  },
23
23
  }),
24
24
  ],
25
-
25
+
26
26
  /** Resolve bare module imports */
27
27
  nodeResolve: {
28
28
  exportConditions: ['browser', 'development'],