@vonage/vivid 5.23.1 → 5.25.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 (522) hide show
  1. package/README.md +1 -1
  2. package/accordion/index.cjs +1 -1
  3. package/accordion/index.js +1 -1
  4. package/accordion-item/index.cjs +1 -1
  5. package/accordion-item/index.js +1 -1
  6. package/audio-player/index.cjs +2 -2
  7. package/audio-player/index.js +3 -3
  8. package/avatar/index.cjs +10 -10
  9. package/avatar/index.js +4 -3
  10. package/badge/index.cjs +1 -1
  11. package/badge/index.js +1 -1
  12. package/breadcrumb-item/index.cjs +9 -5
  13. package/breadcrumb-item/index.js +11 -6
  14. package/bundled/affix.cjs +1 -1
  15. package/bundled/affix.js +1 -1
  16. package/bundled/definition10.cjs +2 -1
  17. package/bundled/definition10.js +3 -2
  18. package/bundled/definition11.cjs +4 -4
  19. package/bundled/definition11.js +4 -3
  20. package/bundled/definition12.cjs +1 -1
  21. package/bundled/definition12.js +1 -0
  22. package/bundled/definition15.cjs +8 -7
  23. package/bundled/definition15.js +27 -24
  24. package/bundled/definition17.cjs +7 -7
  25. package/bundled/definition17.js +22 -109
  26. package/bundled/definition18.cjs +12 -83
  27. package/bundled/definition18.js +20 -426
  28. package/bundled/definition19.cjs +87 -7
  29. package/bundled/definition19.js +433 -16
  30. package/bundled/definition20.cjs +7 -37
  31. package/bundled/definition20.js +17 -172
  32. package/bundled/definition21.cjs +35 -27
  33. package/bundled/definition21.js +155 -154
  34. package/bundled/definition22.cjs +29 -6
  35. package/bundled/definition22.js +172 -20
  36. package/bundled/definition23.cjs +6 -12
  37. package/bundled/definition23.js +17 -32
  38. package/bundled/definition24.cjs +12 -39
  39. package/bundled/definition24.js +33 -67
  40. package/bundled/definition25.cjs +44 -0
  41. package/bundled/definition25.js +81 -0
  42. package/bundled/definition3.cjs +5 -5
  43. package/bundled/definition3.js +10 -40
  44. package/bundled/definition4.cjs +6 -6
  45. package/bundled/definition4.js +4 -3
  46. package/bundled/definition6.cjs +11 -11
  47. package/bundled/definition6.js +4 -3
  48. package/bundled/definition9.cjs +12 -6
  49. package/bundled/definition9.js +66 -43
  50. package/bundled/extractOptions.cjs +1 -0
  51. package/bundled/extractOptions.js +11 -0
  52. package/bundled/icon.cjs +1 -0
  53. package/bundled/icon.js +34 -0
  54. package/bundled/listbox.cjs +1 -1
  55. package/bundled/listbox.js +28 -12
  56. package/bundled/mixins.cjs +8 -8
  57. package/bundled/mixins.js +4 -3
  58. package/bundled/optgroup.cjs +1 -0
  59. package/bundled/optgroup.js +27 -0
  60. package/bundled/option.cjs +1 -0
  61. package/bundled/option.js +93 -0
  62. package/bundled/render-in-light-dom.cjs +1 -1
  63. package/bundled/render-in-light-dom.js +16 -19
  64. package/bundled/vivid-element.cjs +1 -1
  65. package/bundled/vivid-element.js +9 -1
  66. package/card/index.cjs +22 -22
  67. package/card/index.js +4 -3
  68. package/color-picker/index.cjs +18 -18
  69. package/color-picker/index.js +4 -3
  70. package/combobox/definition.cjs +1 -1
  71. package/combobox/definition.js +1 -1
  72. package/combobox/index.cjs +7 -7
  73. package/combobox/index.js +31 -21
  74. package/country/definition.cjs +1 -1
  75. package/country/definition.js +1 -1
  76. package/country/index.cjs +1 -1
  77. package/country/index.js +1 -1
  78. package/country-group/definition.cjs +1 -1
  79. package/country-group/definition.js +1 -1
  80. package/country-group/index.cjs +1 -1
  81. package/country-group/index.js +2 -2
  82. package/custom-elements.json +8438 -7866
  83. package/data-grid/definition.cjs +1 -1
  84. package/data-grid/definition.js +1 -1
  85. package/data-grid/index.cjs +26 -26
  86. package/data-grid/index.js +9 -8
  87. package/date-picker/definition.cjs +1 -1
  88. package/date-picker/definition.js +1 -1
  89. package/date-picker/index.cjs +1 -1
  90. package/date-picker/index.js +1 -1
  91. package/date-range-picker/definition.cjs +1 -1
  92. package/date-range-picker/definition.js +1 -1
  93. package/date-range-picker/index.cjs +1 -1
  94. package/date-range-picker/index.js +1 -1
  95. package/date-time-picker/definition.cjs +1 -1
  96. package/date-time-picker/definition.js +1 -1
  97. package/date-time-picker/index.cjs +1 -1
  98. package/date-time-picker/index.js +1 -1
  99. package/dial-pad/definition.cjs +1 -1
  100. package/dial-pad/definition.js +1 -1
  101. package/dial-pad/index.cjs +7 -7
  102. package/dial-pad/index.js +124 -54
  103. package/dialog/definition.cjs +1 -1
  104. package/dialog/definition.js +1 -1
  105. package/dialog/index.cjs +14 -14
  106. package/dialog/index.js +4 -3
  107. package/divider/definition.cjs +1 -1
  108. package/divider/definition.js +1 -1
  109. package/divider/index.cjs +1 -1
  110. package/divider/index.js +1 -1
  111. package/empty-state/definition.cjs +1 -1
  112. package/empty-state/definition.js +1 -1
  113. package/empty-state/index.cjs +3 -3
  114. package/empty-state/index.js +4 -3
  115. package/fab/definition.cjs +1 -1
  116. package/fab/definition.js +1 -1
  117. package/file-picker/definition.cjs +1 -1
  118. package/file-picker/definition.js +1 -1
  119. package/file-picker/index.cjs +7 -7
  120. package/file-picker/index.js +4 -3
  121. package/flag/definition.cjs +1 -1
  122. package/flag/definition.js +1 -1
  123. package/header/definition.cjs +1 -1
  124. package/header/definition.js +1 -1
  125. package/header/index.cjs +3 -3
  126. package/header/index.js +3 -3
  127. package/icon/definition.cjs +2 -1
  128. package/icon/definition.js +2 -1
  129. package/index.cjs +209 -198
  130. package/index.js +59 -54
  131. package/kbd-key/definition.cjs +1 -1
  132. package/kbd-key/definition.js +1 -1
  133. package/kbd-shortcut/definition.cjs +1 -1
  134. package/kbd-shortcut/definition.js +1 -1
  135. package/layout/definition.cjs +1 -1
  136. package/layout/definition.js +1 -1
  137. package/lib/accordion-item/accordion-item.d.ts +3 -1
  138. package/lib/action-group/action-group.d.ts +1 -1
  139. package/lib/alert/alert.d.ts +2 -2
  140. package/lib/audio-player/audio-player.d.ts +1 -1
  141. package/lib/avatar/avatar.d.ts +1 -1
  142. package/lib/badge/badge.d.ts +1 -1
  143. package/lib/banner/banner.d.ts +3 -3
  144. package/lib/breadcrumb/breadcrumb.d.ts +1 -1
  145. package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
  146. package/lib/button/button.d.ts +3 -3
  147. package/lib/calendar-event/calendar-event.d.ts +1 -1
  148. package/lib/card/card.d.ts +1 -1
  149. package/lib/checkbox/checkbox.d.ts +6 -6
  150. package/lib/color-picker/color-picker.d.ts +7 -7
  151. package/lib/combobox/combobox.d.ts +8 -8
  152. package/lib/components.d.ts +2 -0
  153. package/lib/country-group/country-group.d.ts +2 -2
  154. package/lib/data-grid/data-grid-cell.d.ts +4 -3
  155. package/lib/data-grid/data-grid-row.d.ts +3 -2
  156. package/lib/data-grid/data-grid.options.d.ts +5 -0
  157. package/lib/date-picker/date-picker.d.ts +8 -8
  158. package/lib/date-range-picker/date-range-picker.d.ts +4 -4
  159. package/lib/date-time-picker/date-time-picker.d.ts +8 -8
  160. package/lib/dial-pad/dial-pad.d.ts +2 -2
  161. package/lib/dialog/dialog.d.ts +2 -2
  162. package/lib/divider/divider.d.ts +1 -1
  163. package/lib/fab/fab.d.ts +1 -1
  164. package/lib/file-picker/file-picker.d.ts +7 -7
  165. package/lib/header/header.d.ts +1 -1
  166. package/lib/listbox/definition.d.ts +3 -0
  167. package/lib/listbox/index.d.ts +1 -0
  168. package/lib/listbox/listbox.d.ts +1302 -0
  169. package/lib/listbox/listbox.template.d.ts +3 -0
  170. package/lib/listbox/variations.browser-spec.d.ts +1 -0
  171. package/lib/menu/menu.d.ts +2 -3
  172. package/lib/menu-item/menu-item.d.ts +3 -3
  173. package/lib/nav/nav.d.ts +1 -1
  174. package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
  175. package/lib/nav-item/nav-item.d.ts +2 -2
  176. package/lib/note/note.d.ts +1 -1
  177. package/lib/number-field/number-field.d.ts +9 -10
  178. package/lib/optgroup/definition.d.ts +3 -0
  179. package/lib/optgroup/index.d.ts +1 -0
  180. package/lib/optgroup/optgroup.d.ts +430 -0
  181. package/lib/optgroup/optgroup.template.d.ts +2 -0
  182. package/lib/optgroup/variations.browser-spec.d.ts +1 -0
  183. package/lib/option/option.d.ts +2 -2
  184. package/lib/pagination/pagination.d.ts +1 -1
  185. package/lib/popover/popover.d.ts +2 -2
  186. package/lib/progress/progress.d.ts +1 -1
  187. package/lib/progress-ring/progress-ring.d.ts +1 -1
  188. package/lib/radio/radio.d.ts +3 -3
  189. package/lib/radio-group/radio-group.d.ts +1 -1
  190. package/lib/range-slider/range-slider.d.ts +3 -3
  191. package/lib/rich-text-editor/rich-text-editor.d.ts +1 -1
  192. package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
  193. package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -2
  194. package/lib/searchable-select/option-tag.d.ts +1 -1
  195. package/lib/searchable-select/searchable-select.d.ts +47 -47
  196. package/lib/select/select.d.ts +9 -9
  197. package/lib/selectable-box/selectable-box.d.ts +1 -1
  198. package/lib/simple-color-picker/simple-color-picker.d.ts +2 -2
  199. package/lib/slider/slider.d.ts +3 -3
  200. package/lib/split-button/split-button.d.ts +3 -3
  201. package/lib/status/status.d.ts +1 -1
  202. package/lib/switch/switch.d.ts +2 -2
  203. package/lib/tab/tab.d.ts +3 -3
  204. package/lib/tab-panel/tab-panel.d.ts +1 -1
  205. package/lib/table/table-cell.d.ts +1 -1
  206. package/lib/table/table-header-cell.d.ts +1 -1
  207. package/lib/table/table-row.d.ts +1 -1
  208. package/lib/table/table-sorting-button.d.ts +1 -1
  209. package/lib/tag/tag.d.ts +3 -3
  210. package/lib/tag-group/tag-group.d.ts +1 -1
  211. package/lib/tag-name-map.d.ts +3 -1
  212. package/lib/text-area/text-area.d.ts +8 -8
  213. package/lib/text-field/text-field.d.ts +10 -9
  214. package/lib/time-picker/time-picker.d.ts +4 -4
  215. package/lib/toggletip/toggletip.d.ts +3 -2
  216. package/lib/tooltip/tooltip.d.ts +3 -2
  217. package/lib/tree-item/tree-item.d.ts +2 -2
  218. package/lib/tree-view/tree-view.d.ts +1 -1
  219. package/lib/video-player/video-player.d.ts +1 -1
  220. package/listbox/definition.cjs +5 -0
  221. package/listbox/definition.js +2 -0
  222. package/listbox/index.cjs +11 -0
  223. package/listbox/index.js +540 -0
  224. package/menu/index.cjs +1 -1
  225. package/menu/index.js +1 -1
  226. package/menu-item/index.cjs +1 -1
  227. package/menu-item/index.js +1 -1
  228. package/nav/definition.cjs +1 -1
  229. package/nav/definition.js +1 -1
  230. package/nav-disclosure/definition.cjs +1 -1
  231. package/nav-disclosure/definition.js +1 -1
  232. package/nav-disclosure/index.cjs +4 -4
  233. package/nav-disclosure/index.js +4 -3
  234. package/nav-item/definition.cjs +1 -1
  235. package/nav-item/definition.js +1 -1
  236. package/note/definition.cjs +1 -1
  237. package/note/definition.js +1 -1
  238. package/number-field/definition.cjs +1 -1
  239. package/number-field/definition.js +1 -1
  240. package/number-field/index.cjs +1 -1
  241. package/number-field/index.js +1 -1
  242. package/optgroup/definition.cjs +6 -0
  243. package/optgroup/definition.js +3 -0
  244. package/optgroup/index.cjs +1 -0
  245. package/optgroup/index.js +4 -0
  246. package/option/definition.cjs +2 -1
  247. package/option/definition.js +2 -1
  248. package/package.json +9 -8
  249. package/pagination/definition.cjs +1 -1
  250. package/pagination/definition.js +1 -1
  251. package/platform-switch/definition.cjs +1 -1
  252. package/platform-switch/definition.js +1 -1
  253. package/popover/definition.cjs +1 -1
  254. package/popover/definition.js +1 -1
  255. package/popover/index.cjs +5 -5
  256. package/popover/index.js +4 -3
  257. package/progress/definition.cjs +1 -1
  258. package/progress/definition.js +1 -1
  259. package/radio/definition.cjs +1 -1
  260. package/radio/definition.js +1 -1
  261. package/radio-group/definition.cjs +1 -1
  262. package/radio-group/definition.js +1 -1
  263. package/range-slider/definition.cjs +1 -1
  264. package/range-slider/definition.js +1 -1
  265. package/rich-text-editor/definition.cjs +1 -1
  266. package/rich-text-editor/definition.js +1 -1
  267. package/rich-text-editor/index.cjs +13 -13
  268. package/rich-text-editor/index.js +26 -23
  269. package/rich-text-view/definition.cjs +1 -1
  270. package/rich-text-view/definition.js +1 -1
  271. package/searchable-select/definition.cjs +1 -1
  272. package/searchable-select/definition.js +1 -1
  273. package/searchable-select/index.cjs +23 -23
  274. package/searchable-select/index.js +67 -49
  275. package/select/definition.cjs +1 -1
  276. package/select/definition.js +1 -1
  277. package/select/index.cjs +1 -1
  278. package/select/index.js +1 -1
  279. package/selectable-box/definition.cjs +1 -1
  280. package/selectable-box/definition.js +1 -1
  281. package/shared/aria/delegates-aria.d.ts +1 -1
  282. package/shared/aria/host-semantics.d.ts +1 -1
  283. package/shared/color-picker/base-color-picker.d.ts +1 -1
  284. package/shared/feedback/feedback-message.d.ts +1 -1
  285. package/shared/feedback/mixins.d.ts +2 -2
  286. package/shared/foundation/button/button.d.ts +2 -2
  287. package/shared/foundation/form-associated/form-associated.d.ts +2 -2
  288. package/shared/foundation/listbox/extractOptions.d.ts +2 -0
  289. package/shared/foundation/listbox/listbox.d.ts +2 -0
  290. package/shared/listbox/commands.d.ts +17 -0
  291. package/shared/listbox/move.d.ts +6 -0
  292. package/shared/listbox/options.d.ts +12 -0
  293. package/shared/listbox/selection.d.ts +28 -0
  294. package/shared/listbox/state.d.ts +26 -0
  295. package/shared/listbox/typeahead.d.ts +8 -0
  296. package/shared/listbox/with-options-filter.d.ts +440 -0
  297. package/shared/listbox/with-options.d.ts +862 -0
  298. package/shared/patterns/affix.d.ts +2 -2
  299. package/shared/patterns/anchored.d.ts +2 -2
  300. package/shared/patterns/char-count/char-count.d.ts +1 -1
  301. package/shared/patterns/form-elements/form-element.d.ts +1 -1
  302. package/shared/patterns/form-elements/with-contextual-help.d.ts +1 -1
  303. package/shared/patterns/form-elements/with-error-text.d.ts +1 -1
  304. package/shared/patterns/form-elements/with-success-text.d.ts +1 -1
  305. package/shared/patterns/kbd-shortcut.d.ts +1 -1
  306. package/shared/patterns/linkable.d.ts +1 -1
  307. package/shared/patterns/localized.d.ts +2 -2
  308. package/shared/patterns/trapped-focus.d.ts +1 -1
  309. package/shared/picker-field/mixins/calendar-picker.d.ts +2 -2
  310. package/shared/picker-field/mixins/calendar-picker.template.d.ts +2 -2
  311. package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +1 -1
  312. package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +2 -2
  313. package/shared/picker-field/mixins/single-date-picker.d.ts +2 -2
  314. package/shared/picker-field/mixins/single-value-picker.d.ts +2 -2
  315. package/shared/picker-field/mixins/time-selection-picker.d.ts +2 -2
  316. package/shared/picker-field/mixins/time-selection-picker.template.d.ts +4 -4
  317. package/shared/picker-field/picker-field.d.ts +7 -7
  318. package/side-drawer/definition.cjs +1 -1
  319. package/side-drawer/definition.js +1 -1
  320. package/simple-color-picker/definition.cjs +1 -1
  321. package/simple-color-picker/definition.js +1 -1
  322. package/simple-color-picker/index.cjs +6 -6
  323. package/simple-color-picker/index.js +4 -3
  324. package/split-button/definition.cjs +1 -1
  325. package/split-button/definition.js +1 -1
  326. package/split-button/index.cjs +1 -0
  327. package/split-button/index.js +1 -0
  328. package/status/definition.cjs +1 -1
  329. package/status/definition.js +1 -1
  330. package/switch/definition.cjs +1 -1
  331. package/switch/definition.js +1 -1
  332. package/switch/index.cjs +6 -5
  333. package/switch/index.js +16 -14
  334. package/tab/definition.cjs +1 -1
  335. package/tab/definition.js +1 -1
  336. package/tab-panel/definition.cjs +1 -1
  337. package/tab-panel/definition.js +1 -1
  338. package/table/definition.cjs +1 -1
  339. package/table/definition.js +1 -1
  340. package/table/index.cjs +13 -13
  341. package/table/index.js +4 -3
  342. package/tabs/definition.cjs +1 -1
  343. package/tabs/definition.js +1 -1
  344. package/tag/definition.cjs +1 -1
  345. package/tag/definition.js +1 -1
  346. package/tag/index.cjs +11 -11
  347. package/tag/index.js +4 -3
  348. package/tag-group/definition.cjs +1 -1
  349. package/tag-group/definition.js +1 -1
  350. package/text-area/definition.cjs +1 -1
  351. package/text-area/definition.js +1 -1
  352. package/time-picker/definition.cjs +1 -1
  353. package/time-picker/definition.js +1 -1
  354. package/tree-item/definition.cjs +1 -1
  355. package/tree-item/definition.js +1 -1
  356. package/tree-view/definition.cjs +1 -1
  357. package/tree-view/definition.js +1 -1
  358. package/unbundled/affix.cjs +2 -2
  359. package/unbundled/affix.js +1 -1
  360. package/unbundled/base-progress.cjs +1 -1
  361. package/unbundled/base-progress.js +1 -1
  362. package/unbundled/button.cjs +2 -2
  363. package/unbundled/button.js +2 -2
  364. package/unbundled/definition.cjs +2 -65
  365. package/unbundled/definition.js +4 -61
  366. package/unbundled/definition11.cjs +4 -3
  367. package/unbundled/definition11.js +3 -2
  368. package/unbundled/definition12.cjs +3 -2
  369. package/unbundled/definition12.js +3 -2
  370. package/unbundled/definition13.cjs +1 -1
  371. package/unbundled/definition13.js +1 -1
  372. package/unbundled/definition14.cjs +2 -1
  373. package/unbundled/definition14.js +2 -1
  374. package/unbundled/definition17.cjs +9 -4
  375. package/unbundled/definition17.js +9 -4
  376. package/unbundled/definition2.cjs +14 -3
  377. package/unbundled/definition2.js +15 -4
  378. package/unbundled/definition21.cjs +2 -1
  379. package/unbundled/definition21.js +2 -1
  380. package/unbundled/definition23.cjs +3 -1
  381. package/unbundled/definition23.js +4 -2
  382. package/unbundled/definition24.cjs +6 -4
  383. package/unbundled/definition24.js +6 -4
  384. package/unbundled/definition25.cjs +2 -1
  385. package/unbundled/definition25.js +2 -1
  386. package/unbundled/definition26.cjs +7 -4
  387. package/unbundled/definition26.js +7 -4
  388. package/unbundled/definition27.cjs +39 -5
  389. package/unbundled/definition27.js +40 -6
  390. package/unbundled/definition28.cjs +4 -3
  391. package/unbundled/definition28.js +4 -3
  392. package/unbundled/definition29.cjs +5 -168
  393. package/unbundled/definition29.js +11 -162
  394. package/unbundled/definition30.cjs +26 -506
  395. package/unbundled/definition30.js +24 -498
  396. package/unbundled/definition31.cjs +503 -39
  397. package/unbundled/definition31.js +501 -37
  398. package/unbundled/definition32.cjs +39 -239
  399. package/unbundled/definition32.js +36 -236
  400. package/unbundled/definition33.cjs +236 -74
  401. package/unbundled/definition33.js +233 -71
  402. package/unbundled/definition34.cjs +74 -1968
  403. package/unbundled/definition34.js +70 -1940
  404. package/unbundled/definition35.cjs +1993 -26
  405. package/unbundled/definition35.js +1965 -27
  406. package/unbundled/definition36.cjs +26 -111
  407. package/unbundled/definition36.js +23 -103
  408. package/unbundled/definition37.cjs +53 -294
  409. package/unbundled/definition37.js +50 -291
  410. package/unbundled/definition38.cjs +282 -132
  411. package/unbundled/definition38.js +279 -129
  412. package/unbundled/definition39.cjs +165 -339
  413. package/unbundled/definition39.js +163 -337
  414. package/unbundled/definition40.cjs +395 -227
  415. package/unbundled/definition40.js +393 -225
  416. package/unbundled/definition41.cjs +269 -47
  417. package/unbundled/definition41.js +264 -42
  418. package/unbundled/definition42.cjs +48 -67
  419. package/unbundled/definition42.js +45 -64
  420. package/unbundled/definition43.cjs +56 -383
  421. package/unbundled/definition43.js +55 -382
  422. package/unbundled/definition44.cjs +387 -44
  423. package/unbundled/definition44.js +383 -40
  424. package/unbundled/definition45.cjs +53 -45
  425. package/unbundled/definition45.js +49 -41
  426. package/unbundled/definition46.cjs +40 -164
  427. package/unbundled/definition46.js +36 -160
  428. package/unbundled/definition47.cjs +171 -31
  429. package/unbundled/definition47.js +168 -22
  430. package/unbundled/definition48.cjs +30 -89
  431. package/unbundled/definition48.js +22 -87
  432. package/unbundled/definition49.cjs +589 -48
  433. package/unbundled/definition49.js +587 -47
  434. package/unbundled/definition50.cjs +90 -21
  435. package/unbundled/definition50.js +88 -16
  436. package/unbundled/definition51.cjs +47 -32
  437. package/unbundled/definition51.js +44 -29
  438. package/unbundled/definition52.cjs +22 -323
  439. package/unbundled/definition52.js +16 -320
  440. package/unbundled/definition53.cjs +33 -212
  441. package/unbundled/definition53.js +29 -208
  442. package/unbundled/definition54.cjs +318 -41
  443. package/unbundled/definition54.js +314 -37
  444. package/unbundled/definition55.cjs +199 -253
  445. package/unbundled/definition55.js +193 -247
  446. package/unbundled/definition56.cjs +45 -53
  447. package/unbundled/definition56.js +42 -49
  448. package/unbundled/definition57.cjs +255 -133
  449. package/unbundled/definition57.js +253 -128
  450. package/unbundled/definition58.cjs +49 -245
  451. package/unbundled/definition58.js +47 -244
  452. package/unbundled/definition59.cjs +127 -444
  453. package/unbundled/definition59.js +124 -444
  454. package/unbundled/definition6.cjs +2 -1
  455. package/unbundled/definition6.js +2 -1
  456. package/unbundled/definition60.cjs +230 -3746
  457. package/unbundled/definition60.js +223 -3576
  458. package/unbundled/definition61.cjs +427 -739
  459. package/unbundled/definition61.js +425 -737
  460. package/unbundled/definition62.cjs +3762 -103
  461. package/unbundled/definition62.js +3593 -97
  462. package/unbundled/definition63.cjs +678 -886
  463. package/unbundled/definition63.js +672 -877
  464. package/unbundled/definition64.cjs +104 -108
  465. package/unbundled/definition64.js +100 -104
  466. package/unbundled/definition65.cjs +999 -65
  467. package/unbundled/definition65.js +995 -58
  468. package/unbundled/definition66.cjs +105 -155
  469. package/unbundled/definition66.js +101 -151
  470. package/unbundled/definition67.cjs +71 -121
  471. package/unbundled/definition67.js +63 -119
  472. package/unbundled/definition68.cjs +162 -51
  473. package/unbundled/definition68.js +158 -47
  474. package/unbundled/definition69.cjs +117 -75
  475. package/unbundled/definition69.js +116 -71
  476. package/unbundled/definition70.cjs +59 -21
  477. package/unbundled/definition70.js +56 -15
  478. package/unbundled/definition71.cjs +80 -75
  479. package/unbundled/definition71.js +76 -74
  480. package/unbundled/definition72.cjs +20 -305
  481. package/unbundled/definition72.js +14 -230
  482. package/unbundled/definition73.cjs +75 -315
  483. package/unbundled/definition73.js +74 -307
  484. package/unbundled/definition74.cjs +308 -30
  485. package/unbundled/definition74.js +231 -24
  486. package/unbundled/definition75.cjs +314 -109
  487. package/unbundled/definition75.js +304 -106
  488. package/unbundled/definition76.cjs +26 -250
  489. package/unbundled/definition76.js +21 -246
  490. package/unbundled/definition77.cjs +133 -27
  491. package/unbundled/definition77.js +124 -25
  492. package/unbundled/definition78.cjs +230 -116
  493. package/unbundled/definition78.js +227 -107
  494. package/unbundled/definition79.cjs +28 -203
  495. package/unbundled/definition79.js +26 -193
  496. package/unbundled/definition80.cjs +126 -477
  497. package/unbundled/definition80.js +118 -473
  498. package/unbundled/definition81.cjs +221 -0
  499. package/unbundled/definition81.js +202 -0
  500. package/unbundled/definition82.cjs +517 -0
  501. package/unbundled/definition82.js +497 -0
  502. package/unbundled/extractOptions.cjs +21 -0
  503. package/unbundled/extractOptions.js +16 -0
  504. package/unbundled/icon.cjs +67 -0
  505. package/unbundled/icon.js +61 -0
  506. package/unbundled/linkable.cjs +1 -1
  507. package/unbundled/linkable.js +1 -1
  508. package/unbundled/listbox.cjs +29 -7
  509. package/unbundled/listbox.js +29 -7
  510. package/unbundled/mixins.cjs +2 -1
  511. package/unbundled/mixins.js +2 -1
  512. package/unbundled/optgroup.cjs +66 -0
  513. package/unbundled/optgroup.js +54 -0
  514. package/unbundled/option.cjs +176 -0
  515. package/unbundled/option.js +164 -0
  516. package/unbundled/time-selection-picker.template.cjs +1 -1
  517. package/unbundled/time-selection-picker.template.js +1 -1
  518. package/unbundled/vivid-element.cjs +10 -1
  519. package/unbundled/vivid-element.js +10 -1
  520. package/video-player/definition.cjs +1 -1
  521. package/video-player/definition.js +1 -1
  522. package/vivid.api.json +568 -231
