@vonage/vivid 4.13.0 → 4.14.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 (516) hide show
  1. package/custom-elements.json +4033 -2662
  2. package/elevation/index.cjs +1 -1
  3. package/elevation/index.js +1 -1
  4. package/index.cjs +70 -136
  5. package/index.d.ts +0 -1
  6. package/index.js +60 -62
  7. package/lib/accordion/accordion.d.ts +2 -2
  8. package/lib/accordion/accordion.template.d.ts +1 -2
  9. package/lib/accordion/definition.d.ts +1 -1
  10. package/lib/accordion-item/accordion-item.d.ts +2 -2
  11. package/lib/accordion-item/accordion-item.template.d.ts +2 -3
  12. package/lib/accordion-item/definition.d.ts +1 -1
  13. package/lib/action-group/action-group.d.ts +2 -2
  14. package/lib/action-group/action-group.template.d.ts +1 -3
  15. package/lib/action-group/definition.d.ts +1 -1
  16. package/lib/alert/alert.d.ts +2 -2
  17. package/lib/alert/alert.template.d.ts +2 -3
  18. package/lib/alert/definition.d.ts +1 -1
  19. package/lib/audio-player/audio-player.d.ts +2 -2
  20. package/lib/audio-player/audio-player.template.d.ts +2 -3
  21. package/lib/audio-player/definition.d.ts +1 -3
  22. package/lib/avatar/avatar.d.ts +2 -2
  23. package/lib/avatar/avatar.template.d.ts +2 -3
  24. package/lib/avatar/definition.d.ts +1 -1
  25. package/lib/badge/badge.d.ts +2 -2
  26. package/lib/badge/badge.template.d.ts +2 -3
  27. package/lib/badge/definition.d.ts +1 -3
  28. package/lib/banner/banner.d.ts +2 -2
  29. package/lib/banner/banner.template.d.ts +2 -3
  30. package/lib/banner/definition.d.ts +1 -1
  31. package/lib/breadcrumb/breadcrumb.d.ts +2 -2
  32. package/lib/breadcrumb/breadcrumb.template.d.ts +3 -4
  33. package/lib/breadcrumb/definition.d.ts +1 -1
  34. package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
  35. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +2 -3
  36. package/lib/breadcrumb-item/definition.d.ts +1 -1
  37. package/lib/button/button.d.ts +2 -2
  38. package/lib/button/button.template.d.ts +2 -4
  39. package/lib/button/definition.d.ts +1 -1
  40. package/lib/calendar/calendar.d.ts +2 -2
  41. package/lib/calendar/calendar.template.d.ts +1 -3
  42. package/lib/calendar/definition.d.ts +1 -1
  43. package/lib/calendar-event/calendar-event.d.ts +2 -2
  44. package/lib/calendar-event/calendar-event.template.d.ts +1 -3
  45. package/lib/calendar-event/definition.d.ts +1 -1
  46. package/lib/card/card.d.ts +2 -2
  47. package/lib/card/card.template.d.ts +2 -3
  48. package/lib/card/definition.d.ts +1 -1
  49. package/lib/checkbox/checkbox.form-associated.d.ts +3 -2
  50. package/lib/checkbox/checkbox.template.d.ts +2 -3
  51. package/lib/checkbox/definition.d.ts +1 -1
  52. package/lib/combobox/combobox.d.ts +17 -2
  53. package/lib/combobox/combobox.options.d.ts +7 -0
  54. package/lib/combobox/combobox.template.d.ts +2 -3
  55. package/lib/combobox/definition.d.ts +1 -2
  56. package/lib/data-grid/data-grid-cell.d.ts +16 -13
  57. package/lib/data-grid/data-grid-cell.template.d.ts +2 -3
  58. package/lib/data-grid/data-grid-row.d.ts +19 -2
  59. package/lib/data-grid/data-grid-row.template.d.ts +2 -2
  60. package/lib/data-grid/data-grid.d.ts +45 -4
  61. package/lib/data-grid/data-grid.template.d.ts +2 -2
  62. package/lib/data-grid/definition.d.ts +1 -6
  63. package/lib/date-picker/definition.d.ts +1 -3
  64. package/lib/date-range-picker/definition.d.ts +1 -3
  65. package/lib/dial-pad/definition.d.ts +1 -3
  66. package/lib/dial-pad/dial-pad.d.ts +2 -2
  67. package/lib/dial-pad/dial-pad.template.d.ts +2 -3
  68. package/lib/dialog/definition.d.ts +1 -1
  69. package/lib/dialog/dialog.d.ts +2 -2
  70. package/lib/dialog/dialog.template.d.ts +2 -3
  71. package/lib/divider/definition.d.ts +1 -1
  72. package/lib/divider/divider.d.ts +2 -2
  73. package/lib/divider/divider.template.d.ts +1 -3
  74. package/lib/elevation/definition.d.ts +1 -1
  75. package/lib/elevation/elevation.d.ts +2 -2
  76. package/lib/elevation/elevation.template.d.ts +1 -3
  77. package/lib/empty-state/definition.d.ts +1 -3
  78. package/lib/empty-state/empty-state.d.ts +2 -2
  79. package/lib/empty-state/empty-state.template.d.ts +2 -3
  80. package/lib/fab/definition.d.ts +1 -3
  81. package/lib/fab/fab.template.d.ts +2 -3
  82. package/lib/file-picker/definition.d.ts +1 -3
  83. package/lib/file-picker/file-picker.form-associated.d.ts +3 -2
  84. package/lib/file-picker/file-picker.template.d.ts +2 -3
  85. package/lib/header/definition.d.ts +1 -3
  86. package/lib/header/header.d.ts +2 -2
  87. package/lib/header/header.template.d.ts +2 -3
  88. package/lib/icon/definition.d.ts +1 -3
  89. package/lib/icon/icon.d.ts +2 -2
  90. package/lib/icon/icon.template.d.ts +1 -3
  91. package/lib/layout/definition.d.ts +1 -3
  92. package/lib/layout/layout.d.ts +2 -2
  93. package/lib/layout/layout.template.d.ts +1 -3
  94. package/lib/listbox/definition.d.ts +1 -3
  95. package/lib/listbox/listbox.template.d.ts +1 -3
  96. package/lib/menu/definition.d.ts +1 -11
  97. package/lib/menu/menu.d.ts +2 -2
  98. package/lib/menu/menu.template.d.ts +3 -3
  99. package/lib/menu-item/definition.d.ts +1 -3
  100. package/lib/menu-item/menu-item.d.ts +2 -2
  101. package/lib/menu-item/menu-item.template.d.ts +2 -3
  102. package/lib/nav/definition.d.ts +1 -3
  103. package/lib/nav/nav.d.ts +2 -2
  104. package/lib/nav/nav.template.d.ts +1 -3
  105. package/lib/nav-disclosure/definition.d.ts +1 -3
  106. package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
  107. package/lib/nav-disclosure/nav-disclosure.template.d.ts +2 -3
  108. package/lib/nav-item/definition.d.ts +1 -3
  109. package/lib/nav-item/nav-item.template.d.ts +2 -3
  110. package/lib/note/definition.d.ts +1 -3
  111. package/lib/note/note.d.ts +2 -2
  112. package/lib/note/note.template.d.ts +2 -3
  113. package/lib/number-field/definition.d.ts +1 -4
  114. package/lib/number-field/number-field.form-associated.d.ts +3 -2
  115. package/lib/number-field/number-field.template.d.ts +2 -3
  116. package/lib/option/definition.d.ts +1 -3
  117. package/lib/option/option.d.ts +3 -2
  118. package/lib/option/option.template.d.ts +2 -3
  119. package/lib/pagination/definition.d.ts +1 -3
  120. package/lib/pagination/pagination.d.ts +2 -2
  121. package/lib/pagination/pagination.template.d.ts +2 -3
  122. package/lib/popup/definition.d.ts +1 -3
  123. package/lib/popup/popup.template.d.ts +2 -3
  124. package/lib/progress/definition.d.ts +1 -3
  125. package/lib/progress/progress.d.ts +1 -1
  126. package/lib/progress/progress.template.d.ts +1 -4
  127. package/lib/progress-ring/definition.d.ts +1 -3
  128. package/lib/progress-ring/progress-ring.d.ts +1 -1
  129. package/lib/progress-ring/progress-ring.template.d.ts +1 -3
  130. package/lib/radio/definition.d.ts +1 -3
  131. package/lib/radio/radio.form-associated.d.ts +3 -2
  132. package/lib/radio/radio.template.d.ts +1 -3
  133. package/lib/radio-group/definition.d.ts +1 -11
  134. package/lib/radio-group/radio-group.d.ts +2 -2
  135. package/lib/radio-group/radio-group.template.d.ts +2 -3
  136. package/lib/range-slider/definition.d.ts +1 -3
  137. package/lib/range-slider/range-slider.form-associated.d.ts +3 -2
  138. package/lib/range-slider/range-slider.template.d.ts +2 -3
  139. package/lib/searchable-select/definition.d.ts +1 -4
  140. package/lib/searchable-select/option-tag.template.d.ts +2 -3
  141. package/lib/searchable-select/searchable-select.form-associated.d.ts +3 -2
  142. package/lib/searchable-select/searchable-select.template.d.ts +2 -3
  143. package/lib/select/definition.d.ts +1 -3
  144. package/lib/select/select.d.ts +14 -4
  145. package/lib/select/select.form-associated.d.ts +11 -0
  146. package/lib/select/select.template.d.ts +2 -3
  147. package/lib/selectable-box/definition.d.ts +1 -3
  148. package/lib/selectable-box/selectable-box.d.ts +2 -2
  149. package/lib/selectable-box/selectable-box.template.d.ts +2 -3
  150. package/lib/side-drawer/definition.d.ts +1 -3
  151. package/lib/side-drawer/side-drawer.d.ts +2 -2
  152. package/lib/side-drawer/side-drawer.template.d.ts +1 -3
  153. package/lib/slider/definition.d.ts +1 -3
  154. package/lib/slider/slider.form-associated.d.ts +3 -2
  155. package/lib/slider/slider.template.d.ts +3 -4
  156. package/lib/split-button/definition.d.ts +1 -1
  157. package/lib/split-button/split-button.d.ts +2 -2
  158. package/lib/split-button/split-button.template.d.ts +2 -3
  159. package/lib/switch/definition.d.ts +1 -3
  160. package/lib/switch/switch.form-associated.d.ts +3 -2
  161. package/lib/switch/switch.template.d.ts +1 -3
  162. package/lib/tab/definition.d.ts +1 -3
  163. package/lib/tab/tab.d.ts +2 -2
  164. package/lib/tab/tab.template.d.ts +2 -2
  165. package/lib/tab-panel/definition.d.ts +1 -3
  166. package/lib/tab-panel/tab-panel.d.ts +2 -2
  167. package/lib/tab-panel/tab-panel.template.d.ts +1 -1
  168. package/lib/tabs/definition.d.ts +1 -3
  169. package/lib/tabs/tabs.d.ts +3 -2
  170. package/lib/tabs/tabs.template.d.ts +1 -1
  171. package/lib/tag/definition.d.ts +1 -4
  172. package/lib/tag/tag.d.ts +2 -2
  173. package/lib/tag/tag.template.d.ts +2 -3
  174. package/lib/tag-group/definition.d.ts +1 -3
  175. package/lib/tag-group/tag-group.d.ts +2 -2
  176. package/lib/tag-group/tag-group.template.d.ts +1 -3
  177. package/lib/text-anchor/definition.d.ts +1 -3
  178. package/lib/text-anchor/text-anchor.d.ts +4 -3
  179. package/lib/text-anchor/text-anchor.template.d.ts +2 -3
  180. package/lib/text-area/definition.d.ts +1 -3
  181. package/lib/text-area/text-area.d.ts +1 -1
  182. package/lib/text-area/{text-field.form-associated.d.ts → text-area.form-associated.d.ts} +3 -2
  183. package/lib/text-area/text-area.template.d.ts +2 -3
  184. package/lib/text-field/definition.d.ts +1 -3
  185. package/lib/text-field/text-field.form-associated.d.ts +3 -2
  186. package/lib/text-field/text-field.template.d.ts +2 -3
  187. package/lib/time-picker/definition.d.ts +1 -3
  188. package/lib/time-picker/time-picker.form-associated.d.ts +3 -2
  189. package/lib/time-picker/time-picker.template.d.ts +2 -2
  190. package/lib/toggletip/definition.d.ts +1 -3
  191. package/lib/toggletip/toggletip.d.ts +2 -2
  192. package/lib/toggletip/toggletip.template.d.ts +2 -3
  193. package/lib/tooltip/definition.d.ts +1 -3
  194. package/lib/tooltip/tooltip.d.ts +2 -2
  195. package/lib/tooltip/tooltip.template.d.ts +2 -3
  196. package/lib/tree-item/definition.d.ts +1 -3
  197. package/lib/tree-item/tree-item.d.ts +11 -2
  198. package/lib/tree-item/tree-item.template.d.ts +3 -3
  199. package/lib/tree-view/definition.d.ts +1 -3
  200. package/lib/tree-view/tree-view.d.ts +16 -2
  201. package/lib/tree-view/tree-view.template.d.ts +1 -1
  202. package/lib/video-player/definition.d.ts +1 -3
  203. package/lib/video-player/video-player.d.ts +2 -2
  204. package/lib/video-player/video-player.template.d.ts +1 -3
  205. package/listbox/index.cjs +37 -39
  206. package/listbox/index.js +37 -39
  207. package/menu/index.cjs +1 -1
  208. package/menu/index.js +1 -1
  209. package/nav/index.cjs +1 -1
  210. package/nav/index.js +1 -1
  211. package/nav-disclosure/index.cjs +1 -1
  212. package/nav-disclosure/index.js +1 -1
  213. package/nav-item/index.cjs +1 -1
  214. package/nav-item/index.js +1 -1
  215. package/note/index.cjs +1 -1
  216. package/note/index.js +1 -1
  217. package/number-field/index.cjs +1 -1
  218. package/number-field/index.js +1 -1
  219. package/option/index.cjs +1 -1
  220. package/option/index.js +1 -1
  221. package/package.json +1 -1
  222. package/pagination/index.cjs +1 -1
  223. package/pagination/index.js +1 -1
  224. package/popup/index.cjs +1 -1
  225. package/popup/index.js +1 -1
  226. package/progress/index.cjs +1 -1
  227. package/progress/index.js +1 -1
  228. package/progress-ring/index.cjs +1 -1
  229. package/progress-ring/index.js +1 -1
  230. package/radio/index.cjs +1 -1
  231. package/radio/index.js +1 -1
  232. package/radio-group/index.cjs +1 -1
  233. package/radio-group/index.js +1 -1
  234. package/range-slider/index.cjs +1 -1
  235. package/range-slider/index.js +1 -1
  236. package/searchable-select/index.cjs +1 -1
  237. package/searchable-select/index.js +1 -1
  238. package/select/index.cjs +1 -1
  239. package/select/index.js +1 -1
  240. package/selectable-box/index.cjs +1 -1
  241. package/selectable-box/index.js +1 -1
  242. package/shared/affix.cjs +10 -10
  243. package/shared/affix.js +2 -2
  244. package/shared/anchor.cjs +59 -0
  245. package/shared/anchor.js +57 -0
  246. package/shared/anchored.cjs +6 -6
  247. package/shared/anchored.js +2 -2
  248. package/shared/apply-mixins.cjs +15 -17
  249. package/shared/apply-mixins.js +15 -17
  250. package/shared/apply-mixins2.cjs +25 -0
  251. package/shared/apply-mixins2.js +23 -0
  252. package/shared/applyMixinsWithObservables.cjs +4 -4
  253. package/shared/applyMixinsWithObservables.js +2 -2
  254. package/shared/aria-global.cjs +86 -67
  255. package/shared/aria-global.js +86 -67
  256. package/shared/aria-global2.cjs +68 -86
  257. package/shared/aria-global2.js +68 -86
  258. package/shared/base-progress.cjs +70 -63
  259. package/shared/base-progress.js +69 -62
  260. package/shared/breadcrumb-item.cjs +7 -58
  261. package/shared/breadcrumb-item.js +4 -55
  262. package/shared/button.cjs +178 -0
  263. package/shared/button.js +176 -0
  264. package/shared/calendar-event.cjs +10 -9
  265. package/shared/calendar-event.js +3 -2
  266. package/shared/children.cjs +2 -2
  267. package/shared/children.js +1 -1
  268. package/shared/date-picker/date-picker-base.form-associated.d.ts +3 -2
  269. package/shared/date-picker/date-picker-base.template.d.ts +2 -3
  270. package/shared/defineVividComponent.cjs +2612 -0
  271. package/shared/defineVividComponent.js +2592 -0
  272. package/shared/definition.cjs +26 -24
  273. package/shared/definition.js +17 -14
  274. package/shared/definition10.cjs +15 -12
  275. package/shared/definition10.js +15 -11
  276. package/shared/definition11.cjs +52 -248
  277. package/shared/definition11.js +24 -218
  278. package/shared/definition12.cjs +18 -14
  279. package/shared/definition12.js +17 -12
  280. package/shared/definition13.cjs +20 -19
  281. package/shared/definition13.js +11 -9
  282. package/shared/definition14.cjs +36 -38
  283. package/shared/definition14.js +16 -17
  284. package/shared/definition15.cjs +28 -26
  285. package/shared/definition15.js +17 -14
  286. package/shared/definition16.cjs +478 -611
  287. package/shared/definition16.js +471 -603
  288. package/shared/definition17.cjs +934 -1113
  289. package/shared/definition17.js +912 -1090
  290. package/shared/definition18.cjs +16 -20
  291. package/shared/definition18.js +19 -22
  292. package/shared/definition19.cjs +26 -30
  293. package/shared/definition19.js +21 -24
  294. package/shared/definition2.cjs +20 -22
  295. package/shared/definition2.js +21 -22
  296. package/shared/definition20.cjs +51 -52
  297. package/shared/definition20.js +35 -35
  298. package/shared/definition21.cjs +42 -45
  299. package/shared/definition21.js +18 -20
  300. package/shared/definition22.cjs +16 -13
  301. package/shared/definition22.js +15 -11
  302. package/shared/definition23.cjs +22 -20
  303. package/shared/definition23.js +15 -12
  304. package/shared/definition24.cjs +20 -172
  305. package/shared/definition24.js +17 -168
  306. package/shared/definition25.cjs +27 -28
  307. package/shared/definition25.js +19 -19
  308. package/shared/definition26.cjs +17 -14
  309. package/shared/definition26.js +15 -11
  310. package/shared/definition27.cjs +265 -12
  311. package/shared/definition27.js +262 -10
  312. package/shared/definition28.cjs +19 -16
  313. package/shared/definition28.js +15 -11
  314. package/shared/definition29.cjs +143 -68
  315. package/shared/definition29.js +102 -29
  316. package/shared/definition3.cjs +21 -16
  317. package/shared/definition3.js +17 -11
  318. package/shared/definition30.cjs +99 -76
  319. package/shared/definition30.js +98 -74
  320. package/shared/definition31.cjs +24 -97
  321. package/shared/definition31.js +25 -97
  322. package/shared/definition32.cjs +10 -25
  323. package/shared/definition32.js +9 -23
  324. package/shared/definition33.cjs +53 -14
  325. package/shared/definition33.js +52 -12
  326. package/shared/definition34.cjs +641 -34
  327. package/shared/definition34.js +638 -30
  328. package/shared/definition35.cjs +204 -596
  329. package/shared/definition35.js +198 -591
  330. package/shared/definition36.cjs +198 -233
  331. package/shared/definition36.js +193 -226
  332. package/shared/definition37.cjs +79 -206
  333. package/shared/definition37.js +75 -202
  334. package/shared/definition38.cjs +50 -56
  335. package/shared/definition38.js +48 -52
  336. package/shared/definition39.cjs +260 -56
  337. package/shared/definition39.js +259 -54
  338. package/shared/definition4.cjs +33 -35
  339. package/shared/definition4.js +20 -21
  340. package/shared/definition40.cjs +112 -229
  341. package/shared/definition40.js +109 -226
  342. package/shared/definition41.cjs +627 -36
  343. package/shared/definition41.js +626 -34
  344. package/shared/definition42.cjs +975 -487
  345. package/shared/definition42.js +972 -482
  346. package/shared/definition43.cjs +725 -932
  347. package/shared/definition43.js +713 -918
  348. package/shared/definition44.cjs +116 -734
  349. package/shared/definition44.js +114 -731
  350. package/shared/definition45.cjs +93 -116
  351. package/shared/definition45.js +93 -115
  352. package/shared/definition46.cjs +469 -89
  353. package/shared/definition46.js +466 -86
  354. package/shared/definition47.cjs +119 -470
  355. package/shared/definition47.js +116 -465
  356. package/shared/definition48.cjs +114 -120
  357. package/shared/definition48.js +112 -117
  358. package/shared/definition49.cjs +17 -134
  359. package/shared/definition49.js +16 -132
  360. package/shared/definition5.cjs +48 -49
  361. package/shared/definition5.js +19 -19
  362. package/shared/definition50.cjs +112 -15
  363. package/shared/definition50.js +110 -12
  364. package/shared/definition51.cjs +847 -84
  365. package/shared/definition51.js +843 -79
  366. package/shared/definition52.cjs +31 -873
  367. package/shared/definition52.js +29 -870
  368. package/shared/definition53.cjs +126 -28
  369. package/shared/definition53.js +124 -25
  370. package/shared/definition54.cjs +268 -107
  371. package/shared/definition54.js +262 -100
  372. package/shared/definition55.cjs +63 -278
  373. package/shared/definition55.js +61 -275
  374. package/shared/definition56.cjs +868 -76
  375. package/shared/definition56.js +867 -74
  376. package/shared/definition57.cjs +108 -826
  377. package/shared/definition57.js +106 -823
  378. package/shared/definition58.cjs +74 -100
  379. package/shared/definition58.js +70 -95
  380. package/shared/definition59.cjs +181 -106
  381. package/shared/definition59.js +175 -101
  382. package/shared/definition6.cjs +23 -21
  383. package/shared/definition6.js +15 -12
  384. package/shared/definition60.cjs +273 -70
  385. package/shared/definition60.js +273 -69
  386. package/shared/definition61.cjs +66157 -271
  387. package/shared/definition61.js +66156 -269
  388. package/shared/definition62.cjs +36 -66174
  389. package/shared/definition62.js +33 -66171
  390. package/shared/definition63.cjs +2154 -27
  391. package/shared/definition63.js +2151 -25
  392. package/shared/definition7.cjs +19 -15
  393. package/shared/definition7.js +14 -10
  394. package/shared/definition8.cjs +26 -27
  395. package/shared/definition8.js +17 -17
  396. package/shared/definition9.cjs +21 -21
  397. package/shared/definition9.js +18 -17
  398. package/shared/design-system/createRegisterFunction.d.ts +2 -0
  399. package/shared/design-system/defineVividComponent.d.ts +15 -0
  400. package/shared/{localization.js → direction.js} +11 -11
  401. package/shared/dom.cjs +0 -13
  402. package/shared/dom.js +1 -13
  403. package/shared/form-associated.cjs +422 -457
  404. package/shared/form-associated.js +422 -457
  405. package/shared/form-associated2.cjs +383 -0
  406. package/shared/form-associated2.js +381 -0
  407. package/shared/form-elements.cjs +15 -42
  408. package/shared/form-elements.js +2 -29
  409. package/shared/foundation/anchor/anchor.d.ts +1 -0
  410. package/shared/foundation/button/button.d.ts +3 -2
  411. package/shared/foundation/button/button.template.d.ts +2 -4
  412. package/shared/foundation/form-associated/form-associated.d.ts +51 -0
  413. package/shared/foundation/listbox/listbox.d.ts +22 -0
  414. package/shared/foundation/progress/base-progress.d.ts +9 -0
  415. package/shared/foundation/utilities/apply-mixins.d.ts +1 -0
  416. package/shared/foundation/vivid-element/vivid-element.d.ts +3 -0
  417. package/shared/foundation-element.cjs +1417 -0
  418. package/shared/foundation-element.js +1414 -0
  419. package/shared/index.cjs +7 -5097
  420. package/shared/index.js +7 -5079
  421. package/shared/key-codes.cjs +10 -0
  422. package/shared/key-codes.js +6 -1
  423. package/shared/key-codes2.cjs +50 -6
  424. package/shared/key-codes2.js +50 -4
  425. package/shared/listbox.cjs +428 -1195
  426. package/shared/listbox.js +412 -1176
  427. package/shared/listbox2.cjs +1268 -0
  428. package/shared/listbox2.js +1265 -0
  429. package/shared/localized.cjs +2 -2
  430. package/shared/localized.js +1 -1
  431. package/shared/numbers.cjs +12 -0
  432. package/shared/numbers.js +12 -1
  433. package/shared/patterns/affix.d.ts +2 -2
  434. package/shared/patterns/chevron.d.ts +2 -2
  435. package/shared/patterns/form-elements/form-elements.d.ts +2 -2
  436. package/shared/presentationDate.cjs +50 -49
  437. package/shared/presentationDate.js +7 -6
  438. package/shared/ref.cjs +2 -2
  439. package/shared/ref.js +1 -1
  440. package/shared/repeat.cjs +22 -22
  441. package/shared/repeat.js +1 -1
  442. package/shared/slider.template.cjs +5 -5
  443. package/shared/slider.template.js +2 -2
  444. package/shared/slotted.cjs +4 -4
  445. package/shared/slotted.js +1 -1
  446. package/shared/strings.cjs +0 -26
  447. package/shared/strings.js +1 -25
  448. package/shared/strings2.cjs +37 -0
  449. package/shared/strings2.js +33 -0
  450. package/shared/text-anchor.cjs +8 -89
  451. package/shared/text-anchor.js +5 -86
  452. package/shared/text-anchor.template.cjs +2 -2
  453. package/shared/text-anchor.template.js +1 -1
  454. package/shared/text-field2.cjs +29 -28
  455. package/shared/text-field2.js +6 -5
  456. package/shared/vivid-element.cjs +8 -0
  457. package/shared/vivid-element.js +6 -0
  458. package/side-drawer/index.cjs +1 -1
  459. package/side-drawer/index.js +1 -1
  460. package/slider/index.cjs +1 -1
  461. package/slider/index.js +1 -1
  462. package/split-button/index.cjs +1 -1
  463. package/split-button/index.js +1 -1
  464. package/styles/core/all.css +1 -1
  465. package/styles/core/theme.css +1 -1
  466. package/styles/core/typography.css +1 -1
  467. package/styles/tokens/theme-dark.css +4 -4
  468. package/styles/tokens/theme-light.css +4 -4
  469. package/styles/tokens/vivid-2-compat.css +1 -1
  470. package/switch/index.cjs +1 -1
  471. package/switch/index.js +1 -1
  472. package/tab/index.cjs +1 -1
  473. package/tab/index.js +1 -1
  474. package/tab-panel/index.cjs +1 -1
  475. package/tab-panel/index.js +1 -1
  476. package/tabs/index.cjs +1 -1
  477. package/tabs/index.js +1 -1
  478. package/tag/index.cjs +1 -1
  479. package/tag/index.js +1 -1
  480. package/tag-group/index.cjs +1 -1
  481. package/tag-group/index.js +1 -1
  482. package/text-anchor/index.cjs +10 -7
  483. package/text-anchor/index.js +10 -7
  484. package/text-area/index.cjs +1 -1
  485. package/text-area/index.js +1 -1
  486. package/text-field/index.cjs +1 -1
  487. package/text-field/index.js +1 -1
  488. package/time-picker/index.cjs +1 -1
  489. package/time-picker/index.js +1 -1
  490. package/toggletip/index.cjs +1 -1
  491. package/toggletip/index.js +1 -1
  492. package/tooltip/index.cjs +1 -1
  493. package/tooltip/index.js +1 -1
  494. package/tree-item/index.cjs +1 -1
  495. package/tree-item/index.js +1 -1
  496. package/tree-view/index.cjs +1 -1
  497. package/tree-view/index.js +1 -1
  498. package/video-player/index.cjs +1 -1
  499. package/video-player/index.js +1 -1
  500. package/vivid.api.json +2846 -7860
  501. package/shared/definition64.cjs +0 -2175
  502. package/shared/definition64.js +0 -2170
  503. package/shared/design-system/index.d.ts +0 -3
  504. package/shared/icon.cjs +0 -261
  505. package/shared/icon.js +0 -258
  506. package/shared/index2.cjs +0 -11
  507. package/shared/index2.js +0 -9
  508. package/shared/radio.cjs +0 -126
  509. package/shared/radio.js +0 -124
  510. package/shared/select.options.cjs +0 -12
  511. package/shared/select.options.js +0 -10
  512. package/shared/start-end.cjs +0 -52
  513. package/shared/start-end.js +0 -50
  514. package/shared/tree-item.cjs +0 -154
  515. package/shared/tree-item.js +0 -151
  516. package/shared/{localization.cjs → direction.cjs} +9 -9
