@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
@@ -1,7 +1,8 @@
1
1
  import { VwcIconElement as Icon, iconDefinition } from '../icon/definition.js';
2
2
  import { V as VividElement, d as defineVividComponent, c as createRegisterFunction } from '../unbundled/vivid-element.js';
3
3
  import { VwcVisuallyHiddenElement as VisuallyHidden, visuallyHiddenDefinition } from '../visually-hidden/definition.js';
4
- import { html, attr, observable, RepeatDirective, DOM, Observable, nullableNumberConverter, children, slotted, elements, when } from '@microsoft/fast-element';
4
+ import { html, attr, observable, RepeatDirective, normalizeBinding, Updates as Updates$1, Observable, nullableNumberConverter, children, slotted, elements, when } from '@microsoft/fast-element';
5
+ import { c as commonjsGlobal } from '../unbundled/_commonjsHelpers.js';
5
6
  import { eventFocusIn, eventFocusOut, eventKeyDown, keyEscape, keyFunction2, keyEnter, keyEnd, keyHome, eventFocus, keyPageDown, keyPageUp, keyArrowDown, keyArrowUp, classNames, keySpace } from '@microsoft/fast-web-utilities';
6
7
  import { k as keyArrowRight, a as keyArrowLeft } from '../unbundled/key-codes.js';
7
8
  import { H as HostSemantics, a as applyHostSemantics } from '../unbundled/host-semantics.js';
@@ -13,6 +14,837 @@ const dataGridRowStyles = ".base.connotation-cta{--_connotation-color-primary: v
13
14
 
14
15
  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}";
15
16
 