@@ -1,793 +1,481 @@
1
- import { d as createRegisterFunction, u as defineVividComponent } from "./vivid-element.js";
2
- import { t as iconDefinition } from "./definition.js";
1
+ import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
3
2
  import { t as __decorate } from "./decorate.js";
4
- import { a as affixIconTemplateFactory, i as IconWrapper, n as AffixIconWithTrailing } from "./affix.js";
5
3
  import { n as FormAssociated } from "./form-associated.js";
6
4
  import { t as Localized } from "./localized.js";
7
- import { i as Button, r as chevronTemplateFactory, t as buttonDefinition } from "./definition6.js";
8
- import { t as handleEscapeKeyAndStopPropogation } from "./dialog.js";
9
- import { i as Popup, t as popupDefinition } from "./definition9.js";
10
- import { n as applyHostSemantics, t as HostSemantics } from "./host-semantics.js";
11
- import { n as WithLightDOMFeedback, r as feedbackMessageDefinition } from "./mixins.js";
5
+ import { i as Popup, r as PlacementStrategy, t as popupDefinition } from "./definition9.js";
6
+ import { n as keyArrowRight$1, t as keyArrowLeft$1 } from "./key-codes.js";
7
+ import { a as defaultToOneConverter, i as lerp, n as getMarkersTemplate, o as roundToStepValue, r as inverseLerp } from "./slider.template.js";
12
8
  import { t as FormElement } from "./form-element.js";
