@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/definition57.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('./definition61.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,71 +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
|
-
"control",
|
|
40
|
-
["disabled", disabled],
|
|
41
|
-
["selected", Boolean(selected)]
|
|
42
|
-
);
|
|
43
|
-
const expandCollapseButton = (context) => {
|
|
44
|
-
const iconTag = context.tagFor(icon.Icon);
|
|
45
|
-
return index.html`
|
|
46
|
-
<div aria-hidden="true"
|
|
47
|
-
class="expandCollapseButton"
|
|
48
|
-
@click="${(x, c) => x.handleExpandCollapseButtonClick(c.event)}"
|
|
49
|
-
${ref.ref("expandCollapseButton")}
|
|
50
|
-
>
|
|
51
|
-
<${iconTag} class="expandCollapseIcon" name="${(x) => x.expanded ? "chevron-down-line" : "chevron-right-line"}"></${iconTag}>
|
|
52
|
-
</div>`;
|
|
53
|
-
};
|
|
54
|
-
const TreeItemTemplate = (context) => {
|
|
55
|
-
const affixIconTemplate = affix.affixIconTemplateFactory(context);
|
|
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();
|
|
56
124
|
return index.html`
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
${when.when((x) => x.childItems && x.childItems.length > 0, expandCollapseButton(context))}
|
|
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`
|
|
76
|
-
<div role="group" class="items">
|
|
77
|
-
<slot name="item" ${slotted.slotted("items")}></slot>
|
|
78
|
-
</div>`
|
|
79
|
-
)}
|
|
80
|
-
</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}>`;
|
|
81
137
|
};
|
|
82
138
|
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
);
|
|
90
|
-
const treeItemRegistries = [treeItemDefinition(), ...definition.iconRegistries];
|
|
91
|
-
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);
|
|
92
146
|
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
95
|
-
exports.
|
|
147
|
+
exports.registerTooltip = registerTooltip;
|
|
148
|
+
exports.tooltipDefinition = tooltipDefinition;
|
|
149
|
+
exports.tooltipRegistries = tooltipRegistries;
|
package/shared/definition57.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import { a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { T as TreeItem$1 } from './tree-item.js';
|
|
5
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
6
|
-
import { I as Icon } from './icon.js';
|
|
7
|
-
import { e as elements, s as slotted } from './slotted.js';
|
|
8
|
-
import { c as children } from './children.js';
|
|
9
|
-
import { w as when } from './when.js';
|
|
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 './definition61.js';
|
|
3
|
+
import { b as anchored, a as anchorSlotTemplateFactory } from './anchored.js';
|
|
10
4
|
import { c as classNames } from './class-names.js';
|
|
11
|
-
import { r as ref } from './ref.js';
|
|
12
5
|
|
|
13
|
-
const styles = ":host
|
|
6
|
+
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";
|
|
14
7
|
|
|
15
8
|
var __defProp = Object.defineProperty;
|
|
16
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -23,69 +16,130 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
23
16
|
__defProp(target, key, result);
|
|
24
17
|
return result;
|
|
25
18
|
};
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
var __accessCheck = (obj, member, msg) => {
|
|
20
|
+
if (!member.has(obj))
|
|
21
|
+
throw TypeError("Cannot " + msg);
|
|
22
|
+
};
|
|
23
|
+
var __privateGet = (obj, member, getter) => {
|
|
24
|
+
__accessCheck(obj, member, "read from private field");
|
|
25
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
26
|
+
};
|
|
27
|
+
var __privateAdd = (obj, member, value) => {
|
|
28
|
+
if (member.has(obj))
|
|
29
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
30
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
31
|
+
};
|
|
32
|
+
var __privateMethod = (obj, member, method) => {
|
|
33
|
+
__accessCheck(obj, member, "access private method");
|
|
34
|
+
return method;
|
|
35
|
+
};
|
|
36
|
+
var _setupAnchor, setupAnchor_fn, _cleanupAnchor, cleanupAnchor_fn, _show, _hide, _updateListeners, updateListeners_fn, _closeOnEscape;
|
|
37
|
+
let Tooltip = class extends FoundationElement {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
__privateAdd(this, _setupAnchor);
|
|
41
|
+
__privateAdd(this, _cleanupAnchor);
|
|
42
|
+
__privateAdd(this, _updateListeners);
|
|
43
|
+
this.open = false;
|
|
44
|
+
__privateAdd(this, _show, () => {
|
|
45
|
+
this.open = true;
|
|
46
|
+
});
|
|
47
|
+
__privateAdd(this, _hide, () => {
|
|
48
|
+
this.open = false;
|
|
49
|
+
});
|
|
50
|
+
__privateAdd(this, _closeOnEscape, (e) => {
|
|
51
|
+
if (e.key === "Escape")
|
|
52
|
+
__privateGet(this, _hide).call(this);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
connectedCallback() {
|
|
56
|
+
super.connectedCallback();
|
|
57
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
58
|
+
}
|
|
59
|
+
disconnectedCallback() {
|
|
60
|
+
super.disconnectedCallback();
|
|
61
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
66
|
+
_anchorElChanged(oldValue, newValue) {
|
|
67
|
+
if (oldValue)
|
|
68
|
+
__privateMethod(this, _cleanupAnchor, cleanupAnchor_fn).call(this, oldValue);
|
|
69
|
+
if (newValue)
|
|
70
|
+
__privateMethod(this, _setupAnchor, setupAnchor_fn).call(this, newValue);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
*/
|
|
75
|
+
openChanged(oldValue) {
|
|
76
|
+
if (oldValue === void 0)
|
|
77
|
+
return;
|
|
78
|
+
__privateMethod(this, _updateListeners, updateListeners_fn).call(this);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
_setupAnchor = new WeakSet();
|
|
82
|
+
setupAnchor_fn = function(a) {
|
|
83
|
+
a.addEventListener("mouseover", __privateGet(this, _show));
|
|
84
|
+
a.addEventListener("mouseout", __privateGet(this, _hide));
|
|
85
|
+
a.addEventListener("focusin", __privateGet(this, _show));
|
|
86
|
+
a.addEventListener("focusout", __privateGet(this, _hide));
|
|
87
|
+
};
|
|
88
|
+
_cleanupAnchor = new WeakSet();
|
|
89
|
+
cleanupAnchor_fn = function(a) {
|
|
90
|
+
a.removeEventListener("mouseover", __privateGet(this, _show));
|
|
91
|
+
a.removeEventListener("mouseout", __privateGet(this, _hide));
|
|
92
|
+
a.removeEventListener("focusin", __privateGet(this, _show));
|
|
93
|
+
a.removeEventListener("focusout", __privateGet(this, _hide));
|
|
94
|
+
};
|
|
95
|
+
_show = new WeakMap();
|
|
96
|
+
_hide = new WeakMap();
|
|
97
|
+
_updateListeners = new WeakSet();
|
|
98
|
+
updateListeners_fn = function() {
|
|
99
|
+
document.removeEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
100
|
+
if (this.open && this.isConnected) {
|
|
101
|
+
document.addEventListener("keydown", __privateGet(this, _closeOnEscape));
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
_closeOnEscape = new WeakMap();
|
|
28
105
|
__decorateClass([
|
|
29
106
|
attr
|
|
30
|
-
],
|
|
31
|
-
|
|
107
|
+
], Tooltip.prototype, "text", 2);
|
|
108
|
+
__decorateClass([
|
|
109
|
+
attr({ mode: "fromView" })
|
|
110
|
+
], Tooltip.prototype, "placement", 2);
|
|
111
|
+
__decorateClass([
|
|
112
|
+
attr({ mode: "boolean" })
|
|
113
|
+
], Tooltip.prototype, "open", 2);
|
|
114
|
+
Tooltip = __decorateClass([
|
|
115
|
+
anchored
|
|
116
|
+
], Tooltip);
|
|
32
117
|
|
|
33
|
-
const getClasses = ({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"control",
|
|
38
|
-
["disabled", disabled],
|
|
39
|
-
["selected", Boolean(selected)]
|
|
40
|
-
);
|
|
41
|
-
const expandCollapseButton = (context) => {
|
|
42
|
-
const iconTag = context.tagFor(Icon);
|
|
43
|
-
return html`
|
|
44
|
-
<div aria-hidden="true"
|
|
45
|
-
class="expandCollapseButton"
|
|
46
|
-
@click="${(x, c) => x.handleExpandCollapseButtonClick(c.event)}"
|
|
47
|
-
${ref("expandCollapseButton")}
|
|
48
|
-
>
|
|
49
|
-
<${iconTag} class="expandCollapseIcon" name="${(x) => x.expanded ? "chevron-down-line" : "chevron-right-line"}"></${iconTag}>
|
|
50
|
-
</div>`;
|
|
51
|
-
};
|
|
52
|
-
const TreeItemTemplate = (context) => {
|
|
53
|
-
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
118
|
+
const getClasses = ({ open }) => classNames("control", ["open", Boolean(open)]);
|
|
119
|
+
const TooltipTemplate = (context) => {
|
|
120
|
+
const popupTag = context.tagFor(Popup);
|
|
121
|
+
const anchorSlotTemplate = anchorSlotTemplateFactory();
|
|
54
122
|
return html`
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
${when((x) => x.childItems && x.childItems.length > 0, expandCollapseButton(context))}
|
|
68
|
-
${(x) => affixIconTemplate(x.icon, IconWrapper.Slot)}
|
|
69
|
-
${(x) => x.text}
|
|
70
|
-
</div>
|
|
71
|
-
${when(
|
|
72
|
-
(x) => x.childItems && x.childItems.length > 0 && x.expanded,
|
|
73
|
-
html`
|
|
74
|
-
<div role="group" class="items">
|
|
75
|
-
<slot name="item" ${slotted("items")}></slot>
|
|
76
|
-
</div>`
|
|
77
|
-
)}
|
|
78
|
-
</template>`;
|
|
123
|
+
${anchorSlotTemplate}
|
|
124
|
+
<${popupTag} class="${getClasses}" arrow alternate
|
|
125
|
+
:placement=${(x) => x.placement}
|
|
126
|
+
:anchor="${(x) => x._anchorEl}"
|
|
127
|
+
:open=${(x) => x.open}
|
|
128
|
+
exportparts="vvd-theme-alternate">
|
|
129
|
+
<div class="tooltip" role="tooltip">
|
|
130
|
+
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
131
|
+
<div class="tooltip-text">${(x) => x.text}</div>
|
|
132
|
+
</header>
|
|
133
|
+
</div>
|
|
134
|
+
</${popupTag}>`;
|
|
79
135
|
};
|
|
80
136
|
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
);
|
|
88
|
-
const treeItemRegistries = [treeItemDefinition(), ...iconRegistries];
|
|
89
|
-
const registerTreeItem = registerFactory(treeItemRegistries);
|
|
137
|
+
const tooltipDefinition = Tooltip.compose({
|
|
138
|
+
baseName: "tooltip",
|
|
139
|
+
template: TooltipTemplate,
|
|
140
|
+
styles
|
|
141
|
+
});
|
|
142
|
+
const tooltipRegistries = [tooltipDefinition(), ...popupRegistries];
|
|
143
|
+
const registerTooltip = registerFactory(tooltipRegistries);
|
|
90
144
|
|
|
91
|
-
export {
|
|
145
|
+
export { tooltipRegistries as a, registerTooltip as r, tooltipDefinition as t };
|