@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/shared/definition31.js
CHANGED
|
@@ -1,372 +1,61 @@
|
|
|
1
|
-
import { F as FoundationElement,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { S as StartEnd } from './start-end.js';
|
|
6
|
-
import { D as Direction, g as getDirection } from './direction.js';
|
|
1
|
+
import { F as FoundationElement, a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition24.js';
|
|
3
|
+
import { A as AffixIcon } from './affix.js';
|
|
4
|
+
import './index2.js';
|
|
7
5
|
import { a as applyMixins } from './apply-mixins.js';
|
|
8
|
-
import {
|
|
9
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
6
|
+
import { I as Icon } from './icon.js';
|
|
10
7
|
import { w as when } from './when.js';
|
|
11
|
-
import { s as slotted } from './slotted.js';
|
|
12
8
|
import { c as classNames } from './class-names.js';
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
menuitemcheckbox: "menuitemcheckbox",
|
|
27
|
-
/**
|
|
28
|
-
* The menu item has a "menuitemradio" role
|
|
29
|
-
*/
|
|
30
|
-
menuitemradio: "menuitemradio",
|
|
10
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 GMT\n */\n.base {\n display: flex;\n align-items: flex-start;\n padding: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 20));\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(--_appearance-color-text);\n column-gap: 16px;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-note-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-note-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-note-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-note-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-note-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-note-success-backdrop, var(--vvd-color-success-50));\n}\n.base.connotation-information {\n /* @cssprop [--vvd-note-information-primary=var(--vvd-color-information-500)] */\n --_connotation-color-primary: var(--vvd-note-information-primary, var(--vvd-color-information-500));\n /* @cssprop [--vvd-note-information-intermediate=var(--vvd-color-information-500)] */\n --_connotation-color-intermediate: var(--vvd-note-information-intermediate, var(--vvd-color-information-500));\n /* @cssprop [--vvd-note-information-backdrop=var(--vvd-color-information-50)] */\n --_connotation-color-backdrop: var(--vvd-note-information-backdrop, var(--vvd-color-information-50));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-note-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-note-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-note-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-note-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-note-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-note-alert-backdrop, var(--vvd-color-alert-50));\n}\n.base.connotation-warning {\n /* @cssprop [--vvd-note-warning-primary=var(--vvd-color-warning-300)] */\n --_connotation-color-primary: var(--vvd-note-warning-primary, var(--vvd-color-warning-300));\n /* @cssprop [--vvd-note-warning-intermediate=var(--vvd-color-warning-300)] */\n --_connotation-color-intermediate: var(--vvd-note-warning-intermediate, var(--vvd-color-warning-300));\n /* @cssprop [--vvd-note-warning-backdrop=var(--vvd-color-warning-50)] */\n --_connotation-color-backdrop: var(--vvd-note-warning-backdrop, var(--vvd-color-warning-50));\n}\n.base:not(.connotation-success, .connotation-information, .connotation-alert, .connotation-warning) {\n /* @cssprop [--vvd-note-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-note-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-note-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-note-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-note-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-note-accent-backdrop, var(--vvd-color-canvas));\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n@supports (contain: content) {\n .base {\n contain: content;\n }\n}\n@supports not (contain: content) {\n .base {\n overflow: hidden;\n }\n}\n\n.icon {\n color: var(--_appearance-color-outline);\n font-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2) - 16));\n}\n\n.text {\n display: flex;\n min-height: 24px;\n flex-direction: column;\n flex-grow: 1;\n align-items: flex-start;\n justify-content: center;\n gap: 4px;\n text-align: start;\n}\n.text .headline {\n font: var(--vvd-typography-base-bold);\n}\n.text .message {\n font: var(--vvd-typography-base);\n}";
|
|
11
|
+
|
|
12
|
+
var __defProp = Object.defineProperty;
|
|
13
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19
|
+
if (kind && result)
|
|
20
|
+
__defProp(target, key, result);
|
|
21
|
+
return result;
|
|
31
22
|
};
|
|
32
|
-
|
|
33
|
-
* @internal
|
|
34
|
-
*/
|
|
35
|
-
const roleForMenuItem = {
|
|
36
|
-
[MenuItemRole$1.menuitem]: "menuitem",
|
|
37
|
-
[MenuItemRole$1.menuitemcheckbox]: "menuitemcheckbox",
|
|
38
|
-
[MenuItemRole$1.menuitemradio]: "menuitemradio",
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* A Switch Custom HTML Element.
|
|
43
|
-
* 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 }.
|
|
44
|
-
*
|
|
45
|
-
* @slot checked-indicator - The checked indicator
|
|
46
|
-
* @slot radio-indicator - The radio indicator
|
|
47
|
-
* @slot start - Content which can be provided before the menu item content
|
|
48
|
-
* @slot end - Content which can be provided after the menu item content
|
|
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
|
|
61
|
-
*
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
class MenuItem$1 extends FoundationElement {
|
|
65
|
-
constructor() {
|
|
66
|
-
super(...arguments);
|
|
67
|
-
/**
|
|
68
|
-
* The role of the element.
|
|
69
|
-
*
|
|
70
|
-
* @public
|
|
71
|
-
* @remarks
|
|
72
|
-
* HTML Attribute: role
|
|
73
|
-
*/
|
|
74
|
-
this.role = MenuItemRole$1.menuitem;
|
|
75
|
-
/**
|
|
76
|
-
* @internal
|
|
77
|
-
*/
|
|
78
|
-
this.hasSubmenu = false;
|
|
79
|
-
/**
|
|
80
|
-
* Track current direction to pass to the anchored region
|
|
81
|
-
*
|
|
82
|
-
* @internal
|
|
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
|
|
167
|
-
*/
|
|
168
|
-
this.invoke = () => {
|
|
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
|
-
};
|
|
193
|
-
/**
|
|
194
|
-
* Gets the submenu element if any
|
|
195
|
-
*
|
|
196
|
-
* @internal
|
|
197
|
-
*/
|
|
198
|
-
this.updateSubmenu = () => {
|
|
199
|
-
this.submenu = this.domChildren().find((element) => {
|
|
200
|
-
return element.getAttribute("role") === "menu";
|
|
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 });
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
checkedChanged(oldValue, newValue) {
|
|
220
|
-
if (this.$fastController.isConnected) {
|
|
221
|
-
this.$emit("change");
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* @internal
|
|
226
|
-
*/
|
|
227
|
-
connectedCallback() {
|
|
228
|
-
super.connectedCallback();
|
|
229
|
-
DOM.queueUpdate(() => {
|
|
230
|
-
this.updateSubmenu();
|
|
231
|
-
});
|
|
232
|
-
if (!this.startColumnCount) {
|
|
233
|
-
this.startColumnCount = 1;
|
|
234
|
-
}
|
|
235
|
-
this.observer = new MutationObserver(this.updateSubmenu);
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* @internal
|
|
239
|
-
*/
|
|
240
|
-
disconnectedCallback() {
|
|
241
|
-
super.disconnectedCallback();
|
|
242
|
-
this.submenu = undefined;
|
|
243
|
-
if (this.observer !== undefined) {
|
|
244
|
-
this.observer.disconnect();
|
|
245
|
-
this.observer = undefined;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
/**
|
|
249
|
-
* get an array of valid DOM children
|
|
250
|
-
*/
|
|
251
|
-
domChildren() {
|
|
252
|
-
return Array.from(this.children).filter(child => !child.hasAttribute("hidden"));
|
|
253
|
-
}
|
|
23
|
+
class Note extends FoundationElement {
|
|
254
24
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
],
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
],
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
], MenuItem$1.prototype, "checked", void 0);
|
|
270
|
-
__decorate([
|
|
271
|
-
observable
|
|
272
|
-
], MenuItem$1.prototype, "submenuRegion", void 0);
|
|
273
|
-
__decorate([
|
|
274
|
-
observable
|
|
275
|
-
], MenuItem$1.prototype, "hasSubmenu", void 0);
|
|
276
|
-
__decorate([
|
|
277
|
-
observable
|
|
278
|
-
], MenuItem$1.prototype, "currentDirection", void 0);
|
|
279
|
-
__decorate([
|
|
280
|
-
observable
|
|
281
|
-
], MenuItem$1.prototype, "submenu", void 0);
|
|
282
|
-
applyMixins(MenuItem$1, StartEnd);
|
|
283
|
-
|
|
284
|
-
var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 17 Aug 2023 11:13:18 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);
|
|
296
|
-
|
|
297
|
-
const getCheckIcon = (affixIconTemplate, x, iconType) => {
|
|
298
|
-
const iconStatus = x.checked ? 'checked' : 'unchecked';
|
|
299
|
-
const icon = `${iconType}-${iconStatus}-line`;
|
|
300
|
-
return affixIconTemplate(icon);
|
|
301
|
-
};
|
|
302
|
-
const getClasses = ({
|
|
303
|
-
disabled,
|
|
304
|
-
checked,
|
|
305
|
-
expanded,
|
|
306
|
-
role,
|
|
307
|
-
text,
|
|
308
|
-
textSecondary,
|
|
309
|
-
icon,
|
|
310
|
-
metaSlottedContent
|
|
311
|
-
}) => classNames('base', ['disabled', Boolean(disabled)], ['selected', role !== MenuItemRole.menuitem && Boolean(checked)], ['trailing', role !== MenuItemRole.menuitem && Boolean(icon)], ['expanded', Boolean(expanded)], ['item-checkbox', role === MenuItemRole.menuitemcheckbox], ['item-radio', role === MenuItemRole.menuitemradio], ['two-lines', Boolean(text === null || text === void 0 ? void 0 : text.length) && Boolean(textSecondary === null || textSecondary === void 0 ? void 0 : textSecondary.length)], ['has-meta', Boolean(metaSlottedContent === null || metaSlottedContent === void 0 ? void 0 : metaSlottedContent.length)]);
|
|
312
|
-
function handleClick(x, {
|
|
313
|
-
event
|
|
314
|
-
}) {
|
|
315
|
-
x.handleMenuItemClick(event);
|
|
316
|
-
return x.role === MenuItemRole.presentation;
|
|
25
|
+
__decorateClass([
|
|
26
|
+
attr
|
|
27
|
+
], Note.prototype, "headline", 2);
|
|
28
|
+
__decorateClass([
|
|
29
|
+
attr
|
|
30
|
+
], Note.prototype, "connotation", 2);
|
|
31
|
+
applyMixins(Note, AffixIcon);
|
|
32
|
+
|
|
33
|
+
const getClasses = ({ connotation }) => classNames(
|
|
34
|
+
"base",
|
|
35
|
+
`connotation-${connotation}`
|
|
36
|
+
);
|
|
37
|
+
function getHeaderTemplate() {
|
|
38
|
+
return html`<div class="headline">${(x) => x.headline}</div>`;
|
|
317
39
|
}
|
|
318
|
-
const
|
|
319
|
-
const
|
|
320
|
-
const focusTemplate = focusTemplateFactory(context);
|
|
40
|
+
const NoteTemplate = (context) => {
|
|
41
|
+
const iconTag = context.tagFor(Icon);
|
|
321
42
|
return html`
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
>
|
|
331
|
-
<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
|
-
${() => focusTemplate}
|
|
345
|
-
<slot name="meta" ${slotted('metaSlottedContent')}></slot>
|
|
346
|
-
${when(x => x.role === MenuItemRole.menuitemcheckbox, html`<span class="action">${x => getCheckIcon(affixIconTemplate, x, 'checkbox')}</span>`)}
|
|
347
|
-
|
|
348
|
-
${when(x => x.role === MenuItemRole.menuitemradio, html`<span class="action">${x => getCheckIcon(affixIconTemplate, x, 'radio')}</span>`)}
|
|
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
|
-
|
|
359
|
-
</div>
|
|
360
|
-
</template>
|
|
361
|
-
`;
|
|
43
|
+
<div class="${getClasses}">
|
|
44
|
+
${when((x) => x.icon, html`<${iconTag} class="icon" name="${(x) => x.icon}"></${iconTag}>`)}
|
|
45
|
+
<div class="text">
|
|
46
|
+
${when((x) => x.headline, getHeaderTemplate())}
|
|
47
|
+
<slot class="message"></slot>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
`;
|
|
362
51
|
};
|
|
363
52
|
|
|
364
|
-
const
|
|
365
|
-
baseName:
|
|
366
|
-
template:
|
|
367
|
-
styles
|
|
53
|
+
const noteDefinition = Note.compose({
|
|
54
|
+
baseName: "note",
|
|
55
|
+
template: NoteTemplate,
|
|
56
|
+
styles
|
|
368
57
|
});
|
|
369
|
-
const
|
|
370
|
-
const
|
|
58
|
+
const noteRegistries = [noteDefinition(), ...iconRegistries];
|
|
59
|
+
const registerNote = registerFactory(noteRegistries);
|
|
371
60
|
|
|
372
|
-
export {
|
|
61
|
+
export { noteRegistries as a, noteDefinition as n, registerNote as r };
|