@vonage/vivid 4.13.0 → 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 +4033 -2662
- 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.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 +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.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 -2
- 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 +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 +52 -248
- package/shared/definition11.js +24 -218
- 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 +912 -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 +20 -22
- package/shared/definition2.js +21 -22
- package/shared/definition20.cjs +51 -52
- package/shared/definition20.js +35 -35
- package/shared/definition21.cjs +42 -45
- package/shared/definition21.js +18 -20
- 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 +27 -28
- package/shared/definition25.js +19 -19
- 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 +143 -68
- package/shared/definition29.js +102 -29
- package/shared/definition3.cjs +21 -16
- package/shared/definition3.js +17 -11
- package/shared/definition30.cjs +99 -76
- package/shared/definition30.js +98 -74
- 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 +204 -596
- package/shared/definition35.js +198 -591
- package/shared/definition36.cjs +198 -233
- package/shared/definition36.js +193 -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 +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 -470
- package/shared/definition47.js +116 -465
- package/shared/definition48.cjs +114 -120
- package/shared/definition48.js +112 -117
- package/shared/definition49.cjs +17 -134
- package/shared/definition49.js +16 -132
- 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 -873
- package/shared/definition52.js +29 -870
- 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 -278
- package/shared/definition55.js +61 -275
- package/shared/definition56.cjs +868 -76
- package/shared/definition56.js +867 -74
- package/shared/definition57.cjs +108 -826
- package/shared/definition57.js +106 -823
- 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/{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/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 +428 -1195
- package/shared/listbox.js +412 -1176
- 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 +50 -49
- package/shared/presentationDate.js +7 -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 +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 +29 -28
- package/shared/text-field2.js +6 -5
- 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 +1 -1
- package/styles/core/theme.css +1 -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 +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/definition42.cjs
CHANGED
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const definition = require('./
|
|
5
|
-
const
|
|
3
|
+
const definition$1 = require('./definition11.cjs');
|
|
4
|
+
const definition = require('./definition63.cjs');
|
|
5
|
+
const definition$2 = require('./definition27.cjs');
|
|
6
|
+
const defineVividComponent = require('./defineVividComponent.cjs');
|
|
7
|
+
const applyMixinsWithObservables = require('./applyMixinsWithObservables.cjs');
|
|
8
|
+
const scrollIntoView = require('./scrollIntoView.cjs');
|
|
6
9
|
const formAssociated = require('./form-associated.cjs');
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const applyMixins = require('./apply-mixins.cjs');
|
|
10
|
+
const vividElement = require('./vivid-element.cjs');
|
|
11
|
+
const affix = require('./affix.cjs');
|
|
10
12
|
const localized = require('./localized.cjs');
|
|
11
|
-
const numbers = require('./numbers.cjs');
|
|
12
13
|
const formElements = require('./form-elements.cjs');
|
|
13
|
-
const
|
|
14
|
+
const listbox = require('./listbox2.cjs');
|
|
15
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
16
|
+
const foundationElement = require('./foundation-element.cjs');
|
|
14
17
|
const when = require('./when.cjs');
|
|
18
|
+
const ref = require('./ref.cjs');
|
|
19
|
+
const slotted = require('./slotted.cjs');
|
|
20
|
+
const repeat = require('./repeat.cjs');
|
|
15
21
|
const classNames = require('./class-names.cjs');
|
|
16
22
|
|
|
17
|
-
const styles = "
|
|
23
|
+
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-block;inline-size:300px;--_low-ink-color: var(--vvd-color-neutral-600)}:host([disabled]){--_low-ink-color: var(--vvd-color-neutral-400);cursor:not-allowed}.control-wrapper{display:flex;flex-direction:column;gap:4px}.label{color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.fieldset{--_connotation-color-primary: var(--vvd-searchable-select-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-searchable-select-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-searchable-select-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-searchable-select-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-faint: var(--vvd-searchable-select-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-searchable-select-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-firm: var(--vvd-searchable-select-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-searchable-select-accent-fierce, var(--vvd-color-neutral-700))}.fieldset{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.fieldset.appearance-ghost{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset: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)}.fieldset: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}.fieldset: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)}.fieldset:where(.disabled,:disabled).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset: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)}.fieldset:where(.readonly):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: var(--vvd-color-neutral-600);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.fieldset: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)}.fieldset:where(.error):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-alert-50);--_appearance-color-outline: transparent}.fieldset: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)}.fieldset:where(.success):where(:not(.disabled,:disabled)).appearance-ghost{--_appearance-color-text: notSet;--_appearance-color-fill: var(--vvd-color-success-50);--_appearance-color-outline: transparent}.fieldset{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;padding-block:8px;padding-inline:16px;transition:box-shadow .2s,background-color .2s}.fieldset:focus-within{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}:host(:not([shape=pill])) .fieldset{border-radius:8px}:host([shape=pill]) .fieldset{border-radius:24px}.popup-wrapper{position:relative}.content-area{display:flex;overflow:hidden;flex:1;flex-direction:column;gap:8px;min-block-size:24px}.tag-row{display:flex;gap:8px;inline-size:100%}.tag-row.contains-only-input:not(:focus-within){display:contents}.tag-wrapper{overflow:hidden}.tag{max-inline-size:100%}input{box-sizing:border-box;flex:1;border:none;background:none;block-size:24px;font:var(--vvd-typography-base);max-inline-size:100%;min-inline-size:100px;outline:none}.contains-only-input input:not(:focus){position:absolute;block-size:0;inline-size:0;min-inline-size:0;opacity:0;pointer-events:none}.listbox{display:flex;flex-direction:column;padding:4px;gap:2px;max-block-size:var(--searchable-select-height, 408px);overflow-y:auto}.empty-message{display:flex;align-items:center;justify-content:center;color:var(--vvd-color-neutral-300);min-block-size:40px;text-align:center}::part(popup-base){inline-size:max-content;min-inline-size:100%}slot[name=icon]{font-size:20px}.visually-hidden{position:absolute;overflow:hidden;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}";
|
|
18
24
|
|
|
19
|
-
|
|
25
|
+
const optionTagStyles = ".base{--_connotation-color-contrast: var(--vvd-option-tag-accent-contrast, var(--vvd-color-neutral-800))}.base{position:relative;display:inline-flex;box-sizing:border-box;align-items:center;background-color:var(--fill-color);block-size:calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 1px var(--outline-color);color:var(--text-color);column-gap:8px;font:var(--vvd-typography-base-bold);max-inline-size:100%;padding-inline:8px;user-select:none;vertical-align:middle}.base:not(.disabled){--text-color: var(--_connotation-color-contrast);--fill-color: color-mix( in srgb, var(--_connotation-color-contrast), transparent 87.5% );--outline-color: transparent}.base.disabled{--text-color: var(--vvd-color-neutral-300);--fill-color: color-mix( in srgb, var(--vvd-color-neutral-800), transparent 87.5% );--outline-color: transparent}.base:not(.shape-pill){border-radius:4px}.base.shape-pill{border-radius:16px}.label{overflow:hidden;max-inline-size:100%;text-overflow:ellipsis;white-space:nowrap}slot[name=icon]{font-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5);line-height:1}.icon-placeholder{inline-size:calc(calc(1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2))) / 1.5)}.remove-button{display:flex;align-items:center;border-radius:inherit;cursor:pointer;outline:none}.disabled .remove-button{pointer-events:none}.remove-button:focus-visible:before{--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));position:absolute;z-index:1;display:block;border-radius:inherit;content:\"\";inset:0;pointer-events:none}";
|
|
26
|
+
|
|
27
|
+
class _SearchableSelect extends vividElement.VividElement {
|
|
20
28
|
}
|
|
21
|
-
class
|
|
29
|
+
class FormAssociatedSearchableSelect extends formAssociated.FormAssociated(
|
|
30
|
+
_SearchableSelect
|
|
31
|
+
) {
|
|
22
32
|
constructor() {
|
|
23
33
|
super(...arguments);
|
|
24
34
|
this.proxy = document.createElement("input");
|
|
25
35
|
}
|
|
26
36
|
}
|
|
27
37
|
|
|
28
|
-
var __defProp = Object.defineProperty;
|
|
38
|
+
var __defProp$1 = Object.defineProperty;
|
|
29
39
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
30
40
|
var __typeError = (msg) => {
|
|
31
41
|
throw TypeError(msg);
|
|
32
42
|
};
|
|
33
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
43
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
34
44
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
35
45
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
36
46
|
if (decorator = decorators[i])
|
|
37
47
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
38
|
-
if (kind && result) __defProp(target, key, result);
|
|
48
|
+
if (kind && result) __defProp$1(target, key, result);
|
|
39
49
|
return result;
|
|
40
50
|
};
|
|
41
51
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
@@ -43,597 +53,1075 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
43
53
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
44
54
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
45
55
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
46
|
-
var
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
let
|
|
56
|
+
var _SearchableSelect_instances, updateValuesThroughUserInteraction_fn, updateValuesWhileMaintainingOrder_fn, isValidValue_fn, _slottedOptionsChangeHandler, updateSelectedOnSlottedOptions_fn, handleOptionInteraction_fn, _clonedTagIcons, tagIconOfOption_fn, updateClonedTagIconOfOption_fn, _suppressFilter, updateFilteredOptions_fn, transitionHighlightedOptionTo_fn, selectHighlightedOption_fn, highlightFirstOption_fn, highlightLastOption_fn, highlightPrevPage_fn, highlightNextPage_fn, highlightPreviousOption_fn, highlightNextOption_fn, textForValue_fn, measureTagWidth_fn, updateTagLayout_fn, moveTagFocusTo_fn, nextTagIndexLeft_fn, nextTagIndexRight_fn, nextTagIndexForRemoved_fn, determineInitialValues_fn, updateFormValue_fn, _resizeObserver;
|
|
57
|
+
const TagGapPx = 8;
|
|
58
|
+
const InputMinWidthPx = 100;
|
|
59
|
+
const PageSize = 10;
|
|
60
|
+
const isFormAssociatedTryingToSetFormValue = (value) => typeof value === "string";
|
|
61
|
+
let SearchableSelect = class extends FormAssociatedSearchableSelect {
|
|
52
62
|
constructor() {
|
|
53
63
|
super(...arguments);
|
|
54
|
-
__privateAdd(this,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
this.
|
|
58
|
-
this.
|
|
59
|
-
this.
|
|
60
|
-
this.
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
|
|
64
|
-
this.ariaEndLabel = null;
|
|
65
|
-
this.markers = false;
|
|
66
|
-
this.pin = false;
|
|
67
|
-
this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
|
|
68
|
-
// --- Thumbs ---
|
|
64
|
+
__privateAdd(this, _SearchableSelect_instances);
|
|
65
|
+
this.fixedDropdown = false;
|
|
66
|
+
this.open = false;
|
|
67
|
+
this.multiple = false;
|
|
68
|
+
this.externalTags = false;
|
|
69
|
+
this.maxLines = null;
|
|
70
|
+
this.values = [];
|
|
71
|
+
this.initialValues = [];
|
|
72
|
+
this._inputValue = "";
|
|
73
|
+
// --- Slotted options ---
|
|
69
74
|
/**
|
|
70
75
|
* @internal
|
|
71
76
|
*/
|
|
72
|
-
this.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*/
|
|
80
|
-
this._endThumbEl = null;
|
|
81
|
-
this._draggingThumb = false;
|
|
82
|
-
this._visiblyFocusedThumb = null;
|
|
83
|
-
this._hoveredThumb = null;
|
|
84
|
-
this._startThumbCss = "";
|
|
85
|
-
this._endThumbCss = "";
|
|
86
|
-
this._selectedRangeCss = "";
|
|
87
|
-
__privateAdd(this, _isNonVisibleFocus, false);
|
|
88
|
-
__privateAdd(this, _onThumbFocus, (e) => {
|
|
89
|
-
if (!__privateGet(this, _isNonVisibleFocus)) {
|
|
90
|
-
this._visiblyFocusedThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
__privateAdd(this, _onThumbBlur, () => {
|
|
94
|
-
this._visiblyFocusedThumb = null;
|
|
95
|
-
});
|
|
96
|
-
__privateAdd(this, _onMouseOver, (e) => {
|
|
97
|
-
this._hoveredThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
98
|
-
});
|
|
99
|
-
__privateAdd(this, _onMouseOut, () => {
|
|
100
|
-
this._hoveredThumb = null;
|
|
101
|
-
});
|
|
102
|
-
__privateAdd(this, _onThumbMousedown, (event) => {
|
|
103
|
-
if (this.disabled || event.defaultPrevented) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
let target = event.target;
|
|
107
|
-
if (target === this._endThumbEl && this.startAsNumber === this.max && this.endAsNumber === this.max) {
|
|
108
|
-
target = this._startThumbEl;
|
|
109
|
-
}
|
|
110
|
-
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, target);
|
|
111
|
-
this._draggingThumb = __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, target);
|
|
112
|
-
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
113
|
-
});
|
|
114
|
-
__privateAdd(this, _onThumbKeydown, (e) => {
|
|
115
|
-
const thumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
116
|
-
this._visiblyFocusedThumb = thumb;
|
|
117
|
-
if (e.key === keyCodes.keyHome) {
|
|
118
|
-
e.preventDefault();
|
|
119
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min}` });
|
|
120
|
-
} else if (e.key === keyCodes.keyEnd) {
|
|
121
|
-
e.preventDefault();
|
|
122
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max}` });
|
|
123
|
-
} else if (!e.shiftKey) {
|
|
124
|
-
switch (e.key) {
|
|
125
|
-
case keyCodes.keyArrowRight:
|
|
126
|
-
case keyCodes.keyArrowDown:
|
|
127
|
-
e.preventDefault();
|
|
128
|
-
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Increment);
|
|
129
|
-
break;
|
|
130
|
-
case keyCodes.keyArrowLeft:
|
|
131
|
-
case keyCodes.keyArrowUp:
|
|
132
|
-
e.preventDefault();
|
|
133
|
-
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Decrement);
|
|
134
|
-
break;
|
|
77
|
+
this._areOptionsInitialized = false;
|
|
78
|
+
__privateAdd(this, _slottedOptionsChangeHandler, {
|
|
79
|
+
handleChange: (source, _) => {
|
|
80
|
+
if (source.selected && !this.values.includes(source.value)) {
|
|
81
|
+
this.values = [...this.values, source.value];
|
|
82
|
+
} else if (!source.selected && this.values.includes(source.value)) {
|
|
83
|
+
this.values = this.values.filter((option) => option !== source.value);
|
|
135
84
|
}
|
|
136
85
|
}
|
|
137
86
|
});
|
|
138
|
-
|
|
139
|
-
|
|
87
|
+
// --- Option tag icons ---
|
|
88
|
+
__privateAdd(this, _clonedTagIcons, /* @__PURE__ */ new Map());
|
|
89
|
+
this._filteredOptions = [];
|
|
90
|
+
this._filteredEnabledOptions = [];
|
|
91
|
+
__privateAdd(this, _suppressFilter, false);
|
|
92
|
+
this._highlightedOptionIndex = null;
|
|
93
|
+
this._numElidedTags = 0;
|
|
94
|
+
this._tagRows = [];
|
|
95
|
+
this._lastTagRow = [];
|
|
96
|
+
this.clearable = false;
|
|
97
|
+
this.setFormValue = (value, state) => {
|
|
98
|
+
if (isFormAssociatedTryingToSetFormValue(value)) {
|
|
140
99
|
return;
|
|
141
100
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this._draggingThumb = false;
|
|
150
|
-
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
151
|
-
});
|
|
101
|
+
super.setFormValue(value, state);
|
|
102
|
+
};
|
|
103
|
+
this._changeDescription = "";
|
|
104
|
+
// --- Core ---
|
|
105
|
+
__privateAdd(this, _resizeObserver, new ResizeObserver(() => {
|
|
106
|
+
__privateMethod(this, _SearchableSelect_instances, updateTagLayout_fn).call(this);
|
|
107
|
+
}));
|
|
152
108
|
}
|
|
153
109
|
/**
|
|
154
110
|
* @internal
|
|
155
111
|
*/
|
|
156
|
-
|
|
157
|
-
this.
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
112
|
+
openChanged() {
|
|
113
|
+
if (!this.open) {
|
|
114
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, null);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
valuesChanged() {
|
|
121
|
+
if (!this._areOptionsInitialized) {
|
|
122
|
+
return;
|
|
161
123
|
}
|
|
124
|
+
if (!this.multiple && this.values.length > 1) {
|
|
125
|
+
this.values = [this.values[0]];
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (this.values.some((value) => !__privateMethod(this, _SearchableSelect_instances, isValidValue_fn).call(this, value))) {
|
|
129
|
+
this.values = this.values.filter((value) => __privateMethod(this, _SearchableSelect_instances, isValidValue_fn).call(this, value));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (!this.multiple) {
|
|
133
|
+
if (this.values.length) {
|
|
134
|
+
__privateSet(this, _suppressFilter, true);
|
|
135
|
+
this._inputValue = __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.values[0]);
|
|
136
|
+
} else {
|
|
137
|
+
this._inputValue = "";
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
this.value = this.values.length ? this.values[0] : "";
|
|
141
|
+
__privateMethod(this, _SearchableSelect_instances, updateSelectedOnSlottedOptions_fn).call(this);
|
|
162
142
|
if (this.$fastController.isConnected) {
|
|
163
|
-
__privateMethod(this,
|
|
143
|
+
__privateMethod(this, _SearchableSelect_instances, updateTagLayout_fn).call(this);
|
|
164
144
|
}
|
|
145
|
+
__privateMethod(this, _SearchableSelect_instances, updateFormValue_fn).call(this);
|
|
165
146
|
}
|
|
166
147
|
/**
|
|
167
148
|
* @internal
|
|
168
149
|
*/
|
|
169
|
-
|
|
170
|
-
if (
|
|
171
|
-
this.
|
|
150
|
+
initialValuesChanged() {
|
|
151
|
+
if (!this.dirtyValue) {
|
|
152
|
+
this.values = this.initialValues;
|
|
172
153
|
this.dirtyValue = false;
|
|
173
154
|
}
|
|
174
155
|
}
|
|
175
156
|
/**
|
|
176
157
|
* @internal
|
|
177
158
|
*/
|
|
178
|
-
|
|
179
|
-
|
|
159
|
+
valueChanged(prev, next) {
|
|
160
|
+
super.valueChanged(prev, next);
|
|
161
|
+
if (!this._areOptionsInitialized) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const isValidValue = this._slottedOptions.some(
|
|
165
|
+
(option) => option.value === next
|
|
166
|
+
);
|
|
167
|
+
if (this.values[0] !== next) {
|
|
168
|
+
this.values = isValidValue ? [next] : [];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
get selectedIndex() {
|
|
172
|
+
if (this.values.length) {
|
|
173
|
+
return this._slottedOptions.findIndex(
|
|
174
|
+
(option) => option.value === this.values[0]
|
|
175
|
+
);
|
|
176
|
+
} else {
|
|
177
|
+
return -1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
set selectedIndex(index) {
|
|
181
|
+
this.value = this._slottedOptions[index]?.value ?? "";
|
|
182
|
+
}
|
|
183
|
+
get options() {
|
|
184
|
+
return [...this._slottedOptions];
|
|
185
|
+
}
|
|
186
|
+
get selectedOptions() {
|
|
187
|
+
return this._slottedOptions.filter(
|
|
188
|
+
(option) => this.values.includes(option.value)
|
|
189
|
+
);
|
|
180
190
|
}
|
|
181
191
|
/**
|
|
182
|
-
*
|
|
183
|
-
|
|
184
|
-
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
_inputValueChanged() {
|
|
195
|
+
__privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* @internal
|
|
185
199
|
*/
|
|
186
|
-
|
|
187
|
-
|
|
200
|
+
_onInputInput(event) {
|
|
201
|
+
__privateSet(this, _suppressFilter, false);
|
|
202
|
+
this._inputValue = event.target.value;
|
|
188
203
|
}
|
|
189
|
-
|
|
190
|
-
|
|
204
|
+
/**
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
_onInputFocus(_) {
|
|
208
|
+
__privateSet(this, _suppressFilter, true);
|
|
209
|
+
__privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
|
|
210
|
+
this.open = true;
|
|
191
211
|
}
|
|
192
212
|
/**
|
|
193
213
|
* @internal
|
|
194
214
|
*/
|
|
195
|
-
|
|
196
|
-
this.
|
|
197
|
-
if (
|
|
198
|
-
this.
|
|
199
|
-
|
|
215
|
+
_onInputBlur(_) {
|
|
216
|
+
this.open = false;
|
|
217
|
+
if (this.multiple) {
|
|
218
|
+
this._inputValue = "";
|
|
219
|
+
} else {
|
|
220
|
+
if (this.values.length === 0) {
|
|
221
|
+
this._inputValue = "";
|
|
222
|
+
} else {
|
|
223
|
+
this._inputValue = __privateMethod(this, _SearchableSelect_instances, textForValue_fn).call(this, this.values[0]);
|
|
224
|
+
}
|
|
200
225
|
}
|
|
201
|
-
|
|
202
|
-
|
|
226
|
+
this._changeDescription = "";
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @internal
|
|
230
|
+
*/
|
|
231
|
+
_onInputKeydown(e) {
|
|
232
|
+
if (e.ctrlKey || e.shiftKey) {
|
|
233
|
+
return true;
|
|
234
|
+
}
|
|
235
|
+
switch (e.key) {
|
|
236
|
+
case "Enter":
|
|
237
|
+
__privateMethod(this, _SearchableSelect_instances, selectHighlightedOption_fn).call(this);
|
|
238
|
+
return false;
|
|
239
|
+
case "Escape":
|
|
240
|
+
this.open = false;
|
|
241
|
+
break;
|
|
242
|
+
case "Home":
|
|
243
|
+
if (!this.open) {
|
|
244
|
+
this.open = true;
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
__privateMethod(this, _SearchableSelect_instances, highlightFirstOption_fn).call(this);
|
|
248
|
+
return false;
|
|
249
|
+
case "End":
|
|
250
|
+
if (!this.open) {
|
|
251
|
+
this.open = true;
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
__privateMethod(this, _SearchableSelect_instances, highlightLastOption_fn).call(this);
|
|
255
|
+
return false;
|
|
256
|
+
case "PageUp":
|
|
257
|
+
if (!this.open) {
|
|
258
|
+
this.open = true;
|
|
259
|
+
break;
|
|
260
|
+
}
|
|
261
|
+
__privateMethod(this, _SearchableSelect_instances, highlightPrevPage_fn).call(this);
|
|
262
|
+
return false;
|
|
263
|
+
case "PageDown":
|
|
264
|
+
if (!this.open) {
|
|
265
|
+
this.open = true;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
__privateMethod(this, _SearchableSelect_instances, highlightNextPage_fn).call(this);
|
|
269
|
+
return false;
|
|
270
|
+
case "ArrowUp":
|
|
271
|
+
if (!this.open) {
|
|
272
|
+
this.open = true;
|
|
273
|
+
break;
|
|
274
|
+
}
|
|
275
|
+
__privateMethod(this, _SearchableSelect_instances, highlightPreviousOption_fn).call(this);
|
|
276
|
+
return false;
|
|
277
|
+
case "ArrowDown":
|
|
278
|
+
if (!this.open) {
|
|
279
|
+
this.open = true;
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
__privateMethod(this, _SearchableSelect_instances, highlightNextOption_fn).call(this);
|
|
283
|
+
return false;
|
|
284
|
+
case "ArrowLeft":
|
|
285
|
+
if (this.multiple && this._inputValue === "" && this.values.length && !this.externalTags) {
|
|
286
|
+
__privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexLeft_fn).call(this, this.values.length));
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
return true;
|
|
290
|
+
case "Backspace":
|
|
291
|
+
if (this.multiple && this._inputValue === "" && this.values.length) {
|
|
292
|
+
this._onTagRemoved(this.values[this.values.length - 1]);
|
|
293
|
+
return false;
|
|
294
|
+
}
|
|
295
|
+
return true;
|
|
296
|
+
default:
|
|
297
|
+
if (!this.open) {
|
|
298
|
+
this.open = true;
|
|
299
|
+
}
|
|
300
|
+
return true;
|
|
203
301
|
}
|
|
302
|
+
return true;
|
|
204
303
|
}
|
|
205
304
|
/**
|
|
206
305
|
* @internal
|
|
207
306
|
*/
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
this.
|
|
211
|
-
|
|
307
|
+
_slottedOptionsChanged(oldValue, newValue) {
|
|
308
|
+
const hasSlottedOptions = Boolean(
|
|
309
|
+
this.querySelectorAll(`:not([slot])`).length
|
|
310
|
+
);
|
|
311
|
+
if (!newValue.length && hasSlottedOptions) {
|
|
312
|
+
return;
|
|
313
|
+
}
|
|
314
|
+
this._areOptionsInitialized = true;
|
|
315
|
+
if (oldValue) {
|
|
316
|
+
for (const option of oldValue) {
|
|
317
|
+
const notifier = defineVividComponent.Observable.getNotifier(option);
|
|
318
|
+
notifier.unsubscribe(__privateGet(this, _slottedOptionsChangeHandler), "selected");
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (newValue) {
|
|
322
|
+
for (const option of newValue) {
|
|
323
|
+
option._displayCheckmark = true;
|
|
324
|
+
const notifier = defineVividComponent.Observable.getNotifier(option);
|
|
325
|
+
notifier.subscribe(__privateGet(this, _slottedOptionsChangeHandler), "selected");
|
|
326
|
+
}
|
|
212
327
|
}
|
|
328
|
+
const values = [];
|
|
329
|
+
for (const option of this._slottedOptions) {
|
|
330
|
+
if (option.selected || option.value === this.value || this.values.includes(option.value)) {
|
|
331
|
+
values.push(option.value);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
__privateMethod(this, _SearchableSelect_instances, updateValuesWhileMaintainingOrder_fn).call(this, values);
|
|
335
|
+
__privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
|
|
213
336
|
}
|
|
214
337
|
/**
|
|
215
338
|
* @internal
|
|
216
339
|
*/
|
|
217
|
-
|
|
218
|
-
|
|
340
|
+
_tagIconSlotName(value) {
|
|
341
|
+
return `_tag-icon-${this.values.indexOf(value)}`;
|
|
219
342
|
}
|
|
343
|
+
// --- Tags ---
|
|
220
344
|
/**
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
* @public
|
|
345
|
+
* @internal
|
|
224
346
|
*/
|
|
225
|
-
|
|
226
|
-
|
|
347
|
+
_tagLabelForValue(value) {
|
|
348
|
+
const option = this._slottedOptions.find(
|
|
349
|
+
(option2) => option2.value === value
|
|
350
|
+
);
|
|
351
|
+
return option.label;
|
|
227
352
|
}
|
|
228
|
-
|
|
229
|
-
|
|
353
|
+
/**
|
|
354
|
+
* @internal
|
|
355
|
+
*/
|
|
356
|
+
_isTagDisabled(value) {
|
|
357
|
+
const option = this._slottedOptions.find(
|
|
358
|
+
(option2) => option2.value === value
|
|
359
|
+
);
|
|
360
|
+
return this.disabled || option.disabled;
|
|
230
361
|
}
|
|
231
362
|
/**
|
|
232
363
|
* @internal
|
|
233
364
|
*/
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
365
|
+
_onTagRemoved(value) {
|
|
366
|
+
__privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, this.values.filter((option) => option !== value));
|
|
367
|
+
__privateMethod(this, _SearchableSelect_instances, updateFilteredOptions_fn).call(this);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* @internal
|
|
371
|
+
*/
|
|
372
|
+
_onTagKeydown(event) {
|
|
373
|
+
const tagIndex = parseInt(event.target.dataset.index);
|
|
374
|
+
switch (event.key) {
|
|
375
|
+
case "Backspace":
|
|
376
|
+
case "Delete":
|
|
377
|
+
case "Enter":
|
|
378
|
+
case " ": {
|
|
379
|
+
this._onTagRemoved(this.values[tagIndex]);
|
|
380
|
+
defineVividComponent.DOM.processUpdates();
|
|
381
|
+
__privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexForRemoved_fn).call(this, tagIndex));
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
case "ArrowLeft":
|
|
385
|
+
__privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexLeft_fn).call(this, tagIndex) ?? tagIndex);
|
|
386
|
+
break;
|
|
387
|
+
case "ArrowRight":
|
|
388
|
+
__privateMethod(this, _SearchableSelect_instances, moveTagFocusTo_fn).call(this, __privateMethod(this, _SearchableSelect_instances, nextTagIndexRight_fn).call(this, tagIndex));
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @internal
|
|
395
|
+
*/
|
|
396
|
+
_onListboxClick(e) {
|
|
397
|
+
if (this.disabled) {
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
const capturedOption = e.target.closest(
|
|
401
|
+
`option,[role=option]`
|
|
402
|
+
);
|
|
403
|
+
if (capturedOption && !capturedOption.disabled) {
|
|
404
|
+
__privateMethod(this, _SearchableSelect_instances, handleOptionInteraction_fn).call(this, capturedOption);
|
|
237
405
|
}
|
|
238
406
|
}
|
|
239
|
-
|
|
407
|
+
/**
|
|
408
|
+
* @internal
|
|
409
|
+
*/
|
|
410
|
+
get _shouldShowClearButton() {
|
|
411
|
+
return this.clearable && this.values.length > 0;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* @internal
|
|
415
|
+
*/
|
|
416
|
+
_onClearButtonClick() {
|
|
417
|
+
__privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, this.selectedOptions.filter((option) => option.disabled).map((option) => option.value));
|
|
418
|
+
}
|
|
240
419
|
/**
|
|
241
420
|
* @internal
|
|
242
421
|
*/
|
|
243
422
|
nameChanged(previous, next) {
|
|
244
423
|
super.nameChanged(previous, next);
|
|
245
|
-
__privateMethod(this,
|
|
424
|
+
__privateMethod(this, _SearchableSelect_instances, updateFormValue_fn).call(this);
|
|
246
425
|
}
|
|
426
|
+
/**
|
|
427
|
+
* @internal
|
|
428
|
+
*/
|
|
247
429
|
formResetCallback() {
|
|
248
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
249
|
-
start: this.initialStart ?? this.min.toString(),
|
|
250
|
-
end: this.initialEnd ?? this.max.toString()
|
|
251
|
-
});
|
|
252
430
|
super.formResetCallback();
|
|
431
|
+
__privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, __privateMethod(this, _SearchableSelect_instances, determineInitialValues_fn).call(this));
|
|
253
432
|
}
|
|
254
433
|
/**
|
|
255
434
|
* @internal
|
|
256
435
|
*/
|
|
257
|
-
|
|
258
|
-
|
|
436
|
+
_onFieldsetClick(e) {
|
|
437
|
+
if (this.disabled) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (!e.defaultPrevented) {
|
|
441
|
+
this._input.focus();
|
|
442
|
+
this.open = true;
|
|
443
|
+
}
|
|
259
444
|
}
|
|
260
|
-
// --- Lifecycle ---
|
|
261
445
|
connectedCallback() {
|
|
262
446
|
super.connectedCallback();
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
__privateMethod(this, _RangeSlider_instances, registerThumbListeners_fn).call(this);
|
|
268
|
-
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
447
|
+
if (!this.values.length) {
|
|
448
|
+
this.values = __privateMethod(this, _SearchableSelect_instances, determineInitialValues_fn).call(this);
|
|
449
|
+
}
|
|
450
|
+
__privateGet(this, _resizeObserver).observe(this._contentArea);
|
|
269
451
|
}
|
|
270
452
|
disconnectedCallback() {
|
|
271
453
|
super.disconnectedCallback();
|
|
272
|
-
|
|
273
|
-
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
454
|
+
__privateGet(this, _resizeObserver).disconnect();
|
|
274
455
|
}
|
|
275
456
|
/**
|
|
276
457
|
* @internal
|
|
277
458
|
*/
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
459
|
+
validate() {
|
|
460
|
+
super.validate(this._input ?? void 0);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
_SearchableSelect_instances = new WeakSet();
|
|
464
|
+
updateValuesThroughUserInteraction_fn = function(newValues) {
|
|
465
|
+
this.values = newValues;
|
|
466
|
+
this.$emit("change", void 0, {
|
|
467
|
+
bubbles: false
|
|
468
|
+
});
|
|
469
|
+
this.$emit("input", void 0, {
|
|
470
|
+
bubbles: false
|
|
471
|
+
});
|
|
472
|
+
};
|
|
473
|
+
updateValuesWhileMaintainingOrder_fn = function(newValues) {
|
|
474
|
+
const oldSet = new Set(this.values);
|
|
475
|
+
const newSet = new Set(newValues);
|
|
476
|
+
this.values = [...this.values].filter((v) => newSet.has(v)).concat([...newValues].filter((v) => !oldSet.has(v)));
|
|
477
|
+
};
|
|
478
|
+
isValidValue_fn = function(value) {
|
|
479
|
+
return this._slottedOptions.some((option) => option.value === value);
|
|
480
|
+
};
|
|
481
|
+
_slottedOptionsChangeHandler = new WeakMap();
|
|
482
|
+
updateSelectedOnSlottedOptions_fn = function() {
|
|
483
|
+
for (const option of this._slottedOptions) {
|
|
484
|
+
option.selected = this.values.includes(option.value);
|
|
485
|
+
__privateMethod(this, _SearchableSelect_instances, updateClonedTagIconOfOption_fn).call(this, option);
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
handleOptionInteraction_fn = function(option) {
|
|
489
|
+
const value = option.value;
|
|
490
|
+
let newValues;
|
|
491
|
+
const isSelection = !this.values.includes(value);
|
|
492
|
+
if (this.multiple) {
|
|
493
|
+
if (isSelection) {
|
|
494
|
+
newValues = [...this.values, value];
|
|
495
|
+
} else {
|
|
496
|
+
newValues = this.values.filter((option2) => option2 !== value);
|
|
497
|
+
}
|
|
498
|
+
this._inputValue = "";
|
|
499
|
+
} else {
|
|
500
|
+
if (isSelection) {
|
|
501
|
+
newValues = [value];
|
|
502
|
+
this._inputValue = option.text;
|
|
503
|
+
} else {
|
|
504
|
+
newValues = [];
|
|
505
|
+
}
|
|
506
|
+
this.open = false;
|
|
507
|
+
}
|
|
508
|
+
this._changeDescription = isSelection ? this.locale.searchableSelect.optionSelectedMessage(option.text) : this.locale.searchableSelect.optionDeselectedMessage(option.text);
|
|
509
|
+
__privateMethod(this, _SearchableSelect_instances, updateValuesThroughUserInteraction_fn).call(this, newValues);
|
|
510
|
+
};
|
|
511
|
+
_clonedTagIcons = new WeakMap();
|
|
512
|
+
tagIconOfOption_fn = function(option) {
|
|
513
|
+
return option.querySelector('[slot="tag-icon"]');
|
|
514
|
+
};
|
|
515
|
+
updateClonedTagIconOfOption_fn = function(option) {
|
|
516
|
+
if (option.selected && __privateMethod(this, _SearchableSelect_instances, tagIconOfOption_fn).call(this, option)) {
|
|
517
|
+
let clone = __privateGet(this, _clonedTagIcons).get(option);
|
|
518
|
+
if (!clone) {
|
|
519
|
+
clone = __privateMethod(this, _SearchableSelect_instances, tagIconOfOption_fn).call(this, option).cloneNode(true);
|
|
520
|
+
__privateGet(this, _clonedTagIcons).set(option, clone);
|
|
521
|
+
}
|
|
522
|
+
clone.slot = this._tagIconSlotName(option.value);
|
|
523
|
+
this.appendChild(clone);
|
|
524
|
+
} else {
|
|
525
|
+
const clone = __privateGet(this, _clonedTagIcons).get(option);
|
|
526
|
+
if (clone) {
|
|
527
|
+
clone.remove();
|
|
528
|
+
__privateGet(this, _clonedTagIcons).delete(option);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
_suppressFilter = new WeakMap();
|
|
533
|
+
updateFilteredOptions_fn = function() {
|
|
534
|
+
const newFilteredOptions = [];
|
|
535
|
+
for (const option of this._slottedOptions ?? []) {
|
|
536
|
+
if (__privateGet(this, _suppressFilter) || this._inputValue === "") {
|
|
537
|
+
option.hidden = false;
|
|
538
|
+
option._matchedRange = null;
|
|
539
|
+
} else {
|
|
540
|
+
const matchIndex = option.text.toLowerCase().indexOf(this._inputValue.toLowerCase());
|
|
541
|
+
const matchedRange = matchIndex === -1 ? null : { from: matchIndex, to: matchIndex + this._inputValue.length };
|
|
542
|
+
option.hidden = !matchedRange;
|
|
543
|
+
option._matchedRange = matchedRange;
|
|
544
|
+
}
|
|
545
|
+
if (!option.hidden) {
|
|
546
|
+
newFilteredOptions.push(option);
|
|
281
547
|
}
|
|
282
|
-
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, e);
|
|
283
|
-
const startDistance = Math.abs(value - Number(this.start));
|
|
284
|
-
const endDistance = Math.abs(value - Number(this.end));
|
|
285
|
-
const thumb = startDistance < endDistance || startDistance === endDistance && value < Number(this.start) ? "start" : "end";
|
|
286
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
287
|
-
[thumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, value)}`
|
|
288
|
-
});
|
|
289
|
-
this._draggingThumb = thumb;
|
|
290
|
-
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb]);
|
|
291
|
-
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
292
548
|
}
|
|
549
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, null);
|
|
550
|
+
this._filteredOptions = newFilteredOptions;
|
|
551
|
+
this._filteredEnabledOptions = newFilteredOptions.filter(
|
|
552
|
+
(option) => !option.disabled
|
|
553
|
+
);
|
|
293
554
|
};
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
if (start === this.start) {
|
|
298
|
-
start = void 0;
|
|
555
|
+
transitionHighlightedOptionTo_fn = function(index) {
|
|
556
|
+
if (typeof this._highlightedOptionIndex === "number") {
|
|
557
|
+
this._filteredEnabledOptions[this._highlightedOptionIndex]._highlighted = false;
|
|
299
558
|
}
|
|
300
|
-
if (
|
|
301
|
-
|
|
559
|
+
if (typeof index === "number") {
|
|
560
|
+
if (!this._filteredEnabledOptions.length) {
|
|
561
|
+
index = null;
|
|
562
|
+
} else {
|
|
563
|
+
index = Math.max(
|
|
564
|
+
0,
|
|
565
|
+
Math.min(this._filteredEnabledOptions.length - 1, index)
|
|
566
|
+
);
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
this._highlightedOptionIndex = index;
|
|
570
|
+
if (typeof this._highlightedOptionIndex === "number") {
|
|
571
|
+
const highlightedOption = this._filteredEnabledOptions[this._highlightedOptionIndex];
|
|
572
|
+
highlightedOption._highlighted = true;
|
|
573
|
+
scrollIntoView.scrollIntoView(highlightedOption, this._listbox, "nearest");
|
|
574
|
+
this._changeDescription = this.locale.searchableSelect.optionFocusedMessage(
|
|
575
|
+
highlightedOption.text,
|
|
576
|
+
this._highlightedOptionIndex + 1,
|
|
577
|
+
this._filteredEnabledOptions.length
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
selectHighlightedOption_fn = function() {
|
|
582
|
+
if (this._highlightedOptionIndex === null) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
__privateMethod(this, _SearchableSelect_instances, handleOptionInteraction_fn).call(this, this._filteredEnabledOptions[this._highlightedOptionIndex]);
|
|
586
|
+
};
|
|
587
|
+
highlightFirstOption_fn = function() {
|
|
588
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, 0);
|
|
589
|
+
};
|
|
590
|
+
highlightLastOption_fn = function() {
|
|
591
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, this._filteredEnabledOptions.length - 1);
|
|
592
|
+
};
|
|
593
|
+
highlightPrevPage_fn = function() {
|
|
594
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - PageSize);
|
|
595
|
+
};
|
|
596
|
+
highlightNextPage_fn = function() {
|
|
597
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? -1) + PageSize);
|
|
598
|
+
};
|
|
599
|
+
highlightPreviousOption_fn = function() {
|
|
600
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? this._filteredEnabledOptions.length) - 1);
|
|
601
|
+
};
|
|
602
|
+
highlightNextOption_fn = function() {
|
|
603
|
+
__privateMethod(this, _SearchableSelect_instances, transitionHighlightedOptionTo_fn).call(this, (this._highlightedOptionIndex ?? -1) + 1);
|
|
604
|
+
};
|
|
605
|
+
textForValue_fn = function(value) {
|
|
606
|
+
const option = this._slottedOptions.find(
|
|
607
|
+
(option2) => option2.value === value
|
|
608
|
+
);
|
|
609
|
+
return option.text;
|
|
610
|
+
};
|
|
611
|
+
/**
|
|
612
|
+
* @internal
|
|
613
|
+
*/
|
|
614
|
+
measureTagWidth_fn = function(label, removable, hasIcon) {
|
|
615
|
+
const tag = document.createElement(this._optionTagTagName);
|
|
616
|
+
tag.label = label;
|
|
617
|
+
tag.removable = removable;
|
|
618
|
+
tag.style.cssText = "position: absolute; visibility: hidden;";
|
|
619
|
+
tag.hasIconPlaceholder = hasIcon;
|
|
620
|
+
this.shadowRoot.appendChild(tag);
|
|
621
|
+
const width = tag.getBoundingClientRect().width;
|
|
622
|
+
tag.remove();
|
|
623
|
+
return width;
|
|
624
|
+
};
|
|
625
|
+
updateTagLayout_fn = function() {
|
|
626
|
+
if (!this.multiple) {
|
|
627
|
+
this._numElidedTags = 0;
|
|
628
|
+
this._tagRows = [];
|
|
629
|
+
this._lastTagRow = [];
|
|
630
|
+
return;
|
|
302
631
|
}
|
|
303
|
-
if (
|
|
632
|
+
if (this.externalTags) {
|
|
633
|
+
this._numElidedTags = this.values.length;
|
|
634
|
+
this._tagRows = [];
|
|
635
|
+
this._lastTagRow = [];
|
|
304
636
|
return;
|
|
305
637
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
638
|
+
const rowWidth = this._contentArea.getBoundingClientRect().width;
|
|
639
|
+
const rows = [[]];
|
|
640
|
+
let currentRowIndex = 0;
|
|
641
|
+
let currentRowWidth = InputMinWidthPx;
|
|
642
|
+
let i;
|
|
643
|
+
for (i = this.values.length - 1; i >= 0; i--) {
|
|
644
|
+
const isLastRow = this.maxLines && currentRowIndex === this.maxLines - 1;
|
|
645
|
+
const tagWidth = __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this._tagLabelForValue(this.values[i]), true, __privateMethod(this, _SearchableSelect_instances, tagIconOfOption_fn).call(this, this.selectedOptions[i]) !== null);
|
|
646
|
+
const entry = {
|
|
647
|
+
value: this.values[i],
|
|
648
|
+
width: tagWidth
|
|
649
|
+
};
|
|
650
|
+
let elidedTagCounterWidth = 0;
|
|
651
|
+
if (isLastRow) {
|
|
652
|
+
const numElidedTags = i;
|
|
653
|
+
if (numElidedTags) {
|
|
654
|
+
elidedTagCounterWidth = TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, numElidedTags.toString(), false, false);
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
const totalWidthNeeded = currentRowWidth + TagGapPx + tagWidth + elidedTagCounterWidth;
|
|
658
|
+
if (totalWidthNeeded > rowWidth) {
|
|
659
|
+
if (isLastRow) {
|
|
660
|
+
if (i === this.values.length - 1) {
|
|
661
|
+
rows[currentRowIndex].unshift(entry);
|
|
662
|
+
currentRowWidth += TagGapPx + tagWidth;
|
|
663
|
+
} else {
|
|
664
|
+
break;
|
|
665
|
+
}
|
|
666
|
+
} else {
|
|
667
|
+
rows.push([]);
|
|
668
|
+
currentRowIndex++;
|
|
669
|
+
rows[currentRowIndex].unshift(entry);
|
|
670
|
+
currentRowWidth = tagWidth;
|
|
671
|
+
}
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
rows[currentRowIndex].unshift(entry);
|
|
675
|
+
currentRowWidth += TagGapPx + tagWidth;
|
|
676
|
+
}
|
|
677
|
+
this._numElidedTags = i + 1;
|
|
678
|
+
rows.reverse();
|
|
679
|
+
for (let i2 = 0; i2 < rows.length - 1; i2++) {
|
|
680
|
+
let lineWidth = rows[i2].map((e) => e.width).reduce((a, b) => a + b, 0) + (rows[i2].length - 1) * TagGapPx;
|
|
681
|
+
if (i2 === 0 && this._numElidedTags) {
|
|
682
|
+
lineWidth += TagGapPx + __privateMethod(this, _SearchableSelect_instances, measureTagWidth_fn).call(this, this._numElidedTags.toString(), false, false);
|
|
683
|
+
}
|
|
684
|
+
while (rows[i2 + 1].length && lineWidth + TagGapPx + rows[i2 + 1][0].width <= rowWidth) {
|
|
685
|
+
const nextTag = rows[i2 + 1].shift();
|
|
686
|
+
rows[i2].push(nextTag);
|
|
687
|
+
lineWidth += TagGapPx + nextTag.width;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
const rowValues = rows.map((line) => line.map((entry) => entry.value));
|
|
691
|
+
this._tagRows = rowValues.slice(0, -1);
|
|
692
|
+
this._lastTagRow = rowValues.slice(-1)[0];
|
|
693
|
+
};
|
|
694
|
+
moveTagFocusTo_fn = function(index) {
|
|
695
|
+
if (index === null) {
|
|
696
|
+
this._input.focus();
|
|
697
|
+
} else {
|
|
698
|
+
this.shadowRoot.querySelector(`[data-index="${index}"]`)?.focus();
|
|
309
699
|
}
|
|
310
|
-
|
|
311
|
-
|
|
700
|
+
};
|
|
701
|
+
nextTagIndexLeft_fn = function(index) {
|
|
702
|
+
if (!this.values.length) {
|
|
703
|
+
return null;
|
|
312
704
|
}
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
this.$emit("input:start");
|
|
705
|
+
for (let i = index - 1; i >= 0; i--) {
|
|
706
|
+
if (!this._isTagDisabled(this.values[i])) {
|
|
707
|
+
return i;
|
|
317
708
|
}
|
|
318
|
-
|
|
319
|
-
|
|
709
|
+
}
|
|
710
|
+
return null;
|
|
711
|
+
};
|
|
712
|
+
nextTagIndexRight_fn = function(index) {
|
|
713
|
+
if (!this.values.length) {
|
|
714
|
+
return null;
|
|
715
|
+
}
|
|
716
|
+
for (let i = index + 1; i < this.values.length; i++) {
|
|
717
|
+
if (!this._isTagDisabled(this.values[i])) {
|
|
718
|
+
return i;
|
|
320
719
|
}
|
|
321
|
-
this.$emit("input");
|
|
322
|
-
this.$emit("change");
|
|
323
|
-
this.dirtyValue = true;
|
|
324
720
|
}
|
|
325
|
-
|
|
721
|
+
return null;
|
|
326
722
|
};
|
|
327
|
-
|
|
328
|
-
__privateMethod(this,
|
|
329
|
-
|
|
330
|
-
|
|
723
|
+
nextTagIndexForRemoved_fn = function(index) {
|
|
724
|
+
return __privateMethod(this, _SearchableSelect_instances, nextTagIndexRight_fn).call(this, index - 1) ?? __privateMethod(this, _SearchableSelect_instances, nextTagIndexLeft_fn).call(this, index);
|
|
725
|
+
};
|
|
726
|
+
// --- Form handling ---
|
|
727
|
+
determineInitialValues_fn = function() {
|
|
728
|
+
return this.initialValues.length ? this.initialValues : this.initialValue ? [this.initialValue] : [];
|
|
331
729
|
};
|
|
332
730
|
updateFormValue_fn = function() {
|
|
333
731
|
if (!this.name) {
|
|
334
732
|
this.setFormValue(null);
|
|
335
733
|
} else {
|
|
336
734
|
const formData = new FormData();
|
|
337
|
-
|
|
338
|
-
|
|
735
|
+
for (const value of this.values) {
|
|
736
|
+
formData.append(this.name, value);
|
|
737
|
+
}
|
|
339
738
|
this.setFormValue(formData);
|
|
340
739
|
}
|
|
341
740
|
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
741
|
+
_resizeObserver = new WeakMap();
|
|
742
|
+
__decorateClass$1([
|
|
743
|
+
defineVividComponent.attr
|
|
744
|
+
], SearchableSelect.prototype, "appearance", 2);
|
|
745
|
+
__decorateClass$1([
|
|
746
|
+
defineVividComponent.attr
|
|
747
|
+
], SearchableSelect.prototype, "shape", 2);
|
|
748
|
+
__decorateClass$1([
|
|
749
|
+
defineVividComponent.attr({ mode: "boolean", attribute: "fixed-dropdown" })
|
|
750
|
+
], SearchableSelect.prototype, "fixedDropdown", 2);
|
|
751
|
+
__decorateClass$1([
|
|
752
|
+
defineVividComponent.attr
|
|
753
|
+
], SearchableSelect.prototype, "placeholder", 2);
|
|
754
|
+
__decorateClass$1([
|
|
755
|
+
defineVividComponent.attr({ mode: "boolean" })
|
|
756
|
+
], SearchableSelect.prototype, "open", 2);
|
|
757
|
+
__decorateClass$1([
|
|
758
|
+
defineVividComponent.attr({ mode: "boolean" })
|
|
759
|
+
], SearchableSelect.prototype, "multiple", 2);
|
|
760
|
+
__decorateClass$1([
|
|
761
|
+
defineVividComponent.attr({ attribute: "external-tags", mode: "boolean" })
|
|
762
|
+
], SearchableSelect.prototype, "externalTags", 2);
|
|
763
|
+
__decorateClass$1([
|
|
764
|
+
defineVividComponent.attr({ attribute: "max-lines", converter: defineVividComponent.nullableNumberConverter })
|
|
765
|
+
], SearchableSelect.prototype, "maxLines", 2);
|
|
766
|
+
__decorateClass$1([
|
|
767
|
+
defineVividComponent.observable
|
|
768
|
+
], SearchableSelect.prototype, "values", 2);
|
|
769
|
+
__decorateClass$1([
|
|
770
|
+
defineVividComponent.observable
|
|
771
|
+
], SearchableSelect.prototype, "initialValues", 2);
|
|
772
|
+
__decorateClass$1([
|
|
773
|
+
defineVividComponent.observable
|
|
774
|
+
], SearchableSelect.prototype, "_input", 2);
|
|
775
|
+
__decorateClass$1([
|
|
776
|
+
defineVividComponent.observable
|
|
777
|
+
], SearchableSelect.prototype, "_inputValue", 2);
|
|
778
|
+
__decorateClass$1([
|
|
779
|
+
defineVividComponent.observable
|
|
780
|
+
], SearchableSelect.prototype, "_slottedOptions", 2);
|
|
781
|
+
__decorateClass$1([
|
|
782
|
+
defineVividComponent.observable
|
|
783
|
+
], SearchableSelect.prototype, "_filteredOptions", 2);
|
|
784
|
+
__decorateClass$1([
|
|
785
|
+
defineVividComponent.observable
|
|
786
|
+
], SearchableSelect.prototype, "_filteredEnabledOptions", 2);
|
|
787
|
+
__decorateClass$1([
|
|
788
|
+
defineVividComponent.observable
|
|
789
|
+
], SearchableSelect.prototype, "_highlightedOptionIndex", 2);
|
|
790
|
+
__decorateClass$1([
|
|
791
|
+
defineVividComponent.observable
|
|
792
|
+
], SearchableSelect.prototype, "_contentArea", 2);
|
|
793
|
+
__decorateClass$1([
|
|
794
|
+
defineVividComponent.observable
|
|
795
|
+
], SearchableSelect.prototype, "_numElidedTags", 2);
|
|
796
|
+
__decorateClass$1([
|
|
797
|
+
defineVividComponent.observable
|
|
798
|
+
], SearchableSelect.prototype, "_tagRows", 2);
|
|
799
|
+
__decorateClass$1([
|
|
800
|
+
defineVividComponent.observable
|
|
801
|
+
], SearchableSelect.prototype, "_lastTagRow", 2);
|
|
802
|
+
__decorateClass$1([
|
|
803
|
+
defineVividComponent.observable
|
|
804
|
+
], SearchableSelect.prototype, "_listbox", 2);
|
|
805
|
+
__decorateClass$1([
|
|
806
|
+
defineVividComponent.attr({ mode: "boolean" })
|
|
807
|
+
], SearchableSelect.prototype, "clearable", 2);
|
|
808
|
+
__decorateClass$1([
|
|
809
|
+
defineVividComponent.observable
|
|
810
|
+
], SearchableSelect.prototype, "_changeDescription", 2);
|
|
811
|
+
__decorateClass$1([
|
|
812
|
+
defineVividComponent.observable
|
|
813
|
+
], SearchableSelect.prototype, "_anchor", 2);
|
|
814
|
+
SearchableSelect = __decorateClass$1([
|
|
815
|
+
formElements.errorText,
|
|
816
|
+
formElements.formElements
|
|
817
|
+
], SearchableSelect);
|
|
818
|
+
applyMixinsWithObservables.applyMixinsWithObservables(
|
|
819
|
+
SearchableSelect,
|
|
820
|
+
affix.AffixIconWithTrailing,
|
|
821
|
+
formElements.FormElementHelperText,
|
|
822
|
+
formElements.FormElementSuccessText,
|
|
823
|
+
localized.Localized
|
|
824
|
+
);
|
|
825
|
+
|
|
826
|
+
var __defProp = Object.defineProperty;
|
|
827
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
828
|
+
var result = void 0 ;
|
|
829
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
830
|
+
if (decorator = decorators[i])
|
|
831
|
+
result = (decorator(target, key, result) ) || result;
|
|
832
|
+
if (result) __defProp(target, key, result);
|
|
833
|
+
return result;
|
|
391
834
|
};
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
403
|
-
"mousedown",
|
|
404
|
-
__privateGet(this, _onThumbMousedown),
|
|
405
|
-
{ passive: true }
|
|
406
|
-
);
|
|
407
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
408
|
-
"touchstart",
|
|
409
|
-
__privateGet(this, _onThumbMousedown),
|
|
410
|
-
{ passive: true }
|
|
411
|
-
);
|
|
412
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseover", __privateGet(this, _onMouseOver), {
|
|
413
|
-
passive: true
|
|
414
|
-
});
|
|
415
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseout", __privateGet(this, _onMouseOut), {
|
|
416
|
-
passive: true
|
|
835
|
+
class OptionTag extends foundationElement.FoundationElement {
|
|
836
|
+
constructor() {
|
|
837
|
+
super(...arguments);
|
|
838
|
+
this.removable = false;
|
|
839
|
+
this.disabled = false;
|
|
840
|
+
this.hasIconPlaceholder = false;
|
|
841
|
+
}
|
|
842
|
+
_onClickRemove() {
|
|
843
|
+
this.$emit("remove", void 0, {
|
|
844
|
+
bubbles: false
|
|
417
845
|
});
|
|
418
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("focus", __privateGet(this, _onThumbFocus));
|
|
419
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
420
846
|
}
|
|
421
|
-
}
|
|
422
|
-
unregisterThumbListeners_fn = function() {
|
|
423
|
-
for (const thumb of ["start", "end"]) {
|
|
424
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
425
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
426
|
-
"mousedown",
|
|
427
|
-
__privateGet(this, _onThumbMousedown)
|
|
428
|
-
);
|
|
429
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
430
|
-
"touchstart",
|
|
431
|
-
__privateGet(this, _onThumbMousedown)
|
|
432
|
-
);
|
|
433
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseover", __privateGet(this, _onMouseOver));
|
|
434
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseout", __privateGet(this, _onMouseOut));
|
|
435
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("focus", __privateGet(this, _onThumbFocus));
|
|
436
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
_onThumbFocus = new WeakMap();
|
|
440
|
-
_onThumbBlur = new WeakMap();
|
|
441
|
-
_onMouseOver = new WeakMap();
|
|
442
|
-
_onMouseOut = new WeakMap();
|
|
443
|
-
_onThumbMousedown = new WeakMap();
|
|
444
|
-
_onThumbKeydown = new WeakMap();
|
|
445
|
-
registerDragHandlers_fn = function() {
|
|
446
|
-
window.addEventListener("mousemove", __privateGet(this, _onDragMove), { passive: true });
|
|
447
|
-
window.addEventListener("touchmove", __privateGet(this, _onDragMove), { passive: true });
|
|
448
|
-
window.addEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
449
|
-
window.addEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
450
|
-
window.document.addEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
451
|
-
};
|
|
452
|
-
unregisterDragListeners_fn = function() {
|
|
453
|
-
window.removeEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
454
|
-
window.document.removeEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
455
|
-
window.removeEventListener("mousemove", __privateGet(this, _onDragMove));
|
|
456
|
-
window.removeEventListener("touchmove", __privateGet(this, _onDragMove));
|
|
457
|
-
window.removeEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
458
|
-
};
|
|
459
|
-
_onDragMove = new WeakMap();
|
|
460
|
-
_onDragEnd = new WeakMap();
|
|
461
|
-
__decorateClass([
|
|
462
|
-
index.observable
|
|
463
|
-
], RangeSlider.prototype, "start", 2);
|
|
464
|
-
__decorateClass([
|
|
465
|
-
index.attr({ mode: "fromView", attribute: "start" })
|
|
466
|
-
], RangeSlider.prototype, "initialStart", 2);
|
|
467
|
-
__decorateClass([
|
|
468
|
-
index.attr({ attribute: "current-start" })
|
|
469
|
-
], RangeSlider.prototype, "currentStart", 2);
|
|
470
|
-
__decorateClass([
|
|
471
|
-
index.observable
|
|
472
|
-
], RangeSlider.prototype, "end", 2);
|
|
473
|
-
__decorateClass([
|
|
474
|
-
index.attr({ mode: "fromView", attribute: "end" })
|
|
475
|
-
], RangeSlider.prototype, "initialEnd", 2);
|
|
476
|
-
__decorateClass([
|
|
477
|
-
index.attr({ attribute: "current-end" })
|
|
478
|
-
], RangeSlider.prototype, "currentEnd", 2);
|
|
479
|
-
__decorateClass([
|
|
480
|
-
index.attr({ converter: index.nullableNumberConverter })
|
|
481
|
-
], RangeSlider.prototype, "min", 2);
|
|
482
|
-
__decorateClass([
|
|
483
|
-
index.attr({ converter: index.nullableNumberConverter })
|
|
484
|
-
], RangeSlider.prototype, "max", 2);
|
|
485
|
-
__decorateClass([
|
|
486
|
-
index.attr({ converter: index.nullableNumberConverter })
|
|
487
|
-
], RangeSlider.prototype, "step", 2);
|
|
488
|
-
__decorateClass([
|
|
489
|
-
index.attr
|
|
490
|
-
], RangeSlider.prototype, "orientation", 2);
|
|
491
|
-
__decorateClass([
|
|
492
|
-
index.attr({ attribute: "aria-start-label" })
|
|
493
|
-
], RangeSlider.prototype, "ariaStartLabel", 2);
|
|
494
|
-
__decorateClass([
|
|
495
|
-
index.attr({ attribute: "aria-end-label" })
|
|
496
|
-
], RangeSlider.prototype, "ariaEndLabel", 2);
|
|
497
|
-
__decorateClass([
|
|
498
|
-
index.attr({ mode: "boolean" })
|
|
499
|
-
], RangeSlider.prototype, "markers", 2);
|
|
500
|
-
__decorateClass([
|
|
501
|
-
index.attr
|
|
502
|
-
], RangeSlider.prototype, "connotation", 2);
|
|
503
|
-
__decorateClass([
|
|
504
|
-
index.attr({ mode: "boolean" })
|
|
505
|
-
], RangeSlider.prototype, "pin", 2);
|
|
506
|
-
__decorateClass([
|
|
507
|
-
index.observable
|
|
508
|
-
], RangeSlider.prototype, "valueTextFormatter", 2);
|
|
509
|
-
__decorateClass([
|
|
510
|
-
index.observable
|
|
511
|
-
], RangeSlider.prototype, "_draggingThumb", 2);
|
|
847
|
+
}
|
|
512
848
|
__decorateClass([
|
|
513
|
-
|
|
514
|
-
],
|
|
849
|
+
defineVividComponent.attr
|
|
850
|
+
], OptionTag.prototype, "shape");
|
|
515
851
|
__decorateClass([
|
|
516
|
-
|
|
517
|
-
],
|
|
852
|
+
defineVividComponent.attr
|
|
853
|
+
], OptionTag.prototype, "label");
|
|
518
854
|
__decorateClass([
|
|
519
|
-
|
|
520
|
-
],
|
|
855
|
+
defineVividComponent.attr({ mode: "boolean" })
|
|
856
|
+
], OptionTag.prototype, "removable");
|
|
521
857
|
__decorateClass([
|
|
522
|
-
|
|
523
|
-
],
|
|
858
|
+
defineVividComponent.attr({ mode: "boolean" })
|
|
859
|
+
], OptionTag.prototype, "disabled");
|
|
524
860
|
__decorateClass([
|
|
525
|
-
|
|
526
|
-
],
|
|
527
|
-
|
|
528
|
-
formElements.formElements
|
|
529
|
-
], RangeSlider);
|
|
530
|
-
applyMixins.applyMixins(RangeSlider, localized.Localized);
|
|
861
|
+
defineVividComponent.observable
|
|
862
|
+
], OptionTag.prototype, "hasIconPlaceholder");
|
|
863
|
+
applyMixins.applyMixins(OptionTag, localized.Localized);
|
|
531
864
|
|
|
532
|
-
const
|
|
533
|
-
"
|
|
534
|
-
[
|
|
535
|
-
[`
|
|
865
|
+
const getStateClasses = (x) => classNames.classNames(
|
|
866
|
+
["disabled", x.disabled],
|
|
867
|
+
[`appearance-${x.appearance}`, Boolean(x.appearance)],
|
|
868
|
+
[`shape-${x.shape}`, Boolean(x.shape)],
|
|
869
|
+
["error", Boolean(x.errorValidationMessage)],
|
|
870
|
+
["success", !!x.successText]
|
|
536
871
|
);
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
872
|
+
function renderLabel() {
|
|
873
|
+
return defineVividComponent.html`
|
|
874
|
+
<label for="control" class="label" id="label"> ${(x) => x.label} </label>
|
|
875
|
+
`;
|
|
876
|
+
}
|
|
877
|
+
const tagTemplateFactory = (context, getComponent) => {
|
|
878
|
+
const optionTagTag = context.tagFor(OptionTag);
|
|
879
|
+
return defineVividComponent.html`
|
|
880
|
+
<div class="tag-wrapper">
|
|
881
|
+
<${optionTagTag}
|
|
882
|
+
class="tag"
|
|
883
|
+
tabindex="-1"
|
|
884
|
+
data-index="${(x, c) => getComponent(c).values.indexOf(x)}"
|
|
885
|
+
removable
|
|
886
|
+
:label="${(x, c) => getComponent(c)._tagLabelForValue(x)}"
|
|
887
|
+
:shape="${(_, c) => getComponent(c).shape}"
|
|
888
|
+
?disabled="${(x, c) => getComponent(c)._isTagDisabled(x)}"
|
|
889
|
+
@remove="${(x, c) => getComponent(c)._onTagRemoved(x)}"
|
|
890
|
+
@keydown="${(_, c) => getComponent(c)._onTagKeydown(c.event)}"
|
|
891
|
+
@mousedown="${() => false}">
|
|
892
|
+
<slot slot="icon" name="${(x, c) => getComponent(c)._tagIconSlotName(x)}"></slot>
|
|
893
|
+
</${optionTagTag}>
|
|
894
|
+
</div>
|
|
895
|
+
`;
|
|
896
|
+
};
|
|
897
|
+
const elidedTagTemplateFactory = (context, getComponent) => {
|
|
898
|
+
const optionTagTag = context.tagFor(OptionTag);
|
|
899
|
+
return defineVividComponent.html`
|
|
900
|
+
<${optionTagTag}
|
|
901
|
+
class="tag"
|
|
902
|
+
tabindex="-1"
|
|
903
|
+
:label="${(x, c) => getComponent(x, c)._numElidedTags.toString()}"
|
|
904
|
+
:shape="${(x, c) => getComponent(x, c).shape}"
|
|
905
|
+
?disabled="${(x, c) => getComponent(x, c).disabled}"
|
|
906
|
+
@mousedown="${() => false}">
|
|
907
|
+
</${optionTagTag}>
|
|
908
|
+
`;
|
|
909
|
+
};
|
|
910
|
+
function renderFieldset(context) {
|
|
911
|
+
const buttonTag = context.tagFor(definition$1.Button);
|
|
912
|
+
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
913
|
+
const chevronTemplate = definition$1.chevronTemplateFactory(context);
|
|
914
|
+
const tagTemplate = tagTemplateFactory(context, (c) => c.parent);
|
|
915
|
+
const nestedTagTemplate = tagTemplateFactory(
|
|
916
|
+
context,
|
|
917
|
+
(c) => c.parentContext.parent
|
|
918
|
+
);
|
|
919
|
+
const elidedTagTemplate = elidedTagTemplateFactory(context, (x, _) => x);
|
|
920
|
+
const nestedElidedTagTemplate = elidedTagTemplateFactory(
|
|
921
|
+
context,
|
|
922
|
+
(_, c) => c.parent
|
|
923
|
+
);
|
|
924
|
+
return defineVividComponent.html`
|
|
925
|
+
<div
|
|
926
|
+
class="fieldset ${getStateClasses}"
|
|
927
|
+
@click="${(x, c) => x._onFieldsetClick(c.event)}"
|
|
928
|
+
${ref.ref("_anchor")}
|
|
929
|
+
>
|
|
930
|
+
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
931
|
+
<div class="content-area" ${ref.ref("_contentArea")}>
|
|
932
|
+
${repeat.repeat(
|
|
933
|
+
(x) => x._tagRows,
|
|
934
|
+
defineVividComponent.html`
|
|
935
|
+
<div class="tag-row">
|
|
936
|
+
${when.when(
|
|
937
|
+
(_, c) => c.isFirst && c.parent._numElidedTags,
|
|
938
|
+
nestedElidedTagTemplate
|
|
939
|
+
)}
|
|
940
|
+
${repeat.repeat((x) => x, nestedTagTemplate)}
|
|
941
|
+
</div>
|
|
942
|
+
`,
|
|
943
|
+
{ positioning: true }
|
|
556
944
|
)}
|
|
557
|
-
</div>
|
|
558
945
|
<div
|
|
559
|
-
${
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
tabindex="${(x) => x.disabled ? null : 0}"
|
|
564
|
-
aria-label="${(x) => x.ariaStartLabel || x.locale.rangeSlider.startThumbLabel}"
|
|
565
|
-
aria-valuetext="${(x) => x.valueTextFormatter(x.start)}"
|
|
566
|
-
aria-valuenow="${(x) => x.start}"
|
|
567
|
-
aria-valuemin="${(x) => x.min}"
|
|
568
|
-
aria-valuemax="${(x) => x.end}"
|
|
569
|
-
aria-disabled="${(x) => x.disabled}"
|
|
570
|
-
aria-orientation="${(x) => x.orientation}"
|
|
571
|
-
></div>
|
|
572
|
-
${when.when(
|
|
573
|
-
(x) => x.pin,
|
|
574
|
-
index.html`<${popupTag}
|
|
575
|
-
class="popup"
|
|
576
|
-
arrow
|
|
577
|
-
alternate
|
|
578
|
-
:anchor="${(x) => x._startThumbEl}"
|
|
579
|
-
:open=${(x) => x._isThumbPopupOpen("start")}
|
|
580
|
-
:placementStrategy=${(x) => x.orientation === aria.Orientation.horizontal ? definition.PlacementStrategy.AutoPlacementHorizontal : definition.PlacementStrategy.AutoPlacementVertical}
|
|
581
|
-
animation-frame
|
|
582
|
-
exportparts="vvd-theme-alternate"
|
|
583
|
-
aria-hidden="true"
|
|
946
|
+
class="tag-row ${(x) => classNames.classNames([
|
|
947
|
+
"contains-only-input",
|
|
948
|
+
x._tagRows.length > 0 && x._lastTagRow.length === 0
|
|
949
|
+
])}"
|
|
584
950
|
>
|
|
585
|
-
|
|
586
|
-
|
|
951
|
+
${when.when(
|
|
952
|
+
(x) => x._tagRows.length === 0 && x._numElidedTags,
|
|
953
|
+
elidedTagTemplate
|
|
587
954
|
)}
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
955
|
+
${repeat.repeat((x) => x._lastTagRow, tagTemplate)}
|
|
956
|
+
<input
|
|
957
|
+
id="control"
|
|
958
|
+
class="control"
|
|
959
|
+
autofocus
|
|
960
|
+
autocomplete="off"
|
|
961
|
+
aria-autocomplete="list"
|
|
962
|
+
aria-expanded="${(x) => x.open}"
|
|
963
|
+
aria-haspopup="listbox"
|
|
964
|
+
aria-controls="listbox"
|
|
965
|
+
placeholder="${(x) => x.multiple && x.values.length ? "" : x.placeholder}"
|
|
966
|
+
role="combobox"
|
|
967
|
+
type="text"
|
|
968
|
+
?disabled="${(x) => x.disabled}"
|
|
969
|
+
:value="${(x) => x._inputValue}"
|
|
970
|
+
@input="${(x, c) => x._onInputInput(c.event)}"
|
|
971
|
+
@focus="${(x, c) => x._onInputFocus(c.event)}"
|
|
972
|
+
@blur="${(x, c) => x._onInputBlur(c.event)}"
|
|
973
|
+
@keydown="${(x, c) => x._onInputKeydown(c.event)}"
|
|
974
|
+
${ref.ref("_input")}
|
|
975
|
+
/>
|
|
976
|
+
</div>
|
|
977
|
+
</div>
|
|
978
|
+
<slot name="meta"></slot>
|
|
979
|
+
${when.when(
|
|
980
|
+
(x) => x._shouldShowClearButton,
|
|
981
|
+
defineVividComponent.html`<${buttonTag}
|
|
982
|
+
aria-label="${(x) => x.locale.searchableSelect.clearButtonLabel}"
|
|
983
|
+
@click="${(x) => x._onClearButtonClick()}"
|
|
984
|
+
@mousedown="${() => false}"
|
|
985
|
+
?disabled="${(x) => x.disabled}"
|
|
986
|
+
:shape="${(x) => x.shape}"
|
|
987
|
+
size="super-condensed"
|
|
988
|
+
icon="close-line"
|
|
989
|
+
appearance="ghost-light"
|
|
990
|
+
tabindex="-1"
|
|
991
|
+
></${buttonTag}>`
|
|
992
|
+
)}
|
|
993
|
+
${chevronTemplate}
|
|
994
|
+
</div>
|
|
995
|
+
`;
|
|
996
|
+
}
|
|
997
|
+
function renderControl(context) {
|
|
998
|
+
const popupTag = context.tagFor(definition.Popup);
|
|
999
|
+
return defineVividComponent.html`
|
|
1000
|
+
${when.when((x) => x.label, renderLabel())}
|
|
1001
|
+
<span aria-live="assertive" aria-relevant="text" class="visually-hidden">
|
|
1002
|
+
${(x) => x._changeDescription}
|
|
1003
|
+
</span>
|
|
1004
|
+
<div>
|
|
1005
|
+
${renderFieldset(context)}
|
|
1006
|
+
<div class="popup-wrapper">
|
|
1007
|
+
<${popupTag}
|
|
1008
|
+
:anchor="${(x) => x._anchor}"
|
|
1009
|
+
:open="${(x) => x.open}"
|
|
605
1010
|
class="popup"
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
1011
|
+
placement="bottom-start"
|
|
1012
|
+
strategy="${(x) => x.fixedDropdown ? "fixed" : "absolute"}">
|
|
1013
|
+
<div
|
|
1014
|
+
class="listbox"
|
|
1015
|
+
role="listbox"
|
|
1016
|
+
aria-multiselectable="${(x) => x.multiple}"
|
|
1017
|
+
aria-required="${(x) => x.required}"
|
|
1018
|
+
${ref.ref("_listbox")}
|
|
1019
|
+
@click="${(x, c) => x._onListboxClick(c.event)}"
|
|
1020
|
+
@mousedown="${() => false}"
|
|
1021
|
+
>
|
|
1022
|
+
<slot
|
|
1023
|
+
${slotted.slotted({
|
|
1024
|
+
filter: listbox.Listbox.slottedOptionFilter,
|
|
1025
|
+
flatten: true,
|
|
1026
|
+
property: "_slottedOptions"
|
|
1027
|
+
})}>
|
|
1028
|
+
</slot>
|
|
1029
|
+
${when.when(
|
|
1030
|
+
(x) => x._filteredOptions.length === 0,
|
|
1031
|
+
defineVividComponent.html`<div class="empty-message">
|
|
1032
|
+
${when.when(
|
|
1033
|
+
(x) => x._inputValue === "",
|
|
1034
|
+
defineVividComponent.html`<slot name="no-options">
|
|
1035
|
+
${(x) => x.locale.searchableSelect.noOptionsMessage}
|
|
1036
|
+
</slot>`
|
|
1037
|
+
)}
|
|
1038
|
+
${when.when(
|
|
1039
|
+
(x) => x._inputValue !== "",
|
|
1040
|
+
defineVividComponent.html`<slot name="no-matches">
|
|
1041
|
+
${(x) => x.locale.searchableSelect.noMatchesMessage}
|
|
1042
|
+
</slot>`
|
|
1043
|
+
)}
|
|
1044
|
+
</div>`
|
|
617
1045
|
)}
|
|
1046
|
+
</div>
|
|
1047
|
+
</${popupTag}>
|
|
618
1048
|
</div>
|
|
619
1049
|
</div>
|
|
620
|
-
|
|
1050
|
+
`;
|
|
1051
|
+
}
|
|
1052
|
+
const SearchableSelectTemplate = (context) => {
|
|
1053
|
+
const optionTagTag = context.tagFor(OptionTag);
|
|
1054
|
+
return defineVividComponent.html`
|
|
1055
|
+
<template :_optionTagTagName="${() => optionTagTag}">
|
|
1056
|
+
<div class="control-wrapper">
|
|
1057
|
+
${renderControl(context)} ${formElements.getFeedbackTemplate(context)}
|
|
1058
|
+
</div>
|
|
1059
|
+
</template>
|
|
1060
|
+
`;
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
const getClasses = ({ shape, disabled, removable }) => classNames.classNames(
|
|
1064
|
+
"base",
|
|
1065
|
+
["disabled", disabled],
|
|
1066
|
+
["removable", removable],
|
|
1067
|
+
[`shape-${shape}`, Boolean(shape)]
|
|
1068
|
+
);
|
|
1069
|
+
function renderRemoveButton(iconTag) {
|
|
1070
|
+
return defineVividComponent.html`
|
|
1071
|
+
<span
|
|
1072
|
+
class="remove-button"
|
|
1073
|
+
aria-label="${(x) => x.locale.searchableSelect.removeTagButtonLabel(x.label)}"
|
|
1074
|
+
role="button"
|
|
1075
|
+
tabindex="${(x) => x.disabled ? null : 0}"
|
|
1076
|
+
@click="${(x) => x._onClickRemove()}"
|
|
1077
|
+
>
|
|
1078
|
+
<${iconTag} name="close-line"></${iconTag}>
|
|
1079
|
+
</span>
|
|
1080
|
+
`;
|
|
1081
|
+
}
|
|
1082
|
+
const optionTagTemplate = (context) => {
|
|
1083
|
+
const iconTag = context.tagFor(definition$2.Icon);
|
|
1084
|
+
return defineVividComponent.html`<span class="${getClasses}" aria-disabled="${(x) => x.disabled}">
|
|
1085
|
+
<slot name="icon" aria-hidden="true">
|
|
1086
|
+
${when.when(
|
|
1087
|
+
(x) => x.hasIconPlaceholder,
|
|
1088
|
+
defineVividComponent.html`<div class="icon-placeholder"></div>`
|
|
1089
|
+
)}
|
|
1090
|
+
</slot>
|
|
1091
|
+
${when.when(
|
|
1092
|
+
(x) => x.label,
|
|
1093
|
+
(x) => defineVividComponent.html`<span class="label">${x.label}</span>`
|
|
1094
|
+
)}
|
|
1095
|
+
${when.when((x) => x.removable, renderRemoveButton(iconTag))}
|
|
1096
|
+
</span>`;
|
|
621
1097
|
};
|
|
622
1098
|
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
const
|
|
1099
|
+
const optionTagDefinition = defineVividComponent.defineVividComponent(
|
|
1100
|
+
"option-tag",
|
|
1101
|
+
OptionTag,
|
|
1102
|
+
optionTagTemplate,
|
|
1103
|
+
[definition$2.iconDefinition],
|
|
1104
|
+
{
|
|
1105
|
+
styles: [optionTagStyles],
|
|
1106
|
+
shadowOptions: {
|
|
1107
|
+
delegatesFocus: true
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
);
|
|
1111
|
+
const searchableSelectDefinition = defineVividComponent.defineVividComponent(
|
|
1112
|
+
"searchable-select",
|
|
1113
|
+
SearchableSelect,
|
|
1114
|
+
SearchableSelectTemplate,
|
|
1115
|
+
[definition$1.buttonDefinition, definition.popupDefinition, definition$2.iconDefinition, optionTagDefinition],
|
|
1116
|
+
{
|
|
1117
|
+
styles,
|
|
1118
|
+
shadowOptions: {
|
|
1119
|
+
delegatesFocus: true
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
);
|
|
1123
|
+
const registerSearchableSelect = defineVividComponent.createRegisterFunction(
|
|
1124
|
+
searchableSelectDefinition
|
|
1125
|
+
);
|
|
636
1126
|
|
|
637
|
-
exports.
|
|
638
|
-
exports.rangeSliderRegistries = rangeSliderRegistries;
|
|
639
|
-
exports.registerRangeSlider = registerRangeSlider;
|
|
1127
|
+
exports.registerSearchableSelect = registerSearchableSelect;
|