@vonage/vivid 3.31.0 → 3.34.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.js +5 -5
- package/accordion-item/index.js +4 -4
- package/action-group/index.js +1 -1
- package/alert/index.js +8 -7
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +5 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +4 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +3 -3
- package/checkbox/index.js +7 -4
- package/combobox/index.js +10 -9
- package/custom-elements.json +996 -29
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +35 -0
- package/dialog/index.js +6 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +4 -4
- package/file-picker/index.js +7 -6
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +68 -66
- package/layout/index.js +1 -1
- package/lib/button/button.d.ts +2 -0
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/components.d.ts +20 -19
- package/lib/date-picker/calendar/calendarGrid.d.ts +17 -0
- package/lib/date-picker/calendar/dateStr.d.ts +7 -0
- package/lib/date-picker/calendar/month.d.ts +12 -0
- package/lib/date-picker/calendar/monthPickerGrid.d.ts +10 -0
- package/lib/date-picker/calendar/presentationDate.d.ts +4 -0
- package/lib/date-picker/calendar/year.d.ts +2 -0
- package/lib/date-picker/date-picker.d.ts +18 -0
- package/lib/date-picker/date-picker.template.d.ts +4 -0
- package/lib/date-picker/definition.d.ts +3 -0
- package/lib/date-picker/locale.d.ts +21 -0
- package/lib/icon/icon.d.ts +0 -1
- package/lib/listbox/listbox.d.ts +9 -1
- package/lib/select/select.d.ts +4 -2
- package/lib/text-field/text-field.d.ts +1 -0
- package/listbox/index.js +22 -17
- package/locales/en-GB.d.ts +3 -0
- package/locales/en-GB.js +59 -0
- package/locales/en-US.d.ts +3 -0
- package/locales/en-US.js +59 -0
- package/locales/ja-JP.d.ts +3 -0
- package/locales/ja-JP.js +59 -0
- package/locales/zh-CN.d.ts +3 -0
- package/locales/zh-CN.js +59 -0
- package/menu/index.js +8 -8
- package/menu-item/index.js +4 -4
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +4 -4
- package/number-field/index.js +8 -7
- package/option/index.js +5 -4
- package/package.json +2 -15
- package/pagination/index.js +5 -5
- package/popup/index.js +6 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +1 -1
- package/select/index.js +10 -9
- package/shared/affix.js +25 -9
- package/shared/apply-mixins.js +1 -1
- package/shared/breadcrumb-item.js +5 -5
- package/shared/button.js +13 -13
- package/shared/calendar-event.js +36 -16
- package/shared/definition.js +133 -194
- package/shared/definition10.js +225 -40
- package/shared/definition11.js +36 -32
- package/shared/definition12.js +763 -98
- package/shared/definition13.js +125 -89
- package/shared/definition14.js +207 -27
- package/shared/definition15.js +710 -731
- package/shared/definition16.js +1289 -47
- package/shared/definition17.js +6113 -93
- package/shared/definition18.js +242 -164
- package/shared/definition19.js +47 -692
- package/shared/definition2.js +199 -117
- package/shared/definition20.js +59 -1671
- package/shared/definition21.js +95 -255
- package/shared/definition22.js +2218 -1167
- package/shared/definition23.js +57 -219
- package/shared/definition24.js +27 -68
- package/shared/definition25.js +54 -38
- package/shared/definition26.js +395 -70
- package/shared/definition27.js +381 -2223
- package/shared/definition28.js +85 -44
- package/shared/definition29.js +27 -40
- package/shared/definition3.js +61 -24
- package/shared/definition30.js +13 -427
- package/shared/definition31.js +49 -360
- package/shared/definition32.js +466 -13
- package/shared/definition33.js +273 -63
- package/shared/definition34.js +195 -25
- package/shared/definition35.js +86 -35
- package/shared/definition36.js +66 -427
- package/shared/definition37.js +430 -190
- package/shared/definition38.js +34 -52
- package/shared/definition39.js +683 -31
- package/shared/definition4.js +157 -12
- package/shared/definition40.js +97 -422
- package/shared/definition41.js +473 -543
- package/shared/definition42.js +122 -73
- package/shared/definition43.js +103 -502
- package/shared/definition44.js +23 -101
- package/shared/definition45.js +76 -126
- package/shared/definition46.js +494 -48
- package/shared/definition47.js +23 -23
- package/shared/definition48.js +126 -476
- package/shared/definition49.js +275 -98
- package/shared/definition5.js +71 -36
- package/shared/definition50.js +157 -16
- package/shared/definition51.js +133 -263
- package/shared/definition52.js +131 -115
- package/shared/definition53.js +85 -120
- package/shared/definition54.js +295 -111
- package/shared/definition55.js +12 -71
- package/shared/definition56.js +39 -295
- package/shared/definition57.js +181 -0
- package/shared/definition6.js +56 -111
- package/shared/definition7.js +119 -187
- package/shared/definition8.js +58 -23
- package/shared/definition9.js +92 -66
- package/shared/focus.js +2 -1
- package/shared/focus2.js +1 -1
- package/shared/form-associated.js +2 -2
- package/shared/icon.js +48 -27
- package/shared/index.js +7 -27
- package/shared/index2.js +202 -0
- package/shared/key-codes.js +1 -1
- package/shared/listbox.js +88 -11
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/localization/index.d.ts +7 -0
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/patterns/index.d.ts +1 -0
- package/shared/patterns/localized.d.ts +4 -0
- package/shared/radio.js +23 -7
- package/shared/repeat.js +1 -1
- package/shared/text-anchor.js +21 -4
- package/shared/text-anchor.template.js +37 -40
- package/shared/text-field.js +2 -2
- package/shared/text-field2.js +15 -15
- package/shared/tree-item.js +12 -12
- package/side-drawer/index.js +1 -1
- package/slider/index.js +2 -2
- package/split-button/index.js +3 -3
- package/style.css +6097 -0
- package/styles/core/all.css +25 -3
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +25 -3
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +2 -2
- package/switch/index.js +5 -4
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +1 -1
- package/text-area/index.js +5 -4
- package/text-field/index.js +5 -4
- package/toggletip/index.js +7 -7
- package/tooltip/index.js +7 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +137 -0
- package/lib/accordion/index.d.ts +0 -1
- package/lib/accordion-item/index.d.ts +0 -1
- package/lib/action-group/index.d.ts +0 -1
- package/lib/alert/index.d.ts +0 -1
- package/lib/avatar/index.d.ts +0 -1
- package/lib/badge/index.d.ts +0 -1
- package/lib/banner/index.d.ts +0 -1
- package/lib/breadcrumb/index.d.ts +0 -1
- package/lib/breadcrumb-item/index.d.ts +0 -1
- package/lib/button/index.d.ts +0 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/index.d.ts +0 -1
- package/lib/card/index.d.ts +0 -1
- package/lib/checkbox/index.d.ts +0 -1
- package/lib/combobox/index.d.ts +0 -1
- package/lib/data-grid/index.d.ts +0 -1
- package/lib/dialog/index.d.ts +0 -1
- package/lib/divider/index.d.ts +0 -1
- package/lib/elevation/index.d.ts +0 -1
- package/lib/empty-state/index.d.ts +0 -1
- package/lib/fab/index.d.ts +0 -1
- package/lib/file-picker/index.d.ts +0 -1
- package/lib/focus/index.d.ts +0 -1
- package/lib/header/index.d.ts +0 -1
- package/lib/icon/index.d.ts +0 -1
- package/lib/layout/index.d.ts +0 -1
- package/lib/listbox/index.d.ts +0 -1
- package/lib/menu/index.d.ts +0 -1
- package/lib/menu-item/index.d.ts +0 -1
- package/lib/nav/index.d.ts +0 -1
- package/lib/nav-disclosure/index.d.ts +0 -1
- package/lib/nav-item/index.d.ts +0 -1
- package/lib/note/index.d.ts +0 -1
- package/lib/number-field/index.d.ts +0 -1
- package/lib/option/index.d.ts +0 -1
- package/lib/pagination/index.d.ts +0 -1
- package/lib/popup/index.d.ts +0 -1
- package/lib/progress/index.d.ts +0 -1
- package/lib/progress-ring/index.d.ts +0 -1
- package/lib/radio/index.d.ts +0 -1
- package/lib/radio-group/index.d.ts +0 -1
- package/lib/select/index.d.ts +0 -1
- package/lib/side-drawer/index.d.ts +0 -1
- package/lib/slider/index.d.ts +0 -1
- package/lib/split-button/index.d.ts +0 -1
- package/lib/switch/index.d.ts +0 -1
- package/lib/tab/index.d.ts +0 -1
- package/lib/tab-panel/index.d.ts +0 -1
- package/lib/tabs/index.d.ts +0 -1
- package/lib/tag/index.d.ts +0 -1
- package/lib/tag-group/index.d.ts +0 -1
- package/lib/text-anchor/index.d.ts +0 -1
- package/lib/text-area/index.d.ts +0 -1
- package/lib/text-field/index.d.ts +0 -1
- package/lib/toggletip/index.d.ts +0 -1
- package/lib/tooltip/index.d.ts +0 -1
- package/lib/tree-item/index.d.ts +0 -1
- package/lib/tree-view/index.d.ts +0 -1
- package/shared/form-elements.js +0 -162
package/radio-group/index.js
CHANGED
package/select/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { r as registerSelect } from '../shared/
|
|
1
|
+
import { r as registerSelect } from '../shared/definition39.js';
|
|
2
2
|
import '../shared/index.js';
|
|
3
|
-
import '../shared/
|
|
3
|
+
import '../shared/definition55.js';
|
|
4
4
|
import '../shared/focus.js';
|
|
5
|
-
import '../shared/
|
|
6
|
-
import '../shared/
|
|
7
|
-
import '../shared/
|
|
5
|
+
import '../shared/definition57.js';
|
|
6
|
+
import '../shared/definition10.js';
|
|
7
|
+
import '../shared/definition24.js';
|
|
8
8
|
import '../shared/icon.js';
|
|
9
9
|
import '../shared/_has.js';
|
|
10
10
|
import '../shared/class-names.js';
|
|
11
11
|
import '../shared/when.js';
|
|
12
|
-
import '../shared/
|
|
12
|
+
import '../shared/definition35.js';
|
|
13
13
|
import '../shared/base-progress.js';
|
|
14
14
|
import '../shared/affix.js';
|
|
15
15
|
import '../shared/button.js';
|
|
@@ -20,10 +20,11 @@ import '../shared/aria-global.js';
|
|
|
20
20
|
import '../shared/start-end.js';
|
|
21
21
|
import '../shared/ref.js';
|
|
22
22
|
import '../shared/focus2.js';
|
|
23
|
-
import '../shared/
|
|
24
|
-
import '../shared/
|
|
23
|
+
import '../shared/definition56.js';
|
|
24
|
+
import '../shared/definition33.js';
|
|
25
25
|
import '../shared/dom.js';
|
|
26
|
-
import '../shared/
|
|
26
|
+
import '../shared/index2.js';
|
|
27
|
+
import '../locales/en-US.js';
|
|
27
28
|
import '../shared/listbox.js';
|
|
28
29
|
import '../shared/strings.js';
|
|
29
30
|
import '../shared/numbers.js';
|
package/shared/affix.js
CHANGED
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
import { _ as __decorate, a as attr, b as __metadata, h as html } from './index.js';
|
|
2
1
|
import { I as Icon } from './icon.js';
|
|
2
|
+
import { a as attr, h as html } from './index.js';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
8
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
+
if (decorator = decorators[i])
|
|
10
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11
|
+
if (kind && result)
|
|
12
|
+
__defProp(target, key, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
class AffixIcon {
|
|
16
|
+
}
|
|
17
|
+
__decorateClass([
|
|
18
|
+
attr
|
|
19
|
+
], AffixIcon.prototype, "icon", 2);
|
|
6
20
|
class AffixIconWithTrailing extends AffixIcon {
|
|
7
21
|
constructor() {
|
|
8
22
|
super(...arguments);
|
|
9
23
|
this.iconTrailing = false;
|
|
10
24
|
}
|
|
11
25
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
26
|
+
__decorateClass([
|
|
27
|
+
attr({
|
|
28
|
+
mode: "boolean",
|
|
29
|
+
attribute: "icon-trailing"
|
|
30
|
+
})
|
|
31
|
+
], AffixIconWithTrailing.prototype, "iconTrailing", 2);
|
|
16
32
|
const affixIconTemplateFactory = (context, withWrapper = true) => {
|
|
17
33
|
const iconTag = context.tagFor(Icon);
|
|
18
|
-
return icon => {
|
|
34
|
+
return (icon) => {
|
|
19
35
|
if (!icon) {
|
|
20
36
|
return null;
|
|
21
37
|
}
|
|
@@ -24,4 +40,4 @@ const affixIconTemplateFactory = (context, withWrapper = true) => {
|
|
|
24
40
|
};
|
|
25
41
|
};
|
|
26
42
|
|
|
27
|
-
export {
|
|
43
|
+
export { AffixIcon as A, affixIconTemplateFactory as a, AffixIconWithTrailing as b };
|
package/shared/apply-mixins.js
CHANGED
|
@@ -8,7 +8,7 @@ import { S as StartEnd } from './start-end.js';
|
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
class BreadcrumbItem extends Anchor {
|
|
11
|
+
let BreadcrumbItem$1 = class BreadcrumbItem extends Anchor {
|
|
12
12
|
constructor() {
|
|
13
13
|
super(...arguments);
|
|
14
14
|
/**
|
|
@@ -16,10 +16,10 @@ class BreadcrumbItem extends Anchor {
|
|
|
16
16
|
*/
|
|
17
17
|
this.separator = true;
|
|
18
18
|
}
|
|
19
|
-
}
|
|
19
|
+
};
|
|
20
20
|
__decorate([
|
|
21
21
|
observable
|
|
22
|
-
], BreadcrumbItem.prototype, "separator", void 0);
|
|
23
|
-
applyMixins(BreadcrumbItem, StartEnd, DelegatesARIALink);
|
|
22
|
+
], BreadcrumbItem$1.prototype, "separator", void 0);
|
|
23
|
+
applyMixins(BreadcrumbItem$1, StartEnd, DelegatesARIALink);
|
|
24
24
|
|
|
25
|
-
export { BreadcrumbItem as B };
|
|
25
|
+
export { BreadcrumbItem$1 as B };
|
package/shared/button.js
CHANGED
|
@@ -30,7 +30,7 @@ class FormAssociatedButton extends FormAssociated(_Button) {
|
|
|
30
30
|
*
|
|
31
31
|
* @public
|
|
32
32
|
*/
|
|
33
|
-
class Button extends FormAssociatedButton {
|
|
33
|
+
let Button$1 = class Button extends FormAssociatedButton {
|
|
34
34
|
constructor() {
|
|
35
35
|
super(...arguments);
|
|
36
36
|
/**
|
|
@@ -153,34 +153,34 @@ class Button extends FormAssociatedButton {
|
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
155
|
}
|
|
156
|
-
}
|
|
156
|
+
};
|
|
157
157
|
__decorate([
|
|
158
158
|
attr({ mode: "boolean" })
|
|
159
|
-
], Button.prototype, "autofocus", void 0);
|
|
159
|
+
], Button$1.prototype, "autofocus", void 0);
|
|
160
160
|
__decorate([
|
|
161
161
|
attr({ attribute: "form" })
|
|
162
|
-
], Button.prototype, "formId", void 0);
|
|
162
|
+
], Button$1.prototype, "formId", void 0);
|
|
163
163
|
__decorate([
|
|
164
164
|
attr
|
|
165
|
-
], Button.prototype, "formaction", void 0);
|
|
165
|
+
], Button$1.prototype, "formaction", void 0);
|
|
166
166
|
__decorate([
|
|
167
167
|
attr
|
|
168
|
-
], Button.prototype, "formenctype", void 0);
|
|
168
|
+
], Button$1.prototype, "formenctype", void 0);
|
|
169
169
|
__decorate([
|
|
170
170
|
attr
|
|
171
|
-
], Button.prototype, "formmethod", void 0);
|
|
171
|
+
], Button$1.prototype, "formmethod", void 0);
|
|
172
172
|
__decorate([
|
|
173
173
|
attr({ mode: "boolean" })
|
|
174
|
-
], Button.prototype, "formnovalidate", void 0);
|
|
174
|
+
], Button$1.prototype, "formnovalidate", void 0);
|
|
175
175
|
__decorate([
|
|
176
176
|
attr
|
|
177
|
-
], Button.prototype, "formtarget", void 0);
|
|
177
|
+
], Button$1.prototype, "formtarget", void 0);
|
|
178
178
|
__decorate([
|
|
179
179
|
attr
|
|
180
|
-
], Button.prototype, "type", void 0);
|
|
180
|
+
], Button$1.prototype, "type", void 0);
|
|
181
181
|
__decorate([
|
|
182
182
|
observable
|
|
183
|
-
], Button.prototype, "defaultSlottedContent", void 0);
|
|
183
|
+
], Button$1.prototype, "defaultSlottedContent", void 0);
|
|
184
184
|
/**
|
|
185
185
|
* Includes ARIA states and properties relating to the ARIA button role
|
|
186
186
|
*
|
|
@@ -195,6 +195,6 @@ __decorate([
|
|
|
195
195
|
attr({ attribute: "aria-pressed" })
|
|
196
196
|
], DelegatesARIAButton.prototype, "ariaPressed", void 0);
|
|
197
197
|
applyMixins(DelegatesARIAButton, ARIAGlobalStatesAndProperties);
|
|
198
|
-
applyMixins(Button, StartEnd, DelegatesARIAButton);
|
|
198
|
+
applyMixins(Button$1, StartEnd, DelegatesARIAButton);
|
|
199
199
|
|
|
200
|
-
export { Button as B };
|
|
200
|
+
export { Button$1 as B };
|
package/shared/calendar-event.js
CHANGED
|
@@ -1,19 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as attr, F as FoundationElement, n as nullableNumberConverter } from './index.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
6
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
7
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
8
|
+
if (decorator = decorators[i])
|
|
9
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
10
|
+
if (kind && result)
|
|
11
|
+
__defProp(target, key, result);
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
class CalendarEvent extends FoundationElement {
|
|
15
|
+
// TODO should be converted to allowed range
|
|
16
|
+
}
|
|
17
|
+
__decorateClass([
|
|
18
|
+
attr
|
|
19
|
+
], CalendarEvent.prototype, "heading", 2);
|
|
20
|
+
__decorateClass([
|
|
21
|
+
attr
|
|
22
|
+
], CalendarEvent.prototype, "description", 2);
|
|
23
|
+
__decorateClass([
|
|
24
|
+
attr
|
|
25
|
+
], CalendarEvent.prototype, "connotation", 2);
|
|
26
|
+
__decorateClass([
|
|
27
|
+
attr
|
|
28
|
+
], CalendarEvent.prototype, "appearance", 2);
|
|
29
|
+
__decorateClass([
|
|
30
|
+
attr({ converter: nullableNumberConverter, attribute: "overlap-count" })
|
|
31
|
+
], CalendarEvent.prototype, "overlapCount", 2);
|
|
32
|
+
__decorateClass([
|
|
33
|
+
attr({ converter: nullableNumberConverter })
|
|
34
|
+
], CalendarEvent.prototype, "start", 2);
|
|
35
|
+
__decorateClass([
|
|
36
|
+
attr({ converter: nullableNumberConverter })
|
|
37
|
+
], CalendarEvent.prototype, "duration", 2);
|
|
18
38
|
|
|
19
39
|
export { CalendarEvent as C };
|
package/shared/definition.js
CHANGED
|
@@ -1,224 +1,163 @@
|
|
|
1
|
-
import { F as FoundationElement, _ as __decorate, a as attr,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { F as FoundationElement, _ as __decorate, a as attr, n as nullableNumberConverter, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition24.js';
|
|
3
|
+
import { f as focusRegistries } from './definition55.js';
|
|
4
|
+
import { b as AffixIconWithTrailing, a as affixIconTemplateFactory } from './affix.js';
|
|
5
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
6
|
+
import { S as StartEnd } from './start-end.js';
|
|
7
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
8
|
+
import { r as ref } from './ref.js';
|
|
9
|
+
import { w as when } from './when.js';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @public
|
|
12
|
-
*/
|
|
13
|
-
const AccordionExpandMode = {
|
|
14
|
-
/**
|
|
15
|
-
* Designates only a single {@link @microsoft/fast-foundation#(AccordionItem:class) } can be open a time.
|
|
16
|
-
*/
|
|
17
|
-
single: "single",
|
|
18
|
-
/**
|
|
19
|
-
* Designates multiple {@link @microsoft/fast-foundation#(AccordionItem:class) | AccordionItems} can be open simultaneously.
|
|
20
|
-
*/
|
|
21
|
-
multi: "multi",
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* An Accordion Custom HTML Element
|
|
25
|
-
* Implements {@link https://www.w3.org/TR/wai-aria-practices-1.1/#accordion | ARIA Accordion}.
|
|
12
|
+
* An individual item in an {@link @microsoft/fast-foundation#(Accordion:class) }.
|
|
26
13
|
*
|
|
27
|
-
* @
|
|
28
|
-
* @
|
|
29
|
-
* @
|
|
14
|
+
* @slot start - Content which can be provided between the heading and the icon
|
|
15
|
+
* @slot end - Content which can be provided between the start slot and icon
|
|
16
|
+
* @slot heading - Content which serves as the accordion item heading and text of the expand button
|
|
17
|
+
* @slot - The default slot for accordion item content
|
|
18
|
+
* @slot expanded-icon - The expanded icon
|
|
19
|
+
* @slot collapsed-icon - The collapsed icon
|
|
20
|
+
* @fires change - Fires a custom 'change' event when the button is invoked
|
|
21
|
+
* @csspart heading - Wraps the button
|
|
22
|
+
* @csspart button - The button which serves to invoke the item
|
|
23
|
+
* @csspart heading-content - Wraps the slot for the heading content within the button
|
|
24
|
+
* @csspart icon - The icon container
|
|
25
|
+
* @csspart expanded-icon - The expanded icon slot
|
|
26
|
+
* @csspart collapsed-icon - The collapsed icon
|
|
27
|
+
* @csspart region - The wrapper for the accordion item content
|
|
30
28
|
*
|
|
31
|
-
* @
|
|
32
|
-
* Designed to be used with {@link @microsoft/fast-foundation#accordionTemplate} and {@link @microsoft/fast-foundation#(AccordionItem:class)}.
|
|
29
|
+
* @public
|
|
33
30
|
*/
|
|
34
|
-
|
|
31
|
+
let AccordionItem$1 = class AccordionItem extends FoundationElement {
|
|
35
32
|
constructor() {
|
|
36
33
|
super(...arguments);
|
|
37
34
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
35
|
+
* Configures the {@link https://www.w3.org/TR/wai-aria-1.1/#aria-level | level} of the
|
|
36
|
+
* heading element.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue 2
|
|
40
39
|
* @public
|
|
40
|
+
* @remarks
|
|
41
|
+
* HTML attribute: heading-level
|
|
42
|
+
*/
|
|
43
|
+
this.headinglevel = 2;
|
|
44
|
+
/**
|
|
45
|
+
* Expands or collapses the item.
|
|
41
46
|
*
|
|
47
|
+
* @public
|
|
42
48
|
* @remarks
|
|
43
|
-
* HTML attribute:
|
|
49
|
+
* HTML attribute: expanded
|
|
44
50
|
*/
|
|
45
|
-
this.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var _a;
|
|
52
|
-
if (this.accordionItems.length === 0) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
this.accordionIds = this.getItemIds();
|
|
56
|
-
this.accordionItems.forEach((item, index) => {
|
|
57
|
-
if (item instanceof AccordionItem) {
|
|
58
|
-
item.addEventListener("change", this.activeItemChange);
|
|
59
|
-
if (this.isSingleExpandMode()) {
|
|
60
|
-
this.activeItemIndex !== index
|
|
61
|
-
? (item.expanded = false)
|
|
62
|
-
: (item.expanded = true);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const itemId = this.accordionIds[index];
|
|
66
|
-
item.setAttribute("id", typeof itemId !== "string" ? `accordion-${index + 1}` : itemId);
|
|
67
|
-
this.activeid = this.accordionIds[this.activeItemIndex];
|
|
68
|
-
item.addEventListener("keydown", this.handleItemKeyDown);
|
|
69
|
-
item.addEventListener("focus", this.handleItemFocus);
|
|
70
|
-
});
|
|
71
|
-
if (this.isSingleExpandMode()) {
|
|
72
|
-
const expandedItem = (_a = this.findExpandedItem()) !== null && _a !== void 0 ? _a : this.accordionItems[0];
|
|
73
|
-
expandedItem.setAttribute("aria-disabled", "true");
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
this.removeItemListeners = (oldValue) => {
|
|
77
|
-
oldValue.forEach((item, index) => {
|
|
78
|
-
item.removeEventListener("change", this.activeItemChange);
|
|
79
|
-
item.removeEventListener("keydown", this.handleItemKeyDown);
|
|
80
|
-
item.removeEventListener("focus", this.handleItemFocus);
|
|
81
|
-
});
|
|
82
|
-
};
|
|
83
|
-
this.activeItemChange = (event) => {
|
|
84
|
-
if (event.defaultPrevented || event.target !== event.currentTarget) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
event.preventDefault();
|
|
88
|
-
const selectedItem = event.target;
|
|
89
|
-
this.activeid = selectedItem.getAttribute("id");
|
|
90
|
-
if (this.isSingleExpandMode()) {
|
|
91
|
-
this.resetItems();
|
|
92
|
-
selectedItem.expanded = true;
|
|
93
|
-
selectedItem.setAttribute("aria-disabled", "true");
|
|
94
|
-
this.accordionItems.forEach((item) => {
|
|
95
|
-
if (!item.hasAttribute("disabled") && item.id !== this.activeid) {
|
|
96
|
-
item.removeAttribute("aria-disabled");
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
this.activeItemIndex = Array.from(this.accordionItems).indexOf(selectedItem);
|
|
51
|
+
this.expanded = false;
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
this.clickHandler = (e) => {
|
|
56
|
+
this.expanded = !this.expanded;
|
|
101
57
|
this.change();
|
|
102
58
|
};
|
|
103
|
-
this.
|
|
104
|
-
|
|
105
|
-
// prevents arrow keys from moving focus to accordion headers when focus is on accordion item panel content
|
|
106
|
-
if (event.target !== event.currentTarget) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
this.accordionIds = this.getItemIds();
|
|
110
|
-
switch (event.key) {
|
|
111
|
-
case keyArrowUp:
|
|
112
|
-
event.preventDefault();
|
|
113
|
-
this.adjust(-1);
|
|
114
|
-
break;
|
|
115
|
-
case keyArrowDown:
|
|
116
|
-
event.preventDefault();
|
|
117
|
-
this.adjust(1);
|
|
118
|
-
break;
|
|
119
|
-
case keyHome:
|
|
120
|
-
this.activeItemIndex = 0;
|
|
121
|
-
this.focusItem();
|
|
122
|
-
break;
|
|
123
|
-
case keyEnd:
|
|
124
|
-
this.activeItemIndex = this.accordionItems.length - 1;
|
|
125
|
-
this.focusItem();
|
|
126
|
-
break;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
this.handleItemFocus = (event) => {
|
|
130
|
-
// update the active item index if the focus moves to an accordion item via a different method other than the up and down arrow key actions
|
|
131
|
-
// only do so if the focus is actually on the accordion item and not on any of its children
|
|
132
|
-
if (event.target === event.currentTarget) {
|
|
133
|
-
const focusedItem = event.target;
|
|
134
|
-
const focusedIndex = (this.activeItemIndex = Array.from(this.accordionItems).indexOf(focusedItem));
|
|
135
|
-
if (this.activeItemIndex !== focusedIndex && focusedIndex !== -1) {
|
|
136
|
-
this.activeItemIndex = focusedIndex;
|
|
137
|
-
this.activeid = this.accordionIds[this.activeItemIndex];
|
|
138
|
-
}
|
|
139
|
-
}
|
|
59
|
+
this.change = () => {
|
|
60
|
+
this.$emit("change");
|
|
140
61
|
};
|
|
141
62
|
}
|
|
142
|
-
|
|
143
|
-
* @internal
|
|
144
|
-
*/
|
|
145
|
-
accordionItemsChanged(oldValue, newValue) {
|
|
146
|
-
if (this.$fastController.isConnected) {
|
|
147
|
-
this.removeItemListeners(oldValue);
|
|
148
|
-
this.setItems();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
findExpandedItem() {
|
|
152
|
-
for (let item = 0; item < this.accordionItems.length; item++) {
|
|
153
|
-
if (this.accordionItems[item].getAttribute("expanded") === "true") {
|
|
154
|
-
return this.accordionItems[item];
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
resetItems() {
|
|
160
|
-
this.accordionItems.forEach((item, index) => {
|
|
161
|
-
item.expanded = false;
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
getItemIds() {
|
|
165
|
-
return this.accordionItems.map((accordionItem) => {
|
|
166
|
-
return accordionItem.getAttribute("id");
|
|
167
|
-
});
|
|
168
|
-
}
|
|
169
|
-
isSingleExpandMode() {
|
|
170
|
-
return this.expandmode === AccordionExpandMode.single;
|
|
171
|
-
}
|
|
172
|
-
adjust(adjustment) {
|
|
173
|
-
this.activeItemIndex = wrapInBounds(0, this.accordionItems.length - 1, this.activeItemIndex + adjustment);
|
|
174
|
-
this.focusItem();
|
|
175
|
-
}
|
|
176
|
-
focusItem() {
|
|
177
|
-
const element = this.accordionItems[this.activeItemIndex];
|
|
178
|
-
if (element instanceof AccordionItem) {
|
|
179
|
-
element.expandbutton.focus();
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
63
|
+
};
|
|
183
64
|
__decorate([
|
|
184
|
-
attr({
|
|
185
|
-
|
|
65
|
+
attr({
|
|
66
|
+
attribute: "heading-level",
|
|
67
|
+
mode: "fromView",
|
|
68
|
+
converter: nullableNumberConverter,
|
|
69
|
+
})
|
|
70
|
+
], AccordionItem$1.prototype, "headinglevel", void 0);
|
|
186
71
|
__decorate([
|
|
187
|
-
|
|
188
|
-
],
|
|
72
|
+
attr({ mode: "boolean" })
|
|
73
|
+
], AccordionItem$1.prototype, "expanded", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
attr
|
|
76
|
+
], AccordionItem$1.prototype, "id", void 0);
|
|
77
|
+
applyMixins(AccordionItem$1, StartEnd);
|
|
189
78
|
|
|
190
|
-
|
|
79
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 GMT\n */\n:host {\n display: flex;\n box-sizing: border-box;\n flex-direction: column;\n}\n\n.heading-container {\n margin: 0;\n}\n\n.heading-button {\n position: relative;\n display: flex;\n width: 100%;\n align-items: center;\n padding: 16px;\n border: none;\n background-color: var(--_appearance-color-fill);\n color: var(--_appearance-color-text);\n cursor: pointer;\n text-align: left;\n}\n.heading-button {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.heading-button:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.heading-button:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.heading-button {\n /* @cssprop [--vvd-accordion-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-accordion-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-accordion-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-accordion-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-accordion-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-accordion-item-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports selector(:focus-visible) {\n .heading-button:focus-visible {\n outline: none;\n }\n}\n.heading-button.size-condensed {\n font: var(--vvd-typography-base-bold);\n gap: 12px;\n}\n.heading-button:not(.size-condensed) {\n font: var(--vvd-typography-heading-4);\n gap: 16px;\n}\n\n.heading-content {\n flex: auto;\n}\n\n.meta {\n overflow: hidden;\n max-width: 20%;\n flex-shrink: 0;\n color: var(--vvd-color-neutral-600);\n text-align: end;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.heading-button:not(.size-condensed) .meta {\n font: var(--vvd-typography-base-bold);\n}\n.heading-button.size-condensed .meta {\n font: var(--vvd-typography-base-condensed-bold);\n}\n\n.region {\n display: none;\n padding: 8px 32px 24px 16px;\n}\n.region:not(.size-condensed).padded {\n padding-inline-start: 52px;\n}\n:host([expanded]) .region {\n display: block;\n}\n.region.size-condensed.padded {\n padding-inline-start: 44px;\n}\n\n.icon {\n color: var(--vvd-color-neutral-600);\n}\n.heading-button:not(.size-condensed) .icon {\n font: inherit;\n}\n.heading-button.size-condensed .icon {\n font: var(--vvd-typography-base-extended);\n}\n:host(:not([icon-trailing])) .icon:last-of-type {\n color: var(--_appearance-color-text);\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n}\nbutton:not(:focus-visible) > .focus-indicator {\n display: none;\n}";
|
|
191
80
|
|
|
192
|
-
|
|
81
|
+
var __defProp = Object.defineProperty;
|
|
82
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
83
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
84
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
85
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
86
|
+
if (decorator = decorators[i])
|
|
87
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
88
|
+
if (kind && result)
|
|
89
|
+
__defProp(target, key, result);
|
|
90
|
+
return result;
|
|
91
|
+
};
|
|
92
|
+
class AccordionItem extends AccordionItem$1 {
|
|
193
93
|
constructor() {
|
|
194
94
|
super(...arguments);
|
|
195
|
-
this.
|
|
196
|
-
}
|
|
197
|
-
closeAll() {
|
|
198
|
-
if (this.expandmode === AccordionExpandMode.multi) {
|
|
199
|
-
this.accordionItems.forEach(item => {
|
|
200
|
-
item.expanded = false;
|
|
201
|
-
});
|
|
202
|
-
}
|
|
95
|
+
this.noIndicator = false;
|
|
203
96
|
}
|
|
204
97
|
}
|
|
98
|
+
__decorateClass([
|
|
99
|
+
attr
|
|
100
|
+
], AccordionItem.prototype, "heading", 2);
|
|
101
|
+
__decorateClass([
|
|
102
|
+
attr({ mode: "boolean", attribute: "no-indicator" })
|
|
103
|
+
], AccordionItem.prototype, "noIndicator", 2);
|
|
104
|
+
__decorateClass([
|
|
105
|
+
attr
|
|
106
|
+
], AccordionItem.prototype, "meta", 2);
|
|
107
|
+
__decorateClass([
|
|
108
|
+
attr
|
|
109
|
+
], AccordionItem.prototype, "size", 2);
|
|
110
|
+
applyMixins(AccordionItem, AffixIconWithTrailing);
|
|
111
|
+
|
|
112
|
+
const header = (context, hTag) => {
|
|
113
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
114
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
115
|
+
return 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("expandbutton")}
|
|
124
|
+
>
|
|
125
|
+
${() => focusTemplate}
|
|
126
|
+
|
|
127
|
+
${(x) => x.icon && !x.iconTrailing ? affixIconTemplate(x.icon) : null}
|
|
128
|
+
|
|
129
|
+
<span class="heading-content">${(x) => x.heading}</span>
|
|
205
130
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
131
|
+
${when((x) => x.meta, html`<span class="meta">${(x) => x.meta}</span>`)}
|
|
132
|
+
|
|
133
|
+
${(x) => x.icon && x.iconTrailing ? affixIconTemplate(x.icon) : null}
|
|
134
|
+
${(x) => !(x.icon && x.iconTrailing) && !x.noIndicator ? affixIconTemplate(x.expanded ? "chevron-up-solid" : "chevron-down-solid") : null}
|
|
135
|
+
|
|
136
|
+
</button>
|
|
137
|
+
</${hTag}>
|
|
138
|
+
`;
|
|
139
|
+
};
|
|
140
|
+
const AccordionItemTemplate = (context) => html`
|
|
141
|
+
${(x) => header(context, "h" + x.headinglevel)}
|
|
142
|
+
<div
|
|
143
|
+
id="${(x) => x.id}-panel"
|
|
144
|
+
aria-labelledby="${(x) => x.id}"
|
|
145
|
+
role="region"
|
|
146
|
+
class="region ${(x) => x.icon && !x.iconTrailing ? "padded" : ""} ${(x) => x.size ? `size-${x.size}` : ""}"
|
|
147
|
+
>
|
|
148
|
+
<slot></slot>
|
|
213
149
|
</div>
|
|
214
150
|
`;
|
|
215
151
|
|
|
216
|
-
const
|
|
217
|
-
baseName:
|
|
218
|
-
template:
|
|
219
|
-
styles
|
|
152
|
+
const accordionItemDefinition = AccordionItem.compose({
|
|
153
|
+
baseName: "accordion-item",
|
|
154
|
+
template: AccordionItemTemplate,
|
|
155
|
+
styles,
|
|
156
|
+
shadowOptions: {
|
|
157
|
+
delegatesFocus: true
|
|
158
|
+
}
|
|
220
159
|
});
|
|
221
|
-
const
|
|
222
|
-
const
|
|
160
|
+
const accordionItemRegistries = [accordionItemDefinition(), ...iconRegistries, ...focusRegistries];
|
|
161
|
+
const registerAccordionItem = registerFactory(accordionItemRegistries);
|
|
223
162
|
|
|
224
|
-
export {
|
|
163
|
+
export { AccordionItem$1 as A, accordionItemDefinition as a, accordionItemRegistries as b, registerAccordionItem as r };
|