@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 +1 @@
1
- "use strict";const d=require("./attribute-binding-behaviour.cjs"),s=require("./vivid-element.cjs");class h{constructor(r,e){this.target=r,this.source=null,this.bindingBehaviours=[],this.onSourceAriaPropertyChanged=(t,i)=>{this.forwardedProperties.has(i)&&this.forwardPropertyToTarget(this.target,i,t[i])},this.boundProperties=e.boundProperties,this.forwardedProperties=e.forwardedProperties}bind(r){this.source=r,this.bindPropertiesToTarget(r,this.boundProperties,this.target),this.startForwardingPropertiesToTarget(r,this.forwardedProperties,this.target)}unbind(){this.source!==null&&(this.releasePropertyBindings(this.source),this.stopForwardingPropertiesToTarget(this.source),this.source=null)}bindPropertiesToTarget(r,e,t){for(const[i,a]of Object.entries(e)){const n=a instanceof Function?a:()=>a;this.bindingBehaviours.push(new d.AttributeBindingBehavior(t,n,s.Observable.isVolatileBinding(n),s.ariaAttributeName(i)))}r.$fastController.addBehaviors(this.bindingBehaviours)}releasePropertyBindings(r){r.$fastController.removeBehaviors(this.bindingBehaviours),this.bindingBehaviours=[]}startForwardingPropertiesToTarget(r,e,t){for(const i of e)this.forwardPropertyToTarget(t,i,r[i]);s.subscribeToAriaPropertyChanges(r,this.onSourceAriaPropertyChanged)}stopForwardingPropertiesToTarget(r){s.unsubscribeFromAriaPropertyChanges(r,this.onSourceAriaPropertyChanged)}forwardPropertyToTarget(r,e,t){s.DOM.setAttribute(r,s.ariaAttributeName(e),t)}}function g(o={},r={}){const e=new Set((r.onlySpecified?[]:s.ariaMixinProperties).filter(t=>!(t in o)));return new s.AttachedBehaviorHTMLDirective("vvd-delegate-aria",h,{boundProperties:o,forwardedProperties:e})}const u=o=>{class r extends o{constructor(){super(...arguments),this._vividAriaBehaviour="delegate"}}return r};exports.DelegatesAria=u;exports.delegateAria=g;
1
+ "use strict";const h=require("./attribute-binding-behaviour.cjs"),o=require("./vivid-element.cjs");class g{constructor(e,t){this.target=null,this.bindingBehaviours=[],this.onSourceAriaPropertyChanged=(r,i)=>{!this.forwardedProperties.has(i)||i in this.boundProperties||this.forwardPropertyToTarget(this.target,i,r[i])},this.target=e,this.boundProperties=t.boundProperties,this.forwardedProperties=t.forwardedProperties}bind(e){const t=e.source;this.bindPropertiesToTarget(t,this.boundProperties,this.target),this.startForwardingPropertiesToTarget(t,this.forwardedProperties,this.target)}bindPropertiesToTarget(e,t,r){for(const[i,a]of Object.entries(t)){const n=a instanceof Function?a:()=>a;this.bindingBehaviours.push(new h.AttributeBindingBehavior(r,o.oneWay(n),o.Observable.isVolatileBinding(n),o.ariaAttributeName(i)))}for(const i of this.bindingBehaviours)i.bind({source:e,context:e.$fastController.context})}startForwardingPropertiesToTarget(e,t,r){for(const i of t)i in this.boundProperties||this.forwardPropertyToTarget(r,i,e[i]);o.subscribeToAriaPropertyChanges(e,this.onSourceAriaPropertyChanged)}forwardPropertyToTarget(e,t,r){r==null||r===!1?e.removeAttribute(o.ariaAttributeName(t)):e.setAttribute(o.ariaAttributeName(t),String(r))}}class d extends o.StatelessAttachedAttributeDirective{constructor(e,t){super("vvd-delegate-aria"),this.boundProperties=e,this.forwardedProperties=t,this.targetNodeId=""}bind(e){const t=e.targets[this.targetNodeId];new g(t,{boundProperties:this.boundProperties,forwardedProperties:this.forwardedProperties}).bind(e)}}o.HTMLDirective.define(d);function u(s={},e={}){const t=new Set((e.onlySpecified?[]:o.ariaMixinProperties).filter(r=>!(r in s)));return new d(s,t)}const b=s=>{class e extends s{constructor(){super(...arguments),this._vividAriaBehaviour="delegate"}}return e};exports.DelegatesAria=b;exports.delegateAria=u;
@@ -1,77 +1,90 @@
1
1
  import { A as h } from "./attribute-binding-behaviour.js";