@@ -1,41 +1,51 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index.cjs');
4
- const definition = require('./definition64.cjs');
5
- const keyCodes = require('./key-codes.cjs');
3
+ const definition$1 = require('./definition11.cjs');
4
+ const definition = require('./definition63.cjs');
5
+ const definition$2 = require('./definition27.cjs');
6
+ const defineVividComponent = require('./defineVividComponent.cjs');
7
+ const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
8
+ const scrollIntoView = require('./scrollIntoView.cjs');
6
9
  const formAssociated = require('./form-associated.cjs');
7
- const slider_template = require('./slider.template.cjs');
8
- const aria = require('./aria.cjs');
9
- const applyMixins = require('./apply-mixins.cjs');
10
+ const vividElement = require('./vivid-element.cjs');
11
+ const affix = require('./affix.cjs');
10
12
  const localized = require('./localized.cjs');
11
- const numbers = require('./numbers.cjs');
12
13
  const formElements = require('./form-elements.cjs');
13
- const ref = require('./ref.cjs');
14
+ const listbox = require('./listbox2.cjs');
15
+ const applyMixins = require('./apply-mixins.cjs');
16
+ const foundationElement = require('./foundation-element.cjs');
14
17
  const when = require('./when.cjs');
18
+ const ref = require('./ref.cjs');
19
+ const slotted = require('./slotted.cjs');
20
+ const repeat = require('./repeat.cjs');
15
21
  const classNames = require('./class-names.cjs');
