@vonage/vivid 4.23.0 → 4.25.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 +21830 -14295
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/index.cjs +112 -150
- package/index.js +37 -35
- package/lib/accordion-item/accordion-item.d.ts +6 -0
- package/lib/action-group/action-group.d.ts +6 -0
- package/lib/alert/alert.d.ts +20 -0
- package/lib/audio-player/audio-player.d.ts +6 -0
- package/lib/badge/badge.d.ts +9 -1
- package/lib/banner/banner.d.ts +25 -0
- package/lib/breadcrumb/breadcrumb.d.ts +6 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +63 -7
- package/lib/button/button.d.ts +732 -7
- package/lib/button/locale.d.ts +3 -0
- package/lib/calendar-event/calendar-event.d.ts +6 -0
- package/lib/card/card.d.ts +394 -2
- package/lib/card/card.template.d.ts +2 -1
- package/lib/checkbox/checkbox.d.ts +1822 -5
- package/lib/combobox/combobox.d.ts +1827 -20
- package/lib/data-grid/data-grid-cell.d.ts +339 -1
- package/lib/data-grid/locale.d.ts +5 -0
- package/lib/date-picker/date-picker.d.ts +1676 -207
- package/lib/date-range-picker/date-range-picker.d.ts +840 -107
- package/lib/date-time-picker/date-time-picker.d.ts +1678 -209
- package/lib/dial-pad/dial-pad.d.ts +8 -0
- package/lib/dialog/dialog.d.ts +12 -0
- package/lib/divider/divider.d.ts +6 -0
- package/lib/fab/fab.d.ts +6 -0
- package/lib/file-picker/file-picker.d.ts +1510 -32
- package/lib/file-picker/locale.d.ts +1 -0
- package/lib/header/header.d.ts +6 -0
- package/lib/icon/icon.d.ts +1 -0
- package/lib/icon/icon.template.d.ts +2 -1
- package/lib/menu/menu.d.ts +16 -7
- package/lib/menu/name.d.ts +1 -0
- package/lib/menu-item/menu-item.d.ts +14 -2
- package/lib/nav/nav.d.ts +6 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +13 -0
- package/lib/nav-item/nav-item.d.ts +405 -3
- package/lib/note/note.d.ts +6 -0
- package/lib/number-field/number-field.d.ts +1857 -36
- package/lib/option/option.d.ts +12 -0
- package/lib/progress/progress.d.ts +6 -0
- package/lib/progress-ring/progress-ring.d.ts +6 -0
- package/lib/radio/radio.d.ts +1137 -4
- package/lib/radio-group/radio-group.d.ts +20 -2
- package/lib/range-slider/range-slider.d.ts +752 -5
- package/lib/rich-text-editor/definition.d.ts +2 -2
- package/lib/rich-text-editor/facades/vivid-prose-mirror.facade.d.ts +3 -1
- package/lib/rich-text-editor/locale.d.ts +10 -0
- package/lib/rich-text-editor/menubar/menubar.d.ts +340 -1
- package/lib/rich-text-editor/rich-text-editor.d.ts +352 -2
- package/lib/searchable-select/locale.d.ts +1 -0
- package/lib/searchable-select/option-tag.d.ts +6 -0
- package/lib/searchable-select/searchable-select.d.ts +1857 -35
- package/lib/select/select.d.ts +1843 -28
- package/lib/selectable-box/selectable-box.d.ts +6 -0
- package/lib/slider/slider.d.ts +384 -2
- package/lib/split-button/split-button.d.ts +18 -0
- package/lib/switch/switch.d.ts +386 -3
- package/lib/tab/tab.d.ts +18 -1
- package/lib/tab-panel/tab-panel.d.ts +6 -0
- package/lib/tabs/tabs.d.ts +5 -21
- package/lib/tag/tag.d.ts +12 -0
- package/lib/tag-group/tag-group.d.ts +6 -0
- package/lib/text-area/text-area.d.ts +2174 -19
- package/lib/text-field/text-field.d.ts +2195 -31
- package/lib/time-picker/time-picker.d.ts +839 -106
- package/lib/toggletip/toggletip.d.ts +10 -4
- package/lib/tooltip/tooltip.d.ts +10 -4
- package/lib/tree-item/tree-item.d.ts +12 -0
- package/lib/tree-view/tree-view.d.ts +6 -0
- package/lib/video-player/video-player.d.ts +6 -0
- package/lib/visually-hidden/definition.d.ts +4 -0
- package/lib/visually-hidden/visually-hidden.d.ts +3 -0
- package/lib/visually-hidden/visually-hidden.template.d.ts +3 -0
- package/locales/de-DE.cjs +47 -1
- package/locales/de-DE.js +47 -1
- package/locales/en-GB.cjs +47 -1
- package/locales/en-GB.js +47 -1
- package/locales/en-US.cjs +47 -1
- package/locales/en-US.js +47 -1
- package/locales/ja-JP.cjs +47 -1
- package/locales/ja-JP.js +47 -1
- package/locales/zh-CN.cjs +47 -1
- package/locales/zh-CN.js +47 -1
- package/menu/index.cjs +1 -1
- package/menu/index.js +1 -1
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +1 -1
- package/nav-disclosure/index.js +1 -1
- package/nav-item/index.cjs +1 -1
- package/nav-item/index.js +1 -1
- package/note/index.cjs +1 -1
- package/note/index.js +1 -1
- package/number-field/index.cjs +1 -1
- package/number-field/index.js +1 -1
- package/option/index.cjs +1 -1
- package/option/index.js +1 -1
- package/package.json +1 -1
- package/pagination/index.cjs +1 -1
- package/pagination/index.js +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +1 -1
- package/range-slider/index.js +1 -1
- package/rich-text-editor/index.cjs +1 -1
- package/rich-text-editor/index.js +1 -1
- package/searchable-select/index.cjs +1 -1
- package/searchable-select/index.js +1 -1
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/affix.cjs +13 -7
- package/shared/affix.js +13 -8
- package/shared/aria/delegates-aria.d.ts +6 -0
- package/shared/aria/host-semantics.d.ts +6 -0
- package/shared/breadcrumb-item.cjs +2 -5
- package/shared/breadcrumb-item.js +2 -5
- package/shared/button.cjs +19 -14
- package/shared/button.js +19 -14
- package/shared/calendar-picker.template.cjs +3 -3
- package/shared/calendar-picker.template.js +1 -1
- package/shared/char-count.cjs +92 -0
- package/shared/char-count.js +90 -0
- package/shared/definition.js +1 -1
- package/shared/definition10.js +1 -1
- package/shared/definition11.cjs +27 -44
- package/shared/definition11.js +28 -45
- package/shared/definition12.cjs +1 -1
- package/shared/definition12.js +2 -2
- package/shared/definition13.js +1 -1
- package/shared/definition14.cjs +53 -22
- package/shared/definition14.js +54 -23
- package/shared/definition15.cjs +31 -36
- package/shared/definition15.js +30 -36
- package/shared/definition16.cjs +43 -63
- package/shared/definition16.js +42 -63
- package/shared/definition17.cjs +12 -5
- package/shared/definition17.js +12 -5
- package/shared/definition18.cjs +10 -14
- package/shared/definition18.js +9 -14
- package/shared/definition19.cjs +85 -100
- package/shared/definition19.js +75 -91
- package/shared/definition2.js +1 -1
- package/shared/definition20.cjs +15 -20
- package/shared/definition20.js +14 -20
- package/shared/definition21.cjs +22 -3
- package/shared/definition21.js +23 -4
- package/shared/definition22.cjs +12 -6
- package/shared/definition22.js +13 -7
- package/shared/definition23.cjs +5 -38
- package/shared/definition23.js +5 -37
- package/shared/definition24.cjs +2 -7
- package/shared/definition24.js +3 -8
- package/shared/definition25.js +1 -1
- package/shared/definition26.cjs +160 -163
- package/shared/definition26.js +159 -163
- package/shared/definition27.cjs +1 -1
- package/shared/definition27.js +2 -2
- package/shared/definition28.cjs +32 -17
- package/shared/definition28.js +33 -18
- package/shared/definition29.js +1 -1
- package/shared/definition3.js +1 -1
- package/shared/definition30.cjs +96 -482
- package/shared/definition30.js +99 -482
- package/shared/definition31.cjs +334 -57
- package/shared/definition31.js +333 -56
- package/shared/definition32.cjs +104 -19
- package/shared/definition32.js +105 -20
- package/shared/definition33.cjs +67 -15
- package/shared/definition33.js +66 -14
- package/shared/definition34.cjs +15 -50
- package/shared/definition34.js +14 -49
- package/shared/definition35.cjs +28 -397
- package/shared/definition35.js +27 -397
- package/shared/definition36.cjs +404 -54
- package/shared/definition36.js +404 -55
- package/shared/definition37.cjs +57 -234
- package/shared/definition37.js +57 -233
- package/shared/definition38.cjs +221 -66
- package/shared/definition38.js +220 -65
- package/shared/definition39.cjs +52 -44
- package/shared/definition39.js +51 -43
- package/shared/definition4.cjs +31 -24
- package/shared/definition4.js +33 -26
- package/shared/definition40.cjs +56 -266
- package/shared/definition40.js +55 -265
- package/shared/definition41.cjs +285 -142
- package/shared/definition41.js +285 -142
- package/shared/definition42.cjs +156 -564
- package/shared/definition42.js +156 -565
- package/shared/definition43.cjs +557 -14317
- package/shared/definition43.js +556 -14316
- package/shared/definition44.cjs +14418 -1085
- package/shared/definition44.js +14416 -1085
- package/shared/definition45.cjs +1049 -671
- package/shared/definition45.js +1050 -672
- package/shared/definition46.cjs +848 -113
- package/shared/definition46.js +847 -112
- package/shared/definition47.cjs +125 -90
- package/shared/definition47.js +124 -89
- package/shared/definition48.cjs +88 -455
- package/shared/definition48.js +87 -454
- package/shared/definition49.cjs +466 -109
- package/shared/definition49.js +466 -109
- package/shared/definition5.cjs +8 -7
- package/shared/definition5.js +6 -5
- package/shared/definition50.cjs +106 -106
- package/shared/definition50.js +105 -105
- package/shared/definition51.cjs +136 -15
- package/shared/definition51.js +135 -14
- package/shared/definition52.cjs +16 -115
- package/shared/definition52.js +15 -114
- package/shared/definition53.cjs +78 -490
- package/shared/definition53.js +77 -488
- package/shared/definition54.cjs +445 -23
- package/shared/definition54.js +443 -22
- package/shared/definition55.cjs +22 -136
- package/shared/definition55.js +21 -135
- package/shared/definition56.cjs +95 -291
- package/shared/definition56.js +95 -292
- package/shared/definition57.cjs +192 -480
- package/shared/definition57.js +190 -479
- package/shared/definition58.cjs +411 -24
- package/shared/definition58.js +410 -24
- package/shared/definition59.cjs +27 -144
- package/shared/definition59.js +27 -143
- package/shared/definition6.js +1 -1
- package/shared/definition60.cjs +83 -54
- package/shared/definition60.js +82 -53
- package/shared/definition61.cjs +78 -166
- package/shared/definition61.js +77 -164
- package/shared/definition62.cjs +143 -232
- package/shared/definition62.js +141 -231
- package/shared/definition63.cjs +234 -69417
- package/shared/definition63.js +233 -69416
- package/shared/definition64.cjs +69454 -28
- package/shared/definition64.js +69453 -27
- package/shared/definition65.cjs +28 -2168
- package/shared/definition65.js +27 -2166
- package/shared/definition66.cjs +27 -0
- package/shared/definition66.js +23 -0
- package/shared/definition67.cjs +2195 -0
- package/shared/definition67.js +2190 -0
- package/shared/definition7.cjs +11 -2
- package/shared/definition7.js +12 -3
- package/shared/definition8.cjs +24 -11
- package/shared/definition8.js +26 -13
- package/shared/definition9.cjs +1 -2
- package/shared/definition9.js +2 -3
- package/shared/delegates-aria.js +1 -1
- package/shared/deprecation/replaced-props.d.ts +20 -0
- package/shared/divider.cjs +41 -0
- package/shared/divider.js +38 -0
- package/shared/feedback/feedback-message.d.ts +345 -0
- package/shared/feedback/locale.d.ts +4 -0
- package/{lib/text-anchor/text-anchor.d.ts → shared/feedback/mixins.d.ts} +62 -39
- package/shared/form-associated.cjs +124 -100
- package/shared/form-associated.js +125 -101
- package/shared/form-element.cjs +84 -0
- package/shared/form-element.js +82 -0
- package/shared/foundation/button/button.d.ts +378 -2
- package/shared/foundation/form-associated/form-associated.d.ts +753 -49
- package/shared/foundation/listbox/listbox.d.ts +1 -1
- package/shared/foundation/vivid-element/vivid-element.d.ts +14 -0
- package/shared/host-semantics.js +1 -1
- package/shared/key-codes.js +1 -1
- package/shared/linkable.cjs +70 -0
- package/shared/linkable.js +68 -0
- package/shared/localization/Locale.d.ts +16 -0
- package/shared/mixins.cjs +306 -0
- package/shared/mixins.js +300 -0
- package/shared/patterns/affix.d.ts +16 -1
- package/shared/patterns/anchored.d.ts +20 -8
- package/shared/patterns/char-count/char-count.d.ts +351 -0
- package/shared/patterns/char-count/index.d.ts +1 -0
- package/shared/patterns/char-count/locale.d.ts +4 -0
- package/shared/patterns/form-elements/form-element.d.ts +744 -0
- package/shared/patterns/form-elements/index.d.ts +3 -1
- package/shared/patterns/form-elements/with-error-text.d.ts +1122 -0
- package/shared/patterns/form-elements/with-success-text.d.ts +341 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/patterns/linkable.d.ts +394 -0
- package/shared/patterns/localized.d.ts +6 -0
- package/shared/patterns/trapped-focus.d.ts +6 -0
- package/shared/picker-field/mixins/calendar-picker.d.ts +420 -52
- package/shared/picker-field/mixins/calendar-picker.template.d.ts +420 -52
- package/shared/picker-field/mixins/inline-time-picker/inline-time-picker.d.ts +6 -0
- package/shared/picker-field/mixins/min-max-calendar-picker.d.ts +843 -107
- package/shared/picker-field/mixins/single-date-picker.d.ts +1259 -155
- package/shared/picker-field/mixins/single-value-picker.d.ts +417 -49
- package/shared/picker-field/mixins/time-selection-picker.d.ts +842 -106
- package/shared/picker-field/mixins/time-selection-picker.template.d.ts +839 -103
- package/shared/picker-field/picker-field.d.ts +1491 -15
- package/shared/picker-field.template.cjs +13 -22
- package/shared/picker-field.template.js +14 -23
- package/shared/repeat.js +1 -1
- package/shared/slider.template.cjs +1 -1
- package/shared/slider.template.js +1 -1
- package/shared/time-selection-picker.template.cjs +10 -15
- package/shared/time-selection-picker.template.js +10 -16
- package/shared/vivid-element.cjs +53 -4
- package/shared/vivid-element.js +53 -3
- package/shared/with-error-text.cjs +56 -0
- package/shared/with-error-text.js +54 -0
- package/shared/with-success-text.cjs +23 -0
- package/shared/with-success-text.js +21 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-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/visually-hidden/index.cjs +5 -0
- package/visually-hidden/index.js +3 -0
- package/vivid.api.json +762 -1478
- package/lib/checkbox/checkbox.form-associated.d.ts +0 -11
- package/lib/file-picker/file-picker.form-associated.d.ts +0 -11
- package/lib/number-field/number-field.form-associated.d.ts +0 -11
- package/lib/radio/radio.form-associated.d.ts +0 -13
- package/lib/range-slider/range-slider.form-associated.d.ts +0 -11
- package/lib/searchable-select/searchable-select.form-associated.d.ts +0 -11
- package/lib/select/select.form-associated.d.ts +0 -11
- package/lib/slider/slider.form-associated.d.ts +0 -11
- package/lib/switch/switch.form-associated.d.ts +0 -11
- package/lib/text-anchor/definition.d.ts +0 -2
- package/lib/text-anchor/text-anchor.template.d.ts +0 -3
- package/lib/text-area/text-area.form-associated.d.ts +0 -11
- package/lib/text-field/text-field.form-associated.d.ts +0 -11
- package/shared/anchor.cjs +0 -49
- package/shared/anchor.js +0 -47
- package/shared/apply-mixins.cjs +0 -23
- package/shared/apply-mixins.js +0 -21
- package/shared/applyMixinsWithObservables.cjs +0 -15
- package/shared/applyMixinsWithObservables.js +0 -13
- package/shared/direction.cjs +0 -17
- package/shared/direction.js +0 -15
- package/shared/form-elements.cjs +0 -209
- package/shared/form-elements.js +0 -202
- package/shared/foundation/anchor/anchor.d.ts +0 -11
- package/shared/foundation/utilities/apply-mixins.d.ts +0 -1
- package/shared/patterns/form-elements/form-elements.d.ts +0 -58
- package/shared/picker-field/picker-field.form-associated.d.ts +0 -11
- package/shared/text-anchor.cjs +0 -38
- package/shared/text-anchor.js +0 -36
- package/shared/text-anchor.template.cjs +0 -35
- package/shared/text-anchor.template.js +0 -33
- package/shared/utils/applyMixinsWithObservables.d.ts +0 -1
- package/text-anchor/index.cjs +0 -17
- package/text-anchor/index.js +0 -15
package/shared/definition42.js
CHANGED
|
@@ -1,635 +1,226 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { F as
|
|
5
|
-
import {
|
|
6
|
-
import { L as Localized } from './localized.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';
|
|
1
|
+
import { D as DOM, V as VividElement, 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 { W as WithErrorText } from './with-error-text.js';
|
|
4
|
+
import { F as FormElement } from './form-element.js';
|
|
5
|
+
import { a as keySpace } from './key-codes.js';
|
|
10
6
|
import { c as classNames } from './class-names.js';
|
|
11
|
-
import { r as ref } from './ref.js';
|
|
12
7
|
import { w as when } from './when.js';
|
|
13
8
|
|
|
14
|
-
const styles = ":host
|
|
15
|
-
|
|
16
|
-
class _RangeSlider extends VividElement {
|
|
17
|
-
}
|
|
18
|
-
class FormAssociatedRangeSlider extends FormAssociated(_RangeSlider) {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.proxy = document.createElement("input");
|
|
22
|
-
}
|
|
23
|
-
}
|
|
9
|
+
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(--vvd-color-neutral-500)}.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(--vvd-color-neutral-700)}.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-stroke-gap-color: transparent;position:relative}:host(:focus-visible) .control:before{box-shadow:0 0 0 4px color-mix(in srgb,var(--vvd-color-cta-500),transparent 85%),inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:1px solid var(--focus-stroke-color, var(--vvd-color-cta-500));outline-offset:calc(-1px - var(--focus-inset, 0px));position:absolute;display:block;border-radius:var(--focus-border-radius, inherit);block-size:calc(100% + var(--focus-block-size-addition, 4px));content:\"\";inline-size:calc(100% + var(--focus-block-size-addition, 4px));inset-block-start:50%;inset-inline-start:50%;transform:translate(-50%,-50%)}label{color:var(--vvd-color-canvas-text);cursor:pointer;font:var(--vvd-typography-base)}";
|
|
24
10
|
|
|
25
11
|
var __defProp = Object.defineProperty;
|
|
26
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
27
|
-
var __typeError = (msg) => {
|
|
28
|
-
throw TypeError(msg);
|
|
29
|
-
};
|
|
30
12
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
31
|
-
var result =
|
|
13
|
+
var result = void 0 ;
|
|
32
14
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
33
15
|
if (decorator = decorators[i])
|
|
34
|
-
result = (
|
|
35
|
-
if (
|
|
16
|
+
result = (decorator(target, key, result) ) || result;
|
|
17
|
+
if (result) __defProp(target, key, result);
|
|
36
18
|
return result;
|
|
37
19
|
};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
|
|
42
|
-
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
43
|
-
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;
|
|
44
|
-
const Direction = {
|
|
45
|
-
Increment: 1,
|
|
46
|
-
Decrement: -1
|
|
47
|
-
};
|
|
48
|
-
let RangeSlider = class extends Localized(FormAssociatedRangeSlider) {
|
|
20
|
+
class Radio extends WithErrorText(
|
|
21
|
+
FormElement(CheckableFormAssociated(VividElement))
|
|
22
|
+
) {
|
|
49
23
|
constructor() {
|
|
50
|
-
super(
|
|
51
|
-
|
|
52
|
-
// --- Start & end values ---
|
|
53
|
-
__privateAdd(this, _isInternalValueUpdate, false);
|
|
54
|
-
this.start = "";
|
|
55
|
-
this.end = "";
|
|
56
|
-
this.min = 0;
|
|
57
|
-
this.max = 10;
|
|
58
|
-
this.step = 1;
|
|
59
|
-
this.orientation = Orientation.horizontal;
|
|
60
|
-
this.ariaStartLabel = null;
|
|
61
|
-
this.ariaEndLabel = null;
|
|
62
|
-
this.markers = false;
|
|
63
|
-
this.pin = false;
|
|
64
|
-
this.valueTextFormatter = (value) => parseFloat(value).toLocaleString(this.locale.lang);
|
|
65
|
-
// --- Thumbs ---
|
|
24
|
+
super();
|
|
25
|
+
this.ariaLabel = null;
|
|
66
26
|
/**
|
|
27
|
+
* The element's value to be included in form submission when checked.
|
|
28
|
+
* Default to "on" to reach parity with input[type="radio"]
|
|
29
|
+
*
|
|
67
30
|
* @internal
|
|
68
31
|
*/
|
|
69
|
-
this.
|
|
32
|
+
this.initialValue = "on";
|
|
33
|
+
this.defaultSlottedNodes = [];
|
|
70
34
|
/**
|
|
71
35
|
* @internal
|
|
72
36
|
*/
|
|
73
|
-
this.
|
|
37
|
+
this.keypressHandler = (e) => {
|
|
38
|
+
switch (e.key) {
|
|
39
|
+
case keySpace:
|
|
40
|
+
if (!this.checked && !this.readOnly) {
|
|
41
|
+
this.checked = true;
|
|
42
|
+
}
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
};
|
|
74
47
|
/**
|
|
75
48
|
* @internal
|
|
76
49
|
*/
|
|
77
|
-
this.
|
|
78
|
-
this
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this._visiblyFocusedThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
__privateAdd(this, _onThumbBlur, () => {
|
|
91
|
-
this._visiblyFocusedThumb = null;
|
|
92
|
-
});
|
|
93
|
-
__privateAdd(this, _onMouseOver, (e) => {
|
|
94
|
-
this._hoveredThumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
95
|
-
});
|
|
96
|
-
__privateAdd(this, _onMouseOut, () => {
|
|
97
|
-
this._hoveredThumb = null;
|
|
98
|
-
});
|
|
99
|
-
__privateAdd(this, _onThumbMousedown, (event) => {
|
|
100
|
-
if (this.disabled || event.defaultPrevented) {
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
let target = event.target;
|
|
104
|
-
if (target === this._endThumbEl && this.startAsNumber === this.max && this.endAsNumber === this.max) {
|
|
105
|
-
target = this._startThumbEl;
|
|
106
|
-
}
|
|
107
|
-
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, target);
|
|
108
|
-
this._draggingThumb = __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, target);
|
|
109
|
-
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
110
|
-
});
|
|
111
|
-
__privateAdd(this, _onThumbKeydown, (e) => {
|
|
112
|
-
const thumb = __privateMethod(this, _RangeSlider_instances, getThumbIdFromEvent_fn).call(this, e);
|
|
113
|
-
this._visiblyFocusedThumb = thumb;
|
|
114
|
-
if (e.key === keyHome) {
|
|
115
|
-
e.preventDefault();
|
|
116
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min}` });
|
|
117
|
-
} else if (e.key === keyEnd) {
|
|
118
|
-
e.preventDefault();
|
|
119
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, { [thumb]: `${__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max}` });
|
|
120
|
-
} else if (!e.shiftKey) {
|
|
121
|
-
switch (e.key) {
|
|
122
|
-
case keyArrowRight:
|
|
123
|
-
case keyArrowDown:
|
|
124
|
-
e.preventDefault();
|
|
125
|
-
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Increment);
|
|
126
|
-
break;
|
|
127
|
-
case keyArrowLeft:
|
|
128
|
-
case keyArrowUp:
|
|
129
|
-
e.preventDefault();
|
|
130
|
-
__privateMethod(this, _RangeSlider_instances, applyStep_fn).call(this, thumb, Direction.Decrement);
|
|
131
|
-
break;
|
|
50
|
+
this.proxy = document.createElement("input");
|
|
51
|
+
this.#validateValueMissingWithSiblings = () => {
|
|
52
|
+
const siblings = this.#radioSiblings;
|
|
53
|
+
const group = this.#radioGroup;
|
|
54
|
+
if (siblings && siblings.length > 1) {
|
|
55
|
+
const isSiblingChecked = siblings.some((x) => x.checked);
|
|
56
|
+
if (isSiblingChecked) {
|
|
57
|
+
this.setValidity({ valueMissing: false });
|
|
58
|
+
this.errorValidationMessage = "";
|
|
59
|
+
if (group) group.errorValidationMessage = "";
|
|
132
60
|
}
|
|
133
61
|
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
if (this.
|
|
137
|
-
|
|
62
|
+
};
|
|
63
|
+
this.#syncSiblingsRequiredValidationStatus = () => {
|
|
64
|
+
if (this.elementInternals && !this.validity.valueMissing) {
|
|
65
|
+
const siblings = this.#radioSiblings;
|
|
66
|
+
const group = this.#radioGroup;
|
|
67
|
+
if (siblings && siblings.length > 1) {
|
|
68
|
+
siblings.forEach((x) => {
|
|
69
|
+
x.elementInternals.setValidity({ valueMissing: false });
|
|
70
|
+
x.errorValidationMessage = "";
|
|
71
|
+
if (group) group.errorValidationMessage = "";
|
|
72
|
+
});
|
|
73
|
+
}
|
|
138
74
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
});
|
|
145
|
-
__privateAdd(this, _onDragEnd, () => {
|
|
146
|
-
this._draggingThumb = false;
|
|
147
|
-
__privateMethod(this, _RangeSlider_instances, unregisterDragListeners_fn).call(this);
|
|
148
|
-
});
|
|
75
|
+
};
|
|
76
|
+
this.proxy.setAttribute("type", "radio");
|
|
77
|
+
this.proxy.setAttribute("name", this.name);
|
|
78
|
+
this.checked = this.defaultChecked;
|
|
79
|
+
this.dirtyChecked = false;
|
|
149
80
|
}
|
|
81
|
+
// Map to proxy element
|
|
150
82
|
/**
|
|
151
83
|
* @internal
|
|
152
84
|
*/
|
|
153
|
-
|
|
154
|
-
this.
|
|
155
|
-
|
|
156
|
-
this.dirtyValue = true;
|
|
157
|
-
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
158
|
-
}
|
|
159
|
-
if (this.$fastController.isConnected) {
|
|
160
|
-
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
85
|
+
readOnlyChanged() {
|
|
86
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
87
|
+
this.proxy.readOnly = this.readOnly;
|
|
161
88
|
}
|
|
162
89
|
}
|
|
163
90
|
/**
|
|
164
91
|
* @internal
|
|
165
92
|
*/
|
|
166
|
-
|
|
167
|
-
if (
|
|
168
|
-
this.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* @internal
|
|
174
|
-
*/
|
|
175
|
-
currentStartChanged() {
|
|
176
|
-
this.start = this.currentStart;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* The start property, typed as a number.
|
|
180
|
-
*
|
|
181
|
-
* @public
|
|
182
|
-
*/
|
|
183
|
-
get startAsNumber() {
|
|
184
|
-
return parseFloat(this.start);
|
|
185
|
-
}
|
|
186
|
-
set startAsNumber(next) {
|
|
187
|
-
this.start = next.toString();
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* @internal
|
|
191
|
-
*/
|
|
192
|
-
endChanged() {
|
|
193
|
-
this.currentEnd = this.end;
|
|
194
|
-
if (!__privateGet(this, _isInternalValueUpdate)) {
|
|
195
|
-
this.dirtyValue = true;
|
|
196
|
-
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
197
|
-
}
|
|
198
|
-
if (this.$fastController.isConnected) {
|
|
199
|
-
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* @internal
|
|
204
|
-
*/
|
|
205
|
-
initialEndChanged(_, newValue) {
|
|
206
|
-
if (newValue && !this.dirtyValue) {
|
|
207
|
-
this.end = newValue;
|
|
208
|
-
this.dirtyValue = false;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* @internal
|
|
213
|
-
*/
|
|
214
|
-
currentEndChanged() {
|
|
215
|
-
this.end = this.currentEnd;
|
|
216
|
-
}
|
|
217
|
-
/**
|
|
218
|
-
* The end property, typed as a number.
|
|
219
|
-
*
|
|
220
|
-
* @public
|
|
221
|
-
*/
|
|
222
|
-
get endAsNumber() {
|
|
223
|
-
return parseFloat(this.end);
|
|
224
|
-
}
|
|
225
|
-
set endAsNumber(next) {
|
|
226
|
-
this.end = next.toString();
|
|
227
|
-
}
|
|
228
|
-
/**
|
|
229
|
-
* @internal
|
|
230
|
-
*/
|
|
231
|
-
orientationChanged() {
|
|
232
|
-
if (this.$fastController.isConnected) {
|
|
233
|
-
__privateMethod(this, _RangeSlider_instances, updateThumbPositions_fn).call(this);
|
|
93
|
+
defaultCheckedChanged() {
|
|
94
|
+
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
95
|
+
if (!this.isInsideRadioGroup()) {
|
|
96
|
+
this.checked = this.defaultChecked;
|
|
97
|
+
this.dirtyChecked = false;
|
|
98
|
+
}
|
|
234
99
|
}
|
|
235
100
|
}
|
|
236
|
-
// --- Form handling ---
|
|
237
101
|
/**
|
|
238
102
|
* @internal
|
|
239
103
|
*/
|
|
240
104
|
nameChanged(previous, next) {
|
|
241
105
|
super.nameChanged(previous, next);
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
formResetCallback() {
|
|
245
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
246
|
-
start: this.initialStart ?? this.min.toString(),
|
|
247
|
-
end: this.initialEnd ?? this.max.toString()
|
|
248
|
-
});
|
|
249
|
-
super.formResetCallback();
|
|
106
|
+
next !== null ? this.proxy.setAttribute("name", this.name) : this.proxy.removeAttribute("name");
|
|
107
|
+
DOM.queueUpdate(this.validate);
|
|
250
108
|
}
|
|
251
109
|
/**
|
|
252
110
|
* @internal
|
|
253
111
|
*/
|
|
254
|
-
_isThumbPopupOpen(thumb) {
|
|
255
|
-
return this._visiblyFocusedThumb === thumb || this._hoveredThumb === thumb || this._draggingThumb === thumb;
|
|
256
|
-
}
|
|
257
|
-
// --- Lifecycle ---
|
|
258
112
|
connectedCallback() {
|
|
259
113
|
super.connectedCallback();
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
114
|
+
DOM.queueUpdate(this.validate);
|
|
115
|
+
if (this.parentElement.getAttribute("role") !== "radiogroup" && this.getAttribute("tabindex") === null) {
|
|
116
|
+
if (!this.disabled) {
|
|
117
|
+
this.setAttribute("tabindex", "0");
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (this.defaultChecked) {
|
|
121
|
+
if (!this.dirtyChecked) {
|
|
122
|
+
if (!this.isInsideRadioGroup()) {
|
|
123
|
+
this.checked = this.defaultChecked;
|
|
124
|
+
this.dirtyChecked = false;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
266
128
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
129
|
+
isInsideRadioGroup() {
|
|
130
|
+
const parent = this.closest(
|
|
131
|
+
"[role=radiogroup]"
|
|
132
|
+
);
|
|
133
|
+
return parent !== null;
|
|
271
134
|
}
|
|
272
135
|
/**
|
|
273
136
|
* @internal
|
|
274
137
|
*/
|
|
275
|
-
|
|
276
|
-
if (this.disabled
|
|
277
|
-
|
|
138
|
+
clickHandler(_) {
|
|
139
|
+
if (!this.disabled && !this.readOnly && !this.checked) {
|
|
140
|
+
this.checked = true;
|
|
278
141
|
}
|
|
279
|
-
const value = __privateMethod(this, _RangeSlider_instances, calculateValueFromMouseEvent_fn).call(this, e);
|
|
280
|
-
const startDistance = Math.abs(value - Number(this.start));
|
|
281
|
-
const endDistance = Math.abs(value - Number(this.end));
|
|
282
|
-
const thumb = startDistance < endDistance || startDistance === endDistance && value < Number(this.start) ? "start" : "end";
|
|
283
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
284
|
-
[thumb]: `${__privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, value)}`
|
|
285
|
-
});
|
|
286
|
-
this._draggingThumb = thumb;
|
|
287
|
-
__privateMethod(this, _RangeSlider_instances, focusThumbNonVisibly_fn).call(this, __privateGet(this, _RangeSlider_instances, thumbs_get)[thumb]);
|
|
288
|
-
__privateMethod(this, _RangeSlider_instances, registerDragHandlers_fn).call(this);
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
_isInternalValueUpdate = new WeakMap();
|
|
292
|
-
_RangeSlider_instances = new WeakSet();
|
|
293
|
-
updateValues_fn = function({ start, end }, emitEvents = true) {
|
|
294
|
-
if (start === this.start) {
|
|
295
|
-
start = void 0;
|
|
296
|
-
}
|
|
297
|
-
if (end === this.end) {
|
|
298
|
-
end = void 0;
|
|
299
|
-
}
|
|
300
|
-
if (start === void 0 && end === void 0) {
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
__privateSet(this, _isInternalValueUpdate, true);
|
|
304
|
-
if (start !== void 0) {
|
|
305
|
-
this.start = start;
|
|
306
142
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
this.$emit("input:start");
|
|
314
|
-
}
|
|
315
|
-
if (end !== void 0) {
|
|
316
|
-
this.$emit("input:end");
|
|
143
|
+
get #radioSiblings() {
|
|
144
|
+
const siblings = this.parentElement?.querySelectorAll(
|
|
145
|
+
`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`
|
|
146
|
+
);
|
|
147
|
+
if (siblings) {
|
|
148
|
+
return Array.from(siblings);
|
|
317
149
|
}
|
|
318
|
-
|
|
319
|
-
this.$emit("change");
|
|
320
|
-
this.dirtyValue = true;
|
|
321
|
-
}
|
|
322
|
-
__privateMethod(this, _RangeSlider_instances, updateFormValue_fn).call(this);
|
|
323
|
-
};
|
|
324
|
-
applyStep_fn = function(thumb, direction) {
|
|
325
|
-
__privateMethod(this, _RangeSlider_instances, updateValues_fn).call(this, {
|
|
326
|
-
[thumb]: __privateMethod(this, _RangeSlider_instances, roundToNearestStep_fn).call(this, thumb, Number(this[thumb]) + direction * this.step).toString()
|
|
327
|
-
});
|
|
328
|
-
};
|
|
329
|
-
updateFormValue_fn = function() {
|
|
330
|
-
if (!this.name) {
|
|
331
|
-
this.setFormValue(null);
|
|
332
|
-
} else {
|
|
333
|
-
const formData = new FormData();
|
|
334
|
-
formData.append(this.name, this.start);
|
|
335
|
-
formData.append(this.name, this.end);
|
|
336
|
-
this.setFormValue(formData);
|
|
150
|
+
return [];
|
|
337
151
|
}
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
start: this._startThumbEl,
|
|
342
|
-
end: this._endThumbEl
|
|
343
|
-
};
|
|
344
|
-
};
|
|
345
|
-
thumbConstraints_get = function() {
|
|
346
|
-
return {
|
|
347
|
-
start: { min: this.min, max: this.endAsNumber },
|
|
348
|
-
end: { min: this.startAsNumber, max: this.max }
|
|
349
|
-
};
|
|
350
|
-
};
|
|
351
|
-
getThumbId_fn = function(thumb) {
|
|
352
|
-
return thumb === this._startThumbEl ? "start" : "end";
|
|
353
|
-
};
|
|
354
|
-
getThumbIdFromEvent_fn = function(e) {
|
|
355
|
-
return __privateMethod(this, _RangeSlider_instances, getThumbId_fn).call(this, e.target);
|
|
356
|
-
};
|
|
357
|
-
updateThumbPositions_fn = function() {
|
|
358
|
-
const startOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.startAsNumber);
|
|
359
|
-
const endOffsetPct = __privateMethod(this, _RangeSlider_instances, thumbTrackEndOffset_fn).call(this, this.endAsNumber);
|
|
360
|
-
const [dirProp, dimProp] = this.orientation === Orientation.horizontal ? ["right", "width"] : ["bottom", "height"];
|
|
361
|
-
const transition = `transition: ${this._draggingThumb ? "none" : "all 0.2s ease"};`;
|
|
362
|
-
this._startThumbCss = `${dirProp}: ${startOffsetPct}%; ${transition}`;
|
|
363
|
-
this._endThumbCss = `${dirProp}: ${endOffsetPct}%; ${transition}`;
|
|
364
|
-
this._selectedRangeCss = `${dirProp}: ${endOffsetPct}%; ${dimProp}: ${startOffsetPct - endOffsetPct}%; ${transition}`;
|
|
365
|
-
};
|
|
366
|
-
thumbTrackEndOffset_fn = function(value) {
|
|
367
|
-
return (1 - inverseLerp(this.min, this.max, value)) * 100;
|
|
368
|
-
};
|
|
369
|
-
calculateValueFromMouseEvent_fn = function(e) {
|
|
370
|
-
const trackClientRect = this._trackEl.getBoundingClientRect();
|
|
371
|
-
const [minPos, maxPos, valuePos] = this.orientation === Orientation.horizontal ? [
|
|
372
|
-
this._trackEl.clientLeft,
|
|
373
|
-
this._trackEl.clientWidth,
|
|
374
|
-
e.pageX - document.documentElement.scrollLeft - this.getBoundingClientRect().left
|
|
375
|
-
] : [
|
|
376
|
-
trackClientRect.top,
|
|
377
|
-
trackClientRect.bottom,
|
|
378
|
-
e.pageY - document.documentElement.scrollTop
|
|
379
|
-
];
|
|
380
|
-
return lerp(this.min, this.max, inverseLerp(minPos, maxPos, valuePos));
|
|
381
|
-
};
|
|
382
|
-
roundToNearestStep_fn = function(thumb, value) {
|
|
383
|
-
return limit(
|
|
384
|
-
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].min,
|
|
385
|
-
__privateGet(this, _RangeSlider_instances, thumbConstraints_get)[thumb].max,
|
|
386
|
-
roundToStepValue(value - this.min, this.step) + this.min
|
|
387
|
-
);
|
|
388
|
-
};
|
|
389
|
-
_isNonVisibleFocus = new WeakMap();
|
|
390
|
-
focusThumbNonVisibly_fn = function(thumb) {
|
|
391
|
-
__privateSet(this, _isNonVisibleFocus, true);
|
|
392
|
-
thumb.focus();
|
|
393
|
-
__privateSet(this, _isNonVisibleFocus, false);
|
|
394
|
-
};
|
|
395
|
-
// --- Event handling ---
|
|
396
|
-
registerThumbListeners_fn = function() {
|
|
397
|
-
for (const thumb of ["start", "end"]) {
|
|
398
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("keydown", __privateGet(this, _onThumbKeydown));
|
|
399
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
400
|
-
"mousedown",
|
|
401
|
-
__privateGet(this, _onThumbMousedown),
|
|
402
|
-
{ passive: true }
|
|
403
|
-
);
|
|
404
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener(
|
|
405
|
-
"touchstart",
|
|
406
|
-
__privateGet(this, _onThumbMousedown),
|
|
407
|
-
{ passive: true }
|
|
152
|
+
get #radioGroup() {
|
|
153
|
+
const parentGroup = this.closest(
|
|
154
|
+
`${this.tagName.toLocaleLowerCase()}-group[name="${this.name}"]`
|
|
408
155
|
);
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
passive: true
|
|
414
|
-
});
|
|
415
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("focus", __privateGet(this, _onThumbFocus));
|
|
416
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].addEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
156
|
+
if (parentGroup) {
|
|
157
|
+
return parentGroup;
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
417
160
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
)
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
__privateGet(this, _RangeSlider_instances, thumbs_get)[thumb].removeEventListener("blur", __privateGet(this, _onThumbBlur));
|
|
161
|
+
#validateValueMissingWithSiblings;
|
|
162
|
+
#syncSiblingsRequiredValidationStatus;
|
|
163
|
+
/**
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
validate(anchor) {
|
|
167
|
+
super.validate(anchor);
|
|
168
|
+
if (this.proxy) {
|
|
169
|
+
this.errorValidationMessage = this.validationMessage || "";
|
|
170
|
+
if (this.validity.valueMissing) {
|
|
171
|
+
this.#validateValueMissingWithSiblings();
|
|
172
|
+
} else {
|
|
173
|
+
this.#syncSiblingsRequiredValidationStatus();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
434
176
|
}
|
|
435
|
-
}
|
|
436
|
-
_onThumbFocus = new WeakMap();
|
|
437
|
-
_onThumbBlur = new WeakMap();
|
|
438
|
-
_onMouseOver = new WeakMap();
|
|
439
|
-
_onMouseOut = new WeakMap();
|
|
440
|
-
_onThumbMousedown = new WeakMap();
|
|
441
|
-
_onThumbKeydown = new WeakMap();
|
|
442
|
-
registerDragHandlers_fn = function() {
|
|
443
|
-
window.addEventListener("mousemove", __privateGet(this, _onDragMove), { passive: true });
|
|
444
|
-
window.addEventListener("touchmove", __privateGet(this, _onDragMove), { passive: true });
|
|
445
|
-
window.addEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
446
|
-
window.addEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
447
|
-
window.document.addEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
448
|
-
};
|
|
449
|
-
unregisterDragListeners_fn = function() {
|
|
450
|
-
window.removeEventListener("mouseup", __privateGet(this, _onDragEnd));
|
|
451
|
-
window.document.removeEventListener("mouseleave", __privateGet(this, _onDragEnd));
|
|
452
|
-
window.removeEventListener("mousemove", __privateGet(this, _onDragMove));
|
|
453
|
-
window.removeEventListener("touchmove", __privateGet(this, _onDragMove));
|
|
454
|
-
window.removeEventListener("touchend", __privateGet(this, _onDragEnd));
|
|
455
|
-
};
|
|
456
|
-
_onDragMove = new WeakMap();
|
|
457
|
-
_onDragEnd = new WeakMap();
|
|
458
|
-
__decorateClass([
|
|
459
|
-
observable
|
|
460
|
-
], RangeSlider.prototype, "start", 2);
|
|
461
|
-
__decorateClass([
|
|
462
|
-
attr({ mode: "fromView", attribute: "start" })
|
|
463
|
-
], RangeSlider.prototype, "initialStart", 2);
|
|
464
|
-
__decorateClass([
|
|
465
|
-
attr({ attribute: "current-start" })
|
|
466
|
-
], RangeSlider.prototype, "currentStart", 2);
|
|
467
|
-
__decorateClass([
|
|
468
|
-
observable
|
|
469
|
-
], RangeSlider.prototype, "end", 2);
|
|
470
|
-
__decorateClass([
|
|
471
|
-
attr({ mode: "fromView", attribute: "end" })
|
|
472
|
-
], RangeSlider.prototype, "initialEnd", 2);
|
|
473
|
-
__decorateClass([
|
|
474
|
-
attr({ attribute: "current-end" })
|
|
475
|
-
], RangeSlider.prototype, "currentEnd", 2);
|
|
476
|
-
__decorateClass([
|
|
477
|
-
attr({ converter: nullableNumberConverter })
|
|
478
|
-
], RangeSlider.prototype, "min", 2);
|
|
479
|
-
__decorateClass([
|
|
480
|
-
attr({ converter: nullableNumberConverter })
|
|
481
|
-
], RangeSlider.prototype, "max", 2);
|
|
482
|
-
__decorateClass([
|
|
483
|
-
attr({ converter: defaultToOneConverter })
|
|
484
|
-
], RangeSlider.prototype, "step", 2);
|
|
485
|
-
__decorateClass([
|
|
486
|
-
attr
|
|
487
|
-
], RangeSlider.prototype, "orientation", 2);
|
|
488
|
-
__decorateClass([
|
|
489
|
-
attr({ attribute: "aria-start-label" })
|
|
490
|
-
], RangeSlider.prototype, "ariaStartLabel", 2);
|
|
491
|
-
__decorateClass([
|
|
492
|
-
attr({ attribute: "aria-end-label" })
|
|
493
|
-
], RangeSlider.prototype, "ariaEndLabel", 2);
|
|
177
|
+
}
|
|
494
178
|
__decorateClass([
|
|
495
|
-
attr({
|
|
496
|
-
],
|
|
179
|
+
attr({ attribute: "aria-label" })
|
|
180
|
+
], Radio.prototype, "ariaLabel");
|
|
497
181
|
__decorateClass([
|
|
498
182
|
attr
|
|
499
|
-
],
|
|
183
|
+
], Radio.prototype, "connotation");
|
|
500
184
|
__decorateClass([
|
|
501
|
-
attr({ mode: "boolean" })
|
|
502
|
-
],
|
|
185
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
186
|
+
], Radio.prototype, "readOnly");
|
|
503
187
|
__decorateClass([
|
|
504
188
|
observable
|
|
505
|
-
],
|
|
506
|
-
__decorateClass([
|
|
507
|
-
observable
|
|
508
|
-
], RangeSlider.prototype, "_draggingThumb", 2);
|
|
509
|
-
__decorateClass([
|
|
510
|
-
observable
|
|
511
|
-
], RangeSlider.prototype, "_visiblyFocusedThumb", 2);
|
|
512
|
-
__decorateClass([
|
|
513
|
-
observable
|
|
514
|
-
], RangeSlider.prototype, "_hoveredThumb", 2);
|
|
515
|
-
__decorateClass([
|
|
516
|
-
observable
|
|
517
|
-
], RangeSlider.prototype, "_startThumbCss", 2);
|
|
518
|
-
__decorateClass([
|
|
519
|
-
observable
|
|
520
|
-
], RangeSlider.prototype, "_endThumbCss", 2);
|
|
521
|
-
__decorateClass([
|
|
522
|
-
observable
|
|
523
|
-
], RangeSlider.prototype, "_selectedRangeCss", 2);
|
|
524
|
-
RangeSlider = __decorateClass([
|
|
525
|
-
formElements
|
|
526
|
-
], RangeSlider);
|
|
189
|
+
], Radio.prototype, "defaultSlottedNodes");
|
|
527
190
|
|
|
528
|
-
const getClasses = ({
|
|
529
|
-
"
|
|
530
|
-
[
|
|
531
|
-
[
|
|
191
|
+
const getClasses = ({ connotation, checked, readOnly, disabled }) => classNames(
|
|
192
|
+
"base",
|
|
193
|
+
[`connotation-${connotation}`, Boolean(connotation)],
|
|
194
|
+
["checked", Boolean(checked)],
|
|
195
|
+
["readonly", Boolean(readOnly)],
|
|
196
|
+
["disabled", Boolean(disabled)]
|
|
532
197
|
);
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
>
|
|
542
|
-
<div class="
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
x.orientation === Orientation.horizontal,
|
|
550
|
-
Math.floor((x.max - x.min) / x.step)
|
|
551
|
-
)}`
|
|
552
|
-
)}
|
|
553
|
-
</div>
|
|
554
|
-
<div
|
|
555
|
-
${ref("_startThumbEl")}
|
|
556
|
-
class="${getThumbClassesFor("start")}"
|
|
557
|
-
style="${(x) => x._startThumbCss}"
|
|
558
|
-
role="slider"
|
|
559
|
-
tabindex="${(x) => x.disabled ? null : 0}"
|
|
560
|
-
aria-label="${(x) => x.ariaStartLabel || x.locale.rangeSlider.startThumbLabel}"
|
|
561
|
-
aria-valuetext="${(x) => x.valueTextFormatter(x.start)}"
|
|
562
|
-
aria-valuenow="${(x) => x.start}"
|
|
563
|
-
aria-valuemin="${(x) => x.min}"
|
|
564
|
-
aria-valuemax="${(x) => x.end}"
|
|
565
|
-
aria-disabled="${(x) => x.disabled}"
|
|
566
|
-
aria-orientation="${(x) => x.orientation}"
|
|
567
|
-
></div>
|
|
568
|
-
${when(
|
|
569
|
-
(x) => x.pin,
|
|
570
|
-
html`<${popupTag}
|
|
571
|
-
class="popup"
|
|
572
|
-
arrow
|
|
573
|
-
alternate
|
|
574
|
-
:anchor="${(x) => x._startThumbEl}"
|
|
575
|
-
:open=${(x) => x._isThumbPopupOpen("start")}
|
|
576
|
-
:placementStrategy=${(x) => x.orientation === Orientation.horizontal ? PlacementStrategy.AutoPlacementHorizontal : PlacementStrategy.AutoPlacementVertical}
|
|
577
|
-
animation-frame
|
|
578
|
-
exportparts="vvd-theme-alternate"
|
|
579
|
-
aria-hidden="true"
|
|
580
|
-
>
|
|
581
|
-
<div class="tooltip">${(x) => x.valueTextFormatter(x.start)}</div>
|
|
582
|
-
</${popupTag}>`
|
|
583
|
-
)}
|
|
584
|
-
<div
|
|
585
|
-
${ref("_endThumbEl")}
|
|
586
|
-
class="${getThumbClassesFor("end")}"
|
|
587
|
-
style="${(x) => x._endThumbCss}"
|
|
588
|
-
role="slider"
|
|
589
|
-
tabindex="${(x) => x.disabled ? null : 0}"
|
|
590
|
-
aria-label="${(x) => x.ariaEndLabel || x.locale.rangeSlider.endThumbLabel}"
|
|
591
|
-
aria-valuetext="${(x) => x.valueTextFormatter(x.end)}"
|
|
592
|
-
aria-valuenow="${(x) => x.end}"
|
|
593
|
-
aria-valuemin="${(x) => x.start}"
|
|
594
|
-
aria-valuemax="${(x) => x.max}"
|
|
595
|
-
aria-disabled="${(x) => x.disabled}"
|
|
596
|
-
aria-orientation="${(x) => x.orientation}"
|
|
597
|
-
></div>
|
|
598
|
-
${when(
|
|
599
|
-
(x) => x.pin,
|
|
600
|
-
html`<${popupTag}
|
|
601
|
-
class="popup"
|
|
602
|
-
arrow
|
|
603
|
-
alternate
|
|
604
|
-
:anchor="${(x) => x._endThumbEl}"
|
|
605
|
-
:open=${(x) => x._isThumbPopupOpen("end")}
|
|
606
|
-
:placementStrategy=${(x) => x.orientation === Orientation.horizontal ? PlacementStrategy.AutoPlacementHorizontal : PlacementStrategy.AutoPlacementVertical}
|
|
607
|
-
animation-frame
|
|
608
|
-
exportparts="vvd-theme-alternate"
|
|
609
|
-
aria-hidden="true"
|
|
610
|
-
>
|
|
611
|
-
<div class="tooltip">${(x) => x.valueTextFormatter(x.end)}</div>
|
|
612
|
-
</${popupTag}>`
|
|
613
|
-
)}
|
|
614
|
-
</div>
|
|
615
|
-
</div>
|
|
616
|
-
</template>`;
|
|
617
|
-
};
|
|
198
|
+
const RadioTemplate = html`<template
|
|
199
|
+
aria-checked="${(x) => x.checked}"
|
|
200
|
+
aria-disabled="${(x) => x.disabled}"
|
|
201
|
+
aria-required="${(x) => x.required}"
|
|
202
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
203
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
204
|
+
role="radio"
|
|
205
|
+
>
|
|
206
|
+
<div class="${getClasses}">
|
|
207
|
+
<div class="control"></div>
|
|
208
|
+
${when(
|
|
209
|
+
(x) => x.label,
|
|
210
|
+
html`<label class="label">${(x) => x.label}</label>`
|
|
211
|
+
)}
|
|
212
|
+
</div>
|
|
213
|
+
</template>`;
|
|
618
214
|
|
|
619
|
-
const
|
|
620
|
-
"
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
[
|
|
215
|
+
const radioDefinition = defineVividComponent(
|
|
216
|
+
"radio",
|
|
217
|
+
Radio,
|
|
218
|
+
RadioTemplate,
|
|
219
|
+
[],
|
|
624
220
|
{
|
|
625
|
-
styles
|
|
626
|
-
shadowOptions: {
|
|
627
|
-
delegatesFocus: true
|
|
628
|
-
}
|
|
221
|
+
styles
|
|
629
222
|
}
|
|
630
223
|
);
|
|
631
|
-
const
|
|
632
|
-
rangeSliderDefinition
|
|
633
|
-
);
|
|
224
|
+
const registerRadio = createRegisterFunction(radioDefinition);
|
|
634
225
|
|
|
635
|
-
export {
|
|
226
|
+
export { Radio as R, registerRadio as a, radioDefinition as r };
|