@vonage/vivid 3.32.0 → 3.35.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 +6 -6
- 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 +5 -3
- package/combobox/index.js +8 -8
- package/custom-elements.json +256 -18
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +9 -9
- 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 +5 -5
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.js +59 -59
- package/layout/index.js +1 -1
- package/lib/avatar/avatar.d.ts +1 -1
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/date-picker/calendar/dateStr.d.ts +1 -0
- package/lib/date-picker/calendar/month.d.ts +1 -0
- package/lib/date-picker/calendar/year.d.ts +2 -0
- package/lib/date-picker/date-picker.d.ts +2 -0
- package/lib/icon/icon.d.ts +0 -1
- package/lib/listbox/listbox.d.ts +9 -1
- package/lib/progress-ring/progress-ring.d.ts +1 -1
- package/lib/text-field/text-field.d.ts +1 -0
- package/listbox/index.js +20 -16
- package/locales/en-GB.js +48 -14
- package/locales/en-US.js +48 -14
- package/locales/ja-JP.js +48 -14
- package/locales/zh-CN.js +48 -14
- 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 +2 -3
- package/number-field/index.js +6 -6
- package/option/index.js +3 -3
- package/package.json +2 -16
- 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 +8 -8
- 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 +61 -5784
- package/shared/definition24.js +28 -117
- package/shared/definition25.js +52 -66
- package/shared/definition26.js +391 -214
- package/shared/definition27.js +441 -34
- package/shared/definition28.js +85 -73
- package/shared/definition29.js +21 -2283
- package/shared/definition3.js +61 -24
- package/shared/definition30.js +13 -49
- package/shared/definition31.js +54 -39
- package/shared/definition32.js +413 -375
- package/shared/definition33.js +223 -304
- package/shared/definition34.js +197 -13
- package/shared/definition35.js +88 -73
- package/shared/definition36.js +75 -25
- package/shared/definition37.js +434 -34
- package/shared/definition38.js +32 -432
- package/shared/definition39.js +677 -187
- package/shared/definition4.js +157 -12
- package/shared/definition40.js +95 -48
- package/shared/definition41.js +577 -31
- package/shared/definition42.js +126 -424
- package/shared/definition43.js +114 -618
- package/shared/definition44.js +24 -80
- package/shared/definition45.js +71 -543
- package/shared/definition46.js +499 -92
- package/shared/definition47.js +19 -133
- package/shared/definition48.js +129 -52
- package/shared/definition49.js +281 -17
- package/shared/definition5.js +71 -36
- package/shared/definition50.js +153 -484
- package/shared/definition51.js +131 -98
- package/shared/definition52.js +131 -16
- package/shared/definition53.js +80 -264
- package/shared/definition54.js +293 -118
- package/shared/definition55.js +12 -117
- package/shared/definition56.js +39 -68
- package/shared/definition57.js +166 -288
- package/shared/definition6.js +56 -111
- package/shared/definition7.js +120 -195
- 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 +108 -80
- package/shared/key-codes.js +1 -1
- package/shared/listbox.js +88 -11
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- 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 +6106 -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.js +3 -3
- 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 +3 -3
- package/text-field/index.js +3 -3
- 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 +10 -1
- 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/date-picker/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/definition33.js
CHANGED
|
@@ -1,372 +1,291 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import {
|
|
3
|
-
import { f as focusRegistries } from './
|
|
4
|
-
import { b as
|
|
1
|
+
import { F as FoundationElement, O as Observable, _ as __decorate, o as observable, a as attr, 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 ARIAGlobalStatesAndProperties } from './aria-global.js';
|
|
5
6
|
import { S as StartEnd } from './start-end.js';
|
|
6
|
-
import { D as Direction, g as getDirection } from './direction.js';
|
|
7
7
|
import { a as applyMixins } from './apply-mixins.js';
|
|
8
|
-
import { i as
|
|
8
|
+
import { i as isHTMLElement } from './dom.js';
|
|
9
9
|
import { f as focusTemplateFactory } from './focus2.js';
|
|
10
|
+
import './index2.js';
|
|
10
11
|
import { w as when } from './when.js';
|
|
11
|
-
import { s as slotted } from './slotted.js';
|
|
12
12
|
import { c as classNames } from './class-names.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Determines if the element is a {@link (ListboxOption:class)}
|
|
16
|
+
*
|
|
17
|
+
* @param element - the element to test.
|
|
16
18
|
* @public
|
|
17
19
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* The menu item has a "menuitemcheckbox" role
|
|
25
|
-
*/
|
|
26
|
-
menuitemcheckbox: "menuitemcheckbox",
|
|
27
|
-
/**
|
|
28
|
-
* The menu item has a "menuitemradio" role
|
|
29
|
-
*/
|
|
30
|
-
menuitemradio: "menuitemradio",
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
const roleForMenuItem = {
|
|
36
|
-
[MenuItemRole$1.menuitem]: "menuitem",
|
|
37
|
-
[MenuItemRole$1.menuitemcheckbox]: "menuitemcheckbox",
|
|
38
|
-
[MenuItemRole$1.menuitemradio]: "menuitemradio",
|
|
39
|
-
};
|
|
40
|
-
|
|
20
|
+
function isListboxOption(el) {
|
|
21
|
+
return (isHTMLElement(el) &&
|
|
22
|
+
(el.getAttribute("role") === "option" ||
|
|
23
|
+
el instanceof HTMLOptionElement));
|
|
24
|
+
}
|
|
41
25
|
/**
|
|
42
|
-
*
|
|
43
|
-
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#
|
|
26
|
+
* An Option Custom HTML Element.
|
|
27
|
+
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#option | ARIA option }.
|
|
44
28
|
*
|
|
45
|
-
* @slot
|
|
46
|
-
* @slot
|
|
47
|
-
* @slot
|
|
48
|
-
* @
|
|
49
|
-
* @slot - The default slot for menu item content
|
|
50
|
-
* @slot expand-collapse-indicator - The expand/collapse indicator
|
|
51
|
-
* @slot submenu - Used to nest menu's within menu items
|
|
52
|
-
* @csspart input-container - The element representing the visual checked or radio indicator
|
|
53
|
-
* @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator
|
|
54
|
-
* @csspart radio - The element wrapping the `menuitemradio` indicator
|
|
55
|
-
* @csspart content - The element wrapping the menu item content
|
|
56
|
-
* @csspart expand-collapse-glyph-container - The element wrapping the expand collapse element
|
|
57
|
-
* @csspart expand-collapse - The expand/collapse element
|
|
58
|
-
* @csspart submenu-region - The container for the submenu, used for positioning
|
|
59
|
-
* @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
|
|
60
|
-
* @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
|
|
29
|
+
* @slot start - Content which can be provided before the listbox option content
|
|
30
|
+
* @slot end - Content which can be provided after the listbox option content
|
|
31
|
+
* @slot - The default slot for listbox option content
|
|
32
|
+
* @csspart content - Wraps the listbox option content
|
|
61
33
|
*
|
|
62
34
|
* @public
|
|
63
35
|
*/
|
|
64
|
-
|
|
65
|
-
constructor() {
|
|
66
|
-
super(
|
|
36
|
+
let ListboxOption$1 = class ListboxOption extends FoundationElement {
|
|
37
|
+
constructor(text, value, defaultSelected, selected) {
|
|
38
|
+
super();
|
|
67
39
|
/**
|
|
68
|
-
* The
|
|
69
|
-
*
|
|
40
|
+
* The defaultSelected state of the option.
|
|
70
41
|
* @public
|
|
71
|
-
* @remarks
|
|
72
|
-
* HTML Attribute: role
|
|
73
42
|
*/
|
|
74
|
-
this.
|
|
43
|
+
this.defaultSelected = false;
|
|
75
44
|
/**
|
|
45
|
+
* Tracks whether the "selected" property has been changed.
|
|
76
46
|
* @internal
|
|
77
47
|
*/
|
|
78
|
-
this.
|
|
48
|
+
this.dirtySelected = false;
|
|
79
49
|
/**
|
|
80
|
-
*
|
|
50
|
+
* The checked state of the control.
|
|
81
51
|
*
|
|
82
|
-
* @
|
|
83
|
-
*/
|
|
84
|
-
this.currentDirection = Direction.ltr;
|
|
85
|
-
this.focusSubmenuOnLoad = false;
|
|
86
|
-
/**
|
|
87
|
-
* @internal
|
|
88
|
-
*/
|
|
89
|
-
this.handleMenuItemKeyDown = (e) => {
|
|
90
|
-
if (e.defaultPrevented) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
switch (e.key) {
|
|
94
|
-
case keyEnter:
|
|
95
|
-
case keySpace:
|
|
96
|
-
this.invoke();
|
|
97
|
-
return false;
|
|
98
|
-
case keyArrowRight:
|
|
99
|
-
//open/focus on submenu
|
|
100
|
-
this.expandAndFocus();
|
|
101
|
-
return false;
|
|
102
|
-
case keyArrowLeft:
|
|
103
|
-
//close submenu
|
|
104
|
-
if (this.expanded) {
|
|
105
|
-
this.expanded = false;
|
|
106
|
-
this.focus();
|
|
107
|
-
return false;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return true;
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* @internal
|
|
114
|
-
*/
|
|
115
|
-
this.handleMenuItemClick = (e) => {
|
|
116
|
-
if (e.defaultPrevented || this.disabled) {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
this.invoke();
|
|
120
|
-
return false;
|
|
121
|
-
};
|
|
122
|
-
/**
|
|
123
|
-
* @internal
|
|
124
|
-
*/
|
|
125
|
-
this.submenuLoaded = () => {
|
|
126
|
-
if (!this.focusSubmenuOnLoad) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
this.focusSubmenuOnLoad = false;
|
|
130
|
-
if (this.hasSubmenu) {
|
|
131
|
-
this.submenu.focus();
|
|
132
|
-
this.setAttribute("tabindex", "-1");
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* @internal
|
|
137
|
-
*/
|
|
138
|
-
this.handleMouseOver = (e) => {
|
|
139
|
-
if (this.disabled || !this.hasSubmenu || this.expanded) {
|
|
140
|
-
return false;
|
|
141
|
-
}
|
|
142
|
-
this.expanded = true;
|
|
143
|
-
return false;
|
|
144
|
-
};
|
|
145
|
-
/**
|
|
146
|
-
* @internal
|
|
147
|
-
*/
|
|
148
|
-
this.handleMouseOut = (e) => {
|
|
149
|
-
if (!this.expanded || this.contains(document.activeElement)) {
|
|
150
|
-
return false;
|
|
151
|
-
}
|
|
152
|
-
this.expanded = false;
|
|
153
|
-
return false;
|
|
154
|
-
};
|
|
155
|
-
/**
|
|
156
|
-
* @internal
|
|
157
|
-
*/
|
|
158
|
-
this.expandAndFocus = () => {
|
|
159
|
-
if (!this.hasSubmenu) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
this.focusSubmenuOnLoad = true;
|
|
163
|
-
this.expanded = true;
|
|
164
|
-
};
|
|
165
|
-
/**
|
|
166
|
-
* @internal
|
|
52
|
+
* @public
|
|
167
53
|
*/
|
|
168
|
-
this.
|
|
169
|
-
if (this.disabled) {
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
switch (this.role) {
|
|
173
|
-
case MenuItemRole$1.menuitemcheckbox:
|
|
174
|
-
this.checked = !this.checked;
|
|
175
|
-
break;
|
|
176
|
-
case MenuItemRole$1.menuitem:
|
|
177
|
-
// update submenu
|
|
178
|
-
this.updateSubmenu();
|
|
179
|
-
if (this.hasSubmenu) {
|
|
180
|
-
this.expandAndFocus();
|
|
181
|
-
}
|
|
182
|
-
else {
|
|
183
|
-
this.$emit("change");
|
|
184
|
-
}
|
|
185
|
-
break;
|
|
186
|
-
case MenuItemRole$1.menuitemradio:
|
|
187
|
-
if (!this.checked) {
|
|
188
|
-
this.checked = true;
|
|
189
|
-
}
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
};
|
|
54
|
+
this.selected = this.defaultSelected;
|
|
193
55
|
/**
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* @internal
|
|
56
|
+
* Track whether the value has been changed from the initial value
|
|
197
57
|
*/
|
|
198
|
-
this.
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
});
|
|
202
|
-
this.hasSubmenu = this.submenu === undefined ? false : true;
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
expandedChanged(oldValue) {
|
|
206
|
-
if (this.$fastController.isConnected) {
|
|
207
|
-
if (this.submenu === undefined) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (this.expanded === false) {
|
|
211
|
-
this.submenu.collapseExpandedItem();
|
|
212
|
-
}
|
|
213
|
-
else {
|
|
214
|
-
this.currentDirection = getDirection(this);
|
|
215
|
-
}
|
|
216
|
-
this.$emit("expanded-change", this, { bubbles: false });
|
|
58
|
+
this.dirtyValue = false;
|
|
59
|
+
if (text) {
|
|
60
|
+
this.textContent = text;
|
|
217
61
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
if (this.$fastController.isConnected) {
|
|
221
|
-
this.$emit("change");
|
|
62
|
+
if (value) {
|
|
63
|
+
this.initialValue = value;
|
|
222
64
|
}
|
|
65
|
+
if (defaultSelected) {
|
|
66
|
+
this.defaultSelected = defaultSelected;
|
|
67
|
+
}
|
|
68
|
+
if (selected) {
|
|
69
|
+
this.selected = selected;
|
|
70
|
+
}
|
|
71
|
+
this.proxy = new Option(`${this.textContent}`, this.initialValue, this.defaultSelected, this.selected);
|
|
72
|
+
this.proxy.disabled = this.disabled;
|
|
223
73
|
}
|
|
224
74
|
/**
|
|
225
|
-
*
|
|
75
|
+
* Updates the ariaChecked property when the checked property changes.
|
|
76
|
+
*
|
|
77
|
+
* @param prev - the previous checked value
|
|
78
|
+
* @param next - the current checked value
|
|
79
|
+
*
|
|
80
|
+
* @public
|
|
226
81
|
*/
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
});
|
|
232
|
-
if (!this.startColumnCount) {
|
|
233
|
-
this.startColumnCount = 1;
|
|
82
|
+
checkedChanged(prev, next) {
|
|
83
|
+
if (typeof next === "boolean") {
|
|
84
|
+
this.ariaChecked = next ? "true" : "false";
|
|
85
|
+
return;
|
|
234
86
|
}
|
|
235
|
-
this.
|
|
87
|
+
this.ariaChecked = null;
|
|
236
88
|
}
|
|
237
89
|
/**
|
|
90
|
+
* Updates the proxy's text content when the default slot changes.
|
|
91
|
+
* @param prev - the previous content value
|
|
92
|
+
* @param next - the current content value
|
|
93
|
+
*
|
|
238
94
|
* @internal
|
|
239
95
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
if (this.observer !== undefined) {
|
|
244
|
-
this.observer.disconnect();
|
|
245
|
-
this.observer = undefined;
|
|
96
|
+
contentChanged(prev, next) {
|
|
97
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
98
|
+
this.proxy.textContent = this.textContent;
|
|
246
99
|
}
|
|
100
|
+
this.$emit("contentchange", null, { bubbles: true });
|
|
247
101
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
102
|
+
defaultSelectedChanged() {
|
|
103
|
+
if (!this.dirtySelected) {
|
|
104
|
+
this.selected = this.defaultSelected;
|
|
105
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
106
|
+
this.proxy.selected = this.defaultSelected;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
253
109
|
}
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
110
|
+
disabledChanged(prev, next) {
|
|
111
|
+
this.ariaDisabled = this.disabled ? "true" : "false";
|
|
112
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
113
|
+
this.proxy.disabled = this.disabled;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
selectedAttributeChanged() {
|
|
117
|
+
this.defaultSelected = this.selectedAttribute;
|
|
118
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
119
|
+
this.proxy.defaultSelected = this.defaultSelected;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
selectedChanged() {
|
|
123
|
+
this.ariaSelected = this.selected ? "true" : "false";
|
|
124
|
+
if (!this.dirtySelected) {
|
|
125
|
+
this.dirtySelected = true;
|
|
126
|
+
}
|
|
127
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
128
|
+
this.proxy.selected = this.selected;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
initialValueChanged(previous, next) {
|
|
132
|
+
// If the value is clean and the component is connected to the DOM
|
|
133
|
+
// then set value equal to the attribute value.
|
|
134
|
+
if (!this.dirtyValue) {
|
|
135
|
+
this.value = this.initialValue;
|
|
136
|
+
this.dirtyValue = false;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
get label() {
|
|
140
|
+
var _a;
|
|
141
|
+
return (_a = this.value) !== null && _a !== void 0 ? _a : this.text;
|
|
142
|
+
}
|
|
143
|
+
get text() {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
return (_b = (_a = this.textContent) === null || _a === void 0 ? void 0 : _a.replace(/\s+/g, " ").trim()) !== null && _b !== void 0 ? _b : "";
|
|
146
|
+
}
|
|
147
|
+
set value(next) {
|
|
148
|
+
const newValue = `${next !== null && next !== void 0 ? next : ""}`;
|
|
149
|
+
this._value = newValue;
|
|
150
|
+
this.dirtyValue = true;
|
|
151
|
+
if (this.proxy instanceof HTMLOptionElement) {
|
|
152
|
+
this.proxy.value = newValue;
|
|
153
|
+
}
|
|
154
|
+
Observable.notify(this, "value");
|
|
155
|
+
}
|
|
156
|
+
get value() {
|
|
157
|
+
var _a;
|
|
158
|
+
Observable.track(this, "value");
|
|
159
|
+
return (_a = this._value) !== null && _a !== void 0 ? _a : this.text;
|
|
160
|
+
}
|
|
161
|
+
get form() {
|
|
162
|
+
return this.proxy ? this.proxy.form : null;
|
|
163
|
+
}
|
|
164
|
+
};
|
|
258
165
|
__decorate([
|
|
259
|
-
|
|
260
|
-
],
|
|
166
|
+
observable
|
|
167
|
+
], ListboxOption$1.prototype, "checked", void 0);
|
|
261
168
|
__decorate([
|
|
262
169
|
observable
|
|
263
|
-
],
|
|
170
|
+
], ListboxOption$1.prototype, "content", void 0);
|
|
264
171
|
__decorate([
|
|
265
|
-
|
|
266
|
-
],
|
|
172
|
+
observable
|
|
173
|
+
], ListboxOption$1.prototype, "defaultSelected", void 0);
|
|
267
174
|
__decorate([
|
|
268
175
|
attr({ mode: "boolean" })
|
|
269
|
-
],
|
|
176
|
+
], ListboxOption$1.prototype, "disabled", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
attr({ attribute: "selected", mode: "boolean" })
|
|
179
|
+
], ListboxOption$1.prototype, "selectedAttribute", void 0);
|
|
180
|
+
__decorate([
|
|
181
|
+
observable
|
|
182
|
+
], ListboxOption$1.prototype, "selected", void 0);
|
|
183
|
+
__decorate([
|
|
184
|
+
attr({ attribute: "value", mode: "fromView" })
|
|
185
|
+
], ListboxOption$1.prototype, "initialValue", void 0);
|
|
186
|
+
/**
|
|
187
|
+
* States and properties relating to the ARIA `option` role.
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
191
|
+
class DelegatesARIAListboxOption {
|
|
192
|
+
}
|
|
270
193
|
__decorate([
|
|
271
194
|
observable
|
|
272
|
-
],
|
|
195
|
+
], DelegatesARIAListboxOption.prototype, "ariaChecked", void 0);
|
|
273
196
|
__decorate([
|
|
274
197
|
observable
|
|
275
|
-
],
|
|
198
|
+
], DelegatesARIAListboxOption.prototype, "ariaPosInSet", void 0);
|
|
276
199
|
__decorate([
|
|
277
200
|
observable
|
|
278
|
-
],
|
|
201
|
+
], DelegatesARIAListboxOption.prototype, "ariaSelected", void 0);
|
|
279
202
|
__decorate([
|
|
280
203
|
observable
|
|
281
|
-
],
|
|
282
|
-
applyMixins(
|
|
283
|
-
|
|
284
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Tue, 22 Aug 2023 13:37:39 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus-visible) {\n outline: none;\n }\n}\n.base {\n position: relative;\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n gap: 12px;\n inline-size: 100%;\n padding-block: 2px;\n padding-inline: 16px;\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base: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.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base: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.base:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-dim);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-pale);\n --_appearance-color-outline: transparent;\n}\n.base {\n /* @cssprop [--vvd-menu-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-menu-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-menu-item-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-menu-item-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-menu-item-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-menu-item-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-menu-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-menu-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-menu-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-menu-item-accent-soft, var(--vvd-color-neutral-100));\n /* @cssprop [--vvd-menu-item-accent-pale=var(--vvd-color-neutral-300)] */\n --_connotation-color-pale: var(--vvd-menu-item-accent-pale, var(--vvd-color-neutral-300));\n /* @cssprop [--vvd-menu-item-accent-dim=var(--vvd-color-neutral-200)] */\n --_connotation-color-dim: var(--vvd-menu-item-accent-dim, var(--vvd-color-neutral-200));\n}\n.base:not(.two-lines) {\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base.two-lines {\n min-block-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) + calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16)));\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n\n.focus-indicator {\n border-radius: 6px;\n}\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n\n.icon {\n flex-shrink: 0;\n font-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n line-height: 1;\n}\n\n.action,\n.decorative {\n display: flex;\n place-content: center;\n}\n\n.action {\n color: var(--_appearance-color-text);\n}\n.base.trailing .action {\n order: 1;\n margin-inline-start: auto;\n}\n.base.has-meta .action {\n order: 1;\n margin-inline-start: auto;\n}\n\n.base:not(.disabled) .decorative {\n color: var(--vvd-color-neutral-600);\n}\n.base.disabled .decorative {\n color: var(--vvd-color-neutral-200);\n}\n.base.has-meta .decorative {\n order: 1;\n margin-inline-start: auto;\n}\n\n.text {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n}\n\n.text-primary,\n.text-secondary {\n /* stylelint-disable value-no-vendor-prefix */\n display: -webkit-box;\n /* stylelint-enable value-no-vendor-prefix */\n overflow: hidden;\n -webkit-box-orient: vertical;\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n}\n\n.text-primary {\n -webkit-line-clamp: var(--text-primary-line-clamp, 1);\n}\n.base.two-lines .text-primary {\n font: var(--vvd-typography-base-bold);\n}\n\n.text-secondary {\n -webkit-line-clamp: var(--text-secondary-line-clamp, 1);\n}\n.base.two-lines .text-secondary {\n color: var(--vvd-color-neutral-600);\n}";
|
|
285
|
-
|
|
286
|
-
const MenuItemRole = Object.assign(Object.assign({}, MenuItemRole$1), {
|
|
287
|
-
presentation: 'presentation'
|
|
288
|
-
});
|
|
289
|
-
class MenuItem extends MenuItem$1 {}
|
|
290
|
-
__decorate([attr, __metadata("design:type", String)], MenuItem.prototype, "text", void 0);
|
|
291
|
-
__decorate([attr({
|
|
292
|
-
attribute: 'text-secondary'
|
|
293
|
-
}), __metadata("design:type", String)], MenuItem.prototype, "textSecondary", void 0);
|
|
294
|
-
__decorate([observable, __metadata("design:type", Array)], MenuItem.prototype, "metaSlottedContent", void 0);
|
|
295
|
-
applyMixins(MenuItem, AffixIcon);
|
|
204
|
+
], DelegatesARIAListboxOption.prototype, "ariaSetSize", void 0);
|
|
205
|
+
applyMixins(DelegatesARIAListboxOption, ARIAGlobalStatesAndProperties);
|
|
206
|
+
applyMixins(ListboxOption$1, StartEnd, DelegatesARIAListboxOption);
|
|
296
207
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
208
|
+
var __defProp = Object.defineProperty;
|
|
209
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
210
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
211
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
212
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
213
|
+
if (decorator = decorators[i])
|
|
214
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
215
|
+
if (kind && result)
|
|
216
|
+
__defProp(target, key, result);
|
|
217
|
+
return result;
|
|
301
218
|
};
|
|
219
|
+
class ListboxOption extends ListboxOption$1 {
|
|
220
|
+
// #region overrides base class accessor
|
|
221
|
+
set text(value) {
|
|
222
|
+
this._text = value;
|
|
223
|
+
}
|
|
224
|
+
get text() {
|
|
225
|
+
return this._text ?? "";
|
|
226
|
+
}
|
|
227
|
+
get label() {
|
|
228
|
+
return this._label ?? this.text;
|
|
229
|
+
}
|
|
230
|
+
set label(value) {
|
|
231
|
+
this._label = value;
|
|
232
|
+
}
|
|
233
|
+
// #endregion overrides
|
|
234
|
+
}
|
|
235
|
+
__decorateClass([
|
|
236
|
+
attr({
|
|
237
|
+
attribute: "text"
|
|
238
|
+
})
|
|
239
|
+
], ListboxOption.prototype, "_text", 2);
|
|
240
|
+
__decorateClass([
|
|
241
|
+
attr({
|
|
242
|
+
attribute: "label"
|
|
243
|
+
})
|
|
244
|
+
], ListboxOption.prototype, "_label", 2);
|
|
245
|
+
applyMixins(ListboxOption, AffixIconWithTrailing);
|
|
246
|
+
|
|
302
247
|
const getClasses = ({
|
|
303
|
-
disabled,
|
|
304
|
-
checked,
|
|
305
|
-
expanded,
|
|
306
|
-
role,
|
|
307
|
-
text,
|
|
308
|
-
textSecondary,
|
|
309
248
|
icon,
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
249
|
+
disabled,
|
|
250
|
+
selected,
|
|
251
|
+
checked
|
|
252
|
+
}) => classNames(
|
|
253
|
+
"base",
|
|
254
|
+
["disabled", disabled],
|
|
255
|
+
["selected", Boolean(selected)],
|
|
256
|
+
["active", Boolean(checked)],
|
|
257
|
+
["icon", Boolean(icon)]
|
|
258
|
+
);
|
|
259
|
+
const ListboxOptionTemplate = (context) => {
|
|
260
|
+
const affixIconTemplate = affixIconTemplateFactory(context, false);
|
|
320
261
|
const focusTemplate = focusTemplateFactory(context);
|
|
321
262
|
return html`
|
|
322
263
|
<template
|
|
323
|
-
aria-checked="${x => x.
|
|
324
|
-
aria-disabled="${x => x.
|
|
325
|
-
aria-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
@mouseout="${(x, c) => x.handleMouseOut(c.event)}"
|
|
330
|
-
>
|
|
264
|
+
aria-checked="${(x) => x.ariaChecked}"
|
|
265
|
+
aria-disabled="${(x) => x.ariaDisabled}"
|
|
266
|
+
aria-posinset="${(x) => x.ariaPosInSet}"
|
|
267
|
+
aria-selected="${(x) => x.ariaSelected}"
|
|
268
|
+
aria-setsize="${(x) => x.ariaSetSize}"
|
|
269
|
+
role="option">
|
|
331
270
|
<div class="${getClasses}">
|
|
332
|
-
|
|
333
|
-
${when(x => x.hasSubmenu, html`
|
|
334
|
-
<div
|
|
335
|
-
class="expand-collapse-glyph-container"
|
|
336
|
-
>
|
|
337
|
-
<span class="expand-collapse">
|
|
338
|
-
<slot name="expand-collapse-indicator">
|
|
339
|
-
${definition.expandCollapseGlyph || ''}
|
|
340
|
-
</slot>
|
|
341
|
-
</span>
|
|
342
|
-
</div>
|
|
343
|
-
`)}
|
|
344
271
|
${() => focusTemplate}
|
|
345
|
-
<slot name="
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
${when(x => x.
|
|
349
|
-
|
|
350
|
-
${when(x => x.icon, html`<span class="decorative">${x => affixIconTemplate(x.icon)}</span>`)}
|
|
351
|
-
|
|
352
|
-
${when(x => x.text || x.textSecondary, html`<span class="text">
|
|
353
|
-
${when(x => x.text, html`<span class="text-primary">${x => x.text}</span>`)}
|
|
354
|
-
${when(x => x.textSecondary, html`<span class="text-secondary">${x => x.textSecondary}</span>`)}
|
|
355
|
-
</span>`)}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
272
|
+
<slot name="icon">
|
|
273
|
+
${when((x) => x.icon, html`${(x) => affixIconTemplate(x.icon)}`)}
|
|
274
|
+
</slot>
|
|
275
|
+
${when((x) => x.text, html`<div class="text">${(x) => x.text}</div>`)}
|
|
359
276
|
</div>
|
|
360
277
|
</template>
|
|
361
278
|
`;
|
|
362
279
|
};
|
|
363
280
|
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
281
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Wed, 06 Sep 2023 09:40:36 GMT\n */\n.base {\n position: relative; /* this is needed for the focus */\n display: flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_option-appearance-color-text, var(--_appearance-color-text));\n font: var(--vvd-typography-base);\n gap: 12px;\n hyphens: auto;\n inline-size: 100%;\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n padding-inline: 16px;\n vertical-align: middle;\n word-break: break-word;\n}\n.base {\n /* @cssprop [--vvd-option-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-option-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-option-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-option-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-option-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-option-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-option-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-option-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-option-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-option-accent-soft, var(--vvd-color-neutral-100));\n /* @cssprop [--vvd-option-accent-pale=var(--vvd-color-neutral-300)] */\n --_connotation-color-pale: var(--vvd-option-accent-pale, var(--vvd-color-neutral-300));\n /* @cssprop [--vvd-option-accent-dim=var(--vvd-color-neutral-200)] */\n --_connotation-color-dim: var(--vvd-option-accent-dim, var(--vvd-color-neutral-200));\n}\n.base {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base: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.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base: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.base:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-dim);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-pale);\n --_appearance-color-outline: transparent;\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n cursor: pointer;\n}\n.base.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n.base .text {\n font: var(--vvd-typography-base);\n}\n\nslot[name=icon] {\n font-size: 20px;\n line-height: 1;\n}\n.base:not(.disabled, .selected) slot[name=icon] {\n color: var(--vvd-color-neutral-600);\n}\n\n.focus-indicator {\n --focus-stroke-color: var(--vvd-color-neutral-500);\n --focus-stroke-gap-color: transparent;\n}\n:host(:not([aria-checked=true])) .focus-indicator {\n display: none;\n}";
|
|
282
|
+
|
|
283
|
+
const listboxOptionDefinition = ListboxOption.compose({
|
|
284
|
+
baseName: "option",
|
|
285
|
+
template: ListboxOptionTemplate,
|
|
286
|
+
styles
|
|
368
287
|
});
|
|
369
|
-
const
|
|
370
|
-
const
|
|
288
|
+
const listboxOptionRegistries = [listboxOptionDefinition(), ...iconRegistries, ...focusRegistries];
|
|
289
|
+
const registerOption = registerFactory(listboxOptionRegistries);
|
|
371
290
|
|
|
372
|
-
export {
|
|
291
|
+
export { ListboxOption as L, listboxOptionRegistries as a, isListboxOption as i, listboxOptionDefinition as l, registerOption as r };
|