@vonage/vivid 3.52.0 → 3.53.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/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/alert/index.cjs +3 -3
- package/alert/index.js +3 -3
- package/audio-player/index.cjs +3 -3
- package/audio-player/index.js +3 -3
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.cjs +1 -1
- package/badge/index.js +1 -1
- package/banner/index.cjs +2 -2
- package/banner/index.js +2 -2
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.cjs +2 -2
- package/button/index.js +2 -2
- package/card/index.cjs +2 -2
- package/card/index.js +2 -2
- package/checkbox/index.cjs +3 -2
- package/checkbox/index.js +3 -2
- package/combobox/index.cjs +5 -5
- package/combobox/index.js +5 -5
- package/custom-elements.json +717 -4
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +7 -6
- package/date-picker/index.js +7 -6
- package/date-range-picker/index.cjs +7 -6
- package/date-range-picker/index.js +7 -6
- package/dial-pad/index.cjs +33 -0
- package/dial-pad/index.js +31 -0
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +4 -4
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +2 -2
- package/empty-state/index.js +2 -2
- package/fab/index.cjs +2 -2
- package/fab/index.js +2 -2
- package/file-picker/index.cjs +4 -3
- package/file-picker/index.js +4 -3
- package/header/index.cjs +2 -2
- package/header/index.js +2 -2
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +132 -122
- package/index.js +46 -43
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/components.d.ts +2 -0
- package/lib/dial-pad/definition.d.ts +3 -0
- package/lib/dial-pad/dial-pad.d.ts +14 -0
- package/lib/dial-pad/dial-pad.template.d.ts +4 -0
- package/lib/dial-pad/locale.d.ts +18 -0
- package/lib/enums.d.ts +6 -0
- package/lib/text-anchor/definition.d.ts +1 -0
- package/lib/text-anchor/text-anchor.d.ts +5 -0
- package/lib/video-player/definition.d.ts +3 -0
- package/lib/video-player/locale.d.ts +1 -0
- package/lib/video-player/video-player.d.ts +17 -0
- package/lib/video-player/video-player.template.d.ts +4 -0
- package/listbox/index.cjs +2 -2
- package/listbox/index.js +2 -2
- package/locales/en-GB.cjs +30 -0
- package/locales/en-GB.js +30 -0
- package/locales/en-US.cjs +198 -0
- package/locales/en-US.js +198 -0
- package/locales/ja-JP.cjs +197 -0
- package/locales/ja-JP.js +197 -0
- package/locales/zh-CN.cjs +199 -0
- package/locales/zh-CN.js +199 -0
- package/menu/index.cjs +6 -6
- package/menu/index.js +6 -6
- package/menu-item/index.cjs +2 -2
- package/menu-item/index.js +2 -2
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +2 -2
- package/nav-disclosure/index.js +2 -2
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +2 -2
- package/note/index.cjs +2 -2
- package/note/index.js +2 -2
- package/number-field/index.cjs +5 -4
- package/number-field/index.js +5 -4
- package/option/index.cjs +2 -2
- package/option/index.js +2 -2
- package/package.json +1 -1
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +3 -3
- package/popup/index.cjs +4 -4
- package/popup/index.js +4 -4
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +2 -2
- package/range-slider/index.js +2 -2
- package/select/index.cjs +7 -6
- package/select/index.js +7 -6
- package/selectable-box/index.cjs +5 -4
- package/selectable-box/index.js +5 -4
- package/shared/applyMixinsWithObservables.cjs +15 -0
- package/shared/applyMixinsWithObservables.js +13 -0
- package/shared/definition.cjs +1 -1
- package/shared/definition.js +1 -1
- package/shared/definition11.cjs +3 -3
- package/shared/definition11.js +3 -3
- package/shared/definition14.cjs +2 -2
- package/shared/definition14.js +2 -2
- package/shared/definition15.cjs +8 -9
- package/shared/definition15.js +8 -9
- package/shared/definition16.cjs +3 -3
- package/shared/definition16.js +3 -3
- package/shared/definition17.cjs +2 -2
- package/shared/definition17.js +3 -3
- package/shared/definition18.cjs +3 -3
- package/shared/definition18.js +3 -3
- package/shared/definition19.cjs +3 -3
- package/shared/definition19.js +3 -3
- package/shared/definition20.cjs +186 -227
- package/shared/definition20.js +181 -222
- package/shared/definition21.cjs +264 -67
- package/shared/definition21.js +263 -65
- package/shared/definition22.cjs +66 -57
- package/shared/definition22.js +64 -56
- package/shared/definition23.cjs +42 -76
- package/shared/definition23.js +41 -75
- package/shared/definition24.cjs +70 -2402
- package/shared/definition24.js +69 -2401
- package/shared/definition25.cjs +2402 -46
- package/shared/definition25.js +2401 -45
- package/shared/definition26.cjs +63 -30
- package/shared/definition26.js +62 -29
- package/shared/definition27.cjs +28 -56
- package/shared/definition27.js +27 -55
- package/shared/definition28.cjs +35 -881
- package/shared/definition28.js +34 -879
- package/shared/definition29.cjs +893 -60
- package/shared/definition29.js +893 -61
- package/shared/definition30.cjs +68 -86
- package/shared/definition30.js +67 -85
- package/shared/definition31.cjs +86 -21
- package/shared/definition31.js +86 -21
- package/shared/definition32.cjs +24 -12
- package/shared/definition32.js +23 -11
- package/shared/definition33.cjs +11 -50
- package/shared/definition33.js +10 -49
- package/shared/definition34.cjs +26 -515
- package/shared/definition34.js +26 -515
- package/shared/definition35.cjs +448 -194
- package/shared/definition35.js +448 -192
- package/shared/definition36.cjs +256 -202
- package/shared/definition36.js +253 -201
- package/shared/definition37.cjs +204 -65
- package/shared/definition37.js +203 -63
- package/shared/definition38.cjs +63 -57
- package/shared/definition38.js +60 -55
- package/shared/definition39.cjs +65 -432
- package/shared/definition39.js +64 -431
- package/shared/definition4.cjs +2 -2
- package/shared/definition4.js +2 -2
- package/shared/definition40.cjs +441 -34
- package/shared/definition40.js +438 -31
- package/shared/definition41.cjs +34 -576
- package/shared/definition41.js +33 -575
- package/shared/definition42.cjs +531 -654
- package/shared/definition42.js +531 -654
- package/shared/definition43.cjs +690 -114
- package/shared/definition43.js +689 -113
- package/shared/definition44.cjs +124 -79
- package/shared/definition44.js +122 -77
- package/shared/definition45.cjs +78 -520
- package/shared/definition45.js +77 -518
- package/shared/definition46.cjs +520 -119
- package/shared/definition46.js +518 -118
- package/shared/definition47.cjs +118 -135
- package/shared/definition47.js +117 -134
- package/shared/definition48.cjs +151 -19
- package/shared/definition48.js +150 -18
- package/shared/definition49.cjs +21 -84
- package/shared/definition49.js +20 -83
- package/shared/definition5.cjs +1 -1
- package/shared/definition5.js +1 -1
- package/shared/definition50.cjs +52 -505
- package/shared/definition50.js +51 -504
- package/shared/definition51.cjs +526 -28
- package/shared/definition51.js +525 -27
- package/shared/definition52.cjs +28 -123
- package/shared/definition52.js +26 -122
- package/shared/definition53.cjs +110 -309
- package/shared/definition53.js +110 -308
- package/shared/definition54.cjs +255 -271
- package/shared/definition54.js +255 -271
- package/shared/definition55.cjs +262 -791
- package/shared/definition55.js +261 -790
- package/shared/definition56.cjs +818 -107
- package/shared/definition56.js +817 -106
- package/shared/definition57.cjs +85 -55
- package/shared/definition57.js +84 -54
- package/shared/definition58.cjs +125 -72
- package/shared/definition58.js +124 -71
- package/shared/definition59.cjs +72 -285
- package/shared/definition59.js +73 -286
- package/shared/definition6.cjs +1 -1
- package/shared/definition6.js +1 -1
- package/shared/definition60.cjs +298 -39
- package/shared/definition60.js +297 -38
- package/shared/definition61.cjs +65739 -1688
- package/shared/definition61.js +65738 -1687
- package/shared/definition62.cjs +50 -0
- package/shared/definition62.js +46 -0
- package/shared/definition63.cjs +1828 -0
- package/shared/definition63.js +1824 -0
- package/shared/definition7.cjs +2 -2
- package/shared/definition7.js +2 -2
- package/shared/definition8.cjs +2 -2
- package/shared/definition8.js +2 -2
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +1 -1
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/index2.cjs +66 -37
- package/shared/index2.js +66 -37
- package/shared/key-codes2.js +1 -1
- package/shared/listbox.cjs +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/form-elements/form-elements.d.ts +2 -3
- package/shared/presentationDate.cjs +16 -5
- package/shared/presentationDate.js +16 -5
- package/shared/text-anchor.cjs +6 -0
- package/shared/text-anchor.js +6 -0
- package/shared/text-anchor.template.cjs +6 -1
- package/shared/text-anchor.template.js +6 -1
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/applyMixinsWithObservables.d.ts +1 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -1
- package/split-button/index.cjs +2 -2
- package/split-button/index.js +2 -2
- package/style.css +1 -0
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +2 -2
- package/switch/index.js +2 -2
- package/tab/index.cjs +2 -2
- package/tab/index.js +2 -2
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +4 -4
- package/tabs/index.js +4 -4
- package/tag/index.cjs +2 -2
- package/tag/index.js +2 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +4 -3
- package/text-area/index.js +4 -3
- package/text-field/index.cjs +4 -3
- package/text-field/index.js +4 -3
- package/time-picker/index.cjs +8 -7
- package/time-picker/index.js +8 -7
- package/toggletip/index.cjs +5 -5
- package/toggletip/index.js +5 -5
- package/tooltip/index.cjs +5 -5
- package/tooltip/index.js +5 -5
- package/tree-item/index.cjs +2 -2
- package/tree-item/index.js +2 -2
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +17 -0
- package/video-player/index.js +15 -0
- package/vivid.api.json +311 -0
package/shared/definition48.cjs
CHANGED
|
@@ -1,37 +1,169 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition27.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);
|
|
14
99
|
|
|
15
|
-
|
|
100
|
+
const styles = ":host(.disabled){cursor:not-allowed}.control{display:inline-flex;border-radius:16px;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";
|
|
101
|
+
|
|
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
|
-
|
|
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>
|
|
23
153
|
`;
|
|
24
|
-
}
|
|
154
|
+
};
|
|
25
155
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
156
|
+
const switchDefinition = Switch.compose({
|
|
157
|
+
baseName: "switch",
|
|
158
|
+
template: SwitchTemplate,
|
|
159
|
+
styles,
|
|
160
|
+
shadowOptions: {
|
|
161
|
+
delegatesFocus: true
|
|
30
162
|
}
|
|
31
|
-
);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
163
|
+
});
|
|
164
|
+
const switchRegistries = [switchDefinition(), ...definition.iconRegistries];
|
|
165
|
+
const registerSwitch = index.registerFactory(switchRegistries);
|
|
34
166
|
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
167
|
+
exports.registerSwitch = registerSwitch;
|
|
168
|
+
exports.switchDefinition = switchDefinition;
|
|
169
|
+
exports.switchRegistries = switchRegistries;
|
package/shared/definition48.js
CHANGED
|
@@ -1,33 +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 './definition27.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);
|
|
12
97
|
|
|
13
|
-
|
|
98
|
+
const styles = ":host(.disabled){cursor:not-allowed}.control{display:inline-flex;border-radius:16px;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";
|
|
99
|
+
|
|
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
|
-
|
|
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>
|
|
21
151
|
`;
|
|
22
|
-
}
|
|
152
|
+
};
|
|
23
153
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
154
|
+
const switchDefinition = Switch.compose({
|
|
155
|
+
baseName: "switch",
|
|
156
|
+
template: SwitchTemplate,
|
|
157
|
+
styles,
|
|
158
|
+
shadowOptions: {
|
|
159
|
+
delegatesFocus: true
|
|
28
160
|
}
|
|
29
|
-
);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
161
|
+
});
|
|
162
|
+
const switchRegistries = [switchDefinition(), ...iconRegistries];
|
|
163
|
+
const registerSwitch = registerFactory(switchRegistries);
|
|
32
164
|
|
|
33
|
-
export {
|
|
165
|
+
export { switchRegistries as a, registerSwitch as r, switchDefinition as s };
|
package/shared/definition49.cjs
CHANGED
|
@@ -1,100 +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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}) => classNames.classNames(
|
|
66
|
-
"base",
|
|
67
|
-
[
|
|
68
|
-
`connotation-${connotation}`,
|
|
69
|
-
Boolean(connotation) && ariaSelected === "true"
|
|
70
|
-
],
|
|
71
|
-
[`shape-${shape}`, Boolean(shape)],
|
|
72
|
-
["disabled", Boolean(disabled)],
|
|
73
|
-
["selected", ariaSelected === "true"],
|
|
74
|
-
["icon-trailing", iconTrailing]
|
|
75
|
-
);
|
|
76
|
-
function TabTemplate(context) {
|
|
77
|
-
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
78
|
-
return index.html` <template
|
|
79
|
-
slot="tab"
|
|
80
|
-
role="tab"
|
|
81
|
-
aria-disabled="${(x) => x.disabled}"
|
|
82
|
-
aria-selected="${(x) => x.ariaSelected}"
|
|
83
|
-
>
|
|
84
|
-
<div class="${getClasses}">
|
|
85
|
-
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)} ${(x) => x.label}
|
|
86
|
-
</div>
|
|
87
|
-
</template>`;
|
|
18
|
+
function TabPanelTemplate() {
|
|
19
|
+
return index.html`
|
|
20
|
+
<template slot="tabpanel" role="tabpanel">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</template>
|
|
23
|
+
`;
|
|
88
24
|
}
|
|
89
25
|
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
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);
|
|
97
34
|
|
|
98
|
-
exports.
|
|
99
|
-
exports.
|
|
100
|
-
exports.
|
|
35
|
+
exports.registerTabPanel = registerTabPanel;
|
|
36
|
+
exports.tabPanelDefinition = tabPanelDefinition;
|
|
37
|
+
exports.tabPanelRegistries = tabPanelRegistries;
|
package/shared/definition49.js
CHANGED
|
@@ -1,96 +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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}) => classNames(
|
|
64
|
-
"base",
|
|
65
|
-
[
|
|
66
|
-
`connotation-${connotation}`,
|
|
67
|
-
Boolean(connotation) && ariaSelected === "true"
|
|
68
|
-
],
|
|
69
|
-
[`shape-${shape}`, Boolean(shape)],
|
|
70
|
-
["disabled", Boolean(disabled)],
|
|
71
|
-
["selected", ariaSelected === "true"],
|
|
72
|
-
["icon-trailing", iconTrailing]
|
|
73
|
-
);
|
|
74
|
-
function TabTemplate(context) {
|
|
75
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
76
|
-
return html` <template
|
|
77
|
-
slot="tab"
|
|
78
|
-
role="tab"
|
|
79
|
-
aria-disabled="${(x) => x.disabled}"
|
|
80
|
-
aria-selected="${(x) => x.ariaSelected}"
|
|
81
|
-
>
|
|
82
|
-
<div class="${getClasses}">
|
|
83
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)} ${(x) => x.label}
|
|
84
|
-
</div>
|
|
85
|
-
</template>`;
|
|
16
|
+
function TabPanelTemplate() {
|
|
17
|
+
return html`
|
|
18
|
+
<template slot="tabpanel" role="tabpanel">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</template>
|
|
21
|
+
`;
|
|
86
22
|
}
|
|
87
23
|
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
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);
|
|
95
32
|
|
|
96
|
-
export {
|
|
33
|
+
export { tabPanelRegistries as a, registerTabPanel as r, tabPanelDefinition as t };
|
package/shared/definition5.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
4
|
const definition = require('./definition11.cjs');
|
|
5
|
-
const definition$1 = require('./
|
|
5
|
+
const definition$1 = require('./definition46.cjs');
|
|
6
6
|
require('./affix.cjs');
|
|
7
7
|
require('./index2.cjs');
|
|
8
8
|
const localized = require('./localized.cjs');
|
package/shared/definition5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as attr, F as FoundationElement, o as observable, h as html, r as registerFactory } from './index.js';
|
|
2
2
|
import { B as Button, a as buttonRegistries } from './definition11.js';
|
|
3
|
-
import { S as Slider, a as sliderRegistries } from './
|
|
3
|
+
import { S as Slider, a as sliderRegistries } from './definition46.js';
|
|
4
4
|
import './affix.js';
|
|
5
5
|
import './index2.js';
|
|
6
6
|
import { L as Localized } from './localized.js';
|