@vonage/vivid 5.1.0 → 5.3.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 (386) hide show
  1. package/accordion-item/definition.cjs +2 -1
  2. package/accordion-item/definition.js +2 -1
  3. package/alert/index.cjs +1 -1
  4. package/alert/index.js +1 -1
  5. package/audio-player/definition.cjs +41 -6
  6. package/audio-player/definition.js +41 -6
  7. package/audio-player/index.cjs +27 -25
  8. package/audio-player/index.js +88 -62
  9. package/badge/index.cjs +2 -2
  10. package/badge/index.js +4 -4
  11. package/banner/index.cjs +3 -3
  12. package/banner/index.js +6 -6
  13. package/breadcrumb-item/index.cjs +1 -1
  14. package/breadcrumb-item/index.js +1 -1
  15. package/bundled/affix.cjs +7 -7
  16. package/bundled/affix.js +5 -5
  17. package/bundled/anchored.cjs +1 -1
  18. package/bundled/anchored.js +6 -6
  19. package/bundled/attribute-binding-behaviour.cjs +1 -1
  20. package/bundled/attribute-binding-behaviour.js +15 -13
  21. package/bundled/base-color-picker.cjs +13 -0
  22. package/bundled/base-color-picker.js +194 -0
  23. package/bundled/button.cjs +1 -1
  24. package/bundled/button.js +2 -2
  25. package/bundled/calendar-picker.template.cjs +1 -1
  26. package/bundled/calendar-picker.template.js +21 -21
  27. package/bundled/char-count.cjs +1 -1
  28. package/bundled/char-count.js +1 -1
  29. package/bundled/children.cjs +1 -1
  30. package/bundled/children.js +28 -20
  31. package/bundled/definition.cjs +3 -3
  32. package/bundled/definition.js +38 -38
  33. package/bundled/definition10.cjs +72 -18
  34. package/bundled/definition10.js +351 -65
  35. package/bundled/definition11.cjs +19 -10
  36. package/bundled/definition11.js +66 -37
  37. package/bundled/definition12.cjs +10 -1
  38. package/bundled/definition12.js +38 -14
  39. package/bundled/definition13.cjs +1 -73
  40. package/bundled/definition13.js +15 -354
  41. package/bundled/definition15.cjs +1 -1
  42. package/bundled/definition15.js +1 -1
  43. package/bundled/definition16.cjs +2 -2
  44. package/bundled/definition16.js +8 -8
  45. package/bundled/definition17.cjs +7 -7
  46. package/bundled/definition17.js +17 -17
  47. package/bundled/definition19.cjs +17 -14
  48. package/bundled/definition19.js +85 -77
  49. package/bundled/definition2.cjs +9 -5
  50. package/bundled/definition2.js +21 -17
  51. package/bundled/definition22.cjs +9 -9
  52. package/bundled/definition22.js +31 -31
  53. package/bundled/definition3.cjs +1 -1
  54. package/bundled/definition3.js +1 -1
  55. package/bundled/definition6.cjs +6 -6
  56. package/bundled/definition6.js +34 -31
  57. package/bundled/definition7.cjs +1 -1
  58. package/bundled/definition7.js +6 -6
  59. package/bundled/definition8.cjs +2 -2
  60. package/bundled/definition8.js +4 -4
  61. package/bundled/definition9.cjs +1 -1
  62. package/bundled/definition9.js +1 -1
  63. package/bundled/delegates-aria.cjs +1 -1
  64. package/bundled/delegates-aria.js +59 -46
  65. package/bundled/form-associated.cjs +1 -1
  66. package/bundled/form-associated.js +3 -3
  67. package/bundled/host-semantics.cjs +1 -1
  68. package/bundled/host-semantics.js +48 -34
  69. package/bundled/localized.cjs +1 -1
  70. package/bundled/localized.js +43 -31
  71. package/bundled/mixins.cjs +18 -18
  72. package/bundled/mixins.js +99 -93
  73. package/bundled/normalize.cjs +1 -0
  74. package/bundled/normalize.js +7 -0
  75. package/bundled/picker-field.template.cjs +18 -13
  76. package/bundled/picker-field.template.js +45 -37
  77. package/bundled/ref.cjs +1 -1
  78. package/bundled/ref.js +8 -25
  79. package/bundled/repeat.cjs +1 -1
  80. package/bundled/repeat.js +459 -233
  81. package/bundled/slider.template.cjs +1 -1
  82. package/bundled/slider.template.js +2 -2
  83. package/bundled/slotted.cjs +1 -1
  84. package/bundled/slotted.js +62 -45
  85. package/bundled/text-field.cjs +1 -1
  86. package/bundled/text-field.js +1 -1
  87. package/bundled/time-selection-picker.template.cjs +1 -1
  88. package/bundled/time-selection-picker.template.js +5 -5
  89. package/bundled/vivid-element.cjs +1 -1
  90. package/bundled/vivid-element.js +2126 -1172
  91. package/bundled/when.cjs +1 -1
  92. package/bundled/when.js +8 -7
  93. package/bundled/with-contextual-help.cjs +1 -1
  94. package/bundled/with-contextual-help.js +17 -7
  95. package/calendar/definition.cjs +1 -1
  96. package/calendar/definition.js +2 -2
  97. package/calendar/index.cjs +1 -1
  98. package/calendar/index.js +6 -6
  99. package/calendar-event/index.cjs +1 -1
  100. package/calendar-event/index.js +1 -1
  101. package/card/definition.cjs +10 -2
  102. package/card/definition.js +10 -2
  103. package/card/index.cjs +19 -11
  104. package/card/index.js +35 -27
  105. package/color-picker/definition.cjs +1079 -0
  106. package/color-picker/definition.js +1073 -0
  107. package/color-picker/index.cjs +127 -0
  108. package/color-picker/index.js +726 -0
  109. package/combobox/definition.cjs +13 -6
  110. package/combobox/definition.js +14 -7
  111. package/combobox/index.cjs +15 -11
  112. package/combobox/index.js +82 -75
  113. package/contextual-help/index.cjs +1 -1
  114. package/contextual-help/index.js +1 -1
  115. package/custom-elements.json +1621 -325
  116. package/data-grid/definition.cjs +862 -27
  117. package/data-grid/definition.js +863 -28
  118. package/data-grid/index.cjs +25 -25
  119. package/data-grid/index.js +175 -168
  120. package/date-picker/index.cjs +1 -1
  121. package/date-picker/index.js +2 -2
  122. package/date-range-picker/index.cjs +1 -1
  123. package/date-range-picker/index.js +2 -2
  124. package/date-time-picker/index.cjs +1 -1
  125. package/date-time-picker/index.js +2 -2
  126. package/dial-pad/definition.cjs +55 -1
  127. package/dial-pad/definition.js +56 -2
  128. package/dial-pad/index.cjs +21 -18
  129. package/dial-pad/index.js +138 -104
  130. package/dialog/definition.cjs +4 -1
  131. package/dialog/definition.js +4 -1
  132. package/dialog/index.cjs +21 -18
  133. package/dialog/index.js +43 -40
  134. package/empty-state/definition.cjs +7 -2
  135. package/empty-state/definition.js +7 -2
  136. package/empty-state/index.cjs +10 -5
  137. package/empty-state/index.js +18 -13
  138. package/fab/index.cjs +2 -2
  139. package/fab/index.js +4 -4
  140. package/file-picker/definition.cjs +16 -7
  141. package/file-picker/definition.js +17 -8
  142. package/file-picker/index.cjs +12 -9
  143. package/file-picker/index.js +103 -93
  144. package/icon/definition.cjs +10 -6
  145. package/icon/definition.js +10 -6
  146. package/index.cjs +4 -0
  147. package/index.js +1 -0
  148. package/lib/accordion-item/accordion-item.d.ts +2 -2
  149. package/lib/action-group/action-group.d.ts +2 -2
  150. package/lib/alert/alert.d.ts +4 -4
  151. package/lib/audio-player/audio-player.d.ts +6 -2
  152. package/lib/avatar/avatar.d.ts +2 -2
  153. package/lib/badge/badge.d.ts +2 -2
  154. package/lib/banner/banner.d.ts +6 -6
  155. package/lib/breadcrumb/breadcrumb.d.ts +2 -2
  156. package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
  157. package/lib/button/button.d.ts +6 -6
  158. package/lib/button/button.template.d.ts +2 -1
  159. package/lib/calendar/calendar.d.ts +1 -1
  160. package/lib/calendar-event/calendar-event.d.ts +2 -2
  161. package/lib/card/card.d.ts +2 -2
  162. package/lib/checkbox/checkbox.d.ts +12 -12
  163. package/lib/color-picker/color-picker.d.ts +2420 -0
  164. package/lib/color-picker/color-picker.template.d.ts +3 -0
  165. package/lib/color-picker/definition.d.ts +4 -0
  166. package/lib/color-picker/locale.d.ts +9 -0
  167. package/lib/combobox/combobox.d.ts +495 -78
  168. package/lib/components.d.ts +1 -0
  169. package/lib/data-grid/data-grid-cell.d.ts +4 -4
  170. package/lib/data-grid/data-grid-row.d.ts +3 -4
  171. package/lib/data-grid/data-grid.d.ts +1 -2
  172. package/lib/date-picker/date-picker.d.ts +906 -894
  173. package/lib/date-range-picker/date-range-picker.d.ts +596 -590
  174. package/lib/date-time-picker/date-time-picker.d.ts +907 -895
  175. package/lib/dial-pad/dial-pad.d.ts +3 -2
  176. package/lib/dial-pad/dial-pad.template.d.ts +1 -1
  177. package/lib/dial-pad/locale.d.ts +1 -0
  178. package/lib/dialog/dialog.d.ts +4 -4
  179. package/lib/divider/divider.d.ts +2 -2
  180. package/lib/fab/fab.d.ts +2 -2
  181. package/lib/file-picker/file-picker.d.ts +495 -78
  182. package/lib/header/header.d.ts +2 -2
  183. package/lib/menu/menu.d.ts +5 -4
  184. package/lib/menu-item/menu-item.d.ts +4 -4
  185. package/lib/nav/nav.d.ts +2 -2
  186. package/lib/nav-disclosure/nav-disclosure.d.ts +4 -4
  187. package/lib/nav-item/nav-item.d.ts +4 -4
  188. package/lib/note/note.d.ts +2 -2
  189. package/lib/number-field/number-field.d.ts +19 -18
  190. package/lib/option/option.d.ts +4 -4
  191. package/lib/pagination/pagination.d.ts +2 -2
  192. package/lib/progress/progress.d.ts +2 -2
  193. package/lib/progress-ring/progress-ring.d.ts +2 -2
  194. package/lib/radio/radio.d.ts +6 -6
  195. package/lib/radio-group/radio-group.d.ts +2 -2
  196. package/lib/range-slider/range-slider.d.ts +6 -6
  197. package/lib/rich-text-editor/menubar/menubar.d.ts +2 -2
  198. package/lib/rich-text-editor/rich-text-editor.d.ts +2 -2
  199. package/lib/searchable-select/option-tag.d.ts +2 -2
  200. package/lib/searchable-select/searchable-select.d.ts +521 -104
  201. package/lib/select/select.d.ts +484 -67
  202. package/lib/selectable-box/selectable-box.d.ts +2 -2
  203. package/lib/simple-color-picker/locale.d.ts +0 -1
  204. package/lib/simple-color-picker/simple-color-picker.d.ts +47 -821
  205. package/lib/slider/slider.d.ts +6 -6
  206. package/lib/split-button/split-button.d.ts +6 -6
  207. package/lib/switch/switch.d.ts +4 -4
  208. package/lib/tab/tab.d.ts +6 -6
  209. package/lib/tab-panel/tab-panel.d.ts +2 -2
  210. package/lib/tag/tag.d.ts +6 -6
  211. package/lib/tag-group/tag-group.d.ts +2 -2
  212. package/lib/tag-name-map.d.ts +2 -1
  213. package/lib/text-area/text-area.d.ts +17 -16
  214. package/lib/text-field/text-field.d.ts +19 -18
  215. package/lib/time-picker/time-picker.d.ts +579 -573
  216. package/lib/toggletip/toggletip.d.ts +4 -4
  217. package/lib/tooltip/tooltip.d.ts +2 -2
  218. package/lib/tree-item/tree-item.d.ts +4 -4
  219. package/lib/tree-view/tree-view.d.ts +2 -2
  220. package/lib/video-player/video-player.d.ts +2 -2
  221. package/locales/de-DE.cjs +15 -3
  222. package/locales/de-DE.js +15 -3
  223. package/locales/en-GB.cjs +15 -3
  224. package/locales/en-GB.js +15 -3
  225. package/locales/en-US.cjs +15 -3
  226. package/locales/en-US.js +15 -3
  227. package/locales/ja-JP.cjs +15 -3
  228. package/locales/ja-JP.js +15 -3
  229. package/locales/zh-CN.cjs +15 -3
  230. package/locales/zh-CN.js +15 -3
  231. package/menu/definition.cjs +8 -4
  232. package/menu/definition.js +9 -5
  233. package/note/index.cjs +2 -2
  234. package/note/index.js +4 -4
  235. package/number-field/definition.cjs +3 -3
  236. package/number-field/definition.js +4 -4
  237. package/number-field/index.cjs +8 -8
  238. package/number-field/index.js +41 -40
  239. package/option/index.cjs +1 -1
  240. package/option/index.js +1 -1
  241. package/package.json +5 -5
  242. package/pagination/definition.cjs +2 -1
  243. package/pagination/definition.js +2 -1
  244. package/pagination/index.cjs +12 -12
  245. package/pagination/index.js +59 -59
  246. package/progress/index.cjs +1 -1
  247. package/progress/index.js +1 -1
  248. package/radio/definition.cjs +9 -9
  249. package/radio/definition.js +10 -10
  250. package/radio-group/definition.cjs +2 -1
  251. package/radio-group/definition.js +2 -1
  252. package/radio-group/index.cjs +5 -5
  253. package/radio-group/index.js +80 -77
  254. package/range-slider/index.cjs +1 -1
  255. package/range-slider/index.js +1 -1
  256. package/rich-text-editor/definition.cjs +1 -1
  257. package/rich-text-editor/definition.js +2 -2
  258. package/rich-text-editor/index.cjs +2 -2
  259. package/rich-text-editor/index.js +3 -3
  260. package/searchable-select/definition.cjs +30 -21
  261. package/searchable-select/definition.js +31 -22
  262. package/searchable-select/index.cjs +28 -25
  263. package/searchable-select/index.js +149 -140
  264. package/select/definition.cjs +15 -7
  265. package/select/definition.js +16 -8
  266. package/selectable-box/definition.cjs +1 -1
  267. package/selectable-box/definition.js +1 -1
  268. package/selectable-box/index.cjs +3 -3
  269. package/selectable-box/index.js +20 -20
  270. package/shared/aria/aria-change-subscription.d.ts +0 -1
  271. package/shared/aria/aria-mixin.d.ts +2 -2
  272. package/shared/aria/delegate-aria-behavior.d.ts +5 -10
  273. package/shared/aria/delegates-aria.d.ts +3 -3
  274. package/shared/aria/host-semantics-behavior.d.ts +5 -8
  275. package/shared/aria/host-semantics.d.ts +3 -3
  276. package/shared/color-picker/base-color-picker.d.ts +436 -0
  277. package/shared/color-picker/index.d.ts +1 -0
  278. package/shared/color-picker/locale.d.ts +3 -0
  279. package/shared/color-picker/utils.d.ts +1 -0
  280. package/shared/deprecation/replaced-props.d.ts +317 -2
  281. package/shared/design-system/defineVividComponent.d.ts +2 -2
  282. package/shared/feedback/feedback-message.d.ts +2 -2
  283. package/shared/feedback/mixins.d.ts +4 -4
  284. package/shared/foundation/button/button.d.ts +4 -4
  285. package/shared/foundation/form-associated/form-associated.d.ts +4 -4
  286. package/shared/foundation/vivid-element/vivid-element.d.ts +335 -8
  287. package/shared/localization/Locale.d.ts +4 -0
  288. package/shared/patterns/affix.d.ts +4 -4
  289. package/shared/patterns/anchored.d.ts +4 -4
  290. package/shared/patterns/char-count/char-count.d.ts +2 -2
  291. package/shared/patterns/form-elements/form-element.d.ts +4 -4
  292. package/shared/patterns/form-elements/index.d.ts +1 -0
  293. package/shared/patterns/form-elements/with-contextual-help.d.ts +7 -6
  294. package/shared/patterns/form-elements/with-error-text.d.ts +6 -6
  295. package/shared/patterns/form-elements/with-success-text.d.ts +2 -2
  296. package/shared/patterns/linkable.d.ts +2 -2
  297. package/shared/patterns/localized.d.ts +2 -2
  298. package/shared/patterns/trapped-focus.d.ts +2 -2
  299. package/shared/picker-field/mixins/calendar-picker.d.ts +454 -451
  300. package/shared/picker-field/mixins/calendar-picker.template.d.ts +454 -451
  301. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +2 -2
  302. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +600 -594
  303. package/shared/picker-field/mixins/single-date-picker.d.ts +746 -737
  304. package/shared/picker-field/mixins/single-value-picker.d.ts +451 -448
  305. package/shared/picker-field/mixins/time-selection-picker.d.ts +580 -574
  306. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +579 -573
  307. package/shared/picker-field/picker-field.d.ts +495 -78
  308. package/shared/templating/attribute-binding-behaviour.d.ts +3 -4
  309. package/shared/templating/render-in-light-dom.d.ts +13 -12
  310. package/side-drawer/index.cjs +1 -1
  311. package/side-drawer/index.js +1 -1
  312. package/simple-color-picker/definition.cjs +28 -215
  313. package/simple-color-picker/definition.js +29 -216
  314. package/simple-color-picker/index.cjs +9 -21
  315. package/simple-color-picker/index.js +71 -185
  316. package/styles/core/all.css +1 -1
  317. package/styles/core/theme.css +1 -1
  318. package/styles/core/typography.css +1 -1
  319. package/styles/tokens/theme-dark.css +4 -4
  320. package/styles/tokens/theme-light.css +4 -4
  321. package/styles/tokens/vivid-2-compat.css +1 -1
  322. package/switch/index.cjs +2 -2
  323. package/switch/index.js +4 -4
  324. package/tabs/definition.cjs +1 -1
  325. package/tabs/definition.js +2 -2
  326. package/tabs/index.cjs +2 -2
  327. package/tabs/index.js +16 -16
  328. package/tag/index.cjs +1 -1
  329. package/tag/index.js +1 -1
  330. package/text-area/definition.cjs +1 -1
  331. package/text-area/definition.js +1 -1
  332. package/text-area/index.cjs +3 -3
  333. package/text-area/index.js +9 -9
  334. package/text-field/definition.cjs +3 -3
  335. package/text-field/definition.js +4 -4
  336. package/text-field/index.cjs +1 -1
  337. package/text-field/index.js +1 -1
  338. package/time-picker/index.cjs +1 -1
  339. package/time-picker/index.js +2 -2
  340. package/toggletip/definition.cjs +1 -1
  341. package/toggletip/definition.js +2 -2
  342. package/tree-view/definition.cjs +1 -1
  343. package/tree-view/definition.js +2 -2
  344. package/tree-view/index.cjs +2 -2
  345. package/tree-view/index.js +6 -6
  346. package/unbundled/_commonjsHelpers.cjs +36 -0
  347. package/unbundled/_commonjsHelpers.js +32 -0
  348. package/unbundled/affix.cjs +1 -1
  349. package/unbundled/affix.js +1 -1
  350. package/unbundled/attribute-binding-behaviour.cjs +11 -10
  351. package/unbundled/attribute-binding-behaviour.js +11 -10
  352. package/unbundled/base-color-picker.cjs +278 -0
  353. package/unbundled/base-color-picker.js +275 -0
  354. package/unbundled/button.cjs +1 -1
  355. package/unbundled/button.js +2 -2
  356. package/unbundled/calendar-picker.template.cjs +3 -3
  357. package/unbundled/calendar-picker.template.js +4 -4
  358. package/unbundled/definition2.cjs +1 -1
  359. package/unbundled/definition2.js +2 -2
  360. package/unbundled/definition3.cjs +2 -1
  361. package/unbundled/definition3.js +2 -1
  362. package/unbundled/delegates-aria.cjs +67 -33
  363. package/unbundled/delegates-aria.js +69 -35
  364. package/unbundled/form-associated.cjs +2 -2
  365. package/unbundled/form-associated.js +3 -3
  366. package/unbundled/host-semantics.cjs +47 -22
  367. package/unbundled/host-semantics.js +48 -23
  368. package/unbundled/mixins.cjs +34 -27
  369. package/unbundled/mixins.js +35 -28
  370. package/unbundled/picker-field.template.cjs +13 -5
  371. package/unbundled/picker-field.template.js +14 -6
  372. package/unbundled/text-field.cjs +1 -1
  373. package/unbundled/text-field.js +1 -1
  374. package/unbundled/time-selection-picker.template.cjs +4 -4
  375. package/unbundled/time-selection-picker.template.js +5 -5
  376. package/unbundled/vivid-element.cjs +22 -15
  377. package/unbundled/vivid-element.js +23 -15
  378. package/unbundled/with-contextual-help.cjs +11 -0
  379. package/unbundled/with-contextual-help.js +11 -0
  380. package/video-player/definition.cjs +69007 -1
  381. package/video-player/definition.js +69007 -1
  382. package/video-player/index.cjs +35 -35
  383. package/video-player/index.js +1358 -1384
  384. package/visually-hidden/index.cjs +1 -1
  385. package/visually-hidden/index.js +1 -1
  386. package/vivid.api.json +347 -69
