@vonage/vivid 3.31.0 → 3.34.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/accordion/index.js +5 -5
- package/accordion-item/index.js +4 -4
- package/action-group/index.js +1 -1
- package/alert/index.js +8 -7
- package/avatar/index.js +2 -2
- package/badge/index.js +2 -2
- package/banner/index.js +5 -5
- package/breadcrumb/index.js +1 -1
- package/breadcrumb-item/index.js +3 -3
- package/button/index.js +4 -4
- package/calendar/index.js +1 -1
- package/calendar-event/index.js +1 -1
- package/card/index.js +3 -3
- package/checkbox/index.js +7 -4
- package/combobox/index.js +10 -9
- package/custom-elements.json +996 -29
- package/data-grid/index.js +2 -2
- package/date-picker/index.js +35 -0
- package/dialog/index.js +6 -6
- package/divider/index.js +1 -1
- package/elevation/index.js +1 -1
- package/empty-state/index.js +2 -2
- package/fab/index.js +4 -4
- package/file-picker/index.js +7 -6
- package/focus/index.js +1 -1
- package/header/index.js +2 -2
- package/icon/index.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +68 -66
- package/layout/index.js +1 -1
- package/lib/button/button.d.ts +2 -0
- package/lib/calendar/calendar.d.ts +1 -1
- package/lib/components.d.ts +20 -19
- package/lib/date-picker/calendar/calendarGrid.d.ts +17 -0
- package/lib/date-picker/calendar/dateStr.d.ts +7 -0
- package/lib/date-picker/calendar/month.d.ts +12 -0
- package/lib/date-picker/calendar/monthPickerGrid.d.ts +10 -0
- package/lib/date-picker/calendar/presentationDate.d.ts +4 -0
- package/lib/date-picker/calendar/year.d.ts +2 -0
- package/lib/date-picker/date-picker.d.ts +18 -0
- package/lib/date-picker/date-picker.template.d.ts +4 -0
- package/lib/date-picker/definition.d.ts +3 -0
- package/lib/date-picker/locale.d.ts +21 -0
- package/lib/icon/icon.d.ts +0 -1
- package/lib/listbox/listbox.d.ts +9 -1
- package/lib/select/select.d.ts +4 -2
- package/lib/text-field/text-field.d.ts +1 -0
- package/listbox/index.js +22 -17
- package/locales/en-GB.d.ts +3 -0
- package/locales/en-GB.js +59 -0
- package/locales/en-US.d.ts +3 -0
- package/locales/en-US.js +59 -0
- package/locales/ja-JP.d.ts +3 -0
- package/locales/ja-JP.js +59 -0
- package/locales/zh-CN.d.ts +3 -0
- package/locales/zh-CN.js +59 -0
- package/menu/index.js +8 -8
- package/menu-item/index.js +4 -4
- package/nav/index.js +1 -1
- package/nav-disclosure/index.js +3 -3
- package/nav-item/index.js +3 -3
- package/note/index.js +4 -4
- package/number-field/index.js +8 -7
- package/option/index.js +5 -4
- package/package.json +2 -15
- package/pagination/index.js +5 -5
- package/popup/index.js +6 -6
- package/progress/index.js +1 -1
- package/progress-ring/index.js +1 -1
- package/radio/index.js +2 -2
- package/radio-group/index.js +1 -1
- package/select/index.js +10 -9
- package/shared/affix.js +25 -9
- package/shared/apply-mixins.js +1 -1
- package/shared/breadcrumb-item.js +5 -5
- package/shared/button.js +13 -13
- package/shared/calendar-event.js +36 -16
- package/shared/definition.js +133 -194
- package/shared/definition10.js +225 -40
- package/shared/definition11.js +36 -32
- package/shared/definition12.js +763 -98
- package/shared/definition13.js +125 -89
- package/shared/definition14.js +207 -27
- package/shared/definition15.js +710 -731
- package/shared/definition16.js +1289 -47
- package/shared/definition17.js +6113 -93
- package/shared/definition18.js +242 -164
- package/shared/definition19.js +47 -692
- package/shared/definition2.js +199 -117
- package/shared/definition20.js +59 -1671
- package/shared/definition21.js +95 -255
- package/shared/definition22.js +2218 -1167
- package/shared/definition23.js +57 -219
- package/shared/definition24.js +27 -68
- package/shared/definition25.js +54 -38
- package/shared/definition26.js +395 -70
- package/shared/definition27.js +381 -2223
- package/shared/definition28.js +85 -44
- package/shared/definition29.js +27 -40
- package/shared/definition3.js +61 -24
- package/shared/definition30.js +13 -427
- package/shared/definition31.js +49 -360
- package/shared/definition32.js +466 -13
- package/shared/definition33.js +273 -63
- package/shared/definition34.js +195 -25
- package/shared/definition35.js +86 -35
- package/shared/definition36.js +66 -427
- package/shared/definition37.js +430 -190
- package/shared/definition38.js +34 -52
- package/shared/definition39.js +683 -31
- package/shared/definition4.js +157 -12
- package/shared/definition40.js +97 -422
- package/shared/definition41.js +473 -543
- package/shared/definition42.js +122 -73
- package/shared/definition43.js +103 -502
- package/shared/definition44.js +23 -101
- package/shared/definition45.js +76 -126
- package/shared/definition46.js +494 -48
- package/shared/definition47.js +23 -23
- package/shared/definition48.js +126 -476
- package/shared/definition49.js +275 -98
- package/shared/definition5.js +71 -36
- package/shared/definition50.js +157 -16
- package/shared/definition51.js +133 -263
- package/shared/definition52.js +131 -115
- package/shared/definition53.js +85 -120
- package/shared/definition54.js +295 -111
- package/shared/definition55.js +12 -71
- package/shared/definition56.js +39 -295
- package/shared/definition57.js +181 -0
- package/shared/definition6.js +56 -111
- package/shared/definition7.js +119 -187
- package/shared/definition8.js +58 -23
- package/shared/definition9.js +92 -66
- package/shared/focus.js +2 -1
- package/shared/focus2.js +1 -1
- package/shared/form-associated.js +2 -2
- package/shared/icon.js +48 -27
- package/shared/index.js +7 -27
- package/shared/index2.js +202 -0
- package/shared/key-codes.js +1 -1
- package/shared/listbox.js +88 -11
- package/shared/localization/Locale.d.ts +4 -0
- package/shared/localization/index.d.ts +7 -0
- package/shared/patterns/form-elements/form-elements.d.ts +4 -4
- package/shared/patterns/index.d.ts +1 -0
- package/shared/patterns/localized.d.ts +4 -0
- package/shared/radio.js +23 -7
- package/shared/repeat.js +1 -1
- package/shared/text-anchor.js +21 -4
- package/shared/text-anchor.template.js +37 -40
- package/shared/text-field.js +2 -2
- package/shared/text-field2.js +15 -15
- package/shared/tree-item.js +12 -12
- package/side-drawer/index.js +1 -1
- package/slider/index.js +2 -2
- package/split-button/index.js +3 -3
- package/style.css +6097 -0
- package/styles/core/all.css +25 -3
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +25 -3
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +2 -2
- package/switch/index.js +5 -4
- package/tab/index.js +3 -3
- package/tab-panel/index.js +1 -1
- package/tabs/index.js +5 -5
- package/tag/index.js +3 -3
- package/tag-group/index.js +1 -1
- package/text-anchor/index.js +1 -1
- package/text-area/index.js +5 -4
- package/text-field/index.js +5 -4
- package/toggletip/index.js +7 -7
- package/tooltip/index.js +7 -7
- package/tree-item/index.js +3 -3
- package/tree-view/index.js +1 -1
- package/vivid.api.json +137 -0
- package/lib/accordion/index.d.ts +0 -1
- package/lib/accordion-item/index.d.ts +0 -1
- package/lib/action-group/index.d.ts +0 -1
- package/lib/alert/index.d.ts +0 -1
- package/lib/avatar/index.d.ts +0 -1
- package/lib/badge/index.d.ts +0 -1
- package/lib/banner/index.d.ts +0 -1
- package/lib/breadcrumb/index.d.ts +0 -1
- package/lib/breadcrumb-item/index.d.ts +0 -1
- package/lib/button/index.d.ts +0 -1
- package/lib/calendar/index.d.ts +0 -1
- package/lib/calendar-event/index.d.ts +0 -1
- package/lib/card/index.d.ts +0 -1
- package/lib/checkbox/index.d.ts +0 -1
- package/lib/combobox/index.d.ts +0 -1
- package/lib/data-grid/index.d.ts +0 -1
- package/lib/dialog/index.d.ts +0 -1
- package/lib/divider/index.d.ts +0 -1
- package/lib/elevation/index.d.ts +0 -1
- package/lib/empty-state/index.d.ts +0 -1
- package/lib/fab/index.d.ts +0 -1
- package/lib/file-picker/index.d.ts +0 -1
- package/lib/focus/index.d.ts +0 -1
- package/lib/header/index.d.ts +0 -1
- package/lib/icon/index.d.ts +0 -1
- package/lib/layout/index.d.ts +0 -1
- package/lib/listbox/index.d.ts +0 -1
- package/lib/menu/index.d.ts +0 -1
- package/lib/menu-item/index.d.ts +0 -1
- package/lib/nav/index.d.ts +0 -1
- package/lib/nav-disclosure/index.d.ts +0 -1
- package/lib/nav-item/index.d.ts +0 -1
- package/lib/note/index.d.ts +0 -1
- package/lib/number-field/index.d.ts +0 -1
- package/lib/option/index.d.ts +0 -1
- package/lib/pagination/index.d.ts +0 -1
- package/lib/popup/index.d.ts +0 -1
- package/lib/progress/index.d.ts +0 -1
- package/lib/progress-ring/index.d.ts +0 -1
- package/lib/radio/index.d.ts +0 -1
- package/lib/radio-group/index.d.ts +0 -1
- package/lib/select/index.d.ts +0 -1
- package/lib/side-drawer/index.d.ts +0 -1
- package/lib/slider/index.d.ts +0 -1
- package/lib/split-button/index.d.ts +0 -1
- package/lib/switch/index.d.ts +0 -1
- package/lib/tab/index.d.ts +0 -1
- package/lib/tab-panel/index.d.ts +0 -1
- package/lib/tabs/index.d.ts +0 -1
- package/lib/tag/index.d.ts +0 -1
- package/lib/tag-group/index.d.ts +0 -1
- package/lib/text-anchor/index.d.ts +0 -1
- package/lib/text-area/index.d.ts +0 -1
- package/lib/text-field/index.d.ts +0 -1
- package/lib/toggletip/index.d.ts +0 -1
- package/lib/tooltip/index.d.ts +0 -1
- package/lib/tree-item/index.d.ts +0 -1
- package/lib/tree-view/index.d.ts +0 -1
- package/shared/form-elements.js +0 -162
package/shared/definition52.js
CHANGED
|
@@ -1,124 +1,140 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as iconRegistries } from './definition3.js';
|
|
4
|
-
import { b as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
5
|
-
import './focus.js';
|
|
6
|
-
import { e as errorText, f as formElements, F as FormElementSuccessText, a as FormElementHelperText, b as FormElementCharCount, g as getFeedbackTemplate } from './form-elements.js';
|
|
7
|
-
import { T as TextField$1 } from './text-field2.js';
|
|
8
|
-
import { a as applyMixins } from './apply-mixins.js';
|
|
9
|
-
import { c as css_248z } from './text-field.js';
|
|
10
|
-
import { f as focusTemplateFactory } from './focus2.js';
|
|
11
|
-
import { w as when } from './when.js';
|
|
12
|
-
import { r as ref } from './ref.js';
|
|
13
|
-
import { s as slotted } from './slotted.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 './definition57.js';
|
|
14
3
|
import { c as classNames } from './class-names.js';
|
|
15
4
|
|
|
16
|
-
|
|
17
|
-
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "appearance", void 0);
|
|
18
|
-
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "shape", void 0);
|
|
19
|
-
__decorate([attr, __metadata("design:type", String)], TextField.prototype, "autoComplete", void 0);
|
|
20
|
-
__decorate([observable, __metadata("design:type", Array)], TextField.prototype, "actionItemsSlottedContent", void 0);
|
|
21
|
-
TextField = __decorate([errorText, formElements], TextField);
|
|
22
|
-
applyMixins(TextField, AffixIcon, FormElementCharCount, FormElementHelperText, FormElementSuccessText);
|
|
5
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 GMT\n */\n.control {\n pointer-events: none;\n}\n\n.tooltip {\n width: var(--tooltip-inline-size, auto);\n}\n.tooltip-text {\n padding: 8px 12px;\n color: var(--vvd-color-canvas-text);\n font: var(--vvd-typography-base-bold);\n}";
|
|
23
6
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
12
|
+
if (decorator = decorators[i])
|
|
13
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
14
|
+
if (kind && result)
|
|
15
|
+
__defProp(target, key, result);
|
|
16
|
+
return result;
|
|
17
|
+
};
|
|
18
|
+
class Tooltip extends FoundationElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.#anchorEl = null;
|
|
22
|
+
this.open = false;
|
|
23
|
+
this.#observeMissingAnchor = (anchorId) => {
|
|
24
|
+
this.#observer = new MutationObserver(() => {
|
|
25
|
+
const anchor = document.getElementById(anchorId);
|
|
26
|
+
if (anchor) {
|
|
27
|
+
this.#anchorEl = anchor;
|
|
28
|
+
this.#anchorUpdated();
|
|
29
|
+
this.#observer.disconnect();
|
|
30
|
+
this.#observer = void 0;
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
this.#observer.observe(document.body, { childList: true, subtree: true });
|
|
34
|
+
};
|
|
35
|
+
this.#show = () => {
|
|
36
|
+
this.open = true;
|
|
37
|
+
};
|
|
38
|
+
this.#hide = () => {
|
|
39
|
+
this.open = false;
|
|
40
|
+
};
|
|
41
|
+
this.#closeOnEscape = (e) => {
|
|
42
|
+
if (e.key === "Escape")
|
|
43
|
+
this.#hide();
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
#anchorEl;
|
|
47
|
+
#observer;
|
|
48
|
+
anchorChanged(_, newValue) {
|
|
49
|
+
if (this.#anchorEl)
|
|
50
|
+
this.#removeEventListener();
|
|
51
|
+
this.#observer?.disconnect();
|
|
52
|
+
this.#anchorEl = newValue instanceof HTMLElement ? newValue : document.getElementById(newValue);
|
|
53
|
+
if (this.#anchorEl) {
|
|
54
|
+
this.#anchorUpdated();
|
|
55
|
+
} else {
|
|
56
|
+
this.#observeMissingAnchor(newValue);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
#observeMissingAnchor;
|
|
60
|
+
disconnectedCallback() {
|
|
61
|
+
super.disconnectedCallback();
|
|
62
|
+
this.#removeEventListener();
|
|
63
|
+
this.#observer?.disconnect();
|
|
64
|
+
document.removeEventListener("keydown", this.#closeOnEscape);
|
|
65
|
+
}
|
|
66
|
+
#anchorUpdated() {
|
|
67
|
+
this.#removeEventListener();
|
|
68
|
+
this.#addEventListener();
|
|
69
|
+
}
|
|
70
|
+
#addEventListener() {
|
|
71
|
+
if (this.#anchorEl) {
|
|
72
|
+
this.#anchorEl.addEventListener("mouseover", this.#show);
|
|
73
|
+
this.#anchorEl.addEventListener("mouseout", this.#hide);
|
|
74
|
+
this.#anchorEl.addEventListener("focusin", this.#show);
|
|
75
|
+
this.#anchorEl.addEventListener("focusout", this.#hide);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
#removeEventListener() {
|
|
79
|
+
this.#anchorEl?.removeEventListener("mouseover", this.#show);
|
|
80
|
+
this.#anchorEl?.removeEventListener("mouseout", this.#hide);
|
|
81
|
+
this.#anchorEl?.removeEventListener("focusin", this.#show);
|
|
82
|
+
this.#anchorEl?.removeEventListener("focusout", this.#hide);
|
|
83
|
+
}
|
|
84
|
+
#show;
|
|
85
|
+
#hide;
|
|
86
|
+
#closeOnEscape;
|
|
87
|
+
openChanged(_, newValue) {
|
|
88
|
+
if (_ === void 0)
|
|
89
|
+
return;
|
|
90
|
+
if (newValue) {
|
|
91
|
+
document.addEventListener("keydown", this.#closeOnEscape);
|
|
92
|
+
} else {
|
|
93
|
+
document.removeEventListener("keydown", this.#closeOnEscape);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
46
96
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
@input="${x => x.handleTextInput()}"
|
|
60
|
-
@change="${x => x.handleChange()}"
|
|
61
|
-
?autofocus="${x => x.autofocus}"
|
|
62
|
-
?disabled="${x => x.disabled}"
|
|
63
|
-
list="${x => x.list}"
|
|
64
|
-
maxlength="${x => x.maxlength}"
|
|
65
|
-
minlength="${x => x.minlength}"
|
|
66
|
-
pattern="${x => x.pattern}"
|
|
67
|
-
placeholder="${x => x.placeholder}"
|
|
68
|
-
?readonly="${x => x.readOnly}"
|
|
69
|
-
?required="${x => x.required}"
|
|
70
|
-
size="${x => x.size}"
|
|
71
|
-
autocomplete="${x => x.autoComplete}"
|
|
72
|
-
name="${x => x.name}"
|
|
73
|
-
?spellcheck="${x => x.spellcheck}"
|
|
74
|
-
:value="${x => x.value}"
|
|
75
|
-
type="${x => x.type}"
|
|
76
|
-
aria-atomic="${x => x.ariaAtomic}"
|
|
77
|
-
aria-busy="${x => x.ariaBusy}"
|
|
78
|
-
aria-controls="${x => x.ariaControls}"
|
|
79
|
-
aria-current="${x => x.ariaCurrent}"
|
|
80
|
-
aria-describedby="${x => x.ariaDescribedby}"
|
|
81
|
-
aria-details="${x => x.ariaDetails}"
|
|
82
|
-
aria-disabled="${x => x.ariaDisabled}"
|
|
83
|
-
aria-errormessage="${x => x.ariaErrormessage}"
|
|
84
|
-
aria-flowto="${x => x.ariaFlowto}"
|
|
85
|
-
aria-haspopup="${x => x.ariaHaspopup}"
|
|
86
|
-
aria-hidden="${x => x.ariaHidden}"
|
|
87
|
-
aria-invalid="${x => x.ariaInvalid}"
|
|
88
|
-
aria-keyshortcuts="${x => x.ariaKeyshortcuts}"
|
|
89
|
-
aria-label="${x => x.ariaLabel}"
|
|
90
|
-
aria-labelledby="${x => x.ariaLabelledby}"
|
|
91
|
-
aria-live="${x => x.ariaLive}"
|
|
92
|
-
aria-owns="${x => x.ariaOwns}"
|
|
93
|
-
aria-relevant="${x => x.ariaRelevant}"
|
|
94
|
-
aria-roledescription="${x => x.ariaRoledescription}"
|
|
95
|
-
${ref('control')}
|
|
96
|
-
/>
|
|
97
|
-
${() => focusTemplate}
|
|
98
|
-
</div>
|
|
99
|
-
<div class="action-items-wrapper">
|
|
100
|
-
<slot name="action-items" ${slotted('actionItemsSlottedContent')}></slot>
|
|
101
|
-
</div>
|
|
97
|
+
__decorateClass([
|
|
98
|
+
attr
|
|
99
|
+
], Tooltip.prototype, "text", 2);
|
|
100
|
+
__decorateClass([
|
|
101
|
+
attr({ mode: "fromView" })
|
|
102
|
+
], Tooltip.prototype, "placement", 2);
|
|
103
|
+
__decorateClass([
|
|
104
|
+
attr({ mode: "boolean" })
|
|
105
|
+
], Tooltip.prototype, "open", 2);
|
|
106
|
+
__decorateClass([
|
|
107
|
+
attr({ mode: "fromView" })
|
|
108
|
+
], Tooltip.prototype, "anchor", 2);
|
|
102
109
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
const getClasses = ({
|
|
111
|
+
open
|
|
112
|
+
}) => classNames(
|
|
113
|
+
"control",
|
|
114
|
+
["open", Boolean(open)]
|
|
115
|
+
);
|
|
116
|
+
const TooltipTemplate = (context) => {
|
|
117
|
+
const popupTag = context.tagFor(Popup);
|
|
118
|
+
return html`
|
|
119
|
+
<${popupTag} class="${getClasses}" arrow alternate
|
|
120
|
+
:placement=${(x) => x.placement}
|
|
121
|
+
:anchor="${(x) => x.anchor}"
|
|
122
|
+
:open=${(x) => x.open}
|
|
123
|
+
exportparts="vvd-theme-alternate">
|
|
124
|
+
<div class="tooltip" role="tooltip">
|
|
125
|
+
<header part="vvd-theme-alternate" class="tooltip-header">
|
|
126
|
+
<div class="tooltip-text">${(x) => x.text}</div>
|
|
127
|
+
</header>
|
|
128
|
+
</div>
|
|
129
|
+
</${popupTag}>`;
|
|
111
130
|
};
|
|
112
131
|
|
|
113
|
-
const
|
|
114
|
-
baseName:
|
|
115
|
-
template:
|
|
116
|
-
styles
|
|
117
|
-
shadowOptions: {
|
|
118
|
-
delegatesFocus: true
|
|
119
|
-
}
|
|
132
|
+
const tooltipDefinition = Tooltip.compose({
|
|
133
|
+
baseName: "tooltip",
|
|
134
|
+
template: TooltipTemplate,
|
|
135
|
+
styles
|
|
120
136
|
});
|
|
121
|
-
const
|
|
122
|
-
const
|
|
137
|
+
const tooltipRegistries = [tooltipDefinition(), ...popupRegistries];
|
|
138
|
+
const registerTooltip = registerFactory(tooltipRegistries);
|
|
123
139
|
|
|
124
|
-
export {
|
|
140
|
+
export { tooltipRegistries as a, registerTooltip as r, tooltipDefinition as t };
|
package/shared/definition53.js
CHANGED
|
@@ -1,131 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { a as attr, h as html, r as registerFactory } from './index.js';
|
|
2
|
+
import { a as iconRegistries } from './definition24.js';
|
|
3
|
+
import { f as focusRegistries } from './definition55.js';
|
|
4
|
+
import { A as AffixIcon, a as affixIconTemplateFactory } from './affix.js';
|
|
5
|
+
import { T as TreeItem$1 } from './tree-item.js';
|
|
6
|
+
import { a as applyMixins } from './apply-mixins.js';
|
|
7
|
+
import { I as Icon } from './icon.js';
|
|
8
|
+
import { f as focusTemplateFactory } from './focus2.js';
|
|
9
|
+
import { e as elements } from './node-observation.js';
|
|
10
|
+
import { c as children } from './children.js';
|
|
3
11
|
import { w as when } from './when.js';
|
|
12
|
+
import { s as slotted } from './slotted.js';
|
|
4
13
|
import { c as classNames } from './class-names.js';
|
|
14
|
+
import { r as ref } from './ref.js';
|
|
5
15
|
|
|
6
|
-
|
|
16
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Mon, 04 Sep 2023 12:44:18 GMT\n */\n@supports selector(:focus-visible) {\n :host(:focus-visible) {\n outline: none;\n }\n}\n.control {\n position: relative;\n display: inline-flex;\n box-sizing: border-box;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n border-radius: 6px;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n color: var(--_appearance-color-text);\n font: var(--vvd-typography-base);\n gap: 12px;\n hyphens: auto;\n inline-size: 100%;\n min-block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n padding-inline: 16px;\n text-decoration: none;\n vertical-align: middle;\n word-break: break-word;\n}\n.control {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.control:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.control:where(:active, .active):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-soft);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:not(:disabled, .disabled, :hover, .hover)) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary);\n --_appearance-color-outline: transparent;\n}\n.control:where(.selected, [aria-current]):where(:hover, .hover) {\n --_appearance-color-text: var(--_connotation-color-primary-text);\n --_appearance-color-fill: var(--_connotation-color-primary-increment);\n --_appearance-color-outline: transparent;\n}\n.control {\n /* @cssprop [--vvd-tree-item-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-tree-item-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-tree-item-accent-primary-text=var(--vvd-color-canvas)] */\n --_connotation-color-primary-text: var(--vvd-tree-item-accent-primary-text, var(--vvd-color-canvas));\n /* @cssprop [--vvd-tree-item-accent-primary-increment=var(--vvd-color-neutral-800)] */\n --_connotation-color-primary-increment: var(--vvd-tree-item-accent-primary-increment, var(--vvd-color-neutral-800));\n /* @cssprop [--vvd-tree-item-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-tree-item-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-tree-item-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-tree-item-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports selector(:focus-visible) {\n .control:focus-visible {\n outline: none;\n }\n}\n@supports (user-select: none) {\n .control {\n user-select: none;\n }\n}\n.control:not(.disabled) {\n cursor: pointer;\n}\n.control.disabled {\n cursor: not-allowed;\n pointer-events: none;\n}\n.control .text {\n font: var(--vvd-typography-base);\n}\n\n.expandCollapseButton {\n display: flex;\n align-items: center;\n border-radius: 6px;\n font-size: 20px;\n}\n.expandCollapseButton .expandCollapseIcon {\n margin: 4px;\n}\n.expandCollapseButton:hover {\n background-color: var(--vvd-color-neutral-100);\n}\n\n.items {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin-block: 4px;\n padding-inline-start: 48px;\n}\n\n:host(:not(:focus-visible)) .focus-indicator {\n display: none;\n}\n\n.icon {\n font-size: 20px;\n line-height: 1;\n}\n.control:not(.disabled, .selected) .icon {\n color: var(--vvd-color-neutral-600);\n}";
|
|
7
17
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (anchor) {
|
|
19
|
-
__classPrivateFieldSet(this, _Toggletip_anchorEl, anchor, "f");
|
|
20
|
-
__classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_setupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
|
|
21
|
-
__classPrivateFieldGet(this, _Toggletip_observer, "f").disconnect();
|
|
22
|
-
__classPrivateFieldSet(this, _Toggletip_observer, undefined, "f");
|
|
23
|
-
}
|
|
24
|
-
}), "f");
|
|
25
|
-
__classPrivateFieldGet(this, _Toggletip_observer, "f").observe(document.body, {
|
|
26
|
-
childList: true,
|
|
27
|
-
subtree: true
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
_Toggletip_ANCHOR_ARIA_LABEL_SUFFIX.set(this, ' ; Show more information');
|
|
31
|
-
this.alternate = false;
|
|
32
|
-
this.placement = 'right';
|
|
33
|
-
this.anchor = '';
|
|
34
|
-
this.open = false;
|
|
35
|
-
_Toggletip_openIfClosed.set(this, () => {
|
|
36
|
-
if (!this.open) DOM.queueUpdate(() => this.open = true);
|
|
37
|
-
});
|
|
38
|
-
_Toggletip_closeOnClickOutside.set(this, e => {
|
|
39
|
-
if (!this.contains(e.target)) this.open = false;
|
|
40
|
-
});
|
|
41
|
-
_Toggletip_closeOnEscape.set(this, e => {
|
|
42
|
-
if (e.key === 'Escape') this.open = false;
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
anchorChanged(_, newValue) {
|
|
46
|
-
var _a;
|
|
47
|
-
if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) __classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_cleanupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
|
|
48
|
-
(_a = __classPrivateFieldGet(this, _Toggletip_observer, "f")) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
49
|
-
__classPrivateFieldSet(this, _Toggletip_anchorEl, newValue instanceof HTMLElement ? newValue : document.getElementById(newValue), "f");
|
|
50
|
-
if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) {
|
|
51
|
-
__classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_setupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
|
|
52
|
-
} else {
|
|
53
|
-
__classPrivateFieldGet(this, _Toggletip_observeMissingAnchor, "f").call(this, newValue);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
openChanged(oldValue, newValue) {
|
|
57
|
-
if (oldValue === undefined) return;
|
|
58
|
-
if (newValue) {
|
|
59
|
-
document.addEventListener('click', __classPrivateFieldGet(this, _Toggletip_closeOnClickOutside, "f"));
|
|
60
|
-
document.addEventListener('keydown', __classPrivateFieldGet(this, _Toggletip_closeOnEscape, "f"));
|
|
61
|
-
this.setAttribute('role', 'status');
|
|
62
|
-
} else {
|
|
63
|
-
document.removeEventListener('click', __classPrivateFieldGet(this, _Toggletip_closeOnClickOutside, "f"));
|
|
64
|
-
document.removeEventListener('keydown', __classPrivateFieldGet(this, _Toggletip_closeOnEscape, "f"));
|
|
65
|
-
this.removeAttribute('role');
|
|
66
|
-
}
|
|
67
|
-
if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) {
|
|
68
|
-
__classPrivateFieldGet(this, _Toggletip_anchorEl, "f").ariaExpanded = this.open.toString();
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
disconnectedCallback() {
|
|
72
|
-
var _a;
|
|
73
|
-
super.disconnectedCallback();
|
|
74
|
-
if (__classPrivateFieldGet(this, _Toggletip_anchorEl, "f")) __classPrivateFieldGet(this, _Toggletip_instances, "m", _Toggletip_cleanupAnchor).call(this, __classPrivateFieldGet(this, _Toggletip_anchorEl, "f"));
|
|
75
|
-
(_a = __classPrivateFieldGet(this, _Toggletip_observer, "f")) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
76
|
-
document.removeEventListener('keydown', __classPrivateFieldGet(this, _Toggletip_closeOnEscape, "f"));
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
_Toggletip_observer = new WeakMap(), _Toggletip_anchorEl = new WeakMap(), _Toggletip_observeMissingAnchor = new WeakMap(), _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX = new WeakMap(), _Toggletip_openIfClosed = new WeakMap(), _Toggletip_closeOnClickOutside = new WeakMap(), _Toggletip_closeOnEscape = new WeakMap(), _Toggletip_instances = new WeakSet(), _Toggletip_setupAnchor = function _Toggletip_setupAnchor(a) {
|
|
80
|
-
var _a;
|
|
81
|
-
a.addEventListener('click', __classPrivateFieldGet(this, _Toggletip_openIfClosed, "f"), true);
|
|
82
|
-
a.ariaLabel = ((_a = a.ariaLabel) !== null && _a !== void 0 ? _a : '') + __classPrivateFieldGet(this, _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX, "f");
|
|
83
|
-
}, _Toggletip_cleanupAnchor = function _Toggletip_cleanupAnchor(a) {
|
|
84
|
-
a.removeEventListener('click', __classPrivateFieldGet(this, _Toggletip_openIfClosed, "f"), true);
|
|
85
|
-
if (a.ariaLabel) a.ariaLabel = a.ariaLabel.replace(__classPrivateFieldGet(this, _Toggletip_ANCHOR_ARIA_LABEL_SUFFIX, "f"), '');
|
|
18
|
+
var __defProp = Object.defineProperty;
|
|
19
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
21
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
22
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23
|
+
if (decorator = decorators[i])
|
|
24
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
25
|
+
if (kind && result)
|
|
26
|
+
__defProp(target, key, result);
|
|
27
|
+
return result;
|
|
86
28
|
};
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}), __metadata("design:type", String)], Toggletip.prototype, "placement", void 0);
|
|
94
|
-
__decorate([attr({
|
|
95
|
-
mode: 'fromView'
|
|
96
|
-
}), __metadata("design:type", Object)], Toggletip.prototype, "anchor", void 0);
|
|
97
|
-
__decorate([attr({
|
|
98
|
-
mode: 'boolean'
|
|
99
|
-
}), __metadata("design:type", Object)], Toggletip.prototype, "open", void 0);
|
|
29
|
+
class TreeItem extends TreeItem$1 {
|
|
30
|
+
}
|
|
31
|
+
__decorateClass([
|
|
32
|
+
attr
|
|
33
|
+
], TreeItem.prototype, "text", 2);
|
|
34
|
+
applyMixins(TreeItem, AffixIcon);
|
|
100
35
|
|
|
101
|
-
const getClasses =
|
|
102
|
-
|
|
103
|
-
|
|
36
|
+
const getClasses = ({
|
|
37
|
+
disabled,
|
|
38
|
+
selected
|
|
39
|
+
}) => classNames(
|
|
40
|
+
"control",
|
|
41
|
+
["disabled", disabled],
|
|
42
|
+
["selected", Boolean(selected)]
|
|
43
|
+
);
|
|
44
|
+
const expandCollapseButton = (context) => {
|
|
45
|
+
const iconTag = context.tagFor(Icon);
|
|
46
|
+
return html`
|
|
47
|
+
<div aria-hidden="true"
|
|
48
|
+
class="expandCollapseButton"
|
|
49
|
+
@click="${(x, c) => x.handleExpandCollapseButtonClick(c.event)}"
|
|
50
|
+
${ref("expandCollapseButton")}
|
|
51
|
+
>
|
|
52
|
+
<${iconTag} class="expandCollapseIcon" name="${(x) => x.expanded ? "chevron-down-line" : "chevron-right-line"}"></${iconTag}>
|
|
53
|
+
</div>`;
|
|
54
|
+
};
|
|
55
|
+
const TreeItemTemplate = (context) => {
|
|
56
|
+
const affixIconTemplate = affixIconTemplateFactory(context);
|
|
57
|
+
const focusTemplate = focusTemplateFactory(context);
|
|
104
58
|
return html`
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
59
|
+
<template
|
|
60
|
+
role="treeitem"
|
|
61
|
+
slot="${(x) => x.isNestedItem() ? "item" : void 0}"
|
|
62
|
+
tabindex="-1"
|
|
63
|
+
aria-expanded="${(x) => x.childItems && x.childItems.length > 0 ? x.expanded : void 0}"
|
|
64
|
+
aria-selected="${(x) => x.selected}"
|
|
65
|
+
aria-disabled="${(x) => x.disabled}"
|
|
66
|
+
@focusin="${(x, c) => x.handleFocus(c.event)}"
|
|
67
|
+
@focusout="${(x, c) => x.handleBlur(c.event)}"
|
|
68
|
+
${children({ property: "childItems", filter: elements() })}
|
|
69
|
+
>
|
|
70
|
+
<div class="${getClasses}">
|
|
71
|
+
${() => focusTemplate}
|
|
72
|
+
${when((x) => x.childItems && x.childItems.length > 0, expandCollapseButton(context))}
|
|
73
|
+
${(x) => affixIconTemplate(x.icon)}
|
|
74
|
+
${(x) => x.text}
|
|
118
75
|
</div>
|
|
119
|
-
|
|
120
|
-
|
|
76
|
+
${when(
|
|
77
|
+
(x) => x.childItems && x.childItems.length > 0 && x.expanded,
|
|
78
|
+
html`
|
|
79
|
+
<div role="group" class="items">
|
|
80
|
+
<slot name="item" ${slotted("items")}></slot>
|
|
81
|
+
</div>`
|
|
82
|
+
)}
|
|
83
|
+
</template>`;
|
|
121
84
|
};
|
|
122
85
|
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
86
|
+
const treeItemDefinition = TreeItem.compose(
|
|
87
|
+
{
|
|
88
|
+
baseName: "tree-item",
|
|
89
|
+
template: TreeItemTemplate,
|
|
90
|
+
styles
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
|
+
const treeItemRegistries = [treeItemDefinition(), ...iconRegistries, ...focusRegistries];
|
|
94
|
+
const registerTreeItem = registerFactory(treeItemRegistries);
|
|
130
95
|
|
|
131
|
-
export {
|
|
96
|
+
export { treeItemRegistries as a, registerTreeItem as r, treeItemDefinition as t };
|