@vonage/vivid 3.47.0 → 3.49.0-preview.0

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 (216) hide show
  1. package/README.md +3 -403
  2. package/accordion/index.cjs +21 -0
  3. package/accordion-item/index.cjs +18 -0
  4. package/action-group/index.cjs +7 -0
  5. package/alert/index.cjs +30 -0
  6. package/alert/index.js +0 -1
  7. package/appearance-ui/index.cjs +96 -0
  8. package/audio-player/index.cjs +34 -0
  9. package/audio-player/index.js +0 -1
  10. package/avatar/index.cjs +11 -0
  11. package/badge/index.cjs +14 -0
  12. package/banner/index.cjs +29 -0
  13. package/banner/index.js +0 -1
  14. package/breadcrumb/index.cjs +13 -0
  15. package/breadcrumb-item/index.cjs +22 -0
  16. package/button/index.cjs +25 -0
  17. package/button/index.js +0 -1
  18. package/calendar/index.cjs +9 -0
  19. package/calendar-event/index.cjs +9 -0
  20. package/card/index.cjs +14 -0
  21. package/checkbox/index.cjs +21 -0
  22. package/combobox/index.cjs +39 -0
  23. package/combobox/index.js +1 -1
  24. package/custom-elements.json +30 -35
  25. package/data-grid/index.cjs +18 -0
  26. package/date-picker/index.cjs +40 -0
  27. package/date-picker/index.js +1 -1
  28. package/date-range-picker/index.cjs +40 -0
  29. package/date-range-picker/index.js +1 -1
  30. package/dialog/index.cjs +31 -0
  31. package/dialog/index.js +1 -1
  32. package/divider/index.cjs +8 -0
  33. package/elevation/index.cjs +7 -0
  34. package/empty-state/index.cjs +12 -0
  35. package/fab/index.cjs +22 -0
  36. package/file-picker/index.cjs +30 -0
  37. package/file-picker/index.js +1 -1
  38. package/focus/index.cjs +7 -0
  39. package/header/index.cjs +8 -0
  40. package/icon/index.cjs +10 -0
  41. package/index.cjs +296 -0
  42. package/index.js +1 -1
  43. package/layout/index.cjs +7 -0
  44. package/lib/menu-item/menu-item.d.ts +1 -0
  45. package/lib/tabs/tabs.d.ts +1 -0
  46. package/listbox/index.cjs +77 -0
  47. package/locales/en-GB.cjs +106 -0
  48. package/locales/en-US.cjs +106 -0
  49. package/locales/ja-JP.cjs +106 -0
  50. package/locales/zh-CN.cjs +106 -0
  51. package/menu/index.cjs +32 -0
  52. package/menu/index.js +0 -1
  53. package/menu-item/index.cjs +22 -0
  54. package/menu-item/index.js +0 -1
  55. package/nav/index.cjs +6 -0
  56. package/nav-disclosure/index.cjs +17 -0
  57. package/nav-disclosure/index.js +0 -1
  58. package/nav-item/index.cjs +22 -0
  59. package/note/index.cjs +16 -0
  60. package/number-field/index.cjs +33 -0
  61. package/number-field/index.js +1 -1
  62. package/option/index.cjs +23 -0
  63. package/package.json +20 -2
  64. package/pagination/index.cjs +28 -0
  65. package/pagination/index.js +0 -1
  66. package/popup/index.cjs +27 -0
  67. package/popup/index.js +0 -1
  68. package/progress/index.cjs +9 -0
  69. package/progress-ring/index.cjs +9 -0
  70. package/radio/index.cjs +14 -0
  71. package/radio-group/index.cjs +14 -0
  72. package/select/index.cjs +38 -0
  73. package/select/index.js +1 -1
  74. package/selectable-box/index.cjs +25 -0
  75. package/shared/Reflector.cjs +67 -0
  76. package/shared/_has.cjs +62 -0
  77. package/shared/affix.cjs +64 -0
  78. package/shared/affix.js +8 -4
  79. package/shared/anchor.cjs +90 -0
  80. package/shared/anchored.cjs +78 -0
  81. package/shared/apply-mixins.cjs +25 -0
  82. package/shared/aria-global.cjs +74 -0
  83. package/shared/aria.cjs +11 -0
  84. package/shared/aria2.cjs +11 -0
  85. package/shared/base-progress.cjs +72 -0
  86. package/shared/breadcrumb-item.cjs +27 -0
  87. package/shared/button.cjs +202 -0
  88. package/shared/calendar-event.cjs +41 -0
  89. package/shared/children.cjs +61 -0
  90. package/shared/class-names.cjs +17 -0
  91. package/shared/definition.cjs +165 -0
  92. package/shared/definition10.cjs +102 -0
  93. package/shared/definition11.cjs +164 -0
  94. package/shared/definition11.js +39 -42
  95. package/shared/definition12.cjs +50 -0
  96. package/shared/definition13.cjs +779 -0
  97. package/shared/definition14.cjs +157 -0
  98. package/shared/definition15.cjs +249 -0
  99. package/shared/definition16.cjs +746 -0
  100. package/shared/definition17.cjs +1372 -0
  101. package/shared/definition18.cjs +175 -0
  102. package/shared/definition19.cjs +416 -0
  103. package/shared/definition2.cjs +232 -0
  104. package/shared/definition20.cjs +278 -0
  105. package/shared/definition21.cjs +83 -0
  106. package/shared/definition22.cjs +74 -0
  107. package/shared/definition23.cjs +106 -0
  108. package/shared/definition24.cjs +2392 -0
  109. package/shared/definition25.cjs +75 -0
  110. package/shared/definition26.cjs +39 -0
  111. package/shared/definition27.cjs +66 -0
  112. package/shared/definition28.cjs +849 -0
  113. package/shared/definition28.js +5 -4
  114. package/shared/definition29.cjs +72 -0
  115. package/shared/definition29.js +1 -1
  116. package/shared/definition3.cjs +72 -0
  117. package/shared/definition30.cjs +98 -0
  118. package/shared/definition30.js +1 -4
  119. package/shared/definition31.cjs +37 -0
  120. package/shared/definition32.cjs +24 -0
  121. package/shared/definition33.cjs +64 -0
  122. package/shared/definition34.cjs +533 -0
  123. package/shared/definition35.cjs +295 -0
  124. package/shared/definition36.cjs +219 -0
  125. package/shared/definition37.cjs +109 -0
  126. package/shared/definition38.cjs +92 -0
  127. package/shared/definition39.cjs +448 -0
  128. package/shared/definition4.cjs +198 -0
  129. package/shared/definition40.cjs +49 -0
  130. package/shared/definition41.cjs +694 -0
  131. package/shared/definition41.js +1 -6
  132. package/shared/definition42.cjs +152 -0
  133. package/shared/definition43.cjs +113 -0
  134. package/shared/definition44.cjs +607 -0
  135. package/shared/definition45.cjs +152 -0
  136. package/shared/definition45.js +1 -6
  137. package/shared/definition46.cjs +166 -0
  138. package/shared/definition46.js +2 -7
  139. package/shared/definition47.cjs +35 -0
  140. package/shared/definition48.cjs +98 -0
  141. package/shared/definition49.cjs +543 -0
  142. package/shared/definition49.js +12 -3
  143. package/shared/definition5.cjs +199 -0
  144. package/shared/definition50.cjs +52 -0
  145. package/shared/definition51.cjs +150 -0
  146. package/shared/definition52.cjs +304 -0
  147. package/shared/definition53.cjs +309 -0
  148. package/shared/definition54.cjs +146 -0
  149. package/shared/definition55.cjs +128 -0
  150. package/shared/definition56.cjs +99 -0
  151. package/shared/definition57.cjs +310 -0
  152. package/shared/definition58.cjs +20 -0
  153. package/shared/definition59.cjs +51 -0
  154. package/shared/definition6.cjs +83 -0
  155. package/shared/definition60.cjs +1810 -0
  156. package/shared/definition7.cjs +72 -0
  157. package/shared/definition8.cjs +152 -0
  158. package/shared/definition9.cjs +69 -0
  159. package/shared/dialog-polyfill.esm.cjs +862 -0
  160. package/shared/direction.cjs +22 -0
  161. package/shared/dom.cjs +23 -0
  162. package/shared/enums.cjs +87 -0
  163. package/shared/focus.cjs +8 -0
  164. package/shared/focus2.cjs +11 -0
  165. package/shared/form-associated.cjs +470 -0
  166. package/shared/icon.cjs +237 -0
  167. package/shared/index.cjs +5061 -0
  168. package/shared/index2.cjs +231 -0
  169. package/shared/key-codes.cjs +115 -0
  170. package/shared/key-codes2.cjs +14 -0
  171. package/shared/listbox.cjs +1072 -0
  172. package/shared/localized.cjs +11 -0
  173. package/shared/numbers.cjs +38 -0
  174. package/shared/patterns/affix.d.ts +5 -1
  175. package/shared/presentationDate.cjs +6192 -0
  176. package/shared/presentationDate.js +1 -6
  177. package/shared/radio.cjs +153 -0
  178. package/shared/ref.cjs +43 -0
  179. package/shared/repeat.cjs +767 -0
  180. package/shared/select.options.cjs +12 -0
  181. package/shared/slotted.cjs +123 -0
  182. package/shared/start-end.cjs +52 -0
  183. package/shared/strings.cjs +11 -0
  184. package/shared/text-anchor.cjs +33 -0
  185. package/shared/text-anchor.template.cjs +48 -0
  186. package/shared/text-field.cjs +5 -0
  187. package/shared/text-field2.cjs +228 -0
  188. package/shared/tree-item.cjs +154 -0
  189. package/shared/when.cjs +31 -0
  190. package/side-drawer/index.cjs +8 -0
  191. package/slider/index.cjs +16 -0
  192. package/split-button/index.cjs +20 -0
  193. package/split-button/index.js +0 -1
  194. package/style.css +1 -1
  195. package/styles/core/all.css +1 -1
  196. package/styles/core/theme.css +1 -1
  197. package/styles/core/typography.css +1 -1
  198. package/styles/tokens/theme-dark.css +4 -4
  199. package/styles/tokens/theme-light.css +4 -4
  200. package/styles/tokens/vivid-2-compat.css +1 -1
  201. package/switch/index.cjs +15 -0
  202. package/switch/index.js +0 -5
  203. package/tab/index.cjs +17 -0
  204. package/tab-panel/index.cjs +6 -0
  205. package/tabs/index.cjs +24 -0
  206. package/tag/index.cjs +17 -0
  207. package/tag-group/index.cjs +7 -0
  208. package/text-anchor/index.cjs +24 -0
  209. package/text-area/index.cjs +25 -0
  210. package/text-field/index.cjs +27 -0
  211. package/toggletip/index.cjs +29 -0
  212. package/toggletip/index.js +0 -1
  213. package/tooltip/index.cjs +29 -0
  214. package/tooltip/index.js +0 -1
  215. package/tree-item/index.cjs +22 -0
  216. package/tree-view/index.cjs +14 -0