@@ -1,23 +1,38 @@
1
- import { Observable, DOM, AttachedBehaviorHTMLDirective } from '@microsoft/fast-element';
1
+ import { oneWay, Observable, StatelessAttachedAttributeDirective, HTMLDirective } from '@microsoft/fast-element';
2
2
  import { A as AttributeBindingBehavior } from './attribute-binding-behaviour.js';
3
- import { a as ariaAttributeName, s as subscribeToAriaPropertyChanges, u as unsubscribeFromAriaPropertyChanges, b as ariaMixinProperties } from './vivid-element.js';
3
+ import { a as ariaAttributeName, s as subscribeToAriaPropertyChanges, b as ariaMixinProperties } from './vivid-element.js';
4
4
 
5
5
  class DelegateAriaBehavior {
6
6
  constructor(target, params) {
7
- this.target = target;
8
- this.source = null;
7
+ this.target = null;
8
+ // unbind() {
9
+ // if (this.source === null) {
10
+ // return;
11
+ // }
12
+ // this.releasePropertyBindings(this.source);
13
+ // this.stopForwardingPropertiesToTarget(this.source);
14
+ // this.source = null;
15
+ // }
9
16
  this.bindingBehaviours = [];
17
+ // private stopForwardingPropertiesToTarget(source: DelegatesAriaElement) {
18
+ // unsubscribeFromAriaPropertyChanges(
19
+ // source as AriaMixinElement,
20
+ // this.onSourceAriaPropertyChanged
21
+ // );
22
+ // }
10
23
  this.onSourceAriaPropertyChanged = (source, property) => {
11
- if (!this.forwardedProperties.has(property)) {
24
+ if (!this.forwardedProperties.has(property) || property in this.boundProperties) {
12
25
  return;
13
26
  }
14
27
  this.forwardPropertyToTarget(this.target, property, source[property]);
15
28
  };
29
+ this.target = target;
16
30
  this.boundProperties = params.boundProperties;
17
31
  this.forwardedProperties = params.forwardedProperties;
18
32
  }
19
- bind(source) {
20
- this.source = source;
33
+ // private source: DelegatesAriaElement | null = null;
34
+ bind(controller) {
35
+ const source = controller.source;
21
36
  this.bindPropertiesToTarget(source, this.boundProperties, this.target);
22
37
  this.startForwardingPropertiesToTarget(
23
38
  source,
@@ -25,63 +40,82 @@ class DelegateAriaBehavior {
25
40
  this.target
26
41
  );
27
42
  }
28
- unbind() {
29
- if (this.source === null) {
30
- return;
31
- }
32
- this.releasePropertyBindings(this.source);
33
- this.stopForwardingPropertiesToTarget(this.source);
34
- this.source = null;
35
- }
36
43
  bindPropertiesToTarget(source, boundProperties, target) {
37
44
  for (const [property, binding] of Object.entries(boundProperties)) {
38
45
  const bindingFn = binding instanceof Function ? binding : () => binding;
39
46
  this.bindingBehaviours.push(
40
47
  new AttributeBindingBehavior(
41
48
  target,
42
- bindingFn,
49
+ oneWay(bindingFn),
43
50
  Observable.isVolatileBinding(bindingFn),
44
51
  ariaAttributeName(property)
45
52
  )
46
53
  );
47
54
  }
48
- source.$fastController.addBehaviors(this.bindingBehaviours);
49
- }
50
- releasePropertyBindings(source) {
51
- source.$fastController.removeBehaviors(this.bindingBehaviours);
52
- this.bindingBehaviours = [];
55
+ for (const behavior of this.bindingBehaviours) {
56
+ behavior.bind({
57
+ source,
58
+ context: source.$fastController.context
59
+ });
60
+ }
53
61
  }
62
+ // private releasePropertyBindings(source: DelegatesAriaElement) {
63
+ // for (const behavior of this.bindingBehaviours) {
64
+ // (behavior as any).unbind(); // TODO: fix type
65
+ // }
66
+ // this.bindingBehaviours = [];
67
+ // }
54
68
  startForwardingPropertiesToTarget(source, delegatedProperties, target) {
55
69
  for (const key of delegatedProperties) {
56
- this.forwardPropertyToTarget(target, key, source[key]);
70
+ if (!(key in this.boundProperties)) {
71
+ this.forwardPropertyToTarget(target, key, source[key]);
72
+ }
57
73
  }
58
- subscribeToAriaPropertyChanges(source, this.onSourceAriaPropertyChanged);
59
- }
60
- stopForwardingPropertiesToTarget(source) {
61
- unsubscribeFromAriaPropertyChanges(
74
+ subscribeToAriaPropertyChanges(
62
75
  source,
63
76
  this.onSourceAriaPropertyChanged
64
77
  );
65
78
  }
66
79
  forwardPropertyToTarget(target, property, value) {
67
- DOM.setAttribute(target, ariaAttributeName(property), value);
80
+ if (value === null || value === void 0 || value === false) {
81
+ target.removeAttribute(ariaAttributeName(property));
82
+ } else {
83
+ target.setAttribute(ariaAttributeName(property), String(value));
84
+ }
68
85
  }
69
86
  }
70
87
 
88
+ class DelegateAriaDirective extends StatelessAttachedAttributeDirective {
89
+ constructor(boundProperties, forwardedProperties) {
90
+ super("vvd-delegate-aria");
91
+ this.boundProperties = boundProperties;
92
+ this.forwardedProperties = forwardedProperties;
93
+ /**
94
+ * The structural id of the DOM node to which the created behavior will apply.
95
+ */
96
+ this.targetNodeId = "";
97
+ }
98
+ bind(controller) {
99
+ const targetElement = controller.targets[this.targetNodeId];
100
+ const behavior = new DelegateAriaBehavior(
101
+ targetElement,
102
+ // Pass the target element as target
103
+ {
104
+ boundProperties: this.boundProperties,
105
+ forwardedProperties: this.forwardedProperties
106
+ }
107
+ );
108
+ behavior.bind(controller);
109
+ }
110
+ }
111
+ HTMLDirective.define(DelegateAriaDirective);
71
112
  function delegateAria(boundProperties = {}, options = {}) {
72
113
  const forwardedProperties = new Set(
73
114
  (options.onlySpecified ? [] : ariaMixinProperties).filter(
74
115
  (p) => !(p in boundProperties)
75
116
  )
76
117
  );
77
- return new AttachedBehaviorHTMLDirective(
78
- "vvd-delegate-aria",
79
- DelegateAriaBehavior,
80
- {
81
- boundProperties,
82
- forwardedProperties
83
- }
84
- );
118
+ return new DelegateAriaDirective(boundProperties, forwardedProperties);
85
119
  }
86
120
  const DelegatesAria = (Base) => {
87
121
  class DelegatesAriaElement extends Base {
@@ -133,7 +133,7 @@ const FormAssociated = (Base) => {
133
133
  if (this.proxy instanceof HTMLElement) {
134
134
  this.proxy.disabled = this.disabled;
135
135
  }
136
- fastElement.DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled));
136
+ fastElement.Updates.enqueue(() => this.classList.toggle("disabled", this.disabled));
137
137
  }
138
138
  /**
139
139
  * @internal
@@ -150,7 +150,7 @@ const FormAssociated = (Base) => {
150
150
  if (this.proxy instanceof HTMLElement) {
151
151
  this.proxy.required = this.required;
152
152
  }
153
- fastElement.DOM.queueUpdate(() => this.classList.toggle("required", this.required));
153
+ fastElement.Updates.enqueue(() => this.classList.toggle("required", this.required));
154
154
  this.validate();
155
155
  }
156
156
  /**
@@ -1,4 +1,4 @@
1
- import { attr, emptyArray, DOM } from '@microsoft/fast-element';
1
+ import { attr, emptyArray, Updates } from '@microsoft/fast-element';
2
2
  import { keyEnter } from '@microsoft/fast-web-utilities';
3
3
 
4
4
  var __defProp = Object.defineProperty;
@@ -131,7 +131,7 @@ const FormAssociated = (Base) => {
131
131
  if (this.proxy instanceof HTMLElement) {
132
132
  this.proxy.disabled = this.disabled;
133
133
  }
134
- DOM.queueUpdate(() => this.classList.toggle("disabled", this.disabled));
134
+ Updates.enqueue(() => this.classList.toggle("disabled", this.disabled));
135
135
  }
136
136
  /**
137
137
  * @internal
@@ -148,7 +148,7 @@ const FormAssociated = (Base) => {
148
148
  if (this.proxy instanceof HTMLElement) {
149
149
  this.proxy.required = this.required;
150
150
  }
151
- DOM.queueUpdate(() => this.classList.toggle("required", this.required));
151
+ Updates.enqueue(() => this.classList.toggle("required", this.required));
152
152
  this.validate();
153
153
  }
154
154
  /**
@@ -6,51 +6,76 @@ const attributeBindingBehaviour = require('./attribute-binding-behaviour.cjs');
6
6
 
7
7
  class HostSemanticsBehavior {
8
8
  constructor(target, params) {
9
- this.target = target;
9
+ this.target = null;
10
+ // unbind(controller: ViewController) {
11
+ // const source = controller.source as HostSemanticsElement;
12
+ // this.releasePropertyBindings(source);
13
+ // }
10
14
  this.bindingBehaviours = [];
15
+ this.target = target;
11
16
  this.boundProperties = params.boundProperties;
12
17
  }
13
- bind(source) {
18
+ bind(controller) {
19
+ const source = controller.source;
14
20
  if (this.target !== source) {
15
21
  throw new Error("Target element must be the same as the source element");
16
22
  }
17
23
  this.bindPropertiesToTarget(source, this.boundProperties, this.target);
18
24
  }
19
- unbind(source) {
20
- this.releasePropertyBindings(source);
21
- }
22
25
  bindPropertiesToTarget(source, boundProperties, target) {
23
26
  for (const [property, binding] of Object.entries(boundProperties)) {
24
27
  const bindingFn = binding instanceof Function ? binding : (x) => x[property] ?? binding;
25
28
  this.bindingBehaviours.push(
26
29
  new attributeBindingBehaviour.AttributeBindingBehavior(
27
30
  target,
28
- bindingFn,
31
+ fastElement.oneWay(bindingFn),
29
32
  true,
30
33
  vividElement.ariaAttributeName(property)
31
34
  )
32
35
  );
33
36
  }
34
- source.$fastController.addBehaviors(this.bindingBehaviours);
35
- }
36
- releasePropertyBindings(source) {
37
- source.$fastController.removeBehaviors(this.bindingBehaviours);
38
- this.bindingBehaviours = [];
37
+ for (const behavior of this.bindingBehaviours) {
38
+ behavior.bind({
39
+ source,
40
+ context: source.$fastController.context
41
+ });
42
+ }
39
43
  }
44
+ // private releasePropertyBindings(source: HostSemanticsElement) {
45
+ // for (const behavior of this.bindingBehaviours) {
46
+ // (behavior as any).unbind();
47
+ // }
48
+ // this.bindingBehaviours = [];
49
+ // }
40
50
  }
41
51
 
52
+ class HostSemanticsDirective extends fastElement.StatelessAttachedAttributeDirective {
53
+ constructor(boundProperties) {
54
+ super("vvd-host-semantics");
55
+ this.boundProperties = boundProperties;
56
+ /**
57
+ * The structural id of the DOM node to which the created behavior will apply.
58
+ */
59
+ this.targetNodeId = "";
60
+ }
61
+ bind(controller) {
62
+ const targetElement = controller.targets[this.targetNodeId];
63
+ const behavior = new HostSemanticsBehavior(
64
+ targetElement,
65
+ // Pass the target element as target
66
+ {
67
+ boundProperties: this.boundProperties,
68
+ forwardedProperties: new Set(
69
+ vividElement.ariaMixinProperties.filter((p) => !(p in this.boundProperties))
70
+ )
71
+ }
72
+ );
73
+ behavior.bind(controller);
74
+ }
75
+ }
76
+ fastElement.HTMLDirective.define(HostSemanticsDirective);
42
77
  function applyHostSemantics(boundProperties = {}) {
43
- const forwardedProperties = new Set(
44
- vividElement.ariaMixinProperties.filter((p) => !(p in boundProperties))
45
- );
46
- return new fastElement.AttachedBehaviorHTMLDirective(
47
- "vvd-host-semantics",
48
- HostSemanticsBehavior,
49
- {
50
- boundProperties,
51
- forwardedProperties
52
- }
53
- );
78
+ return new HostSemanticsDirective(boundProperties);
54
79
  }
55
80
  const HostSemantics = (Base) => {
56
81
  class HostSemanticsElement extends Base {
@@ -1,54 +1,79 @@
1
- import { AttachedBehaviorHTMLDirective } from '@microsoft/fast-element';
1
+ import { oneWay, StatelessAttachedAttributeDirective, HTMLDirective } from '@microsoft/fast-element';
2
2
  import { a as ariaAttributeName, b as ariaMixinProperties } from './vivid-element.js';
3
3
  import { A as AttributeBindingBehavior } from './attribute-binding-behaviour.js';
4
4
 
5
5
  class HostSemanticsBehavior {
6
6
  constructor(target, params) {
7
- this.target = target;
7
+ this.target = null;
8
+ // unbind(controller: ViewController) {
9
+ // const source = controller.source as HostSemanticsElement;
10
+ // this.releasePropertyBindings(source);
11
+ // }
8
12
  this.bindingBehaviours = [];
13
+ this.target = target;
9
14
  this.boundProperties = params.boundProperties;
10
15
  }
11
- bind(source) {
16
+ bind(controller) {
17
+ const source = controller.source;
12
18
  if (this.target !== source) {
13
19
  throw new Error("Target element must be the same as the source element");
14
20
  }
15
21
  this.bindPropertiesToTarget(source, this.boundProperties, this.target);
16
22
  }
17
- unbind(source) {
18
- this.releasePropertyBindings(source);
19
- }
20
23
  bindPropertiesToTarget(source, boundProperties, target) {
21
24
  for (const [property, binding] of Object.entries(boundProperties)) {
22
25
  const bindingFn = binding instanceof Function ? binding : (x) => x[property] ?? binding;
23
26
  this.bindingBehaviours.push(
24
27
  new AttributeBindingBehavior(
25
28
  target,
26
- bindingFn,
29
+ oneWay(bindingFn),
27
30
  true,
28
31
  ariaAttributeName(property)
29
32
  )
30
33
  );
31
34
  }
32
- source.$fastController.addBehaviors(this.bindingBehaviours);
33
- }
34
- releasePropertyBindings(source) {
35
- source.$fastController.removeBehaviors(this.bindingBehaviours);
36
- this.bindingBehaviours = [];
35
+ for (const behavior of this.bindingBehaviours) {
36
+ behavior.bind({
37
+ source,
38
+ context: source.$fastController.context
39
+ });
40
+ }
37
41
  }
42
+ // private releasePropertyBindings(source: HostSemanticsElement) {
43
+ // for (const behavior of this.bindingBehaviours) {
44
+ // (behavior as any).unbind();
45
+ // }
46
+ // this.bindingBehaviours = [];
47
+ // }
38
48
  }
39
49
 
50
+ class HostSemanticsDirective extends StatelessAttachedAttributeDirective {
51
+ constructor(boundProperties) {
52
+ super("vvd-host-semantics");
53
+ this.boundProperties = boundProperties;
54
+ /**
55
+ * The structural id of the DOM node to which the created behavior will apply.
56
+ */
57
+ this.targetNodeId = "";
58
+ }
59
+ bind(controller) {
60
+ const targetElement = controller.targets[this.targetNodeId];
61
+ const behavior = new HostSemanticsBehavior(
62
+ targetElement,
63
+ // Pass the target element as target
64
+ {
65
+ boundProperties: this.boundProperties,
66
+ forwardedProperties: new Set(
67
+ ariaMixinProperties.filter((p) => !(p in this.boundProperties))
68
+ )
69
+ }
70
+ );
71
+ behavior.bind(controller);
72
+ }
73
+ }
74
+ HTMLDirective.define(HostSemanticsDirective);
40
75
  function applyHostSemantics(boundProperties = {}) {
41
- const forwardedProperties = new Set(
42
- ariaMixinProperties.filter((p) => !(p in boundProperties))
43
- );
44
- return new AttachedBehaviorHTMLDirective(
45
- "vvd-host-semantics",
46
- HostSemanticsBehavior,
47
- {
48
- boundProperties,
49
- forwardedProperties
50
- }
51
- );
76
+ return new HostSemanticsDirective(boundProperties);
52
77
  }
53
78
  const HostSemantics = (Base) => {
54
79
  class HostSemanticsElement extends Base {
@@ -64,35 +64,39 @@ const feedbackMessageDefinition = vividElement.defineVividComponent(
64
64
  );
65
65
 
66
66
  class RenderInLightDomBehaviour {
67
- constructor(templateBinding, isTemplateBindingVolatile) {
67
+ constructor(directive) {
68
68
  this.source = null;
69
- this.templateBindingObserver = fastElement.Observable.binding(
70
- templateBinding,
69
+ this.templateBindingObserver = directive.templateBinding.createObserver(
71
70
  this,
72
- isTemplateBindingVolatile
71
+ directive
73
72
  );
74
73
  }
75
- bind(source, context) {
76
- this.source = source;
77
- this.context = context;
74
+ bind(controller) {
75
+ this.source = controller.source;
76
+ this.context = controller.context;
77
+ this.controller = controller;
78
78
  if (!this.insertionPoint) {
79
79
  this.insertionPoint = document.createComment("");
80
- source.appendChild(this.insertionPoint);
80
+ this.source.appendChild(this.insertionPoint);
81
81
  }
82
- this.handleChange();
83
- }
84
- unbind() {
85
- this.source = null;
86
- this.view.unbind();
87
- this.templateBindingObserver.disconnect();
82
+ this.templateBindingObserver.bind(controller);
83
+ this.handleChange(this.source, this.templateBindingObserver);
88
84
  }
85
+ // unbind(): void {
86
+ // this.source = null;
87
+ // if (this.view) {
88
+ // this.view.unbind();
89
+ // }
90
+ // // The observer will be automatically cleaned up when the behavior is destroyed
91
+ // }
89
92
  /**
90
93
  * Handles change of the template itself.
91
94
  */
92
- handleChange() {
93
- this.instantiateTemplate(
94
- this.templateBindingObserver.observe(this.source, this.context)
95
- );
95
+ handleChange(source, args) {
96
+ if (args === this.templateBindingObserver) {
97
+ const template = this.templateBindingObserver.bind(this.controller);
98
+ this.instantiateTemplate(template);
99
+ }
96
100
  }
97
101
  instantiateTemplate(template) {
98
102
  if (this.view) {
@@ -103,22 +107,25 @@ class RenderInLightDomBehaviour {
103
107
  this.view.insertBefore(this.insertionPoint);
104
108
  }
105
109
  }
106
- class RenderInLightDomDirective extends fastElement.HTMLDirective {
110
+ class RenderInLightDomDirective {
107
111
  constructor(templateBinding) {
108
- super();
112
+ /**
113
+ * The structural id of the DOM node to which the created behavior will apply.
114
+ */
115
+ this.targetNodeId = "";
109
116
  this.templateBinding = templateBinding;
110
- this.createPlaceholder = fastElement.DOM.createBlockPlaceholder;
111
- this.isTemplateBindingVolatile = fastElement.Observable.isVolatileBinding(templateBinding);
117
+ this.dataBinding = templateBinding;
118
+ }
119
+ createHTML(add) {
120
+ return fastElement.Markup.comment(add(this));
112
121
  }
113
122
  createBehavior() {
114
- return new RenderInLightDomBehaviour(
115
- this.templateBinding,
116
- this.isTemplateBindingVolatile
117
- );
123
+ return new RenderInLightDomBehaviour(this);
118
124
  }
119
125
  }
126
+ fastElement.HTMLDirective.define(RenderInLightDomDirective);
120
127
  function renderInLightDOM(templateOrTemplateBinding) {
121
- const templateBinding = typeof templateOrTemplateBinding === "function" ? templateOrTemplateBinding : () => templateOrTemplateBinding;
128
+ const templateBinding = fastElement.normalizeBinding(templateOrTemplateBinding);
122
129
  return new RenderInLightDomDirective(templateBinding);
123
130
  }
124
131
 
@@ -1,4 +1,4 @@
1
- import { html, when, attr, HTMLDirective, DOM, Observable, observable, slotted } from '@microsoft/fast-element';
1
+ import { html, when, attr, normalizeBinding, Markup, HTMLDirective, observable, slotted } from '@microsoft/fast-element';
2
2
  import { v4 } from 'uuid';
3
3
  import { classNames } from '@microsoft/fast-web-utilities';
4
4
  import { iconDefinition, VwcIconElement as Icon } from '../icon/definition.js';
@@ -62,35 +62,39 @@ const feedbackMessageDefinition = defineVividComponent(
62
62
  );
63
63
 
64
64
  class RenderInLightDomBehaviour {
65
- constructor(templateBinding, isTemplateBindingVolatile) {
65
+ constructor(directive) {
66
66
  this.source = null;
67
- this.templateBindingObserver = Observable.binding(
68
- templateBinding,
67
+ this.templateBindingObserver = directive.templateBinding.createObserver(
69
68
  this,
70
- isTemplateBindingVolatile
69
+ directive
71
70
  );
72
71
  }
73
- bind(source, context) {
74
- this.source = source;
75
- this.context = context;
72
+ bind(controller) {
73
+ this.source = controller.source;
74
+ this.context = controller.context;
75
+ this.controller = controller;
76
76
  if (!this.insertionPoint) {
77
77
  this.insertionPoint = document.createComment("");
78
- source.appendChild(this.insertionPoint);
78
+ this.source.appendChild(this.insertionPoint);
79
79
  }
80
- this.handleChange();
81
- }
82
- unbind() {
83
- this.source = null;
84
- this.view.unbind();
85
- this.templateBindingObserver.disconnect();
80
+ this.templateBindingObserver.bind(controller);
81
+ this.handleChange(this.source, this.templateBindingObserver);
86
82
  }
83
+ // unbind(): void {
84
+ // this.source = null;
85
+ // if (this.view) {
86
+ // this.view.unbind();
87
+ // }
88
+ // // The observer will be automatically cleaned up when the behavior is destroyed
89
+ // }
87
90
  /**
88
91
  * Handles change of the template itself.
89
92
  */
90
- handleChange() {
91
- this.instantiateTemplate(
92
- this.templateBindingObserver.observe(this.source, this.context)
93
- );
93
+ handleChange(source, args) {
94
+ if (args === this.templateBindingObserver) {
95
+ const template = this.templateBindingObserver.bind(this.controller);
96
+ this.instantiateTemplate(template);
97
+ }
94
98
  }
95
99
  instantiateTemplate(template) {
96
100
  if (this.view) {
@@ -101,22 +105,25 @@ class RenderInLightDomBehaviour {
101
105
  this.view.insertBefore(this.insertionPoint);
102
106
  }
103
107
  }
104
- class RenderInLightDomDirective extends HTMLDirective {
108
+ class RenderInLightDomDirective {
105
109
  constructor(templateBinding) {
106
- super();
110
+ /**
111
+ * The structural id of the DOM node to which the created behavior will apply.
112
+ */
113
+ this.targetNodeId = "";
107
114
  this.templateBinding = templateBinding;
108
- this.createPlaceholder = DOM.createBlockPlaceholder;
109
- this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding);
115
+ this.dataBinding = templateBinding;
116
+ }
117
+ createHTML(add) {
118
+ return Markup.comment(add(this));
110
119
  }
111
120
  createBehavior() {
112
- return new RenderInLightDomBehaviour(
113
- this.templateBinding,
114
- this.isTemplateBindingVolatile
115
- );
121
+ return new RenderInLightDomBehaviour(this);
116
122
  }
117
123
  }
124
+ HTMLDirective.define(RenderInLightDomDirective);
118
125
  function renderInLightDOM(templateOrTemplateBinding) {
119
- const templateBinding = typeof templateOrTemplateBinding === "function" ? templateOrTemplateBinding : () => templateOrTemplateBinding;
126
+ const templateBinding = normalizeBinding(templateOrTemplateBinding);
120
127
  return new RenderInLightDomDirective(templateBinding);
121
128
  }
122
129
 
@@ -5,6 +5,7 @@ const index = require('./index.cjs');
5
5
  const mixins = require('./mixins.cjs');
6
6
  const formAssociated = require('./form-associated.cjs');
7
7
  const vividElement = require('./vivid-element.cjs');
8
+ const withContextualHelp = require('./with-contextual-help.cjs');
8
9
  const withErrorText = require('./with-error-text.cjs');
9
10
  const formElement = require('./form-element.cjs');
10
11
  const localized = require('./localized.cjs');
@@ -57,9 +58,11 @@ var __decorateClass = (decorators, target, key, kind) => {
57
58
  if (result) __defProp(target, key, result);
58
59
  return result;
59
60
  };
60
- class PickerField extends mixins.WithFeedback(
61
- withErrorText.WithErrorText(
62
- formElement.FormElement(TrappedFocus(localized.Localized(formAssociated.FormAssociated(vividElement.VividElement))))
61
+ class PickerField extends withContextualHelp.WithContextualHelp(
62
+ mixins.WithFeedback(
63
+ withErrorText.WithErrorText(
64
+ formElement.FormElement(TrappedFocus(localized.Localized(formAssociated.FormAssociated(vividElement.VividElement))))
65
+ )
63
66
  )
64
67
  ) {
65
68
  // --- Core ---
@@ -143,10 +146,10 @@ class PickerField extends mixins.WithFeedback(
143
146
  () => this.locale,
144
147
  this.#localeChangeHandler
145
148
  );
146
- this.#localeChangeObserver.observe(this, fastElement.defaultExecutionContext);
149
+ this.#localeChangeObserver.observe(this, fastElement.ExecutionContext.default);
147
150
  }
148
151
  #stopObservingLocaleChanges() {
149
- this.#localeChangeObserver.disconnect();
152
+ this.#localeChangeObserver.dispose();
150
153
  }
151
154
  #dismissOnClickOutside;
152
155
  #openPopupIfPossible() {
@@ -250,6 +253,11 @@ const PickerFieldTemplate = (context, popupContentTemplate, { withSeparator, pad
250
253
  name='helper-text'
251
254
  ${fastElement.slotted("_helperTextSlottedContent")}
252
255
  ></slot>
256
+ <slot
257
+ slot='${(x) => x._contextualHelpSlottedContent?.length ? "contextual-help" : void 0}'
258
+ name='contextual-help'
259
+ ${fastElement.slotted("_contextualHelpSlottedContent")}
260
+ ></slot>
253
261
  <${buttonTag}
254
262
  id='picker-button'
255
263
  ${fastElement.ref("_pickerButtonEl")}