@vonage/vivid 5.24.0 → 5.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/README.md +1 -1
- package/avatar/index.cjs +10 -10
- package/avatar/index.js +4 -3
- package/breadcrumb-item/index.cjs +9 -5
- package/breadcrumb-item/index.js +11 -6
- package/bundled/affix.cjs +1 -1
- package/bundled/affix.js +1 -1
- package/bundled/definition10.cjs +2 -1
- package/bundled/definition10.js +3 -2
- package/bundled/definition11.cjs +4 -4
- package/bundled/definition11.js +4 -3
- package/bundled/definition12.cjs +1 -1
- package/bundled/definition12.js +1 -0
- package/bundled/definition15.cjs +5 -5
- package/bundled/definition15.js +4 -3
- package/bundled/definition17.cjs +7 -7
- package/bundled/definition17.js +22 -109
- package/bundled/definition18.cjs +3 -3
- package/bundled/definition18.js +9 -31
- package/bundled/definition19.cjs +19 -19
- package/bundled/definition19.js +3 -2
- package/bundled/definition21.cjs +8 -8
- package/bundled/definition21.js +5 -4
- package/bundled/definition22.cjs +2 -2
- package/bundled/definition22.js +2 -2
- package/bundled/definition24.cjs +4 -4
- package/bundled/definition24.js +4 -3
- package/bundled/definition25.cjs +3 -3
- package/bundled/definition25.js +32 -28
- package/bundled/definition3.cjs +5 -5
- package/bundled/definition3.js +10 -40
- package/bundled/definition4.cjs +6 -6
- package/bundled/definition4.js +4 -3
- package/bundled/definition6.cjs +11 -11
- package/bundled/definition6.js +4 -3
- package/bundled/definition9.cjs +12 -6
- package/bundled/definition9.js +66 -43
- package/bundled/extractOptions.cjs +1 -1
- package/bundled/extractOptions.js +2 -2
- package/bundled/icon.cjs +1 -0
- package/bundled/icon.js +34 -0
- package/bundled/listbox.cjs +1 -1
- package/bundled/listbox.js +5 -2
- package/bundled/mixins.cjs +8 -8
- package/bundled/mixins.js +4 -3
- package/bundled/optgroup.cjs +1 -0
- package/bundled/optgroup.js +27 -0
- package/bundled/option.cjs +1 -0
- package/bundled/option.js +93 -0
- package/bundled/vivid-element.cjs +1 -1
- package/bundled/vivid-element.js +1 -1
- package/card/index.cjs +22 -22
- package/card/index.js +4 -3
- package/color-picker/index.cjs +18 -18
- package/color-picker/index.js +4 -3
- package/combobox/index.cjs +7 -7
- package/combobox/index.js +4 -2
- package/custom-elements.json +4159 -3847
- package/data-grid/index.cjs +24 -24
- package/data-grid/index.js +4 -3
- package/dial-pad/index.cjs +21 -21
- package/dial-pad/index.js +4 -3
- package/dialog/index.cjs +14 -14
- package/dialog/index.js +4 -3
- package/empty-state/index.cjs +3 -3
- package/empty-state/index.js +4 -3
- package/file-picker/index.cjs +7 -7
- package/file-picker/index.js +4 -3
- package/icon/definition.cjs +2 -1
- package/icon/definition.js +2 -1
- package/index.cjs +148 -141
- package/index.js +41 -37
- package/lib/accordion-item/accordion-item.d.ts +1 -0
- package/lib/combobox/combobox.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/dial-pad/dial-pad.d.ts +0 -1
- package/lib/listbox/definition.d.ts +3 -0
- package/lib/listbox/index.d.ts +1 -0
- package/lib/listbox/listbox.d.ts +1302 -0
- package/lib/listbox/listbox.template.d.ts +3 -0
- package/lib/listbox/variations.browser-spec.d.ts +1 -0
- package/lib/menu/menu.d.ts +0 -1
- package/lib/number-field/number-field.d.ts +0 -1
- package/lib/rich-text-editor/rte/features/base.d.ts +1 -0
- package/lib/rich-text-editor/rte/utils/default-textblock.d.ts +2 -2
- package/lib/tag-name-map.d.ts +2 -1
- package/lib/text-field/text-field.d.ts +1 -0
- package/lib/toggletip/toggletip.d.ts +1 -0
- package/lib/tooltip/tooltip.d.ts +1 -0
- package/listbox/definition.cjs +5 -0
- package/listbox/definition.js +2 -0
- package/listbox/index.cjs +11 -0
- package/listbox/index.js +540 -0
- package/nav/definition.cjs +1 -1
- package/nav/definition.js +1 -1
- package/nav-disclosure/definition.cjs +1 -1
- package/nav-disclosure/definition.js +1 -1
- package/nav-disclosure/index.cjs +4 -4
- package/nav-disclosure/index.js +4 -3
- package/nav-item/definition.cjs +1 -1
- package/nav-item/definition.js +1 -1
- package/note/definition.cjs +1 -1
- package/note/definition.js +1 -1
- package/number-field/definition.cjs +1 -1
- package/number-field/definition.js +1 -1
- package/optgroup/definition.cjs +2 -1
- package/optgroup/definition.js +2 -1
- package/option/definition.cjs +2 -1
- package/option/definition.js +2 -1
- package/package.json +8 -7
- package/pagination/definition.cjs +1 -1
- package/pagination/definition.js +1 -1
- package/platform-switch/definition.cjs +1 -1
- package/platform-switch/definition.js +1 -1
- package/popover/definition.cjs +1 -1
- package/popover/definition.js +1 -1
- package/popover/index.cjs +5 -5
- package/popover/index.js +4 -3
- package/progress/definition.cjs +1 -1
- package/progress/definition.js +1 -1
- package/radio/definition.cjs +1 -1
- package/radio/definition.js +1 -1
- package/radio-group/definition.cjs +1 -1
- package/radio-group/definition.js +1 -1
- package/range-slider/definition.cjs +1 -1
- package/range-slider/definition.js +1 -1
- package/rich-text-editor/definition.cjs +1 -1
- package/rich-text-editor/definition.js +1 -1
- package/rich-text-editor/index.cjs +13 -13
- package/rich-text-editor/index.js +22 -19
- package/rich-text-view/definition.cjs +1 -1
- package/rich-text-view/definition.js +1 -1
- package/searchable-select/definition.cjs +1 -1
- package/searchable-select/definition.js +1 -1
- package/searchable-select/index.cjs +23 -23
- package/searchable-select/index.js +10 -7
- package/select/definition.cjs +1 -1
- package/select/definition.js +1 -1
- package/selectable-box/definition.cjs +1 -1
- package/selectable-box/definition.js +1 -1
- package/shared/listbox/commands.d.ts +17 -0
- package/shared/listbox/move.d.ts +6 -0
- package/shared/listbox/options.d.ts +12 -0
- package/shared/listbox/selection.d.ts +28 -0
- package/shared/listbox/state.d.ts +26 -0
- package/shared/listbox/typeahead.d.ts +8 -0
- package/shared/listbox/with-options-filter.d.ts +440 -0
- package/shared/listbox/with-options.d.ts +862 -0
- package/side-drawer/definition.cjs +1 -1
- package/side-drawer/definition.js +1 -1
- package/simple-color-picker/definition.cjs +1 -1
- package/simple-color-picker/definition.js +1 -1
- package/simple-color-picker/index.cjs +6 -6
- package/simple-color-picker/index.js +4 -3
- package/split-button/definition.cjs +1 -1
- package/split-button/definition.js +1 -1
- package/status/definition.cjs +1 -1
- package/status/definition.js +1 -1
- package/switch/definition.cjs +1 -1
- package/switch/definition.js +1 -1
- package/tab/definition.cjs +1 -1
- package/tab/definition.js +1 -1
- package/tab-panel/definition.cjs +1 -1
- package/tab-panel/definition.js +1 -1
- package/table/definition.cjs +1 -1
- package/table/definition.js +1 -1
- package/table/index.cjs +13 -13
- package/table/index.js +4 -3
- package/tabs/definition.cjs +1 -1
- package/tabs/definition.js +1 -1
- package/tag/definition.cjs +1 -1
- package/tag/definition.js +1 -1
- package/tag/index.cjs +11 -11
- package/tag/index.js +4 -3
- package/tag-group/definition.cjs +1 -1
- package/tag-group/definition.js +1 -1
- package/text-area/definition.cjs +1 -1
- package/text-area/definition.js +1 -1
- package/time-picker/definition.cjs +1 -1
- package/time-picker/definition.js +1 -1
- package/tree-item/definition.cjs +1 -1
- package/tree-item/definition.js +1 -1
- package/tree-view/definition.cjs +1 -1
- package/tree-view/definition.js +1 -1
- package/unbundled/affix.cjs +2 -2
- package/unbundled/affix.js +1 -1
- package/unbundled/base-progress.cjs +1 -1
- package/unbundled/base-progress.js +1 -1
- package/unbundled/button.cjs +2 -2
- package/unbundled/button.js +2 -2
- package/unbundled/definition.cjs +2 -65
- package/unbundled/definition.js +4 -61
- package/unbundled/definition11.cjs +4 -3
- package/unbundled/definition11.js +3 -2
- package/unbundled/definition12.cjs +3 -2
- package/unbundled/definition12.js +3 -2
- package/unbundled/definition14.cjs +2 -1
- package/unbundled/definition14.js +2 -1
- package/unbundled/definition17.cjs +9 -4
- package/unbundled/definition17.js +9 -4
- package/unbundled/definition2.cjs +7 -2
- package/unbundled/definition2.js +8 -3
- package/unbundled/definition21.cjs +2 -1
- package/unbundled/definition21.js +2 -1
- package/unbundled/definition23.cjs +2 -1
- package/unbundled/definition23.js +2 -1
- package/unbundled/definition24.cjs +6 -4
- package/unbundled/definition24.js +6 -4
- package/unbundled/definition25.cjs +2 -1
- package/unbundled/definition25.js +2 -1
- package/unbundled/definition26.cjs +7 -4
- package/unbundled/definition26.js +7 -4
- package/unbundled/definition27.cjs +39 -5
- package/unbundled/definition27.js +40 -6
- package/unbundled/definition28.cjs +4 -3
- package/unbundled/definition28.js +4 -3
- package/unbundled/definition29.cjs +5 -168
- package/unbundled/definition29.js +11 -162
- package/unbundled/definition30.cjs +2 -63
- package/unbundled/definition30.js +5 -54
- package/unbundled/definition31.cjs +5 -3
- package/unbundled/definition31.js +5 -3
- package/unbundled/definition32.cjs +2 -1
- package/unbundled/definition32.js +2 -1
- package/unbundled/definition35.cjs +2 -1
- package/unbundled/definition35.js +2 -1
- package/unbundled/definition37.cjs +1 -1
- package/unbundled/definition37.js +1 -1
- package/unbundled/definition39.cjs +1 -1
- package/unbundled/definition39.js +1 -1
- package/unbundled/definition40.cjs +4 -2
- package/unbundled/definition40.js +4 -2
- package/unbundled/definition41.cjs +11 -6
- package/unbundled/definition41.js +11 -6
- package/unbundled/definition42.cjs +5 -4
- package/unbundled/definition42.js +5 -4
- package/unbundled/definition44.cjs +3 -2
- package/unbundled/definition44.js +3 -2
- package/unbundled/definition45.cjs +2 -2
- package/unbundled/definition45.js +2 -2
- package/unbundled/definition49.cjs +583 -79
- package/unbundled/definition49.js +579 -76
- package/unbundled/definition50.cjs +71 -33
- package/unbundled/definition50.js +67 -29
- package/unbundled/definition51.cjs +54 -23
- package/unbundled/definition51.js +52 -18
- package/unbundled/definition52.cjs +23 -39
- package/unbundled/definition52.js +17 -36
- package/unbundled/definition53.cjs +29 -314
- package/unbundled/definition53.js +27 -312
- package/unbundled/definition54.cjs +302 -195
- package/unbundled/definition54.js +298 -191
- package/unbundled/definition55.cjs +210 -40
- package/unbundled/definition55.js +206 -36
- package/unbundled/definition56.cjs +42 -266
- package/unbundled/definition56.js +38 -262
- package/unbundled/definition57.cjs +270 -50
- package/unbundled/definition57.js +267 -46
- package/unbundled/definition58.cjs +48 -146
- package/unbundled/definition58.js +47 -143
- package/unbundled/definition59.cjs +127 -225
- package/unbundled/definition59.js +122 -223
- package/unbundled/definition6.cjs +2 -1
- package/unbundled/definition6.js +2 -1
- package/unbundled/definition60.cjs +199 -418
- package/unbundled/definition60.js +196 -415
- package/unbundled/definition61.cjs +442 -3738
- package/unbundled/definition61.js +432 -3565
- package/unbundled/definition62.cjs +3717 -730
- package/unbundled/definition62.js +3544 -720
- package/unbundled/definition63.cjs +770 -97
- package/unbundled/definition63.js +767 -94
- package/unbundled/definition64.cjs +100 -999
- package/unbundled/definition64.js +98 -994
- package/unbundled/definition65.cjs +991 -93
- package/unbundled/definition65.js +985 -90
- package/unbundled/definition66.cjs +109 -73
- package/unbundled/definition66.js +105 -63
- package/unbundled/definition67.cjs +69 -155
- package/unbundled/definition67.js +60 -152
- package/unbundled/definition68.cjs +155 -119
- package/unbundled/definition68.js +151 -115
- package/unbundled/definition69.cjs +124 -49
- package/unbundled/definition69.js +120 -45
- package/unbundled/definition70.cjs +51 -85
- package/unbundled/definition70.js +50 -81
- package/unbundled/definition71.cjs +91 -19
- package/unbundled/definition71.js +86 -14
- package/unbundled/definition72.cjs +20 -87
- package/unbundled/definition72.js +14 -84
- package/unbundled/definition73.cjs +77 -294
- package/unbundled/definition73.js +72 -217
- package/unbundled/definition74.cjs +289 -311
- package/unbundled/definition74.js +219 -306
- package/unbundled/definition75.cjs +326 -26
- package/unbundled/definition75.js +317 -23
- package/unbundled/definition76.cjs +27 -122
- package/unbundled/definition76.js +22 -118
- package/unbundled/definition77.cjs +105 -232
- package/unbundled/definition77.js +101 -228
- package/unbundled/definition78.cjs +259 -26
- package/unbundled/definition78.js +249 -23
- package/unbundled/definition79.cjs +29 -148
- package/unbundled/definition79.js +27 -133
- package/unbundled/definition80.cjs +118 -173
- package/unbundled/definition80.js +109 -169
- package/unbundled/definition81.cjs +181 -477
- package/unbundled/definition81.js +176 -471
- package/unbundled/definition82.cjs +517 -0
- package/unbundled/definition82.js +497 -0
- package/unbundled/extractOptions.cjs +5 -5
- package/unbundled/extractOptions.js +2 -2
- package/unbundled/icon.cjs +67 -0
- package/unbundled/icon.js +61 -0
- package/unbundled/linkable.cjs +1 -1
- package/unbundled/linkable.js +1 -1
- package/unbundled/listbox.cjs +8 -3
- package/unbundled/listbox.js +7 -2
- package/unbundled/mixins.cjs +2 -1
- package/unbundled/mixins.js +2 -1
- package/unbundled/optgroup.cjs +66 -0
- package/unbundled/optgroup.js +54 -0
- package/unbundled/option.cjs +176 -0
- package/unbundled/option.js +164 -0
- package/unbundled/time-selection-picker.template.cjs +1 -1
- package/unbundled/time-selection-picker.template.js +1 -1
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +1 -1
- package/video-player/definition.js +1 -1
- package/vivid.api.json +336 -193
|
@@ -1,160 +1,64 @@
|
|
|
1
|
-
import { d as createRegisterFunction,
|
|
1
|
+
import { d as createRegisterFunction, u as defineVividComponent } from "./vivid-element.js";
|
|
2
2
|
import { t as __decorate } from "./decorate.js";
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var radio_default = ":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)}@media (hover:hover){.base: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.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:checked:where(:not(.disabled,:disabled)),.base.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)}@media (hover:hover){.base:checked: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.checked.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:disabled,.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.base.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{cursor:pointer;user-select:none;align-items:center;gap:8px;display:inline-flex}.base.disabled{pointer-events:none}.control{block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 20));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 20));border-radius:50%;flex-shrink:0;position:relative}.base:not(.checked) .control{background-color:var(--_appearance-color-fill)}.control:after{border-radius:inherit;background-color:var(--_appearance-color-outline);content:\"\";opacity:1;transition:opacity .2s;position:absolute;inset:5px}.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(--focus-stroke-color,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));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));display:block;position:absolute;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)}";
|
|
3
|
+
import { n as delegateAria, t as DelegatesAria } from "./delegates-aria.js";
|
|
4
|
+
import { t as BaseProgress } from "./base-progress.js";
|
|
5
|
+
import { attr, html, when } from "@microsoft/fast-element";
|
|
6
|
+
import { classNames } from "@microsoft/fast-web-utilities";
|
|
7
|
+
//#region src/lib/progress/progress.scss?inline
|
|
8
|
+
var progress_default = ".base{outline:none;align-items:center;height:6px;margin:0}.base:not(.connotation-pacific).connotation-cta{--_connotation-color-primary:var(--vvd-progress-cta-primary,var(--vvd-color-cta-500));--_connotation-color-soft:var(--vvd-progress-cta-soft,var(--vvd-color-cta-100))}.base:not(.connotation-pacific).connotation-alert{--_connotation-color-primary:var(--vvd-progress-alert-primary,var(--vvd-color-alert-500));--_connotation-color-soft:var(--vvd-progress-alert-soft,var(--vvd-color-alert-100))}.base:not(.connotation-pacific).connotation-success{--_connotation-color-primary:var(--vvd-progress-success-primary,var(--vvd-color-success-500));--_connotation-color-soft:var(--vvd-progress-success-soft,var(--vvd-color-success-100))}.base:not(.connotation-pacific):not(.connotation-cta,.connotation-alert,.connotation-success){--_connotation-color-primary:var(--vvd-progress-accent-primary,var(--vvd-color-canvas-text));--_connotation-color-soft:var(--vvd-progress-accent-soft,var(--vvd-color-neutral-100))}.base:not(.connotation-pacific){--_appearance-color-text:var(--_connotation-color-contrast);--_appearance-color-fill:var(--_connotation-color-soft);--_appearance-color-outline:transparent}.base.connotation-pacific{--_connotation-color-primary:linear-gradient(to right, var(--vvd-color-information-200), var(--vvd-color-cta-600))}.progress{align-items:center;block-size:100%;inline-size:100%;display:flex;position:relative;overflow:hidden}.base:not(.connotation-pacific) .progress{background-color:var(--_appearance-color-fill)}.base.connotation-pacific .progress{background-color:var(--vvd-color-neutral-100)}.base:not(.shape-sharp) .progress{border-radius:4px}.indeterminate{border-radius:inherit;background-color:var(--_connotation-color-primary);block-size:100%;inline-size:100%;display:flex}.determinate{border-radius:inherit;background-color:var(--_connotation-color-primary);block-size:100%;transition:all .2s ease-in-out}.connotation-pacific .determinate{background-image:var(--_connotation-color-primary)}.reverse .determinate{position:absolute;right:0}.paused .determinate{background:var(--vvd-color-neutral-300)}.indicator-1{inline-size:30%;animation:2s infinite indeterminate-1}.indicator-2{inline-size:60%;animation:2s infinite indeterminate-2}.indicator-1,.indicator-2{background-color:var(--vvd-color-neutral-100);opacity:0;block-size:100%;animation-timing-function:cubic-bezier(.4,0,.6,1);position:absolute}.connotation-pacific .indicator-1,.connotation-pacific .indicator-2{background-image:var(--_connotation-color-primary)}.paused .indicator-1,.paused .indicator-2{background-color:var(--_connotation-color-primary);animation-play-state:paused}.reverse .indicator-1,.reverse .indicator-2{animation-direction:reverse}@keyframes indeterminate-1{0%{opacity:1;transform:translate(-100%)}70%{opacity:1;transform:translate(300%)}70.01%{opacity:0}to{opacity:0;transform:translate(300%)}}@keyframes indeterminate-2{0%{opacity:0;transform:translate(-150%)}29.99%{opacity:0}30%{opacity:1;transform:translate(-150%)}to{opacity:1;transform:translate(166.66%)}}";
|
|
10
9
|
//#endregion
|
|
11
|
-
//#region src/lib/
|
|
10
|
+
//#region src/lib/progress/progress.ts
|
|
12
11
|
/**
|
|
13
12
|
* @public
|
|
14
|
-
* @
|
|
15
|
-
* @component radio
|
|
16
|
-
* @testAction check click #control
|
|
17
|
-
* @testQuery checked checked true
|
|
18
|
-
* @testQuery unchecked checked false
|
|
19
|
-
* @testRef control shadow .control
|
|
13
|
+
* @component progress
|
|
20
14
|
*/
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (this.proxy instanceof HTMLInputElement) this.proxy.readOnly = this.readOnly;
|
|
26
|
-
}
|
|
27
|
-
/** @internal */
|
|
28
|
-
defaultCheckedChanged() {
|
|
29
|
-
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
30
|
-
/* v8 ignore else -- @preserve */
|
|
31
|
-
if (!this.isInsideRadioGroup()) {
|
|
32
|
-
this.checked = this.defaultChecked;
|
|
33
|
-
this.dirtyChecked = false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
constructor() {
|
|
38
|
-
super();
|
|
39
|
-
this.initialValue = "on";
|
|
40
|
-
this.defaultSlottedNodes = [];
|
|
41
|
-
this.keypressHandler = (e) => {
|
|
42
|
-
switch (e.key) {
|
|
43
|
-
case keySpace:
|
|
44
|
-
if (!this.checked && !this.readOnly) this.checked = true;
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
};
|
|
49
|
-
this.proxy = document.createElement("input");
|
|
50
|
-
this.#validateValueMissingWithSiblings = () => {
|
|
51
|
-
const siblings = this.#radioSiblings;
|
|
52
|
-
const group = this.#radioGroup;
|
|
53
|
-
if (siblings && siblings.length > 1) {
|
|
54
|
-
if (siblings.some((x) => x.checked)) {
|
|
55
|
-
this.setValidity({ valueMissing: false });
|
|
56
|
-
this.errorValidationMessage = "";
|
|
57
|
-
if (group) group.errorValidationMessage = "";
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
this.#syncSiblingsRequiredValidationStatus = () => {
|
|
62
|
-
if (this.elementInternals && !this.validity.valueMissing) {
|
|
63
|
-
const siblings = this.#radioSiblings;
|
|
64
|
-
const group = this.#radioGroup;
|
|
65
|
-
if (siblings && siblings.length > 1) siblings.forEach((x) => {
|
|
66
|
-
x.elementInternals.setValidity({ valueMissing: false });
|
|
67
|
-
x.errorValidationMessage = "";
|
|
68
|
-
if (group) group.errorValidationMessage = "";
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
this.proxy.setAttribute("type", "radio");
|
|
73
|
-
this.proxy.setAttribute("name", this.name);
|
|
74
|
-
this.checked = this.defaultChecked;
|
|
75
|
-
this.dirtyChecked = false;
|
|
76
|
-
}
|
|
77
|
-
/** @internal */
|
|
78
|
-
nameChanged(previous, next) {
|
|
79
|
-
super.nameChanged(previous, next);
|
|
80
|
-
if (next !== null) this.proxy.setAttribute("name", this.name);
|
|
81
|
-
else this.proxy.removeAttribute("name");
|
|
82
|
-
Updates.enqueue(this.validate);
|
|
83
|
-
}
|
|
84
|
-
/** @internal */
|
|
85
|
-
connectedCallback() {
|
|
86
|
-
super.connectedCallback();
|
|
87
|
-
Updates.enqueue(this.validate);
|
|
88
|
-
if (this.parentElement.getAttribute("data-vvd-component") !== "radio-group" && this.getAttribute("tabindex") === null) {
|
|
89
|
-
/* v8 ignore else -- @preserve */
|
|
90
|
-
if (!this.disabled) this.setAttribute("tabindex", "0");
|
|
91
|
-
}
|
|
92
|
-
if (this.defaultChecked) {
|
|
93
|
-
/* v8 ignore else -- @preserve */
|
|
94
|
-
if (!this.dirtyChecked) {
|
|
95
|
-
if (!this.isInsideRadioGroup()) {
|
|
96
|
-
this.checked = this.defaultChecked;
|
|
97
|
-
this.dirtyChecked = false;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
isInsideRadioGroup() {
|
|
103
|
-
return this.closest("[data-vvd-component=\"radio-group\"]") !== null;
|
|
104
|
-
}
|
|
105
|
-
/** @internal */
|
|
106
|
-
clickHandler(_) {
|
|
107
|
-
if (!this.disabled && !this.readOnly && !this.checked) this.checked = true;
|
|
108
|
-
}
|
|
109
|
-
get #radioSiblings() {
|
|
110
|
-
const siblings = this.parentElement?.querySelectorAll(`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`);
|
|
111
|
-
if (siblings) return Array.from(siblings);
|
|
112
|
-
return [];
|
|
113
|
-
}
|
|
114
|
-
get #radioGroup() {
|
|
115
|
-
return this.closest(`${this.tagName.toLocaleLowerCase()}-group[name="${this.name}"]`);
|
|
116
|
-
}
|
|
117
|
-
#validateValueMissingWithSiblings;
|
|
118
|
-
#syncSiblingsRequiredValidationStatus;
|
|
119
|
-
/** @internal */
|
|
120
|
-
validate(anchor) {
|
|
121
|
-
super.validate(anchor);
|
|
122
|
-
if (this.proxy) {
|
|
123
|
-
this.errorValidationMessage = this.validationMessage || "";
|
|
124
|
-
if (this.validity.valueMissing) this.#validateValueMissingWithSiblings();
|
|
125
|
-
else this.#syncSiblingsRequiredValidationStatus();
|
|
126
|
-
}
|
|
15
|
+
var Progress = class extends DelegatesAria(BaseProgress) {
|
|
16
|
+
constructor(..._args) {
|
|
17
|
+
super(..._args);
|
|
18
|
+
this.reverse = false;
|
|
127
19
|
}
|
|
128
20
|
};
|
|
129
|
-
__decorate([attr],
|
|
130
|
-
__decorate([attr(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
21
|
+
__decorate([attr()], Progress.prototype, "shape", void 0);
|
|
22
|
+
__decorate([attr()], Progress.prototype, "connotation", void 0);
|
|
23
|
+
__decorate([attr({ mode: "boolean" })], Progress.prototype, "reverse", void 0);
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/lib/progress/progress.template.ts
|
|
26
|
+
function determinate() {
|
|
27
|
+
return html` <span
|
|
28
|
+
class="determinate"
|
|
29
|
+
style="width: ${(x) => x.percentComplete}%"
|
|
30
|
+
></span>`;
|
|
31
|
+
}
|
|
32
|
+
function indeterminate() {
|
|
33
|
+
return html` <span class="indeterminate" name="indeterminate">
|
|
34
|
+
<span class="indicator-1"></span>
|
|
35
|
+
<span class="indicator-2"></span>
|
|
36
|
+
</span>`;
|
|
37
|
+
}
|
|
135
38
|
//#endregion
|
|
136
|
-
//#region src/lib/
|
|
39
|
+
//#region src/lib/progress/definition.ts
|
|
137
40
|
/** @internal */
|
|
138
|
-
var
|
|
139
|
-
aria-checked="${(x) => x?.checked}"
|
|
140
|
-
aria-disabled="${(x) => x?.disabled}"
|
|
141
|
-
aria-required="${(x) => x?.required}"
|
|
142
|
-
@keypress="${(x, c) => x?.keypressHandler(c.event)}"
|
|
143
|
-
@click="${(x, c) => x?.clickHandler(c.event)}"
|
|
144
|
-
role="radio"
|
|
145
|
-
>
|
|
41
|
+
var progressDefinition = defineVividComponent("progress", Progress, html`<template>
|
|
146
42
|
<div
|
|
147
|
-
class="${(x) => classNames("base", [`connotation-${x.connotation}`, Boolean(x.connotation)], [
|
|
43
|
+
class="${(x) => classNames("base", [`connotation-${x.connotation}`, Boolean(x.connotation)], [`shape-${x.shape}`, Boolean(x.shape)], ["reverse", x.reverse], ["paused", x.paused])}"
|
|
44
|
+
${delegateAria({
|
|
45
|
+
role: "progressbar",
|
|
46
|
+
ariaValueNow: (x) => x.value,
|
|
47
|
+
ariaValueMin: (x) => x.min,
|
|
48
|
+
ariaValueMax: (x) => x.max
|
|
49
|
+
})}
|
|
148
50
|
>
|
|
149
|
-
<div class="
|
|
150
|
-
|
|
51
|
+
<div class="progress">
|
|
52
|
+
${when((x) => typeof x.value === "number", determinate())}
|
|
53
|
+
${when((x) => typeof x.value !== "number", indeterminate())}
|
|
54
|
+
</div>
|
|
151
55
|
</div>
|
|
152
|
-
</template>`, [], { styles:
|
|
56
|
+
</template>`, [], { styles: progress_default });
|
|
153
57
|
/**
|
|
154
|
-
* Registers the
|
|
58
|
+
* Registers the progress elements with the design system.
|
|
155
59
|
*
|
|
156
60
|
* @param prefix - the prefix to use for the component name
|
|
157
61
|
*/
|
|
158
|
-
var
|
|
62
|
+
var registerProgress = createRegisterFunction(progressDefinition);
|
|
159
63
|
//#endregion
|
|
160
|
-
export {
|
|
64
|
+
export { registerProgress as n, Progress as r, progressDefinition as t };
|
|
@@ -1,279 +1,181 @@
|
|
|
1
1
|
require("./chunk.cjs");
|
|
2
2
|
const require_vivid_element = require("./vivid-element.cjs");
|
|
3
3
|
const require_decorate = require("./decorate.cjs");
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const require_definition = require("./definition58.cjs");
|
|
4
|
+
const require_form_associated = require("./form-associated.cjs");
|
|
5
|
+
const require_form_element = require("./form-element.cjs");
|
|
6
|
+
const require_with_error_text = require("./with-error-text.cjs");
|
|
8
7
|
let _microsoft_fast_element = require("@microsoft/fast-element");
|
|
9
8
|
let _microsoft_fast_web_utilities = require("@microsoft/fast-web-utilities");
|
|
10
|
-
//#region src/lib/radio
|
|
11
|
-
var
|
|
9
|
+
//#region src/lib/radio/radio.scss?inline
|
|
10
|
+
var radio_default = ":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)}@media (hover:hover){.base: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.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:checked:where(:not(.disabled,:disabled)),.base.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)}@media (hover:hover){.base:checked: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.checked.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:disabled,.base.disabled{--_appearance-color-text:var(--vvd-color-neutral-600);--_appearance-color-fill:var(--vvd-color-neutral-100);--_appearance-color-outline:var(--vvd-color-neutral-300)}.base.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{cursor:pointer;user-select:none;align-items:center;gap:8px;display:inline-flex}.base.disabled{pointer-events:none}.control{block-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 20));box-shadow:inset 0 0 0 2px var(--_appearance-color-outline);inline-size:calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density,0), 2) - 20));border-radius:50%;flex-shrink:0;position:relative}.base:not(.checked) .control{background-color:var(--_appearance-color-fill)}.control:after{border-radius:inherit;background-color:var(--_appearance-color-outline);content:\"\";opacity:1;transition:opacity .2s;position:absolute;inset:5px}.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(--focus-stroke-color,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));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));display:block;position:absolute;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)}";
|
|
12
11
|
//#endregion
|
|
13
|
-
//#region src/lib/radio
|
|
12
|
+
//#region src/lib/radio/radio.ts
|
|
14
13
|
/**
|
|
15
14
|
* @public
|
|
16
|
-
* @component radio-group
|
|
17
|
-
* @slot - Default slot.
|
|
18
|
-
* @slot helper-text - Describes how to use the text-field. Alternative to the `helper-text` attribute.
|
|
19
15
|
* @event {CustomEvent<undefined>} change - Fires a custom 'change' event when the value changes
|
|
20
|
-
* @
|
|
16
|
+
* @component radio
|
|
17
|
+
* @testAction check click #control
|
|
18
|
+
* @testQuery checked checked true
|
|
19
|
+
* @testQuery unchecked checked false
|
|
20
|
+
* @testRef control shadow .control
|
|
21
21
|
*/
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
this.slottedRadioButtons.forEach((radio) => {
|
|
36
|
-
if (radio !== changedRadio) radio.checked = false;
|
|
37
|
-
});
|
|
38
|
-
this.value = changedRadio.value;
|
|
39
|
-
this.#setTabRovingTarget(changedRadio);
|
|
22
|
+
var Radio = class extends require_with_error_text.WithErrorText(require_form_element.FormElement(require_form_associated.CheckableFormAssociated(require_vivid_element.VividElement))) {
|
|
23
|
+
/** @internal */
|
|
24
|
+
readOnlyChanged() {
|
|
25
|
+
/* v8 ignore if -- @preserve */
|
|
26
|
+
if (this.proxy instanceof HTMLInputElement) this.proxy.readOnly = this.readOnly;
|
|
27
|
+
}
|
|
28
|
+
/** @internal */
|
|
29
|
+
defaultCheckedChanged() {
|
|
30
|
+
if (this.$fastController.isConnected && !this.dirtyChecked) {
|
|
31
|
+
/* v8 ignore else -- @preserve */
|
|
32
|
+
if (!this.isInsideRadioGroup()) {
|
|
33
|
+
this.checked = this.defaultChecked;
|
|
34
|
+
this.dirtyChecked = false;
|
|
40
35
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
this.moveLeftOffGroup = () => {
|
|
53
|
-
const prev = this.previousElementSibling;
|
|
54
|
-
if (prev instanceof HTMLElement) prev.focus();
|
|
55
|
-
};
|
|
56
|
-
this.moveRight = (e) => {
|
|
57
|
-
const radio = e.target;
|
|
58
|
-
const group = this.#focusableRadioButtons;
|
|
59
|
-
let index = group.indexOf(radio) + 1;
|
|
60
|
-
if (index === group.length && this.isInsideToolbar && e.key === "ArrowRight") {
|
|
61
|
-
this.moveRightOffGroup();
|
|
62
|
-
return;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
constructor() {
|
|
39
|
+
super();
|
|
40
|
+
this.initialValue = "on";
|
|
41
|
+
this.defaultSlottedNodes = [];
|
|
42
|
+
this.keypressHandler = (e) => {
|
|
43
|
+
switch (e.key) {
|
|
44
|
+
case _microsoft_fast_web_utilities.keySpace:
|
|
45
|
+
if (!this.checked && !this.readOnly) this.checked = true;
|
|
46
|
+
return;
|
|
63
47
|
}
|
|
64
|
-
|
|
65
|
-
this.moveToRadioByIndex(group, index);
|
|
48
|
+
return true;
|
|
66
49
|
};
|
|
67
|
-
this.
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
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
|
+
if (siblings.some((x) => x.checked)) {
|
|
56
|
+
this.setValidity({ valueMissing: false });
|
|
57
|
+
this.errorValidationMessage = "";
|
|
58
|
+
if (group) group.errorValidationMessage = "";
|
|
59
|
+
}
|
|
74
60
|
}
|
|
75
|
-
index = index < 0 ? group.length - 1 : index;
|
|
76
|
-
this.moveToRadioByIndex(group, index);
|
|
77
61
|
};
|
|
78
|
-
this
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
case require_key_codes.keyArrowLeft:
|
|
88
|
-
case _microsoft_fast_web_utilities.keyArrowUp:
|
|
89
|
-
this.moveLeft(e);
|
|
90
|
-
return;
|
|
91
|
-
default: return true;
|
|
62
|
+
this.#syncSiblingsRequiredValidationStatus = () => {
|
|
63
|
+
if (this.elementInternals && !this.validity.valueMissing) {
|
|
64
|
+
const siblings = this.#radioSiblings;
|
|
65
|
+
const group = this.#radioGroup;
|
|
66
|
+
if (siblings && siblings.length > 1) siblings.forEach((x) => {
|
|
67
|
+
x.elementInternals.setValidity({ valueMissing: false });
|
|
68
|
+
x.errorValidationMessage = "";
|
|
69
|
+
if (group) group.errorValidationMessage = "";
|
|
70
|
+
});
|
|
92
71
|
}
|
|
93
72
|
};
|
|
73
|
+
this.proxy.setAttribute("type", "radio");
|
|
74
|
+
this.proxy.setAttribute("name", this.name);
|
|
75
|
+
this.checked = this.defaultChecked;
|
|
76
|
+
this.dirtyChecked = false;
|
|
94
77
|
}
|
|
95
78
|
/** @internal */
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
/** @internal */
|
|
103
|
-
readOnlyChanged() {
|
|
104
|
-
this.slottedRadioButtons.forEach((radio) => {
|
|
105
|
-
if (this.readOnly) radio.readOnly = true;
|
|
106
|
-
else radio.readOnly = false;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
/** @internal */
|
|
110
|
-
disabledChanged() {
|
|
111
|
-
this.slottedRadioButtons.forEach((radio) => {
|
|
112
|
-
if (this.disabled) radio.disabled = true;
|
|
113
|
-
else radio.disabled = false;
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
nameChanged() {
|
|
117
|
-
this.slottedRadioButtons.forEach((radio) => {
|
|
118
|
-
radio.setAttribute("name", this.name);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
/** @internal */
|
|
122
|
-
valueChanged() {
|
|
123
|
-
this.slottedRadioButtons.forEach((radio) => {
|
|
124
|
-
if (radio.value === this.value) radio.checked = true;
|
|
125
|
-
});
|
|
126
|
-
this.$emit("change");
|
|
127
|
-
}
|
|
128
|
-
/** @internal */
|
|
129
|
-
handleSlotChange() {
|
|
130
|
-
if (this.errorText) this.slottedRadioButtons.forEach((radio) => {
|
|
131
|
-
radio.errorText = this.errorText;
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
/** @internal */
|
|
135
|
-
errorTextChanged(_, newErrorText) {
|
|
136
|
-
if (newErrorText) this.errorValidationMessage = newErrorText;
|
|
137
|
-
else this.errorValidationMessage = "";
|
|
138
|
-
}
|
|
139
|
-
get #focusableRadioButtons() {
|
|
140
|
-
return this.slottedRadioButtons.filter((radio) => !radio.disabled);
|
|
141
|
-
}
|
|
142
|
-
/** @internal */
|
|
143
|
-
slottedRadioButtonsChanged() {
|
|
144
|
-
if (this.slottedRadioButtons.length > 0) this.setupRadioButtons();
|
|
145
|
-
}
|
|
146
|
-
get isInsideToolbar() {
|
|
147
|
-
return !!this.closest("[role=\"toolbar\"]");
|
|
79
|
+
nameChanged(previous, next) {
|
|
80
|
+
super.nameChanged(previous, next);
|
|
81
|
+
if (next !== null) this.proxy.setAttribute("name", this.name);
|
|
82
|
+
else this.proxy.removeAttribute("name");
|
|
83
|
+
_microsoft_fast_element.Updates.enqueue(this.validate);
|
|
148
84
|
}
|
|
149
85
|
/** @internal */
|
|
150
86
|
connectedCallback() {
|
|
151
87
|
super.connectedCallback();
|
|
152
|
-
this.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
radio.removeEventListener("change", this.radioChangeHandler);
|
|
157
|
-
radio.removeEventListener("invalid", this.radioErrorHandler);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
setupRadioButtons() {
|
|
161
|
-
let foundMatchingVal = false;
|
|
162
|
-
for (const radio of this.slottedRadioButtons) {
|
|
163
|
-
if (this.name !== void 0) radio.setAttribute("name", this.name);
|
|
164
|
-
if (this.disabled) radio.disabled = true;
|
|
165
|
-
if (this.readOnly) radio.readOnly = true;
|
|
166
|
-
if (this.required) radio.required = true;
|
|
167
|
-
if (this.value && this.value === radio.value) {
|
|
168
|
-
radio.checked = true;
|
|
169
|
-
this.#setTabRovingTarget(radio);
|
|
170
|
-
foundMatchingVal = true;
|
|
171
|
-
} else radio.checked = false;
|
|
172
|
-
radio.addEventListener("change", this.radioChangeHandler);
|
|
173
|
-
radio.addEventListener("invalid", this.radioErrorHandler);
|
|
88
|
+
_microsoft_fast_element.Updates.enqueue(this.validate);
|
|
89
|
+
if (this.parentElement.getAttribute("data-vvd-component") !== "radio-group" && this.getAttribute("tabindex") === null) {
|
|
90
|
+
/* v8 ignore else -- @preserve */
|
|
91
|
+
if (!this.disabled) this.setAttribute("tabindex", "0");
|
|
174
92
|
}
|
|
175
|
-
if (this.
|
|
176
|
-
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
93
|
+
if (this.defaultChecked) {
|
|
94
|
+
/* v8 ignore else -- @preserve */
|
|
95
|
+
if (!this.dirtyChecked) {
|
|
96
|
+
if (!this.isInsideRadioGroup()) {
|
|
97
|
+
this.checked = this.defaultChecked;
|
|
98
|
+
this.dirtyChecked = false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
182
101
|
}
|
|
183
102
|
}
|
|
103
|
+
isInsideRadioGroup() {
|
|
104
|
+
return this.closest("[data-vvd-component=\"radio-group\"]") !== null;
|
|
105
|
+
}
|
|
184
106
|
/** @internal */
|
|
185
|
-
|
|
186
|
-
this
|
|
107
|
+
clickHandler(_) {
|
|
108
|
+
if (!this.disabled && !this.readOnly && !this.checked) this.checked = true;
|
|
187
109
|
}
|
|
188
|
-
#
|
|
189
|
-
|
|
190
|
-
|
|
110
|
+
get #radioSiblings() {
|
|
111
|
+
const siblings = this.parentElement?.querySelectorAll(`${this.tagName.toLocaleLowerCase()}[name="${this.name}"]`);
|
|
112
|
+
if (siblings) return Array.from(siblings);
|
|
113
|
+
return [];
|
|
191
114
|
}
|
|
192
|
-
|
|
193
|
-
|
|
115
|
+
get #radioGroup() {
|
|
116
|
+
return this.closest(`${this.tagName.toLocaleLowerCase()}-group[name="${this.name}"]`);
|
|
117
|
+
}
|
|
118
|
+
#validateValueMissingWithSiblings;
|
|
119
|
+
#syncSiblingsRequiredValidationStatus;
|
|
120
|
+
/** @internal */
|
|
121
|
+
validate(anchor) {
|
|
122
|
+
super.validate(anchor);
|
|
123
|
+
if (this.proxy) {
|
|
124
|
+
this.errorValidationMessage = this.validationMessage || "";
|
|
125
|
+
if (this.validity.valueMissing) this.#validateValueMissingWithSiblings();
|
|
126
|
+
else this.#syncSiblingsRequiredValidationStatus();
|
|
127
|
+
}
|
|
194
128
|
}
|
|
195
129
|
};
|
|
196
|
-
require_decorate.__decorate([_microsoft_fast_element.attr],
|
|
197
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
198
|
-
attribute: "required",
|
|
199
|
-
mode: "boolean"
|
|
200
|
-
})], RadioGroup.prototype, "required", void 0);
|
|
130
|
+
require_decorate.__decorate([_microsoft_fast_element.attr], Radio.prototype, "connotation", void 0);
|
|
201
131
|
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({
|
|
202
132
|
attribute: "readonly",
|
|
203
133
|
mode: "boolean"
|
|
204
|
-
})],
|
|
205
|
-
require_decorate.__decorate([
|
|
206
|
-
attribute: "disabled",
|
|
207
|
-
mode: "boolean"
|
|
208
|
-
})], RadioGroup.prototype, "disabled", void 0);
|
|
209
|
-
require_decorate.__decorate([_microsoft_fast_element.attr], RadioGroup.prototype, "name", void 0);
|
|
210
|
-
require_decorate.__decorate([_microsoft_fast_element.attr], RadioGroup.prototype, "value", void 0);
|
|
211
|
-
require_decorate.__decorate([_microsoft_fast_element.observable], RadioGroup.prototype, "errorValidationMessage", void 0);
|
|
212
|
-
require_decorate.__decorate([(0, _microsoft_fast_element.attr)({ attribute: "error-text" })], RadioGroup.prototype, "errorText", void 0);
|
|
213
|
-
require_decorate.__decorate([_microsoft_fast_element.attr], RadioGroup.prototype, "orientation", void 0);
|
|
214
|
-
require_decorate.__decorate([_microsoft_fast_element.observable], RadioGroup.prototype, "slottedRadioButtons", void 0);
|
|
134
|
+
})], Radio.prototype, "readOnly", void 0);
|
|
135
|
+
require_decorate.__decorate([_microsoft_fast_element.observable], Radio.prototype, "defaultSlottedNodes", void 0);
|
|
215
136
|
//#endregion
|
|
216
|
-
//#region src/lib/radio
|
|
217
|
-
var
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
ariaLabelledBy: "label",
|
|
233
|
-
ariaDescribedBy: (x) => x._feedbackDescribedBy
|
|
234
|
-
})}
|
|
235
|
-
class="control positioning-region ${(x) => x.orientation === _microsoft_fast_web_utilities.Orientation.horizontal ? "horizontal" : "vertical"}"
|
|
236
|
-
>
|
|
237
|
-
${(0, _microsoft_fast_element.when)((x) => x.label, _microsoft_fast_element.html`<legend id="label">${(x) => x.label}</legend>`)}
|
|
238
|
-
<slot
|
|
239
|
-
${(0, _microsoft_fast_element.slotted)({
|
|
240
|
-
property: "slottedRadioButtons",
|
|
241
|
-
filter: (0, _microsoft_fast_element.elements)(radioTagName)
|
|
242
|
-
})}
|
|
243
|
-
@slotchange="${(x) => x.handleSlotChange()}"
|
|
244
|
-
></slot>
|
|
245
|
-
</fieldset>
|
|
246
|
-
${(x) => x._getFeedbackTemplate(context)}
|
|
247
|
-
</div>
|
|
248
|
-
</template>
|
|
249
|
-
`;
|
|
250
|
-
};
|
|
137
|
+
//#region src/lib/radio/radio.template.ts
|
|
138
|
+
var RadioTemplate = _microsoft_fast_element.html`<template
|
|
139
|
+
aria-checked="${(x) => x?.checked}"
|
|
140
|
+
aria-disabled="${(x) => x?.disabled}"
|
|
141
|
+
aria-required="${(x) => x?.required}"
|
|
142
|
+
@keypress="${(x, c) => x?.keypressHandler(c.event)}"
|
|
143
|
+
@click="${(x, c) => x?.clickHandler(c.event)}"
|
|
144
|
+
role="radio"
|
|
145
|
+
>
|
|
146
|
+
<div
|
|
147
|
+
class="${(x) => (0, _microsoft_fast_web_utilities.classNames)("base", [`connotation-${x.connotation}`, Boolean(x.connotation)], ["checked", x.checked], ["readonly", x.readOnly], ["disabled", x.disabled])}"
|
|
148
|
+
>
|
|
149
|
+
<div class="control"></div>
|
|
150
|
+
${(0, _microsoft_fast_element.when)((x) => x?.label, _microsoft_fast_element.html`<label class="label">${(x) => x?.label}</label>`)}
|
|
151
|
+
</div>
|
|
152
|
+
</template>`;
|
|
251
153
|
//#endregion
|
|
252
|
-
//#region src/lib/radio
|
|
154
|
+
//#region src/lib/radio/definition.ts
|
|
253
155
|
/** @internal */
|
|
254
|
-
var
|
|
156
|
+
var radioDefinition = require_vivid_element.defineVividComponent("radio", Radio, RadioTemplate, [], { styles: radio_default });
|
|
255
157
|
/**
|
|
256
|
-
* Registers the radio
|
|
158
|
+
* Registers the radio elements with the design system.
|
|
257
159
|
*
|
|
258
160
|
* @param prefix - the prefix to use for the component name
|
|
259
161
|
*/
|
|
260
|
-
var
|
|
162
|
+
var registerRadio = require_vivid_element.createRegisterFunction(radioDefinition);
|
|
261
163
|
//#endregion
|
|
262
|
-
Object.defineProperty(exports, "
|
|
164
|
+
Object.defineProperty(exports, "Radio", {
|
|
263
165
|
enumerable: true,
|
|
264
166
|
get: function() {
|
|
265
|
-
return
|
|
167
|
+
return Radio;
|
|
266
168
|
}
|
|
267
169
|
});
|
|
268
|
-
Object.defineProperty(exports, "
|
|
170
|
+
Object.defineProperty(exports, "radioDefinition", {
|
|
269
171
|
enumerable: true,
|
|
270
172
|
get: function() {
|
|
271
|
-
return
|
|
173
|
+
return radioDefinition;
|
|
272
174
|
}
|
|
273
175
|
});
|
|
274
|
-
Object.defineProperty(exports, "
|
|
176
|
+
Object.defineProperty(exports, "registerRadio", {
|
|
275
177
|
enumerable: true,
|
|
276
178
|
get: function() {
|
|
277
|
-
return
|
|
179
|
+
return registerRadio;
|
|
278
180
|
}
|
|
279
181
|
});
|