@vonage/vivid 3.0.0-next.9 → 3.0.0-next.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -4
- package/accordion/index.js +3 -12
- package/accordion-item/index.js +30 -38
- package/action-group/index.js +41 -0
- package/avatar/index.js +60 -0
- package/badge/index.js +16 -30
- package/banner/index.js +25 -111
- package/breadcrumb/index.js +21 -18
- package/breadcrumb-item/index.js +23 -20
- package/button/index.js +19 -757
- package/calendar/index.js +72 -67
- package/calendar-event/index.js +112 -0
- package/card/index.js +113 -0
- package/checkbox/index.js +176 -0
- package/dialog/index.js +229 -0
- package/divider/index.js +4 -0
- package/elevation/index.js +3 -31
- package/fab/index.js +99 -0
- package/focus/index.js +18 -3
- package/header/index.js +61 -0
- package/icon/index.js +10 -9
- package/index.js +57 -20
- package/layout/index.js +5 -15
- package/lib/accordion-item/accordion-item.d.ts +2 -2
- package/lib/accordion-item/index.d.ts +2 -1
- package/lib/action-group/action-group.d.ts +10 -0
- package/lib/{sidenav-item/sidenav-item.template.d.ts → action-group/action-group.template.d.ts} +2 -2
- package/lib/{sidenav-item → action-group}/index.d.ts +1 -2
- package/lib/avatar/avatar.d.ts +15 -0
- package/lib/avatar/avatar.template.d.ts +4 -0
- package/lib/avatar/index.d.ts +3 -0
- package/lib/badge/badge.d.ts +3 -5
- package/lib/badge/index.d.ts +1 -1
- package/lib/banner/banner.d.ts +1 -1
- package/lib/banner/banner.template.d.ts +0 -2
- package/lib/banner/index.d.ts +1 -0
- package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
- package/lib/breadcrumb-item/breadcrumb-item.d.ts +1 -1
- package/lib/breadcrumb-item/index.d.ts +1 -0
- package/lib/button/button.d.ts +6 -5
- package/lib/button/index.d.ts +2 -19
- package/lib/calendar/calendar.d.ts +3 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/calendar-event.d.ts +14 -0
- package/lib/calendar-event/calendar-event.template.d.ts +4 -0
- package/lib/calendar-event/index.d.ts +2 -0
- package/lib/card/card.d.ts +10 -0
- package/lib/{text/text.template.d.ts → card/card.template.d.ts} +2 -2
- package/lib/card/index.d.ts +4 -0
- package/lib/checkbox/checkbox.d.ts +5 -0
- package/lib/checkbox/checkbox.template.d.ts +4 -0
- package/lib/checkbox/index.d.ts +4 -0
- package/lib/components.d.ts +29 -10
- package/lib/dialog/dialog.d.ts +20 -0
- package/lib/dialog/dialog.template.d.ts +4 -0
- package/lib/dialog/index.d.ts +5 -0
- package/lib/divider/divider.d.ts +3 -0
- package/lib/divider/divider.template.d.ts +4 -0
- package/lib/divider/index.d.ts +2 -0
- package/lib/elevation/elevation.d.ts +1 -0
- package/lib/elevation/index.d.ts +1 -1
- package/lib/enums.d.ts +11 -6
- package/lib/fab/fab.d.ts +13 -0
- package/lib/fab/fab.template.d.ts +4 -0
- package/lib/fab/index.d.ts +4 -0
- package/lib/focus/index.d.ts +1 -1
- package/lib/header/header.d.ts +5 -0
- package/lib/header/header.template.d.ts +4 -0
- package/lib/header/index.d.ts +3 -0
- package/lib/icon/icon.d.ts +4 -3
- package/lib/layout/index.d.ts +1 -1
- package/lib/layout/layout.d.ts +3 -3
- package/lib/listbox-option/index.d.ts +4 -0
- package/lib/listbox-option/listbox-option.d.ts +7 -0
- package/lib/listbox-option/listbox-option.template.d.ts +4 -0
- package/lib/menu/index.d.ts +12 -0
- package/lib/menu/menu.d.ts +10 -0
- package/lib/menu/menu.template.d.ts +3 -0
- package/lib/menu-item/index.d.ts +3 -0
- package/lib/menu-item/menu-item.d.ts +7 -0
- package/lib/menu-item/menu-item.template.d.ts +5 -0
- package/lib/nav/index.d.ts +2 -0
- package/lib/nav/nav.d.ts +3 -0
- package/lib/nav/nav.template.d.ts +4 -0
- package/lib/nav-disclosure/index.d.ts +4 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
- package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
- package/lib/nav-item/index.d.ts +4 -0
- package/lib/{sidenav-item/sidenav-item.d.ts → nav-item/nav-item.d.ts} +2 -2
- package/lib/nav-item/nav-item.template.d.ts +4 -0
- package/lib/{text → note}/index.d.ts +1 -1
- package/lib/note/note.d.ts +10 -0
- package/lib/note/note.template.d.ts +5 -0
- package/lib/number-field/index.d.ts +4 -0
- package/lib/number-field/number-field.d.ts +14 -0
- package/lib/number-field/number-field.template.d.ts +4 -0
- package/lib/popup/index.d.ts +1 -1
- package/lib/popup/popup.d.ts +2 -1
- package/lib/progress/progress.d.ts +1 -1
- package/lib/progress-ring/progress-ring.d.ts +2 -1
- package/lib/radio/index.d.ts +3 -0
- package/lib/radio/radio.d.ts +4 -0
- package/lib/radio/radio.template.d.ts +4 -0
- package/lib/radio-group/index.d.ts +10 -0
- package/lib/radio-group/radio-group.d.ts +4 -0
- package/lib/radio-group/radio-group.template.d.ts +4 -0
- package/lib/side-drawer/index.d.ts +1 -1
- package/lib/side-drawer/side-drawer.d.ts +3 -2
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/text-area/index.d.ts +4 -0
- package/lib/text-area/text-area.d.ts +9 -0
- package/lib/text-area/text-area.template.d.ts +4 -0
- package/lib/text-field/index.d.ts +4 -0
- package/lib/text-field/text-field.d.ts +14 -0
- package/lib/text-field/text-field.template.d.ts +5 -0
- package/lib/tooltip/tooltip.d.ts +2 -2
- package/listbox-option/index.js +248 -0
- package/menu/index.js +376 -0
- package/menu-item/index.js +20 -0
- package/nav/index.js +17 -0
- package/nav-disclosure/index.js +81 -0
- package/nav-item/index.js +45 -0
- package/note/index.js +58 -0
- package/number-field/index.js +516 -0
- package/package.json +58 -10
- package/popup/index.js +22 -2061
- package/progress/index.js +35 -36
- package/progress-ring/index.js +11 -11
- package/radio/index.js +50 -0
- package/radio-group/index.js +435 -0
- package/shared/affix.js +1 -6
- package/shared/anchor.js +10 -2
- package/shared/apply-mixins.js +5 -4
- package/shared/aria-global.js +2 -86
- package/shared/aria.js +9 -0
- package/shared/base-progress.js +5 -0
- package/shared/breadcrumb-item.js +1 -1
- package/shared/button.js +200 -0
- package/shared/calendar-event.js +19 -0
- package/shared/dialog-polyfill.esm.js +858 -0
- package/shared/direction.js +20 -0
- package/shared/enums.js +62 -0
- package/shared/es.object.assign.js +3 -2
- package/shared/export.js +1017 -0
- package/shared/focus.js +5 -0
- package/shared/focus2.js +11 -0
- package/shared/form-associated.js +466 -0
- package/shared/form-elements.js +331 -0
- package/shared/icon.js +534 -531
- package/shared/index.js +108 -79
- package/shared/index2.js +100 -14
- package/shared/index3.js +31 -0
- package/shared/index4.js +77 -0
- package/shared/index5.js +1525 -0
- package/shared/index6.js +349 -0
- package/shared/iterators.js +61 -0
- package/shared/key-codes.js +96 -0
- package/shared/object-keys.js +13 -0
- package/shared/patterns/focus.d.ts +3 -0
- package/shared/patterns/form-elements/form-elements.d.ts +28 -0
- package/shared/patterns/form-elements/index.d.ts +1 -0
- package/shared/patterns/index.d.ts +2 -0
- package/shared/radio.js +127 -0
- package/shared/ref.js +41 -0
- package/shared/slotted.js +1 -1
- package/shared/start-end.js +50 -0
- package/shared/text-anchor.js +2 -13
- package/shared/text-anchor.template.js +6 -5
- package/shared/to-string.js +51 -0
- package/shared/web.dom-collections.iterator.js +74 -1081
- package/side-drawer/index.js +41 -33
- package/styles/core/all.css +75 -0
- package/styles/core/theme.css +11 -0
- package/styles/core/typography.css +69 -0
- package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
- package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
- package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
- package/styles/fonts/spezia.css +9 -12
- package/styles/tokens/theme-dark.css +230 -0
- package/styles/tokens/theme-light.css +230 -0
- package/text-anchor/index.js +9 -1
- package/text-area/index.js +288 -0
- package/text-field/index.js +129 -0
- package/tooltip/index.js +23 -24
- package/lib/text/text.d.ts +0 -10
- package/shared/style-inject.es.js +0 -28
- package/sidenav-item/index.js +0 -38
- package/styles/themes/dark.css +0 -205
- package/styles/themes/light.css +0 -205
- package/text/index.js +0 -45
package/shared/index6.js
ADDED
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import '../icon/index.js';
|
|
2
|
+
import { F as FoundationElement, D as DOM, _ as __decorate, a as attr, o as observable, b as __metadata, h as html, d as designSystem } from './index.js';
|
|
3
|
+
import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
4
|
+
import { S as StartEnd } from './start-end.js';
|
|
5
|
+
import { D as Direction, g as getDirection } from './direction.js';
|
|
6
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
+
import { g as keyArrowLeft, h as keyArrowRight, a as keySpace, k as keyEnter } from './key-codes.js';
|
|
8
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
9
|
+
import { w as when } from './when.js';
|
|
10
|
+
import { c as classNames } from './class-names.js';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Menu items roles.
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
const MenuItemRole = {
|
|
17
|
+
/**
|
|
18
|
+
* The menu item has a "menuitem" role
|
|
19
|
+
*/
|
|
20
|
+
menuitem: "menuitem",
|
|
21
|
+
/**
|
|
22
|
+
* The menu item has a "menuitemcheckbox" role
|
|
23
|
+
*/
|
|
24
|
+
menuitemcheckbox: "menuitemcheckbox",
|
|
25
|
+
/**
|
|
26
|
+
* The menu item has a "menuitemradio" role
|
|
27
|
+
*/
|
|
28
|
+
menuitemradio: "menuitemradio",
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* @internal
|
|
32
|
+
*/
|
|
33
|
+
const roleForMenuItem = {
|
|
34
|
+
[MenuItemRole.menuitem]: "menuitem",
|
|
35
|
+
[MenuItemRole.menuitemcheckbox]: "menuitemcheckbox",
|
|
36
|
+
[MenuItemRole.menuitemradio]: "menuitemradio",
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* A Switch Custom HTML Element.
|
|
41
|
+
* Implements {@link https://www.w3.org/TR/wai-aria-1.1/#menuitem | ARIA menuitem }, {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemcheckbox | ARIA menuitemcheckbox}, or {@link https://www.w3.org/TR/wai-aria-1.1/#menuitemradio | ARIA menuitemradio }.
|
|
42
|
+
*
|
|
43
|
+
* @slot checked-indicator - The checked indicator
|
|
44
|
+
* @slot radio-indicator - The radio indicator
|
|
45
|
+
* @slot start - Content which can be provided before the menu item content
|
|
46
|
+
* @slot end - Content which can be provided after the menu item content
|
|
47
|
+
* @slot - The default slot for menu item content
|
|
48
|
+
* @slot expand-collapse-indicator - The expand/collapse indicator
|
|
49
|
+
* @slot submenu - Used to nest menu's within menu items
|
|
50
|
+
* @csspart input-container - The element representing the visual checked or radio indicator
|
|
51
|
+
* @csspart checkbox - The element wrapping the `menuitemcheckbox` indicator
|
|
52
|
+
* @csspart radio - The element wrapping the `menuitemradio` indicator
|
|
53
|
+
* @csspart content - The element wrapping the menu item content
|
|
54
|
+
* @csspart expand-collapse-glyph-container - The element wrapping the expand collapse element
|
|
55
|
+
* @csspart expand-collapse - The expand/collapse element
|
|
56
|
+
* @csspart submenu-region - The container for the submenu, used for positioning
|
|
57
|
+
* @fires expanded-change - Fires a custom 'expanded-change' event when the expanded state changes
|
|
58
|
+
* @fires change - Fires a custom 'change' event when a non-submenu item with a role of `menuitemcheckbox`, `menuitemradio`, or `menuitem` is invoked
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
class MenuItem$1 extends FoundationElement {
|
|
63
|
+
constructor() {
|
|
64
|
+
super(...arguments);
|
|
65
|
+
/**
|
|
66
|
+
* The role of the element.
|
|
67
|
+
*
|
|
68
|
+
* @public
|
|
69
|
+
* @remarks
|
|
70
|
+
* HTML Attribute: role
|
|
71
|
+
*/
|
|
72
|
+
this.role = MenuItemRole.menuitem;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
this.hasSubmenu = false;
|
|
77
|
+
/**
|
|
78
|
+
* Track current direction to pass to the anchored region
|
|
79
|
+
*
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
this.currentDirection = Direction.ltr;
|
|
83
|
+
this.focusSubmenuOnLoad = false;
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
*/
|
|
87
|
+
this.handleMenuItemKeyDown = (e) => {
|
|
88
|
+
if (e.defaultPrevented) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
switch (e.key) {
|
|
92
|
+
case keyEnter:
|
|
93
|
+
case keySpace:
|
|
94
|
+
this.invoke();
|
|
95
|
+
return false;
|
|
96
|
+
case keyArrowRight:
|
|
97
|
+
//open/focus on submenu
|
|
98
|
+
this.expandAndFocus();
|
|
99
|
+
return false;
|
|
100
|
+
case keyArrowLeft:
|
|
101
|
+
//close submenu
|
|
102
|
+
if (this.expanded) {
|
|
103
|
+
this.expanded = false;
|
|
104
|
+
this.focus();
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return true;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
*/
|
|
113
|
+
this.handleMenuItemClick = (e) => {
|
|
114
|
+
if (e.defaultPrevented || this.disabled) {
|
|
115
|
+
return false;
|
|
116
|
+
}
|
|
117
|
+
this.invoke();
|
|
118
|
+
return false;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* @internal
|
|
122
|
+
*/
|
|
123
|
+
this.submenuLoaded = () => {
|
|
124
|
+
if (!this.focusSubmenuOnLoad) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this.focusSubmenuOnLoad = false;
|
|
128
|
+
if (this.hasSubmenu) {
|
|
129
|
+
this.submenu.focus();
|
|
130
|
+
this.setAttribute("tabindex", "-1");
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
this.handleMouseOver = (e) => {
|
|
137
|
+
if (this.disabled || !this.hasSubmenu || this.expanded) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
this.expanded = true;
|
|
141
|
+
return false;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* @internal
|
|
145
|
+
*/
|
|
146
|
+
this.handleMouseOut = (e) => {
|
|
147
|
+
if (!this.expanded || this.contains(document.activeElement)) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
this.expanded = false;
|
|
151
|
+
return false;
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* @internal
|
|
155
|
+
*/
|
|
156
|
+
this.expandAndFocus = () => {
|
|
157
|
+
if (!this.hasSubmenu) {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
this.focusSubmenuOnLoad = true;
|
|
161
|
+
this.expanded = true;
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
this.invoke = () => {
|
|
167
|
+
if (this.disabled) {
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
switch (this.role) {
|
|
171
|
+
case MenuItemRole.menuitemcheckbox:
|
|
172
|
+
this.checked = !this.checked;
|
|
173
|
+
break;
|
|
174
|
+
case MenuItemRole.menuitem:
|
|
175
|
+
// update submenu
|
|
176
|
+
this.updateSubmenu();
|
|
177
|
+
if (this.hasSubmenu) {
|
|
178
|
+
this.expandAndFocus();
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
this.$emit("change");
|
|
182
|
+
}
|
|
183
|
+
break;
|
|
184
|
+
case MenuItemRole.menuitemradio:
|
|
185
|
+
if (!this.checked) {
|
|
186
|
+
this.checked = true;
|
|
187
|
+
}
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Gets the submenu element if any
|
|
193
|
+
*
|
|
194
|
+
* @internal
|
|
195
|
+
*/
|
|
196
|
+
this.updateSubmenu = () => {
|
|
197
|
+
this.submenu = this.domChildren().find((element) => {
|
|
198
|
+
return element.getAttribute("role") === "menu";
|
|
199
|
+
});
|
|
200
|
+
this.hasSubmenu = this.submenu === undefined ? false : true;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
expandedChanged(oldValue) {
|
|
204
|
+
if (this.$fastController.isConnected) {
|
|
205
|
+
if (this.submenu === undefined) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (this.expanded === false) {
|
|
209
|
+
this.submenu.collapseExpandedItem();
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
this.currentDirection = getDirection(this);
|
|
213
|
+
}
|
|
214
|
+
this.$emit("expanded-change", this, { bubbles: false });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
checkedChanged(oldValue, newValue) {
|
|
218
|
+
if (this.$fastController.isConnected) {
|
|
219
|
+
this.$emit("change");
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* @internal
|
|
224
|
+
*/
|
|
225
|
+
connectedCallback() {
|
|
226
|
+
super.connectedCallback();
|
|
227
|
+
DOM.queueUpdate(() => {
|
|
228
|
+
this.updateSubmenu();
|
|
229
|
+
});
|
|
230
|
+
if (!this.startColumnCount) {
|
|
231
|
+
this.startColumnCount = 1;
|
|
232
|
+
}
|
|
233
|
+
this.observer = new MutationObserver(this.updateSubmenu);
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
238
|
+
disconnectedCallback() {
|
|
239
|
+
super.disconnectedCallback();
|
|
240
|
+
this.submenu = undefined;
|
|
241
|
+
if (this.observer !== undefined) {
|
|
242
|
+
this.observer.disconnect();
|
|
243
|
+
this.observer = undefined;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* get an array of valid DOM children
|
|
248
|
+
*/
|
|
249
|
+
domChildren() {
|
|
250
|
+
return Array.from(this.children).filter(child => !child.hasAttribute("hidden"));
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
__decorate([
|
|
254
|
+
attr({ mode: "boolean" })
|
|
255
|
+
], MenuItem$1.prototype, "disabled", void 0);
|
|
256
|
+
__decorate([
|
|
257
|
+
attr({ mode: "boolean" })
|
|
258
|
+
], MenuItem$1.prototype, "expanded", void 0);
|
|
259
|
+
__decorate([
|
|
260
|
+
observable
|
|
261
|
+
], MenuItem$1.prototype, "startColumnCount", void 0);
|
|
262
|
+
__decorate([
|
|
263
|
+
attr
|
|
264
|
+
], MenuItem$1.prototype, "role", void 0);
|
|
265
|
+
__decorate([
|
|
266
|
+
attr({ mode: "boolean" })
|
|
267
|
+
], MenuItem$1.prototype, "checked", void 0);
|
|
268
|
+
__decorate([
|
|
269
|
+
observable
|
|
270
|
+
], MenuItem$1.prototype, "submenuRegion", void 0);
|
|
271
|
+
__decorate([
|
|
272
|
+
observable
|
|
273
|
+
], MenuItem$1.prototype, "hasSubmenu", void 0);
|
|
274
|
+
__decorate([
|
|
275
|
+
observable
|
|
276
|
+
], MenuItem$1.prototype, "currentDirection", void 0);
|
|
277
|
+
__decorate([
|
|
278
|
+
observable
|
|
279
|
+
], MenuItem$1.prototype, "submenu", void 0);
|
|
280
|
+
applyMixins(MenuItem$1, StartEnd);
|
|
281
|
+
|
|
282
|
+
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 03 Nov 2022 17:26:06 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus) {\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 block-size: calc(1px * (40 + 8 * clamp(-1, var(--vvd-size-density, 0), 1)));\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n gap: 8px;\n inline-size: 100%;\n padding-inline: 8px;\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)) {\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-400);\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-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.base:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.base {\n --_connotation-color-primary: var(--vvd-color-canvas-text);\n --_connotation-color-primary-text: var(--vvd-color-canvas);\n --_connotation-color-primary-increment: var(--vvd-color-neutral-800);\n --_connotation-color-faint: var(--vvd-color-neutral-50);\n --_connotation-color-soft: var(--vvd-color-neutral-100);\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}\n\n.focus-indicator {\n border-radius: 6px;\n}\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n}\n.base:not(.item-checkbox, .item-radio) .icon {\n color: var(--vvd-color-neutral-600);\n}\n\n.text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}";
|
|
283
|
+
|
|
284
|
+
class MenuItem extends MenuItem$1 {}
|
|
285
|
+
__decorate([attr, __metadata("design:type", String)], MenuItem.prototype, "text", void 0);
|
|
286
|
+
applyMixins(MenuItem, AffixIcon);
|
|
287
|
+
|
|
288
|
+
let _ = t => t,
|
|
289
|
+
_t,
|
|
290
|
+
_t2,
|
|
291
|
+
_t3,
|
|
292
|
+
_t4,
|
|
293
|
+
_t5;
|
|
294
|
+
const getClasses = ({
|
|
295
|
+
disabled,
|
|
296
|
+
checked,
|
|
297
|
+
expanded,
|
|
298
|
+
role
|
|
299
|
+
}) => classNames('base', ['disabled', Boolean(disabled)], ['selected', role !== MenuItemRole.menuitem && Boolean(checked)], ['expanded', Boolean(expanded)], ['item-checkbox', role === MenuItemRole.menuitemcheckbox], ['item-radio', role === MenuItemRole.menuitemradio]);
|
|
300
|
+
const MenuItemTemplate = (context, definition) => {
|
|
301
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
302
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
303
|
+
return html(_t || (_t = _`
|
|
304
|
+
<template
|
|
305
|
+
aria-checked="${0}"
|
|
306
|
+
aria-disabled="${0}"
|
|
307
|
+
aria-expanded="${0}"
|
|
308
|
+
@keydown="${0}"
|
|
309
|
+
@click="${0}"
|
|
310
|
+
@mouseover="${0}"
|
|
311
|
+
@mouseout="${0}"
|
|
312
|
+
>
|
|
313
|
+
<div class="${0}">
|
|
314
|
+
|
|
315
|
+
${0}
|
|
316
|
+
${0}
|
|
317
|
+
|
|
318
|
+
${0}
|
|
319
|
+
|
|
320
|
+
${0}
|
|
321
|
+
|
|
322
|
+
${0}
|
|
323
|
+
|
|
324
|
+
<span class="text">
|
|
325
|
+
${0}
|
|
326
|
+
</span>
|
|
327
|
+
</div>
|
|
328
|
+
</template>
|
|
329
|
+
`), x => x.role !== MenuItemRole.menuitem ? x.checked : void 0, x => x.disabled, x => x.expanded, (x, c) => x.handleMenuItemKeyDown(c.event), (x, c) => x.handleMenuItemClick(c.event), (x, c) => x.handleMouseOver(c.event), (x, c) => x.handleMouseOut(c.event), getClasses, when(x => x.hasSubmenu, html(_t2 || (_t2 = _`
|
|
330
|
+
<div
|
|
331
|
+
class="expand-collapse-glyph-container"
|
|
332
|
+
>
|
|
333
|
+
<span class="expand-collapse">
|
|
334
|
+
<slot name="expand-collapse-indicator">
|
|
335
|
+
${0}
|
|
336
|
+
</slot>
|
|
337
|
+
</span>
|
|
338
|
+
</div>
|
|
339
|
+
`), definition.expandCollapseGlyph || '')), () => focusTemplate, when(x => x.role === MenuItemRole.menuitemcheckbox, html(_t3 || (_t3 = _`${0}`), x => affixIconTemplate(x.checked ? 'checkbox-checked-line' : 'checkbox-unchecked-line'))), when(x => x.role === MenuItemRole.menuitemradio, html(_t4 || (_t4 = _`${0}`), x => affixIconTemplate(x.checked ? 'radio-checked-line' : 'radio-unchecked-line'))), when(x => x.role === MenuItemRole.menuitem && x.icon, html(_t5 || (_t5 = _`${0}`), x => affixIconTemplate(x.icon))), x => x.text);
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
const vividMenuItem = MenuItem.compose({
|
|
343
|
+
baseName: 'menu-item',
|
|
344
|
+
template: MenuItemTemplate,
|
|
345
|
+
styles: css_248z
|
|
346
|
+
});
|
|
347
|
+
designSystem.register(vividMenuItem());
|
|
348
|
+
|
|
349
|
+
export { MenuItem$1 as M, MenuItemRole as a, roleForMenuItem as r, vividMenuItem as v };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { i as isCallable$1, f as functionUncurryThis, j as anObject$1, w as wellKnownSymbol$1, o as objectDefineProperty, q as hasOwnProperty_1, a as getBuiltIn$1 } from './export.js';
|
|
2
|
+
|
|
3
|
+
var isCallable = isCallable$1;
|
|
4
|
+
|
|
5
|
+
var $String = String;
|
|
6
|
+
var $TypeError = TypeError;
|
|
7
|
+
|
|
8
|
+
var aPossiblePrototype$1 = function (argument) {
|
|
9
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
10
|
+
throw $TypeError("Can't set " + $String(argument) + ' as a prototype');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/* eslint-disable no-proto -- safe */
|
|
14
|
+
|
|
15
|
+
var uncurryThis = functionUncurryThis;
|
|
16
|
+
var anObject = anObject$1;
|
|
17
|
+
var aPossiblePrototype = aPossiblePrototype$1;
|
|
18
|
+
|
|
19
|
+
// `Object.setPrototypeOf` method
|
|
20
|
+
// https://tc39.es/ecma262/#sec-object.setprototypeof
|
|
21
|
+
// Works with __proto__ only. Old v8 can't work with null proto objects.
|
|
22
|
+
// eslint-disable-next-line es/no-object-setprototypeof -- safe
|
|
23
|
+
var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
|
24
|
+
var CORRECT_SETTER = false;
|
|
25
|
+
var test = {};
|
|
26
|
+
var setter;
|
|
27
|
+
try {
|
|
28
|
+
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
29
|
+
setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
|
|
30
|
+
setter(test, []);
|
|
31
|
+
CORRECT_SETTER = test instanceof Array;
|
|
32
|
+
} catch (error) { /* empty */ }
|
|
33
|
+
return function setPrototypeOf(O, proto) {
|
|
34
|
+
anObject(O);
|
|
35
|
+
aPossiblePrototype(proto);
|
|
36
|
+
if (CORRECT_SETTER) setter(O, proto);
|
|
37
|
+
else O.__proto__ = proto;
|
|
38
|
+
return O;
|
|
39
|
+
};
|
|
40
|
+
}() : undefined);
|
|
41
|
+
|
|
42
|
+
var defineProperty = objectDefineProperty.f;
|
|
43
|
+
var hasOwn = hasOwnProperty_1;
|
|
44
|
+
var wellKnownSymbol = wellKnownSymbol$1;
|
|
45
|
+
|
|
46
|
+
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
|
47
|
+
|
|
48
|
+
var setToStringTag = function (target, TAG, STATIC) {
|
|
49
|
+
if (target && !STATIC) target = target.prototype;
|
|
50
|
+
if (target && !hasOwn(target, TO_STRING_TAG)) {
|
|
51
|
+
defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var getBuiltIn = getBuiltIn$1;
|
|
56
|
+
|
|
57
|
+
var html = getBuiltIn('document', 'documentElement');
|
|
58
|
+
|
|
59
|
+
var iterators = {};
|
|
60
|
+
|
|
61
|
+
export { html as h, iterators as i, objectSetPrototypeOf as o, setToStringTag as s };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Key Code values
|
|
3
|
+
* @deprecated - KeyCodes are deprecated, use individual string key exports
|
|
4
|
+
*/
|
|
5
|
+
var KeyCodes;
|
|
6
|
+
(function (KeyCodes) {
|
|
7
|
+
KeyCodes[KeyCodes["alt"] = 18] = "alt";
|
|
8
|
+
KeyCodes[KeyCodes["arrowDown"] = 40] = "arrowDown";
|
|
9
|
+
KeyCodes[KeyCodes["arrowLeft"] = 37] = "arrowLeft";
|
|
10
|
+
KeyCodes[KeyCodes["arrowRight"] = 39] = "arrowRight";
|
|
11
|
+
KeyCodes[KeyCodes["arrowUp"] = 38] = "arrowUp";
|
|
12
|
+
KeyCodes[KeyCodes["back"] = 8] = "back";
|
|
13
|
+
KeyCodes[KeyCodes["backSlash"] = 220] = "backSlash";
|
|
14
|
+
KeyCodes[KeyCodes["break"] = 19] = "break";
|
|
15
|
+
KeyCodes[KeyCodes["capsLock"] = 20] = "capsLock";
|
|
16
|
+
KeyCodes[KeyCodes["closeBracket"] = 221] = "closeBracket";
|
|
17
|
+
KeyCodes[KeyCodes["colon"] = 186] = "colon";
|
|
18
|
+
KeyCodes[KeyCodes["colon2"] = 59] = "colon2";
|
|
19
|
+
KeyCodes[KeyCodes["comma"] = 188] = "comma";
|
|
20
|
+
KeyCodes[KeyCodes["ctrl"] = 17] = "ctrl";
|
|
21
|
+
KeyCodes[KeyCodes["delete"] = 46] = "delete";
|
|
22
|
+
KeyCodes[KeyCodes["end"] = 35] = "end";
|
|
23
|
+
KeyCodes[KeyCodes["enter"] = 13] = "enter";
|
|
24
|
+
KeyCodes[KeyCodes["equals"] = 187] = "equals";
|
|
25
|
+
KeyCodes[KeyCodes["equals2"] = 61] = "equals2";
|
|
26
|
+
KeyCodes[KeyCodes["equals3"] = 107] = "equals3";
|
|
27
|
+
KeyCodes[KeyCodes["escape"] = 27] = "escape";
|
|
28
|
+
KeyCodes[KeyCodes["forwardSlash"] = 191] = "forwardSlash";
|
|
29
|
+
KeyCodes[KeyCodes["function1"] = 112] = "function1";
|
|
30
|
+
KeyCodes[KeyCodes["function10"] = 121] = "function10";
|
|
31
|
+
KeyCodes[KeyCodes["function11"] = 122] = "function11";
|
|
32
|
+
KeyCodes[KeyCodes["function12"] = 123] = "function12";
|
|
33
|
+
KeyCodes[KeyCodes["function2"] = 113] = "function2";
|
|
34
|
+
KeyCodes[KeyCodes["function3"] = 114] = "function3";
|
|
35
|
+
KeyCodes[KeyCodes["function4"] = 115] = "function4";
|
|
36
|
+
KeyCodes[KeyCodes["function5"] = 116] = "function5";
|
|
37
|
+
KeyCodes[KeyCodes["function6"] = 117] = "function6";
|
|
38
|
+
KeyCodes[KeyCodes["function7"] = 118] = "function7";
|
|
39
|
+
KeyCodes[KeyCodes["function8"] = 119] = "function8";
|
|
40
|
+
KeyCodes[KeyCodes["function9"] = 120] = "function9";
|
|
41
|
+
KeyCodes[KeyCodes["home"] = 36] = "home";
|
|
42
|
+
KeyCodes[KeyCodes["insert"] = 45] = "insert";
|
|
43
|
+
KeyCodes[KeyCodes["menu"] = 93] = "menu";
|
|
44
|
+
KeyCodes[KeyCodes["minus"] = 189] = "minus";
|
|
45
|
+
KeyCodes[KeyCodes["minus2"] = 109] = "minus2";
|
|
46
|
+
KeyCodes[KeyCodes["numLock"] = 144] = "numLock";
|
|
47
|
+
KeyCodes[KeyCodes["numPad0"] = 96] = "numPad0";
|
|
48
|
+
KeyCodes[KeyCodes["numPad1"] = 97] = "numPad1";
|
|
49
|
+
KeyCodes[KeyCodes["numPad2"] = 98] = "numPad2";
|
|
50
|
+
KeyCodes[KeyCodes["numPad3"] = 99] = "numPad3";
|
|
51
|
+
KeyCodes[KeyCodes["numPad4"] = 100] = "numPad4";
|
|
52
|
+
KeyCodes[KeyCodes["numPad5"] = 101] = "numPad5";
|
|
53
|
+
KeyCodes[KeyCodes["numPad6"] = 102] = "numPad6";
|
|
54
|
+
KeyCodes[KeyCodes["numPad7"] = 103] = "numPad7";
|
|
55
|
+
KeyCodes[KeyCodes["numPad8"] = 104] = "numPad8";
|
|
56
|
+
KeyCodes[KeyCodes["numPad9"] = 105] = "numPad9";
|
|
57
|
+
KeyCodes[KeyCodes["numPadDivide"] = 111] = "numPadDivide";
|
|
58
|
+
KeyCodes[KeyCodes["numPadDot"] = 110] = "numPadDot";
|
|
59
|
+
KeyCodes[KeyCodes["numPadMinus"] = 109] = "numPadMinus";
|
|
60
|
+
KeyCodes[KeyCodes["numPadMultiply"] = 106] = "numPadMultiply";
|
|
61
|
+
KeyCodes[KeyCodes["numPadPlus"] = 107] = "numPadPlus";
|
|
62
|
+
KeyCodes[KeyCodes["openBracket"] = 219] = "openBracket";
|
|
63
|
+
KeyCodes[KeyCodes["pageDown"] = 34] = "pageDown";
|
|
64
|
+
KeyCodes[KeyCodes["pageUp"] = 33] = "pageUp";
|
|
65
|
+
KeyCodes[KeyCodes["period"] = 190] = "period";
|
|
66
|
+
KeyCodes[KeyCodes["print"] = 44] = "print";
|
|
67
|
+
KeyCodes[KeyCodes["quote"] = 222] = "quote";
|
|
68
|
+
KeyCodes[KeyCodes["scrollLock"] = 145] = "scrollLock";
|
|
69
|
+
KeyCodes[KeyCodes["shift"] = 16] = "shift";
|
|
70
|
+
KeyCodes[KeyCodes["space"] = 32] = "space";
|
|
71
|
+
KeyCodes[KeyCodes["tab"] = 9] = "tab";
|
|
72
|
+
KeyCodes[KeyCodes["tilde"] = 192] = "tilde";
|
|
73
|
+
KeyCodes[KeyCodes["windowsLeft"] = 91] = "windowsLeft";
|
|
74
|
+
KeyCodes[KeyCodes["windowsOpera"] = 219] = "windowsOpera";
|
|
75
|
+
KeyCodes[KeyCodes["windowsRight"] = 92] = "windowsRight";
|
|
76
|
+
})(KeyCodes || (KeyCodes = {}));
|
|
77
|
+
/**
|
|
78
|
+
* String values for use with KeyboardEvent.key
|
|
79
|
+
*/
|
|
80
|
+
const keyArrowDown = "ArrowDown";
|
|
81
|
+
const keyArrowLeft = "ArrowLeft";
|
|
82
|
+
const keyArrowRight = "ArrowRight";
|
|
83
|
+
const keyArrowUp = "ArrowUp";
|
|
84
|
+
const keyEnter = "Enter";
|
|
85
|
+
const keyEscape = "Escape";
|
|
86
|
+
const keyHome = "Home";
|
|
87
|
+
const keyEnd = "End";
|
|
88
|
+
const keySpace = " ";
|
|
89
|
+
const ArrowKeys = {
|
|
90
|
+
ArrowDown: keyArrowDown,
|
|
91
|
+
ArrowLeft: keyArrowLeft,
|
|
92
|
+
ArrowRight: keyArrowRight,
|
|
93
|
+
ArrowUp: keyArrowUp,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
export { ArrowKeys as A, keySpace as a, keyHome as b, keyEnd as c, keyArrowUp as d, keyArrowDown as e, keyEscape as f, keyArrowLeft as g, keyArrowRight as h, keyEnter as k };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { M as objectKeysInternal, H as enumBugKeys$1 } from './export.js';
|
|
2
|
+
|
|
3
|
+
var internalObjectKeys = objectKeysInternal;
|
|
4
|
+
var enumBugKeys = enumBugKeys$1;
|
|
5
|
+
|
|
6
|
+
// `Object.keys` method
|
|
7
|
+
// https://tc39.es/ecma262/#sec-object.keys
|
|
8
|
+
// eslint-disable-next-line es/no-object-keys -- safe
|
|
9
|
+
var objectKeys = Object.keys || function keys(O) {
|
|
10
|
+
return internalObjectKeys(O, enumBugKeys);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { objectKeys as o };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ElementDefinitionContext } from '@microsoft/fast-foundation';
|
|
2
|
+
export interface FormElement {
|
|
3
|
+
charCount: boolean;
|
|
4
|
+
errorValidationMessage: boolean;
|
|
5
|
+
helperText: string;
|
|
6
|
+
successText: string;
|
|
7
|
+
label: string;
|
|
8
|
+
userValid: boolean;
|
|
9
|
+
dirtyValue: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function formElements<T extends {
|
|
12
|
+
new (...args: any[]): Record<string, any>;
|
|
13
|
+
}>(constructor: T): {
|
|
14
|
+
new (...args: any[]): {
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
label?: string | undefined;
|
|
17
|
+
helperText?: string | undefined;
|
|
18
|
+
successText?: string | undefined;
|
|
19
|
+
charCount: boolean;
|
|
20
|
+
userValid: boolean;
|
|
21
|
+
"__#6608@#blurred": boolean;
|
|
22
|
+
readonly errorValidationMessage: any;
|
|
23
|
+
validate: () => void;
|
|
24
|
+
};
|
|
25
|
+
} & T;
|
|
26
|
+
declare type FeedbackType = 'error' | 'helper' | 'success';
|
|
27
|
+
export declare function getFeedbackTemplate(messageType: FeedbackType, context: ElementDefinitionContext): import("@microsoft/fast-element").ViewTemplate<FormElement, any>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './form-elements';
|