13
- import { t as WithErrorText } from "./with-error-text.js";
14
- import { t as WithSuccessText } from "./with-success-text.js";
15
- import { t as WithContextualHelp } from "./with-contextual-help.js";
16
- import { r as ListboxOption, t as listboxOptionDefinition } from "./definition29.js";
17
- import { t as Listbox } from "./listbox.js";
18
- import { Observable, Updates, attr, html, observable, ref, slotted, volatile, when } from "@microsoft/fast-element";
19
- import { classNames, inRange, keyArrowDown, keyArrowUp, keyEnd, keyEnter, keyEscape, keyHome, keySpace, keyTab, uniqueId } from "@microsoft/fast-web-utilities";
20
- //#region src/lib/select/select.scss?inline
21
- var select_default = ".label-wrapper{align-items:center;gap:var(--label-wrapper-gap,4px);flex-direction:row;display:flex}.label-wrapper[hidden]{display:none}.label:not(slot),.label::slotted(label){flex:0 auto}.chevron{font:var(--vvd-typography-base-extended);flex-shrink:0;display:flex;transform:rotate(0)}@media (prefers-reduced-motion:no-preference){.chevron{transition:transform .2s}}:host([data-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{--_low-ink-color:var(--vvd-color-neutral-600);--focus-stroke-gap-color:transparent;flex-direction:column;gap:4px;display:inline-flex}:host([disabled]){--_low-ink-color:var(--vvd-color-neutral-600);cursor:not-allowed}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.control{--_appearance-color-text:var(--vvd-color-canvas-text);--_appearance-color-fill:var(--vvd-color-canvas);--_appearance-color-outline:var(--vvd-color-neutral-500)}.control.appearance-ghost{--_appearance-color-text:var(--_connotation-color-firm);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}@media (hover:hover){.control: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(--vvd-color-neutral-700)}.control: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}}.control.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(--vvd-color-neutral-700)}.control.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}.control:disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.control:disabled.appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.control.disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.control.disabled.appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-300);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.control.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)}.control.readonly:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:transparent;--_appearance-color-outline:transparent}.control.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)}.control.error:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-alert-50);--_appearance-color-outline:transparent}.control.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)}.control.success:where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text:notset;--_appearance-color-fill:var(--vvd-color-success-50);--_appearance-color-outline:transparent}.control{--_connotation-color-primary:var(--vvd-select-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-primary-text:var(--vvd-select-accent-primary-text,var(--vvd-color-canvas));--_connotation-color-primary-increment:var(--vvd-select-accent-primary-increment,var(--vvd-color-neutral-800));--_connotation-color-intermediate:var(--vvd-select-accent-intermediate,var(--vvd-color-neutral-500));--_connotation-color-faint:var(--vvd-select-accent-faint,var(--vvd-color-neutral-50));--_connotation-color-soft:var(--vvd-select-accent-soft,var(--vvd-color-neutral-100));--_connotation-color-firm:var(--vvd-select-accent-firm,var(--vvd-color-canvas-text));--_connotation-color-fierce:var(--vvd-select-accent-fierce,var(--vvd-color-neutral-700));border-radius:var(--_select-control-border-radius);block-size:var(--_select-block-size);padding-inline:var(--_select-padding-inline);--_select-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2);--_select-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2)));--_select-padding-inline:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);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);justify-content:space-between;align-items:center;gap:8px;transition:box-shadow .2s,background-color .2s;display:flex}.control.size-condensed{--_select-icon-size:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2))) / 2.5);--_select-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 8));--_select-padding-inline:calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16)) / 2)}.control.size-condensed:not(.shape-pill){--_select-control-border-radius:4px}.control-wrapper{position:relative}.control:not(.disabled){cursor:pointer}.control.disabled{pointer-events:none}.control:not(.shape-pill){--_select-control-border-radius:8px}.control.shape-pill{--_select-control-border-radius:24px}.listbox{max-height:var(--select-height,408px);flex-direction:column;gap:2px;padding:4px;display:flex;overflow-y:auto}:host([multiple]:focus-visible) .listbox{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));border-radius:8px}.selected-value{white-space:nowrap;flex-grow:1;align-items:center;column-gap:12px;display:flex;overflow:hidden}.selected-value .text{text-overflow:ellipsis;max-inline-size:100%;overflow:hidden}.control.shows-placeholder .selected-value .text{color:var(--vvd-color-neutral-600)}.selected-value slot[name=icon]{flex:0 0 var(--_select-icon-size);font-size:var(--_select-icon-size);line-height:1}.control.has-meta .selected-value{padding-inline-end:8px}.feedback-wrapper{display:contents}::part(popup-base){inline-size:max-content;min-inline-size:var(--_select-fixed-width,100%)}:host([multiple]) ::part(popup-base){position:static}@supports selector(:has(*)){:host(:focus-within) .control:not(.has-activedescendant,:has(.clear-button:focus)){--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}}@supports not selector(:has(*)){:host(:focus-within) .control:not(.has-activedescendant){--focus-stroke-gap-color:transparent;box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px))}}:host(:not([multiple]):focus-visible) ::slotted([data-vvd-component=option][current-selected]){box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent;border-radius:8px}:host([multiple]) .clear-button{margin-inline-start:auto}:host([multiple][clearable]) .label-wrapper{min-block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 16))}";
9
+ import { attr, html, nullableNumberConverter, observable, ref, when } from "@microsoft/fast-element";
10
+ import { Orientation, classNames, keyArrowDown, keyArrowUp, keyEnd, keyHome, limit } from "@microsoft/fast-web-utilities";
11
+ //#region src/lib/range-slider/range-slider.scss?inline
12
+ var range_slider_default = ":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;--_thumb-size:12px;--_thumb-interaction-indicator-size:36px;--_track-start-inset-inline-start:0;--_track-start-inset-block-start:0;cursor:pointer;user-select:none;outline:none}.control .positioning-region{position:relative}.control .track{background:var(--_track-background-color);border-radius:4px;position:absolute}.control .track-start{border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;position:absolute;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));min-inline-size:var(--_thumb-size);margin-inline-start:calc(var(--_thumb-size) / 2)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:2px;left:0;right:0}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start:1px;border-top-left-radius:0;border-bottom-left-radius:0}.control.horizontal .track .mark{block-size:6px;inline-size:100%;position:absolute;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{block-size:100%;inline-size:6px;position:absolute;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{block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);touch-action:none;border-radius:50%;outline:none;position:absolute}.thumb-container.focus-visible{box-shadow:0 0 0 4px color-mix(in sRGB, var(--focus-stroke-color,var(--vvd-color-cta-500)), transparent 85%), inset 0 0 0 3px var(--focus-stroke-gap-color,currentColor);outline:1px solid var(--focus-stroke-color,var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset,0px));--focus-stroke-gap-color:transparent;--_thumb-interaction-indicator-alpha:.05;border-radius:50%}.control.horizontal .thumb-container{transform:translateX(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}@media (hover:hover){.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{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);display:block;position:absolute}@media (prefers-reduced-motion:no-preference){.thumb-container:before{transition:opacity .2s ease-out}}.thumb-container:after{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);display:block;position:absolute}.popup{pointer-events:none}.tooltip{width:auto;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold);padding:8px 12px}:host([internal-part]) .thumb-container{opacity:0}@media (prefers-reduced-motion:no-preference){:host([internal-part]) .thumb-container{transition:opacity .2s}}:host([internal-part]) .control.horizontal .track{block-size:4px;top:16px;overflow:hidden}:host([internal-part]) .control:focus .thumb-container{opacity:1}@media (hover:hover){:host([internal-part]) .control:hover .thumb-container{opacity:1}}.control,: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
13
  //#endregion
