@vonage/vivid 5.23.1 → 5.24.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 (406) hide show
  1. package/accordion/index.cjs +1 -1
  2. package/accordion/index.js +1 -1
  3. package/accordion-item/index.cjs +1 -1
  4. package/accordion-item/index.js +1 -1
  5. package/audio-player/index.cjs +2 -2
  6. package/audio-player/index.js +3 -3
  7. package/badge/index.cjs +1 -1
  8. package/badge/index.js +1 -1
  9. package/bundled/definition15.cjs +8 -7
  10. package/bundled/definition15.js +26 -24
  11. package/bundled/definition17.cjs +2 -2
  12. package/bundled/definition17.js +2 -2
  13. package/bundled/definition18.cjs +12 -83
  14. package/bundled/definition18.js +35 -419
  15. package/bundled/definition19.cjs +87 -7
  16. package/bundled/definition19.js +432 -16
  17. package/bundled/definition20.cjs +7 -37
  18. package/bundled/definition20.js +17 -172
  19. package/bundled/definition21.cjs +35 -27
  20. package/bundled/definition21.js +154 -154
  21. package/bundled/definition22.cjs +29 -6
  22. package/bundled/definition22.js +172 -20
  23. package/bundled/definition23.cjs +6 -12
  24. package/bundled/definition23.js +17 -32
  25. package/bundled/definition24.cjs +12 -39
  26. package/bundled/definition24.js +32 -67
  27. package/bundled/definition25.cjs +44 -0
  28. package/bundled/definition25.js +77 -0
  29. package/bundled/extractOptions.cjs +1 -0
  30. package/bundled/extractOptions.js +11 -0
  31. package/bundled/listbox.cjs +1 -1
  32. package/bundled/listbox.js +24 -11
  33. package/bundled/render-in-light-dom.cjs +1 -1
  34. package/bundled/render-in-light-dom.js +16 -19
  35. package/bundled/vivid-element.cjs +1 -1
  36. package/bundled/vivid-element.js +9 -1
  37. package/combobox/definition.cjs +1 -1
  38. package/combobox/definition.js +1 -1
  39. package/combobox/index.cjs +7 -7
  40. package/combobox/index.js +29 -21
  41. package/country/definition.cjs +1 -1
  42. package/country/definition.js +1 -1
  43. package/country/index.cjs +1 -1
  44. package/country/index.js +1 -1
  45. package/country-group/definition.cjs +1 -1
  46. package/country-group/definition.js +1 -1
  47. package/country-group/index.cjs +1 -1
  48. package/country-group/index.js +2 -2
  49. package/custom-elements.json +3102 -2842
  50. package/data-grid/definition.cjs +1 -1
  51. package/data-grid/definition.js +1 -1
  52. package/data-grid/index.cjs +4 -4
  53. package/data-grid/index.js +5 -5
  54. package/date-picker/definition.cjs +1 -1
  55. package/date-picker/definition.js +1 -1
  56. package/date-picker/index.cjs +1 -1
  57. package/date-picker/index.js +1 -1
  58. package/date-range-picker/definition.cjs +1 -1
  59. package/date-range-picker/definition.js +1 -1
  60. package/date-range-picker/index.cjs +1 -1
  61. package/date-range-picker/index.js +1 -1
  62. package/date-time-picker/definition.cjs +1 -1
  63. package/date-time-picker/definition.js +1 -1
  64. package/date-time-picker/index.cjs +1 -1
  65. package/date-time-picker/index.js +1 -1
  66. package/dial-pad/definition.cjs +1 -1
  67. package/dial-pad/definition.js +1 -1
  68. package/dial-pad/index.cjs +24 -24
  69. package/dial-pad/index.js +120 -51
  70. package/dialog/definition.cjs +1 -1
  71. package/dialog/definition.js +1 -1
  72. package/divider/definition.cjs +1 -1
  73. package/divider/definition.js +1 -1
  74. package/divider/index.cjs +1 -1
  75. package/divider/index.js +1 -1
  76. package/empty-state/definition.cjs +1 -1
  77. package/empty-state/definition.js +1 -1
  78. package/fab/definition.cjs +1 -1
  79. package/fab/definition.js +1 -1
  80. package/file-picker/definition.cjs +1 -1
  81. package/file-picker/definition.js +1 -1
  82. package/flag/definition.cjs +1 -1
  83. package/flag/definition.js +1 -1
  84. package/header/definition.cjs +1 -1
  85. package/header/definition.js +1 -1
  86. package/header/index.cjs +3 -3
  87. package/header/index.js +3 -3
  88. package/index.cjs +200 -196
  89. package/index.js +53 -52
  90. package/kbd-key/definition.cjs +1 -1
  91. package/kbd-key/definition.js +1 -1
  92. package/kbd-shortcut/definition.cjs +1 -1
  93. package/kbd-shortcut/definition.js +1 -1
  94. package/layout/definition.cjs +1 -1
  95. package/layout/definition.js +1 -1
  96. package/lib/accordion-item/accordion-item.d.ts +2 -1
  97. package/lib/action-group/action-group.d.ts +1 -1
  98. package/lib/alert/alert.d.ts +2 -2
  99. package/lib/audio-player/audio-player.d.ts +1 -1
  100. package/lib/avatar/avatar.d.ts +1 -1
  101. package/lib/badge/badge.d.ts +1 -1
  102. package/lib/banner/banner.d.ts +3 -3
  103. package/lib/breadcrumb/breadcrumb.d.ts +1 -1
  104. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  105. package/lib/button/button.d.ts +3 -3
  106. package/lib/calendar-event/calendar-event.d.ts +1 -1
  107. package/lib/card/card.d.ts +1 -1
  108. package/lib/checkbox/checkbox.d.ts +6 -6
  109. package/lib/color-picker/color-picker.d.ts +7 -7
  110. package/lib/combobox/combobox.d.ts +7 -7
  111. package/lib/components.d.ts +1 -0
  112. package/lib/country-group/country-group.d.ts +2 -2
  113. package/lib/data-grid/data-grid-cell.d.ts +4 -3
  114. package/lib/data-grid/data-grid-row.d.ts +3 -2
  115. package/lib/data-grid/data-grid.options.d.ts +5 -0
  116. package/lib/date-picker/date-picker.d.ts +8 -8
  117. package/lib/date-range-picker/date-range-picker.d.ts +4 -4
  118. package/lib/date-time-picker/date-time-picker.d.ts +8 -8
  119. package/lib/dial-pad/dial-pad.d.ts +2 -1
  120. package/lib/dialog/dialog.d.ts +2 -2
  121. package/lib/divider/divider.d.ts +1 -1
  122. package/lib/fab/fab.d.ts +1 -1
  123. package/lib/file-picker/file-picker.d.ts +7 -7
  124. package/lib/header/header.d.ts +1 -1
  125. package/lib/menu/menu.d.ts +2 -2
  126. package/lib/menu-item/menu-item.d.ts +3 -3
  127. package/lib/nav/nav.d.ts +1 -1
  128. package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
  129. package/lib/nav-item/nav-item.d.ts +2 -2
  130. package/lib/note/note.d.ts +1 -1
  131. package/lib/number-field/number-field.d.ts +9 -9
  132. package/lib/optgroup/definition.d.ts +3 -0
  133. package/lib/optgroup/index.d.ts +1 -0
  134. package/lib/optgroup/optgroup.d.ts +430 -0
  135. package/lib/optgroup/optgroup.template.d.ts +2 -0
  136. package/lib/optgroup/variations.browser-spec.d.ts +1 -0
  137. package/lib/option/option.d.ts +2 -2
  138. package/lib/pagination/pagination.d.ts +1 -1
  139. package/lib/popover/popover.d.ts +2 -2
  140. package/lib/progress/progress.d.ts +1 -1
  141. package/lib/progress-ring/progress-ring.d.ts +1 -1
  142. package/lib/radio/radio.d.ts +3 -3
  143. package/lib/radio-group/radio-group.d.ts +1 -1
  144. package/lib/range-slider/range-slider.d.ts +3 -3
  145. package/lib/rich-text-editor/rich-text-editor.d.ts +1 -1
  146. package/lib/searchable-select/option-tag.d.ts +1 -1
  147. package/lib/searchable-select/searchable-select.d.ts +47 -47
  148. package/lib/select/select.d.ts +9 -9
  149. package/lib/selectable-box/selectable-box.d.ts +1 -1
  150. package/lib/simple-color-picker/simple-color-picker.d.ts +2 -2
  151. package/lib/slider/slider.d.ts +3 -3
  152. package/lib/split-button/split-button.d.ts +3 -3
  153. package/lib/status/status.d.ts +1 -1
  154. package/lib/switch/switch.d.ts +2 -2
  155. package/lib/tab/tab.d.ts +3 -3
  156. package/lib/tab-panel/tab-panel.d.ts +1 -1
  157. package/lib/table/table-cell.d.ts +1 -1
  158. package/lib/table/table-header-cell.d.ts +1 -1
  159. package/lib/table/table-row.d.ts +1 -1
  160. package/lib/table/table-sorting-button.d.ts +1 -1
  161. package/lib/tag/tag.d.ts +3 -3
  162. package/lib/tag-group/tag-group.d.ts +1 -1
  163. package/lib/tag-name-map.d.ts +2 -1
  164. package/lib/text-area/text-area.d.ts +8 -8
  165. package/lib/text-field/text-field.d.ts +9 -9
  166. package/lib/time-picker/time-picker.d.ts +4 -4
  167. package/lib/toggletip/toggletip.d.ts +2 -2
  168. package/lib/tooltip/tooltip.d.ts +2 -2
  169. package/lib/tree-item/tree-item.d.ts +2 -2
  170. package/lib/tree-view/tree-view.d.ts +1 -1
  171. package/lib/video-player/video-player.d.ts +1 -1
  172. package/menu/index.cjs +1 -1
  173. package/menu/index.js +1 -1
  174. package/menu-item/index.cjs +1 -1
  175. package/menu-item/index.js +1 -1
  176. package/nav/definition.cjs +1 -1
  177. package/nav/definition.js +1 -1
  178. package/nav-disclosure/definition.cjs +1 -1
  179. package/nav-disclosure/definition.js +1 -1
  180. package/nav-item/definition.cjs +1 -1
  181. package/nav-item/definition.js +1 -1
  182. package/note/definition.cjs +1 -1
  183. package/note/definition.js +1 -1
  184. package/number-field/definition.cjs +1 -1
  185. package/number-field/definition.js +1 -1
  186. package/number-field/index.cjs +1 -1
  187. package/number-field/index.js +1 -1
  188. package/optgroup/definition.cjs +5 -0
  189. package/optgroup/definition.js +2 -0
  190. package/optgroup/index.cjs +1 -0
  191. package/optgroup/index.js +4 -0
  192. package/package.json +6 -6
  193. package/pagination/definition.cjs +1 -1
  194. package/pagination/definition.js +1 -1
  195. package/platform-switch/definition.cjs +1 -1
  196. package/platform-switch/definition.js +1 -1
  197. package/popover/definition.cjs +1 -1
  198. package/popover/definition.js +1 -1
  199. package/progress/definition.cjs +1 -1
  200. package/progress/definition.js +1 -1
  201. package/radio/definition.cjs +1 -1
  202. package/radio/definition.js +1 -1
  203. package/radio-group/definition.cjs +1 -1
  204. package/radio-group/definition.js +1 -1
  205. package/range-slider/definition.cjs +1 -1
  206. package/range-slider/definition.js +1 -1
  207. package/rich-text-editor/definition.cjs +1 -1
  208. package/rich-text-editor/definition.js +1 -1
  209. package/rich-text-editor/index.cjs +1 -1
  210. package/rich-text-editor/index.js +4 -4
  211. package/rich-text-view/definition.cjs +1 -1
  212. package/rich-text-view/definition.js +1 -1
  213. package/searchable-select/definition.cjs +1 -1
  214. package/searchable-select/definition.js +1 -1
  215. package/searchable-select/index.cjs +19 -19
  216. package/searchable-select/index.js +60 -45
  217. package/select/definition.cjs +1 -1
  218. package/select/definition.js +1 -1
  219. package/select/index.cjs +1 -1
  220. package/select/index.js +1 -1
  221. package/selectable-box/definition.cjs +1 -1
  222. package/selectable-box/definition.js +1 -1
  223. package/shared/aria/delegates-aria.d.ts +1 -1
  224. package/shared/aria/host-semantics.d.ts +1 -1
  225. package/shared/color-picker/base-color-picker.d.ts +1 -1
  226. package/shared/feedback/feedback-message.d.ts +1 -1
  227. package/shared/feedback/mixins.d.ts +2 -2
  228. package/shared/foundation/button/button.d.ts +2 -2
  229. package/shared/foundation/form-associated/form-associated.d.ts +2 -2
  230. package/shared/foundation/listbox/extractOptions.d.ts +2 -0
  231. package/shared/foundation/listbox/listbox.d.ts +2 -0
  232. package/shared/patterns/affix.d.ts +2 -2
  233. package/shared/patterns/anchored.d.ts +2 -2
  234. package/shared/patterns/char-count/char-count.d.ts +1 -1
  235. package/shared/patterns/form-elements/form-element.d.ts +1 -1
  236. package/shared/patterns/form-elements/with-contextual-help.d.ts +1 -1
  237. package/shared/patterns/form-elements/with-error-text.d.ts +1 -1
  238. package/shared/patterns/form-elements/with-success-text.d.ts +1 -1
  239. package/shared/patterns/kbd-shortcut.d.ts +1 -1
  240. package/shared/patterns/linkable.d.ts +1 -1
  241. package/shared/patterns/localized.d.ts +2 -2
  242. package/shared/patterns/trapped-focus.d.ts +1 -1
  243. package/shared/picker-field/mixins/calendar-picker.d.ts +2 -2
  244. package/shared/picker-field/mixins/calendar-picker.template.d.ts +2 -2
  245. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +1 -1
  246. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +2 -2
  247. package/shared/picker-field/mixins/single-date-picker.d.ts +2 -2
  248. package/shared/picker-field/mixins/single-value-picker.d.ts +2 -2
  249. package/shared/picker-field/mixins/time-selection-picker.d.ts +2 -2
  250. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +4 -4
  251. package/shared/picker-field/picker-field.d.ts +7 -7
  252. package/side-drawer/definition.cjs +1 -1
  253. package/side-drawer/definition.js +1 -1
  254. package/simple-color-picker/definition.cjs +1 -1
  255. package/simple-color-picker/definition.js +1 -1
  256. package/split-button/definition.cjs +1 -1
  257. package/split-button/definition.js +1 -1
  258. package/split-button/index.cjs +1 -0
  259. package/split-button/index.js +1 -0
  260. package/status/definition.cjs +1 -1
  261. package/status/definition.js +1 -1
  262. package/switch/definition.cjs +1 -1
  263. package/switch/definition.js +1 -1
  264. package/switch/index.cjs +6 -5
  265. package/switch/index.js +16 -14
  266. package/tab/definition.cjs +1 -1
  267. package/tab/definition.js +1 -1
  268. package/tab-panel/definition.cjs +1 -1
  269. package/tab-panel/definition.js +1 -1
  270. package/table/definition.cjs +1 -1
  271. package/table/definition.js +1 -1
  272. package/tabs/definition.cjs +1 -1
  273. package/tabs/definition.js +1 -1
  274. package/tag/definition.cjs +1 -1
  275. package/tag/definition.js +1 -1
  276. package/tag-group/definition.cjs +1 -1
  277. package/tag-group/definition.js +1 -1
  278. package/text-area/definition.cjs +1 -1
  279. package/text-area/definition.js +1 -1
  280. package/time-picker/definition.cjs +1 -1
  281. package/time-picker/definition.js +1 -1
  282. package/tree-item/definition.cjs +1 -1
  283. package/tree-item/definition.js +1 -1
  284. package/tree-view/definition.cjs +1 -1
  285. package/tree-view/definition.js +1 -1
  286. package/unbundled/definition13.cjs +1 -1
  287. package/unbundled/definition13.js +1 -1
  288. package/unbundled/definition2.cjs +9 -3
  289. package/unbundled/definition2.js +9 -3
  290. package/unbundled/definition23.cjs +1 -0
  291. package/unbundled/definition23.js +2 -1
  292. package/unbundled/definition29.cjs +2 -2
  293. package/unbundled/definition29.js +2 -2
  294. package/unbundled/definition30.cjs +65 -484
  295. package/unbundled/definition30.js +57 -482
  296. package/unbundled/definition31.cjs +501 -39
  297. package/unbundled/definition31.js +499 -37
  298. package/unbundled/definition32.cjs +38 -239
  299. package/unbundled/definition32.js +35 -236
  300. package/unbundled/definition33.cjs +236 -74
  301. package/unbundled/definition33.js +233 -71
  302. package/unbundled/definition34.cjs +74 -1968
  303. package/unbundled/definition34.js +70 -1940
  304. package/unbundled/definition35.cjs +1992 -26
  305. package/unbundled/definition35.js +1964 -27
  306. package/unbundled/definition36.cjs +26 -111
  307. package/unbundled/definition36.js +23 -103
  308. package/unbundled/definition37.cjs +53 -294
  309. package/unbundled/definition37.js +50 -291
  310. package/unbundled/definition38.cjs +282 -132
  311. package/unbundled/definition38.js +279 -129
  312. package/unbundled/definition39.cjs +165 -339
  313. package/unbundled/definition39.js +163 -337
  314. package/unbundled/definition40.cjs +394 -228
  315. package/unbundled/definition40.js +391 -225
  316. package/unbundled/definition41.cjs +263 -46
  317. package/unbundled/definition41.js +258 -41
  318. package/unbundled/definition42.cjs +47 -67
  319. package/unbundled/definition42.js +45 -65
  320. package/unbundled/definition43.cjs +56 -383
  321. package/unbundled/definition43.js +55 -382
  322. package/unbundled/definition44.cjs +386 -44
  323. package/unbundled/definition44.js +382 -40
  324. package/unbundled/definition45.cjs +53 -45
  325. package/unbundled/definition45.js +49 -41
  326. package/unbundled/definition46.cjs +40 -164
  327. package/unbundled/definition46.js +36 -160
  328. package/unbundled/definition47.cjs +171 -31
  329. package/unbundled/definition47.js +168 -22
  330. package/unbundled/definition48.cjs +30 -89
  331. package/unbundled/definition48.js +22 -87
  332. package/unbundled/definition49.cjs +70 -33
  333. package/unbundled/definition49.js +67 -30
  334. package/unbundled/definition50.cjs +54 -23
  335. package/unbundled/definition50.js +52 -18
  336. package/unbundled/definition51.cjs +23 -39
  337. package/unbundled/definition51.js +17 -36
  338. package/unbundled/definition52.cjs +29 -314
  339. package/unbundled/definition52.js +27 -312
  340. package/unbundled/definition53.cjs +301 -195
  341. package/unbundled/definition53.js +297 -191
  342. package/unbundled/definition54.cjs +210 -40
  343. package/unbundled/definition54.js +206 -36
  344. package/unbundled/definition55.cjs +42 -266
  345. package/unbundled/definition55.js +38 -262
  346. package/unbundled/definition56.cjs +266 -50
  347. package/unbundled/definition56.js +263 -46
  348. package/unbundled/definition57.cjs +48 -146
  349. package/unbundled/definition57.js +47 -143
  350. package/unbundled/definition58.cjs +127 -225
  351. package/unbundled/definition58.js +122 -223
  352. package/unbundled/definition59.cjs +199 -418
  353. package/unbundled/definition59.js +196 -415
  354. package/unbundled/definition60.cjs +441 -3738
  355. package/unbundled/definition60.js +431 -3565
  356. package/unbundled/definition61.cjs +3712 -728
  357. package/unbundled/definition61.js +3538 -717
  358. package/unbundled/definition62.cjs +769 -97
  359. package/unbundled/definition62.js +766 -94
  360. package/unbundled/definition63.cjs +100 -981
  361. package/unbundled/definition63.js +98 -976
  362. package/unbundled/definition64.cjs +988 -93
  363. package/unbundled/definition64.js +982 -90
  364. package/unbundled/definition65.cjs +109 -73
  365. package/unbundled/definition65.js +105 -63
  366. package/unbundled/definition66.cjs +69 -155
  367. package/unbundled/definition66.js +60 -152
  368. package/unbundled/definition67.cjs +154 -118
  369. package/unbundled/definition67.js +151 -115
  370. package/unbundled/definition68.cjs +124 -49
  371. package/unbundled/definition68.js +120 -45
  372. package/unbundled/definition69.cjs +51 -84
  373. package/unbundled/definition69.js +50 -80
  374. package/unbundled/definition70.cjs +91 -19
  375. package/unbundled/definition70.js +86 -14
  376. package/unbundled/definition71.cjs +20 -87
  377. package/unbundled/definition71.js +14 -84
  378. package/unbundled/definition72.cjs +76 -294
  379. package/unbundled/definition72.js +71 -217
  380. package/unbundled/definition73.cjs +288 -311
  381. package/unbundled/definition73.js +218 -306
  382. package/unbundled/definition74.cjs +326 -26
  383. package/unbundled/definition74.js +317 -23
  384. package/unbundled/definition75.cjs +27 -122
  385. package/unbundled/definition75.js +22 -118
  386. package/unbundled/definition76.cjs +103 -232
  387. package/unbundled/definition76.js +99 -228
  388. package/unbundled/definition77.cjs +259 -26
  389. package/unbundled/definition77.js +249 -23
  390. package/unbundled/definition78.cjs +29 -148
  391. package/unbundled/definition78.js +27 -133
  392. package/unbundled/definition79.cjs +117 -173
  393. package/unbundled/definition79.js +108 -169
  394. package/unbundled/definition80.cjs +181 -477
  395. package/unbundled/definition80.js +176 -471
  396. package/unbundled/definition81.cjs +517 -0
  397. package/unbundled/definition81.js +497 -0
  398. package/unbundled/extractOptions.cjs +21 -0
  399. package/unbundled/extractOptions.js +16 -0
  400. package/unbundled/listbox.cjs +23 -6
  401. package/unbundled/listbox.js +23 -6
  402. package/unbundled/vivid-element.cjs +10 -1
  403. package/unbundled/vivid-element.js +10 -1
  404. package/video-player/definition.cjs +1 -1
  405. package/video-player/definition.js +1 -1
  406. package/vivid.api.json +194 -0