16
22
 
17
- const styles = ":host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline:none;touch-action:none}.thumb-container.focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--_thumb-interaction-indicator-alpha: .05;border-radius:50%}.control.horizontal .thumb-container{transform:translate(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha: .12}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha: .25}.thumb-container:before{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:\"\";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha, 0);transition:opacity .2s ease-out 0s}.thumb-container:after{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:\"\";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2)}.popup{pointer-events:none}.tooltip{width:auto;padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}.control{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}:host([markers]) .control.horizontal .track-start,:host([markers]) .control.vertical .track-start{--_track-start-inset-inline-start: auto;--_track-start-inset-block-start: auto}";
23
+ const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-block;inline-size:300px;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.control-wrapper{display:flex;flex-direction:column;gap:4px}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.fieldset{--_connotation-color-primary: var(--vvd-searchable-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-searchable-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-searchable-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-searchable-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-searchable-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-searchable-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-searchable-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-searchable-select-accent-fierce, var(--vvd-color-neutral-700))}.fieldset{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.fieldset:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.fieldset:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.fieldset:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.fieldset:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.fieldset:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.fieldset:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.fieldset{display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;padding-block:8px;padding-inline:16px;transition:box-shadow .2s,background-color .2s}.fieldset:focus-within{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent}:host(:not([shape=pill])) .fieldset{border-radius:8px}:host([shape=pill]) .fieldset{border-radius:24px}.popup-wrapper{position:relative}.content-area{display:flex;overflow:hidden;flex:1;flex-direction:column;gap:8px;min-block-size:24px}.tag-row{display:flex;gap:8px;inline-size:100%}.tag-row.contains-only-input:not(:focus-within){display:contents}.tag-wrapper{overflow:hidden}.tag{max-inline-size:100%}input{box-sizing:border-box;flex:1;border:none;background:none;block-size:24px;font:var(--vvd-typography-base);max-inline-size:100%;min-inline-size:100px;outline:none}.contains-only-input input:not(:focus){position:absolute;block-size:0;inline-size:0;min-inline-size:0;opacity:0;pointer-events:none}.listbox{display:flex;flex-direction:column;padding:4px;gap:2px;max-block-size:var(--searchable-select-height, 408px);overflow-y:auto}.empty-message{display:flex;align-items:center;justify-content:center;color:var(--vvd-color-neutral-300);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:100%}slot[name=icon]{font-size:20px}.visually-hidden{position:absolute;overflow:hidden;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}";
18
24
 
19
- class _RangeSlider extends index.FoundationElement {
25
+ const optionTagStyles = ".base{--_connotation-color-contrast: var(--vvd-option-tag-accent-contrast, var(--vvd-color-neutral-800))}.base{position:relative;display:inline-flex;box-sizing:border-box;align-items:center;background-color:var(--fill-color);block-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 1px var(--outline-color);color:var(--text-color);column-gap:8px;font:var(--vvd-typography-base-bold);max-inline-size:100%;padding-inline:8px;user-select:none;vertical-align:middle}.base:not(.disabled){--text-color: var(--_connotation-color-contrast);--fill-color: color-mix( in srgb, var(--_connotation-color-contrast), transparent 87.5% );--outline-color: transparent}.base.disabled{--text-color: var(--vvd-color-neutral-300);--fill-color: color-mix( in srgb, var(--vvd-color-neutral-800), transparent 87.5% );--outline-color: transparent}.base:not(.shape-pill){border-radius:4px}.base.shape-pill{border-radius:16px}.label{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis;white-space:nowrap}slot[name=icon]{font-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5);line-height:1}.icon-placeholder{inline-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5)}.remove-button{display:flex;align-items:center;border-radius:inherit;cursor:pointer;outline:none}.disabled .remove-button{pointer-events:none}.remove-button:focus-visible:before{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}";
26
+
27
+ class _SearchableSelect extends vividElement.VividElement {
20
28
  }
21
- class FormAssociatedRangeSlider extends formAssociated.FormAssociated(_RangeSlider) {
29
+ class FormAssociatedSearchableSelect extends formAssociated.FormAssociated(
30
+ _SearchableSelect
31
+ ) {
22
32
  constructor() {
23
33
  super(...arguments);
24
34
  this.proxy = document.createElement("input");
25
35
  }
26
36
  }
27
37
 
28
- var __defProp = Object.defineProperty;
38
+ var __defProp$1 = Object.defineProperty;
29
39
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
30
40
  var __typeError = (msg) => {
31
41
  throw TypeError(msg);
32
42
  };
33
- var __decorateClass = (decorators, target, key, kind) => {
43
+ var __decorateClass$1 = (decorators, target, key, kind) => {
34
44
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
35
45
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
36
46
  if (decorator = decorators[i])
37
47
  result = (kind ? decorator(target, key, result) : decorator(result)) || result;
38
- if (kind && result) __defProp(target, key, result);
48
+ if (kind && result) __defProp$1(target, key, result);
39
49
  return result;
40
50
  };
41
51
  var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
@@ -43,597 +53,1075 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
43
53
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
44
54
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
45
55
  var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
46
- var _isInternalValueUpdate, _RangeSlider_instances, updateValues_fn, applyStep_fn, updateFormValue_fn, thumbs_get, thumbConstraints_get, getThumbId_fn, getThumbIdFromEvent_fn, updateThumbPositions_fn, thumbTrackEndOffset_fn, calculateValueFromMouseEvent_fn, roundToNearestStep_fn, _isNonVisibleFocus, focusThumbNonVisibly_fn, registerThumbListeners_fn, unregisterThumbListeners_fn, _onThumbFocus, _onThumbBlur, _onMouseOver, _onMouseOut, _onThumbMousedown, _onThumbKeydown, registerDragHandlers_fn, unregisterDragListeners_fn, _onDragMove, _onDragEnd;
47
- const Direction = {
48
- Increment: 1,
49
- Decrement: -1
50
- };
51
- let RangeSlider = class extends FormAssociatedRangeSlider {
56
+ var _SearchableSelect_instances, updateValuesThroughUserInteraction_fn, updateValuesWhileMaintainingOrder_fn, isValidValue_fn, _slottedOptionsChangeHandler, updateSelectedOnSlottedOptions_fn, handleOptionInteraction_fn, _clonedTagIcons, tagIconOfOption_fn, updateClonedTagIconOfOption_fn, _suppressFilter, updateFilteredOptions_fn, transitionHighlightedOptionTo_fn, selectHighlightedOption_fn, highlightFirstOption_fn, highlightLastOption_fn, highlightPrevPage_fn, highlightNextPage_fn, highlightPreviousOption_fn, highlightNextOption_fn, textForValue_fn, measureTagWidth_fn, updateTagLayout_fn, moveTagFocusTo_fn, nextTagIndexLeft_fn, nextTagIndexRight_fn, nextTagIndexForRemoved_fn, determineInitialValues_fn, updateFormValue_fn, _resizeObserver;
57
+ const TagGapPx = 8;
58
+ const InputMinWidthPx = 100;
59
+ const PageSize = 10;
60
+ const isFormAssociatedTryingToSetFormValue = (value) => typeof value === "string";
61
+ let SearchableSelect = class extends FormAssociatedSearchableSelect {
52
62
  constructor() {
53
63
  super(...arguments);
54
- __privateAdd(this, _RangeSlider_instances);
55
- // --- Start & end values ---
56
- __privateAdd(this, _isInternalValueUpdate, false);
57
- this.start = "";
58
- this.end = "";
59
- this.min = 0;
60
- this.max = 10;
61
- this.step = 1;
62
- this.orientation = aria.Orientation.horizontal;
63
- this.ariaStartLabel = null;
64
- this.ariaEndLabel = null;
65
- this.markers = false;
66
- this.pin = false;
67
- this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
68
- // --- Thumbs ---
64
+ __privateAdd(this, _SearchableSelect_instances);
65
+ this.fixedDropdown = false;
66
+ this.open = false;
67
+ this.multiple = false;
68
+ this.externalTags = false;
69
+ this.maxLines = null;
70
+ this.values = [];
71
+ this.initialValues = [];
72
+ this._inputValue = "";
73
+ // --- Slotted options ---
69
74
  /**
70
75
  * @internal
71
76
  */
72
- this._trackEl = null;
73
- /**
74
- * @internal
75
- */
76
- this._startThumbEl = null;
77
- /**
78
- * @internal
79
- */
80
- this._endThumbEl = null;
81
- this._draggingThumb = false;
82
- this._visiblyFocusedThumb = null;
83
- this._hoveredThumb = null;
84
- this._startThumbCss = "";
85
- this._endThumbCss = "";
86
- this._selectedRangeCss = "";
87
- __privateAdd(this, _isNonVisibleFocus, false);
88
- __privateAdd(this, _onThumbFocus, (e) => {
89
- if (!__privateGet(this, _isNonVisibleFocus)) {
90
- this._visiblyFocusedThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
91
- }
92
- });
93
- __privateAdd(this, _onThumbBlur, () => {
94
- this._visiblyFocusedThumb = null;
95
- });
96
- __privateAdd(this, _onMouseOver, (e) => {
97
- this._hoveredThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
98
- });
99
- __privateAdd(this, _onMouseOut, () => {
100
- this._hoveredThumb = null;
101
- });
102
- __privateAdd(this, _onThumbMousedown, (event) => {
103
- if (this.disabled || event.defaultPrevented) {
104
- return;
105
- }
106
- let target = event.target;
107
- if (target === this._endThumbEl && this.startAsNumber === this.max && this.endAsNumber === this.max) {
108
- target = this._startThumbEl;
109
- }
110
- __privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, target);
111
- this._draggingThumb = __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, target);
112
- __privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
113
- });
114
- __privateAdd(this, _onThumbKeydown, (e) => {
115
- const thumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
116
- this._visiblyFocusedThumb = thumb;
117
- if (e.key === keyCodes.keyHome) {
118
- e.preventDefault();
119
- __privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min}` });
120
- } else if (e.key === keyCodes.keyEnd) {
121
- e.preventDefault();
122
- __privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max}` });
123
- } else if (!e.shiftKey) {
124
- switch (e.key) {
125
- case keyCodes.keyArrowRight:
126
- case keyCodes.keyArrowDown:
127
- e.preventDefault();
128
- __privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Increment);
129
- break;
130
- case keyCodes.keyArrowLeft:
131
- case keyCodes.keyArrowUp:
132
- e.preventDefault();
133
- __privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Decrement);
134
- break;
77
+ this._areOptionsInitialized = false;
78
+ __privateAdd(this, _slottedOptionsChangeHandler, {
79
+ handleChange: (source, _) => {
80
+ if (source.selected && !this.values.includes(source.value)) {
81
+ this.values = [...this.values, source.value];
82
+ } else if (!source.selected && this.values.includes(source.value)) {
83
+ this.values = this.values.filter((option) => option !== source.value);
135
84
  }
136
85
  }
137
86
  });
138
- __privateAdd(this, _onDragMove, (e) => {
139
- if (this.disabled || e.defaultPrevented || !this._draggingThumb) {
87
+ // --- Option tag icons ---
88
+ __privateAdd(this, _clonedTagIcons, /* @__PURE__ */ new Map());
89
+ this._filteredOptions = [];
90
+ this._filteredEnabledOptions = [];
91
+ __privateAdd(this, _suppressFilter, false);
92
+ this._highlightedOptionIndex = null;
93
+ this._numElidedTags = 0;
94
+ this._tagRows = [];
95
+ this._lastTagRow = [];
96
+ this.clearable = false;
97
+ this.setFormValue = (value, state) => {
98
+ if (isFormAssociatedTryingToSetFormValue(value)) {
140
99
  return;
141
100
  }
142
- const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
143
- const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, sourceEvent);
144
- __privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
145
- [this._draggingThumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, this._draggingThumb, value)}`
146
- });
147
- });
148
- __privateAdd(this, _onDragEnd, () => {
149
- this._draggingThumb = false;
150
- __privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
151
- });
101
+ super.setFormValue(value, state);
102
+ };
103
+ this._changeDescription = "";
104
+ // --- Core ---
105
+ __privateAdd(this, _resizeObserver, new ResizeObserver(() => {
106
+ __privateMethod(this, _SearchableSelect_instances, updateTagLayout_fn).call(this);
107
+ }));
152
108
  }
153
109
  /**
154
110
  * @internal
155
111
  */
156
- startChanged() {
157
- this.currentStart = this.start;
158
- if (!__privateGet(this, _isInternalValueUpdate)) {
159
- this.dirtyValue = true;
160
- __privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
112
+ openChanged() {
113
+ if (!this.open) {
114
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, null);
115
+ }
116
+ }
117
+ /**
118
+ * @internal
119
+ */
120
+ valuesChanged() {
121
+ if (!this._areOptionsInitialized) {
122
+ return;
161
123
  }
124
+ if (!this.multiple && this.values.length > 1) {
125
+ this.values = [this.values[0]];
126
+ return;
127
+ }
128
+ if (this.values.some((value) => !__privateMethod(this, _SearchableSelect_instances, isValidValue_fn).call(this, value))) {
129
+ this.values = this.values.filter((value) => __privateMethod(this, _SearchableSelect_instances, isValidValue_fn).call(this, value));
130
+ return;
131
+ }
132
+ if (!this.multiple) {
133
+ if (this.values.length) {
134
+ __privateSet(this, _suppressFilter, true);
135
+ this._inputValue = __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.values[0]);
136
+ } else {
137
+ this._inputValue = "";
138
+ }
139
+ }
140
+ this.value = this.values.length ? this.values[0] : "";
141
+ __privateMethod(this, _SearchableSelect_instances, updateSelectedOnSlottedOptions_fn).call(this);
162
142
  if (this.$fastController.isConnected) {
163
- __privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
143
+ __privateMethod(this, _SearchableSelect_instances, updateTagLayout_fn).call(this);
164
144
  }
145
+ __privateMethod(this, _SearchableSelect_instances, updateFormValue_fn).call(this);
165
146
  }
166
147
  /**
167
148
  * @internal
168
149
  */
169
- initialStartChanged(_, newValue) {
170
- if (newValue && !this.dirtyValue) {
171
- this.start = newValue;
150
+ initialValuesChanged() {
151
+ if (!this.dirtyValue) {
152
+ this.values = this.initialValues;
172
153
  this.dirtyValue = false;
173
154
  }
174
155
  }
175
156
  /**
176
157
  * @internal
177
158
  */
178
- currentStartChanged() {
179
- this.start = this.currentStart;
159
+ valueChanged(prev, next) {
160
+ super.valueChanged(prev, next);
161
+ if (!this._areOptionsInitialized) {
162
+ return;
163
+ }
164
+ const isValidValue = this._slottedOptions.some(
165
+ (option) => option.value === next
166
+ );
167
+ if (this.values[0] !== next) {
168
+ this.values = isValidValue ? [next] : [];
169
+ }
170
+ }
171
+ get selectedIndex() {
172
+ if (this.values.length) {
173
+ return this._slottedOptions.findIndex(
174
+ (option) => option.value === this.values[0]
175
+ );
176
+ } else {
177
+ return -1;
178
+ }
179
+ }
180
+ set selectedIndex(index) {
181
+ this.value = this._slottedOptions[index]?.value ?? "";
182
+ }
183
+ get options() {
184
+ return [...this._slottedOptions];
185
+ }
186
+ get selectedOptions() {
187
+ return this._slottedOptions.filter(
188
+ (option) => this.values.includes(option.value)
189
+ );
180
190
  }
181
191
  /**
182
- * The start property, typed as a number.
183
- *
184
- * @public
192
+ * @internal
193
+ */
194
+ _inputValueChanged() {
195
+ __privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
196
+ }
197
+ /**
198
+ * @internal
185
199
  */
186
- get startAsNumber() {
187
- return parseFloat(this.start);
200
+ _onInputInput(event) {
201
+ __privateSet(this, _suppressFilter, false);
202
+ this._inputValue = event.target.value;
188
203
  }
189
- set startAsNumber(next) {
190
- this.start = next.toString();
204
+ /**
205
+ * @internal
206
+ */
207
+ _onInputFocus(_) {
208
+ __privateSet(this, _suppressFilter, true);
209
+ __privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
210
+ this.open = true;
191
211
  }
192
212
  /**
193
213
  * @internal
194
214
  */
195
- endChanged() {
196
- this.currentEnd = this.end;
197
- if (!__privateGet(this, _isInternalValueUpdate)) {
198
- this.dirtyValue = true;
199
- __privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
215
+ _onInputBlur(_) {
216
+ this.open = false;
217
+ if (this.multiple) {
218
+ this._inputValue = "";
219
+ } else {
220
+ if (this.values.length === 0) {
221
+ this._inputValue = "";
222
+ } else {
223
+ this._inputValue = __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.values[0]);
224
+ }
200
225
  }
201
- if (this.$fastController.isConnected) {
202
- __privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
226
+ this._changeDescription = "";
227
+ }
228
+ /**
229
+ * @internal
230
+ */
231
+ _onInputKeydown(e) {
232
+ if (e.ctrlKey || e.shiftKey) {
233
+ return true;
234
+ }
235
+ switch (e.key) {
236
+ case "Enter":
237
+ __privateMethod(this, _SearchableSelect_instances, selectHighlightedOption_fn).call(this);
238
+ return false;
239
+ case "Escape":
240
+ this.open = false;
241
+ break;
242
+ case "Home":
243
+ if (!this.open) {
244
+ this.open = true;
245
+ break;
246
+ }
247
+ __privateMethod(this, _SearchableSelect_instances, highlightFirstOption_fn).call(this);
248
+ return false;
249
+ case "End":
250
+ if (!this.open) {
251
+ this.open = true;
252
+ break;
253
+ }
254
+ __privateMethod(this, _SearchableSelect_instances, highlightLastOption_fn).call(this);
255
+ return false;
256
+ case "PageUp":
257
+ if (!this.open) {
258
+ this.open = true;
259
+ break;
260
+ }
261
+ __privateMethod(this, _SearchableSelect_instances, highlightPrevPage_fn).call(this);
262
+ return false;
263
+ case "PageDown":
264
+ if (!this.open) {
265
+ this.open = true;
266
+ break;
267
+ }
268
+ __privateMethod(this, _SearchableSelect_instances, highlightNextPage_fn).call(this);
269
+ return false;
270
+ case "ArrowUp":
271
+ if (!this.open) {
272
+ this.open = true;
273
+ break;
274
+ }
275
+ __privateMethod(this, _SearchableSelect_instances, highlightPreviousOption_fn).call(this);
276
+ return false;
277
+ case "ArrowDown":
278
+ if (!this.open) {
279
+ this.open = true;
280
+ break;
281
+ }
282
+ __privateMethod(this, _SearchableSelect_instances, highlightNextOption_fn).call(this);
283
+ return false;
284
+ case "ArrowLeft":
285
+ if (this.multiple && this._inputValue === "" && this.values.length && !this.externalTags) {
286
+ __privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexLeft_fn).call(this, this.values.length));
287
+ return false;
288
+ }
289
+ return true;
290
+ case "Backspace":
291
+ if (this.multiple && this._inputValue === "" && this.values.length) {
292
+ this._onTagRemoved(this.values[this.values.length - 1]);
293
+ return false;
294
+ }
295
+ return true;
296
+ default:
297
+ if (!this.open) {
298
+ this.open = true;
299
+ }
300
+ return true;
203
301
  }
302
+ return true;
204
303
  }
205
304
  /**
206
305
  * @internal
207
306
  */
208
- initialEndChanged(_, newValue) {
209
- if (newValue && !this.dirtyValue) {
210
- this.end = newValue;
211
- this.dirtyValue = false;
307
+ _slottedOptionsChanged(oldValue, newValue) {
308
+ const hasSlottedOptions = Boolean(
309
+ this.querySelectorAll(`:not([slot])`).length
310
+ );
311
+ if (!newValue.length && hasSlottedOptions) {
312
+ return;
313
+ }
314
+ this._areOptionsInitialized = true;
315
+ if (oldValue) {
316
+ for (const option of oldValue) {
317
+ const notifier = defineVividComponent.Observable.getNotifier(option);
318
+ notifier.unsubscribe(__privateGet(this, _slottedOptionsChangeHandler), "selected");
319
+ }
320
+ }
321
+ if (newValue) {
322
+ for (const option of newValue) {
323
+ option._displayCheckmark = true;
324
+ const notifier = defineVividComponent.Observable.getNotifier(option);
325
+ notifier.subscribe(__privateGet(this, _slottedOptionsChangeHandler), "selected");
326
+ }
212
327
  }
328
+ const values = [];
329
+ for (const option of this._slottedOptions) {
330
+ if (option.selected || option.value === this.value || this.values.includes(option.value)) {
331
+ values.push(option.value);
332
+ }
333
+ }
334
+ __privateMethod(this, _SearchableSelect_instances, updateValuesWhileMaintainingOrder_fn).call(this, values);
335
+ __privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
213
336
  }
214
337
  /**
215
338
  * @internal
216
339
  */
217
- currentEndChanged() {
218
- this.end = this.currentEnd;
340
+ _tagIconSlotName(value) {
341
+ return `_tag-icon-${this.values.indexOf(value)}`;
219
342
  }
343
+ // --- Tags ---
220
344
  /**
221
- * The end property, typed as a number.
222
- *
223
- * @public
345
+ * @internal
224
346
  */
225
- get endAsNumber() {
226
- return parseFloat(this.end);
347
+ _tagLabelForValue(value) {
348
+ const option = this._slottedOptions.find(
349
+ (option2) => option2.value === value
350
+ );
351
+ return option.label;
227
352
  }
228
- set endAsNumber(next) {
229
- this.end = next.toString();
353
+ /**
354
+ * @internal
355
+ */
356
+ _isTagDisabled(value) {
357
+ const option = this._slottedOptions.find(
358
+ (option2) => option2.value === value
359
+ );
360
+ return this.disabled || option.disabled;
230
361
  }
231
362
  /**
232
363
  * @internal
233
364
  */
234
- orientationChanged() {
235
- if (this.$fastController.isConnected) {
236
- __privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
365
+ _onTagRemoved(value) {
366
+ __privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, this.values.filter((option) => option !== value));
367
+ __privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
368
+ }
369
+ /**
370
+ * @internal
371
+ */
372
+ _onTagKeydown(event) {
373
+ const tagIndex = parseInt(event.target.dataset.index);
374
+ switch (event.key) {
375
+ case "Backspace":
376
+ case "Delete":
377
+ case "Enter":
378
+ case " ": {
379
+ this._onTagRemoved(this.values[tagIndex]);
380
+ defineVividComponent.DOM.processUpdates();
381
+ __privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexForRemoved_fn).call(this, tagIndex));
382
+ break;
383
+ }
384
+ case "ArrowLeft":
385
+ __privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexLeft_fn).call(this, tagIndex) ?? tagIndex);
386
+ break;
387
+ case "ArrowRight":
388
+ __privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexRight_fn).call(this, tagIndex));
389
+ break;
390
+ }
391
+ return true;
392
+ }
393
+ /**
394
+ * @internal
395
+ */
396
+ _onListboxClick(e) {
397
+ if (this.disabled) {
398
+ return;
399
+ }
400
+ const capturedOption = e.target.closest(
401
+ `option,[role=option]`
402
+ );
403
+ if (capturedOption && !capturedOption.disabled) {
404
+ __privateMethod(this, _SearchableSelect_instances, handleOptionInteraction_fn).call(this, capturedOption);
237
405
  }
238
406
  }
239
- // --- Form handling ---
407
+ /**
408
+ * @internal
409
+ */
410
+ get _shouldShowClearButton() {
411
+ return this.clearable && this.values.length > 0;
412
+ }
413
+ /**
414
+ * @internal
415
+ */
416
+ _onClearButtonClick() {
417
+ __privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, this.selectedOptions.filter((option) => option.disabled).map((option) => option.value));
418
+ }
240
419
  /**
241
420
  * @internal
242
421
  */
243
422
  nameChanged(previous, next) {
244
423
  super.nameChanged(previous, next);
245
- __privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
424
+ __privateMethod(this, _SearchableSelect_instances, updateFormValue_fn).call(this);
246
425
  }
426
+ /**
427
+ * @internal
428
+ */
247
429
  formResetCallback() {
248
- __privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
249
- start: this.initialStart ?? this.min.toString(),
250
- end: this.initialEnd ?? this.max.toString()
251
- });
252
430
  super.formResetCallback();
431
+ __privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, __privateMethod(this, _SearchableSelect_instances, determineInitialValues_fn).call(this));
253
432
  }
254
433
  /**
255
434
  * @internal
256
435
  */
257
- _isThumbPopupOpen(thumb) {
258
- return this._visiblyFocusedThumb === thumb || this._hoveredThumb === thumb || this._draggingThumb === thumb;
436
+ _onFieldsetClick(e) {
437
+ if (this.disabled) {
438
+ return;
439
+ }
440
+ if (!e.defaultPrevented) {
441
+ this._input.focus();
442
+ this.open = true;
443
+ }
259
444
  }
260
- // --- Lifecycle ---
261
445
  connectedCallback() {
262
446
  super.connectedCallback();
263
- __privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
264
- start: this.start || this.initialStart || this.min.toString(),
265
- end: this.end || this.initialEnd || this.max.toString()
266
- }, false);
267
- __privateMethod(this, _RangeSlider_instances, registerThumbListeners_fn).call(this);
268
- __privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
447
+ if (!this.values.length) {
448
+ this.values = __privateMethod(this, _SearchableSelect_instances, determineInitialValues_fn).call(this);
449
+ }
450
+ __privateGet(this, _resizeObserver).observe(this._contentArea);
269
451
  }
270
452
  disconnectedCallback() {
271
453
  super.disconnectedCallback();
272
- __privateMethod(this, _RangeSlider_instances, unregisterThumbListeners_fn).call(this);
273
- __privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
454
+ __privateGet(this, _resizeObserver).disconnect();
274
455
  }
275
456
  /**
276
457
  * @internal
277
458
  */
278
- _onMouseDown(e) {
279
- if (this.disabled || this._draggingThumb) {
280
- return;
459
+ validate() {
460
+ super.validate(this._input ?? void 0);
461
+ }
462
+ };
463
+ _SearchableSelect_instances = new WeakSet();
464
+ updateValuesThroughUserInteraction_fn = function(newValues) {
465
+ this.values = newValues;
466
+ this.$emit("change", void 0, {
467
+ bubbles: false
468
+ });
469
+ this.$emit("input", void 0, {
470
+ bubbles: false
471
+ });
472
+ };
473
+ updateValuesWhileMaintainingOrder_fn = function(newValues) {
474
+ const oldSet = new Set(this.values);
475
+ const newSet = new Set(newValues);
476
+ this.values = [...this.values].filter((v) => newSet.has(v)).concat([...newValues].filter((v) => !oldSet.has(v)));
477
+ };
478
+ isValidValue_fn = function(value) {
479
+ return this._slottedOptions.some((option) => option.value === value);
480
+ };
481
+ _slottedOptionsChangeHandler = new WeakMap();
482
+ updateSelectedOnSlottedOptions_fn = function() {
483
+ for (const option of this._slottedOptions) {
484
+ option.selected = this.values.includes(option.value);
485
+ __privateMethod(this, _SearchableSelect_instances, updateClonedTagIconOfOption_fn).call(this, option);
486
+ }
487
+ };
488
+ handleOptionInteraction_fn = function(option) {
489
+ const value = option.value;
490
+ let newValues;
491
+ const isSelection = !this.values.includes(value);
492
+ if (this.multiple) {
493
+ if (isSelection) {
494
+ newValues = [...this.values, value];
495
+ } else {
496
+ newValues = this.values.filter((option2) => option2 !== value);
497
+ }
498
+ this._inputValue = "";
499
+ } else {
500
+ if (isSelection) {
501
+ newValues = [value];
502
+ this._inputValue = option.text;
503
+ } else {
504
+ newValues = [];
505
+ }
506
+ this.open = false;
507
+ }
508
+ this._changeDescription = isSelection ? this.locale.searchableSelect.optionSelectedMessage(option.text) : this.locale.searchableSelect.optionDeselectedMessage(option.text);
509
+ __privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, newValues);
510
+ };
511
+ _clonedTagIcons = new WeakMap();
512
+ tagIconOfOption_fn = function(option) {
513
+ return option.querySelector('[slot="tag-icon"]');
514
+ };
515
+ updateClonedTagIconOfOption_fn = function(option) {
516
+ if (option.selected && __privateMethod(this, _SearchableSelect_instances, tagIconOfOption_fn).call(this, option)) {
517
+ let clone = __privateGet(this, _clonedTagIcons).get(option);
518
+ if (!clone) {
519
+ clone = __privateMethod(this, _SearchableSelect_instances, tagIconOfOption_fn).call(this, option).cloneNode(true);
520
+ __privateGet(this, _clonedTagIcons).set(option, clone);
521
+ }
522
+ clone.slot = this._tagIconSlotName(option.value);
523
+ this.appendChild(clone);
524
+ } else {
525
+ const clone = __privateGet(this, _clonedTagIcons).get(option);
526
+ if (clone) {
527
+ clone.remove();
528
+ __privateGet(this, _clonedTagIcons).delete(option);
529
+ }
530
+ }
531
+ };
532
+ _suppressFilter = new WeakMap();
533
+ updateFilteredOptions_fn = function() {
534
+ const newFilteredOptions = [];
535
+ for (const option of this._slottedOptions ?? []) {
536
+ if (__privateGet(this, _suppressFilter) || this._inputValue === "") {
537
+ option.hidden = false;
538
+ option._matchedRange = null;
539
+ } else {
540
+ const matchIndex = option.text.toLowerCase().indexOf(this._inputValue.toLowerCase());
541
+ const matchedRange = matchIndex === -1 ? null : { from: matchIndex, to: matchIndex + this._inputValue.length };
542
+ option.hidden = !matchedRange;
543
+ option._matchedRange = matchedRange;
544
+ }
545
+ if (!option.hidden) {
546
+ newFilteredOptions.push(option);
281
547
  }
282
- const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, e);
283
- const startDistance = Math.abs(value - Number(this.start));
284
- const endDistance = Math.abs(value - Number(this.end));
285
- const thumb = startDistance < endDistance || startDistance === endDistance && value < Number(this.start) ? "start" : "end";
286
- __privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
287
- [thumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, value)}`
288
- });
289
- this._draggingThumb = thumb;
290
- __privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb]);
291
- __privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
292
548
  }
549
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, null);
550
+ this._filteredOptions = newFilteredOptions;
551
+ this._filteredEnabledOptions = newFilteredOptions.filter(
552
+ (option) => !option.disabled
553
+ );
293
554
  };
