@vonage/vivid 3.53.0 → 3.54.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/appearance-ui/index.cjs +1 -1
- package/appearance-ui/index.js +1 -1
- package/custom-elements.json +444 -94
- package/lib/appearance-ui/appearance-ui.d.ts +1 -1
- package/lib/audio-player/audio-player.d.ts +4 -0
- package/lib/audio-player/locale.d.ts +2 -0
- package/lib/dial-pad/dial-pad.d.ts +3 -0
- package/lib/enums.d.ts +1 -0
- package/lib/menu/menu.d.ts +1 -0
- package/lib/nav-disclosure/nav-disclosure.d.ts +5 -0
- package/lib/text-anchor/text-anchor.d.ts +1 -1
- package/lib/video-player/vivid-video-svg.d.ts +1 -0
- package/locales/en-GB.cjs +3 -1
- package/locales/en-GB.js +3 -1
- package/locales/en-US.cjs +3 -1
- package/locales/en-US.js +3 -1
- package/locales/ja-JP.cjs +3 -1
- package/locales/ja-JP.js +3 -1
- package/locales/zh-CN.cjs +3 -1
- package/locales/zh-CN.js +3 -1
- package/package.json +1 -1
- package/shared/definition20.cjs +15 -2
- package/shared/definition20.js +15 -2
- package/shared/definition27.cjs +1 -1
- package/shared/definition27.js +1 -1
- package/shared/definition29.cjs +39 -10
- package/shared/definition29.js +39 -10
- package/shared/definition30.cjs +1 -1
- package/shared/definition30.js +1 -1
- package/shared/definition31.cjs +14 -2
- package/shared/definition31.js +14 -2
- package/shared/definition32.cjs +1 -1
- package/shared/definition32.js +1 -1
- package/shared/definition35.cjs +1 -1
- package/shared/definition35.js +1 -1
- package/shared/definition43.cjs +1 -1
- package/shared/definition43.js +1 -1
- package/shared/definition5.cjs +99 -18
- package/shared/definition5.js +99 -18
- package/shared/definition55.cjs +120 -52
- package/shared/definition55.js +120 -52
- package/shared/definition61.cjs +307 -1
- package/shared/definition61.js +307 -1
- package/shared/enums.cjs +1 -0
- package/shared/enums.js +1 -0
- package/shared/icon.cjs +20 -2
- package/shared/icon.js +21 -3
- package/shared/index2.cjs +15 -8
- package/shared/index2.js +15 -8
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/numberConverter.d.ts +2 -0
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/vivid.api.json +21 -0
- package/style.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
2
|
import type { Appearance } from '../enums.js';
|
|
3
|
-
export type AppearanceUIAppearance = Extract<Appearance, Appearance.Filled | Appearance.Ghost | Appearance.Outlined | Appearance.Duotone | Appearance.Fieldset | Appearance.Subtle | Appearance.Listitem>;
|
|
3
|
+
export type AppearanceUIAppearance = Extract<Appearance, Appearance.Filled | Appearance.Ghost | Appearance.GhostLight | Appearance.Outlined | Appearance.Duotone | Appearance.Fieldset | Appearance.Subtle | Appearance.Listitem>;
|
|
4
4
|
export declare class AppearanceUi extends FoundationElement {
|
|
5
5
|
appearance?: AppearanceUIAppearance;
|
|
6
6
|
hovered: boolean;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
2
|
import type { Connotation } from '../enums';
|
|
3
|
+
import { MediaSkipBy } from '../enums';
|
|
3
4
|
import { Localized } from '../../shared/patterns';
|
|
4
5
|
export type AudioPlayerConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
|
|
5
6
|
export declare class AudioPlayer extends FoundationElement {
|
|
6
7
|
playButtonAriaLabel: string | null;
|
|
7
8
|
pauseButtonAriaLabel: string | null;
|
|
8
9
|
sliderAriaLabel: string | null;
|
|
10
|
+
skipForwardButtonAriaLabel: string | null;
|
|
11
|
+
skipBackwardButtonAriaLabel: string | null;
|
|
9
12
|
connotation?: AudioPlayerConnotation;
|
|
10
13
|
src?: string;
|
|
11
14
|
disabled: boolean;
|
|
12
15
|
notime: boolean;
|
|
16
|
+
skipBy?: MediaSkipBy;
|
|
13
17
|
connectedCallback(): void;
|
|
14
18
|
disconnectedCallback(): void;
|
|
15
19
|
}
|
|
@@ -7,8 +7,11 @@ export declare class DialPad extends FoundationElement {
|
|
|
7
7
|
valueChanged(_oldValue: string, newValue: string): void;
|
|
8
8
|
pattern: string;
|
|
9
9
|
disabled: boolean;
|
|
10
|
+
pending: boolean;
|
|
10
11
|
callActive: boolean;
|
|
11
12
|
noCall: boolean;
|
|
13
|
+
endCallButtonLabel: string | null;
|
|
14
|
+
callButtonLabel: string | null;
|
|
12
15
|
}
|
|
13
16
|
export interface DialPad extends Localized {
|
|
14
17
|
}
|
package/lib/enums.d.ts
CHANGED
package/lib/menu/menu.d.ts
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { FoundationElement } from '@microsoft/fast-foundation';
|
|
2
|
+
import { Appearance, Connotation } from '../enums';
|
|
2
3
|
import { AffixIcon } from '../../shared/patterns/affix';
|
|
4
|
+
export type NavDisclosureAppearance = Extract<Appearance, Appearance.Ghost | Appearance.GhostLight>;
|
|
5
|
+
export type NavDisclosureConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
|
|
3
6
|
export declare class NavDisclosure extends FoundationElement {
|
|
4
7
|
#private;
|
|
5
8
|
details: HTMLDetailsElement;
|
|
6
9
|
label?: string;
|
|
10
|
+
appearance?: NavDisclosureAppearance;
|
|
11
|
+
connotation?: NavDisclosureConnotation;
|
|
7
12
|
open: boolean;
|
|
8
13
|
ariaCurrent: string | null;
|
|
9
14
|
}
|
|
@@ -2,7 +2,7 @@ import { Anchor } from '@microsoft/fast-foundation';
|
|
|
2
2
|
import { Appearance, Connotation } from '../enums';
|
|
3
3
|
import { AffixIcon } from '../../shared/patterns/affix';
|
|
4
4
|
export type TextAnchorConnotation = Extract<Connotation, Connotation.Accent | Connotation.CTA>;
|
|
5
|
-
export type TextAnchorAppearance = Extract<Appearance, Appearance.Ghost>;
|
|
5
|
+
export type TextAnchorAppearance = Extract<Appearance, Appearance.Ghost | Appearance.GhostLight>;
|
|
6
6
|
export declare class TextAnchor extends Anchor {
|
|
7
7
|
text?: string;
|
|
8
8
|
connotation?: TextAnchorConnotation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function renderSvgIcons(): import("@microsoft/fast-element").ViewTemplate<any, any>;
|
package/locales/en-GB.cjs
CHANGED
|
@@ -109,7 +109,9 @@ const enGB = {
|
|
|
109
109
|
audioPlayer: {
|
|
110
110
|
playButtonLabel: "Play",
|
|
111
111
|
pauseButtonLabel: "Pause",
|
|
112
|
-
sliderLabel: "Audio progress bar"
|
|
112
|
+
sliderLabel: "Audio progress bar",
|
|
113
|
+
skipForwardButton: "Skip Forward",
|
|
114
|
+
skipBackwardButton: "Skip Backward"
|
|
113
115
|
},
|
|
114
116
|
alert: {
|
|
115
117
|
dismissButtonLabel: "Close"
|
package/locales/en-GB.js
CHANGED
|
@@ -107,7 +107,9 @@ const enGB = {
|
|
|
107
107
|
audioPlayer: {
|
|
108
108
|
playButtonLabel: "Play",
|
|
109
109
|
pauseButtonLabel: "Pause",
|
|
110
|
-
sliderLabel: "Audio progress bar"
|
|
110
|
+
sliderLabel: "Audio progress bar",
|
|
111
|
+
skipForwardButton: "Skip Forward",
|
|
112
|
+
skipBackwardButton: "Skip Backward"
|
|
111
113
|
},
|
|
112
114
|
alert: {
|
|
113
115
|
dismissButtonLabel: "Close"
|
package/locales/en-US.cjs
CHANGED
|
@@ -277,7 +277,9 @@ const enUS = {
|
|
|
277
277
|
audioPlayer: {
|
|
278
278
|
playButtonLabel: "Play",
|
|
279
279
|
pauseButtonLabel: "Pause",
|
|
280
|
-
sliderLabel: "Audio progress bar"
|
|
280
|
+
sliderLabel: "Audio progress bar",
|
|
281
|
+
skipForwardButton: "Skip Forward",
|
|
282
|
+
skipBackwardButton: "Skip Backward"
|
|
281
283
|
},
|
|
282
284
|
alert: {
|
|
283
285
|
dismissButtonLabel: "Close"
|
package/locales/en-US.js
CHANGED
|
@@ -275,7 +275,9 @@ const enUS = {
|
|
|
275
275
|
audioPlayer: {
|
|
276
276
|
playButtonLabel: "Play",
|
|
277
277
|
pauseButtonLabel: "Pause",
|
|
278
|
-
sliderLabel: "Audio progress bar"
|
|
278
|
+
sliderLabel: "Audio progress bar",
|
|
279
|
+
skipForwardButton: "Skip Forward",
|
|
280
|
+
skipBackwardButton: "Skip Backward"
|
|
279
281
|
},
|
|
280
282
|
alert: {
|
|
281
283
|
dismissButtonLabel: "Close"
|
package/locales/ja-JP.cjs
CHANGED
|
@@ -276,7 +276,9 @@ const jaJP = {
|
|
|
276
276
|
audioPlayer: {
|
|
277
277
|
playButtonLabel: "開始",
|
|
278
278
|
pauseButtonLabel: "休止",
|
|
279
|
-
sliderLabel: "オーディオプログレスバー"
|
|
279
|
+
sliderLabel: "オーディオプログレスバー",
|
|
280
|
+
skipForwardButton: "前にスキップ",
|
|
281
|
+
skipBackwardButton: "後方にスキップ"
|
|
280
282
|
},
|
|
281
283
|
alert: {
|
|
282
284
|
dismissButtonLabel: "閉じる"
|
package/locales/ja-JP.js
CHANGED
|
@@ -274,7 +274,9 @@ const jaJP = {
|
|
|
274
274
|
audioPlayer: {
|
|
275
275
|
playButtonLabel: "開始",
|
|
276
276
|
pauseButtonLabel: "休止",
|
|
277
|
-
sliderLabel: "オーディオプログレスバー"
|
|
277
|
+
sliderLabel: "オーディオプログレスバー",
|
|
278
|
+
skipForwardButton: "前にスキップ",
|
|
279
|
+
skipBackwardButton: "後方にスキップ"
|
|
278
280
|
},
|
|
279
281
|
alert: {
|
|
280
282
|
dismissButtonLabel: "閉じる"
|
package/locales/zh-CN.cjs
CHANGED
package/locales/zh-CN.js
CHANGED
package/package.json
CHANGED
package/shared/definition20.cjs
CHANGED
|
@@ -34,8 +34,11 @@ class DialPad extends index.FoundationElement {
|
|
|
34
34
|
this.value = "";
|
|
35
35
|
this.pattern = "^[0-9#*]*$";
|
|
36
36
|
this.disabled = false;
|
|
37
|
+
this.pending = false;
|
|
37
38
|
this.callActive = false;
|
|
38
39
|
this.noCall = false;
|
|
40
|
+
this.endCallButtonLabel = null;
|
|
41
|
+
this.callButtonLabel = null;
|
|
39
42
|
/**
|
|
40
43
|
*
|
|
41
44
|
* @internal
|
|
@@ -113,17 +116,26 @@ __decorateClass([
|
|
|
113
116
|
__decorateClass([
|
|
114
117
|
index.attr({ mode: "boolean" })
|
|
115
118
|
], DialPad.prototype, "disabled", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
index.attr({ mode: "boolean" })
|
|
121
|
+
], DialPad.prototype, "pending", 2);
|
|
116
122
|
__decorateClass([
|
|
117
123
|
index.attr({ attribute: "call-active", mode: "boolean" })
|
|
118
124
|
], DialPad.prototype, "callActive", 2);
|
|
119
125
|
__decorateClass([
|
|
120
126
|
index.attr({ mode: "boolean", attribute: "no-call" })
|
|
121
127
|
], DialPad.prototype, "noCall", 2);
|
|
128
|
+
__decorateClass([
|
|
129
|
+
index.attr({ attribute: "end-call-button-label" })
|
|
130
|
+
], DialPad.prototype, "endCallButtonLabel", 2);
|
|
131
|
+
__decorateClass([
|
|
132
|
+
index.attr({ attribute: "call-button-label" })
|
|
133
|
+
], DialPad.prototype, "callButtonLabel", 2);
|
|
122
134
|
applyMixins.applyMixins(DialPad, localized.Localized);
|
|
123
135
|
|
|
124
136
|
const getClasses = (_) => classNames.classNames("base");
|
|
125
137
|
function handleKeyDown(x, e) {
|
|
126
|
-
if (e.key === keyCodes.keyEnter) {
|
|
138
|
+
if (e.key === keyCodes.keyEnter && !x.pending && !x.disabled && !x.callActive && !x.noCall && x.value.length > 0 && e.target instanceof HTMLInputElement) {
|
|
127
139
|
x._onDial();
|
|
128
140
|
} else {
|
|
129
141
|
const key = e.key === "*" ? "Asterisk" : e.key === "#" ? "Hashtag" : e.key;
|
|
@@ -203,8 +215,9 @@ function renderDialButton(buttonTag) {
|
|
|
203
215
|
icon="${(x) => x.callActive ? "disable-call-line" : "call-line"}"
|
|
204
216
|
connotation="${(x) => x.callActive ? "alert" : "cta"}"
|
|
205
217
|
?disabled="${(x) => x.disabled}"
|
|
218
|
+
?pending="${(x) => x.pending}"
|
|
206
219
|
@click="${(x) => x._onDial()}"
|
|
207
|
-
label="${(x) => x.callActive ? x.locale.dialPad.endCallButtonLabel : x.locale.dialPad.callButtonLabel}">
|
|
220
|
+
label="${(x) => x.callActive ? x.endCallButtonLabel || x.locale.dialPad.endCallButtonLabel : x.callButtonLabel || x.locale.dialPad.callButtonLabel}">
|
|
208
221
|
</${buttonTag}>`;
|
|
209
222
|
}
|
|
210
223
|
const DialPadTemplate = (context) => {
|
package/shared/definition20.js
CHANGED
|
@@ -32,8 +32,11 @@ class DialPad extends FoundationElement {
|
|
|
32
32
|
this.value = "";
|
|
33
33
|
this.pattern = "^[0-9#*]*$";
|
|
34
34
|
this.disabled = false;
|
|
35
|
+
this.pending = false;
|
|
35
36
|
this.callActive = false;
|
|
36
37
|
this.noCall = false;
|
|
38
|
+
this.endCallButtonLabel = null;
|
|
39
|
+
this.callButtonLabel = null;
|
|
37
40
|
/**
|
|
38
41
|
*
|
|
39
42
|
* @internal
|
|
@@ -111,17 +114,26 @@ __decorateClass([
|
|
|
111
114
|
__decorateClass([
|
|
112
115
|
attr({ mode: "boolean" })
|
|
113
116
|
], DialPad.prototype, "disabled", 2);
|
|
117
|
+
__decorateClass([
|
|
118
|
+
attr({ mode: "boolean" })
|
|
119
|
+
], DialPad.prototype, "pending", 2);
|
|
114
120
|
__decorateClass([
|
|
115
121
|
attr({ attribute: "call-active", mode: "boolean" })
|
|
116
122
|
], DialPad.prototype, "callActive", 2);
|
|
117
123
|
__decorateClass([
|
|
118
124
|
attr({ mode: "boolean", attribute: "no-call" })
|
|
119
125
|
], DialPad.prototype, "noCall", 2);
|
|
126
|
+
__decorateClass([
|
|
127
|
+
attr({ attribute: "end-call-button-label" })
|
|
128
|
+
], DialPad.prototype, "endCallButtonLabel", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
attr({ attribute: "call-button-label" })
|
|
131
|
+
], DialPad.prototype, "callButtonLabel", 2);
|
|
120
132
|
applyMixins(DialPad, Localized);
|
|
121
133
|
|
|
122
134
|
const getClasses = (_) => classNames("base");
|
|
123
135
|
function handleKeyDown(x, e) {
|
|
124
|
-
if (e.key === keyEnter) {
|
|
136
|
+
if (e.key === keyEnter && !x.pending && !x.disabled && !x.callActive && !x.noCall && x.value.length > 0 && e.target instanceof HTMLInputElement) {
|
|
125
137
|
x._onDial();
|
|
126
138
|
} else {
|
|
127
139
|
const key = e.key === "*" ? "Asterisk" : e.key === "#" ? "Hashtag" : e.key;
|
|
@@ -201,8 +213,9 @@ function renderDialButton(buttonTag) {
|
|
|
201
213
|
icon="${(x) => x.callActive ? "disable-call-line" : "call-line"}"
|
|
202
214
|
connotation="${(x) => x.callActive ? "alert" : "cta"}"
|
|
203
215
|
?disabled="${(x) => x.disabled}"
|
|
216
|
+
?pending="${(x) => x.pending}"
|
|
204
217
|
@click="${(x) => x._onDial()}"
|
|
205
|
-
label="${(x) => x.callActive ? x.locale.dialPad.endCallButtonLabel : x.locale.dialPad.callButtonLabel}">
|
|
218
|
+
label="${(x) => x.callActive ? x.endCallButtonLabel || x.locale.dialPad.endCallButtonLabel : x.callButtonLabel || x.locale.dialPad.callButtonLabel}">
|
|
206
219
|
</${buttonTag}>`;
|
|
207
220
|
}
|
|
208
221
|
const DialPadTemplate = (context) => {
|
package/shared/definition27.cjs
CHANGED
|
@@ -10,7 +10,7 @@ const styles = ":host{display:inline-block;vertical-align:sub}.control{display:f
|
|
|
10
10
|
const getClasses = ({ connotation, size }) => classNames.classNames(
|
|
11
11
|
"control",
|
|
12
12
|
[`connotation-${connotation}`, Boolean(connotation)],
|
|
13
|
-
[`size-${size}`,
|
|
13
|
+
[`size-${size}`, typeof size === "number"]
|
|
14
14
|
);
|
|
15
15
|
const iconTemplate = () => index.html`
|
|
16
16
|
<figure class="${getClasses}">
|
package/shared/definition27.js
CHANGED
|
@@ -8,7 +8,7 @@ const styles = ":host{display:inline-block;vertical-align:sub}.control{display:f
|
|
|
8
8
|
const getClasses = ({ connotation, size }) => classNames(
|
|
9
9
|
"control",
|
|
10
10
|
[`connotation-${connotation}`, Boolean(connotation)],
|
|
11
|
-
[`size-${size}`,
|
|
11
|
+
[`size-${size}`, typeof size === "number"]
|
|
12
12
|
);
|
|
13
13
|
const iconTemplate = () => html`
|
|
14
14
|
<figure class="${getClasses}">
|
package/shared/definition29.cjs
CHANGED
|
@@ -600,10 +600,11 @@ var __privateMethod = (obj, member, method) => {
|
|
|
600
600
|
__accessCheck(obj, member, "access private method");
|
|
601
601
|
return method;
|
|
602
602
|
};
|
|
603
|
-
var _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn,
|
|
603
|
+
var _triggerBehaviour, triggerBehaviour_get, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _onAnchorClick, _updateClickOutsideListeners, _wasOpenBeforeClick, _onClickOutsideCapture, _onClickOutside;
|
|
604
604
|
exports.Menu = class Menu extends Menu$1 {
|
|
605
605
|
constructor() {
|
|
606
606
|
super();
|
|
607
|
+
__privateAdd(this, _triggerBehaviour);
|
|
607
608
|
__privateAdd(this, _setupAnchor);
|
|
608
609
|
__privateAdd(this, _updateAnchor);
|
|
609
610
|
__privateAdd(this, _cleanupAnchor);
|
|
@@ -611,9 +612,15 @@ exports.Menu = class Menu extends Menu$1 {
|
|
|
611
612
|
this.placement = "bottom";
|
|
612
613
|
this.autoDismiss = false;
|
|
613
614
|
this.open = false;
|
|
614
|
-
__privateAdd(this,
|
|
615
|
-
if (
|
|
616
|
-
|
|
615
|
+
__privateAdd(this, _onAnchorClick, () => {
|
|
616
|
+
if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "off") {
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "legacy" && this.open) {
|
|
620
|
+
return;
|
|
621
|
+
}
|
|
622
|
+
const newValue = !this.open;
|
|
623
|
+
index.DOM.queueUpdate(() => this.open = newValue);
|
|
617
624
|
});
|
|
618
625
|
__privateAdd(this, _updateClickOutsideListeners, () => {
|
|
619
626
|
document.removeEventListener("click", __privateGet(this, _onClickOutsideCapture), true);
|
|
@@ -634,15 +641,20 @@ exports.Menu = class Menu extends Menu$1 {
|
|
|
634
641
|
});
|
|
635
642
|
const handleFocusOut = this.handleFocusOut;
|
|
636
643
|
this.handleFocusOut = (e) => {
|
|
637
|
-
const
|
|
638
|
-
const isSafeToCallSuper =
|
|
639
|
-
|
|
644
|
+
const privates2 = this;
|
|
645
|
+
const isSafeToCallSuper = privates2.menuItems.some(
|
|
646
|
+
privates2.isFocusableElement
|
|
640
647
|
);
|
|
641
648
|
if (!isSafeToCallSuper) {
|
|
642
649
|
return;
|
|
643
650
|
}
|
|
644
651
|
handleFocusOut(e);
|
|
645
652
|
};
|
|
653
|
+
const privates = this;
|
|
654
|
+
const domChildren = privates.domChildren;
|
|
655
|
+
privates.domChildren = () => {
|
|
656
|
+
return domChildren.call(this).filter((child) => !child.hasAttribute("slot"));
|
|
657
|
+
};
|
|
646
658
|
}
|
|
647
659
|
autoDismissChanged(oldValue) {
|
|
648
660
|
if (oldValue === void 0)
|
|
@@ -672,10 +684,24 @@ exports.Menu = class Menu extends Menu$1 {
|
|
|
672
684
|
if (newValue)
|
|
673
685
|
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
674
686
|
}
|
|
687
|
+
/**
|
|
688
|
+
* @internal
|
|
689
|
+
*/
|
|
690
|
+
_onChange(e) {
|
|
691
|
+
const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
|
|
692
|
+
if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
|
|
693
|
+
this.open = false;
|
|
694
|
+
}
|
|
695
|
+
return true;
|
|
696
|
+
}
|
|
697
|
+
};
|
|
698
|
+
_triggerBehaviour = new WeakSet();
|
|
699
|
+
triggerBehaviour_get = function() {
|
|
700
|
+
return this.trigger ?? "legacy";
|
|
675
701
|
};
|
|
676
702
|
_setupAnchor = new WeakSet();
|
|
677
703
|
setupAnchor_fn = function(a) {
|
|
678
|
-
a.addEventListener("click", __privateGet(this,
|
|
704
|
+
a.addEventListener("click", __privateGet(this, _onAnchorClick), true);
|
|
679
705
|
a.setAttribute("aria-haspopup", "menu");
|
|
680
706
|
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
|
|
681
707
|
};
|
|
@@ -685,11 +711,11 @@ updateAnchor_fn = function(a) {
|
|
|
685
711
|
};
|
|
686
712
|
_cleanupAnchor = new WeakSet();
|
|
687
713
|
cleanupAnchor_fn = function(a) {
|
|
688
|
-
a.removeEventListener("click", __privateGet(this,
|
|
714
|
+
a.removeEventListener("click", __privateGet(this, _onAnchorClick), true);
|
|
689
715
|
a.removeAttribute("aria-hasPopup");
|
|
690
716
|
a.removeAttribute("aria-expanded");
|
|
691
717
|
};
|
|
692
|
-
|
|
718
|
+
_onAnchorClick = new WeakMap();
|
|
693
719
|
_updateClickOutsideListeners = new WeakMap();
|
|
694
720
|
_wasOpenBeforeClick = new WeakMap();
|
|
695
721
|
_onClickOutsideCapture = new WeakMap();
|
|
@@ -700,6 +726,9 @@ __decorateClass$1([
|
|
|
700
726
|
__decorateClass$1([
|
|
701
727
|
index.attr({ mode: "fromView" })
|
|
702
728
|
], exports.Menu.prototype, "placement", 2);
|
|
729
|
+
__decorateClass$1([
|
|
730
|
+
index.attr
|
|
731
|
+
], exports.Menu.prototype, "trigger", 2);
|
|
703
732
|
__decorateClass$1([
|
|
704
733
|
index.attr({ mode: "boolean", attribute: "auto-dismiss" })
|
|
705
734
|
], exports.Menu.prototype, "autoDismiss", 2);
|
package/shared/definition29.js
CHANGED
|
@@ -598,10 +598,11 @@ var __privateMethod = (obj, member, method) => {
|
|
|
598
598
|
__accessCheck(obj, member, "access private method");
|
|
599
599
|
return method;
|
|
600
600
|
};
|
|
601
|
-
var _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn,
|
|
601
|
+
var _triggerBehaviour, triggerBehaviour_get, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _onAnchorClick, _updateClickOutsideListeners, _wasOpenBeforeClick, _onClickOutsideCapture, _onClickOutside;
|
|
602
602
|
let Menu = class extends Menu$1 {
|
|
603
603
|
constructor() {
|
|
604
604
|
super();
|
|
605
|
+
__privateAdd(this, _triggerBehaviour);
|
|
605
606
|
__privateAdd(this, _setupAnchor);
|
|
606
607
|
__privateAdd(this, _updateAnchor);
|
|
607
608
|
__privateAdd(this, _cleanupAnchor);
|
|
@@ -609,9 +610,15 @@ let Menu = class extends Menu$1 {
|
|
|
609
610
|
this.placement = "bottom";
|
|
610
611
|
this.autoDismiss = false;
|
|
611
612
|
this.open = false;
|
|
612
|
-
__privateAdd(this,
|
|
613
|
-
if (
|
|
614
|
-
|
|
613
|
+
__privateAdd(this, _onAnchorClick, () => {
|
|
614
|
+
if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "off") {
|
|
615
|
+
return;
|
|
616
|
+
}
|
|
617
|
+
if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "legacy" && this.open) {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
620
|
+
const newValue = !this.open;
|
|
621
|
+
DOM.queueUpdate(() => this.open = newValue);
|
|
615
622
|
});
|
|
616
623
|
__privateAdd(this, _updateClickOutsideListeners, () => {
|
|
617
624
|
document.removeEventListener("click", __privateGet(this, _onClickOutsideCapture), true);
|
|
@@ -632,15 +639,20 @@ let Menu = class extends Menu$1 {
|
|
|
632
639
|
});
|
|
633
640
|
const handleFocusOut = this.handleFocusOut;
|
|
634
641
|
this.handleFocusOut = (e) => {
|
|
635
|
-
const
|
|
636
|
-
const isSafeToCallSuper =
|
|
637
|
-
|
|
642
|
+
const privates2 = this;
|
|
643
|
+
const isSafeToCallSuper = privates2.menuItems.some(
|
|
644
|
+
privates2.isFocusableElement
|
|
638
645
|
);
|
|
639
646
|
if (!isSafeToCallSuper) {
|
|
640
647
|
return;
|
|
641
648
|
}
|
|
642
649
|
handleFocusOut(e);
|
|
643
650
|
};
|
|
651
|
+
const privates = this;
|
|
652
|
+
const domChildren = privates.domChildren;
|
|
653
|
+
privates.domChildren = () => {
|
|
654
|
+
return domChildren.call(this).filter((child) => !child.hasAttribute("slot"));
|
|
655
|
+
};
|
|
644
656
|
}
|
|
645
657
|
autoDismissChanged(oldValue) {
|
|
646
658
|
if (oldValue === void 0)
|
|
@@ -670,10 +682,24 @@ let Menu = class extends Menu$1 {
|
|
|
670
682
|
if (newValue)
|
|
671
683
|
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
672
684
|
}
|
|
685
|
+
/**
|
|
686
|
+
* @internal
|
|
687
|
+
*/
|
|
688
|
+
_onChange(e) {
|
|
689
|
+
const clickedOnNonCheckboxMenuItem = e.target instanceof HTMLElement && (e.target.role === "menuitem" || e.target.role === "menuitemradio");
|
|
690
|
+
if (__privateGet(this, _triggerBehaviour, triggerBehaviour_get) === "auto" && clickedOnNonCheckboxMenuItem) {
|
|
691
|
+
this.open = false;
|
|
692
|
+
}
|
|
693
|
+
return true;
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
_triggerBehaviour = new WeakSet();
|
|
697
|
+
triggerBehaviour_get = function() {
|
|
698
|
+
return this.trigger ?? "legacy";
|
|
673
699
|
};
|
|
674
700
|
_setupAnchor = new WeakSet();
|
|
675
701
|
setupAnchor_fn = function(a) {
|
|
676
|
-
a.addEventListener("click", __privateGet(this,
|
|
702
|
+
a.addEventListener("click", __privateGet(this, _onAnchorClick), true);
|
|
677
703
|
a.setAttribute("aria-haspopup", "menu");
|
|
678
704
|
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
|
|
679
705
|
};
|
|
@@ -683,11 +709,11 @@ updateAnchor_fn = function(a) {
|
|
|
683
709
|
};
|
|
684
710
|
_cleanupAnchor = new WeakSet();
|
|
685
711
|
cleanupAnchor_fn = function(a) {
|
|
686
|
-
a.removeEventListener("click", __privateGet(this,
|
|
712
|
+
a.removeEventListener("click", __privateGet(this, _onAnchorClick), true);
|
|
687
713
|
a.removeAttribute("aria-hasPopup");
|
|
688
714
|
a.removeAttribute("aria-expanded");
|
|
689
715
|
};
|
|
690
|
-
|
|
716
|
+
_onAnchorClick = new WeakMap();
|
|
691
717
|
_updateClickOutsideListeners = new WeakMap();
|
|
692
718
|
_wasOpenBeforeClick = new WeakMap();
|
|
693
719
|
_onClickOutsideCapture = new WeakMap();
|
|
@@ -698,6 +724,9 @@ __decorateClass$1([
|
|
|
698
724
|
__decorateClass$1([
|
|
699
725
|
attr({ mode: "fromView" })
|
|
700
726
|
], Menu.prototype, "placement", 2);
|
|
727
|
+
__decorateClass$1([
|
|
728
|
+
attr
|
|
729
|
+
], Menu.prototype, "trigger", 2);
|
|
701
730
|
__decorateClass$1([
|
|
702
731
|
attr({ mode: "boolean", attribute: "auto-dismiss" })
|
|
703
732
|
], Menu.prototype, "autoDismiss", 2);
|
package/shared/definition30.cjs
CHANGED
|
@@ -33,7 +33,7 @@ const MenuTemplate = (context) => {
|
|
|
33
33
|
x.open = state;
|
|
34
34
|
}
|
|
35
35
|
return index.html`
|
|
36
|
-
<template role="presentation">
|
|
36
|
+
<template role="presentation" @change="${(x, c) => x._onChange(c.event)}">
|
|
37
37
|
${anchorSlotTemplate}
|
|
38
38
|
<${popupTag}
|
|
39
39
|
:placement=${(x) => x.placement}
|
package/shared/definition30.js
CHANGED
|
@@ -31,7 +31,7 @@ const MenuTemplate = (context) => {
|
|
|
31
31
|
x.open = state;
|
|
32
32
|
}
|
|
33
33
|
return html`
|
|
34
|
-
<template role="presentation">
|
|
34
|
+
<template role="presentation" @change="${(x, c) => x._onChange(c.event)}">
|
|
35
35
|
${anchorSlotTemplate}
|
|
36
36
|
<${popupTag}
|
|
37
37
|
:placement=${(x) => x.placement}
|
package/shared/definition31.cjs
CHANGED
|
@@ -6,8 +6,9 @@ const affix = require('./affix.cjs');
|
|
|
6
6
|
const applyMixins = require('./apply-mixins.cjs');
|
|
7
7
|
const icon = require('./icon.cjs');
|
|
8
8
|
const ref = require('./ref.cjs');
|
|
9
|
+
const classNames = require('./class-names.cjs');
|
|
9
10
|
|
|
10
|
-
const styles = ".control{display:flex;box-sizing:border-box;align-items:center;border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);
|
|
11
|
+
const styles = ".control{display:flex;box-sizing:border-box;align-items:center;border-radius:8px;background-color:var(--_appearance-color-fill);box-shadow:inset 0 0 0 1px var(--_appearance-color-outline);cursor:pointer;font:var(--vvd-typography-base);gap:12px;hyphens:auto;inline-size:100%;min-block-size:calc(1px*(40 + 4*clamp(-1,var(--vvd-size-density, 0),2)));padding-block:10px;padding-inline:16px;text-decoration:none;vertical-align:middle}.control.connotation-cta{--_connotation-color-primary: var(--vvd-nav-disclosure-cta-primary, var(--vvd-color-cta-500));--_connotation-color-primary-text: var(--vvd-nav-disclosure-cta-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-nav-disclosure-cta-primary-increment, var(--vvd-color-cta-600));--_connotation-color-contrast: var(--vvd-nav-disclosure-cta-contrast, var(--vvd-color-cta-800));--_connotation-color-fierce: var(--vvd-nav-disclosure-cta-fierce, var(--vvd-color-cta-700));--_connotation-color-fierce-primary: var(--vvd-nav-disclosure-cta-fierce-primary, var(--vvd-color-cta-700));--_connotation-color-faint: var(--vvd-nav-disclosure-cta-faint, var(--vvd-color-cta-50));--_connotation-color-firm: var(--vvd-nav-disclosure-cta-firm, var(--vvd-color-cta-600));--_connotation-color-soft: var(--vvd-nav-disclosure-cta-soft, var(--vvd-color-cta-100))}.control:not(.connotation-cta){--_connotation-color-primary: var(--vvd-nav-disclosure-accent-primary, var(--vvd-color-canvas-text));--_connotation-color-primary-text: var(--vvd-nav-disclosure-accent-primary-text, var(--vvd-color-canvas));--_connotation-color-primary-increment: var(--vvd-nav-disclosure-accent-primary-increment, var(--vvd-color-neutral-800));--_connotation-color-contrast: var(--vvd-nav-disclosure-accent-contrast, var(--vvd-color-neutral-800));--_connotation-color-fierce: var(--vvd-nav-disclosure-accent-fierce, var(--vvd-color-neutral-700));--_connotation-color-fierce-primary: var(--vvd-nav-disclosure-accent-fierce-primary, var(--vvd-color-canvas-text));--_connotation-color-faint: var(--vvd-nav-disclosure-accent-faint, var(--vvd-color-neutral-50));--_connotation-color-firm: var(--vvd-nav-disclosure-accent-firm, var(--vvd-color-canvas-text));--_connotation-color-soft: var(--vvd-nav-disclosure-accent-soft, var(--vvd-color-neutral-100))}.control{--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control.appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-firm);--_appearance-color-fill: transparent;--_appearance-color-outline: transparent}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-faint);--_appearance-color-outline: transparent}.control:where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-fierce-primary);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-primary), transparent 90%);--_appearance-color-outline: transparent}.control:where(.active,:active):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary);--_appearance-color-fill: var(--_connotation-color-soft);--_appearance-color-outline: transparent}.control:where(.active,:active):where(:not(.disabled,:disabled)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-fierce-primary);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-primary), transparent 80%);--_appearance-color-outline: transparent}.control:where([aria-current]):where(:not(.disabled,:disabled)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary);--_appearance-color-outline: transparent}.control:where([aria-current]):where(:not(.disabled,:disabled)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-firm), transparent 10%);--_appearance-color-outline: transparent}.control:where([aria-current]):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)){--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: var(--_connotation-color-primary-increment);--_appearance-color-outline: transparent}.control:where([aria-current]):where(.hover,:hover):where(:not(.disabled,:disabled,.readonly)).appearance-ghost-light{--_appearance-color-text: var(--_connotation-color-primary-text);--_appearance-color-fill: color-mix(in srgb, var(--_connotation-color-fierce-primary), transparent 20%);--_appearance-color-outline: transparent}.control[aria-current]{color:var(--_appearance-color-text)}.control:not([aria-current]){color:var(--vvd-color-canvas-text)}.control:focus-visible{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))}:host(:where([aria-current=true][open])) .control,:host(:not([aria-current=true])) .control{--focus-stroke-gap-color: transparent}@supports (user-select: none){.control{user-select:none}}.control .toggleIcon{margin-inline-start:auto}slot[name=icon]{font-size:20px;line-height:1}.content{display:flex;flex-direction:column;border-inline-start:1px solid var(--vvd-color-neutral-200);gap:4px;margin-block:4px;margin-inline-start:20px;padding-inline-start:12px}details>summary{list-style:none}details>summary::-webkit-details-marker{display:none}\n";
|
|
11
12
|
|
|
12
13
|
var __defProp = Object.defineProperty;
|
|
13
14
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -50,6 +51,12 @@ class NavDisclosure extends index.FoundationElement {
|
|
|
50
51
|
__decorateClass([
|
|
51
52
|
index.attr
|
|
52
53
|
], NavDisclosure.prototype, "label", 2);
|
|
54
|
+
__decorateClass([
|
|
55
|
+
index.attr
|
|
56
|
+
], NavDisclosure.prototype, "appearance", 2);
|
|
57
|
+
__decorateClass([
|
|
58
|
+
index.attr
|
|
59
|
+
], NavDisclosure.prototype, "connotation", 2);
|
|
53
60
|
__decorateClass([
|
|
54
61
|
index.attr({ mode: "boolean" })
|
|
55
62
|
], NavDisclosure.prototype, "open", 2);
|
|
@@ -61,11 +68,16 @@ applyMixins.applyMixins(NavDisclosure, affix.AffixIcon);
|
|
|
61
68
|
function getAriaCurrent(ariaCurrent, open) {
|
|
62
69
|
return ariaCurrent && !open;
|
|
63
70
|
}
|
|
71
|
+
const getClasses = ({ appearance, connotation }) => classNames.classNames(
|
|
72
|
+
"control",
|
|
73
|
+
[`appearance-${appearance}`, Boolean(appearance)],
|
|
74
|
+
[`connotation-${connotation}`, Boolean(connotation)]
|
|
75
|
+
);
|
|
64
76
|
const NavDisclosureTemplate = (context) => {
|
|
65
77
|
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
66
78
|
const iconTag = context.tagFor(icon.Icon);
|
|
67
79
|
return index.html`<details class="base" ${ref.ref("details")} ?open=${(x) => x.open}>
|
|
68
|
-
<summary class="
|
|
80
|
+
<summary class="${getClasses}"
|
|
69
81
|
role="button"
|
|
70
82
|
aria-controls="disclosure-content"
|
|
71
83
|
aria-expanded="${(x) => x.open}"
|