@@ -1,45 +1,2011 @@
1
1
  require("./chunk.cjs");
2
2
  const require_vivid_element = require("./vivid-element.cjs");
3
+ const require_definition = require("./definition.cjs");
4
+ const require_decorate = require("./decorate.cjs");
5
+ const require_localized = require("./localized.cjs");
6
+ const require_key_codes = require("./key-codes.cjs");
3
7
  const require_host_semantics = require("./host-semantics.cjs");
4
- const require_divider = require("./divider.cjs");
8
+ const require_definition$1 = require("./definition22.cjs");
9
+ const require_data_grid_options = require("./data-grid.options.cjs");
5
10
  let _microsoft_fast_element = require("@microsoft/fast-element");
6
11
  let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
7
- //#region src/lib/divider/divider.scss?inline
8
- var divider_default = ":host{display:block}.base{--_connotation-color-soft:var(--vvd-divider-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-dim:var(--vvd-divider-accent-dim,var(--vvd-color-neutral-200));display:block}.base:not(.vertical){block-size:1px;inline-size:100%}.base.vertical{block-size:100%;inline-size:1px}.base.appearance-ghost{background-color:var(--_connotation-color-dim)}.base.appearance-subtle{background-color:var(--_connotation-color-soft)}";
9
- //#endregion
10
- //#region src/lib/divider/divider.template.ts
11
- var getAriaOrientation = ({ role, orientation }) => role === require_divider.DividerRole.presentation ? null : orientation;
12
- var DividerTemplate = _microsoft_fast_element.html`<template
13
- ${require_host_semantics.applyHostSemantics({
14
- role: (x) => x.role || require_divider.DividerRole.separator,
15
- ariaHidden: true,
16
- ariaOrientation: getAriaOrientation
17
- })}
18
- >
19
- <span
20
- class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("base", [x.orientation, Boolean(x.orientation)], [`appearance-${x.appearance}`, Boolean(x.appearance)])}"
21
- ></span
22
- ></template>`;
23
- //#endregion
24
- //#region src/lib/divider/definition.ts
12
+ //#region src/lib/data-grid/data-grid.scss?inline
13
+ var data_grid_default = ":host{display:block}:host([generate-header=sticky]){max-block-size:400px}.base{--scrollbar-track-color:transparent;--scrollbar-thumb-color:color-mix(in sRGB, var(--vvd-color-neutral-950), transparent 70%);scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.base ::-webkit-scrollbar{width:4px}.base ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.base ::-webkit-scrollbar-thumb{background-color:var(--scrollbar-fallback-track-color,var(--scrollbar-thumb-color));border:0;border-radius:4px}.base{block-size:inherit;inline-size:100%;max-block-size:inherit;position:relative;overflow:auto}";
14
+ //#endregion
15
+ //#region src/lib/data-grid/data-grid-row.scss?inline
16
+ var data_grid_row_default = ".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-firm:var(--vvd-data-grid-row-cta-firm,var(--vvd-color-cta-600));--_connotation-color-faint:var(--vvd-data-grid-row-cta-faint,var(--vvd-color-cta-50));--_connotation-color-soft:var(--vvd-data-grid-row-cta-soft,var(--vvd-color-cta-100));--_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-firm:var(--vvd-data-grid-row-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-faint:var(--vvd-data-grid-row-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-data-grid-row-accent-soft,var(--vvd-color-neutral-100));--_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-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.base{box-sizing:border-box;width:100%;color:var(--vvd-color-canvas-text);display:grid}:host([row-type=sticky-header]) .base{z-index:9;background:var(--data-grid-row-background,var(--vvd-color-canvas));position:sticky;top:0}:host([row-type=hidden-header]) .base{display:none}:host([selected]:not([row-type*=header])) .base{background-color:var(--_appearance-color-fill)}";
17
+ //#endregion
18
+ //#region src/lib/data-grid/data-grid-cell.scss?inline
19
+ var data_grid_cell_default = ":host{block-size:100%;min-inline-size:80px}:host(:focus-visible){outline:none}:host([data-fixed]){z-index:5;background:var(--data-grid-cell-background,var(--vvd-color-surface-2dp));position:sticky}:host([data-fixed]):before{z-index:1;width:1px;content:\"\";pointer-events:none;block-size:100%;position:absolute;top:0;right:0;box-shadow:4px 0 4px #0000001a,2px 0 2px #0000000d,1px 0 1px #0000000d}.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-firm:var(--vvd-data-grid-cell-cta-firm,var(--vvd-color-cta-600));--_connotation-color-soft:var(--vvd-data-grid-cell-cta-soft,var(--vvd-color-cta-100));--_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-firm:var(--vvd-data-grid-cell-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-soft:var(--vvd-data-grid-cell-accent-soft,var(--vvd-color-neutral-100));--_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-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.base:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}}.base.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-faint);--_appearance-color-outline:transparent}.base.selected:where(:not(.disabled,:disabled)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}@media (hover:hover){.base.selected:hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}}.base.selected.hover:where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:var(--_connotation-color-dim);--_appearance-color-outline:transparent}.base{box-sizing:border-box;border-bottom:1px solid var(--vvd-color-neutral-300);block-size:var(--data-grid-cell-block-size,var(--_data-grid-cell-default-block-size));color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base);min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 8));align-items:center;padding-block:13px 14px;padding-inline:12px;display:flex}:host(:focus-visible) .base{--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}:host([cell-type=columnheader]) .base{border-color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold);--_data-grid-cell-default-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) + 8));--_data-grid-cell-default-white-space:nowrap}:host(:not([cell-type=columnheader])) .base{--_data-grid-cell-default-block-size:100%;--_data-grid-cell-default-white-space:normal}:host([selected]:not([cell-type=columnheader])) .base{background-color:var(--_appearance-color-fill)}.content{align-items:center;display:flex;overflow:hidden}.content[role=button]{cursor:pointer}slot:not([name]){text-overflow:ellipsis;white-space:var(--data-grid-cell-white-space,var(--_data-grid-cell-default-white-space));display:block;overflow:hidden}:host(:not([cell-type=columnheader][aria-sort])) slot:not([name]){inline-size:100%}.header-icon{flex-shrink:0;margin-inline-start:16px}slot[name=action-items]{flex-shrink:0;align-items:center;display:flex}.base.has-action-items slot[name=action-items]{margin-inline-start:16px}";
20
+ //#endregion
21
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/interfaces.js
22
+ var kernelMode;
23
+ var kernelAttr = "fast-kernel";
24
+ try {
25
+ if (document.currentScript) kernelMode = document.currentScript.getAttribute(kernelAttr);
26
+ else {
27
+ const scripts = document.getElementsByTagName("script");
28
+ kernelMode = scripts[scripts.length - 1].getAttribute(kernelAttr);
29
+ }
30
+ } catch (e) {
31
+ kernelMode = "isolate";
32
+ }
33
+ var KernelServiceId;
34
+ switch (kernelMode) {
35
+ case "share":
36
+ KernelServiceId = Object.freeze({
37
+ updateQueue: 1,
38
+ observable: 2,
39
+ contextEvent: 3,
40
+ elementRegistry: 4
41
+ });
42
+ break;
43
+ case "share-v2":
44
+ KernelServiceId = Object.freeze({
45
+ updateQueue: 1.2,
46
+ observable: 2.2,
47
+ contextEvent: 3.2,
48
+ elementRegistry: 4.2
49
+ });
50
+ break;
51
+ default:
52
+ const postfix = `-${Math.random().toString(36).substring(2, 8)}`;
53
+ KernelServiceId = Object.freeze({
54
+ updateQueue: `1.2${postfix}`,
55
+ observable: `2.2${postfix}`,
56
+ contextEvent: `3.2${postfix}`,
57
+ elementRegistry: `4.2${postfix}`
58
+ });
59
+ break;
60
+ }
61
+ /**
62
+ * Warning and error messages.
63
+ * @internal
64
+ */
65
+ var Message;
66
+ (function(Message) {
67
+ Message[Message["needsArrayObservation"] = 1101] = "needsArrayObservation";
68
+ Message[Message["onlySetDOMPolicyOnce"] = 1201] = "onlySetDOMPolicyOnce";
69
+ Message[Message["bindingInnerHTMLRequiresTrustedTypes"] = 1202] = "bindingInnerHTMLRequiresTrustedTypes";
70
+ Message[Message["twoWayBindingRequiresObservables"] = 1203] = "twoWayBindingRequiresObservables";
71
+ Message[Message["hostBindingWithoutHost"] = 1204] = "hostBindingWithoutHost";
72
+ Message[Message["unsupportedBindingBehavior"] = 1205] = "unsupportedBindingBehavior";
73
+ Message[Message["directCallToHTMLTagNotAllowed"] = 1206] = "directCallToHTMLTagNotAllowed";
74
+ Message[Message["onlySetTemplatePolicyOnce"] = 1207] = "onlySetTemplatePolicyOnce";
75
+ Message[Message["cannotSetTemplatePolicyAfterCompilation"] = 1208] = "cannotSetTemplatePolicyAfterCompilation";
76
+ Message[Message["blockedByDOMPolicy"] = 1209] = "blockedByDOMPolicy";
77
+ Message[Message["missingElementDefinition"] = 1401] = "missingElementDefinition";
78
+ Message[Message["noRegistrationForContext"] = 1501] = "noRegistrationForContext";
79
+ Message[Message["noFactoryForResolver"] = 1502] = "noFactoryForResolver";
80
+ Message[Message["invalidResolverStrategy"] = 1503] = "invalidResolverStrategy";
81
+ Message[Message["cannotAutoregisterDependency"] = 1504] = "cannotAutoregisterDependency";
82
+ Message[Message["cannotResolveKey"] = 1505] = "cannotResolveKey";
83
+ Message[Message["cannotConstructNativeFunction"] = 1506] = "cannotConstructNativeFunction";
84
+ Message[Message["cannotJITRegisterNonConstructor"] = 1507] = "cannotJITRegisterNonConstructor";
85
+ Message[Message["cannotJITRegisterIntrinsic"] = 1508] = "cannotJITRegisterIntrinsic";
86
+ Message[Message["cannotJITRegisterInterface"] = 1509] = "cannotJITRegisterInterface";
87
+ Message[Message["invalidResolver"] = 1510] = "invalidResolver";
88
+ Message[Message["invalidKey"] = 1511] = "invalidKey";
89
+ Message[Message["noDefaultResolver"] = 1512] = "noDefaultResolver";
90
+ Message[Message["cyclicDependency"] = 1513] = "cyclicDependency";
91
+ Message[Message["connectUpdateRequiresController"] = 1514] = "connectUpdateRequiresController";
92
+ })(Message || (Message = {}));
93
+ /**
94
+ * Determines whether or not an object is a function.
95
+ * @public
96
+ */
97
+ var isFunction = (object) => typeof object === "function";
98
+ /**
99
+ * Determines whether or not an object is a string.
100
+ * @public
101
+ */
102
+ var isString = (object) => typeof object === "string";
103
+ /**
104
+ * A function which does nothing.
105
+ * @public
106
+ */
107
+ var noop = () => void 0;
108
+ //#endregion
109
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/polyfills.js
110
+ (function ensureGlobalThis() {
111
+ if (typeof globalThis !== "undefined") return;
112
+ if (typeof global !== "undefined") global.globalThis = global;
113
+ else if (typeof self !== "undefined") self.globalThis = self;
114
+ else if (typeof window !== "undefined") window.globalThis = window;
115
+ else {
116
+ const result = new Function("return this")();
117
+ result.globalThis = result;
118
+ }
119
+ })();
120
+ (function requestIdleCallbackPolyfill() {
121
+ if ("requestIdleCallback" in globalThis) return;
122
+ /**
123
+ * A polyfill for requestIdleCallback that falls back to setTimeout.
124
+ *
125
+ * @param callback - The function to call when the browser is idle.
126
+ * @param options - Options object that may contain a timeout property.
127
+ * @returns An ID that can be used to cancel the callback.
128
+ * @public
129
+ */
130
+ globalThis.requestIdleCallback = function requestIdleCallback(callback, options) {
131
+ const start = Date.now();
132
+ return setTimeout(() => {
133
+ callback({
134
+ didTimeout: (options === null || options === void 0 ? void 0 : options.timeout) ? Date.now() - start >= options.timeout : false,
135
+ timeRemaining: () => 0
136
+ });
137
+ }, 1);
138
+ };
139
+ /**
140
+ * A polyfill for cancelIdleCallback that falls back to clearTimeout.
141
+ *
142
+ * @param id - The ID of the callback to cancel.
143
+ * @public
144
+ */
145
+ globalThis.cancelIdleCallback = function cancelIdleCallback(id) {
146
+ clearTimeout(id);
147
+ };
148
+ })();
149
+ //#endregion
150
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/platform.js
151
+ var propConfig = {
152
+ configurable: false,
153
+ enumerable: false,
154
+ writable: false
155
+ };
156
+ if (globalThis.FAST === void 0) Reflect.defineProperty(globalThis, "FAST", Object.assign({ value: Object.create(null) }, propConfig));
157
+ /**
158
+ * The FAST global.
159
+ * @public
160
+ */
161
+ var FAST = globalThis.FAST;
162
+ if (FAST.getById === void 0) {
163
+ const storage = Object.create(null);
164
+ Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) {
165
+ let found = storage[id];
166
+ if (found === void 0) found = initialize ? storage[id] = initialize() : null;
167
+ return found;
168
+ } }, propConfig));
169
+ }
170
+ if (FAST.error === void 0) Object.assign(FAST, {
171
+ warn() {},
172
+ error(code) {
173
+ return /* @__PURE__ */ new Error(`Error ${code}`);
174
+ },
175
+ addMessages() {}
176
+ });
177
+ Object.freeze([]);
178
+ /**
179
+ * Creates a function capable of locating metadata associated with a type.
180
+ * @returns A metadata locator function.
181
+ * @internal
182
+ */
183
+ function createMetadataLocator() {
184
+ const metadataLookup = /* @__PURE__ */ new WeakMap();
185
+ return function(target) {
186
+ let metadata = metadataLookup.get(target);
187
+ if (metadata === void 0) {
188
+ let currentTarget = Reflect.getPrototypeOf(target);
189
+ while (metadata === void 0 && currentTarget !== null) {
190
+ metadata = metadataLookup.get(currentTarget);
191
+ currentTarget = Reflect.getPrototypeOf(currentTarget);
192
+ }
193
+ metadata = metadata === void 0 ? [] : metadata.slice(0);
194
+ metadataLookup.set(target, metadata);
195
+ }
196
+ return metadata;
197
+ };
198
+ }
199
+ /**
200
+ * Makes a type noop for JSON serialization.
201
+ * @param type - The type to make noop for JSON serialization.
202
+ * @internal
203
+ */
204
+ function makeSerializationNoop(type) {
205
+ type.prototype.toJSON = noop;
206
+ }
207
+ Object.freeze({
208
+ /**
209
+ * Not aspected.
210
+ */
211
+ none: 0,
212
+ /**
213
+ * An attribute.
214
+ */
215
+ attribute: 1,
216
+ /**
217
+ * A boolean attribute.
218
+ */
219
+ booleanAttribute: 2,
220
+ /**
221
+ * A property.
222
+ */
223
+ property: 3,
224
+ /**
225
+ * Content
226
+ */
227
+ content: 4,
228
+ /**
229
+ * A token list.
230
+ */
231
+ tokenList: 5,
232
+ /**
233
+ * An event.
234
+ */
235
+ event: 6
236
+ });
237
+ var createHTML = (html) => html;
238
+ var fastTrustedType = globalThis.trustedTypes ? globalThis.trustedTypes.createPolicy("fast-html", { createHTML }) : { createHTML };
239
+ var defaultPolicy = Object.freeze({
240
+ createHTML(value) {
241
+ return fastTrustedType.createHTML(value);
242
+ },
243
+ protect(tagName, aspect, aspectName, sink) {
244
+ return sink;
245
+ }
246
+ });
247
+ var fastPolicy = defaultPolicy;
248
+ /**
249
+ * Common DOM APIs.
250
+ * @public
251
+ */
252
+ var DOM = Object.freeze({
253
+ /**
254
+ * Gets the dom policy used by the templating system.
255
+ */
256
+ get policy() {
257
+ return defaultPolicy;
258
+ },
259
+ /**
260
+ * Sets the dom policy used by the templating system.
261
+ * @param policy - The policy to set.
262
+ * @remarks
263
+ * This API can only be called once, for security reasons. It should be
264
+ * called by the application developer at the start of their program.
265
+ */
266
+ setPolicy(value) {
267
+ if (defaultPolicy !== fastPolicy) throw FAST.error(Message.onlySetDOMPolicyOnce);
268
+ defaultPolicy = value;
269
+ },
270
+ /**
271
+ * Sets an attribute value on an element.
272
+ * @param element - The element to set the attribute value on.
273
+ * @param attributeName - The attribute name to set.
274
+ * @param value - The value of the attribute to set.
275
+ * @remarks
276
+ * If the value is `null` or `undefined`, the attribute is removed, otherwise
277
+ * it is set to the provided value using the standard `setAttribute` API.
278
+ */
279
+ setAttribute(element, attributeName, value) {
280
+ value === null || value === void 0 ? element.removeAttribute(attributeName) : element.setAttribute(attributeName, value);
281
+ },
282
+ /**
283
+ * Sets a boolean attribute value.
284
+ * @param element - The element to set the boolean attribute value on.
285
+ * @param attributeName - The attribute name to set.
286
+ * @param value - The value of the attribute to set.
287
+ * @remarks
288
+ * If the value is true, the attribute is added; otherwise it is removed.
289
+ */
290
+ setBooleanAttribute(element, attributeName, value) {
291
+ value ? element.setAttribute(attributeName, "") : element.removeAttribute(attributeName);
292
+ }
293
+ });
294
+ //#endregion
295
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/observation/notifier.js
296
+ /**
297
+ * An implementation of {@link Notifier} that efficiently keeps track of
298
+ * subscribers interested in a specific change notification on an
299
+ * observable subject.
300
+ *
301
+ * @remarks
302
+ * This set is optimized for the most common scenario of 1 or 2 subscribers.
303
+ * With this in mind, it can store a subscriber in an internal field, allowing it to avoid Array#push operations.
304
+ * If the set ever exceeds two subscribers, it upgrades to an array automatically.
305
+ * @public
306
+ */
307
+ var SubscriberSet = class {
308
+ /**
309
+ * Creates an instance of SubscriberSet for the specified subject.
310
+ * @param subject - The subject that subscribers will receive notifications from.
311
+ * @param initialSubscriber - An initial subscriber to changes.
312
+ */
313
+ constructor(subject, initialSubscriber) {
314
+ this.sub1 = void 0;
315
+ this.sub2 = void 0;
316
+ this.spillover = void 0;
317
+ this.subject = subject;
318
+ this.sub1 = initialSubscriber;
319
+ }
320
+ /**
321
+ * Checks whether the provided subscriber has been added to this set.
322
+ * @param subscriber - The subscriber to test for inclusion in this set.
323
+ */
324
+ has(subscriber) {
325
+ return this.spillover === void 0 ? this.sub1 === subscriber || this.sub2 === subscriber : this.spillover.indexOf(subscriber) !== -1;
326
+ }
327
+ /**
328
+ * Subscribes to notification of changes in an object's state.
329
+ * @param subscriber - The object that is subscribing for change notification.
330
+ */
331
+ subscribe(subscriber) {
332
+ const spillover = this.spillover;
333
+ if (spillover === void 0) {
334
+ if (this.has(subscriber)) return;
335
+ if (this.sub1 === void 0) {
336
+ this.sub1 = subscriber;
337
+ return;
338
+ }
339
+ if (this.sub2 === void 0) {
340
+ this.sub2 = subscriber;
341
+ return;
342
+ }
343
+ this.spillover = [
344
+ this.sub1,
345
+ this.sub2,
346
+ subscriber
347
+ ];
348
+ this.sub1 = void 0;
349
+ this.sub2 = void 0;
350
+ } else if (spillover.indexOf(subscriber) === -1) spillover.push(subscriber);
351
+ }
352
+ /**
353
+ * Unsubscribes from notification of changes in an object's state.
354
+ * @param subscriber - The object that is unsubscribing from change notification.
355
+ */
356
+ unsubscribe(subscriber) {
357
+ const spillover = this.spillover;
358
+ if (spillover === void 0) {
359
+ if (this.sub1 === subscriber) this.sub1 = void 0;
360
+ else if (this.sub2 === subscriber) this.sub2 = void 0;
361
+ } else {
362
+ const index = spillover.indexOf(subscriber);
363
+ if (index !== -1) spillover.splice(index, 1);
364
+ }
365
+ }
366
+ /**
367
+ * Notifies all subscribers.
368
+ * @param args - Data passed along to subscribers during notification.
369
+ */
370
+ notify(args) {
371
+ const spillover = this.spillover;
372
+ const subject = this.subject;
373
+ if (spillover === void 0) {
374
+ const sub1 = this.sub1;
375
+ const sub2 = this.sub2;
376
+ if (sub1 !== void 0) sub1.handleChange(subject, args);
377
+ if (sub2 !== void 0) sub2.handleChange(subject, args);
378
+ } else for (let i = 0, ii = spillover.length; i < ii; ++i) spillover[i].handleChange(subject, args);
379
+ }
380
+ };
381
+ /**
382
+ * An implementation of Notifier that allows subscribers to be notified
383
+ * of individual property changes on an object.
384
+ * @public
385
+ */
386
+ var PropertyChangeNotifier = class {
387
+ /**
388
+ * Creates an instance of PropertyChangeNotifier for the specified subject.
389
+ * @param subject - The object that subscribers will receive notifications for.
390
+ */
391
+ constructor(subject) {
392
+ this.subscribers = {};
393
+ this.subjectSubscribers = null;
394
+ this.subject = subject;
395
+ }
396
+ /**
397
+ * Notifies all subscribers, based on the specified property.
398
+ * @param propertyName - The property name, passed along to subscribers during notification.
399
+ */
400
+ notify(propertyName) {
401
+ var _a, _b;
402
+ (_a = this.subscribers[propertyName]) === null || _a === void 0 || _a.notify(propertyName);
403
+ (_b = this.subjectSubscribers) === null || _b === void 0 || _b.notify(propertyName);
404
+ }
405
+ /**
406
+ * Subscribes to notification of changes in an object's state.
407
+ * @param subscriber - The object that is subscribing for change notification.
408
+ * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes.
409
+ */
410
+ subscribe(subscriber, propertyToWatch) {
411
+ var _a, _b;
412
+ let subscribers;
413
+ if (propertyToWatch) subscribers = (_a = this.subscribers[propertyToWatch]) !== null && _a !== void 0 ? _a : this.subscribers[propertyToWatch] = new SubscriberSet(this.subject);
414
+ else subscribers = (_b = this.subjectSubscribers) !== null && _b !== void 0 ? _b : this.subjectSubscribers = new SubscriberSet(this.subject);
415
+ subscribers.subscribe(subscriber);
416
+ }
417
+ /**
418
+ * Unsubscribes from notification of changes in an object's state.
419
+ * @param subscriber - The object that is unsubscribing from change notification.
420
+ * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching.
421
+ */
422
+ unsubscribe(subscriber, propertyToUnwatch) {
423
+ var _a, _b;
424
+ if (propertyToUnwatch) (_a = this.subscribers[propertyToUnwatch]) === null || _a === void 0 || _a.unsubscribe(subscriber);
425
+ else (_b = this.subjectSubscribers) === null || _b === void 0 || _b.unsubscribe(subscriber);
426
+ }
427
+ };
428
+ //#endregion
429
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/observation/update-queue.js
430
+ /**
431
+ * The default UpdateQueue.
432
+ * @public
433
+ */
434
+ var Updates$1 = FAST.getById(KernelServiceId.updateQueue, () => {
435
+ const tasks = [];
436
+ const pendingErrors = [];
437
+ const rAF = globalThis.requestAnimationFrame;
438
+ let updateAsync = true;
439
+ function throwFirstError() {
440
+ if (pendingErrors.length) throw pendingErrors.shift();
441
+ }
442
+ function tryRunTask(task) {
443
+ try {
444
+ task.call();
445
+ } catch (error) {
446
+ if (updateAsync) {
447
+ pendingErrors.push(error);
448
+ setTimeout(throwFirstError, 0);
449
+ } else {
450
+ tasks.length = 0;
451
+ throw error;
452
+ }
453
+ }
454
+ }
455
+ function process() {
456
+ const capacity = 1024;
457
+ let index = 0;
458
+ while (index < tasks.length) {
459
+ tryRunTask(tasks[index]);
460
+ index++;
461
+ if (index > capacity) {
462
+ for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) tasks[scan] = tasks[scan + index];
463
+ tasks.length -= index;
464
+ index = 0;
465
+ }
466
+ }
467
+ tasks.length = 0;
468
+ }
469
+ function enqueue(callable) {
470
+ tasks.push(callable);
471
+ if (tasks.length < 2) updateAsync ? rAF(process) : process();
472
+ }
473
+ return Object.freeze({
474
+ enqueue,
475
+ next: () => new Promise(enqueue),
476
+ process,
477
+ setMode: (isAsync) => updateAsync = isAsync
478
+ });
479
+ });
480
+ //#endregion
481
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/observation/observable.js
482
+ /**
483
+ * Describes how the source's lifetime relates to its controller's lifetime.
484
+ * @public
485
+ */
486
+ var SourceLifetime = Object.freeze({
487
+ /**
488
+ * The source to controller lifetime relationship is unknown.
489
+ */
490
+ unknown: void 0,
491
+ /**
492
+ * The source and controller lifetimes are coupled to one another.
493
+ * They can/will be GC'd together.
494
+ */
495
+ coupled: 1
496
+ });
497
+ FAST.getById(KernelServiceId.observable, () => {
498
+ const queueUpdate = Updates$1.enqueue;
499
+ const volatileRegex = /(:|&&|\|\||if|\?\.)/;
500
+ const notifierLookup = /* @__PURE__ */ new WeakMap();
501
+ let watcher = void 0;
502
+ let createArrayObserver = (array) => {
503
+ throw FAST.error(Message.needsArrayObservation);
504
+ };
505
+ function getNotifier(source) {
506
+ var _a;
507
+ let found = (_a = source.$fastController) !== null && _a !== void 0 ? _a : notifierLookup.get(source);
508
+ if (found === void 0) Array.isArray(source) ? found = createArrayObserver(source) : notifierLookup.set(source, found = new PropertyChangeNotifier(source));
509
+ return found;
510
+ }
511
+ const getAccessors = createMetadataLocator();
512
+ class DefaultObservableAccessor {
513
+ constructor(name) {
514
+ this.name = name;
515
+ this.field = `_${name}`;
516
+ this.callback = `${name}Changed`;
517
+ }
518
+ getValue(source) {
519
+ if (watcher !== void 0) watcher.watch(source, this.name);
520
+ return source[this.field];
521
+ }
522
+ setValue(source, newValue) {
523
+ const field = this.field;
524
+ const oldValue = source[field];
525
+ if (oldValue !== newValue) {
526
+ source[field] = newValue;
527
+ const callback = source[this.callback];
528
+ if (isFunction(callback)) callback.call(source, oldValue, newValue);
529
+ getNotifier(source).notify(this.name);
530
+ }
531
+ }
532
+ }
533
+ class ExpressionNotifierImplementation extends SubscriberSet {
534
+ constructor(expression, initialSubscriber, isVolatileBinding = false) {
535
+ super(expression, initialSubscriber);
536
+ this.expression = expression;
537
+ this.isVolatileBinding = isVolatileBinding;
538
+ this.needsRefresh = true;
539
+ this.needsQueue = true;
540
+ this.isAsync = true;
541
+ this.first = this;
542
+ this.last = null;
543
+ this.propertySource = void 0;
544
+ this.propertyName = void 0;
545
+ this.notifier = void 0;
546
+ this.next = void 0;
547
+ }
548
+ setMode(isAsync) {
549
+ this.isAsync = this.needsQueue = isAsync;
550
+ }
551
+ bind(controller) {
552
+ this.controller = controller;
553
+ const value = this.observe(controller.source, controller.context);
554
+ if (!controller.isBound && this.requiresUnbind(controller)) controller.onUnbind(this);
555
+ return value;
556
+ }
557
+ requiresUnbind(controller) {
558
+ return controller.sourceLifetime !== SourceLifetime.coupled || this.first !== this.last || this.first.propertySource !== controller.source;
559
+ }
560
+ unbind(controller) {
561
+ this.dispose();
562
+ }
563
+ observe(source, context) {
564
+ if (this.needsRefresh && this.last !== null) this.dispose();
565
+ const previousWatcher = watcher;
566
+ watcher = this.needsRefresh ? this : void 0;
567
+ this.needsRefresh = this.isVolatileBinding;
568
+ let result;
569
+ try {
570
+ result = this.expression(source, context);
571
+ } finally {
572
+ watcher = previousWatcher;
573
+ }
574
+ return result;
575
+ }
576
+ disconnect() {
577
+ this.dispose();
578
+ }
579
+ dispose() {
580
+ if (this.last !== null) {
581
+ let current = this.first;
582
+ while (current !== void 0) {
583
+ current.notifier.unsubscribe(this, current.propertyName);
584
+ current = current.next;
585
+ }
586
+ this.last = null;
587
+ this.needsRefresh = this.needsQueue = this.isAsync;
588
+ }
589
+ }
590
+ watch(propertySource, propertyName) {
591
+ const prev = this.last;
592
+ const notifier = getNotifier(propertySource);
593
+ const current = prev === null ? this.first : {};
594
+ current.propertySource = propertySource;
595
+ current.propertyName = propertyName;
596
+ current.notifier = notifier;
597
+ notifier.subscribe(this, propertyName);
598
+ if (prev !== null) {
599
+ if (!this.needsRefresh) {
600
+ let prevValue;
601
+ watcher = void 0;
602
+ prevValue = prev.propertySource[prev.propertyName];
603
+ watcher = this;
604
+ if (propertySource === prevValue) this.needsRefresh = true;
605
+ }
606
+ prev.next = current;
607
+ }
608
+ this.last = current;
609
+ }
610
+ handleChange() {
611
+ if (this.needsQueue) {
612
+ this.needsQueue = false;
613
+ queueUpdate(this);
614
+ } else if (!this.isAsync) this.call();
615
+ }
616
+ call() {
617
+ if (this.last !== null) {
618
+ this.needsQueue = this.isAsync;
619
+ this.notify(this);
620
+ }
621
+ }
622
+ *records() {
623
+ let next = this.first;
624
+ while (next !== void 0) {
625
+ yield next;
626
+ next = next.next;
627
+ }
628
+ }
629
+ }
630
+ makeSerializationNoop(ExpressionNotifierImplementation);
631
+ return Object.freeze({
632
+ /**
633
+ * @internal
634
+ * @param factory - The factory used to create array observers.
635
+ */
636
+ setArrayObserverFactory(factory) {
637
+ createArrayObserver = factory;
638
+ },
639
+ /**
640
+ * Gets a notifier for an object or Array.
641
+ * @param source - The object or Array to get the notifier for.
642
+ */
643
+ getNotifier,
644
+ /**
645
+ * Records a property change for a source object.
646
+ * @param source - The object to record the change against.
647
+ * @param propertyName - The property to track as changed.
648
+ */
649
+ track(source, propertyName) {
650
+ watcher && watcher.watch(source, propertyName);
651
+ },
652
+ /**
653
+ * Notifies watchers that the currently executing property getter or function is volatile
654
+ * with respect to its observable dependencies.
655
+ */
656
+ trackVolatile() {
657
+ watcher && (watcher.needsRefresh = true);
658
+ },
659
+ /**
660
+ * Notifies subscribers of a source object of changes.
661
+ * @param source - the object to notify of changes.
662
+ * @param args - The change args to pass to subscribers.
663
+ */
664
+ notify(source, args) {
665
+ getNotifier(source).notify(args);
666
+ },
667
+ /**
668
+ * Defines an observable property on an object or prototype.
669
+ * @param target - The target object to define the observable on.
670
+ * @param nameOrAccessor - The name of the property to define as observable;
671
+ * or a custom accessor that specifies the property name and accessor implementation.
672
+ */
673
+ defineProperty(target, nameOrAccessor) {
674
+ if (isString(nameOrAccessor)) nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor);
675
+ getAccessors(target).push(nameOrAccessor);
676
+ Reflect.defineProperty(target, nameOrAccessor.name, {
677
+ enumerable: true,
678
+ get() {
679
+ return nameOrAccessor.getValue(this);
680
+ },
681
+ set(newValue) {
682
+ nameOrAccessor.setValue(this, newValue);
683
+ }
684
+ });
685
+ },
686
+ /**
687
+ * Finds all the observable accessors defined on the target,
688
+ * including its prototype chain.
689
+ * @param target - The target object to search for accessor on.
690
+ */
691
+ getAccessors,
692
+ /**
693
+ * Creates a {@link ExpressionNotifier} that can watch the
694
+ * provided {@link Expression} for changes.
695
+ * @param expression - The binding to observe.
696
+ * @param initialSubscriber - An initial subscriber to changes in the binding value.
697
+ * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation.
698
+ */
699
+ binding(expression, initialSubscriber, isVolatileBinding = this.isVolatileBinding(expression)) {
700
+ return new ExpressionNotifierImplementation(expression, initialSubscriber, isVolatileBinding);
701
+ },
702
+ /**
703
+ * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated
704
+ * on every evaluation of the value.
705
+ * @param expression - The binding to inspect.
706
+ */
707
+ isVolatileBinding(expression) {
708
+ return volatileRegex.test(expression.toString());
709
+ }
710
+ });
711
+ });
712
+ var contextEvent = FAST.getById(KernelServiceId.contextEvent, () => {
713
+ let current = null;
714
+ return {
715
+ get() {
716
+ return current;
717
+ },
718
+ set(event) {
719
+ current = event;
720
+ }
721
+ };
722
+ });
723
+ /**
724
+ * Provides additional contextual information available to behaviors and expressions.
725
+ * @public
726
+ */
727
+ var ExecutionContext = Object.freeze({
728
+ /**
729
+ * A default execution context.
730
+ */
731
+ default: {
732
+ index: 0,
733
+ length: 0,
734
+ get event() {
735
+ return ExecutionContext.getEvent();
736
+ },
737
+ eventDetail() {
738
+ return this.event.detail;
739
+ },
740
+ eventTarget() {
741
+ return this.event.target;
742
+ }
743
+ },
744
+ /**
745
+ * Gets the current event.
746
+ * @returns An event object.
747
+ */
748
+ getEvent() {
749
+ return contextEvent.get();
750
+ },
751
+ /**
752
+ * Sets the current event.
753
+ * @param event - An event object.
754
+ */
755
+ setEvent(event) {
756
+ contextEvent.set(event);
757
+ }
758
+ });
759
+ //#endregion
760
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/templating/markup.js
761
+ /**
762
+ * A unique per-session random marker string used to create placeholder tokens in HTML.
763
+ * Bindings embedded in template literals are replaced with interpolation markers
764
+ * of the form `fast-xxxxxx{id}fast-xxxxxx` so the compiler can later locate them in the
765
+ * parsed DOM and associate each marker with its ViewBehaviorFactory.
766
+ */
767
+ var marker = `fast-${Math.random().toString(36).substring(2, 8)}`;
768
+ var interpolationStart = `${marker}{`;
769
+ var interpolationEnd = `}${marker}`;
770
+ var interpolationEndLength = interpolationEnd.length;
771
+ var id = 0;
25
772
  /** @internal */
