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