2
- import { O as d, f as n, s as g, u, D as p, g as c, A as l } from "./vivid-element.js";
2
+ import { g, O as b, j as a, s as c, k as u, S as f, H as p } from "./vivid-element.js";
3
3
  class P {
4
- constructor(r, e) {
5
- this.target = r, this.source = null, this.bindingBehaviours = [], this.onSourceAriaPropertyChanged = (t, i) => {
6
- this.forwardedProperties.has(i) && this.forwardPropertyToTarget(this.target, i, t[i]);
7
- }, this.boundProperties = e.boundProperties, this.forwardedProperties = e.forwardedProperties;
4
+ constructor(e, r) {
5
+ this.target = null, this.bindingBehaviours = [], this.onSourceAriaPropertyChanged = (t, i) => {
6
+ !this.forwardedProperties.has(i) || i in this.boundProperties || this.forwardPropertyToTarget(this.target, i, t[i]);
7
+ }, this.target = e, this.boundProperties = r.boundProperties, this.forwardedProperties = r.forwardedProperties;
8
8
  }
9
- bind(r) {
10
- this.source = r, this.bindPropertiesToTarget(r, this.boundProperties, this.target), this.startForwardingPropertiesToTarget(
9
+ // private source: DelegatesAriaElement | null = null;
10
+ bind(e) {
11
+ const r = e.source;
12
+ this.bindPropertiesToTarget(r, this.boundProperties, this.target), this.startForwardingPropertiesToTarget(
11
13
  r,
12
14
  this.forwardedProperties,
13
15
  this.target
14
16
  );
15
17
  }
16
- unbind() {
17
- this.source !== null && (this.releasePropertyBindings(this.source), this.stopForwardingPropertiesToTarget(this.source), this.source = null);
18
- }
19
- bindPropertiesToTarget(r, e, t) {
20
- for (const [i, o] of Object.entries(e)) {
21
- const a = o instanceof Function ? o : () => o;
18
+ bindPropertiesToTarget(e, r, t) {
19
+ for (const [i, o] of Object.entries(r)) {
20
+ const n = o instanceof Function ? o : () => o;
22
21
  this.bindingBehaviours.push(
23
22
  new h(
24
23
  t,
25
- a,
26
- d.isVolatileBinding(a),
27
- n(i)
24
+ g(n),
25
+ b.isVolatileBinding(n),
26
+ a(i)
28
27
  )
29
28
  );
30
29
  }
31
- r.$fastController.addBehaviors(this.bindingBehaviours);
32
- }
33
- releasePropertyBindings(r) {
34
- r.$fastController.removeBehaviors(this.bindingBehaviours), this.bindingBehaviours = [];
35
- }
36
- startForwardingPropertiesToTarget(r, e, t) {
37
- for (const i of e)
38
- this.forwardPropertyToTarget(t, i, r[i]);
39
- g(r, this.onSourceAriaPropertyChanged);
30
+ for (const i of this.bindingBehaviours)
31
+ i.bind({
32
+ source: e,
33
+ context: e.$fastController.context
34
+ });
40
35
  }
41
- stopForwardingPropertiesToTarget(r) {
42
- u(
43
- r,
36
+ // private releasePropertyBindings(source: DelegatesAriaElement) {
37
+ // for (const behavior of this.bindingBehaviours) {
38
+ // (behavior as any).unbind(); // TODO: fix type
39
+ // }
40
+ // this.bindingBehaviours = [];
41
+ // }
42
+ startForwardingPropertiesToTarget(e, r, t) {
43
+ for (const i of r)
44
+ i in this.boundProperties || this.forwardPropertyToTarget(t, i, e[i]);
45
+ c(
46
+ e,
44
47
  this.onSourceAriaPropertyChanged
45
48
  );
46
49
  }
47
- forwardPropertyToTarget(r, e, t) {
48
- p.setAttribute(r, n(e), t);
50
+ forwardPropertyToTarget(e, r, t) {
51
+ t == null || t === !1 ? e.removeAttribute(a(r)) : e.setAttribute(a(r), String(t));
52
+ }
53
+ }
54
+ class d extends f {
55
+ constructor(e, r) {
56
+ super("vvd-delegate-aria"), this.boundProperties = e, this.forwardedProperties = r, this.targetNodeId = "";
57
+ }
58
+ bind(e) {
59
+ const r = e.targets[this.targetNodeId];
60
+ new P(
61
+ r,
62
+ // Pass the target element as target
63
+ {
64
+ boundProperties: this.boundProperties,
65
+ forwardedProperties: this.forwardedProperties
66
+ }
67
+ ).bind(e);
49
68
  }
50
69
  }
51
- function T(s = {}, r = {}) {
52
- const e = new Set(
53
- (r.onlySpecified ? [] : c).filter(
70
+ p.define(d);
71
+ function v(s = {}, e = {}) {
72
+ const r = new Set(
73
+ (e.onlySpecified ? [] : u).filter(
54
74
  (t) => !(t in s)
55
75
  )
56
76
  );
57
- return new l(
58
- "vvd-delegate-aria",
59
- P,
60
- {
61
- boundProperties: s,
62
- forwardedProperties: e
63
- }
64
- );
77
+ return new d(s, r);
65
78
  }
66
- const v = (s) => {
67
- class r extends s {
79
+ const A = (s) => {
80
+ class e extends s {
68
81
  constructor() {
69
82
  super(...arguments), this._vividAriaBehaviour = "delegate";
70
83
  }
71
84
  }
72
- return r;
85
+ return e;
73
86
  };
74
87
  export {
75
- v as D,
76
- T as d
88
+ A as D,
89
+ v as d
77
90
  };
@@ -1 +1 @@
1
- "use strict";const a=require("./vivid-element.cjs"),m=require("./key-codes.cjs");var f=Object.defineProperty,l=(r,i,o,e)=>{for(var t=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(t=n(i,o,t)||t);return t&&f(i,o,t),t};const h="form-associated-proxy",d="ElementInternals",c=d in window&&"setFormValue"in window[d].prototype,u=new WeakMap,p=r=>{class i extends r{constructor(...e){super(...e),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return c}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const e=this.proxy.labels,t=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));return Object.freeze(t.concat(Array.from(e)))}else return a.emptyArray}valueChanged(e,t){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.setFormValue(this.value),this.validate()}get currentValue(){return this.value}set currentValue(e){this.value=e}initialValueChanged(e,t){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),a.DOM.queueUpdate(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),a.DOM.queueUpdate(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!c)return null;let e=u.get(this);return e||(e=this.attachInternals(),u.set(this,e)),e}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){super.disconnectedCallback(),this.proxyEventsToBlock.forEach(e=>this.proxy.removeEventListener(e,this.stopPropagation)),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(e,t,s){if("valid"in e&&this.disabled){const{valid:n,...y}=e;e=y}this.elementInternals?this.elementInternals.setValidity(e,t,s):typeof t=="string"&&this.proxy.setCustomValidity(t)}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach(e=>this.proxy.addEventListener(e,this.stopPropagation)),this.proxy.disabled=this.disabled,this.proxy.required=this.required,typeof this.name=="string"&&(this.proxy.name=this.name),typeof this.value=="string"&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",h),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",h)),this.shadowRoot.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){this.removeChild(this.proxy),this.shadowRoot.removeChild(this.proxySlot)}validate(e){if(this.proxy instanceof HTMLElement&&this.elementInternals){const t=this.proxy.validity.valid,s=this.control,n=s&&s.validity&&!s.validity.valid&&(s.validity.tooShort||s.validity.tooLong);t&&n?this.setValidity(s.validity,s.validationMessage,e):this.setValidity(this.proxy.validity,this.proxy.validationMessage,e)}}setFormValue(e,t){this.elementInternals&&this.elementInternals.setFormValue(e,t||e)}_keypressHandler(e){switch(e.key){case m.keyEnter:this.form instanceof HTMLFormElement&&this.form.querySelector("[type=submit]")?.click();break}}stopPropagation(e){e.stopPropagation()}}return l([a.attr({attribute:"current-value"})],i.prototype,"value"),l([a.attr({mode:"fromView",attribute:"value"})],i.prototype,"initialValue"),l([a.attr({mode:"boolean"})],i.prototype,"disabled"),l([a.attr],i.prototype,"name"),l([a.attr({mode:"boolean"})],i.prototype,"required"),i},v={fromView(r){return typeof r=="string"?r.toLowerCase()==="true":!!r},toView(r){return r?"true":"false"}},k=r=>{class i extends p(r){constructor(){super(...arguments),this.dirtyChecked=!1,this.defaultChecked=!1}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(e,t){this.dirtyChecked||(this.dirtyChecked=!0),this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),e!==void 0&&this.$emit("change"),this.validate()}get checkedAttribute(){return this.defaultChecked}set checkedAttribute(e){this.defaultChecked=e}get currentChecked(){return this.checked}set currentChecked(e){this.checked=e}updateForm(){const e=this.checked?this.value:null;this.setFormValue(e,e)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.defaultChecked,this.dirtyChecked=!1}}return l([a.attr({attribute:"checked",mode:"boolean"})],i.prototype,"defaultChecked"),l([a.attr({attribute:"current-checked",converter:v})],i.prototype,"checked"),i};exports.CheckableFormAssociated=k;exports.FormAssociated=p;
1
+ "use strict";const a=require("./vivid-element.cjs"),m=require("./key-codes.cjs");var f=Object.defineProperty,l=(r,i,o,e)=>{for(var t=void 0,s=r.length-1,n;s>=0;s--)(n=r[s])&&(t=n(i,o,t)||t);return t&&f(i,o,t),t};const h="form-associated-proxy",d="ElementInternals",c=d in window&&"setFormValue"in window[d].prototype,u=new WeakMap,p=r=>{class i extends r{constructor(...e){super(...e),this.dirtyValue=!1,this.disabled=!1,this.proxyEventsToBlock=["change","click"],this.proxyInitialized=!1,this.required=!1,this.initialValue=this.initialValue||"",this.elementInternals||(this.formResetCallback=this.formResetCallback.bind(this))}static get formAssociated(){return c}get validity(){return this.elementInternals?this.elementInternals.validity:this.proxy.validity}get form(){return this.elementInternals?this.elementInternals.form:this.proxy.form}get validationMessage(){return this.elementInternals?this.elementInternals.validationMessage:this.proxy.validationMessage}get willValidate(){return this.elementInternals?this.elementInternals.willValidate:this.proxy.willValidate}get labels(){if(this.elementInternals)return Object.freeze(Array.from(this.elementInternals.labels));if(this.proxy instanceof HTMLElement&&this.proxy.ownerDocument&&this.id){const e=this.proxy.labels,t=Array.from(this.proxy.getRootNode().querySelectorAll(`[for='${this.id}']`));return Object.freeze(t.concat(Array.from(e)))}else return a.emptyArray}valueChanged(e,t){this.dirtyValue=!0,this.proxy instanceof HTMLElement&&(this.proxy.value=this.value),this.setFormValue(this.value),this.validate()}get currentValue(){return this.value}set currentValue(e){this.value=e}initialValueChanged(e,t){this.dirtyValue||(this.value=this.initialValue,this.dirtyValue=!1)}disabledChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.disabled=this.disabled),a.Updates.enqueue(()=>this.classList.toggle("disabled",this.disabled))}nameChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.name=this.name)}requiredChanged(e,t){this.proxy instanceof HTMLElement&&(this.proxy.required=this.required),a.Updates.enqueue(()=>this.classList.toggle("required",this.required)),this.validate()}get elementInternals(){if(!c)return null;let e=u.get(this);return e||(e=this.attachInternals(),u.set(this,e)),e}connectedCallback(){super.connectedCallback(),this.addEventListener("keypress",this._keypressHandler),this.value||(this.value=this.initialValue,this.dirtyValue=!1),this.elementInternals||(this.attachProxy(),this.form&&this.form.addEventListener("reset",this.formResetCallback))}disconnectedCallback(){super.disconnectedCallback(),this.proxyEventsToBlock.forEach(e=>this.proxy.removeEventListener(e,this.stopPropagation)),!this.elementInternals&&this.form&&this.form.removeEventListener("reset",this.formResetCallback)}checkValidity(){return this.elementInternals?this.elementInternals.checkValidity():this.proxy.checkValidity()}reportValidity(){return this.elementInternals?this.elementInternals.reportValidity():this.proxy.reportValidity()}setValidity(e,t,s){if("valid"in e&&this.disabled){const{valid:n,...y}=e;e=y}this.elementInternals?this.elementInternals.setValidity(e,t,s):typeof t=="string"&&this.proxy.setCustomValidity(t)}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=this.initialValue,this.dirtyValue=!1}attachProxy(){this.proxyInitialized||(this.proxyInitialized=!0,this.proxy.style.display="none",this.proxyEventsToBlock.forEach(e=>this.proxy.addEventListener(e,this.stopPropagation)),this.proxy.disabled=this.disabled,this.proxy.required=this.required,typeof this.name=="string"&&(this.proxy.name=this.name),typeof this.value=="string"&&(this.proxy.value=this.value),this.proxy.setAttribute("slot",h),this.proxySlot=document.createElement("slot"),this.proxySlot.setAttribute("name",h)),this.shadowRoot.appendChild(this.proxySlot),this.appendChild(this.proxy)}detachProxy(){this.removeChild(this.proxy),this.shadowRoot.removeChild(this.proxySlot)}validate(e){if(this.proxy instanceof HTMLElement&&this.elementInternals){const t=this.proxy.validity.valid,s=this.control,n=s&&s.validity&&!s.validity.valid&&(s.validity.tooShort||s.validity.tooLong);t&&n?this.setValidity(s.validity,s.validationMessage,e):this.setValidity(this.proxy.validity,this.proxy.validationMessage,e)}}setFormValue(e,t){this.elementInternals&&this.elementInternals.setFormValue(e,t||e)}_keypressHandler(e){switch(e.key){case m.keyEnter:this.form instanceof HTMLFormElement&&this.form.querySelector("[type=submit]")?.click();break}}stopPropagation(e){e.stopPropagation()}}return l([a.attr({attribute:"current-value"})],i.prototype,"value"),l([a.attr({mode:"fromView",attribute:"value"})],i.prototype,"initialValue"),l([a.attr({mode:"boolean"})],i.prototype,"disabled"),l([a.attr],i.prototype,"name"),l([a.attr({mode:"boolean"})],i.prototype,"required"),i},v={fromView(r){return typeof r=="string"?r.toLowerCase()==="true":!!r},toView(r){return r?"true":"false"}},k=r=>{class i extends p(r){constructor(){super(...arguments),this.dirtyChecked=!1,this.defaultChecked=!1}defaultCheckedChanged(){this.dirtyChecked||(this.checked=this.defaultChecked,this.dirtyChecked=!1)}checkedChanged(e,t){this.dirtyChecked||(this.dirtyChecked=!0),this.updateForm(),this.proxy instanceof HTMLInputElement&&(this.proxy.checked=this.checked),e!==void 0&&this.$emit("change"),this.validate()}get checkedAttribute(){return this.defaultChecked}set checkedAttribute(e){this.defaultChecked=e}get currentChecked(){return this.checked}set currentChecked(e){this.checked=e}updateForm(){const e=this.checked?this.value:null;this.setFormValue(e,e)}connectedCallback(){super.connectedCallback(),this.updateForm()}formResetCallback(){super.formResetCallback(),this.checked=!!this.defaultChecked,this.dirtyChecked=!1}}return l([a.attr({attribute:"checked",mode:"boolean"})],i.prototype,"defaultChecked"),l([a.attr({attribute:"current-checked",converter:v})],i.prototype,"checked"),i};exports.CheckableFormAssociated=k;exports.FormAssociated=p;
@@ -1,4 +1,4 @@
1
- import { a, e as m, D as h } from "./vivid-element.js";
1
+ import { a, e as m, U as h } from "./vivid-element.js";
2
2
  import { f } from "./key-codes.js";
