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