@vonage/vivid 5.23.0 → 5.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/action-group/index.cjs +1 -1
- package/action-group/index.js +1 -1
- package/alert/definition.cjs +1 -1
- package/alert/definition.js +1 -1
- package/alert/index.cjs +7 -7
- package/alert/index.js +13 -14
- package/audio-player/definition.cjs +1 -1
- package/audio-player/definition.js +1 -1
- package/audio-player/index.cjs +18 -16
- package/audio-player/index.js +21 -19
- package/avatar/definition.cjs +1 -1
- package/avatar/definition.js +1 -1
- package/avatar/index.cjs +4 -4
- package/avatar/index.js +6 -6
- package/badge/definition.cjs +1 -1
- package/badge/definition.js +1 -1
- package/banner/definition.cjs +1 -1
- package/banner/definition.js +1 -1
- package/banner/index.cjs +3 -3
- package/banner/index.js +8 -8
- package/breadcrumb/definition.cjs +1 -1
- package/breadcrumb/definition.js +1 -1
- package/breadcrumb-item/definition.cjs +1 -1
- package/breadcrumb-item/definition.js +1 -1
- package/breadcrumb-item/index.cjs +2 -2
- package/breadcrumb-item/index.js +5 -5
- package/bundled/affix.cjs +1 -1
- package/bundled/affix.js +1 -1
- package/bundled/base-color-picker.cjs +2 -2
- package/bundled/base-color-picker.js +5 -5
- package/bundled/calendar-picker.template.cjs +1 -1
- package/bundled/calendar-picker.template.js +1 -1
- package/bundled/definition11.cjs +4 -4
- package/bundled/definition11.js +5 -5
- package/bundled/definition12.cjs +9 -7
- package/bundled/definition12.js +28 -26
- package/bundled/definition13.cjs +9 -7
- package/bundled/definition13.js +16 -15
- package/bundled/definition15.cjs +6 -6
- package/bundled/definition15.js +17 -17
- package/bundled/definition16.cjs +4 -2
- package/bundled/definition16.js +8 -6
- package/bundled/definition17.cjs +8 -6
- package/bundled/definition17.js +15 -14
- package/bundled/definition18.cjs +23 -23
- package/bundled/definition18.js +51 -52
- package/bundled/definition19.cjs +3 -1
- package/bundled/definition19.js +3 -1
- package/bundled/definition2.cjs +1 -13
- package/bundled/definition2.js +181 -48
- package/bundled/definition20.cjs +11 -9
- package/bundled/definition20.js +25 -23
- package/bundled/definition21.cjs +6 -6
- package/bundled/definition21.js +7 -8
- package/bundled/definition22.cjs +5 -3
- package/bundled/definition22.js +13 -11
- package/bundled/definition23.cjs +1 -1
- package/bundled/definition23.js +2 -2
- package/bundled/definition24.cjs +10 -10
- package/bundled/definition24.js +12 -12
- package/bundled/definition3.cjs +13 -1
- package/bundled/definition3.js +48 -181
- package/bundled/definition4.cjs +9 -7
- package/bundled/definition4.js +18 -16
- package/bundled/definition5.cjs +5 -5
- package/bundled/definition5.js +9 -9
- package/bundled/definition6.cjs +3 -3
- package/bundled/definition6.js +16 -16
- package/bundled/definition7.cjs +1 -1
- package/bundled/definition7.js +1 -1
- package/bundled/definition8.cjs +7 -7
- package/bundled/definition8.js +9 -7
- package/bundled/definition9.cjs +4 -4
- package/bundled/definition9.js +12 -12
- package/bundled/mixins.cjs +3 -3
- package/bundled/mixins.js +5 -5
- package/bundled/numberConverter.cjs +1 -1
- package/bundled/numberConverter.js +36 -1
- package/bundled/picker-field.template.cjs +13 -13
- package/bundled/picker-field.template.js +16 -16
- package/bundled/slider.template.cjs +8 -8
- package/bundled/slider.template.js +9 -9
- package/bundled/text-field.cjs +1 -1
- package/bundled/text-field.js +1 -1
- package/bundled/time-selection-picker.template.cjs +3 -3
- package/bundled/time-selection-picker.template.js +9 -9
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/button/definition.cjs +1 -1
- package/button/definition.js +1 -1
- package/calendar/definition.cjs +1 -1
- package/calendar/definition.js +1 -1
- package/calendar/index.cjs +9 -9
- package/calendar/index.js +7 -7
- package/calendar-event/definition.cjs +1 -1
- package/calendar-event/definition.js +1 -1
- package/calendar-event/index.cjs +2 -2
- package/calendar-event/index.js +2 -2
- package/card/definition.cjs +1 -1
- package/card/definition.js +1 -1
- package/card/index.cjs +3 -3
- package/card/index.js +6 -6
- package/color-picker/index.cjs +10 -10
- package/color-picker/index.js +52 -52
- package/combobox/index.cjs +14 -11
- package/combobox/index.js +38 -36
- package/custom-elements.json +4235 -4883
- package/data-grid/index.cjs +8 -6
- package/data-grid/index.js +20 -18
- package/dial-pad/index.cjs +22 -20
- package/dial-pad/index.js +36 -34
- package/dialog/index.cjs +14 -14
- package/dialog/index.js +17 -18
- package/elevation/definition.cjs +1 -1
- package/elevation/definition.js +1 -1
- package/empty-state/index.cjs +4 -4
- package/empty-state/index.js +7 -11
- package/fab/index.cjs +4 -4
- package/fab/index.js +9 -13
- package/file-picker/index.cjs +8 -8
- package/file-picker/index.js +19 -19
- package/flag/index.cjs +5 -5
- package/flag/index.js +8 -12
- package/header/index.cjs +5 -5
- package/header/index.js +4 -8
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +15 -14
- package/index.js +16 -16
- package/kbd-key/index.cjs +3 -3
- package/kbd-key/index.js +2 -6
- package/layout/index.cjs +3 -1
- package/layout/index.js +3 -1
- package/lib/accordion/variations.browser-spec.d.ts +1 -0
- package/lib/accordion-item/variations.browser-spec.d.ts +1 -0
- package/lib/action-group/variations.browser-spec.d.ts +1 -0
- package/lib/alert/variations.browser-spec.d.ts +1 -0
- package/lib/audio-player/variations.browser-spec.d.ts +1 -0
- package/lib/avatar/variations.browser-spec.d.ts +1 -0
- package/lib/badge/badge.d.ts +4 -4
- package/lib/badge/badge.template.d.ts +1 -2
- package/lib/badge/variations.browser-spec.d.ts +1 -0
- package/lib/banner/variations.browser-spec.d.ts +1 -0
- package/lib/breadcrumb-item/variations.browser-spec.d.ts +1 -0
- package/lib/button/variations.browser-spec.d.ts +1 -0
- package/lib/calendar/variations.browser-spec.d.ts +1 -0
- package/lib/calendar-event/variations.browser-spec.d.ts +1 -0
- package/lib/card/card.d.ts +4 -4
- package/lib/card/variations.browser-spec.d.ts +1 -0
- package/lib/checkbox/variations.browser-spec.d.ts +1 -0
- package/lib/color-picker/color-picker.d.ts +1 -1
- package/lib/color-picker/variations.browser-spec.d.ts +1 -0
- package/lib/combobox/variations.browser-spec.d.ts +1 -0
- package/lib/contextual-help/variations.browser-spec.d.ts +1 -0
- package/lib/country/variations.browser-spec.d.ts +1 -0
- package/lib/data-grid/variations.browser-spec.d.ts +1 -0
- package/lib/date-picker/variations.browser-spec.d.ts +1 -0
- package/lib/date-range-picker/variations.browser-spec.d.ts +1 -0
- package/lib/date-time-picker/variations.browser-spec.d.ts +1 -0
- package/lib/dial-pad/variations.browser-spec.d.ts +1 -0
- package/lib/dialog/variations.browser-spec.d.ts +1 -0
- package/lib/divider/variations.browser-spec.d.ts +1 -0
- package/lib/empty-state/variations.browser-spec.d.ts +1 -0
- package/lib/fab/fab.d.ts +5 -5
- package/lib/fab/variations.browser-spec.d.ts +1 -0
- package/lib/file-picker/variations.browser-spec.d.ts +1 -0
- package/lib/flag/variations.browser-spec.d.ts +1 -0
- package/lib/header/variations.browser-spec.d.ts +1 -0
- package/lib/icon/variations.browser-spec.d.ts +1 -0
- package/lib/kbd-key/variations.browser-spec.d.ts +1 -0
- package/lib/kbd-shortcut/variations.browser-spec.d.ts +1 -0
- package/lib/layout/variations.browser-spec.d.ts +1 -0
- package/lib/menu/variations.browser-spec.d.ts +1 -0
- package/lib/menu-item/variations.browser-spec.d.ts +1 -0
- package/lib/nav/variations.browser-spec.d.ts +1 -0
- package/lib/nav-disclosure/variations.browser-spec.d.ts +1 -0
- package/lib/nav-item/variations.browser-spec.d.ts +1 -0
- package/lib/note/variations.browser-spec.d.ts +1 -0
- package/lib/number-field/variations.browser-spec.d.ts +1 -0
- package/lib/option/variations.browser-spec.d.ts +1 -0
- package/lib/pagination/variations.browser-spec.d.ts +1 -0
- package/lib/popover/variations.browser-spec.d.ts +1 -0
- package/lib/progress/variations.browser-spec.d.ts +1 -0
- package/lib/progress-ring/variations.browser-spec.d.ts +1 -0
- package/lib/radio/variations.browser-spec.d.ts +1 -0
- package/lib/radio-group/variations.browser-spec.d.ts +1 -0
- package/lib/range-slider/variations.browser-spec.d.ts +1 -0
- package/lib/rich-text-editor/rte/features/internal/cursor-fix.d.ts +6 -1
- package/lib/rich-text-editor/variations.browser-spec.d.ts +1 -0
- package/lib/rich-text-view/variations.browser-spec.d.ts +1 -0
- package/lib/searchable-select/variations.browser-spec.d.ts +1 -0
- package/lib/select/variations.browser-spec.d.ts +1 -0
- package/lib/selectable-box/variations.browser-spec.d.ts +1 -0
- package/lib/side-drawer/variations.browser-spec.d.ts +1 -0
- package/lib/simple-color-picker/simple-color-picker.d.ts +2 -2
- package/lib/simple-color-picker/variations.browser-spec.d.ts +1 -0
- package/lib/slider/variations.browser-spec.d.ts +1 -0
- package/lib/split-button/variations.browser-spec.d.ts +1 -0
- package/lib/status/variations.browser-spec.d.ts +1 -0
- package/lib/switch/variations.browser-spec.d.ts +1 -0
- package/lib/tab/tab.d.ts +12 -12
- package/lib/table/variations.browser-spec.d.ts +1 -0
- package/lib/tabs/variations.browser-spec.d.ts +1 -0
- package/lib/tag/tag.d.ts +12 -12
- package/lib/tag/variations.browser-spec.d.ts +1 -0
- package/lib/text-area/text-area.template.d.ts +1 -2
- package/lib/text-area/variations.browser-spec.d.ts +1 -0
- package/lib/text-field/variations.browser-spec.d.ts +1 -0
- package/lib/time-picker/variations.browser-spec.d.ts +1 -0
- package/lib/toggletip/variations.browser-spec.d.ts +1 -0
- package/lib/tooltip/variations.browser-spec.d.ts +1 -0
- package/lib/tree-item/variations.browser-spec.d.ts +1 -0
- package/lib/video-player/variations.browser-spec.d.ts +1 -0
- package/menu/definition.cjs +1 -1
- package/menu/definition.js +1 -1
- package/menu-item/definition.cjs +1 -1
- package/menu-item/definition.js +1 -1
- package/nav-disclosure/index.cjs +6 -6
- package/nav-disclosure/index.js +11 -15
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +11 -15
- package/note/index.cjs +5 -5
- package/note/index.js +10 -11
- package/number-field/index.cjs +12 -12
- package/number-field/index.js +34 -35
- package/package.json +19 -10
- package/popover/index.cjs +8 -8
- package/popover/index.js +11 -15
- package/popup/definition.cjs +1 -1
- package/popup/definition.js +1 -1
- package/progress/index.cjs +8 -8
- package/progress/index.js +9 -10
- package/range-slider/index.cjs +10 -8
- package/range-slider/index.js +26 -24
- package/rich-text-editor/index.cjs +3 -3
- package/rich-text-editor/index.js +758 -747
- package/searchable-select/definition.cjs +1 -0
- package/searchable-select/definition.js +2 -2
- package/searchable-select/index.cjs +30 -27
- package/searchable-select/index.js +80 -76
- package/selectable-box/index.cjs +8 -8
- package/selectable-box/index.js +8 -9
- package/side-drawer/index.cjs +3 -3
- package/side-drawer/index.js +3 -3
- package/simple-color-picker/index.cjs +4 -4
- package/simple-color-picker/index.js +6 -6
- package/slider/definition.cjs +1 -1
- package/slider/definition.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +4 -4
- package/split-button/index.js +9 -9
- package/status/index.cjs +7 -5
- package/status/index.js +14 -12
- package/styles/core/all.css +5 -7
- package/styles/core/theme.css +5 -7
- package/styles/core/typography.css +0 -3
- package/styles/tokens/vivid-2-compat.css +1 -6
- package/switch/index.cjs +3 -3
- package/switch/index.js +5 -5
- package/table/index.cjs +10 -10
- package/table/index.js +12 -12
- package/tabs/index.cjs +6 -4
- package/tabs/index.js +10 -9
- package/tag/index.cjs +6 -6
- package/tag/index.js +8 -8
- package/text-area/index.cjs +8 -6
- package/text-area/index.js +20 -19
- package/unbundled/affix.cjs +2 -7
- package/unbundled/affix.js +2 -7
- package/unbundled/anchored.cjs +2 -6
- package/unbundled/anchored.js +2 -6
- package/unbundled/aria-binding-directive.cjs +1 -3
- package/unbundled/aria-binding-directive.js +1 -3
- package/unbundled/base-color-picker.cjs +18 -52
- package/unbundled/base-color-picker.js +18 -52
- package/unbundled/base-progress.cjs +4 -14
- package/unbundled/base-progress.js +4 -14
- package/unbundled/button.cjs +2 -8
- package/unbundled/button.js +2 -8
- package/unbundled/calendar-picker.template.cjs +31 -85
- package/unbundled/calendar-picker.template.js +30 -84
- package/unbundled/char-count.cjs +2 -4
- package/unbundled/char-count.js +2 -4
- package/unbundled/data-grid.options.cjs +3 -19
- package/unbundled/data-grid.options.js +3 -19
- package/unbundled/definition.cjs +3 -8
- package/unbundled/definition.js +3 -8
- package/unbundled/definition10.cjs +316 -211
- package/unbundled/definition10.js +313 -202
- package/unbundled/definition11.cjs +262 -356
- package/unbundled/definition11.js +248 -354
- package/unbundled/definition12.cjs +243 -274
- package/unbundled/definition12.js +241 -260
- package/unbundled/definition13.cjs +341 -255
- package/unbundled/definition13.js +338 -252
- package/unbundled/definition14.cjs +61 -371
- package/unbundled/definition14.js +57 -367
- package/unbundled/definition15.cjs +32 -77
- package/unbundled/definition15.js +28 -73
- package/unbundled/definition16.cjs +120 -32
- package/unbundled/definition16.js +117 -29
- package/unbundled/definition17.cjs +24 -132
- package/unbundled/definition17.js +24 -126
- package/unbundled/definition18.cjs +74 -26
- package/unbundled/definition18.js +67 -25
- package/unbundled/definition19.cjs +33 -79
- package/unbundled/definition19.js +32 -73
- package/unbundled/definition2.cjs +3 -6
- package/unbundled/definition2.js +3 -6
- package/unbundled/definition20.cjs +272 -29
- package/unbundled/definition20.js +264 -27
- package/unbundled/definition21.cjs +135 -263
- package/unbundled/definition21.js +133 -260
- package/unbundled/definition22.cjs +17 -155
- package/unbundled/definition22.js +13 -151
- package/unbundled/definition23.cjs +8 -17
- package/unbundled/definition23.js +8 -17
- package/unbundled/definition24.cjs +4 -10
- package/unbundled/definition24.js +4 -10
- package/unbundled/definition25.cjs +2 -10
- package/unbundled/definition25.js +2 -10
- package/unbundled/definition26.cjs +28 -70
- package/unbundled/definition26.js +28 -70
- package/unbundled/definition27.cjs +6 -13
- package/unbundled/definition27.js +6 -13
- package/unbundled/definition28.cjs +30 -77
- package/unbundled/definition28.js +30 -77
- package/unbundled/definition29.cjs +7 -14
- package/unbundled/definition29.js +7 -14
- package/unbundled/definition3.cjs +5 -16
- package/unbundled/definition3.js +5 -16
- package/unbundled/definition30.cjs +20 -51
- package/unbundled/definition30.js +20 -51
- package/unbundled/definition31.cjs +2 -4
- package/unbundled/definition31.js +2 -4
- package/unbundled/definition32.cjs +7 -17
- package/unbundled/definition32.js +7 -17
- package/unbundled/definition33.cjs +4 -9
- package/unbundled/definition33.js +4 -9
- package/unbundled/definition34.cjs +51 -141
- package/unbundled/definition34.js +51 -141
- package/unbundled/definition35.cjs +4 -5
- package/unbundled/definition35.js +4 -5
- package/unbundled/definition36.cjs +16 -38
- package/unbundled/definition36.js +14 -36
- package/unbundled/definition37.cjs +33 -89
- package/unbundled/definition37.js +31 -87
- package/unbundled/definition38.cjs +18 -44
- package/unbundled/definition38.js +16 -42
- package/unbundled/definition39.cjs +16 -32
- package/unbundled/definition39.js +13 -29
- package/unbundled/definition4.cjs +2 -11
- package/unbundled/definition4.js +2 -7
- package/unbundled/definition40.cjs +9 -20
- package/unbundled/definition40.js +9 -20
- package/unbundled/definition41.cjs +3 -6
- package/unbundled/definition41.js +3 -6
- package/unbundled/definition42.cjs +3 -6
- package/unbundled/definition42.js +3 -6
- package/unbundled/definition43.cjs +24 -67
- package/unbundled/definition43.js +24 -67
- package/unbundled/definition44.cjs +3 -6
- package/unbundled/definition44.js +3 -6
- package/unbundled/definition45.cjs +1 -3
- package/unbundled/definition45.js +1 -3
- package/unbundled/definition46.cjs +5 -14
- package/unbundled/definition46.js +5 -14
- package/unbundled/definition47.cjs +4 -5
- package/unbundled/definition47.js +5 -11
- package/unbundled/definition48.cjs +5 -12
- package/unbundled/definition48.js +5 -12
- package/unbundled/definition49.cjs +3 -7
- package/unbundled/definition49.js +3 -7
- package/unbundled/definition5.cjs +2 -5
- package/unbundled/definition5.js +2 -5
- package/unbundled/definition50.cjs +1 -3
- package/unbundled/definition50.js +1 -3
- package/unbundled/definition51.cjs +2 -5
- package/unbundled/definition51.js +2 -5
- package/unbundled/definition52.cjs +19 -44
- package/unbundled/definition52.js +16 -41
- package/unbundled/definition53.cjs +5 -13
- package/unbundled/definition53.js +5 -13
- package/unbundled/definition54.cjs +2 -6
- package/unbundled/definition54.js +2 -6
- package/unbundled/definition55.cjs +23 -65
- package/unbundled/definition55.js +23 -65
- package/unbundled/definition56.cjs +2 -5
- package/unbundled/definition56.js +2 -5
- package/unbundled/definition57.cjs +11 -24
- package/unbundled/definition57.js +11 -26
- package/unbundled/definition58.cjs +10 -30
- package/unbundled/definition58.js +10 -30
- package/unbundled/definition59.cjs +19 -48
- package/unbundled/definition59.js +19 -48
- package/unbundled/definition6.cjs +179 -17
- package/unbundled/definition6.js +170 -14
- package/unbundled/definition60.cjs +70 -54
- package/unbundled/definition60.js +70 -54
- package/unbundled/definition61.cjs +22 -54
- package/unbundled/definition61.js +22 -54
- package/unbundled/definition62.cjs +3 -9
- package/unbundled/definition62.js +3 -9
- package/unbundled/definition63.cjs +62 -130
- package/unbundled/definition63.js +60 -131
- package/unbundled/definition64.cjs +5 -12
- package/unbundled/definition64.js +5 -12
- package/unbundled/definition65.cjs +6 -14
- package/unbundled/definition65.js +6 -19
- package/unbundled/definition66.cjs +13 -35
- package/unbundled/definition66.js +13 -35
- package/unbundled/definition67.cjs +3 -5
- package/unbundled/definition67.js +3 -5
- package/unbundled/definition68.cjs +4 -5
- package/unbundled/definition68.js +4 -5
- package/unbundled/definition69.cjs +6 -15
- package/unbundled/definition69.js +6 -17
- package/unbundled/definition7.cjs +31 -177
- package/unbundled/definition7.js +24 -170
- package/unbundled/definition70.cjs +1 -3
- package/unbundled/definition70.js +1 -3
- package/unbundled/definition71.cjs +7 -12
- package/unbundled/definition71.js +7 -12
- package/unbundled/definition72.cjs +11 -25
- package/unbundled/definition72.js +11 -25
- package/unbundled/definition73.cjs +15 -39
- package/unbundled/definition73.js +15 -39
- package/unbundled/definition74.cjs +1 -3
- package/unbundled/definition74.js +1 -3
- package/unbundled/definition75.cjs +5 -11
- package/unbundled/definition75.js +5 -11
- package/unbundled/definition76.cjs +24 -59
- package/unbundled/definition76.js +24 -59
- package/unbundled/definition77.cjs +6 -8
- package/unbundled/definition77.js +4 -6
- package/unbundled/definition78.cjs +7 -13
- package/unbundled/definition78.js +7 -13
- package/unbundled/definition79.cjs +5 -15
- package/unbundled/definition79.js +5 -15
- package/unbundled/definition8.cjs +152 -36
- package/unbundled/definition8.js +148 -31
- package/unbundled/definition80.cjs +9 -25
- package/unbundled/definition80.js +9 -25
- package/unbundled/definition9.cjs +200 -135
- package/unbundled/definition9.js +189 -130
- package/unbundled/delegates-aria.cjs +1 -3
- package/unbundled/delegates-aria.js +1 -3
- package/unbundled/divider.cjs +2 -7
- package/unbundled/divider.js +2 -7
- package/unbundled/form-associated.cjs +20 -60
- package/unbundled/form-associated.js +20 -60
- package/unbundled/form-element.cjs +5 -15
- package/unbundled/form-element.js +5 -15
- package/unbundled/host-semantics.cjs +1 -3
- package/unbundled/host-semantics.js +1 -3
- package/unbundled/kbd-shortcut.cjs +1 -3
- package/unbundled/kbd-shortcut.js +1 -3
- package/unbundled/linkable.cjs +1 -3
- package/unbundled/linkable.js +1 -3
- package/unbundled/listbox.cjs +6 -20
- package/unbundled/listbox.js +6 -20
- package/unbundled/localized.cjs +3 -9
- package/unbundled/localized.js +3 -9
- package/unbundled/mixins.cjs +9 -25
- package/unbundled/mixins.js +9 -25
- package/unbundled/numberConverter.cjs +39 -9
- package/unbundled/numberConverter.js +39 -9
- package/unbundled/picker-field.template.cjs +16 -36
- package/unbundled/picker-field.template.js +16 -36
- package/unbundled/platform.cjs +1 -3
- package/unbundled/platform.js +1 -3
- package/unbundled/playbackRates.cjs +1 -3
- package/unbundled/playbackRates.js +1 -3
- package/unbundled/randomId.cjs +1 -3
- package/unbundled/randomId.js +1 -3
- package/unbundled/single-date-picker.cjs +6 -18
- package/unbundled/single-date-picker.js +6 -18
- package/unbundled/single-value-picker.cjs +7 -21
- package/unbundled/single-value-picker.js +7 -21
- package/unbundled/slider.template.cjs +6 -14
- package/unbundled/slider.template.js +6 -14
- package/unbundled/slottable-request.cjs +2 -6
- package/unbundled/slottable-request.js +2 -6
- package/unbundled/text-field.cjs +1 -1
- package/unbundled/text-field.js +1 -1
- package/unbundled/time-selection-picker.template.cjs +27 -79
- package/unbundled/time-selection-picker.template.js +27 -79
- package/unbundled/trapped-focus.cjs +1 -3
- package/unbundled/trapped-focus.js +1 -3
- package/unbundled/vivid-element.cjs +7 -19
- package/unbundled/vivid-element.js +7 -19
- package/unbundled/with-contextual-help.cjs +4 -13
- package/unbundled/with-contextual-help.js +4 -13
- package/unbundled/with-error-text.cjs +2 -6
- package/unbundled/with-error-text.js +2 -6
- package/unbundled/with-success-text.cjs +1 -3
- package/unbundled/with-success-text.js +1 -3
- package/video-player/index.cjs +3 -3
- package/video-player/index.js +5 -5
- package/visually-hidden/definition.cjs +1 -1
- package/visually-hidden/definition.js +1 -1
- package/shared/color-picker/index.d.ts +0 -3
- package/shared/foundation/button/index.d.ts +0 -2
- package/shared/patterns/char-count/index.d.ts +0 -1
- package/shared/patterns/form-elements/index.d.ts +0 -4
- package/shared/patterns/index.d.ts +0 -7
|
@@ -1,241 +1,352 @@
|
|
|
1
1
|
import { d as createRegisterFunction, t as VividElement, u as defineVividComponent } from "./vivid-element.js";
|
|
2
2
|
import { t as __decorate } from "./decorate.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"top-end"
|
|
23
|
-
] }),
|
|
24
|
-
[PlacementStrategy.AutoPlacementVertical]: autoPlacement({ allowedPlacements: [
|
|
25
|
-
"left",
|
|
26
|
-
"right",
|
|
27
|
-
"left-start",
|
|
28
|
-
"left-end",
|
|
29
|
-
"right-start",
|
|
30
|
-
"right-end"
|
|
31
|
-
] })
|
|
3
|
+
import { t as DelegatesAria } from "./delegates-aria.js";
|
|
4
|
+
import { n as FormAssociated } from "./form-associated.js";
|
|
5
|
+
import { t as Localized } from "./localized.js";
|
|
6
|
+
import { t as popupDefinition } from "./definition9.js";
|
|
7
|
+
import { n as keyArrowRight$1, t as keyArrowLeft$1 } from "./key-codes.js";
|
|
8
|
+
import { a as defaultToOneConverter, i as lerp, o as roundToStepValue, r as inverseLerp, t as SliderTemplate } from "./slider.template.js";
|
|
9
|
+
import { attr, nullableNumberConverter, observable, volatile } from "@microsoft/fast-element";
|
|
10
|
+
import { Direction, Orientation, keyArrowDown, keyArrowUp, keyEnd, keyHome, limit } from "@microsoft/fast-web-utilities";
|
|
11
|
+
//#region src/lib/slider/slider.scss?inline
|
|
12
|
+
var 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}}";
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/shared/foundation/utilities/direction.ts
|
|
15
|
+
/**
|
|
16
|
+
* a method to determine the current localization direction of the view
|
|
17
|
+
* @param rootNode - the HTMLElement to begin the query from, usually "this" when used in a component controller
|
|
18
|
+
*/
|
|
19
|
+
var getDirection = (rootNode) => {
|
|
20
|
+
const dirNode = rootNode.closest("[dir]");
|
|
21
|
+
return dirNode !== null && dirNode.dir === "rtl" ? Direction.rtl : Direction.ltr;
|
|
32
22
|
};
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/lib/slider/slider.ts
|
|
25
|
+
/** The selection modes of a Slider. */
|
|
26
|
+
var SliderMode = { singleValue: "single-value" };
|
|
33
27
|
/**
|
|
34
|
-
* @
|
|
35
|
-
* @
|
|
28
|
+
* @public
|
|
29
|
+
* @component slider
|
|
30
|
+
* @event {CustomEvent<undefined>} change - Fires a custom 'change' event when the slider value changes
|
|
31
|
+
* @vueModel modelValue value change `event.currentTarget.value`
|
|
32
|
+
* @vueModel valueAsNumber valueAsNumber change `event.currentTarget.valueAsNumber`
|
|
33
|
+
* @testSelector byLabel byLabel
|
|
34
|
+
* @testAction slideTo slideTo #track #thumb
|
|
35
|
+
* @testQuery valueAsNumber valueAsNumber
|
|
36
|
+
* @testRef track shadow .control
|
|
37
|
+
* @testRef thumb shadow .thumb-container
|
|
36
38
|
*/
|
|
37
|
-
var
|
|
39
|
+
var Slider = class extends Localized(DelegatesAria(FormAssociated(VividElement))) {
|
|
38
40
|
constructor(..._args) {
|
|
39
41
|
super(..._args);
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
44
|
-
this.
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
49
|
-
this
|
|
50
|
-
|
|
51
|
-
|
|
42
|
+
this.proxy = document.createElement("input");
|
|
43
|
+
this.direction = Direction.ltr;
|
|
44
|
+
this.isDragging = false;
|
|
45
|
+
this.trackWidth = 0;
|
|
46
|
+
this.trackMinWidth = 0;
|
|
47
|
+
this.trackHeight = 0;
|
|
48
|
+
this.trackLeft = 0;
|
|
49
|
+
this.trackMinHeight = 0;
|
|
50
|
+
this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
|
|
51
|
+
this.min = 0;
|
|
52
|
+
this.max = 10;
|
|
53
|
+
this.step = 1;
|
|
54
|
+
this.orientation = Orientation.horizontal;
|
|
55
|
+
this.mode = SliderMode.singleValue;
|
|
56
|
+
this.keypressHandler = (e) => {
|
|
57
|
+
this._focusVisible = true;
|
|
58
|
+
if (this.readOnly) return;
|
|
59
|
+
if (e.key === keyHome) {
|
|
60
|
+
e.preventDefault();
|
|
61
|
+
this.value = `${this.min}`;
|
|
62
|
+
} else if (e.key === keyEnd) {
|
|
63
|
+
e.preventDefault();
|
|
64
|
+
this.value = `${this.max}`;
|
|
65
|
+
} else {
|
|
66
|
+
if (e.shiftKey) return;
|
|
67
|
+
switch (e.key) {
|
|
68
|
+
case keyArrowRight$1:
|
|
69
|
+
case keyArrowUp:
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
this.increment();
|
|
72
|
+
break;
|
|
73
|
+
case keyArrowLeft$1:
|
|
74
|
+
case keyArrowDown:
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
this.decrement();
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
this.setupTrackConstraints = () => {
|
|
82
|
+
const clientRect = this.track.getBoundingClientRect();
|
|
83
|
+
this.trackWidth = this.track.clientWidth;
|
|
84
|
+
this.trackMinWidth = this.track.clientLeft;
|
|
85
|
+
this.trackHeight = clientRect.bottom;
|
|
86
|
+
this.trackMinHeight = clientRect.top;
|
|
87
|
+
this.trackLeft = this.getBoundingClientRect().left;
|
|
88
|
+
if (this.trackWidth === 0) this.trackWidth = 1;
|
|
89
|
+
};
|
|
90
|
+
this.setupListeners = (remove = false) => {
|
|
91
|
+
const eventAction = remove ? "removeEventListener" : "addEventListener";
|
|
92
|
+
this[eventAction]("keydown", this.keypressHandler);
|
|
93
|
+
this[eventAction]("mousedown", this.handleMouseDown);
|
|
94
|
+
this.thumb[eventAction]("mousedown", this.handleThumbMouseDown, { passive: true });
|
|
95
|
+
this.thumb[eventAction]("touchstart", this.handleThumbMouseDown, { passive: true });
|
|
96
|
+
if (remove) {
|
|
97
|
+
this.handleMouseDown(null);
|
|
98
|
+
this.handleThumbMouseDown(null);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
this.initialValue = "";
|
|
102
|
+
this.handleThumbMouseDown = (event) => {
|
|
103
|
+
if (event) {
|
|
104
|
+
if (this.readOnly || this.disabled || event.defaultPrevented) return;
|
|
105
|
+
this.#isNonVisibleFocus = true;
|
|
106
|
+
event.target.focus();
|
|
107
|
+
this.#isNonVisibleFocus = false;
|
|
108
|
+
}
|
|
109
|
+
const eventAction = event !== null ? "addEventListener" : "removeEventListener";
|
|
110
|
+
window[eventAction]("mouseup", this.handleWindowMouseUp);
|
|
111
|
+
window[eventAction]("mousemove", this.handleMouseMove, { passive: true });
|
|
112
|
+
window[eventAction]("touchmove", this.handleMouseMove, { passive: true });
|
|
113
|
+
window[eventAction]("touchend", this.handleWindowMouseUp);
|
|
114
|
+
this.isDragging = event !== null;
|
|
115
|
+
};
|
|
116
|
+
this.handleMouseMove = (e) => {
|
|
117
|
+
if (this.readOnly || this.disabled || e.defaultPrevented) return;
|
|
118
|
+
const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
|
|
119
|
+
const value = this.#calculateValueFromMouseEvent(sourceEvent);
|
|
120
|
+
this.value = `${this.#roundToNearestStep(value)}`;
|
|
121
|
+
};
|
|
122
|
+
this.handleWindowMouseUp = (_) => {
|
|
123
|
+
this.stopDragging();
|
|
124
|
+
};
|
|
125
|
+
this.stopDragging = () => {
|
|
126
|
+
this.isDragging = false;
|
|
127
|
+
this.handleMouseDown(null);
|
|
128
|
+
this.handleThumbMouseDown(null);
|
|
129
|
+
};
|
|
130
|
+
this.handleMouseDown = (e) => {
|
|
131
|
+
const eventAction = e !== null ? "addEventListener" : "removeEventListener";
|
|
132
|
+
if (e === null || !this.disabled && !this.readOnly) {
|
|
133
|
+
window[eventAction]("mouseup", this.handleWindowMouseUp);
|
|
134
|
+
window.document[eventAction]("mouseleave", this.handleWindowMouseUp);
|
|
135
|
+
window[eventAction]("mousemove", this.handleMouseMove);
|
|
136
|
+
if (e) {
|
|
137
|
+
e.preventDefault();
|
|
138
|
+
this.setupTrackConstraints();
|
|
139
|
+
this.#isNonVisibleFocus = true;
|
|
140
|
+
e.target.focus();
|
|
141
|
+
this.#isNonVisibleFocus = false;
|
|
142
|
+
const value = this.#calculateValueFromMouseEvent(e);
|
|
143
|
+
this.value = `${this.#roundToNearestStep(value)}`;
|
|
144
|
+
this.isDragging = true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
this.markers = false;
|
|
149
|
+
this.pin = false;
|
|
150
|
+
this._focusVisible = false;
|
|
151
|
+
this._hoveringOnThumb = false;
|
|
152
|
+
this.#isNonVisibleFocus = false;
|
|
153
|
+
this._onFocusIn = () => {
|
|
154
|
+
if (!this.#isNonVisibleFocus) this._focusVisible = true;
|
|
155
|
+
this.#isNonVisibleFocus = false;
|
|
156
|
+
};
|
|
157
|
+
this._onFocusOut = () => {
|
|
158
|
+
this._focusVisible = false;
|
|
159
|
+
};
|
|
160
|
+
this.#onVisibilityChange = () => {
|
|
161
|
+
if (document.hidden && this.shadowRoot.activeElement !== null) this.#isNonVisibleFocus = true;
|
|
162
|
+
};
|
|
163
|
+
this.#onMouseOver = () => {
|
|
164
|
+
this._hoveringOnThumb = true;
|
|
165
|
+
};
|
|
166
|
+
this.#onMouseOut = () => {
|
|
167
|
+
this._hoveringOnThumb = false;
|
|
52
168
|
};
|
|
53
169
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
shift({ crossAxis: this.shiftCrossAxis }),
|
|
59
|
-
hide(),
|
|
60
|
-
size({ apply({ availableWidth, availableHeight, elements }) {
|
|
61
|
-
Object.assign(elements.floating.style, {
|
|
62
|
-
maxWidth: `${availableWidth}px`,
|
|
63
|
-
maxHeight: `${availableHeight}px`
|
|
64
|
-
});
|
|
65
|
-
} })
|
|
66
|
-
];
|
|
67
|
-
let offsetValue = this.offset ?? 0;
|
|
68
|
-
if (this.arrow) {
|
|
69
|
-
offsetValue += 12;
|
|
70
|
-
middleware = [...middleware, arrow({
|
|
71
|
-
element: this.arrowEl,
|
|
72
|
-
padding: 10
|
|
73
|
-
})];
|
|
74
|
-
}
|
|
75
|
-
if (offsetValue > 0) middleware.unshift(offset(offsetValue));
|
|
76
|
-
return middleware;
|
|
170
|
+
/** @internal */
|
|
171
|
+
readOnlyChanged() {
|
|
172
|
+
/* v8 ignore if -- @preserve */
|
|
173
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.readOnly = this.readOnly;
|
|
77
174
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this
|
|
81
|
-
this.#updateAutoUpdate();
|
|
82
|
-
this.$emit(newValue ? "vwc-popup:open" : "vwc-popup:close");
|
|
175
|
+
/** The value property, typed as a number. */
|
|
176
|
+
get valueAsNumber() {
|
|
177
|
+
return parseFloat(this.value);
|
|
83
178
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*/
|
|
87
|
-
animationFrameChanged() {
|
|
88
|
-
this.#updateAutoUpdate();
|
|
179
|
+
set valueAsNumber(next) {
|
|
180
|
+
this.value = next.toString();
|
|
89
181
|
}
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
182
|
+
/** @internal */
|
|
183
|
+
valueChanged(previous, next) {
|
|
184
|
+
super.valueChanged(previous, next);
|
|
185
|
+
if (this.$fastController.isConnected) {
|
|
186
|
+
const nextAsNumber = parseFloat(next);
|
|
187
|
+
const value = this.#roundToNearestStep(nextAsNumber).toString();
|
|
188
|
+
if (value !== next) {
|
|
189
|
+
this.value = value;
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.setThumbPositionForOrientation(this.direction);
|
|
193
|
+
this.$emit("change");
|
|
194
|
+
}
|
|
95
195
|
}
|
|
96
|
-
/**
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this
|
|
196
|
+
/** @internal */
|
|
197
|
+
minChanged() {
|
|
198
|
+
/* v8 ignore if -- @preserve */
|
|
199
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.min = `${this.min}`;
|
|
200
|
+
this.validate();
|
|
101
201
|
}
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this
|
|
202
|
+
/** @internal */
|
|
203
|
+
maxChanged() {
|
|
204
|
+
/* v8 ignore if -- @preserve */
|
|
205
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.max = `${this.max}`;
|
|
206
|
+
this.validate();
|
|
207
|
+
}
|
|
208
|
+
/** @internal */
|
|
209
|
+
stepChanged() {
|
|
210
|
+
/* v8 ignore if -- @preserve */
|
|
211
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.step = `${this.step}`;
|
|
212
|
+
this.updateStepMultiplier();
|
|
213
|
+
this.validate();
|
|
107
214
|
}
|
|
215
|
+
/** @internal */
|
|
216
|
+
orientationChanged() {
|
|
217
|
+
if (this.$fastController.isConnected) this.setThumbPositionForOrientation(this.direction);
|
|
218
|
+
}
|
|
219
|
+
/** @internal */
|
|
108
220
|
connectedCallback() {
|
|
109
221
|
super.connectedCallback();
|
|
110
|
-
this
|
|
111
|
-
this
|
|
222
|
+
this.proxy.setAttribute("type", "range");
|
|
223
|
+
this.direction = getDirection(this);
|
|
224
|
+
this.updateStepMultiplier();
|
|
225
|
+
this.setupTrackConstraints();
|
|
226
|
+
this.setupListeners();
|
|
227
|
+
this.setupDefaultValue();
|
|
228
|
+
this.setThumbPositionForOrientation(this.direction);
|
|
229
|
+
this.#registerThumbListeners();
|
|
230
|
+
document.addEventListener("visibilitychange", this.#onVisibilityChange);
|
|
112
231
|
}
|
|
232
|
+
/** @internal */
|
|
113
233
|
disconnectedCallback() {
|
|
114
|
-
|
|
115
|
-
this.#
|
|
234
|
+
this.setupListeners(true);
|
|
235
|
+
this.#unregisterThumbListeners();
|
|
236
|
+
document.removeEventListener("visibilitychange", this.#onVisibilityChange);
|
|
116
237
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
if (this.anchorEl && this.open && this.popupEl) this.#cleanup = autoUpdate(this.anchorEl, this.popupEl, () => void this.#autoUpdateCallback(), { animationFrame: this.animationFrame });
|
|
238
|
+
/** Increment the value by the step */
|
|
239
|
+
increment() {
|
|
240
|
+
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + this.step : Number(this.value) - this.step;
|
|
241
|
+
this.value = this.#roundToNearestStep(newVal).toString();
|
|
122
242
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
243
|
+
/** Decrement the value by the step */
|
|
244
|
+
decrement() {
|
|
245
|
+
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - this.step : Number(this.value) + this.step;
|
|
246
|
+
this.value = this.#roundToNearestStep(newVal).toString();
|
|
126
247
|
}
|
|
127
|
-
#lastPositionUpdate;
|
|
128
|
-
#autoUpdateCallback;
|
|
129
248
|
/**
|
|
130
|
-
*
|
|
249
|
+
* Places the thumb based on the current value
|
|
131
250
|
*
|
|
132
|
-
* @
|
|
251
|
+
* @param direction - writing mode
|
|
133
252
|
*/
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
strategy: this.strategy,
|
|
139
|
-
middleware: this.#middleware
|
|
140
|
-
});
|
|
141
|
-
this.#assignPopupPosition(positionData);
|
|
142
|
-
if (this.arrow) this.#assignArrowPosition(positionData);
|
|
143
|
-
}
|
|
144
|
-
#assignPopupPosition(data) {
|
|
145
|
-
const { x: popupX, y: popupY } = data;
|
|
146
|
-
const { referenceHidden } = data.middlewareData.hide;
|
|
147
|
-
Object.assign(this.popupEl.style, {
|
|
148
|
-
left: `${popupX}px`,
|
|
149
|
-
top: `${popupY}px`,
|
|
150
|
-
visibility: referenceHidden ? "hidden" : "visible"
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
#assignArrowPosition(data) {
|
|
154
|
-
const { x: arrowX, y: arrowY } = data.middlewareData.arrow;
|
|
155
|
-
const styles = {
|
|
156
|
-
left: "calc(100% - 4px)",
|
|
157
|
-
right: "-4px",
|
|
158
|
-
top: "calc(100% - 4px)",
|
|
159
|
-
bottom: "-4px"
|
|
160
|
-
};
|
|
161
|
-
const staticAxis = data.placement.split("-")[0];
|
|
162
|
-
Object.assign(this.arrowEl.style, {
|
|
163
|
-
left: arrowX ? `${arrowX}px` : styles[staticAxis],
|
|
164
|
-
top: arrowY ? `${arrowY}px` : styles[staticAxis]
|
|
165
|
-
});
|
|
253
|
+
setThumbPositionForOrientation(_) {
|
|
254
|
+
const percentage = this.#thumbTrackEndOffset(this.valueAsNumber);
|
|
255
|
+
if (this.orientation === Orientation.horizontal) this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: right 0.2s ease;`;
|
|
256
|
+
else this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: bottom 0.2s ease;`;
|
|
166
257
|
}
|
|
167
|
-
|
|
168
|
-
return this.
|
|
258
|
+
#thumbTrackEndOffset(value) {
|
|
259
|
+
return (1 - inverseLerp(this.min, this.max, value)) * 100;
|
|
169
260
|
}
|
|
170
261
|
/**
|
|
171
|
-
*
|
|
172
|
-
*
|
|
262
|
+
* Update the step multiplier used to ensure rounding errors from steps that
|
|
263
|
+
* are not whole numbers
|
|
173
264
|
*/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
265
|
+
updateStepMultiplier() {
|
|
266
|
+
const stepString = String(this.step);
|
|
267
|
+
const decimalPlacesOfStep = this.step % 1 ? stepString.length - stepString.indexOf(".") - 1 : 0;
|
|
268
|
+
this.stepMultiplier = Math.pow(10, decimalPlacesOfStep);
|
|
269
|
+
}
|
|
270
|
+
get midpoint() {
|
|
271
|
+
return `${this.#roundToNearestStep((this.max + this.min) / 2)}`;
|
|
177
272
|
}
|
|
178
|
-
|
|
179
|
-
|
|
273
|
+
setupDefaultValue() {
|
|
274
|
+
/* v8 ignore else -- @preserve */
|
|
275
|
+
if (typeof this.value === "string") if (this.value.length === 0) this.initialValue = this.midpoint;
|
|
276
|
+
else {
|
|
277
|
+
const value = parseFloat(this.value);
|
|
278
|
+
if (!Number.isNaN(value) && (value < this.min || value > this.max)) this.value = this.midpoint;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
#calculateValueFromMouseEvent(e) {
|
|
282
|
+
const trackClientRect = this.track.getBoundingClientRect();
|
|
283
|
+
const [minPos, maxPos, valuePos] = this.orientation === Orientation.horizontal ? [
|
|
284
|
+
this.track.clientLeft,
|
|
285
|
+
this.track.clientWidth,
|
|
286
|
+
e.pageX - document.documentElement.scrollLeft - this.getBoundingClientRect().left
|
|
287
|
+
] : [
|
|
288
|
+
trackClientRect.top,
|
|
289
|
+
trackClientRect.bottom,
|
|
290
|
+
e.pageY - document.documentElement.scrollTop
|
|
291
|
+
];
|
|
292
|
+
return lerp(this.min, this.max, inverseLerp(minPos, maxPos, valuePos));
|
|
180
293
|
}
|
|
294
|
+
#roundToNearestStep(value) {
|
|
295
|
+
return limit(this.min, this.max, roundToStepValue(value - this.min, this.step) + this.min);
|
|
296
|
+
}
|
|
297
|
+
/** @internal */
|
|
298
|
+
get _isThumbPopupOpen() {
|
|
299
|
+
return this._focusVisible || this._hoveringOnThumb || this.isDragging;
|
|
300
|
+
}
|
|
301
|
+
#isNonVisibleFocus;
|
|
302
|
+
#registerThumbListeners() {
|
|
303
|
+
this.thumb.addEventListener("mouseover", this.#onMouseOver, { passive: true });
|
|
304
|
+
this.thumb.addEventListener("mouseout", this.#onMouseOut, { passive: true });
|
|
305
|
+
}
|
|
306
|
+
#unregisterThumbListeners() {
|
|
307
|
+
this.thumb.removeEventListener("mouseover", this.#onMouseOver);
|
|
308
|
+
this.thumb.removeEventListener("mouseout", this.#onMouseOut);
|
|
309
|
+
}
|
|
310
|
+
#onVisibilityChange;
|
|
311
|
+
#onMouseOver;
|
|
312
|
+
#onMouseOut;
|
|
181
313
|
};
|
|
182
|
-
__decorate([attr({ mode: "boolean" })], Popup.prototype, "open", void 0);
|
|
183
|
-
__decorate([attr({ mode: "boolean" })], Popup.prototype, "dismissible", void 0);
|
|
184
|
-
__decorate([attr({ mode: "boolean" })], Popup.prototype, "arrow", void 0);
|
|
185
|
-
__decorate([attr({ mode: "boolean" })], Popup.prototype, "alternate", void 0);
|
|
186
|
-
__decorate([attr({ mode: "fromView" })], Popup.prototype, "placement", void 0);
|
|
187
|
-
__decorate([attr({
|
|
188
|
-
mode: "boolean",
|
|
189
|
-
attribute: "animation-frame"
|
|
190
|
-
})], Popup.prototype, "animationFrame", void 0);
|
|
191
|
-
__decorate([attr({
|
|
192
|
-
mode: "boolean",
|
|
193
|
-
attribute: "shift-cross-axis"
|
|
194
|
-
})], Popup.prototype, "shiftCrossAxis", void 0);
|
|
195
|
-
__decorate([attr({ mode: "fromView" })], Popup.prototype, "strategy", void 0);
|
|
196
314
|
__decorate([attr({
|
|
197
|
-
attribute: "
|
|
198
|
-
|
|
199
|
-
})],
|
|
200
|
-
__decorate([observable],
|
|
315
|
+
attribute: "readonly",
|
|
316
|
+
mode: "boolean"
|
|
317
|
+
})], Slider.prototype, "readOnly", void 0);
|
|
318
|
+
__decorate([observable], Slider.prototype, "direction", void 0);
|
|
319
|
+
__decorate([observable], Slider.prototype, "isDragging", void 0);
|
|
320
|
+
__decorate([observable], Slider.prototype, "position", void 0);
|
|
321
|
+
__decorate([observable], Slider.prototype, "trackWidth", void 0);
|
|
322
|
+
__decorate([observable], Slider.prototype, "trackMinWidth", void 0);
|
|
323
|
+
__decorate([observable], Slider.prototype, "trackHeight", void 0);
|
|
324
|
+
__decorate([observable], Slider.prototype, "trackLeft", void 0);
|
|
325
|
+
__decorate([observable], Slider.prototype, "trackMinHeight", void 0);
|
|
326
|
+
__decorate([observable], Slider.prototype, "valueTextFormatter", void 0);
|
|
327
|
+
__decorate([attr({ converter: nullableNumberConverter })], Slider.prototype, "min", void 0);
|
|
328
|
+
__decorate([attr({ converter: nullableNumberConverter })], Slider.prototype, "max", void 0);
|
|
329
|
+
__decorate([attr({ converter: defaultToOneConverter })], Slider.prototype, "step", void 0);
|
|
330
|
+
__decorate([attr], Slider.prototype, "orientation", void 0);
|
|
331
|
+
__decorate([attr], Slider.prototype, "mode", void 0);
|
|
332
|
+
__decorate([attr({ mode: "boolean" })], Slider.prototype, "markers", void 0);
|
|
333
|
+
__decorate([attr({ mode: "boolean" })], Slider.prototype, "pin", void 0);
|
|
334
|
+
__decorate([attr], Slider.prototype, "connotation", void 0);
|
|
335
|
+
__decorate([observable], Slider.prototype, "_focusVisible", void 0);
|
|
336
|
+
__decorate([observable], Slider.prototype, "_hoveringOnThumb", void 0);
|
|
337
|
+
__decorate([volatile], Slider.prototype, "_isThumbPopupOpen", null);
|
|
201
338
|
//#endregion
|
|
202
|
-
//#region src/lib/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
return x.strategy && x.strategy === "fixed" ? "manual" : null;
|
|
209
|
-
}
|
|
210
|
-
var popupTemplate = (context) => {
|
|
211
|
-
const elevationTag = context.tagFor(Elevation);
|
|
212
|
-
const buttonTag = context.tagFor(Button);
|
|
213
|
-
return html`
|
|
214
|
-
<${elevationTag}>
|
|
215
|
-
<div popover="${handlePopover}" class="popup-wrapper ${(x) => x.strategy}" ${ref("popupEl")} part="popup-base">
|
|
216
|
-
<div ${ref("controlEl")} class="${getClasses}" aria-hidden="${(x) => x.open ? "false" : "true"}"
|
|
217
|
-
part="${(x) => x.alternate ? "vvd-theme-alternate" : ""}">
|
|
218
|
-
<div class="popup-content">
|
|
219
|
-
<slot></slot>
|
|
220
|
-
${when((x) => x.dismissible, html`<${buttonTag} size="condensed" @click="${(x) => x.open = false}"
|
|
221
|
-
class="dismissible-button" icon="close-small-solid" shape="pill"></${buttonTag}>`)}
|
|
222
|
-
</div>
|
|
223
|
-
${when((x) => x.arrow, html`<div class="arrow" ${ref("arrowEl")}></div>`)}
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
</${elevationTag}>`;
|
|
227
|
-
};
|
|
228
|
-
//#endregion
|
|
229
|
-
//#region src/lib/popup/definition.ts
|
|
230
|
-
/**
|
|
231
|
-
* @internal
|
|
232
|
-
*/
|
|
233
|
-
var popupDefinition = defineVividComponent("popup", Popup, popupTemplate, [elevationDefinition, buttonDefinition], { styles: popup_default });
|
|
339
|
+
//#region src/lib/slider/definition.ts
|
|
340
|
+
/** @internal */
|
|
341
|
+
var sliderDefinition = defineVividComponent("slider", Slider, SliderTemplate, [popupDefinition], {
|
|
342
|
+
styles: slider_default,
|
|
343
|
+
shadowOptions: { delegatesFocus: true }
|
|
344
|
+
});
|
|
234
345
|
/**
|
|
235
|
-
* Registers the
|
|
346
|
+
* Registers the slider elements with the design system.
|
|
236
347
|
*
|
|
237
348
|
* @param prefix - the prefix to use for the component name
|
|
238
349
|
*/
|
|
239
|
-
var
|
|
350
|
+
var registerSlider = createRegisterFunction(sliderDefinition);
|
|
240
351
|
//#endregion
|
|
241
|
-
export {
|
|
352
|
+
export { sliderDefinition as n, Slider as r, registerSlider as t };
|