@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/definition41.js
CHANGED
|
@@ -1,637 +1,212 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
5
|
-
import { F as FormAssociated } from './form-associated.js';
|
|
6
|
-
import { i as inverseLerp, l as lerp, r as roundToStepValue, d as defaultToOneConverter, g as getMarkersTemplate } from './slider.template.js';
|
|
7
|
-
import { O as Orientation } from './aria.js';
|
|
8
|
-
import { l as limit } from './numbers.js';
|
|
9
|
-
import { f as formElements } from './form-elements.js';
|
|
10
|
-
import { L as Localized } from './localized.js';
|
|
11
|
-
import { r as ref } from './ref.js';
|
|
12
|
-
import { w as when } from './when.js';
|
|
1
|
+
import { V as VividElement, D as DOM, a as attr, o as observable, h as html, d as createRegisterFunction, f as defineVividComponent } from './vivid-element.js';
|
|
2
|
+
import { C as CheckableFormAssociated } from './form-associated.js';
|
|
3
|
+
import { a as keySpace } from './key-codes.js';
|
|
13
4
|
import { c as classNames } from './class-names.js';
|
|
5
|
+
import { w as when } from './when.js';
|
|
14
6
|
|
|
15
|
-
const styles = ":host
|
|
7
|
+
const styles = ":host(:focus-visible){outline:none}:host([disabled]){cursor:not-allowed}.base.connotation-cta{--_connotation-color-primary: var(--vvd-radio-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-radio-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-intermediate: var(--vvd-radio-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-firm: var(--vvd-radio-cta-firm, var(--vvd-color-cta-600));--_connotation-color-fierce: var(--vvd-radio-cta-fierce, var(--vvd-color-cta-700))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-radio-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-radio-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-radio-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-intermediate: var(--vvd-radio-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-firm: var(--vvd-radio-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-fierce: var(--vvd-radio-accent-fierce, var(--vvd-color-neutral-700))}.base{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.base: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)}.base:where(.checked,:checked):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: var(--_connotation-color-primary)}.base:where(.checked,:checked):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: var(--_connotation-color-primary-increment)}.base: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)}.base: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)}.base{display:inline-flex;align-items:center;cursor:pointer;gap:8px}@supports (user-select: none){.base{user-select:none}}.base.disabled{pointer-events:none}.control{position:relative;flex-shrink:0;border-radius:50%;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}.base:not(.checked) .control{background-color:var(--_appearance-color-fill)}.control:after{position:absolute;border-radius:inherit;background-color:var(--_appearance-color-outline);content:\"\";inset:5px;opacity:1;transition:opacity .2s}.base:not(.checked) .control:after{opacity:0}:host(:focus-visible) .control{--focus-inset: -3px;--focus-stroke-gap-color: transparent}:host(:focus-visible) .control:before{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;display:block;border-radius:inherit;block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));content:\"\";inline-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}label{color:var(--vvd-color-canvas-text);cursor:pointer;font:var(--vvd-typography-base)}.focus-indicator{--focus-inset: -3px;--focus-stroke-gap-color: transparent;border-radius:50%}:host(:not(:focus-visible)) .focus-indicator{display:none}";
|
|
16
8
|
|
|
17
|
-
class
|
|
9
|
+
class _Radio extends VividElement {
|
|
18
10
|
}
|
|
19
|
-
class
|
|
11
|
+
class FormAssociatedRadio extends CheckableFormAssociated(_Radio) {
|
|
20
12
|
constructor() {
|
|
21
13
|
super(...arguments);
|
|
22
14
|
this.proxy = document.createElement("input");
|
|
15
|
+
this.#validateValueMissingWithSiblings = () => {
|
|
16
|
+
const siblings = this.#radioSiblings;
|
|
17
|
+
if (siblings && siblings.length > 1) {
|
|
18
|
+
const isSiblingChecked = siblings.some((x) => x.checked);
|
|
19
|
+
if (isSiblingChecked) {
|
|
20
|
+
this.setValidity({ valueMissing: false });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
this.#syncSiblingsRequiredValidationStatus = () => {
|
|
25
|
+
if (this.elementInternals && !this.validity.valueMissing) {
|
|
26
|
+
const siblings = this.#radioSiblings;
|
|
27
|
+
if (siblings && siblings.length > 1) {
|
|
28
|
+
siblings.forEach((x) => {
|
|
29
|
+
x.elementInternals.setValidity({ valueMissing: false });
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.validate = (anchor) => {
|
|
35
|
+
super.validate(anchor);
|
|
36
|
+
if (this.validity.valueMissing) {
|
|
37
|
+
this.#validateValueMissingWithSiblings();
|
|
38
|
+
} else {
|
|
39
|
+
this.#syncSiblingsRequiredValidationStatus();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
get #radioSiblings() {
|
|
44
|
+
const siblings = this.parentElement?.querySelectorAll(
|
|
45
|
+
`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`
|
|
46
|
+
);
|
|
47
|
+
if (siblings) {
|
|
48
|
+
return Array.from(siblings);
|
|
49
|
+
}
|
|
50
|
+
return [];
|
|
23
51
|
}
|
|
52
|
+
#validateValueMissingWithSiblings;
|
|
53
|
+
#syncSiblingsRequiredValidationStatus;
|
|
24
54
|
}
|
|
25
55
|
|
|
26
56
|
var __defProp = Object.defineProperty;
|
|
27
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
28
|
-
var __typeError = (msg) => {
|
|
29
|
-
throw TypeError(msg);
|
|
30
|
-
};
|
|
31
57
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
32
|
-
var result =
|
|
58
|
+
var result = void 0 ;
|
|
33
59
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
34
60
|
if (decorator = decorators[i])
|
|
35
|
-
result = (
|
|
36
|
-
if (
|
|
61
|
+
result = (decorator(target, key, result) ) || result;
|
|
62
|
+
if (result) __defProp(target, key, result);
|
|
37
63
|
return result;
|
|
38
64
|
};
|
|
39
|
-
|
|
40
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
41
|
-
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);
|
|
42
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
43
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
44
|
-
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;
|
|
45
|
-
const Direction = {
|
|
46
|
-
Increment: 1,
|
|
47
|
-
Decrement: -1
|
|
48
|
-
};
|
|
49
|
-
let RangeSlider = class extends FormAssociatedRangeSlider {
|
|
65
|
+
class Radio extends FormAssociatedRadio {
|
|
50
66
|
constructor() {
|
|
51
|
-
super(
|
|
52
|
-
|
|
53
|
-
// --- Start & end values ---
|
|
54
|
-
__privateAdd(this, _isInternalValueUpdate, false);
|
|
55
|
-
this.start = "";
|
|
56
|
-
this.end = "";
|
|
57
|
-
this.min = 0;
|
|
58
|
-
this.max = 10;
|
|
59
|
-
this.step = 1;
|
|
60
|
-
this.orientation = Orientation.horizontal;
|
|
61
|
-
this.ariaStartLabel = null;
|
|
62
|
-
this.ariaEndLabel = null;
|
|
63
|
-
this.markers = false;
|
|
64
|
-
this.pin = false;
|
|
65
|
-
this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
|
|
66
|
-
// --- Thumbs ---
|
|
67
|
-
/**
|
|
68
|
-
* @internal
|
|
69
|
-
*/
|
|
70
|
-
this._trackEl = null;
|
|
67
|
+
super();
|
|
68
|
+
this.ariaLabel = null;
|
|
71
69
|
/**
|
|
70
|
+
* The element's value to be included in form submission when checked.
|
|
71
|
+
* Default to "on" to reach parity with input[type="radio"]
|
|
72
|
+
*
|
|
72
73
|
* @internal
|
|
73
74
|
*/
|
|
74
|
-
this.
|
|
75
|
+
this.initialValue = "on";
|
|
76
|
+
this.defaultSlottedNodes = [];
|
|
75
77
|
/**
|
|
76
78
|
* @internal
|
|
77
79
|
*/
|
|
78
|
-
this.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
__privateAdd(this, _isNonVisibleFocus, false);
|
|
86
|
-
__privateAdd(this, _onThumbFocus, (e) => {
|
|
87
|
-
if (!__privateGet(this, _isNonVisibleFocus)) {
|
|
88
|
-
this._visiblyFocusedThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
80
|
+
this.keypressHandler = (e) => {
|
|
81
|
+
switch (e.key) {
|
|
82
|
+
case keySpace:
|
|
83
|
+
if (!this.checked && !this.readOnly) {
|
|
84
|
+
this.checked = true;
|
|
85
|
+
}
|
|
86
|
+
return;
|
|
89
87
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
__privateAdd(this, _onMouseOver, (e) => {
|
|
95
|
-
this._hoveredThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
96
|
-
});
|
|
97
|
-
__privateAdd(this, _onMouseOut, () => {
|
|
98
|
-
this._hoveredThumb = null;
|
|
99
|
-
});
|
|
100
|
-
__privateAdd(this, _onThumbMousedown, (event) => {
|
|
101
|
-
if (this.disabled || event.defaultPrevented) {
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
let target = event.target;
|
|
105
|
-
if (target === this._endThumbEl && this.startAsNumber === this.max && this.endAsNumber === this.max) {
|
|
106
|
-
target = this._startThumbEl;
|
|
107
|
-
}
|
|
108
|
-
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, target);
|
|
109
|
-
this._draggingThumb = __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, target);
|
|
110
|
-
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
111
|
-
});
|
|
112
|
-
__privateAdd(this, _onThumbKeydown, (e) => {
|
|
113
|
-
const thumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
114
|
-
this._visiblyFocusedThumb = thumb;
|
|
115
|
-
if (e.key === keyHome) {
|
|
116
|
-
e.preventDefault();
|
|
117
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min}` });
|
|
118
|
-
} else if (e.key === keyEnd) {
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max}` });
|
|
121
|
-
} else if (!e.shiftKey) {
|
|
122
|
-
switch (e.key) {
|
|
123
|
-
case keyArrowRight:
|
|
124
|
-
case keyArrowDown:
|
|
125
|
-
e.preventDefault();
|
|
126
|
-
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Increment);
|
|
127
|
-
break;
|
|
128
|
-
case keyArrowLeft:
|
|
129
|
-
case keyArrowUp:
|
|
130
|
-
e.preventDefault();
|
|
131
|
-
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Decrement);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
__privateAdd(this, _onDragMove, (e) => {
|
|
137
|
-
if (this.disabled || e.defaultPrevented || !this._draggingThumb) {
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const sourceEvent = "TouchEvent" in window && e instanceof TouchEvent ? e.touches[0] : e;
|
|
141
|
-
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, sourceEvent);
|
|
142
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
143
|
-
[this._draggingThumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, this._draggingThumb, value)}`
|
|
144
|
-
});
|
|
145
|
-
});
|
|
146
|
-
__privateAdd(this, _onDragEnd, () => {
|
|
147
|
-
this._draggingThumb = false;
|
|
148
|
-
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* @internal
|
|
153
|
-
*/
|
|
154
|
-
startChanged() {
|
|
155
|
-
this.currentStart = this.start;
|
|
156
|
-
if (!__privateGet(this, _isInternalValueUpdate)) {
|
|
157
|
-
this.dirtyValue = true;
|
|
158
|
-
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
159
|
-
}
|
|
160
|
-
if (this.$fastController.isConnected) {
|
|
161
|
-
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
162
|
-
}
|
|
88
|
+
return true;
|
|
89
|
+
};
|
|
90
|
+
this.proxy.setAttribute("type", "radio");
|
|
91
|
+
this.proxy.setAttribute("name", this.name);
|
|
163
92
|
}
|
|
93
|
+
// Map to proxy element
|
|
164
94
|
/**
|
|
165
95
|
* @internal
|
|
166
96
|
*/
|
|
167
|
-
|
|
168
|
-
if (
|
|
169
|
-
this.
|
|
170
|
-
this.dirtyValue = false;
|
|
97
|
+
readOnlyChanged() {
|
|
98
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
99
|
+
this.proxy.readOnly = this.readOnly;
|
|
171
100
|
}
|
|
172
101
|
}
|
|
173
102
|
/**
|
|
174
103
|
* @internal
|
|
175
104
|
*/
|
|
176
|
-
|
|
177
|
-
this.
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
* @public
|
|
183
|
-
*/
|
|
184
|
-
get startAsNumber() {
|
|
185
|
-
return parseFloat(this.start);
|
|
186
|
-
}
|
|
187
|
-
set startAsNumber(next) {
|
|
188
|
-
this.start = next.toString();
|
|
189
|
-
}
|
|
190
|
-
/**
|
|
191
|
-
* @internal
|
|
192
|
-
*/
|
|
193
|
-
endChanged() {
|
|
194
|
-
this.currentEnd = this.end;
|
|
195
|
-
if (!__privateGet(this, _isInternalValueUpdate)) {
|
|
196
|
-
this.dirtyValue = true;
|
|
197
|
-
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
198
|
-
}
|
|
199
|
-
if (this.$fastController.isConnected) {
|
|
200
|
-
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
/**
|
|
204
|
-
* @internal
|
|
205
|
-
*/
|
|
206
|
-
initialEndChanged(_, newValue) {
|
|
207
|
-
if (newValue && !this.dirtyValue) {
|
|
208
|
-
this.end = newValue;
|
|
209
|
-
this.dirtyValue = false;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* @internal
|
|
214
|
-
*/
|
|
215
|
-
currentEndChanged() {
|
|
216
|
-
this.end = this.currentEnd;
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* The end property, typed as a number.
|
|
220
|
-
*
|
|
221
|
-
* @public
|
|
222
|
-
*/
|
|
223
|
-
get endAsNumber() {
|
|
224
|
-
return parseFloat(this.end);
|
|
225
|
-
}
|
|
226
|
-
set endAsNumber(next) {
|
|
227
|
-
this.end = next.toString();
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* @internal
|
|
231
|
-
*/
|
|
232
|
-
orientationChanged() {
|
|
233
|
-
if (this.$fastController.isConnected) {
|
|
234
|
-
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
105
|
+
defaultCheckedChanged() {
|
|
106
|
+
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
107
|
+
if (!this.isInsideRadioGroup()) {
|
|
108
|
+
this.checked = this.defaultChecked;
|
|
109
|
+
this.dirtyChecked = false;
|
|
110
|
+
}
|
|
235
111
|
}
|
|
236
112
|
}
|
|
237
|
-
// --- Form handling ---
|
|
238
113
|
/**
|
|
239
114
|
* @internal
|
|
240
115
|
*/
|
|
241
116
|
nameChanged(previous, next) {
|
|
242
|
-
super.nameChanged
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
start: this.initialStart ?? this.min.toString(),
|
|
248
|
-
end: this.initialEnd ?? this.max.toString()
|
|
249
|
-
});
|
|
250
|
-
super.formResetCallback();
|
|
117
|
+
if (super.nameChanged) {
|
|
118
|
+
super.nameChanged(previous, next);
|
|
119
|
+
}
|
|
120
|
+
next !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name");
|
|
121
|
+
DOM.queueUpdate(this.validate);
|
|
251
122
|
}
|
|
252
123
|
/**
|
|
253
124
|
* @internal
|
|
254
125
|
*/
|
|
255
|
-
_isThumbPopupOpen(thumb) {
|
|
256
|
-
return this._visiblyFocusedThumb === thumb || this._hoveredThumb === thumb || this._draggingThumb === thumb;
|
|
257
|
-
}
|
|
258
|
-
// --- Lifecycle ---
|
|
259
126
|
connectedCallback() {
|
|
260
127
|
super.connectedCallback();
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
128
|
+
DOM.queueUpdate(this.validate);
|
|
129
|
+
if (this.parentElement.getAttribute("role") !== "radiogroup" && this.getAttribute("tabindex") === null) {
|
|
130
|
+
if (!this.disabled) {
|
|
131
|
+
this.setAttribute("tabindex", "0");
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (this.checkedAttribute) {
|
|
135
|
+
if (!this.dirtyChecked) {
|
|
136
|
+
if (!this.isInsideRadioGroup()) {
|
|
137
|
+
this.checked = this.defaultChecked;
|
|
138
|
+
this.dirtyChecked = false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
267
142
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
143
|
+
isInsideRadioGroup() {
|
|
144
|
+
const parent = this.closest(
|
|
145
|
+
"[role=radiogroup]"
|
|
146
|
+
);
|
|
147
|
+
return parent !== null;
|
|
272
148
|
}
|
|
273
149
|
/**
|
|
274
150
|
* @internal
|
|
275
151
|
*/
|
|
276
|
-
|
|
277
|
-
if (this.disabled
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, e);
|
|
281
|
-
const startDistance = Math.abs(value - Number(this.start));
|
|
282
|
-
const endDistance = Math.abs(value - Number(this.end));
|
|
283
|
-
const thumb = startDistance < endDistance || startDistance === endDistance && value < Number(this.start) ? "start" : "end";
|
|
284
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
285
|
-
[thumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, value)}`
|
|
286
|
-
});
|
|
287
|
-
this._draggingThumb = thumb;
|
|
288
|
-
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb]);
|
|
289
|
-
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
_isInternalValueUpdate = new WeakMap();
|
|
293
|
-
_RangeSlider_instances = new WeakSet();
|
|
294
|
-
updateValues_fn = function({ start, end }, emitEvents = true) {
|
|
295
|
-
if (start === this.start) {
|
|
296
|
-
start = void 0;
|
|
297
|
-
}
|
|
298
|
-
if (end === this.end) {
|
|
299
|
-
end = void 0;
|
|
300
|
-
}
|
|
301
|
-
if (start === void 0 && end === void 0) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
__privateSet(this, _isInternalValueUpdate, true);
|
|
305
|
-
if (start !== void 0) {
|
|
306
|
-
this.start = start;
|
|
307
|
-
}
|
|
308
|
-
if (end !== void 0) {
|
|
309
|
-
this.end = end;
|
|
310
|
-
}
|
|
311
|
-
__privateSet(this, _isInternalValueUpdate, false);
|
|
312
|
-
if (emitEvents) {
|
|
313
|
-
if (start !== void 0) {
|
|
314
|
-
this.$emit("input:start");
|
|
315
|
-
}
|
|
316
|
-
if (end !== void 0) {
|
|
317
|
-
this.$emit("input:end");
|
|
152
|
+
clickHandler(_) {
|
|
153
|
+
if (!this.disabled && !this.readOnly && !this.checked) {
|
|
154
|
+
this.checked = true;
|
|
318
155
|
}
|
|
319
|
-
this.$emit("input");
|
|
320
|
-
this.$emit("change");
|
|
321
|
-
this.dirtyValue = true;
|
|
322
|
-
}
|
|
323
|
-
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
324
|
-
};
|
|
325
|
-
applyStep_fn = function(thumb, direction) {
|
|
326
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
327
|
-
[thumb]: __privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, Number(this[thumb]) + direction * this.step).toString()
|
|
328
|
-
});
|
|
329
|
-
};
|
|
330
|
-
updateFormValue_fn = function() {
|
|
331
|
-
if (!this.name) {
|
|
332
|
-
this.setFormValue(null);
|
|
333
|
-
} else {
|
|
334
|
-
const formData = new FormData();
|
|
335
|
-
formData.append(this.name, this.start);
|
|
336
|
-
formData.append(this.name, this.end);
|
|
337
|
-
this.setFormValue(formData);
|
|
338
156
|
}
|
|
339
|
-
}
|
|
340
|
-
thumbs_get = function() {
|
|
341
|
-
return {
|
|
342
|
-
start: this._startThumbEl,
|
|
343
|
-
end: this._endThumbEl
|
|
344
|
-
};
|
|
345
|
-
};
|
|
346
|
-
thumbConstraints_get = function() {
|
|
347
|
-
return {
|
|
348
|
-
start: { min: this.min, max: this.endAsNumber },
|
|
349
|
-
end: { min: this.startAsNumber, max: this.max }
|
|
350
|
-
};
|
|
351
|
-
};
|
|
352
|
-
getThumbId_fn = function(thumb) {
|
|
353
|
-
return thumb === this._startThumbEl ? "start" : "end";
|
|
354
|
-
};
|
|
355
|
-
getThumbIdFromEvent_fn = function(e) {
|
|
356
|
-
return __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, e.target);
|
|
357
|
-
};
|
|
358
|
-
updateThumbPositions_fn = function() {
|
|
359
|
-
const startOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.startAsNumber);
|
|
360
|
-
const endOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.endAsNumber);
|
|
361
|
-
const [dirProp, dimProp] = this.orientation === Orientation.horizontal ? ["right", "width"] : ["bottom", "height"];
|
|
362
|
-
const transition = `transition: ${this._draggingThumb ? "none" : "all 0.2s ease"};`;
|
|
363
|
-
this._startThumbCss = `${dirProp}: ${startOffsetPct}%; ${transition}`;
|
|
364
|
-
this._endThumbCss = `${dirProp}: ${endOffsetPct}%; ${transition}`;
|
|
365
|
-
this._selectedRangeCss = `${dirProp}: ${endOffsetPct}%; ${dimProp}: ${startOffsetPct - endOffsetPct}%; ${transition}`;
|
|
366
|
-
};
|
|
367
|
-
thumbTrackEndOffset_fn = function(value) {
|
|
368
|
-
return (1 - inverseLerp(this.min, this.max, value)) * 100;
|
|
369
|
-
};
|
|
370
|
-
calculateValueFromMouseEvent_fn = function(e) {
|
|
371
|
-
const trackClientRect = this._trackEl.getBoundingClientRect();
|
|
372
|
-
const [minPos, maxPos, valuePos] = this.orientation === Orientation.horizontal ? [
|
|
373
|
-
this._trackEl.clientLeft,
|
|
374
|
-
this._trackEl.clientWidth,
|
|
375
|
-
e.pageX - document.documentElement.scrollLeft - this.getBoundingClientRect().left
|
|
376
|
-
] : [
|
|
377
|
-
trackClientRect.top,
|
|
378
|
-
trackClientRect.bottom,
|
|
379
|
-
e.pageY - document.documentElement.scrollTop
|
|
380
|
-
];
|
|
381
|
-
return lerp(this.min, this.max, inverseLerp(minPos, maxPos, valuePos));
|
|
382
|
-
};
|
|
383
|
-
roundToNearestStep_fn = function(thumb, value) {
|
|
384
|
-
return limit(
|
|
385
|
-
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min,
|
|
386
|
-
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max,
|
|
387
|
-
roundToStepValue(value - this.min, this.step) + this.min
|
|
388
|
-
);
|
|
389
|
-
};
|
|
390
|
-
_isNonVisibleFocus = new WeakMap();
|
|
391
|
-
focusThumbNonVisibly_fn = function(thumb) {
|
|
392
|
-
__privateSet(this, _isNonVisibleFocus, true);
|
|
393
|
-
thumb.focus();
|
|
394
|
-
__privateSet(this, _isNonVisibleFocus, false);
|
|
395
|
-
};
|
|
396
|
-
// --- Event handling ---
|
|
397
|
-
registerThumbListeners_fn = function() {
|
|
398
|
-
for (const thumb of ["start", "end"]) {
|
|
399
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
400
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
401
|
-
"mousedown",
|
|
402
|
-
__privateGet(this, _onThumbMousedown),
|
|
403
|
-
{ passive: true }
|
|
404
|
-
);
|
|
405
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
406
|
-
"touchstart",
|
|
407
|
-
__privateGet(this, _onThumbMousedown),
|
|
408
|
-
{ passive: true }
|
|
409
|
-
);
|
|
410
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseover", __privateGet(this, _onMouseOver), {
|
|
411
|
-
passive: true
|
|
412
|
-
});
|
|
413
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("mouseout", __privateGet(this, _onMouseOut), {
|
|
414
|
-
passive: true
|
|
415
|
-
});
|
|
416
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("focus", __privateGet(this, _onThumbFocus));
|
|
417
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
|
-
unregisterThumbListeners_fn = function() {
|
|
421
|
-
for (const thumb of ["start", "end"]) {
|
|
422
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
423
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
424
|
-
"mousedown",
|
|
425
|
-
__privateGet(this, _onThumbMousedown)
|
|
426
|
-
);
|
|
427
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener(
|
|
428
|
-
"touchstart",
|
|
429
|
-
__privateGet(this, _onThumbMousedown)
|
|
430
|
-
);
|
|
431
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseover", __privateGet(this, _onMouseOver));
|
|
432
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("mouseout", __privateGet(this, _onMouseOut));
|
|
433
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("focus", __privateGet(this, _onThumbFocus));
|
|
434
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
_onThumbFocus = new WeakMap();
|
|
438
|
-
_onThumbBlur = new WeakMap();
|
|
439
|
-
_onMouseOver = new WeakMap();
|
|
440
|
-
_onMouseOut = new WeakMap();
|
|
441
|
-
_onThumbMousedown = new WeakMap();
|
|
442
|
-
_onThumbKeydown = new WeakMap();
|
|
443
|
-
registerDragHandlers_fn = function() {
|
|
444
|
-
window.addEventListener("mousemove", __privateGet(this, _onDragMove), { passive: true });
|
|
445
|
-
window.addEventListener("touchmove", __privateGet(this, _onDragMove), { passive: true });
|
|
446
|
-
window.addEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
447
|
-
window.addEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
448
|
-
window.document.addEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
449
|
-
};
|
|
450
|
-
unregisterDragListeners_fn = function() {
|
|
451
|
-
window.removeEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
452
|
-
window.document.removeEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
453
|
-
window.removeEventListener("mousemove", __privateGet(this, _onDragMove));
|
|
454
|
-
window.removeEventListener("touchmove", __privateGet(this, _onDragMove));
|
|
455
|
-
window.removeEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
456
|
-
};
|
|
457
|
-
_onDragMove = new WeakMap();
|
|
458
|
-
_onDragEnd = new WeakMap();
|
|
459
|
-
__decorateClass([
|
|
460
|
-
observable
|
|
461
|
-
], RangeSlider.prototype, "start", 2);
|
|
462
|
-
__decorateClass([
|
|
463
|
-
attr({ mode: "fromView", attribute: "start" })
|
|
464
|
-
], RangeSlider.prototype, "initialStart", 2);
|
|
465
|
-
__decorateClass([
|
|
466
|
-
attr({ attribute: "current-start" })
|
|
467
|
-
], RangeSlider.prototype, "currentStart", 2);
|
|
468
|
-
__decorateClass([
|
|
469
|
-
observable
|
|
470
|
-
], RangeSlider.prototype, "end", 2);
|
|
471
|
-
__decorateClass([
|
|
472
|
-
attr({ mode: "fromView", attribute: "end" })
|
|
473
|
-
], RangeSlider.prototype, "initialEnd", 2);
|
|
474
|
-
__decorateClass([
|
|
475
|
-
attr({ attribute: "current-end" })
|
|
476
|
-
], RangeSlider.prototype, "currentEnd", 2);
|
|
477
|
-
__decorateClass([
|
|
478
|
-
attr({ converter: nullableNumberConverter })
|
|
479
|
-
], RangeSlider.prototype, "min", 2);
|
|
480
|
-
__decorateClass([
|
|
481
|
-
attr({ converter: nullableNumberConverter })
|
|
482
|
-
], RangeSlider.prototype, "max", 2);
|
|
157
|
+
}
|
|
483
158
|
__decorateClass([
|
|
484
|
-
attr({
|
|
485
|
-
],
|
|
159
|
+
attr({ attribute: "aria-label" })
|
|
160
|
+
], Radio.prototype, "ariaLabel");
|
|
486
161
|
__decorateClass([
|
|
487
162
|
attr
|
|
488
|
-
],
|
|
489
|
-
__decorateClass([
|
|
490
|
-
attr({ attribute: "aria-start-label" })
|
|
491
|
-
], RangeSlider.prototype, "ariaStartLabel", 2);
|
|
492
|
-
__decorateClass([
|
|
493
|
-
attr({ attribute: "aria-end-label" })
|
|
494
|
-
], RangeSlider.prototype, "ariaEndLabel", 2);
|
|
495
|
-
__decorateClass([
|
|
496
|
-
attr({ mode: "boolean" })
|
|
497
|
-
], RangeSlider.prototype, "markers", 2);
|
|
163
|
+
], Radio.prototype, "label");
|
|
498
164
|
__decorateClass([
|
|
499
165
|
attr
|
|
500
|
-
],
|
|
166
|
+
], Radio.prototype, "connotation");
|
|
501
167
|
__decorateClass([
|
|
502
|
-
attr({ mode: "boolean" })
|
|
503
|
-
],
|
|
168
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
169
|
+
], Radio.prototype, "readOnly");
|
|
504
170
|
__decorateClass([
|
|
505
|
-
|
|
506
|
-
],
|
|
507
|
-
__decorateClass([
|
|
508
|
-
observable
|
|
509
|
-
], RangeSlider.prototype, "_draggingThumb", 2);
|
|
510
|
-
__decorateClass([
|
|
511
|
-
observable
|
|
512
|
-
], RangeSlider.prototype, "_visiblyFocusedThumb", 2);
|
|
513
|
-
__decorateClass([
|
|
514
|
-
observable
|
|
515
|
-
], RangeSlider.prototype, "_hoveredThumb", 2);
|
|
516
|
-
__decorateClass([
|
|
517
|
-
observable
|
|
518
|
-
], RangeSlider.prototype, "_startThumbCss", 2);
|
|
519
|
-
__decorateClass([
|
|
520
|
-
observable
|
|
521
|
-
], RangeSlider.prototype, "_endThumbCss", 2);
|
|
171
|
+
attr
|
|
172
|
+
], Radio.prototype, "name");
|
|
522
173
|
__decorateClass([
|
|
523
174
|
observable
|
|
524
|
-
],
|
|
525
|
-
RangeSlider = __decorateClass([
|
|
526
|
-
formElements
|
|
527
|
-
], RangeSlider);
|
|
528
|
-
applyMixins(RangeSlider, Localized);
|
|
175
|
+
], Radio.prototype, "defaultSlottedNodes");
|
|
529
176
|
|
|
530
|
-
const getClasses = ({
|
|
531
|
-
"
|
|
532
|
-
[
|
|
533
|
-
[
|
|
177
|
+
const getClasses = ({ connotation, checked, readOnly, disabled }) => classNames(
|
|
178
|
+
"base",
|
|
179
|
+
[`connotation-${connotation}`, Boolean(connotation)],
|
|
180
|
+
["checked", Boolean(checked)],
|
|
181
|
+
["readonly", Boolean(readOnly)],
|
|
182
|
+
["disabled", Boolean(disabled)]
|
|
534
183
|
);
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
>
|
|
544
|
-
<div class="
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
x.orientation === Orientation.horizontal,
|
|
552
|
-
Math.floor((x.max - x.min) / x.step)
|
|
553
|
-
)}`
|
|
554
|
-
)}
|
|
555
|
-
</div>
|
|
556
|
-
<div
|
|
557
|
-
${ref("_startThumbEl")}
|
|
558
|
-
class="${getThumbClassesFor("start")}"
|
|
559
|
-
style="${(x) => x._startThumbCss}"
|
|
560
|
-
role="slider"
|
|
561
|
-
tabindex="${(x) => x.disabled ? null : 0}"
|
|
562
|
-
aria-label="${(x) => x.ariaStartLabel || x.locale.rangeSlider.startThumbLabel}"
|
|
563
|
-
aria-valuetext="${(x) => x.valueTextFormatter(x.start)}"
|
|
564
|
-
aria-valuenow="${(x) => x.start}"
|
|
565
|
-
aria-valuemin="${(x) => x.min}"
|
|
566
|
-
aria-valuemax="${(x) => x.end}"
|
|
567
|
-
aria-disabled="${(x) => x.disabled}"
|
|
568
|
-
aria-orientation="${(x) => x.orientation}"
|
|
569
|
-
></div>
|
|
570
|
-
${when(
|
|
571
|
-
(x) => x.pin,
|
|
572
|
-
html`<${popupTag}
|
|
573
|
-
class="popup"
|
|
574
|
-
arrow
|
|
575
|
-
alternate
|
|
576
|
-
:anchor="${(x) => x._startThumbEl}"
|
|
577
|
-
:open=${(x) => x._isThumbPopupOpen("start")}
|
|
578
|
-
:placementStrategy=${(x) => x.orientation === Orientation.horizontal ? PlacementStrategy.AutoPlacementHorizontal : PlacementStrategy.AutoPlacementVertical}
|
|
579
|
-
animation-frame
|
|
580
|
-
exportparts="vvd-theme-alternate"
|
|
581
|
-
aria-hidden="true"
|
|
582
|
-
>
|
|
583
|
-
<div class="tooltip">${(x) => x.valueTextFormatter(x.start)}</div>
|
|
584
|
-
</${popupTag}>`
|
|
585
|
-
)}
|
|
586
|
-
<div
|
|
587
|
-
${ref("_endThumbEl")}
|
|
588
|
-
class="${getThumbClassesFor("end")}"
|
|
589
|
-
style="${(x) => x._endThumbCss}"
|
|
590
|
-
role="slider"
|
|
591
|
-
tabindex="${(x) => x.disabled ? null : 0}"
|
|
592
|
-
aria-label="${(x) => x.ariaEndLabel || x.locale.rangeSlider.endThumbLabel}"
|
|
593
|
-
aria-valuetext="${(x) => x.valueTextFormatter(x.end)}"
|
|
594
|
-
aria-valuenow="${(x) => x.end}"
|
|
595
|
-
aria-valuemin="${(x) => x.start}"
|
|
596
|
-
aria-valuemax="${(x) => x.max}"
|
|
597
|
-
aria-disabled="${(x) => x.disabled}"
|
|
598
|
-
aria-orientation="${(x) => x.orientation}"
|
|
599
|
-
></div>
|
|
600
|
-
${when(
|
|
601
|
-
(x) => x.pin,
|
|
602
|
-
html`<${popupTag}
|
|
603
|
-
class="popup"
|
|
604
|
-
arrow
|
|
605
|
-
alternate
|
|
606
|
-
:anchor="${(x) => x._endThumbEl}"
|
|
607
|
-
:open=${(x) => x._isThumbPopupOpen("end")}
|
|
608
|
-
:placementStrategy=${(x) => x.orientation === Orientation.horizontal ? PlacementStrategy.AutoPlacementHorizontal : PlacementStrategy.AutoPlacementVertical}
|
|
609
|
-
animation-frame
|
|
610
|
-
exportparts="vvd-theme-alternate"
|
|
611
|
-
aria-hidden="true"
|
|
612
|
-
>
|
|
613
|
-
<div class="tooltip">${(x) => x.valueTextFormatter(x.end)}</div>
|
|
614
|
-
</${popupTag}>`
|
|
615
|
-
)}
|
|
616
|
-
</div>
|
|
617
|
-
</div>
|
|
618
|
-
</template>`;
|
|
619
|
-
};
|
|
184
|
+
const RadioTemplate = html`<template
|
|
185
|
+
aria-checked="${(x) => x.checked}"
|
|
186
|
+
aria-disabled="${(x) => x.disabled}"
|
|
187
|
+
aria-required="${(x) => x.required}"
|
|
188
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
189
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
190
|
+
role="radio"
|
|
191
|
+
>
|
|
192
|
+
<div class="${getClasses}">
|
|
193
|
+
<div class="control"></div>
|
|
194
|
+
${when(
|
|
195
|
+
(x) => x.label,
|
|
196
|
+
html`<label class="label">${(x) => x.label}</label>`
|
|
197
|
+
)}
|
|
198
|
+
</div>
|
|
199
|
+
</template>`;
|
|
620
200
|
|
|
621
|
-
const
|
|
622
|
-
"
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
[
|
|
201
|
+
const radioDefinition = defineVividComponent(
|
|
202
|
+
"radio",
|
|
203
|
+
Radio,
|
|
204
|
+
RadioTemplate,
|
|
205
|
+
[],
|
|
626
206
|
{
|
|
627
|
-
styles
|
|
628
|
-
shadowOptions: {
|
|
629
|
-
delegatesFocus: true
|
|
630
|
-
}
|
|
207
|
+
styles
|
|
631
208
|
}
|
|
632
209
|
);
|
|
633
|
-
const
|
|
634
|
-
rangeSliderDefinition
|
|
635
|
-
);
|
|
210
|
+
const registerRadio = createRegisterFunction(radioDefinition);
|
|
636
211
|
|
|
637
|
-
export {
|
|
212
|
+
export { Radio as R, registerRadio as a, radioDefinition as r };
|