@vonage/vivid 3.51.0 → 3.52.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/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +2 -1
- package/audio-player/index.js +2 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/combobox/index.cjs +2 -5
- package/combobox/index.js +2 -5
- package/custom-elements.json +1357 -529
- package/date-picker/index.cjs +3 -6
- package/date-picker/index.js +3 -6
- package/date-range-picker/index.cjs +2 -5
- package/date-range-picker/index.js +2 -5
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/file-picker/index.cjs +0 -2
- package/file-picker/index.js +0 -2
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/index.cjs +60 -58
- package/index.js +22 -23
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/listbox/index.cjs +23 -22
- package/listbox/index.js +23 -22
- package/locales/en-GB.cjs +4 -0
- package/locales/en-GB.js +4 -0
- package/locales/en-US.cjs +4 -0
- package/locales/en-US.js +4 -0
- package/locales/ja-JP.cjs +5 -1
- package/locales/ja-JP.js +5 -1
- package/locales/zh-CN.cjs +4 -0
- package/locales/zh-CN.js +4 -0
- package/menu/index.cjs +3 -3
- package/menu/index.js +3 -3
- package/menu-item/index.cjs +2 -2
- package/menu-item/index.js +2 -2
- package/number-field/index.cjs +0 -2
- package/number-field/index.js +0 -2
- package/package.json +34 -34
- package/popup/index.cjs +2 -2
- package/popup/index.js +2 -2
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +3 -3
- package/select/index.js +3 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/definition.cjs +8 -3
- package/shared/definition.js +8 -3
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +75 -47
- package/shared/definition11.js +76 -48
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +33 -32
- package/shared/definition14.js +33 -32
- package/shared/definition15.cjs +20 -7
- package/shared/definition15.js +20 -7
- package/shared/definition16.cjs +37 -42
- package/shared/definition16.js +36 -41
- package/shared/definition17.cjs +125 -65
- package/shared/definition17.js +126 -66
- package/shared/definition18.cjs +30 -14
- package/shared/definition18.js +30 -14
- package/shared/definition19.cjs +116 -80
- package/shared/definition19.js +116 -80
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +16 -15
- package/shared/definition20.js +16 -15
- package/shared/definition21.cjs +6 -10
- package/shared/definition21.js +6 -10
- package/shared/definition22.cjs +14 -18
- package/shared/definition22.js +14 -18
- package/shared/definition23.cjs +34 -35
- package/shared/definition23.js +34 -35
- package/shared/definition24.cjs +116 -69
- package/shared/definition24.js +116 -69
- package/shared/definition25.cjs +2 -4
- package/shared/definition25.js +2 -4
- package/shared/definition26.cjs +9 -8
- package/shared/definition26.js +9 -8
- package/shared/definition27.cjs +7 -5
- package/shared/definition27.js +7 -5
- package/shared/definition28.cjs +209 -143
- package/shared/definition28.js +209 -143
- package/shared/definition29.cjs +10 -4
- package/shared/definition29.js +10 -4
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +7 -5
- package/shared/definition30.js +7 -5
- package/shared/definition31.cjs +2 -4
- package/shared/definition31.js +2 -4
- package/shared/definition32.cjs +1 -3
- package/shared/definition32.js +1 -3
- package/shared/definition33.cjs +7 -10
- package/shared/definition33.js +7 -10
- package/shared/definition34.cjs +76 -59
- package/shared/definition34.js +76 -59
- package/shared/definition35.cjs +19 -20
- package/shared/definition35.js +19 -20
- package/shared/definition36.cjs +30 -14
- package/shared/definition36.js +30 -14
- package/shared/definition37.cjs +33 -46
- package/shared/definition37.js +33 -46
- package/shared/definition38.cjs +31 -33
- package/shared/definition38.js +31 -33
- package/shared/definition39.cjs +13 -4
- package/shared/definition39.js +13 -4
- package/shared/definition4.cjs +23 -11
- package/shared/definition4.js +23 -11
- package/shared/definition40.cjs +19 -14
- package/shared/definition40.js +19 -14
- package/shared/definition41.cjs +534 -635
- package/shared/definition41.js +534 -635
- package/shared/definition42.cjs +674 -106
- package/shared/definition42.js +673 -105
- package/shared/definition43.cjs +122 -79
- package/shared/definition43.js +120 -77
- package/shared/definition44.cjs +72 -567
- package/shared/definition44.js +71 -565
- package/shared/definition45.cjs +520 -118
- package/shared/definition45.js +518 -117
- package/shared/definition46.cjs +117 -130
- package/shared/definition46.js +116 -129
- package/shared/definition47.cjs +152 -18
- package/shared/definition47.js +151 -17
- package/shared/definition48.cjs +20 -77
- package/shared/definition48.js +19 -76
- package/shared/definition49.cjs +52 -495
- package/shared/definition49.js +51 -494
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +525 -24
- package/shared/definition50.js +524 -23
- package/shared/definition51.cjs +28 -119
- package/shared/definition51.js +26 -118
- package/shared/definition52.cjs +113 -266
- package/shared/definition52.js +113 -265
- package/shared/definition53.cjs +285 -245
- package/shared/definition53.js +285 -245
- package/shared/definition54.cjs +285 -751
- package/shared/definition54.js +284 -750
- package/shared/definition55.cjs +828 -99
- package/shared/definition55.js +827 -98
- package/shared/definition56.cjs +126 -77
- package/shared/definition56.js +125 -76
- package/shared/definition57.cjs +125 -71
- package/shared/definition57.js +124 -70
- package/shared/definition58.cjs +73 -287
- package/shared/definition58.js +74 -288
- package/shared/definition59.cjs +298 -40
- package/shared/definition59.js +297 -39
- package/shared/definition6.cjs +3 -4
- package/shared/definition6.js +3 -4
- package/shared/definition60.cjs +24 -1784
- package/shared/definition60.js +23 -1783
- package/shared/definition61.cjs +1819 -11
- package/shared/definition61.js +1818 -11
- package/shared/definition7.cjs +6 -4
- package/shared/definition7.js +6 -4
- package/shared/definition8.cjs +25 -18
- package/shared/definition8.js +25 -18
- package/shared/definition9.cjs +6 -9
- package/shared/definition9.js +6 -9
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +1 -1
- package/shared/index2.js +1 -1
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +126 -78
- package/shared/presentationDate.js +126 -78
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.template.cjs +30 -35
- package/shared/text-anchor.template.js +30 -35
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -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/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- 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 +3 -3
- package/tabs/index.js +3 -3
- 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 -4
- package/text-field/index.js +1 -4
- package/time-picker/index.cjs +4 -7
- package/time-picker/index.js +4 -7
- package/toggletip/index.cjs +3 -3
- package/toggletip/index.js +3 -3
- package/tooltip/index.cjs +3 -3
- package/tooltip/index.js +3 -3
- 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/vivid.api.json +117 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
package/shared/definition47.cjs
CHANGED
|
@@ -1,35 +1,169 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition26.cjs');
|
|
5
|
+
const formAssociated = require('./form-associated.cjs');
|
|
6
|
+
const keyCodes = require('./key-codes.cjs');
|
|
7
|
+
const when = require('./when.cjs');
|
|
8
|
+
const classNames = require('./class-names.cjs');
|
|
9
|
+
|
|
10
|
+
class _Switch extends index.FoundationElement {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Switch:class)} component.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
class FormAssociatedSwitch extends formAssociated.CheckableFormAssociated(_Switch) {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments);
|
|
20
|
+
this.proxy = document.createElement("input");
|
|
21
|
+
}
|
|
22
|
+
}
|
|
4
23
|
|
|
5
24
|
/**
|
|
6
|
-
* A
|
|
25
|
+
* A Switch Custom HTML Element.
|
|
26
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#switch | ARIA switch }.
|
|
7
27
|
*
|
|
8
|
-
* @slot - The
|
|
28
|
+
* @slot - The deafult slot for the label
|
|
29
|
+
* @slot checked-message - The message when in a checked state
|
|
30
|
+
* @slot unchecked-message - The message when in an unchecked state
|
|
31
|
+
* @csspart label - The label
|
|
32
|
+
* @csspart switch - The element representing the switch, which wraps the indicator
|
|
33
|
+
* @csspart status-message - The wrapper for the status messages
|
|
34
|
+
* @csspart checked-message - The checked message
|
|
35
|
+
* @csspart unchecked-message - The unchecked message
|
|
36
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
9
37
|
*
|
|
10
38
|
* @public
|
|
11
39
|
*/
|
|
12
|
-
let
|
|
40
|
+
let Switch$1 = class Switch extends FormAssociatedSwitch {
|
|
41
|
+
constructor() {
|
|
42
|
+
super();
|
|
43
|
+
/**
|
|
44
|
+
* The element's value to be included in form submission when checked.
|
|
45
|
+
* Default to "on" to reach parity with input[type="checkbox"]
|
|
46
|
+
*
|
|
47
|
+
* @internal
|
|
48
|
+
*/
|
|
49
|
+
this.initialValue = "on";
|
|
50
|
+
/**
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
this.keypressHandler = (e) => {
|
|
54
|
+
if (this.readOnly) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
switch (e.key) {
|
|
58
|
+
case keyCodes.keyEnter:
|
|
59
|
+
case keyCodes.keySpace:
|
|
60
|
+
this.checked = !this.checked;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* @internal
|
|
66
|
+
*/
|
|
67
|
+
this.clickHandler = (e) => {
|
|
68
|
+
if (!this.disabled && !this.readOnly) {
|
|
69
|
+
this.checked = !this.checked;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
this.proxy.setAttribute("type", "checkbox");
|
|
73
|
+
}
|
|
74
|
+
readOnlyChanged() {
|
|
75
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
76
|
+
this.proxy.readOnly = this.readOnly;
|
|
77
|
+
}
|
|
78
|
+
this.readOnly
|
|
79
|
+
? this.classList.add("readonly")
|
|
80
|
+
: this.classList.remove("readonly");
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
checkedChanged(prev, next) {
|
|
86
|
+
super.checkedChanged(prev, next);
|
|
87
|
+
/**
|
|
88
|
+
* @deprecated - this behavior already exists in the template and should not exist in the class.
|
|
89
|
+
*/
|
|
90
|
+
this.checked ? this.classList.add("checked") : this.classList.remove("checked");
|
|
91
|
+
}
|
|
13
92
|
};
|
|
93
|
+
index.__decorate([
|
|
94
|
+
index.attr({ attribute: "readonly", mode: "boolean" })
|
|
95
|
+
], Switch$1.prototype, "readOnly", void 0);
|
|
96
|
+
index.__decorate([
|
|
97
|
+
index.observable
|
|
98
|
+
], Switch$1.prototype, "defaultSlottedNodes", void 0);
|
|
99
|
+
|
|
100
|
+
const styles = ":host(.disabled){cursor:not-allowed}.control{display:inline-flex;border-radius:14px;gap:8px;--focus-inset: -4px;--focus-stroke-gap-color: transparent}.control.connotation-cta{--_connotation-color-primary-text: var(--vvd-switch-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-increment: var(--vvd-switch-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-switch-cta-firm, var(--vvd-color-cta-600));--_connotation-color-intermediate: var(--vvd-switch-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-fierce: var(--vvd-switch-cta-fierce, var(--vvd-color-cta-700))}.control.connotation-alert{--_connotation-color-primary-text: var(--vvd-switch-alert-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-alert-primary, var(--vvd-color-alert-500));--_connotation-color-primary-increment: var(--vvd-switch-alert-primary-increment, var(--vvd-color-alert-600));--_connotation-color-firm: var(--vvd-switch-alert-firm, var(--vvd-color-alert-600));--_connotation-color-intermediate: var(--vvd-switch-alert-intermediate, var(--vvd-color-alert-500));--_connotation-color-fierce: var(--vvd-switch-alert-fierce, var(--vvd-color-alert-700))}.control.connotation-success{--_connotation-color-primary-text: var(--vvd-switch-success-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-success-primary, var(--vvd-color-success-500));--_connotation-color-primary-increment: var(--vvd-switch-success-primary-increment, var(--vvd-color-success-600));--_connotation-color-firm: var(--vvd-switch-success-firm, var(--vvd-color-success-600));--_connotation-color-intermediate: var(--vvd-switch-success-intermediate, var(--vvd-color-success-500));--_connotation-color-fierce: var(--vvd-switch-success-fierce, var(--vvd-color-success-700))}.control:not(.connotation-cta,.connotation-alert,.connotation-success){--_connotation-color-primary-text: var(--vvd-switch-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-increment: var(--vvd-switch-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-switch-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-intermediate: var(--vvd-switch-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-fierce: var(--vvd-switch-accent-fierce, var(--vvd-color-neutral-700))}.control{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.control.appearance-filled{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-filled{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}.control: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)}.control:where(.disabled,:disabled).appearance-filled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: transparent}.control: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)}.control:where(.readonly):where(:not(.disabled,:disabled)).appearance-filled{--_appearance-color-text: var(--vvd-color-neutral-800);--_appearance-color-fill: var(--vvd-color-neutral-500);--_appearance-color-outline: transparent}.control:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}@supports (user-select: none){.control{user-select:none}}.control:not(.disabled){cursor:pointer}.control.disabled{pointer-events:none}.switch{--_switch-inline-size:calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*1.8);display:flex;box-sizing:border-box;align-items:center;border-radius:40px;background-color:var(--_appearance-color-fill);block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);inline-size:var(--_switch-inline-size);transition:all .2s ease-in-out 0s}.checked-indicator{--_switch-checked-indicator-size: calc(calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) / 1.6667 );--_switch-gutter: calc(var(--_switch-checked-indicator-size) / 3);border-radius:inherit;block-size:var(--_switch-checked-indicator-size);inline-size:var(--_switch-checked-indicator-size);margin-inline-start:auto;transition:all .2s ease-in-out 0s}.control:not(.appearance-filled) .checked-indicator{background-color:var(--_appearance-color-outline)}.control:not(.appearance-filled):where(.readonly) .checked-indicator{background-color:var(--vvd-color-neutral-600)}.control.appearance-filled .checked-indicator{background-color:var(--vvd-color-neutral-100)}.control:not(.checked) .checked-indicator{transform:translate(calc(-1 * var(--_switch-inline-size) + var(--_switch-checked-indicator-size) + var(--_switch-gutter)))}.control.checked .checked-indicator{transform:translate(calc(-1 * var(--_switch-gutter)))}.control.appearance-filled.disabled .checked-indicator{background-color:var(--_appearance-color-text)}.control.appearance-filled.readonly .checked-indicator{background-color:var(--vvd-color-neutral-50)}.label{color:var(--vvd-color-canvas-text);cursor:pointer;font:var(--vvd-typography-base)}\n";
|
|
14
101
|
|
|
15
|
-
|
|
102
|
+
var __defProp = Object.defineProperty;
|
|
103
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
104
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
105
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
106
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
107
|
+
if (decorator = decorators[i])
|
|
108
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
109
|
+
if (kind && result)
|
|
110
|
+
__defProp(target, key, result);
|
|
111
|
+
return result;
|
|
112
|
+
};
|
|
113
|
+
class Switch extends Switch$1 {
|
|
16
114
|
}
|
|
115
|
+
__decorateClass([
|
|
116
|
+
index.attr
|
|
117
|
+
], Switch.prototype, "label", 2);
|
|
118
|
+
__decorateClass([
|
|
119
|
+
index.attr
|
|
120
|
+
], Switch.prototype, "connotation", 2);
|
|
17
121
|
|
|
18
|
-
|
|
122
|
+
const getClasses = (_) => classNames.classNames(
|
|
123
|
+
"control",
|
|
124
|
+
["appearance-filled", _.checked],
|
|
125
|
+
["checked", _.checked],
|
|
126
|
+
["disabled", _.disabled],
|
|
127
|
+
["readonly", _.readOnly],
|
|
128
|
+
[
|
|
129
|
+
`connotation-${_.connotation}`,
|
|
130
|
+
Boolean(_.checked) && Boolean(_.connotation)
|
|
131
|
+
]
|
|
132
|
+
);
|
|
133
|
+
const SwitchTemplate = () => {
|
|
19
134
|
return index.html`
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
135
|
+
<div
|
|
136
|
+
class="${getClasses}"
|
|
137
|
+
role="switch"
|
|
138
|
+
aria-checked="${(x) => x.checked}"
|
|
139
|
+
aria-disabled="${(x) => x.disabled}"
|
|
140
|
+
aria-readonly="${(x) => x.readOnly}"
|
|
141
|
+
tabindex="${(x) => x.disabled ? null : 0}"
|
|
142
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
143
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
144
|
+
>
|
|
145
|
+
<div class="switch">
|
|
146
|
+
<span class="checked-indicator"></span>
|
|
147
|
+
</div>
|
|
148
|
+
${when.when(
|
|
149
|
+
(x) => x.label,
|
|
150
|
+
index.html`<div class="label">${(x) => x.label}</div>`
|
|
151
|
+
)}
|
|
152
|
+
</div>
|
|
153
|
+
`;
|
|
154
|
+
};
|
|
25
155
|
|
|
26
|
-
const
|
|
27
|
-
baseName: "
|
|
28
|
-
template:
|
|
156
|
+
const switchDefinition = Switch.compose({
|
|
157
|
+
baseName: "switch",
|
|
158
|
+
template: SwitchTemplate,
|
|
159
|
+
styles,
|
|
160
|
+
shadowOptions: {
|
|
161
|
+
delegatesFocus: true
|
|
162
|
+
}
|
|
29
163
|
});
|
|
30
|
-
const
|
|
31
|
-
const
|
|
164
|
+
const switchRegistries = [switchDefinition(), ...definition.iconRegistries];
|
|
165
|
+
const registerSwitch = index.registerFactory(switchRegistries);
|
|
32
166
|
|
|
33
|
-
exports.
|
|
34
|
-
exports.
|
|
35
|
-
exports.
|
|
167
|
+
exports.registerSwitch = registerSwitch;
|
|
168
|
+
exports.switchDefinition = switchDefinition;
|
|
169
|
+
exports.switchRegistries = switchRegistries;
|
package/shared/definition47.js
CHANGED
|
@@ -1,31 +1,165 @@
|
|
|
1
|
-
import { F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition26.js';
|
|
3
|
+
import { C as CheckableFormAssociated } from './form-associated.js';
|
|
4
|
+
import { a as keySpace, k as keyEnter } from './key-codes.js';
|
|
5
|
+
import { w as when } from './when.js';
|
|
6
|
+
import { c as classNames } from './class-names.js';
|
|
7
|
+
|
|
8
|
+
class _Switch extends FoundationElement {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Switch:class)} component.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
class FormAssociatedSwitch extends CheckableFormAssociated(_Switch) {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.proxy = document.createElement("input");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
2
21
|
|
|
3
22
|
/**
|
|
4
|
-
* A
|
|
23
|
+
* A Switch Custom HTML Element.
|
|
24
|
+
* Implements the {@link https://www.w3.org/TR/wai-aria-1.1/#switch | ARIA switch }.
|
|
5
25
|
*
|
|
6
|
-
* @slot - The
|
|
26
|
+
* @slot - The deafult slot for the label
|
|
27
|
+
* @slot checked-message - The message when in a checked state
|
|
28
|
+
* @slot unchecked-message - The message when in an unchecked state
|
|
29
|
+
* @csspart label - The label
|
|
30
|
+
* @csspart switch - The element representing the switch, which wraps the indicator
|
|
31
|
+
* @csspart status-message - The wrapper for the status messages
|
|
32
|
+
* @csspart checked-message - The checked message
|
|
33
|
+
* @csspart unchecked-message - The unchecked message
|
|
34
|
+
* @fires change - Emits a custom change event when the checked state changes
|
|
7
35
|
*
|
|
8
36
|
* @public
|
|
9
37
|
*/
|
|
10
|
-
let
|
|
38
|
+
let Switch$1 = class Switch extends FormAssociatedSwitch {
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
/**
|
|
42
|
+
* The element's value to be included in form submission when checked.
|
|
43
|
+
* Default to "on" to reach parity with input[type="checkbox"]
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
this.initialValue = "on";
|
|
48
|
+
/**
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
this.keypressHandler = (e) => {
|
|
52
|
+
if (this.readOnly) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
switch (e.key) {
|
|
56
|
+
case keyEnter:
|
|
57
|
+
case keySpace:
|
|
58
|
+
this.checked = !this.checked;
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
this.clickHandler = (e) => {
|
|
66
|
+
if (!this.disabled && !this.readOnly) {
|
|
67
|
+
this.checked = !this.checked;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
this.proxy.setAttribute("type", "checkbox");
|
|
71
|
+
}
|
|
72
|
+
readOnlyChanged() {
|
|
73
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
74
|
+
this.proxy.readOnly = this.readOnly;
|
|
75
|
+
}
|
|
76
|
+
this.readOnly
|
|
77
|
+
? this.classList.add("readonly")
|
|
78
|
+
: this.classList.remove("readonly");
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
checkedChanged(prev, next) {
|
|
84
|
+
super.checkedChanged(prev, next);
|
|
85
|
+
/**
|
|
86
|
+
* @deprecated - this behavior already exists in the template and should not exist in the class.
|
|
87
|
+
*/
|
|
88
|
+
this.checked ? this.classList.add("checked") : this.classList.remove("checked");
|
|
89
|
+
}
|
|
11
90
|
};
|
|
91
|
+
__decorate([
|
|
92
|
+
attr({ attribute: "readonly", mode: "boolean" })
|
|
93
|
+
], Switch$1.prototype, "readOnly", void 0);
|
|
94
|
+
__decorate([
|
|
95
|
+
observable
|
|
96
|
+
], Switch$1.prototype, "defaultSlottedNodes", void 0);
|
|
97
|
+
|
|
98
|
+
const styles = ":host(.disabled){cursor:not-allowed}.control{display:inline-flex;border-radius:14px;gap:8px;--focus-inset: -4px;--focus-stroke-gap-color: transparent}.control.connotation-cta{--_connotation-color-primary-text: var(--vvd-switch-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-increment: var(--vvd-switch-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-switch-cta-firm, var(--vvd-color-cta-600));--_connotation-color-intermediate: var(--vvd-switch-cta-intermediate, var(--vvd-color-cta-500));--_connotation-color-fierce: var(--vvd-switch-cta-fierce, var(--vvd-color-cta-700))}.control.connotation-alert{--_connotation-color-primary-text: var(--vvd-switch-alert-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-alert-primary, var(--vvd-color-alert-500));--_connotation-color-primary-increment: var(--vvd-switch-alert-primary-increment, var(--vvd-color-alert-600));--_connotation-color-firm: var(--vvd-switch-alert-firm, var(--vvd-color-alert-600));--_connotation-color-intermediate: var(--vvd-switch-alert-intermediate, var(--vvd-color-alert-500));--_connotation-color-fierce: var(--vvd-switch-alert-fierce, var(--vvd-color-alert-700))}.control.connotation-success{--_connotation-color-primary-text: var(--vvd-switch-success-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-success-primary, var(--vvd-color-success-500));--_connotation-color-primary-increment: var(--vvd-switch-success-primary-increment, var(--vvd-color-success-600));--_connotation-color-firm: var(--vvd-switch-success-firm, var(--vvd-color-success-600));--_connotation-color-intermediate: var(--vvd-switch-success-intermediate, var(--vvd-color-success-500));--_connotation-color-fierce: var(--vvd-switch-success-fierce, var(--vvd-color-success-700))}.control:not(.connotation-cta,.connotation-alert,.connotation-success){--_connotation-color-primary-text: var(--vvd-switch-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-increment: var(--vvd-switch-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-switch-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-intermediate: var(--vvd-switch-accent-intermediate, var(--vvd-color-neutral-500));--_connotation-color-fierce: var(--vvd-switch-accent-fierce, var(--vvd-color-neutral-700))}.control{--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-intermediate)}.control.appearance-filled{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--vvd-color-canvas-text);--_appearance-color-fill: var(--vvd-color-canvas);--_appearance-color-outline: var(--_connotation-color-fierce)}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-filled{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}.control: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)}.control:where(.disabled,:disabled).appearance-filled{--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: var(--vvd-color-neutral-100);--_appearance-color-outline: transparent}.control: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)}.control:where(.readonly):where(:not(.disabled,:disabled)).appearance-filled{--_appearance-color-text: var(--vvd-color-neutral-800);--_appearance-color-fill: var(--vvd-color-neutral-500);--_appearance-color-outline: transparent}.control:focus-visible{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px))}@supports (user-select: none){.control{user-select:none}}.control:not(.disabled){cursor:pointer}.control.disabled{pointer-events:none}.switch{--_switch-inline-size:calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))*1.8);display:flex;box-sizing:border-box;align-items:center;border-radius:40px;background-color:var(--_appearance-color-fill);block-size:calc(1px*(20 + 4*clamp(-1,var(--vvd-size-density, 0),2)));box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);inline-size:var(--_switch-inline-size);transition:all .2s ease-in-out 0s}.checked-indicator{--_switch-checked-indicator-size: calc(calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2))) / 1.6667 );--_switch-gutter: calc(var(--_switch-checked-indicator-size) / 3);border-radius:inherit;block-size:var(--_switch-checked-indicator-size);inline-size:var(--_switch-checked-indicator-size);margin-inline-start:auto;transition:all .2s ease-in-out 0s}.control:not(.appearance-filled) .checked-indicator{background-color:var(--_appearance-color-outline)}.control:not(.appearance-filled):where(.readonly) .checked-indicator{background-color:var(--vvd-color-neutral-600)}.control.appearance-filled .checked-indicator{background-color:var(--vvd-color-neutral-100)}.control:not(.checked) .checked-indicator{transform:translate(calc(-1 * var(--_switch-inline-size) + var(--_switch-checked-indicator-size) + var(--_switch-gutter)))}.control.checked .checked-indicator{transform:translate(calc(-1 * var(--_switch-gutter)))}.control.appearance-filled.disabled .checked-indicator{background-color:var(--_appearance-color-text)}.control.appearance-filled.readonly .checked-indicator{background-color:var(--vvd-color-neutral-50)}.label{color:var(--vvd-color-canvas-text);cursor:pointer;font:var(--vvd-typography-base)}\n";
|
|
12
99
|
|
|
13
|
-
|
|
100
|
+
var __defProp = Object.defineProperty;
|
|
101
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
102
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
103
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
104
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
105
|
+
if (decorator = decorators[i])
|
|
106
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
107
|
+
if (kind && result)
|
|
108
|
+
__defProp(target, key, result);
|
|
109
|
+
return result;
|
|
110
|
+
};
|
|
111
|
+
class Switch extends Switch$1 {
|
|
14
112
|
}
|
|
113
|
+
__decorateClass([
|
|
114
|
+
attr
|
|
115
|
+
], Switch.prototype, "label", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
attr
|
|
118
|
+
], Switch.prototype, "connotation", 2);
|
|
15
119
|
|
|
16
|
-
|
|
120
|
+
const getClasses = (_) => classNames(
|
|
121
|
+
"control",
|
|
122
|
+
["appearance-filled", _.checked],
|
|
123
|
+
["checked", _.checked],
|
|
124
|
+
["disabled", _.disabled],
|
|
125
|
+
["readonly", _.readOnly],
|
|
126
|
+
[
|
|
127
|
+
`connotation-${_.connotation}`,
|
|
128
|
+
Boolean(_.checked) && Boolean(_.connotation)
|
|
129
|
+
]
|
|
130
|
+
);
|
|
131
|
+
const SwitchTemplate = () => {
|
|
17
132
|
return html`
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
133
|
+
<div
|
|
134
|
+
class="${getClasses}"
|
|
135
|
+
role="switch"
|
|
136
|
+
aria-checked="${(x) => x.checked}"
|
|
137
|
+
aria-disabled="${(x) => x.disabled}"
|
|
138
|
+
aria-readonly="${(x) => x.readOnly}"
|
|
139
|
+
tabindex="${(x) => x.disabled ? null : 0}"
|
|
140
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
141
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
142
|
+
>
|
|
143
|
+
<div class="switch">
|
|
144
|
+
<span class="checked-indicator"></span>
|
|
145
|
+
</div>
|
|
146
|
+
${when(
|
|
147
|
+
(x) => x.label,
|
|
148
|
+
html`<div class="label">${(x) => x.label}</div>`
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
151
|
+
`;
|
|
152
|
+
};
|
|
23
153
|
|
|
24
|
-
const
|
|
25
|
-
baseName: "
|
|
26
|
-
template:
|
|
154
|
+
const switchDefinition = Switch.compose({
|
|
155
|
+
baseName: "switch",
|
|
156
|
+
template: SwitchTemplate,
|
|
157
|
+
styles,
|
|
158
|
+
shadowOptions: {
|
|
159
|
+
delegatesFocus: true
|
|
160
|
+
}
|
|
27
161
|
});
|
|
28
|
-
const
|
|
29
|
-
const
|
|
162
|
+
const switchRegistries = [switchDefinition(), ...iconRegistries];
|
|
163
|
+
const registerSwitch = registerFactory(switchRegistries);
|
|
30
164
|
|
|
31
|
-
export {
|
|
165
|
+
export { switchRegistries as a, registerSwitch as r, switchDefinition as s };
|
package/shared/definition48.cjs
CHANGED
|
@@ -1,94 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./definition26.cjs');
|
|
5
|
-
const affix = require('./affix.cjs');
|
|
6
|
-
const applyMixins = require('./apply-mixins.cjs');
|
|
7
|
-
const classNames = require('./class-names.cjs');
|
|
8
4
|
|
|
9
5
|
/**
|
|
10
|
-
* A
|
|
6
|
+
* A TabPanel Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}
|
|
11
7
|
*
|
|
12
|
-
* @slot - The default slot for the
|
|
8
|
+
* @slot - The default slot for the tabpanel content
|
|
13
9
|
*
|
|
14
10
|
* @public
|
|
15
11
|
*/
|
|
16
|
-
let
|
|
12
|
+
let TabPanel$1 = class TabPanel extends index.FoundationElement {
|
|
17
13
|
};
|
|
18
|
-
index.__decorate([
|
|
19
|
-
index.attr({ mode: "boolean" })
|
|
20
|
-
], Tab$1.prototype, "disabled", void 0);
|
|
21
14
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var __defProp = Object.defineProperty;
|
|
25
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
26
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
27
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
28
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
29
|
-
if (decorator = decorators[i])
|
|
30
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
31
|
-
if (kind && result)
|
|
32
|
-
__defProp(target, key, result);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
class Tab extends Tab$1 {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(...arguments);
|
|
38
|
-
this.tabIndex = "-1";
|
|
39
|
-
this.ariaSelected = null;
|
|
40
|
-
}
|
|
15
|
+
class TabPanel extends TabPanel$1 {
|
|
41
16
|
}
|
|
42
|
-
__decorateClass([
|
|
43
|
-
index.attr
|
|
44
|
-
], Tab.prototype, "connotation", 2);
|
|
45
|
-
__decorateClass([
|
|
46
|
-
index.attr
|
|
47
|
-
], Tab.prototype, "shape", 2);
|
|
48
|
-
__decorateClass([
|
|
49
|
-
index.attr
|
|
50
|
-
], Tab.prototype, "label", 2);
|
|
51
|
-
__decorateClass([
|
|
52
|
-
index.attr({ mode: "fromView" })
|
|
53
|
-
], Tab.prototype, "tabIndex", 2);
|
|
54
|
-
__decorateClass([
|
|
55
|
-
index.attr({ attribute: "aria-selected" })
|
|
56
|
-
], Tab.prototype, "ariaSelected", 2);
|
|
57
|
-
applyMixins.applyMixins(Tab, affix.AffixIconWithTrailing);
|
|
58
17
|
|
|
59
|
-
|
|
60
|
-
connotation,
|
|
61
|
-
disabled,
|
|
62
|
-
ariaSelected,
|
|
63
|
-
iconTrailing,
|
|
64
|
-
shape
|
|
65
|
-
}) => classNames.classNames(
|
|
66
|
-
"base",
|
|
67
|
-
[`connotation-${connotation}`, Boolean(connotation) && ariaSelected === "true"],
|
|
68
|
-
[`shape-${shape}`, Boolean(shape)],
|
|
69
|
-
["disabled", Boolean(disabled)],
|
|
70
|
-
["selected", ariaSelected === "true"],
|
|
71
|
-
["icon-trailing", iconTrailing]
|
|
72
|
-
);
|
|
73
|
-
function TabTemplate(context) {
|
|
74
|
-
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
18
|
+
function TabPanelTemplate() {
|
|
75
19
|
return index.html`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
</div>
|
|
81
|
-
</template>`;
|
|
20
|
+
<template slot="tabpanel" role="tabpanel">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</template>
|
|
23
|
+
`;
|
|
82
24
|
}
|
|
83
25
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const
|
|
26
|
+
const tabPanelDefinition = TabPanel.compose(
|
|
27
|
+
{
|
|
28
|
+
baseName: "tab-panel",
|
|
29
|
+
template: TabPanelTemplate
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
const tabPanelRegistries = [tabPanelDefinition()];
|
|
33
|
+
const registerTabPanel = index.registerFactory(tabPanelRegistries);
|
|
91
34
|
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
35
|
+
exports.registerTabPanel = registerTabPanel;
|
|
36
|
+
exports.tabPanelDefinition = tabPanelDefinition;
|
|
37
|
+
exports.tabPanelRegistries = tabPanelRegistries;
|
package/shared/definition48.js
CHANGED
|
@@ -1,90 +1,33 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import { a as iconRegistries } from './definition26.js';
|
|
3
|
-
import { b as AffixIconWithTrailing, a as affixIconTemplateFactory, I as IconWrapper } from './affix.js';
|
|
4
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
5
|
-
import { c as classNames } from './class-names.js';
|
|
1
|
+
import { F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
6
2
|
|
|
7
3
|
/**
|
|
8
|
-
* A
|
|
4
|
+
* A TabPanel Component to be used with {@link @microsoft/fast-foundation#(Tabs:class)}
|
|
9
5
|
*
|
|
10
|
-
* @slot - The default slot for the
|
|
6
|
+
* @slot - The default slot for the tabpanel content
|
|
11
7
|
*
|
|
12
8
|
* @public
|
|
13
9
|
*/
|
|
14
|
-
let
|
|
10
|
+
let TabPanel$1 = class TabPanel extends FoundationElement {
|
|
15
11
|
};
|
|
16
|
-
__decorate([
|
|
17
|
-
attr({ mode: "boolean" })
|
|
18
|
-
], Tab$1.prototype, "disabled", void 0);
|
|
19
12
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var __defProp = Object.defineProperty;
|
|
23
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
24
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
25
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
26
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
27
|
-
if (decorator = decorators[i])
|
|
28
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
29
|
-
if (kind && result)
|
|
30
|
-
__defProp(target, key, result);
|
|
31
|
-
return result;
|
|
32
|
-
};
|
|
33
|
-
class Tab extends Tab$1 {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(...arguments);
|
|
36
|
-
this.tabIndex = "-1";
|
|
37
|
-
this.ariaSelected = null;
|
|
38
|
-
}
|
|
13
|
+
class TabPanel extends TabPanel$1 {
|
|
39
14
|
}
|
|
40
|
-
__decorateClass([
|
|
41
|
-
attr
|
|
42
|
-
], Tab.prototype, "connotation", 2);
|
|
43
|
-
__decorateClass([
|
|
44
|
-
attr
|
|
45
|
-
], Tab.prototype, "shape", 2);
|
|
46
|
-
__decorateClass([
|
|
47
|
-
attr
|
|
48
|
-
], Tab.prototype, "label", 2);
|
|
49
|
-
__decorateClass([
|
|
50
|
-
attr({ mode: "fromView" })
|
|
51
|
-
], Tab.prototype, "tabIndex", 2);
|
|
52
|
-
__decorateClass([
|
|
53
|
-
attr({ attribute: "aria-selected" })
|
|
54
|
-
], Tab.prototype, "ariaSelected", 2);
|
|
55
|
-
applyMixins(Tab, AffixIconWithTrailing);
|
|
56
15
|
|
|
57
|
-
|
|
58
|
-
connotation,
|
|
59
|
-
disabled,
|
|
60
|
-
ariaSelected,
|
|
61
|
-
iconTrailing,
|
|
62
|
-
shape
|
|
63
|
-
}) => classNames(
|
|
64
|
-
"base",
|
|
65
|
-
[`connotation-${connotation}`, Boolean(connotation) && ariaSelected === "true"],
|
|
66
|
-
[`shape-${shape}`, Boolean(shape)],
|
|
67
|
-
["disabled", Boolean(disabled)],
|
|
68
|
-
["selected", ariaSelected === "true"],
|
|
69
|
-
["icon-trailing", iconTrailing]
|
|
70
|
-
);
|
|
71
|
-
function TabTemplate(context) {
|
|
72
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
16
|
+
function TabPanelTemplate() {
|
|
73
17
|
return html`
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
</div>
|
|
79
|
-
</template>`;
|
|
18
|
+
<template slot="tabpanel" role="tabpanel">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</template>
|
|
21
|
+
`;
|
|
80
22
|
}
|
|
81
23
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
const
|
|
24
|
+
const tabPanelDefinition = TabPanel.compose(
|
|
25
|
+
{
|
|
26
|
+
baseName: "tab-panel",
|
|
27
|
+
template: TabPanelTemplate
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
const tabPanelRegistries = [tabPanelDefinition()];
|
|
31
|
+
const registerTabPanel = registerFactory(tabPanelRegistries);
|
|
89
32
|
|
|
90
|
-
export {
|
|
33
|
+
export { tabPanelRegistries as a, registerTabPanel as r, tabPanelDefinition as t };
|