17
+ let kernelMode;
18
+ const kernelAttr = "fast-kernel";
19
+ try {
20
+ if (document.currentScript) {
21
+ kernelMode = document.currentScript.getAttribute(kernelAttr);
22
+ }
23
+ else {
24
+ const scripts = document.getElementsByTagName("script");
25
+ const currentScript = scripts[scripts.length - 1];
26
+ kernelMode = currentScript.getAttribute(kernelAttr);
27
+ }
28
+ }
29
+ catch (e) {
30
+ kernelMode = "isolate";
31
+ }
32
+ let KernelServiceId;
33
+ switch (kernelMode) {
34
+ case "share": // share the kernel across major versions
35
+ KernelServiceId = Object.freeze({
36
+ updateQueue: 1,
37
+ observable: 2,
38
+ contextEvent: 3,
39
+ elementRegistry: 4,
40
+ });
41
+ break;
42
+ case "share-v2": // only share the kernel with other v2 instances
43
+ KernelServiceId = Object.freeze({
44
+ updateQueue: 1.2,
45
+ observable: 2.2,
46
+ contextEvent: 3.2,
47
+ elementRegistry: 4.2,
48
+ });
49
+ break;
50
+ default:
51
+ // fully isolate the kernel from all other FAST instances
52
+ const postfix = `-${Math.random().toString(36).substring(2, 8)}`;
53
+ KernelServiceId = Object.freeze({
54
+ updateQueue: `1.2${postfix}`,
55
+ observable: `2.2${postfix}`,
56
+ contextEvent: `3.2${postfix}`,
57
+ elementRegistry: `4.2${postfix}`,
58
+ });
59
+ break;
60
+ }
61
+ /**
62
+ * Determines whether or not an object is a function.
63
+ * @public
64
+ */
65
+ const isFunction = (object) => typeof object === "function";
66
+ /**
67
+ * Determines whether or not an object is a string.
68
+ * @public
69
+ */
70
+ const isString = (object) => typeof object === "string";
71
+ /**
72
+ * A function which does nothing.
73
+ * @public
74
+ */
75
+ const noop = () => void 0;
76
+
77
+ /* eslint-disable @typescript-eslint/ban-ts-comment */
78
+
79
+ (function ensureGlobalThis() {
80
+ if (typeof globalThis !== "undefined") {
81
+ // We're running in a modern environment.
82
+ return;
83
+ }
84
+ // @ts-ignore
85
+ if (typeof commonjsGlobal !== "undefined") {
86
+ // We're running in NodeJS
87
+ // @ts-ignore
88
+ commonjsGlobal.globalThis = commonjsGlobal;
89
+ }
90
+ else if (typeof self !== "undefined") {
91
+ self.globalThis = self;
92
+ }
93
+ else if (typeof window !== "undefined") {
94
+ // We're running in the browser's main thread.
95
+ window.globalThis = window;
96
+ }
97
+ else {
98
+ // Hopefully we never get here...
99
+ // Not all environments allow eval and Function. Use only as a last resort:
100
+ // eslint-disable-next-line no-new-func
101
+ const result = new Function("return this")();
102
+ result.globalThis = result;
103
+ }
104
+ })();
105
+
106
+ // ensure FAST global - duplicated debug.ts
107
+ const propConfig = {
108
+ configurable: false,
109
+ enumerable: false,
110
+ writable: false,
111
+ };
112
+ if (globalThis.FAST === void 0) {
113
+ Reflect.defineProperty(globalThis, "FAST", Object.assign({ value: Object.create(null) }, propConfig));
114
+ }
115
+ /**
116
+ * The FAST global.
117
+ * @public
118
+ */
119
+ const FAST = globalThis.FAST;
120
+ if (FAST.getById === void 0) {
121
+ const storage = Object.create(null);
122
+ Reflect.defineProperty(FAST, "getById", Object.assign({ value(id, initialize) {
123
+ let found = storage[id];
124
+ if (found === void 0) {
125
+ found = initialize ? (storage[id] = initialize()) : null;
126
+ }
127
+ return found;
128
+ } }, propConfig));
129
+ }
130
+ if (FAST.error === void 0) {
131
+ Object.assign(FAST, {
132
+ warn() { },
133
+ error(code) {
134
+ return new Error(`Error ${code}`);
135
+ },
136
+ addMessages() { },
137
+ });
138
+ }
139
+ /**
140
+ * Creates a function capable of locating metadata associated with a type.
141
+ * @returns A metadata locator function.
142
+ * @internal
143
+ */
144
+ function createMetadataLocator() {
145
+ const metadataLookup = new WeakMap();
146
+ return function (target) {
147
+ let metadata = metadataLookup.get(target);
148
+ if (metadata === void 0) {
149
+ let currentTarget = Reflect.getPrototypeOf(target);
150
+ while (metadata === void 0 && currentTarget !== null) {
151
+ metadata = metadataLookup.get(currentTarget);
152
+ currentTarget = Reflect.getPrototypeOf(currentTarget);
153
+ }
154
+ metadata = metadata === void 0 ? [] : metadata.slice(0);
155
+ metadataLookup.set(target, metadata);
156
+ }
157
+ return metadata;
158
+ };
159
+ }
160
+ /**
161
+ * Makes a type noop for JSON serialization.
162
+ * @param type - The type to make noop for JSON serialization.
163
+ * @internal
164
+ */
165
+ function makeSerializationNoop(type) {
166
+ type.prototype.toJSON = noop;
167
+ }
168
+
169
+ const createHTML = html => html;
170
+ const fastTrustedType = globalThis.trustedTypes
171
+ ? globalThis.trustedTypes.createPolicy("fast-html", { createHTML })
172
+ : { createHTML };
173
+ let defaultPolicy = Object.freeze({
174
+ createHTML(value) {
175
+ return fastTrustedType.createHTML(value);
176
+ },
177
+ protect(tagName, aspect, aspectName, sink) {
178
+ return sink;
179
+ },
180
+ });
181
+ const fastPolicy = defaultPolicy;
182
+ /**
183
+ * Common DOM APIs.
184
+ * @public
185
+ */
186
+ const DOM = Object.freeze({
187
+ /**
188
+ * Gets the dom policy used by the templating system.
189
+ */
190
+ get policy() {
191
+ return defaultPolicy;
192
+ },
193
+ /**
194
+ * Sets the dom policy used by the templating system.
195
+ * @param policy - The policy to set.
196
+ * @remarks
197
+ * This API can only be called once, for security reasons. It should be
198
+ * called by the application developer at the start of their program.
199
+ */
200
+ setPolicy(value) {
201
+ if (defaultPolicy !== fastPolicy) {
202
+ throw FAST.error(1201 /* Message.onlySetDOMPolicyOnce */);
203
+ }
204
+ defaultPolicy = value;
205
+ },
206
+ /**
207
+ * Sets an attribute value on an element.
208
+ * @param element - The element to set the attribute value on.
209
+ * @param attributeName - The attribute name to set.
210
+ * @param value - The value of the attribute to set.
211
+ * @remarks
212
+ * If the value is `null` or `undefined`, the attribute is removed, otherwise
213
+ * it is set to the provided value using the standard `setAttribute` API.
214
+ */
215
+ setAttribute(element, attributeName, value) {
216
+ value === null || value === undefined
217
+ ? element.removeAttribute(attributeName)
218
+ : element.setAttribute(attributeName, value);
219
+ },
220
+ /**
221
+ * Sets a boolean attribute value.
222
+ * @param element - The element to set the boolean attribute value on.
223
+ * @param attributeName - The attribute name to set.
224
+ * @param value - The value of the attribute to set.
225
+ * @remarks
226
+ * If the value is true, the attribute is added; otherwise it is removed.
227
+ */
228
+ setBooleanAttribute(element, attributeName, value) {
229
+ value
230
+ ? element.setAttribute(attributeName, "")
231
+ : element.removeAttribute(attributeName);
232
+ },
233
+ });
234
+
235
+ /**
236
+ * The default UpdateQueue.
237
+ * @public
238
+ */
239
+ const Updates = FAST.getById(KernelServiceId.updateQueue, () => {
240
+ const tasks = [];
241
+ const pendingErrors = [];
242
+ const rAF = globalThis.requestAnimationFrame;
243
+ let updateAsync = true;
244
+ function throwFirstError() {
245
+ if (pendingErrors.length) {
246
+ throw pendingErrors.shift();
247
+ }
248
+ }
249
+ function tryRunTask(task) {
250
+ try {
251
+ task.call();
252
+ }
253
+ catch (error) {
254
+ if (updateAsync) {
255
+ pendingErrors.push(error);
256
+ setTimeout(throwFirstError, 0);
257
+ }
258
+ else {
259
+ tasks.length = 0;
260
+ throw error;
261
+ }
262
+ }
263
+ }
264
+ function process() {
265
+ const capacity = 1024;
266
+ let index = 0;
267
+ while (index < tasks.length) {
268
+ tryRunTask(tasks[index]);
269
+ index++;
270
+ // Prevent leaking memory for long chains of recursive calls to `enqueue`.
271
+ // If we call `enqueue` within a task scheduled by `enqueue`, the queue will
272
+ // grow, but to avoid an O(n) walk for every task we execute, we don't
273
+ // shift tasks off the queue after they have been executed.
274
+ // Instead, we periodically shift 1024 tasks off the queue.
275
+ if (index > capacity) {
276
+ // Manually shift all values starting at the index back to the
277
+ // beginning of the queue.
278
+ for (let scan = 0, newLength = tasks.length - index; scan < newLength; scan++) {
279
+ tasks[scan] = tasks[scan + index];
280
+ }
281
+ tasks.length -= index;
282
+ index = 0;
283
+ }
284
+ }
285
+ tasks.length = 0;
286
+ }
287
+ function enqueue(callable) {
288
+ tasks.push(callable);
289
+ if (tasks.length < 2) {
290
+ updateAsync ? rAF(process) : process();
291
+ }
292
+ }
293
+ return Object.freeze({
294
+ enqueue,
295
+ next: () => new Promise(enqueue),
296
+ process,
297
+ setMode: (isAsync) => (updateAsync = isAsync),
298
+ });
299
+ });
300
+
301
+ /**
302
+ * An implementation of {@link Notifier} that efficiently keeps track of
303
+ * subscribers interested in a specific change notification on an
304
+ * observable subject.
305
+ *
306
+ * @remarks
307
+ * This set is optimized for the most common scenario of 1 or 2 subscribers.
308
+ * With this in mind, it can store a subscriber in an internal field, allowing it to avoid Array#push operations.
309
+ * If the set ever exceeds two subscribers, it upgrades to an array automatically.
310
+ * @public
311
+ */
312
+ class SubscriberSet {
313
+ /**
314
+ * Creates an instance of SubscriberSet for the specified subject.
315
+ * @param subject - The subject that subscribers will receive notifications from.
316
+ * @param initialSubscriber - An initial subscriber to changes.
317
+ */
318
+ constructor(subject, initialSubscriber) {
319
+ this.sub1 = void 0;
320
+ this.sub2 = void 0;
321
+ this.spillover = void 0;
322
+ this.subject = subject;
323
+ this.sub1 = initialSubscriber;
324
+ }
325
+ /**
326
+ * Checks whether the provided subscriber has been added to this set.
327
+ * @param subscriber - The subscriber to test for inclusion in this set.
328
+ */
329
+ has(subscriber) {
330
+ return this.spillover === void 0
331
+ ? this.sub1 === subscriber || this.sub2 === subscriber
332
+ : this.spillover.indexOf(subscriber) !== -1;
333
+ }
334
+ /**
335
+ * Subscribes to notification of changes in an object's state.
336
+ * @param subscriber - The object that is subscribing for change notification.
337
+ */
338
+ subscribe(subscriber) {
339
+ const spillover = this.spillover;
340
+ if (spillover === void 0) {
341
+ if (this.has(subscriber)) {
342
+ return;
343
+ }
344
+ if (this.sub1 === void 0) {
345
+ this.sub1 = subscriber;
346
+ return;
347
+ }
348
+ if (this.sub2 === void 0) {
349
+ this.sub2 = subscriber;
350
+ return;
351
+ }
352
+ this.spillover = [this.sub1, this.sub2, subscriber];
353
+ this.sub1 = void 0;
354
+ this.sub2 = void 0;
355
+ }
356
+ else {
357
+ const index = spillover.indexOf(subscriber);
358
+ if (index === -1) {
359
+ spillover.push(subscriber);
360
+ }
361
+ }
362
+ }
363
+ /**
364
+ * Unsubscribes from notification of changes in an object's state.
365
+ * @param subscriber - The object that is unsubscribing from change notification.
366
+ */
367
+ unsubscribe(subscriber) {
368
+ const spillover = this.spillover;
369
+ if (spillover === void 0) {
370
+ if (this.sub1 === subscriber) {
371
+ this.sub1 = void 0;
372
+ }
373
+ else if (this.sub2 === subscriber) {
374
+ this.sub2 = void 0;
375
+ }
376
+ }
377
+ else {
378
+ const index = spillover.indexOf(subscriber);
379
+ if (index !== -1) {
380
+ spillover.splice(index, 1);
381
+ }
382
+ }
383
+ }
384
+ /**
385
+ * Notifies all subscribers.
386
+ * @param args - Data passed along to subscribers during notification.
387
+ */
388
+ notify(args) {
389
+ const spillover = this.spillover;
390
+ const subject = this.subject;
391
+ if (spillover === void 0) {
392
+ const sub1 = this.sub1;
393
+ const sub2 = this.sub2;
394
+ if (sub1 !== void 0) {
395
+ sub1.handleChange(subject, args);
396
+ }
397
+ if (sub2 !== void 0) {
398
+ sub2.handleChange(subject, args);
399
+ }
400
+ }
401
+ else {
402
+ for (let i = 0, ii = spillover.length; i < ii; ++i) {
403
+ spillover[i].handleChange(subject, args);
404
+ }
405
+ }
406
+ }
407
+ }
408
+ /**
409
+ * An implementation of Notifier that allows subscribers to be notified
410
+ * of individual property changes on an object.
411
+ * @public
412
+ */
413
+ class PropertyChangeNotifier {
414
+ /**
415
+ * Creates an instance of PropertyChangeNotifier for the specified subject.
416
+ * @param subject - The object that subscribers will receive notifications for.
417
+ */
418
+ constructor(subject) {
419
+ this.subscribers = {};
420
+ this.subjectSubscribers = null;
421
+ this.subject = subject;
422
+ }
423
+ /**
424
+ * Notifies all subscribers, based on the specified property.
425
+ * @param propertyName - The property name, passed along to subscribers during notification.
426
+ */
427
+ notify(propertyName) {
428
+ var _a, _b;
429
+ (_a = this.subscribers[propertyName]) === null || _a === void 0 ? void 0 : _a.notify(propertyName);
430
+ (_b = this.subjectSubscribers) === null || _b === void 0 ? void 0 : _b.notify(propertyName);
431
+ }
432
+ /**
433
+ * Subscribes to notification of changes in an object's state.
434
+ * @param subscriber - The object that is subscribing for change notification.
435
+ * @param propertyToWatch - The name of the property that the subscriber is interested in watching for changes.
436
+ */
437
+ subscribe(subscriber, propertyToWatch) {
438
+ var _a, _b;
439
+ let subscribers;
440
+ if (propertyToWatch) {
441
+ subscribers =
442
+ (_a = this.subscribers[propertyToWatch]) !== null && _a !== void 0 ? _a : (this.subscribers[propertyToWatch] = new SubscriberSet(this.subject));
443
+ }
444
+ else {
445
+ subscribers =
446
+ (_b = this.subjectSubscribers) !== null && _b !== void 0 ? _b : (this.subjectSubscribers = new SubscriberSet(this.subject));
447
+ }
448
+ subscribers.subscribe(subscriber);
449
+ }
450
+ /**
451
+ * Unsubscribes from notification of changes in an object's state.
452
+ * @param subscriber - The object that is unsubscribing from change notification.
453
+ * @param propertyToUnwatch - The name of the property that the subscriber is no longer interested in watching.
454
+ */
455
+ unsubscribe(subscriber, propertyToUnwatch) {
456
+ var _a, _b;
457
+ if (propertyToUnwatch) {
458
+ (_a = this.subscribers[propertyToUnwatch]) === null || _a === void 0 ? void 0 : _a.unsubscribe(subscriber);
459
+ }
460
+ else {
461
+ (_b = this.subjectSubscribers) === null || _b === void 0 ? void 0 : _b.unsubscribe(subscriber);
462
+ }
463
+ }
464
+ }
465
+
466
+ /**
467
+ * Describes how the source's lifetime relates to its controller's lifetime.
468
+ * @public
469
+ */
470
+ const SourceLifetime = Object.freeze({
471
+ /**
472
+ * The source to controller lifetime relationship is unknown.
473
+ */
474
+ unknown: void 0,
475
+ /**
476
+ * The source and controller lifetimes are coupled to one another.
477
+ * They can/will be GC'd together.
478
+ */
479
+ coupled: 1,
480
+ });
481
+ /**
482
+ * Common Observable APIs.
483
+ * @public
484
+ */
485
+ FAST.getById(KernelServiceId.observable, () => {
486
+ const queueUpdate = Updates.enqueue;
487
+ const volatileRegex = /(:|&&|\|\||if|\?\.)/;
488
+ const notifierLookup = new WeakMap();
489
+ let watcher = void 0;
490
+ let createArrayObserver = (array) => {
491
+ throw FAST.error(1101 /* Message.needsArrayObservation */);
492
+ };
493
+ function getNotifier(source) {
494
+ var _a;
495
+ let found = (_a = source.$fastController) !== null && _a !== void 0 ? _a : notifierLookup.get(source);
496
+ if (found === void 0) {
497
+ Array.isArray(source)
498
+ ? (found = createArrayObserver(source))
499
+ : notifierLookup.set(source, (found = new PropertyChangeNotifier(source)));
500
+ }
501
+ return found;
502
+ }
503
+ const getAccessors = createMetadataLocator();
504
+ class DefaultObservableAccessor {
505
+ constructor(name) {
506
+ this.name = name;
507
+ this.field = `_${name}`;
508
+ this.callback = `${name}Changed`;
509
+ }
510
+ getValue(source) {
511
+ if (watcher !== void 0) {
512
+ watcher.watch(source, this.name);
513
+ }
514
+ return source[this.field];
515
+ }
516
+ setValue(source, newValue) {
517
+ const field = this.field;
518
+ const oldValue = source[field];
519
+ if (oldValue !== newValue) {
520
+ source[field] = newValue;
521
+ const callback = source[this.callback];
522
+ if (isFunction(callback)) {
523
+ callback.call(source, oldValue, newValue);
524
+ }
525
+ getNotifier(source).notify(this.name);
526
+ }
527
+ }
528
+ }
529
+ class ExpressionNotifierImplementation extends SubscriberSet {
530
+ constructor(expression, initialSubscriber, isVolatileBinding = false) {
531
+ super(expression, initialSubscriber);
532
+ this.expression = expression;
533
+ this.isVolatileBinding = isVolatileBinding;
534
+ this.needsRefresh = true;
535
+ this.needsQueue = true;
536
+ this.isAsync = true;
537
+ this.first = this;
538
+ this.last = null;
539
+ this.propertySource = void 0;
540
+ this.propertyName = void 0;
541
+ this.notifier = void 0;
542
+ this.next = void 0;
543
+ }
544
+ setMode(isAsync) {
545
+ this.isAsync = this.needsQueue = isAsync;
546
+ }
547
+ bind(controller) {
548
+ this.controller = controller;
549
+ const value = this.observe(controller.source, controller.context);
550
+ if (!controller.isBound && this.requiresUnbind(controller)) {
551
+ controller.onUnbind(this);
552
+ }
553
+ return value;
554
+ }
555
+ requiresUnbind(controller) {
556
+ return (controller.sourceLifetime !== SourceLifetime.coupled ||
557
+ this.first !== this.last ||
558
+ this.first.propertySource !== controller.source);
559
+ }
560
+ unbind(controller) {
561
+ this.dispose();
562
+ }
563
+ observe(source, context) {
564
+ if (this.needsRefresh && this.last !== null) {
565
+ this.dispose();
566
+ }
567
+ const previousWatcher = watcher;
568
+ watcher = this.needsRefresh ? this : void 0;
569
+ this.needsRefresh = this.isVolatileBinding;
570
+ let result;
571
+ try {
572
+ result = this.expression(source, context);
573
+ }
574
+ finally {
575
+ watcher = previousWatcher;
576
+ }
577
+ return result;
578
+ }
579
+ // backwards compat with v1 kernel
580
+ disconnect() {
581
+ this.dispose();
582
+ }
583
+ dispose() {
584
+ if (this.last !== null) {
585
+ let current = this.first;
586
+ while (current !== void 0) {
587
+ current.notifier.unsubscribe(this, current.propertyName);
588
+ current = current.next;
589
+ }
590
+ this.last = null;
591
+ this.needsRefresh = this.needsQueue = this.isAsync;
592
+ }
593
+ }
594
+ watch(propertySource, propertyName) {
595
+ const prev = this.last;
596
+ const notifier = getNotifier(propertySource);
597
+ const current = prev === null ? this.first : {};
598
+ current.propertySource = propertySource;
599
+ current.propertyName = propertyName;
600
+ current.notifier = notifier;
601
+ notifier.subscribe(this, propertyName);
602
+ if (prev !== null) {
603
+ if (!this.needsRefresh) {
604
+ // Declaring the variable prior to assignment below circumvents
605
+ // a bug in Angular's optimization process causing infinite recursion
606
+ // of this watch() method. Details https://github.com/microsoft/fast/issues/4969
607
+ let prevValue;
608
+ watcher = void 0;
609
+ /* eslint-disable-next-line */
610
+ prevValue = prev.propertySource[prev.propertyName];
611
+ /* eslint-disable-next-line */
612
+ watcher = this;
613
+ if (propertySource === prevValue) {
614
+ this.needsRefresh = true;
615
+ }
616
+ }
617
+ prev.next = current;
618
+ }
619
+ this.last = current;
620
+ }
621
+ handleChange() {
622
+ if (this.needsQueue) {
623
+ this.needsQueue = false;
624
+ queueUpdate(this);
625
+ }
626
+ else if (!this.isAsync) {
627
+ this.call();
628
+ }
629
+ }
630
+ call() {
631
+ if (this.last !== null) {
632
+ this.needsQueue = this.isAsync;
633
+ this.notify(this);
634
+ }
635
+ }
636
+ *records() {
637
+ let next = this.first;
638
+ while (next !== void 0) {
639
+ yield next;
640
+ next = next.next;
641
+ }
642
+ }
643
+ }
644
+ makeSerializationNoop(ExpressionNotifierImplementation);
645
+ return Object.freeze({
646
+ /**
647
+ * @internal
648
+ * @param factory - The factory used to create array observers.
649
+ */
650
+ setArrayObserverFactory(factory) {
651
+ createArrayObserver = factory;
652
+ },
653
+ /**
654
+ * Gets a notifier for an object or Array.
655
+ * @param source - The object or Array to get the notifier for.
656
+ */
657
+ getNotifier,
658
+ /**
659
+ * Records a property change for a source object.
660
+ * @param source - The object to record the change against.
661
+ * @param propertyName - The property to track as changed.
662
+ */
663
+ track(source, propertyName) {
664
+ watcher && watcher.watch(source, propertyName);
665
+ },
666
+ /**
667
+ * Notifies watchers that the currently executing property getter or function is volatile
668
+ * with respect to its observable dependencies.
669
+ */
670
+ trackVolatile() {
671
+ watcher && (watcher.needsRefresh = true);
672
+ },
673
+ /**
674
+ * Notifies subscribers of a source object of changes.
675
+ * @param source - the object to notify of changes.
676
+ * @param args - The change args to pass to subscribers.
677
+ */
678
+ notify(source, args) {
679
+ /* eslint-disable-next-line @typescript-eslint/no-use-before-define */
680
+ getNotifier(source).notify(args);
681
+ },
682
+ /**
683
+ * Defines an observable property on an object or prototype.
684
+ * @param target - The target object to define the observable on.
685
+ * @param nameOrAccessor - The name of the property to define as observable;
686
+ * or a custom accessor that specifies the property name and accessor implementation.
687
+ */
688
+ defineProperty(target, nameOrAccessor) {
689
+ if (isString(nameOrAccessor)) {
690
+ nameOrAccessor = new DefaultObservableAccessor(nameOrAccessor);
691
+ }
692
+ getAccessors(target).push(nameOrAccessor);
693
+ Reflect.defineProperty(target, nameOrAccessor.name, {
694
+ enumerable: true,
695
+ get() {
696
+ return nameOrAccessor.getValue(this);
697
+ },
698
+ set(newValue) {
699
+ nameOrAccessor.setValue(this, newValue);
700
+ },
701
+ });
702
+ },
703
+ /**
704
+ * Finds all the observable accessors defined on the target,
705
+ * including its prototype chain.
706
+ * @param target - The target object to search for accessor on.
707
+ */
708
+ getAccessors,
709
+ /**
710
+ * Creates a {@link ExpressionNotifier} that can watch the
711
+ * provided {@link Expression} for changes.
712
+ * @param expression - The binding to observe.
713
+ * @param initialSubscriber - An initial subscriber to changes in the binding value.
714
+ * @param isVolatileBinding - Indicates whether the binding's dependency list must be re-evaluated on every value evaluation.
715
+ */
716
+ binding(expression, initialSubscriber, isVolatileBinding = this.isVolatileBinding(expression)) {
717
+ return new ExpressionNotifierImplementation(expression, initialSubscriber, isVolatileBinding);
718
+ },
719
+ /**
720
+ * Determines whether a binding expression is volatile and needs to have its dependency list re-evaluated
721
+ * on every evaluation of the value.
722
+ * @param expression - The binding to inspect.
723
+ */
724
+ isVolatileBinding(expression) {
725
+ return volatileRegex.test(expression.toString());
726
+ },
727
+ });
728
+ });
729
+ const contextEvent = FAST.getById(KernelServiceId.contextEvent, () => {
730
+ let current = null;
731
+ return {
732
+ get() {
733
+ return current;
734
+ },
735
+ set(event) {
736
+ current = event;
737
+ },
738
+ };
739
+ });
740
+ /**
741
+ * Provides additional contextual information available to behaviors and expressions.
742
+ * @public
743
+ */
744
+ const ExecutionContext = Object.freeze({
745
+ /**
746
+ * A default execution context.
747
+ */
748
+ default: {
749
+ index: 0,
750
+ length: 0,
751
+ get event() {
752
+ return ExecutionContext.getEvent();
753
+ },
754
+ eventDetail() {
755
+ return this.event.detail;
756
+ },
757
+ eventTarget() {
758
+ return this.event.target;
759
+ },
760
+ },
761
+ /**
762
+ * Gets the current event.
763
+ * @returns An event object.
764
+ */
765
+ getEvent() {
766
+ return contextEvent.get();
767
+ },
768
+ /**
769
+ * Sets the current event.
770
+ * @param event - An event object.
771
+ */
772
+ setEvent(event) {
773
+ contextEvent.set(event);
774
+ },
775
+ });
776
+
777
+ const marker = `fast-${Math.random().toString(36).substring(2, 8)}`;
778
+ let id = 0;
779
+ /** @internal */
780
+ const nextId = () => `${marker}-${++id}`;
781
+
782
+ /**
783
+ * Bridges between ViewBehaviors and HostBehaviors, enabling a host to
784
+ * control ViewBehaviors.
785
+ * @public
786
+ */
787
+ const ViewBehaviorOrchestrator = Object.freeze({
788
+ /**
789
+ * Creates a ViewBehaviorOrchestrator.
790
+ * @param source - The source to to associate behaviors with.
791
+ * @returns A ViewBehaviorOrchestrator.
792
+ */
793
+ create(source) {
794
+ const behaviors = [];
795
+ const targets = {};
796
+ let unbindables = null;
797
+ let isConnected = false;
798
+ return {
799
+ source,
800
+ context: ExecutionContext.default,
801
+ targets,
802
+ get isBound() {
803
+ return isConnected;
804
+ },
805
+ addBehaviorFactory(factory, target) {
806
+ var _a, _b, _c, _d;
807
+ const compiled = factory;
808
+ compiled.id = (_a = compiled.id) !== null && _a !== void 0 ? _a : nextId();
809
+ compiled.targetNodeId = (_b = compiled.targetNodeId) !== null && _b !== void 0 ? _b : nextId();
810
+ compiled.targetTagName = (_c = target.tagName) !== null && _c !== void 0 ? _c : null;
811
+ compiled.policy = (_d = compiled.policy) !== null && _d !== void 0 ? _d : DOM.policy;
812
+ this.addTarget(compiled.targetNodeId, target);
813
+ this.addBehavior(compiled.createBehavior());
814
+ },
815
+ addTarget(nodeId, target) {
816
+ targets[nodeId] = target;
817
+ },
818
+ addBehavior(behavior) {
819
+ behaviors.push(behavior);
820
+ if (isConnected) {
821
+ behavior.bind(this);
822
+ }
823
+ },
824
+ onUnbind(unbindable) {
825
+ if (unbindables === null) {
826
+ unbindables = [];
827
+ }
828
+ unbindables.push(unbindable);
829
+ },
830
+ connectedCallback(controller) {
831
+ if (!isConnected) {
832
+ isConnected = true;
833
+ behaviors.forEach(x => x.bind(this));
834
+ }
835
+ },
836
+ disconnectedCallback(controller) {
837
+ if (isConnected) {
838
+ isConnected = false;
839
+ if (unbindables !== null) {
840
+ unbindables.forEach(x => x.unbind(this));
841
+ }
842
+ }
843
+ },
844
+ };
845
+ },
846
+ });
847
+
16
848
  const DataGridCellSortStates = {
17
849
  none: "none",
18
850
  ascending: "ascending",
@@ -365,8 +1197,7 @@ class DataGridRow extends HostSemantics(VividElement) {
365
1197
  this.rowType = DataGridRowTypes.default;
366
1198
  this.rowData = null;
367
1199
  this.columnDefinitions = null;
368
- this.cellsRepeatBehavior = null;
369
- this.cellsPlaceholder = null;
1200
+ this.behaviorOrchestrator = null;
370
1201
  /**
371
1202
  * @internal
372
1203
  */
@@ -418,16 +1249,18 @@ class DataGridRow extends HostSemantics(VividElement) {
418
1249
  */
419
1250
  connectedCallback() {
420
1251
  super.connectedCallback();
421
- if (this.cellsRepeatBehavior === null) {
422
- this.cellsPlaceholder = document.createComment("");
423
- this.appendChild(this.cellsPlaceholder);
1252
+ if (this.behaviorOrchestrator === null) {
424
1253
  this.updateItemTemplate();
425
- this.cellsRepeatBehavior = new RepeatDirective(
426
- (x) => x.columnDefinitions,
427
- (x) => x.activeCellItemTemplate,
428
- { positioning: true }
429
- ).createBehavior(this.cellsPlaceholder);
430
- this.$fastController.addBehaviors([this.cellsRepeatBehavior]);
1254
+ this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
1255
+ this.$fastController.addBehavior(this.behaviorOrchestrator);
1256
+ this.behaviorOrchestrator.addBehaviorFactory(
1257
+ new RepeatDirective(
1258
+ normalizeBinding((x) => x.columnDefinitions),
1259
+ normalizeBinding((x) => x.activeCellItemTemplate),
1260
+ { positioning: true }
1261
+ ),
1262
+ this.appendChild(document.createComment(""))
1263
+ );
431
1264
  }
432
1265
  this.addEventListener("cell-focused", this.handleCellFocus);
433
1266
  this.addEventListener(eventFocusOut, this.handleFocusout);
@@ -571,8 +1404,7 @@ const _DataGrid = class _DataGrid extends VividElement {
571
1404
  * @internal
572
1405
  */
573
1406
  this.fixedColumnsPositions = [];
574
- this.rowsRepeatBehavior = null;
575
- this.rowsPlaceholder = null;
1407
+ this.behaviorOrchestrator = null;
576
1408
  this.generatedHeader = null;
577
1409
  this.isUpdatingFocus = false;
578
1410
  this.pendingFocusUpdate = false;
@@ -618,7 +1450,7 @@ const _DataGrid = class _DataGrid extends VividElement {
618
1450
  this.queueRowIndexUpdate = () => {
619
1451
  if (!this.rowindexUpdateQueued) {
620
1452
  this.rowindexUpdateQueued = true;
621
- DOM.queueUpdate(this.updateRowIndexes);
1453
+ Updates$1.enqueue(this.updateRowIndexes);
622
1454
  }
623
1455
  };
624
1456
  this.updateRowIndexes = () => {
@@ -866,15 +1698,19 @@ const _DataGrid = class _DataGrid extends VividElement {
866
1698
  if (this.rowItemTemplate === void 0) {
867
1699
  this.rowItemTemplate = this.defaultRowItemTemplate;
868
1700
  }
869
- this.rowsPlaceholder = document.createComment("");
870
- this.appendChild(this.rowsPlaceholder);
1701
+ if (this.behaviorOrchestrator === null) {
1702
+ this.behaviorOrchestrator = ViewBehaviorOrchestrator.create(this);
1703
+ this.$fastController.addBehavior(this.behaviorOrchestrator);
1704
+ this.behaviorOrchestrator.addBehaviorFactory(
1705
+ new RepeatDirective(
1706
+ normalizeBinding((x) => x.rowsData),
1707
+ normalizeBinding((x) => x.rowItemTemplate),
1708
+ { positioning: true }
1709
+ ),
1710
+ this.appendChild(document.createComment(""))
1711
+ );
1712
+ }
871
1713
  this.toggleGeneratedHeader();
872
- this.rowsRepeatBehavior = new RepeatDirective(
873
- (x) => x.rowsData,
874
- (x) => x.rowItemTemplate,
875
- { positioning: true }
876
- ).createBehavior(this.rowsPlaceholder);
877
- this.$fastController.addBehaviors([this.rowsRepeatBehavior]);
878
1714
  this.addEventListener("row-focused", this.handleRowFocus);
879
1715
  this.addEventListener(eventFocus, this.handleFocus);
880
1716
  this.addEventListener(eventKeyDown, this.handleKeydown);
@@ -882,7 +1718,7 @@ const _DataGrid = class _DataGrid extends VividElement {
882
1718
  this.observer = new MutationObserver(this.onChildListChange);
883
1719
  this.observer.observe(this, { childList: true });
884
1720
  this.setupResizeObserver();
885
- DOM.queueUpdate(this.queueRowIndexUpdate);
1721
+ Updates$1.enqueue(this.queueRowIndexUpdate);
886
1722
  this.#setTabIndex();
887
1723
  Observable.getNotifier(this).subscribe(
888
1724
  this.#changeHandler,
@@ -906,7 +1742,6 @@ const _DataGrid = class _DataGrid extends VividElement {
906
1742
  this.resizeObserver.disconnect();
907
1743
  this.resizeObserver = void 0;
908
1744
  }
909
- this.rowsPlaceholder = null;
910
1745
  this.generatedHeader = null;
911
1746
  Observable.getNotifier(this).unsubscribe(
912
1747
  this.#changeHandler,
@@ -1026,7 +1861,7 @@ const _DataGrid = class _DataGrid extends VividElement {
1026
1861
  }
1027
1862
  if (this.pendingFocusUpdate === false) {
1028
1863
  this.pendingFocusUpdate = true;
1029
- DOM.queueUpdate(() => this.updateFocus());
1864
+ Updates$1.enqueue(() => this.updateFocus());
1030
1865
  }
1031
1866
  }
1032
1867
  updateFocus() {
@@ -1074,7 +1909,7 @@ const _DataGrid = class _DataGrid extends VividElement {
1074
1909
  }
1075
1910
  selectionModeChanged(oldValue) {
1076
1911
  if (oldValue === void 0) {
1077
- DOM.queueUpdate(this._resetSelection);
1912
+ Updates$1.enqueue(this._resetSelection);
1078
1913
  return;
1079
1914
  }
1080
1915
  this._resetSelection(true);
@@ -1246,7 +2081,7 @@ function handleColumnSort(_, { event }) {
1246
2081
  }
1247
2082
  const DataGridTemplate = (context) => {
1248
2083
  const rowItemTemplate = createRowItemTemplate(context);
1249
- const rowTag = context.tagFor(DataGridRow);
2084
+ const rowTag = context.tagFor(DataGridRow, true);
1250
2085
  return html`
1251
2086
  <template
1252
2087
  aria-multiselectable="${getMultiSelectAriaState}"