@vonage/vivid 3.51.0 → 3.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/alert/index.cjs +1 -1
- package/alert/index.js +1 -1
- package/appearance-ui/index.cjs +19 -11
- package/appearance-ui/index.js +19 -11
- package/audio-player/index.cjs +2 -1
- package/audio-player/index.js +2 -1
- package/card/index.cjs +1 -1
- package/card/index.js +1 -1
- package/combobox/index.cjs +2 -5
- package/combobox/index.js +2 -5
- package/custom-elements.json +1357 -529
- package/date-picker/index.cjs +3 -6
- package/date-picker/index.js +3 -6
- package/date-range-picker/index.cjs +2 -5
- package/date-range-picker/index.js +2 -5
- package/dialog/index.cjs +1 -1
- package/dialog/index.js +1 -1
- package/elevation/index.cjs +1 -1
- package/elevation/index.js +1 -1
- package/file-picker/index.cjs +0 -2
- package/file-picker/index.js +0 -2
- package/header/index.cjs +1 -1
- package/header/index.js +1 -1
- package/index.cjs +60 -58
- package/index.js +22 -23
- package/lib/avatar/definition.d.ts +1 -1
- package/lib/button/button.d.ts +1 -0
- package/lib/button/definition.d.ts +1 -1
- package/lib/calendar-event/definition.d.ts +1 -1
- package/lib/components.d.ts +1 -0
- package/lib/layout/definition.d.ts +1 -1
- package/lib/menu-item/menu-item.d.ts +3 -0
- package/lib/range-slider/definition.d.ts +3 -0
- package/lib/range-slider/locale.d.ts +4 -0
- package/lib/range-slider/range-slider.d.ts +32 -0
- package/lib/range-slider/range-slider.form-associated.d.ts +10 -0
- package/lib/range-slider/range-slider.template.d.ts +4 -0
- package/lib/range-slider/utils/lerp.d.ts +2 -0
- package/lib/range-slider/utils/roundToStepValue.d.ts +1 -0
- package/lib/slider/slider.template.d.ts +1 -0
- package/lib/split-button/definition.d.ts +1 -1
- package/listbox/index.cjs +23 -22
- package/listbox/index.js +23 -22
- package/locales/en-GB.cjs +4 -0
- package/locales/en-GB.js +4 -0
- package/locales/en-US.cjs +4 -0
- package/locales/en-US.js +4 -0
- package/locales/ja-JP.cjs +5 -1
- package/locales/ja-JP.js +5 -1
- package/locales/zh-CN.cjs +4 -0
- package/locales/zh-CN.js +4 -0
- package/menu/index.cjs +3 -3
- package/menu/index.js +3 -3
- package/menu-item/index.cjs +2 -2
- package/menu-item/index.js +2 -2
- package/number-field/index.cjs +0 -2
- package/number-field/index.js +0 -2
- package/package.json +34 -34
- package/popup/index.cjs +2 -2
- package/popup/index.js +2 -2
- package/range-slider/index.cjs +22 -0
- package/range-slider/index.js +20 -0
- package/select/index.cjs +3 -3
- package/select/index.js +3 -3
- package/selectable-box/index.cjs +1 -1
- package/selectable-box/index.js +1 -1
- package/shared/Reflector.cjs +5 -1
- package/shared/Reflector.js +5 -1
- package/shared/affix.cjs +11 -4
- package/shared/affix.js +12 -4
- package/shared/anchored.cjs +8 -2
- package/shared/anchored.js +8 -2
- package/shared/definition.cjs +8 -3
- package/shared/definition.js +8 -3
- package/shared/definition10.cjs +5 -5
- package/shared/definition10.js +5 -5
- package/shared/definition11.cjs +75 -47
- package/shared/definition11.js +76 -48
- package/shared/definition12.cjs +12 -14
- package/shared/definition12.js +12 -14
- package/shared/definition13.cjs +118 -75
- package/shared/definition13.js +118 -75
- package/shared/definition14.cjs +33 -32
- package/shared/definition14.js +33 -32
- package/shared/definition15.cjs +20 -7
- package/shared/definition15.js +20 -7
- package/shared/definition16.cjs +37 -42
- package/shared/definition16.js +36 -41
- package/shared/definition17.cjs +125 -65
- package/shared/definition17.js +126 -66
- package/shared/definition18.cjs +30 -14
- package/shared/definition18.js +30 -14
- package/shared/definition19.cjs +116 -80
- package/shared/definition19.js +116 -80
- package/shared/definition2.cjs +10 -5
- package/shared/definition2.js +10 -5
- package/shared/definition20.cjs +16 -15
- package/shared/definition20.js +16 -15
- package/shared/definition21.cjs +6 -10
- package/shared/definition21.js +6 -10
- package/shared/definition22.cjs +14 -18
- package/shared/definition22.js +14 -18
- package/shared/definition23.cjs +34 -35
- package/shared/definition23.js +34 -35
- package/shared/definition24.cjs +116 -69
- package/shared/definition24.js +116 -69
- package/shared/definition25.cjs +2 -4
- package/shared/definition25.js +2 -4
- package/shared/definition26.cjs +9 -8
- package/shared/definition26.js +9 -8
- package/shared/definition27.cjs +7 -5
- package/shared/definition27.js +7 -5
- package/shared/definition28.cjs +209 -143
- package/shared/definition28.js +209 -143
- package/shared/definition29.cjs +10 -4
- package/shared/definition29.js +10 -4
- package/shared/definition3.cjs +7 -10
- package/shared/definition3.js +7 -10
- package/shared/definition30.cjs +7 -5
- package/shared/definition30.js +7 -5
- package/shared/definition31.cjs +2 -4
- package/shared/definition31.js +2 -4
- package/shared/definition32.cjs +1 -3
- package/shared/definition32.js +1 -3
- package/shared/definition33.cjs +7 -10
- package/shared/definition33.js +7 -10
- package/shared/definition34.cjs +76 -59
- package/shared/definition34.js +76 -59
- package/shared/definition35.cjs +19 -20
- package/shared/definition35.js +19 -20
- package/shared/definition36.cjs +30 -14
- package/shared/definition36.js +30 -14
- package/shared/definition37.cjs +33 -46
- package/shared/definition37.js +33 -46
- package/shared/definition38.cjs +31 -33
- package/shared/definition38.js +31 -33
- package/shared/definition39.cjs +13 -4
- package/shared/definition39.js +13 -4
- package/shared/definition4.cjs +23 -11
- package/shared/definition4.js +23 -11
- package/shared/definition40.cjs +19 -14
- package/shared/definition40.js +19 -14
- package/shared/definition41.cjs +534 -635
- package/shared/definition41.js +534 -635
- package/shared/definition42.cjs +674 -106
- package/shared/definition42.js +673 -105
- package/shared/definition43.cjs +122 -79
- package/shared/definition43.js +120 -77
- package/shared/definition44.cjs +72 -567
- package/shared/definition44.js +71 -565
- package/shared/definition45.cjs +520 -118
- package/shared/definition45.js +518 -117
- package/shared/definition46.cjs +117 -130
- package/shared/definition46.js +116 -129
- package/shared/definition47.cjs +152 -18
- package/shared/definition47.js +151 -17
- package/shared/definition48.cjs +20 -77
- package/shared/definition48.js +19 -76
- package/shared/definition49.cjs +52 -495
- package/shared/definition49.js +51 -494
- package/shared/definition5.cjs +20 -17
- package/shared/definition5.js +20 -17
- package/shared/definition50.cjs +525 -24
- package/shared/definition50.js +524 -23
- package/shared/definition51.cjs +28 -119
- package/shared/definition51.js +26 -118
- package/shared/definition52.cjs +113 -266
- package/shared/definition52.js +113 -265
- package/shared/definition53.cjs +285 -245
- package/shared/definition53.js +285 -245
- package/shared/definition54.cjs +285 -751
- package/shared/definition54.js +284 -750
- package/shared/definition55.cjs +828 -99
- package/shared/definition55.js +827 -98
- package/shared/definition56.cjs +126 -77
- package/shared/definition56.js +125 -76
- package/shared/definition57.cjs +125 -71
- package/shared/definition57.js +124 -70
- package/shared/definition58.cjs +73 -287
- package/shared/definition58.js +74 -288
- package/shared/definition59.cjs +298 -40
- package/shared/definition59.js +297 -39
- package/shared/definition6.cjs +3 -4
- package/shared/definition6.js +3 -4
- package/shared/definition60.cjs +24 -1784
- package/shared/definition60.js +23 -1783
- package/shared/definition61.cjs +1819 -11
- package/shared/definition61.js +1818 -11
- package/shared/definition7.cjs +6 -4
- package/shared/definition7.js +6 -4
- package/shared/definition8.cjs +25 -18
- package/shared/definition8.js +25 -18
- package/shared/definition9.cjs +6 -9
- package/shared/definition9.js +6 -9
- package/shared/icon.cjs +7 -2
- package/shared/icon.js +7 -2
- package/shared/index2.cjs +1 -1
- package/shared/index2.js +1 -1
- package/shared/key-codes2.cjs +8 -0
- package/shared/key-codes2.js +5 -1
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/patterns/index.d.ts +0 -1
- package/shared/presentationDate.cjs +126 -78
- package/shared/presentationDate.js +126 -78
- package/shared/slider.template.cjs +71 -0
- package/shared/slider.template.js +67 -0
- package/shared/text-anchor.template.cjs +30 -35
- package/shared/text-anchor.template.js +30 -35
- package/shared/text-field.cjs +1 -1
- package/shared/text-field.js +1 -1
- package/side-drawer/index.cjs +1 -1
- package/side-drawer/index.js +1 -1
- package/slider/index.cjs +2 -1
- package/slider/index.js +2 -1
- package/split-button/index.cjs +1 -1
- package/split-button/index.js +1 -1
- package/styles/core/all.css +1 -1
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +1 -1
- package/styles/fonts/spezia-variable.css +39 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +4 -2
- package/switch/index.cjs +1 -1
- package/switch/index.js +1 -1
- package/tab/index.cjs +1 -1
- package/tab/index.js +1 -1
- package/tab-panel/index.cjs +1 -1
- package/tab-panel/index.js +1 -1
- package/tabs/index.cjs +3 -3
- package/tabs/index.js +3 -3
- package/tag/index.cjs +1 -1
- package/tag/index.js +1 -1
- package/tag-group/index.cjs +1 -1
- package/tag-group/index.js +1 -1
- package/text-area/index.cjs +1 -1
- package/text-area/index.js +1 -1
- package/text-field/index.cjs +1 -4
- package/text-field/index.js +1 -4
- package/time-picker/index.cjs +4 -7
- package/time-picker/index.js +4 -7
- package/toggletip/index.cjs +3 -3
- package/toggletip/index.js +3 -3
- package/tooltip/index.cjs +3 -3
- package/tooltip/index.js +3 -3
- package/tree-item/index.cjs +1 -1
- package/tree-item/index.js +1 -1
- package/tree-view/index.cjs +1 -1
- package/tree-view/index.js +1 -1
- package/vivid.api.json +117 -1
- package/focus/index.cjs +0 -7
- package/focus/index.js +0 -5
- package/lib/focus/definition.d.ts +0 -3
- package/lib/focus/focus.d.ts +0 -3
- package/lib/focus/focus.template.d.ts +0 -4
- package/lib/popup/popup.d.ts +0 -21
- package/shared/focus.cjs +0 -8
- package/shared/focus.js +0 -6
- package/shared/focus2.cjs +0 -11
- package/shared/focus2.js +0 -9
- package/shared/patterns/focus.d.ts +0 -3
package/shared/definition56.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('./definition61.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;
|
|
@@ -18,113 +19,161 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
18
19
|
__defProp(target, key, result);
|
|
19
20
|
return result;
|
|
20
21
|
};
|
|
21
|
-
|
|
22
|
+
var __accessCheck = (obj, member, msg) => {
|
|
23
|
+
if (!member.has(obj))
|
|
24
|
+
throw TypeError("Cannot " + msg);
|
|
25
|
+
};
|
|
26
|
+
var __privateGet = (obj, member, getter) => {
|
|
27
|
+
__accessCheck(obj, member, "read from private field");
|
|
28
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
29
|
+
};
|
|
30
|
+
var __privateAdd = (obj, member, value) => {
|
|
31
|
+
if (member.has(obj))
|
|
32
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
33
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
34
|
+
};
|
|
35
|
+
var __privateMethod = (obj, member, method) => {
|
|
36
|
+
__accessCheck(obj, member, "access private method");
|
|
37
|
+
return method;
|
|
38
|
+
};
|
|
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 {
|
|
22
41
|
constructor() {
|
|
23
42
|
super(...arguments);
|
|
43
|
+
__privateAdd(this, _setupAnchor);
|
|
44
|
+
__privateAdd(this, _updateAnchor);
|
|
45
|
+
__privateAdd(this, _cleanupAnchor);
|
|
46
|
+
__privateAdd(this, _updateListeners);
|
|
47
|
+
__privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
|
|
48
|
+
this.alternate = false;
|
|
49
|
+
this.placement = "right";
|
|
24
50
|
this.open = false;
|
|
25
|
-
this
|
|
26
|
-
this.open
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
51
|
+
__privateAdd(this, _openIfClosed, () => {
|
|
52
|
+
if (!this.open)
|
|
53
|
+
index.DOM.queueUpdate(() => this.open = true);
|
|
54
|
+
});
|
|
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;
|
|
60
|
+
});
|
|
61
|
+
__privateAdd(this, _closeOnEscape, (e) => {
|
|
32
62
|
if (e.key === "Escape")
|
|
33
|
-
this
|
|
34
|
-
};
|
|
63
|
+
this.open = false;
|
|
64
|
+
});
|
|
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
|
+
}
|
|
35
78
|
}
|
|
36
79
|
connectedCallback() {
|
|
37
80
|
super.connectedCallback();
|
|
38
|
-
this
|
|
81
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
39
82
|
}
|
|
40
83
|
disconnectedCallback() {
|
|
41
84
|
super.disconnectedCallback();
|
|
42
|
-
this
|
|
85
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
43
86
|
}
|
|
44
87
|
/**
|
|
45
88
|
* @internal
|
|
46
89
|
*/
|
|
47
90
|
_anchorElChanged(oldValue, newValue) {
|
|
48
91
|
if (oldValue)
|
|
49
|
-
this
|
|
92
|
+
__privateMethod(this, _cleanupAnchor, cleanupAnchor_fn).call(this, oldValue);
|
|
50
93
|
if (newValue)
|
|
51
|
-
this
|
|
52
|
-
}
|
|
53
|
-
#setupAnchor(a) {
|
|
54
|
-
a.addEventListener("mouseover", this.#show);
|
|
55
|
-
a.addEventListener("mouseout", this.#hide);
|
|
56
|
-
a.addEventListener("focusin", this.#show);
|
|
57
|
-
a.addEventListener("focusout", this.#hide);
|
|
58
|
-
}
|
|
59
|
-
#cleanupAnchor(a) {
|
|
60
|
-
a.removeEventListener("mouseover", this.#show);
|
|
61
|
-
a.removeEventListener("mouseout", this.#hide);
|
|
62
|
-
a.removeEventListener("focusin", this.#show);
|
|
63
|
-
a.removeEventListener("focusout", this.#hide);
|
|
64
|
-
}
|
|
65
|
-
#show;
|
|
66
|
-
#hide;
|
|
67
|
-
#updateListeners() {
|
|
68
|
-
document.removeEventListener("keydown", this.#closeOnEscape);
|
|
69
|
-
if (this.open && this.isConnected) {
|
|
70
|
-
document.addEventListener("keydown", this.#closeOnEscape);
|
|
71
|
-
}
|
|
94
|
+
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
72
95
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
};
|
|
97
|
+
_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
|
|
98
|
+
_setupAnchor = new WeakSet();
|
|
99
|
+
setupAnchor_fn = function(a) {
|
|
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());
|
|
107
|
+
};
|
|
108
|
+
_cleanupAnchor = new WeakSet();
|
|
109
|
+
cleanupAnchor_fn = function(a) {
|
|
110
|
+
a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
111
|
+
if (a.ariaLabel)
|
|
112
|
+
a.ariaLabel = a.ariaLabel.replace(__privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX), "");
|
|
113
|
+
};
|
|
114
|
+
_openIfClosed = new WeakMap();
|
|
115
|
+
_updateListeners = new WeakSet();
|
|
116
|
+
updateListeners_fn = function() {
|
|
117
|
+
document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
118
|
+
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
119
|
+
if (this.open && this.isConnected) {
|
|
120
|
+
document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
121
|
+
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
81
122
|
}
|
|
82
123
|
};
|
|
124
|
+
_closeOnClickOutside = new WeakMap();
|
|
125
|
+
_closeOnEscape = new WeakMap();
|
|
83
126
|
__decorateClass([
|
|
84
127
|
index.attr
|
|
85
|
-
],
|
|
128
|
+
], Toggletip.prototype, "headline", 2);
|
|
129
|
+
__decorateClass([
|
|
130
|
+
index.attr({ mode: "boolean" })
|
|
131
|
+
], Toggletip.prototype, "alternate", 2);
|
|
86
132
|
__decorateClass([
|
|
87
133
|
index.attr({ mode: "fromView" })
|
|
88
|
-
],
|
|
134
|
+
], Toggletip.prototype, "placement", 2);
|
|
89
135
|
__decorateClass([
|
|
90
136
|
index.attr({ mode: "boolean" })
|
|
91
|
-
],
|
|
92
|
-
|
|
137
|
+
], Toggletip.prototype, "open", 2);
|
|
138
|
+
Toggletip = __decorateClass([
|
|
93
139
|
anchored.anchored
|
|
94
|
-
],
|
|
140
|
+
], Toggletip);
|
|
95
141
|
|
|
96
|
-
const getClasses = (
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"control",
|
|
100
|
-
["open", Boolean(open)]
|
|
101
|
-
);
|
|
102
|
-
const TooltipTemplate = (context) => {
|
|
103
|
-
const popupTag = context.tagFor(definition.Popup);
|
|
142
|
+
const getClasses = (_) => classNames.classNames("control");
|
|
143
|
+
const ToggletipTemplate = (context) => {
|
|
144
|
+
const popup = context.tagFor(definition.Popup);
|
|
104
145
|
const anchorSlotTemplate = anchored.anchorSlotTemplateFactory();
|
|
105
146
|
return index.html`
|
|
106
|
-
${anchorSlotTemplate}
|
|
107
|
-
<${
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
+
`;
|
|
118
167
|
};
|
|
119
168
|
|
|
120
|
-
const
|
|
121
|
-
baseName: "
|
|
122
|
-
template:
|
|
169
|
+
const toggletipDefinition = Toggletip.compose({
|
|
170
|
+
baseName: "toggletip",
|
|
171
|
+
template: ToggletipTemplate,
|
|
123
172
|
styles
|
|
124
173
|
});
|
|
125
|
-
const
|
|
126
|
-
const
|
|
174
|
+
const toggletipRegistries = [toggletipDefinition(), ...definition.popupRegistries];
|
|
175
|
+
const registerToggletip = index.registerFactory(toggletipRegistries);
|
|
127
176
|
|
|
128
|
-
exports.
|
|
129
|
-
exports.
|
|
130
|
-
exports.
|
|
177
|
+
exports.registerToggletip = registerToggletip;
|
|
178
|
+
exports.toggletipDefinition = toggletipDefinition;
|
|
179
|
+
exports.toggletipRegistries = toggletipRegistries;
|
package/shared/definition56.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 './definition61.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;
|
|
@@ -16,111 +17,159 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
16
17
|
__defProp(target, key, result);
|
|
17
18
|
return result;
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
var __accessCheck = (obj, member, msg) => {
|
|
21
|
+
if (!member.has(obj))
|
|
22
|
+
throw TypeError("Cannot " + msg);
|
|
23
|
+
};
|
|
24
|
+
var __privateGet = (obj, member, getter) => {
|
|
25
|
+
__accessCheck(obj, member, "read from private field");
|
|
26
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
27
|
+
};
|
|
28
|
+
var __privateAdd = (obj, member, value) => {
|
|
29
|
+
if (member.has(obj))
|
|
30
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
31
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
32
|
+
};
|
|
33
|
+
var __privateMethod = (obj, member, method) => {
|
|
34
|
+
__accessCheck(obj, member, "access private method");
|
|
35
|
+
return method;
|
|
36
|
+
};
|
|
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 {
|
|
20
39
|
constructor() {
|
|
21
40
|
super(...arguments);
|
|
41
|
+
__privateAdd(this, _setupAnchor);
|
|
42
|
+
__privateAdd(this, _updateAnchor);
|
|
43
|
+
__privateAdd(this, _cleanupAnchor);
|
|
44
|
+
__privateAdd(this, _updateListeners);
|
|
45
|
+
__privateAdd(this, _ANCHOR_ARIA_LABEL_SUFFIX, " ; Show more information");
|
|
46
|
+
this.alternate = false;
|
|
47
|
+
this.placement = "right";
|
|
22
48
|
this.open = false;
|
|
23
|
-
this
|
|
24
|
-
this.open
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
49
|
+
__privateAdd(this, _openIfClosed, () => {
|
|
50
|
+
if (!this.open)
|
|
51
|
+
DOM.queueUpdate(() => this.open = true);
|
|
52
|
+
});
|
|
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;
|
|
58
|
+
});
|
|
59
|
+
__privateAdd(this, _closeOnEscape, (e) => {
|
|
30
60
|
if (e.key === "Escape")
|
|
31
|
-
this
|
|
32
|
-
};
|
|
61
|
+
this.open = false;
|
|
62
|
+
});
|
|
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
|
+
}
|
|
33
76
|
}
|
|
34
77
|
connectedCallback() {
|
|
35
78
|
super.connectedCallback();
|
|
36
|
-
this
|
|
79
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
37
80
|
}
|
|
38
81
|
disconnectedCallback() {
|
|
39
82
|
super.disconnectedCallback();
|
|
40
|
-
this
|
|
83
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
41
84
|
}
|
|
42
85
|
/**
|
|
43
86
|
* @internal
|
|
44
87
|
*/
|
|
45
88
|
_anchorElChanged(oldValue, newValue) {
|
|
46
89
|
if (oldValue)
|
|
47
|
-
this
|
|
90
|
+
__privateMethod(this, _cleanupAnchor, cleanupAnchor_fn).call(this, oldValue);
|
|
48
91
|
if (newValue)
|
|
49
|
-
this
|
|
50
|
-
}
|
|
51
|
-
#setupAnchor(a) {
|
|
52
|
-
a.addEventListener("mouseover", this.#show);
|
|
53
|
-
a.addEventListener("mouseout", this.#hide);
|
|
54
|
-
a.addEventListener("focusin", this.#show);
|
|
55
|
-
a.addEventListener("focusout", this.#hide);
|
|
56
|
-
}
|
|
57
|
-
#cleanupAnchor(a) {
|
|
58
|
-
a.removeEventListener("mouseover", this.#show);
|
|
59
|
-
a.removeEventListener("mouseout", this.#hide);
|
|
60
|
-
a.removeEventListener("focusin", this.#show);
|
|
61
|
-
a.removeEventListener("focusout", this.#hide);
|
|
62
|
-
}
|
|
63
|
-
#show;
|
|
64
|
-
#hide;
|
|
65
|
-
#updateListeners() {
|
|
66
|
-
document.removeEventListener("keydown", this.#closeOnEscape);
|
|
67
|
-
if (this.open && this.isConnected) {
|
|
68
|
-
document.addEventListener("keydown", this.#closeOnEscape);
|
|
69
|
-
}
|
|
92
|
+
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
70
93
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
94
|
+
};
|
|
95
|
+
_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap();
|
|
96
|
+
_setupAnchor = new WeakSet();
|
|
97
|
+
setupAnchor_fn = function(a) {
|
|
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());
|
|
105
|
+
};
|
|
106
|
+
_cleanupAnchor = new WeakSet();
|
|
107
|
+
cleanupAnchor_fn = function(a) {
|
|
108
|
+
a.removeEventListener("click", __privateGet(this, _openIfClosed), true);
|
|
109
|
+
if (a.ariaLabel)
|
|
110
|
+
a.ariaLabel = a.ariaLabel.replace(__privateGet(this, _ANCHOR_ARIA_LABEL_SUFFIX), "");
|
|
111
|
+
};
|
|
112
|
+
_openIfClosed = new WeakMap();
|
|
113
|
+
_updateListeners = new WeakSet();
|
|
114
|
+
updateListeners_fn = function() {
|
|
115
|
+
document.removeEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
116
|
+
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
117
|
+
if (this.open && this.isConnected) {
|
|
118
|
+
document.addEventListener("click", __privateGet(this, _closeOnClickOutside));
|
|
119
|
+
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
79
120
|
}
|
|
80
121
|
};
|
|
122
|
+
_closeOnClickOutside = new WeakMap();
|
|
123
|
+
_closeOnEscape = new WeakMap();
|
|
81
124
|
__decorateClass([
|
|
82
125
|
attr
|
|
83
|
-
],
|
|
126
|
+
], Toggletip.prototype, "headline", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
attr({ mode: "boolean" })
|
|
129
|
+
], Toggletip.prototype, "alternate", 2);
|
|
84
130
|
__decorateClass([
|
|
85
131
|
attr({ mode: "fromView" })
|
|
86
|
-
],
|
|
132
|
+
], Toggletip.prototype, "placement", 2);
|
|
87
133
|
__decorateClass([
|
|
88
134
|
attr({ mode: "boolean" })
|
|
89
|
-
],
|
|
90
|
-
|
|
135
|
+
], Toggletip.prototype, "open", 2);
|
|
136
|
+
Toggletip = __decorateClass([
|
|
91
137
|
anchored
|
|
92
|
-
],
|
|
138
|
+
], Toggletip);
|
|
93
139
|
|
|
94
|
-
const getClasses = (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"control",
|
|
98
|
-
["open", Boolean(open)]
|
|
99
|
-
);
|
|
100
|
-
const TooltipTemplate = (context) => {
|
|
101
|
-
const popupTag = context.tagFor(Popup);
|
|
140
|
+
const getClasses = (_) => classNames("control");
|
|
141
|
+
const ToggletipTemplate = (context) => {
|
|
142
|
+
const popup = context.tagFor(Popup);
|
|
102
143
|
const anchorSlotTemplate = anchorSlotTemplateFactory();
|
|
103
144
|
return html`
|
|
104
|
-
${anchorSlotTemplate}
|
|
105
|
-
<${
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
+
`;
|
|
116
165
|
};
|
|
117
166
|
|
|
118
|
-
const
|
|
119
|
-
baseName: "
|
|
120
|
-
template:
|
|
167
|
+
const toggletipDefinition = Toggletip.compose({
|
|
168
|
+
baseName: "toggletip",
|
|
169
|
+
template: ToggletipTemplate,
|
|
121
170
|
styles
|
|
122
171
|
});
|
|
123
|
-
const
|
|
124
|
-
const
|
|
172
|
+
const toggletipRegistries = [toggletipDefinition(), ...popupRegistries];
|
|
173
|
+
const registerToggletip = registerFactory(toggletipRegistries);
|
|
125
174
|
|
|
126
|
-
export {
|
|
175
|
+
export { toggletipRegistries as a, registerToggletip as r, toggletipDefinition as t };
|