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