@digital-realty/ix-grid 1.0.6

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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +62 -0
  3. package/demo/columns.js +65 -0
  4. package/demo/contacts.js +292 -0
  5. package/demo/index.html +92 -0
  6. package/dist/IxGrid.d.ts +46 -0
  7. package/dist/IxGrid.js +227 -0
  8. package/dist/IxGrid.js.map +1 -0
  9. package/dist/components/IxGridColumnFilter.d.ts +20 -0
  10. package/dist/components/IxGridColumnFilter.js +133 -0
  11. package/dist/components/IxGridColumnFilter.js.map +1 -0
  12. package/dist/components/IxGridRowFilter.d.ts +37 -0
  13. package/dist/components/IxGridRowFilter.js +317 -0
  14. package/dist/components/IxGridRowFilter.js.map +1 -0
  15. package/dist/components/IxPagination.d.ts +13 -0
  16. package/dist/components/IxPagination.js +93 -0
  17. package/dist/components/IxPagination.js.map +1 -0
  18. package/dist/components/grid-column-filter-styles.d.ts +1 -0
  19. package/dist/components/grid-column-filter-styles.js +71 -0
  20. package/dist/components/grid-column-filter-styles.js.map +1 -0
  21. package/dist/components/grid-row-filter-styles.d.ts +1 -0
  22. package/dist/components/grid-row-filter-styles.js +414 -0
  23. package/dist/components/grid-row-filter-styles.js.map +1 -0
  24. package/dist/components/pagination-styles.d.ts +1 -0
  25. package/dist/components/pagination-styles.js +33 -0
  26. package/dist/components/pagination-styles.js.map +1 -0
  27. package/dist/grid-view-styles.d.ts +1 -0
  28. package/dist/grid-view-styles.js +265 -0
  29. package/dist/grid-view-styles.js.map +1 -0
  30. package/dist/index.d.ts +1 -0
  31. package/dist/index.js +2 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/ix-grid-copy.d.ts +10 -0
  34. package/dist/ix-grid-copy.js +11 -0
  35. package/dist/ix-grid-copy.js.map +1 -0
  36. package/dist/ix-grid.d.ts +1 -0
  37. package/dist/ix-grid.js +3 -0
  38. package/dist/ix-grid.js.map +1 -0
  39. package/dist/test/ix-grid-column-filter.test.d.ts +1 -0
  40. package/dist/test/ix-grid-column-filter.test.js +36 -0
  41. package/dist/test/ix-grid-column-filter.test.js.map +1 -0
  42. package/dist/test/ix-grid-row-filter.test.d.ts +1 -0
  43. package/dist/test/ix-grid-row-filter.test.js +37 -0
  44. package/dist/test/ix-grid-row-filter.test.js.map +1 -0
  45. package/dist/test/ix-grid.test.d.ts +1 -0
  46. package/dist/test/ix-grid.test.js +43 -0
  47. package/dist/test/ix-grid.test.js.map +1 -0
  48. package/dist/test/ix-pagination.test.d.ts +1 -0
  49. package/dist/test/ix-pagination.test.js +28 -0
  50. package/dist/test/ix-pagination.test.js.map +1 -0
  51. package/package.json +95 -0
  52. package/src/IxGrid.ts +229 -0
  53. package/src/components/IxGridColumnFilter.ts +144 -0
  54. package/src/components/IxGridRowFilter.ts +352 -0
  55. package/src/components/IxPagination.ts +85 -0
  56. package/src/components/grid-column-filter-styles.ts +71 -0
  57. package/src/components/grid-row-filter-styles.ts +414 -0
  58. package/src/components/pagination-styles.ts +33 -0
  59. package/src/grid-view-styles.ts +265 -0
  60. package/src/index.ts +1 -0
  61. package/src/ix-grid-copy.ts +10 -0
  62. package/src/ix-grid.ts +3 -0
  63. package/src/test/ix-grid-column-filter.test.ts +47 -0
  64. package/src/test/ix-grid-row-filter.test.ts +48 -0
  65. package/src/test/ix-grid.test.ts +50 -0
  66. package/src/test/ix-pagination.test.ts +33 -0
  67. package/tsconfig.json +22 -0
  68. package/web-dev-server.config.mjs +27 -0
  69. package/web-test-runner.config.mjs +43 -0