26
- var dividerDefinition = require_vivid_element.defineVividComponent("divider", require_divider.Divider, DividerTemplate, [], { styles: divider_default });
773
+ var nextId = () => `${marker}-${++id}`;
774
+ Object.freeze({
775
+ /**
776
+ * Creates a placeholder string suitable for marking out a location *within*
777
+ * an attribute value or HTML content.
778
+ * @param index - The directive index to create the placeholder for.
779
+ * @remarks
780
+ * Used internally by binding directives.
781
+ */
782
+ interpolation: (id) => `${interpolationStart}${id}${interpolationEnd}`,
783
+ /**
784
+ * Creates a placeholder that manifests itself as an attribute on an
785
+ * element.
786
+ * @param attributeName - The name of the custom attribute.
787
+ * @param index - The directive index to create the placeholder for.
788
+ * @remarks
789
+ * Used internally by attribute directives such as `ref`, `slotted`, and `children`.
790
+ */
791
+ attribute: (id) => `${nextId()}="${interpolationStart}${id}${interpolationEnd}"`,
792
+ /**
793
+ * Creates a placeholder that manifests itself as a marker within the DOM structure.
794
+ * @param index - The directive index to create the placeholder for.
795
+ * @remarks
796
+ * Used internally by structural directives such as `repeat`.
797
+ */
798
+ comment: (id) => `<!--${interpolationStart}${id}${interpolationEnd}-->`
799
+ });
800
+ Object.freeze({
801
+ /**
802
+ * Parses text content or HTML attribute content, separating out the static strings
803
+ * from the directives.
804
+ * @param value - The content or attribute string to parse.
805
+ * @param factories - A list of directives to search for in the string.
806
+ * @returns A heterogeneous array of static strings interspersed with
807
+ * directives or null if no directives are found in the string.
808
+ */
809
+ parse(value, factories) {
810
+ const parts = value.split(interpolationStart);
811
+ if (parts.length === 1) return null;
812
+ const result = [];
813
+ for (let i = 0, ii = parts.length; i < ii; ++i) {
814
+ const current = parts[i];
815
+ const index = current.indexOf(interpolationEnd);
816
+ let literal;
817
+ if (index === -1) literal = current;
818
+ else {
819
+ const factoryId = current.substring(0, index);
820
+ result.push(factories[factoryId]);
821
+ literal = current.substring(index + interpolationEndLength);
822
+ }
823
+ if (literal !== "") result.push(literal);
824
+ }
825
+ return result;
826
+ } });
827
+ //#endregion
828
+ //#region ../../node_modules/.pnpm/@microsoft+fast-element@2.10.4/node_modules/@microsoft/fast-element/dist/esm/utilities.js
829
+ /**
830
+ * Bridges between ViewBehaviors and HostBehaviors, enabling a host to
831
+ * control ViewBehaviors.
832
+ * @public
833
+ */
834
+ var ViewBehaviorOrchestrator = Object.freeze({
835
+ /**
836
+ * Creates a ViewBehaviorOrchestrator.
837
+ * @param source - The source to to associate behaviors with.
838
+ * @returns A ViewBehaviorOrchestrator.
839
+ */
840
+ create(source) {
841
+ const behaviors = [];
842
+ const targets = {};
843
+ let unbindables = null;
844
+ let isConnected = false;
845
+ return {
846
+ source,
847
+ context: ExecutionContext.default,
848
+ targets,
849
+ get isBound() {
850
+ return isConnected;
851
+ },
852
+ addBehaviorFactory(factory, target) {
853
+ var _a, _b, _c, _d;
854
+ const compiled = factory;
855
+ compiled.id = (_a = compiled.id) !== null && _a !== void 0 ? _a : nextId();
856
+ compiled.targetNodeId = (_b = compiled.targetNodeId) !== null && _b !== void 0 ? _b : nextId();
857
+ compiled.targetTagName = (_c = target.tagName) !== null && _c !== void 0 ? _c : null;
858
+ compiled.policy = (_d = compiled.policy) !== null && _d !== void 0 ? _d : DOM.policy;
859
+ this.addTarget(compiled.targetNodeId, target);
860
+ this.addBehavior(compiled.createBehavior());
861
+ },
862
+ addTarget(nodeId, target) {
863
+ targets[nodeId] = target;
864
+ },
865
+ addBehavior(behavior) {
866
+ behaviors.push(behavior);
867
+ if (isConnected) behavior.bind(this);
868
+ },
869
+ onUnbind(unbindable) {
870
+ if (unbindables === null) unbindables = [];
871
+ unbindables.push(unbindable);
872
+ },
873
+ connectedCallback(controller) {
874
+ if (!isConnected) {
875
+ isConnected = true;
876
+ behaviors.forEach((x) => x.bind(this));
877
+ }
878
+ },
879
+ disconnectedCallback(controller) {
880
+ if (isConnected) {
881
+ isConnected = false;
882
+ if (unbindables !== null) unbindables.forEach((x) => x.unbind(this));
883
+ }
884
+ }
885
+ };
886
+ } });
887
+ //#endregion
888
+ //#region src/lib/data-grid/data-grid.ts
889
+ var DataGridSelectionMode = {
890
+ none: "none",
891
+ singleRow: "single-row",
892
+ multiRow: "multi-row",
893
+ singleCell: "single-cell",
894
+ multiCell: "multi-cell"
895
+ };
27
896
  /**
28
- * Registers the divider elements with the design system.
897
+ * @public
898
+ * @component data-grid
899
+ * @slot - Default slot.
900
+ * @event {CustomEvent<{cell: HTMLElement, row: HTMLElement, isHeaderCell: boolean, columnDataKey: string}>} cell-click - Event that fires when a cell is clicked
901
+ */
902
+ var DataGrid = class DataGrid extends require_vivid_element.VividElement {
903
+ /** generates a gridTemplateColumns based on columndata array */
904
+ static generateTemplateColumns(columnDefinitions) {
905
+ let templateColumns = "";
906
+ columnDefinitions.forEach((_) => {
907
+ templateColumns = `${templateColumns}${templateColumns === "" ? "" : " "}1fr`;
908
+ });
909
+ return templateColumns;
910
+ }
911
+ /** @internal */
912
+ noTabbingChanged() {
913
+ if (this.$fastController.isConnected) this.#setTabIndex();
914
+ }
915
+ #setTabIndex() {
916
+ this.setAttribute("tabIndex", this.noTabbing || this.contains(document.activeElement) ? "-1" : "0");
917
+ }
918
+ /** @internal */
919
+ generateHeaderChanged() {
920
+ if (this.$fastController.isConnected) this.toggleGeneratedHeader();
921
+ }
922
+ /** @internal */
923
+ gridTemplateColumnsChanged() {
924
+ /* v8 ignore if -- @preserve */
925
+ if (this.$fastController.isConnected) {
926
+ this.updateRowIndexes();
927
+ if (this.fixedColumns && this.fixedColumns > 0) this.applyFixedColumns();
928
+ }
929
+ }
930
+ /** @internal */
931
+ rowsDataChanged() {
932
+ if (this.columnDefinitions === null && this.rowsData.length > 0) this.columnDefinitions = DataGrid.generateColumns(this.rowsData[0]);
933
+ if (this.$fastController.isConnected) this.toggleGeneratedHeader();
934
+ }
935
+ /** @internal */
936
+ columnDefinitionsChanged() {
937
+ if (this.columnDefinitions === null) {
938
+ this.generatedGridTemplateColumns = "";
939
+ return;
940
+ }
941
+ this.generatedGridTemplateColumns = DataGrid.generateTemplateColumns(this.columnDefinitions);
942
+ /* v8 ignore if -- @preserve */
943
+ if (this.$fastController.isConnected) {
944
+ this.columnDefinitionsStale = true;
945
+ this.queueRowIndexUpdate();
946
+ }
947
+ }
948
+ /** @internal */
949
+ headerCellItemTemplateChanged() {
950
+ /* v8 ignore if -- @preserve */
951
+ if (this.$fastController.isConnected) {
952
+ if (this.generatedHeader !== null) this.generatedHeader.headerCellItemTemplate = this.headerCellItemTemplate;
953
+ }
954
+ }
955
+ /** @internal */
956
+ focusRowIndexChanged() {
957
+ if (this.$fastController.isConnected) this.queueFocusUpdate();
958
+ }
959
+ /** @internal */
960
+ focusColumnIndexChanged() {
961
+ if (this.$fastController.isConnected) this.queueFocusUpdate();
962
+ }
963
+ /** @internal */
964
+ fixedColumnsChanged() {
965
+ /* v8 ignore if -- @preserve */
966
+ if (this.$fastController.isConnected) {
967
+ this.applyFixedColumns();
968
+ this.setupResizeObserver();
969
+ }
970
+ }
971
+ /** @internal */
972
+ setupResizeObserver() {
973
+ if (this.resizeObserver) {
974
+ this.resizeObserver.disconnect();
975
+ this.resizeObserver = void 0;
976
+ }
977
+ if (typeof ResizeObserver !== "undefined" && this.fixedColumns && this.fixedColumns > 0) {
978
+ this.resizeObserver = new ResizeObserver(() => {
979
+ this.applyFixedColumns();
980
+ });
981
+ this.resizeObserver.observe(this);
982
+ }
983
+ }
984
+ /** @internal */
985
+ connectedCallback() {
986
+ super.connectedCallback();
987
+ /* v8 ignore else -- @preserve */
988
+ if (this.rowItemTemplate === void 0) this.rowItemTemplate = this.defaultRowItemTemplate;
989
+ /* v8 ignore else -- @preserve */
990
+ if (this.behaviorOrchestrator === null) {
991
+ this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
992
+ this.$fastController.addBehavior(this.behaviorOrchestrator);
993
+ this.behaviorOrchestrator.addBehaviorFactory(new _microsoft_fast_element.RepeatDirective((0, _microsoft_fast_element.normalizeBinding)((x) => x.rowsData), (0, _microsoft_fast_element.normalizeBinding)((x) => x.rowItemTemplate), { positioning: true }), this.appendChild(document.createComment("")));
994
+ }
995
+ this.toggleGeneratedHeader();
996
+ this.addEventListener("row-focused", this.handleRowFocus);
997
+ this.addEventListener(_microsoft_fast_web_utilities.eventFocus, this.handleFocus);
998
+ this.addEventListener(_microsoft_fast_web_utilities.eventKeyDown, this.handleKeydown);
999
+ this.addEventListener(_microsoft_fast_web_utilities.eventFocusOut, this.handleFocusOut);
1000
+ this.observer = new MutationObserver(this.onChildListChange);
1001
+ this.observer.observe(this, { childList: true });
1002
+ this.setupResizeObserver();
1003
+ _microsoft_fast_element.Updates.enqueue(this.queueRowIndexUpdate);
1004
+ this.#setTabIndex();
1005
+ _microsoft_fast_element.Observable.getNotifier(this).subscribe(this.#changeHandler, "columnDefinitions");
1006
+ }
1007
+ /** @internal */
1008
+ disconnectedCallback() {
1009
+ super.disconnectedCallback();
1010
+ this.removeEventListener("row-focused", this.handleRowFocus);
1011
+ this.removeEventListener(_microsoft_fast_web_utilities.eventFocus, this.handleFocus);
1012
+ this.removeEventListener(_microsoft_fast_web_utilities.eventKeyDown, this.handleKeydown);
1013
+ this.removeEventListener(_microsoft_fast_web_utilities.eventFocusOut, this.handleFocusOut);
1014
+ this.observer.disconnect();
1015
+ if (this.resizeObserver) {
1016
+ this.resizeObserver.disconnect();
1017
+ this.resizeObserver = void 0;
1018
+ }
1019
+ this.generatedHeader = null;
1020
+ _microsoft_fast_element.Observable.getNotifier(this).unsubscribe(this.#changeHandler, "columnDefinitions");
1021
+ }
1022
+ /** @internal */
1023
+ handleRowFocus(e) {
1024
+ this.isUpdatingFocus = true;
1025
+ const focusRow = e.target;
1026
+ this.focusRowIndex = this.rowElements.indexOf(focusRow);
1027
+ this.focusColumnIndex = focusRow.focusColumnIndex;
1028
+ this.setAttribute("tabIndex", "-1");
1029
+ this.isUpdatingFocus = false;
1030
+ }
1031
+ /** @internal */
1032
+ handleFocus(_) {
1033
+ this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);
1034
+ }
1035
+ /** @internal */
1036
+ handleFocusOut(e) {
1037
+ if (e.relatedTarget === null || !this.contains(e.relatedTarget)) this.setAttribute("tabIndex", this.noTabbing ? "-1" : "0");
1038
+ }
1039
+ /** @internal */
1040
+ handleKeydown(e) {
1041
+ if (e.defaultPrevented) return;
1042
+ let newFocusRowIndex;
1043
+ const maxIndex = this.rowElements.length - 1;
1044
+ const currentGridBottom = this.offsetHeight + this.scrollTop;
1045
+ const lastRow = this.rowElements[maxIndex];
1046
+ switch (e.key) {
1047
+ case _microsoft_fast_web_utilities.keyArrowUp:
1048
+ e.preventDefault();
1049
+ this.focusOnCell(this.focusRowIndex - 1, this.focusColumnIndex, true);
1050
+ break;
1051
+ case _microsoft_fast_web_utilities.keyArrowDown:
1052
+ e.preventDefault();
1053
+ this.focusOnCell(this.focusRowIndex + 1, this.focusColumnIndex, true);
1054
+ break;
1055
+ case _microsoft_fast_web_utilities.keyPageUp:
1056
+ e.preventDefault();
1057
+ if (this.rowElements.length === 0) {
1058
+ this.focusOnCell(0, 0, false);
1059
+ break;
1060
+ }
1061
+ if (this.focusRowIndex === 0) {
1062
+ this.focusOnCell(0, this.focusColumnIndex, false);
1063
+ return;
1064
+ }
1065
+ newFocusRowIndex = this.focusRowIndex - 1;
1066
+ for (; newFocusRowIndex >= 0; newFocusRowIndex--) {
1067
+ const thisRow = this.rowElements[newFocusRowIndex];
1068
+ if (thisRow.offsetTop < this.scrollTop) {
1069
+ this.scrollTop = thisRow.offsetTop + thisRow.clientHeight - this.clientHeight;
1070
+ break;
1071
+ }
1072
+ }
1073
+ this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);
1074
+ break;
1075
+ case _microsoft_fast_web_utilities.keyPageDown:
1076
+ e.preventDefault();
1077
+ if (this.rowElements.length === 0) {
1078
+ this.focusOnCell(0, 0, false);
1079
+ break;
1080
+ }
1081
+ if (this.focusRowIndex >= maxIndex || lastRow.offsetTop + lastRow.offsetHeight <= currentGridBottom) {
1082
+ this.focusOnCell(maxIndex, this.focusColumnIndex, false);
1083
+ return;
1084
+ }
1085
+ newFocusRowIndex = this.focusRowIndex + 1;
1086
+ for (; newFocusRowIndex <= maxIndex; newFocusRowIndex++) {
1087
+ const thisRow = this.rowElements[newFocusRowIndex];
1088
+ if (thisRow.offsetTop + thisRow.offsetHeight > currentGridBottom) {
1089
+ let stickyHeaderOffset = 0;
1090
+ if (this.generateHeader === require_data_grid_options.GenerateHeaderOptions.sticky && this.generatedHeader !== null) stickyHeaderOffset = this.generatedHeader.clientHeight;
1091
+ this.scrollTop = thisRow.offsetTop - stickyHeaderOffset;
1092
+ break;
1093
+ }
1094
+ }
1095
+ this.focusOnCell(newFocusRowIndex, this.focusColumnIndex, false);
1096
+ break;
1097
+ case _microsoft_fast_web_utilities.keyHome:
1098
+ /* v8 ignore else -- @preserve */
1099
+ if (e.ctrlKey) {
1100
+ e.preventDefault();
1101
+ this.focusOnCell(0, 0, true);
1102
+ }
1103
+ break;
1104
+ case _microsoft_fast_web_utilities.keyEnd:
1105
+ /* v8 ignore else -- @preserve */
1106
+ if (e.ctrlKey && this.columnDefinitions !== null) {
1107
+ e.preventDefault();
1108
+ this.focusOnCell(this.rowElements.length - 1, this.columnDefinitions.length - 1, true);
1109
+ }
1110
+ break;
1111
+ }
1112
+ }
1113
+ queueFocusUpdate() {
1114
+ if (this.isUpdatingFocus && this.contains(document.activeElement)) return;
1115
+ if (!this.pendingFocusUpdate) {
1116
+ this.pendingFocusUpdate = true;
1117
+ _microsoft_fast_element.Updates.enqueue(() => this.updateFocus());
1118
+ }
1119
+ }
1120
+ updateFocus() {
1121
+ this.pendingFocusUpdate = false;
1122
+ this.focusOnCell(this.focusRowIndex, this.focusColumnIndex, true);
1123
+ }
1124
+ toggleGeneratedHeader() {
1125
+ if (this.generatedHeader !== null) {
1126
+ this.removeChild(this.generatedHeader);
1127
+ this.generatedHeader = null;
1128
+ }
1129
+ if (this.generateHeader !== require_data_grid_options.GenerateHeaderOptions.none && this.columnDefinitions !== null) {
1130
+ const generatedHeaderElement = document.createElement(this.rowElementTag);
1131
+ this.generatedHeader = generatedHeaderElement;
1132
+ this.generatedHeader.columnDefinitions = this.columnDefinitions;
1133
+ this.generatedHeader.gridTemplateColumns = this.gridTemplateColumns;
1134
+ this.generatedHeader.rowType = this.generateHeader === require_data_grid_options.GenerateHeaderOptions.sticky ? require_data_grid_options.DataGridRowTypes.stickyHeader : require_data_grid_options.DataGridRowTypes.header;
1135
+ /* v8 ignore else -- @preserve */
1136
+ if (this.firstChild !== null) this.insertBefore(generatedHeaderElement, this.firstChild);
1137
+ return;
1138
+ }
1139
+ }
1140
+ /** @internal */
1141
+ slottedRowElementsChanged() {
1142
+ this._resetSelection();
1143
+ }
1144
+ get #selectedRows() {
1145
+ return this.rowElements.filter((row) => row.selected);
1146
+ }
1147
+ get #selectedCells() {
1148
+ return this.rowElements.reduce((acc, row) => {
1149
+ const selectedCells = Array.from(row.children).filter((cell) => cell.selected);
1150
+ return acc.concat(selectedCells);
1151
+ }, []);
1152
+ }
1153
+ /** @internal */
1154
+ selectionModeChanged(oldValue) {
1155
+ if (oldValue === void 0) {
1156
+ _microsoft_fast_element.Updates.enqueue(this._resetSelection);
1157
+ return;
1158
+ }
1159
+ this._resetSelection(true);
1160
+ }
1161
+ #handleKeypress;
1162
+ #handleClick;
1163
+ #handleCellSelection;
1164
+ #handleRowSelection;
1165
+ constructor() {
1166
+ super();
1167
+ this.noTabbing = false;
1168
+ this.generateHeader = require_data_grid_options.GenerateHeaderOptions.default;
1169
+ this.rowsData = [];
1170
+ this.columnDefinitions = null;
1171
+ this.focusRowIndex = 0;
1172
+ this.focusColumnIndex = 0;
1173
+ this.fixedColumnsPositions = [];
1174
+ this.behaviorOrchestrator = null;
1175
+ this.generatedHeader = null;
1176
+ this.isUpdatingFocus = false;
1177
+ this.pendingFocusUpdate = false;
1178
+ this.rowindexUpdateQueued = false;
1179
+ this.columnDefinitionsStale = true;
1180
+ this.generatedGridTemplateColumns = "";
1181
+ this.focusOnCell = (rowIndex, columnIndex, scrollIntoView) => {
1182
+ if (this.rowElements.length === 0) {
1183
+ this.focusRowIndex = 0;
1184
+ this.focusColumnIndex = 0;
1185
+ return;
1186
+ }
1187
+ const focusRowIndex = Math.max(0, Math.min(this.rowElements.length - 1, rowIndex));
1188
+ const cells = this.rowElements[focusRowIndex].querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [role=\"rowheader\"], [data-vvd-component=\"data-grid-cell\"]");
1189
+ const focusTarget = cells[Math.max(0, Math.min(cells.length - 1, columnIndex))];
1190
+ if (scrollIntoView && this.scrollHeight !== this.clientHeight && (focusRowIndex < this.focusRowIndex && this.scrollTop > 0 || focusRowIndex > this.focusRowIndex && this.scrollTop < this.scrollHeight - this.clientHeight)) focusTarget.scrollIntoView({
1191
+ block: "center",
1192
+ inline: "center"
1193
+ });
1194
+ focusTarget.focus();
1195
+ };
1196
+ this.onChildListChange = (mutations, _) => {
1197
+ /* v8 ignore else -- @preserve */
1198
+ if (mutations && mutations.length) {
1199
+ mutations.forEach((mutation) => {
1200
+ mutation.addedNodes.forEach((newNode) => {
1201
+ if (newNode.nodeType === 1 && (newNode.getAttribute("role") === "row" || newNode.getAttribute("row-type") === "default")) newNode.columnDefinitions = this.columnDefinitions;
1202
+ });
1203
+ });
1204
+ this.queueRowIndexUpdate();
1205
+ }
1206
+ };
1207
+ this.queueRowIndexUpdate = () => {
1208
+ if (!this.rowindexUpdateQueued) {
1209
+ this.rowindexUpdateQueued = true;
1210
+ _microsoft_fast_element.Updates.enqueue(this.updateRowIndexes);
1211
+ }
1212
+ };
1213
+ this.updateRowIndexes = () => {
1214
+ let newGridTemplateColumns = this.gridTemplateColumns;
1215
+ if (newGridTemplateColumns === void 0) {
1216
+ if (this.generatedGridTemplateColumns === "" && this.rowElements.length > 0) {
1217
+ const firstRow = this.rowElements[0];
1218
+ this.generatedGridTemplateColumns = new Array(firstRow.cellElements.length).fill("1fr").join(" ");
1219
+ }
1220
+ newGridTemplateColumns = this.generatedGridTemplateColumns;
1221
+ }
1222
+ this.rowElements.forEach((element, index) => {
1223
+ const thisRow = element;
1224
+ thisRow.rowIndex = index;
1225
+ thisRow.gridTemplateColumns = newGridTemplateColumns;
1226
+ if (this.columnDefinitionsStale) thisRow.columnDefinitions = this.columnDefinitions;
1227
+ });
1228
+ this.rowindexUpdateQueued = false;
1229
+ this.columnDefinitionsStale = false;
1230
+ };
1231
+ this.#handleKeypress = (e) => {
1232
+ if (e.key === "Enter" || e.key === " ") this.#handleClick(e);
1233
+ };
1234
+ this.#handleClick = ({ target, ctrlKey, shiftKey, metaKey }) => {
1235
+ if (target.getAttribute("role") !== "gridcell" || target.getAttribute("cell-type") !== "default") return;
1236
+ if (this.selectionMode === DataGridSelectionMode.singleCell || this.selectionMode === DataGridSelectionMode.multiCell) {
1237
+ this.#handleCellSelection({
1238
+ target,
1239
+ ctrlKey,
1240
+ shiftKey,
1241
+ metaKey
1242
+ });
1243
+ return;
1244
+ }
1245
+ if (this.selectionMode === DataGridSelectionMode.singleRow || this.selectionMode === DataGridSelectionMode.multiRow) this.#handleRowSelection({
1246
+ target,
1247
+ ctrlKey,
1248
+ shiftKey,
1249
+ metaKey
1250
+ });
1251
+ };
1252
+ this.#handleCellSelection = ({ target, ctrlKey, shiftKey, metaKey }) => {
1253
+ const cell = target;
1254
+ if (this.selectionMode === DataGridSelectionMode.multiCell && (ctrlKey || shiftKey || metaKey)) cell.selected = !this.#selectedCells.includes(cell);
1255
+ else {
1256
+ const cacheTargetSelection = cell.selected;
1257
+ this._resetSelection(true);
1258
+ cell.selected = !cacheTargetSelection;
1259
+ }
1260
+ };
1261
+ this.#handleRowSelection = ({ target, ctrlKey, shiftKey, metaKey }) => {
1262
+ const row = target.parentNode;
1263
+ if (this.selectionMode === DataGridSelectionMode.multiRow && (ctrlKey || shiftKey || metaKey)) row.selected = !this.#selectedRows.includes(row);
1264
+ else {
1265
+ const cacheTargetSelection = row.selected;
1266
+ this._resetSelection(true);
1267
+ row.selected = !cacheTargetSelection;
1268
+ }
1269
+ };
1270
+ this.#changeHandler = { handleChange(dataGrid, propertyName) {
1271
+ /* v8 ignore else -- @preserve */
1272
+ if (propertyName === "columnDefinitions") {
1273
+ /* v8 ignore else -- @preserve */
1274
+ if (dataGrid.$fastController.isConnected) dataGrid.toggleGeneratedHeader();
1275
+ }
1276
+ } };
1277
+ this._resetSelection = (clear = false) => {
1278
+ const cells = Array.from(this.querySelectorAll("[role=\"gridcell\"], [cell-type=\"default\"]"));
1279
+ const rows = Array.from(this.querySelectorAll("[role=\"row\"], [row-type=\"default\"]"));
1280
+ if (this.selectionMode === DataGridSelectionMode.singleCell || this.selectionMode === DataGridSelectionMode.multiCell) {
1281
+ for (const cell of cells) {
1282
+ cell._selectable = true;
1283
+ cell.selected = clear ? false : cell.selected || false;
1284
+ }
1285
+ for (const row of rows) {
1286
+ row._selectable = false;
1287
+ row.selected = false;
1288
+ }
1289
+ }
1290
+ if (this.selectionMode === DataGridSelectionMode.none) for (const element of [...cells, ...rows]) {
1291
+ element._selectable = false;
1292
+ element.selected = false;
1293
+ }
1294
+ if (this.selectionMode === DataGridSelectionMode.singleRow || this.selectionMode === DataGridSelectionMode.multiRow) {
1295
+ for (const cell of cells) {
1296
+ cell._selectable = false;
1297
+ cell.selected = false;
1298
+ }
1299
+ for (const row of rows) {
1300
+ row._selectable = true;
1301
+ row.selected = clear ? false : row.selected || false;
1302
+ }
1303
+ }
1304
+ };
1305
+ this.addEventListener("click", this.#handleClick);
1306
+ this.addEventListener("keydown", this.#handleKeypress);
1307
+ }
1308
+ #changeHandler;
1309
+ static generateColumns(rowData) {
1310
+ return Object.keys(rowData).map((property, index) => {
1311
+ return {
1312
+ columnDataKey: property,
1313
+ gridColumn: `${index}`
1314
+ };
1315
+ });
1316
+ }
1317
+ /** @internal */
1318
+ applyFixedColumns() {
1319
+ if (!this.fixedColumns || this.fixedColumns <= 0) {
1320
+ this.clearFixedColumns();
1321
+ return;
1322
+ }
1323
+ this.calculateFixedColumnPositions();
1324
+ this.applyFixedColumnStyling();
1325
+ }
1326
+ /**
1327
+ * Applies fixed columns styling using cached positions
1328
+ * @internal
1329
+ */
1330
+ applyFixedColumnStyling() {
1331
+ this.rowElements.forEach((row) => {
1332
+ const cells = row.querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [cell-type=\"default\"], [cell-type=\"columnheader\"]");
1333
+ this.fixedColumnsPositions.forEach((position, index) => {
1334
+ /* v8 ignore else -- @preserve */
1335
+ if (index < cells.length) {
1336
+ const gridCell = cells[index];
1337
+ /* v8 ignore else -- @preserve */
1338
+ if (typeof gridCell.setFixedPosition === "function") gridCell.setFixedPosition(`${position}px`);
1339
+ }
1340
+ });
1341
+ });
1342
+ }
1343
+ /**
1344
+ * Calculates and caches fixed columns positions based on current layout
1345
+ * @internal
1346
+ */
1347
+ calculateFixedColumnPositions() {
1348
+ this.fixedColumnsPositions = [];
1349
+ if (this.rowElements.length === 0) return;
1350
+ const cells = this.rowElements[0].querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [cell-type=\"default\"], [cell-type=\"columnheader\"]");
1351
+ let accumulator = 0;
1352
+ for (let i = 0; i < Math.min(this.fixedColumns, cells.length); i++) {
1353
+ this.fixedColumnsPositions.push(accumulator);
1354
+ accumulator += cells[i].offsetWidth;
1355
+ }
1356
+ }
1357
+ /**
1358
+ * Clears all fixed columns state and styling
1359
+ * @internal
1360
+ */
1361
+ clearFixedColumns() {
1362
+ if (this.rowElements.length === 0) {
1363
+ this.fixedColumnsPositions = [];
1364
+ return;
1365
+ }
1366
+ this.rowElements.forEach((row) => {
1367
+ const cells = row.querySelectorAll("[role=\"cell\"], [role=\"gridcell\"], [role=\"columnheader\"], [cell-type=\"default\"], [cell-type=\"columnheader\"]");
1368
+ this.fixedColumnsPositions.forEach((_, index) => {
1369
+ /* v8 ignore else -- @preserve */
1370
+ if (index < cells.length) {
1371
+ const gridCell = cells[index];
1372
+ /* v8 ignore else -- @preserve */
1373
+ if (typeof gridCell.setFixedPosition === "function") gridCell.setFixedPosition(void 0);
1374
+ }
1375
+ });
1376
+ });
1377
+ this.fixedColumnsPositions = [];
1378
+ }
1379
+ };
1380
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
1381
+ attribute: "no-tabbing",
1382
+ mode: "boolean"
1383
+ })], DataGrid.prototype, "noTabbing", void 0);
1384
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "generate-header" })], DataGrid.prototype, "generateHeader", void 0);
1385
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "grid-template-columns" })], DataGrid.prototype, "gridTemplateColumns", void 0);
1386
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "rowsData", void 0);
1387
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "columnDefinitions", void 0);
1388
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "rowItemTemplate", void 0);
1389
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "cellItemTemplate", void 0);
1390
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "headerCellItemTemplate", void 0);
1391
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "focusRowIndex", void 0);
1392
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "focusColumnIndex", void 0);
1393
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
1394
+ attribute: "fixed-columns",
1395
+ converter: _microsoft_fast_element.nullableNumberConverter
1396
+ })], DataGrid.prototype, "fixedColumns", void 0);
1397
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "defaultRowItemTemplate", void 0);
1398
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "rowElementTag", void 0);
1399
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "rowElements", void 0);
1400
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGrid.prototype, "slottedRowElements", void 0);
1401
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "selection-mode" })], DataGrid.prototype, "selectionMode", void 0);
1402
+ //#endregion
1403
+ //#region src/lib/data-grid/data-grid-row.ts
1404
+ /**
1405
+ * @public
1406
+ * @component data-grid-row
1407
+ * @slot - Default slot.
1408
+ * @event {CustomEvent<{cell: HTMLElement, row: HTMLElement, isHeaderCell: boolean, columnDataKey: string}>} cell-click - Event that fires when a cell is clicked
1409
+ * @event {CustomEvent<HTMLElement>} row-focused - Fires a custom 'row-focused' event when focus is on an element (usually a cell or its contents) in the row
1410
+ */
1411
+ var DataGridRow = class extends require_host_semantics.HostSemantics(require_vivid_element.VividElement) {
1412
+ constructor(..._args) {
1413
+ super(..._args);
1414
+ this.rowType = require_data_grid_options.DataGridRowTypes.default;
1415
+ this.rowData = null;
1416
+ this.columnDefinitions = null;
1417
+ this.behaviorOrchestrator = null;
1418
+ this.focusColumnIndex = 0;
1419
+ this.updateRowStyle = () => {
1420
+ this.style.gridTemplateColumns = this.gridTemplateColumns;
1421
+ };
1422
+ this.ariaSelected = null;
1423
+ this._selectable = false;
1424
+ this.selected = false;
1425
+ }
1426
+ /** @internal */
1427
+ gridTemplateColumnsChanged() {
1428
+ if (this.$fastController.isConnected) this.updateRowStyle();
1429
+ }
1430
+ /** @internal */
1431
+ rowTypeChanged() {
1432
+ if (this.$fastController.isConnected) this.updateItemTemplate();
1433
+ }
1434
+ /** @internal */
1435
+ cellItemTemplateChanged() {
1436
+ this.updateItemTemplate();
1437
+ }
1438
+ /** @internal */
1439
+ headerCellItemTemplateChanged() {
1440
+ this.updateItemTemplate();
1441
+ }
1442
+ /** @internal */
1443
+ connectedCallback() {
1444
+ super.connectedCallback();
1445
+ /* v8 ignore else -- @preserve */
1446
+ if (this.behaviorOrchestrator === null) {
1447
+ this.updateItemTemplate();
1448
+ this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
1449
+ this.$fastController.addBehavior(this.behaviorOrchestrator);
1450
+ this.behaviorOrchestrator.addBehaviorFactory(new _microsoft_fast_element.RepeatDirective((0, _microsoft_fast_element.normalizeBinding)((x) => x.columnDefinitions), (0, _microsoft_fast_element.normalizeBinding)((x) => x.activeCellItemTemplate), { positioning: true }), this.appendChild(document.createComment("")));
1451
+ }
1452
+ this.addEventListener("cell-focused", this.handleCellFocus);
1453
+ this.addEventListener(_microsoft_fast_web_utilities.eventFocusOut, this.handleFocusout);
1454
+ this.addEventListener(_microsoft_fast_web_utilities.eventKeyDown, this.handleKeydown);
1455
+ this.updateRowStyle();
1456
+ }
1457
+ /** @internal */
1458
+ disconnectedCallback() {
1459
+ super.disconnectedCallback();
1460
+ this.removeEventListener("cell-focused", this.handleCellFocus);
1461
+ this.removeEventListener(_microsoft_fast_web_utilities.eventFocusOut, this.handleFocusout);
1462
+ this.removeEventListener(_microsoft_fast_web_utilities.eventKeyDown, this.handleKeydown);
1463
+ }
1464
+ /** @internal */
1465
+ handleFocusout(_) {
1466
+ /* v8 ignore else -- @preserve */
1467
+ if (!this.contains(document.activeElement)) this.focusColumnIndex = 0;
1468
+ }
1469
+ /** @internal */
1470
+ handleCellFocus(e) {
1471
+ this.focusColumnIndex = this.cellElements.indexOf(e.target);
1472
+ this.$emit("row-focused", this);
1473
+ }
1474
+ /** @internal */
1475
+ handleKeydown(e) {
1476
+ if (e.defaultPrevented) return;
1477
+ switch (e.key) {
1478
+ case require_key_codes.keyArrowLeft: {
1479
+ const newFocusColumnIndex = Math.max(0, this.focusColumnIndex - 1);
1480
+ this.cellElements[newFocusColumnIndex].focus();
1481
+ e.preventDefault();
1482
+ break;
1483
+ }
1484
+ case require_key_codes.keyArrowRight: {
1485
+ const newFocusColumnIndex = Math.min(this.cellElements.length - 1, this.focusColumnIndex + 1);
1486
+ this.cellElements[newFocusColumnIndex].focus();
1487
+ e.preventDefault();
1488
+ break;
1489
+ }
1490
+ case _microsoft_fast_web_utilities.keyHome:
1491
+ if (!e.ctrlKey) {
1492
+ this.cellElements[0].focus();
1493
+ e.preventDefault();
1494
+ }
1495
+ break;
1496
+ case _microsoft_fast_web_utilities.keyEnd:
1497
+ if (!e.ctrlKey) {
1498
+ this.cellElements[this.cellElements.length - 1].focus();
1499
+ e.preventDefault();
1500
+ }
1501
+ break;
1502
+ }
1503
+ }
1504
+ updateItemTemplate() {
1505
+ this.activeCellItemTemplate = this.rowType === require_data_grid_options.DataGridRowTypes.default && this.cellItemTemplate !== void 0 ? this.cellItemTemplate : this.rowType === require_data_grid_options.DataGridRowTypes.default && this.cellItemTemplate === void 0 ? this.defaultCellItemTemplate : this.headerCellItemTemplate !== void 0 ? this.headerCellItemTemplate : this.defaultHeaderCellItemTemplate;
1506
+ }
1507
+ /** @internal */
1508
+ ariaSelectedChanged(oldValue, newValue) {
1509
+ super.ariaSelectedChanged(oldValue, newValue);
1510
+ this._selectable = newValue !== null;
1511
+ this.selected = newValue === "true";
1512
+ }
1513
+ };
1514
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "grid-template-columns" })], DataGridRow.prototype, "gridTemplateColumns", void 0);
1515
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "row-type" })], DataGridRow.prototype, "rowType", void 0);
1516
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "rowData", void 0);
1517
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "columnDefinitions", void 0);
1518
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "cellItemTemplate", void 0);
1519
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "headerCellItemTemplate", void 0);
1520
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "rowIndex", void 0);
1521
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "activeCellItemTemplate", void 0);
1522
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "defaultCellItemTemplate", void 0);
1523
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "defaultHeaderCellItemTemplate", void 0);
1524
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "cellElements", void 0);
1525
+ require_decorate.__decorate([_microsoft_fast_element.attr], DataGridRow.prototype, "connotation", void 0);
1526
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridRow.prototype, "_selectable", void 0);
1527
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], DataGridRow.prototype, "selected", void 0);
1528
+ //#endregion
1529
+ //#region src/lib/data-grid/data-grid.template.ts
1530
+ function createRowItemTemplate(context) {
1531
+ const rowTag = context.tagFor(DataGridRow);
1532
+ return _microsoft_fast_element.html`
1533
+ <${rowTag}
1534
+ :rowData="${(x) => x}"
1535
+ :cellItemTemplate="${(_, c) => c.parent.cellItemTemplate}"
1536
+ :headerCellItemTemplate="${(_, c) => c.parent.headerCellItemTemplate}"
1537
+ ></${rowTag}>
1538
+ `;
1539
+ }
1540
+ function getMultiSelectAriaState(x) {
1541
+ return x.selectionMode === void 0 || x.selectionMode === DataGridSelectionMode.none ? null : x.selectionMode.includes("multi") ? "true" : "false";
1542
+ }
1543
+ function setHeaderRow(x) {
1544
+ if (x.columnDefinitions === null) {
1545
+ const headerRow = x.querySelector("[cell-type=\"columnheader\"]")?.parentElement;
1546
+ if (x.generateHeader === require_data_grid_options.GenerateHeaderOptions.default && (headerRow?.getAttribute("row-type") === require_data_grid_options.DataGridRowTypes.header || headerRow?.getAttribute("row-type") === require_data_grid_options.DataGridRowTypes.stickyHeader)) return;
1547
+ if (headerRow) {
1548
+ const rowType = x.generateHeader === require_data_grid_options.GenerateHeaderOptions.sticky ? require_data_grid_options.DataGridRowTypes.stickyHeader : require_data_grid_options.DataGridRowTypes.header;
1549
+ headerRow.setAttribute("row-type", rowType);
1550
+ }
1551
+ }
1552
+ }
1553
+ function handleColumnSort(_, { event }) {
1554
+ event.stopPropagation();
1555
+ }
1556
+ var DataGridTemplate = (context) => {
1557
+ const rowItemTemplate = createRowItemTemplate(context);
1558
+ const rowTag = context.tagFor(DataGridRow, true);
1559
+ return _microsoft_fast_element.html`
1560
+ <template
1561
+ aria-multiselectable="${getMultiSelectAriaState}"
1562
+ role="grid"
1563
+ tabindex="0"
1564
+ @sort="${handleColumnSort}"
1565
+ :rowElementTag="${() => rowTag}"
1566
+ :defaultRowItemTemplate="${rowItemTemplate}"
1567
+ ${(0, _microsoft_fast_element.children)({
1568
+ property: "rowElements",
1569
+ filter: (0, _microsoft_fast_element.elements)("[role=row],[data-vvd-component=data-grid-row]")
1570
+ })}
1571
+ >
1572
+ <div class="base">
1573
+ ${setHeaderRow}
1574
+ <slot ${(0, _microsoft_fast_element.slotted)("slottedRowElements")}></slot>
1575
+ </div>
1576
+ </template>
1577
+ `;
1578
+ };
1579
+ //#endregion
1580
+ //#region src/lib/data-grid/data-grid-cell.ts
1581
+ var defaultCellContentsTemplate = _microsoft_fast_element.html`
1582
+ <template>
1583
+ ${(x) => x.rowData === null || x.columnDefinition === null || x.columnDefinition.columnDataKey === null ? null : x.rowData[x.columnDefinition.columnDataKey]}
1584
+ </template>
1585
+ `;
1586
+ var defaultHeaderCellContentsTemplate = _microsoft_fast_element.html`
1587
+ <template>
1588
+ ${(x) => x.columnDefinition.title === void 0 ? x.columnDefinition.columnDataKey : x.columnDefinition.title}
1589
+ </template>
1590
+ `;
1591
+ /**
1592
+ * @public
1593
+ * @component data-grid-cell
1594
+ * @slot - Default slot.
1595
+ * @slot action-items - Add action items to the cell using this slot.
1596
+ * @event {CustomEvent<{columnDataKey: string, ariaSort: string | null, sortDirection: string | null}>} sort - Event that fires when a sortable column header is clicked
1597
+ * @event {CustomEvent<{cell: HTMLElement, row: HTMLElement, isHeaderCell: boolean, columnDataKey: string}>} cell-click - Event that fires when a cell is clicked
1598
+ * @event {CustomEvent<HTMLElement>} cell-focused - Fires a custom 'cell-focused' event when focus is on the cell or its contents
1599
+ */
1600
+ var DataGridCell = class extends require_localized.Localized(require_host_semantics.HostSemantics(require_vivid_element.VividElement)) {
1601
+ constructor(..._args) {
1602
+ super(..._args);
1603
+ this.cellType = require_data_grid_options.DataGridCellTypes.default;
1604
+ this.rowData = null;
1605
+ this.columnDefinition = null;
1606
+ this.isActiveCell = false;
1607
+ this.customCellView = null;
1608
+ this.updateCellStyle = () => {
1609
+ if (this.gridColumn && !this.gridColumn.includes("undefined")) this.style.gridColumn = this.gridColumn;
1610
+ else this.style.removeProperty("grid-column");
1611
+ };
1612
+ this._selectable = false;
1613
+ this.selected = false;
1614
+ this.ariaSelected = null;
1615
+ this.ariaSort = null;
1616
+ }
1617
+ /** @internal */
1618
+ cellTypeChanged() {
1619
+ if (this.$fastController.isConnected) this.updateCellView();
1620
+ }
1621
+ /** @internal */
1622
+ gridColumnChanged() {
1623
+ if (this.$fastController.isConnected) this.updateCellStyle();
1624
+ }
1625
+ /** @internal */
1626
+ columnDefinitionChanged(_oldValue, _newValue) {
1627
+ if (this.$fastController.isConnected) this.updateCellView();
1628
+ }
1629
+ /**
1630
+ * Updates the fixed column style
1631
+ * @internal
1632
+ */
1633
+ updateFixedStyle() {
1634
+ if (this.fixedPosition !== void 0) {
1635
+ this.setAttribute("data-fixed", "");
1636
+ this.style.left = this.fixedPosition;
1637
+ } else {
1638
+ this.removeAttribute("data-fixed");
1639
+ this.style.removeProperty("left");
1640
+ }
1641
+ }
1642
+ /**
1643
+ * Sets the fixed state and position for this cell
1644
+ * @internal
1645
+ */
1646
+ setFixedPosition(position) {
1647
+ this.fixedPosition = position;
1648
+ this.updateFixedStyle();
1649
+ }
1650
+ /** @internal */
1651
+ connectedCallback() {
1652
+ super.connectedCallback();
1653
+ this.addEventListener(_microsoft_fast_web_utilities.eventFocusIn, this.handleFocusin);
1654
+ this.addEventListener(_microsoft_fast_web_utilities.eventFocusOut, this.handleFocusout);
1655
+ this.addEventListener(_microsoft_fast_web_utilities.eventKeyDown, this.handleKeydown);
1656
+ this.style.gridColumn = `${this.columnDefinition?.gridColumn === void 0 ? 0 : this.columnDefinition.gridColumn}`;
1657
+ this.updateCellView();
1658
+ this.updateCellStyle();
1659
+ this.updateFixedStyle();
1660
+ }
1661
+ /** @internal */
1662
+ disconnectedCallback() {
1663
+ super.disconnectedCallback();
1664
+ this.removeEventListener(_microsoft_fast_web_utilities.eventFocusIn, this.handleFocusin);
1665
+ this.removeEventListener(_microsoft_fast_web_utilities.eventFocusOut, this.handleFocusout);
1666
+ this.removeEventListener(_microsoft_fast_web_utilities.eventKeyDown, this.handleKeydown);
1667
+ this.disconnectCellView();
1668
+ }
1669
+ /** @internal */
1670
+ handleFocusin(_) {
1671
+ this.shadowRoot.querySelector(".base").classList.add("active");
1672
+ if (this.isActiveCell) return;
1673
+ this.isActiveCell = true;
1674
+ switch (this.cellType) {
1675
+ case require_data_grid_options.DataGridCellTypes.columnHeader:
1676
+ if (this.columnDefinition !== null && this.columnDefinition.headerCellInternalFocusQueue !== true && typeof this.columnDefinition.headerCellFocusTargetCallback === "function") {
1677
+ const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);
1678
+ /* v8 ignore else -- @preserve */
1679
+ if (focusTarget !== null) focusTarget.focus();
1680
+ }
1681
+ break;
1682
+ default:
1683
+ if (this.columnDefinition !== null && this.columnDefinition.cellInternalFocusQueue !== true && typeof this.columnDefinition.cellFocusTargetCallback === "function") {
1684
+ const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);
1685
+ /* v8 ignore else -- @preserve */
1686
+ if (focusTarget !== null) focusTarget.focus();
1687
+ }
1688
+ break;
1689
+ }
1690
+ this.$emit("cell-focused", this);
1691
+ }
1692
+ /** @internal */
1693
+ handleFocusout(_) {
1694
+ this.shadowRoot.querySelector(".base").classList.remove("active");
1695
+ /* v8 ignore else -- @preserve */
1696
+ if (this !== document.activeElement && !this.contains(document.activeElement)) this.isActiveCell = false;
1697
+ }
1698
+ /** @internal */
1699
+ handleKeydown(e) {
1700
+ if (e.defaultPrevented || this.columnDefinition === null || this.cellType === require_data_grid_options.DataGridCellTypes.default && this.columnDefinition.cellInternalFocusQueue !== true || this.cellType === require_data_grid_options.DataGridCellTypes.columnHeader && this.columnDefinition.headerCellInternalFocusQueue !== true) return;
1701
+ switch (e.key) {
1702
+ case _microsoft_fast_web_utilities.keyEnter:
1703
+ case _microsoft_fast_web_utilities.keyFunction2:
1704
+ if (this.contains(document.activeElement) && document.activeElement !== this) return;
1705
+ switch (this.cellType) {
1706
+ case require_data_grid_options.DataGridCellTypes.columnHeader:
1707
+ if (this.columnDefinition.headerCellFocusTargetCallback !== void 0) {
1708
+ const focusTarget = this.columnDefinition.headerCellFocusTargetCallback(this);
1709
+ /* v8 ignore else -- @preserve */
1710
+ if (focusTarget !== null) focusTarget.focus();
1711
+ e.preventDefault();
1712
+ }
1713
+ break;
1714
+ default:
1715
+ if (this.columnDefinition.cellFocusTargetCallback !== void 0) {
1716
+ const focusTarget = this.columnDefinition.cellFocusTargetCallback(this);
1717
+ /* v8 ignore else -- @preserve */
1718
+ if (focusTarget !== null) focusTarget.focus();
1719
+ e.preventDefault();
1720
+ }
1721
+ break;
1722
+ }
1723
+ break;
1724
+ case _microsoft_fast_web_utilities.keyEscape:
1725
+ /* v8 ignore else -- @preserve */
1726
+ if (this.contains(document.activeElement) && document.activeElement !== this) {
1727
+ this.focus();
1728
+ e.preventDefault();
1729
+ }
1730
+ break;
1731
+ }
1732
+ }
1733
+ updateCellView() {
1734
+ this.disconnectCellView();
1735
+ if (this.columnDefinition === null) return;
1736
+ switch (this.cellType) {
1737
+ case require_data_grid_options.DataGridCellTypes.columnHeader:
1738
+ if (this.columnDefinition.headerCellTemplate !== void 0) this.customCellView = this.columnDefinition.headerCellTemplate.render(this, this);
1739
+ else this.customCellView = defaultHeaderCellContentsTemplate.render(this, this);
1740
+ break;
1741
+ case require_data_grid_options.DataGridCellTypes.rowHeader:
1742
+ case require_data_grid_options.DataGridCellTypes.default:
1743
+ if (this.columnDefinition.cellTemplate !== void 0) this.customCellView = this.columnDefinition.cellTemplate.render(this, this);
1744
+ else this.customCellView = defaultCellContentsTemplate.render(this, this);
1745
+ break;
1746
+ }
1747
+ if (!this.columnDefinition?.sortable) this.sortDirection = void 0;
1748
+ else if (this.columnDefinition.sortDirection) this.sortDirection = this.columnDefinition.sortDirection;
1749
+ else this.sortDirection = require_data_grid_options.DataGridCellSortStates.none;
1750
+ }
1751
+ disconnectCellView() {
1752
+ if (this.customCellView !== null) {
1753
+ this.customCellView.dispose();
1754
+ this.customCellView = null;
1755
+ }
1756
+ }
1757
+ /** @internal */
1758
+ ariaSelectedChanged(prevValue, newValue) {
1759
+ super.ariaSelectedChanged(prevValue, newValue);
1760
+ this._selectable = newValue !== null;
1761
+ this.selected = newValue === "true";
1762
+ }
1763
+ /** @internal */
1764
+ ariaSortChanged(oldValue, newValue) {
1765
+ super.ariaSortChanged(oldValue, newValue);
1766
+ if (newValue === null) {
1767
+ this.sortDirection = void 0;
1768
+ return;
1769
+ }
1770
+ this.sortDirection = newValue;
1771
+ }
1772
+ #getColumnDataKey() {
1773
+ return this.columnDefinition && this.columnDefinition.columnDataKey ? this.columnDefinition.columnDataKey : this.textContent.trim();
1774
+ }
1775
+ /** @internal */
1776
+ _handleInteraction() {
1777
+ const isHeaderCell = this.cellType === "columnheader";
1778
+ if (isHeaderCell && this.sortDirection !== void 0) this.$emit("sort", {
1779
+ columnDataKey: this.#getColumnDataKey(),
1780
+ sortDirection: this.sortDirection
1781
+ });
1782
+ if (!(isHeaderCell ? this.columnDefinition?.headerCellInternalFocusQueue : this.columnDefinition?.cellInternalFocusQueue)) this.$emit("cell-click", {
1783
+ cell: this,
1784
+ row: this.parentElement,
1785
+ isHeaderCell,
1786
+ columnDataKey: this.#getColumnDataKey()
1787
+ });
1788
+ return true;
1789
+ }
1790
+ };
1791
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "cell-type" })], DataGridCell.prototype, "cellType", void 0);
1792
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "grid-column" })], DataGridCell.prototype, "gridColumn", void 0);
1793
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridCell.prototype, "rowData", void 0);
1794
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridCell.prototype, "columnDefinition", void 0);
1795
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridCell.prototype, "_selectable", void 0);
1796
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ mode: "boolean" })], DataGridCell.prototype, "selected", void 0);
1797
+ require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "sort-direction" })], DataGridCell.prototype, "sortDirection", void 0);
1798
+ require_decorate.__decorate([_microsoft_fast_element.attr], DataGridCell.prototype, "connotation", void 0);
1799
+ require_decorate.__decorate([_microsoft_fast_element.observable], DataGridCell.prototype, "_actionItemsSlottedContent", void 0);
1800
+ //#endregion
1801
+ //#region src/lib/data-grid/data-grid-row.template.ts
1802
+ function calculateAriaSelectedValue$1(x) {
1803
+ if (x._selectable && x.selected) return "true";
1804
+ if (x._selectable && !x.selected) return "false";
1805
+ return null;
1806
+ }
1807
+ function createCellItemTemplate(context) {
1808
+ const cellTag = context.tagFor(DataGridCell);
1809
+ return _microsoft_fast_element.html`
1810
+ <${cellTag}
1811
+ cell-type="${(x) => x.isRowHeader ? "rowheader" : void 0}"
1812
+ grid-column="${(_, c) => c.index + 1}"
1813
+ :rowData="${(_, c) => c.parent.rowData}"
1814
+ :columnDefinition="${(x) => x}"
1815
+ selected="${(_, c) => c.parent.ariaSelected === "true" ? true : null}"
1816
+ ></${cellTag}>
1817
+ `;
1818
+ }
1819
+ function createHeaderCellItemTemplate(context) {
1820
+ const cellTag = context.tagFor(DataGridCell);
1821
+ return _microsoft_fast_element.html`
1822
+ <${cellTag}
1823
+ cell-type="columnheader"
1824
+ grid-column="${(_, c) => c.index + 1}"
1825
+ :columnDefinition="${(x) => x}"
1826
+ ></${cellTag}>
1827
+ `;
1828
+ }
1829
+ var DataGridRowTemplate = (context) => {
1830
+ const cellItemTemplate = createCellItemTemplate(context);
1831
+ const headerCellItemTemplate = createHeaderCellItemTemplate(context);
1832
+ return _microsoft_fast_element.html`
1833
+ <template
1834
+ ${require_host_semantics.applyHostSemantics({
1835
+ role: "row",
1836
+ ariaSelected: calculateAriaSelectedValue$1
1837
+ })}
1838
+ class="${(x) => x.rowType !== "default" ? x.rowType : ""}"
1839
+ :defaultCellItemTemplate="${cellItemTemplate}"
1840
+ :defaultHeaderCellItemTemplate="${headerCellItemTemplate}"
1841
+ ${(0, _microsoft_fast_element.children)({
1842
+ property: "cellElements",
1843
+ filter: (0, _microsoft_fast_element.elements)("[role=\"cell\"],[role=\"gridcell\"],[role=\"columnheader\"],[role=\"rowheader\"],[data-vvd-component=\"data-grid-cell\"]")
1844
+ })}
1845
+ >
1846
+ <div
1847
+ class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("base", ["selected", !!x.selected], [`connotation-${x.connotation}`, Boolean(x.connotation)])}"
1848
+ style="grid-template-columns: ${(x) => x.gridTemplateColumns};"
1849
+ >
1850
+ <slot ${(0, _microsoft_fast_element.slotted)("slottedCellElements")}></slot>
1851
+ </div>
1852
+ </template>
1853
+ `;
1854
+ };
1855
+ //#endregion
1856
+ //#region src/lib/data-grid/data-grid-cell.template.ts
1857
+ function shouldShowSortIcons(x) {
1858
+ return x.cellType === "columnheader" && x.sortDirection !== void 0 && x.sortDirection !== require_data_grid_options.DataGridCellSortStates.other;
1859
+ }
1860
+ function getSortIcon(x) {
1861
+ if (x.sortDirection === require_data_grid_options.DataGridCellSortStates.ascending) return "sort-asc-solid";
1862
+ if (x.sortDirection === require_data_grid_options.DataGridCellSortStates.descending) return "sort-desc-solid";
1863
+ return "sort-solid";
1864
+ }
1865
+ function calculateAriaSelectedValue(x) {
1866
+ if (x._selectable && x.selected) return "true";
1867
+ if (x._selectable && !x.selected) return "false";
1868
+ return null;
1869
+ }
1870
+ function renderSortIcons(c) {
1871
+ const iconTag = c.tagFor(require_definition.Icon);
1872
+ return _microsoft_fast_element.html`
1873
+ ${(0, _microsoft_fast_element.when)(shouldShowSortIcons, _microsoft_fast_element.html`
1874
+ <${iconTag} class="header-icon" name="${getSortIcon}"></${iconTag}>
1875
+ `)}
1876
+ `;
1877
+ }
1878
+ function shouldAnnounceSortState(x) {
1879
+ return x.cellType === require_data_grid_options.DataGridCellTypes.columnHeader && x.sortDirection !== void 0;
1880
+ }
1881
+ function getSortStateKey(x) {
1882
+ return x.sortDirection ?? require_data_grid_options.DataGridCellSortStates.none;
1883
+ }
1884
+ function getLocalizedSortStatus(x) {
1885
+ const direction = getSortStateKey(x);
1886
+ return x.locale.dataGrid.cell.sortStatus?.[direction];
1887
+ }
1888
+ function getLocalizedSortInstruction(x) {
1889
+ const direction = getSortStateKey(x);
1890
+ return x.locale.dataGrid.cell.sortInstruction?.[direction];
1891
+ }
1892
+ function getSortAnnouncement(x) {
1893
+ return [getLocalizedSortStatus(x), getLocalizedSortInstruction(x)].filter((part) => !!part).join(" ").trim();
1894
+ }
1895
+ function handleKeyDown(x, e) {
1896
+ if (e.key === _microsoft_fast_web_utilities.keyEnter || e.key === _microsoft_fast_web_utilities.keySpace) {
1897
+ if (e.target.closest("[slot=\"action-items\"]")) return true;
1898
+ x._handleInteraction();
1899
+ }
1900
+ return true;
1901
+ }
1902
+ function handleClick(x, e) {
1903
+ if (e.target.closest("[slot=\"action-items\"]")) return true;
1904
+ x._handleInteraction();
1905
+ return true;
1906
+ }
1907
+ var DataGridCellTemplate = (context) => {
1908
+ const visuallyHiddenTagName = context.tagFor(require_definition$1.VisuallyHidden);
1909
+ return _microsoft_fast_element.html`
1910
+ <template
1911
+ tabindex="-1"
1912
+ ${require_host_semantics.applyHostSemantics({
1913
+ role: (x) => require_data_grid_options.DataGridCellRole[x.cellType] ?? require_data_grid_options.DataGridCellRole.default,
1914
+ ariaSelected: calculateAriaSelectedValue,
1915
+ ariaSort: (x) => x.sortDirection ?? null
1916
+ })}
1917
+ @click="${(x, c) => handleClick(x, c.event)}"
1918
+ @keydown="${(x, c) => handleKeyDown(x, c.event)}"
1919
+ >
1920
+ <div
1921
+ class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("base", ["selected", x.selected], ["has-action-items", Boolean(x._actionItemsSlottedContent?.length)], [`connotation-${x.connotation}`, Boolean(x.connotation)])}"
1922
+ >
1923
+ <div
1924
+ class="content"
1925
+ role="${(x) => shouldShowSortIcons(x) ? "button" : void 0}"
1926
+ >
1927
+ ${(x) => x.selected ? _microsoft_fast_element.html`<${visuallyHiddenTagName}
1928
+ data-announcement="selection"
1929
+ >
1930
+ ${(x) => x.locale.dataGrid.cell.selected}
1931
+ </${visuallyHiddenTagName}>` : null}
1932
+ <slot></slot>
1933
+ ${(0, _microsoft_fast_element.when)(shouldShowSortIcons, _microsoft_fast_element.html`<${visuallyHiddenTagName}
1934
+ data-announcement="button-role"
1935
+ >
1936
+ ${(x) => x.locale.dataGrid.cell.button}
1937
+ </${visuallyHiddenTagName}>
1938
+ `)}
1939
+ ${(0, _microsoft_fast_element.when)(shouldAnnounceSortState, _microsoft_fast_element.html`<${visuallyHiddenTagName}
1940
+ aria-live="polite"
1941
+ data-announcement="sort-state"
1942
+ >
1943
+ ${getSortAnnouncement}
1944
+ </${visuallyHiddenTagName}>`)}
1945
+ ${(_) => renderSortIcons(context)}
1946
+ </div>
1947
+ <slot
1948
+ name="action-items"
1949
+ ${(0, _microsoft_fast_element.slotted)("_actionItemsSlottedContent")}
1950
+ ></slot>
1951
+ </div>
1952
+ </template>
1953
+ `;
1954
+ };
1955
+ //#endregion
1956
+ //#region src/lib/data-grid/definition.ts
1957
+ /** @internal */
1958
+ var dataGridCellDefinition = require_vivid_element.defineVividComponent("data-grid-cell", DataGridCell, DataGridCellTemplate, [require_definition.iconDefinition, require_definition$1.visuallyHiddenDefinition], { styles: data_grid_cell_default });
1959
+ /** @internal */
1960
+ var dataGridRowDefinition = require_vivid_element.defineVividComponent("data-grid-row", DataGridRow, DataGridRowTemplate, [dataGridCellDefinition], { styles: data_grid_row_default });
1961
+ /** @internal */
1962
+ var dataGridDefinition = require_vivid_element.defineVividComponent("data-grid", DataGrid, DataGridTemplate, [dataGridRowDefinition], { styles: data_grid_default });
1963
+ /**
1964
+ * Registers the data-grid element with the design system.
29
1965
  *
30
1966
  * @param prefix - the prefix to use for the component name
31
1967
  */