3
3
  var v = Object.defineProperty, l = (r, i, o, e) => {
4
4
  for (var t = void 0, s = r.length - 1, n; s >= 0; s--)
@@ -85,7 +85,7 @@ const d = "form-associated-proxy", c = "ElementInternals", u = c in window && "s
85
85
  * @internal
86
86
  */
87
87
  disabledChanged(e, t) {
88
- this.proxy instanceof HTMLElement && (this.proxy.disabled = this.disabled), h.queueUpdate(() => this.classList.toggle("disabled", this.disabled));
88
+ this.proxy instanceof HTMLElement && (this.proxy.disabled = this.disabled), h.enqueue(() => this.classList.toggle("disabled", this.disabled));
89
89
  }
90
90
  /**
91
91
  * @internal
@@ -97,7 +97,7 @@ const d = "form-associated-proxy", c = "ElementInternals", u = c in window && "s
97
97
  * @internal
98
98
  */
99
99
  requiredChanged(e, t) {
100
- this.proxy instanceof HTMLElement && (this.proxy.required = this.required), h.queueUpdate(() => this.classList.toggle("required", this.required)), this.validate();
100
+ this.proxy instanceof HTMLElement && (this.proxy.required = this.required), h.enqueue(() => this.classList.toggle("required", this.required)), this.validate();
101
101
  }
102
102
  /**
103
103
  * The element internals object. Will only exist
@@ -1 +1 @@
1
- "use strict";const s=require("./vivid-element.cjs"),u=require("./attribute-binding-behaviour.cjs");class c{constructor(e,t){this.target=e,this.bindingBehaviours=[],this.boundProperties=t.boundProperties}bind(e){if(this.target!==e)throw new Error("Target element must be the same as the source element");this.bindPropertiesToTarget(e,this.boundProperties,this.target)}unbind(e){this.releasePropertyBindings(e)}bindPropertiesToTarget(e,t,o){for(const[n,r]of Object.entries(t)){const a=r instanceof Function?r:h=>h[n]??r;this.bindingBehaviours.push(new u.AttributeBindingBehavior(o,a,!0,s.ariaAttributeName(n)))}e.$fastController.addBehaviors(this.bindingBehaviours)}releasePropertyBindings(e){e.$fastController.removeBehaviors(this.bindingBehaviours),this.bindingBehaviours=[]}}function d(i={}){const e=new Set(s.ariaMixinProperties.filter(t=>!(t in i)));return new s.AttachedBehaviorHTMLDirective("vvd-host-semantics",c,{boundProperties:i,forwardedProperties:e})}const v=i=>{class e extends i{constructor(){super(...arguments),this._vividAriaBehaviour="host"}}return e};exports.HostSemantics=v;exports.applyHostSemantics=d;
1
+ "use strict";const s=require("./vivid-element.cjs"),d=require("./attribute-binding-behaviour.cjs");class h{constructor(t,e){this.target=null,this.bindingBehaviours=[],this.target=t,this.boundProperties=e.boundProperties}bind(t){const e=t.source;if(this.target!==e)throw new Error("Target element must be the same as the source element");this.bindPropertiesToTarget(e,this.boundProperties,this.target)}bindPropertiesToTarget(t,e,o){for(const[i,n]of Object.entries(e)){const c=n instanceof Function?n:u=>u[i]??n;this.bindingBehaviours.push(new d.AttributeBindingBehavior(o,s.oneWay(c),!0,s.ariaAttributeName(i)))}for(const i of this.bindingBehaviours)i.bind({source:t,context:t.$fastController.context})}}class a extends s.StatelessAttachedAttributeDirective{constructor(t){super("vvd-host-semantics"),this.boundProperties=t,this.targetNodeId=""}bind(t){const e=t.targets[this.targetNodeId];new h(e,{boundProperties:this.boundProperties,forwardedProperties:new Set(s.ariaMixinProperties.filter(i=>!(i in this.boundProperties)))}).bind(t)}}s.HTMLDirective.define(a);function b(r={}){return new a(r)}const p=r=>{class t extends r{constructor(){super(...arguments),this._vividAriaBehaviour="host"}}return t};exports.HostSemantics=p;exports.applyHostSemantics=b;
@@ -1,50 +1,64 @@
1
- import { f as h, g as d, A as u } from "./vivid-element.js";
2
- import { A as c } from "./attribute-binding-behaviour.js";
3
- class g {
1
+ import { g as h, j as d, S as u, k as b, H as p } from "./vivid-element.js";
2
+ import { A as g } from "./attribute-binding-behaviour.js";
3
+ class m {
4
4
  constructor(t, e) {
5
- this.target = t, this.bindingBehaviours = [], this.boundProperties = e.boundProperties;
5
+ this.target = null, this.bindingBehaviours = [], this.target = t, this.boundProperties = e.boundProperties;
6
6
  }
7
7
  bind(t) {
8
- if (this.target !== t)
8
+ const e = t.source;
9
+ if (this.target !== e)
9
10
  throw new Error("Target element must be the same as the source element");
10
- this.bindPropertiesToTarget(t, this.boundProperties, this.target);
11
+ this.bindPropertiesToTarget(e, this.boundProperties, this.target);
11
12
  }
12
- unbind(t) {
13
- this.releasePropertyBindings(t);
14
- }
15
- bindPropertiesToTarget(t, e, n) {
16
- for (const [s, r] of Object.entries(e)) {
17
- const o = r instanceof Function ? r : (a) => a[s] ?? r;
13
+ bindPropertiesToTarget(t, e, o) {
14
+ for (const [i, r] of Object.entries(e)) {
15
+ const a = r instanceof Function ? r : (c) => c[i] ?? r;
18
16
  this.bindingBehaviours.push(
19
- new c(
20
- n,
17
+ new g(
21
18
  o,
19
+ h(a),
22
20
  !0,
23
- h(s)
21
+ d(i)
24
22
  )
25
23
  );
26
24
  }
27
- t.$fastController.addBehaviors(this.bindingBehaviours);
25
+ for (const i of this.bindingBehaviours)
26
+ i.bind({
27
+ source: t,
28
+ context: t.$fastController.context
29
+ });
30
+ }
31
+ // private releasePropertyBindings(source: HostSemanticsElement) {
32
+ // for (const behavior of this.bindingBehaviours) {
33
+ // (behavior as any).unbind();
34
+ // }
35
+ // this.bindingBehaviours = [];
36
+ // }
37
+ }
38
+ class n extends u {
39
+ constructor(t) {
40
+ super("vvd-host-semantics"), this.boundProperties = t, this.targetNodeId = "";
28
41
  }
29
- releasePropertyBindings(t) {
30
- t.$fastController.removeBehaviors(this.bindingBehaviours), this.bindingBehaviours = [];
42
+ bind(t) {
43
+ const e = t.targets[this.targetNodeId];
44
+ new m(
45
+ e,
46
+ // Pass the target element as target
47
+ {
48
+ boundProperties: this.boundProperties,
49
+ forwardedProperties: new Set(
50
+ b.filter((i) => !(i in this.boundProperties))
51
+ )
52
+ }
53
+ ).bind(t);
31
54
  }
32
55
  }
33
- function p(i = {}) {
34
- const t = new Set(
35
- d.filter((e) => !(e in i))
36
- );
37
- return new u(
38
- "vvd-host-semantics",
39
- g,
40
- {
41
- boundProperties: i,
42
- forwardedProperties: t
43
- }
44
- );
56
+ p.define(n);
57
+ function l(s = {}) {
58
+ return new n(s);
45
59
  }
46
- const v = (i) => {
47
- class t extends i {
60
+ const P = (s) => {
61
+ class t extends s {
48
62
  constructor() {
49
63
  super(...arguments), this._vividAriaBehaviour = "host";
50
64
  }
@@ -52,6 +66,6 @@ const v = (i) => {
52
66
  return t;
53
67
  };
54
68
  export {
55
- v as H,
56
- p as a
69
+ P as H,
70
+ l as a
57
71
  };
@@ -1 +1 @@
1
- "use strict";const f=require("./option.cjs"),o=require("./vivid-element.cjs"),l=require("./key-codes.cjs"),b=require("./strings.cjs");function x(h,e){let t=h.length;for(;t--;)if(e(h[t],t,h))return t;return-1}var O=Object.defineProperty,a=(h,e,t,n)=>{for(var s=void 0,i=h.length-1,d;i>=0;i--)(d=h[i])&&(s=d(e,t,s)||s);return s&&O(e,t,s),s};const r=class p extends o.VividElement{constructor(){super(...arguments),this._options=[],this.selectedIndex=-1,this.selectedOptions=[],this.shouldSkipFocus=!1,this.typeaheadBuffer="",this.typeaheadExpired=!0,this.typeaheadTimeout=-1,this._activeDescendant=null}get firstSelectedOption(){return this.selectedOptions[0]??null}get hasSelectableOptions(){return this.options.length>0&&!this.options.every(e=>e.disabled)}get length(){return this.options.length}get options(){return o.Observable.track(this,"options"),this._options}set options(e){this._options=e,o.Observable.notify(this,"options")}static{this.slottedOptionFilter=e=>f.isListboxOption(e)&&!e.hidden}static{this.TYPE_AHEAD_TIMEOUT_MS=1e3}clickHandler(e){const t=e.target.closest("option,[role=option],[data-vvd-component=option]");if(t&&!t.disabled)return this.selectedIndex=this.options.indexOf(t),!0}focusAndScrollOptionIntoView(e=this.firstSelectedOption){this.contains(document.activeElement)&&e!==null&&(e.focus(),requestAnimationFrame(()=>{e.scrollIntoView({block:"nearest"})}))}focusinHandler(e){!this.shouldSkipFocus&&e.target===e.currentTarget&&(this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}getTypeaheadMatches(){const e=this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`^${e}`,"gi");return this.options.filter(n=>n.text.trim().match(t))}getSelectableIndex(e,t){const n=e>t?-1:1,s=e+n;let i=null;switch(n){case-1:{i=this.options.reduceRight((d,c,u)=>!d&&!c.disabled&&u<s?c:d,i);break}case 1:{i=this.options.reduce((d,c,u)=>!d&&!c.disabled&&u>s?c:d,i);break}}return this.options.indexOf(i)}handleChange(e,t){switch(t){case"selected":{p.slottedOptionFilter(e)&&(this.selectedIndex=this.options.indexOf(e)),this.setSelectedOptions();break}}}handleTypeAhead(e){this.typeaheadTimeout&&window.clearTimeout(this.typeaheadTimeout),this.typeaheadTimeout=window.setTimeout(()=>this.typeaheadExpired=!0,p.TYPE_AHEAD_TIMEOUT_MS),this.typeaheadBuffer=`${this.typeaheadExpired?"":this.typeaheadBuffer}${e}`}keydownHandler(e){if(this.disabled)return!0;this.shouldSkipFocus=!1;const t=e.key;switch(t){case l.keyHome:{e.shiftKey||(e.preventDefault(),this.selectFirstOption());break}case l.keyArrowDown:{e.shiftKey||(e.preventDefault(),this.selectNextOption());break}case l.keyArrowUp:{e.shiftKey||(e.preventDefault(),this.selectPreviousOption());break}case l.keyEnd:{e.preventDefault(),this.selectLastOption();break}case l.keyTab:return this.focusAndScrollOptionIntoView(),!0;case l.keyEnter:case l.keyEscape:return!0;case l.keySpace:if(this.typeaheadExpired)return!0;default:return t.length===1&&this.handleTypeAhead(`${t}`),!0}}mousedownHandler(e){return this.shouldSkipFocus=!this.contains(document.activeElement),!0}selectedIndexChanged(e,t){if(!this.hasSelectableOptions){this.selectedIndex=-1;return}if(this.options[this.selectedIndex]?.disabled&&typeof e=="number"){const n=this.getSelectableIndex(e,t),s=n>-1?n:e;this.selectedIndex=s;return}this.setSelectedOptions()}selectedOptionsChanged(e,t){const n=t.filter(p.slottedOptionFilter);this.options.forEach(s=>{const i=o.Observable.getNotifier(s);i.unsubscribe(this,"selected"),s.selected=n.includes(s),i.subscribe(this,"selected")})}selectFirstOption(){this.disabled||(this.selectedIndex=this.options.findIndex(e=>!e.disabled))}selectLastOption(){this.disabled||(this.selectedIndex=x(this.options,e=>!e.disabled))}selectNextOption(){!this.disabled&&this.selectedIndex<this.options.length-1&&(this.selectedIndex+=1)}selectPreviousOption(){!this.disabled&&this.selectedIndex>0&&(this.selectedIndex=this.selectedIndex-1)}setDefaultSelectedOption(){this.selectedIndex=this.options.findIndex(e=>e.defaultSelected)}setSelectedOptions(){this.options.length&&(this.selectedOptions=[this.options[this.selectedIndex]],this._activeDescendant=this.firstSelectedOption?.id??"",this.focusAndScrollOptionIntoView())}slottedOptionsChanged(e,t){this.options=t.reduce((s,i)=>(f.isListboxOption(i)&&s.push(i),s),[]);const n=`${this.options.length}`;this.options.forEach((s,i)=>{s.id||(s.id=b.uniqueId("option-")),s.ariaPosInSet=`${i+1}`,s.ariaSetSize=n}),this.$fastController.isConnected&&(this.setSelectedOptions(),this.setDefaultSelectedOption())}typeaheadBufferChanged(e,t){if(this.$fastController.isConnected){const n=this.getTypeaheadMatches();if(n.length){const s=this.options.indexOf(n[0]);s>-1&&(this.selectedIndex=s)}this.typeaheadExpired=!1}}};a([o.attr({mode:"boolean"})],r.prototype,"disabled");a([o.observable],r.prototype,"selectedIndex");a([o.observable],r.prototype,"selectedOptions");a([o.observable],r.prototype,"slottedOptions");a([o.observable],r.prototype,"typeaheadBuffer");a([o.observable],r.prototype,"_activeDescendant");let y=r;exports.Listbox=y;
1
+ "use strict";const p=require("./definition11.cjs"),o=require("./vivid-element.cjs"),d=require("./key-codes.cjs"),u=require("./strings.cjs");function f(r,e){let t=r.length;for(;t--;)if(e(r[t],t,r))return t;return-1}var x=Object.defineProperty,a=(r,e,t,i)=>{for(var s=void 0,n=r.length-1,c;n>=0;n--)(c=r[n])&&(s=c(e,t,s)||s);return s&&x(e,t,s),s};const l=class h extends o.VividElement{constructor(){super(...arguments),this._options=[],this.selectedIndex=-1,this.selectedOptions=[],this.shouldSkipFocus=!1,this.typeaheadBuffer="",this.typeaheadExpired=!0,this.typeaheadTimeout=-1,this._activeDescendant=null}get firstSelectedOption(){return this.selectedOptions[0]??null}get length(){return this.options.length}get options(){return o.Observable.track(this,"options"),this._options}set options(e){const t=this._options;if(this._options=e,o.Observable.notify(this,"options"),this.$fastController.isConnected){const i=this._newDefaultSelectedIndex(t,e,this.selectedIndex);i!==null&&(this.selectedIndex=i)}}static{this.slottedOptionFilter=e=>p.isListboxOption(e)&&!e.hidden}static{this.TYPE_AHEAD_TIMEOUT_MS=1e3}clickHandler(e){const t=e.target.closest("option,[role=option],[data-vvd-component=option]");if(t&&!t.disabled)return this.selectedIndex=this.options.indexOf(t),!0}focusAndScrollOptionIntoView(e=this.firstSelectedOption){this.contains(document.activeElement)&&e!==null&&(e.focus(),requestAnimationFrame(()=>{e.scrollIntoView({block:"nearest"})}))}focusinHandler(e){!this.shouldSkipFocus&&e.target===e.currentTarget&&(this.setSelectedOptions(),this.focusAndScrollOptionIntoView()),this.shouldSkipFocus=!1}getTypeaheadMatches(){const e=this.typeaheadBuffer.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&"),t=new RegExp(`^${e}`,"gi");return this.options.filter(i=>i.text.trim().match(t))}getNextSelectableIndex(e){const t=this.options.reduce((i,s,n)=>!i&&!s.disabled&&n>=e?s:i,null);return this.options.indexOf(t)}handleChange(e,t){switch(t){case"selected":{h.slottedOptionFilter(e)&&(this.selectedIndex=this.options.indexOf(e)),this.setSelectedOptions();break}}}handleTypeAhead(e){this.typeaheadTimeout&&window.clearTimeout(this.typeaheadTimeout),this.typeaheadTimeout=window.setTimeout(()=>this.typeaheadExpired=!0,h.TYPE_AHEAD_TIMEOUT_MS),this.typeaheadBuffer=`${this.typeaheadExpired?"":this.typeaheadBuffer}${e}`}keydownHandler(e){if(this.disabled)return!0;this.shouldSkipFocus=!1;const t=e.key;switch(t){case d.keyHome:{e.shiftKey||(e.preventDefault(),this.selectFirstOption());break}case d.keyArrowDown:{e.shiftKey||(e.preventDefault(),this.selectNextOption());break}case d.keyArrowUp:{e.shiftKey||(e.preventDefault(),this.selectPreviousOption());break}case d.keyEnd:{e.preventDefault(),this.selectLastOption();break}case d.keyTab:return this.focusAndScrollOptionIntoView(),!0;case d.keyEnter:case d.keyEscape:return!0;case d.keySpace:if(this.typeaheadExpired)return!0;default:return t.length===1&&this.handleTypeAhead(`${t}`),!0}}mousedownHandler(e){return this.shouldSkipFocus=!this.contains(document.activeElement),!0}selectedIndexChanged(e,t){const i=this._validSelectedIndex(t);if(t!==i){this.selectedIndex=i;return}this.setSelectedOptions()}_validSelectedIndex(e){return e>this.options.length-1||e<-1?-1:e}selectedOptionsChanged(e,t){const i=t.filter(h.slottedOptionFilter);this.options.forEach(s=>{const n=o.Observable.getNotifier(s);n.unsubscribe(this,"selected"),s.selected=i.includes(s),n.subscribe(this,"selected")})}selectFirstOption(){this.disabled||(this.selectedIndex=this.options.findIndex(e=>!e.disabled))}selectLastOption(){this.disabled||(this.selectedIndex=f(this.options,e=>!e.disabled))}selectNextOption(){!this.disabled&&this.selectedIndex<this.options.length-1&&(this.selectedIndex+=1)}selectPreviousOption(){!this.disabled&&this.selectedIndex>0&&(this.selectedIndex=this.selectedIndex-1)}_newDefaultSelectedIndex(e,t,i){for(const[s,n]of t.entries())if(this._isDefaultSelected(n)&&!e.includes(n))return s;return null}_isDefaultSelected(e){return e.defaultSelected}setSelectedOptions(){this.selectedOptions=this.selectedIndex!==-1?[this.options[this.selectedIndex]]:[],this._activeDescendant=this.firstSelectedOption?.id??"",this.focusAndScrollOptionIntoView()}slottedOptionsChanged(e,t){this.options=t.reduce((s,n)=>(p.isListboxOption(n)&&s.push(n),s),[]);const i=`${this.options.length}`;this.options.forEach((s,n)=>{s.id||(s.id=u.uniqueId("option-")),s.ariaPosInSet=`${n+1}`,s.ariaSetSize=i})}typeaheadBufferChanged(e,t){if(this.$fastController.isConnected){const i=this.getTypeaheadMatches();if(i.length){const s=this.options.indexOf(i[0]);s>-1&&(this.selectedIndex=s)}this.typeaheadExpired=!1}}};a([o.attr({mode:"boolean"})],l.prototype,"disabled");a([o.observable],l.prototype,"selectedIndex");a([o.observable],l.prototype,"selectedOptions");a([o.observable],l.prototype,"slottedOptions");a([o.observable],l.prototype,"typeaheadBuffer");a([o.observable],l.prototype,"_activeDescendant");let b=l;exports.Listbox=b;