@vonage/vivid 4.5.0 → 4.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +947 -79
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/index.cjs +62 -56
- package/index.js +20 -19
- package/lib/components.d.ts +1 -0
- package/lib/dialog/dialog.d.ts +0 -1
- package/lib/menu/menu.d.ts +2 -1
- package/lib/number-field/number-field.d.ts +3 -1
- package/lib/searchable-select/definition.d.ts +4 -0
- package/lib/searchable-select/locale.d.ts +9 -0
- package/lib/searchable-select/option-tag.d.ts +14 -0
- package/lib/searchable-select/option-tag.template.d.ts +4 -0
- package/lib/searchable-select/searchable-select.d.ts +29 -0
- package/lib/searchable-select/searchable-select.form-associated.d.ts +10 -0
- package/lib/searchable-select/searchable-select.template.d.ts +4 -0
- package/lib/select/select.d.ts +3 -1
- package/lib/tab/locale.d.ts +3 -0
- package/lib/tab/tab.d.ts +5 -1
- package/lib/tag/definition.d.ts +1 -0
- package/lib/text-field/text-field.d.ts +3 -1
- package/locales/de-DE.cjs +24 -0
- package/locales/de-DE.js +24 -0
- package/locales/en-GB.cjs +24 -0
- package/locales/en-GB.js +24 -0
- package/locales/en-US.cjs +24 -0
- package/locales/en-US.js +24 -0
- package/locales/ja-JP.cjs +24 -0
- package/locales/ja-JP.js +24 -0
- package/locales/zh-CN.cjs +24 -0
- package/locales/zh-CN.js +24 -0
- package/package.json +1 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/searchable-select/index.cjs +5 -0
- package/searchable-select/index.js +3 -0
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition14.cjs +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition16.cjs +1 -1
- package/shared/definition16.js +1 -1
- package/shared/definition18.cjs +2 -2
- package/shared/definition18.js +2 -2
- package/shared/definition19.cjs +2 -2
- package/shared/definition19.js +2 -2
- package/shared/definition20.cjs +14 -34
- package/shared/definition20.js +14 -34
- package/shared/definition21.cjs +2 -19
- package/shared/definition21.js +2 -19
- package/shared/definition26.cjs +1 -1
- package/shared/definition26.js +1 -1
- package/shared/definition29.cjs +4 -0
- package/shared/definition29.js +4 -0
- package/shared/definition30.cjs +2 -1
- package/shared/definition30.js +2 -1
- package/shared/definition35.cjs +12 -7
- package/shared/definition35.js +12 -7
- package/shared/definition36.cjs +50 -207
- package/shared/definition36.js +51 -207
- package/shared/definition4.cjs +1 -1
- package/shared/definition4.js +1 -1
- package/shared/definition42.cjs +1 -1
- package/shared/definition42.js +1 -1
- package/shared/definition43.cjs +1018 -647
- package/shared/definition43.js +1014 -644
- package/shared/definition44.cjs +723 -112
- package/shared/definition44.js +722 -111
- package/shared/definition45.cjs +121 -80
- package/shared/definition45.js +119 -78
- package/shared/definition46.cjs +81 -614
- package/shared/definition46.js +80 -612
- package/shared/definition47.cjs +608 -114
- package/shared/definition47.js +606 -113
- package/shared/definition48.cjs +116 -134
- package/shared/definition48.js +115 -133
- package/shared/definition49.cjs +149 -19
- package/shared/definition49.js +148 -18
- package/shared/definition5.cjs +1 -1
- package/shared/definition5.js +1 -1
- package/shared/definition50.cjs +21 -82
- package/shared/definition50.js +20 -81
- package/shared/definition51.cjs +77 -539
- package/shared/definition51.js +76 -538
- package/shared/definition52.cjs +568 -28
- package/shared/definition52.js +567 -27
- package/shared/definition53.cjs +28 -123
- package/shared/definition53.js +26 -122
- package/shared/definition54.cjs +115 -295
- package/shared/definition54.js +114 -294
- package/shared/definition55.cjs +251 -311
- package/shared/definition55.js +251 -311
- package/shared/definition56.cjs +299 -780
- package/shared/definition56.js +298 -779
- package/shared/definition57.cjs +800 -102
- package/shared/definition57.js +799 -101
- package/shared/definition58.cjs +92 -63
- package/shared/definition58.js +91 -62
- package/shared/definition59.cjs +117 -75
- package/shared/definition59.js +116 -74
- package/shared/definition60.cjs +70 -285
- package/shared/definition60.js +71 -286
- package/shared/definition61.cjs +274 -66146
- package/shared/definition61.js +273 -66145
- package/shared/definition62.cjs +66160 -27
- package/shared/definition62.js +66158 -25
- package/shared/definition63.cjs +24 -1952
- package/shared/definition63.js +23 -1950
- package/shared/definition64.cjs +1976 -0
- package/shared/definition64.js +1971 -0
- package/shared/listbox-option.cjs +204 -0
- package/shared/listbox-option.js +201 -0
- package/shared/listbox.cjs +3 -3
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/presentationDate.cjs +2 -2
- package/shared/presentationDate.js +2 -2
- package/shared/scrollIntoView.cjs +51 -0
- package/shared/scrollIntoView.js +49 -0
- package/shared/slider.template.cjs +1 -1
- package/shared/slider.template.js +1 -1
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/scrollIntoView.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 +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +1 -1
- package/tabs/index.js +1 -1
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +295 -0
- package/api-extractor.json +0 -25
- package/shared/dialog-polyfill.esm.cjs +0 -862
- package/shared/dialog-polyfill.esm.js +0 -858
- package/tsdoc-metadata.json +0 -11
package/shared/definition49.cjs
CHANGED
|
@@ -1,37 +1,167 @@
|
|
|
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.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.connotation-announcement{--_connotation-color-primary-text: var(--vvd-switch-announcement-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-announcement-primary, var(--vvd-color-announcement-500));--_connotation-color-primary-increment: var(--vvd-switch-announcement-primary-increment, var(--vvd-color-announcement-600));--_connotation-color-firm: var(--vvd-switch-announcement-firm, var(--vvd-color-announcement-600));--_connotation-color-intermediate: var(--vvd-switch-announcement-intermediate, var(--vvd-color-announcement-500));--_connotation-color-fierce: var(--vvd-switch-announcement-fierce, var(--vvd-color-announcement-700))}.control:not(.connotation-cta,.connotation-alert,.connotation-success,.connotation-announcement){--_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{display:inline-flex;border-radius:16px;gap:8px;--focus-inset: -4px;--focus-stroke-gap-color: 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)}";
|
|
101
|
+
|
|
102
|
+
var __defProp = Object.defineProperty;
|
|
103
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
104
|
+
var result = void 0 ;
|
|
105
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
106
|
+
if (decorator = decorators[i])
|
|
107
|
+
result = (decorator(target, key, result) ) || result;
|
|
108
|
+
if (result) __defProp(target, key, result);
|
|
109
|
+
return result;
|
|
110
|
+
};
|
|
111
|
+
class Switch extends Switch$1 {
|
|
16
112
|
}
|
|
113
|
+
__decorateClass([
|
|
114
|
+
index.attr
|
|
115
|
+
], Switch.prototype, "label");
|
|
116
|
+
__decorateClass([
|
|
117
|
+
index.attr
|
|
118
|
+
], Switch.prototype, "connotation");
|
|
17
119
|
|
|
18
|
-
|
|
120
|
+
const getClasses = (_) => classNames.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 = () => {
|
|
19
132
|
return index.html`
|
|
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.when(
|
|
147
|
+
(x) => x.label,
|
|
148
|
+
index.html`<div class="label">${(x) => x.label}</div>`
|
|
149
|
+
)}
|
|
150
|
+
</div>
|
|
23
151
|
`;
|
|
24
|
-
}
|
|
152
|
+
};
|
|
25
153
|
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
154
|
+
const switchDefinition = Switch.compose({
|
|
155
|
+
baseName: "switch",
|
|
156
|
+
template: SwitchTemplate,
|
|
157
|
+
styles,
|
|
158
|
+
shadowOptions: {
|
|
159
|
+
delegatesFocus: true
|
|
30
160
|
}
|
|
31
|
-
);
|
|
32
|
-
const
|
|
33
|
-
const
|
|
161
|
+
});
|
|
162
|
+
const switchRegistries = [switchDefinition(), ...definition.iconRegistries];
|
|
163
|
+
const registerSwitch = index.registerFactory(switchRegistries);
|
|
34
164
|
|
|
35
|
-
exports.
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
165
|
+
exports.registerSwitch = registerSwitch;
|
|
166
|
+
exports.switchDefinition = switchDefinition;
|
|
167
|
+
exports.switchRegistries = switchRegistries;
|
package/shared/definition49.js
CHANGED
|
@@ -1,33 +1,163 @@
|
|
|
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.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.connotation-announcement{--_connotation-color-primary-text: var(--vvd-switch-announcement-primary-text, var(--vvd-color-canvas));--_connotation-color-primary: var(--vvd-switch-announcement-primary, var(--vvd-color-announcement-500));--_connotation-color-primary-increment: var(--vvd-switch-announcement-primary-increment, var(--vvd-color-announcement-600));--_connotation-color-firm: var(--vvd-switch-announcement-firm, var(--vvd-color-announcement-600));--_connotation-color-intermediate: var(--vvd-switch-announcement-intermediate, var(--vvd-color-announcement-500));--_connotation-color-fierce: var(--vvd-switch-announcement-fierce, var(--vvd-color-announcement-700))}.control:not(.connotation-cta,.connotation-alert,.connotation-success,.connotation-announcement){--_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{display:inline-flex;border-radius:16px;gap:8px;--focus-inset: -4px;--focus-stroke-gap-color: 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)}";
|
|
99
|
+
|
|
100
|
+
var __defProp = Object.defineProperty;
|
|
101
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
102
|
+
var result = void 0 ;
|
|
103
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
104
|
+
if (decorator = decorators[i])
|
|
105
|
+
result = (decorator(target, key, result) ) || result;
|
|
106
|
+
if (result) __defProp(target, key, result);
|
|
107
|
+
return result;
|
|
108
|
+
};
|
|
109
|
+
class Switch extends Switch$1 {
|
|
14
110
|
}
|
|
111
|
+
__decorateClass([
|
|
112
|
+
attr
|
|
113
|
+
], Switch.prototype, "label");
|
|
114
|
+
__decorateClass([
|
|
115
|
+
attr
|
|
116
|
+
], Switch.prototype, "connotation");
|
|
15
117
|
|
|
16
|
-
|
|
118
|
+
const getClasses = (_) => classNames(
|
|
119
|
+
"control",
|
|
120
|
+
["appearance-filled", _.checked],
|
|
121
|
+
["checked", _.checked],
|
|
122
|
+
["disabled", _.disabled],
|
|
123
|
+
["readonly", _.readOnly],
|
|
124
|
+
[
|
|
125
|
+
`connotation-${_.connotation}`,
|
|
126
|
+
Boolean(_.checked) && Boolean(_.connotation)
|
|
127
|
+
]
|
|
128
|
+
);
|
|
129
|
+
const SwitchTemplate = () => {
|
|
17
130
|
return html`
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
131
|
+
<div
|
|
132
|
+
class="${getClasses}"
|
|
133
|
+
role="switch"
|
|
134
|
+
aria-checked="${(x) => x.checked}"
|
|
135
|
+
aria-disabled="${(x) => x.disabled}"
|
|
136
|
+
aria-readonly="${(x) => x.readOnly}"
|
|
137
|
+
tabindex="${(x) => x.disabled ? null : 0}"
|
|
138
|
+
@keypress="${(x, c) => x.keypressHandler(c.event)}"
|
|
139
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
140
|
+
>
|
|
141
|
+
<div class="switch">
|
|
142
|
+
<span class="checked-indicator"></span>
|
|
143
|
+
</div>
|
|
144
|
+
${when(
|
|
145
|
+
(x) => x.label,
|
|
146
|
+
html`<div class="label">${(x) => x.label}</div>`
|
|
147
|
+
)}
|
|
148
|
+
</div>
|
|
21
149
|
`;
|
|
22
|
-
}
|
|
150
|
+
};
|
|
23
151
|
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
152
|
+
const switchDefinition = Switch.compose({
|
|
153
|
+
baseName: "switch",
|
|
154
|
+
template: SwitchTemplate,
|
|
155
|
+
styles,
|
|
156
|
+
shadowOptions: {
|
|
157
|
+
delegatesFocus: true
|
|
28
158
|
}
|
|
29
|
-
);
|
|
30
|
-
const
|
|
31
|
-
const
|
|
159
|
+
});
|
|
160
|
+
const switchRegistries = [switchDefinition(), ...iconRegistries];
|
|
161
|
+
const registerSwitch = registerFactory(switchRegistries);
|
|
32
162
|
|
|
33
|
-
export {
|
|
163
|
+
export { switchRegistries as a, registerSwitch as r, switchDefinition as s };
|
package/shared/definition5.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
4
|
const definition$1 = require('./definition11.cjs');
|
|
5
|
-
const definition$2 = require('./
|
|
5
|
+
const definition$2 = require('./definition47.cjs');
|
|
6
6
|
const definition$3 = require('./definition30.cjs');
|
|
7
7
|
const enums = require('./enums.cjs');
|
|
8
8
|
const applyMixins = require('./apply-mixins.cjs');
|
package/shared/definition5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { F as FoundationElement, O as Observable, a as attr, 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 './definition47.js';
|
|
4
4
|
import { a as menuRegistries } from './definition30.js';
|
|
5
5
|
import { M as MediaSkipBy } from './enums.js';
|
|
6
6
|
import { a as applyMixins } from './apply-mixins.js';
|
package/shared/definition50.cjs
CHANGED
|
@@ -1,98 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./definition27.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 __decorateClass = (decorators, target, key, kind) => {
|
|
26
|
-
var result = void 0 ;
|
|
27
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
28
|
-
if (decorator = decorators[i])
|
|
29
|
-
result = (decorator(target, key, result) ) || result;
|
|
30
|
-
if (result) __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
|
-
}
|
|
15
|
+
class TabPanel extends TabPanel$1 {
|
|
39
16
|
}
|
|
40
|
-
__decorateClass([
|
|
41
|
-
index.attr
|
|
42
|
-
], Tab.prototype, "connotation");
|
|
43
|
-
__decorateClass([
|
|
44
|
-
index.attr
|
|
45
|
-
], Tab.prototype, "shape");
|
|
46
|
-
__decorateClass([
|
|
47
|
-
index.attr
|
|
48
|
-
], Tab.prototype, "label");
|
|
49
|
-
__decorateClass([
|
|
50
|
-
index.attr({ mode: "fromView" })
|
|
51
|
-
], Tab.prototype, "tabIndex");
|
|
52
|
-
__decorateClass([
|
|
53
|
-
index.attr({ attribute: "aria-selected" })
|
|
54
|
-
], Tab.prototype, "ariaSelected");
|
|
55
|
-
applyMixins.applyMixins(Tab, affix.AffixIconWithTrailing);
|
|
56
17
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}) => classNames.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 = affix.affixIconTemplateFactory(context);
|
|
76
|
-
return index.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, affix.IconWrapper.Slot)} ${(x) => x.label}
|
|
84
|
-
</div>
|
|
85
|
-
</template>`;
|
|
18
|
+
function TabPanelTemplate() {
|
|
19
|
+
return index.html`
|
|
20
|
+
<template slot="tabpanel" role="tabpanel">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</template>
|
|
23
|
+
`;
|
|
86
24
|
}
|
|
87
25
|
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
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);
|
|
95
34
|
|
|
96
|
-
exports.
|
|
97
|
-
exports.
|
|
98
|
-
exports.
|
|
35
|
+
exports.registerTabPanel = registerTabPanel;
|
|
36
|
+
exports.tabPanelDefinition = tabPanelDefinition;
|
|
37
|
+
exports.tabPanelRegistries = tabPanelRegistries;
|
package/shared/definition50.js
CHANGED
|
@@ -1,94 +1,33 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import { a as iconRegistries } from './definition27.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 __decorateClass = (decorators, target, key, kind) => {
|
|
24
|
-
var result = void 0 ;
|
|
25
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
26
|
-
if (decorator = decorators[i])
|
|
27
|
-
result = (decorator(target, key, result) ) || result;
|
|
28
|
-
if (result) __defProp(target, key, result);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
|
-
class Tab extends Tab$1 {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
this.tabIndex = "-1";
|
|
35
|
-
this.ariaSelected = null;
|
|
36
|
-
}
|
|
13
|
+
class TabPanel extends TabPanel$1 {
|
|
37
14
|
}
|
|
38
|
-
__decorateClass([
|
|
39
|
-
attr
|
|
40
|
-
], Tab.prototype, "connotation");
|
|
41
|
-
__decorateClass([
|
|
42
|
-
attr
|
|
43
|
-
], Tab.prototype, "shape");
|
|
44
|
-
__decorateClass([
|
|
45
|
-
attr
|
|
46
|
-
], Tab.prototype, "label");
|
|
47
|
-
__decorateClass([
|
|
48
|
-
attr({ mode: "fromView" })
|
|
49
|
-
], Tab.prototype, "tabIndex");
|
|
50
|
-
__decorateClass([
|
|
51
|
-
attr({ attribute: "aria-selected" })
|
|
52
|
-
], Tab.prototype, "ariaSelected");
|
|
53
|
-
applyMixins(Tab, AffixIconWithTrailing);
|
|
54
15
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}) => classNames(
|
|
62
|
-
"base",
|
|
63
|
-
[
|
|
64
|
-
`connotation-${connotation}`,
|
|
65
|
-
Boolean(connotation) && ariaSelected === "true"
|
|
66
|
-
],
|
|
67
|
-
[`shape-${shape}`, Boolean(shape)],
|
|
68
|
-
["disabled", Boolean(disabled)],
|
|
69
|
-
["selected", ariaSelected === "true"],
|
|
70
|
-
["icon-trailing", iconTrailing]
|
|
71
|
-
);
|
|
72
|
-
function TabTemplate(context) {
|
|
73
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
74
|
-
return html` <template
|
|
75
|
-
slot="tab"
|
|
76
|
-
role="tab"
|
|
77
|
-
aria-disabled="${(x) => x.disabled}"
|
|
78
|
-
aria-selected="${(x) => x.ariaSelected}"
|
|
79
|
-
>
|
|
80
|
-
<div class="${getClasses}">
|
|
81
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)} ${(x) => x.label}
|
|
82
|
-
</div>
|
|
83
|
-
</template>`;
|
|
16
|
+
function TabPanelTemplate() {
|
|
17
|
+
return html`
|
|
18
|
+
<template slot="tabpanel" role="tabpanel">
|
|
19
|
+
<slot></slot>
|
|
20
|
+
</template>
|
|
21
|
+
`;
|
|
84
22
|
}
|
|
85
23
|
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
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);
|
|
93
32
|
|
|
94
|
-
export {
|
|
33
|
+
export { tabPanelRegistries as a, registerTabPanel as r, tabPanelDefinition as t };
|