@vonage/vivid 3.48.0 → 3.49.0-preview.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/accordion/index.cjs +21 -0
- package/accordion-item/index.cjs +18 -0
- package/action-group/index.cjs +7 -0
- package/alert/index.cjs +30 -0
- package/appearance-ui/index.cjs +96 -0
- package/audio-player/index.cjs +34 -0
- package/avatar/index.cjs +11 -0
- package/badge/index.cjs +14 -0
- package/banner/index.cjs +29 -0
- package/breadcrumb/index.cjs +13 -0
- package/breadcrumb-item/index.cjs +22 -0
- package/button/index.cjs +25 -0
- package/calendar/index.cjs +9 -0
- package/calendar-event/index.cjs +9 -0
- package/card/index.cjs +14 -0
- package/checkbox/index.cjs +21 -0
- package/combobox/index.cjs +39 -0
- package/data-grid/index.cjs +18 -0
- package/date-picker/index.cjs +40 -0
- package/date-range-picker/index.cjs +40 -0
- package/dialog/index.cjs +31 -0
- package/divider/index.cjs +8 -0
- package/elevation/index.cjs +7 -0
- package/empty-state/index.cjs +12 -0
- package/fab/index.cjs +22 -0
- package/file-picker/index.cjs +30 -0
- package/focus/index.cjs +7 -0
- package/header/index.cjs +8 -0
- package/icon/index.cjs +10 -0
- package/index.cjs +296 -0
- package/layout/index.cjs +7 -0
- package/listbox/index.cjs +77 -0
- package/locales/en-GB.cjs +106 -0
- package/locales/en-US.cjs +106 -0
- package/locales/ja-JP.cjs +106 -0
- package/locales/zh-CN.cjs +106 -0
- package/menu/index.cjs +32 -0
- package/menu-item/index.cjs +22 -0
- package/nav/index.cjs +6 -0
- package/nav-disclosure/index.cjs +17 -0
- package/nav-item/index.cjs +22 -0
- package/note/index.cjs +16 -0
- package/number-field/index.cjs +33 -0
- package/option/index.cjs +23 -0
- package/package.json +20 -2
- package/pagination/index.cjs +28 -0
- package/popup/index.cjs +27 -0
- package/progress/index.cjs +9 -0
- package/progress-ring/index.cjs +9 -0
- package/radio/index.cjs +14 -0
- package/radio-group/index.cjs +14 -0
- package/select/index.cjs +38 -0
- package/selectable-box/index.cjs +25 -0
- package/shared/Reflector.cjs +67 -0
- package/shared/_has.cjs +62 -0
- package/shared/affix.cjs +64 -0
- package/shared/affix.js +8 -4
- package/shared/anchor.cjs +90 -0
- package/shared/anchored.cjs +78 -0
- package/shared/apply-mixins.cjs +25 -0
- package/shared/aria-global.cjs +74 -0
- package/shared/aria.cjs +11 -0
- package/shared/aria2.cjs +11 -0
- package/shared/base-progress.cjs +72 -0
- package/shared/breadcrumb-item.cjs +27 -0
- package/shared/button.cjs +202 -0
- package/shared/calendar-event.cjs +41 -0
- package/shared/children.cjs +61 -0
- package/shared/class-names.cjs +17 -0
- package/shared/definition.cjs +165 -0
- package/shared/definition10.cjs +102 -0
- package/shared/definition11.cjs +164 -0
- package/shared/definition11.js +38 -36
- package/shared/definition12.cjs +50 -0
- package/shared/definition13.cjs +779 -0
- package/shared/definition14.cjs +157 -0
- package/shared/definition15.cjs +249 -0
- package/shared/definition16.cjs +746 -0
- package/shared/definition17.cjs +1372 -0
- package/shared/definition18.cjs +175 -0
- package/shared/definition19.cjs +416 -0
- package/shared/definition2.cjs +232 -0
- package/shared/definition20.cjs +278 -0
- package/shared/definition21.cjs +83 -0
- package/shared/definition22.cjs +74 -0
- package/shared/definition23.cjs +106 -0
- package/shared/definition24.cjs +2392 -0
- package/shared/definition25.cjs +75 -0
- package/shared/definition26.cjs +39 -0
- package/shared/definition27.cjs +66 -0
- package/shared/definition28.cjs +849 -0
- package/shared/definition29.cjs +72 -0
- package/shared/definition3.cjs +72 -0
- package/shared/definition30.cjs +98 -0
- package/shared/definition31.cjs +37 -0
- package/shared/definition32.cjs +24 -0
- package/shared/definition33.cjs +64 -0
- package/shared/definition34.cjs +533 -0
- package/shared/definition35.cjs +295 -0
- package/shared/definition36.cjs +219 -0
- package/shared/definition37.cjs +109 -0
- package/shared/definition38.cjs +92 -0
- package/shared/definition39.cjs +448 -0
- package/shared/definition4.cjs +198 -0
- package/shared/definition40.cjs +49 -0
- package/shared/definition41.cjs +694 -0
- package/shared/definition42.cjs +152 -0
- package/shared/definition43.cjs +113 -0
- package/shared/definition44.cjs +607 -0
- package/shared/definition45.cjs +152 -0
- package/shared/definition46.cjs +166 -0
- package/shared/definition47.cjs +35 -0
- package/shared/definition48.cjs +98 -0
- package/shared/definition49.cjs +543 -0
- package/shared/definition5.cjs +199 -0
- package/shared/definition50.cjs +52 -0
- package/shared/definition51.cjs +150 -0
- package/shared/definition52.cjs +304 -0
- package/shared/definition53.cjs +309 -0
- package/shared/definition54.cjs +146 -0
- package/shared/definition55.cjs +128 -0
- package/shared/definition56.cjs +99 -0
- package/shared/definition57.cjs +310 -0
- package/shared/definition58.cjs +20 -0
- package/shared/definition59.cjs +51 -0
- package/shared/definition6.cjs +83 -0
- package/shared/definition60.cjs +1810 -0
- package/shared/definition7.cjs +72 -0
- package/shared/definition8.cjs +152 -0
- package/shared/definition9.cjs +69 -0
- package/shared/dialog-polyfill.esm.cjs +862 -0
- package/shared/direction.cjs +22 -0
- package/shared/dom.cjs +23 -0
- package/shared/enums.cjs +87 -0
- package/shared/focus.cjs +8 -0
- package/shared/focus2.cjs +11 -0
- package/shared/form-associated.cjs +470 -0
- package/shared/icon.cjs +237 -0
- package/shared/index.cjs +5061 -0
- package/shared/index2.cjs +231 -0
- package/shared/key-codes.cjs +115 -0
- package/shared/key-codes2.cjs +14 -0
- package/shared/listbox.cjs +1072 -0
- package/shared/localized.cjs +11 -0
- package/shared/numbers.cjs +38 -0
- package/shared/patterns/affix.d.ts +5 -1
- package/shared/presentationDate.cjs +6192 -0
- package/shared/radio.cjs +153 -0
- package/shared/ref.cjs +43 -0
- package/shared/repeat.cjs +767 -0
- package/shared/select.options.cjs +12 -0
- package/shared/slotted.cjs +123 -0
- package/shared/start-end.cjs +52 -0
- package/shared/strings.cjs +11 -0
- package/shared/text-anchor.cjs +33 -0
- package/shared/text-anchor.template.cjs +48 -0
- package/shared/text-field.cjs +5 -0
- package/shared/text-field2.cjs +228 -0
- package/shared/tree-item.cjs +154 -0
- package/shared/when.cjs +31 -0
- package/side-drawer/index.cjs +8 -0
- package/slider/index.cjs +16 -0
- package/split-button/index.cjs +20 -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 +15 -0
- package/tab/index.cjs +17 -0
- package/tab-panel/index.cjs +6 -0
- package/tabs/index.cjs +24 -0
- package/tag/index.cjs +17 -0
- package/tag-group/index.cjs +7 -0
- package/text-anchor/index.cjs +24 -0
- package/text-area/index.cjs +25 -0
- package/text-field/index.cjs +27 -0
- package/toggletip/index.cjs +29 -0
- package/tooltip/index.cjs +29 -0
- package/tree-item/index.cjs +22 -0
- package/tree-view/index.cjs +14 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
5
|
+
const formAssociated = require('./form-associated.cjs');
|
|
6
|
+
const ariaGlobal = require('./aria-global.cjs');
|
|
7
|
+
const startEnd = require('./start-end.cjs');
|
|
8
|
+
|
|
9
|
+
class _Button extends index.FoundationElement {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* A form-associated base class for the {@link @microsoft/fast-foundation#(Button:class)} component.
|
|
13
|
+
*
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
class FormAssociatedButton extends formAssociated.FormAssociated(_Button) {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.proxy = document.createElement("input");
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A Button Custom HTML Element.
|
|
25
|
+
* Based largely on the {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button | <button> element }.
|
|
26
|
+
*
|
|
27
|
+
* @slot start - Content which can be provided before the button content
|
|
28
|
+
* @slot end - Content which can be provided after the button content
|
|
29
|
+
* @slot - The default slot for button content
|
|
30
|
+
* @csspart control - The button element
|
|
31
|
+
* @csspart content - The element wrapping button content
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
let Button$1 = class Button extends FormAssociatedButton {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(...arguments);
|
|
38
|
+
/**
|
|
39
|
+
* Prevent events to propagate if disabled and has no slotted content wrapped in HTML elements
|
|
40
|
+
* @internal
|
|
41
|
+
*/
|
|
42
|
+
this.handleClick = (e) => {
|
|
43
|
+
var _a;
|
|
44
|
+
if (this.disabled && ((_a = this.defaultSlottedContent) === null || _a === void 0 ? void 0 : _a.length) <= 1) {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Submits the parent form
|
|
50
|
+
*/
|
|
51
|
+
this.handleSubmission = () => {
|
|
52
|
+
if (!this.form) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const attached = this.proxy.isConnected;
|
|
56
|
+
if (!attached) {
|
|
57
|
+
this.attachProxy();
|
|
58
|
+
}
|
|
59
|
+
// Browser support for requestSubmit is not comprehensive
|
|
60
|
+
// so click the proxy if it isn't supported
|
|
61
|
+
typeof this.form.requestSubmit === "function"
|
|
62
|
+
? this.form.requestSubmit(this.proxy)
|
|
63
|
+
: this.proxy.click();
|
|
64
|
+
if (!attached) {
|
|
65
|
+
this.detachProxy();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Resets the parent form
|
|
70
|
+
*/
|
|
71
|
+
this.handleFormReset = () => {
|
|
72
|
+
var _a;
|
|
73
|
+
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Overrides the focus call for where delegatesFocus is unsupported.
|
|
77
|
+
* This check works for Chrome, Edge Chromium, FireFox, and Safari
|
|
78
|
+
* Relevant PR on the Firefox browser: https://phabricator.services.mozilla.com/D123858
|
|
79
|
+
*/
|
|
80
|
+
this.handleUnsupportedDelegatesFocus = () => {
|
|
81
|
+
var _a;
|
|
82
|
+
// Check to see if delegatesFocus is supported
|
|
83
|
+
if (window.ShadowRoot &&
|
|
84
|
+
!window.ShadowRoot.prototype.hasOwnProperty("delegatesFocus") &&
|
|
85
|
+
((_a = this.$fastController.definition.shadowOptions) === null || _a === void 0 ? void 0 : _a.delegatesFocus)) {
|
|
86
|
+
this.focus = () => {
|
|
87
|
+
this.control.focus();
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
formactionChanged() {
|
|
93
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
94
|
+
this.proxy.formAction = this.formaction;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
formenctypeChanged() {
|
|
98
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
99
|
+
this.proxy.formEnctype = this.formenctype;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
formmethodChanged() {
|
|
103
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
104
|
+
this.proxy.formMethod = this.formmethod;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
formnovalidateChanged() {
|
|
108
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
109
|
+
this.proxy.formNoValidate = this.formnovalidate;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
formtargetChanged() {
|
|
113
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
114
|
+
this.proxy.formTarget = this.formtarget;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
typeChanged(previous, next) {
|
|
118
|
+
if (this.proxy instanceof HTMLInputElement) {
|
|
119
|
+
this.proxy.type = this.type;
|
|
120
|
+
}
|
|
121
|
+
next === "submit" && this.addEventListener("click", this.handleSubmission);
|
|
122
|
+
previous === "submit" && this.removeEventListener("click", this.handleSubmission);
|
|
123
|
+
next === "reset" && this.addEventListener("click", this.handleFormReset);
|
|
124
|
+
previous === "reset" && this.removeEventListener("click", this.handleFormReset);
|
|
125
|
+
}
|
|
126
|
+
/** {@inheritDoc (FormAssociated:interface).validate} */
|
|
127
|
+
validate() {
|
|
128
|
+
super.validate(this.control);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* @internal
|
|
132
|
+
*/
|
|
133
|
+
connectedCallback() {
|
|
134
|
+
var _a;
|
|
135
|
+
super.connectedCallback();
|
|
136
|
+
this.proxy.setAttribute("type", this.type);
|
|
137
|
+
this.handleUnsupportedDelegatesFocus();
|
|
138
|
+
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
139
|
+
if (elements) {
|
|
140
|
+
elements.forEach((span) => {
|
|
141
|
+
span.addEventListener("click", this.handleClick);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
disconnectedCallback() {
|
|
149
|
+
var _a;
|
|
150
|
+
super.disconnectedCallback();
|
|
151
|
+
const elements = Array.from((_a = this.control) === null || _a === void 0 ? void 0 : _a.children);
|
|
152
|
+
if (elements) {
|
|
153
|
+
elements.forEach((span) => {
|
|
154
|
+
span.removeEventListener("click", this.handleClick);
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
index.__decorate([
|
|
160
|
+
index.attr({ mode: "boolean" })
|
|
161
|
+
], Button$1.prototype, "autofocus", void 0);
|
|
162
|
+
index.__decorate([
|
|
163
|
+
index.attr({ attribute: "form" })
|
|
164
|
+
], Button$1.prototype, "formId", void 0);
|
|
165
|
+
index.__decorate([
|
|
166
|
+
index.attr
|
|
167
|
+
], Button$1.prototype, "formaction", void 0);
|
|
168
|
+
index.__decorate([
|
|
169
|
+
index.attr
|
|
170
|
+
], Button$1.prototype, "formenctype", void 0);
|
|
171
|
+
index.__decorate([
|
|
172
|
+
index.attr
|
|
173
|
+
], Button$1.prototype, "formmethod", void 0);
|
|
174
|
+
index.__decorate([
|
|
175
|
+
index.attr({ mode: "boolean" })
|
|
176
|
+
], Button$1.prototype, "formnovalidate", void 0);
|
|
177
|
+
index.__decorate([
|
|
178
|
+
index.attr
|
|
179
|
+
], Button$1.prototype, "formtarget", void 0);
|
|
180
|
+
index.__decorate([
|
|
181
|
+
index.attr
|
|
182
|
+
], Button$1.prototype, "type", void 0);
|
|
183
|
+
index.__decorate([
|
|
184
|
+
index.observable
|
|
185
|
+
], Button$1.prototype, "defaultSlottedContent", void 0);
|
|
186
|
+
/**
|
|
187
|
+
* Includes ARIA states and properties relating to the ARIA button role
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
191
|
+
class DelegatesARIAButton {
|
|
192
|
+
}
|
|
193
|
+
index.__decorate([
|
|
194
|
+
index.attr({ attribute: "aria-expanded" })
|
|
195
|
+
], DelegatesARIAButton.prototype, "ariaExpanded", void 0);
|
|
196
|
+
index.__decorate([
|
|
197
|
+
index.attr({ attribute: "aria-pressed" })
|
|
198
|
+
], DelegatesARIAButton.prototype, "ariaPressed", void 0);
|
|
199
|
+
applyMixins.applyMixins(DelegatesARIAButton, ariaGlobal.ARIAGlobalStatesAndProperties);
|
|
200
|
+
applyMixins.applyMixins(Button$1, startEnd.StartEnd, DelegatesARIAButton);
|
|
201
|
+
|
|
202
|
+
exports.Button = Button$1;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
8
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
9
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
10
|
+
if (decorator = decorators[i])
|
|
11
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
12
|
+
if (kind && result)
|
|
13
|
+
__defProp(target, key, result);
|
|
14
|
+
return result;
|
|
15
|
+
};
|
|
16
|
+
class CalendarEvent extends index.FoundationElement {
|
|
17
|
+
// TODO should be converted to allowed range
|
|
18
|
+
}
|
|
19
|
+
__decorateClass([
|
|
20
|
+
index.attr
|
|
21
|
+
], CalendarEvent.prototype, "heading", 2);
|
|
22
|
+
__decorateClass([
|
|
23
|
+
index.attr
|
|
24
|
+
], CalendarEvent.prototype, "description", 2);
|
|
25
|
+
__decorateClass([
|
|
26
|
+
index.attr
|
|
27
|
+
], CalendarEvent.prototype, "connotation", 2);
|
|
28
|
+
__decorateClass([
|
|
29
|
+
index.attr
|
|
30
|
+
], CalendarEvent.prototype, "appearance", 2);
|
|
31
|
+
__decorateClass([
|
|
32
|
+
index.attr({ converter: index.nullableNumberConverter, attribute: "overlap-count" })
|
|
33
|
+
], CalendarEvent.prototype, "overlapCount", 2);
|
|
34
|
+
__decorateClass([
|
|
35
|
+
index.attr({ converter: index.nullableNumberConverter })
|
|
36
|
+
], CalendarEvent.prototype, "start", 2);
|
|
37
|
+
__decorateClass([
|
|
38
|
+
index.attr({ converter: index.nullableNumberConverter })
|
|
39
|
+
], CalendarEvent.prototype, "duration", 2);
|
|
40
|
+
|
|
41
|
+
exports.CalendarEvent = CalendarEvent;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const slotted = require('./slotted.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The runtime behavior for child node observation.
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
class ChildrenBehavior extends slotted.NodeObservationBehavior {
|
|
11
|
+
/**
|
|
12
|
+
* Creates an instance of ChildrenBehavior.
|
|
13
|
+
* @param target - The element target to observe children on.
|
|
14
|
+
* @param options - The options to use when observing the element children.
|
|
15
|
+
*/
|
|
16
|
+
constructor(target, options) {
|
|
17
|
+
super(target, options);
|
|
18
|
+
this.observer = null;
|
|
19
|
+
options.childList = true;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Begins observation of the nodes.
|
|
23
|
+
*/
|
|
24
|
+
observe() {
|
|
25
|
+
if (this.observer === null) {
|
|
26
|
+
this.observer = new MutationObserver(this.handleEvent.bind(this));
|
|
27
|
+
}
|
|
28
|
+
this.observer.observe(this.target, this.options);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Disconnects observation of the nodes.
|
|
32
|
+
*/
|
|
33
|
+
disconnect() {
|
|
34
|
+
this.observer.disconnect();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves the nodes that should be assigned to the target.
|
|
38
|
+
*/
|
|
39
|
+
getNodes() {
|
|
40
|
+
if ("subtree" in this.options) {
|
|
41
|
+
return Array.from(this.target.querySelectorAll(this.options.selector));
|
|
42
|
+
}
|
|
43
|
+
return Array.from(this.target.childNodes);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A directive that observes the `childNodes` of an element and updates a property
|
|
48
|
+
* whenever they change.
|
|
49
|
+
* @param propertyOrOptions - The options used to configure child node observation.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
function children(propertyOrOptions) {
|
|
53
|
+
if (typeof propertyOrOptions === "string") {
|
|
54
|
+
propertyOrOptions = {
|
|
55
|
+
property: propertyOrOptions,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return new index.AttachedBehaviorHTMLDirective("fast-children", ChildrenBehavior, propertyOrOptions);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
exports.children = children;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function classNames(...args) {
|
|
4
|
+
return args.reduce((accum, value) => {
|
|
5
|
+
const leadingChar = accum.length ? " " : "";
|
|
6
|
+
const normalizedValue = Array.isArray(value) && value[1]
|
|
7
|
+
? classNames.call(null, value[0])
|
|
8
|
+
: typeof value === "function"
|
|
9
|
+
? value()
|
|
10
|
+
: typeof value === "string"
|
|
11
|
+
? value
|
|
12
|
+
: "";
|
|
13
|
+
return !normalizedValue.length ? accum : accum + leadingChar + normalizedValue;
|
|
14
|
+
}, "");
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
exports.classNames = classNames;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const definition = require('./definition26.cjs');
|
|
5
|
+
const definition$1 = require('./definition58.cjs');
|
|
6
|
+
const affix = require('./affix.cjs');
|
|
7
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
8
|
+
const startEnd = require('./start-end.cjs');
|
|
9
|
+
const ref = require('./ref.cjs');
|
|
10
|
+
const when = require('./when.cjs');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* An individual item in an {@link @microsoft/fast-foundation#(Accordion:class) }.
|
|
14
|
+
*
|
|
15
|
+
* @slot start - Content which can be provided between the heading and the icon
|
|
16
|
+
* @slot end - Content which can be provided between the start slot and icon
|
|
17
|
+
* @slot heading - Content which serves as the accordion item heading and text of the expand button
|
|
18
|
+
* @slot - The default slot for accordion item content
|
|
19
|
+
* @slot expanded-icon - The expanded icon
|
|
20
|
+
* @slot collapsed-icon - The collapsed icon
|
|
21
|
+
* @fires change - Fires a custom 'change' event when the button is invoked
|
|
22
|
+
* @csspart heading - Wraps the button
|
|
23
|
+
* @csspart button - The button which serves to invoke the item
|
|
24
|
+
* @csspart heading-content - Wraps the slot for the heading content within the button
|
|
25
|
+
* @csspart icon - The icon container
|
|
26
|
+
* @csspart expanded-icon - The expanded icon slot
|
|
27
|
+
* @csspart collapsed-icon - The collapsed icon
|
|
28
|
+
* @csspart region - The wrapper for the accordion item content
|
|
29
|
+
*
|
|
30
|
+
* @public
|
|
31
|
+
*/
|
|
32
|
+
let AccordionItem$1 = class AccordionItem extends index.FoundationElement {
|
|
33
|
+
constructor() {
|
|
34
|
+
super(...arguments);
|
|
35
|
+
/**
|
|
36
|
+
* Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the
|
|
37
|
+
* heading element.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue 2
|
|
40
|
+
* @public
|
|
41
|
+
* @remarks
|
|
42
|
+
* HTML attribute: heading-level
|
|
43
|
+
*/
|
|
44
|
+
this.headinglevel = 2;
|
|
45
|
+
/**
|
|
46
|
+
* Expands or collapses the item.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
* @remarks
|
|
50
|
+
* HTML attribute: expanded
|
|
51
|
+
*/
|
|
52
|
+
this.expanded = false;
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
this.clickHandler = (e) => {
|
|
57
|
+
this.expanded = !this.expanded;
|
|
58
|
+
this.change();
|
|
59
|
+
};
|
|
60
|
+
this.change = () => {
|
|
61
|
+
this.$emit("change");
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
index.__decorate([
|
|
66
|
+
index.attr({
|
|
67
|
+
attribute: "heading-level",
|
|
68
|
+
mode: "fromView",
|
|
69
|
+
converter: index.nullableNumberConverter,
|
|
70
|
+
})
|
|
71
|
+
], AccordionItem$1.prototype, "headinglevel", void 0);
|
|
72
|
+
index.__decorate([
|
|
73
|
+
index.attr({ mode: "boolean" })
|
|
74
|
+
], AccordionItem$1.prototype, "expanded", void 0);
|
|
75
|
+
index.__decorate([
|
|
76
|
+
index.attr
|
|
77
|
+
], AccordionItem$1.prototype, "id", void 0);
|
|
78
|
+
applyMixins.applyMixins(AccordionItem$1, startEnd.StartEnd);
|
|
79
|
+
|
|
80
|
+
const styles = ":host{display:flex;box-sizing:border-box;flex-direction:column}.heading-container{margin:0}.heading-button{--focus-stroke-gap-color: transparent;display:flex;width:100%;align-items:center;padding:16px;border:none;background-color:var(--_appearance-color-fill);color:var(--_appearance-color-text);cursor:pointer;text-align:left}.heading-button{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.heading-button:where(:hover,.hover):where(:not(:disabled,.disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.heading-button:where(:active,.active):where(:not(:disabled,.disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.heading-button{--_connotation-color-primary: var(--vvd-accordion-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-accordion-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-accordion-item-accent-soft, var(--vvd-color-neutral-100))}.heading-button: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))}.heading-button.size-condensed{font:var(--vvd-typography-base-bold);gap:12px}.heading-button:not(.size-condensed){font:var(--vvd-typography-heading-4);gap:16px}.heading-content{flex:auto}.meta{overflow:hidden;max-width:20%;flex-shrink:0;color:var(--vvd-color-neutral-600);text-align:end;text-overflow:ellipsis;white-space:nowrap}.heading-button:not(.size-condensed) .meta{font:var(--vvd-typography-base-bold)}.heading-button.size-condensed .meta{font:var(--vvd-typography-base-condensed-bold)}.region{display:none;padding:8px 32px 24px 16px}.region:not(.size-condensed).padded{padding-inline-start:52px}:host([expanded]) .region{display:block}.region.size-condensed.padded{padding-inline-start:44px}slot[name=icon]{color:var(--vvd-color-neutral-600)}.heading-button:not(.size-condensed) slot[name=icon]{font:inherit}.heading-button.size-condensed slot[name=icon]{font:var(--vvd-typography-base-extended)}:host(:not([icon-trailing])) slot[name=icon]:last-of-type{color:var(--_appearance-color-text)}\n";
|
|
81
|
+
|
|
82
|
+
var __defProp = Object.defineProperty;
|
|
83
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
84
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
85
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
86
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
87
|
+
if (decorator = decorators[i])
|
|
88
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
89
|
+
if (kind && result)
|
|
90
|
+
__defProp(target, key, result);
|
|
91
|
+
return result;
|
|
92
|
+
};
|
|
93
|
+
class AccordionItem extends AccordionItem$1 {
|
|
94
|
+
constructor() {
|
|
95
|
+
super(...arguments);
|
|
96
|
+
this.noIndicator = false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
__decorateClass([
|
|
100
|
+
index.attr
|
|
101
|
+
], AccordionItem.prototype, "heading", 2);
|
|
102
|
+
__decorateClass([
|
|
103
|
+
index.attr({ mode: "boolean", attribute: "no-indicator" })
|
|
104
|
+
], AccordionItem.prototype, "noIndicator", 2);
|
|
105
|
+
__decorateClass([
|
|
106
|
+
index.attr
|
|
107
|
+
], AccordionItem.prototype, "meta", 2);
|
|
108
|
+
__decorateClass([
|
|
109
|
+
index.attr
|
|
110
|
+
], AccordionItem.prototype, "size", 2);
|
|
111
|
+
applyMixins.applyMixins(AccordionItem, affix.AffixIconWithTrailing);
|
|
112
|
+
|
|
113
|
+
const header = (context, hTag) => {
|
|
114
|
+
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
115
|
+
return index.html`
|
|
116
|
+
<${hTag} class="heading-container">
|
|
117
|
+
<button
|
|
118
|
+
class="heading-button ${(x) => x.size ? `size-${x.size}` : ""}"
|
|
119
|
+
id="${(x) => x.id}"
|
|
120
|
+
aria-expanded="${(x) => x.expanded}"
|
|
121
|
+
aria-controls="${(x) => x.id}-panel"
|
|
122
|
+
@click="${(x, c) => x.clickHandler(c.event)}"
|
|
123
|
+
${ref.ref("expandbutton")}
|
|
124
|
+
>
|
|
125
|
+
|
|
126
|
+
${(x) => !x.iconTrailing ? affixIconTemplate(x.icon, affix.IconWrapper.Slot) : null}
|
|
127
|
+
|
|
128
|
+
<span class="heading-content">${(x) => x.heading}</span>
|
|
129
|
+
|
|
130
|
+
${when.when((x) => x.meta, index.html`<span class="meta">${(x) => x.meta}</span>`)}
|
|
131
|
+
|
|
132
|
+
${(x) => x.icon && x.iconTrailing ? affixIconTemplate(x.icon) : null}
|
|
133
|
+
${(x) => !(x.icon && x.iconTrailing) && !x.noIndicator ? affixIconTemplate(x.expanded ? "chevron-up-solid" : "chevron-down-solid") : null}
|
|
134
|
+
|
|
135
|
+
</button>
|
|
136
|
+
</${hTag}>
|
|
137
|
+
`;
|
|
138
|
+
};
|
|
139
|
+
const AccordionItemTemplate = (context) => index.html`
|
|
140
|
+
${(x) => header(context, "h" + x.headinglevel)}
|
|
141
|
+
<div
|
|
142
|
+
id="${(x) => x.id}-panel"
|
|
143
|
+
aria-labelledby="${(x) => x.id}"
|
|
144
|
+
role="region"
|
|
145
|
+
class="region ${(x) => x.icon && !x.iconTrailing ? "padded" : ""} ${(x) => x.size ? `size-${x.size}` : ""}"
|
|
146
|
+
>
|
|
147
|
+
<slot></slot>
|
|
148
|
+
</div>
|
|
149
|
+
`;
|
|
150
|
+
|
|
151
|
+
const accordionItemDefinition = AccordionItem.compose({
|
|
152
|
+
baseName: "accordion-item",
|
|
153
|
+
template: AccordionItemTemplate,
|
|
154
|
+
styles,
|
|
155
|
+
shadowOptions: {
|
|
156
|
+
delegatesFocus: true
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
const accordionItemRegistries = [accordionItemDefinition(), ...definition.iconRegistries, ...definition$1.focusRegistries];
|
|
160
|
+
const registerAccordionItem = index.registerFactory(accordionItemRegistries);
|
|
161
|
+
|
|
162
|
+
exports.AccordionItem = AccordionItem$1;
|
|
163
|
+
exports.accordionItemDefinition = accordionItemDefinition;
|
|
164
|
+
exports.accordionItemRegistries = accordionItemRegistries;
|
|
165
|
+
exports.registerAccordionItem = registerAccordionItem;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const index = require('./index.cjs');
|
|
4
|
+
const slotted = require('./slotted.cjs');
|
|
5
|
+
const breadcrumbItem = require('./breadcrumb-item.cjs');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A Breadcrumb Custom HTML Element.
|
|
9
|
+
* @slot - The default slot for the breadcrumb items
|
|
10
|
+
* @csspart list - The element wrapping the slotted items
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
let Breadcrumb$1 = class Breadcrumb extends index.FoundationElement {
|
|
15
|
+
slottedBreadcrumbItemsChanged() {
|
|
16
|
+
if (this.$fastController.isConnected) {
|
|
17
|
+
if (this.slottedBreadcrumbItems === undefined ||
|
|
18
|
+
this.slottedBreadcrumbItems.length === 0) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const lastNode = this.slottedBreadcrumbItems[this.slottedBreadcrumbItems.length - 1];
|
|
22
|
+
this.slottedBreadcrumbItems.forEach((item) => {
|
|
23
|
+
const itemIsLastNode = item === lastNode;
|
|
24
|
+
this.setItemSeparator(item, itemIsLastNode);
|
|
25
|
+
this.setAriaCurrent(item, itemIsLastNode);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
setItemSeparator(item, isLastNode) {
|
|
30
|
+
if (item instanceof breadcrumbItem.BreadcrumbItem) {
|
|
31
|
+
item.separator = !isLastNode;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Finds href on childnodes in the light DOM or shadow DOM.
|
|
36
|
+
* We look in the shadow DOM because we insert an anchor when breadcrumb-item has an href.
|
|
37
|
+
*/
|
|
38
|
+
findChildWithHref(node) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
if (node.childElementCount > 0) {
|
|
41
|
+
return node.querySelector("a[href]");
|
|
42
|
+
}
|
|
43
|
+
else if ((_a = node.shadowRoot) === null || _a === void 0 ? void 0 : _a.childElementCount) {
|
|
44
|
+
return (_b = node.shadowRoot) === null || _b === void 0 ? void 0 : _b.querySelector("a[href]");
|
|
45
|
+
}
|
|
46
|
+
else
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Sets ARIA Current for the current node
|
|
51
|
+
* If child node with an anchor tag and with href is found then set aria-current to correct value for the child node,
|
|
52
|
+
* otherwise apply aria-current to the host element, with an href
|
|
53
|
+
*/
|
|
54
|
+
setAriaCurrent(item, isLastNode) {
|
|
55
|
+
const childNodeWithHref = this.findChildWithHref(item);
|
|
56
|
+
if (childNodeWithHref === null &&
|
|
57
|
+
item.hasAttribute("href") &&
|
|
58
|
+
item instanceof breadcrumbItem.BreadcrumbItem) {
|
|
59
|
+
isLastNode
|
|
60
|
+
? item.setAttribute("aria-current", "page")
|
|
61
|
+
: item.removeAttribute("aria-current");
|
|
62
|
+
}
|
|
63
|
+
else if (childNodeWithHref !== null) {
|
|
64
|
+
isLastNode
|
|
65
|
+
? childNodeWithHref.setAttribute("aria-current", "page")
|
|
66
|
+
: childNodeWithHref.removeAttribute("aria-current");
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
index.__decorate([
|
|
71
|
+
index.observable
|
|
72
|
+
], Breadcrumb$1.prototype, "slottedBreadcrumbItems", void 0);
|
|
73
|
+
|
|
74
|
+
const breadcrumbTemplate = () => index.html`
|
|
75
|
+
<nav aria-label="breadcrumbs" class="base">
|
|
76
|
+
<div role="list" class="list">
|
|
77
|
+
<slot
|
|
78
|
+
${slotted.slotted({
|
|
79
|
+
property: "slottedBreadcrumbItems",
|
|
80
|
+
filter: slotted.elements()
|
|
81
|
+
})}
|
|
82
|
+
></slot>
|
|
83
|
+
</div>
|
|
84
|
+
</nav>
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
const styles = ".list{display:flex}\n";
|
|
88
|
+
|
|
89
|
+
class Breadcrumb extends Breadcrumb$1 {
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const breadcrumbDefinition = Breadcrumb.compose({
|
|
93
|
+
baseName: "breadcrumb",
|
|
94
|
+
template: breadcrumbTemplate,
|
|
95
|
+
styles
|
|
96
|
+
});
|
|
97
|
+
const breadcrumbRegistries = [breadcrumbDefinition()];
|
|
98
|
+
const registerBreadcrumb = index.registerFactory(breadcrumbRegistries);
|
|
99
|
+
|
|
100
|
+
exports.breadcrumbDefinition = breadcrumbDefinition;
|
|
101
|
+
exports.breadcrumbRegistries = breadcrumbRegistries;
|
|
102
|
+
exports.registerBreadcrumb = registerBreadcrumb;
|