32
- var registerDivider = require_vivid_element.createRegisterFunction(dividerDefinition);
1968
+ var registerDataGrid = require_vivid_element.createRegisterFunction(dataGridDefinition);
33
1969
  //#endregion
34
- Object.defineProperty(exports, "dividerDefinition", {
1970
+ Object.defineProperty(exports, "DataGrid", {
1971
+ enumerable: true,
1972
+ get: function() {
1973
+ return DataGrid;
1974
+ }
1975
+ });
1976
+ Object.defineProperty(exports, "DataGridCell", {
1977
+ enumerable: true,
1978
+ get: function() {
1979
+ return DataGridCell;
1980
+ }
1981
+ });
1982
+ Object.defineProperty(exports, "DataGridRow", {
1983
+ enumerable: true,
1984
+ get: function() {
1985
+ return DataGridRow;
1986
+ }
1987
+ });
1988
+ Object.defineProperty(exports, "dataGridCellDefinition", {
1989
+ enumerable: true,
1990
+ get: function() {
1991
+ return dataGridCellDefinition;
1992
+ }
1993
+ });
1994
+ Object.defineProperty(exports, "dataGridDefinition", {
1995
+ enumerable: true,
1996
+ get: function() {
1997
+ return dataGridDefinition;
1998
+ }
1999
+ });
2000
+ Object.defineProperty(exports, "dataGridRowDefinition", {
35
2001
  enumerable: true,
36
2002
  get: function() {
37
- return dividerDefinition;
2003
+ return dataGridRowDefinition;
38
2004
  }
39
2005
  });
40
- Object.defineProperty(exports, "registerDivider", {
2006
+ Object.defineProperty(exports, "registerDataGrid", {
41
2007
  enumerable: true,
42
2008
  get: function() {
43
- return registerDivider;
2009
+ return registerDataGrid;
44
2010
  }
45
2011
  });