@vonage/vivid 4.4.0 → 4.6.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/custom-elements.json +7181 -6876
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/index.cjs +80 -74
- package/index.js +23 -22
- package/lib/components.d.ts +1 -0
- package/lib/fab/fab.d.ts +1 -1
- package/lib/icon/icon.d.ts +1 -1
- package/lib/menu/menu.d.ts +2 -1
- package/lib/number-field/number-field.d.ts +3 -1
- package/lib/searchable-select/definition.d.ts +4 -0
- package/lib/searchable-select/locale.d.ts +6 -0
- package/lib/searchable-select/option-tag.d.ts +14 -0
- package/lib/searchable-select/option-tag.template.d.ts +4 -0
- package/lib/searchable-select/searchable-select.d.ts +29 -0
- package/lib/searchable-select/searchable-select.form-associated.d.ts +10 -0
- package/lib/searchable-select/searchable-select.template.d.ts +4 -0
- package/lib/select/select.d.ts +4 -1
- package/lib/tab/locale.d.ts +3 -0
- package/lib/tab/tab.d.ts +5 -1
- package/lib/tabs/tabs.d.ts +2 -0
- package/lib/tag/definition.d.ts +1 -0
- package/lib/text-field/text-field.d.ts +3 -1
- package/lib/video-player/video-player.d.ts +0 -1
- package/listbox/index.cjs +1 -1
- package/listbox/index.js +1 -1
- package/locales/de-DE.cjs +12 -0
- package/locales/de-DE.js +12 -0
- package/locales/en-GB.cjs +12 -0
- package/locales/en-GB.js +12 -0
- package/locales/en-US.cjs +12 -0
- package/locales/en-US.js +12 -0
- package/locales/ja-JP.cjs +12 -0
- package/locales/ja-JP.js +12 -0
- package/locales/zh-CN.cjs +12 -0
- package/locales/zh-CN.js +12 -0
- package/package.json +6 -1
- package/popup/index.cjs +1 -1
- package/popup/index.js +1 -1
- package/searchable-select/index.cjs +5 -0
- package/searchable-select/index.js +3 -0
- package/select/index.cjs +1 -1
- package/select/index.js +1 -1
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/anchored.js +1 -1
- package/shared/calendar-event.js +1 -1
- package/shared/definition.cjs +2 -2
- package/shared/definition.js +2 -2
- package/shared/definition11.cjs +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition12.cjs +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition13.js +1 -1
- package/shared/definition14.cjs +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.cjs +7 -8
- package/shared/definition15.js +2 -3
- package/shared/definition16.cjs +11 -7
- package/shared/definition16.js +10 -6
- package/shared/definition17.cjs +2 -2
- package/shared/definition17.js +2 -2
- package/shared/definition18.cjs +5 -6
- package/shared/definition18.js +3 -4
- package/shared/definition19.cjs +5 -6
- package/shared/definition19.js +3 -4
- package/shared/definition20.cjs +16 -38
- package/shared/definition20.js +17 -39
- package/shared/definition21.cjs +7 -6
- package/shared/definition21.js +8 -7
- package/shared/definition23.cjs +1 -1
- package/shared/definition23.js +2 -2
- package/shared/definition24.cjs +2 -2
- package/shared/definition24.js +2 -2
- package/shared/definition25.cjs +6 -7
- package/shared/definition25.js +2 -3
- package/shared/definition26.cjs +1 -1
- package/shared/definition26.js +2 -2
- package/shared/definition27.cjs +1 -1
- package/shared/definition27.js +1 -1
- package/shared/definition28.js +1 -1
- package/shared/definition29.cjs +8 -4
- package/shared/definition29.js +8 -4
- package/shared/definition3.cjs +1 -1
- package/shared/definition3.js +2 -2
- package/shared/definition30.cjs +4 -2
- package/shared/definition30.js +4 -2
- package/shared/definition31.cjs +1 -1
- package/shared/definition31.js +2 -2
- package/shared/definition32.cjs +1 -1
- package/shared/definition32.js +1 -1
- package/shared/definition34.cjs +2 -3
- package/shared/definition34.js +2 -3
- package/shared/definition35.cjs +21 -16
- package/shared/definition35.js +16 -11
- package/shared/definition36.cjs +50 -207
- package/shared/definition36.js +51 -207
- package/shared/definition37.js +1 -1
- package/shared/definition38.cjs +1 -1
- package/shared/definition38.js +1 -1
- package/shared/definition4.cjs +6 -4
- package/shared/definition4.js +7 -5
- package/shared/definition41.cjs +1 -1
- package/shared/definition41.js +1 -1
- package/shared/definition42.cjs +6 -7
- package/shared/definition42.js +6 -7
- package/shared/definition43.cjs +998 -643
- package/shared/definition43.js +992 -638
- package/shared/definition44.cjs +723 -112
- package/shared/definition44.js +722 -111
- package/shared/definition45.cjs +121 -79
- package/shared/definition45.js +120 -78
- package/shared/definition46.cjs +81 -616
- package/shared/definition46.js +80 -614
- package/shared/definition47.cjs +609 -116
- package/shared/definition47.js +607 -115
- package/shared/definition48.cjs +116 -134
- package/shared/definition48.js +115 -133
- package/shared/definition49.cjs +149 -19
- package/shared/definition49.js +148 -18
- package/shared/definition5.cjs +5 -6
- package/shared/definition5.js +5 -6
- package/shared/definition50.cjs +21 -82
- package/shared/definition50.js +20 -81
- package/shared/definition51.cjs +78 -494
- package/shared/definition51.js +77 -493
- package/shared/definition52.cjs +568 -28
- package/shared/definition52.js +567 -27
- package/shared/definition53.cjs +28 -123
- package/shared/definition53.js +27 -123
- package/shared/definition54.cjs +115 -296
- package/shared/definition54.js +114 -295
- package/shared/definition55.cjs +258 -318
- package/shared/definition55.js +252 -312
- package/shared/definition56.cjs +303 -784
- package/shared/definition56.js +298 -779
- package/shared/definition57.cjs +802 -95
- package/shared/definition57.js +801 -94
- package/shared/definition58.cjs +95 -60
- package/shared/definition58.js +94 -59
- package/shared/definition59.cjs +117 -75
- package/shared/definition59.js +116 -74
- package/shared/definition6.cjs +1 -1
- package/shared/definition6.js +1 -1
- package/shared/definition60.cjs +70 -285
- package/shared/definition60.js +71 -286
- package/shared/definition61.cjs +296 -325
- package/shared/definition61.js +295 -324
- package/shared/definition62.cjs +66160 -27
- package/shared/definition62.js +66159 -26
- package/shared/definition63.cjs +24 -1952
- package/shared/definition63.js +23 -1950
- package/shared/definition64.cjs +1976 -0
- package/shared/definition64.js +1971 -0
- package/shared/definition7.cjs +1 -1
- package/shared/definition7.js +1 -1
- package/shared/definition8.cjs +2 -3
- package/shared/definition8.js +3 -4
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +1 -1
- package/shared/dialog/index.d.ts +1 -0
- package/shared/form-elements.cjs +236 -0
- package/shared/form-elements.js +229 -0
- package/shared/icon.js +1 -1
- package/shared/index2.cjs +6 -256
- package/shared/index2.js +6 -249
- package/shared/listbox-option.cjs +204 -0
- package/shared/listbox-option.js +201 -0
- package/shared/listbox.cjs +3 -3
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/localized.cjs +26 -2
- package/shared/localized.js +25 -2
- package/shared/playbackRates.cjs +13 -0
- package/shared/playbackRates.js +11 -0
- package/shared/presentationDate.cjs +11 -11
- package/shared/presentationDate.js +11 -11
- package/shared/scrollIntoView.cjs +51 -0
- package/shared/scrollIntoView.js +49 -0
- package/shared/slider.template.cjs +1 -1
- package/shared/slider.template.js +1 -1
- package/shared/text-anchor.cjs +1 -1
- package/shared/text-anchor.js +1 -1
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/playbackRates.d.ts +1 -0
- package/shared/utils/scrollIntoView.d.ts +1 -0
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +1 -1
- package/slider/index.js +1 -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/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.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 +1 -1
- package/tabs/index.js +1 -1
- 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 -1
- package/text-field/index.js +1 -1
- package/time-picker/index.cjs +1 -1
- package/time-picker/index.js +1 -1
- package/toggletip/index.cjs +1 -1
- package/toggletip/index.js +1 -1
- package/tooltip/index.cjs +1 -1
- package/tooltip/index.js +1 -1
- 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/video-player/index.cjs +1 -1
- package/video-player/index.js +1 -1
- package/vivid.api.json +312 -8
- package/appearance-ui/index.cjs +0 -102
- package/appearance-ui/index.js +0 -100
- package/lib/appearance-ui/appearance-ui.d.ts +0 -12
- package/lib/appearance-ui/appearance-ui.template.d.ts +0 -4
- package/lib/appearance-ui/definition.d.ts +0 -3
- package/shared/video-player.cjs +0 -65860
- package/shared/video-player.js +0 -65857
package/shared/definition58.cjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./
|
|
4
|
+
const definition = require('./definition64.cjs');
|
|
5
5
|
const anchored = require('./anchored.cjs');
|
|
6
|
+
const index$1 = require('./index2.cjs');
|
|
7
|
+
const when = require('./when.cjs');
|
|
6
8
|
const classNames = require('./class-names.cjs');
|
|
7
9
|
|
|
8
|
-
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.
|
|
10
|
+
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.content-wrapper{width:var(--toggletip-inline-size, auto);padding:16px;max-inline-size:var(--toggletip-max-inline-size, 30ch)}.headline{font:var(--vvd-typography-base-bold)}.action-items{display:flex;justify-content:flex-end;gap:10px}::slotted([slot=action-items]){margin-block-start:16px}";
|
|
9
11
|
|
|
10
12
|
var __defProp = Object.defineProperty;
|
|
11
13
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -24,107 +26,140 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
24
26
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
25
27
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
26
28
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
27
|
-
var
|
|
28
|
-
let
|
|
29
|
+
var _ANCHOR_ARIA_LABEL_SUFFIX, _Toggletip_instances, setupAnchor_fn, updateAnchor_fn, cleanupAnchor_fn, _openIfClosed, updateListeners_fn, _closeOnClickOutside, _closeOnEscape;
|
|
30
|
+
let Toggletip = class extends index.FoundationElement {
|
|
29
31
|
constructor() {
|
|
30
32
|
super(...arguments);
|
|
31
|
-
__privateAdd(this,
|
|
33
|
+
__privateAdd(this, _Toggletip_instances);
|
|
34
|
+
__privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
|
|
35
|
+
this.alternate = false;
|
|
36
|
+
this.placement = "right";
|
|
32
37
|
this.open = false;
|
|
33
|
-
__privateAdd(this,
|
|
34
|
-
this.open = true;
|
|
38
|
+
__privateAdd(this, _openIfClosed, () => {
|
|
39
|
+
if (!this.open) index.DOM.queueUpdate(() => this.open = true);
|
|
35
40
|
});
|
|
36
|
-
__privateAdd(this,
|
|
37
|
-
|
|
41
|
+
__privateAdd(this, _closeOnClickOutside, (e) => {
|
|
42
|
+
const clickedOutside = !this.contains(e.target);
|
|
43
|
+
const clickedOnAnchor = this._anchorEl?.contains(e.target);
|
|
44
|
+
if (clickedOutside || clickedOnAnchor) this.open = false;
|
|
38
45
|
});
|
|
39
46
|
__privateAdd(this, _closeOnEscape, (e) => {
|
|
40
|
-
if (e.key === "Escape")
|
|
47
|
+
if (e.key === "Escape") {
|
|
48
|
+
this.open = false;
|
|
49
|
+
}
|
|
41
50
|
});
|
|
42
51
|
}
|
|
52
|
+
openChanged(oldValue, newValue) {
|
|
53
|
+
if (oldValue === void 0) return;
|
|
54
|
+
if (newValue) {
|
|
55
|
+
this.setAttribute("role", "status");
|
|
56
|
+
} else {
|
|
57
|
+
this.removeAttribute("role");
|
|
58
|
+
}
|
|
59
|
+
__privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
|
|
60
|
+
if (this._anchorEl) {
|
|
61
|
+
__privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, this._anchorEl);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
43
64
|
connectedCallback() {
|
|
44
65
|
super.connectedCallback();
|
|
45
|
-
__privateMethod(this,
|
|
66
|
+
__privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
|
|
46
67
|
}
|
|
47
68
|
disconnectedCallback() {
|
|
48
69
|
super.disconnectedCallback();
|
|
49
|
-
__privateMethod(this,
|
|
70
|
+
__privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
|
|
50
71
|
}
|
|
51
72
|
/**
|
|
52
73
|
* @internal
|
|
53
74
|
*/
|
|
54
75
|
_anchorElChanged(oldValue, newValue) {
|
|
55
|
-
if (oldValue) __privateMethod(this,
|
|
56
|
-
if (newValue) __privateMethod(this,
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* @internal
|
|
60
|
-
*/
|
|
61
|
-
openChanged(oldValue) {
|
|
62
|
-
if (oldValue === void 0) return;
|
|
63
|
-
__privateMethod(this, _Tooltip_instances, updateListeners_fn).call(this);
|
|
76
|
+
if (oldValue) __privateMethod(this, _Toggletip_instances, cleanupAnchor_fn).call(this, oldValue);
|
|
77
|
+
if (newValue) __privateMethod(this, _Toggletip_instances, setupAnchor_fn).call(this, newValue);
|
|
64
78
|
}
|
|
65
79
|
};
|
|
66
|
-
|
|
80
|
+
_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
|
|
81
|
+
_Toggletip_instances = new WeakSet();
|
|
67
82
|
setupAnchor_fn = function(a) {
|
|
68
|
-
a.addEventListener("
|
|
69
|
-
a.
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
a.addEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
84
|
+
a.ariaLabel = (a.ariaLabel ?? "") + __privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX);
|
|
85
|
+
__privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, a);
|
|
86
|
+
};
|
|
87
|
+
updateAnchor_fn = function(a) {
|
|
88
|
+
a.setAttribute("aria-expanded", this.open.toString());
|
|
72
89
|
};
|
|
73
90
|
cleanupAnchor_fn = function(a) {
|
|
74
|
-
a.removeEventListener("
|
|
75
|
-
a.
|
|
76
|
-
|
|
77
|
-
a.removeEventListener("focusout", __privateGet(this, _hide));
|
|
91
|
+
a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
92
|
+
if (a.ariaLabel)
|
|
93
|
+
a.ariaLabel = a.ariaLabel.replace(__privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX), "");
|
|
78
94
|
};
|
|
79
|
-
|
|
80
|
-
_hide = new WeakMap();
|
|
95
|
+
_openIfClosed = new WeakMap();
|
|
81
96
|
updateListeners_fn = function() {
|
|
97
|
+
document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
82
98
|
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
83
99
|
if (this.open && this.isConnected) {
|
|
100
|
+
document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
84
101
|
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
85
102
|
}
|
|
86
103
|
};
|
|
104
|
+
_closeOnClickOutside = new WeakMap();
|
|
87
105
|
_closeOnEscape = new WeakMap();
|
|
88
106
|
__decorateClass([
|
|
89
107
|
index.attr
|
|
90
|
-
],
|
|
108
|
+
], Toggletip.prototype, "headline", 2);
|
|
109
|
+
__decorateClass([
|
|
110
|
+
index.attr({ mode: "boolean" })
|
|
111
|
+
], Toggletip.prototype, "alternate", 2);
|
|
91
112
|
__decorateClass([
|
|
92
113
|
index.attr({ mode: "fromView" })
|
|
93
|
-
],
|
|
114
|
+
], Toggletip.prototype, "placement", 2);
|
|
94
115
|
__decorateClass([
|
|
95
116
|
index.attr({ mode: "boolean" })
|
|
96
|
-
],
|
|
97
|
-
|
|
117
|
+
], Toggletip.prototype, "open", 2);
|
|
118
|
+
Toggletip = __decorateClass([
|
|
98
119
|
anchored.anchored
|
|
99
|
-
],
|
|
120
|
+
], Toggletip);
|
|
100
121
|
|
|
101
|
-
const getClasses = (
|
|
102
|
-
const
|
|
103
|
-
const
|
|
122
|
+
const getClasses = (_) => classNames.classNames("control");
|
|
123
|
+
const ToggletipTemplate = (context) => {
|
|
124
|
+
const popup = context.tagFor(definition.Popup);
|
|
104
125
|
const anchorSlotTemplate = anchored.anchorSlotTemplateFactory();
|
|
105
126
|
return index.html`
|
|
106
|
-
${anchorSlotTemplate}
|
|
107
|
-
<${
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
127
|
+
${anchorSlotTemplate}
|
|
128
|
+
<${popup}
|
|
129
|
+
@keydown="${(x, { event }) => {
|
|
130
|
+
if (x.open && index$1.handleEscapeKeyAndStopPropogation(event)) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}}"
|
|
135
|
+
class="${getClasses}"
|
|
136
|
+
arrow
|
|
137
|
+
:anchor="${(x) => x._anchorEl}"
|
|
138
|
+
:open="${(x) => x.open}"
|
|
139
|
+
?alternate="${(x) => !x.alternate}"
|
|
140
|
+
placement="${(x) => x.placement}"
|
|
141
|
+
exportparts="vvd-theme-alternate"
|
|
142
|
+
>
|
|
143
|
+
<div class="content-wrapper">
|
|
144
|
+
${when.when(
|
|
145
|
+
(x) => x.headline,
|
|
146
|
+
index.html`<header class="headline">${(x) => x.headline}</header>`
|
|
147
|
+
)}
|
|
148
|
+
<slot></slot>
|
|
149
|
+
<footer class="action-items"><slot name="action-items"></slot></footer>
|
|
150
|
+
</div>
|
|
151
|
+
</${popup}>
|
|
152
|
+
`;
|
|
118
153
|
};
|
|
119
154
|
|
|
120
|
-
const
|
|
121
|
-
baseName: "
|
|
122
|
-
template:
|
|
155
|
+
const toggletipDefinition = Toggletip.compose({
|
|
156
|
+
baseName: "toggletip",
|
|
157
|
+
template: ToggletipTemplate,
|
|
123
158
|
styles
|
|
124
159
|
});
|
|
125
|
-
const
|
|
126
|
-
const
|
|
160
|
+
const toggletipRegistries = [toggletipDefinition(), ...definition.popupRegistries];
|
|
161
|
+
const registerToggletip = index.registerFactory(toggletipRegistries);
|
|
127
162
|
|
|
128
|
-
exports.
|
|
129
|
-
exports.
|
|
130
|
-
exports.
|
|
163
|
+
exports.registerToggletip = registerToggletip;
|
|
164
|
+
exports.toggletipDefinition = toggletipDefinition;
|
|
165
|
+
exports.toggletipRegistries = toggletipRegistries;
|
package/shared/definition58.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { a as attr,
|
|
2
|
-
import { P as Popup, p as popupRegistries } from './
|
|
1
|
+
import { F as FoundationElement, a as attr, D as DOM, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { P as Popup, p as popupRegistries } from './definition64.js';
|
|
3
3
|
import { b as anchored, a as anchorSlotTemplateFactory } from './anchored.js';
|
|
4
|
+
import { h as handleEscapeKeyAndStopPropogation } from './index2.js';
|
|
5
|
+
import { w as when } from './when.js';
|
|
4
6
|
import { c as classNames } from './class-names.js';
|
|
5
7
|
|
|
6
|
-
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.
|
|
8
|
+
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.content-wrapper{width:var(--toggletip-inline-size, auto);padding:16px;max-inline-size:var(--toggletip-max-inline-size, 30ch)}.headline{font:var(--vvd-typography-base-bold)}.action-items{display:flex;justify-content:flex-end;gap:10px}::slotted([slot=action-items]){margin-block-start:16px}";
|
|
7
9
|
|
|
8
10
|
var __defProp = Object.defineProperty;
|
|
9
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -22,105 +24,138 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
22
24
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
23
25
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
24
26
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
25
|
-
var
|
|
26
|
-
let
|
|
27
|
+
var _ANCHOR_ARIA_LABEL_SUFFIX, _Toggletip_instances, setupAnchor_fn, updateAnchor_fn, cleanupAnchor_fn, _openIfClosed, updateListeners_fn, _closeOnClickOutside, _closeOnEscape;
|
|
28
|
+
let Toggletip = class extends FoundationElement {
|
|
27
29
|
constructor() {
|
|
28
30
|
super(...arguments);
|
|
29
|
-
__privateAdd(this,
|
|
31
|
+
__privateAdd(this, _Toggletip_instances);
|
|
32
|
+
__privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
|
|
33
|
+
this.alternate = false;
|
|
34
|
+
this.placement = "right";
|
|
30
35
|
this.open = false;
|
|
31
|
-
__privateAdd(this,
|
|
32
|
-
this.open = true;
|
|
36
|
+
__privateAdd(this, _openIfClosed, () => {
|
|
37
|
+
if (!this.open) DOM.queueUpdate(() => this.open = true);
|
|
33
38
|
});
|
|
34
|
-
__privateAdd(this,
|
|
35
|
-
|
|
39
|
+
__privateAdd(this, _closeOnClickOutside, (e) => {
|
|
40
|
+
const clickedOutside = !this.contains(e.target);
|
|
41
|
+
const clickedOnAnchor = this._anchorEl?.contains(e.target);
|
|
42
|
+
if (clickedOutside || clickedOnAnchor) this.open = false;
|
|
36
43
|
});
|
|
37
44
|
__privateAdd(this, _closeOnEscape, (e) => {
|
|
38
|
-
if (e.key === "Escape")
|
|
45
|
+
if (e.key === "Escape") {
|
|
46
|
+
this.open = false;
|
|
47
|
+
}
|
|
39
48
|
});
|
|
40
49
|
}
|
|
50
|
+
openChanged(oldValue, newValue) {
|
|
51
|
+
if (oldValue === void 0) return;
|
|
52
|
+
if (newValue) {
|
|
53
|
+
this.setAttribute("role", "status");
|
|
54
|
+
} else {
|
|
55
|
+
this.removeAttribute("role");
|
|
56
|
+
}
|
|
57
|
+
__privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
|
|
58
|
+
if (this._anchorEl) {
|
|
59
|
+
__privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, this._anchorEl);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
41
62
|
connectedCallback() {
|
|
42
63
|
super.connectedCallback();
|
|
43
|
-
__privateMethod(this,
|
|
64
|
+
__privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
|
|
44
65
|
}
|
|
45
66
|
disconnectedCallback() {
|
|
46
67
|
super.disconnectedCallback();
|
|
47
|
-
__privateMethod(this,
|
|
68
|
+
__privateMethod(this, _Toggletip_instances, updateListeners_fn).call(this);
|
|
48
69
|
}
|
|
49
70
|
/**
|
|
50
71
|
* @internal
|
|
51
72
|
*/
|
|
52
73
|
_anchorElChanged(oldValue, newValue) {
|
|
53
|
-
if (oldValue) __privateMethod(this,
|
|
54
|
-
if (newValue) __privateMethod(this,
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
openChanged(oldValue) {
|
|
60
|
-
if (oldValue === void 0) return;
|
|
61
|
-
__privateMethod(this, _Tooltip_instances, updateListeners_fn).call(this);
|
|
74
|
+
if (oldValue) __privateMethod(this, _Toggletip_instances, cleanupAnchor_fn).call(this, oldValue);
|
|
75
|
+
if (newValue) __privateMethod(this, _Toggletip_instances, setupAnchor_fn).call(this, newValue);
|
|
62
76
|
}
|
|
63
77
|
};
|
|
64
|
-
|
|
78
|
+
_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
|
|
79
|
+
_Toggletip_instances = new WeakSet();
|
|
65
80
|
setupAnchor_fn = function(a) {
|
|
66
|
-
a.addEventListener("
|
|
67
|
-
a.
|
|
68
|
-
|
|
69
|
-
|
|
81
|
+
a.addEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
82
|
+
a.ariaLabel = (a.ariaLabel ?? "") + __privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX);
|
|
83
|
+
__privateMethod(this, _Toggletip_instances, updateAnchor_fn).call(this, a);
|
|
84
|
+
};
|
|
85
|
+
updateAnchor_fn = function(a) {
|
|
86
|
+
a.setAttribute("aria-expanded", this.open.toString());
|
|
70
87
|
};
|
|
71
88
|
cleanupAnchor_fn = function(a) {
|
|
72
|
-
a.removeEventListener("
|
|
73
|
-
a.
|
|
74
|
-
|
|
75
|
-
a.removeEventListener("focusout", __privateGet(this, _hide));
|
|
89
|
+
a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
90
|
+
if (a.ariaLabel)
|
|
91
|
+
a.ariaLabel = a.ariaLabel.replace(__privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX), "");
|
|
76
92
|
};
|
|
77
|
-
|
|
78
|
-
_hide = new WeakMap();
|
|
93
|
+
_openIfClosed = new WeakMap();
|
|
79
94
|
updateListeners_fn = function() {
|
|
95
|
+
document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
80
96
|
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
81
97
|
if (this.open && this.isConnected) {
|
|
98
|
+
document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
82
99
|
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
83
100
|
}
|
|
84
101
|
};
|
|
102
|
+
_closeOnClickOutside = new WeakMap();
|
|
85
103
|
_closeOnEscape = new WeakMap();
|
|
86
104
|
__decorateClass([
|
|
87
105
|
attr
|
|
88
|
-
],
|
|
106
|
+
], Toggletip.prototype, "headline", 2);
|
|
107
|
+
__decorateClass([
|
|
108
|
+
attr({ mode: "boolean" })
|
|
109
|
+
], Toggletip.prototype, "alternate", 2);
|
|
89
110
|
__decorateClass([
|
|
90
111
|
attr({ mode: "fromView" })
|
|
91
|
-
],
|
|
112
|
+
], Toggletip.prototype, "placement", 2);
|
|
92
113
|
__decorateClass([
|
|
93
114
|
attr({ mode: "boolean" })
|
|
94
|
-
],
|
|
95
|
-
|
|
115
|
+
], Toggletip.prototype, "open", 2);
|
|
116
|
+
Toggletip = __decorateClass([
|
|
96
117
|
anchored
|
|
97
|
-
],
|
|
118
|
+
], Toggletip);
|
|
98
119
|
|
|
99
|
-
const getClasses = (
|
|
100
|
-
const
|
|
101
|
-
const
|
|
120
|
+
const getClasses = (_) => classNames("control");
|
|
121
|
+
const ToggletipTemplate = (context) => {
|
|
122
|
+
const popup = context.tagFor(Popup);
|
|
102
123
|
const anchorSlotTemplate = anchorSlotTemplateFactory();
|
|
103
124
|
return html`
|
|
104
|
-
${anchorSlotTemplate}
|
|
105
|
-
<${
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
125
|
+
${anchorSlotTemplate}
|
|
126
|
+
<${popup}
|
|
127
|
+
@keydown="${(x, { event }) => {
|
|
128
|
+
if (x.open && handleEscapeKeyAndStopPropogation(event)) {
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
return true;
|
|
132
|
+
}}"
|
|
133
|
+
class="${getClasses}"
|
|
134
|
+
arrow
|
|
135
|
+
:anchor="${(x) => x._anchorEl}"
|
|
136
|
+
:open="${(x) => x.open}"
|
|
137
|
+
?alternate="${(x) => !x.alternate}"
|
|
138
|
+
placement="${(x) => x.placement}"
|
|
139
|
+
exportparts="vvd-theme-alternate"
|
|
140
|
+
>
|
|
141
|
+
<div class="content-wrapper">
|
|
142
|
+
${when(
|
|
143
|
+
(x) => x.headline,
|
|
144
|
+
html`<header class="headline">${(x) => x.headline}</header>`
|
|
145
|
+
)}
|
|
146
|
+
<slot></slot>
|
|
147
|
+
<footer class="action-items"><slot name="action-items"></slot></footer>
|
|
148
|
+
</div>
|
|
149
|
+
</${popup}>
|
|
150
|
+
`;
|
|
116
151
|
};
|
|
117
152
|
|
|
118
|
-
const
|
|
119
|
-
baseName: "
|
|
120
|
-
template:
|
|
153
|
+
const toggletipDefinition = Toggletip.compose({
|
|
154
|
+
baseName: "toggletip",
|
|
155
|
+
template: ToggletipTemplate,
|
|
121
156
|
styles
|
|
122
157
|
});
|
|
123
|
-
const
|
|
124
|
-
const
|
|
158
|
+
const toggletipRegistries = [toggletipDefinition(), ...popupRegistries];
|
|
159
|
+
const registerToggletip = registerFactory(toggletipRegistries);
|
|
125
160
|
|
|
126
|
-
export {
|
|
161
|
+
export { toggletipRegistries as a, registerToggletip as r, toggletipDefinition as t };
|
package/shared/definition59.cjs
CHANGED
|
@@ -1,94 +1,136 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const applyMixins = require('./apply-mixins.cjs');
|
|
8
|
-
const icon = require('./icon.cjs');
|
|
9
|
-
const slotted = require('./slotted.cjs');
|
|
10
|
-
const children = require('./children.cjs');
|
|
11
|
-
const when = require('./when.cjs');
|
|
4
|
+
const definition = require('./definition64.cjs');
|
|
5
|
+
const anchored = require('./anchored.cjs');
|
|
6
|
+
const index$1 = require('./index2.cjs');
|
|
12
7
|
const classNames = require('./class-names.cjs');
|
|
13
|
-
const ref = require('./ref.cjs');
|
|
14
8
|
|
|
15
|
-
const styles = ":host
|
|
9
|
+
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.control{pointer-events:none}.tooltip{width:var(--tooltip-inline-size, auto);max-inline-size:var(--tooltip-max-inline-size, 30ch)}.tooltip-text{padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}";
|
|
16
10
|
|
|
17
11
|
var __defProp = Object.defineProperty;
|
|
12
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
13
|
+
var __typeError = (msg) => {
|
|
14
|
+
throw TypeError(msg);
|
|
15
|
+
};
|
|
18
16
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
19
|
-
var result = void 0 ;
|
|
17
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
20
18
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21
19
|
if (decorator = decorators[i])
|
|
22
|
-
result = (decorator(target, key, result) ) || result;
|
|
23
|
-
if (result) __defProp(target, key, result);
|
|
20
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
21
|
+
if (kind && result) __defProp(target, key, result);
|
|
24
22
|
return result;
|
|
25
23
|
};
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
25
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
26
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
27
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
28
|
+
var _Tooltip_instances, setupAnchor_fn, cleanupAnchor_fn, _show, _hide, updateListeners_fn, _closeOnEscape;
|
|
29
|
+
let Tooltip = class extends index.FoundationElement {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments);
|
|
32
|
+
__privateAdd(this, _Tooltip_instances);
|
|
33
|
+
this.open = false;
|
|
34
|
+
__privateAdd(this, _show, () => {
|
|
35
|
+
this.open = true;
|
|
36
|
+
});
|
|
37
|
+
__privateAdd(this, _hide, () => {
|
|
38
|
+
this.open = false;
|
|
39
|
+
});
|
|
40
|
+
__privateAdd(this, _closeOnEscape, (e) => {
|
|
41
|
+
if (e.key === "Escape") __privateGet(this, _hide).call(this);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
connectedCallback() {
|
|
45
|
+
super.connectedCallback();
|
|
46
|
+
__privateMethod(this, _Tooltip_instances, updateListeners_fn).call(this);
|
|
47
|
+
}
|
|
48
|
+
disconnectedCallback() {
|
|
49
|
+
super.disconnectedCallback();
|
|
50
|
+
__privateMethod(this, _Tooltip_instances, updateListeners_fn).call(this);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @internal
|
|
54
|
+
*/
|
|
55
|
+
_anchorElChanged(oldValue, newValue) {
|
|
56
|
+
if (oldValue) __privateMethod(this, _Tooltip_instances, cleanupAnchor_fn).call(this, oldValue);
|
|
57
|
+
if (newValue) __privateMethod(this, _Tooltip_instances, setupAnchor_fn).call(this, newValue);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
openChanged(oldValue) {
|
|
63
|
+
if (oldValue === void 0) return;
|
|
64
|
+
__privateMethod(this, _Tooltip_instances, updateListeners_fn).call(this);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
_Tooltip_instances = new WeakSet();
|
|
68
|
+
setupAnchor_fn = function(a) {
|
|
69
|
+
a.addEventListener("mouseover", __privateGet(this, _show));
|
|
70
|
+
a.addEventListener("mouseout", __privateGet(this, _hide));
|
|
71
|
+
a.addEventListener("focusin", __privateGet(this, _show));
|
|
72
|
+
a.addEventListener("focusout", __privateGet(this, _hide));
|
|
73
|
+
};
|
|
74
|
+
cleanupAnchor_fn = function(a) {
|
|
75
|
+
a.removeEventListener("mouseover", __privateGet(this, _show));
|
|
76
|
+
a.removeEventListener("mouseout", __privateGet(this, _hide));
|
|
77
|
+
a.removeEventListener("focusin", __privateGet(this, _show));
|
|
78
|
+
a.removeEventListener("focusout", __privateGet(this, _hide));
|
|
79
|
+
};
|
|
80
|
+
_show = new WeakMap();
|
|
81
|
+
_hide = new WeakMap();
|
|
82
|
+
updateListeners_fn = function() {
|
|
83
|
+
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
84
|
+
if (this.open && this.isConnected) {
|
|
85
|
+
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
_closeOnEscape = new WeakMap();
|
|
28
89
|
__decorateClass([
|
|
29
90
|
index.attr
|
|
30
|
-
],
|
|
31
|
-
|
|
91
|
+
], Tooltip.prototype, "text", 2);
|
|
92
|
+
__decorateClass([
|
|
93
|
+
index.attr({ mode: "fromView" })
|
|
94
|
+
], Tooltip.prototype, "placement", 2);
|
|
95
|
+
__decorateClass([
|
|
96
|
+
index.attr({ mode: "boolean" })
|
|
97
|
+
], Tooltip.prototype, "open", 2);
|
|
98
|
+
Tooltip = __decorateClass([
|
|
99
|
+
anchored.anchored
|
|
100
|
+
], Tooltip);
|
|
32
101
|
|
|
33
|
-
const getClasses = ({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
);
|
|
38
|
-
const expandCollapseButton = (context) => {
|
|
39
|
-
const iconTag = context.tagFor(icon.Icon);
|
|
102
|
+
const getClasses = ({ open }) => classNames.classNames("control", ["open", Boolean(open)]);
|
|
103
|
+
const TooltipTemplate = (context) => {
|
|
104
|
+
const popupTag = context.tagFor(definition.Popup);
|
|
105
|
+
const anchorSlotTemplate = anchored.anchorSlotTemplateFactory();
|
|
40
106
|
return index.html`
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
59
|
-
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
60
|
-
${children.children({
|
|
61
|
-
property: "childItems",
|
|
62
|
-
filter: slotted.elements(context.tagFor(TreeItem))
|
|
63
|
-
})}
|
|
64
|
-
>
|
|
65
|
-
<div class="${getClasses}">
|
|
66
|
-
${when.when(
|
|
67
|
-
(x) => x.childItems && x.childItems.length > 0,
|
|
68
|
-
expandCollapseButton(context)
|
|
69
|
-
)}
|
|
70
|
-
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
71
|
-
${(x) => x.text}
|
|
72
|
-
</div>
|
|
73
|
-
${when.when(
|
|
74
|
-
(x) => x.childItems && x.childItems.length > 0 && x.expanded,
|
|
75
|
-
index.html` <div role="group" class="items">
|
|
76
|
-
<slot name="item" ${slotted.slotted("items")}></slot>
|
|
77
|
-
</div>`
|
|
78
|
-
)}
|
|
79
|
-
</template>`;
|
|
107
|
+
${anchorSlotTemplate}
|
|
108
|
+
<${popupTag} class="${getClasses}" arrow alternate
|
|
109
|
+
:placement=${(x) => x.placement}
|
|
110
|
+
:anchor="${(x) => x._anchorEl}"
|
|
111
|
+
:open="${(x) => x.open}"
|
|
112
|
+
@keydown="${(x, c) => {
|
|
113
|
+
if (x.open && index$1.handleEscapeKeyAndStopPropogation(c.event)) {
|
|
114
|
+
x.open = false;
|
|
115
|
+
}
|
|
116
|
+
}}"
|
|
117
|
+
exportparts="vvd-theme-alternate">
|
|
118
|
+
<div class="tooltip" role="tooltip">
|
|
119
|
+
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
120
|
+
<div class="tooltip-text">${(x) => x.text}</div>
|
|
121
|
+
</header>
|
|
122
|
+
</div>
|
|
123
|
+
</${popupTag}>`;
|
|
80
124
|
};
|
|
81
125
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
);
|
|
89
|
-
const treeItemRegistries = [treeItemDefinition(), ...definition.iconRegistries];
|
|
90
|
-
const registerTreeItem = index.registerFactory(treeItemRegistries);
|
|
126
|
+
const tooltipDefinition = Tooltip.compose({
|
|
127
|
+
baseName: "tooltip",
|
|
128
|
+
template: TooltipTemplate,
|
|
129
|
+
styles
|
|
130
|
+
});
|
|
131
|
+
const tooltipRegistries = [tooltipDefinition(), ...definition.popupRegistries];
|
|
132
|
+
const registerTooltip = index.registerFactory(tooltipRegistries);
|
|
91
133
|
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
134
|
+
exports.registerTooltip = registerTooltip;
|
|
135
|
+
exports.tooltipDefinition = tooltipDefinition;
|
|
136
|
+
exports.tooltipRegistries = tooltipRegistries;
|