@vonage/vivid 5.2.0 → 5.4.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 (433) hide show
  1. package/accordion-item/definition.cjs +2 -1
  2. package/accordion-item/definition.js +3 -2
  3. package/alert/definition.cjs +1 -1
  4. package/alert/definition.js +2 -2
  5. package/alert/index.cjs +1 -1
  6. package/alert/index.js +1 -1
  7. package/audio-player/definition.cjs +4 -2
  8. package/audio-player/definition.js +4 -2
  9. package/audio-player/index.cjs +5 -3
  10. package/audio-player/index.js +5 -3
  11. package/badge/definition.js +1 -1
  12. package/badge/index.cjs +2 -2
  13. package/badge/index.js +4 -4
  14. package/banner/definition.js +1 -1
  15. package/banner/index.cjs +3 -3
  16. package/banner/index.js +6 -6
  17. package/breadcrumb-item/index.cjs +1 -1
  18. package/breadcrumb-item/index.js +1 -1
  19. package/bundled/affix.cjs +7 -7
  20. package/bundled/affix.js +5 -5
  21. package/bundled/anchored.cjs +1 -1
  22. package/bundled/anchored.js +6 -6
  23. package/bundled/attribute-binding-behaviour.cjs +1 -1
  24. package/bundled/attribute-binding-behaviour.js +15 -13
  25. package/bundled/base-color-picker.cjs +13 -0
  26. package/bundled/base-color-picker.js +194 -0
  27. package/bundled/button.cjs +1 -1
  28. package/bundled/button.js +2 -2
  29. package/bundled/calendar-picker.template.cjs +7 -7
  30. package/bundled/calendar-picker.template.js +118 -118
  31. package/bundled/char-count.cjs +1 -1
  32. package/bundled/char-count.js +1 -1
  33. package/bundled/children.cjs +1 -1
  34. package/bundled/children.js +28 -20
  35. package/bundled/definition.cjs +3 -3
  36. package/bundled/definition.js +38 -38
  37. package/bundled/definition10.cjs +72 -18
  38. package/bundled/definition10.js +351 -65
  39. package/bundled/definition11.cjs +19 -10
  40. package/bundled/definition11.js +217 -36
  41. package/bundled/definition12.cjs +10 -1
  42. package/bundled/definition12.js +38 -14
  43. package/bundled/definition13.cjs +1 -73
  44. package/bundled/definition13.js +15 -354
  45. package/bundled/definition15.cjs +1 -1
  46. package/bundled/definition15.js +1 -1
  47. package/bundled/definition16.cjs +2 -2
  48. package/bundled/definition16.js +8 -8
  49. package/bundled/definition17.cjs +7 -7
  50. package/bundled/definition17.js +17 -17
  51. package/bundled/definition19.cjs +23 -24
  52. package/bundled/definition19.js +151 -163
  53. package/bundled/definition2.cjs +9 -5
  54. package/bundled/definition2.js +21 -17
  55. package/bundled/definition22.cjs +9 -9
  56. package/bundled/definition22.js +31 -31
  57. package/bundled/definition3.cjs +1 -1
  58. package/bundled/definition3.js +1 -1
  59. package/bundled/definition6.cjs +3 -3
  60. package/bundled/definition6.js +28 -28
  61. package/bundled/definition7.cjs +1 -1
  62. package/bundled/definition7.js +6 -6
  63. package/bundled/definition8.cjs +2 -2
  64. package/bundled/definition8.js +4 -4
  65. package/bundled/definition9.cjs +5 -5
  66. package/bundled/definition9.js +394 -392
  67. package/bundled/delegates-aria.cjs +1 -1
  68. package/bundled/delegates-aria.js +59 -46
  69. package/bundled/form-associated.cjs +1 -1
  70. package/bundled/form-associated.js +3 -3
  71. package/bundled/host-semantics.cjs +1 -1
  72. package/bundled/host-semantics.js +48 -34
  73. package/bundled/listbox.cjs +1 -1
  74. package/bundled/listbox.js +82 -102
  75. package/bundled/localized.cjs +1 -1
  76. package/bundled/localized.js +51 -36
  77. package/bundled/mixins.cjs +18 -18
  78. package/bundled/mixins.js +99 -93
  79. package/bundled/normalize.cjs +1 -0
  80. package/bundled/normalize.js +7 -0
  81. package/bundled/picker-field.template.cjs +1 -1
  82. package/bundled/picker-field.template.js +4 -4
  83. package/bundled/ref.cjs +1 -1
  84. package/bundled/ref.js +8 -25
  85. package/bundled/repeat.cjs +1 -1
  86. package/bundled/repeat.js +459 -233
  87. package/bundled/slider.template.cjs +1 -1
  88. package/bundled/slider.template.js +2 -2
  89. package/bundled/slotted.cjs +1 -1
  90. package/bundled/slotted.js +62 -45
  91. package/bundled/time-selection-picker.template.cjs +1 -1
  92. package/bundled/time-selection-picker.template.js +5 -5
  93. package/bundled/vivid-element.cjs +5 -1
  94. package/bundled/vivid-element.js +2159 -1162
  95. package/bundled/when.cjs +1 -1
  96. package/bundled/when.js +8 -7
  97. package/calendar/definition.cjs +1 -1
  98. package/calendar/definition.js +2 -2
  99. package/calendar/index.cjs +1 -1
  100. package/calendar/index.js +15 -15
  101. package/calendar-event/index.cjs +1 -1
  102. package/calendar-event/index.js +1 -1
  103. package/card/definition.cjs +11 -3
  104. package/card/definition.js +11 -3
  105. package/card/index.cjs +19 -11
  106. package/card/index.js +35 -27
  107. package/color-picker/definition.cjs +1079 -0
  108. package/color-picker/definition.js +1073 -0
  109. package/color-picker/index.cjs +127 -0
  110. package/color-picker/index.js +726 -0
  111. package/combobox/definition.cjs +8 -28
  112. package/combobox/definition.js +10 -30
  113. package/combobox/index.cjs +7 -7
  114. package/combobox/index.js +60 -74
  115. package/contextual-help/index.cjs +1 -1
  116. package/contextual-help/index.js +1 -1
  117. package/custom-elements.json +1670 -163
  118. package/data-grid/definition.cjs +862 -27
  119. package/data-grid/definition.js +863 -28
  120. package/data-grid/index.cjs +25 -25
  121. package/data-grid/index.js +175 -168
  122. package/date-picker/definition.cjs +1 -1
  123. package/date-picker/definition.js +1 -1
  124. package/date-picker/index.cjs +1 -1
  125. package/date-picker/index.js +2 -2
  126. package/date-range-picker/definition.cjs +1 -1
  127. package/date-range-picker/definition.js +1 -1
  128. package/date-range-picker/index.cjs +1 -1
  129. package/date-range-picker/index.js +2 -2
  130. package/date-time-picker/definition.cjs +1 -1
  131. package/date-time-picker/definition.js +1 -1
  132. package/date-time-picker/index.cjs +1 -1
  133. package/date-time-picker/index.js +2 -2
  134. package/dial-pad/definition.cjs +4 -0
  135. package/dial-pad/definition.js +4 -0
  136. package/dial-pad/index.cjs +3 -3
  137. package/dial-pad/index.js +42 -39
  138. package/dialog/definition.cjs +6 -3
  139. package/dialog/definition.js +6 -3
  140. package/dialog/index.cjs +22 -19
  141. package/dialog/index.js +48 -45
  142. package/elevation/definition.cjs +1 -1
  143. package/elevation/definition.js +1 -1
  144. package/empty-state/definition.cjs +7 -2
  145. package/empty-state/definition.js +7 -2
  146. package/empty-state/index.cjs +10 -5
  147. package/empty-state/index.js +18 -13
  148. package/fab/definition.js +1 -1
  149. package/fab/index.cjs +2 -2
  150. package/fab/index.js +4 -4
  151. package/file-picker/definition.cjs +2 -2
  152. package/file-picker/definition.js +3 -3
  153. package/file-picker/index.cjs +1 -1
  154. package/file-picker/index.js +4 -4
  155. package/header/definition.cjs +1 -1
  156. package/header/definition.js +1 -1
  157. package/icon/definition.cjs +10 -6
  158. package/icon/definition.js +10 -6
  159. package/index.cjs +7 -4
  160. package/index.js +3 -3
  161. package/lib/accordion/accordion.d.ts +1 -1
  162. package/lib/accordion/definition.d.ts +1 -1
  163. package/lib/accordion-item/accordion-item.d.ts +2 -2
  164. package/lib/action-group/action-group.d.ts +2 -2
  165. package/lib/alert/alert.d.ts +4 -4
  166. package/lib/audio-player/audio-player.d.ts +3 -3
  167. package/lib/avatar/avatar.d.ts +2 -2
  168. package/lib/badge/badge.d.ts +2 -2
  169. package/lib/banner/banner.d.ts +6 -6
  170. package/lib/breadcrumb/breadcrumb.d.ts +2 -2
  171. package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
  172. package/lib/button/button.d.ts +6 -6
  173. package/lib/button/button.template.d.ts +2 -1
  174. package/lib/calendar/calendar.d.ts +1 -1
  175. package/lib/calendar-event/calendar-event.d.ts +2 -2
  176. package/lib/card/card.d.ts +2 -2
  177. package/lib/checkbox/checkbox.d.ts +12 -12
  178. package/lib/color-picker/color-picker.d.ts +2420 -0
  179. package/lib/color-picker/color-picker.template.d.ts +3 -0
  180. package/lib/color-picker/definition.d.ts +4 -0
  181. package/lib/color-picker/locale.d.ts +9 -0
  182. package/lib/combobox/combobox.d.ts +15 -14
  183. package/lib/combobox/combobox.options.d.ts +1 -1
  184. package/lib/components.d.ts +1 -0
  185. package/lib/data-grid/data-grid-cell.d.ts +4 -4
  186. package/lib/data-grid/data-grid-row.d.ts +3 -4
  187. package/lib/data-grid/data-grid.d.ts +1 -2
  188. package/lib/date-picker/date-picker.d.ts +54 -54
  189. package/lib/date-range-picker/date-range-picker.d.ts +28 -28
  190. package/lib/date-time-picker/date-time-picker.d.ts +56 -56
  191. package/lib/dial-pad/dial-pad.d.ts +3 -2
  192. package/lib/dialog/dialog.d.ts +4 -4
  193. package/lib/divider/divider.d.ts +3 -3
  194. package/lib/fab/fab.d.ts +2 -2
  195. package/lib/file-picker/file-picker.d.ts +14 -14
  196. package/lib/header/header.d.ts +2 -2
  197. package/lib/menu/menu.d.ts +4 -4
  198. package/lib/menu-item/menu-item-role.d.ts +1 -1
  199. package/lib/menu-item/menu-item.d.ts +4 -4
  200. package/lib/nav/nav.d.ts +2 -2
  201. package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
  202. package/lib/nav-item/nav-item.d.ts +4 -4
  203. package/lib/note/note.d.ts +2 -2
  204. package/lib/number-field/number-field.d.ts +18 -18
  205. package/lib/option/option.d.ts +4 -4
  206. package/lib/pagination/pagination.d.ts +2 -2
  207. package/lib/popup/popup.d.ts +1 -1
  208. package/lib/progress/progress.d.ts +2 -2
  209. package/lib/progress-ring/progress-ring.d.ts +2 -2
  210. package/lib/radio/radio.d.ts +6 -6
  211. package/lib/radio-group/radio-group.d.ts +2 -2
  212. package/lib/range-slider/range-slider.d.ts +6 -6
  213. package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
  214. package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
  215. package/lib/searchable-select/locale.d.ts +4 -0
  216. package/lib/searchable-select/option-tag.d.ts +2 -2
  217. package/lib/searchable-select/searchable-select.d.ts +21 -18
  218. package/lib/select/select.d.ts +19 -17
  219. package/lib/selectable-box/selectable-box.d.ts +2 -2
  220. package/lib/simple-color-picker/locale.d.ts +0 -1
  221. package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
  222. package/lib/slider/slider.d.ts +7 -7
  223. package/lib/split-button/split-button.d.ts +6 -6
  224. package/lib/switch/switch.d.ts +4 -4
  225. package/lib/tab/tab.d.ts +6 -6
  226. package/lib/tab-panel/tab-panel.d.ts +2 -2
  227. package/lib/tabs/tabs.d.ts +2 -2
  228. package/lib/tag/tag.d.ts +6 -6
  229. package/lib/tag-group/tag-group.d.ts +2 -2
  230. package/lib/tag-name-map.d.ts +2 -1
  231. package/lib/text-area/text-area.d.ts +17 -17
  232. package/lib/text-field/text-field.d.ts +19 -19
  233. package/lib/time-picker/time-picker.d.ts +28 -28
  234. package/lib/toggletip/toggletip.d.ts +4 -4
  235. package/lib/tooltip/tooltip.d.ts +2 -2
  236. package/lib/tree-item/tree-item.d.ts +4 -4
  237. package/lib/tree-view/tree-view.d.ts +2 -2
  238. package/lib/video-player/video-player.d.ts +2 -2
  239. package/locales/de-DE.cjs +17 -2
  240. package/locales/de-DE.js +17 -2
  241. package/locales/en-GB.cjs +17 -2
  242. package/locales/en-GB.js +17 -2
  243. package/locales/en-US.cjs +17 -2
  244. package/locales/en-US.js +17 -2
  245. package/locales/ja-JP.cjs +17 -2
  246. package/locales/ja-JP.js +17 -2
  247. package/locales/zh-CN.cjs +17 -2
  248. package/locales/zh-CN.js +17 -2
  249. package/menu/definition.cjs +6 -6
  250. package/menu/definition.js +7 -7
  251. package/nav-disclosure/definition.js +1 -1
  252. package/nav-item/definition.js +1 -1
  253. package/note/definition.js +1 -1
  254. package/note/index.cjs +2 -2
  255. package/note/index.js +4 -4
  256. package/number-field/definition.cjs +1 -1
  257. package/number-field/definition.js +3 -3
  258. package/number-field/index.cjs +5 -5
  259. package/number-field/index.js +21 -21
  260. package/option/definition.cjs +6 -77
  261. package/option/definition.js +3 -78
  262. package/option/index.cjs +1 -1
  263. package/option/index.js +1 -1
  264. package/package.json +34 -8
  265. package/pagination/definition.cjs +2 -1
  266. package/pagination/definition.js +2 -1
  267. package/pagination/index.cjs +12 -12
  268. package/pagination/index.js +59 -59
  269. package/popup/definition.cjs +2 -2
  270. package/popup/definition.js +2 -2
  271. package/progress/index.cjs +1 -1
  272. package/progress/index.js +1 -1
  273. package/radio/definition.cjs +9 -9
  274. package/radio/definition.js +10 -10
  275. package/radio-group/definition.cjs +2 -1
  276. package/radio-group/definition.js +2 -1
  277. package/radio-group/index.cjs +5 -5
  278. package/radio-group/index.js +80 -77
  279. package/range-slider/definition.cjs +1 -1
  280. package/range-slider/definition.js +1 -1
  281. package/range-slider/index.cjs +1 -1
  282. package/range-slider/index.js +1 -1
  283. package/rich-text-editor/definition.cjs +3 -4
  284. package/rich-text-editor/definition.js +3 -4
  285. package/rich-text-editor/index.cjs +27 -27
  286. package/rich-text-editor/index.js +1208 -1198
  287. package/searchable-select/definition.cjs +106 -14
  288. package/searchable-select/definition.js +107 -15
  289. package/searchable-select/index.cjs +81 -69
  290. package/searchable-select/index.js +362 -276
  291. package/select/definition.cjs +25 -42
  292. package/select/definition.js +26 -43
  293. package/selectable-box/definition.cjs +1 -1
  294. package/selectable-box/definition.js +1 -1
  295. package/selectable-box/index.cjs +3 -3
  296. package/selectable-box/index.js +20 -20
  297. package/shared/aria/aria-change-subscription.d.ts +0 -1
  298. package/shared/aria/aria-mixin.d.ts +3 -3
  299. package/shared/aria/delegate-aria-behavior.d.ts +5 -10
  300. package/shared/aria/delegates-aria.d.ts +3 -3
  301. package/shared/aria/host-semantics-behavior.d.ts +5 -8
  302. package/shared/aria/host-semantics.d.ts +3 -3
  303. package/shared/color-picker/base-color-picker.d.ts +436 -0
  304. package/shared/color-picker/index.d.ts +1 -0
  305. package/shared/color-picker/locale.d.ts +3 -0
  306. package/shared/color-picker/utils.d.ts +1 -0
  307. package/shared/deprecation/replaced-props.d.ts +317 -2
  308. package/shared/design-system/defineVividComponent.d.ts +2 -2
  309. package/shared/feedback/feedback-message.d.ts +2 -2
  310. package/shared/feedback/mixins.d.ts +4 -4
  311. package/shared/foundation/button/button.d.ts +4 -4
  312. package/shared/foundation/form-associated/form-associated.d.ts +4 -4
  313. package/shared/foundation/listbox/listbox.d.ts +4 -0
  314. package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
  315. package/shared/localization/Locale.d.ts +4 -0
  316. package/shared/patterns/affix.d.ts +4 -4
  317. package/shared/patterns/anchored.d.ts +4 -4
  318. package/shared/patterns/char-count/char-count.d.ts +2 -2
  319. package/shared/patterns/form-elements/form-element.d.ts +4 -4
  320. package/shared/patterns/form-elements/with-contextual-help.d.ts +6 -6
  321. package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
  322. package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
  323. package/shared/patterns/linkable.d.ts +2 -2
  324. package/shared/patterns/localized.d.ts +2 -2
  325. package/shared/patterns/trapped-focus.d.ts +2 -2
  326. package/shared/picker-field/mixins/calendar-picker.d.ts +14 -14
  327. package/shared/picker-field/mixins/calendar-picker.template.d.ts +14 -14
  328. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
  329. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +28 -28
  330. package/shared/picker-field/mixins/single-date-picker.d.ts +40 -40
  331. package/shared/picker-field/mixins/single-value-picker.d.ts +12 -12
  332. package/shared/picker-field/mixins/time-selection-picker.d.ts +29 -29
  333. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +28 -28
  334. package/shared/picker-field/picker-field.d.ts +14 -14
  335. package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
  336. package/shared/templating/render-in-light-dom.d.ts +13 -12
  337. package/side-drawer/index.cjs +1 -1
  338. package/side-drawer/index.js +1 -1
  339. package/simple-color-picker/definition.cjs +29 -216
  340. package/simple-color-picker/definition.js +30 -217
  341. package/simple-color-picker/index.cjs +9 -21
  342. package/simple-color-picker/index.js +71 -185
  343. package/slider/definition.cjs +1 -1
  344. package/slider/definition.js +1 -1
  345. package/split-button/definition.js +1 -1
  346. package/styles/core/all.css +1 -1
  347. package/styles/core/theme.css +1 -1
  348. package/styles/core/typography.css +1 -1
  349. package/styles/tokens/theme-dark.css +4 -4
  350. package/styles/tokens/theme-light.css +4 -4
  351. package/styles/tokens/vivid-2-compat.css +1 -1
  352. package/switch/index.cjs +2 -2
  353. package/switch/index.js +4 -4
  354. package/tab/definition.js +1 -1
  355. package/tabs/definition.cjs +1 -1
  356. package/tabs/definition.js +2 -2
  357. package/tabs/index.cjs +2 -2
  358. package/tabs/index.js +16 -16
  359. package/tag/definition.js +1 -1
  360. package/tag/index.cjs +1 -1
  361. package/tag/index.js +1 -1
  362. package/text-area/index.cjs +3 -3
  363. package/text-area/index.js +8 -8
  364. package/text-field/definition.cjs +2 -2
  365. package/text-field/definition.js +4 -4
  366. package/text-field/index.cjs +1 -1
  367. package/text-field/index.js +1 -1
  368. package/time-picker/definition.cjs +1 -1
  369. package/time-picker/definition.js +1 -1
  370. package/time-picker/index.cjs +1 -1
  371. package/time-picker/index.js +2 -2
  372. package/toggletip/definition.cjs +2 -2
  373. package/toggletip/definition.js +3 -3
  374. package/tooltip/definition.cjs +1 -1
  375. package/tooltip/definition.js +1 -1
  376. package/tree-item/definition.cjs +1 -1
  377. package/tree-item/definition.js +1 -1
  378. package/tree-view/definition.cjs +2 -2
  379. package/tree-view/definition.js +3 -3
  380. package/tree-view/index.cjs +2 -2
  381. package/tree-view/index.js +6 -6
  382. package/unbundled/_commonjsHelpers.cjs +36 -0
  383. package/unbundled/_commonjsHelpers.js +32 -0
  384. package/unbundled/affix.cjs +1 -1
  385. package/unbundled/affix.js +2 -2
  386. package/unbundled/attribute-binding-behaviour.cjs +11 -10
  387. package/unbundled/attribute-binding-behaviour.js +11 -10
  388. package/unbundled/base-color-picker.cjs +278 -0
  389. package/unbundled/base-color-picker.js +275 -0
  390. package/unbundled/button.cjs +1 -1
  391. package/unbundled/button.js +2 -2
  392. package/unbundled/calendar-picker.template.cjs +4 -4
  393. package/unbundled/calendar-picker.template.js +5 -5
  394. package/unbundled/definition.js +1 -1
  395. package/unbundled/definition2.cjs +1 -1
  396. package/unbundled/definition2.js +3 -3
  397. package/unbundled/definition3.cjs +222 -140
  398. package/unbundled/definition3.js +220 -138
  399. package/unbundled/definition4.cjs +145 -235
  400. package/unbundled/definition4.js +143 -233
  401. package/unbundled/definition5.cjs +269 -27
  402. package/unbundled/definition5.js +267 -26
  403. package/unbundled/definition6.cjs +56 -0
  404. package/unbundled/definition6.js +52 -0
  405. package/unbundled/delegates-aria.cjs +67 -33
  406. package/unbundled/delegates-aria.js +69 -35
  407. package/unbundled/form-associated.cjs +2 -2
  408. package/unbundled/form-associated.js +3 -3
  409. package/unbundled/host-semantics.cjs +47 -22
  410. package/unbundled/host-semantics.js +48 -23
  411. package/unbundled/listbox.cjs +41 -63
  412. package/unbundled/listbox.js +39 -61
  413. package/unbundled/mixins.cjs +34 -27
  414. package/unbundled/mixins.js +35 -28
  415. package/unbundled/picker-field.template.cjs +3 -3
  416. package/unbundled/picker-field.template.js +4 -4
  417. package/unbundled/slider.template.cjs +1 -1
  418. package/unbundled/slider.template.js +1 -1
  419. package/unbundled/time-selection-picker.template.cjs +4 -4
  420. package/unbundled/time-selection-picker.template.js +5 -5
  421. package/unbundled/vivid-element.cjs +22 -15
  422. package/unbundled/vivid-element.js +23 -15
  423. package/video-player/definition.cjs +69047 -1
  424. package/video-player/definition.js +69047 -1
  425. package/video-player/index.cjs +36 -36
  426. package/video-player/index.js +1895 -1905
  427. package/visually-hidden/index.cjs +1 -1
  428. package/visually-hidden/index.js +1 -1
  429. package/vivid.api.json +719 -224
  430. package/bundled/option.cjs +0 -1
  431. package/bundled/option.js +0 -158
  432. package/unbundled/option.cjs +0 -217
  433. package/unbundled/option.js +0 -214