@@ -0,0 +1,1372 @@
1
+ 'use strict';
2
+
3
+ const definition = require('./definition26.cjs');
4
+ const index = require('./index.cjs');
5
+ const keyCodes = require('./key-codes.cjs');
6
+ const repeat = require('./repeat.cjs');
7
+ const slotted = require('./slotted.cjs');
8
+ const children = require('./children.cjs');
9
+ const icon = require('./icon.cjs');
10
+ const focus = require('./focus2.cjs');
11
+ const keyCodes$1 = require('./key-codes2.cjs');
12
+ const when = require('./when.cjs');
13
+
14
+ /**
15
+ * This set of exported strings reference https://developer.mozilla.org/en-US/docs/Web/Events
16
+ * and should include all non-deprecated and non-experimental Standard events
17
+ */
18
+ const eventFocus = "focus";
19
+ const eventFocusIn = "focusin";
20
+ const eventFocusOut = "focusout";
21
+ const eventKeyDown = "keydown";
22
+
23
+ /**
24
+ * Enumerates the data grid auto generated header options
25
+ * default option generates a non-sticky header row
26
+ *
27
+ * @public
28
+ */
29
+ const GenerateHeaderOptions$1 = {
30
+ none: "none",
31
+ default: "default",
32
+ sticky: "sticky",
33
+ };
34
+ /**
35
+ * Enumerates possible data grid cell types.
36
+ *
37
+ * @public
38
+ */
39
+ const DataGridCellTypes = {
40
+ default: "default",
41
+ columnHeader: "columnheader",
42
+ rowHeader: "rowheader",
43
+ };
44
+ /**
45
+ * Enumerates possible data grid row types
46
+ *
47
+ * @public
48
+ */
49
+ const DataGridRowTypes$1 = {
50
+ default: "default",
51
+ header: "header",
52
+ stickyHeader: "sticky-header",
53
+ };
54
+
55
+ /**
56
+ * A Data Grid Row Custom HTML Element.
57
+ *
58
+ * @fires row-focused - Fires a custom 'row-focused' event when focus is on an element (usually a cell or its contents) in the row
59
+ * @slot - The default slot for custom cell elements
60
+ * @public
61
+ */
62
+ let DataGridRow$1 = class DataGridRow extends index.FoundationElement {
63
+ constructor() {
64
+ super(...arguments);
65
+ /**
66
+ * The type of row
67
+ *
68
+ * @public
69
+ * @remarks
70
+ * HTML Attribute: row-type
71
+ */
72
+ this.rowType = DataGridRowTypes$1.default;
73
+ /**
74
+ * The base data for this row
75
+ *
76
+ * @public
77
+ */
78
+ this.rowData = null;
79
+ /**
80
+ * The column definitions of the row
81
+ *
82
+ * @public
83
+ */
84
+ this.columnDefinitions = null;
85
+ /**
86
+ * Whether focus is on/in a cell within this row.
87
+ *
88
+ * @internal
89
+ */
90
+ this.isActiveRow = false;
91
+ this.cellsRepeatBehavior = null;
92
+ this.cellsPlaceholder = null;
93
+ /**
94
+ * @internal
95
+ */
96
+ this.focusColumnIndex = 0;
97
+ this.refocusOnLoad = false;
98
+ this.updateRowStyle = () => {
99
+ this.style.gridTemplateColumns = this.gridTemplateColumns;
100
+ };
101
+ }
102
+ gridTemplateColumnsChanged() {
103
+ if (this.$fastController.isConnected) {
104
+ this.updateRowStyle();
105
+ }
106
+ }
107
+ rowTypeChanged() {
108
+ if (this.$fastController.isConnected) {
109
+ this.updateItemTemplate();
110
+ }
111
+ }
112
+ rowDataChanged() {
113
+ if (this.rowData !== null && this.isActiveRow) {
114
+ this.refocusOnLoad = true;
115
+ return;
116
+ }
117
+ }
118
+ cellItemTemplateChanged() {
119
+ this.updateItemTemplate();
120
+ }
121
+ headerCellItemTemplateChanged() {
122
+ this.updateItemTemplate();
123
+ }
124
+ /**
125
+ * @internal
126
+ */
127
+ connectedCallback() {
128
+ super.connectedCallback();
129
+ // note that row elements can be reused with a different data object
130
+ // as the parent grid's repeat behavior reacts to changes in the data set.
131
+ if (this.cellsRepeatBehavior === null) {
132
+ this.cellsPlaceholder = document.createComment("");
133
+ this.appendChild(this.cellsPlaceholder);
134
+ this.updateItemTemplate();
135
+ this.cellsRepeatBehavior = new repeat.RepeatDirective(x => x.columnDefinitions, x => x.activeCellItemTemplate, { positioning: true }).createBehavior(this.cellsPlaceholder);
136
+ /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
137
+ this.$fastController.addBehaviors([this.cellsRepeatBehavior]);
138
+ }
139
+ this.addEventListener("cell-focused", this.handleCellFocus);
140
+ this.addEventListener(eventFocusOut, this.handleFocusout);
141
+ this.addEventListener(eventKeyDown, this.handleKeydown);
142
+ this.updateRowStyle();
143
+ if (this.refocusOnLoad) {
144
+ // if focus was on the row when data changed try to refocus on same cell
145
+ this.refocusOnLoad = false;
146
+ if (this.cellElements.length > this.focusColumnIndex) {
147
+ this.cellElements[this.focusColumnIndex].focus();
148
+ }
149
+ }
150
+ }
151
+ /**
152
+ * @internal
153
+ */
154
+ disconnectedCallback() {
155
+ super.disconnectedCallback();
156
+ this.removeEventListener("cell-focused", this.handleCellFocus);
157
+ this.removeEventListener(eventFocusOut, this.handleFocusout);
158
+ this.removeEventListener(eventKeyDown, this.handleKeydown);
159
+ }
160
+ handleFocusout(e) {
161
+ if (!this.contains(e.target)) {
162
+ this.isActiveRow = false;
163
+ this.focusColumnIndex = 0;
164
+ }
165
+ }
166
+ handleCellFocus(e) {
167
+ this.isActiveRow = true;
168
+ this.focusColumnIndex = this.cellElements.indexOf(e.target);
169
+ this.$emit("row-focused", this);
170
+ }
171
+ handleKeydown(e) {
172
+ if (e.defaultPrevented) {
173
+ return;
174
+ }
175
+ let newFocusColumnIndex = 0;
176
+ switch (e.key) {
177
+ case keyCodes.keyArrowLeft:
178
+ // focus left one cell
179
+ newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1);
180
+ this.cellElements[newFocusColumnIndex].focus();
181
+ e.preventDefault();
182
+ break;
183
+ case keyCodes.keyArrowRight:
184
+ // focus right one cell
185
+ newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1);
186
+ this.cellElements[newFocusColumnIndex].focus();
187
+ e.preventDefault();
188
+ break;
189
+ case keyCodes.keyHome:
190
+ if (!e.ctrlKey) {
191
+ this.cellElements[0].focus();
192
+ e.preventDefault();
193
+ }
194
+ break;
195
+ case keyCodes.keyEnd:
196
+ if (!e.ctrlKey) {
197
+ // focus last cell of the row
198
+ this.cellElements[this.cellElements.length - 1].focus();
199
+ e.preventDefault();
200
+ }
201
+ break;
202
+ }
203
+ }
204
+ updateItemTemplate() {
205
+ this.activeCellItemTemplate =
206
+ this.rowType === DataGridRowTypes$1.default &&
207
+ this.cellItemTemplate !== undefined
208
+ ? this.cellItemTemplate
209
+ : this.rowType === DataGridRowTypes$1.default &&
210
+ this.cellItemTemplate === undefined
211
+ ? this.defaultCellItemTemplate
212
+ : this.headerCellItemTemplate !== undefined
213
+ ? this.headerCellItemTemplate
214
+ : this.defaultHeaderCellItemTemplate;
215
+ }
216
+ };
217
+ index.__decorate([
218
+ index.attr({ attribute: "grid-template-columns" })
219
+ ], DataGridRow$1.prototype, "gridTemplateColumns", void 0);
220
+ index.__decorate([
221
+ index.attr({ attribute: "row-type" })
222
+ ], DataGridRow$1.prototype, "rowType", void 0);
223
+ index.__decorate([
224
+ index.observable
225
+ ], DataGridRow$1.prototype, "rowData", void 0);
226
+ index.__decorate([
227
+ index.observable
228
+ ], DataGridRow$1.prototype, "columnDefinitions", void 0);
229
+ index.__decorate([
230
+ index.observable
231
+ ], DataGridRow$1.prototype, "cellItemTemplate", void 0);
232
+ index.__decorate([
233
+ index.observable
234
+ ], DataGridRow$1.prototype, "headerCellItemTemplate", void 0);
235
+ index.__decorate([
236
+ index.observable
237
+ ], DataGridRow$1.prototype, "rowIndex", void 0);
238
+ index.__decorate([
239
+ index.observable
240
+ ], DataGridRow$1.prototype, "isActiveRow", void 0);
241
+ index.__decorate([
242
+ index.observable
243
+ ], DataGridRow$1.prototype, "activeCellItemTemplate", void 0);
244
+ index.__decorate([
245
+ index.observable
246
+ ], DataGridRow$1.prototype, "defaultCellItemTemplate", void 0);
247
+ index.__decorate([
248
+ index.observable
249
+ ], DataGridRow$1.prototype, "defaultHeaderCellItemTemplate", void 0);
250
+ index.__decorate([
251
+ index.observable
252
+ ], DataGridRow$1.prototype, "cellElements", void 0);
253
+
254
+ /**
255
+ * A Data Grid Custom HTML Element.
256
+ *
257
+ * @slot - The default slot for custom row elements
258
+ * @public
259
+ */
260
+ let DataGrid$1 = class DataGrid extends index.FoundationElement {
261
+ constructor() {
262
+ super();
263
+ /**
264
+ * When true the component will not add itself to the tab queue.
265
+ * Default is false.
266
+ *
267
+ * @public
268
+ * @remarks
269
+ * HTML Attribute: no-tabbing
270
+ */
271
+ this.noTabbing = false;
272
+ /**
273
+ * Whether the grid should automatically generate a header row and its type
274
+ *
275
+ * @public
276
+ * @remarks
277
+ * HTML Attribute: generate-header
278
+ */
279
+ this.generateHeader = GenerateHeaderOptions$1.default;
280
+ /**
281
+ * The data being displayed in the grid
282
+ *
283
+ * @public
284
+ */
285
+ this.rowsData = [];
286
+ /**
287
+ * The column definitions of the grid
288
+ *
289
+ * @public
290
+ */
291
+ this.columnDefinitions = null;
292
+ /**
293
+ * The index of the row that will receive focus the next time the
294
+ * grid is focused. This value changes as focus moves to different
295
+ * rows within the grid. Changing this value when focus is already
296
+ * within the grid moves focus to the specified row.
297
+ *
298
+ * @public
299
+ */
300
+ this.focusRowIndex = 0;
301
+ /**
302
+ * The index of the column that will receive focus the next time the
303
+ * grid is focused. This value changes as focus moves to different rows
304
+ * within the grid. Changing this value when focus is already within
305
+ * the grid moves focus to the specified column.
306
+ *
307
+ * @public
308
+ */
309
+ this.focusColumnIndex = 0;
310
+ this.rowsPlaceholder = null;
311
+ this.generatedHeader = null;
312
+ this.isUpdatingFocus = false;
313
+ this.pendingFocusUpdate = false;
314
+ this.rowindexUpdateQueued = false;
315
+ this.columnDefinitionsStale = true;
316
+ this.generatedGridTemplateColumns = "";
317
+ this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => {
318
+ if (this.rowElements.length === 0) {
319
+ this.focusRowIndex = 0;
320
+ this.focusColumnIndex = 0;
321
+ return;
322
+ }
323
+ const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex));
324
+ const focusRow = this.rowElements[focusRowIndex];
325
+ const cells = focusRow.querySelectorAll('[role="cell"], [role="gridcell"], [role="columnheader"], [role="rowheader"]');
326
+ const focusColumnIndex = Math.max(0, Math.min(cells.length - 1, columnIndex));
327
+ const focusTarget = cells[focusColumnIndex];
328
+ if (scrollIntoView &&
329
+ this.scrollHeight !== this.clientHeight &&
330
+ ((focusRowIndex < this.focusRowIndex && this.scrollTop > 0) ||
331
+ (focusRowIndex > this.focusRowIndex &&
332
+ this.scrollTop < this.scrollHeight - this.clientHeight))) {
333
+ focusTarget.scrollIntoView({ block: "center", inline: "center" });
334
+ }
335
+ focusTarget.focus();
336
+ };
337
+ this.onChildListChange = (mutations,
338
+ /* eslint-disable-next-line @typescript-eslint/no-unused-vars */
339
+ observer) => {
340
+ if (mutations && mutations.length) {
341
+ mutations.forEach((mutation) => {
342
+ mutation.addedNodes.forEach((newNode) => {
343
+ if (newNode.nodeType === 1 &&
344
+ newNode.getAttribute("role") === "row") {
345
+ newNode.columnDefinitions = this.columnDefinitions;
346
+ }
347
+ });
348
+ });
349
+ this.queueRowIndexUpdate();
350
+ }
351
+ };
352
+ this.queueRowIndexUpdate = () => {
353
+ if (!this.rowindexUpdateQueued) {
354
+ this.rowindexUpdateQueued = true;
355
+ index.DOM.queueUpdate(this.updateRowIndexes);
356
+ }
357
+ };
358
+ this.updateRowIndexes = () => {
359
+ let newGridTemplateColumns = this.gridTemplateColumns;
360
+ if (newGridTemplateColumns === undefined) {
361
+ // try to generate columns based on manual rows
362
+ if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) {
363
+ const firstRow = this.rowElements[0];
364
+ this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length)
365
+ .fill("1fr")
366
+ .join(" ");
367
+ }
368
+ newGridTemplateColumns = this.generatedGridTemplateColumns;
369
+ }
370
+ this.rowElements.forEach((element, index) => {
371
+ const thisRow = element;
372
+ thisRow.rowIndex = index;
373
+ thisRow.gridTemplateColumns = newGridTemplateColumns;
374
+ if (this.columnDefinitionsStale) {
375
+ thisRow.columnDefinitions = this.columnDefinitions;
376
+ }
377
+ });
378
+ this.rowindexUpdateQueued = false;
379
+ this.columnDefinitionsStale = false;
380
+ };
381
+ }
382
+ /**
383
+ * generates a gridTemplateColumns based on columndata array
384
+ */
385
+ static generateTemplateColumns(columnDefinitions) {
386
+ let templateColumns = "";
387
+ columnDefinitions.forEach((column) => {
388
+ templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}${"1fr"}`;
389
+ });
390
+ return templateColumns;
391
+ }
392
+ noTabbingChanged() {
393
+ if (this.$fastController.isConnected) {
394
+ if (this.noTabbing) {
395
+ this.setAttribute("tabIndex", "-1");
396
+ }
397
+ else {
398
+ this.setAttribute("tabIndex", this.contains(document.activeElement) ||
399
+ this === document.activeElement
400
+ ? "-1"
401
+ : "0");
402
+ }
403
+ }
404
+ }
405
+ generateHeaderChanged() {
406
+ if (this.$fastController.isConnected) {
407
+ this.toggleGeneratedHeader();
408
+ }
409
+ }
410
+ gridTemplateColumnsChanged() {
411
+ if (this.$fastController.isConnected) {
412
+ this.updateRowIndexes();
413
+ }
414
+ }
415
+ rowsDataChanged() {
416
+ if (this.columnDefinitions === null && this.rowsData.length > 0) {
417
+ this.columnDefinitions = DataGrid.generateColumns(this.rowsData[0]);
418
+ }
419
+ if (this.$fastController.isConnected) {
420
+ this.toggleGeneratedHeader();
421
+ }
422
+ }
423
+ columnDefinitionsChanged() {
424
+ if (this.columnDefinitions === null) {
425
+ this.generatedGridTemplateColumns = "";
426
+ return;
427
+ }
428
+ this.generatedGridTemplateColumns = DataGrid.generateTemplateColumns(this.columnDefinitions);
429
+ if (this.$fastController.isConnected) {
430
+ this.columnDefinitionsStale = true;
431
+ this.queueRowIndexUpdate();
432
+ }
433
+ }
434
+ headerCellItemTemplateChanged() {
435
+ if (this.$fastController.isConnected) {
436
+ if (this.generatedHeader !== null) {
437
+ this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate;
438
+ }
439
+ }
440
+ }
441
+ focusRowIndexChanged() {
442
+ if (this.$fastController.isConnected) {
443
+ this.queueFocusUpdate();
444
+ }
445
+ }
446
+ focusColumnIndexChanged() {
447
+ if (this.$fastController.isConnected) {
448
+ this.queueFocusUpdate();
449
+ }
450
+ }
451
+ /**
452
+ * @internal
453
+ */
454
+ connectedCallback() {
455
+ super.connectedCallback();
456
+ if (this.rowItemTemplate === undefined) {
457
+ this.rowItemTemplate = this.defaultRowItemTemplate;
458
+ }
459
+ this.rowsPlaceholder = document.createComment("");
460
+ this.appendChild(this.rowsPlaceholder);
461
+ this.toggleGeneratedHeader();
462
+ this.rowsRepeatBehavior = new repeat.RepeatDirective(x => x.rowsData, x => x.rowItemTemplate, { positioning: true }).createBehavior(this.rowsPlaceholder);
463
+ /* eslint-disable-next-line @typescript-eslint/no-non-null-assertion */
464
+ this.$fastController.addBehaviors([this.rowsRepeatBehavior]);
465
+ this.addEventListener("row-focused", this.handleRowFocus);
466
+ this.addEventListener(eventFocus, this.handleFocus);
467
+ this.addEventListener(eventKeyDown, this.handleKeydown);
468
+ this.addEventListener(eventFocusOut, this.handleFocusOut);
469
+ this.observer = new MutationObserver(this.onChildListChange);
470
+ // only observe if nodes are added or removed
471
+ this.observer.observe(this, { childList: true });
472
+ if (this.noTabbing) {
473
+ this.setAttribute("tabindex", "-1");
474
+ }
475
+ index.DOM.queueUpdate(this.queueRowIndexUpdate);
476
+ }
477
+ /**
478
+ * @internal
479
+ */
480
+ disconnectedCallback() {
481
+ super.disconnectedCallback();
482
+ this.removeEventListener("row-focused", this.handleRowFocus);
483
+ this.removeEventListener(eventFocus, this.handleFocus);
484
+ this.removeEventListener(eventKeyDown, this.handleKeydown);
485
+ this.removeEventListener(eventFocusOut, this.handleFocusOut);
486
+ // disconnect observer
487
+ this.observer.disconnect();
488
+ this.rowsPlaceholder = null;
489
+ this.generatedHeader = null;
490
+ }
491
+ /**
492
+ * @internal
493
+ */
494
+ handleRowFocus(e) {
495
+ this.isUpdatingFocus = true;
496
+ const focusRow = e.target;
497
+ this.focusRowIndex = this.rowElements.indexOf(focusRow);
498
+ this.focusColumnIndex = focusRow.focusColumnIndex;
499
+ this.setAttribute("tabIndex", "-1");
500
+ this.isUpdatingFocus = false;
501
+ }
502
+ /**
503
+ * @internal
504
+ */
505
+ handleFocus(e) {
506
+ this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);
507
+ }
508
+ /**
509
+ * @internal
510
+ */
511
+ handleFocusOut(e) {
512
+ if (e.relatedTarget === null || !this.contains(e.relatedTarget)) {
513
+ this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0");
514
+ }
515
+ }
516
+ /**
517
+ * @internal
518
+ */
519
+ handleKeydown(e) {
520
+ if (e.defaultPrevented) {
521
+ return;
522
+ }
523
+ let newFocusRowIndex;
524
+ const maxIndex = this.rowElements.length - 1;
525
+ const currentGridBottom = this.offsetHeight + this.scrollTop;
526
+ const lastRow = this.rowElements[maxIndex];
527
+ switch (e.key) {
528
+ case keyCodes.keyArrowUp:
529
+ e.preventDefault();
530
+ // focus up one row
531
+ this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true);
532
+ break;
533
+ case keyCodes.keyArrowDown:
534
+ e.preventDefault();
535
+ // focus down one row
536
+ this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true);
537
+ break;
538
+ case keyCodes.keyPageUp:
539
+ e.preventDefault();
540
+ if (this.rowElements.length === 0) {
541
+ this.focusOnCell(0, 0, false);
542
+ break;
543
+ }
544
+ if (this.focusRowIndex === 0) {
545
+ this.focusOnCell(0, this.focusColumnIndex, false);
546
+ return;
547
+ }
548
+ newFocusRowIndex = this.focusRowIndex - 1;
549
+ for (newFocusRowIndex; newFocusRowIndex >= 0; newFocusRowIndex--) {
550
+ const thisRow = this.rowElements[newFocusRowIndex];
551
+ if (thisRow.offsetTop < this.scrollTop) {
552
+ this.scrollTop =
553
+ thisRow.offsetTop + thisRow.clientHeight - this.clientHeight;
554
+ break;
555
+ }
556
+ }
557
+ this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);
558
+ break;
559
+ case keyCodes.keyPageDown:
560
+ e.preventDefault();
561
+ if (this.rowElements.length === 0) {
562
+ this.focusOnCell(0, 0, false);
563
+ break;
564
+ }
565
+ // focus down one "page"
566
+ if (this.focusRowIndex >= maxIndex ||
567
+ lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) {
568
+ this.focusOnCell(maxIndex, this.focusColumnIndex, false);
569
+ return;
570
+ }
571
+ newFocusRowIndex = this.focusRowIndex + 1;
572
+ for (newFocusRowIndex; newFocusRowIndex <= maxIndex; newFocusRowIndex++) {
573
+ const thisRow = this.rowElements[newFocusRowIndex];
574
+ if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) {
575
+ let stickyHeaderOffset = 0;
576
+ if (this.generateHeader === GenerateHeaderOptions$1.sticky &&
577
+ this.generatedHeader !== null) {
578
+ stickyHeaderOffset = this.generatedHeader.clientHeight;
579
+ }
580
+ this.scrollTop = thisRow.offsetTop - stickyHeaderOffset;
581
+ break;
582
+ }
583
+ }
584
+ this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);
585
+ break;
586
+ case keyCodes.keyHome:
587
+ if (e.ctrlKey) {
588
+ e.preventDefault();
589
+ // focus first cell of first row
590
+ this.focusOnCell(0, 0, true);
591
+ }
592
+ break;
593
+ case keyCodes.keyEnd:
594
+ if (e.ctrlKey && this.columnDefinitions !== null) {
595
+ e.preventDefault();
596
+ // focus last cell of last row
597
+ this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true);
598
+ }
599
+ break;
600
+ }
601
+ }
602
+ queueFocusUpdate() {
603
+ if (this.isUpdatingFocus &&
604
+ (this.contains(document.activeElement) || this === document.activeElement)) {
605
+ return;
606
+ }
607
+ if (this.pendingFocusUpdate === false) {
608
+ this.pendingFocusUpdate = true;
609
+ index.DOM.queueUpdate(() => this.updateFocus());
610
+ }
611
+ }
612
+ updateFocus() {
613
+ this.pendingFocusUpdate = false;
614
+ this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);
615
+ }
616
+ toggleGeneratedHeader() {
617
+ if (this.generatedHeader !== null) {
618
+ this.removeChild(this.generatedHeader);
619
+ this.generatedHeader = null;
620
+ }
621
+ if (this.generateHeader !== GenerateHeaderOptions$1.none &&
622
+ this.rowsData.length > 0) {
623
+ const generatedHeaderElement = document.createElement(this.rowElementTag);
624
+ this.generatedHeader = generatedHeaderElement;
625
+ this.generatedHeader.columnDefinitions = this.columnDefinitions;
626
+ this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns;
627
+ this.generatedHeader.rowType =
628
+ this.generateHeader === GenerateHeaderOptions$1.sticky
629
+ ? DataGridRowTypes$1.stickyHeader
630
+ : DataGridRowTypes$1.header;
631
+ if (this.firstChild !== null || this.rowsPlaceholder !== null) {
632
+ this.insertBefore(generatedHeaderElement, this.firstChild !== null ? this.firstChild : this.rowsPlaceholder);
633
+ }
634
+ return;
635
+ }
636
+ }
637
+ };
638
+ /**
639
+ * generates a basic column definition by examining sample row data
640
+ */
641
+ DataGrid$1.generateColumns = (row) => {
642
+ return Object.getOwnPropertyNames(row).map((property, index) => {
643
+ return {
644
+ columnDataKey: property,
645
+ gridColumn: `${index}`,
646
+ };
647
+ });
648
+ };
649
+ index.__decorate([
650
+ index.attr({ attribute: "no-tabbing", mode: "boolean" })
651
+ ], DataGrid$1.prototype, "noTabbing", void 0);
652
+ index.__decorate([
653
+ index.attr({ attribute: "generate-header" })
654
+ ], DataGrid$1.prototype, "generateHeader", void 0);
655
+ index.__decorate([
656
+ index.attr({ attribute: "grid-template-columns" })
657
+ ], DataGrid$1.prototype, "gridTemplateColumns", void 0);
658
+ index.__decorate([
659
+ index.observable
660
+ ], DataGrid$1.prototype, "rowsData", void 0);
661
+ index.__decorate([
662
+ index.observable
663
+ ], DataGrid$1.prototype, "columnDefinitions", void 0);
664
+ index.__decorate([
665
+ index.observable
666
+ ], DataGrid$1.prototype, "rowItemTemplate", void 0);
667
+ index.__decorate([
668
+ index.observable
669
+ ], DataGrid$1.prototype, "cellItemTemplate", void 0);
670
+ index.__decorate([
671
+ index.observable
672
+ ], DataGrid$1.prototype, "headerCellItemTemplate", void 0);
673
+ index.__decorate([
674
+ index.observable
675
+ ], DataGrid$1.prototype, "focusRowIndex", void 0);
676
+ index.__decorate([
677
+ index.observable
678
+ ], DataGrid$1.prototype, "focusColumnIndex", void 0);
679
+ index.__decorate([
680
+ index.observable
681
+ ], DataGrid$1.prototype, "defaultRowItemTemplate", void 0);
682
+ index.__decorate([
683
+ index.observable
684
+ ], DataGrid$1.prototype, "rowElementTag", void 0);
685
+ index.__decorate([
686
+ index.observable
687
+ ], DataGrid$1.prototype, "rowElements", void 0);
688
+
689
+ const defaultCellContentsTemplate = index.html `
690
+ <template>
691
+ ${x => x.rowData === null ||
692
+ x.columnDefinition === null ||
693
+ x.columnDefinition.columnDataKey === null
694
+ ? null
695
+ : x.rowData[x.columnDefinition.columnDataKey]}
696
+ </template>
697
+ `;
698
+ const defaultHeaderCellContentsTemplate = index.html `
699
+ <template>
700
+ ${x => x.columnDefinition === null
701
+ ? null
702
+ : x.columnDefinition.title === undefined
703
+ ? x.columnDefinition.columnDataKey
704
+ : x.columnDefinition.title}
705
+ </template>
706
+ `;
707
+ /**
708
+ * A Data Grid Cell Custom HTML Element.
709
+ *
710
+ * @fires cell-focused - Fires a custom 'cell-focused' event when focus is on the cell or its contents
711
+ * @slot - The default slot for cell contents. The "cell contents template" renders here.
712
+ * @public
713
+ */
714
+ let DataGridCell$1 = class DataGridCell extends index.FoundationElement {
715
+ constructor() {
716
+ super(...arguments);
717
+ /**
718
+ * The type of cell
719
+ *
720
+ * @public
721
+ * @remarks
722
+ * HTML Attribute: cell-type
723
+ */
724
+ this.cellType = DataGridCellTypes.default;
725
+ /**
726
+ * The base data for the parent row
727
+ *
728
+ * @public
729
+ */
730
+ this.rowData = null;
731
+ /**
732
+ * The base data for the column
733
+ *
734
+ * @public
735
+ */
736
+ this.columnDefinition = null;
737
+ this.isActiveCell = false;
738
+ this.customCellView = null;
739
+ this.updateCellStyle = () => {
740
+ this.style.gridColumn = this.gridColumn;
741
+ };
742
+ }
743
+ cellTypeChanged() {
744
+ if (this.$fastController.isConnected) {
745
+ this.updateCellView();
746
+ }
747
+ }
748
+ gridColumnChanged() {
749
+ if (this.$fastController.isConnected) {
750
+ this.updateCellStyle();
751
+ }
752
+ }
753
+ columnDefinitionChanged(oldValue, newValue) {
754
+ if (this.$fastController.isConnected) {
755
+ this.updateCellView();
756
+ }
757
+ }
758
+ /**
759
+ * @internal
760
+ */
761
+ connectedCallback() {
762
+ var _a;
763
+ super.connectedCallback();
764
+ this.addEventListener(eventFocusIn, this.handleFocusin);
765
+ this.addEventListener(eventFocusOut, this.handleFocusout);
766
+ this.addEventListener(eventKeyDown, this.handleKeydown);
767
+ this.style.gridColumn = `${((_a = this.columnDefinition) === null || _a === void 0 ? void 0 : _a.gridColumn) === undefined
768
+ ? 0
769
+ : this.columnDefinition.gridColumn}`;
770
+ this.updateCellView();
771
+ this.updateCellStyle();
772
+ }
773
+ /**
774
+ * @internal
775
+ */
776
+ disconnectedCallback() {
777
+ super.disconnectedCallback();
778
+ this.removeEventListener(eventFocusIn, this.handleFocusin);
779
+ this.removeEventListener(eventFocusOut, this.handleFocusout);
780
+ this.removeEventListener(eventKeyDown, this.handleKeydown);
781
+ this.disconnectCellView();
782
+ }
783
+ handleFocusin(e) {
784
+ if (this.isActiveCell) {
785
+ return;
786
+ }
787
+ this.isActiveCell = true;
788
+ switch (this.cellType) {
789
+ case DataGridCellTypes.columnHeader:
790
+ if (this.columnDefinition !== null &&
791
+ this.columnDefinition.headerCellInternalFocusQueue !== true &&
792
+ typeof this.columnDefinition.headerCellFocusTargetCallback ===
793
+ "function") {
794
+ // move focus to the focus target
795
+ const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);
796
+ if (focusTarget !== null) {
797
+ focusTarget.focus();
798
+ }
799
+ }
800
+ break;
801
+ default:
802
+ if (this.columnDefinition !== null &&
803
+ this.columnDefinition.cellInternalFocusQueue !== true &&
804
+ typeof this.columnDefinition.cellFocusTargetCallback === "function") {
805
+ // move focus to the focus target
806
+ const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);
807
+ if (focusTarget !== null) {
808
+ focusTarget.focus();
809
+ }
810
+ }
811
+ break;
812
+ }
813
+ this.$emit("cell-focused", this);
814
+ }
815
+ handleFocusout(e) {
816
+ if (this !== document.activeElement && !this.contains(document.activeElement)) {
817
+ this.isActiveCell = false;
818
+ }
819
+ }
820
+ handleKeydown(e) {
821
+ if (e.defaultPrevented ||
822
+ this.columnDefinition === null ||
823
+ (this.cellType === DataGridCellTypes.default &&
824
+ this.columnDefinition.cellInternalFocusQueue !== true) ||
825
+ (this.cellType === DataGridCellTypes.columnHeader &&
826
+ this.columnDefinition.headerCellInternalFocusQueue !== true)) {
827
+ return;
828
+ }
829
+ switch (e.key) {
830
+ case keyCodes.keyEnter:
831
+ case keyCodes.keyFunction2:
832
+ if (this.contains(document.activeElement) &&
833
+ document.activeElement !== this) {
834
+ return;
835
+ }
836
+ switch (this.cellType) {
837
+ case DataGridCellTypes.columnHeader:
838
+ if (this.columnDefinition.headerCellFocusTargetCallback !==
839
+ undefined) {
840
+ const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);
841
+ if (focusTarget !== null) {
842
+ focusTarget.focus();
843
+ }
844
+ e.preventDefault();
845
+ }
846
+ break;
847
+ default:
848
+ if (this.columnDefinition.cellFocusTargetCallback !== undefined) {
849
+ const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);
850
+ if (focusTarget !== null) {
851
+ focusTarget.focus();
852
+ }
853
+ e.preventDefault();
854
+ }
855
+ break;
856
+ }
857
+ break;
858
+ case keyCodes.keyEscape:
859
+ if (this.contains(document.activeElement) &&
860
+ document.activeElement !== this) {
861
+ this.focus();
862
+ e.preventDefault();
863
+ }
864
+ break;
865
+ }
866
+ }
867
+ updateCellView() {
868
+ this.disconnectCellView();
869
+ if (this.columnDefinition === null) {
870
+ return;
871
+ }
872
+ switch (this.cellType) {
873
+ case DataGridCellTypes.columnHeader:
874
+ if (this.columnDefinition.headerCellTemplate !== undefined) {
875
+ this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this);
876
+ }
877
+ else {
878
+ this.customCellView = defaultHeaderCellContentsTemplate.render(this, this);
879
+ }
880
+ break;
881
+ case undefined:
882
+ case DataGridCellTypes.rowHeader:
883
+ case DataGridCellTypes.default:
884
+ if (this.columnDefinition.cellTemplate !== undefined) {
885
+ this.customCellView = this.columnDefinition.cellTemplate.render(this, this);
886
+ }
887
+ else {
888
+ this.customCellView = defaultCellContentsTemplate.render(this, this);
889
+ }
890
+ break;
891
+ }
892
+ }
893
+ disconnectCellView() {
894
+ if (this.customCellView !== null) {
895
+ this.customCellView.dispose();
896
+ this.customCellView = null;
897
+ }
898
+ }
899
+ };
900
+ index.__decorate([
901
+ index.attr({ attribute: "cell-type" })
902
+ ], DataGridCell$1.prototype, "cellType", void 0);
903
+ index.__decorate([
904
+ index.attr({ attribute: "grid-column" })
905
+ ], DataGridCell$1.prototype, "gridColumn", void 0);
906
+ index.__decorate([
907
+ index.observable
908
+ ], DataGridCell$1.prototype, "rowData", void 0);
909
+ index.__decorate([
910
+ index.observable
911
+ ], DataGridCell$1.prototype, "columnDefinition", void 0);
912
+
913
+ const dataGridStyles = ":host{display:block}:host([generate-header=sticky]){max-block-size:400px}.base{position:relative;overflow:auto;block-size:inherit;inline-size:100%;max-block-size:inherit}\n";
914
+
915
+ const dataGridRowStyles = ".base{display:grid;width:100%;box-sizing:border-box;color:var(--vvd-color-canvas-text)}.base.connotation-cta{--_connotation-color-primary: var(--vvd-data-grid-row-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-data-grid-row-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-row-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-data-grid-row-cta-faint, var(--vvd-color-cta-50));--_connotation-color-pale: var(--vvd-data-grid-row-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-data-grid-row-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-data-grid-row-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-data-grid-row-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-row-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-faint: var(--vvd-data-grid-row-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-pale: var(--vvd-data-grid-row-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-data-grid-row-accent-dim, var(--vvd-color-neutral-200))}.base{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.selected,[aria-current]):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base:where(.selected,[aria-current]):where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-pale);--_appearance-color-outline: transparent}:host([row-type=sticky-header]) .base{position:sticky;z-index:9;top:0;background:var(--data-grid-row-background, var(--vvd-color-canvas))}:host([row-type=hidden-header]) .base{display:none}:host(:is([aria-selected]):not([row-type*=header])) .base{background-color:var(--_appearance-color-fill)}\n";
916
+
917
+ const dataGridCellStyles = ":host{min-inline-size:80px}:host(:focus-visible){outline:none}.base{position:relative;display:flex;box-sizing:border-box;align-items:center;padding:8px 12px;border-bottom:1px solid var(--vvd-color-neutral-300);block-size:calc(1px*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));color:var(--_appearance-color-text);font:var(--vvd-typography-base)}.base.connotation-cta{--_connotation-color-primary: var(--vvd-data-grid-cell-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-data-grid-cell-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-cell-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-data-grid-cell-cta-faint, var(--vvd-color-cta-50));--_connotation-color-pale: var(--vvd-data-grid-cell-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-data-grid-cell-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-data-grid-cell-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-data-grid-cell-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-data-grid-cell-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-faint: var(--vvd-data-grid-cell-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-pale: var(--vvd-data-grid-cell-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-data-grid-cell-accent-dim, var(--vvd-color-neutral-200))}.base{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.selected,[aria-current]):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base:where(.selected,[aria-current]):where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-pale);--_appearance-color-outline: transparent}:host([cell-type=columnheader]) .base{border-color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}:host(:is([aria-selected]):not([cell-type=columnheader])) .base{background-color:var(--_appearance-color-fill)}.focus-indicator{--focus-stroke-gap-color: transparent;pointer-events:none}:host(:not(:focus)) .base>.focus-indicator{display:none}slot{display:block;overflow:hidden;inline-size:100%;text-overflow:ellipsis;white-space:nowrap}.header-icon{margin-inline-start:auto}\n";
918
+
919
+ const DataGridCellSortStates = {
920
+ none: "none",
921
+ ascending: "ascending",
922
+ descending: "descending",
923
+ other: "other"
924
+ };
925
+ const GenerateHeaderOptions = {
926
+ none: "none",
927
+ default: "default",
928
+ sticky: "sticky"
929
+ };
930
+ const DataGridRowTypes = {
931
+ default: "default",
932
+ header: "header",
933
+ stickyHeader: "sticky-header"
934
+ };
935
+ const DataGridCellRole = {
936
+ columnheader: "columnheader",
937
+ rowheader: "rowheader",
938
+ default: "gridcell"
939
+ };
940
+
941
+ var __defProp$2 = Object.defineProperty;
942
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
943
+ var __decorateClass$2 = (decorators, target, key, kind) => {
944
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
945
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
946
+ if (decorator = decorators[i])
947
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
948
+ if (kind && result)
949
+ __defProp$2(target, key, result);
950
+ return result;
951
+ };
952
+ const DataGridSelectionMode = {
953
+ none: "none",
954
+ singleRow: "single-row",
955
+ multiRow: "multi-row",
956
+ singleCell: "single-cell",
957
+ multiCell: "multi-cell"
958
+ };
959
+ class DataGrid extends DataGrid$1 {
960
+ constructor() {
961
+ super();
962
+ this.#handleKeypress = (e) => {
963
+ if (e.key === "Enter" || e.key === " ") {
964
+ this.#handleClick(e);
965
+ }
966
+ };
967
+ this.#handleClick = ({ target, ctrlKey, shiftKey, metaKey }) => {
968
+ if (target.getAttribute("role") !== "gridcell")
969
+ return;
970
+ if (this.selectionMode === DataGridSelectionMode.singleCell || this.selectionMode === DataGridSelectionMode.multiCell) {
971
+ this.#handleCellSelection({ target, ctrlKey, shiftKey, metaKey });
972
+ return;
973
+ }
974
+ if (this.selectionMode === DataGridSelectionMode.singleRow || this.selectionMode === DataGridSelectionMode.multiRow) {
975
+ this.#handleRowSelection({ target, ctrlKey, shiftKey, metaKey });
976
+ }
977
+ };
978
+ this.#handleCellSelection = ({ target, ctrlKey, shiftKey, metaKey }) => {
979
+ const cell = target;
980
+ if (this.selectionMode === DataGridSelectionMode.multiCell && (ctrlKey || shiftKey || metaKey)) {
981
+ this.#setSelectedState(cell, !this.#selectedCells.includes(cell));
982
+ } else {
983
+ const cacheTargetSelection = cell.getAttribute("aria-selected") === "true";
984
+ this.#resetSelection();
985
+ this.#setSelectedState(cell, !cacheTargetSelection);
986
+ }
987
+ };
988
+ this.#handleRowSelection = ({ target, ctrlKey, shiftKey, metaKey }) => {
989
+ const row = target.parentNode;
990
+ if (this.selectionMode === DataGridSelectionMode.multiRow && (ctrlKey || shiftKey || metaKey)) {
991
+ this.#setSelectedState(row, !this.#selectedRows.includes(row));
992
+ } else {
993
+ const cacheTargetSelection = row.getAttribute("aria-selected") === "true";
994
+ this.#resetSelection();
995
+ this.#setSelectedState(row, !cacheTargetSelection);
996
+ }
997
+ };
998
+ this.#changeHandler = {
999
+ handleChange(dataGrid, propertyName) {
1000
+ if (propertyName === "columnDefinitions") {
1001
+ if (dataGrid.$fastController.isConnected) {
1002
+ dataGrid.toggleGeneratedHeader();
1003
+ }
1004
+ }
1005
+ }
1006
+ };
1007
+ this.#setSelectedState = (cell, selectedState) => {
1008
+ cell.setAttribute("aria-selected", selectedState.toString());
1009
+ };
1010
+ this.#resetSelection = () => {
1011
+ if (this.selectionMode === DataGridSelectionMode.singleCell || this.selectionMode === DataGridSelectionMode.multiCell) {
1012
+ Array.from(this.querySelectorAll('[role="gridcell"]')).forEach((cell) => this.#setSelectedState(cell, false));
1013
+ Array.from(this.querySelectorAll('[role="row"]')).forEach((row) => row.removeAttribute("aria-selected"));
1014
+ }
1015
+ if (this.selectionMode === DataGridSelectionMode.none) {
1016
+ Array.from(this.querySelectorAll('[role="gridcell"]')).forEach((cell) => cell.removeAttribute("aria-selected"));
1017
+ Array.from(this.querySelectorAll('[role="row"]')).forEach((row) => row.removeAttribute("aria-selected"));
1018
+ }
1019
+ if (this.selectionMode === DataGridSelectionMode.singleRow || this.selectionMode === DataGridSelectionMode.multiRow) {
1020
+ Array.from(this.querySelectorAll('[role="gridcell"]')).forEach((cell) => cell.removeAttribute("aria-selected"));
1021
+ Array.from(this.querySelectorAll('[role="row"]')).forEach((row) => row.setAttribute("aria-selected", "false"));
1022
+ }
1023
+ };
1024
+ this.#initSelections = () => {
1025
+ if (this.selectionMode === DataGridSelectionMode.singleCell || this.selectionMode === DataGridSelectionMode.multiCell) {
1026
+ Array.from(this.querySelectorAll('[role="gridcell"]')).forEach((cell) => !cell.hasAttribute("aria-selected") && this.#setSelectedState(cell, false));
1027
+ Array.from(this.querySelectorAll('[role="row"]')).forEach((row) => row.removeAttribute("aria-selected"));
1028
+ }
1029
+ if (this.selectionMode === DataGridSelectionMode.none) {
1030
+ Array.from(this.querySelectorAll('[role="gridcell"]')).forEach((cell) => cell.removeAttribute("aria-selected"));
1031
+ Array.from(this.querySelectorAll('[role="row"]')).forEach((row) => row.removeAttribute("aria-selected"));
1032
+ }
1033
+ if (this.selectionMode === DataGridSelectionMode.singleRow || this.selectionMode === DataGridSelectionMode.multiRow) {
1034
+ Array.from(this.querySelectorAll('[role="gridcell"]')).forEach((cell) => cell.removeAttribute("aria-selected"));
1035
+ Array.from(this.querySelectorAll('[role="row"]')).forEach((row) => !row.hasAttribute("aria-selected") && row.setAttribute("aria-selected", "false"));
1036
+ }
1037
+ };
1038
+ this.addEventListener("click", this.#handleClick);
1039
+ this.addEventListener("keydown", this.#handleKeypress);
1040
+ const privates = this;
1041
+ privates.toggleGeneratedHeader = () => {
1042
+ if (privates.generatedHeader !== null) {
1043
+ this.removeChild(privates.generatedHeader);
1044
+ privates.generatedHeader = null;
1045
+ }
1046
+ if (this.generateHeader !== GenerateHeaderOptions.none && this.columnDefinitions !== null) {
1047
+ const generatedHeaderElement = document.createElement(
1048
+ this.rowElementTag
1049
+ );
1050
+ privates.generatedHeader = generatedHeaderElement;
1051
+ privates.generatedHeader.columnDefinitions = this.columnDefinitions;
1052
+ privates.generatedHeader.gridTemplateColumns = this.gridTemplateColumns;
1053
+ privates.generatedHeader.rowType = this.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header;
1054
+ if (this.firstChild !== null || privates.rowsPlaceholder !== null) {
1055
+ this.insertBefore(
1056
+ generatedHeaderElement,
1057
+ this.firstChild !== null ? this.firstChild : privates.rowsPlaceholder
1058
+ );
1059
+ }
1060
+ return;
1061
+ }
1062
+ };
1063
+ }
1064
+ /**
1065
+ *
1066
+ *
1067
+ * @internal
1068
+ */
1069
+ slottedRowElementsChanged(_oldValue, _newValue) {
1070
+ this.#initSelections();
1071
+ }
1072
+ get #selectedRows() {
1073
+ return this.rowElements.filter((row) => row.getAttribute("aria-selected") === "true");
1074
+ }
1075
+ get #selectedCells() {
1076
+ return this.rowElements.reduce((acc, row) => {
1077
+ const rowChildren = Array.from(row.children);
1078
+ const selectedCells = rowChildren.filter((cell) => cell.getAttribute("aria-selected") === "true");
1079
+ return acc.concat(selectedCells);
1080
+ }, []);
1081
+ }
1082
+ selectionModeChanged(oldValue) {
1083
+ if (oldValue === void 0) {
1084
+ index.DOM.queueUpdate(this.#initSelections);
1085
+ return;
1086
+ }
1087
+ this.#resetSelection();
1088
+ }
1089
+ #handleKeypress;
1090
+ #handleClick;
1091
+ #handleCellSelection;
1092
+ #handleRowSelection;
1093
+ #changeHandler;
1094
+ connectedCallback() {
1095
+ super.connectedCallback();
1096
+ index.Observable.getNotifier(this).subscribe(this.#changeHandler, "columnDefinitions");
1097
+ }
1098
+ disconnectedCallback() {
1099
+ super.disconnectedCallback();
1100
+ index.Observable.getNotifier(this).unsubscribe(this.#changeHandler, "columnDefinitions");
1101
+ }
1102
+ #setSelectedState;
1103
+ #resetSelection;
1104
+ #initSelections;
1105
+ static generateColumns(rowData) {
1106
+ return Object.keys(rowData).map((property, index) => {
1107
+ return {
1108
+ columnDataKey: property,
1109
+ gridColumn: `${index}`
1110
+ };
1111
+ });
1112
+ }
1113
+ }
1114
+ __decorateClass$2([
1115
+ index.observable
1116
+ ], DataGrid.prototype, "slottedRowElements", 2);
1117
+ __decorateClass$2([
1118
+ index.attr({ attribute: "selection-mode" })
1119
+ ], DataGrid.prototype, "selectionMode", 2);
1120
+
1121
+ var __defProp$1 = Object.defineProperty;
1122
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
1123
+ var __decorateClass$1 = (decorators, target, key, kind) => {
1124
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
1125
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1126
+ if (decorator = decorators[i])
1127
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1128
+ if (kind && result)
1129
+ __defProp$1(target, key, result);
1130
+ return result;
1131
+ };
1132
+ class DataGridRow extends DataGridRow$1 {
1133
+ constructor() {
1134
+ super(...arguments);
1135
+ this.ariaSelected = null;
1136
+ }
1137
+ }
1138
+ __decorateClass$1([
1139
+ index.attr({ attribute: "aria-selected" })
1140
+ ], DataGridRow.prototype, "ariaSelected", 2);
1141
+
1142
+ function createRowItemTemplate(context) {
1143
+ const rowTag = context.tagFor(DataGridRow);
1144
+ return index.html`
1145
+ <${rowTag}
1146
+ :rowData="${(x) => x}"
1147
+ :cellItemTemplate="${(_, c) => c.parent.cellItemTemplate}"
1148
+ :headerCellItemTemplate="${(_, c) => c.parent.headerCellItemTemplate}"
1149
+ ></${rowTag}>
1150
+ `;
1151
+ }
1152
+ function getMultiSelectAriaState(x) {
1153
+ return x.selectionMode === void 0 || x.selectionMode === DataGridSelectionMode.none ? null : x.selectionMode.includes("multi") ? "true" : "false";
1154
+ }
1155
+ function setHeaderRow(x) {
1156
+ if (x.columnDefinitions === null) {
1157
+ const headerRow = x.querySelector('[cell-type="columnheader"]')?.parentElement;
1158
+ if (headerRow) {
1159
+ const rowType = x.generateHeader === GenerateHeaderOptions.sticky ? DataGridRowTypes.stickyHeader : DataGridRowTypes.header;
1160
+ headerRow.setAttribute("row-type", rowType);
1161
+ }
1162
+ }
1163
+ }
1164
+ function handleColumnSort(_, { event }) {
1165
+ event.stopPropagation();
1166
+ }
1167
+ const DataGridTemplate = (context) => {
1168
+ const rowItemTemplate = createRowItemTemplate(context);
1169
+ const rowTag = context.tagFor(DataGridRow);
1170
+ return index.html`
1171
+ <template
1172
+ aria-multiselectable="${getMultiSelectAriaState}"
1173
+ role="grid"
1174
+ tabindex="0"
1175
+ @sort="${handleColumnSort}"
1176
+ :rowElementTag="${() => rowTag}"
1177
+ :defaultRowItemTemplate="${rowItemTemplate}"
1178
+ ${children.children({
1179
+ property: "rowElements",
1180
+ filter: slotted.elements("[role=row]")
1181
+ })}
1182
+ >
1183
+ <div class="base">
1184
+ ${setHeaderRow}
1185
+ <slot ${slotted.slotted("slottedRowElements")}></slot>
1186
+ </div>
1187
+ </template>
1188
+ `;
1189
+ };
1190
+
1191
+ var __defProp = Object.defineProperty;
1192
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1193
+ var __decorateClass = (decorators, target, key, kind) => {
1194
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
1195
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
1196
+ if (decorator = decorators[i])
1197
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
1198
+ if (kind && result)
1199
+ __defProp(target, key, result);
1200
+ return result;
1201
+ };
1202
+ class DataGridCell extends DataGridCell$1 {
1203
+ constructor() {
1204
+ super();
1205
+ this.ariaSelected = null;
1206
+ this.ariaSort = null;
1207
+ this.updateCellStyle = () => {
1208
+ if (this.gridColumn && !this.gridColumn.includes("undefined")) {
1209
+ this.style.gridColumn = this.gridColumn;
1210
+ } else {
1211
+ this.style.removeProperty("grid-column");
1212
+ }
1213
+ };
1214
+ }
1215
+ ariaSelectedChanged(_, selectedState) {
1216
+ this.shadowRoot.querySelector(".base")?.classList.toggle("selected", selectedState === "true");
1217
+ }
1218
+ connectedCallback() {
1219
+ super.connectedCallback();
1220
+ this.ariaSelectedChanged(null, this.ariaSelected);
1221
+ }
1222
+ handleFocusin(e) {
1223
+ super.handleFocusin(e);
1224
+ this.shadowRoot.querySelector(".base").classList.add("active");
1225
+ }
1226
+ handleFocusout(e) {
1227
+ super.handleFocusout(e);
1228
+ this.shadowRoot.querySelector(".base").classList.remove("active");
1229
+ }
1230
+ #getColumnDataKey() {
1231
+ return this.columnDefinition && this.columnDefinition.columnDataKey ? this.columnDefinition.columnDataKey : this.textContent.trim();
1232
+ }
1233
+ /**
1234
+ * @internal
1235
+ */
1236
+ _handleInteraction() {
1237
+ const isHeaderCell = this.cellType === "columnheader";
1238
+ const isSortable = isHeaderCell && this.ariaSort !== null;
1239
+ if (isSortable) {
1240
+ this.$emit("sort", {
1241
+ columnDataKey: this.#getColumnDataKey(),
1242
+ sortDirection: this.ariaSort
1243
+ });
1244
+ }
1245
+ const hasInternalFocusQueue = isHeaderCell ? this.columnDefinition?.headerCellInternalFocusQueue : this.columnDefinition?.cellInternalFocusQueue;
1246
+ if (!hasInternalFocusQueue) {
1247
+ this.$emit("cell-click", {
1248
+ cell: this,
1249
+ row: this.parentElement,
1250
+ isHeaderCell,
1251
+ columnDataKey: this.#getColumnDataKey()
1252
+ });
1253
+ }
1254
+ }
1255
+ }
1256
+ __decorateClass([
1257
+ index.attr({ attribute: "aria-selected", mode: "fromView" })
1258
+ ], DataGridCell.prototype, "ariaSelected", 2);
1259
+ __decorateClass([
1260
+ index.attr({ attribute: "aria-sort" })
1261
+ ], DataGridCell.prototype, "ariaSort", 2);
1262
+
1263
+ function createCellItemTemplate(context) {
1264
+ const cellTag = context.tagFor(DataGridCell);
1265
+ return index.html`
1266
+ <${cellTag}
1267
+ cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}"
1268
+ grid-column="${(_, c) => c.index + 1}"
1269
+ :rowData="${(_, c) => c.parent.rowData}"
1270
+ :columnDefinition="${(x) => x}"
1271
+ selected="${(_, c) => c.parent.ariaSelected === "true" ? true : null}"
1272
+ ></${cellTag}>
1273
+ `;
1274
+ }
1275
+ function createHeaderCellItemTemplate(context) {
1276
+ const cellTag = context.tagFor(DataGridCell);
1277
+ return index.html`
1278
+ <${cellTag}
1279
+ cell-type="columnheader"
1280
+ grid-column="${(_, c) => c.index + 1}"
1281
+ :columnDefinition="${(x) => x}"
1282
+ ></${cellTag}>
1283
+ `;
1284
+ }
1285
+ const DataGridRowTemplate = (context) => {
1286
+ const cellItemTemplate = createCellItemTemplate(context);
1287
+ const headerCellItemTemplate = createHeaderCellItemTemplate(context);
1288
+ return index.html`
1289
+ <template
1290
+ role="row"
1291
+ class="${(x) => x.rowType !== "default" ? x.rowType : ""}"
1292
+ :defaultCellItemTemplate="${cellItemTemplate}"
1293
+ :defaultHeaderCellItemTemplate="${headerCellItemTemplate}"
1294
+ ${children.children({
1295
+ property: "cellElements",
1296
+ filter: slotted.elements('[role="cell"],[role="gridcell"],[role="columnheader"],[role="rowheader"]')
1297
+ })}
1298
+ >
1299
+ <div class="base ${(x) => x.ariaSelected === "true" ? "selected" : ""}"
1300
+ style="grid-template-columns: ${(x) => x.gridTemplateColumns};"
1301
+ >
1302
+ <slot ${slotted.slotted("slottedCellElements")}></slot>
1303
+ </div>
1304
+ </template>
1305
+ `;
1306
+ };
1307
+
1308
+ function shouldShowSortIcons(x) {
1309
+ if (x.columnDefinition) {
1310
+ x.ariaSort = !x.columnDefinition.sortable ? null : x.columnDefinition.sortDirection ? x.columnDefinition.sortDirection : DataGridCellSortStates.none;
1311
+ }
1312
+ return x.cellType === "columnheader" && x.ariaSort !== null && x.ariaSort !== DataGridCellSortStates.other;
1313
+ }
1314
+ function getSortIcon(x) {
1315
+ return x.ariaSort === DataGridCellSortStates.ascending ? "sort-asc-solid" : x.ariaSort === DataGridCellSortStates.descending ? "sort-desc-solid" : "sort-solid";
1316
+ }
1317
+ function renderSortIcons(c) {
1318
+ const iconTag = c.tagFor(icon.Icon);
1319
+ return index.html`
1320
+ ${when.when(shouldShowSortIcons, index.html`
1321
+ <${iconTag} class="header-icon" name="${getSortIcon}"></${iconTag}>
1322
+ `)}
1323
+ `;
1324
+ }
1325
+ function handleKeyDown(x, e) {
1326
+ if (e.key === keyCodes$1.keyEnter || e.key === keyCodes$1.keySpace) {
1327
+ x._handleInteraction();
1328
+ }
1329
+ return true;
1330
+ }
1331
+ function DataGridCellTemplate(context) {
1332
+ const focusTemplate = focus.focusTemplateFactory(context);
1333
+ return index.html`
1334
+ <template
1335
+ tabindex="-1"
1336
+ role="${(x) => DataGridCellRole[x.cellType] ?? DataGridCellRole.default}"
1337
+ @click="${(x) => x._handleInteraction()}"
1338
+ @keydown="${(x, c) => handleKeyDown(x, c.event)}"
1339
+ >
1340
+ <div class="base">
1341
+ <slot></slot>
1342
+ ${() => focusTemplate}
1343
+ ${(_) => renderSortIcons(context)}
1344
+ </div>
1345
+
1346
+ </template>
1347
+ `;
1348
+ }
1349
+
1350
+ const dataGrid = DataGrid.compose({
1351
+ baseName: "data-grid",
1352
+ template: DataGridTemplate,
1353
+ styles: dataGridStyles
1354
+ })();
1355
+ const dataGridRow = DataGridRow.compose({
1356
+ baseName: "data-grid-row",
1357
+ template: DataGridRowTemplate,
1358
+ styles: dataGridRowStyles
1359
+ })();
1360
+ const dataGridCell = DataGridCell.compose({
1361
+ baseName: "data-grid-cell",
1362
+ template: DataGridCellTemplate,
1363
+ styles: dataGridCellStyles
1364
+ })();
1365
+ const dataGridElements = [dataGridCell, dataGridRow, dataGrid, ...definition.iconRegistries];
1366
+ const registerDataGrid = index.registerFactory(dataGridElements);
1367
+
1368
+ exports.dataGrid = dataGrid;
1369
+ exports.dataGridCell = dataGridCell;
1370
+ exports.dataGridElements = dataGridElements;
1371
+ exports.dataGridRow = dataGridRow;
1372
+ exports.registerDataGrid = registerDataGrid;