@vonage/vivid 4.16.2 → 4.18.0

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