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