23
- //#region src/lib/select/select.ts
14
+ //#region src/lib/range-slider/range-slider.ts
15
+ var Direction$1 = {
16
+ Increment: 1,
17
+ Decrement: -1
18
+ };
24
19
  /**
20
+ * Base class for range-slider
21
+ *
22
+ * @component range-slider
25
23
  * @public
26
- * @component select
27
- * @slot - Default slot.
28
- * @slot icon - The preferred way to add an icon to the select control.
29
- * @slot meta - Slot to add meta content to the select control.
30
- * @slot helper-text - Describes how to use the select. Alternative to the `helper-text` attribute.
31
- * @event {CustomEvent<undefined>} input - Fires a custom 'input' event when the value updates
32
- * @event {CustomEvent<HTMLElement>} change - Fires a custom 'change' event when the value updates
33
- * @vueModel modelValue value input,@lazy:change `event.currentTarget.value`
34
- * @testAction selectOptionByValue selectOptionByValue
35
- * @testAction selectOptionByText selectOptionByText
24
+ * @event {CustomEvent<undefined>} input:start - Event emitted when the start value changes
25
+ * @event {CustomEvent<undefined>} input:end - Event emitted when the end value changes
26
+ * @event {CustomEvent<undefined>} input - Event emitted when either the start or end value changes.
27
+ * @event {CustomEvent<undefined>} change - Event emitted when either the start or end value changes.
28
+ * @vueModel start start input:start `event.currentTarget.start`
29
+ * @vueModel end end input:end `event.currentTarget.end`
30
+ * @vueModel startAsNumber startAsNumber input:start `event.currentTarget.startAsNumber`
31
+ * @vueModel endAsNumber endAsNumber input:end `event.currentTarget.endAsNumber`
32
+ * @testSelector byLabel byLabel
33
+ * @testAction slideStartTo slideTo #track #startThumb
34
+ * @testAction slideEndTo slideTo #track #endThumb
35
+ * @testQuery range rangeAsNumber
36
+ * @testRef track shadow .control
37
+ * @testRef startThumb shadow #start-thumb
38
+ * @testRef endThumb shadow #end-thumb
36
39
  */
37
- var Select = class extends WithLightDOMFeedback(WithContextualHelp(WithErrorText(WithSuccessText(Localized(FormElement(HostSemantics(AffixIconWithTrailing(FormAssociated(Listbox))))))))) {
40
+ var RangeSlider = class extends Localized(FormElement(FormAssociated(VividElement))) {
38
41
  constructor(..._args) {
39
42
  super(..._args);
40
- this.proxy = document.createElement("select");
41
- this.activeIndex = -1;
42
- this.rangeStartIndex = -1;
43
- this.open = false;
44
- this.listboxId = uniqueId("listbox-");
45
- this.maxHeight = 0;
46
- this.fixedDropdown = false;
47
- this._feedbackWrapper = null;
48
- this._isResetting = false;
49
- this.clearable = false;
50
- this._isClearButtonFocused = false;
51
- }
52
- /**
53
- * Returns the last checked option.
54
- *
55
- * @internal
56
- */
57
- get activeOption() {
58
- return this.options[this.activeIndex];
59
- }
60
- /**
61
- * Returns the list of checked options.
62
- *
63
- * @internal
64
- */
65
- get checkedOptions() {
66
- return this.options.filter((o) => o.checked);
67
- }
68
- /**
69
- * Returns the index of the first selected option.
70
- *
71
- * @internal
72
- */
73
- get firstSelectedOptionIndex() {
74
- return this.options.indexOf(this.firstSelectedOption);
75
- }
76
- /**
77
- * Updates the `ariaActiveDescendant` property when the active index changes.
78
- *
79
- * @internal
80
- */
81
- activeIndexChanged(_, next) {
82
- this._activeDescendant = this.options[next]?.id ?? "";
83
- this.focusAndScrollOptionIntoView();
84
- }
85
- /**
86
- * Toggles the checked state for the currently active option.
87
- *
88
- * @remarks
89
- * Multiple-selection mode only.
90
- *
91
- * @internal
92
- */
93
- checkActiveIndex() {
94
- const activeItem = this.activeOption;
95
- /* v8 ignore else -- @preserve */
96
- if (activeItem) activeItem.checked = true;
97
- }
98
- /**
99
- * Sets the active index to the first option and marks it as checked.
100
- *
101
- * @remarks
102
- * Multi-selection mode only.
103
- *
104
- * @param preserveChecked - mark all options unchecked before changing the active index
105
- *
106
- * @internal
107
- */
108
- checkFirstOption(preserveChecked) {
109
- const firstSelectableIndex = this.getNextSelectableIndex(0);
110
- if (firstSelectableIndex === -1) return;
111
- if (preserveChecked) {
112
- if (this.rangeStartIndex === -1) this.rangeStartIndex = this.activeIndex;
113
- this.options.forEach((o, i) => {
114
- o.checked = inRange(i, firstSelectableIndex, this.rangeStartIndex + 1) && !o.disabled;
115
- });
116
- } else this.uncheckAllOptions();
117
- this.activeIndex = firstSelectableIndex;
118
- this.checkActiveIndex();
119
- }
120
- /**
121
- * Decrements the active index and sets the matching option as checked.
122
- *
123
- * @remarks
124
- * Multi-selection mode only.
125
- *
126
- * @param preserveChecked - mark all options unchecked before changing the active index
127
- *
128
- * @internal
129
- */
130
- checkLastOption(preserveChecked) {
131
- const lastSelectableIndex = this.getPreviousSelectableIndex(this.length - 1);
132
- if (lastSelectableIndex === -1) return;
133
- if (preserveChecked) {
134
- if (this.rangeStartIndex === -1) this.rangeStartIndex = this.activeIndex;
135
- this.options.forEach((o, i) => {
136
- o.checked = inRange(i, this.rangeStartIndex, lastSelectableIndex + 1) && !o.disabled;
137
- });
138
- } else this.uncheckAllOptions();
139
- this.activeIndex = lastSelectableIndex;
140
- this.checkActiveIndex();
141
- }
142
- /**
143
- * Increments the active index and marks the matching option as checked.
144
- *
145
- * @remarks
146
- * Multiple-selection mode only.
147
- *
148
- * @param preserveChecked - mark all options unchecked before changing the active index
149
- *
150
- * @internal
151
- */
152
- checkNextOption(preserveChecked) {
153
- const nextIndex = this.getNextSelectableIndex(this.activeIndex + 1);
154
- if (nextIndex === -1) return;
155
- if (preserveChecked) {
156
- if (this.rangeStartIndex === -1) this.rangeStartIndex = this.activeIndex;
157
- this.options.forEach((o, i) => {
158
- o.checked = inRange(i, this.rangeStartIndex, nextIndex + 1) && !o.disabled;
159
- });
160
- } else this.uncheckAllOptions();
161
- this.activeIndex = nextIndex;
162
- this.checkActiveIndex();
163
- }
164
- /**
165
- * Decrements the active index and marks the matching option as checked.
166
- *
167
- * @remarks
168
- * Multiple-selection mode only.
169
- *
170
- * @param preserveChecked - mark all options unchecked before changing the active index
171
- *
172
- * @internal
173
- */
174
- checkPreviousOption(preserveChecked) {
175
- const previousIndex = this.getPreviousSelectableIndex(this.activeIndex - 1);
176
- if (previousIndex === -1) return;
177
- if (preserveChecked) {
178
- if (this.rangeStartIndex === -1) this.rangeStartIndex = this.activeIndex;
179
- if (this.checkedOptions.length === 1) this.rangeStartIndex += 1;
180
- this.options.forEach((o, i) => {
181
- o.checked = inRange(i, previousIndex, this.rangeStartIndex + 1) && !o.disabled;
182
- });
183
- } else this.uncheckAllOptions();
184
- this.activeIndex = previousIndex;
185
- this.checkActiveIndex();
186
- }
43
+ this.#isInternalValueUpdate = false;
44
+ this.start = "";
45
+ this.end = "";
46
+ this.min = 0;
47
+ this.max = 10;
48
+ this.step = 1;
49
+ this.orientation = Orientation.horizontal;
50
+ this.ariaStartLabel = null;
51
+ this.ariaEndLabel = null;
52
+ this.markers = false;
53
+ this.pin = false;
54
+ this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
55
+ this.proxy = document.createElement("input");
56
+ this._trackEl = null;
57
+ this._startThumbEl = null;
58
+ this._endThumbEl = null;
59
+ this._draggingThumb = false;
60
+ this._visiblyFocusedThumb = null;
61
+ this._hoveredThumb = null;
62
+ this._startThumbCss = "";
63
+ this._endThumbCss = "";
64
+ this._selectedRangeCss = "";
65
+ this.#isNonVisibleFocus = false;
66
+ this.#onThumbFocus = (e) => {
67
+ if (!this.#isNonVisibleFocus) this._visiblyFocusedThumb = this.#getThumbIdFromEvent(e);
68
+ this.#isNonVisibleFocus = false;
69
+ };
70
+ this.#onThumbBlur = () => {
71
+ this._visiblyFocusedThumb = null;
72
+ };
73
+ this.#onVisibilityChange = () => {
74
+ if (document.hidden && (this.shadowRoot.activeElement === this._startThumbEl || this.shadowRoot.activeElement === this._endThumbEl)) this.#isNonVisibleFocus = true;
75
+ };
76
+ this.#onMouseOver = (e) => {
77
+ this._hoveredThumb = this.#getThumbIdFromEvent(e);
78
+ };
79
+ this.#onMouseOut = () => {
80
+ this._hoveredThumb = null;
81
+ };
82
+ this.#onThumbMousedown = (event) => {
83
+ if (this.disabled || event.defaultPrevented) return;
84
+ let target = event.target;
85
+ if (target === this._endThumbEl && this.startAsNumber === this.max && this.endAsNumber === this.max) target = this._startThumbEl;
86
+ this.#focusThumbNonVisibly(target);
87
+ this._draggingThumb = this.#getThumbId(target);
88
+ this.#registerDragHandlers();
89
+ };
90
+ this.#onThumbKeydown = (e) => {
91
+ const thumb = this.#getThumbIdFromEvent(e);
92
+ this._visiblyFocusedThumb = thumb;
93
+ if (e.key === keyHome) {
94
+ e.preventDefault();
95
+ this.#updateValues({ [thumb]: `${this.#thumbConstraints[thumb].min}` });
96
+ } else if (e.key === keyEnd) {
97
+ e.preventDefault();
98
+ this.#updateValues({ [thumb]: `${this.#thumbConstraints[thumb].max}` });
99
+ } else {
100
+ if (e.shiftKey) return;
101
+ switch (e.key) {
102
+ case keyArrowRight$1:
103
+ case keyArrowDown:
104
+ e.preventDefault();
105
+ this.#applyStep(thumb, Direction$1.Increment);
106
+ break;
107
+ case keyArrowLeft$1:
108
+ case keyArrowUp:
109
+ e.preventDefault();
110
+ this.#applyStep(thumb, Direction$1.Decrement);
111
+ break;
112
+ }
113
+ }
114
+ };
115
+ this.#onDragMove = (e) => {
116
+ if (this.disabled || e.defaultPrevented || !this._draggingThumb) return;
117
+ const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
118
+ const value = this.#calculateValueFromMouseEvent(sourceEvent);
119
+ this.#updateValues({ [this._draggingThumb]: `${this.#roundToNearestStep(this._draggingThumb, value)}` });
120
+ };
121
+ this.#onDragEnd = () => {
122
+ this._draggingThumb = false;
123
+ this.#unregisterDragListeners();
124
+ };
125
+ }
126
+ #isInternalValueUpdate;
187
127
  /** @internal */