294
- _isInternalValueUpdate = new WeakMap();
295
- _RangeSlider_instances = new WeakSet();
296
- updateValues_fn = function({ start, end }, emitEvents = true) {
297
- if (start === this.start) {
298
- start = void 0;
555
+ transitionHighlightedOptionTo_fn = function(index) {
556
+ if (typeof this._highlightedOptionIndex === "number") {
557
+ this._filteredEnabledOptions[this._highlightedOptionIndex]._highlighted = false;
299
558
  }
300
- if (end === this.end) {
301
- end = void 0;
559
+ if (typeof index === "number") {
560
+ if (!this._filteredEnabledOptions.length) {
561
+ index = null;
562
+ } else {
563
+ index = Math.max(
564
+ 0,
565
+ Math.min(this._filteredEnabledOptions.length - 1, index)
566
+ );
567
+ }
568
+ }
569
+ this._highlightedOptionIndex = index;
570
+ if (typeof this._highlightedOptionIndex === "number") {
571
+ const highlightedOption = this._filteredEnabledOptions[this._highlightedOptionIndex];
572
+ highlightedOption._highlighted = true;
573
+ scrollIntoView.scrollIntoView(highlightedOption, this._listbox, "nearest");
574
+ this._changeDescription = this.locale.searchableSelect.optionFocusedMessage(
575
+ highlightedOption.text,
576
+ this._highlightedOptionIndex + 1,
577
+ this._filteredEnabledOptions.length
578
+ );
579
+ }
580
+ };
581
+ selectHighlightedOption_fn = function() {
582
+ if (this._highlightedOptionIndex === null) {
583
+ return;
584
+ }
585
+ __privateMethod(this, _SearchableSelect_instances, handleOptionInteraction_fn).call(this, this._filteredEnabledOptions[this._highlightedOptionIndex]);
586
+ };
587
+ highlightFirstOption_fn = function() {
588
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, 0);
589
+ };
590
+ highlightLastOption_fn = function() {
591
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, this._filteredEnabledOptions.length - 1);
592
+ };
593
+ highlightPrevPage_fn = function() {
594
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - PageSize);
595
+ };
596
+ highlightNextPage_fn = function() {
597
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? -1) + PageSize);
598
+ };
599
+ highlightPreviousOption_fn = function() {
600
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - 1);
601
+ };
602
+ highlightNextOption_fn = function() {
603
+ __privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? -1) + 1);
604
+ };
605
+ textForValue_fn = function(value) {
606
+ const option = this._slottedOptions.find(
607
+ (option2) => option2.value === value
608
+ );
609
+ return option.text;
610
+ };
611
+ /**
612
+ * @internal
613
+ */
614
+ measureTagWidth_fn = function(label, removable, hasIcon) {
615
+ const tag = document.createElement(this._optionTagTagName);
616
+ tag.label = label;
617
+ tag.removable = removable;
618
+ tag.style.cssText = "position: absolute; visibility: hidden;";
619
+ tag.hasIconPlaceholder = hasIcon;
620
+ this.shadowRoot.appendChild(tag);
621
+ const width = tag.getBoundingClientRect().width;
622
+ tag.remove();
623
+ return width;
624
+ };
625
+ updateTagLayout_fn = function() {
626
+ if (!this.multiple) {
627
+ this._numElidedTags = 0;
628
+ this._tagRows = [];
629
+ this._lastTagRow = [];
630
+ return;
302
631
  }
303
- if (start === void 0 && end === void 0) {
632
+ if (this.externalTags) {
633
+ this._numElidedTags = this.values.length;
634
+ this._tagRows = [];
635
+ this._lastTagRow = [];
304
636
  return;
305
637
  }
306
- __privateSet(this, _isInternalValueUpdate, true);
307
- if (start !== void 0) {
308
- this.start = start;
638
+ const rowWidth = this._contentArea.getBoundingClientRect().width;
639
+ const rows = [[]];
640
+ let currentRowIndex = 0;
641
+ let currentRowWidth = InputMinWidthPx;
642
+ let i;
643
+ for (i = this.values.length - 1; i >= 0; i--) {
644
+ const isLastRow = this.maxLines && currentRowIndex === this.maxLines - 1;
645
+ const tagWidth = __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this._tagLabelForValue(this.values[i]), true, __privateMethod(this, _SearchableSelect_instances, tagIconOfOption_fn).call(this, this.selectedOptions[i]) !== null);
646
+ const entry = {
647
+ value: this.values[i],
648
+ width: tagWidth
649
+ };
650
+ let elidedTagCounterWidth = 0;
651
+ if (isLastRow) {
652
+ const numElidedTags = i;
653
+ if (numElidedTags) {
654
+ elidedTagCounterWidth = TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, numElidedTags.toString(), false, false);
655
+ }
656
+ }
657
+ const totalWidthNeeded = currentRowWidth + TagGapPx + tagWidth + elidedTagCounterWidth;
658
+ if (totalWidthNeeded > rowWidth) {
659
+ if (isLastRow) {
660
+ if (i === this.values.length - 1) {
661
+ rows[currentRowIndex].unshift(entry);
662
+ currentRowWidth += TagGapPx + tagWidth;
663
+ } else {
664
+ break;
665
+ }
666
+ } else {
667
+ rows.push([]);
668
+ currentRowIndex++;
669
+ rows[currentRowIndex].unshift(entry);
670
+ currentRowWidth = tagWidth;
671
+ }
672
+ continue;
673
+ }
674
+ rows[currentRowIndex].unshift(entry);
675
+ currentRowWidth += TagGapPx + tagWidth;
676
+ }
677
+ this._numElidedTags = i + 1;
678
+ rows.reverse();
679
+ for (let i2 = 0; i2 < rows.length - 1; i2++) {
680
+ let lineWidth = rows[i2].map((e) => e.width).reduce((a, b) => a + b, 0) + (rows[i2].length - 1) * TagGapPx;
681
+ if (i2 === 0 && this._numElidedTags) {
682
+ lineWidth += TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this._numElidedTags.toString(), false, false);
683
+ }
684
+ while (rows[i2 + 1].length && lineWidth + TagGapPx + rows[i2 + 1][0].width <= rowWidth) {
685
+ const nextTag = rows[i2 + 1].shift();
686
+ rows[i2].push(nextTag);
687
+ lineWidth += TagGapPx + nextTag.width;
688
+ }
689
+ }
690
+ const rowValues = rows.map((line) => line.map((entry) => entry.value));
691
+ this._tagRows = rowValues.slice(0, -1);
692
+ this._lastTagRow = rowValues.slice(-1)[0];
693
+ };
694
+ moveTagFocusTo_fn = function(index) {
695
+ if (index === null) {
696
+ this._input.focus();
697
+ } else {
698
+ this.shadowRoot.querySelector(`[data-index="${index}"]`)?.focus();
309
699
  }
310
- if (end !== void 0) {
311
- this.end = end;
700
+ };
701
+ nextTagIndexLeft_fn = function(index) {
702
+ if (!this.values.length) {
703
+ return null;
312
704
  }
313
- __privateSet(this, _isInternalValueUpdate, false);
314
- if (emitEvents) {
315
- if (start !== void 0) {
316
- this.$emit("input:start");
705
+ for (let i = index - 1; i >= 0; i--) {
706
+ if (!this._isTagDisabled(this.values[i])) {
707
+ return i;
317
708
  }
318
- if (end !== void 0) {
319
- this.$emit("input:end");
709
+ }
710
+ return null;
711
+ };
712
+ nextTagIndexRight_fn = function(index) {
713
+ if (!this.values.length) {
714
+ return null;
715
+ }
716
+ for (let i = index + 1; i < this.values.length; i++) {
717
+ if (!this._isTagDisabled(this.values[i])) {
718
+ return i;
320
719
  }
321
- this.$emit("input");
322
- this.$emit("change");
323
- this.dirtyValue = true;
324
720
  }
325
- __privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
721
+ return null;
326
722
  };
327
- applyStep_fn = function(thumb, direction) {
328
- __privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
329
- [thumb]: __privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, Number(this[thumb]) + direction * this.step).toString()
330
- });
723
+ nextTagIndexForRemoved_fn = function(index) {
724
+ return __privateMethod(this, _SearchableSelect_instances, nextTagIndexRight_fn).call(this, index - 1) ?? __privateMethod(this, _SearchableSelect_instances, nextTagIndexLeft_fn).call(this, index);
725
+ };
726
+ // --- Form handling ---
727
+ determineInitialValues_fn = function() {
728
+ return this.initialValues.length ? this.initialValues : this.initialValue ? [this.initialValue] : [];
331
729
  };
332
730
  updateFormValue_fn = function() {
333
731
  if (!this.name) {
334
732
  this.setFormValue(null);
335
733
  } else {
336
734
  const formData = new FormData();
337
- formData.append(this.name, this.start);
338
- formData.append(this.name, this.end);
735
+ for (const value of this.values) {
736
+ formData.append(this.name, value);
737
+ }
339
738
  this.setFormValue(formData);
340
739
  }
341
740
  };
342
- thumbs_get = function() {
343
- return {
344
- start: this._startThumbEl,
345
- end: this._endThumbEl
346
- };
347
- };
348
- thumbConstraints_get = function() {
349
- return {
350
- start: { min: this.min, max: this.endAsNumber },
351
- end: { min: this.startAsNumber, max: this.max }
352
- };
353
- };
354
- getThumbId_fn = function(thumb) {
355
- return thumb === this._startThumbEl ? "start" : "end";
356
- };
357
- getThumbIdFromEvent_fn = function(e) {
358
- return __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, e.target);
359
- };
360
- updateThumbPositions_fn = function() {
361
- const startOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.startAsNumber);
362
- const endOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.endAsNumber);
363
- const [dirProp, dimProp] = this.orientation === aria.Orientation.horizontal ? ["right", "width"] : ["bottom", "height"];
364
- const transition = `transition: ${this._draggingThumb ? "none" : "all 0.2s ease"};`;
365
- this._startThumbCss = `${dirProp}: ${startOffsetPct}%; ${transition}`;
366
- this._endThumbCss = `${dirProp}: ${endOffsetPct}%; ${transition}`;
367
- this._selectedRangeCss = `${dirProp}: ${endOffsetPct}%; ${dimProp}: ${startOffsetPct - endOffsetPct}%; ${transition}`;
368
- };
369
- thumbTrackEndOffset_fn = function(value) {
370
- return (1 - slider_template.inverseLerp(this.min, this.max, value)) * 100;
371
- };
372
- calculateValueFromMouseEvent_fn = function(e) {
373
- const trackClientRect = this._trackEl.getBoundingClientRect();
374
- const [minPos, maxPos, valuePos] = this.orientation === aria.Orientation.horizontal ? [
375
- this._trackEl.clientLeft,
376
- this._trackEl.clientWidth,
377
- e.pageX - document.documentElement.scrollLeft - this.getBoundingClientRect().left
378
- ] : [
379
- trackClientRect.top,
380
- trackClientRect.bottom,
381
- e.pageY - document.documentElement.scrollTop
382
- ];
383
- return slider_template.lerp(this.min, this.max, slider_template.inverseLerp(minPos, maxPos, valuePos));
384
- };
385
- roundToNearestStep_fn = function(thumb, value) {
386
- return numbers.limit(
387
- __privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min,
388
- __privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max,
389
- slider_template.roundToStepValue(value - this.min, this.step) + this.min
390
- );
741
+ _resizeObserver = new WeakMap();
742
+ __decorateClass$1([
743
+ defineVividComponent.attr
744
+ ], SearchableSelect.prototype, "appearance", 2);
745
+ __decorateClass$1([
746
+ defineVividComponent.attr
747
+ ], SearchableSelect.prototype, "shape", 2);
748
+ __decorateClass$1([
749
+ defineVividComponent.attr({ mode: "boolean", attribute: "fixed-dropdown" })
750
+ ], SearchableSelect.prototype, "fixedDropdown", 2);
751
+ __decorateClass$1([
752
+ defineVividComponent.attr
753
+ ], SearchableSelect.prototype, "placeholder", 2);
754
+ __decorateClass$1([
755
+ defineVividComponent.attr({ mode: "boolean" })
756
+ ], SearchableSelect.prototype, "open", 2);
757
+ __decorateClass$1([
758
+ defineVividComponent.attr({ mode: "boolean" })
759
+ ], SearchableSelect.prototype, "multiple", 2);
760
+ __decorateClass$1([
761
+ defineVividComponent.attr({ attribute: "external-tags", mode: "boolean" })
762
+ ], SearchableSelect.prototype, "externalTags", 2);
763
+ __decorateClass$1([
764
+ defineVividComponent.attr({ attribute: "max-lines", converter: defineVividComponent.nullableNumberConverter })
765
+ ], SearchableSelect.prototype, "maxLines", 2);
766
+ __decorateClass$1([
767
+ defineVividComponent.observable
768
+ ], SearchableSelect.prototype, "values", 2);
769
+ __decorateClass$1([
770
+ defineVividComponent.observable
771
+ ], SearchableSelect.prototype, "initialValues", 2);
772
+ __decorateClass$1([
773
+ defineVividComponent.observable
774
+ ], SearchableSelect.prototype, "_input", 2);
775
+ __decorateClass$1([
776
+ defineVividComponent.observable
777
+ ], SearchableSelect.prototype, "_inputValue", 2);
778
+ __decorateClass$1([
779
+ defineVividComponent.observable
780
+ ], SearchableSelect.prototype, "_slottedOptions", 2);
781
+ __decorateClass$1([
782
+ defineVividComponent.observable
783
+ ], SearchableSelect.prototype, "_filteredOptions", 2);
784
+ __decorateClass$1([
785
+ defineVividComponent.observable
786
+ ], SearchableSelect.prototype, "_filteredEnabledOptions", 2);
787
+ __decorateClass$1([
788
+ defineVividComponent.observable
789
+ ], SearchableSelect.prototype, "_highlightedOptionIndex", 2);
790
+ __decorateClass$1([
791
+ defineVividComponent.observable
792
+ ], SearchableSelect.prototype, "_contentArea", 2);
793
+ __decorateClass$1([
794
+ defineVividComponent.observable
795
+ ], SearchableSelect.prototype, "_numElidedTags", 2);
796
+ __decorateClass$1([
797
+ defineVividComponent.observable
798
+ ], SearchableSelect.prototype, "_tagRows", 2);
799
+ __decorateClass$1([
800
+ defineVividComponent.observable
801
+ ], SearchableSelect.prototype, "_lastTagRow", 2);
802
+ __decorateClass$1([
803
+ defineVividComponent.observable
804
+ ], SearchableSelect.prototype, "_listbox", 2);
805
+ __decorateClass$1([
806
+ defineVividComponent.attr({ mode: "boolean" })
807
+ ], SearchableSelect.prototype, "clearable", 2);
808
+ __decorateClass$1([
809
+ defineVividComponent.observable
810
+ ], SearchableSelect.prototype, "_changeDescription", 2);
811
+ __decorateClass$1([
812
+ defineVividComponent.observable
813
+ ], SearchableSelect.prototype, "_anchor", 2);
814
+ SearchableSelect = __decorateClass$1([
815
+ formElements.errorText,
816
+ formElements.formElements
817
+ ], SearchableSelect);
818
+ applyMixinsWithObservables.applyMixinsWithObservables(
819
+ SearchableSelect,
820
+ affix.AffixIconWithTrailing,
821
+ formElements.FormElementHelperText,
822
+ formElements.FormElementSuccessText,
823
+ localized.Localized
824
+ );
825
+
826
+ var __defProp = Object.defineProperty;
827
+ var __decorateClass = (decorators, target, key, kind) => {
828
+ var result = void 0 ;
829
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
830
+ if (decorator = decorators[i])
831
+ result = (decorator(target, key, result) ) || result;
832
+ if (result) __defProp(target, key, result);
833
+ return result;
391
834
  };
392
- _isNonVisibleFocus = new WeakMap();
393
- focusThumbNonVisibly_fn = function(thumb) {
394
- __privateSet(this, _isNonVisibleFocus, true);
395
- thumb.focus();
396
- __privateSet(this, _isNonVisibleFocus, false);
397
- };
398
- // --- Event handling ---
399
- registerThumbListeners_fn = function() {
400
- for (const thumb of ["start", "end"]) {
401
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("keydown", __privateGet(this, _onThumbKeydown));
402
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
403
- "mousedown",
404
- __privateGet(this, _onThumbMousedown),
405
- { passive: true }
406
- );
407
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
408
- "touchstart",
409
- __privateGet(this, _onThumbMousedown),
410
- { passive: true }
411
- );
412
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseover", __privateGet(this, _onMouseOver), {
413
- passive: true
414
- });
415
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseout", __privateGet(this, _onMouseOut), {
416
- passive: true
835
+ class OptionTag extends foundationElement.FoundationElement {
836
+ constructor() {
837
+ super(...arguments);
838
+ this.removable = false;
839
+ this.disabled = false;
840
+ this.hasIconPlaceholder = false;
841
+ }
842
+ _onClickRemove() {
843
+ this.$emit("remove", void 0, {
844
+ bubbles: false
417
845
  });
418
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("focus", __privateGet(this, _onThumbFocus));
419
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("blur", __privateGet(this, _onThumbBlur));
420
846
  }
421
- };
422
- unregisterThumbListeners_fn = function() {
423
- for (const thumb of ["start", "end"]) {
424
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("keydown", __privateGet(this, _onThumbKeydown));
425
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
426
- "mousedown",
427
- __privateGet(this, _onThumbMousedown)
428
- );
429
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
430
- "touchstart",
431
- __privateGet(this, _onThumbMousedown)
432
- );
433
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseover", __privateGet(this, _onMouseOver));
434
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseout", __privateGet(this, _onMouseOut));
435
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("focus", __privateGet(this, _onThumbFocus));
436
- __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("blur", __privateGet(this, _onThumbBlur));
437
- }
438
- };
439
- _onThumbFocus = new WeakMap();
440
- _onThumbBlur = new WeakMap();
441
- _onMouseOver = new WeakMap();
442
- _onMouseOut = new WeakMap();
443
- _onThumbMousedown = new WeakMap();
444
- _onThumbKeydown = new WeakMap();
445
- registerDragHandlers_fn = function() {
446
- window.addEventListener("mousemove", __privateGet(this, _onDragMove), { passive: true });
447
- window.addEventListener("touchmove", __privateGet(this, _onDragMove), { passive: true });
448
- window.addEventListener("mouseup", __privateGet(this, _onDragEnd));
449
- window.addEventListener("touchend", __privateGet(this, _onDragEnd));
450
- window.document.addEventListener("mouseleave", __privateGet(this, _onDragEnd));
451
- };
452
- unregisterDragListeners_fn = function() {
453
- window.removeEventListener("mouseup", __privateGet(this, _onDragEnd));
454
- window.document.removeEventListener("mouseleave", __privateGet(this, _onDragEnd));
455
- window.removeEventListener("mousemove", __privateGet(this, _onDragMove));
456
- window.removeEventListener("touchmove", __privateGet(this, _onDragMove));
457
- window.removeEventListener("touchend", __privateGet(this, _onDragEnd));
458
- };
459
- _onDragMove = new WeakMap();
460
- _onDragEnd = new WeakMap();
461
- __decorateClass([
462
- index.observable
463
- ], RangeSlider.prototype, "start", 2);
464
- __decorateClass([
465
- index.attr({ mode: "fromView", attribute: "start" })
466
- ], RangeSlider.prototype, "initialStart", 2);
467
- __decorateClass([
468
- index.attr({ attribute: "current-start" })
469
- ], RangeSlider.prototype, "currentStart", 2);
470
- __decorateClass([
471
- index.observable
472
- ], RangeSlider.prototype, "end", 2);
473
- __decorateClass([
474
- index.attr({ mode: "fromView", attribute: "end" })
475
- ], RangeSlider.prototype, "initialEnd", 2);
476
- __decorateClass([
477
- index.attr({ attribute: "current-end" })
478
- ], RangeSlider.prototype, "currentEnd", 2);
479
- __decorateClass([
480
- index.attr({ converter: index.nullableNumberConverter })
481
- ], RangeSlider.prototype, "min", 2);
482
- __decorateClass([
483
- index.attr({ converter: index.nullableNumberConverter })
484
- ], RangeSlider.prototype, "max", 2);
485
- __decorateClass([
486
- index.attr({ converter: index.nullableNumberConverter })
487
- ], RangeSlider.prototype, "step", 2);
488
- __decorateClass([
489
- index.attr
490
- ], RangeSlider.prototype, "orientation", 2);
491
- __decorateClass([
492
- index.attr({ attribute: "aria-start-label" })
493
- ], RangeSlider.prototype, "ariaStartLabel", 2);
494
- __decorateClass([
495
- index.attr({ attribute: "aria-end-label" })
496
- ], RangeSlider.prototype, "ariaEndLabel", 2);
497
- __decorateClass([
498
- index.attr({ mode: "boolean" })
499
- ], RangeSlider.prototype, "markers", 2);
500
- __decorateClass([
501
- index.attr
502
- ], RangeSlider.prototype, "connotation", 2);
503
- __decorateClass([
504
- index.attr({ mode: "boolean" })
505
- ], RangeSlider.prototype, "pin", 2);
506
- __decorateClass([
507
- index.observable
508
- ], RangeSlider.prototype, "valueTextFormatter", 2);
509
- __decorateClass([
510
- index.observable
511
- ], RangeSlider.prototype, "_draggingThumb", 2);
847
+ }
512
848
  __decorateClass([
513
- index.observable
514
- ], RangeSlider.prototype, "_visiblyFocusedThumb", 2);
849
+ defineVividComponent.attr
850
+ ], OptionTag.prototype, "shape");
515
851
  __decorateClass([
516
- index.observable
517
- ], RangeSlider.prototype, "_hoveredThumb", 2);
852
+ defineVividComponent.attr
853
+ ], OptionTag.prototype, "label");
518
854
  __decorateClass([
519
- index.observable
520
- ], RangeSlider.prototype, "_startThumbCss", 2);
855
+ defineVividComponent.attr({ mode: "boolean" })
856
+ ], OptionTag.prototype, "removable");
521
857
  __decorateClass([
522
- index.observable
523
- ], RangeSlider.prototype, "_endThumbCss", 2);
858
+ defineVividComponent.attr({ mode: "boolean" })
859
+ ], OptionTag.prototype, "disabled");
524
860
  __decorateClass([
525
- index.observable
526
- ], RangeSlider.prototype, "_selectedRangeCss", 2);
527
- RangeSlider = __decorateClass([
528
- formElements.formElements
529
- ], RangeSlider);
530
- applyMixins.applyMixins(RangeSlider, localized.Localized);
861
+ defineVividComponent.observable
862
+ ], OptionTag.prototype, "hasIconPlaceholder");
863
+ applyMixins.applyMixins(OptionTag, localized.Localized);
531
864
 
