@vonage/vivid 4.12.1 → 4.14.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.
- package/custom-elements.json +7489 -4858
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/index.cjs +70 -136
- package/index.d.ts +0 -1
- package/index.js +60 -62
- package/lib/accordion/accordion.d.ts +2 -2
- package/lib/accordion/accordion.template.d.ts +1 -2
- package/lib/accordion/definition.d.ts +1 -1
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/accordion-item.template.d.ts +2 -3
- package/lib/accordion-item/definition.d.ts +1 -1
- package/lib/action-group/action-group.d.ts +2 -2
- package/lib/action-group/action-group.template.d.ts +1 -3
- package/lib/action-group/definition.d.ts +1 -1
- package/lib/alert/alert.d.ts +2 -2
- package/lib/alert/alert.template.d.ts +2 -3
- package/lib/alert/definition.d.ts +1 -1
- package/lib/audio-player/audio-player.d.ts +2 -2
- package/lib/audio-player/audio-player.template.d.ts +2 -3
- package/lib/audio-player/definition.d.ts +1 -3
- package/lib/avatar/avatar.d.ts +2 -2
- package/lib/avatar/avatar.template.d.ts +2 -3
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/badge/badge.d.ts +2 -2
- package/lib/badge/badge.template.d.ts +2 -3
- package/lib/badge/definition.d.ts +1 -3
- package/lib/banner/banner.d.ts +2 -2
- package/lib/banner/banner.template.d.ts +2 -3
- package/lib/banner/definition.d.ts +1 -1
- package/lib/breadcrumb/breadcrumb.d.ts +2 -2
- package/lib/breadcrumb/breadcrumb.template.d.ts +3 -4
- package/lib/breadcrumb/definition.d.ts +1 -1
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +2 -2
- package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +2 -3
- package/lib/breadcrumb-item/definition.d.ts +1 -1
- package/lib/button/button.d.ts +2 -2
- package/lib/button/button.template.d.ts +2 -4
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar/calendar.d.ts +2 -2
- package/lib/calendar/calendar.template.d.ts +1 -3
- package/lib/calendar/definition.d.ts +1 -1
- package/lib/calendar-event/calendar-event.d.ts +2 -2
- package/lib/calendar-event/calendar-event.template.d.ts +1 -3
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/card/card.d.ts +2 -2
- package/lib/card/card.template.d.ts +2 -3
- package/lib/card/definition.d.ts +1 -1
- package/lib/checkbox/checkbox.form-associated.d.ts +3 -2
- package/lib/checkbox/checkbox.template.d.ts +2 -3
- package/lib/checkbox/definition.d.ts +1 -1
- package/lib/combobox/combobox.d.ts +17 -2
- package/lib/combobox/combobox.options.d.ts +7 -0
- package/lib/combobox/combobox.template.d.ts +2 -3
- package/lib/combobox/definition.d.ts +1 -2
- package/lib/data-grid/data-grid-cell.d.ts +16 -13
- package/lib/data-grid/data-grid-cell.template.d.ts +2 -3
- package/lib/data-grid/data-grid-row.d.ts +19 -2
- package/lib/data-grid/data-grid-row.template.d.ts +2 -2
- package/lib/data-grid/data-grid.d.ts +45 -4
- package/lib/data-grid/data-grid.template.d.ts +2 -2
- package/lib/data-grid/definition.d.ts +1 -6
- package/lib/date-picker/definition.d.ts +1 -3
- package/lib/date-range-picker/definition.d.ts +1 -3
- package/lib/dial-pad/definition.d.ts +1 -3
- package/lib/dial-pad/dial-pad.d.ts +2 -2
- package/lib/dial-pad/dial-pad.template.d.ts +2 -3
- package/lib/dialog/definition.d.ts +1 -1
- package/lib/dialog/dialog.d.ts +2 -2
- package/lib/dialog/dialog.template.d.ts +2 -3
- package/lib/divider/definition.d.ts +1 -1
- package/lib/divider/divider.d.ts +2 -2
- package/lib/divider/divider.template.d.ts +1 -3
- package/lib/elevation/definition.d.ts +1 -1
- package/lib/elevation/elevation.d.ts +2 -2
- package/lib/elevation/elevation.template.d.ts +1 -3
- package/lib/empty-state/definition.d.ts +1 -3
- package/lib/empty-state/empty-state.d.ts +2 -2
- package/lib/empty-state/empty-state.template.d.ts +2 -3
- package/lib/fab/definition.d.ts +1 -3
- package/lib/fab/fab.template.d.ts +2 -3
- package/lib/file-picker/definition.d.ts +1 -3
- package/lib/file-picker/file-picker.d.ts +6 -0
- package/lib/file-picker/file-picker.form-associated.d.ts +3 -2
- package/lib/file-picker/file-picker.template.d.ts +2 -3
- package/lib/header/definition.d.ts +1 -3
- package/lib/header/header.d.ts +2 -2
- package/lib/header/header.template.d.ts +2 -3
- package/lib/icon/definition.d.ts +1 -3
- package/lib/icon/icon.d.ts +2 -2
- package/lib/icon/icon.template.d.ts +1 -3
- package/lib/layout/definition.d.ts +1 -3
- package/lib/layout/layout.d.ts +2 -2
- package/lib/layout/layout.template.d.ts +1 -3
- package/lib/listbox/definition.d.ts +1 -3
- package/lib/listbox/listbox.template.d.ts +1 -3
- package/lib/menu/definition.d.ts +1 -11
- package/lib/menu/menu.d.ts +16 -3
- package/lib/menu/menu.template.d.ts +3 -3
- package/lib/menu-item/definition.d.ts +1 -3
- package/lib/menu-item/menu-item.d.ts +10 -2
- package/lib/menu-item/menu-item.template.d.ts +2 -3
- package/lib/nav/definition.d.ts +1 -3
- package/lib/nav/nav.d.ts +2 -2
- package/lib/nav/nav.template.d.ts +1 -3
- package/lib/nav-disclosure/definition.d.ts +1 -3
- package/lib/nav-disclosure/nav-disclosure.d.ts +2 -2
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +2 -3
- package/lib/nav-item/definition.d.ts +1 -3
- package/lib/nav-item/nav-item.template.d.ts +2 -3
- package/lib/note/definition.d.ts +1 -3
- package/lib/note/note.d.ts +2 -2
- package/lib/note/note.template.d.ts +2 -3
- package/lib/number-field/definition.d.ts +1 -4
- package/lib/number-field/number-field.form-associated.d.ts +3 -2
- package/lib/number-field/number-field.template.d.ts +2 -3
- package/lib/option/definition.d.ts +1 -3
- package/lib/option/option.d.ts +28 -7
- package/lib/option/option.template.d.ts +2 -3
- package/lib/pagination/definition.d.ts +1 -3
- package/lib/pagination/pagination.d.ts +2 -2
- package/lib/pagination/pagination.template.d.ts +2 -3
- package/lib/popup/definition.d.ts +1 -3
- package/lib/popup/popup.template.d.ts +2 -3
- package/lib/progress/definition.d.ts +1 -3
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress/progress.template.d.ts +1 -4
- package/lib/progress-ring/definition.d.ts +1 -3
- package/lib/progress-ring/progress-ring.d.ts +1 -1
- package/lib/progress-ring/progress-ring.template.d.ts +1 -3
- package/lib/radio/definition.d.ts +1 -3
- package/lib/radio/radio.form-associated.d.ts +3 -2
- package/lib/radio/radio.template.d.ts +1 -3
- package/lib/radio-group/definition.d.ts +1 -11
- package/lib/radio-group/radio-group.d.ts +2 -2
- package/lib/radio-group/radio-group.template.d.ts +2 -3
- package/lib/range-slider/definition.d.ts +1 -3
- package/lib/range-slider/range-slider.form-associated.d.ts +3 -2
- package/lib/range-slider/range-slider.template.d.ts +2 -3
- package/lib/searchable-select/definition.d.ts +1 -4
- package/lib/searchable-select/option-tag.template.d.ts +2 -3
- package/lib/searchable-select/searchable-select.form-associated.d.ts +3 -2
- package/lib/searchable-select/searchable-select.template.d.ts +2 -3
- package/lib/select/definition.d.ts +1 -3
- package/lib/select/select.d.ts +14 -4
- package/lib/select/select.form-associated.d.ts +11 -0
- package/lib/select/select.template.d.ts +2 -3
- package/lib/selectable-box/definition.d.ts +1 -3
- package/lib/selectable-box/selectable-box.d.ts +2 -2
- package/lib/selectable-box/selectable-box.template.d.ts +2 -3
- package/lib/side-drawer/definition.d.ts +1 -3
- package/lib/side-drawer/side-drawer.d.ts +2 -2
- package/lib/side-drawer/side-drawer.template.d.ts +1 -3
- package/lib/slider/definition.d.ts +1 -3
- package/lib/slider/slider.form-associated.d.ts +3 -2
- package/lib/slider/slider.template.d.ts +3 -4
- package/lib/split-button/definition.d.ts +1 -1
- package/lib/split-button/split-button.d.ts +2 -2
- package/lib/split-button/split-button.template.d.ts +2 -3
- package/lib/switch/definition.d.ts +1 -3
- package/lib/switch/switch.d.ts +5 -2
- package/lib/switch/switch.form-associated.d.ts +11 -0
- package/lib/switch/switch.template.d.ts +1 -3
- package/lib/tab/definition.d.ts +1 -3
- package/lib/tab/tab.d.ts +2 -2
- package/lib/tab/tab.template.d.ts +2 -2
- package/lib/tab-panel/definition.d.ts +1 -3
- package/lib/tab-panel/tab-panel.d.ts +2 -2
- package/lib/tab-panel/tab-panel.template.d.ts +1 -1
- package/lib/tabs/definition.d.ts +1 -3
- package/lib/tabs/tabs.d.ts +6 -4
- package/lib/tabs/tabs.template.d.ts +1 -1
- package/lib/tag/definition.d.ts +1 -4
- package/lib/tag/tag.d.ts +2 -2
- package/lib/tag/tag.template.d.ts +2 -3
- package/lib/tag-group/definition.d.ts +1 -3
- package/lib/tag-group/tag-group.d.ts +2 -2
- package/lib/tag-group/tag-group.template.d.ts +1 -3
- package/lib/text-anchor/definition.d.ts +1 -3
- package/lib/text-anchor/text-anchor.d.ts +4 -3
- package/lib/text-anchor/text-anchor.template.d.ts +2 -3
- package/lib/text-area/definition.d.ts +1 -3
- package/lib/text-area/text-area.d.ts +25 -3
- package/lib/text-area/text-area.form-associated.d.ts +11 -0
- package/lib/text-area/text-area.template.d.ts +2 -3
- package/lib/text-field/definition.d.ts +1 -3
- package/lib/text-field/text-field.d.ts +28 -3
- package/lib/text-field/text-field.form-associated.d.ts +11 -0
- package/lib/text-field/text-field.template.d.ts +2 -3
- package/lib/time-picker/definition.d.ts +1 -3
- package/lib/time-picker/time-picker.form-associated.d.ts +3 -2
- package/lib/time-picker/time-picker.template.d.ts +2 -2
- package/lib/toggletip/definition.d.ts +1 -3
- package/lib/toggletip/toggletip.d.ts +2 -2
- package/lib/toggletip/toggletip.template.d.ts +2 -3
- package/lib/tooltip/definition.d.ts +1 -3
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/lib/tooltip/tooltip.template.d.ts +2 -3
- package/lib/tree-item/definition.d.ts +1 -3
- package/lib/tree-item/tree-item.d.ts +11 -2
- package/lib/tree-item/tree-item.template.d.ts +3 -3
- package/lib/tree-view/definition.d.ts +1 -3
- package/lib/tree-view/tree-view.d.ts +16 -2
- package/lib/tree-view/tree-view.template.d.ts +1 -1
- package/lib/video-player/definition.d.ts +1 -3
- package/lib/video-player/video-player.d.ts +2 -2
- package/lib/video-player/video-player.template.d.ts +1 -3
- package/listbox/index.cjs +37 -39
- package/listbox/index.js +37 -39
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.cjs +1 -1
- package/note/index.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/affix.cjs +10 -10
- package/shared/affix.js +2 -2
- package/shared/anchor.cjs +59 -0
- package/shared/anchor.js +57 -0
- package/shared/anchored.cjs +6 -6
- package/shared/anchored.js +2 -2
- package/shared/apply-mixins.cjs +15 -17
- package/shared/apply-mixins.js +15 -17
- package/shared/apply-mixins2.cjs +25 -0
- package/shared/apply-mixins2.js +23 -0
- package/shared/applyMixinsWithObservables.cjs +4 -4
- package/shared/applyMixinsWithObservables.js +2 -2
- package/shared/aria-global.cjs +86 -67
- package/shared/aria-global.js +86 -67
- package/shared/aria-global2.cjs +68 -86
- package/shared/aria-global2.js +68 -86
- package/shared/base-progress.cjs +70 -63
- package/shared/base-progress.js +69 -62
- package/shared/breadcrumb-item.cjs +7 -58
- package/shared/breadcrumb-item.js +4 -55
- package/shared/button.cjs +178 -0
- package/shared/button.js +176 -0
- package/shared/calendar-event.cjs +10 -9
- package/shared/calendar-event.js +3 -2
- package/shared/children.cjs +2 -2
- package/shared/children.js +1 -1
- package/shared/date-picker/date-picker-base.form-associated.d.ts +3 -2
- package/shared/date-picker/date-picker-base.template.d.ts +2 -3
- package/shared/defineVividComponent.cjs +2612 -0
- package/shared/defineVividComponent.js +2592 -0
- package/shared/definition.cjs +26 -24
- package/shared/definition.js +17 -14
- package/shared/definition10.cjs +15 -12
- package/shared/definition10.js +15 -11
- package/shared/definition11.cjs +53 -249
- package/shared/definition11.js +25 -219
- package/shared/definition12.cjs +18 -14
- package/shared/definition12.js +17 -12
- package/shared/definition13.cjs +20 -19
- package/shared/definition13.js +11 -9
- package/shared/definition14.cjs +36 -38
- package/shared/definition14.js +16 -17
- package/shared/definition15.cjs +28 -26
- package/shared/definition15.js +17 -14
- package/shared/definition16.cjs +478 -611
- package/shared/definition16.js +471 -603
- package/shared/definition17.cjs +934 -1113
- package/shared/definition17.js +913 -1091
- package/shared/definition18.cjs +16 -20
- package/shared/definition18.js +19 -22
- package/shared/definition19.cjs +26 -30
- package/shared/definition19.js +21 -24
- package/shared/definition2.cjs +20 -22
- package/shared/definition2.js +21 -22
- package/shared/definition20.cjs +53 -53
- package/shared/definition20.js +36 -35
- package/shared/definition21.cjs +43 -46
- package/shared/definition21.js +19 -21
- package/shared/definition22.cjs +16 -13
- package/shared/definition22.js +15 -11
- package/shared/definition23.cjs +22 -20
- package/shared/definition23.js +15 -12
- package/shared/definition24.cjs +20 -172
- package/shared/definition24.js +17 -168
- package/shared/definition25.cjs +48 -28
- package/shared/definition25.js +43 -22
- package/shared/definition26.cjs +17 -14
- package/shared/definition26.js +15 -11
- package/shared/definition27.cjs +265 -12
- package/shared/definition27.js +262 -10
- package/shared/definition28.cjs +19 -16
- package/shared/definition28.js +15 -11
- package/shared/definition29.cjs +478 -604
- package/shared/definition29.js +450 -578
- package/shared/definition3.cjs +21 -16
- package/shared/definition3.js +17 -11
- package/shared/definition30.cjs +100 -75
- package/shared/definition30.js +99 -73
- package/shared/definition31.cjs +24 -97
- package/shared/definition31.js +25 -97
- package/shared/definition32.cjs +10 -25
- package/shared/definition32.js +9 -23
- package/shared/definition33.cjs +53 -14
- package/shared/definition33.js +52 -12
- package/shared/definition34.cjs +641 -34
- package/shared/definition34.js +638 -30
- package/shared/definition35.cjs +205 -377
- package/shared/definition35.js +200 -373
- package/shared/definition36.cjs +204 -104
- package/shared/definition36.js +199 -97
- package/shared/definition37.cjs +79 -206
- package/shared/definition37.js +75 -202
- package/shared/definition38.cjs +50 -56
- package/shared/definition38.js +48 -52
- package/shared/definition39.cjs +260 -56
- package/shared/definition39.js +259 -54
- package/shared/definition4.cjs +33 -35
- package/shared/definition4.js +20 -21
- package/shared/definition40.cjs +112 -229
- package/shared/definition40.js +109 -226
- package/shared/definition41.cjs +627 -36
- package/shared/definition41.js +626 -34
- package/shared/definition42.cjs +975 -487
- package/shared/definition42.js +972 -482
- package/shared/definition43.cjs +725 -932
- package/shared/definition43.js +713 -918
- package/shared/definition44.cjs +116 -734
- package/shared/definition44.js +114 -731
- package/shared/definition45.cjs +93 -116
- package/shared/definition45.js +93 -115
- package/shared/definition46.cjs +469 -89
- package/shared/definition46.js +466 -86
- package/shared/definition47.cjs +119 -479
- package/shared/definition47.js +116 -474
- package/shared/definition48.cjs +114 -120
- package/shared/definition48.js +112 -117
- package/shared/definition49.cjs +18 -160
- package/shared/definition49.js +16 -157
- package/shared/definition5.cjs +48 -49
- package/shared/definition5.js +19 -19
- package/shared/definition50.cjs +112 -15
- package/shared/definition50.js +110 -12
- package/shared/definition51.cjs +847 -84
- package/shared/definition51.js +843 -79
- package/shared/definition52.cjs +31 -859
- package/shared/definition52.js +29 -856
- package/shared/definition53.cjs +126 -28
- package/shared/definition53.js +124 -25
- package/shared/definition54.cjs +268 -107
- package/shared/definition54.js +262 -100
- package/shared/definition55.cjs +63 -298
- package/shared/definition55.js +61 -295
- package/shared/definition56.cjs +799 -311
- package/shared/definition56.js +795 -306
- package/shared/definition57.cjs +108 -825
- package/shared/definition57.js +106 -822
- package/shared/definition58.cjs +74 -100
- package/shared/definition58.js +70 -95
- package/shared/definition59.cjs +181 -106
- package/shared/definition59.js +175 -101
- package/shared/definition6.cjs +23 -21
- package/shared/definition6.js +15 -12
- package/shared/definition60.cjs +273 -70
- package/shared/definition60.js +273 -69
- package/shared/definition61.cjs +66157 -271
- package/shared/definition61.js +66156 -269
- package/shared/definition62.cjs +36 -66174
- package/shared/definition62.js +33 -66171
- package/shared/definition63.cjs +2154 -27
- package/shared/definition63.js +2151 -25
- package/shared/definition7.cjs +19 -15
- package/shared/definition7.js +14 -10
- package/shared/definition8.cjs +26 -27
- package/shared/definition8.js +17 -17
- package/shared/definition9.cjs +21 -21
- package/shared/definition9.js +18 -17
- package/shared/design-system/createRegisterFunction.d.ts +2 -0
- package/shared/design-system/defineVividComponent.d.ts +15 -0
- package/shared/direction.cjs +10 -1
- package/shared/direction.js +10 -1
- package/shared/dom.cjs +0 -13
- package/shared/dom.js +1 -13
- package/shared/form-associated.cjs +422 -457
- package/shared/form-associated.js +422 -457
- package/shared/form-associated2.cjs +383 -0
- package/shared/form-associated2.js +381 -0
- package/shared/form-elements.cjs +15 -42
- package/shared/form-elements.js +2 -29
- package/shared/foundation/anchor/anchor.d.ts +1 -0
- package/shared/foundation/button/button.d.ts +3 -2
- package/shared/foundation/button/button.template.d.ts +2 -4
- package/shared/foundation/form-associated/form-associated.d.ts +51 -0
- package/shared/foundation/listbox/listbox.d.ts +22 -0
- package/shared/foundation/progress/base-progress.d.ts +9 -0
- package/shared/foundation/utilities/apply-mixins.d.ts +1 -0
- package/shared/foundation/vivid-element/vivid-element.d.ts +3 -0
- package/shared/foundation-element.cjs +1417 -0
- package/shared/foundation-element.js +1414 -0
- package/shared/index.cjs +7 -5097
- package/shared/index.js +7 -5079
- package/shared/key-codes.cjs +10 -0
- package/shared/key-codes.js +6 -1
- package/shared/key-codes2.cjs +50 -6
- package/shared/key-codes2.js +50 -4
- package/shared/listbox.cjs +409 -981
- package/shared/listbox.js +410 -979
- package/shared/listbox2.cjs +1268 -0
- package/shared/listbox2.js +1265 -0
- package/shared/localized.cjs +2 -2
- package/shared/localized.js +1 -1
- package/shared/numbers.cjs +12 -0
- package/shared/numbers.js +12 -1
- package/shared/patterns/affix.d.ts +2 -2
- package/shared/patterns/chevron.d.ts +2 -2
- package/shared/patterns/form-elements/form-elements.d.ts +2 -2
- package/shared/presentationDate.cjs +56 -55
- package/shared/presentationDate.js +8 -7
- package/shared/ref.cjs +2 -2
- package/shared/ref.js +1 -1
- package/shared/repeat.cjs +22 -22
- package/shared/repeat.js +1 -1
- package/shared/slider.template.cjs +5 -5
- package/shared/slider.template.js +2 -2
- package/shared/slotted.cjs +4 -4
- package/shared/slotted.js +1 -1
- package/shared/strings.cjs +0 -26
- package/shared/strings.js +1 -25
- package/shared/strings2.cjs +37 -0
- package/shared/strings2.js +33 -0
- package/shared/text-anchor.cjs +8 -89
- package/shared/text-anchor.js +5 -86
- package/shared/text-anchor.template.cjs +2 -2
- package/shared/text-anchor.template.js +1 -1
- package/shared/text-field2.cjs +539 -194
- package/shared/text-field2.js +539 -194
- package/shared/vivid-element.cjs +8 -0
- package/shared/vivid-element.js +6 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +21 -1
- package/styles/core/theme.css +21 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-anchor/index.cjs +10 -7
- package/text-anchor/index.js +10 -7
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +2848 -7818
- package/shared/Reflector.cjs +0 -71
- package/shared/Reflector.js +0 -69
- package/shared/definition64.cjs +0 -2164
- package/shared/definition64.js +0 -2159
- package/shared/design-system/index.d.ts +0 -3
- package/shared/icon.cjs +0 -261
- package/shared/icon.js +0 -258
- package/shared/index2.cjs +0 -11
- package/shared/index2.js +0 -9
- package/shared/listbox-option.cjs +0 -204
- package/shared/listbox-option.js +0 -201
- package/shared/radio.cjs +0 -126
- package/shared/radio.js +0 -124
- package/shared/select.options.cjs +0 -12
- package/shared/select.options.js +0 -10
- package/shared/start-end.cjs +0 -52
- package/shared/start-end.js +0 -50
- package/shared/tree-item.cjs +0 -154
- package/shared/tree-item.js +0 -151
package/shared/definition47.js
CHANGED
|
@@ -1,506 +1,148 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { b as keyHome, a as keyEnd, c as keyArrowDown, e as keyArrowLeft, d as keyArrowUp, f as keyArrowRight } from './key-codes.js';
|
|
4
|
-
import { i as inverseLerp, l as lerp, r as roundToStepValue, S as SliderTemplate } from './slider.template.js';
|
|
5
|
-
import { F as FormAssociated } from './form-associated.js';
|
|
6
|
-
import { O as Orientation } from './aria.js';
|
|
7
|
-
import { g as getDirection } from './direction.js';
|
|
8
|
-
import { l as limit } from './numbers.js';
|
|
1
|
+
import { i as iconDefinition } from './definition27.js';
|
|
2
|
+
import { a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './defineVividComponent.js';
|
|
9
3
|
import { a as applyMixins } from './apply-mixins.js';
|
|
4
|
+
import { A as AffixIcon, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
5
|
+
import { V as VividElement } from './vivid-element.js';
|
|
10
6
|
import { L as Localized } from './localized.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* Expose ltr and rtl strings
|
|
14
|
-
*/
|
|
15
|
-
var Direction;
|
|
16
|
-
(function (Direction) {
|
|
17
|
-
Direction["ltr"] = "ltr";
|
|
18
|
-
Direction["rtl"] = "rtl";
|
|
19
|
-
})(Direction || (Direction = {}));
|
|
20
|
-
|
|
21
|
-
const styles = ":host{display:inline-block}:host(:not([orientation=vertical])){inline-size:100%}:host([orientation=vertical]){block-size:100%;min-block-size:calc(var(--_thumb-interaction-indicator-size) * 5)}:host([disabled]){cursor:not-allowed}.control.connotation-cta{--_connotation-color-primary: var(--vvd-slider-cta-primary, var(--vvd-color-cta-500))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-slider-accent-primary, var(--vvd-color-canvas-text))}.control{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control{--_thumb-size: 12px;--_thumb-interaction-indicator-size: 36px;--_track-start-inset-inline-start: 0;--_track-start-inset-block-start: 0;cursor:pointer;outline:none;user-select:none}.control .positioning-region{position:relative}.control .track{position:absolute;border-radius:4px;background:var(--_track-background-color)}.control .track-start{position:absolute;border-radius:inherit;background:var(--_track-start-background-color);block-size:100%;inset-inline-start:var(--_track-start-inset-inline-start)}.control.horizontal{block-size:var(--_thumb-interaction-indicator-size);inline-size:calc(100% - var(--_thumb-size));margin-inline-start:calc(var(--_thumb-size) / 2);min-inline-size:var(--_thumb-size)}.control.horizontal .track{top:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);right:0;left:0;block-size:2px}:host([markers]) .control.horizontal .track-start{--_track-start-inset-inline-start: 1px;border-bottom-left-radius:0;border-top-left-radius:0}.control.horizontal .track .mark{position:absolute;block-size:6px;inline-size:100%;inset-block-start:-2px;inset-inline-start:0}.control.vertical{margin-top:calc(var(--_thumb-interaction-indicator-size) / 2);block-size:calc(100% - var(--_thumb-interaction-indicator-size));inline-size:var(--_thumb-interaction-indicator-size);min-block-size:var(--_thumb-interaction-indicator-size)}.control.vertical .positioning-region{block-size:100%}.control.vertical .track{left:calc((var(--_thumb-interaction-indicator-size) - 2px) / 2);block-size:100%;inline-size:2px}.control.vertical .track .mark{position:absolute;block-size:100%;inline-size:6px;inset-block-start:0;inset-inline-start:-2px}.control.vertical .track-start{block-size:auto;inline-size:100%;inset-block-start:var(--_track-start-inset-block-start)}:host([markers]) .control.vertical .track-start{--_track-start-inset-block-start: 1px;border-radius:0}.control.disabled{--_track-background-color: var(--vvd-color-neutral-100);--_track-start-background-color: var(--vvd-color-neutral-300);pointer-events:none}.control:not(.disabled){--_track-background-color: var(--vvd-color-neutral-300);--_track-start-background-color: var(--_appearance-color-fill)}.control:not(.disabled) .mark{color:var(--vvd-color-neutral-950)}.control.disabled .mark{color:var(--_track-start-background-color)}.thumb-container{position:absolute;border-radius:50%;block-size:var(--_thumb-interaction-indicator-size);cursor:inherit;inline-size:var(--_thumb-interaction-indicator-size);outline:none;touch-action:none}.thumb-container.focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;--_thumb-interaction-indicator-alpha: .05;border-radius:50%}.control.horizontal .thumb-container{transform:translate(calc(var(--_thumb-interaction-indicator-size) / 2))}.control.vertical .thumb-container{transform:translateY(calc(var(--_thumb-interaction-indicator-size) / 2))}.control:not(.disabled) .thumb-container:hover{--_thumb-interaction-indicator-alpha: .12}.control:not(.disabled) .thumb-container:active{--_thumb-interaction-indicator-alpha: .25}.thumb-container:before{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-interaction-indicator-size);content:\"\";inline-size:var(--_thumb-interaction-indicator-size);opacity:var(--_thumb-interaction-indicator-alpha, 0);transition:opacity .2s ease-out 0s}.thumb-container:after{position:absolute;display:block;border-radius:inherit;background-color:var(--_track-start-background-color);block-size:var(--_thumb-size);content:\"\";inline-size:var(--_thumb-size);inset:calc((var(--_thumb-interaction-indicator-size) - var(--_thumb-size)) / 2)}.popup{pointer-events:none}.tooltip{width:auto;padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}";
|
|
22
|
-
|
|
23
|
-
class _Slider extends FoundationElement {
|
|
24
|
-
}
|
|
25
|
-
class FormAssociatedSlider extends FormAssociated(_Slider) {
|
|
26
|
-
constructor() {
|
|
27
|
-
super(...arguments);
|
|
28
|
-
this.proxy = document.createElement("input");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
7
|
+
import { r as ref } from './ref.js';
|
|
8
|
+
import { c as classNames } from './class-names.js';
|
|
31
9
|
|
|
32
10
|
var __defProp = Object.defineProperty;
|
|
33
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
34
11
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
35
|
-
var result =
|
|
12
|
+
var result = void 0 ;
|
|
36
13
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
37
14
|
if (decorator = decorators[i])
|
|
38
|
-
result = (
|
|
39
|
-
if (
|
|
15
|
+
result = (decorator(target, key, result) ) || result;
|
|
16
|
+
if (result) __defProp(target, key, result);
|
|
40
17
|
return result;
|
|
41
18
|
};
|
|
42
|
-
|
|
43
|
-
singleValue: "single-value"
|
|
44
|
-
};
|
|
45
|
-
class Slider extends FormAssociatedSlider {
|
|
19
|
+
class SplitButton extends VividElement {
|
|
46
20
|
constructor() {
|
|
47
21
|
super(...arguments);
|
|
48
|
-
this.
|
|
49
|
-
this.
|
|
50
|
-
this.trackWidth = 0;
|
|
51
|
-
this.trackMinWidth = 0;
|
|
52
|
-
this.trackHeight = 0;
|
|
53
|
-
this.trackLeft = 0;
|
|
54
|
-
this.trackMinHeight = 0;
|
|
55
|
-
this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
|
|
56
|
-
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
57
|
-
this.min = 0;
|
|
58
|
-
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
59
|
-
this.max = 10;
|
|
60
|
-
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
61
|
-
this.step = 1;
|
|
62
|
-
// eslint-disable-next-line @nrwl/nx/workspace/no-attribute-default-value
|
|
63
|
-
this.orientation = Orientation.horizontal;
|
|
64
|
-
this.mode = SliderMode.singleValue;
|
|
65
|
-
this.keypressHandler = (e) => {
|
|
66
|
-
this._focusVisible = true;
|
|
67
|
-
if (this.readOnly) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
if (e.key === keyHome) {
|
|
71
|
-
e.preventDefault();
|
|
72
|
-
this.value = `${this.min}`;
|
|
73
|
-
} else if (e.key === keyEnd) {
|
|
74
|
-
e.preventDefault();
|
|
75
|
-
this.value = `${this.max}`;
|
|
76
|
-
} else if (!e.shiftKey) {
|
|
77
|
-
switch (e.key) {
|
|
78
|
-
case keyArrowRight:
|
|
79
|
-
case keyArrowUp:
|
|
80
|
-
e.preventDefault();
|
|
81
|
-
this.increment();
|
|
82
|
-
break;
|
|
83
|
-
case keyArrowLeft:
|
|
84
|
-
case keyArrowDown:
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
this.decrement();
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
this.setupTrackConstraints = () => {
|
|
92
|
-
const clientRect = this.track.getBoundingClientRect();
|
|
93
|
-
this.trackWidth = this.track.clientWidth;
|
|
94
|
-
this.trackMinWidth = this.track.clientLeft;
|
|
95
|
-
this.trackHeight = clientRect.bottom;
|
|
96
|
-
this.trackMinHeight = clientRect.top;
|
|
97
|
-
this.trackLeft = this.getBoundingClientRect().left;
|
|
98
|
-
if (this.trackWidth === 0) {
|
|
99
|
-
this.trackWidth = 1;
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
this.setupListeners = (remove = false) => {
|
|
103
|
-
const eventAction = remove ? "removeEventListener" : "addEventListener";
|
|
104
|
-
this[eventAction]("keydown", this.keypressHandler);
|
|
105
|
-
this[eventAction]("mousedown", this.handleMouseDown);
|
|
106
|
-
this.thumb[eventAction](
|
|
107
|
-
"mousedown",
|
|
108
|
-
this.handleThumbMouseDown,
|
|
109
|
-
{
|
|
110
|
-
passive: true
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
this.thumb[eventAction](
|
|
114
|
-
"touchstart",
|
|
115
|
-
this.handleThumbMouseDown,
|
|
116
|
-
{
|
|
117
|
-
passive: true
|
|
118
|
-
}
|
|
119
|
-
);
|
|
120
|
-
if (remove) {
|
|
121
|
-
this.handleMouseDown(null);
|
|
122
|
-
this.handleThumbMouseDown(null);
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
/**
|
|
126
|
-
* @internal
|
|
127
|
-
*/
|
|
128
|
-
this.initialValue = "";
|
|
129
|
-
/**
|
|
130
|
-
* Handle mouse moves during a thumb drag operation
|
|
131
|
-
* If the event handler is null it removes the events
|
|
132
|
-
*/
|
|
133
|
-
this.handleThumbMouseDown = (event) => {
|
|
134
|
-
if (event) {
|
|
135
|
-
if (this.readOnly || this.disabled || event.defaultPrevented) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
this.#isNonVisibleFocus = true;
|
|
139
|
-
event.target.focus();
|
|
140
|
-
this.#isNonVisibleFocus = false;
|
|
141
|
-
}
|
|
142
|
-
const eventAction = event !== null ? "addEventListener" : "removeEventListener";
|
|
143
|
-
window[eventAction]("mouseup", this.handleWindowMouseUp);
|
|
144
|
-
window[eventAction]("mousemove", this.handleMouseMove, {
|
|
145
|
-
passive: true
|
|
146
|
-
});
|
|
147
|
-
window[eventAction]("touchmove", this.handleMouseMove, {
|
|
148
|
-
passive: true
|
|
149
|
-
});
|
|
150
|
-
window[eventAction]("touchend", this.handleWindowMouseUp);
|
|
151
|
-
this.isDragging = event !== null;
|
|
152
|
-
};
|
|
153
|
-
/**
|
|
154
|
-
* Handle mouse moves during a thumb drag operation
|
|
155
|
-
*/
|
|
156
|
-
this.handleMouseMove = (e) => {
|
|
157
|
-
if (this.readOnly || this.disabled || e.defaultPrevented) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
|
|
161
|
-
const value = this.#calculateValueFromMouseEvent(sourceEvent);
|
|
162
|
-
this.value = `${this.#roundToNearestStep(value)}`;
|
|
163
|
-
};
|
|
164
|
-
/**
|
|
165
|
-
* Handle a window mouse up during a drag operation
|
|
166
|
-
*/
|
|
167
|
-
this.handleWindowMouseUp = (_) => {
|
|
168
|
-
this.stopDragging();
|
|
169
|
-
};
|
|
170
|
-
this.stopDragging = () => {
|
|
171
|
-
this.isDragging = false;
|
|
172
|
-
this.handleMouseDown(null);
|
|
173
|
-
this.handleThumbMouseDown(null);
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
* @param e - MouseEvent or null. If there is no event handler it will remove the events
|
|
178
|
-
*/
|
|
179
|
-
this.handleMouseDown = (e) => {
|
|
180
|
-
const eventAction = e !== null ? "addEventListener" : "removeEventListener";
|
|
181
|
-
if (e === null || !this.disabled && !this.readOnly) {
|
|
182
|
-
window[eventAction]("mouseup", this.handleWindowMouseUp);
|
|
183
|
-
window.document[eventAction](
|
|
184
|
-
"mouseleave",
|
|
185
|
-
this.handleWindowMouseUp
|
|
186
|
-
);
|
|
187
|
-
window[eventAction]("mousemove", this.handleMouseMove);
|
|
188
|
-
if (e) {
|
|
189
|
-
e.preventDefault();
|
|
190
|
-
this.setupTrackConstraints();
|
|
191
|
-
this.#isNonVisibleFocus = true;
|
|
192
|
-
e.target.focus();
|
|
193
|
-
this.#isNonVisibleFocus = false;
|
|
194
|
-
const value = this.#calculateValueFromMouseEvent(e);
|
|
195
|
-
this.value = `${this.#roundToNearestStep(value)}`;
|
|
196
|
-
this.isDragging = true;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
};
|
|
22
|
+
this.splitIndicator = "chevron-down-line";
|
|
23
|
+
this.disabled = false;
|
|
200
24
|
this.ariaLabel = null;
|
|
201
|
-
this.
|
|
202
|
-
this.
|
|
203
|
-
this.pin = false;
|
|
204
|
-
this._focusVisible = false;
|
|
205
|
-
this._hoveringOnThumb = false;
|
|
206
|
-
this.#isNonVisibleFocus = false;
|
|
207
|
-
/**
|
|
208
|
-
* @internal
|
|
209
|
-
*/
|
|
210
|
-
this._onFocusIn = () => {
|
|
211
|
-
if (!this.#isNonVisibleFocus) {
|
|
212
|
-
this._focusVisible = true;
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* @internal
|
|
217
|
-
*/
|
|
218
|
-
this._onFocusOut = () => {
|
|
219
|
-
this._focusVisible = false;
|
|
220
|
-
};
|
|
221
|
-
this.#onMouseOver = () => {
|
|
222
|
-
this._hoveringOnThumb = true;
|
|
223
|
-
};
|
|
224
|
-
this.#onMouseOut = () => {
|
|
225
|
-
this._hoveringOnThumb = false;
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
// Map to proxy element
|
|
229
|
-
/**
|
|
230
|
-
* @internal
|
|
231
|
-
*/
|
|
232
|
-
readOnlyChanged() {
|
|
233
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
234
|
-
this.proxy.readOnly = this.readOnly;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* The value property, typed as a number.
|
|
239
|
-
*
|
|
240
|
-
* @public
|
|
241
|
-
*/
|
|
242
|
-
get valueAsNumber() {
|
|
243
|
-
return parseFloat(super.value);
|
|
244
|
-
}
|
|
245
|
-
set valueAsNumber(next) {
|
|
246
|
-
this.value = next.toString();
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* @internal
|
|
250
|
-
*/
|
|
251
|
-
valueChanged(previous, next) {
|
|
252
|
-
super.valueChanged(previous, next);
|
|
253
|
-
if (this.$fastController.isConnected) {
|
|
254
|
-
const nextAsNumber = parseFloat(next);
|
|
255
|
-
const value = this.#roundToNearestStep(nextAsNumber).toString();
|
|
256
|
-
if (value !== next) {
|
|
257
|
-
this.value = value;
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
this.setThumbPositionForOrientation(this.direction);
|
|
261
|
-
this.$emit("change");
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
// Map to proxy element.
|
|
265
|
-
/**
|
|
266
|
-
* @internal
|
|
267
|
-
*/
|
|
268
|
-
minChanged() {
|
|
269
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
270
|
-
this.proxy.min = `${this.min}`;
|
|
271
|
-
}
|
|
272
|
-
this.validate();
|
|
273
|
-
}
|
|
274
|
-
// Map to proxy element.
|
|
275
|
-
/**
|
|
276
|
-
* @internal
|
|
277
|
-
*/
|
|
278
|
-
maxChanged() {
|
|
279
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
280
|
-
this.proxy.max = `${this.max}`;
|
|
281
|
-
}
|
|
282
|
-
this.validate();
|
|
283
|
-
}
|
|
284
|
-
// Map to proxy element.
|
|
285
|
-
/**
|
|
286
|
-
* @internal
|
|
287
|
-
*/
|
|
288
|
-
stepChanged() {
|
|
289
|
-
if (this.proxy instanceof HTMLInputElement) {
|
|
290
|
-
this.proxy.step = `${this.step}`;
|
|
291
|
-
}
|
|
292
|
-
this.updateStepMultiplier();
|
|
293
|
-
this.validate();
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* @internal
|
|
297
|
-
*/
|
|
298
|
-
orientationChanged() {
|
|
299
|
-
if (this.$fastController.isConnected) {
|
|
300
|
-
this.setThumbPositionForOrientation(this.direction);
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
/**
|
|
304
|
-
* @internal
|
|
305
|
-
*/
|
|
306
|
-
connectedCallback() {
|
|
307
|
-
super.connectedCallback();
|
|
308
|
-
this.proxy.setAttribute("type", "range");
|
|
309
|
-
this.direction = getDirection(this);
|
|
310
|
-
this.updateStepMultiplier();
|
|
311
|
-
this.setupTrackConstraints();
|
|
312
|
-
this.setupListeners();
|
|
313
|
-
this.setupDefaultValue();
|
|
314
|
-
this.setThumbPositionForOrientation(this.direction);
|
|
315
|
-
this.#registerThumbListeners();
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* @internal
|
|
319
|
-
*/
|
|
320
|
-
disconnectedCallback() {
|
|
321
|
-
this.setupListeners(true);
|
|
322
|
-
this.#unregisterThumbListeners();
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Increment the value by the step
|
|
326
|
-
*
|
|
327
|
-
* @public
|
|
328
|
-
*/
|
|
329
|
-
increment() {
|
|
330
|
-
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) + Number(this.step) : Number(this.value) - Number(this.step);
|
|
331
|
-
this.value = this.#roundToNearestStep(newVal).toString();
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Decrement the value by the step
|
|
335
|
-
*
|
|
336
|
-
* @public
|
|
337
|
-
*/
|
|
338
|
-
decrement() {
|
|
339
|
-
const newVal = this.direction !== Direction.rtl && this.orientation !== Orientation.vertical ? Number(this.value) - Number(this.step) : Number(this.value) + Number(this.step);
|
|
340
|
-
this.value = this.#roundToNearestStep(newVal).toString();
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* Places the thumb based on the current value
|
|
344
|
-
*
|
|
345
|
-
* @public
|
|
346
|
-
* @param direction - writing mode
|
|
347
|
-
*/
|
|
348
|
-
setThumbPositionForOrientation(_) {
|
|
349
|
-
const percentage = this.#thumbTrackEndOffset(this.valueAsNumber);
|
|
350
|
-
if (this.orientation === Orientation.horizontal) {
|
|
351
|
-
this.position = this.isDragging ? `right: ${percentage}%; transition: none;` : `right: ${percentage}%; transition: all 0.2s ease;`;
|
|
352
|
-
} else {
|
|
353
|
-
this.position = this.isDragging ? `bottom: ${percentage}%; transition: none;` : `bottom: ${percentage}%; transition: all 0.2s ease;`;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
#thumbTrackEndOffset(value) {
|
|
357
|
-
return (1 - inverseLerp(this.min, this.max, value)) * 100;
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Update the step multiplier used to ensure rounding errors from steps that
|
|
361
|
-
* are not whole numbers
|
|
362
|
-
*/
|
|
363
|
-
updateStepMultiplier() {
|
|
364
|
-
const stepString = this.step + "";
|
|
365
|
-
const decimalPlacesOfStep = this.step % 1 ? stepString.length - stepString.indexOf(".") - 1 : 0;
|
|
366
|
-
this.stepMultiplier = Math.pow(10, decimalPlacesOfStep);
|
|
25
|
+
this.ariaExpanded = null;
|
|
26
|
+
this.indicatorAriaLabel = null;
|
|
367
27
|
}
|
|
368
|
-
get
|
|
369
|
-
return
|
|
28
|
+
get action() {
|
|
29
|
+
return this._action;
|
|
370
30
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
if (this.value.length === 0) {
|
|
374
|
-
this.initialValue = this.midpoint;
|
|
375
|
-
} else {
|
|
376
|
-
const value = parseFloat(this.value);
|
|
377
|
-
if (!Number.isNaN(value) && (value < this.min || value > this.max)) {
|
|
378
|
-
this.value = this.midpoint;
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
#calculateValueFromMouseEvent(e) {
|
|
384
|
-
const trackClientRect = this.track.getBoundingClientRect();
|
|
385
|
-
const [minPos, maxPos, valuePos] = this.orientation === Orientation.horizontal ? [
|
|
386
|
-
this.track.clientLeft,
|
|
387
|
-
this.track.clientWidth,
|
|
388
|
-
e.pageX - document.documentElement.scrollLeft - this.getBoundingClientRect().left
|
|
389
|
-
] : [
|
|
390
|
-
trackClientRect.top,
|
|
391
|
-
trackClientRect.bottom,
|
|
392
|
-
e.pageY - document.documentElement.scrollTop
|
|
393
|
-
];
|
|
394
|
-
return lerp(this.min, this.max, inverseLerp(minPos, maxPos, valuePos));
|
|
395
|
-
}
|
|
396
|
-
#roundToNearestStep(value) {
|
|
397
|
-
return limit(
|
|
398
|
-
this.min,
|
|
399
|
-
this.max,
|
|
400
|
-
roundToStepValue(value - this.min, this.step) + this.min
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
get _isThumbPopupOpen() {
|
|
404
|
-
return this._focusVisible || this._hoveringOnThumb || this.isDragging;
|
|
31
|
+
get indicator() {
|
|
32
|
+
return this._indicator;
|
|
405
33
|
}
|
|
406
|
-
#isNonVisibleFocus;
|
|
407
|
-
#registerThumbListeners() {
|
|
408
|
-
this.thumb.addEventListener("mouseover", this.#onMouseOver, {
|
|
409
|
-
passive: true
|
|
410
|
-
});
|
|
411
|
-
this.thumb.addEventListener("mouseout", this.#onMouseOut, {
|
|
412
|
-
passive: true
|
|
413
|
-
});
|
|
414
|
-
}
|
|
415
|
-
#unregisterThumbListeners() {
|
|
416
|
-
this.thumb.removeEventListener("mouseover", this.#onMouseOver);
|
|
417
|
-
this.thumb.removeEventListener("mouseout", this.#onMouseOut);
|
|
418
|
-
}
|
|
419
|
-
#onMouseOver;
|
|
420
|
-
#onMouseOut;
|
|
421
34
|
}
|
|
422
35
|
__decorateClass([
|
|
423
|
-
attr
|
|
424
|
-
],
|
|
425
|
-
__decorateClass([
|
|
426
|
-
observable
|
|
427
|
-
], Slider.prototype, "direction", 2);
|
|
428
|
-
__decorateClass([
|
|
429
|
-
observable
|
|
430
|
-
], Slider.prototype, "isDragging", 2);
|
|
431
|
-
__decorateClass([
|
|
432
|
-
observable
|
|
433
|
-
], Slider.prototype, "position", 2);
|
|
434
|
-
__decorateClass([
|
|
435
|
-
observable
|
|
436
|
-
], Slider.prototype, "trackWidth", 2);
|
|
437
|
-
__decorateClass([
|
|
438
|
-
observable
|
|
439
|
-
], Slider.prototype, "trackMinWidth", 2);
|
|
440
|
-
__decorateClass([
|
|
441
|
-
observable
|
|
442
|
-
], Slider.prototype, "trackHeight", 2);
|
|
443
|
-
__decorateClass([
|
|
444
|
-
observable
|
|
445
|
-
], Slider.prototype, "trackLeft", 2);
|
|
446
|
-
__decorateClass([
|
|
447
|
-
observable
|
|
448
|
-
], Slider.prototype, "trackMinHeight", 2);
|
|
449
|
-
__decorateClass([
|
|
450
|
-
observable
|
|
451
|
-
], Slider.prototype, "valueTextFormatter", 2);
|
|
452
|
-
__decorateClass([
|
|
453
|
-
attr({ converter: nullableNumberConverter })
|
|
454
|
-
], Slider.prototype, "min", 2);
|
|
455
|
-
__decorateClass([
|
|
456
|
-
attr({ converter: nullableNumberConverter })
|
|
457
|
-
], Slider.prototype, "max", 2);
|
|
458
|
-
__decorateClass([
|
|
459
|
-
attr({ converter: nullableNumberConverter })
|
|
460
|
-
], Slider.prototype, "step", 2);
|
|
36
|
+
attr
|
|
37
|
+
], SplitButton.prototype, "connotation");
|
|
461
38
|
__decorateClass([
|
|
462
39
|
attr
|
|
463
|
-
],
|
|
40
|
+
], SplitButton.prototype, "shape");
|
|
464
41
|
__decorateClass([
|
|
465
42
|
attr
|
|
466
|
-
],
|
|
43
|
+
], SplitButton.prototype, "appearance");
|
|
467
44
|
__decorateClass([
|
|
468
|
-
attr
|
|
469
|
-
],
|
|
45
|
+
attr
|
|
46
|
+
], SplitButton.prototype, "size");
|
|
470
47
|
__decorateClass([
|
|
471
|
-
attr
|
|
472
|
-
],
|
|
48
|
+
attr
|
|
49
|
+
], SplitButton.prototype, "label");
|
|
473
50
|
__decorateClass([
|
|
474
|
-
attr
|
|
475
|
-
|
|
476
|
-
})
|
|
477
|
-
], Slider.prototype, "markers", 2);
|
|
51
|
+
attr
|
|
52
|
+
], SplitButton.prototype, "icon");
|
|
478
53
|
__decorateClass([
|
|
479
|
-
attr({ mode: "
|
|
480
|
-
],
|
|
54
|
+
attr({ attribute: "split-indicator", mode: "fromView" })
|
|
55
|
+
], SplitButton.prototype, "splitIndicator");
|
|
481
56
|
__decorateClass([
|
|
482
|
-
attr
|
|
483
|
-
],
|
|
57
|
+
attr({ attribute: "disabled", mode: "boolean" })
|
|
58
|
+
], SplitButton.prototype, "disabled");
|
|
484
59
|
__decorateClass([
|
|
485
|
-
|
|
486
|
-
],
|
|
60
|
+
attr({ attribute: "aria-label" })
|
|
61
|
+
], SplitButton.prototype, "ariaLabel");
|
|
487
62
|
__decorateClass([
|
|
488
|
-
|
|
489
|
-
],
|
|
63
|
+
attr({ attribute: "aria-expanded" })
|
|
64
|
+
], SplitButton.prototype, "ariaExpanded");
|
|
490
65
|
__decorateClass([
|
|
491
|
-
|
|
492
|
-
],
|
|
493
|
-
applyMixins(
|
|
66
|
+
attr({ attribute: "indicator-aria-label" })
|
|
67
|
+
], SplitButton.prototype, "indicatorAriaLabel");
|
|
68
|
+
applyMixins(SplitButton, AffixIcon, Localized);
|
|
69
|
+
|
|
70
|
+
const styles = ":host{--_vvd-split-button-accent-firm-wrapper: var( --vvd-split-button-accent-firm );--_vvd-split-button-cta-firm-wrapper: var( --vvd-split-button-cta-firm );--_vvd-split-button-success-firm-wrapper: var( --vvd-split-button-success-firm );--_vvd-split-button-alert-firm-wrapper: var( --vvd-split-button-alert-firm );--_vvd-split-button-announcement-firm-wrapper: var( --vvd-split-button-announcement-firm )}:where(.control,.indicator):not(.appearance-filled,.appearance-outlined){--vvd-split-button-accent-firm: var( --_vvd-split-button-accent-firm-wrapper, var(--vvd-split-button-accent-primary) );--vvd-split-button-cta-firm: var( --_vvd-split-button-cta-firm-wrapper, var(--vvd-split-button-cta-primary) );--vvd-split-button-success-firm: var( --_vvd-split-button-success-firm-wrapper, var(--vvd-split-button-success-primary) );--vvd-split-button-alert-firm: var( --_vvd-split-button-alert-firm-wrapper, var(--vvd-split-button-alert-primary) );--vvd-split-button-announcement-firm: var( --_vvd-split-button-announcement-firm-wrapper, var(--vvd-split-button-announcement-primary) )}:host{display:inline-block}.base{display:inline-flex;justify-content:flex-start;inline-size:inherit}.control.connotation-cta,.indicator.connotation-cta{--_connotation-color-primary: var(--vvd-split-button-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-split-button-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-split-button-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-contrast: var(--vvd-split-button-cta-contrast, var(--vvd-color-cta-800));--_connotation-color-fierce: var(--vvd-split-button-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-firm: var(--vvd-split-button-cta-firm, var(--vvd-color-cta-600));--_connotation-color-soft: var(--vvd-split-button-cta-soft, var(--vvd-color-cta-100));--_connotation-color-faint: var(--vvd-split-button-cta-faint, var(--vvd-color-cta-50))}.control.connotation-success,.indicator.connotation-success{--_connotation-color-primary: var(--vvd-split-button-success-primary, var(--vvd-color-success-500));--_connotation-color-primary-text: var(--vvd-split-button-success-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-split-button-success-primary-increment, var(--vvd-color-success-600));--_connotation-color-contrast: var(--vvd-split-button-success-contrast, var(--vvd-color-success-800));--_connotation-color-fierce: var(--vvd-split-button-success-fierce, var(--vvd-color-success-700));--_connotation-color-firm: var(--vvd-split-button-success-firm, var(--vvd-color-success-600));--_connotation-color-soft: var(--vvd-split-button-success-soft, var(--vvd-color-success-100));--_connotation-color-faint: var(--vvd-split-button-success-faint, var(--vvd-color-success-50))}.control.connotation-alert,.indicator.connotation-alert{--_connotation-color-primary: var(--vvd-split-button-alert-primary, var(--vvd-color-alert-500));--_connotation-color-primary-text: var(--vvd-split-button-alert-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-split-button-alert-primary-increment, var(--vvd-color-alert-600));--_connotation-color-contrast: var(--vvd-split-button-alert-contrast, var(--vvd-color-alert-800));--_connotation-color-fierce: var(--vvd-split-button-alert-fierce, var(--vvd-color-alert-700));--_connotation-color-firm: var(--vvd-split-button-alert-firm, var(--vvd-color-alert-600));--_connotation-color-soft: var(--vvd-split-button-alert-soft, var(--vvd-color-alert-100));--_connotation-color-faint: var(--vvd-split-button-alert-faint, var(--vvd-color-alert-50))}.control.connotation-announcement,.indicator.connotation-announcement{--_connotation-color-primary: var(--vvd-split-button-announcement-primary, var(--vvd-color-announcement-500));--_connotation-color-primary-text: var(--vvd-split-button-announcement-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-split-button-announcement-primary-increment, var(--vvd-color-announcement-600));--_connotation-color-contrast: var(--vvd-split-button-announcement-contrast, var(--vvd-color-announcement-800));--_connotation-color-fierce: var(--vvd-split-button-announcement-fierce, var(--vvd-color-announcement-700));--_connotation-color-firm: var(--vvd-split-button-announcement-firm, var(--vvd-color-announcement-600));--_connotation-color-soft: var(--vvd-split-button-announcement-soft, var(--vvd-color-announcement-100));--_connotation-color-faint: var(--vvd-split-button-announcement-faint, var(--vvd-color-announcement-50))}.control:not(.connotation-cta,.connotation-success,.connotation-alert,.connotation-announcement),.indicator:not(.connotation-cta,.connotation-success,.connotation-alert,.connotation-announcement){--_connotation-color-primary: var(--vvd-split-button-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-split-button-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-split-button-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-contrast: var(--vvd-split-button-accent-contrast, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-split-button-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-firm: var(--vvd-split-button-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-soft: var(--vvd-split-button-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-faint: var(--vvd-split-button-accent-faint, var(--vvd-color-neutral-50))}.control.appearance-filled,.indicator.appearance-filled{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control.appearance-outlined,.indicator.appearance-outlined{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-300)}.control,.indicator{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-filled,.indicator:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-filled{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-outlined,.indicator:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-outlined{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--vvd-color-neutral-300)}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)),.indicator:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:where(.disabled,:disabled).appearance-filled,.indicator:where(.disabled,:disabled).appearance-filled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: transparent}.control:where(.disabled,:disabled).appearance-outlined,.indicator:where(.disabled,:disabled).appearance-outlined{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--vvd-color-neutral-300)}.control:where(.disabled,:disabled),.indicator:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(:active,[aria-expanded=true]):where(:not(.disabled,:disabled)).appearance-filled,.indicator:where(:active,[aria-expanded=true]):where(:not(.disabled,:disabled)).appearance-filled{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-fierce);--_appearance-color-outline: transparent}.control:where(:active,[aria-expanded=true]):where(:not(.disabled,:disabled)).appearance-outlined,.indicator:where(:active,[aria-expanded=true]):where(:not(.disabled,:disabled)).appearance-outlined{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: var(--vvd-color-neutral-300)}.control:where(:active,[aria-expanded=true]):where(:not(.disabled,:disabled)),.indicator:where(:active,[aria-expanded=true]):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.control,.indicator{display:inline-flex;box-sizing:border-box;flex-shrink:0;align-items:center;justify-content:center;padding:0;border:1px solid var(--_appearance-color-outline);margin:0;background-color:var(--_appearance-color-fill);block-size:var(--_split-button-block-size);color:var(--_appearance-color-text);vertical-align:middle}@supports (user-select: none){.control,.indicator{user-select:none}}.control{border-bottom-left-radius:var(--_border-radius);border-inline-end:0;border-top-left-radius:var(--_border-radius);gap:var(--_split-button-icon-gap)}.control:not(.appearance-filled){--focus-stroke-gap-color: transparent}.control.appearance-outlined{--focus-inset: -1px}.control:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.control:not(:disabled){cursor:pointer}.control:disabled{cursor:not-allowed}.control.icon-only{contain:size;place-content:center}@supports (aspect-ratio: 1){.control.icon-only{aspect-ratio:1}}@supports not (aspect-ratio: 1){.control.icon-only{inline-size:var(--_split-button-block-size)}}.control:not(.icon-only){flex-grow:1;inline-size:inherit}.control.size-super-condensed{--_split-button-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-condensed-bold)}.control.size-super-condensed:not(.icon-only){--_split-button-icon-gap: 4px;padding-inline:8px}.control.size-condensed{--_split-button-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-condensed-bold)}.control.size-condensed:not(.icon-only){--_split-button-icon-gap: 8px;padding-inline:12px}.control.size-expanded{--_split-button-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-extended-bold)}.control.size-expanded:not(.icon-only){--_split-button-icon-gap: 10px;padding-inline:20px}.control:not(.size-condensed,.size-expanded,.size-super-condensed){--_split-button-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-bold)}.control:not(.size-condensed,.size-expanded,.size-super-condensed):not(.icon-only){--_split-button-icon-gap: 8px;padding-inline:16px}.control:not(.shape-pill){--_border-radius: 8px}.control:not(.shape-pill).size-super-condensed,.control:not(.shape-pill).super-condensed{--_border-radius: 4px}.control.shape-pill{--_border-radius: 24px}.control .text{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis;white-space:nowrap}.indicator{position:relative;border-bottom-right-radius:var(--_border-radius);border-inline-start:0;border-top-right-radius:var(--_border-radius);inline-size:var(--_split-button-inline-size);isolation:isolate}.indicator:not(.appearance-filled){--focus-stroke-gap-color: transparent}.indicator.appearance-outlined{--focus-inset: 1px}.indicator:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.indicator:not(:disabled){cursor:pointer}.indicator:disabled{cursor:not-allowed}.indicator:before{position:absolute;background-color:var(--_appearance-color-text);content:\"\";inline-size:1px;inset-inline-start:0;opacity:.35}.indicator:not(.appearance-filled,.appearance-outlined):before{block-size:50%}.indicator:is(.appearance-filled,.appearance-outlined):before{block-size:100%}.indicator.size-super-condensed{--_split-button-block-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_split-button-inline-size: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-condensed)}.indicator.size-condensed{--_split-button-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_split-button-inline-size: calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-condensed)}.indicator.size-expanded{--_split-button-block-size: calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_split-button-inline-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-extended)}.indicator:not(.size-condensed,.size-expanded,.size-super-condensed){--_split-button-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_split-button-inline-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;font:var(--vvd-typography-base-extended)}.indicator:not(.shape-pill){--_border-radius: 8px}.indicator:not(.shape-pill).size-super-condensed,.indicator:not(.shape-pill).super-condensed{--_border-radius: 4px}.indicator.shape-pill{--_border-radius: 24px}.icon{line-height:1}.icon-trailing .icon{order:1}.control>.icon{font-size:calc(var(--_split-button-block-size) / 2)}";
|
|
494
71
|
|
|
495
|
-
const
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
72
|
+
const getClasses = ({
|
|
73
|
+
connotation,
|
|
74
|
+
appearance,
|
|
75
|
+
shape,
|
|
76
|
+
disabled,
|
|
77
|
+
size,
|
|
78
|
+
label,
|
|
79
|
+
icon,
|
|
80
|
+
iconSlottedContent
|
|
81
|
+
}) => classNames(
|
|
82
|
+
[`connotation-${connotation}`, Boolean(connotation)],
|
|
83
|
+
["disabled", disabled],
|
|
84
|
+
[`shape-${shape}`, Boolean(shape)],
|
|
85
|
+
[`appearance-${appearance}`, Boolean(appearance)],
|
|
86
|
+
[`size-${size}`, Boolean(size)],
|
|
87
|
+
["icon-only", !label && !!(icon || iconSlottedContent?.length)]
|
|
88
|
+
);
|
|
89
|
+
function actionButton(context) {
|
|
90
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
91
|
+
return html`
|
|
92
|
+
<button
|
|
93
|
+
${ref("_action")}
|
|
94
|
+
class="control ${getClasses}"
|
|
95
|
+
aria-label="${(x) => x.ariaLabel}"
|
|
96
|
+
?disabled="${(x) => x.disabled}"
|
|
97
|
+
@click="${(x) => x.$emit("action-click", void 0, {
|
|
98
|
+
bubbles: false
|
|
99
|
+
})}"
|
|
100
|
+
>
|
|
101
|
+
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
102
|
+
<span class="text">${(x) => x.label}</span>
|
|
103
|
+
</button>
|
|
104
|
+
`;
|
|
105
|
+
}
|
|
106
|
+
function indicatorButton(context) {
|
|
107
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
108
|
+
return html`
|
|
109
|
+
<button
|
|
110
|
+
${ref("_indicator")}
|
|
111
|
+
class="indicator ${getClasses}"
|
|
112
|
+
?disabled="${(x) => x.disabled}"
|
|
113
|
+
aria-label="${(x) => x.indicatorAriaLabel || x.locale.splitButton.showMoreActionsLabel}"
|
|
114
|
+
aria-expanded="${(x) => x.ariaExpanded}"
|
|
115
|
+
@click="${(x) => x.$emit("indicator-click", void 0, {
|
|
116
|
+
bubbles: false
|
|
117
|
+
})}"
|
|
118
|
+
>
|
|
119
|
+
${(x) => affixIconTemplate(x.splitIndicator)}
|
|
120
|
+
</button>
|
|
121
|
+
`;
|
|
122
|
+
}
|
|
123
|
+
const SplitButtonTemplate = (context) => {
|
|
124
|
+
return html` <template role="presentation">
|
|
125
|
+
<div class="base" role="group">
|
|
126
|
+
${actionButton(context)} ${indicatorButton(context)}
|
|
127
|
+
<slot></slot>
|
|
128
|
+
</div>
|
|
129
|
+
</template>`;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const splitButtonDefinition = defineVividComponent(
|
|
133
|
+
"split-button",
|
|
134
|
+
SplitButton,
|
|
135
|
+
SplitButtonTemplate,
|
|
136
|
+
[iconDefinition],
|
|
137
|
+
{
|
|
138
|
+
styles,
|
|
139
|
+
shadowOptions: {
|
|
140
|
+
delegatesFocus: true
|
|
141
|
+
}
|
|
501
142
|
}
|
|
502
|
-
|
|
503
|
-
const
|
|
504
|
-
|
|
143
|
+
);
|
|
144
|
+
const registerSplitButton = createRegisterFunction(
|
|
145
|
+
splitButtonDefinition
|
|
146
|
+
);
|
|
505
147
|
|
|
506
|
-
export {
|
|
148
|
+
export { registerSplitButton as r, splitButtonDefinition as s };
|