188
- focusAndScrollOptionIntoView() {
189
- super.focusAndScrollOptionIntoView(this.activeOption);
190
- }
191
- /**
192
- * In multiple-selection mode:
193
- * If any options are selected, the first selected option is checked when
194
- * the listbox receives focus. If no options are selected, the first
195
- * selectable option is checked.
196
- *
197
- * @internal
198
- */
199
- focusinHandler(e) {
200
- if (!this.multiple) {
201
- super.focusinHandler(e);
202
- return;
203
- }
204
- /* v8 ignore else -- @preserve */
205
- if (!this.shouldSkipFocus && e.target === e.currentTarget) {
206
- this.uncheckAllOptions();
207
- if (this.activeIndex === -1) this.activeIndex = this.firstSelectedOptionIndex !== -1 ? this.firstSelectedOptionIndex : 0;
208
- this.checkActiveIndex();
209
- this.setSelectedOptions();
210
- this.focusAndScrollOptionIntoView();
128
+ startChanged() {
129
+ this.currentStart = this.start;
130
+ if (!this.#isInternalValueUpdate) {
131
+ this.dirtyValue = true;
132
+ this.#updateFormValue();
211
133
  }
212
- this.shouldSkipFocus = false;
213
- }
214
- /** Sets an option as selected and gives it focus. */
215
- setSelectedOptions() {
216
- if (!this.multiple) {
217
- super.setSelectedOptions();
218
- return;
219
- }
220
- /* v8 ignore else -- @preserve */
221
- if (this.$fastController.isConnected && this.options) {
222
- this.selectedOptions = this.options.filter((o) => o.selected);
223
- this.focusAndScrollOptionIntoView();
224
- }
225
- }
226
- /**
227
- * Toggles the selected state of the provided options. If any provided items
228
- * are in an unselected state, all items are set to selected. If every
229
- * provided item is selected, they are all unselected.
230
- *
231
- * @internal
232
- */
233
- toggleSelectedForAllCheckedOptions() {
234
- const enabledCheckedOptions = this.checkedOptions.filter((o) => !o.disabled);
235
- const force = !enabledCheckedOptions.every((o) => o.selected);
236
- enabledCheckedOptions.forEach((o) => o.selected = force);
237
- this.selectedIndex = this.options.indexOf(enabledCheckedOptions[enabledCheckedOptions.length - 1]);
238
- this.setSelectedOptions();
239
- this.updateValue(true);
134
+ if (this.$fastController.isConnected) this.#updateThumbPositions();
240
135
  }
241
136
  /** @internal */
242
- typeaheadBufferChanged(prev, next) {
243
- if (!this.multiple) {
244
- super.typeaheadBufferChanged(prev, next);
245
- return;
246
- }
247
- /* v8 ignore if -- @preserve */
248
- if (this.$fastController.isConnected) {
249
- const typeaheadMatches = this.getTypeaheadMatches();
250
- const activeIndex = this.options.indexOf(typeaheadMatches[0]);
251
- if (activeIndex > -1) {
252
- this.activeIndex = activeIndex;
253
- this.uncheckAllOptions();
254
- this.checkActiveIndex();
255
- }
256
- this.typeaheadExpired = false;
257
- }
258
- }
259
- /**
260
- * Unchecks all options.
261
- *
262
- * @remarks
263
- * Multiple-selection mode only.
264
- *
265
- * @param preserveChecked - reset the rangeStartIndex
266
- *
267
- * @internal
268
- */
269
- uncheckAllOptions(preserveChecked = false) {
270
- this.options.forEach((o) => o.checked = false);
271
- /* v8 ignore else -- @preserve */
272
- if (!preserveChecked) this.rangeStartIndex = -1;
273
- }
274
- /**
275
- * Sets focus when the open property changes.
276
- *
277
- * @internal
278
- */
279
- openChanged(prev, next) {
280
- if (!this.collapsible) return;
281
- if (this.open) {
282
- this.focusAndScrollOptionIntoView();
283
- this.indexWhenOpened = this.selectedIndex;
284
- Updates.enqueue(() => this.focus());
285
- return;
137
+ initialStartChanged(_, newValue) {
138
+ if (newValue && !this.dirtyValue) {
139
+ this.start = newValue;
140
+ this.dirtyValue = false;
286
141
  }
287
- const didClose = prev && !next;
288
- const selectionChangedWhileOpen = this.indexWhenOpened !== this.selectedIndex;
289
- if (didClose && selectionChangedWhileOpen) this.updateValue(true);
290
- }
291
- /**
292
- * The component is collapsible when in single-selection mode.
293
- *
294
- * @internal
295
- */
296
- get collapsible() {
297
- return !this.multiple;
298
142
  }
299
143
  /** @internal */
300
- valueChanged(prev, next) {
301
- const nextSelectedIndex = this.options.findIndex((el) => el.value === next);
302
- const validNextSelectedIndex = this._validSelectedIndex(nextSelectedIndex);
303
- const nextValue = this.options[validNextSelectedIndex]?.value ?? "";
304
- if (this.selectedIndex !== validNextSelectedIndex) this.selectedIndex = validNextSelectedIndex;
305
- if (next !== nextValue) return;
306
- super.valueChanged(prev, next);
307
- this.updateDisplayValue();
308
- }
309
- /**
310
- * Sets the value and display value to match the first selected option.
311
- *
312
- * @param shouldEmit - if true, the input and change events will be emitted
313
- *
314
- * @internal
315
- */
316
- updateValue(shouldEmit) {
317
- if (this.$fastController.isConnected) this.value = this.firstSelectedOption?.value ?? "";
318
- if (shouldEmit) {
319
- this.$emit("input");
320
- this.$emit("change", this, {
321
- bubbles: true,
322
- composed: void 0
323
- });
324
- }
144
+ currentStartChanged() {
145
+ this.start = this.currentStart;
325
146
  }
326
- /**
327
- * Updates the proxy value when the selected index changes.
328
- *
329
- * @param prev - the previous selected index
330
- * @param next - the next selected index
331
- *
332
- * @internal
333
- */
334
- selectedIndexChanged(prev, next) {
335
- super.selectedIndexChanged(prev, next);
336
- this.updateValue();
337
- }
338
- /**
339
- * Handle opening and closing the listbox when the select is clicked.
340
- *
341
- * @param e - the mouse event
342
- * @internal
343
- */
344
- clickHandler(e) {
345
- if (this.disabled || this._isFromContextualHelp(e)) return;
346
- const clickedOption = e.target.closest(`option,[role=option],[data-vvd-component=option]`);
347
- if (clickedOption && clickedOption.disabled) return;
348
- if (this.multiple) {
349
- this.uncheckAllOptions();
350
- this.activeIndex = this.options.indexOf(clickedOption);
351
- this.checkActiveIndex();
352
- this.toggleSelectedForAllCheckedOptions();
353
- } else super.clickHandler(e);
354
- if (this.collapsible) this.open = !this.open;
355
- return true;
356
- }
357
- /**
358
- * Handles focus state when the element or its children lose focus.
359
- *
360
- * @param e - The focus event
361
- * @internal
362
- */
363
- focusoutHandler(e) {
364
- if (this.multiple) this.uncheckAllOptions();
365
- if (!this.open) return true;
366
- const focusTarget = e.relatedTarget;
367
- if (this.isSameNode(focusTarget)) {
368
- this.focus();
369
- return;
370
- }
371
- /* v8 ignore else -- @preserve */
372
- if (!this.options.includes(focusTarget)) {
373
- this.open = false;
374
- if (this.indexWhenOpened !== this.selectedIndex) this.updateValue(true);
375
- }
147
+ /** The start property, typed as a number. */
148
+ get startAsNumber() {
149
+ return parseFloat(this.start);
376
150
  }
377
- /**
378
- * Updates the value when an option's value changes.
379
- *
380
- * @param source - the source object
381
- * @param propertyName - the property to evaluate
382
- *
383
- * @internal
384
- */
385
- handleChange(source, propertyName) {
386
- super.handleChange(source, propertyName);
387
- if (propertyName === "value") this.updateValue();
388
- }
389
- /**
390
- * Prevents focus when a scrollbar is clicked.
391
- *
392
- * @param e - the mouse event object
393
- *
394
- * @internal
395
- */
396
- mousedownHandler(e) {
397
- if (e.offsetX >= 0 && e.offsetX <= this.listbox.scrollWidth) return super.mousedownHandler(e);
398
- return this.collapsible;
151
+ set startAsNumber(next) {
152
+ this.start = next.toString();
399
153
  }
400
154
  /** @internal */
401
- multipleChanged(_, next) {
402
- this.options.forEach((o) => {
403
- o.checked = next ? false : void 0;
404
- });
405
- this.setSelectedOptions();
406
- /* v8 ignore if -- @preserve */
407
- if (this.proxy) this.proxy.multiple = next;
408
- }
409
- /**
410
- * Updates the selectedness of each option when the list of selected options changes.
411
- *
412
- * @param prev - the previous list of selected options
413
- * @param next - the current list of selected options
414
- *
415
- * @internal
416
- */
417
- selectedOptionsChanged(prev, next) {
418
- super.selectedOptionsChanged(prev, next);
419
- this.options.forEach((o, i) => {
420
- const proxyOption = this.proxy.options.item(i);
421
- if (proxyOption) proxyOption.selected = o.selected;
422
- });
423
- }
424
- /**
425
- * Resets and fills the proxy to match the component's options.
426
- *
427
- * @internal
428
- */
429
- setProxyOptions() {
430
- /* v8 ignore else -- @preserve */
431
- if (this.proxy instanceof HTMLSelectElement && this.options) {
432
- this.proxy.length = 0;
433
- this.options.forEach((option) => {
434
- const proxyOption = option.proxy || (option instanceof HTMLOptionElement ? option.cloneNode() : null);
435
- if (proxyOption) this.proxy.options.add(proxyOption);
436
- });
155
+ endChanged() {
156
+ this.currentEnd = this.end;
157
+ if (!this.#isInternalValueUpdate) {
158
+ this.dirtyValue = true;
159
+ this.#updateFormValue();
437
160
  }
161
+ if (this.$fastController.isConnected) this.#updateThumbPositions();
438
162
  }
439
- /**
440
- * Handles keydown actions when the select is in multiple selection mode.
441
- *
442
- * @internal
443
- */
444
- multipleKeydownHandler(e) {
445
- if (this.disabled) return;
446
- const { key, shiftKey } = e;
447
- this.shouldSkipFocus = false;
448
- switch (key) {
449
- case keyHome:
450
- this.checkFirstOption(shiftKey);
451
- return;
452
- case keyArrowDown:
453
- this.checkNextOption(shiftKey);
454
- return;
455
- case keyArrowUp:
456
- this.checkPreviousOption(shiftKey);
457
- return;
458
- case keyEnd:
459
- this.checkLastOption(shiftKey);
460
- return;
461
- case keyTab:
462
- this.focusAndScrollOptionIntoView();
463
- return;
464
- case keyEscape:
465
- this.uncheckAllOptions();
466
- this.checkActiveIndex();
467
- return;
468
- case keySpace:
469
- e.preventDefault();
470
- /* v8 ignore else -- @preserve */
471
- if (this.typeaheadExpired) {
472
- this.toggleSelectedForAllCheckedOptions();
473
- return;
474
- }
475
- default:
476
- /* v8 ignore else -- @preserve */
477
- if (key.length === 1) this.handleTypeAhead(key);
478
- return;
163
+ /** @internal */
164
+ initialEndChanged(_, newValue) {
165
+ if (newValue && !this.dirtyValue) {
166
+ this.end = newValue;
167
+ this.dirtyValue = false;
479
168
  }
480
169
  }
481
- /**
482
- * Handle keyboard interaction for the select.
483
- *
484
- * @param e - the keyboard event
485
- * @internal
486
- */
487
- keydownHandler(e) {
488
- const selectedIndexBefore = this.selectedIndex;
489
- if (this.multiple) this.multipleKeydownHandler(e);
490
- else super.keydownHandler(e);
491
- switch (e.key) {
492
- case keySpace:
493
- e.preventDefault();
494
- if (this.collapsible && this.typeaheadExpired) this.open = !this.open;
495
- break;
496
- case keyHome:
497
- case keyEnd:
498
- e.preventDefault();
499
- break;
500
- case keyEnter:
501
- e.preventDefault();
502
- this.open = !this.open;
503
- break;
504
- case keyEscape:
505
- if (this.collapsible && this.open) {
506
- e.preventDefault();
507
- this.open = false;
508
- }
509
- break;
510
- case keyTab:
511
- if (this.collapsible && this.open) {
512
- e.preventDefault();
513
- this.open = false;
514
- }
515
- return true;
170
+ /** @internal */
171
+ currentEndChanged() {
172
+ this.end = this.currentEnd;
173
+ }
174
+ /** The end property, typed as a number. */
175
+ get endAsNumber() {
176
+ return parseFloat(this.end);
177
+ }
178
+ set endAsNumber(next) {
179
+ this.end = next.toString();
180
+ }
181
+ #updateValues({ start, end }, emitEvents = true) {
182
+ if (start === this.start) start = void 0;
183
+ if (end === this.end) end = void 0;
184
+ if (start === void 0 && end === void 0) return;
185
+ this.#isInternalValueUpdate = true;
186
+ if (start !== void 0) this.start = start;
187
+ if (end !== void 0) this.end = end;
188
+ this.#isInternalValueUpdate = false;
189
+ if (emitEvents) {
190
+ if (start !== void 0) this.$emit("input:start");
191
+ if (end !== void 0) this.$emit("input:end");
192
+ this.$emit("input");
193
+ this.$emit("change");
194
+ this.dirtyValue = true;
516
195
  }
517
- if (this.collapsible && !this.open && this.selectedIndex !== selectedIndexBefore) this.updateValue(true);
518
- return !(e.key === keyArrowDown || e.key === keyArrowUp);
196
+ this.#updateFormValue();
519
197
  }
520
- connectedCallback() {
521
- super.connectedCallback();
522
- this.addEventListener("focusout", this.focusoutHandler);
523
- this.addEventListener("contentchange", this.updateDisplayValue);
198
+ #applyStep(thumb, direction) {
199
+ this.#updateValues({ [thumb]: this.#roundToNearestStep(thumb, Number(this[thumb]) + direction * this.step).toString() });
524
200
  }
525
- disconnectedCallback() {
526
- this.removeEventListener("focusout", this.focusoutHandler);
527
- this.removeEventListener("contentchange", this.updateDisplayValue);
528
- super.disconnectedCallback();
201
+ /** @internal */
202
+ orientationChanged() {
203
+ if (this.$fastController.isConnected) this.#updateThumbPositions();
529
204
  }
530
205
  /** @internal */
531
- updateDisplayValue() {
532
- if (this.collapsible) Observable.notify(this, "displayValue");
533
- }
534
- get displayValue() {
535
- Observable.track(this, "displayValue");
536
- return this.firstSelectedOption?.getAttribute("label") ?? this.firstSelectedOption?.text ?? this.placeholder ?? "";
537
- }
538
- _newDefaultSelectedIndex(prev, next, currentSelectIndex) {
539
- const defaultSelectedIndex = super._newDefaultSelectedIndex(prev, next, currentSelectIndex);
540
- if (defaultSelectedIndex === null && currentSelectIndex === -1 && !this.placeholder) {
541
- const firstSelectableIndex = this.getNextSelectableIndex(0);
542
- if (firstSelectableIndex !== -1) return firstSelectableIndex;
206
+ nameChanged(previous, next) {
207
+ super.nameChanged(previous, next);
208
+ this.#updateFormValue();
209
+ }
210
+ #updateFormValue() {
211
+ if (!this.name) this.setFormValue(null);
212
+ else {
213
+ const formData = new FormData();
214
+ formData.append(this.name, this.start);
215
+ formData.append(this.name, this.end);
216
+ this.setFormValue(formData);
543
217
  }
544
- return defaultSelectedIndex;
545
218
  }
546
- _isDefaultSelected(option) {
547
- return super._isDefaultSelected(option) || option.value === this.initialValue || !this._isResetting && option.value === this.value;
548
- }
549
- slottedOptionsChanged(prev, next) {
550
- this.options.forEach((o) => {
551
- Observable.getNotifier(o).unsubscribe(this, "value");
552
- });
553
- super.slottedOptionsChanged(prev, next);
554
- this.options.forEach((o) => {
555
- Observable.getNotifier(o).subscribe(this, "value");
219
+ /** Resets `start` and `end` to their initial values when the form is reset. */
220
+ formResetCallback() {
221
+ this.#updateValues({
222
+ start: this.initialStart ?? this.min.toString(),
223
+ end: this.initialEnd ?? this.max.toString()
556
224
  });
557
- this.setProxyOptions();
558
- this.updateValue();
559
- const scale = this.getAttribute("scale") || this.scale;
560
- next.forEach((element) => {
561
- if (scale) {
562
- element.setAttribute("scale", scale);
563
- element.scale = scale;
225
+ super.formResetCallback();
226
+ }
227
+ get #thumbs() {
228
+ return {
229
+ start: this._startThumbEl,
230
+ end: this._endThumbEl
231
+ };
232
+ }
233
+ get #thumbConstraints() {
234
+ return {
235
+ start: {
236
+ min: this.min,
237
+ max: this.endAsNumber
238
+ },
239
+ end: {
240
+ min: this.startAsNumber,
241
+ max: this.max
564
242
  }
565
- });
566
- this.proxy.value = this.value;
567
- this.validate();
568
- }
569
- formResetCallback() {
570
- this.setProxyOptions();
571
- this._isResetting = true;
572
- this.selectedIndex = this._newDefaultSelectedIndex([], this.options, -1) ?? -1;
573
- this._isResetting = false;
243
+ };
244
+ }
245
+ #getThumbId(thumb) {
246
+ return thumb === this._startThumbEl ? "start" : "end";
247
+ }
248
+ #getThumbIdFromEvent(e) {
249
+ return this.#getThumbId(e.target);
250
+ }
251
+ #updateThumbPositions() {
252
+ const startOffsetPct = this.#thumbTrackEndOffset(this.startAsNumber);
253
+ const endOffsetPct = this.#thumbTrackEndOffset(this.endAsNumber);
254
+ const [dirProp, dimProp] = this.orientation === Orientation.horizontal ? ["right", "width"] : ["bottom", "height"];
255
+ const transition = `transition: ${this._draggingThumb ? "none" : "all 0.2s ease"};`;
256
+ this._startThumbCss = `${dirProp}: ${startOffsetPct}%; ${transition}`;
257
+ this._endThumbCss = `${dirProp}: ${endOffsetPct}%; ${transition}`;
258
+ this._selectedRangeCss = `${dirProp}: ${endOffsetPct}%; ${dimProp}: ${startOffsetPct - endOffsetPct}%; ${transition}`;
259
+ }
260
+ #thumbTrackEndOffset(value) {
261
+ return (1 - inverseLerp(this.min, this.max, value)) * 100;
262
+ }
263
+ #calculateValueFromMouseEvent(e) {
264
+ const trackClientRect = this._trackEl.getBoundingClientRect();
265
+ const [minPos, maxPos, valuePos] = this.orientation === Orientation.horizontal ? [
266
+ this._trackEl.clientLeft,
267
+ this._trackEl.clientWidth,
268
+ e.pageX - document.documentElement.scrollLeft - this.getBoundingClientRect().left
269
+ ] : [
270
+ trackClientRect.top,
271
+ trackClientRect.bottom,
272
+ e.pageY - document.documentElement.scrollTop
273
+ ];
274
+ return lerp(this.min, this.max, inverseLerp(minPos, maxPos, valuePos));
275
+ }
276
+ #roundToNearestStep(thumb, value) {
277
+ return limit(this.#thumbConstraints[thumb].min, this.#thumbConstraints[thumb].max, roundToStepValue(value - this.min, this.step) + this.min);
278
+ }
279
+ #isNonVisibleFocus;
280
+ #focusThumbNonVisibly(thumb) {
281
+ this.#isNonVisibleFocus = true;
282
+ thumb.focus();
283
+ this.#isNonVisibleFocus = false;
574
284
  }
575
285
  /** @internal */
576
- get _shouldShowClearButton() {
577
- if (!this.clearable) return false;
578
- if (this.multiple) return this.selectedOptions?.length > 0;
579
- return this.value !== "";
286
+ _isThumbPopupOpen(thumb) {
287
+ return this._visiblyFocusedThumb === thumb || this._hoveredThumb === thumb || this._draggingThumb === thumb;
580
288
  }
581
- /** @internal */
582
- _onClearButtonFocus() {
583
- this._isClearButtonFocused = true;
584
- this.activeIndex = -1;
585
- this.uncheckAllOptions();
289
+ connectedCallback() {
290
+ super.connectedCallback();
291
+ this.#updateValues({
292
+ start: this.start || this.initialStart || this.min.toString(),
293
+ end: this.end || this.initialEnd || this.max.toString()
294
+ }, false);
295
+ this.#registerThumbListeners();
296
+ this.#updateThumbPositions();
297
+ document.addEventListener("visibilitychange", this.#onVisibilityChange);
586
298
  }
587
- /** @internal */
588
- _onClearButtonBlur() {
589
- this._isClearButtonFocused = false;
299
+ disconnectedCallback() {
300
+ super.disconnectedCallback();
301
+ this.#unregisterThumbListeners();
302
+ this.#unregisterDragListeners();
303
+ document.removeEventListener("visibilitychange", this.#onVisibilityChange);
304
+ }
305
+ #registerThumbListeners() {
306
+ for (const thumb of ["start", "end"]) {
307
+ this.#thumbs[thumb].addEventListener("keydown", this.#onThumbKeydown);
308
+ this.#thumbs[thumb].addEventListener("mousedown", this.#onThumbMousedown, { passive: true });
309
+ this.#thumbs[thumb].addEventListener("touchstart", this.#onThumbMousedown, { passive: true });
310
+ this.#thumbs[thumb].addEventListener("mouseover", this.#onMouseOver, { passive: true });
311
+ this.#thumbs[thumb].addEventListener("mouseout", this.#onMouseOut, { passive: true });
312
+ this.#thumbs[thumb].addEventListener("focus", this.#onThumbFocus);
313
+ this.#thumbs[thumb].addEventListener("blur", this.#onThumbBlur);
314
+ }
590
315
  }
591
- /** @internal */
592
- get _shouldShowLabelWrapper() {
593
- return Boolean(this.label || this._hasContextualHelp || this.multiple && this._shouldShowClearButton);
316
+ #unregisterThumbListeners() {
317
+ for (const thumb of ["start", "end"]) {
318
+ this.#thumbs[thumb].removeEventListener("keydown", this.#onThumbKeydown);
319
+ this.#thumbs[thumb].removeEventListener("mousedown", this.#onThumbMousedown);
320
+ this.#thumbs[thumb].removeEventListener("touchstart", this.#onThumbMousedown);
321
+ this.#thumbs[thumb].removeEventListener("mouseover", this.#onMouseOver);
322
+ this.#thumbs[thumb].removeEventListener("mouseout", this.#onMouseOut);
323
+ this.#thumbs[thumb].removeEventListener("focus", this.#onThumbFocus);
324
+ this.#thumbs[thumb].removeEventListener("blur", this.#onThumbBlur);
325
+ }
594
326
  }
595
327
  /** @internal */
596
- _onClearButtonClick() {
597
- if (this.multiple) this.selectedOptions.forEach((o) => {
598
- /* v8 ignore else -- @preserve */
599
- if (!o.disabled) o.selected = false;
600
- });
601
- else this.selectedIndex = -1;
602
- this.updateValue(true);
603
- }
328
+ _onMouseDown(e) {
329
+ if (this.disabled || this._draggingThumb) return;
330
+ const value = this.#calculateValueFromMouseEvent(e);
331
+ const startDistance = Math.abs(value - Number(this.start));
332
+ const endDistance = Math.abs(value - Number(this.end));
333
+ const thumb = startDistance < endDistance || startDistance === endDistance && value < Number(this.start) ? "start" : "end";
334
+ this.#updateValues({ [thumb]: `${this.#roundToNearestStep(thumb, value)}` });
335
+ this._draggingThumb = thumb;
336
+ this.#focusThumbNonVisibly(this.#thumbs[thumb]);
337
+ this.#registerDragHandlers();
338
+ }
339
+ #onThumbFocus;
340
+ #onThumbBlur;
341
+ #onVisibilityChange;
342
+ #onMouseOver;
343
+ #onMouseOut;
344
+ #onThumbMousedown;
345
+ #onThumbKeydown;
346
+ #registerDragHandlers() {
347
+ window.addEventListener("mousemove", this.#onDragMove, { passive: true });
348
+ window.addEventListener("touchmove", this.#onDragMove, { passive: true });
349
+ window.addEventListener("mouseup", this.#onDragEnd);
350
+ window.addEventListener("touchend", this.#onDragEnd);
351
+ window.document.addEventListener("mouseleave", this.#onDragEnd);
352
+ }
353
+ #unregisterDragListeners() {
354
+ window.removeEventListener("mouseup", this.#onDragEnd);
355
+ window.document.removeEventListener("mouseleave", this.#onDragEnd);
356
+ window.removeEventListener("mousemove", this.#onDragMove);
357
+ window.removeEventListener("touchmove", this.#onDragMove);
358
+ window.removeEventListener("touchend", this.#onDragEnd);
359
+ }
360
+ #onDragMove;
361
+ #onDragEnd;
604
362
  };
605
- __decorate([observable], Select.prototype, "activeIndex", void 0);
606
- __decorate([attr({ mode: "boolean" })], Select.prototype, "multiple", void 0);
363
+ __decorate([observable], RangeSlider.prototype, "start", void 0);
607
364
  __decorate([attr({
608
- attribute: "open",
609
- mode: "boolean"
610
- })], Select.prototype, "open", void 0);
611
- __decorate([volatile], Select.prototype, "collapsible", null);
612
- __decorate([observable], Select.prototype, "control", void 0);
613
- __decorate([observable], Select.prototype, "maxHeight", void 0);
614
- __decorate([observable], Select.prototype, "_anchor", void 0);
615
- __decorate([attr()], Select.prototype, "scale", void 0);
616
- __decorate([attr], Select.prototype, "appearance", void 0);
617
- __decorate([attr], Select.prototype, "shape", void 0);
365
+ mode: "fromView",
366
+ attribute: "start"
367
+ })], RangeSlider.prototype, "initialStart", void 0);
368
+ __decorate([attr({ attribute: "current-start" })], RangeSlider.prototype, "currentStart", void 0);
369
+ __decorate([observable], RangeSlider.prototype, "end", void 0);
618
370
  __decorate([attr({
619
- mode: "boolean",
620
- attribute: "fixed-dropdown"
621
- })], Select.prototype, "fixedDropdown", void 0);
622
- __decorate([attr], Select.prototype, "placeholder", void 0);
623
- __decorate([observable], Select.prototype, "_feedbackWrapper", void 0);
624
- __decorate([observable], Select.prototype, "metaSlottedContent", void 0);
625
- __decorate([attr({ mode: "boolean" })], Select.prototype, "clearable", void 0);
626
- __decorate([observable], Select.prototype, "_isClearButtonFocused", void 0);
371
+ mode: "fromView",
372
+ attribute: "end"
373
+ })], RangeSlider.prototype, "initialEnd", void 0);
374
+ __decorate([attr({ attribute: "current-end" })], RangeSlider.prototype, "currentEnd", void 0);
375
+ __decorate([attr({ converter: nullableNumberConverter })], RangeSlider.prototype, "min", void 0);
376
+ __decorate([attr({ converter: nullableNumberConverter })], RangeSlider.prototype, "max", void 0);
377
+ __decorate([attr({ converter: defaultToOneConverter })], RangeSlider.prototype, "step", void 0);
378
+ __decorate([attr], RangeSlider.prototype, "orientation", void 0);
379
+ __decorate([attr({ attribute: "aria-start-label" })], RangeSlider.prototype, "ariaStartLabel", void 0);
380
+ __decorate([attr({ attribute: "aria-end-label" })], RangeSlider.prototype, "ariaEndLabel", void 0);
381
+ __decorate([attr({ mode: "boolean" })], RangeSlider.prototype, "markers", void 0);
382
+ __decorate([attr], RangeSlider.prototype, "connotation", void 0);
383
+ __decorate([attr({ mode: "boolean" })], RangeSlider.prototype, "pin", void 0);
384
+ __decorate([observable], RangeSlider.prototype, "valueTextFormatter", void 0);
385
+ __decorate([observable], RangeSlider.prototype, "_draggingThumb", void 0);
386
+ __decorate([observable], RangeSlider.prototype, "_visiblyFocusedThumb", void 0);
387
+ __decorate([observable], RangeSlider.prototype, "_hoveredThumb", void 0);
388
+ __decorate([observable], RangeSlider.prototype, "_startThumbCss", void 0);
389
+ __decorate([observable], RangeSlider.prototype, "_endThumbCss", void 0);
390
+ __decorate([observable], RangeSlider.prototype, "_selectedRangeCss", void 0);
627
391
  //#endregion
628
- //#region src/lib/select/select.template.ts
629
- function renderLabel() {
630
- return html` <label
631
- for="${(x) => x.multiple ? null : "control"}"
632
- class="label"
633
- id="label"
634
- >
635
- ${(x) => x.label}
636
- </label>`;
637
- }
638
- function renderPlaceholder(context) {
639
- const optionTag = context.tagFor(ListboxOption);
640
- return html`
641
- <${optionTag} text="${(x) => x.placeholder}" hidden disabled>
642
- </${optionTag}>`;
643
- }
644
- function renderClearButton(context) {
645
- const buttonTag = context.tagFor(Button);
646
- return html`
647
- <${buttonTag}
648
- aria-label="${(x) => x.locale.select.clearButtonLabel}"
649
- aria-hidden="${(x) => x._isClearButtonFocused ? "false" : "true"}"
650
- @click="${(x, c) => {
651
- x._onClearButtonClick();
652
- c.event.stopPropagation();
653
- }}"
654
- @mousedown="${() => false}"
655
- @keydown="${(x, c) => {
656
- /* v8 ignore next -- @preserve */
657
- if (c.event.key === "Tab") x._onClearButtonBlur();
658
- c.event.stopPropagation();
659
- return true;
660
- }}"
661
- @focusin="${(x, c) => {
662
- c.event.stopPropagation();
663
- x._onClearButtonFocus();
664
- }}"
665
- @focusout="${(x) => x._onClearButtonBlur()}"
666
- ?disabled="${(x) => x.disabled}"
667
- :shape="${(x) => x.shape}"
668
- size="super-condensed"
669
- icon="close-line"
670
- appearance="ghost-light"
671
- class="clear-button"
672
- tabindex="0"
673
- ></${buttonTag}>
674
- `;
675
- }
676
- function selectValue(context) {
677
- const affixIconTemplate = affixIconTemplateFactory(context);
678
- const chevronTemplate = chevronTemplateFactory(context);
679
- return html` <div
680
- class="control ${(x) => classNames(["has-activedescendant", Boolean(x._activeDescendant) && x.open], ["disabled", x.disabled], [`appearance-${x.appearance}`, Boolean(x.appearance)], [`shape-${x.shape}`, Boolean(x.shape)], ["has-meta", Boolean(x.metaSlottedContent?.length)], ["error", Boolean(x.errorValidationMessage)], ["success", !!x.successText], ["shows-placeholder", Boolean(x.placeholder) && !x.value], [`size-${x.scale}`, Boolean(x.scale)])}"
681
- ${ref("_anchor")}
682
- id="control"
683
- ?disabled="${(x) => x.disabled}"
684
- >
685
- <div class="selected-value">
686
- ${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
687
- <span class="text">${(x) => x.displayValue}</span>
688
- <slot name="meta" ${slotted("metaSlottedContent")}></slot>
689
- </div>
690
- ${when((x) => x._shouldShowClearButton, renderClearButton(context))}
691
- ${chevronTemplate}
692
- </div>`;
693
- }
694
- function setFixedDropdownVarWidth(x) {
695
- return x.open && x.fixedDropdown ? `--_select-fixed-width: ${Math.round(x.getBoundingClientRect().width)}px` : null;
696
- }
697
- /** @param context - element definition context */
698
- function renderControl(context) {
392
+ //#region src/lib/range-slider/range-slider.template.ts
393
+ var getThumbClassesFor = (thumb) => ({ _visiblyFocusedThumb }) => classNames("thumb-container", ["focus-visible", _visiblyFocusedThumb === thumb]);
394
+ var RangeSliderTemplate = (context) => {
699
395
  const popupTag = context.tagFor(Popup);
700
- return html`
701
- <div class="label-wrapper" ?hidden=${(x) => !x._shouldShowLabelWrapper}>
702
- ${when((x) => x.label, renderLabel())}
703
- ${when((x) => x.multiple && x._shouldShowClearButton, renderClearButton(context))}
704
- <slot name="contextual-help" ${slotted("_contextualHelpSlottedContent")}></slot>
705
- </div>
706
- <div class="control-wrapper">
707
- ${when((x) => !x.multiple, selectValue(context))}
708
- <${popupTag} class="popup"
709
- style="${setFixedDropdownVarWidth}"
710
- ?open="${(x) => x.collapsible ? x.open : true}"
711
- :anchor="${(x) => x._anchor}"
712
- placement="bottom-start"
713
- strategy="${(x) => x.fixedDropdown ? null : "absolute"}">
714
- <div class="listbox"
715
- id="${(x) => x.listboxId}"
716
- role="listbox"
717
- aria-multiselectable="${(x) => x.multiple}"
718
- aria-label="${(x) => x.multiple && !x.label && x.ariaLabel ? x.ariaLabel : null}"
719
- aria-labelledby="${(x) => x.multiple && x.label ? "label" : null}"
720
- ?disabled="${(x) => x.disabled}"
721
- ?hidden="${(x) => x.collapsible ? !x.open : false}"
722
- ${ref("listbox")}>
723
- ${when((x) => x.placeholder, renderPlaceholder(context))}
724
- <slot
725
- ${slotted({
726
- filter: Listbox.slottedOptionFilter,
727
- flatten: true,
728
- property: "slottedOptions"
729
- })}>
730
- </slot>
731
- </div>
732
- </${popupTag}>
733
- </div>
734
- `;
735
- }
736
- /** Ignore events that originate from feedback, e.g. a click on link */
737
- function ifNotFromFeedback(handler) {
738
- return (x, c) => {
739
- if (!c.event.composedPath().includes(x._feedbackWrapper)) {
740
- handler(x, c.event);
741
- return;
742
- }
743
- return true;
744
- };
745
- }
746
- var SelectTemplate = (context) => {
747
- return html`
748
- <template
749
- ${applyHostSemantics({
750
- role: "combobox",
751
- ariaLabel: (x) => x.ariaLabel ?? x.label,
752
- ariaHasPopup: (x) => x.collapsible ? "listbox" : "false",
753
- ariaExpanded: (x) => x.open,
754
- ariaDisabled: (x) => x.disabled
755
- })}
756
- aria-controls="${(x) => x.listboxId}"
757
- aria-activedescendant="${(x) => x.open ? x._activeDescendant : null}"
758
- aria-describedby="${(x) => x._feedbackDescribedBy}"
759
- tabindex="${(x) => !x.disabled ? "0" : null}"
760
- @click="${ifNotFromFeedback((x, e) => x.clickHandler(e))}"
761
- @focusin="${ifNotFromFeedback((x, e) => x.focusinHandler(e))}"
762
- @focusout="${ifNotFromFeedback((x, e) => x.focusoutHandler(e))}"
763
- @keydown="${ifNotFromFeedback((x, e) => {
764
- if (x.open) handleEscapeKeyAndStopPropogation(e);
765
- return x.keydownHandler(e);
766
- })}"
767
- @mousedown="${ifNotFromFeedback((x, e) => x.mousedownHandler(e))}"
396
+ return html` <template
397
+ @mousedown="${(x, c) => x._onMouseDown(c.event)}"
398
+ >
399
+ <div
400
+ class="${(x) => classNames("control", ["disabled", x.disabled], [`connotation-${x.connotation}`, Boolean(x.connotation)])} ${(x) => x.orientation}"
768
401
  >
769
- ${renderControl(context)}
770
- <div class="feedback-wrapper" ${ref("_feedbackWrapper")}>
771
- ${(x) => x._getFeedbackTemplate(context)}
402
+ <div class="positioning-region">
403
+ <div ${ref("_trackEl")} class="track">
404
+ <div class="track-start" style="${(x) => x._selectedRangeCss}"></div>
405
+ ${when((x) => x.markers, html`${(x) => getMarkersTemplate(x.orientation === Orientation.horizontal, Math.floor((x.max - x.min) / x.step))}`)}
406
+ </div>
407
+ <div
408
+ id="start-thumb"
409
+ ${ref("_startThumbEl")}
410
+ class="${getThumbClassesFor("start")}"
411
+ style="${(x) => x._startThumbCss}"
412
+ role="slider"
413
+ tabindex="${(x) => x.disabled ? null : 0}"
414
+ aria-label="${(x) => x.ariaStartLabel || x.locale.rangeSlider.startThumbLabel}"
415
+ aria-valuetext="${(x) => x.valueTextFormatter(x.start)}"
416
+ aria-valuenow="${(x) => x.start}"
417
+ aria-valuemin="${(x) => x.min}"
418
+ aria-valuemax="${(x) => x.end}"
419
+ aria-disabled="${(x) => x.disabled}"
420
+ aria-orientation="${(x) => x.orientation}"
421
+ ></div>
422
+ ${when((x) => x.pin, html`<${popupTag}
423
+ class="popup"
424
+ arrow
425
+ alternate
426
+ :anchor="${(x) => x._startThumbEl}"
427
+ :open=${(x) => x._isThumbPopupOpen("start")}
428
+ :placementStrategy=${(x) => x.orientation === Orientation.horizontal ? PlacementStrategy.AutoPlacementHorizontal : PlacementStrategy.AutoPlacementVertical}
429
+ animation-frame
430
+ exportparts="vvd-theme-alternate"
431
+ aria-hidden="true"
432
+ >
433
+ <div class="tooltip">${(x) => x.valueTextFormatter(x.start)}</div>
434
+ </${popupTag}>`)}
435
+ <div
436
+ id="end-thumb"
437
+ ${ref("_endThumbEl")}
438
+ class="${getThumbClassesFor("end")}"
439
+ style="${(x) => x._endThumbCss}"
440
+ role="slider"
441
+ tabindex="${(x) => x.disabled ? null : 0}"
442
+ aria-label="${(x) => x.ariaEndLabel || x.locale.rangeSlider.endThumbLabel}"
443
+ aria-valuetext="${(x) => x.valueTextFormatter(x.end)}"
444
+ aria-valuenow="${(x) => x.end}"
445
+ aria-valuemin="${(x) => x.start}"
446
+ aria-valuemax="${(x) => x.max}"
447
+ aria-disabled="${(x) => x.disabled}"
448
+ aria-orientation="${(x) => x.orientation}"
449
+ ></div>
450
+ ${when((x) => x.pin, html`<${popupTag}
451
+ class="popup"
452
+ arrow
453
+ alternate
454
+ :anchor="${(x) => x._endThumbEl}"
455
+ :open=${(x) => x._isThumbPopupOpen("end")}
456
+ :placementStrategy=${(x) => x.orientation === Orientation.horizontal ? PlacementStrategy.AutoPlacementHorizontal : PlacementStrategy.AutoPlacementVertical}
457
+ animation-frame
458
+ exportparts="vvd-theme-alternate"
459
+ aria-hidden="true"
460
+ >
461
+ <div class="tooltip">${(x) => x.valueTextFormatter(x.end)}</div>
462
+ </${popupTag}>`)}
772
463
  </div>
773
- </template>
774
- `;
464
+ </div>
465
+ </template>`;
775
466
  };
776
467
  //#endregion
777
- //#region src/lib/select/definition.ts
468
+ //#region src/lib/range-slider/definition.ts
778
469
  /** @internal */
779
- var selectDefinition = defineVividComponent("select", Select, SelectTemplate, [
780
- popupDefinition,
781
- iconDefinition,
782
- listboxOptionDefinition,
783
- buttonDefinition,
784
- feedbackMessageDefinition
785
- ], { styles: select_default });
470
+ var rangeSliderDefinition = defineVividComponent("range-slider", RangeSlider, RangeSliderTemplate, [popupDefinition], {
471
+ styles: range_slider_default,
472
+ shadowOptions: { delegatesFocus: true }
473
+ });
786
474
  /**
787
- * Registers the select elements with the design system.
475
+ * Registers the range-slider element with the design system.
788
476
  *
789
477
  * @param prefix - the prefix to use for the component name
790
478
  */
791
- var registerSelect = createRegisterFunction(selectDefinition);
479
+ var registerRangeSlider = createRegisterFunction(rangeSliderDefinition);
792
480
  //#endregion
793
- export { selectDefinition as n, Select as r, registerSelect as t };
481
+ export { registerRangeSlider as n, RangeSlider as r, rangeSliderDefinition as t };