@vonage/vivid 3.52.0 → 3.53.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/README.md +1 -1
- package/accordion/index.cjs +1 -1
- package/accordion/index.js +1 -1
- package/accordion-item/index.cjs +1 -1
- package/accordion-item/index.js +1 -1
- package/alert/index.cjs +3 -3
- package/alert/index.js +3 -3
- package/audio-player/index.cjs +3 -3
- package/audio-player/index.js +3 -3
- package/avatar/index.cjs +1 -1
- package/avatar/index.js +1 -1
- package/badge/index.cjs +1 -1
- package/badge/index.js +1 -1
- package/banner/index.cjs +2 -2
- package/banner/index.js +2 -2
- package/breadcrumb-item/index.cjs +1 -1
- package/breadcrumb-item/index.js +1 -1
- package/button/index.cjs +2 -2
- package/button/index.js +2 -2
- package/card/index.cjs +2 -2
- package/card/index.js +2 -2
- package/checkbox/index.cjs +3 -2
- package/checkbox/index.js +3 -2
- package/combobox/index.cjs +5 -5
- package/combobox/index.js +5 -5
- package/custom-elements.json +717 -4
- package/data-grid/index.cjs +1 -1
- package/data-grid/index.js +1 -1
- package/date-picker/index.cjs +7 -6
- package/date-picker/index.js +7 -6
- package/date-range-picker/index.cjs +7 -6
- package/date-range-picker/index.js +7 -6
- package/dial-pad/index.cjs +33 -0
- package/dial-pad/index.js +31 -0
- package/dialog/index.cjs +4 -4
- package/dialog/index.js +4 -4
- package/divider/index.cjs +1 -1
- package/divider/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.cjs +2 -2
- package/empty-state/index.js +2 -2
- package/fab/index.cjs +2 -2
- package/fab/index.js +2 -2
- package/file-picker/index.cjs +4 -3
- package/file-picker/index.js +4 -3
- package/header/index.cjs +2 -2
- package/header/index.js +2 -2
- package/icon/index.cjs +1 -1
- package/icon/index.js +1 -1
- package/index.cjs +132 -122
- package/index.js +46 -43
- package/layout/index.cjs +1 -1
- package/layout/index.js +1 -1
- package/lib/components.d.ts +2 -0
- package/lib/dial-pad/definition.d.ts +3 -0
- package/lib/dial-pad/dial-pad.d.ts +14 -0
- package/lib/dial-pad/dial-pad.template.d.ts +4 -0
- package/lib/dial-pad/locale.d.ts +18 -0
- package/lib/enums.d.ts +6 -0
- package/lib/text-anchor/definition.d.ts +1 -0
- package/lib/text-anchor/text-anchor.d.ts +5 -0
- package/lib/video-player/definition.d.ts +3 -0
- package/lib/video-player/locale.d.ts +1 -0
- package/lib/video-player/video-player.d.ts +17 -0
- package/lib/video-player/video-player.template.d.ts +4 -0
- package/listbox/index.cjs +2 -2
- package/listbox/index.js +2 -2
- package/locales/en-GB.cjs +30 -0
- package/locales/en-GB.js +30 -0
- package/locales/en-US.cjs +198 -0
- package/locales/en-US.js +198 -0
- package/locales/ja-JP.cjs +197 -0
- package/locales/ja-JP.js +197 -0
- package/locales/zh-CN.cjs +199 -0
- package/locales/zh-CN.js +199 -0
- package/menu/index.cjs +6 -6
- package/menu/index.js +6 -6
- package/menu-item/index.cjs +2 -2
- package/menu-item/index.js +2 -2
- package/nav/index.cjs +1 -1
- package/nav/index.js +1 -1
- package/nav-disclosure/index.cjs +2 -2
- package/nav-disclosure/index.js +2 -2
- package/nav-item/index.cjs +2 -2
- package/nav-item/index.js +2 -2
- package/note/index.cjs +2 -2
- package/note/index.js +2 -2
- package/number-field/index.cjs +5 -4
- package/number-field/index.js +5 -4
- package/option/index.cjs +2 -2
- package/option/index.js +2 -2
- package/package.json +1 -1
- package/pagination/index.cjs +3 -3
- package/pagination/index.js +3 -3
- package/popup/index.cjs +4 -4
- package/popup/index.js +4 -4
- package/progress/index.cjs +1 -1
- package/progress/index.js +1 -1
- package/progress-ring/index.cjs +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.cjs +1 -1
- package/radio/index.js +1 -1
- package/radio-group/index.cjs +1 -1
- package/radio-group/index.js +1 -1
- package/range-slider/index.cjs +2 -2
- package/range-slider/index.js +2 -2
- package/select/index.cjs +7 -6
- package/select/index.js +7 -6
- package/selectable-box/index.cjs +5 -4
- package/selectable-box/index.js +5 -4
- package/shared/applyMixinsWithObservables.cjs +15 -0
- package/shared/applyMixinsWithObservables.js +13 -0
- package/shared/definition.cjs +1 -1
- package/shared/definition.js +1 -1
- package/shared/definition11.cjs +3 -3
- package/shared/definition11.js +3 -3
- package/shared/definition14.cjs +2 -2
- package/shared/definition14.js +2 -2
- package/shared/definition15.cjs +8 -9
- package/shared/definition15.js +8 -9
- package/shared/definition16.cjs +3 -3
- package/shared/definition16.js +3 -3
- package/shared/definition17.cjs +2 -2
- package/shared/definition17.js +3 -3
- package/shared/definition18.cjs +3 -3
- package/shared/definition18.js +3 -3
- package/shared/definition19.cjs +3 -3
- package/shared/definition19.js +3 -3
- package/shared/definition20.cjs +186 -227
- package/shared/definition20.js +181 -222
- package/shared/definition21.cjs +264 -67
- package/shared/definition21.js +263 -65
- package/shared/definition22.cjs +66 -57
- package/shared/definition22.js +64 -56
- package/shared/definition23.cjs +42 -76
- package/shared/definition23.js +41 -75
- package/shared/definition24.cjs +70 -2402
- package/shared/definition24.js +69 -2401
- package/shared/definition25.cjs +2402 -46
- package/shared/definition25.js +2401 -45
- package/shared/definition26.cjs +63 -30
- package/shared/definition26.js +62 -29
- package/shared/definition27.cjs +28 -56
- package/shared/definition27.js +27 -55
- package/shared/definition28.cjs +35 -881
- package/shared/definition28.js +34 -879
- package/shared/definition29.cjs +893 -60
- package/shared/definition29.js +893 -61
- package/shared/definition30.cjs +68 -86
- package/shared/definition30.js +67 -85
- package/shared/definition31.cjs +86 -21
- package/shared/definition31.js +86 -21
- package/shared/definition32.cjs +24 -12
- package/shared/definition32.js +23 -11
- package/shared/definition33.cjs +11 -50
- package/shared/definition33.js +10 -49
- package/shared/definition34.cjs +26 -515
- package/shared/definition34.js +26 -515
- package/shared/definition35.cjs +448 -194
- package/shared/definition35.js +448 -192
- package/shared/definition36.cjs +256 -202
- package/shared/definition36.js +253 -201
- package/shared/definition37.cjs +204 -65
- package/shared/definition37.js +203 -63
- package/shared/definition38.cjs +63 -57
- package/shared/definition38.js +60 -55
- package/shared/definition39.cjs +65 -432
- package/shared/definition39.js +64 -431
- package/shared/definition4.cjs +2 -2
- package/shared/definition4.js +2 -2
- package/shared/definition40.cjs +441 -34
- package/shared/definition40.js +438 -31
- package/shared/definition41.cjs +34 -576
- package/shared/definition41.js +33 -575
- package/shared/definition42.cjs +531 -654
- package/shared/definition42.js +531 -654
- package/shared/definition43.cjs +690 -114
- package/shared/definition43.js +689 -113
- package/shared/definition44.cjs +124 -79
- package/shared/definition44.js +122 -77
- package/shared/definition45.cjs +78 -520
- package/shared/definition45.js +77 -518
- package/shared/definition46.cjs +520 -119
- package/shared/definition46.js +518 -118
- package/shared/definition47.cjs +118 -135
- package/shared/definition47.js +117 -134
- package/shared/definition48.cjs +151 -19
- package/shared/definition48.js +150 -18
- package/shared/definition49.cjs +21 -84
- package/shared/definition49.js +20 -83
- package/shared/definition5.cjs +1 -1
- package/shared/definition5.js +1 -1
- package/shared/definition50.cjs +52 -505
- package/shared/definition50.js +51 -504
- package/shared/definition51.cjs +526 -28
- package/shared/definition51.js +525 -27
- package/shared/definition52.cjs +28 -123
- package/shared/definition52.js +26 -122
- package/shared/definition53.cjs +110 -309
- package/shared/definition53.js +110 -308
- package/shared/definition54.cjs +255 -271
- package/shared/definition54.js +255 -271
- package/shared/definition55.cjs +262 -791
- package/shared/definition55.js +261 -790
- package/shared/definition56.cjs +818 -107
- package/shared/definition56.js +817 -106
- package/shared/definition57.cjs +85 -55
- package/shared/definition57.js +84 -54
- package/shared/definition58.cjs +125 -72
- package/shared/definition58.js +124 -71
- package/shared/definition59.cjs +72 -285
- package/shared/definition59.js +73 -286
- package/shared/definition6.cjs +1 -1
- package/shared/definition6.js +1 -1
- package/shared/definition60.cjs +298 -39
- package/shared/definition60.js +297 -38
- package/shared/definition61.cjs +65739 -1688
- package/shared/definition61.js +65738 -1687
- package/shared/definition62.cjs +50 -0
- package/shared/definition62.js +46 -0
- package/shared/definition63.cjs +1828 -0
- package/shared/definition63.js +1824 -0
- package/shared/definition7.cjs +2 -2
- package/shared/definition7.js +2 -2
- package/shared/definition8.cjs +2 -2
- package/shared/definition8.js +2 -2
- package/shared/definition9.cjs +1 -1
- package/shared/definition9.js +1 -1
- package/shared/enums.cjs +8 -0
- package/shared/enums.js +8 -1
- package/shared/index2.cjs +66 -37
- package/shared/index2.js +66 -37
- package/shared/key-codes2.js +1 -1
- package/shared/listbox.cjs +1 -1
- package/shared/listbox.js +1 -1
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/patterns/form-elements/form-elements.d.ts +2 -3
- package/shared/presentationDate.cjs +16 -5
- package/shared/presentationDate.js +16 -5
- package/shared/text-anchor.cjs +6 -0
- package/shared/text-anchor.js +6 -0
- package/shared/text-anchor.template.cjs +6 -1
- package/shared/text-anchor.template.js +6 -1
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/shared/utils/applyMixinsWithObservables.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 +2 -2
- package/split-button/index.js +2 -2
- package/style.css +1 -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/switch/index.cjs +2 -2
- package/switch/index.js +2 -2
- package/tab/index.cjs +2 -2
- package/tab/index.js +2 -2
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +4 -4
- package/tabs/index.js +4 -4
- package/tag/index.cjs +2 -2
- package/tag/index.js +2 -2
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +4 -3
- package/text-area/index.js +4 -3
- package/text-field/index.cjs +4 -3
- package/text-field/index.js +4 -3
- package/time-picker/index.cjs +8 -7
- package/time-picker/index.js +8 -7
- package/toggletip/index.cjs +5 -5
- package/toggletip/index.js +5 -5
- package/tooltip/index.cjs +5 -5
- package/tooltip/index.js +5 -5
- package/tree-item/index.cjs +2 -2
- package/tree-item/index.js +2 -2
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/video-player/index.cjs +17 -0
- package/video-player/index.js +15 -0
- package/vivid.api.json +311 -0
package/shared/definition57.cjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./
|
|
4
|
+
const definition = require('./definition63.cjs');
|
|
5
5
|
const anchored = require('./anchored.cjs');
|
|
6
|
+
const when = require('./when.cjs');
|
|
6
7
|
const classNames = require('./class-names.cjs');
|
|
7
8
|
|
|
8
|
-
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.
|
|
9
|
+
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.content-wrapper{width:var(--toggletip-inline-size, auto);padding:16px}.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}\n";
|
|
9
10
|
|
|
10
11
|
var __defProp = Object.defineProperty;
|
|
11
12
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -35,25 +36,46 @@ var __privateMethod = (obj, member, method) => {
|
|
|
35
36
|
__accessCheck(obj, member, "access private method");
|
|
36
37
|
return method;
|
|
37
38
|
};
|
|
38
|
-
var _setupAnchor, setupAnchor_fn, _cleanupAnchor, cleanupAnchor_fn,
|
|
39
|
-
let
|
|
39
|
+
var _ANCHOR_ARIA_LABEL_SUFFIX, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _openIfClosed, _updateListeners, updateListeners_fn, _closeOnClickOutside, _closeOnEscape;
|
|
40
|
+
let Toggletip = class extends index.FoundationElement {
|
|
40
41
|
constructor() {
|
|
41
42
|
super(...arguments);
|
|
42
43
|
__privateAdd(this, _setupAnchor);
|
|
44
|
+
__privateAdd(this, _updateAnchor);
|
|
43
45
|
__privateAdd(this, _cleanupAnchor);
|
|
44
46
|
__privateAdd(this, _updateListeners);
|
|
47
|
+
__privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
|
|
48
|
+
this.alternate = false;
|
|
49
|
+
this.placement = "right";
|
|
45
50
|
this.open = false;
|
|
46
|
-
__privateAdd(this,
|
|
47
|
-
this.open
|
|
51
|
+
__privateAdd(this, _openIfClosed, () => {
|
|
52
|
+
if (!this.open)
|
|
53
|
+
index.DOM.queueUpdate(() => this.open = true);
|
|
48
54
|
});
|
|
49
|
-
__privateAdd(this,
|
|
50
|
-
|
|
55
|
+
__privateAdd(this, _closeOnClickOutside, (e) => {
|
|
56
|
+
const clickedOutside = !this.contains(e.target);
|
|
57
|
+
const clickedOnAnchor = this._anchorEl?.contains(e.target);
|
|
58
|
+
if (clickedOutside || clickedOnAnchor)
|
|
59
|
+
this.open = false;
|
|
51
60
|
});
|
|
52
61
|
__privateAdd(this, _closeOnEscape, (e) => {
|
|
53
62
|
if (e.key === "Escape")
|
|
54
|
-
|
|
63
|
+
this.open = false;
|
|
55
64
|
});
|
|
56
65
|
}
|
|
66
|
+
openChanged(oldValue, newValue) {
|
|
67
|
+
if (oldValue === void 0)
|
|
68
|
+
return;
|
|
69
|
+
if (newValue) {
|
|
70
|
+
this.setAttribute("role", "status");
|
|
71
|
+
} else {
|
|
72
|
+
this.removeAttribute("role");
|
|
73
|
+
}
|
|
74
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
75
|
+
if (this._anchorEl) {
|
|
76
|
+
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, this._anchorEl);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
57
79
|
connectedCallback() {
|
|
58
80
|
super.connectedCallback();
|
|
59
81
|
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
@@ -71,79 +93,87 @@ let Tooltip = class extends index.FoundationElement {
|
|
|
71
93
|
if (newValue)
|
|
72
94
|
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
73
95
|
}
|
|
74
|
-
/**
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
openChanged(oldValue) {
|
|
78
|
-
if (oldValue === void 0)
|
|
79
|
-
return;
|
|
80
|
-
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
81
|
-
}
|
|
82
96
|
};
|
|
97
|
+
_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
|
|
83
98
|
_setupAnchor = new WeakSet();
|
|
84
99
|
setupAnchor_fn = function(a) {
|
|
85
|
-
a.addEventListener("
|
|
86
|
-
a.
|
|
87
|
-
|
|
88
|
-
|
|
100
|
+
a.addEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
101
|
+
a.ariaLabel = (a.ariaLabel ?? "") + __privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX);
|
|
102
|
+
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
|
|
103
|
+
};
|
|
104
|
+
_updateAnchor = new WeakSet();
|
|
105
|
+
updateAnchor_fn = function(a) {
|
|
106
|
+
a.setAttribute("aria-expanded", this.open.toString());
|
|
89
107
|
};
|
|
90
108
|
_cleanupAnchor = new WeakSet();
|
|
91
109
|
cleanupAnchor_fn = function(a) {
|
|
92
|
-
a.removeEventListener("
|
|
93
|
-
a.
|
|
94
|
-
|
|
95
|
-
a.removeEventListener("focusout", __privateGet(this, _hide));
|
|
110
|
+
a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
111
|
+
if (a.ariaLabel)
|
|
112
|
+
a.ariaLabel = a.ariaLabel.replace(__privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX), "");
|
|
96
113
|
};
|
|
97
|
-
|
|
98
|
-
_hide = new WeakMap();
|
|
114
|
+
_openIfClosed = new WeakMap();
|
|
99
115
|
_updateListeners = new WeakSet();
|
|
100
116
|
updateListeners_fn = function() {
|
|
117
|
+
document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
101
118
|
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
102
119
|
if (this.open && this.isConnected) {
|
|
120
|
+
document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
103
121
|
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
104
122
|
}
|
|
105
123
|
};
|
|
124
|
+
_closeOnClickOutside = new WeakMap();
|
|
106
125
|
_closeOnEscape = new WeakMap();
|
|
107
126
|
__decorateClass([
|
|
108
127
|
index.attr
|
|
109
|
-
],
|
|
128
|
+
], Toggletip.prototype, "headline", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
index.attr({ mode: "boolean" })
|
|
131
|
+
], Toggletip.prototype, "alternate", 2);
|
|
110
132
|
__decorateClass([
|
|
111
133
|
index.attr({ mode: "fromView" })
|
|
112
|
-
],
|
|
134
|
+
], Toggletip.prototype, "placement", 2);
|
|
113
135
|
__decorateClass([
|
|
114
136
|
index.attr({ mode: "boolean" })
|
|
115
|
-
],
|
|
116
|
-
|
|
137
|
+
], Toggletip.prototype, "open", 2);
|
|
138
|
+
Toggletip = __decorateClass([
|
|
117
139
|
anchored.anchored
|
|
118
|
-
],
|
|
140
|
+
], Toggletip);
|
|
119
141
|
|
|
120
|
-
const getClasses = (
|
|
121
|
-
const
|
|
122
|
-
const
|
|
142
|
+
const getClasses = (_) => classNames.classNames("control");
|
|
143
|
+
const ToggletipTemplate = (context) => {
|
|
144
|
+
const popup = context.tagFor(definition.Popup);
|
|
123
145
|
const anchorSlotTemplate = anchored.anchorSlotTemplateFactory();
|
|
124
146
|
return index.html`
|
|
125
|
-
${anchorSlotTemplate}
|
|
126
|
-
<${
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
${anchorSlotTemplate}
|
|
148
|
+
<${popup}
|
|
149
|
+
class="${getClasses}"
|
|
150
|
+
arrow
|
|
151
|
+
:anchor="${(x) => x._anchorEl}"
|
|
152
|
+
:open="${(x) => x.open}"
|
|
153
|
+
?alternate="${(x) => !x.alternate}"
|
|
154
|
+
placement="${(x) => x.placement}"
|
|
155
|
+
exportparts="vvd-theme-alternate"
|
|
156
|
+
>
|
|
157
|
+
<div class="content-wrapper">
|
|
158
|
+
${when.when(
|
|
159
|
+
(x) => x.headline,
|
|
160
|
+
index.html`<header class="headline">${(x) => x.headline}</header>`
|
|
161
|
+
)}
|
|
162
|
+
<slot></slot>
|
|
163
|
+
<footer class="action-items"><slot name="action-items"></slot></footer>
|
|
164
|
+
</div>
|
|
165
|
+
</${popup}>
|
|
166
|
+
`;
|
|
137
167
|
};
|
|
138
168
|
|
|
139
|
-
const
|
|
140
|
-
baseName: "
|
|
141
|
-
template:
|
|
169
|
+
const toggletipDefinition = Toggletip.compose({
|
|
170
|
+
baseName: "toggletip",
|
|
171
|
+
template: ToggletipTemplate,
|
|
142
172
|
styles
|
|
143
173
|
});
|
|
144
|
-
const
|
|
145
|
-
const
|
|
174
|
+
const toggletipRegistries = [toggletipDefinition(), ...definition.popupRegistries];
|
|
175
|
+
const registerToggletip = index.registerFactory(toggletipRegistries);
|
|
146
176
|
|
|
147
|
-
exports.
|
|
148
|
-
exports.
|
|
149
|
-
exports.
|
|
177
|
+
exports.registerToggletip = registerToggletip;
|
|
178
|
+
exports.toggletipDefinition = toggletipDefinition;
|
|
179
|
+
exports.toggletipRegistries = toggletipRegistries;
|
package/shared/definition57.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { a as attr, F as FoundationElement, h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import { P as Popup, p as popupRegistries } from './
|
|
1
|
+
import { a as attr, F as FoundationElement, D as DOM, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { P as Popup, p as popupRegistries } from './definition63.js';
|
|
3
3
|
import { b as anchored, a as anchorSlotTemplateFactory } from './anchored.js';
|
|
4
|
+
import { w as when } from './when.js';
|
|
4
5
|
import { c as classNames } from './class-names.js';
|
|
5
6
|
|
|
6
|
-
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.
|
|
7
|
+
const styles = ":host{display:var(--_popup-display, inline)}:host([slotted-anchor]){--_popup-display: contents}.content-wrapper{width:var(--toggletip-inline-size, auto);padding:16px}.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}\n";
|
|
7
8
|
|
|
8
9
|
var __defProp = Object.defineProperty;
|
|
9
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -33,25 +34,46 @@ var __privateMethod = (obj, member, method) => {
|
|
|
33
34
|
__accessCheck(obj, member, "access private method");
|
|
34
35
|
return method;
|
|
35
36
|
};
|
|
36
|
-
var _setupAnchor, setupAnchor_fn, _cleanupAnchor, cleanupAnchor_fn,
|
|
37
|
-
let
|
|
37
|
+
var _ANCHOR_ARIA_LABEL_SUFFIX, _setupAnchor, setupAnchor_fn, _updateAnchor, updateAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _openIfClosed, _updateListeners, updateListeners_fn, _closeOnClickOutside, _closeOnEscape;
|
|
38
|
+
let Toggletip = class extends FoundationElement {
|
|
38
39
|
constructor() {
|
|
39
40
|
super(...arguments);
|
|
40
41
|
__privateAdd(this, _setupAnchor);
|
|
42
|
+
__privateAdd(this, _updateAnchor);
|
|
41
43
|
__privateAdd(this, _cleanupAnchor);
|
|
42
44
|
__privateAdd(this, _updateListeners);
|
|
45
|
+
__privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
|
|
46
|
+
this.alternate = false;
|
|
47
|
+
this.placement = "right";
|
|
43
48
|
this.open = false;
|
|
44
|
-
__privateAdd(this,
|
|
45
|
-
this.open
|
|
49
|
+
__privateAdd(this, _openIfClosed, () => {
|
|
50
|
+
if (!this.open)
|
|
51
|
+
DOM.queueUpdate(() => this.open = true);
|
|
46
52
|
});
|
|
47
|
-
__privateAdd(this,
|
|
48
|
-
|
|
53
|
+
__privateAdd(this, _closeOnClickOutside, (e) => {
|
|
54
|
+
const clickedOutside = !this.contains(e.target);
|
|
55
|
+
const clickedOnAnchor = this._anchorEl?.contains(e.target);
|
|
56
|
+
if (clickedOutside || clickedOnAnchor)
|
|
57
|
+
this.open = false;
|
|
49
58
|
});
|
|
50
59
|
__privateAdd(this, _closeOnEscape, (e) => {
|
|
51
60
|
if (e.key === "Escape")
|
|
52
|
-
|
|
61
|
+
this.open = false;
|
|
53
62
|
});
|
|
54
63
|
}
|
|
64
|
+
openChanged(oldValue, newValue) {
|
|
65
|
+
if (oldValue === void 0)
|
|
66
|
+
return;
|
|
67
|
+
if (newValue) {
|
|
68
|
+
this.setAttribute("role", "status");
|
|
69
|
+
} else {
|
|
70
|
+
this.removeAttribute("role");
|
|
71
|
+
}
|
|
72
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
73
|
+
if (this._anchorEl) {
|
|
74
|
+
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, this._anchorEl);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
55
77
|
connectedCallback() {
|
|
56
78
|
super.connectedCallback();
|
|
57
79
|
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
@@ -69,77 +91,85 @@ let Tooltip = class extends FoundationElement {
|
|
|
69
91
|
if (newValue)
|
|
70
92
|
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
71
93
|
}
|
|
72
|
-
/**
|
|
73
|
-
* @internal
|
|
74
|
-
*/
|
|
75
|
-
openChanged(oldValue) {
|
|
76
|
-
if (oldValue === void 0)
|
|
77
|
-
return;
|
|
78
|
-
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
79
|
-
}
|
|
80
94
|
};
|
|
95
|
+
_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
|
|
81
96
|
_setupAnchor = new WeakSet();
|
|
82
97
|
setupAnchor_fn = function(a) {
|
|
83
|
-
a.addEventListener("
|
|
84
|
-
a.
|
|
85
|
-
|
|
86
|
-
|
|
98
|
+
a.addEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
99
|
+
a.ariaLabel = (a.ariaLabel ?? "") + __privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX);
|
|
100
|
+
__privateMethod(this, _updateAnchor, updateAnchor_fn).call(this, a);
|
|
101
|
+
};
|
|
102
|
+
_updateAnchor = new WeakSet();
|
|
103
|
+
updateAnchor_fn = function(a) {
|
|
104
|
+
a.setAttribute("aria-expanded", this.open.toString());
|
|
87
105
|
};
|
|
88
106
|
_cleanupAnchor = new WeakSet();
|
|
89
107
|
cleanupAnchor_fn = function(a) {
|
|
90
|
-
a.removeEventListener("
|
|
91
|
-
a.
|
|
92
|
-
|
|
93
|
-
a.removeEventListener("focusout", __privateGet(this, _hide));
|
|
108
|
+
a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
109
|
+
if (a.ariaLabel)
|
|
110
|
+
a.ariaLabel = a.ariaLabel.replace(__privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX), "");
|
|
94
111
|
};
|
|
95
|
-
|
|
96
|
-
_hide = new WeakMap();
|
|
112
|
+
_openIfClosed = new WeakMap();
|
|
97
113
|
_updateListeners = new WeakSet();
|
|
98
114
|
updateListeners_fn = function() {
|
|
115
|
+
document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
99
116
|
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
100
117
|
if (this.open && this.isConnected) {
|
|
118
|
+
document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
101
119
|
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
102
120
|
}
|
|
103
121
|
};
|
|
122
|
+
_closeOnClickOutside = new WeakMap();
|
|
104
123
|
_closeOnEscape = new WeakMap();
|
|
105
124
|
__decorateClass([
|
|
106
125
|
attr
|
|
107
|
-
],
|
|
126
|
+
], Toggletip.prototype, "headline", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
attr({ mode: "boolean" })
|
|
129
|
+
], Toggletip.prototype, "alternate", 2);
|
|
108
130
|
__decorateClass([
|
|
109
131
|
attr({ mode: "fromView" })
|
|
110
|
-
],
|
|
132
|
+
], Toggletip.prototype, "placement", 2);
|
|
111
133
|
__decorateClass([
|
|
112
134
|
attr({ mode: "boolean" })
|
|
113
|
-
],
|
|
114
|
-
|
|
135
|
+
], Toggletip.prototype, "open", 2);
|
|
136
|
+
Toggletip = __decorateClass([
|
|
115
137
|
anchored
|
|
116
|
-
],
|
|
138
|
+
], Toggletip);
|
|
117
139
|
|
|
118
|
-
const getClasses = (
|
|
119
|
-
const
|
|
120
|
-
const
|
|
140
|
+
const getClasses = (_) => classNames("control");
|
|
141
|
+
const ToggletipTemplate = (context) => {
|
|
142
|
+
const popup = context.tagFor(Popup);
|
|
121
143
|
const anchorSlotTemplate = anchorSlotTemplateFactory();
|
|
122
144
|
return html`
|
|
123
|
-
${anchorSlotTemplate}
|
|
124
|
-
<${
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
145
|
+
${anchorSlotTemplate}
|
|
146
|
+
<${popup}
|
|
147
|
+
class="${getClasses}"
|
|
148
|
+
arrow
|
|
149
|
+
:anchor="${(x) => x._anchorEl}"
|
|
150
|
+
:open="${(x) => x.open}"
|
|
151
|
+
?alternate="${(x) => !x.alternate}"
|
|
152
|
+
placement="${(x) => x.placement}"
|
|
153
|
+
exportparts="vvd-theme-alternate"
|
|
154
|
+
>
|
|
155
|
+
<div class="content-wrapper">
|
|
156
|
+
${when(
|
|
157
|
+
(x) => x.headline,
|
|
158
|
+
html`<header class="headline">${(x) => x.headline}</header>`
|
|
159
|
+
)}
|
|
160
|
+
<slot></slot>
|
|
161
|
+
<footer class="action-items"><slot name="action-items"></slot></footer>
|
|
162
|
+
</div>
|
|
163
|
+
</${popup}>
|
|
164
|
+
`;
|
|
135
165
|
};
|
|
136
166
|
|
|
137
|
-
const
|
|
138
|
-
baseName: "
|
|
139
|
-
template:
|
|
167
|
+
const toggletipDefinition = Toggletip.compose({
|
|
168
|
+
baseName: "toggletip",
|
|
169
|
+
template: ToggletipTemplate,
|
|
140
170
|
styles
|
|
141
171
|
});
|
|
142
|
-
const
|
|
143
|
-
const
|
|
172
|
+
const toggletipRegistries = [toggletipDefinition(), ...popupRegistries];
|
|
173
|
+
const registerToggletip = registerFactory(toggletipRegistries);
|
|
144
174
|
|
|
145
|
-
export {
|
|
175
|
+
export { toggletipRegistries as a, registerToggletip as r, toggletipDefinition as t };
|
package/shared/definition58.cjs
CHANGED
|
@@ -1,18 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const index = require('./index.cjs');
|
|
4
|
-
const definition = require('./
|
|
5
|
-
const
|
|
6
|
-
const treeItem = require('./tree-item.cjs');
|
|
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('./definition63.cjs');
|
|
5
|
+
const anchored = require('./anchored.cjs');
|
|
12
6
|
const classNames = require('./class-names.cjs');
|
|
13
|
-
const ref = require('./ref.cjs');
|
|
14
7
|
|
|
15
|
-
const styles = ":host
|
|
8
|
+
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)}.tooltip-text{padding:8px 12px;color:var(--vvd-color-canvas-text);font:var(--vvd-typography-base-bold)}\n";
|
|
16
9
|
|
|
17
10
|
var __defProp = Object.defineProperty;
|
|
18
11
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -25,72 +18,132 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
25
18
|
__defProp(target, key, result);
|
|
26
19
|
return result;
|
|
27
20
|
};
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
var __accessCheck = (obj, member, msg) => {
|
|
22
|
+
if (!member.has(obj))
|
|
23
|
+
throw TypeError("Cannot " + msg);
|
|
24
|
+
};
|
|
25
|
+
var __privateGet = (obj, member, getter) => {
|
|
26
|
+
__accessCheck(obj, member, "read from private field");
|
|
27
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
28
|
+
};
|
|
29
|
+
var __privateAdd = (obj, member, value) => {
|
|
30
|
+
if (member.has(obj))
|
|
31
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
32
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
33
|
+
};
|
|
34
|
+
var __privateMethod = (obj, member, method) => {
|
|
35
|
+
__accessCheck(obj, member, "access private method");
|
|
36
|
+
return method;
|
|
37
|
+
};
|
|
38
|
+
var _setupAnchor, setupAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _show, _hide, _updateListeners, updateListeners_fn, _closeOnEscape;
|
|
39
|
+
let Tooltip = class extends index.FoundationElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
__privateAdd(this, _setupAnchor);
|
|
43
|
+
__privateAdd(this, _cleanupAnchor);
|
|
44
|
+
__privateAdd(this, _updateListeners);
|
|
45
|
+
this.open = false;
|
|
46
|
+
__privateAdd(this, _show, () => {
|
|
47
|
+
this.open = true;
|
|
48
|
+
});
|
|
49
|
+
__privateAdd(this, _hide, () => {
|
|
50
|
+
this.open = false;
|
|
51
|
+
});
|
|
52
|
+
__privateAdd(this, _closeOnEscape, (e) => {
|
|
53
|
+
if (e.key === "Escape")
|
|
54
|
+
__privateGet(this, _hide).call(this);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
connectedCallback() {
|
|
58
|
+
super.connectedCallback();
|
|
59
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
60
|
+
}
|
|
61
|
+
disconnectedCallback() {
|
|
62
|
+
super.disconnectedCallback();
|
|
63
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* @internal
|
|
67
|
+
*/
|
|
68
|
+
_anchorElChanged(oldValue, newValue) {
|
|
69
|
+
if (oldValue)
|
|
70
|
+
__privateMethod(this, _cleanupAnchor, cleanupAnchor_fn).call(this, oldValue);
|
|
71
|
+
if (newValue)
|
|
72
|
+
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @internal
|
|
76
|
+
*/
|
|
77
|
+
openChanged(oldValue) {
|
|
78
|
+
if (oldValue === void 0)
|
|
79
|
+
return;
|
|
80
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
_setupAnchor = new WeakSet();
|
|
84
|
+
setupAnchor_fn = function(a) {
|
|
85
|
+
a.addEventListener("mouseover", __privateGet(this, _show));
|
|
86
|
+
a.addEventListener("mouseout", __privateGet(this, _hide));
|
|
87
|
+
a.addEventListener("focusin", __privateGet(this, _show));
|
|
88
|
+
a.addEventListener("focusout", __privateGet(this, _hide));
|
|
89
|
+
};
|
|
90
|
+
_cleanupAnchor = new WeakSet();
|
|
91
|
+
cleanupAnchor_fn = function(a) {
|
|
92
|
+
a.removeEventListener("mouseover", __privateGet(this, _show));
|
|
93
|
+
a.removeEventListener("mouseout", __privateGet(this, _hide));
|
|
94
|
+
a.removeEventListener("focusin", __privateGet(this, _show));
|
|
95
|
+
a.removeEventListener("focusout", __privateGet(this, _hide));
|
|
96
|
+
};
|
|
97
|
+
_show = new WeakMap();
|
|
98
|
+
_hide = new WeakMap();
|
|
99
|
+
_updateListeners = new WeakSet();
|
|
100
|
+
updateListeners_fn = function() {
|
|
101
|
+
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
102
|
+
if (this.open && this.isConnected) {
|
|
103
|
+
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
_closeOnEscape = new WeakMap();
|
|
30
107
|
__decorateClass([
|
|
31
108
|
index.attr
|
|
32
|
-
],
|
|
33
|
-
|
|
109
|
+
], Tooltip.prototype, "text", 2);
|
|
110
|
+
__decorateClass([
|
|
111
|
+
index.attr({ mode: "fromView" })
|
|
112
|
+
], Tooltip.prototype, "placement", 2);
|
|
113
|
+
__decorateClass([
|
|
114
|
+
index.attr({ mode: "boolean" })
|
|
115
|
+
], Tooltip.prototype, "open", 2);
|
|
116
|
+
Tooltip = __decorateClass([
|
|
117
|
+
anchored.anchored
|
|
118
|
+
], Tooltip);
|
|
34
119
|
|
|
35
|
-
const getClasses = ({
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
);
|
|
40
|
-
const expandCollapseButton = (context) => {
|
|
41
|
-
const iconTag = context.tagFor(icon.Icon);
|
|
120
|
+
const getClasses = ({ open }) => classNames.classNames("control", ["open", Boolean(open)]);
|
|
121
|
+
const TooltipTemplate = (context) => {
|
|
122
|
+
const popupTag = context.tagFor(definition.Popup);
|
|
123
|
+
const anchorSlotTemplate = anchored.anchorSlotTemplateFactory();
|
|
42
124
|
return index.html`
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
slot="${(x) => x.isNestedItem() ? "item" : void 0}"
|
|
56
|
-
tabindex="-1"
|
|
57
|
-
aria-expanded="${(x) => x.childItems && x.childItems.length > 0 ? x.expanded : void 0}"
|
|
58
|
-
aria-selected="${(x) => x.selected}"
|
|
59
|
-
aria-disabled="${(x) => x.disabled}"
|
|
60
|
-
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
61
|
-
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
62
|
-
${children.children({
|
|
63
|
-
property: "childItems",
|
|
64
|
-
filter: slotted.elements(context.tagFor(TreeItem))
|
|
65
|
-
})}
|
|
66
|
-
>
|
|
67
|
-
<div class="${getClasses}">
|
|
68
|
-
${when.when(
|
|
69
|
-
(x) => x.childItems && x.childItems.length > 0,
|
|
70
|
-
expandCollapseButton(context)
|
|
71
|
-
)}
|
|
72
|
-
${(x) => affixIconTemplate(x.icon, affix.IconWrapper.Slot)}
|
|
73
|
-
${(x) => x.text}
|
|
74
|
-
</div>
|
|
75
|
-
${when.when(
|
|
76
|
-
(x) => x.childItems && x.childItems.length > 0 && x.expanded,
|
|
77
|
-
index.html` <div role="group" class="items">
|
|
78
|
-
<slot name="item" ${slotted.slotted("items")}></slot>
|
|
79
|
-
</div>`
|
|
80
|
-
)}
|
|
81
|
-
</template>`;
|
|
125
|
+
${anchorSlotTemplate}
|
|
126
|
+
<${popupTag} class="${getClasses}" arrow alternate
|
|
127
|
+
:placement=${(x) => x.placement}
|
|
128
|
+
:anchor="${(x) => x._anchorEl}"
|
|
129
|
+
:open=${(x) => x.open}
|
|
130
|
+
exportparts="vvd-theme-alternate">
|
|
131
|
+
<div class="tooltip" role="tooltip">
|
|
132
|
+
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
133
|
+
<div class="tooltip-text">${(x) => x.text}</div>
|
|
134
|
+
</header>
|
|
135
|
+
</div>
|
|
136
|
+
</${popupTag}>`;
|
|
82
137
|
};
|
|
83
138
|
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
);
|
|
91
|
-
const treeItemRegistries = [treeItemDefinition(), ...definition.iconRegistries];
|
|
92
|
-
const registerTreeItem = index.registerFactory(treeItemRegistries);
|
|
139
|
+
const tooltipDefinition = Tooltip.compose({
|
|
140
|
+
baseName: "tooltip",
|
|
141
|
+
template: TooltipTemplate,
|
|
142
|
+
styles
|
|
143
|
+
});
|
|
144
|
+
const tooltipRegistries = [tooltipDefinition(), ...definition.popupRegistries];
|
|
145
|
+
const registerTooltip = index.registerFactory(tooltipRegistries);
|
|
93
146
|
|
|
94
|
-
exports.
|
|
95
|
-
exports.
|
|
96
|
-
exports.
|
|
147
|
+
exports.registerTooltip = registerTooltip;
|
|
148
|
+
exports.tooltipDefinition = tooltipDefinition;
|
|
149
|
+
exports.tooltipRegistries = tooltipRegistries;
|