@vonage/vivid 5.23.1 → 5.25.0

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