@vonage/vivid 4.13.0 → 4.14.1

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