@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
package/bundled/mixins.js CHANGED
@@ -1,102 +1,108 @@
1
- import { d as k, h as d, V as _, a as y, H as $, D as F, O as f, o as x } from "./vivid-element.js";
2
- import { i as I, I as D } from "./definition2.js";
3
- import { v as w } from "./definition12.js";
4
- import { c as C } from "./class-names.js";
5
- import { w as u } from "./when.js";
6
- import { L as S } from "./localized.js";
7
- import { s as T } from "./slotted.js";
8
- const H = ":host{display:contents}.message{display:flex;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message.none-message{display:none}.message.helper-message{color:var(--_low-ink-color)}.message.error-message,.message.success-message{color:var(--vvd-color-canvas-text)}slot{display:inline}.icon{font-size:16px}.error-message .icon{color:var(--vvd-color-alert-500)}.success-message .icon{color:var(--vvd-color-success-500)}.announcement{display:contents}";
9
- var B = Object.defineProperty, U = (e, t, s, o) => {
10
- for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
11
- (a = e[r]) && (n = a(t, s, n) || n);
12
- return n && B(t, s, n), n;
1
+ import { n as k } from "./normalize.js";
2
+ import { d as _, h as d, V as $, a as y, M as F, H as I, o as f } from "./vivid-element.js";
3
+ import { i as w, I as D } from "./definition2.js";
4
+ import { v as C } from "./definition13.js";
5
+ import { w as m } from "./when.js";
6
+ import { c as B } from "./class-names.js";
7
+ import { L as H } from "./localized.js";
8
+ import { s as x } from "./slotted.js";
9
+ const S = ":host{display:contents}.message{display:flex;contain:inline-size;font:var(--vvd-typography-base-condensed);gap:4px;grid-column:1/-1}.message.none-message{display:none}.message.helper-message{color:var(--_low-ink-color)}.message.error-message,.message.success-message{color:var(--vvd-color-canvas-text)}slot{display:inline}.icon{font-size:16px}.error-message .icon{color:var(--vvd-color-alert-500)}.success-message .icon{color:var(--vvd-color-success-500)}.announcement{display:contents}";
10
+ var M = Object.defineProperty, O = (t, e, o, s) => {
11
+ for (var n = void 0, r = t.length - 1, a; r >= 0; r--)
12
+ (a = t[r]) && (n = a(e, o, n) || n);
13
+ return n && M(e, o, n), n;
13
14
  };
14
- class l extends S(_) {
15
+ class l extends H($) {
15
16
  constructor() {
16
17
  super(...arguments), this.type = "none";
17
18
  }
18
19
  }
19
- U([
20
+ O([
20
21
  y
21
22
  ], l.prototype, "type");
22
- function m(e, t, s) {
23
- const o = e.tagFor(D);
24
- return d`<${o} class="icon" name="${t}" label="${(n) => n.locale.feedbackMessage[s]}"></${o}>`;
23
+ function u(t, e, o) {
24
+ const s = t.tagFor(D);
25
+ return d`<${s} class="icon" name="${e}" label="${(n) => n.locale.feedbackMessage[o]}"></${s}>`;
25
26
  }
26
- function V(e) {
27
- const t = {
27
+ function U(t) {
28
+ const e = {
28
29
  none: "",
29
30
  helper: "",
30
- error: m(e, "info-line", "errorIconText"),
31
- success: m(e, "check-circle-line", "successIconText")
31
+ error: u(t, "info-line", "errorIconText"),
32
+ success: u(t, "check-circle-line", "successIconText")
32
33
  };
33
- return d`${(s) => t[s.type]}`;
34
+ return d`${(o) => e[o.type]}`;
34
35
  }
35
- const g = (e) => e === "error", M = (e) => {
36
- const t = d`<div
37
- class="${(s) => C("message", `${s.type}-message`)}"
36
+ const g = (t) => t === "error", L = (t) => {
37
+ const e = d`<div
38
+ class="${(o) => B("message", `${o.type}-message`)}"
38
39
  >
39
- ${V(e)}<slot></slot>
40
+ ${U(t)}<slot></slot>
40
41
  </div>`;
41
- return d`${u((s) => !g(s.type), t)}
42
+ return d`${m((o) => !g(o.type), e)}
42
43
  <span class="announcement" role="status" aria-live="polite">
43
- ${u((s) => g(s.type), t)}
44
+ ${m((o) => g(o.type), e)}
44
45
  </span>`;
45
- }, Z = k(
46
+ }, ee = _(
46
47
  "feedback-message",
47
48
  l,
48
- M,
49
- [I, w],
49
+ L,
50
+ [w, C],
50
51
  {
51
- styles: H
52
+ styles: S
52
53
  }
53
54
  );
54
55
  class P {
55
- constructor(t, s) {
56
- this.source = null, this.templateBindingObserver = f.binding(
57
- t,
56
+ constructor(e) {
57
+ this.source = null, this.templateBindingObserver = e.templateBinding.createObserver(
58
58
  this,
59
- s
59
+ e
60
60
  );
61
61
  }
62
- bind(t, s) {
63
- this.source = t, this.context = s, this.insertionPoint || (this.insertionPoint = document.createComment(""), t.appendChild(this.insertionPoint)), this.handleChange();
64
- }
65
- unbind() {
66
- this.source = null, this.view.unbind(), this.templateBindingObserver.disconnect();
62
+ bind(e) {
63
+ this.source = e.source, this.context = e.context, this.controller = e, this.insertionPoint || (this.insertionPoint = document.createComment(""), this.source.appendChild(this.insertionPoint)), this.templateBindingObserver.bind(e), this.handleChange(this.source, this.templateBindingObserver);
67
64
  }
65
+ // unbind(): void {
66
+ // this.source = null;
67
+ // if (this.view) {
68
+ // this.view.unbind();
69
+ // }
70
+ // // The observer will be automatically cleaned up when the behavior is destroyed
71
+ // }
68
72
  /**
69
73
  * Handles change of the template itself.
70
74
  */
71
- handleChange() {
72
- this.instantiateTemplate(
73
- this.templateBindingObserver.observe(this.source, this.context)
74
- );
75
+ handleChange(e, o) {
76
+ if (o === this.templateBindingObserver) {
77
+ const s = this.templateBindingObserver.bind(this.controller);
78
+ this.instantiateTemplate(s);
79
+ }
75
80
  }
76
- instantiateTemplate(t) {
77
- this.view && this.view.dispose(), this.view = t.create(), this.view.bind(this.source, this.context), this.view.insertBefore(this.insertionPoint);
81
+ instantiateTemplate(e) {
82
+ this.view && this.view.dispose(), this.view = e.create(), this.view.bind(this.source, this.context), this.view.insertBefore(this.insertionPoint);
78
83
  }
79
84
  }
80
- class L extends $ {
81
- constructor(t) {
82
- super(), this.templateBinding = t, this.createPlaceholder = F.createBlockPlaceholder, this.isTemplateBindingVolatile = f.isVolatileBinding(t);
85
+ class T {
86
+ constructor(e) {
87
+ this.targetNodeId = "", this.templateBinding = e, this.dataBinding = e;
88
+ }
89
+ createHTML(e) {
90
+ return F.comment(e(this));
83
91
  }
84
92
  createBehavior() {
85
- return new P(
86
- this.templateBinding,
87
- this.isTemplateBindingVolatile
88
- );
93
+ return new P(this);
89
94
  }
90
95
  }
91
- function O(e) {
92
- const t = typeof e == "function" ? e : () => e;
93
- return new L(t);
96
+ I.define(T);
97
+ function R(t) {
98
+ const e = k(t);
99
+ return new T(e);
94
100
  }
95
101
  const i = [];
96
- for (let e = 0; e < 256; ++e)
97
- i.push((e + 256).toString(16).slice(1));
98
- function R(e, t = 0) {
99
- return (i[e[t + 0]] + i[e[t + 1]] + i[e[t + 2]] + i[e[t + 3]] + "-" + i[e[t + 4]] + i[e[t + 5]] + "-" + i[e[t + 6]] + i[e[t + 7]] + "-" + i[e[t + 8]] + i[e[t + 9]] + "-" + i[e[t + 10]] + i[e[t + 11]] + i[e[t + 12]] + i[e[t + 13]] + i[e[t + 14]] + i[e[t + 15]]).toLowerCase();
102
+ for (let t = 0; t < 256; ++t)
103
+ i.push((t + 256).toString(16).slice(1));
104
+ function V(t, e = 0) {
105
+ return (i[t[e + 0]] + i[t[e + 1]] + i[t[e + 2]] + i[t[e + 3]] + "-" + i[t[e + 4]] + i[t[e + 5]] + "-" + i[t[e + 6]] + i[t[e + 7]] + "-" + i[t[e + 8]] + i[t[e + 9]] + "-" + i[t[e + 10]] + i[t[e + 11]] + i[t[e + 12]] + i[t[e + 13]] + i[t[e + 14]] + i[t[e + 15]]).toLowerCase();
100
106
  }
101
107
  let p;
102
108
  const E = new Uint8Array(16);
@@ -109,23 +115,23 @@ function W() {
109
115
  return p(E);
110
116
  }
111
117
  const j = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), b = { randomUUID: j };
112
- function z(e, t, s) {
113
- if (b.randomUUID && !e)
118
+ function z(t, e, o) {
119
+ if (b.randomUUID && !t)
114
120
  return b.randomUUID();
115
- e = e || {};
116
- const o = e.random ?? e.rng?.() ?? W();
117
- if (o.length < 16)
121
+ t = t || {};
122
+ const s = t.random ?? t.rng?.() ?? W();
123
+ if (s.length < 16)
118
124
  throw new Error("Random bytes length must be >= 16");
119
- return o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, R(o);
125
+ return s[6] = s[6] & 15 | 64, s[8] = s[8] & 63 | 128, V(s);
120
126
  }
121
127
  const v = () => z();
122
- var A = Object.defineProperty, h = (e, t, s, o) => {
123
- for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
124
- (a = e[r]) && (n = a(t, s, n) || n);
125
- return n && A(t, s, n), n;
128
+ var A = Object.defineProperty, h = (t, e, o, s) => {
129
+ for (var n = void 0, r = t.length - 1, a; r >= 0; r--)
130
+ (a = t[r]) && (n = a(e, o, n) || n);
131
+ return n && A(e, o, n), n;
126
132
  };
127
- const N = (e) => {
128
- class t extends e {
133
+ const N = (t) => {
134
+ class e extends t {
129
135
  /**
130
136
  * Ids of the feedback content that the control should use for aria-describedby.
131
137
  *
@@ -138,8 +144,8 @@ const N = (e) => {
138
144
  * @internal
139
145
  */
140
146
  _internalFeedback() {
141
- const o = this._helperTextSlottedContent?.length ? "" : this.helperText, n = this.errorValidationMessage, r = this.successText;
142
- return r ? { type: "success", message: r } : n ? { type: "error", message: n } : o ? { type: "helper", message: o } : { type: "none", message: "" };
147
+ const s = this._helperTextSlottedContent?.length ? "" : this.helperText, n = this.errorValidationMessage, r = this.successText;
148
+ return r ? { type: "success", message: r } : n ? { type: "error", message: n } : s ? { type: "helper", message: s } : { type: "none", message: "" };
143
149
  }
144
150
  /**
145
151
  * @internal
@@ -150,8 +156,8 @@ const N = (e) => {
150
156
  /**
151
157
  * @internal
152
158
  */
153
- _getFeedbackTemplate(o) {
154
- const n = o.tagFor(l);
159
+ _getFeedbackTemplate(s) {
160
+ const n = s.tagFor(l);
155
161
  return d`
156
162
  <${n} id="feedback" :type="${(r) => r._internalFeedback().type}">
157
163
  ${(r) => r._internalFeedback().message}
@@ -160,28 +166,28 @@ const N = (e) => {
160
166
  id="slotted-helper-text-feedback"
161
167
  :type="${(r) => r._slottedHelperTextFeedbackType()}"
162
168
  >
163
- <slot name="helper-text" ${T("_helperTextSlottedContent")}></slot>
169
+ <slot name="helper-text" ${x("_helperTextSlottedContent")}></slot>
164
170
  </${n}>
165
171
  `;
166
172
  }
167
173
  }
168
174
  return h([
169
175
  y({ attribute: "helper-text" })
170
- ], t.prototype, "helperText"), h([
171
- x
172
- ], t.prototype, "_helperTextSlottedContent"), t;
173
- }, ee = (e) => {
174
- const t = () => `vvd-feedback-${v()}`, s = () => `vvd-slotted-feedback-${v()}`;
175
- class o extends N(e) {
176
+ ], e.prototype, "helperText"), h([
177
+ f
178
+ ], e.prototype, "_helperTextSlottedContent"), e;
179
+ }, te = (t) => {
180
+ const e = () => `vvd-feedback-${v()}`, o = () => `vvd-slotted-feedback-${v()}`;
181
+ class s extends N(t) {
176
182
  constructor() {
177
- super(...arguments), this._slottedHelperTextIds = [], this._feedbackId = t();
183
+ super(...arguments), this._slottedHelperTextIds = [], this._feedbackId = e();
178
184
  }
179
185
  /**
180
186
  * @internal
181
187
  */
182
188
  _helperTextSlottedContentChanged(r, a) {
183
189
  for (const c of a)
184
- c.id || (c.id = s());
190
+ c.id || (c.id = o());
185
191
  this._slottedHelperTextIds = a.map((c) => c.id);
186
192
  }
187
193
  /**
@@ -197,7 +203,7 @@ const N = (e) => {
197
203
  const a = r.tagFor(l);
198
204
  return d`
199
205
  <slot name="_feedback"></slot>
200
- ${O(d`<${a}
206
+ ${R(d`<${a}
201
207
  slot="_feedback"
202
208
  id="${(c) => c._feedbackId}"
203
209
  :type="${(c) => c._internalFeedback().type}"
@@ -207,20 +213,20 @@ const N = (e) => {
207
213
  <${a} :type="${(c) => c._slottedHelperTextFeedbackType()}">
208
214
  <slot
209
215
  name="helper-text"
210
- ${T("_helperTextSlottedContent")}
216
+ ${x("_helperTextSlottedContent")}
211
217
  ></slot>
212
218
  </${a}>
213
219
  `;
214
220
  }
215
221
  }
216
222
  return h([
217
- x
218
- ], o.prototype, "_slottedHelperTextIds"), o;
223
+ f
224
+ ], s.prototype, "_slottedHelperTextIds"), s;
219
225
  };
220
226
  export {
221
227
  N as W,
222
- ee as a,
223
- Z as f,
228
+ te as a,
229
+ ee as f,
224
230
  v as g,
225
- O as r
231
+ R as r
226
232
  };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("./vivid-element.cjs");function e(n){return i.isFunction(n)?i.oneWay(n):n instanceof i.Binding?n:i.oneTime(()=>n)}exports.normalizeBinding=e;
@@ -0,0 +1,7 @@
1
+ import { g as i, u as o, f as s, B as r } from "./vivid-element.js";
2
+ function a(n) {
3
+ return s(n) ? i(n) : n instanceof r ? n : o(() => n);
4
+ }
5
+ export {
6
+ a as n
7
+ };
@@ -1,6 +1,6 @@
1
- "use strict";const b=require("./index.cjs"),_=require("./mixins.cjs"),v=require("./form-associated.cjs"),r=require("./vivid-element.cjs"),g=require("./with-error-text.cjs"),$=require("./form-element.cjs"),m=require("./localized.cjs"),k=require("./definition9.cjs"),x=require("./definition13.cjs"),F=require("./definition3.cjs"),p=require("./ref.cjs"),E=require("./slotted.cjs"),h=require("./class-names.cjs"),f=new WeakSet,y=o=>{f.add(o)},C=o=>{class t extends o{_trappedFocus(a,i){if(!f.has(a)&&a.key==="Tab"){const l=i(),s=l[0],e=l[l.length-1];if(a.shiftKey){if(this.shadowRoot.activeElement===s)return e.focus(),!0}else if(this.shadowRoot.activeElement===e)return s.focus(),!0}return!1}}return t},O=":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";var T=Object.defineProperty,u=(o,t,n,a)=>{for(var i=void 0,l=o.length-1,s;l>=0;l--)(s=o[l])&&(i=s(t,n,i)||i);return i&&T(t,n,i),i};class c extends _.WithFeedback(g.WithErrorText($.FormElement(C(m.Localized(v.FormAssociated(r.VividElement)))))){constructor(){super(),this.readOnly=!1,this.#e=()=>{this.$emit("focus",void 0,{bubbles:!1})},this.#t=()=>{this.$emit("blur",void 0,{bubbles:!1})},this.proxy=document.createElement("input"),this.#o={handleChange:()=>{this._updatePresentationValue()}},this._popupOpen=!1,this.#s=t=>{if(!this._popupOpen)return;const n=t.composedPath();[this._dialogEl,this._pickerButtonEl].some(i=>n.includes(i))||this._closePopup(!1)},this._presentationValue="",this.value=""}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#s),this.addEventListener("focusin",this.#e),this.addEventListener("focusout",this.#t),this.#l()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.#s),this.removeEventListener("focusin",this.#e),this.removeEventListener("focusout",this.#t),this.#n()}#e;#t;validate(){this.proxy&&this.proxy.setCustomValidity(this._getCustomValidationError()??""),super.validate(this._textFieldEl?.querySelector("input")??void 0)}#o;#i;#l(){this.#i=r.Observable.binding(()=>this.locale,this.#o),this.#i.observe(this,r.defaultExecutionContext)}#n(){this.#i.disconnect()}#s;#a(){this.readOnly||(this._popupOpen=!0)}_closePopup(t=!0){this._popupOpen=!1,t&&this._textFieldEl.focus()}_onBaseKeyDown(t){return this._popupOpen&&b.handleEscapeKeyAndStopPropogation(t)?(this._closePopup(),!1):!this._trappedFocus(t,()=>this._focusableElsWithinDialog())}_presentationValueChanged(){this.dirtyValue=!0,this.validate()}_onTextFieldInput(t){const n=t.currentTarget;this._presentationValue=n.value}_onPickerButtonClick(){this._popupOpen?this._closePopup():this.#a()}_onOkClick(){this._closePopup()}_onClearClick(){this.$emit("clear-click")}}u([r.attr({attribute:"readonly",mode:"boolean"})],c.prototype,"readOnly");u([r.observable],c.prototype,"_popupOpen");u([r.observable],c.prototype,"_presentationValue");const P=(o,t,{withSeparator:n,padded:a})=>{const i=o.tagFor(k.Popup),l=o.tagFor(x.TextField),s=o.tagFor(F.Button);return r.html`
1
+ "use strict";const _=require("./index.cjs"),v=require("./mixins.cjs"),g=require("./form-associated.cjs"),r=require("./vivid-element.cjs"),$=require("./with-contextual-help.cjs"),x=require("./with-error-text.cjs"),m=require("./form-element.cjs"),k=require("./localized.cjs"),F=require("./definition9.cjs"),E=require("./definition10.cjs"),y=require("./definition3.cjs"),p=require("./ref.cjs"),h=require("./slotted.cjs"),f=require("./class-names.cjs"),b=new WeakSet,C=l=>{b.add(l)},O=l=>{class t extends l{_trappedFocus(a,i){if(!b.has(a)&&a.key==="Tab"){const s=i(),o=s[0],e=s[s.length-1];if(a.shiftKey){if(this.shadowRoot.activeElement===o)return e.focus(),!0}else if(this.shadowRoot.activeElement===e)return o.focus(),!0}return!1}}return t},T=":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";var P=Object.defineProperty,u=(l,t,n,a)=>{for(var i=void 0,s=l.length-1,o;s>=0;s--)(o=l[s])&&(i=o(t,n,i)||i);return i&&P(t,n,i),i};class c extends $.WithContextualHelp(v.WithFeedback(x.WithErrorText(m.FormElement(O(k.Localized(g.FormAssociated(r.VividElement))))))){constructor(){super(),this.readOnly=!1,this.#e=()=>{this.$emit("focus",void 0,{bubbles:!1})},this.#t=()=>{this.$emit("blur",void 0,{bubbles:!1})},this.proxy=document.createElement("input"),this.#l={handleChange:()=>{this._updatePresentationValue()}},this._popupOpen=!1,this.#o=t=>{if(!this._popupOpen)return;const n=t.composedPath();[this._dialogEl,this._pickerButtonEl].some(i=>n.includes(i))||this._closePopup(!1)},this._presentationValue="",this.value=""}readOnlyChanged(){this.proxy instanceof HTMLInputElement&&(this.proxy.readOnly=this.readOnly,this.validate())}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.#o),this.addEventListener("focusin",this.#e),this.addEventListener("focusout",this.#t),this.#s()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.#o),this.removeEventListener("focusin",this.#e),this.removeEventListener("focusout",this.#t),this.#n()}#e;#t;validate(){this.proxy&&this.proxy.setCustomValidity(this._getCustomValidationError()??""),super.validate(this._textFieldEl?.querySelector("input")??void 0)}#l;#i;#s(){this.#i=r.Observable.binding(()=>this.locale,this.#l),this.#i.observe(this,r.ExecutionContext.default)}#n(){this.#i.dispose()}#o;#a(){this.readOnly||(this._popupOpen=!0)}_closePopup(t=!0){this._popupOpen=!1,t&&this._textFieldEl.focus()}_onBaseKeyDown(t){return this._popupOpen&&_.handleEscapeKeyAndStopPropogation(t)?(this._closePopup(),!1):!this._trappedFocus(t,()=>this._focusableElsWithinDialog())}_presentationValueChanged(){this.dirtyValue=!0,this.validate()}_onTextFieldInput(t){const n=t.currentTarget;this._presentationValue=n.value}_onPickerButtonClick(){this._popupOpen?this._closePopup():this.#a()}_onOkClick(){this._closePopup()}_onClearClick(){this.$emit("clear-click")}}u([r.attr({attribute:"readonly",mode:"boolean"})],c.prototype,"readOnly");u([r.observable],c.prototype,"_popupOpen");u([r.observable],c.prototype,"_presentationValue");const q=(l,t,{withSeparator:n,padded:a})=>{const i=l.tagFor(F.Popup),s=l.tagFor(E.TextField),o=l.tagFor(y.Button);return r.html`
2
2
  <div class='base' @keydown='${(e,{event:d})=>e._onBaseKeyDown(d)}'>
3
- <${l} id='text-field'
3
+ <${s} id='text-field'
4
4
  ${p.ref("_textFieldEl")}
5
5
  class='control'
6
6
  label='${e=>e.label}'
@@ -17,9 +17,14 @@
17
17
  <slot
18
18
  slot='${e=>e._helperTextSlottedContent?.length?"helper-text":void 0}'
19
19
  name='helper-text'
20
- ${E.slotted("_helperTextSlottedContent")}
20
+ ${h.slotted("_helperTextSlottedContent")}
21
21
  ></slot>
22
- <${s}
22
+ <slot
23
+ slot='${e=>e._contextualHelpSlottedContent?.length?"contextual-help":void 0}'
24
+ name='contextual-help'
25
+ ${h.slotted("_contextualHelpSlottedContent")}
26
+ ></slot>
27
+ <${o}
23
28
  id='picker-button'
24
29
  ${p.ref("_pickerButtonEl")}
25
30
  slot='action-items'
@@ -29,34 +34,34 @@
29
34
  ?disabled='${e=>e.disabled||e.readOnly}'
30
35
  aria-label='${e=>e._pickerButtonLabel}'
31
36
  @click='${e=>e._onPickerButtonClick()}'
32
- ></${s}>
33
- </${l}>
37
+ ></${o}>
38
+ </${s}>
34
39
  <${i}
35
40
  ?open='${e=>e._popupOpen}'
36
41
  :anchor='${e=>e._textFieldEl}'
37
42
  offset='${e=>e._helperTextSlottedContent?.length||e.helperText||e.errorValidationMessage?8:null}'
38
43
  placement='bottom-start'
39
44
  class='popup'>
40
- <div class="${()=>h.classNames("dialog",["dialog--padded",a])}" role='dialog' ${p.ref("_dialogEl")} aria-modal='true' aria-label='${e=>e._dialogLabel}'>
45
+ <div class="${()=>f.classNames("dialog",["dialog--padded",a])}" role='dialog' ${p.ref("_dialogEl")} aria-modal='true' aria-label='${e=>e._dialogLabel}'>
41
46
  ${()=>t}
42
- <div class="${()=>h.classNames("footer",["footer--with-separator",n])}">
43
- <${s}
47
+ <div class="${()=>f.classNames("footer",["footer--with-separator",n])}">
48
+ <${o}
44
49
  id='clear-button'
45
50
  tabindex='3'
46
51
  class='vwc-button'
47
52
  size='condensed'
48
53
  label='${e=>e.locale.pickerField.clearLabel}'
49
54
  @click='${e=>e._onClearClick()}'
50
- ></${s}>
51
- <${s}
55
+ ></${o}>
56
+ <${o}
52
57
  tabindex='3'
53
58
  class='vwc-button'
54
59
  size='condensed'
55
60
  appearance='filled'
56
61
  label='${e=>e.locale.pickerField.okLabel}'
57
62
  @click='${e=>e._onOkClick()}'
58
- ></${s}>
63
+ ></${o}>
59
64
  </div>
60
65
  </div>
61
66
  </${i}>
62
- </div>`};exports.PickerField=c;exports.PickerFieldTemplate=P;exports.ignoreEventInFocusTraps=y;exports.pickerFieldStyles=O;
67
+ </div>`};exports.PickerField=c;exports.PickerFieldTemplate=q;exports.ignoreEventInFocusTraps=C;exports.pickerFieldStyles=T;
@@ -1,26 +1,27 @@
1
- import { h as m } from "./index.js";
2
- import { W as b } from "./mixins.js";
3
- import { F as _ } from "./form-associated.js";
4
- import { V as g, O as v, b as $, a as k, o as h, h as x } from "./vivid-element.js";
5
- import { W as F } from "./with-error-text.js";
6
- import { F as y } from "./form-element.js";
7
- import { L as E } from "./localized.js";
8
- import { P as C } from "./definition9.js";
9
- import { T as O } from "./definition13.js";
10
- import { B as T } from "./definition3.js";
1
+ import { h as b } from "./index.js";
2
+ import { W as _ } from "./mixins.js";
3
+ import { F as g } from "./form-associated.js";
4
+ import { V as v, O as $, E as x, a as k, o as f, h as F } from "./vivid-element.js";
5
+ import { W as y } from "./with-contextual-help.js";
6
+ import { W as C } from "./with-error-text.js";
7
+ import { F as E } from "./form-element.js";
8
+ import { L as O } from "./localized.js";
9
+ import { P as T } from "./definition9.js";
10
+ import { T as P } from "./definition10.js";
11
+ import { B as L } from "./definition3.js";
11
12
  import { r as p } from "./ref.js";
12
- import { s as P } from "./slotted.js";
13
- import { c as u } from "./class-names.js";
14
- const f = /* @__PURE__ */ new WeakSet(), q = (s) => {
15
- f.add(s);
16
- }, L = (s) => {
13
+ import { s as u } from "./slotted.js";
14
+ import { c as h } from "./class-names.js";
15
+ const m = /* @__PURE__ */ new WeakSet(), G = (s) => {
16
+ m.add(s);
17
+ }, V = (s) => {
17
18
  class t extends s {
18
19
  /**
19
20
  * @returns Whether focus was trapped.
20
21
  * @internal
21
22
  */
22
23
  _trappedFocus(n, o) {
23
- if (!f.has(n) && n.key === "Tab") {
24
+ if (!m.has(n) && n.key === "Tab") {
24
25
  const l = o(), i = l[0], e = l[l.length - 1];
25
26
  if (n.shiftKey) {
26
27
  if (this.shadowRoot.activeElement === i)
@@ -32,15 +33,17 @@ const f = /* @__PURE__ */ new WeakSet(), q = (s) => {
32
33
  }
33
34
  }
34
35
  return t;
35
- }, N = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";
36
- var V = Object.defineProperty, d = (s, t, a, n) => {
36
+ }, J = ":host{display:inline-block}.base{display:inline-block;inline-size:100%}.control{inline-size:100%}.dialog{display:inline-flex;flex-direction:column}.dialog--padded{padding:12px;gap:12px}.dialog .footer{display:flex;align-items:center;justify-content:flex-end;padding:8px;gap:8px}.dialog .footer--with-separator{border-top:1px solid var(--vvd-color-neutral-200)}";
37
+ var w = Object.defineProperty, d = (s, t, a, n) => {
37
38
  for (var o = void 0, l = s.length - 1, i; l >= 0; l--)
38
39
  (i = s[l]) && (o = i(t, a, o) || o);
39
- return o && V(t, a, o), o;
40
+ return o && w(t, a, o), o;
40
41
  };
41
- class c extends b(
42
- F(
43
- y(L(E(_(g))))
42
+ class c extends y(
43
+ _(
44
+ C(
45
+ E(V(O(g(v))))
46
+ )
44
47
  )
45
48
  ) {
46
49
  // --- Core ---
@@ -89,13 +92,13 @@ class c extends b(
89
92
  #s;
90
93
  #o;
91
94
  #l() {
92
- this.#o = v.binding(
95
+ this.#o = $.binding(
93
96
  () => this.locale,
94
97
  this.#s
95
- ), this.#o.observe(this, $);
98
+ ), this.#o.observe(this, x.default);
96
99
  }
97
100
  #a() {
98
- this.#o.disconnect();
101
+ this.#o.dispose();
99
102
  }
100
103
  #i;
101
104
  #n() {
@@ -112,7 +115,7 @@ class c extends b(
112
115
  * @internal
113
116
  */
114
117
  _onBaseKeyDown(t) {
115
- return this._popupOpen && m(t) ? (this._closePopup(), !1) : !this._trappedFocus(t, () => this._focusableElsWithinDialog());
118
+ return this._popupOpen && b(t) ? (this._closePopup(), !1) : !this._trappedFocus(t, () => this._focusableElsWithinDialog());
116
119
  }
117
120
  /**
118
121
  * @internal
@@ -151,14 +154,14 @@ d([
151
154
  k({ attribute: "readonly", mode: "boolean" })
152
155
  ], c.prototype, "readOnly");
153
156
  d([
154
- h
157
+ f
155
158
  ], c.prototype, "_popupOpen");
156
159
  d([
157
- h
160
+ f
158
161
  ], c.prototype, "_presentationValue");
159
- const G = (s, t, { withSeparator: a, padded: n }) => {
160
- const o = s.tagFor(C), l = s.tagFor(O), i = s.tagFor(T);
161
- return x`
162
+ const Q = (s, t, { withSeparator: a, padded: n }) => {
163
+ const o = s.tagFor(T), l = s.tagFor(P), i = s.tagFor(L);
164
+ return F`
162
165
  <div class='base' @keydown='${(e, { event: r }) => e._onBaseKeyDown(r)}'>
163
166
  <${l} id='text-field'
164
167
  ${p("_textFieldEl")}
@@ -177,7 +180,12 @@ const G = (s, t, { withSeparator: a, padded: n }) => {
177
180
  <slot
178
181
  slot='${(e) => e._helperTextSlottedContent?.length ? "helper-text" : void 0}'
179
182
  name='helper-text'
180
- ${P("_helperTextSlottedContent")}
183
+ ${u("_helperTextSlottedContent")}
184
+ ></slot>
185
+ <slot
186
+ slot='${(e) => e._contextualHelpSlottedContent?.length ? "contextual-help" : void 0}'
187
+ name='contextual-help'
188
+ ${u("_contextualHelpSlottedContent")}
181
189
  ></slot>
182
190
  <${i}
183
191
  id='picker-button'
@@ -197,14 +205,14 @@ const G = (s, t, { withSeparator: a, padded: n }) => {
197
205
  offset='${(e) => e._helperTextSlottedContent?.length || e.helperText || e.errorValidationMessage ? 8 : null}'
198
206
  placement='bottom-start'
199
207
  class='popup'>
200
- <div class="${() => u("dialog", [
208
+ <div class="${() => h("dialog", [
201
209
  "dialog--padded",
202
210
  n
203
211
  ])}" role='dialog' ${p(
204
212
  "_dialogEl"
205
213
  )} aria-modal='true' aria-label='${(e) => e._dialogLabel}'>
206
214
  ${() => t}
207
- <div class="${() => u("footer", ["footer--with-separator", a])}">
215
+ <div class="${() => h("footer", ["footer--with-separator", a])}">
208
216
  <${i}
209
217
  id='clear-button'
210
218
  tabindex='3'
@@ -228,7 +236,7 @@ const G = (s, t, { withSeparator: a, padded: n }) => {
228
236
  };
229
237
  export {
230
238
  c as P,
231
- G as a,
232
- q as i,
233
- N as p
239
+ Q as a,
240
+ G as i,
241
+ J as p
234
242
  };
package/bundled/ref.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const i=require("./vivid-element.cjs");class s{constructor(e,r){this.target=e,this.propertyName=r}bind(e){e[this.propertyName]=this.target}unbind(){}}function n(t){return new i.AttachedBehaviorHTMLDirective("fast-ref",s,t)}exports.ref=n;
1
+ "use strict";const i=require("./vivid-element.cjs");class s extends i.StatelessAttachedAttributeDirective{bind(t){t.source[this.options]=t.targets[this.targetNodeId]}}i.HTMLDirective.define(s);const r=e=>new s(e);exports.ref=r;
package/bundled/ref.js CHANGED
@@ -1,32 +1,15 @@
1
- import { A as i } from "./vivid-element.js";
2
- class a {
1
+ import { S as i, H as r } from "./vivid-element.js";
2
+ class s extends i {
3
3
  /**
4
- * Creates an instance of RefBehavior.
5
- * @param target - The element to reference.
6
- * @param propertyName - The name of the property to assign the reference to.
7
- */
8
- constructor(t, e) {
9
- this.target = t, this.propertyName = e;
10
- }
11
- /**
12
- * Bind this behavior to the source.
13
- * @param source - The source to bind to.
14
- * @param context - The execution context that the binding is operating within.
4
+ * Bind this behavior.
5
+ * @param controller - The view controller that manages the lifecycle of this behavior.
15
6
  */
16
7
  bind(t) {
17
- t[this.propertyName] = this.target;
8
+ t.source[this.options] = t.targets[this.targetNodeId];
18
9
  }
19
- /**
20
- * Unbinds this behavior from the source.
21
- * @param source - The source to unbind from.
22
- */
23
- /* eslint-disable-next-line @typescript-eslint/no-empty-function */
24
- unbind() {
25
- }
26
- }
27
- function s(r) {
28
- return new i("fast-ref", a, r);
29
10
  }
11
+ r.define(s);
12
+ const c = (e) => new s(e);
30
13
  export {
31
- s as r
14
+ c as r
32
15
  };