@@ -6,6 +6,7 @@ const icon_definition = require('../icon/definition.cjs');
6
6
  const vividElement = require('../unbundled/vivid-element.cjs');
7
7
  const visuallyHidden_definition = require('../visually-hidden/definition.cjs');
8
8
  const fastElement = require('@microsoft/fast-element');
9
+ const _commonjsHelpers = require('../unbundled/_commonjsHelpers.cjs');
9
10
  const fastWebUtilities = require('@microsoft/fast-web-utilities');
10
11
  const keyCodes = require('../unbundled/key-codes.cjs');
11
12
  const hostSemantics = require('../unbundled/host-semantics.cjs');
@@ -17,6 +18,837 @@ const dataGridRowStyles = ".base.connotation-cta{--_connotation-color-primary: v
17
18
 
18
19
  const dataGridCellStyles = ":host{block-size:100%;min-inline-size:80px}:host(:focus-visible){outline:none}:host([data-fixed]){position:sticky;z-index:5;background:var(--data-grid-cell-background, var(--vvd-color-surface-2dp))}:host([data-fixed]):before{position:absolute;z-index:1;top:0;right:0;width:1px;block-size:100%;box-shadow:4px 0 4px #0000001a,2px 0 2px #0000000d,1px 0 1px #0000000d;content:\"\";pointer-events:none}.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{display:flex;box-sizing:border-box;align-items:center;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*(48 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:13px 14px;padding-inline:12px}:host(:focus-visible) .base{--focus-stroke-gap-color: transparent;box-shadow:0 0 0 4px color-mix(in srgb,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*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_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(:is([selected]):not([cell-type=columnheader])) .base{background-color:var(--_appearance-color-fill)}slot{display:block;overflow:hidden;text-overflow:ellipsis;white-space:var(--data-grid-cell-white-space, var(--_data-grid-cell-default-white-space))}:host(:not([cell-type=columnheader][aria-sort])) slot{inline-size:100%}.header-icon{margin-inline-start:16px}";
