@vonage/vivid 4.13.0 → 4.14.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/custom-elements.json +3088 -1610
- 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 +3 -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.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 +2 -2
- 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 +2 -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 +3 -2
- 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 +5 -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.form-associated.d.ts +3 -2
- 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 +3 -7
- 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 +1 -1
- package/lib/text-area/{text-field.form-associated.d.ts → text-area.form-associated.d.ts} +3 -2
- 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.form-associated.d.ts +3 -2
- 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 +69 -63
- package/shared/base-progress.js +69 -63
- package/shared/breadcrumb-item.cjs +6 -58
- package/shared/breadcrumb-item.js +3 -55
- package/shared/button.cjs +177 -0
- package/shared/button.js +175 -0
- package/shared/calendar-event.cjs +9 -9
- package/shared/calendar-event.js +2 -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/definition.cjs +25 -24
- package/shared/definition.js +16 -14
- package/shared/definition10.cjs +14 -12
- package/shared/definition10.js +14 -11
- package/shared/definition11.cjs +52 -248
- package/shared/definition11.js +24 -218
- package/shared/definition12.cjs +18 -14
- package/shared/definition12.js +17 -12
- package/shared/definition13.cjs +19 -19
- package/shared/definition13.js +10 -9
- package/shared/definition14.cjs +35 -38
- package/shared/definition14.js +15 -17
- package/shared/definition15.cjs +27 -26
- package/shared/definition15.js +16 -14
- package/shared/definition16.cjs +480 -612
- package/shared/definition16.js +473 -604
- package/shared/definition17.cjs +933 -1113
- package/shared/definition17.js +911 -1090
- 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 +19 -22
- package/shared/definition2.js +20 -22
- package/shared/definition20.cjs +50 -52
- package/shared/definition20.js +34 -35
- package/shared/definition21.cjs +43 -47
- package/shared/definition21.js +19 -22
- package/shared/definition22.cjs +15 -13
- package/shared/definition22.js +14 -11
- package/shared/definition23.cjs +21 -20
- package/shared/definition23.js +14 -12
- package/shared/definition24.cjs +21 -173
- package/shared/definition24.js +18 -169
- package/shared/definition25.cjs +26 -28
- package/shared/definition25.js +18 -19
- package/shared/definition26.cjs +16 -14
- package/shared/definition26.js +14 -11
- package/shared/definition27.cjs +264 -12
- package/shared/definition27.js +261 -10
- package/shared/definition28.cjs +19 -17
- package/shared/definition28.js +15 -12
- package/shared/definition29.cjs +142 -68
- package/shared/definition29.js +101 -29
- package/shared/definition3.cjs +20 -16
- package/shared/definition3.js +16 -11
- package/shared/definition30.cjs +98 -76
- package/shared/definition30.js +97 -74
- package/shared/definition31.cjs +24 -97
- package/shared/definition31.js +25 -97
- package/shared/definition32.cjs +9 -25
- package/shared/definition32.js +8 -23
- package/shared/definition33.cjs +52 -14
- package/shared/definition33.js +51 -12
- package/shared/definition34.cjs +639 -34
- package/shared/definition34.js +636 -30
- package/shared/definition35.cjs +203 -596
- package/shared/definition35.js +197 -591
- package/shared/definition36.cjs +197 -233
- package/shared/definition36.js +192 -226
- 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 +259 -56
- package/shared/definition39.js +258 -54
- package/shared/definition4.cjs +32 -35
- package/shared/definition4.js +19 -21
- package/shared/definition40.cjs +156 -225
- package/shared/definition40.js +152 -221
- package/shared/definition41.cjs +626 -36
- package/shared/definition41.js +625 -34
- package/shared/definition42.cjs +974 -487
- package/shared/definition42.js +971 -482
- package/shared/definition43.cjs +725 -932
- package/shared/definition43.js +713 -918
- package/shared/definition44.cjs +115 -734
- package/shared/definition44.js +113 -731
- package/shared/definition45.cjs +92 -116
- package/shared/definition45.js +92 -115
- package/shared/definition46.cjs +468 -89
- package/shared/definition46.js +465 -86
- package/shared/definition47.cjs +118 -470
- package/shared/definition47.js +115 -465
- package/shared/definition48.cjs +113 -120
- package/shared/definition48.js +111 -117
- package/shared/definition49.cjs +16 -134
- package/shared/definition49.js +15 -132
- package/shared/definition5.cjs +47 -49
- package/shared/definition5.js +18 -19
- package/shared/definition50.cjs +111 -15
- package/shared/definition50.js +109 -12
- package/shared/definition51.cjs +862 -84
- package/shared/definition51.js +858 -79
- package/shared/definition52.cjs +30 -873
- package/shared/definition52.js +28 -870
- package/shared/definition53.cjs +125 -28
- package/shared/definition53.js +123 -25
- package/shared/definition54.cjs +267 -107
- package/shared/definition54.js +261 -100
- package/shared/definition55.cjs +63 -278
- package/shared/definition55.js +61 -275
- package/shared/definition56.cjs +867 -76
- package/shared/definition56.js +866 -74
- package/shared/definition57.cjs +107 -826
- package/shared/definition57.js +105 -823
- package/shared/definition58.cjs +73 -100
- package/shared/definition58.js +69 -95
- package/shared/definition59.cjs +180 -106
- package/shared/definition59.js +174 -101
- package/shared/definition6.cjs +22 -21
- package/shared/definition6.js +14 -12
- package/shared/definition60.cjs +272 -70
- package/shared/definition60.js +272 -69
- package/shared/definition61.cjs +66154 -271
- package/shared/definition61.js +66153 -269
- package/shared/definition62.cjs +38 -66173
- package/shared/definition62.js +35 -66170
- package/shared/definition63.cjs +2153 -27
- package/shared/definition63.js +2150 -25
- package/shared/definition7.cjs +18 -15
- package/shared/definition7.js +13 -10
- package/shared/definition8.cjs +25 -27
- package/shared/definition8.js +16 -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/{localization.js → direction.js} +11 -11
- 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/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 +1463 -6
- package/shared/key-codes2.js +1461 -4
- package/shared/listbox.cjs +427 -1195
- package/shared/listbox.js +411 -1176
- package/shared/listbox2.cjs +1267 -0
- package/shared/listbox2.js +1264 -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 +49 -49
- package/shared/presentationDate.js +6 -6
- 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 +7 -89
- package/shared/text-anchor.js +4 -86
- package/shared/text-anchor.template.cjs +2 -2
- package/shared/text-anchor.template.js +1 -1
- package/shared/text-field2.cjs +28 -28
- package/shared/text-field2.js +5 -5
- package/shared/vivid-element.cjs +2616 -0
- package/shared/vivid-element.js +2595 -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 +40 -1
- package/styles/core/theme.css +40 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +25 -4
- package/styles/tokens/theme-light.css +25 -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 +2846 -7860
- package/shared/definition64.cjs +0 -2175
- package/shared/definition64.js +0 -2170
- 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/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/{localization.cjs → direction.cjs} +9 -9
package/shared/definition44.js
CHANGED
|
@@ -1,765 +1,147 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import { L as ListboxElement, b as Listbox, D as DelegatesARIAListbox, a as Listbox$1 } from './listbox.js';
|
|
6
|
-
import { a as applyMixinsWithObservables } from './applyMixinsWithObservables.js';
|
|
7
|
-
import { S as StartEnd } from './start-end.js';
|
|
8
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
9
|
-
import { F as FormAssociated } from './form-associated.js';
|
|
10
|
-
import { S as SelectPosition } from './select.options.js';
|
|
11
|
-
import { u as uniqueId } from './strings.js';
|
|
12
|
-
import { c as keyTab, b as keyEscape, k as keyEnter, d as keyEnd, g as keyHome, a as keySpace, f as keyArrowDown, e as keyArrowUp } from './key-codes2.js';
|
|
13
|
-
import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, g as getFeedbackTemplate } from './form-elements.js';
|
|
14
|
-
import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
15
|
-
import { d as chevronTemplateFactory } from './definition11.js';
|
|
16
|
-
import { h as handleEscapeKeyAndStopPropogation } from './index2.js';
|
|
17
|
-
import { r as ref } from './ref.js';
|
|
18
|
-
import { w as when } from './when.js';
|
|
19
|
-
import { s as slotted } from './slotted.js';
|
|
1
|
+
import { C as Checkbox, c as checkboxDefinition } from './definition15.js';
|
|
2
|
+
import { R as Radio, r as radioDefinition } from './definition40.js';
|
|
3
|
+
import { V as VividElement, a as attr, h as html, d as defineVividComponent, f as createRegisterFunction } from './vivid-element.js';
|
|
4
|
+
import { C as Connotation } from './enums.js';
|
|
20
5
|
import { c as classNames } from './class-names.js';
|
|
6
|
+
import { w as when } from './when.js';
|
|
21
7
|
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* A form-associated base class for the {@link @microsoft/fast-foundation#(Select:class)} component.
|
|
26
|
-
*
|
|
27
|
-
* @internal
|
|
28
|
-
*/
|
|
29
|
-
class FormAssociatedSelect extends FormAssociated(_Select) {
|
|
30
|
-
constructor() {
|
|
31
|
-
super(...arguments);
|
|
32
|
-
this.proxy = document.createElement("select");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* A Select Custom HTML Element.
|
|
38
|
-
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#select | ARIA select }.
|
|
39
|
-
*
|
|
40
|
-
* @slot start - Content which can be provided before the button content
|
|
41
|
-
* @slot end - Content which can be provided after the button content
|
|
42
|
-
* @slot button-container - The element representing the select button
|
|
43
|
-
* @slot selected-value - The selected value
|
|
44
|
-
* @slot indicator - The visual indicator for the expand/collapse state of the button
|
|
45
|
-
* @slot - The default slot for slotted options
|
|
46
|
-
* @csspart control - The element representing the select invoking element
|
|
47
|
-
* @csspart selected-value - The element wrapping the selected value
|
|
48
|
-
* @csspart indicator - The element wrapping the visual indicator
|
|
49
|
-
* @csspart listbox - The listbox element
|
|
50
|
-
* @fires input - Fires a custom 'input' event when the value updates
|
|
51
|
-
* @fires change - Fires a custom 'change' event when the value updates
|
|
52
|
-
*
|
|
53
|
-
* @public
|
|
54
|
-
*/
|
|
55
|
-
let Select$1 = class Select extends FormAssociatedSelect {
|
|
56
|
-
constructor() {
|
|
57
|
-
super(...arguments);
|
|
58
|
-
/**
|
|
59
|
-
* The open attribute.
|
|
60
|
-
*
|
|
61
|
-
* @public
|
|
62
|
-
* @remarks
|
|
63
|
-
* HTML Attribute: open
|
|
64
|
-
*/
|
|
65
|
-
this.open = false;
|
|
66
|
-
/**
|
|
67
|
-
* Indicates the initial state of the position attribute.
|
|
68
|
-
*
|
|
69
|
-
* @internal
|
|
70
|
-
*/
|
|
71
|
-
this.forcedPosition = false;
|
|
72
|
-
/**
|
|
73
|
-
* The unique id for the internal listbox element.
|
|
74
|
-
*
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
this.listboxId = uniqueId("listbox-");
|
|
78
|
-
/**
|
|
79
|
-
* The max height for the listbox when opened.
|
|
80
|
-
*
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
this.maxHeight = 0;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Sets focus and synchronizes ARIA attributes when the open property changes.
|
|
87
|
-
*
|
|
88
|
-
* @param prev - the previous open value
|
|
89
|
-
* @param next - the current open value
|
|
90
|
-
*
|
|
91
|
-
* @internal
|
|
92
|
-
*/
|
|
93
|
-
openChanged(prev, next) {
|
|
94
|
-
if (!this.collapsible) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
if (this.open) {
|
|
98
|
-
this.ariaControls = this.listboxId;
|
|
99
|
-
this.ariaExpanded = "true";
|
|
100
|
-
this.setPositioning();
|
|
101
|
-
this.focusAndScrollOptionIntoView();
|
|
102
|
-
this.indexWhenOpened = this.selectedIndex;
|
|
103
|
-
// focus is directed to the element when `open` is changed programmatically
|
|
104
|
-
DOM.queueUpdate(() => this.focus());
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
this.ariaControls = "";
|
|
108
|
-
this.ariaExpanded = "false";
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* The component is collapsible when in single-selection mode with no size attribute.
|
|
112
|
-
*
|
|
113
|
-
* @internal
|
|
114
|
-
*/
|
|
115
|
-
get collapsible() {
|
|
116
|
-
return !(this.multiple || typeof this.size === "number");
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* The value property.
|
|
120
|
-
*
|
|
121
|
-
* @public
|
|
122
|
-
*/
|
|
123
|
-
get value() {
|
|
124
|
-
Observable.track(this, "value");
|
|
125
|
-
return this._value;
|
|
126
|
-
}
|
|
127
|
-
set value(next) {
|
|
128
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
129
|
-
const prev = `${this._value}`;
|
|
130
|
-
if ((_a = this._options) === null || _a === void 0 ? void 0 : _a.length) {
|
|
131
|
-
const selectedIndex = this._options.findIndex(el => el.value === next);
|
|
132
|
-
const prevSelectedValue = (_c = (_b = this._options[this.selectedIndex]) === null || _b === void 0 ? void 0 : _b.value) !== null && _c !== void 0 ? _c : null;
|
|
133
|
-
const nextSelectedValue = (_e = (_d = this._options[selectedIndex]) === null || _d === void 0 ? void 0 : _d.value) !== null && _e !== void 0 ? _e : null;
|
|
134
|
-
if (selectedIndex === -1 || prevSelectedValue !== nextSelectedValue) {
|
|
135
|
-
next = "";
|
|
136
|
-
this.selectedIndex = selectedIndex;
|
|
137
|
-
}
|
|
138
|
-
next = (_g = (_f = this.firstSelectedOption) === null || _f === void 0 ? void 0 : _f.value) !== null && _g !== void 0 ? _g : next;
|
|
139
|
-
}
|
|
140
|
-
if (prev !== next) {
|
|
141
|
-
this._value = next;
|
|
142
|
-
super.valueChanged(prev, next);
|
|
143
|
-
Observable.notify(this, "value");
|
|
144
|
-
this.updateDisplayValue();
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
/**
|
|
148
|
-
* Sets the value and display value to match the first selected option.
|
|
149
|
-
*
|
|
150
|
-
* @param shouldEmit - if true, the input and change events will be emitted
|
|
151
|
-
*
|
|
152
|
-
* @internal
|
|
153
|
-
*/
|
|
154
|
-
updateValue(shouldEmit) {
|
|
155
|
-
var _a, _b;
|
|
156
|
-
if (this.$fastController.isConnected) {
|
|
157
|
-
this.value = (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "";
|
|
158
|
-
}
|
|
159
|
-
if (shouldEmit) {
|
|
160
|
-
this.$emit("input");
|
|
161
|
-
this.$emit("change", this, {
|
|
162
|
-
bubbles: true,
|
|
163
|
-
composed: undefined,
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Updates the proxy value when the selected index changes.
|
|
169
|
-
*
|
|
170
|
-
* @param prev - the previous selected index
|
|
171
|
-
* @param next - the next selected index
|
|
172
|
-
*
|
|
173
|
-
* @internal
|
|
174
|
-
*/
|
|
175
|
-
selectedIndexChanged(prev, next) {
|
|
176
|
-
super.selectedIndexChanged(prev, next);
|
|
177
|
-
this.updateValue();
|
|
178
|
-
}
|
|
179
|
-
positionChanged(prev, next) {
|
|
180
|
-
this.positionAttribute = next;
|
|
181
|
-
this.setPositioning();
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Calculate and apply listbox positioning based on available viewport space.
|
|
185
|
-
*
|
|
186
|
-
* @public
|
|
187
|
-
*/
|
|
188
|
-
setPositioning() {
|
|
189
|
-
const currentBox = this.getBoundingClientRect();
|
|
190
|
-
const viewportHeight = window.innerHeight;
|
|
191
|
-
const availableBottom = viewportHeight - currentBox.bottom;
|
|
192
|
-
this.position = this.forcedPosition
|
|
193
|
-
? this.positionAttribute
|
|
194
|
-
: currentBox.top > availableBottom
|
|
195
|
-
? SelectPosition.above
|
|
196
|
-
: SelectPosition.below;
|
|
197
|
-
this.positionAttribute = this.forcedPosition
|
|
198
|
-
? this.positionAttribute
|
|
199
|
-
: this.position;
|
|
200
|
-
this.maxHeight =
|
|
201
|
-
this.position === SelectPosition.above ? ~~currentBox.top : ~~availableBottom;
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* The value displayed on the button.
|
|
205
|
-
*
|
|
206
|
-
* @public
|
|
207
|
-
*/
|
|
208
|
-
get displayValue() {
|
|
209
|
-
var _a, _b;
|
|
210
|
-
Observable.track(this, "displayValue");
|
|
211
|
-
return (_b = (_a = this.firstSelectedOption) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Synchronize the `aria-disabled` property when the `disabled` property changes.
|
|
215
|
-
*
|
|
216
|
-
* @param prev - The previous disabled value
|
|
217
|
-
* @param next - The next disabled value
|
|
218
|
-
*
|
|
219
|
-
* @internal
|
|
220
|
-
*/
|
|
221
|
-
disabledChanged(prev, next) {
|
|
222
|
-
if (super.disabledChanged) {
|
|
223
|
-
super.disabledChanged(prev, next);
|
|
224
|
-
}
|
|
225
|
-
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Reset the element to its first selectable option when its parent form is reset.
|
|
229
|
-
*
|
|
230
|
-
* @internal
|
|
231
|
-
*/
|
|
232
|
-
formResetCallback() {
|
|
233
|
-
this.setProxyOptions();
|
|
234
|
-
// Call the base class's implementation setDefaultSelectedOption instead of the select's
|
|
235
|
-
// override, in order to reset the selectedIndex without using the value property.
|
|
236
|
-
super.setDefaultSelectedOption();
|
|
237
|
-
if (this.selectedIndex === -1) {
|
|
238
|
-
this.selectedIndex = 0;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Handle opening and closing the listbox when the select is clicked.
|
|
243
|
-
*
|
|
244
|
-
* @param e - the mouse event
|
|
245
|
-
* @internal
|
|
246
|
-
*/
|
|
247
|
-
clickHandler(e) {
|
|
248
|
-
// do nothing if the select is disabled
|
|
249
|
-
if (this.disabled) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
if (this.open) {
|
|
253
|
-
const captured = e.target.closest(`option,[role=option]`);
|
|
254
|
-
if (captured && captured.disabled) {
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
super.clickHandler(e);
|
|
259
|
-
this.open = this.collapsible && !this.open;
|
|
260
|
-
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
261
|
-
this.updateValue(true);
|
|
262
|
-
}
|
|
263
|
-
return true;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Handles focus state when the element or its children lose focus.
|
|
267
|
-
*
|
|
268
|
-
* @param e - The focus event
|
|
269
|
-
* @internal
|
|
270
|
-
*/
|
|
271
|
-
focusoutHandler(e) {
|
|
272
|
-
var _a;
|
|
273
|
-
super.focusoutHandler(e);
|
|
274
|
-
if (!this.open) {
|
|
275
|
-
return true;
|
|
276
|
-
}
|
|
277
|
-
const focusTarget = e.relatedTarget;
|
|
278
|
-
if (this.isSameNode(focusTarget)) {
|
|
279
|
-
this.focus();
|
|
280
|
-
return;
|
|
281
|
-
}
|
|
282
|
-
if (!((_a = this.options) === null || _a === void 0 ? void 0 : _a.includes(focusTarget))) {
|
|
283
|
-
this.open = false;
|
|
284
|
-
if (this.indexWhenOpened !== this.selectedIndex) {
|
|
285
|
-
this.updateValue(true);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Updates the value when an option's value changes.
|
|
291
|
-
*
|
|
292
|
-
* @param source - the source object
|
|
293
|
-
* @param propertyName - the property to evaluate
|
|
294
|
-
*
|
|
295
|
-
* @internal
|
|
296
|
-
* @override
|
|
297
|
-
*/
|
|
298
|
-
handleChange(source, propertyName) {
|
|
299
|
-
super.handleChange(source, propertyName);
|
|
300
|
-
if (propertyName === "value") {
|
|
301
|
-
this.updateValue();
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Synchronize the form-associated proxy and updates the value property of the element.
|
|
306
|
-
*
|
|
307
|
-
* @param prev - the previous collection of slotted option elements
|
|
308
|
-
* @param next - the next collection of slotted option elements
|
|
309
|
-
*
|
|
310
|
-
* @internal
|
|
311
|
-
*/
|
|
312
|
-
slottedOptionsChanged(prev, next) {
|
|
313
|
-
this.options.forEach(o => {
|
|
314
|
-
const notifier = Observable.getNotifier(o);
|
|
315
|
-
notifier.unsubscribe(this, "value");
|
|
316
|
-
});
|
|
317
|
-
super.slottedOptionsChanged(prev, next);
|
|
318
|
-
this.options.forEach(o => {
|
|
319
|
-
const notifier = Observable.getNotifier(o);
|
|
320
|
-
notifier.subscribe(this, "value");
|
|
321
|
-
});
|
|
322
|
-
this.setProxyOptions();
|
|
323
|
-
this.updateValue();
|
|
324
|
-
}
|
|
325
|
-
/**
|
|
326
|
-
* Prevents focus when size is set and a scrollbar is clicked.
|
|
327
|
-
*
|
|
328
|
-
* @param e - the mouse event object
|
|
329
|
-
*
|
|
330
|
-
* @override
|
|
331
|
-
* @internal
|
|
332
|
-
*/
|
|
333
|
-
mousedownHandler(e) {
|
|
334
|
-
var _a;
|
|
335
|
-
if (e.offsetX >= 0 && e.offsetX <= ((_a = this.listbox) === null || _a === void 0 ? void 0 : _a.scrollWidth)) {
|
|
336
|
-
return super.mousedownHandler(e);
|
|
337
|
-
}
|
|
338
|
-
return this.collapsible;
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Sets the multiple property on the proxy element.
|
|
342
|
-
*
|
|
343
|
-
* @param prev - the previous multiple value
|
|
344
|
-
* @param next - the current multiple value
|
|
345
|
-
*/
|
|
346
|
-
multipleChanged(prev, next) {
|
|
347
|
-
super.multipleChanged(prev, next);
|
|
348
|
-
if (this.proxy) {
|
|
349
|
-
this.proxy.multiple = next;
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
/**
|
|
353
|
-
* Updates the selectedness of each option when the list of selected options changes.
|
|
354
|
-
*
|
|
355
|
-
* @param prev - the previous list of selected options
|
|
356
|
-
* @param next - the current list of selected options
|
|
357
|
-
*
|
|
358
|
-
* @override
|
|
359
|
-
* @internal
|
|
360
|
-
*/
|
|
361
|
-
selectedOptionsChanged(prev, next) {
|
|
362
|
-
var _a;
|
|
363
|
-
super.selectedOptionsChanged(prev, next);
|
|
364
|
-
(_a = this.options) === null || _a === void 0 ? void 0 : _a.forEach((o, i) => {
|
|
365
|
-
var _a;
|
|
366
|
-
const proxyOption = (_a = this.proxy) === null || _a === void 0 ? void 0 : _a.options.item(i);
|
|
367
|
-
if (proxyOption) {
|
|
368
|
-
proxyOption.selected = o.selected;
|
|
369
|
-
}
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Sets the selected index to match the first option with the selected attribute, or
|
|
374
|
-
* the first selectable option.
|
|
375
|
-
*
|
|
376
|
-
* @override
|
|
377
|
-
* @internal
|
|
378
|
-
*/
|
|
379
|
-
setDefaultSelectedOption() {
|
|
380
|
-
var _a;
|
|
381
|
-
const options = (_a = this.options) !== null && _a !== void 0 ? _a : Array.from(this.children).filter(Listbox.slottedOptionFilter);
|
|
382
|
-
const selectedIndex = options === null || options === void 0 ? void 0 : options.findIndex(el => el.hasAttribute("selected") || el.selected || el.value === this.value);
|
|
383
|
-
if (selectedIndex !== -1) {
|
|
384
|
-
this.selectedIndex = selectedIndex;
|
|
385
|
-
return;
|
|
386
|
-
}
|
|
387
|
-
this.selectedIndex = 0;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* Resets and fills the proxy to match the component's options.
|
|
391
|
-
*
|
|
392
|
-
* @internal
|
|
393
|
-
*/
|
|
394
|
-
setProxyOptions() {
|
|
395
|
-
if (this.proxy instanceof HTMLSelectElement && this.options) {
|
|
396
|
-
this.proxy.options.length = 0;
|
|
397
|
-
this.options.forEach(option => {
|
|
398
|
-
const proxyOption = option.proxy ||
|
|
399
|
-
(option instanceof HTMLOptionElement ? option.cloneNode() : null);
|
|
400
|
-
if (proxyOption) {
|
|
401
|
-
this.proxy.options.add(proxyOption);
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Handle keyboard interaction for the select.
|
|
408
|
-
*
|
|
409
|
-
* @param e - the keyboard event
|
|
410
|
-
* @internal
|
|
411
|
-
*/
|
|
412
|
-
keydownHandler(e) {
|
|
413
|
-
super.keydownHandler(e);
|
|
414
|
-
const key = e.key || e.key.charCodeAt(0);
|
|
415
|
-
switch (key) {
|
|
416
|
-
case keySpace: {
|
|
417
|
-
e.preventDefault();
|
|
418
|
-
if (this.collapsible && this.typeAheadExpired) {
|
|
419
|
-
this.open = !this.open;
|
|
420
|
-
}
|
|
421
|
-
break;
|
|
422
|
-
}
|
|
423
|
-
case keyHome:
|
|
424
|
-
case keyEnd: {
|
|
425
|
-
e.preventDefault();
|
|
426
|
-
break;
|
|
427
|
-
}
|
|
428
|
-
case keyEnter: {
|
|
429
|
-
e.preventDefault();
|
|
430
|
-
this.open = !this.open;
|
|
431
|
-
break;
|
|
432
|
-
}
|
|
433
|
-
case keyEscape: {
|
|
434
|
-
if (this.collapsible && this.open) {
|
|
435
|
-
e.preventDefault();
|
|
436
|
-
this.open = false;
|
|
437
|
-
}
|
|
438
|
-
break;
|
|
439
|
-
}
|
|
440
|
-
case keyTab: {
|
|
441
|
-
if (this.collapsible && this.open) {
|
|
442
|
-
e.preventDefault();
|
|
443
|
-
this.open = false;
|
|
444
|
-
}
|
|
445
|
-
return true;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
if (!this.open && this.indexWhenOpened !== this.selectedIndex) {
|
|
449
|
-
this.updateValue(true);
|
|
450
|
-
this.indexWhenOpened = this.selectedIndex;
|
|
451
|
-
}
|
|
452
|
-
return !(key === keyArrowDown || key === keyArrowUp);
|
|
453
|
-
}
|
|
454
|
-
connectedCallback() {
|
|
455
|
-
super.connectedCallback();
|
|
456
|
-
this.forcedPosition = !!this.positionAttribute;
|
|
457
|
-
this.addEventListener("contentchange", this.updateDisplayValue);
|
|
458
|
-
}
|
|
459
|
-
disconnectedCallback() {
|
|
460
|
-
this.removeEventListener("contentchange", this.updateDisplayValue);
|
|
461
|
-
super.disconnectedCallback();
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* Updates the proxy's size property when the size attribute changes.
|
|
465
|
-
*
|
|
466
|
-
* @param prev - the previous size
|
|
467
|
-
* @param next - the current size
|
|
468
|
-
*
|
|
469
|
-
* @override
|
|
470
|
-
* @internal
|
|
471
|
-
*/
|
|
472
|
-
sizeChanged(prev, next) {
|
|
473
|
-
super.sizeChanged(prev, next);
|
|
474
|
-
if (this.proxy) {
|
|
475
|
-
this.proxy.size = next;
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
*
|
|
480
|
-
* @internal
|
|
481
|
-
*/
|
|
482
|
-
updateDisplayValue() {
|
|
483
|
-
if (this.collapsible) {
|
|
484
|
-
Observable.notify(this, "displayValue");
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
};
|
|
488
|
-
__decorate([
|
|
489
|
-
attr({ attribute: "open", mode: "boolean" })
|
|
490
|
-
], Select$1.prototype, "open", void 0);
|
|
491
|
-
__decorate([
|
|
492
|
-
volatile
|
|
493
|
-
], Select$1.prototype, "collapsible", null);
|
|
494
|
-
__decorate([
|
|
495
|
-
observable
|
|
496
|
-
], Select$1.prototype, "control", void 0);
|
|
497
|
-
__decorate([
|
|
498
|
-
attr({ attribute: "position" })
|
|
499
|
-
], Select$1.prototype, "positionAttribute", void 0);
|
|
500
|
-
__decorate([
|
|
501
|
-
observable
|
|
502
|
-
], Select$1.prototype, "position", void 0);
|
|
503
|
-
__decorate([
|
|
504
|
-
observable
|
|
505
|
-
], Select$1.prototype, "maxHeight", void 0);
|
|
506
|
-
/**
|
|
507
|
-
* Includes ARIA states and properties relating to the ARIA select role.
|
|
508
|
-
*
|
|
509
|
-
* @public
|
|
510
|
-
*/
|
|
511
|
-
class DelegatesARIASelect {
|
|
512
|
-
}
|
|
513
|
-
__decorate([
|
|
514
|
-
observable
|
|
515
|
-
], DelegatesARIASelect.prototype, "ariaControls", void 0);
|
|
516
|
-
applyMixins(DelegatesARIASelect, DelegatesARIAListbox);
|
|
517
|
-
applyMixins(Select$1, StartEnd, DelegatesARIASelect);
|
|
518
|
-
|
|
519
|
-
const styles = ".chevron{display:flex;flex-shrink:0;font:var(--vvd-typography-base-extended);transform:rotate(0);transition:transform .2s}:host([aria-expanded=true]) .chevron,:host([open]) .chevron{transform:rotate(180deg)}:host(:focus-visible){outline:none}:host{display:inline-flex;flex-direction:column;gap:4px;--_low-ink-color: var(--vvd-color-neutral-600);--focus-stroke-gap-color: transparent}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.label{color:var(--vvd-color-canvas-text);contain:inline-size;font:var(--vvd-typography-base)}.control{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.control.appearance-ghost{--_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-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: var(--vvd-color-neutral-300)}.control:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.readonly):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-neutral-200);--_appearance-color-outline: var(--vvd-color-neutral-400)}.control:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.error):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: var(--vvd-color-alert-500)}.control:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.control:where(.success):where(:not(.disabled,:disabled)){--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: var(--vvd-color-success-500)}.control:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.control{--_connotation-color-primary: var(--vvd-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-select-accent-fierce, var(--vvd-color-neutral-700))}.control{border-radius:var(--_select-control-border-radius);block-size:var(--_select-block-size);padding-inline:var(--_select-padding-inline)}.control{--_select-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) ;--_select-block-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_select-padding-inline: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;display:flex;align-items:center;justify-content:space-between;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);color:var(--_appearance-color-text);font:var(--vvd-typography-base);gap:8px;transition:box-shadow .2s,background-color .2s}.control.size-condensed{--_select-icon-size: calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*.4) ;--_select-block-size: calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) ;--_select-padding-inline: calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))/2) }.control-wrapper{position:relative}.control:not(.disabled){cursor:pointer}.control.disabled{pointer-events:none}.control:not(.shape-pill){--_select-control-border-radius: 8px}.control.shape-pill{--_select-control-border-radius: 24px}:host(:focus-visible) .control{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))}.listbox{display:flex;max-height:var(--select-height, 408px);flex-direction:column;padding:4px;gap:2px;overflow-y:auto}:host([multiple]:focus-visible) .listbox{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));border-radius:8px}.selected-value{display:flex;overflow:hidden;flex-grow:1;align-items:center;column-gap:12px;white-space:nowrap}.selected-value .text{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis}.control.shows-placeholder .selected-value .text{color:var(--vvd-color-neutral-600)}.selected-value slot[name=icon]{flex:0 0 var(--_select-icon-size);font-size:var(--_select-icon-size);line-height:1}.control.has-meta .selected-value{padding-inline-end:8px}.feedback-wrapper{display:contents}::part(popup-base){inline-size:max-content;min-inline-size:var(--_select-fixed-width, 100%)}:host([multiple]) ::part(popup-base){position:static}";
|
|
8
|
+
const styles = ":host{display:flex}.base.connotation-cta{--_connotation-color-firm-all: var(--vvd-selectable-box-cta-firm-all, var(--vvd-color-cta-600));--_connotation-color-pale: var(--vvd-selectable-box-cta-pale, var(--vvd-color-cta-300));--_connotation-color-fierce: var(--vvd-selectable-box-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-faint: var(--vvd-selectable-box-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-selectable-box-cta-soft, var(--vvd-color-cta-100))}.base:not(.connotation-cta){--_connotation-color-firm-all: var(--vvd-selectable-box-accent-firm-all, var(--vvd-color-neutral-600));--_connotation-color-pale: var(--vvd-selectable-box-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-fierce: var(--vvd-selectable-box-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-faint: var(--vvd-selectable-box-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-selectable-box-accent-soft, var(--vvd-color-neutral-100))}.base{--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: transparent;--_appearance-color-outline: var(--_connotation-color-firm-all)}.base:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: var(--_connotation-color-pale)}.base:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm-all);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: var(--_connotation-color-firm-all)}.base{position:relative;padding:var(--selectable-box-spacing, 16px);border:1px solid var(--_appearance-color-outline);border-radius:8px;background-color:var(--_appearance-color-fill);inline-size:100%;padding-block-start:calc(var(--selectable-box-spacing, 16px) + 36px);text-align:start}.base:focus-visible{--focus-stroke-gap-color: transparent;box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}.base.tight{overflow:hidden;min-height:calc(var(--selectable-box-spacing, 16px) * 2 + 22px);padding:0}.base.clickable{cursor:pointer}.control{position:absolute;inset-block-start:var(--selectable-box-spacing, 16px);inset-inline-end:var(--selectable-box-spacing, 16px)}";
|
|
520
9
|
|
|
521
10
|
var __defProp = Object.defineProperty;
|
|
522
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
523
11
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
524
|
-
var result =
|
|
12
|
+
var result = void 0 ;
|
|
525
13
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
526
14
|
if (decorator = decorators[i])
|
|
527
|
-
result = (
|
|
528
|
-
if (
|
|
15
|
+
result = (decorator(target, key, result) ) || result;
|
|
16
|
+
if (result) __defProp(target, key, result);
|
|
529
17
|
return result;
|
|
530
18
|
};
|
|
531
|
-
|
|
19
|
+
class SelectableBox extends VividElement {
|
|
532
20
|
constructor() {
|
|
533
21
|
super(...arguments);
|
|
534
|
-
this.
|
|
535
|
-
this.
|
|
536
|
-
this.
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
if (!this.ariaLabel) {
|
|
540
|
-
this.ariaLabel = this.label;
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
connectedCallback() {
|
|
544
|
-
super.connectedCallback();
|
|
545
|
-
}
|
|
546
|
-
get displayValue() {
|
|
547
|
-
Observable.track(this, "displayValue");
|
|
548
|
-
return this.firstSelectedOption?.getAttribute("label") ?? this.firstSelectedOption?.text ?? this.placeholder ?? "";
|
|
549
|
-
}
|
|
550
|
-
setDefaultSelectedOption() {
|
|
551
|
-
const options = Array.from(this.children).filter(
|
|
552
|
-
Listbox$1.slottedOptionFilter
|
|
553
|
-
);
|
|
554
|
-
const selectedIndex = options.findIndex(
|
|
555
|
-
(el) => el.hasAttribute("selected") || el.selected || el.value === this.value
|
|
556
|
-
);
|
|
557
|
-
if (selectedIndex === -1 && !this.placeholderOption) {
|
|
558
|
-
this.selectedIndex = 0;
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
if (selectedIndex !== -1 || this.placeholder !== "") {
|
|
562
|
-
this.selectedIndex = selectedIndex;
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
22
|
+
this.ariaLabel = null;
|
|
23
|
+
this.checked = false;
|
|
24
|
+
this.clickable = false;
|
|
25
|
+
this.clickableBox = false;
|
|
26
|
+
this.tight = false;
|
|
565
27
|
}
|
|
566
|
-
|
|
28
|
+
/**
|
|
567
29
|
* @internal
|
|
568
30
|
*/
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
if (scale) {
|
|
574
|
-
element.setAttribute("scale", scale);
|
|
575
|
-
element.scale = scale;
|
|
576
|
-
}
|
|
577
|
-
});
|
|
578
|
-
this.proxy.value = this.value;
|
|
579
|
-
this.validate();
|
|
31
|
+
_handleCheckedChange() {
|
|
32
|
+
if (this.controlType === "radio" && this.checked) return;
|
|
33
|
+
this.checked = !this.checked;
|
|
34
|
+
if (this.clickableBox || this.clickable) this.$emit("change");
|
|
580
35
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
_handleKeydown(event) {
|
|
40
|
+
if ((event.code === "Space" || event.code === "Enter") && (this.clickableBox || this.clickable))
|
|
41
|
+
return this._handleCheckedChange();
|
|
42
|
+
return true;
|
|
586
43
|
}
|
|
587
|
-
}
|
|
588
|
-
__decorateClass([
|
|
589
|
-
observable
|
|
590
|
-
], Select.prototype, "_anchor", 2);
|
|
44
|
+
}
|
|
591
45
|
__decorateClass([
|
|
592
|
-
attr()
|
|
593
|
-
],
|
|
46
|
+
attr({ attribute: "aria-label" })
|
|
47
|
+
], SelectableBox.prototype, "ariaLabel");
|
|
594
48
|
__decorateClass([
|
|
595
|
-
attr
|
|
596
|
-
],
|
|
49
|
+
attr({ mode: "boolean" })
|
|
50
|
+
], SelectableBox.prototype, "checked");
|
|
597
51
|
__decorateClass([
|
|
598
|
-
attr
|
|
599
|
-
],
|
|
52
|
+
attr({ mode: "boolean" })
|
|
53
|
+
], SelectableBox.prototype, "clickable");
|
|
600
54
|
__decorateClass([
|
|
601
|
-
attr({
|
|
602
|
-
],
|
|
55
|
+
attr({ attribute: "clickable-box", mode: "boolean" })
|
|
56
|
+
], SelectableBox.prototype, "clickableBox");
|
|
603
57
|
__decorateClass([
|
|
604
58
|
attr
|
|
605
|
-
],
|
|
606
|
-
__decorateClass([
|
|
607
|
-
observable
|
|
608
|
-
], Select.prototype, "placeholderOption", 2);
|
|
59
|
+
], SelectableBox.prototype, "connotation");
|
|
609
60
|
__decorateClass([
|
|
610
|
-
|
|
611
|
-
],
|
|
61
|
+
attr({ attribute: "control-type" })
|
|
62
|
+
], SelectableBox.prototype, "controlType");
|
|
612
63
|
__decorateClass([
|
|
613
|
-
|
|
614
|
-
],
|
|
615
|
-
Select = __decorateClass([
|
|
616
|
-
errorText,
|
|
617
|
-
formElements
|
|
618
|
-
], Select);
|
|
619
|
-
applyMixinsWithObservables(
|
|
620
|
-
Select,
|
|
621
|
-
AffixIconWithTrailing,
|
|
622
|
-
FormElementHelperText,
|
|
623
|
-
FormElementSuccessText
|
|
624
|
-
);
|
|
64
|
+
attr({ mode: "boolean" })
|
|
65
|
+
], SelectableBox.prototype, "tight");
|
|
625
66
|
|
|
626
|
-
const
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
successText,
|
|
633
|
-
placeholder,
|
|
634
|
-
value,
|
|
635
|
-
scale
|
|
67
|
+
const getClasses = ({
|
|
68
|
+
connotation,
|
|
69
|
+
tight,
|
|
70
|
+
checked,
|
|
71
|
+
clickableBox,
|
|
72
|
+
clickable
|
|
636
73
|
}) => classNames(
|
|
637
|
-
|
|
638
|
-
[`
|
|
639
|
-
[
|
|
640
|
-
["
|
|
641
|
-
["
|
|
642
|
-
["
|
|
643
|
-
["has-meta", Boolean(metaSlottedContent?.length)],
|
|
644
|
-
["shows-placeholder", Boolean(placeholder) && !value],
|
|
645
|
-
[`size-${scale}`, Boolean(scale)]
|
|
74
|
+
"base",
|
|
75
|
+
[`connotation-${connotation}`, Boolean(connotation)],
|
|
76
|
+
["tight", tight],
|
|
77
|
+
["selected", checked],
|
|
78
|
+
["clickable", clickableBox || clickable],
|
|
79
|
+
["readonly", !clickableBox && !clickable]
|
|
646
80
|
);
|
|
647
|
-
function
|
|
648
|
-
|
|
649
|
-
${(x) => x.label}
|
|
650
|
-
</label>`;
|
|
651
|
-
}
|
|
652
|
-
function renderPlaceholder(context) {
|
|
653
|
-
const optionTag = context.tagFor(ListboxOption);
|
|
654
|
-
return html`
|
|
655
|
-
<${optionTag} ${ref("placeholderOption")}
|
|
656
|
-
text="${(x) => x.placeholder}" hidden disabled>
|
|
657
|
-
</${optionTag}>`;
|
|
658
|
-
}
|
|
659
|
-
function selectValue(context) {
|
|
660
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
661
|
-
const chevronTemplate = chevronTemplateFactory(context);
|
|
662
|
-
return html` <div
|
|
663
|
-
class="control ${getStateClasses}"
|
|
664
|
-
${ref("_anchor")}
|
|
665
|
-
id="control"
|
|
666
|
-
?disabled="${(x) => x.disabled}"
|
|
667
|
-
>
|
|
668
|
-
<div class="selected-value">
|
|
669
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
670
|
-
<span class="text">${(x) => x.displayValue}</span>
|
|
671
|
-
<slot name="meta" ${slotted("metaSlottedContent")}></slot>
|
|
672
|
-
</div>
|
|
673
|
-
${chevronTemplate}
|
|
674
|
-
</div>`;
|
|
81
|
+
function handleControlChange(x) {
|
|
82
|
+
if (!x.clickableBox) x._handleCheckedChange();
|
|
675
83
|
}
|
|
676
|
-
function
|
|
677
|
-
|
|
84
|
+
function checkbox(context) {
|
|
85
|
+
const checkboxTag = context.tagFor(Checkbox);
|
|
86
|
+
return html`${when(
|
|
87
|
+
(x) => x.controlType !== "radio",
|
|
88
|
+
html`
|
|
89
|
+
<${checkboxTag}
|
|
90
|
+
aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
|
|
91
|
+
@change="${(x) => handleControlChange(x)}"
|
|
92
|
+
class="control checkbox"
|
|
93
|
+
connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
|
|
94
|
+
:checked="${(x) => x.checked}"
|
|
95
|
+
inert="${(x) => x.clickableBox || x.clickable ? true : null}"
|
|
96
|
+
></${checkboxTag}>`
|
|
97
|
+
)} `;
|
|
678
98
|
}
|
|
679
|
-
function
|
|
680
|
-
const
|
|
681
|
-
return html
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
role="listbox"
|
|
694
|
-
?disabled="${(x) => x.disabled}"
|
|
695
|
-
?hidden="${(x) => x.collapsible ? !x.open : false}"
|
|
696
|
-
${ref("listbox")}>
|
|
697
|
-
${when((x) => x.placeholder, renderPlaceholder(context))}
|
|
698
|
-
<slot
|
|
699
|
-
${slotted({
|
|
700
|
-
filter: Listbox$1.slottedOptionFilter,
|
|
701
|
-
flatten: true,
|
|
702
|
-
property: "slottedOptions"
|
|
703
|
-
})}>
|
|
704
|
-
</slot>
|
|
705
|
-
</div>
|
|
706
|
-
</${popupTag}>
|
|
707
|
-
</div>
|
|
708
|
-
`;
|
|
99
|
+
function radio(context) {
|
|
100
|
+
const radioTag = context.tagFor(Radio);
|
|
101
|
+
return html`${when(
|
|
102
|
+
(x) => x.controlType === "radio",
|
|
103
|
+
html`
|
|
104
|
+
<${radioTag}
|
|
105
|
+
aria-label="${(x) => !x.clickableBox && !x.clickable && x.ariaLabel ? x.ariaLabel : null}"
|
|
106
|
+
@change="${(x) => handleControlChange(x)}"
|
|
107
|
+
class="control radio"
|
|
108
|
+
connotation="${(x) => x.connotation === "cta" ? Connotation.CTA : Connotation.Accent}"
|
|
109
|
+
:checked="${(x) => x.checked}"
|
|
110
|
+
inert="${(x) => x.clickableBox || x.clickable ? true : null}"
|
|
111
|
+
></${radioTag}>`
|
|
112
|
+
)} `;
|
|
709
113
|
}
|
|
710
|
-
|
|
711
|
-
return
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
<template
|
|
721
|
-
class="base"
|
|
722
|
-
aria-label="${(x) => x.ariaLabel}"
|
|
723
|
-
aria-activedescendant="${(x) => x.ariaActiveDescendant}"
|
|
724
|
-
aria-controls="${(x) => x.ariaControls}"
|
|
725
|
-
aria-disabled="${(x) => x.ariaDisabled}"
|
|
726
|
-
aria-expanded="${(x) => x.ariaExpanded}"
|
|
727
|
-
aria-haspopup="${(x) => x.collapsible ? "listbox" : null}"
|
|
728
|
-
aria-multiselectable="${(x) => x.ariaMultiSelectable}"
|
|
729
|
-
role="combobox"
|
|
730
|
-
tabindex="${(x) => !x.disabled ? "0" : null}"
|
|
731
|
-
@click="${ifNotFromFeedback((x, e) => x.clickHandler(e))}"
|
|
732
|
-
@focusin="${ifNotFromFeedback((x, e) => x.focusinHandler(e))}"
|
|
733
|
-
@focusout="${ifNotFromFeedback(
|
|
734
|
-
(x, e) => x.focusoutHandler(e)
|
|
735
|
-
)}"
|
|
736
|
-
@keydown="${ifNotFromFeedback((x, e) => {
|
|
737
|
-
x.open && handleEscapeKeyAndStopPropogation(e);
|
|
738
|
-
return x.keydownHandler(e);
|
|
739
|
-
})}"
|
|
740
|
-
@mousedown="${ifNotFromFeedback(
|
|
741
|
-
(x, e) => x.mousedownHandler(e)
|
|
742
|
-
)}"
|
|
114
|
+
const SelectableBoxTemplate = (context) => {
|
|
115
|
+
return html`<template role="presentation">
|
|
116
|
+
<div
|
|
117
|
+
class="${getClasses}"
|
|
118
|
+
tabindex="${(x) => x.clickableBox || x.clickable ? "0" : null}"
|
|
119
|
+
role="${(x) => x.clickableBox || x.clickable ? "button" : null}"
|
|
120
|
+
aria-pressed="${(x) => x.clickableBox || x.clickable ? x.checked ? "true" : "false" : null}"
|
|
121
|
+
aria-label="${(x) => x.clickableBox || x.clickable ? x.ariaLabel : null}"
|
|
122
|
+
@keydown="${(x, c) => x._handleKeydown(c.event)}"
|
|
123
|
+
@click="${(x) => x.clickableBox || x.clickable ? x._handleCheckedChange() : null}"
|
|
743
124
|
>
|
|
744
|
-
${
|
|
745
|
-
<
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
</template>
|
|
749
|
-
`;
|
|
125
|
+
${checkbox(context)} ${radio(context)}
|
|
126
|
+
<slot></slot>
|
|
127
|
+
</div>
|
|
128
|
+
</template>`;
|
|
750
129
|
};
|
|
751
130
|
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
131
|
+
const selectableBoxDefinition = defineVividComponent(
|
|
132
|
+
"selectable-box",
|
|
133
|
+
SelectableBox,
|
|
134
|
+
SelectableBoxTemplate,
|
|
135
|
+
[checkboxDefinition, radioDefinition],
|
|
136
|
+
{
|
|
137
|
+
styles,
|
|
138
|
+
shadowOptions: {
|
|
139
|
+
delegatesFocus: true
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
const registerSelectableBox = createRegisterFunction(
|
|
144
|
+
selectableBoxDefinition
|
|
145
|
+
);
|
|
764
146
|
|
|
765
|
-
export {
|
|
147
|
+
export { registerSelectableBox as r, selectableBoxDefinition as s };
|