532
- const getClasses = ({ disabled, connotation }) => classNames.classNames(
533
- "control",
534
- ["disabled", Boolean(disabled)],
535
- [`connotation-${connotation}`, Boolean(connotation)]
865
+ const getStateClasses = (x) => classNames.classNames(
866
+ ["disabled", x.disabled],
867
+ [`appearance-${x.appearance}`, Boolean(x.appearance)],
868
+ [`shape-${x.shape}`, Boolean(x.shape)],
869
+ ["error", Boolean(x.errorValidationMessage)],
870
+ ["success", !!x.successText]
536
871
  );
537
- const getThumbClassesFor = (thumb) => ({ _visiblyFocusedThumb }) => classNames.classNames("thumb-container", [
538
- "focus-visible",
539
- _visiblyFocusedThumb === thumb
540
- ]);
541
- const RangeSliderTemplate = (context) => {
542
- const popupTag = context.tagFor(definition.Popup);
543
- return index.html` <template
544
- @mousedown="${(x, c) => x._onMouseDown(c.event)}"
545
- >
546
- <div class="${getClasses} ${(x) => x.orientation}">
547
- <div class="positioning-region">
548
- <div ${ref.ref("_trackEl")} class="track">
549
- <div class="track-start" style="${(x) => x._selectedRangeCss}"></div>
550
- ${when.when(
551
- (x) => x.markers,
552
- index.html`${(x) => slider_template.getMarkersTemplate(
553
- x.orientation === aria.Orientation.horizontal,
554
- Math.floor((x.max - x.min) / x.step)
555
- )}`
872
+ function renderLabel() {
873
+ return defineVividComponent.html`
874
+ <label for="control" class="label" id="label"> ${(x) => x.label} </label>
875
+ `;
876
+ }
877
+ const tagTemplateFactory = (context, getComponent) => {
878
+ const optionTagTag = context.tagFor(OptionTag);
879
+ return defineVividComponent.html`
880
+ <div class="tag-wrapper">
881
+ <${optionTagTag}
882
+ class="tag"
883
+ tabindex="-1"
884
+ data-index="${(x, c) => getComponent(c).values.indexOf(x)}"
885
+ removable
886
+ :label="${(x, c) => getComponent(c)._tagLabelForValue(x)}"
887
+ :shape="${(_, c) => getComponent(c).shape}"
888
+ ?disabled="${(x, c) => getComponent(c)._isTagDisabled(x)}"
889
+ @remove="${(x, c) => getComponent(c)._onTagRemoved(x)}"
890
+ @keydown="${(_, c) => getComponent(c)._onTagKeydown(c.event)}"
891
+ @mousedown="${() => false}">
892
+ <slot slot="icon" name="${(x, c) => getComponent(c)._tagIconSlotName(x)}"></slot>
893
+ </${optionTagTag}>
894
+ </div>
895
+ `;
896
+ };
897
+ const elidedTagTemplateFactory = (context, getComponent) => {
898
+ const optionTagTag = context.tagFor(OptionTag);
899
+ return defineVividComponent.html`
900
+ <${optionTagTag}
901
+ class="tag"
902
+ tabindex="-1"
903
+ :label="${(x, c) => getComponent(x, c)._numElidedTags.toString()}"
904
+ :shape="${(x, c) => getComponent(x, c).shape}"
905
+ ?disabled="${(x, c) => getComponent(x, c).disabled}"
906
+ @mousedown="${() => false}">
907
+ </${optionTagTag}>
908
+ `;
909
+ };
910
+ function renderFieldset(context) {
911
+ const buttonTag = context.tagFor(definition$1.Button);
912
+ const affixIconTemplate = affix.affixIconTemplateFactory(context);
913
+ const chevronTemplate = definition$1.chevronTemplateFactory(context);
914
+ const tagTemplate = tagTemplateFactory(context, (c) => c.parent);
915
+ const nestedTagTemplate = tagTemplateFactory(
916
+ context,
917
+ (c) => c.parentContext.parent
918
+ );
919
+ const elidedTagTemplate = elidedTagTemplateFactory(context, (x, _) => x);
920
+ const nestedElidedTagTemplate = elidedTagTemplateFactory(
921
+ context,
922
+ (_, c) => c.parent
923
+ );
924
+ return defineVividComponent.html`
925
+ <div
926
+ class="fieldset ${getStateClasses}"
927
+ @click="${(x, c) => x._onFieldsetClick(c.event)}"
928
+ ${ref.ref("_anchor")}
929
+ >
930
+ ${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
931
+ <div class="content-area" ${ref.ref("_contentArea")}>
932
+ ${repeat.repeat(
933
+ (x) => x._tagRows,
934
+ defineVividComponent.html`
935
+ <div class="tag-row">
936
+ ${when.when(
937
+ (_, c) => c.isFirst && c.parent._numElidedTags,
938
+ nestedElidedTagTemplate
939
+ )}
940
+ ${repeat.repeat((x) => x, nestedTagTemplate)}
941
+ </div>
942
+ `,
943
+ { positioning: true }
556
944
  )}
557
- </div>
558
945
  <div
559
- ${ref.ref("_startThumbEl")}
560
- class="${getThumbClassesFor("start")}"
561
- style="${(x) => x._startThumbCss}"
562
- role="slider"
563
- tabindex="${(x) => x.disabled ? null : 0}"
564
- aria-label="${(x) => x.ariaStartLabel || x.locale.rangeSlider.startThumbLabel}"
565
- aria-valuetext="${(x) => x.valueTextFormatter(x.start)}"
566
- aria-valuenow="${(x) => x.start}"
567
- aria-valuemin="${(x) => x.min}"
568
- aria-valuemax="${(x) => x.end}"
569
- aria-disabled="${(x) => x.disabled}"
570
- aria-orientation="${(x) => x.orientation}"
571
- ></div>
572
- ${when.when(
573
- (x) => x.pin,
574
- index.html`<${popupTag}
575
- class="popup"
576
- arrow
577
- alternate
578
- :anchor="${(x) => x._startThumbEl}"
579
- :open=${(x) => x._isThumbPopupOpen("start")}
580
- :placementStrategy=${(x) => x.orientation === aria.Orientation.horizontal ? definition.PlacementStrategy.AutoPlacementHorizontal : definition.PlacementStrategy.AutoPlacementVertical}
581
- animation-frame
582
- exportparts="vvd-theme-alternate"
583
- aria-hidden="true"
946
+ class="tag-row ${(x) => classNames.classNames([
947
+ "contains-only-input",
948
+ x._tagRows.length > 0 && x._lastTagRow.length === 0
949
+ ])}"
584
950
  >
585
- <div class="tooltip">${(x) => x.valueTextFormatter(x.start)}</div>
586
- </${popupTag}>`
951
+ ${when.when(
952
+ (x) => x._tagRows.length === 0 && x._numElidedTags,
953
+ elidedTagTemplate
587
954
  )}
588
- <div
589
- ${ref.ref("_endThumbEl")}
590
- class="${getThumbClassesFor("end")}"
591
- style="${(x) => x._endThumbCss}"
592
- role="slider"
593
- tabindex="${(x) => x.disabled ? null : 0}"
594
- aria-label="${(x) => x.ariaEndLabel || x.locale.rangeSlider.endThumbLabel}"
595
- aria-valuetext="${(x) => x.valueTextFormatter(x.end)}"
596
- aria-valuenow="${(x) => x.end}"
597
- aria-valuemin="${(x) => x.start}"
598
- aria-valuemax="${(x) => x.max}"
599
- aria-disabled="${(x) => x.disabled}"
600
- aria-orientation="${(x) => x.orientation}"
601
- ></div>
602
- ${when.when(
603
- (x) => x.pin,
604
- index.html`<${popupTag}
955
+ ${repeat.repeat((x) => x._lastTagRow, tagTemplate)}
956
+ <input
957
+ id="control"
958
+ class="control"
959
+ autofocus
960
+ autocomplete="off"
961
+ aria-autocomplete="list"
962
+ aria-expanded="${(x) => x.open}"
963
+ aria-haspopup="listbox"
964
+ aria-controls="listbox"
965
+ placeholder="${(x) => x.multiple && x.values.length ? "" : x.placeholder}"
966
+ role="combobox"
967
+ type="text"
968
+ ?disabled="${(x) => x.disabled}"
969
+ :value="${(x) => x._inputValue}"
970
+ @input="${(x, c) => x._onInputInput(c.event)}"
971
+ @focus="${(x, c) => x._onInputFocus(c.event)}"
972
+ @blur="${(x, c) => x._onInputBlur(c.event)}"
973
+ @keydown="${(x, c) => x._onInputKeydown(c.event)}"
974
+ ${ref.ref("_input")}
975
+ />
976
+ </div>
977
+ </div>
978
+ <slot name="meta"></slot>
979
+ ${when.when(
980
+ (x) => x._shouldShowClearButton,
981
+ defineVividComponent.html`<${buttonTag}
982
+ aria-label="${(x) => x.locale.searchableSelect.clearButtonLabel}"
983
+ @click="${(x) => x._onClearButtonClick()}"
984
+ @mousedown="${() => false}"
985
+ ?disabled="${(x) => x.disabled}"
986
+ :shape="${(x) => x.shape}"
987
+ size="super-condensed"
988
+ icon="close-line"
989
+ appearance="ghost-light"
990
+ tabindex="-1"
991
+ ></${buttonTag}>`
992
+ )}
993
+ ${chevronTemplate}
994
+ </div>
995
+ `;
996
+ }
997
+ function renderControl(context) {
998
+ const popupTag = context.tagFor(definition.Popup);
999
+ return defineVividComponent.html`
1000
+ ${when.when((x) => x.label, renderLabel())}
1001
+ <span aria-live="assertive" aria-relevant="text" class="visually-hidden">
1002
+ ${(x) => x._changeDescription}
1003
+ </span>
1004
+ <div>
1005
+ ${renderFieldset(context)}
1006
+ <div class="popup-wrapper">
1007
+ <${popupTag}
1008
+ :anchor="${(x) => x._anchor}"
1009
+ :open="${(x) => x.open}"
605
1010
  class="popup"
606
- arrow
607
- alternate
608
- :anchor="${(x) => x._endThumbEl}"
609
- :open=${(x) => x._isThumbPopupOpen("end")}
610
- :placementStrategy=${(x) => x.orientation === aria.Orientation.horizontal ? definition.PlacementStrategy.AutoPlacementHorizontal : definition.PlacementStrategy.AutoPlacementVertical}
611
- animation-frame
612
- exportparts="vvd-theme-alternate"
613
- aria-hidden="true"
614
- >
615
- <div class="tooltip">${(x) => x.valueTextFormatter(x.end)}</div>
616
- </${popupTag}>`
1011
+ placement="bottom-start"
1012
+ strategy="${(x) => x.fixedDropdown ? "fixed" : "absolute"}">
1013
+ <div
1014
+ class="listbox"
1015
+ role="listbox"
1016
+ aria-multiselectable="${(x) => x.multiple}"
1017
+ aria-required="${(x) => x.required}"
1018
+ ${ref.ref("_listbox")}
1019
+ @click="${(x, c) => x._onListboxClick(c.event)}"
1020
+ @mousedown="${() => false}"
1021
+ >
1022
+ <slot
1023
+ ${slotted.slotted({
1024
+ filter: listbox.Listbox.slottedOptionFilter,
1025
+ flatten: true,
1026
+ property: "_slottedOptions"
1027
+ })}>
1028
+ </slot>
1029
+ ${when.when(
1030
+ (x) => x._filteredOptions.length === 0,
1031
+ defineVividComponent.html`<div class="empty-message">
1032
+ ${when.when(
1033
+ (x) => x._inputValue === "",
1034
+ defineVividComponent.html`<slot name="no-options">
1035
+ ${(x) => x.locale.searchableSelect.noOptionsMessage}
1036
+ </slot>`
1037
+ )}
1038
+ ${when.when(
1039
+ (x) => x._inputValue !== "",
1040
+ defineVividComponent.html`<slot name="no-matches">
1041
+ ${(x) => x.locale.searchableSelect.noMatchesMessage}
1042
+ </slot>`
1043
+ )}
1044
+ </div>`
617
1045
  )}
1046
+ </div>
1047
+ </${popupTag}>
618
1048
  </div>
619
1049
  </div>
620
- </template>`;
1050
+ `;
1051
+ }
1052
+ const SearchableSelectTemplate = (context) => {
1053
+ const optionTagTag = context.tagFor(OptionTag);
1054
+ return defineVividComponent.html`
1055
+ <template :_optionTagTagName="${() => optionTagTag}">
1056
+ <div class="control-wrapper">
1057
+ ${renderControl(context)} ${formElements.getFeedbackTemplate(context)}
1058
+ </div>
1059
+ </template>
1060
+ `;
1061
+ };
1062
+
1063
+ const getClasses = ({ shape, disabled, removable }) => classNames.classNames(
1064
+ "base",
1065
+ ["disabled", disabled],
1066
+ ["removable", removable],
1067
+ [`shape-${shape}`, Boolean(shape)]
1068
+ );
1069
+ function renderRemoveButton(iconTag) {
1070
+ return defineVividComponent.html`
1071
+ <span
1072
+ class="remove-button"
1073
+ aria-label="${(x) => x.locale.searchableSelect.removeTagButtonLabel(x.label)}"
1074
+ role="button"
1075
+ tabindex="${(x) => x.disabled ? null : 0}"
1076
+ @click="${(x) => x._onClickRemove()}"
1077
+ >
1078
+ <${iconTag} name="close-line"></${iconTag}>
1079
+ </span>
1080
+ `;
1081
+ }
1082
+ const optionTagTemplate = (context) => {
1083
+ const iconTag = context.tagFor(definition$2.Icon);
1084
+ return defineVividComponent.html`<span class="${getClasses}" aria-disabled="${(x) => x.disabled}">
1085
+ <slot name="icon" aria-hidden="true">
1086
+ ${when.when(
1087
+ (x) => x.hasIconPlaceholder,
1088
+ defineVividComponent.html`<div class="icon-placeholder"></div>`
1089
+ )}
1090
+ </slot>
1091
+ ${when.when(
1092
+ (x) => x.label,
1093
+ (x) => defineVividComponent.html`<span class="label">${x.label}</span>`
1094
+ )}
1095
+ ${when.when((x) => x.removable, renderRemoveButton(iconTag))}
1096
+ </span>`;
621
1097
  };
622
1098
 
623
- const rangeSliderDefinition = RangeSlider.compose({
624
- baseName: "range-slider",
625
- template: RangeSliderTemplate,
626
- styles,
627
- shadowOptions: {
628
- delegatesFocus: true
629
- }
630
- });
631
- const rangeSliderRegistries = [
632
- ...definition.popupRegistries,
633
- rangeSliderDefinition()
634
- ];
635
- const registerRangeSlider = index.registerFactory(rangeSliderRegistries);
1099
+ const optionTagDefinition = defineVividComponent.defineVividComponent(
1100
+ "option-tag",
1101
+ OptionTag,
1102
+ optionTagTemplate,
1103
+ [definition$2.iconDefinition],
1104
+ {
1105
+ styles: [optionTagStyles],
1106
+ shadowOptions: {
1107
+ delegatesFocus: true
1108
+ }
1109
+ }
1110
+ );
1111
+ const searchableSelectDefinition = defineVividComponent.defineVividComponent(
1112
+ "searchable-select",
1113
+ SearchableSelect,
1114
+ SearchableSelectTemplate,
1115
+ [definition$1.buttonDefinition, definition.popupDefinition, definition$2.iconDefinition, optionTagDefinition],
1116
+ {
1117
+ styles,
1118
+ shadowOptions: {
1119
+ delegatesFocus: true
1120
+ }
1121
+ }
1122
+ );
1123
+ const registerSearchableSelect = defineVividComponent.createRegisterFunction(
1124
+ searchableSelectDefinition
1125
+ );
636
1126
 
637
- exports.rangeSliderDefinition = rangeSliderDefinition;
638
- exports.rangeSliderRegistries = rangeSliderRegistries;
639
- exports.registerRangeSlider = registerRangeSlider;
1127
+ exports.registerSearchableSelect = registerSearchableSelect;