19
20
 
21
+ let kernelMode;
22
+ const kernelAttr = "fast-kernel";
23
+ try {
24
+ if (document.currentScript) {
25
+ kernelMode = document.currentScript.getAttribute(kernelAttr);
26
+ }
27
+ else {
28
+ const scripts = document.getElementsByTagName("script");
29
+ const currentScript = scripts[scripts.length - 1];
30
+ kernelMode = currentScript.getAttribute(kernelAttr);
31
+ }
32
+ }
33
+ catch (e) {
34
+ kernelMode = "isolate";
35
+ }
36
+ let KernelServiceId;
37
+ switch (kernelMode) {
38
+ case "share": // share the kernel across major versions
39
+ KernelServiceId = Object.freeze({
40
+ updateQueue: 1,
41
+ observable: 2,
42
+ contextEvent: 3,
43
+ elementRegistry: 4,
44
+ });
45
+ break;
46
+ case "share-v2": // only share the kernel with other v2 instances
47
+ KernelServiceId = Object.freeze({
48
+ updateQueue: 1.2,
49
+ observable: 2.2,
50
+ contextEvent: 3.2,
51
+ elementRegistry: 4.2,
52
+ });
53
+ break;
54
+ default:
55
+ // fully isolate the kernel from all other FAST instances
56
+ const postfix = `-${Math.random().toString(36).substring(2, 8)}`;
57
+ KernelServiceId = Object.freeze({
58
+ updateQueue: `1.2${postfix}`,
59
+ observable: `2.2${postfix}`,
60
+ contextEvent: `3.2${postfix}`,
61
+ elementRegistry: `4.2${postfix}`,
62
+ });
63
+ break;
64
+ }
65
+ /**
66
+ * Determines whether or not an object is a function.
67
+ * @public
68
+ */
69
+ const isFunction = (object) => typeof object === "function";
70
+ /**
71
+ * Determines whether or not an object is a string.
72
+ * @public
73
+ */
74
+ const isString = (object) => typeof object === "string";
75
+ /**
76
+ * A function which does nothing.
77
+ * @public
78
+ */
79
+ const noop = () => void 0;
80
+
81
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
82
+
83
+ (function ensureGlobalThis() {
84
+ if (typeof globalThis !== "undefined") {
85
+ // We're running in a modern environment.
86
+ return;
87
+ }
88
+ // @ts-ignore
89
+ if (typeof _commonjsHelpers.commonjsGlobal !== "undefined") {
90
+ // We're running in NodeJS
91
+ // @ts-ignore
92
+ _commonjsHelpers.commonjsGlobal.globalThis = _commonjsHelpers.commonjsGlobal;
93
+ }
94
+ else if (typeof self !== "undefined") {
95
+ self.globalThis = self;
96
+ }
97
+ else if (typeof window !== "undefined") {
98
+ // We're running in the browser's main thread.
99
+ window.globalThis = window;
100
+ }
101
+ else {
102
+ // Hopefully we never get here...
103
+ // Not all environments allow eval and Function. Use only as a last resort:
104
+ // eslint-disable-next-line no-new-func
105
+ const result = new Function("return this")();
106
+ result.globalThis = result;
107
+ }
108
+ })();
109
+
110
+ // ensure FAST global - duplicated debug.ts
111
+ const propConfig = {
112
+ configurable: false,
113
+ enumerable: false,
114
+ writable: false,
115
+ };
116
+ if (globalThis.FAST === void 0) {
117
+ Reflect.defineProperty(globalThis, "FAST", Object.assign({ value: Object.create(null) }, propConfig));
118
+ }
119
+ /**
120
+ * The FAST global.
121
+ * @public
122
+ */
123
+ const FAST = globalThis.FAST;
124
+ if (FAST.getById === void 0) {
125
+ const storage = Object.create(null);
126
+ Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) {
127
+ let found = storage[id];
128
+ if (found === void 0) {
129
+ found = initialize ? (storage[id] = initialize()) : null;
130
+ }
131
+ return found;
132
+ } }, propConfig));
133
+ }
134
+ if (FAST.error === void 0) {
135
+ Object.assign(FAST, {
136
+ warn() { },
137
+ error(code) {
138
+ return new Error(`Error ${code}`);
139
+ },
140
+ addMessages() { },
141
+ });
142
+ }
143
+ /**
144
+ * Creates a function capable of locating metadata associated with a type.
145
+ * @returns A metadata locator function.
146
+ * @internal
147
+ */
148
+ function createMetadataLocator() {
149
+ const metadataLookup = new WeakMap();
150
+ return function (target) {
151
+ let metadata = metadataLookup.get(target);
152
+ if (metadata === void 0) {
153
+ let currentTarget = Reflect.getPrototypeOf(target);
154
+ while (metadata === void 0 && currentTarget !== null) {
155
+ metadata = metadataLookup.get(currentTarget);
156
+ currentTarget = Reflect.getPrototypeOf(currentTarget);
157
+ }
158
+ metadata = metadata === void 0 ? [] : metadata.slice(0);
159
+ metadataLookup.set(target, metadata);
160
+ }
161
+ return metadata;
162
+ };
163
+ }
164
+ /**
165
+ * Makes a type noop for JSON serialization.
166
+ * @param type - The type to make noop for JSON serialization.
167
+ * @internal
168
+ */
169
+ function makeSerializationNoop(type) {
170
+ type.prototype.toJSON = noop;
171
+ }
172
+
173
+ const createHTML = html => html;
174
+ const fastTrustedType = globalThis.trustedTypes
175
+ ? globalThis.trustedTypes.createPolicy("fast-html", { createHTML })
176
+ : { createHTML };
177
+ let defaultPolicy = Object.freeze({
178
+ createHTML(value) {
179
+ return fastTrustedType.createHTML(value);
180
+ },
181
+ protect(tagName, aspect, aspectName, sink) {
182
+ return sink;
183
+ },
184
+ });
185
+ const fastPolicy = defaultPolicy;
186
+ /**
187
+ * Common DOM APIs.
188
+ * @public
189
+ */
190
+ const DOM = Object.freeze({
191
+ /**
192
+ * Gets the dom policy used by the templating system.
193
+ */
194
+ get policy() {
195
+ return defaultPolicy;
196
+ },
197
+ /**
198
+ * Sets the dom policy used by the templating system.
199
+ * @param policy - The policy to set.
200
+ * @remarks
201
+ * This API can only be called once, for security reasons. It should be
202
+ * called by the application developer at the start of their program.
203
+ */
204
+ setPolicy(value) {
205
+ if (defaultPolicy !== fastPolicy) {
206
+ throw FAST.error(1201 /* Message.onlySetDOMPolicyOnce */);
207
+ }
208
+ defaultPolicy = value;
209
+ },
210
+ /**
211
+ * Sets an attribute value on an element.
212
+ * @param element - The element to set the attribute value on.
213
+ * @param attributeName - The attribute name to set.
214
+ * @param value - The value of the attribute to set.
215
+ * @remarks
216
+ * If the value is `null` or `undefined`, the attribute is removed, otherwise
217
+ * it is set to the provided value using the standard `setAttribute` API.
218
+ */
219
+ setAttribute(element, attributeName, value) {
220
+ value === null || value === undefined
221
+ ? element.removeAttribute(attributeName)
222
+ : element.setAttribute(attributeName, value);
223
+ },
224
+ /**
225
+ * Sets a boolean attribute value.
226
+ * @param element - The element to set the boolean attribute value on.
227
+ * @param attributeName - The attribute name to set.
228
+ * @param value - The value of the attribute to set.
229
+ * @remarks
230
+ * If the value is true, the attribute is added; otherwise it is removed.
231
+ */
232
+ setBooleanAttribute(element, attributeName, value) {
233
+ value
234
+ ? element.setAttribute(attributeName, "")
235
+ : element.removeAttribute(attributeName);
236
+ },
237
+ });
238
+
239
+ /**
240
+ * The default UpdateQueue.
241
+ * @public
242
+ */
243
+ const Updates = FAST.getById(KernelServiceId.updateQueue, () => {
244
+ const tasks = [];
245
+ const pendingErrors = [];
246
+ const rAF = globalThis.requestAnimationFrame;
247
+ let updateAsync = true;
248
+ function throwFirstError() {
249
+ if (pendingErrors.length) {
250
+ throw pendingErrors.shift();
251
+ }
252
+ }
253
+ function tryRunTask(task) {
254
+ try {
255
+ task.call();
256
+ }
257
+ catch (error) {
258
+ if (updateAsync) {
259
+ pendingErrors.push(error);
260
+ setTimeout(throwFirstError, 0);
261
+ }
262
+ else {
263
+ tasks.length = 0;
264
+ throw error;
265
+ }
266
+ }
267
+ }
268
+ function process() {
269
+ const capacity = 1024;
270
+ let index = 0;
271
+ while (index < tasks.length) {
272
+ tryRunTask(tasks[index]);
273
+ index++;
274
+ // Prevent leaking memory for long chains of recursive calls to `enqueue`.
275
+ // If we call `enqueue` within a task scheduled by `enqueue`, the queue will
276
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
277
+ // shift tasks off the queue after they have been executed.
278
+ // Instead, we periodically shift 1024 tasks off the queue.
279
+ if (index > capacity) {
280
+ // Manually shift all values starting at the index back to the
281
+ // beginning of the queue.
282
+ for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) {
283
+ tasks[scan] = tasks[scan + index];
284
+ }
285
+ tasks.length -= index;
286
+ index = 0;
287
+ }
288
+ }
289
+ tasks.length = 0;
290
+ }
291
+ function enqueue(callable) {
292
+ tasks.push(callable);
293
+ if (tasks.length < 2) {
294
+ updateAsync ? rAF(process) : process();
295
+ }
296
+ }
297
+ return Object.freeze({
298
+ enqueue,
299
+ next: () => new Promise(enqueue),
300
+ process,
301
+ setMode: (isAsync) => (updateAsync = isAsync),
302
+ });
303
+ });
304
+
305
+ /**
306
+ * An implementation of {@link Notifier} that efficiently keeps track of
307
+ * subscribers interested in a specific change notification on an
308
+ * observable subject.
309
+ *
310
+ * @remarks
311
+ * This set is optimized for the most common scenario of 1 or 2 subscribers.
312
+ * With this in mind, it can store a subscriber in an internal field, allowing it to avoid Array#push operations.
313
+ * If the set ever exceeds two subscribers, it upgrades to an array automatically.
314
+ * @public
315
+ */
316
+ class SubscriberSet {
317
+ /**
318
+ * Creates an instance of SubscriberSet for the specified subject.
319
+ * @param subject - The subject that subscribers will receive notifications from.
320
+ * @param initialSubscriber - An initial subscriber to changes.
321
+ */
322
+ constructor(subject, initialSubscriber) {
323
+ this.sub1 = void 0;
324
+ this.sub2 = void 0;
325
+ this.spillover = void 0;
326
+ this.subject = subject;
327
+ this.sub1 = initialSubscriber;
328
+ }
329
+ /**
330
+ * Checks whether the provided subscriber has been added to this set.
331
+ * @param subscriber - The subscriber to test for inclusion in this set.
332
+ */
333
+ has(subscriber) {
334
+ return this.spillover === void 0
335
+ ? this.sub1 === subscriber || this.sub2 === subscriber
336
+ : this.spillover.indexOf(subscriber) !== -1;
337
+ }
338
+ /**
339
+ * Subscribes to notification of changes in an object's state.
340
+ * @param subscriber - The object that is subscribing for change notification.
341
+ */
342
+ subscribe(subscriber) {
343
+ const spillover = this.spillover;
344
+ if (spillover === void 0) {
345
+ if (this.has(subscriber)) {
346
+ return;
347
+ }
348
+ if (this.sub1 === void 0) {
349
+ this.sub1 = subscriber;
350
+ return;
351
+ }
352
+ if (this.sub2 === void 0) {
353
+ this.sub2 = subscriber;
354
+ return;
355
+ }
356
+ this.spillover = [this.sub1, this.sub2, subscriber];
357
+ this.sub1 = void 0;
358
+ this.sub2 = void 0;
359
+ }
360
+ else {
361
+ const index = spillover.indexOf(subscriber);
362
+ if (index === -1) {
363
+ spillover.push(subscriber);
364
+ }
365
+ }
366
+ }
367
+ /**
368
+ * Unsubscribes from notification of changes in an object's state.
369
+ * @param subscriber - The object that is unsubscribing from change notification.
370
+ */
371
+ unsubscribe(subscriber) {
372
+ const spillover = this.spillover;
373
+ if (spillover === void 0) {
374
+ if (this.sub1 === subscriber) {
375
+ this.sub1 = void 0;
376
+ }
377
+ else if (this.sub2 === subscriber) {
378
+ this.sub2 = void 0;
379
+ }
380
+ }
381
+ else {
382
+ const index = spillover.indexOf(subscriber);
383
+ if (index !== -1) {
384
+ spillover.splice(index, 1);
385
+ }
386
+ }
387
+ }
388
+ /**
389
+ * Notifies all subscribers.
390
+ * @param args - Data passed along to subscribers during notification.
391
+ */
392
+ notify(args) {
393
+ const spillover = this.spillover;
394
+ const subject = this.subject;
395
+ if (spillover === void 0) {
396
+ const sub1 = this.sub1;
397
+ const sub2 = this.sub2;
398
+ if (sub1 !== void 0) {
399
+ sub1.handleChange(subject, args);
400
+ }
401
+ if (sub2 !== void 0) {
402
+ sub2.handleChange(subject, args);
403
+ }
404
+ }
405
+ else {
406
+ for (let i = 0, ii = spillover.length; i < ii; ++i) {
407
+ spillover[i].handleChange(subject, args);
408
+ }
409
+ }
410
+ }
411
+ }
412
+ /**
413
+ * An implementation of Notifier that allows subscribers to be notified
414
+ * of individual property changes on an object.
415
+ * @public
416
+ */
417
+ class PropertyChangeNotifier {
418
+ /**
419
+ * Creates an instance of PropertyChangeNotifier for the specified subject.
420
+ * @param subject - The object that subscribers will receive notifications for.
421
+ */
422
+ constructor(subject) {
423
+ this.subscribers = {};
424
+ this.subjectSubscribers = null;
425
+ this.subject = subject;
426
+ }
427
+ /**
428
+ * Notifies all subscribers, based on the specified property.
429
+ * @param propertyName - The property name, passed along to subscribers during notification.
430
+ */
431
+ notify(propertyName) {
432
+ var _a, _b;
433
+ (_a = this.subscribers[propertyName]) === null || _a === void 0 ? void 0 : _a.notify(propertyName);
434
+ (_b = this.subjectSubscribers) === null || _b === void 0 ? void 0 : _b.notify(propertyName);
435
+ }
436
+ /**
437
+ * Subscribes to notification of changes in an object's state.
438
+ * @param subscriber - The object that is subscribing for change notification.
439
+ * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes.
440
+ */
441
+ subscribe(subscriber, propertyToWatch) {
442
+ var _a, _b;
443
+ let subscribers;
444
+ if (propertyToWatch) {
445
+ subscribers =
446
+ (_a = this.subscribers[propertyToWatch]) !== null && _a !== void 0 ? _a : (this.subscribers[propertyToWatch] = new SubscriberSet(this.subject));
447
+ }
448
+ else {
449
+ subscribers =
450
+ (_b = this.subjectSubscribers) !== null && _b !== void 0 ? _b : (this.subjectSubscribers = new SubscriberSet(this.subject));
451
+ }
452
+ subscribers.subscribe(subscriber);
453
+ }
454
+ /**
455
+ * Unsubscribes from notification of changes in an object's state.
456
+ * @param subscriber - The object that is unsubscribing from change notification.
457
+ * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching.
458
+ */
459
+ unsubscribe(subscriber, propertyToUnwatch) {
460
+ var _a, _b;
461
+ if (propertyToUnwatch) {
462
+ (_a = this.subscribers[propertyToUnwatch]) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber);
463
+ }
464
+ else {
465
+ (_b = this.subjectSubscribers) === null || _b === void 0 ? void 0 : _b.unsubscribe(subscriber);
466
+ }
467
+ }
468
+ }
469
+
470
+ /**
471
+ * Describes how the source's lifetime relates to its controller's lifetime.
472
+ * @public
473
+ */
474
+ const SourceLifetime = Object.freeze({
475
+ /**
476
+ * The source to controller lifetime relationship is unknown.
477
+ */
478
+ unknown: void 0,
479
+ /**
480
+ * The source and controller lifetimes are coupled to one another.
481
+ * They can/will be GC'd together.
482
+ */
483
+ coupled: 1,
484
+ });
485
+ /**
486
+ * Common Observable APIs.
487
+ * @public
488
+ */
489
+ FAST.getById(KernelServiceId.observable, () => {
490
+ const queueUpdate = Updates.enqueue;
491
+ const volatileRegex = /(:|&&|\|\||if|\?\.)/;
492
+ const notifierLookup = new WeakMap();
493
+ let watcher = void 0;
494
+ let createArrayObserver = (array) => {
495
+ throw FAST.error(1101 /* Message.needsArrayObservation */);
496
+ };
497
+ function getNotifier(source) {
498
+ var _a;
499
+ let found = (_a = source.$fastController) !== null && _a !== void 0 ? _a : notifierLookup.get(source);
500
+ if (found === void 0) {
501
+ Array.isArray(source)
502
+ ? (found = createArrayObserver(source))
503
+ : notifierLookup.set(source, (found = new PropertyChangeNotifier(source)));
504
+ }
505
+ return found;
506
+ }
507
+ const getAccessors = createMetadataLocator();
508
+ class DefaultObservableAccessor {
509
+ constructor(name) {
510
+ this.name = name;
511
+ this.field = `_${name}`;
512
+ this.callback = `${name}Changed`;
513
+ }
514
+ getValue(source) {
515
+ if (watcher !== void 0) {
516
+ watcher.watch(source, this.name);
517
+ }
518
+ return source[this.field];
519
+ }
520
+ setValue(source, newValue) {
521
+ const field = this.field;
522
+ const oldValue = source[field];
523
+ if (oldValue !== newValue) {
524
+ source[field] = newValue;
525
+ const callback = source[this.callback];
526
+ if (isFunction(callback)) {
527
+ callback.call(source, oldValue, newValue);
528
+ }
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)) {
555
+ controller.onUnbind(this);
556
+ }
557
+ return value;
558
+ }
559
+ requiresUnbind(controller) {
560
+ return (controller.sourceLifetime !== SourceLifetime.coupled ||
561
+ this.first !== this.last ||
562
+ this.first.propertySource !== controller.source);
563
+ }
564
+ unbind(controller) {
565
+ this.dispose();
566
+ }
567
+ observe(source, context) {
568
+ if (this.needsRefresh && this.last !== null) {
569
+ this.dispose();
570
+ }
571
+ const previousWatcher = watcher;
572
+ watcher = this.needsRefresh ? this : void 0;
573
+ this.needsRefresh = this.isVolatileBinding;
574
+ let result;
575
+ try {
576
+ result = this.expression(source, context);
577
+ }
578
+ finally {
579
+ watcher = previousWatcher;
580
+ }
581
+ return result;
582
+ }
583
+ // backwards compat with v1 kernel
584
+ disconnect() {
585
+ this.dispose();
586
+ }
587
+ dispose() {
588
+ if (this.last !== null) {
589
+ let current = this.first;
590
+ while (current !== void 0) {
591
+ current.notifier.unsubscribe(this, current.propertyName);
592
+ current = current.next;
593
+ }
594
+ this.last = null;
595
+ this.needsRefresh = this.needsQueue = this.isAsync;
596
+ }
597
+ }
598
+ watch(propertySource, propertyName) {
599
+ const prev = this.last;
600
+ const notifier = getNotifier(propertySource);
601
+ const current = prev === null ? this.first : {};
602
+ current.propertySource = propertySource;
603
+ current.propertyName = propertyName;
604
+ current.notifier = notifier;
605
+ notifier.subscribe(this, propertyName);
606
+ if (prev !== null) {
607
+ if (!this.needsRefresh) {
608
+ // Declaring the variable prior to assignment below circumvents
609
+ // a bug in Angular's optimization process causing infinite recursion
610
+ // of this watch() method. Details https://github.com/microsoft/fast/issues/4969
611
+ let prevValue;
612
+ watcher = void 0;
613
+ /* eslint-disable-next-line */
614
+ prevValue = prev.propertySource[prev.propertyName];
615
+ /* eslint-disable-next-line */
616
+ watcher = this;
617
+ if (propertySource === prevValue) {
618
+ this.needsRefresh = true;
619
+ }
620
+ }
621
+ prev.next = current;
622
+ }
623
+ this.last = current;
624
+ }
625
+ handleChange() {
626
+ if (this.needsQueue) {
627
+ this.needsQueue = false;
628
+ queueUpdate(this);
629
+ }
630
+ else if (!this.isAsync) {
631
+ this.call();
632
+ }
633
+ }
634
+ call() {
635
+ if (this.last !== null) {
636
+ this.needsQueue = this.isAsync;
637
+ this.notify(this);
638
+ }
639
+ }
640
+ *records() {
641
+ let next = this.first;
642
+ while (next !== void 0) {
643
+ yield next;
644
+ next = next.next;
645
+ }
646
+ }
647
+ }
648
+ makeSerializationNoop(ExpressionNotifierImplementation);
649
+ return Object.freeze({
650
+ /**
651
+ * @internal
652
+ * @param factory - The factory used to create array observers.
653
+ */
654
+ setArrayObserverFactory(factory) {
655
+ createArrayObserver = factory;
656
+ },
657
+ /**
658
+ * Gets a notifier for an object or Array.
659
+ * @param source - The object or Array to get the notifier for.
660
+ */
661
+ getNotifier,
662
+ /**
663
+ * Records a property change for a source object.
664
+ * @param source - The object to record the change against.
665
+ * @param propertyName - The property to track as changed.
666
+ */
667
+ track(source, propertyName) {
668
+ watcher && watcher.watch(source, propertyName);
669
+ },
670
+ /**
671
+ * Notifies watchers that the currently executing property getter or function is volatile
672
+ * with respect to its observable dependencies.
673
+ */
674
+ trackVolatile() {
675
+ watcher && (watcher.needsRefresh = true);
676
+ },
677
+ /**
678
+ * Notifies subscribers of a source object of changes.
679
+ * @param source - the object to notify of changes.
680
+ * @param args - The change args to pass to subscribers.
681
+ */
682
+ notify(source, args) {
683
+ /* eslint-disable-next-line @typescript-eslint/no-use-before-define */
684
+ getNotifier(source).notify(args);
685
+ },
686
+ /**
687
+ * Defines an observable property on an object or prototype.
688
+ * @param target - The target object to define the observable on.
689
+ * @param nameOrAccessor - The name of the property to define as observable;
690
+ * or a custom accessor that specifies the property name and accessor implementation.
691
+ */
692
+ defineProperty(target, nameOrAccessor) {
693
+ if (isString(nameOrAccessor)) {
694
+ nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor);
695
+ }
696
+ getAccessors(target).push(nameOrAccessor);
697
+ Reflect.defineProperty(target, nameOrAccessor.name, {
698
+ enumerable: true,
699
+ get() {
700
+ return nameOrAccessor.getValue(this);
701
+ },
702
+ set(newValue) {
703
+ nameOrAccessor.setValue(this, newValue);
704
+ },
705
+ });
706
+ },
707
+ /**
708
+ * Finds all the observable accessors defined on the target,
709
+ * including its prototype chain.
710
+ * @param target - The target object to search for accessor on.
711
+ */
712
+ getAccessors,
713
+ /**
714
+ * Creates a {@link ExpressionNotifier} that can watch the
715
+ * provided {@link Expression} for changes.
716
+ * @param expression - The binding to observe.
717
+ * @param initialSubscriber - An initial subscriber to changes in the binding value.
718
+ * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation.
719
+ */
720
+ binding(expression, initialSubscriber, isVolatileBinding = this.isVolatileBinding(expression)) {
721
+ return new ExpressionNotifierImplementation(expression, initialSubscriber, isVolatileBinding);
722
+ },
723
+ /**
724
+ * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated
725
+ * on every evaluation of the value.
726
+ * @param expression - The binding to inspect.
727
+ */
728
+ isVolatileBinding(expression) {
729
+ return volatileRegex.test(expression.toString());
730
+ },
731
+ });
732
+ });
733
+ const contextEvent = FAST.getById(KernelServiceId.contextEvent, () => {
734
+ let current = null;
735
+ return {
736
+ get() {
737
+ return current;
738
+ },
739
+ set(event) {
740
+ current = event;
741
+ },
742
+ };
743
+ });
744
+ /**
745
+ * Provides additional contextual information available to behaviors and expressions.
746
+ * @public
747
+ */
748
+ const ExecutionContext = Object.freeze({
749
+ /**
750
+ * A default execution context.
751
+ */
752
+ default: {
753
+ index: 0,
754
+ length: 0,
755
+ get event() {
756
+ return ExecutionContext.getEvent();
757
+ },
758
+ eventDetail() {
759
+ return this.event.detail;
760
+ },
761
+ eventTarget() {
762
+ return this.event.target;
763
+ },
764
+ },
765
+ /**
766
+ * Gets the current event.
767
+ * @returns An event object.
768
+ */
769
+ getEvent() {
770
+ return contextEvent.get();
771
+ },
772
+ /**
773
+ * Sets the current event.
774
+ * @param event - An event object.
775
+ */
776
+ setEvent(event) {
777
+ contextEvent.set(event);
778
+ },
779
+ });
780
+
781
+ const marker = `fast-${Math.random().toString(36).substring(2, 8)}`;
782
+ let id = 0;
783
+ /** @internal */
784
+ const nextId = () => `${marker}-${++id}`;
785
+
786
+ /**
787
+ * Bridges between ViewBehaviors and HostBehaviors, enabling a host to
788
+ * control ViewBehaviors.
789
+ * @public
790
+ */
791
+ const ViewBehaviorOrchestrator = Object.freeze({
792
+ /**
793
+ * Creates a ViewBehaviorOrchestrator.
794
+ * @param source - The source to to associate behaviors with.
795
+ * @returns A ViewBehaviorOrchestrator.
796
+ */
797
+ create(source) {
798
+ const behaviors = [];
799
+ const targets = {};
800
+ let unbindables = null;
801
+ let isConnected = false;
802
+ return {
803
+ source,
804
+ context: ExecutionContext.default,
805
+ targets,
806
+ get isBound() {
807
+ return isConnected;
808
+ },
809
+ addBehaviorFactory(factory, target) {
810
+ var _a, _b, _c, _d;
811
+ const compiled = factory;
812
+ compiled.id = (_a = compiled.id) !== null && _a !== void 0 ? _a : nextId();
813
+ compiled.targetNodeId = (_b = compiled.targetNodeId) !== null && _b !== void 0 ? _b : nextId();
814
+ compiled.targetTagName = (_c = target.tagName) !== null && _c !== void 0 ? _c : null;
815
+ compiled.policy = (_d = compiled.policy) !== null && _d !== void 0 ? _d : DOM.policy;
816
+ this.addTarget(compiled.targetNodeId, target);
817
+ this.addBehavior(compiled.createBehavior());
818
+ },
819
+ addTarget(nodeId, target) {
820
+ targets[nodeId] = target;
821
+ },
822
+ addBehavior(behavior) {
823
+ behaviors.push(behavior);
824
+ if (isConnected) {
825
+ behavior.bind(this);
826
+ }
827
+ },
828
+ onUnbind(unbindable) {
829
+ if (unbindables === null) {
830
+ unbindables = [];
831
+ }
832
+ unbindables.push(unbindable);
833
+ },
834
+ connectedCallback(controller) {
835
+ if (!isConnected) {
836
+ isConnected = true;
837
+ behaviors.forEach(x => x.bind(this));
838
+ }
839
+ },
840
+ disconnectedCallback(controller) {
841
+ if (isConnected) {
842
+ isConnected = false;
843
+ if (unbindables !== null) {
844
+ unbindables.forEach(x => x.unbind(this));
845
+ }
846
+ }
847
+ },
848
+ };
849
+ },
850
+ });
851
+
20
852
  const DataGridCellSortStates = {
21
853
  none: "none",
22
854
  ascending: "ascending",
@@ -369,8 +1201,7 @@ class DataGridRow extends hostSemantics.HostSemantics(vividElement.VividElement)
369
1201
  this.rowType = DataGridRowTypes.default;
370
1202
  this.rowData = null;
371
1203
  this.columnDefinitions = null;
372
- this.cellsRepeatBehavior = null;
373
- this.cellsPlaceholder = null;
1204
+ this.behaviorOrchestrator = null;
374
1205
  /**
375
1206
  * @internal
376
1207
  */
@@ -422,16 +1253,18 @@ class DataGridRow extends hostSemantics.HostSemantics(vividElement.VividElement)
422
1253
  */
423
1254
  connectedCallback() {
424
1255
  super.connectedCallback();
425
- if (this.cellsRepeatBehavior === null) {
426
- this.cellsPlaceholder = document.createComment("");
427
- this.appendChild(this.cellsPlaceholder);
1256
+ if (this.behaviorOrchestrator === null) {
428
1257
  this.updateItemTemplate();
429
- this.cellsRepeatBehavior = new fastElement.RepeatDirective(
430
- (x) => x.columnDefinitions,
431
- (x) => x.activeCellItemTemplate,
432
- { positioning: true }
433
- ).createBehavior(this.cellsPlaceholder);
434
- this.$fastController.addBehaviors([this.cellsRepeatBehavior]);
1258
+ this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
1259
+ this.$fastController.addBehavior(this.behaviorOrchestrator);
1260
+ this.behaviorOrchestrator.addBehaviorFactory(
1261
+ new fastElement.RepeatDirective(
1262
+ fastElement.normalizeBinding((x) => x.columnDefinitions),
1263
+ fastElement.normalizeBinding((x) => x.activeCellItemTemplate),
1264
+ { positioning: true }
1265
+ ),
1266
+ this.appendChild(document.createComment(""))
1267
+ );
435
1268
  }
436
1269
  this.addEventListener("cell-focused", this.handleCellFocus);
437
1270
  this.addEventListener(fastWebUtilities.eventFocusOut, this.handleFocusout);
@@ -575,8 +1408,7 @@ const _DataGrid = class _DataGrid extends vividElement.VividElement {
575
1408
  * @internal
576
1409
  */
577
1410
  this.fixedColumnsPositions = [];
578
- this.rowsRepeatBehavior = null;
579
- this.rowsPlaceholder = null;
1411
+ this.behaviorOrchestrator = null;
580
1412
  this.generatedHeader = null;
581
1413
  this.isUpdatingFocus = false;
582
1414
  this.pendingFocusUpdate = false;
@@ -622,7 +1454,7 @@ const _DataGrid = class _DataGrid extends vividElement.VividElement {
622
1454
  this.queueRowIndexUpdate = () => {
623
1455
  if (!this.rowindexUpdateQueued) {
624
1456
  this.rowindexUpdateQueued = true;
625
- fastElement.DOM.queueUpdate(this.updateRowIndexes);
1457
+ fastElement.Updates.enqueue(this.updateRowIndexes);
626
1458
  }
627
1459
  };
628
1460
  this.updateRowIndexes = () => {
@@ -870,15 +1702,19 @@ const _DataGrid = class _DataGrid extends vividElement.VividElement {
870
1702
  if (this.rowItemTemplate === void 0) {
871
1703
  this.rowItemTemplate = this.defaultRowItemTemplate;
872
1704
  }
873
- this.rowsPlaceholder = document.createComment("");
874
- this.appendChild(this.rowsPlaceholder);
1705
+ if (this.behaviorOrchestrator === null) {
1706
+ this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
1707
+ this.$fastController.addBehavior(this.behaviorOrchestrator);
1708
+ this.behaviorOrchestrator.addBehaviorFactory(
1709
+ new fastElement.RepeatDirective(
1710
+ fastElement.normalizeBinding((x) => x.rowsData),
1711
+ fastElement.normalizeBinding((x) => x.rowItemTemplate),
1712
+ { positioning: true }
1713
+ ),
1714
+ this.appendChild(document.createComment(""))
1715
+ );
1716
+ }
875
1717
  this.toggleGeneratedHeader();
876
- this.rowsRepeatBehavior = new fastElement.RepeatDirective(
877
- (x) => x.rowsData,
878
- (x) => x.rowItemTemplate,
879
- { positioning: true }
880
- ).createBehavior(this.rowsPlaceholder);
881
- this.$fastController.addBehaviors([this.rowsRepeatBehavior]);
882
1718
  this.addEventListener("row-focused", this.handleRowFocus);
883
1719
  this.addEventListener(fastWebUtilities.eventFocus, this.handleFocus);
884
1720
  this.addEventListener(fastWebUtilities.eventKeyDown, this.handleKeydown);
@@ -886,7 +1722,7 @@ const _DataGrid = class _DataGrid extends vividElement.VividElement {
886
1722
  this.observer = new MutationObserver(this.onChildListChange);
887
1723
  this.observer.observe(this, { childList: true });
888
1724
  this.setupResizeObserver();
889
- fastElement.DOM.queueUpdate(this.queueRowIndexUpdate);
1725
+ fastElement.Updates.enqueue(this.queueRowIndexUpdate);
890
1726
  this.#setTabIndex();
891
1727
  fastElement.Observable.getNotifier(this).subscribe(
892
1728
  this.#changeHandler,
@@ -910,7 +1746,6 @@ const _DataGrid = class _DataGrid extends vividElement.VividElement {
910
1746
  this.resizeObserver.disconnect();
911
1747
  this.resizeObserver = void 0;
912
1748
  }
913
- this.rowsPlaceholder = null;
914
1749
  this.generatedHeader = null;
915
1750
  fastElement.Observable.getNotifier(this).unsubscribe(
916
1751
  this.#changeHandler,
@@ -1030,7 +1865,7 @@ const _DataGrid = class _DataGrid extends vividElement.VividElement {
1030
1865
  }
1031
1866
  if (this.pendingFocusUpdate === false) {
1032
1867
  this.pendingFocusUpdate = true;
1033
- fastElement.DOM.queueUpdate(() => this.updateFocus());
1868
+ fastElement.Updates.enqueue(() => this.updateFocus());
1034
1869
  }
1035
1870
  }
1036
1871
  updateFocus() {
@@ -1078,7 +1913,7 @@ const _DataGrid = class _DataGrid extends vividElement.VividElement {
1078
1913
  }
1079
1914
  selectionModeChanged(oldValue) {
1080
1915
  if (oldValue === void 0) {
1081
- fastElement.DOM.queueUpdate(this._resetSelection);
1916
+ fastElement.Updates.enqueue(this._resetSelection);
1082
1917
  return;
1083
1918
  }
1084
1919
  this._resetSelection(true);
@@ -1250,7 +2085,7 @@ function handleColumnSort(_, { event }) {
1250
2085
  }
1251
2086
  const DataGridTemplate = (context) => {
1252
2087
  const rowItemTemplate = createRowItemTemplate(context);
1253
- const rowTag = context.tagFor(DataGridRow);
2088
+ const rowTag = context.tagFor(DataGridRow, true);
1254
2089
  return fastElement.html`
1255
2090
  <template
1256
2091
  aria-multiselectable="${getMultiSelectAriaState}"