@@ -0,0 +1,265 @@
1
+ import { css } from 'lit';
2
+ export const IxGridViewStyles = css `
3
+ @font-face {
4
+ font-family: 'Material Icons';
5
+ font-style: normal;
6
+ font-weight: 400;
7
+ src: url(https://fonts.gstatic.com/s/materialicons/v140/flUhRq6tzZclQEJ-Vdg-IuiaDsNZ.ttf)
8
+ format('truetype');
9
+ }
10
+ .material-icons {
11
+ font-family: 'Material Icons';
12
+ font-weight: normal;
13
+ font-style: normal;
14
+ font-size: 24px;
15
+ line-height: 1;
16
+ letter-spacing: normal;
17
+ text-transform: none;
18
+ display: inline-block;
19
+ white-space: nowrap;
20
+ word-wrap: normal;
21
+ direction: ltr;
22
+ }
23
+ ix-dialog {
24
+ --md-dialog-container-color: #fff;
25
+ }
26
+ ix-textbox {
27
+ --md-sys-color-on-surface-variant: #b8bfc8;
28
+ }
29
+ ix-button {
30
+ --md-outlined-button-outline-color: var(--md-sys-color-primary);
31
+ --md-outlined-select-text-field-outline-color: #ddd;
32
+ }
33
+ ix-button .button-label {
34
+ text-transform: uppercase;
35
+ font-weight: bold;
36
+ letter-spacing: 1.25px;
37
+ }
38
+ .btn_primary {
39
+ --md-filled-button-container-color: var(--md-sys-color-primary);
40
+ }
41
+ .btn_primary ix-icon {
42
+ color: var(--md-sys-color-on-primary);
43
+ }
44
+ .btn_secondary {
45
+ --md-filled-button-container-color: var(--md-sys-color-secondary);
46
+ }
47
+ .btn_secondary ix-icon {
48
+ color: var(--md-sys-color-on-secondary);
49
+ }
50
+ .btn_tertiary {
51
+ --md-filled-button-container-color: var(--md-sys-color-tertiary);
52
+ }
53
+ .btn_tertiary ix-icon {
54
+ color: var(--md-sys-color-on-tertiary);
55
+ }
56
+ .btn_danger {
57
+ --md-filled-button-container-color: var(--md-sys-color-error);
58
+ }
59
+ .btn_danger ix-icon {
60
+ color: var(--md-sys-color-on-error);
61
+ }
62
+ .icon-btn_primary ix-icon {
63
+ color: var(--md-sys-color-primary);
64
+ }
65
+ .icon-btn_secondary ix-icon {
66
+ color: var(--md-sys-color-secondary);
67
+ }
68
+ .icon-btn_tertiary ix-icon {
69
+ color: var(--md-sys-color-tertiary);
70
+ }
71
+ .icon-btn_danger ix-icon {
72
+ color: var(--md-sys-color-error);
73
+ }
74
+ .dialog__headline {
75
+ margin: 0px;
76
+ font-family: 'Red Hat Display', sans-serif;
77
+ font-style: normal;
78
+ font-weight: bold;
79
+ font-size: 20px;
80
+ line-height: 24px;
81
+ letter-spacing: 0.15px;
82
+ padding: 24px;
83
+ }
84
+ .dialog-form {
85
+ min-width: 500px;
86
+ display: flex;
87
+ flex-direction: column;
88
+ justify-content: space-between;
89
+ padding: 8px 24px 20px;
90
+ }
91
+ .dialog-form .textfield {
92
+ width: 100%;
93
+ }
94
+ .dialog-form.sm {
95
+ min-width: 560px;
96
+ }
97
+ .dialog-form__info {
98
+ margin: 0px;
99
+ font-family: 'Open Sans', sans-serif;
100
+ font-style: normal;
101
+ font-weight: 400;
102
+ font-size: 16px;
103
+ line-height: 28px;
104
+ letter-spacing: 0.44px;
105
+ color: rgba(9, 34, 65, 0.7);
106
+ }
107
+ .dialog-form__textbox {
108
+ padding-top: 1rem;
109
+ }
110
+ .dialog-actions {
111
+ display: flex;
112
+ justify-content: flex-end;
113
+ padding: 8px 15px 8px 20px;
114
+ }
115
+ .material-icons {
116
+ font-family: 'Material Icons';
117
+ font-weight: normal;
118
+ font-style: normal;
119
+ font-size: 24px;
120
+ line-height: 1;
121
+ letter-spacing: normal;
122
+ text-transform: none;
123
+ display: inline-block;
124
+ white-space: nowrap;
125
+ word-wrap: normal;
126
+ direction: ltr;
127
+ }
128
+ .material-icons.delete {
129
+ color: #6d758c;
130
+ }
131
+ .material-icons.info {
132
+ color: orange;
133
+ font-size: 48px;
134
+ }
135
+ .material-icons.check_circle {
136
+ color: green;
137
+ }
138
+ .material-icons.mail {
139
+ color: #ff9800;
140
+ }
141
+ .material-icons.warning {
142
+ color: #db0028;
143
+ }
144
+ .material-icons.do_not_disturb_on {
145
+ color: #6d758c;
146
+ }
147
+ ix-dialog {
148
+ --md-dialog-container-color: #fff;
149
+ }
150
+ .grid-container {
151
+ background-color: #ffffff;
152
+ border-radius: 12px;
153
+ box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,
154
+ #e1e4e8 0px 0px 0px 1px inset;
155
+ box-sizing: border-box;
156
+ padding: 3px;
157
+ }
158
+ .grid-header {
159
+ display: flex;
160
+ -webkit-box-pack: justify;
161
+ place-content: center space-between;
162
+ -webkit-box-align: center;
163
+ align-items: center;
164
+ padding: 0px 11px 0px 24px;
165
+ flex-wrap: wrap;
166
+ gap: 18px;
167
+ height: 64px;
168
+ }
169
+ .grid-header h2 {
170
+ margin: 0px;
171
+ font-style: normal;
172
+ font-weight: bold;
173
+ font-size: 20px;
174
+ line-height: 24px;
175
+ letter-spacing: 0.15px;
176
+ color: #092241;
177
+ overflow: hidden;
178
+ text-overflow: ellipsis;
179
+ white-space: nowrap;
180
+ font-family: 'Red Hat Display', sans-serif;
181
+ }
182
+ .grid-menu {
183
+ display: flex;
184
+ gap: 0.5rem;
185
+ }
186
+ .grid-menu span {
187
+ color: #1456e0;
188
+ cursor: pointer;
189
+ }
190
+ .grid-empty-content {
191
+ height: 73vh;
192
+ justify-content: center;
193
+ align-items: flex-start;
194
+ padding-top: 54px;
195
+ }
196
+ .grid-empty-content h2 {
197
+ font-weight: 900;
198
+ font-size: 22px;
199
+ font-family: 'Red Hat Display', sans-serif;
200
+ color: black;
201
+ }
202
+
203
+ .header {
204
+ font-weight: bold;
205
+ display: flex;
206
+ user-select: none;
207
+ align-items: center;
208
+ }
209
+ .header .header-sort-icon {
210
+ padding-left: 5px;
211
+ opacity: 0;
212
+ font-size: 17px;
213
+ color: rgba(0, 0, 0, 0.54);
214
+ cursor: pointer;
215
+ height: 18px;
216
+ }
217
+ .header:hover .header-sort-icon {
218
+ opacity: 1;
219
+ }
220
+ .loading {
221
+ opacity: 0.25;
222
+ }
223
+
224
+ span .disabled {
225
+ color: rgba(9, 34, 65, 0.7);
226
+ }
227
+
228
+ .disable-cursor {
229
+ cursor: default !important;
230
+ }
231
+
232
+ .accounts {
233
+ display: flex;
234
+ align-items: center;
235
+ }
236
+ .account-name {
237
+ margin: 0 8px 0 3px;
238
+ }
239
+
240
+ ix-icon-button {
241
+ --md-icon-button-icon-color: rgb(20, 86, 224);
242
+ --md-icon-button-icon-size: 28px;
243
+ }
244
+
245
+ .header ix-icon-button {
246
+ padding-left: 5px;
247
+ opacity: 0;
248
+ cursor: pointer;
249
+ height: 18px;
250
+ --md-icon-button-icon-color: rgba(0, 0, 0, 0.54);
251
+ --md-icon-button-icon-size: 18px;
252
+ }
253
+
254
+ vaadin-grid-cell-content {
255
+ font-family: 'Red Hat Display', sans-serif;
256
+ font-size: 14px;
257
+ --_cell-padding: 1rem;
258
+ }
259
+
260
+ .row-limit {
261
+ display: flex;
262
+ padding: 8px;
263
+ }
264
+ `;
265
+ //# sourceMappingURL=grid-view-styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-view-styles.js","sourceRoot":"","sources":["../src/grid-view-styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsQlC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const IxGridViewStyles = css`\n @font-face {\n font-family: 'Material Icons';\n font-style: normal;\n font-weight: 400;\n src: url(https://fonts.gstatic.com/s/materialicons/v140/flUhRq6tzZclQEJ-Vdg-IuiaDsNZ.ttf)\n format('truetype');\n }\n .material-icons {\n font-family: 'Material Icons';\n font-weight: normal;\n font-style: normal;\n font-size: 24px;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n }\n ix-dialog {\n --md-dialog-container-color: #fff;\n }\n ix-textbox {\n --md-sys-color-on-surface-variant: #b8bfc8;\n }\n ix-button {\n --md-outlined-button-outline-color: var(--md-sys-color-primary);\n --md-outlined-select-text-field-outline-color: #ddd;\n }\n ix-button .button-label {\n text-transform: uppercase;\n font-weight: bold;\n letter-spacing: 1.25px;\n }\n .btn_primary {\n --md-filled-button-container-color: var(--md-sys-color-primary);\n }\n .btn_primary ix-icon {\n color: var(--md-sys-color-on-primary);\n }\n .btn_secondary {\n --md-filled-button-container-color: var(--md-sys-color-secondary);\n }\n .btn_secondary ix-icon {\n color: var(--md-sys-color-on-secondary);\n }\n .btn_tertiary {\n --md-filled-button-container-color: var(--md-sys-color-tertiary);\n }\n .btn_tertiary ix-icon {\n color: var(--md-sys-color-on-tertiary);\n }\n .btn_danger {\n --md-filled-button-container-color: var(--md-sys-color-error);\n }\n .btn_danger ix-icon {\n color: var(--md-sys-color-on-error);\n }\n .icon-btn_primary ix-icon {\n color: var(--md-sys-color-primary);\n }\n .icon-btn_secondary ix-icon {\n color: var(--md-sys-color-secondary);\n }\n .icon-btn_tertiary ix-icon {\n color: var(--md-sys-color-tertiary);\n }\n .icon-btn_danger ix-icon {\n color: var(--md-sys-color-error);\n }\n .dialog__headline {\n margin: 0px;\n font-family: 'Red Hat Display', sans-serif;\n font-style: normal;\n font-weight: bold;\n font-size: 20px;\n line-height: 24px;\n letter-spacing: 0.15px;\n padding: 24px;\n }\n .dialog-form {\n min-width: 500px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n padding: 8px 24px 20px;\n }\n .dialog-form .textfield {\n width: 100%;\n }\n .dialog-form.sm {\n min-width: 560px;\n }\n .dialog-form__info {\n margin: 0px;\n font-family: 'Open Sans', sans-serif;\n font-style: normal;\n font-weight: 400;\n font-size: 16px;\n line-height: 28px;\n letter-spacing: 0.44px;\n color: rgba(9, 34, 65, 0.7);\n }\n .dialog-form__textbox {\n padding-top: 1rem;\n }\n .dialog-actions {\n display: flex;\n justify-content: flex-end;\n padding: 8px 15px 8px 20px;\n }\n .material-icons {\n font-family: 'Material Icons';\n font-weight: normal;\n font-style: normal;\n font-size: 24px;\n line-height: 1;\n letter-spacing: normal;\n text-transform: none;\n display: inline-block;\n white-space: nowrap;\n word-wrap: normal;\n direction: ltr;\n }\n .material-icons.delete {\n color: #6d758c;\n }\n .material-icons.info {\n color: orange;\n font-size: 48px;\n }\n .material-icons.check_circle {\n color: green;\n }\n .material-icons.mail {\n color: #ff9800;\n }\n .material-icons.warning {\n color: #db0028;\n }\n .material-icons.do_not_disturb_on {\n color: #6d758c;\n }\n ix-dialog {\n --md-dialog-container-color: #fff;\n }\n .grid-container {\n background-color: #ffffff;\n border-radius: 12px;\n box-shadow: rgba(0, 0, 0, 0.12) 0px 12px 20px -12px,\n #e1e4e8 0px 0px 0px 1px inset;\n box-sizing: border-box;\n padding: 3px;\n }\n .grid-header {\n display: flex;\n -webkit-box-pack: justify;\n place-content: center space-between;\n -webkit-box-align: center;\n align-items: center;\n padding: 0px 11px 0px 24px;\n flex-wrap: wrap;\n gap: 18px;\n height: 64px;\n }\n .grid-header h2 {\n margin: 0px;\n font-style: normal;\n font-weight: bold;\n font-size: 20px;\n line-height: 24px;\n letter-spacing: 0.15px;\n color: #092241;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-family: 'Red Hat Display', sans-serif;\n }\n .grid-menu {\n display: flex;\n gap: 0.5rem;\n }\n .grid-menu span {\n color: #1456e0;\n cursor: pointer;\n }\n .grid-empty-content {\n height: 73vh;\n justify-content: center;\n align-items: flex-start;\n padding-top: 54px;\n }\n .grid-empty-content h2 {\n font-weight: 900;\n font-size: 22px;\n font-family: 'Red Hat Display', sans-serif;\n color: black;\n }\n\n .header {\n font-weight: bold;\n display: flex;\n user-select: none;\n align-items: center;\n }\n .header .header-sort-icon {\n padding-left: 5px;\n opacity: 0;\n font-size: 17px;\n color: rgba(0, 0, 0, 0.54);\n cursor: pointer;\n height: 18px;\n }\n .header:hover .header-sort-icon {\n opacity: 1;\n }\n .loading {\n opacity: 0.25;\n }\n\n span .disabled {\n color: rgba(9, 34, 65, 0.7);\n }\n\n .disable-cursor {\n cursor: default !important;\n }\n\n .accounts {\n display: flex;\n align-items: center;\n }\n .account-name {\n margin: 0 8px 0 3px;\n }\n\n ix-icon-button {\n --md-icon-button-icon-color: rgb(20, 86, 224);\n --md-icon-button-icon-size: 28px;\n }\n\n .header ix-icon-button {\n padding-left: 5px;\n opacity: 0;\n cursor: pointer;\n height: 18px;\n --md-icon-button-icon-color: rgba(0, 0, 0, 0.54);\n --md-icon-button-icon-size: 18px;\n }\n\n vaadin-grid-cell-content {\n font-family: 'Red Hat Display', sans-serif;\n font-size: 14px;\n --_cell-padding: 1rem;\n }\n\n .row-limit {\n display: flex;\n padding: 8px;\n }\n`;\n"]}
@@ -0,0 +1 @@
1
+ export { IxGrid } from './IxGrid.js';
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { IxGrid } from './IxGrid.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC","sourcesContent":["export { IxGrid } from './IxGrid.js';\n"]}
@@ -0,0 +1,10 @@
1
+ export declare const copy: {
2
+ activeFilter: string;
3
+ filters: string;
4
+ hideFilters: string;
5
+ showFilters: string;
6
+ rowsPerPage: string;
7
+ user: string;
8
+ viewMore: string;
9
+ viewLess: string;
10
+ };
@@ -0,0 +1,11 @@
1
+ export const copy = {
2
+ activeFilter: 'active filter',
3
+ filters: 'Filters',
4
+ hideFilters: 'Hide Filters',
5
+ showFilters: 'Show Filters',
6
+ rowsPerPage: 'Rows per page',
7
+ user: 'user',
8
+ viewMore: 'VIEW MORE',
9
+ viewLess: 'VIEW LESS',
10
+ };
11
+ //# sourceMappingURL=ix-grid-copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-grid-copy.js","sourceRoot":"","sources":["../src/ix-grid-copy.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,YAAY,EAAE,eAAe;IAC7B,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,eAAe;IAC5B,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,QAAQ,EAAE,WAAW;CACtB,CAAC","sourcesContent":["export const copy = {\n activeFilter: 'active filter',\n filters: 'Filters',\n hideFilters: 'Hide Filters',\n showFilters: 'Show Filters',\n rowsPerPage: 'Rows per page',\n user: 'user',\n viewMore: 'VIEW MORE',\n viewLess: 'VIEW LESS',\n};\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import { IxGrid } from './IxGrid.js';
2
+ window.customElements.define('ix-grid', IxGrid);
3
+ //# sourceMappingURL=ix-grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-grid.js","sourceRoot":"","sources":["../src/ix-grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC","sourcesContent":["import { IxGrid } from './IxGrid.js';\n\nwindow.customElements.define('ix-grid', IxGrid);\n"]}
@@ -0,0 +1 @@
1
+ import '../components/IxGridColumnFilter.js';
@@ -0,0 +1,36 @@
1
+ import { html } from 'lit';
2
+ import { fixture, expect, elementUpdated } from '@open-wc/testing';
3
+ import '../components/IxGridColumnFilter.js';
4
+ const columns = [
5
+ {
6
+ name: 'firstName',
7
+ header: 'First name',
8
+ hidden: false,
9
+ },
10
+ {
11
+ name: 'lastName',
12
+ header: 'Last name',
13
+ hidden: true,
14
+ },
15
+ {
16
+ name: 'middleName',
17
+ header: 'Middle name',
18
+ hidden: false,
19
+ },
20
+ ];
21
+ describe('IxGridColumnFilter', () => {
22
+ it('renders the grid column filter component', async () => {
23
+ const el = await fixture(html `<ix-grid-column-filter></ix-grid-column-filter>`);
24
+ expect(el).to.not.be.null;
25
+ });
26
+ it('renders the grid column filters list', async () => {
27
+ var _a, _b;
28
+ const el = await fixture(html `<ix-grid-column-filter .columns=${columns}></ix-grid-column-filter>`);
29
+ const list = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.list');
30
+ list.click();
31
+ await elementUpdated(el);
32
+ const options = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelectorAll('ix-switch');
33
+ expect(options === null || options === void 0 ? void 0 : options.length).to.equal(3);
34
+ });
35
+ });
36
+ //# sourceMappingURL=ix-grid-column-filter.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-grid-column-filter.test.js","sourceRoot":"","sources":["../../src/test/ix-grid-column-filter.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,qCAAqC,CAAC;AAE7C,MAAM,OAAO,GAAG;IACd;QACE,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,WAAW;QACnB,MAAM,EAAE,IAAI;KACb;IACD;QACE,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,KAAK;KACd;CACF,CAAC;AAEF,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,0CAA0C,EAAE,KAAK,IAAI,EAAE;QACxD,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA,iDAAiD,CACtD,CAAC;QAEF,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sCAAsC,EAAE,KAAK,IAAI,EAAE;;QACpD,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA,mCAAmC,OAAO,2BAA2B,CAC1E,CAAC;QAEF,MAAM,IAAI,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAAC,OAAO,CAAqB,CAAC;QAEvE,IAAI,CAAC,KAAK,EAAE,CAAC;QAEb,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,OAAO,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAE7D,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { fixture, expect, elementUpdated } from '@open-wc/testing';\nimport '../components/IxGridColumnFilter.js';\n\nconst columns = [\n {\n name: 'firstName',\n header: 'First name',\n hidden: false,\n },\n {\n name: 'lastName',\n header: 'Last name',\n hidden: true,\n },\n {\n name: 'middleName',\n header: 'Middle name',\n hidden: false,\n },\n];\n\ndescribe('IxGridColumnFilter', () => {\n it('renders the grid column filter component', async () => {\n const el = await fixture(\n html`<ix-grid-column-filter></ix-grid-column-filter>`\n );\n\n expect(el).to.not.be.null;\n });\n\n it('renders the grid column filters list', async () => {\n const el = await fixture(\n html`<ix-grid-column-filter .columns=${columns}></ix-grid-column-filter>`\n );\n\n const list = el.shadowRoot?.querySelector('.list') as HTMLInputElement;\n\n list.click();\n\n await elementUpdated(el);\n\n const options = el.shadowRoot?.querySelectorAll('ix-switch');\n\n expect(options?.length).to.equal(3);\n });\n});\n"]}
@@ -0,0 +1 @@
1
+ import '../components/IxGridRowFilter.js';
@@ -0,0 +1,37 @@
1
+ import { html } from 'lit';
2
+ import { fixture, expect, elementUpdated } from '@open-wc/testing';
3
+ import '../components/IxGridRowFilter.js';
4
+ const columns = [
5
+ {
6
+ name: 'firstName',
7
+ header: 'First name',
8
+ filterable: true,
9
+ },
10
+ {
11
+ name: 'lastName',
12
+ header: 'Last name',
13
+ filterable: true,
14
+ },
15
+ {
16
+ name: 'middleName',
17
+ header: 'Middle name',
18
+ filterable: false,
19
+ },
20
+ {
21
+ name: 'email',
22
+ header: 'Email',
23
+ filterable: true,
24
+ },
25
+ ];
26
+ describe('IxGridRowFilter', () => {
27
+ it('renders and popluates the grid row filter', async () => {
28
+ var _a, _b;
29
+ const el = await fixture(html `<ix-grid-row-filter .columns=${columns}></ix-grid-row-filter>`);
30
+ const openMenu = (_a = el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.filter-button');
31
+ openMenu.click();
32
+ await elementUpdated(el);
33
+ const options = (_b = el.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelectorAll('select[data-v="firstName"] option');
34
+ expect(options === null || options === void 0 ? void 0 : options.length).to.equal(3);
35
+ });
36
+ });
37
+ //# sourceMappingURL=ix-grid-row-filter.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-grid-row-filter.test.js","sourceRoot":"","sources":["../../src/test/ix-grid-row-filter.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,kCAAkC,CAAC;AAE1C,MAAM,OAAO,GAAG;IACd;QACE,IAAI,EAAE,WAAW;QACjB,MAAM,EAAE,YAAY;QACpB,UAAU,EAAE,IAAI;KACjB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,MAAM,EAAE,WAAW;QACnB,UAAU,EAAE,IAAI;KACjB;IACD;QACE,IAAI,EAAE,YAAY;QAClB,MAAM,EAAE,aAAa;QACrB,UAAU,EAAE,KAAK;KAClB;IACD;QACE,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,OAAO;QACf,UAAU,EAAE,IAAI;KACjB;CACF,CAAC;AAEF,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC/B,EAAE,CAAC,2CAA2C,EAAE,KAAK,IAAI,EAAE;;QACzD,MAAM,EAAE,GAAG,MAAM,OAAO,CACtB,IAAI,CAAA,gCAAgC,OAAO,wBAAwB,CACpE,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,aAAa,CAC3C,gBAAgB,CACG,CAAC;QAEtB,QAAQ,CAAC,KAAK,EAAE,CAAC;QAEjB,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC;QAEzB,MAAM,OAAO,GAAG,MAAA,EAAE,CAAC,UAAU,0CAAE,gBAAgB,CAC7C,mCAAmC,CACpC,CAAC;QAEF,MAAM,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { fixture, expect, elementUpdated } from '@open-wc/testing';\nimport '../components/IxGridRowFilter.js';\n\nconst columns = [\n {\n name: 'firstName',\n header: 'First name',\n filterable: true,\n },\n {\n name: 'lastName',\n header: 'Last name',\n filterable: true,\n },\n {\n name: 'middleName',\n header: 'Middle name',\n filterable: false,\n },\n {\n name: 'email',\n header: 'Email',\n filterable: true,\n },\n];\n\ndescribe('IxGridRowFilter', () => {\n it('renders and popluates the grid row filter', async () => {\n const el = await fixture(\n html`<ix-grid-row-filter .columns=${columns}></ix-grid-row-filter>`\n );\n\n const openMenu = el.shadowRoot?.querySelector(\n '.filter-button'\n ) as HTMLInputElement;\n\n openMenu.click();\n\n await elementUpdated(el);\n\n const options = el.shadowRoot?.querySelectorAll(\n 'select[data-v=\"firstName\"] option'\n );\n\n expect(options?.length).to.equal(3);\n });\n});\n"]}
@@ -0,0 +1 @@
1
+ import '../ix-grid.js';
@@ -0,0 +1,43 @@
1
+ import { html } from 'lit';
2
+ import { fixture, expect } from '@open-wc/testing';
3
+ import '../ix-grid.js';
4
+ const rows = [
5
+ {
6
+ name: 'one',
7
+ },
8
+ {
9
+ name: 'two',
10
+ },
11
+ {
12
+ name: 'three',
13
+ },
14
+ ];
15
+ const columns = [
16
+ {
17
+ name: 'one',
18
+ header: 'one',
19
+ },
20
+ {
21
+ name: 'two',
22
+ header: 'one',
23
+ },
24
+ {
25
+ name: 'three',
26
+ header: 'one',
27
+ },
28
+ ];
29
+ describe('IxGrid', () => {
30
+ it('renders a grid', async () => {
31
+ const el = await fixture(html `<ix-grid></ix-grid>`);
32
+ expect(el).to.not.be.null;
33
+ });
34
+ it('renders the correct number of rows', async () => {
35
+ const el = await fixture(html `<ix-grid
36
+ columns=${columns}
37
+ rows=${rows}
38
+ ></ix-grid>`);
39
+ expect(rows.length).to.equal(3);
40
+ expect(el).to.not.be.null;
41
+ });
42
+ });
43
+ //# sourceMappingURL=ix-grid.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-grid.test.js","sourceRoot":"","sources":["../../src/test/ix-grid.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,eAAe,CAAC;AAEvB,MAAM,IAAI,GAAG;IACX;QACE,IAAI,EAAE,KAAK;KACZ;IACD;QACE,IAAI,EAAE,KAAK;KACZ;IACD;QACE,IAAI,EAAE,OAAO;KACd;CACF,CAAC;AAEF,MAAM,OAAO,GAAG;IACd;QACE,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,KAAK;KACd;IACD;QACE,IAAI,EAAE,OAAO;QACb,MAAM,EAAE,KAAK;KACd;CACF,CAAC;AAEF,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;IACtB,EAAE,CAAC,gBAAgB,EAAE,KAAK,IAAI,EAAE;QAC9B,MAAM,EAAE,GAAG,MAAM,OAAO,CAAS,IAAI,CAAA,qBAAqB,CAAC,CAAC;QAE5D,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAS,IAAI,CAAA;gBACzB,OAAO;aACV,IAAI;gBACD,CAAC,CAAC;QAEd,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAEhC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { fixture, expect } from '@open-wc/testing';\nimport { IxGrid } from '../IxGrid.js';\nimport '../ix-grid.js';\n\nconst rows = [\n {\n name: 'one',\n },\n {\n name: 'two',\n },\n {\n name: 'three',\n },\n];\n\nconst columns = [\n {\n name: 'one',\n header: 'one',\n },\n {\n name: 'two',\n header: 'one',\n },\n {\n name: 'three',\n header: 'one',\n },\n];\n\ndescribe('IxGrid', () => {\n it('renders a grid', async () => {\n const el = await fixture<IxGrid>(html`<ix-grid></ix-grid>`);\n\n expect(el).to.not.be.null;\n });\n\n it('renders the correct number of rows', async () => {\n const el = await fixture<IxGrid>(html`<ix-grid\n columns=${columns}\n rows=${rows}\n ></ix-grid>`);\n\n expect(rows.length).to.equal(3);\n\n expect(el).to.not.be.null;\n });\n});\n"]}
@@ -0,0 +1 @@
1
+ import '../components/IxPagination.js';
@@ -0,0 +1,28 @@
1
+ import { html } from 'lit';
2
+ import { fixture, expect } from '@open-wc/testing';
3
+ import '../components/IxPagination.js';
4
+ describe('IxPagination', () => {
5
+ it('renders pagination', async () => {
6
+ const el = await fixture(html `<ix-pagination></ix-pagination>`);
7
+ expect(el).to.not.be.null;
8
+ });
9
+ it('renders pagination page size select', async () => {
10
+ var _a;
11
+ const el = await fixture(html `<ix-pagination
12
+ .pageSizes=${[1, 2, 3]}
13
+ ></ix-pagination>`);
14
+ const pageSizeSelect = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('ix-select-option');
15
+ expect(pageSizeSelect === null || pageSizeSelect === void 0 ? void 0 : pageSizeSelect.length).to.equal(3);
16
+ });
17
+ it('renders pagination range info', async () => {
18
+ var _a;
19
+ const el = await fixture(html `<ix-pagination
20
+ pageSize="10"
21
+ page="2"
22
+ recordCount="99"
23
+ ></ix-pagination>`);
24
+ const pageRangeInfo = (_a = el === null || el === void 0 ? void 0 : el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('p')[1];
25
+ expect(pageRangeInfo === null || pageRangeInfo === void 0 ? void 0 : pageRangeInfo.innerText).to.equal('11 - 20 of 99');
26
+ });
27
+ });
28
+ //# sourceMappingURL=ix-pagination.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-pagination.test.js","sourceRoot":"","sources":["../../src/test/ix-pagination.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,+BAA+B,CAAC;AAEvC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,oBAAoB,EAAE,KAAK,IAAI,EAAE;QAClC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA,iCAAiC,CAAC,CAAC;QAEhE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qCAAqC,EAAE,KAAK,IAAI,EAAE;;QACnD,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA;mBACd,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;sBACN,CAAC,CAAC;QAEpB,MAAM,cAAc,GAAG,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,UAAU,0CAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAC;QAE5E,MAAM,CAAC,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,MAAM,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+BAA+B,EAAE,KAAK,IAAI,EAAE;;QAC7C,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA;;;;sBAIX,CAAC,CAAC;QAEpB,MAAM,aAAa,GAAG,MAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,UAAU,0CAAE,gBAAgB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QAE/D,MAAM,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,SAAS,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { html } from 'lit';\nimport { fixture, expect } from '@open-wc/testing';\nimport '../components/IxPagination.js';\n\ndescribe('IxPagination', () => {\n it('renders pagination', async () => {\n const el = await fixture(html`<ix-pagination></ix-pagination>`);\n\n expect(el).to.not.be.null;\n });\n\n it('renders pagination page size select', async () => {\n const el = await fixture(html`<ix-pagination\n .pageSizes=${[1, 2, 3]}\n ></ix-pagination>`);\n\n const pageSizeSelect = el?.shadowRoot?.querySelectorAll('ix-select-option');\n\n expect(pageSizeSelect?.length).to.equal(3);\n });\n\n it('renders pagination range info', async () => {\n const el = await fixture(html`<ix-pagination\n pageSize=\"10\"\n page=\"2\"\n recordCount=\"99\"\n ></ix-pagination>`);\n\n const pageRangeInfo = el?.shadowRoot?.querySelectorAll('p')[1];\n\n expect(pageRangeInfo?.innerText).to.equal('11 - 20 of 99');\n });\n});\n"]}
package/package.json ADDED
@@ -0,0 +1,95 @@
1
+ {
2
+ "name": "@digital-realty/ix-grid",
3
+ "description": "Webcomponent ix-grid following open-wc recommendations",
4
+ "license": "MIT",
5
+ "author": "Digital Realty",
6
+ "version": "1.0.6",
7
+ "type": "module",
8
+ "main": "dist/src/index.js",
9
+ "module": "dist/src/index.js",
10
+ "exports": {
11
+ ".": "./dist/src/index.js",
12
+ "./ix-grid.js": "./dist/src/ix-grid.js"
13
+ },
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "scripts": {
18
+ "analyze": "cem analyze --litelement",
19
+ "start": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wds\"",
20
+ "build": "tsc && npm run analyze -- --exclude dist",
21
+ "prepublish": "tsc && npm run analyze -- --exclude dist",
22
+ "lint": "eslint --ext .ts,.html . --ignore-path .gitignore && prettier \"**/*.ts\" --check --ignore-path .gitignore",
23
+ "format": "eslint --ext .ts,.html . --fix --ignore-path .gitignore && prettier \"**/*.ts\" --write --ignore-path .gitignore",
24
+ "test": "tsc && wtr --coverage",
25
+ "test:watch": "tsc && concurrently -k -r \"tsc --watch --preserveWatchOutput\" \"wtr --watch\""
26
+ },
27
+ "dependencies": {
28
+ "@digital-realty/ix-icon": "*",
29
+ "@digital-realty/ix-icon-button": "^1.0.19",
30
+ "@digital-realty/ix-select": "*",
31
+ "@digital-realty/ix-switch": "*",
32
+ "@vaadin/grid": "^24.3.2",
33
+ "lit": "^2.0.2"
34
+ },
35
+ "devDependencies": {
36
+ "@custom-elements-manifest/analyzer": "^0.4.17",
37
+ "@digital-realty/theme": "*",
38
+ "@open-wc/eslint-config": "^9.2.1",
39
+ "@open-wc/testing": "^3.1.6",
40
+ "@typescript-eslint/eslint-plugin": "^5.48.0",
41
+ "@typescript-eslint/parser": "^5.48.0",
42
+ "@web/dev-server": "^0.1.34",
43
+ "@web/test-runner": "^0.14.0",
44
+ "concurrently": "^5.3.0",
45
+ "eslint": "^8.31.0",
46
+ "eslint-config-prettier": "^8.3.0",
47
+ "husky": "^4.3.8",
48
+ "lint-staged": "^10.5.4",
49
+ "prettier": "^2.4.1",
50
+ "tslib": "^2.3.1",
51
+ "typescript": "^4.5.2"
52
+ },
53
+ "customElements": "custom-elements.json",
54
+ "eslintConfig": {
55
+ "parser": "@typescript-eslint/parser",
56
+ "extends": [
57
+ "@open-wc",
58
+ "prettier"
59
+ ],
60
+ "plugins": [
61
+ "@typescript-eslint"
62
+ ],
63
+ "rules": {
64
+ "no-unused-vars": "off",
65
+ "wc/guard-super-call": "off",
66
+ "@typescript-eslint/no-unused-vars": [
67
+ "error"
68
+ ],
69
+ "import/no-unresolved": "off",
70
+ "import/extensions": [
71
+ "error",
72
+ "always",
73
+ {
74
+ "ignorePackages": true
75
+ }
76
+ ]
77
+ }
78
+ },
79
+ "prettier": {
80
+ "singleQuote": true,
81
+ "arrowParens": "avoid"
82
+ },
83
+ "husky": {
84
+ "hooks": {
85
+ "pre-commit": "lint-staged"
86
+ }
87
+ },
88
+ "lint-staged": {
89
+ "*.ts": [
90
+ "eslint --fix",
91
+ "prettier --write"
92
+ ]
93
+ },
94
+ "gitHead": "b9d0668d204a87407a723acbae1f4fd46c7e90b1"
95
+ }