@vonage/vivid 3.51.0 → 3.52.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/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +2 -1
- package/audio-player/index.js +2 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/combobox/index.cjs +2 -5
- package/combobox/index.js +2 -5
- package/custom-elements.json +1357 -529
- package/date-picker/index.cjs +3 -6
- package/date-picker/index.js +3 -6
- package/date-range-picker/index.cjs +2 -5
- package/date-range-picker/index.js +2 -5
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/file-picker/index.cjs +0 -2
- package/file-picker/index.js +0 -2
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/index.cjs +60 -58
- package/index.js +22 -23
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/listbox/index.cjs +23 -22
- package/listbox/index.js +23 -22
- package/locales/en-GB.cjs +4 -0
- package/locales/en-GB.js +4 -0
- package/locales/en-US.cjs +4 -0
- package/locales/en-US.js +4 -0
- package/locales/ja-JP.cjs +5 -1
- package/locales/ja-JP.js +5 -1
- package/locales/zh-CN.cjs +4 -0
- package/locales/zh-CN.js +4 -0
- package/menu/index.cjs +3 -3
- package/menu/index.js +3 -3
- package/menu-item/index.cjs +2 -2
- package/menu-item/index.js +2 -2
- package/number-field/index.cjs +0 -2
- package/number-field/index.js +0 -2
- package/package.json +34 -34
- package/popup/index.cjs +2 -2
- package/popup/index.js +2 -2
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +3 -3
- package/select/index.js +3 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/definition.cjs +8 -3
- package/shared/definition.js +8 -3
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +75 -47
- package/shared/definition11.js +76 -48
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +33 -32
- package/shared/definition14.js +33 -32
- package/shared/definition15.cjs +20 -7
- package/shared/definition15.js +20 -7
- package/shared/definition16.cjs +37 -42
- package/shared/definition16.js +36 -41
- package/shared/definition17.cjs +125 -65
- package/shared/definition17.js +126 -66
- package/shared/definition18.cjs +30 -14
- package/shared/definition18.js +30 -14
- package/shared/definition19.cjs +116 -80
- package/shared/definition19.js +116 -80
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +16 -15
- package/shared/definition20.js +16 -15
- package/shared/definition21.cjs +6 -10
- package/shared/definition21.js +6 -10
- package/shared/definition22.cjs +14 -18
- package/shared/definition22.js +14 -18
- package/shared/definition23.cjs +34 -35
- package/shared/definition23.js +34 -35
- package/shared/definition24.cjs +116 -69
- package/shared/definition24.js +116 -69
- package/shared/definition25.cjs +2 -4
- package/shared/definition25.js +2 -4
- package/shared/definition26.cjs +9 -8
- package/shared/definition26.js +9 -8
- package/shared/definition27.cjs +7 -5
- package/shared/definition27.js +7 -5
- package/shared/definition28.cjs +209 -143
- package/shared/definition28.js +209 -143
- package/shared/definition29.cjs +10 -4
- package/shared/definition29.js +10 -4
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +7 -5
- package/shared/definition30.js +7 -5
- package/shared/definition31.cjs +2 -4
- package/shared/definition31.js +2 -4
- package/shared/definition32.cjs +1 -3
- package/shared/definition32.js +1 -3
- package/shared/definition33.cjs +7 -10
- package/shared/definition33.js +7 -10
- package/shared/definition34.cjs +76 -59
- package/shared/definition34.js +76 -59
- package/shared/definition35.cjs +19 -20
- package/shared/definition35.js +19 -20
- package/shared/definition36.cjs +30 -14
- package/shared/definition36.js +30 -14
- package/shared/definition37.cjs +33 -46
- package/shared/definition37.js +33 -46
- package/shared/definition38.cjs +31 -33
- package/shared/definition38.js +31 -33
- package/shared/definition39.cjs +13 -4
- package/shared/definition39.js +13 -4
- package/shared/definition4.cjs +23 -11
- package/shared/definition4.js +23 -11
- package/shared/definition40.cjs +19 -14
- package/shared/definition40.js +19 -14
- package/shared/definition41.cjs +534 -635
- package/shared/definition41.js +534 -635
- package/shared/definition42.cjs +674 -106
- package/shared/definition42.js +673 -105
- package/shared/definition43.cjs +122 -79
- package/shared/definition43.js +120 -77
- package/shared/definition44.cjs +72 -567
- package/shared/definition44.js +71 -565
- package/shared/definition45.cjs +520 -118
- package/shared/definition45.js +518 -117
- package/shared/definition46.cjs +117 -130
- package/shared/definition46.js +116 -129
- package/shared/definition47.cjs +152 -18
- package/shared/definition47.js +151 -17
- package/shared/definition48.cjs +20 -77
- package/shared/definition48.js +19 -76
- package/shared/definition49.cjs +52 -495
- package/shared/definition49.js +51 -494
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +525 -24
- package/shared/definition50.js +524 -23
- package/shared/definition51.cjs +28 -119
- package/shared/definition51.js +26 -118
- package/shared/definition52.cjs +113 -266
- package/shared/definition52.js +113 -265
- package/shared/definition53.cjs +285 -245
- package/shared/definition53.js +285 -245
- package/shared/definition54.cjs +285 -751
- package/shared/definition54.js +284 -750
- package/shared/definition55.cjs +828 -99
- package/shared/definition55.js +827 -98
- package/shared/definition56.cjs +126 -77
- package/shared/definition56.js +125 -76
- package/shared/definition57.cjs +125 -71
- package/shared/definition57.js +124 -70
- package/shared/definition58.cjs +73 -287
- package/shared/definition58.js +74 -288
- package/shared/definition59.cjs +298 -40
- package/shared/definition59.js +297 -39
- package/shared/definition6.cjs +3 -4
- package/shared/definition6.js +3 -4
- package/shared/definition60.cjs +24 -1784
- package/shared/definition60.js +23 -1783
- package/shared/definition61.cjs +1819 -11
- package/shared/definition61.js +1818 -11
- package/shared/definition7.cjs +6 -4
- package/shared/definition7.js +6 -4
- package/shared/definition8.cjs +25 -18
- package/shared/definition8.js +25 -18
- package/shared/definition9.cjs +6 -9
- package/shared/definition9.js +6 -9
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +1 -1
- package/shared/index2.js +1 -1
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +126 -78
- package/shared/presentationDate.js +126 -78
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.template.cjs +30 -35
- package/shared/text-anchor.template.js +30 -35
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +3 -3
- package/tabs/index.js +3 -3
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -4
- package/text-field/index.js +1 -4
- package/time-picker/index.cjs +4 -7
- package/time-picker/index.js +4 -7
- package/toggletip/index.cjs +3 -3
- package/toggletip/index.js +3 -3
- package/tooltip/index.cjs +3 -3
- package/tooltip/index.js +3 -3
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +117 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
package/shared/definition26.cjs
CHANGED
|
@@ -7,23 +7,24 @@ const when = require('./when.cjs');
|
|
|
7
7
|
|
|
8
8
|
const styles = ":host{display:inline-block;vertical-align:sub}.control{display:flex;margin:unset;block-size:var(--_icon-block-size);color:currentColor;contain:strict;inline-size:var(--_icon-block-size)}.control.connotation-accent{--_connotation-color-primary: var(--vvd-icon-accent-primary, var(--vvd-color-canvas-text))}.control.connotation-announcement{--_connotation-color-primary: var(--vvd-icon-announcement-primary, var(--vvd-color-announcement-500))}.control.connotation-cta{--_connotation-color-primary: var(--vvd-icon-cta-primary, var(--vvd-color-cta-500))}.control.connotation-success{--_connotation-color-primary: var(--vvd-icon-success-primary, var(--vvd-color-success-500))}.control.connotation-alert{--_connotation-color-primary: var(--vvd-icon-alert-primary, var(--vvd-color-alert-500))}.control.connotation-information{--_connotation-color-primary: var(--vvd-icon-information-primary, var(--vvd-color-information-500))}.control.size--6{--_icon-block-size:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.size--5{--_icon-block-size:calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--4{--_icon-block-size:calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--3{--_icon-block-size:calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--2{--_icon-block-size:calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--1{--_icon-block-size:calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-0{--_icon-block-size:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-1{--_icon-block-size:calc(1px*(44 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-2{--_icon-block-size:calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-3{--_icon-block-size:calc(1px*(52 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-4{--_icon-block-size:calc(1px*(56 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-5{--_icon-block-size:calc(1px*(60 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control:not(.size--6,.size--5,.size--4,.size--3,.size--2,.size--1,.size-0,.size-1,.size-2,.size-3,.size-4,.size-5){--_icon-block-size: 1em}.control[class*=connotation]{color:var(--_connotation-color-primary)}slot,svg,::slotted(:where(svg,img)){margin:auto;block-size:inherit;inline-size:inherit}\n";
|
|
9
9
|
|
|
10
|
-
const getClasses = ({
|
|
11
|
-
connotation,
|
|
12
|
-
size
|
|
13
|
-
}) => classNames.classNames(
|
|
10
|
+
const getClasses = ({ connotation, size }) => classNames.classNames(
|
|
14
11
|
"control",
|
|
15
12
|
[`connotation-${connotation}`, Boolean(connotation)],
|
|
16
13
|
[`size-${size}`, Boolean(size)]
|
|
17
14
|
);
|
|
18
15
|
const iconTemplate = () => index.html`
|
|
19
|
-
|
|
20
16
|
<figure class="${getClasses}">
|
|
21
17
|
<slot>
|
|
22
|
-
${when.when(
|
|
23
|
-
|
|
18
|
+
${when.when(
|
|
19
|
+
(x) => !x.iconLoaded,
|
|
20
|
+
index.html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
|
|
21
|
+
)}
|
|
22
|
+
${when.when(
|
|
23
|
+
(x) => x.iconLoaded && x._svg,
|
|
24
|
+
(x) => index.html`${x._svg}`
|
|
25
|
+
)}
|
|
24
26
|
</slot>
|
|
25
27
|
</figure>
|
|
26
|
-
|
|
27
28
|
`;
|
|
28
29
|
|
|
29
30
|
const iconDefinition = icon.Icon.compose({
|
package/shared/definition26.js
CHANGED
|
@@ -5,23 +5,24 @@ import { w as when } from './when.js';
|
|
|
5
5
|
|
|
6
6
|
const styles = ":host{display:inline-block;vertical-align:sub}.control{display:flex;margin:unset;block-size:var(--_icon-block-size);color:currentColor;contain:strict;inline-size:var(--_icon-block-size)}.control.connotation-accent{--_connotation-color-primary: var(--vvd-icon-accent-primary, var(--vvd-color-canvas-text))}.control.connotation-announcement{--_connotation-color-primary: var(--vvd-icon-announcement-primary, var(--vvd-color-announcement-500))}.control.connotation-cta{--_connotation-color-primary: var(--vvd-icon-cta-primary, var(--vvd-color-cta-500))}.control.connotation-success{--_connotation-color-primary: var(--vvd-icon-success-primary, var(--vvd-color-success-500))}.control.connotation-alert{--_connotation-color-primary: var(--vvd-icon-alert-primary, var(--vvd-color-alert-500))}.control.connotation-information{--_connotation-color-primary: var(--vvd-icon-information-primary, var(--vvd-color-information-500))}.control.size--6{--_icon-block-size:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)) - (1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2))))}.control.size--5{--_icon-block-size:calc(1px*(20 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--4{--_icon-block-size:calc(1px*(24 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--3{--_icon-block-size:calc(1px*(28 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--2{--_icon-block-size:calc(1px*(32 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size--1{--_icon-block-size:calc(1px*(36 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-0{--_icon-block-size:calc(1px*(40 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-1{--_icon-block-size:calc(1px*(44 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-2{--_icon-block-size:calc(1px*(48 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-3{--_icon-block-size:calc(1px*(52 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-4{--_icon-block-size:calc(1px*(56 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control.size-5{--_icon-block-size:calc(1px*(60 + 4*clamp(-1, var(--vvd-size-density, 0), 2)))}.control:not(.size--6,.size--5,.size--4,.size--3,.size--2,.size--1,.size-0,.size-1,.size-2,.size-3,.size-4,.size-5){--_icon-block-size: 1em}.control[class*=connotation]{color:var(--_connotation-color-primary)}slot,svg,::slotted(:where(svg,img)){margin:auto;block-size:inherit;inline-size:inherit}\n";
|
|
7
7
|
|
|
8
|
-
const getClasses = ({
|
|
9
|
-
connotation,
|
|
10
|
-
size
|
|
11
|
-
}) => classNames(
|
|
8
|
+
const getClasses = ({ connotation, size }) => classNames(
|
|
12
9
|
"control",
|
|
13
10
|
[`connotation-${connotation}`, Boolean(connotation)],
|
|
14
11
|
[`size-${size}`, Boolean(size)]
|
|
15
12
|
);
|
|
16
13
|
const iconTemplate = () => html`
|
|
17
|
-
|
|
18
14
|
<figure class="${getClasses}">
|
|
19
15
|
<slot>
|
|
20
|
-
${when(
|
|
21
|
-
|
|
16
|
+
${when(
|
|
17
|
+
(x) => !x.iconLoaded,
|
|
18
|
+
html`<img alt="${(x) => x.name}" src="${(x) => x.iconUrl}" />`
|
|
19
|
+
)}
|
|
20
|
+
${when(
|
|
21
|
+
(x) => x.iconLoaded && x._svg,
|
|
22
|
+
(x) => html`${x._svg}`
|
|
23
|
+
)}
|
|
22
24
|
</slot>
|
|
23
25
|
</figure>
|
|
24
|
-
|
|
25
26
|
`;
|
|
26
27
|
|
|
27
28
|
const iconDefinition = Icon.compose({
|
package/shared/definition27.cjs
CHANGED
|
@@ -45,13 +45,15 @@ const getClasses = ({
|
|
|
45
45
|
[`column-basis-${columnBasis}`, Boolean(columnBasis)],
|
|
46
46
|
[`gutters-${gutters}`, Boolean(gutters)],
|
|
47
47
|
[`column-spacing-${columnSpacing}`, Boolean(columnSpacing)],
|
|
48
|
-
[
|
|
48
|
+
[
|
|
49
|
+
`row-spacing-${rowSpacing ? rowSpacing : columnSpacing}`,
|
|
50
|
+
Boolean(rowSpacing) || Boolean(columnSpacing)
|
|
51
|
+
],
|
|
49
52
|
[`auto-sizing-${autoSizing}`, Boolean(autoSizing)]
|
|
50
53
|
);
|
|
51
|
-
const layoutTemplate = () => index.html`
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>`;
|
|
54
|
+
const layoutTemplate = () => index.html` <div class="${getClasses}">
|
|
55
|
+
<slot></slot>
|
|
56
|
+
</div>`;
|
|
55
57
|
|
|
56
58
|
const layoutDefinition = Layout.compose({
|
|
57
59
|
baseName: "layout",
|
package/shared/definition27.js
CHANGED
|
@@ -43,13 +43,15 @@ const getClasses = ({
|
|
|
43
43
|
[`column-basis-${columnBasis}`, Boolean(columnBasis)],
|
|
44
44
|
[`gutters-${gutters}`, Boolean(gutters)],
|
|
45
45
|
[`column-spacing-${columnSpacing}`, Boolean(columnSpacing)],
|
|
46
|
-
[
|
|
46
|
+
[
|
|
47
|
+
`row-spacing-${rowSpacing ? rowSpacing : columnSpacing}`,
|
|
48
|
+
Boolean(rowSpacing) || Boolean(columnSpacing)
|
|
49
|
+
],
|
|
47
50
|
[`auto-sizing-${autoSizing}`, Boolean(autoSizing)]
|
|
48
51
|
);
|
|
49
|
-
const layoutTemplate = () => html`
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</div>`;
|
|
52
|
+
const layoutTemplate = () => html` <div class="${getClasses}">
|
|
53
|
+
<slot></slot>
|
|
54
|
+
</div>`;
|
|
53
55
|
|
|
54
56
|
const layoutDefinition = Layout.compose({
|
|
55
57
|
baseName: "layout",
|
package/shared/definition28.cjs
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
4
|
const definition = require('./definition26.cjs');
|
|
5
5
|
const affix = require('./affix.cjs');
|
|
6
|
-
const
|
|
6
|
+
const anchored = require('./anchored.cjs');
|
|
7
7
|
const startEnd = require('./start-end.cjs');
|
|
8
8
|
const direction = require('./direction.cjs');
|
|
9
|
+
const applyMixins = require('./apply-mixins.cjs');
|
|
9
10
|
const keyCodes = require('./key-codes.cjs');
|
|
10
|
-
const icon = require('./icon.cjs');
|
|
11
|
-
const anchored = require('./anchored.cjs');
|
|
12
11
|
const dom = require('./dom.cjs');
|
|
12
|
+
const icon = require('./icon.cjs');
|
|
13
13
|
const slotted = require('./slotted.cjs');
|
|
14
14
|
const when = require('./when.cjs');
|
|
15
15
|
const classNames = require('./class-names.cjs');
|
|
@@ -570,7 +570,7 @@ index.__decorate([
|
|
|
570
570
|
index.observable
|
|
571
571
|
], Menu$1.prototype, "items", void 0);
|
|
572
572
|
|
|
573
|
-
const styles = ":host(:focus-visible){outline:none}:host([disabled]){pointer-events:none}.base{display:flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);
|
|
573
|
+
const styles = ":host(:focus-visible){outline:none}:host([disabled]){pointer-events:none}.base{display:flex;box-sizing:border-box;align-items:center;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);inline-size:100%}.base{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.base:where(.disabled,:disabled){--_appearance-color-text: var(--vvd-color-neutral-300);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.base:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.base:where(.selected):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: var(--_connotation-color-dim);--_appearance-color-outline: transparent}.base.connotation-cta{--_connotation-color-primary: var(--vvd-menu-item-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-menu-item-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-firm: var(--vvd-menu-item-cta-firm, var(--vvd-color-cta-600));--_connotation-color-faint: var(--vvd-menu-item-cta-faint, var(--vvd-color-cta-50));--_connotation-color-soft: var(--vvd-menu-item-cta-soft, var(--vvd-color-cta-100));--_connotation-color-pale: var(--vvd-menu-item-cta-pale, var(--vvd-color-cta-300));--_connotation-color-dim: var(--vvd-menu-item-cta-dim, var(--vvd-color-cta-200))}.base:not(.connotation-cta){--_connotation-color-primary: var(--vvd-menu-item-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-menu-item-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-menu-item-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-firm: var(--vvd-menu-item-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-menu-item-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-soft: var(--vvd-menu-item-accent-soft, var(--vvd-color-neutral-100));--_connotation-color-pale: var(--vvd-menu-item-accent-pale, var(--vvd-color-neutral-300));--_connotation-color-dim: var(--vvd-menu-item-accent-dim, var(--vvd-color-neutral-200))}.base:not(.two-lines){gap:12px;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:8px;padding-inline:12px}.base.two-lines{padding:12px;gap:16px;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)) + 1px*(24 + 4*clamp(-1,var(--vvd-size-density, 0),2)))}@supports (user-select: none){.base{user-select:none}}.base:not(.disabled){cursor:pointer}:host(:not([role=presentation]):focus-visible) .base{box-shadow:inset 0 0 0 3px var(--focus-stroke-gap-color, currentColor);outline:2px solid var(--focus-stroke-color, var(--vvd-color-canvas-text));outline-offset:calc(-2px - var(--focus-inset, 0px));--focus-stroke-gap-color: transparent;border-radius:8px}.icon{flex-shrink:0;font-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2))/2);line-height:1}.action,.decorative{display:flex;place-content:center}.action{color:var(--_appearance-color-text)}:host(:not([check-appearance],[aria-checked=true])) .action{color:var(--vvd-color-neutral-500)}.base.trailing .action,.base.has-meta .action{order:2}.base:not(.disabled) .decorative{color:var(--vvd-color-neutral-600)}.base.disabled .decorative{color:var(--vvd-color-neutral-200)}.base.has-meta .decorative{order:1}.chevron{order:3}.text{display:flex;overflow:hidden;flex-direction:column;gap:4px;margin-inline-end:auto}.text-primary,.text-secondary{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base)}.text-primary{font:var(--vvd-typography-base);-webkit-line-clamp:var(--text-primary-line-clamp, 1)}.base.two-lines .text-primary{font:var(--vvd-typography-base-bold)}.text-secondary{font:var(--vvd-typography-base-condensed);-webkit-line-clamp:var(--text-secondary-line-clamp, 1)}.base.two-lines:not(.disabled) .text-secondary{color:var(--vvd-color-neutral-600)}.base.two-lines:not(.disabled).selected .text-secondary{color:var(--vvd-color-neutral-800)}\n";
|
|
574
574
|
|
|
575
575
|
var __defProp$1 = Object.defineProperty;
|
|
576
576
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
@@ -583,109 +583,61 @@ var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
|
583
583
|
__defProp$1(target, key, result);
|
|
584
584
|
return result;
|
|
585
585
|
};
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
586
|
+
var __accessCheck = (obj, member, msg) => {
|
|
587
|
+
if (!member.has(obj))
|
|
588
|
+
throw TypeError("Cannot " + msg);
|
|
589
589
|
};
|
|
590
|
-
var
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
return CheckAppearance2;
|
|
594
|
-
})(CheckAppearance || {});
|
|
595
|
-
class MenuItem extends MenuItem$1 {
|
|
596
|
-
constructor() {
|
|
597
|
-
super();
|
|
598
|
-
this.checkTrailing = false;
|
|
599
|
-
this.#submenuArray = [];
|
|
600
|
-
this.updateSubmenu = () => this.#updateSubmenu();
|
|
601
|
-
this.addEventListener("expanded-change", this.#expandedChange);
|
|
602
|
-
}
|
|
603
|
-
#submenuArray;
|
|
604
|
-
/**
|
|
605
|
-
*
|
|
606
|
-
*
|
|
607
|
-
* @internal
|
|
608
|
-
*/
|
|
609
|
-
slottedSubmenuChanged(_oldValue, newValue) {
|
|
610
|
-
this.#submenuArray = newValue;
|
|
611
|
-
}
|
|
612
|
-
#updateSubmenu() {
|
|
613
|
-
for (const submenu of this.#submenuArray) {
|
|
614
|
-
this.submenu = submenu;
|
|
615
|
-
this.submenu.anchor = this;
|
|
616
|
-
this.submenu.placement = "right-start";
|
|
617
|
-
this.submenu.collapseExpandedItem = () => this.#collapseExpandedItem();
|
|
618
|
-
}
|
|
619
|
-
this.hasSubmenu = this.submenu === void 0 ? false : true;
|
|
620
|
-
}
|
|
621
|
-
#collapseExpandedItem() {
|
|
622
|
-
this.expanded = false;
|
|
623
|
-
}
|
|
624
|
-
#expandedChange() {
|
|
625
|
-
if (this.hasSubmenu) {
|
|
626
|
-
this.submenu.open = this.expanded;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
__decorateClass$1([
|
|
631
|
-
index.attr
|
|
632
|
-
], MenuItem.prototype, "text", 2);
|
|
633
|
-
__decorateClass$1([
|
|
634
|
-
index.attr({ attribute: "text-secondary" })
|
|
635
|
-
], MenuItem.prototype, "textSecondary", 2);
|
|
636
|
-
__decorateClass$1([
|
|
637
|
-
index.attr({ mode: "boolean", attribute: "check-trailing" })
|
|
638
|
-
], MenuItem.prototype, "checkTrailing", 2);
|
|
639
|
-
__decorateClass$1([
|
|
640
|
-
index.attr({ attribute: "check-appearance" })
|
|
641
|
-
], MenuItem.prototype, "checkedAppearance", 2);
|
|
642
|
-
__decorateClass$1([
|
|
643
|
-
index.observable
|
|
644
|
-
], MenuItem.prototype, "metaSlottedContent", 2);
|
|
645
|
-
__decorateClass$1([
|
|
646
|
-
index.observable
|
|
647
|
-
], MenuItem.prototype, "trailingMetaSlottedContent", 2);
|
|
648
|
-
__decorateClass$1([
|
|
649
|
-
index.observable
|
|
650
|
-
], MenuItem.prototype, "slottedSubmenu", 2);
|
|
651
|
-
applyMixins.applyMixins(MenuItem, affix.AffixIcon);
|
|
652
|
-
|
|
653
|
-
var __defProp = Object.defineProperty;
|
|
654
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
655
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
656
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
657
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
658
|
-
if (decorator = decorators[i])
|
|
659
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
660
|
-
if (kind && result)
|
|
661
|
-
__defProp(target, key, result);
|
|
662
|
-
return result;
|
|
590
|
+
var __privateGet = (obj, member, getter) => {
|
|
591
|
+
__accessCheck(obj, member, "read from private field");
|
|
592
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
663
593
|
};
|
|
594
|
+
var __privateAdd = (obj, member, value) => {
|
|
595
|
+
if (member.has(obj))
|
|
596
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
597
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
598
|
+
};
|
|
599
|
+
var __privateMethod = (obj, member, method) => {
|
|
600
|
+
__accessCheck(obj, member, "access private method");
|
|
601
|
+
return method;
|
|
602
|
+
};
|
|
603
|
+
var _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _openIfClosed, _updateClickOutsideListeners, _wasOpenBeforeClick, _onClickOutsideCapture, _onClickOutside;
|
|
664
604
|
exports.Menu = class Menu extends Menu$1 {
|
|
665
605
|
constructor() {
|
|
666
606
|
super();
|
|
607
|
+
__privateAdd(this, _setupAnchor);
|
|
608
|
+
__privateAdd(this, _updateAnchor);
|
|
609
|
+
__privateAdd(this, _cleanupAnchor);
|
|
667
610
|
this.ariaLabel = null;
|
|
668
611
|
this.placement = "bottom";
|
|
669
612
|
this.autoDismiss = false;
|
|
670
613
|
this.open = false;
|
|
671
|
-
this
|
|
614
|
+
__privateAdd(this, _openIfClosed, () => {
|
|
672
615
|
if (!this.open)
|
|
673
616
|
index.DOM.queueUpdate(() => this.open = true);
|
|
674
|
-
};
|
|
675
|
-
this
|
|
676
|
-
document.removeEventListener("click", this
|
|
617
|
+
});
|
|
618
|
+
__privateAdd(this, _updateClickOutsideListeners, () => {
|
|
619
|
+
document.removeEventListener("click", __privateGet(this, _onClickOutsideCapture), true);
|
|
620
|
+
document.removeEventListener("click", __privateGet(this, _onClickOutside));
|
|
677
621
|
if (this.autoDismiss && this.isConnected) {
|
|
678
|
-
document.addEventListener("click", this
|
|
622
|
+
document.addEventListener("click", __privateGet(this, _onClickOutsideCapture), true);
|
|
623
|
+
document.addEventListener("click", __privateGet(this, _onClickOutside));
|
|
679
624
|
}
|
|
680
|
-
};
|
|
681
|
-
this
|
|
682
|
-
|
|
625
|
+
});
|
|
626
|
+
__privateAdd(this, _wasOpenBeforeClick, /* @__PURE__ */ new WeakMap());
|
|
627
|
+
__privateAdd(this, _onClickOutsideCapture, (e) => {
|
|
628
|
+
__privateGet(this, _wasOpenBeforeClick).set(e, this.open);
|
|
629
|
+
});
|
|
630
|
+
__privateAdd(this, _onClickOutside, (e) => {
|
|
631
|
+
if (!this.contains(e.target) && __privateGet(this, _wasOpenBeforeClick).get(e)) {
|
|
683
632
|
this.open = false;
|
|
684
|
-
|
|
633
|
+
}
|
|
634
|
+
});
|
|
685
635
|
const handleFocusOut = this.handleFocusOut;
|
|
686
636
|
this.handleFocusOut = (e) => {
|
|
687
637
|
const privates = this;
|
|
688
|
-
const isSafeToCallSuper = privates.menuItems.some(
|
|
638
|
+
const isSafeToCallSuper = privates.menuItems.some(
|
|
639
|
+
privates.isFocusableElement
|
|
640
|
+
);
|
|
689
641
|
if (!isSafeToCallSuper) {
|
|
690
642
|
return;
|
|
691
643
|
}
|
|
@@ -695,70 +647,156 @@ exports.Menu = class Menu extends Menu$1 {
|
|
|
695
647
|
autoDismissChanged(oldValue) {
|
|
696
648
|
if (oldValue === void 0)
|
|
697
649
|
return;
|
|
698
|
-
this
|
|
650
|
+
__privateGet(this, _updateClickOutsideListeners).call(this);
|
|
699
651
|
}
|
|
700
652
|
openChanged(_, newValue) {
|
|
701
653
|
newValue ? this.$emit("open", void 0, { bubbles: false }) : this.$emit("close", void 0, { bubbles: false });
|
|
702
654
|
if (this._anchorEl) {
|
|
703
|
-
this
|
|
655
|
+
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, this._anchorEl);
|
|
704
656
|
}
|
|
705
657
|
}
|
|
706
658
|
connectedCallback() {
|
|
707
659
|
super.connectedCallback();
|
|
708
|
-
this
|
|
660
|
+
__privateGet(this, _updateClickOutsideListeners).call(this);
|
|
709
661
|
}
|
|
710
662
|
disconnectedCallback() {
|
|
711
663
|
super.disconnectedCallback();
|
|
712
|
-
this
|
|
664
|
+
__privateGet(this, _updateClickOutsideListeners).call(this);
|
|
713
665
|
}
|
|
714
666
|
/**
|
|
715
667
|
* @internal
|
|
716
668
|
*/
|
|
717
669
|
_anchorElChanged(oldValue, newValue) {
|
|
718
670
|
if (oldValue)
|
|
719
|
-
this
|
|
671
|
+
__privateMethod(this, _cleanupAnchor, cleanupAnchor_fn).call(this, oldValue);
|
|
720
672
|
if (newValue)
|
|
721
|
-
this
|
|
673
|
+
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
722
674
|
}
|
|
723
|
-
#setupAnchor(a) {
|
|
724
|
-
a.addEventListener("click", this.#openIfClosed, true);
|
|
725
|
-
a.setAttribute("aria-haspopup", "menu");
|
|
726
|
-
this.#updateAnchor(a);
|
|
727
|
-
}
|
|
728
|
-
#updateAnchor(a) {
|
|
729
|
-
a.setAttribute("aria-expanded", this.open.toString());
|
|
730
|
-
}
|
|
731
|
-
#cleanupAnchor(a) {
|
|
732
|
-
a.removeEventListener("click", this.#openIfClosed, true);
|
|
733
|
-
a.removeAttribute("aria-hasPopup");
|
|
734
|
-
a.removeAttribute("aria-expanded");
|
|
735
|
-
}
|
|
736
|
-
#openIfClosed;
|
|
737
|
-
#updateClickOutsideListener;
|
|
738
|
-
#closeOnClickOutside;
|
|
739
675
|
};
|
|
740
|
-
|
|
676
|
+
_setupAnchor = new WeakSet();
|
|
677
|
+
setupAnchor_fn = function(a) {
|
|
678
|
+
a.addEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
679
|
+
a.setAttribute("aria-haspopup", "menu");
|
|
680
|
+
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
|
|
681
|
+
};
|
|
682
|
+
_updateAnchor = new WeakSet();
|
|
683
|
+
updateAnchor_fn = function(a) {
|
|
684
|
+
a.setAttribute("aria-expanded", this.open.toString());
|
|
685
|
+
};
|
|
686
|
+
_cleanupAnchor = new WeakSet();
|
|
687
|
+
cleanupAnchor_fn = function(a) {
|
|
688
|
+
a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
689
|
+
a.removeAttribute("aria-hasPopup");
|
|
690
|
+
a.removeAttribute("aria-expanded");
|
|
691
|
+
};
|
|
692
|
+
_openIfClosed = new WeakMap();
|
|
693
|
+
_updateClickOutsideListeners = new WeakMap();
|
|
694
|
+
_wasOpenBeforeClick = new WeakMap();
|
|
695
|
+
_onClickOutsideCapture = new WeakMap();
|
|
696
|
+
_onClickOutside = new WeakMap();
|
|
697
|
+
__decorateClass$1([
|
|
741
698
|
index.attr({ attribute: "aria-label" })
|
|
742
699
|
], exports.Menu.prototype, "ariaLabel", 2);
|
|
743
|
-
__decorateClass([
|
|
700
|
+
__decorateClass$1([
|
|
744
701
|
index.attr({ mode: "fromView" })
|
|
745
702
|
], exports.Menu.prototype, "placement", 2);
|
|
746
|
-
__decorateClass([
|
|
703
|
+
__decorateClass$1([
|
|
747
704
|
index.attr({ mode: "boolean", attribute: "auto-dismiss" })
|
|
748
705
|
], exports.Menu.prototype, "autoDismiss", 2);
|
|
749
|
-
__decorateClass([
|
|
706
|
+
__decorateClass$1([
|
|
750
707
|
index.attr({ mode: "boolean" })
|
|
751
708
|
], exports.Menu.prototype, "open", 2);
|
|
752
|
-
__decorateClass([
|
|
709
|
+
__decorateClass$1([
|
|
753
710
|
index.observable
|
|
754
711
|
], exports.Menu.prototype, "headerSlottedContent", 2);
|
|
755
|
-
__decorateClass([
|
|
712
|
+
__decorateClass$1([
|
|
756
713
|
index.observable
|
|
757
714
|
], exports.Menu.prototype, "actionItemsSlottedContent", 2);
|
|
758
|
-
exports.Menu = __decorateClass([
|
|
715
|
+
exports.Menu = __decorateClass$1([
|
|
759
716
|
anchored.anchored
|
|
760
717
|
], exports.Menu);
|
|
761
718
|
|
|
719
|
+
var __defProp = Object.defineProperty;
|
|
720
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
721
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
722
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
723
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
724
|
+
if (decorator = decorators[i])
|
|
725
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
726
|
+
if (kind && result)
|
|
727
|
+
__defProp(target, key, result);
|
|
728
|
+
return result;
|
|
729
|
+
};
|
|
730
|
+
const MenuItemRole = {
|
|
731
|
+
...MenuItemRole$1,
|
|
732
|
+
presentation: "presentation"
|
|
733
|
+
};
|
|
734
|
+
var CheckAppearance = /* @__PURE__ */ ((CheckAppearance2) => {
|
|
735
|
+
CheckAppearance2["Normal"] = "normal";
|
|
736
|
+
CheckAppearance2["TickOnly"] = "tick-only";
|
|
737
|
+
return CheckAppearance2;
|
|
738
|
+
})(CheckAppearance || {});
|
|
739
|
+
class MenuItem extends MenuItem$1 {
|
|
740
|
+
constructor() {
|
|
741
|
+
super();
|
|
742
|
+
this.checkTrailing = false;
|
|
743
|
+
this.#submenuArray = [];
|
|
744
|
+
this.updateSubmenu = () => this.#updateSubmenu();
|
|
745
|
+
this.addEventListener("expanded-change", this.#expandedChange);
|
|
746
|
+
}
|
|
747
|
+
#submenuArray;
|
|
748
|
+
/**
|
|
749
|
+
*
|
|
750
|
+
*
|
|
751
|
+
* @internal
|
|
752
|
+
*/
|
|
753
|
+
slottedSubmenuChanged(_oldValue, newValue) {
|
|
754
|
+
this.#submenuArray = newValue;
|
|
755
|
+
}
|
|
756
|
+
#updateSubmenu() {
|
|
757
|
+
for (const submenu of this.#submenuArray) {
|
|
758
|
+
this.submenu = submenu;
|
|
759
|
+
this.submenu.anchor = this;
|
|
760
|
+
this.submenu.placement = "right-start";
|
|
761
|
+
this.submenu.collapseExpandedItem = () => this.#collapseExpandedItem();
|
|
762
|
+
}
|
|
763
|
+
this.hasSubmenu = this.submenu === void 0 ? false : true;
|
|
764
|
+
}
|
|
765
|
+
#collapseExpandedItem() {
|
|
766
|
+
this.expanded = false;
|
|
767
|
+
}
|
|
768
|
+
#expandedChange() {
|
|
769
|
+
if (this.hasSubmenu) {
|
|
770
|
+
this.submenu.open = this.expanded;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
__decorateClass([
|
|
775
|
+
index.attr
|
|
776
|
+
], MenuItem.prototype, "text", 2);
|
|
777
|
+
__decorateClass([
|
|
778
|
+
index.attr({ attribute: "text-secondary" })
|
|
779
|
+
], MenuItem.prototype, "textSecondary", 2);
|
|
780
|
+
__decorateClass([
|
|
781
|
+
index.attr
|
|
782
|
+
], MenuItem.prototype, "connotation", 2);
|
|
783
|
+
__decorateClass([
|
|
784
|
+
index.attr({ mode: "boolean", attribute: "check-trailing" })
|
|
785
|
+
], MenuItem.prototype, "checkTrailing", 2);
|
|
786
|
+
__decorateClass([
|
|
787
|
+
index.attr({ attribute: "check-appearance" })
|
|
788
|
+
], MenuItem.prototype, "checkedAppearance", 2);
|
|
789
|
+
__decorateClass([
|
|
790
|
+
index.observable
|
|
791
|
+
], MenuItem.prototype, "metaSlottedContent", 2);
|
|
792
|
+
__decorateClass([
|
|
793
|
+
index.observable
|
|
794
|
+
], MenuItem.prototype, "trailingMetaSlottedContent", 2);
|
|
795
|
+
__decorateClass([
|
|
796
|
+
index.observable
|
|
797
|
+
], MenuItem.prototype, "slottedSubmenu", 2);
|
|
798
|
+
applyMixins.applyMixins(MenuItem, affix.AffixIcon);
|
|
799
|
+
|
|
762
800
|
const getIndicatorIcon = (x) => {
|
|
763
801
|
if (x.checkedAppearance === CheckAppearance.TickOnly) {
|
|
764
802
|
return x.checked ? "check-line" : "";
|
|
@@ -768,6 +806,7 @@ const getIndicatorIcon = (x) => {
|
|
|
768
806
|
return `${iconType}-${iconStatus}-2-line`;
|
|
769
807
|
};
|
|
770
808
|
const getClasses = ({
|
|
809
|
+
connotation,
|
|
771
810
|
disabled,
|
|
772
811
|
checked,
|
|
773
812
|
role,
|
|
@@ -778,9 +817,13 @@ const getClasses = ({
|
|
|
778
817
|
checkTrailing
|
|
779
818
|
}) => classNames.classNames(
|
|
780
819
|
"base",
|
|
820
|
+
[`connotation-${connotation}`, Boolean(connotation)],
|
|
781
821
|
["disabled", Boolean(disabled)],
|
|
782
822
|
["selected", role !== MenuItemRole.menuitem && Boolean(checked)],
|
|
783
|
-
[
|
|
823
|
+
[
|
|
824
|
+
"trailing",
|
|
825
|
+
role !== MenuItemRole.menuitem && (checkTrailing || Boolean(icon))
|
|
826
|
+
],
|
|
784
827
|
["item-checkbox", role === MenuItemRole.menuitemcheckbox],
|
|
785
828
|
["item-radio", role === MenuItemRole.menuitemradio],
|
|
786
829
|
["two-lines", Boolean(text2?.length) && Boolean(textSecondary?.length)],
|
|
@@ -801,8 +844,14 @@ function text() {
|
|
|
801
844
|
return index.html`${when.when(
|
|
802
845
|
(x) => x.text || x.textSecondary,
|
|
803
846
|
index.html`<span class="text">
|
|
804
|
-
${when.when(
|
|
805
|
-
|
|
847
|
+
${when.when(
|
|
848
|
+
(x) => x.text,
|
|
849
|
+
index.html`<span class="text-primary">${(x) => x.text}</span>`
|
|
850
|
+
)}
|
|
851
|
+
${when.when(
|
|
852
|
+
(x) => x.textSecondary,
|
|
853
|
+
index.html`<span class="text-secondary">${(x) => x.textSecondary}</span>`
|
|
854
|
+
)}
|
|
806
855
|
</span>`
|
|
807
856
|
)}`;
|
|
808
857
|
}
|
|
@@ -810,27 +859,44 @@ const MenuItemTemplate = (context) => {
|
|
|
810
859
|
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
811
860
|
const iconTag = context.tagFor(icon.Icon);
|
|
812
861
|
return index.html`
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
862
|
+
<template
|
|
863
|
+
role="${(x) => x.role ? x.role : MenuItemRole.menuitem}"
|
|
864
|
+
aria-haspopup="${(x) => x.hasSubmenu ? "menu" : void 0}"
|
|
865
|
+
aria-checked="${(x) => x.role !== MenuItemRole.menuitem ? x.checked : void 0}"
|
|
866
|
+
aria-disabled="${(x) => x.disabled}"
|
|
867
|
+
aria-expanded="${(x) => x.expanded}"
|
|
868
|
+
@keydown="${(x, c) => x.handleMenuItemKeyDown(c.event)}"
|
|
869
|
+
@click="${handleClick}"
|
|
870
|
+
@mouseover="${(x, c) => x.handleMouseOver(c.event)}"
|
|
871
|
+
@mouseout="${(x, c) => x.handleMouseOut(c.event)}"
|
|
872
|
+
>
|
|
873
|
+
<div class="${getClasses}">
|
|
874
|
+
<slot name="meta" ${slotted.slotted("metaSlottedContent")}></slot>
|
|
875
|
+
${checkIndicator(context)}
|
|
876
|
+
${when.when(
|
|
877
|
+
(x) => x.icon,
|
|
878
|
+
index.html`<span class="decorative"
|
|
879
|
+
>${(x) => affixIconTemplate(x.icon)}</span
|
|
880
|
+
>`
|
|
881
|
+
)}
|
|
882
|
+
${text()}
|
|
883
|
+
<slot
|
|
884
|
+
name="trailing-meta"
|
|
885
|
+
${slotted.slotted("trailingMetaSlottedContent")}
|
|
886
|
+
></slot>
|
|
887
|
+
${when.when(
|
|
888
|
+
(x) => x.hasSubmenu,
|
|
889
|
+
index.html`<${iconTag} class="chevron" name="chevron-right-line"></${iconTag}>`
|
|
890
|
+
)}
|
|
891
|
+
</div>
|
|
892
|
+
<slot
|
|
893
|
+
name="submenu"
|
|
894
|
+
${slotted.slotted({
|
|
895
|
+
property: "slottedSubmenu",
|
|
896
|
+
filter: slotted.elements(context.tagFor(exports.Menu))
|
|
897
|
+
})}
|
|
898
|
+
></slot>
|
|
899
|
+
</template>
|
|
834
900
|
`;
|
|
835
901
|
};
|
|
836
902
|
|