@vonage/vivid 5.8.0 → 5.10.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/bundled/affix.js +1 -1
- package/bundled/anchored.cjs +1 -1
- package/bundled/anchored.js +6 -6
- package/bundled/data-grid.options.cjs +1 -0
- package/bundled/data-grid.options.js +29 -0
- package/bundled/definition10.js +4 -4
- package/bundled/definition2.cjs +1 -1
- package/bundled/definition2.js +1 -1
- package/bundled/definition3.cjs +1 -1
- package/bundled/definition3.js +1 -1
- package/bundled/definition7.js +3 -3
- package/bundled/definition9.cjs +9 -9
- package/bundled/definition9.js +113 -1342
- package/bundled/floating-ui.dom.cjs +1 -0
- package/bundled/floating-ui.dom.js +1242 -0
- package/bundled/host-semantics.js +4 -4
- package/bundled/localized.cjs +1 -1
- package/bundled/localized.js +21 -16
- package/bundled/mixins.cjs +2 -2
- package/bundled/mixins.js +6 -6
- package/bundled/slottable-request.cjs +4 -0
- package/bundled/slottable-request.js +2907 -0
- package/bundled/vivid-element.cjs +3 -3
- package/bundled/vivid-element.js +89 -69
- package/card/definition.cjs +1 -1
- package/card/definition.js +1 -1
- package/card/index.cjs +10 -10
- package/card/index.js +42 -42
- package/combobox/definition.cjs +14 -15
- package/combobox/definition.js +15 -16
- package/combobox/index.cjs +4 -4
- package/combobox/index.js +82 -87
- package/country/definition.cjs +340 -0
- package/country/definition.js +334 -0
- package/country/index.cjs +12 -0
- package/country/index.js +317 -0
- package/custom-elements.json +4835 -613
- package/data-grid/definition.cjs +23 -49
- package/data-grid/definition.js +1 -27
- package/data-grid/index.cjs +27 -27
- package/data-grid/index.js +44 -64
- package/file-picker/definition.cjs +10 -8
- package/file-picker/definition.js +10 -8
- package/file-picker/index.cjs +5 -5
- package/file-picker/index.js +12 -12
- package/icon/definition.cjs +1 -1
- package/icon/definition.js +1 -1
- package/index.cjs +38 -4
- package/index.js +7 -2
- package/lib/components.d.ts +6 -1
- package/lib/country/countries-data.d.ts +6 -0
- package/lib/country/country-code-to-flag-icon.d.ts +5 -0
- package/lib/country/country.d.ts +5 -0
- package/lib/country/country.template.d.ts +3 -0
- package/lib/country/definition.d.ts +3 -0
- package/lib/popover/definition.d.ts +4 -0
- package/lib/popover/locale.d.ts +3 -0
- package/lib/popover/popover.d.ts +781 -0
- package/lib/popover/popover.template.d.ts +3 -0
- package/lib/rich-text-editor/locale.d.ts +2 -0
- package/lib/rich-text-editor/popover.d.ts +1 -0
- package/lib/rich-text-editor/rte/config.d.ts +5 -1
- package/lib/rich-text-editor/rte/document.d.ts +2 -0
- package/lib/rich-text-editor/rte/exports.d.ts +5 -0
- package/lib/rich-text-editor/rte/feature.d.ts +7 -1
- package/lib/rich-text-editor/rte/features/internal/basic-text-blocks.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/internal/foreign-html.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/internal/history.d.ts +1 -1
- package/lib/rich-text-editor/rte/features/internal/input-rules.d.ts +15 -0
- package/lib/rich-text-editor/rte/instance.d.ts +4 -2
- package/lib/rich-text-editor/rte/utils/feature-state.d.ts +8 -0
- package/lib/rich-text-editor/rte/utils/text-before-cursor.d.ts +2 -0
- package/lib/rich-text-editor/rte/utils/ui.d.ts +2 -0
- package/lib/rich-text-editor/rte/view.d.ts +30 -0
- package/lib/rich-text-view/definition.d.ts +5 -0
- package/lib/rich-text-view/rich-text-view.d.ts +19 -0
- package/lib/rich-text-view/rich-text-view.template.d.ts +3 -0
- package/lib/selectable-box/selectable-box.d.ts +1 -0
- package/lib/status/definition.d.ts +4 -0
- package/lib/status/status.d.ts +388 -0
- package/lib/status/status.template.d.ts +3 -0
- package/lib/table/definition.d.ts +8 -0
- package/lib/table/table-body.d.ts +3 -0
- package/lib/table/table-body.template.d.ts +3 -0
- package/lib/table/table-cell.d.ts +381 -0
- package/lib/table/table-cell.template.d.ts +3 -0
- package/lib/table/table-head.d.ts +3 -0
- package/lib/table/table-head.template.d.ts +3 -0
- package/lib/table/table-header-cell.d.ts +381 -0
- package/lib/table/table-header-cell.template.d.ts +3 -0
- package/lib/table/table-row.d.ts +381 -0
- package/lib/table/table-row.template.d.ts +3 -0
- package/lib/table/table.d.ts +3 -0
- package/lib/table/table.template.d.ts +3 -0
- package/lib/tag/tag.d.ts +1 -1
- package/lib/tag-name-map.d.ts +11 -1
- package/locales/de-DE.cjs +6 -1
- package/locales/de-DE.js +6 -1
- package/locales/en-GB.cjs +6 -1
- package/locales/en-GB.js +6 -1
- package/locales/en-US.cjs +6 -1
- package/locales/en-US.js +6 -1
- package/locales/ja-JP.cjs +6 -1
- package/locales/ja-JP.js +6 -1
- package/locales/zh-CN.cjs +6 -1
- package/locales/zh-CN.js +6 -1
- package/package.json +10 -9
- package/popover/definition.cjs +363 -0
- package/popover/definition.js +357 -0
- package/popover/index.cjs +27 -0
- package/popover/index.js +263 -0
- package/rich-text-editor/definition.cjs +12125 -14657
- package/rich-text-editor/definition.js +8876 -11412
- package/rich-text-editor/index.cjs +20 -22
- package/rich-text-editor/index.js +5046 -7096
- package/rich-text-view/definition.cjs +171 -0
- package/rich-text-view/definition.js +165 -0
- package/rich-text-view/index.cjs +1 -0
- package/rich-text-view/index.js +103 -0
- package/selectable-box/definition.cjs +16 -5
- package/selectable-box/definition.js +16 -5
- package/selectable-box/index.cjs +11 -9
- package/selectable-box/index.js +86 -78
- package/shared/localization/Locale.d.ts +2 -0
- package/shared/utils/slottable-request.d.ts +7 -0
- package/status/definition.cjs +76 -0
- package/status/definition.js +70 -0
- package/status/index.cjs +11 -0
- package/status/index.js +55 -0
- package/styles/core/all.css +2 -2
- package/styles/core/theme.css +2 -2
- 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/table/definition.cjs +168 -0
- package/table/definition.js +152 -0
- package/table/index.cjs +37 -0
- package/table/index.js +107 -0
- package/tag/definition.cjs +1 -1
- package/tag/definition.js +1 -1
- package/tag/index.cjs +24 -24
- package/tag/index.js +89 -89
- package/unbundled/_commonjsHelpers.cjs +26 -0
- package/unbundled/_commonjsHelpers.js +26 -1
- package/unbundled/data-grid.options.cjs +34 -0
- package/unbundled/data-grid.options.js +28 -0
- package/unbundled/definition.cjs +1 -1
- package/unbundled/definition.js +1 -1
- package/unbundled/slottable-request.cjs +3702 -0
- package/unbundled/slottable-request.js +3684 -0
- package/unbundled/vivid-element.cjs +1 -1
- package/unbundled/vivid-element.js +1 -1
- package/video-player/definition.cjs +11 -1
- package/video-player/definition.js +12 -2
- package/video-player/index.cjs +30 -30
- package/video-player/index.js +705 -702
- package/vivid.api.json +1957 -143
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { E as Elevation, e as elevationDefinition } from '../unbundled/definition6.js';
|
|
2
|
+
import { V as VividElement, d as defineVividComponent, c as createRegisterFunction } from '../unbundled/vivid-element.js';
|
|
3
|
+
import { attr, nullableNumberConverter, observable, slotted, ref, when, html } from '@microsoft/fast-element';
|
|
4
|
+
import { inline, flip, shift, hide, arrow, offset, autoUpdate, computePosition } from '@floating-ui/dom';
|
|
5
|
+
import { D as DelegatesAria, d as delegateAria } from '../unbundled/delegates-aria.js';
|
|
6
|
+
import { L as Localized } from '../unbundled/localized.js';
|
|
7
|
+
import { classNames } from '@microsoft/fast-web-utilities';
|
|
8
|
+
import { VwcIconElement as Icon, iconDefinition } from '../icon/definition.js';
|
|
9
|
+
import { B as Button, b as buttonDefinition } from '../unbundled/definition.js';
|
|
10
|
+
|
|
11
|
+
const styles = ":host{display:inline-block}.base{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.base{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.base ::-webkit-scrollbar{width:4px}.base ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.base ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.base{position:fixed;overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content;min-inline-size:fit-content}.base:focus-visible{outline:none}.base::backdrop{background-color:var(--popover-backdrop-bg, transparent)}.control{display:flex;flex-direction:column;padding:var(--popover-padding, 24px);border-radius:inherit;background:var(--vvd-color-surface-4dp);color:var(--vvd-color-canvas-text);gap:var(--popover-gap, 24px)}.control:not(.open){display:none}.control.condensed{--popover-padding: 12px;--popover-gap: 12px}.control.manual{padding-block-start:40px}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismiss-button{position:absolute;inset-block-start:4px;inset-inline-end:4px}";
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
15
|
+
var result = void 0 ;
|
|
16
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
17
|
+
if (decorator = decorators[i])
|
|
18
|
+
result = (decorator(target, key, result) ) || result;
|
|
19
|
+
if (result) __defProp(target, key, result);
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
class Popover extends Localized(DelegatesAria(VividElement)) {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.placement = "bottom";
|
|
26
|
+
this.manual = false;
|
|
27
|
+
this.layout = "default";
|
|
28
|
+
this.offset = 8;
|
|
29
|
+
this.alternate = false;
|
|
30
|
+
this.dismissButtonAriaLabel = null;
|
|
31
|
+
this.arrow = false;
|
|
32
|
+
this.open = false;
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*/
|
|
36
|
+
this.#currentAnchor = null;
|
|
37
|
+
/**
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
this.#manualToggle = () => {
|
|
41
|
+
this._popoverEl.togglePopover();
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
this.#autoUpdateCallback = () => {
|
|
47
|
+
this.#lastPositionUpdate = this.updatePosition();
|
|
48
|
+
};
|
|
49
|
+
// --- Lifecycle & Events ---
|
|
50
|
+
/**
|
|
51
|
+
* Syncs native toggle state (Esc key, light dismiss) back to the 'open' attribute.
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
this.#handleNativeToggle = (e) => {
|
|
55
|
+
const isOpen = e.newState ? e.newState === "open" : this._popoverEl.matches(":popover-open");
|
|
56
|
+
if (this.open !== isOpen) {
|
|
57
|
+
this.open = isOpen;
|
|
58
|
+
}
|
|
59
|
+
this.$emit(isOpen ? "open" : "close", void 0, { bubbles: false });
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
placementChanged() {
|
|
63
|
+
this.#updateAutoUpdate();
|
|
64
|
+
}
|
|
65
|
+
arrowChanged() {
|
|
66
|
+
this.#updateAutoUpdate();
|
|
67
|
+
}
|
|
68
|
+
openChanged(_oldValue, newValue) {
|
|
69
|
+
if (!this._popoverEl) return;
|
|
70
|
+
const isOpen = this._popoverEl.matches(":popover-open");
|
|
71
|
+
if (newValue && !isOpen) {
|
|
72
|
+
this._popoverEl.showPopover();
|
|
73
|
+
} else if (!newValue && isOpen) {
|
|
74
|
+
this._popoverEl.hidePopover();
|
|
75
|
+
}
|
|
76
|
+
this.#updateAutoUpdate();
|
|
77
|
+
}
|
|
78
|
+
anchorChanged() {
|
|
79
|
+
this.#updateAnchor();
|
|
80
|
+
}
|
|
81
|
+
_slottedAnchorChanged() {
|
|
82
|
+
this.#updateAnchor();
|
|
83
|
+
}
|
|
84
|
+
#currentAnchor;
|
|
85
|
+
/**
|
|
86
|
+
* @internal
|
|
87
|
+
*/
|
|
88
|
+
#updateAnchor() {
|
|
89
|
+
if (!this._popoverEl) return;
|
|
90
|
+
const newAnchor = this.anchor || this._slottedAnchor?.[0] || null;
|
|
91
|
+
if (this.#currentAnchor === newAnchor) return;
|
|
92
|
+
if (this.#currentAnchor) {
|
|
93
|
+
this.#unbindTrigger(this.#currentAnchor);
|
|
94
|
+
}
|
|
95
|
+
this.#currentAnchor = newAnchor;
|
|
96
|
+
if (this.#currentAnchor && this._popoverEl) {
|
|
97
|
+
this.#bindTrigger(this.#currentAnchor);
|
|
98
|
+
this.#updateAutoUpdate();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @internal
|
|
103
|
+
*/
|
|
104
|
+
#bindTrigger(anchor) {
|
|
105
|
+
anchor.setAttribute("aria-haspopup", "dialog");
|
|
106
|
+
if (anchor instanceof HTMLButtonElement || anchor instanceof HTMLInputElement) {
|
|
107
|
+
anchor.popoverTargetElement = this._popoverEl;
|
|
108
|
+
} else {
|
|
109
|
+
anchor.addEventListener("click", this.#manualToggle);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
#unbindTrigger(anchor) {
|
|
116
|
+
anchor.removeAttribute("aria-haspopup");
|
|
117
|
+
if (anchor instanceof HTMLButtonElement || anchor instanceof HTMLInputElement) {
|
|
118
|
+
anchor.popoverTargetElement = null;
|
|
119
|
+
} else {
|
|
120
|
+
anchor.removeEventListener("click", this.#manualToggle);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
#manualToggle;
|
|
124
|
+
// --- Floating UI Logic ---
|
|
125
|
+
/**
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
get #middleware() {
|
|
129
|
+
let middleware = [inline(), flip(), shift(), hide()];
|
|
130
|
+
/* v8 ignore next -- @preserve */
|
|
131
|
+
let offsetValue = this.offset ?? 0;
|
|
132
|
+
if (this.arrow && this._arrowEl) {
|
|
133
|
+
offsetValue = 12;
|
|
134
|
+
middleware = [
|
|
135
|
+
...middleware,
|
|
136
|
+
arrow({ element: this._arrowEl, padding: 10 })
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
/* v8 ignore else -- @preserve */
|
|
140
|
+
if (offsetValue > 0) {
|
|
141
|
+
middleware.unshift(offset(offsetValue));
|
|
142
|
+
}
|
|
143
|
+
return middleware;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
#cleanup;
|
|
149
|
+
/**
|
|
150
|
+
* @internal
|
|
151
|
+
*/
|
|
152
|
+
#updateAutoUpdate() {
|
|
153
|
+
this.#cleanup?.();
|
|
154
|
+
if (this.open && this.#currentAnchor && this._popoverEl) {
|
|
155
|
+
this.#cleanup = autoUpdate(
|
|
156
|
+
this.#currentAnchor,
|
|
157
|
+
this._popoverEl,
|
|
158
|
+
this.#autoUpdateCallback
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Tracks the promise of the last position update.
|
|
164
|
+
* @internal
|
|
165
|
+
*/
|
|
166
|
+
#lastPositionUpdate;
|
|
167
|
+
#autoUpdateCallback;
|
|
168
|
+
/**
|
|
169
|
+
* Updates the position of the popover
|
|
170
|
+
* @public
|
|
171
|
+
*/
|
|
172
|
+
async updatePosition() {
|
|
173
|
+
/* v8 ignore if -- @preserve */
|
|
174
|
+
if (!this.open || !this.#currentAnchor || !this._popoverEl) return;
|
|
175
|
+
const positionData = await computePosition(
|
|
176
|
+
this.#currentAnchor,
|
|
177
|
+
this._popoverEl,
|
|
178
|
+
{
|
|
179
|
+
placement: this.placement,
|
|
180
|
+
strategy: "fixed",
|
|
181
|
+
middleware: this.#middleware
|
|
182
|
+
}
|
|
183
|
+
);
|
|
184
|
+
/* v8 ignore if -- @preserve */
|
|
185
|
+
if (!this.open) return;
|
|
186
|
+
this.#assignPopoverPosition(positionData);
|
|
187
|
+
if (this.arrow && this._arrowEl) {
|
|
188
|
+
this.#assignArrowPosition(positionData);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @internal
|
|
193
|
+
*/
|
|
194
|
+
#assignPopoverPosition(data) {
|
|
195
|
+
const { x, y } = data;
|
|
196
|
+
Object.assign(this._popoverEl.style, {
|
|
197
|
+
left: `${x}px`,
|
|
198
|
+
top: `${y}px`,
|
|
199
|
+
visibility: data.middlewareData.hide?.referenceHidden ? "hidden" : "visible"
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @internal
|
|
204
|
+
*/
|
|
205
|
+
#assignArrowPosition(data) {
|
|
206
|
+
/* v8 ignore if -- @preserve */
|
|
207
|
+
if (!this._arrowEl) return;
|
|
208
|
+
const { x: arrowX, y: arrowY } = data.middlewareData.arrow;
|
|
209
|
+
const styles = {
|
|
210
|
+
left: "calc(100% - 4px)",
|
|
211
|
+
right: "-4px",
|
|
212
|
+
top: "calc(100% - 4px)",
|
|
213
|
+
bottom: "-4px"
|
|
214
|
+
};
|
|
215
|
+
const staticAxis = data.placement.split("-")[0];
|
|
216
|
+
Object.assign(this._arrowEl.style, {
|
|
217
|
+
left: arrowX ? `${arrowX}px` : styles[staticAxis],
|
|
218
|
+
top: arrowY ? `${arrowY}px` : styles[staticAxis]
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
#handleNativeToggle;
|
|
222
|
+
connectedCallback() {
|
|
223
|
+
super.connectedCallback();
|
|
224
|
+
this.#updateAnchor();
|
|
225
|
+
/* v8 ignore else -- @preserve */
|
|
226
|
+
if (this._popoverEl) {
|
|
227
|
+
this._popoverEl.addEventListener("toggle", this.#handleNativeToggle);
|
|
228
|
+
if (this.open && !this._popoverEl.matches(":popover-open")) {
|
|
229
|
+
this._popoverEl.showPopover();
|
|
230
|
+
this.#updateAutoUpdate();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
disconnectedCallback() {
|
|
235
|
+
super.disconnectedCallback();
|
|
236
|
+
this.#cleanup?.();
|
|
237
|
+
if (this.#currentAnchor) {
|
|
238
|
+
this.#unbindTrigger(this.#currentAnchor);
|
|
239
|
+
this.#currentAnchor = null;
|
|
240
|
+
}
|
|
241
|
+
/* v8 ignore else -- @preserve */
|
|
242
|
+
if (this._popoverEl) {
|
|
243
|
+
this._popoverEl.removeEventListener("toggle", this.#handleNativeToggle);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// --- Methods ---
|
|
247
|
+
show() {
|
|
248
|
+
this.open = true;
|
|
249
|
+
return this.#lastPositionUpdate ?? Promise.resolve();
|
|
250
|
+
}
|
|
251
|
+
hide() {
|
|
252
|
+
this.open = false;
|
|
253
|
+
}
|
|
254
|
+
toggle() {
|
|
255
|
+
this.open = !this.open;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
__decorateClass([
|
|
259
|
+
attr({ mode: "fromView" })
|
|
260
|
+
], Popover.prototype, "placement");
|
|
261
|
+
__decorateClass([
|
|
262
|
+
attr({ mode: "boolean" })
|
|
263
|
+
], Popover.prototype, "manual");
|
|
264
|
+
__decorateClass([
|
|
265
|
+
attr({ mode: "fromView" })
|
|
266
|
+
], Popover.prototype, "layout");
|
|
267
|
+
__decorateClass([
|
|
268
|
+
attr({
|
|
269
|
+
attribute: "offset",
|
|
270
|
+
mode: "fromView",
|
|
271
|
+
converter: nullableNumberConverter
|
|
272
|
+
})
|
|
273
|
+
], Popover.prototype, "offset");
|
|
274
|
+
__decorateClass([
|
|
275
|
+
attr({
|
|
276
|
+
mode: "boolean"
|
|
277
|
+
})
|
|
278
|
+
], Popover.prototype, "alternate");
|
|
279
|
+
__decorateClass([
|
|
280
|
+
attr({ attribute: "dismiss-button-aria-label" })
|
|
281
|
+
], Popover.prototype, "dismissButtonAriaLabel");
|
|
282
|
+
__decorateClass([
|
|
283
|
+
attr({ mode: "boolean" })
|
|
284
|
+
], Popover.prototype, "arrow");
|
|
285
|
+
__decorateClass([
|
|
286
|
+
attr({ mode: "boolean" })
|
|
287
|
+
], Popover.prototype, "open");
|
|
288
|
+
__decorateClass([
|
|
289
|
+
observable
|
|
290
|
+
], Popover.prototype, "anchor");
|
|
291
|
+
__decorateClass([
|
|
292
|
+
observable
|
|
293
|
+
], Popover.prototype, "_slottedAnchor");
|
|
294
|
+
|
|
295
|
+
const getClasses = ({ open, manual, layout }) => classNames(
|
|
296
|
+
"control",
|
|
297
|
+
["open", Boolean(open)],
|
|
298
|
+
["manual", Boolean(manual)],
|
|
299
|
+
["condensed", layout === "condensed"]
|
|
300
|
+
);
|
|
301
|
+
const popoverTemplate = (context) => {
|
|
302
|
+
const elevationTag = context.tagFor(Elevation);
|
|
303
|
+
const buttonTag = context.tagFor(Button);
|
|
304
|
+
const iconTag = context.tagFor(Icon);
|
|
305
|
+
return html`
|
|
306
|
+
<slot name="anchor" ${slotted("_slottedAnchor")}></slot>
|
|
307
|
+
<${elevationTag}>
|
|
308
|
+
<div class="base"
|
|
309
|
+
${ref("_popoverEl")}
|
|
310
|
+
popover="${(x) => x.manual ? "manual" : "auto"}"
|
|
311
|
+
tabindex="-1"
|
|
312
|
+
autofocus
|
|
313
|
+
${delegateAria({
|
|
314
|
+
role: "dialog",
|
|
315
|
+
ariaModal: "false"
|
|
316
|
+
})}
|
|
317
|
+
>
|
|
318
|
+
<div class="${getClasses}"
|
|
319
|
+
part="${(x) => x.alternate ? "vvd-theme-alternate" : ""}">
|
|
320
|
+
<slot></slot>
|
|
321
|
+
<slot name="footer"></slot>
|
|
322
|
+
${when(
|
|
323
|
+
(x) => x.manual,
|
|
324
|
+
html`<${buttonTag}
|
|
325
|
+
aria-label="${(x) => x.dismissButtonAriaLabel || x.locale.popover.dismissButtonLabel}"
|
|
326
|
+
type="button"
|
|
327
|
+
size="condensed"
|
|
328
|
+
class="dismiss-button"
|
|
329
|
+
@click="${(x) => x.hide()}">
|
|
330
|
+
<${iconTag} name="close-line" slot="icon"></${iconTag}>
|
|
331
|
+
</${buttonTag}>`
|
|
332
|
+
)}
|
|
333
|
+
${when(
|
|
334
|
+
(x) => x.arrow,
|
|
335
|
+
html`<div class="arrow" ${ref("_arrowEl")}></div>`
|
|
336
|
+
)}
|
|
337
|
+
</div>
|
|
338
|
+
</div>
|
|
339
|
+
</${elevationTag}>
|
|
340
|
+
`;
|
|
341
|
+
};
|
|
342
|
+
|
|
343
|
+
const popoverDefinition = defineVividComponent(
|
|
344
|
+
"popover",
|
|
345
|
+
Popover,
|
|
346
|
+
popoverTemplate,
|
|
347
|
+
[buttonDefinition, iconDefinition, elevationDefinition],
|
|
348
|
+
{
|
|
349
|
+
styles,
|
|
350
|
+
shadowOptions: {
|
|
351
|
+
delegatesFocus: true
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
);
|
|
355
|
+
const registerPopover = createRegisterFunction(popoverDefinition);
|
|
356
|
+
|
|
357
|
+
export { Popover as VwcPopoverElement, popoverDefinition, registerPopover };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";const u=require("../bundled/definition4.cjs"),i=require("../bundled/vivid-element.cjs"),l=require("../bundled/floating-ui.dom.cjs"),v=require("../bundled/delegates-aria.cjs"),m=require("../bundled/localized.cjs"),b=require("../bundled/definition2.cjs"),f=require("../bundled/definition3.cjs"),g=require("../bundled/slotted.cjs"),d=require("../bundled/ref.cjs"),h=require("../bundled/when.cjs"),w=require("../bundled/class-names.cjs"),E=":host{display:inline-block}.base{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.base{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.base ::-webkit-scrollbar{width:4px}.base ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.base ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.base{position:fixed;overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content;min-inline-size:fit-content}.base:focus-visible{outline:none}.base::backdrop{background-color:var(--popover-backdrop-bg, transparent)}.control{display:flex;flex-direction:column;padding:var(--popover-padding, 24px);border-radius:inherit;background:var(--vvd-color-surface-4dp);color:var(--vvd-color-canvas-text);gap:var(--popover-gap, 24px)}.control:not(.open){display:none}.control.condensed{--popover-padding: 12px;--popover-gap: 12px}.control.manual{padding-block-start:40px}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismiss-button{position:absolute;inset-block-start:4px;inset-inline-end:4px}";var _=Object.defineProperty,a=(n,e,t,r)=>{for(var o=void 0,p=n.length-1,c;p>=0;p--)(c=n[p])&&(o=c(e,t,o)||o);return o&&_(e,t,o),o};class s extends m.Localized(v.DelegatesAria(i.VividElement)){constructor(){super(...arguments),this.placement="bottom",this.manual=!1,this.layout="default",this.offset=8,this.alternate=!1,this.dismissButtonAriaLabel=null,this.arrow=!1,this.open=!1,this.#e=null,this.#i=()=>{this._popoverEl.togglePopover()},this.#l=()=>{this.#n=this.updatePosition()},this.#s=e=>{const t=e.newState?e.newState==="open":this._popoverEl.matches(":popover-open");this.open!==t&&(this.open=t),this.$emit(t?"open":"close",void 0,{bubbles:!1})}}placementChanged(){this.#t()}arrowChanged(){this.#t()}openChanged(e,t){if(!this._popoverEl)return;const r=this._popoverEl.matches(":popover-open");t&&!r?this._popoverEl.showPopover():!t&&r&&this._popoverEl.hidePopover(),this.#t()}anchorChanged(){this.#o()}_slottedAnchorChanged(){this.#o()}#e;#o(){if(!this._popoverEl)return;const e=this.anchor||this._slottedAnchor?.[0]||null;this.#e!==e&&(this.#e&&this.#a(this.#e),this.#e=e,this.#e&&this._popoverEl&&(this.#p(this.#e),this.#t()))}#p(e){e.setAttribute("aria-haspopup","dialog"),e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e.popoverTargetElement=this._popoverEl:e.addEventListener("click",this.#i)}#a(e){e.removeAttribute("aria-haspopup"),e instanceof HTMLButtonElement||e instanceof HTMLInputElement?e.popoverTargetElement=null:e.removeEventListener("click",this.#i)}#i;get#c(){let e=[l.inline(),l.flip(),l.shift(),l.hide()];/* v8 ignore next -- @preserve */let t=this.offset??0;this.arrow&&this._arrowEl&&(t=12,e=[...e,l.arrow({element:this._arrowEl,padding:10})]);/* v8 ignore else -- @preserve */return t>0&&e.unshift(l.offset(t)),e}#r;#t(){this.#r?.(),this.open&&this.#e&&this._popoverEl&&(this.#r=l.autoUpdate(this.#e,this._popoverEl,this.#l))}#n;#l;async updatePosition(){/* v8 ignore if -- @preserve */if(!this.open||!this.#e||!this._popoverEl)return;const e=await l.computePosition(this.#e,this._popoverEl,{placement:this.placement,strategy:"fixed",middleware:this.#c});/* v8 ignore if -- @preserve */this.open&&(this.#d(e),this.arrow&&this._arrowEl&&this.#h(e))}#d(e){const{x:t,y:r}=e;Object.assign(this._popoverEl.style,{left:`${t}px`,top:`${r}px`,visibility:e.middlewareData.hide?.referenceHidden?"hidden":"visible"})}#h(e){/* v8 ignore if -- @preserve */if(!this._arrowEl)return;const{x:t,y:r}=e.middlewareData.arrow,o={left:"calc(100% - 4px)",right:"-4px",top:"calc(100% - 4px)",bottom:"-4px"},p=e.placement.split("-")[0];Object.assign(this._arrowEl.style,{left:t?`${t}px`:o[p],top:r?`${r}px`:o[p]})}#s;connectedCallback(){super.connectedCallback(),this.#o();/* v8 ignore else -- @preserve */this._popoverEl&&(this._popoverEl.addEventListener("toggle",this.#s),this.open&&!this._popoverEl.matches(":popover-open")&&(this._popoverEl.showPopover(),this.#t()))}disconnectedCallback(){super.disconnectedCallback(),this.#r?.(),this.#e&&(this.#a(this.#e),this.#e=null);/* v8 ignore else -- @preserve */this._popoverEl&&this._popoverEl.removeEventListener("toggle",this.#s)}show(){return this.open=!0,this.#n??Promise.resolve()}hide(){this.open=!1}toggle(){this.open=!this.open}}a([i.attr({mode:"fromView"})],s.prototype,"placement");a([i.attr({mode:"boolean"})],s.prototype,"manual");a([i.attr({mode:"fromView"})],s.prototype,"layout");a([i.attr({attribute:"offset",mode:"fromView",converter:i.nullableNumberConverter})],s.prototype,"offset");a([i.attr({mode:"boolean"})],s.prototype,"alternate");a([i.attr({attribute:"dismiss-button-aria-label"})],s.prototype,"dismissButtonAriaLabel");a([i.attr({mode:"boolean"})],s.prototype,"arrow");a([i.attr({mode:"boolean"})],s.prototype,"open");a([i.observable],s.prototype,"anchor");a([i.observable],s.prototype,"_slottedAnchor");const x=({open:n,manual:e,layout:t})=>w.classNames("control",["open",!!n],["manual",!!e],["condensed",t==="condensed"]),k=n=>{const e=n.tagFor(u.Elevation),t=n.tagFor(f.Button),r=n.tagFor(b.Icon);return i.html`
|
|
2
|
+
<slot name="anchor" ${g.slotted("_slottedAnchor")}></slot>
|
|
3
|
+
<${e}>
|
|
4
|
+
<div class="base"
|
|
5
|
+
${d.ref("_popoverEl")}
|
|
6
|
+
popover="${o=>o.manual?"manual":"auto"}"
|
|
7
|
+
tabindex="-1"
|
|
8
|
+
autofocus
|
|
9
|
+
${v.delegateAria({role:"dialog",ariaModal:"false"})}
|
|
10
|
+
>
|
|
11
|
+
<div class="${x}"
|
|
12
|
+
part="${o=>o.alternate?"vvd-theme-alternate":""}">
|
|
13
|
+
<slot></slot>
|
|
14
|
+
<slot name="footer"></slot>
|
|
15
|
+
${h.when(o=>o.manual,i.html`<${t}
|
|
16
|
+
aria-label="${o=>o.dismissButtonAriaLabel||o.locale.popover.dismissButtonLabel}"
|
|
17
|
+
type="button"
|
|
18
|
+
size="condensed"
|
|
19
|
+
class="dismiss-button"
|
|
20
|
+
@click="${o=>o.hide()}">
|
|
21
|
+
<${r} name="close-line" slot="icon"></${r}>
|
|
22
|
+
</${t}>`)}
|
|
23
|
+
${h.when(o=>o.arrow,i.html`<div class="arrow" ${d.ref("_arrowEl")}></div>`)}
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
</${e}>
|
|
27
|
+
`},y=i.defineVividComponent("popover",s,k,[f.buttonDefinition,b.iconDefinition,u.elevationDefinition],{styles:E,shadowOptions:{delegatesFocus:!0}}),$=i.createRegisterFunction(y);$();
|
package/popover/index.js
ADDED
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import { E as m, e as u } from "../bundled/definition4.js";
|
|
2
|
+
import { V as b, a as n, n as f, o as v, h as p, c as g, d as w } from "../bundled/vivid-element.js";
|
|
3
|
+
import { i as E, f as _, b as x, h as k, c as y, o as $, d as A, e as P } from "../bundled/floating-ui.dom.js";
|
|
4
|
+
import { D as C, d as L } from "../bundled/delegates-aria.js";
|
|
5
|
+
import { L as T } from "../bundled/localized.js";
|
|
6
|
+
import { I as B, i as D } from "../bundled/definition2.js";
|
|
7
|
+
import { B as V, b as O } from "../bundled/definition3.js";
|
|
8
|
+
import { s as z } from "../bundled/slotted.js";
|
|
9
|
+
import { r as d } from "../bundled/ref.js";
|
|
10
|
+
import { w as h } from "../bundled/when.js";
|
|
11
|
+
import { c as F } from "../bundled/class-names.js";
|
|
12
|
+
const H = ":host{display:inline-block}.base{white-space:initial;--scrollbar-track-color: transparent;--scrollbar-thumb-color: color-mix(in srgb, var(--vvd-color-neutral-950), transparent 70%)}.base{scrollbar-color:var(--scrollbar-thumb-color) var(--scrollbar-track-color);scrollbar-width:thin}.base ::-webkit-scrollbar{width:4px}.base ::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.base ::-webkit-scrollbar-thumb{border:0;border-radius:4px;background-color:var(--scrollbar-fallback-track-color, var(--scrollbar-thumb-color))}.base{position:fixed;overflow:visible;padding:0;border:none;border-radius:8px;margin:0;inline-size:max-content;min-inline-size:fit-content}.base:focus-visible{outline:none}.base::backdrop{background-color:var(--popover-backdrop-bg, transparent)}.control{display:flex;flex-direction:column;padding:var(--popover-padding, 24px);border-radius:inherit;background:var(--vvd-color-surface-4dp);color:var(--vvd-color-canvas-text);gap:var(--popover-gap, 24px)}.control:not(.open){display:none}.control.condensed{--popover-padding: 12px;--popover-gap: 12px}.control.manual{padding-block-start:40px}.arrow{position:absolute;z-index:-1;width:8px;height:8px;background:var(--vvd-color-surface-4dp);transform:rotate(45deg)}.dismiss-button{position:absolute;inset-block-start:4px;inset-inline-end:4px}";
|
|
13
|
+
var M = Object.defineProperty, r = (a, o, e, s) => {
|
|
14
|
+
for (var t = void 0, l = a.length - 1, c; l >= 0; l--)
|
|
15
|
+
(c = a[l]) && (t = c(o, e, t) || t);
|
|
16
|
+
return t && M(o, e, t), t;
|
|
17
|
+
};
|
|
18
|
+
class i extends T(C(b)) {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.placement = "bottom", this.manual = !1, this.layout = "default", this.offset = 8, this.alternate = !1, this.dismissButtonAriaLabel = null, this.arrow = !1, this.open = !1, this.#o = null, this.#s = () => {
|
|
21
|
+
this._popoverEl.togglePopover();
|
|
22
|
+
}, this.#l = () => {
|
|
23
|
+
this.#n = this.updatePosition();
|
|
24
|
+
}, this.#r = (o) => {
|
|
25
|
+
const e = o.newState ? o.newState === "open" : this._popoverEl.matches(":popover-open");
|
|
26
|
+
this.open !== e && (this.open = e), this.$emit(e ? "open" : "close", void 0, { bubbles: !1 });
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
placementChanged() {
|
|
30
|
+
this.#e();
|
|
31
|
+
}
|
|
32
|
+
arrowChanged() {
|
|
33
|
+
this.#e();
|
|
34
|
+
}
|
|
35
|
+
openChanged(o, e) {
|
|
36
|
+
if (!this._popoverEl) return;
|
|
37
|
+
const s = this._popoverEl.matches(":popover-open");
|
|
38
|
+
e && !s ? this._popoverEl.showPopover() : !e && s && this._popoverEl.hidePopover(), this.#e();
|
|
39
|
+
}
|
|
40
|
+
anchorChanged() {
|
|
41
|
+
this.#t();
|
|
42
|
+
}
|
|
43
|
+
_slottedAnchorChanged() {
|
|
44
|
+
this.#t();
|
|
45
|
+
}
|
|
46
|
+
#o;
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
50
|
+
#t() {
|
|
51
|
+
if (!this._popoverEl) return;
|
|
52
|
+
const o = this.anchor || this._slottedAnchor?.[0] || null;
|
|
53
|
+
this.#o !== o && (this.#o && this.#a(this.#o), this.#o = o, this.#o && this._popoverEl && (this.#p(this.#o), this.#e()));
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
#p(o) {
|
|
59
|
+
o.setAttribute("aria-haspopup", "dialog"), o instanceof HTMLButtonElement || o instanceof HTMLInputElement ? o.popoverTargetElement = this._popoverEl : o.addEventListener("click", this.#s);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
64
|
+
#a(o) {
|
|
65
|
+
o.removeAttribute("aria-haspopup"), o instanceof HTMLButtonElement || o instanceof HTMLInputElement ? o.popoverTargetElement = null : o.removeEventListener("click", this.#s);
|
|
66
|
+
}
|
|
67
|
+
#s;
|
|
68
|
+
// --- Floating UI Logic ---
|
|
69
|
+
/**
|
|
70
|
+
* @internal
|
|
71
|
+
*/
|
|
72
|
+
get #c() {
|
|
73
|
+
let o = [E(), _(), x(), k()];
|
|
74
|
+
/* v8 ignore next -- @preserve */
|
|
75
|
+
let e = this.offset ?? 0;
|
|
76
|
+
this.arrow && this._arrowEl && (e = 12, o = [
|
|
77
|
+
...o,
|
|
78
|
+
y({ element: this._arrowEl, padding: 10 })
|
|
79
|
+
]);
|
|
80
|
+
/* v8 ignore else -- @preserve */
|
|
81
|
+
return e > 0 && o.unshift($(e)), o;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
#i;
|
|
87
|
+
/**
|
|
88
|
+
* @internal
|
|
89
|
+
*/
|
|
90
|
+
#e() {
|
|
91
|
+
this.#i?.(), this.open && this.#o && this._popoverEl && (this.#i = A(
|
|
92
|
+
this.#o,
|
|
93
|
+
this._popoverEl,
|
|
94
|
+
this.#l
|
|
95
|
+
));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Tracks the promise of the last position update.
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
101
|
+
#n;
|
|
102
|
+
#l;
|
|
103
|
+
/**
|
|
104
|
+
* Updates the position of the popover
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
async updatePosition() {
|
|
108
|
+
/* v8 ignore if -- @preserve */
|
|
109
|
+
if (!this.open || !this.#o || !this._popoverEl) return;
|
|
110
|
+
const o = await P(
|
|
111
|
+
this.#o,
|
|
112
|
+
this._popoverEl,
|
|
113
|
+
{
|
|
114
|
+
placement: this.placement,
|
|
115
|
+
strategy: "fixed",
|
|
116
|
+
middleware: this.#c
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
/* v8 ignore if -- @preserve */
|
|
120
|
+
this.open && (this.#d(o), this.arrow && this._arrowEl && this.#h(o));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
#d(o) {
|
|
126
|
+
const { x: e, y: s } = o;
|
|
127
|
+
Object.assign(this._popoverEl.style, {
|
|
128
|
+
left: `${e}px`,
|
|
129
|
+
top: `${s}px`,
|
|
130
|
+
visibility: o.middlewareData.hide?.referenceHidden ? "hidden" : "visible"
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* @internal
|
|
135
|
+
*/
|
|
136
|
+
#h(o) {
|
|
137
|
+
/* v8 ignore if -- @preserve */
|
|
138
|
+
if (!this._arrowEl) return;
|
|
139
|
+
const { x: e, y: s } = o.middlewareData.arrow, t = {
|
|
140
|
+
left: "calc(100% - 4px)",
|
|
141
|
+
right: "-4px",
|
|
142
|
+
top: "calc(100% - 4px)",
|
|
143
|
+
bottom: "-4px"
|
|
144
|
+
}, l = o.placement.split("-")[0];
|
|
145
|
+
Object.assign(this._arrowEl.style, {
|
|
146
|
+
left: e ? `${e}px` : t[l],
|
|
147
|
+
top: s ? `${s}px` : t[l]
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
#r;
|
|
151
|
+
connectedCallback() {
|
|
152
|
+
super.connectedCallback(), this.#t();
|
|
153
|
+
/* v8 ignore else -- @preserve */
|
|
154
|
+
this._popoverEl && (this._popoverEl.addEventListener("toggle", this.#r), this.open && !this._popoverEl.matches(":popover-open") && (this._popoverEl.showPopover(), this.#e()));
|
|
155
|
+
}
|
|
156
|
+
disconnectedCallback() {
|
|
157
|
+
super.disconnectedCallback(), this.#i?.(), this.#o && (this.#a(this.#o), this.#o = null);
|
|
158
|
+
/* v8 ignore else -- @preserve */
|
|
159
|
+
this._popoverEl && this._popoverEl.removeEventListener("toggle", this.#r);
|
|
160
|
+
}
|
|
161
|
+
// --- Methods ---
|
|
162
|
+
show() {
|
|
163
|
+
return this.open = !0, this.#n ?? Promise.resolve();
|
|
164
|
+
}
|
|
165
|
+
hide() {
|
|
166
|
+
this.open = !1;
|
|
167
|
+
}
|
|
168
|
+
toggle() {
|
|
169
|
+
this.open = !this.open;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
r([
|
|
173
|
+
n({ mode: "fromView" })
|
|
174
|
+
], i.prototype, "placement");
|
|
175
|
+
r([
|
|
176
|
+
n({ mode: "boolean" })
|
|
177
|
+
], i.prototype, "manual");
|
|
178
|
+
r([
|
|
179
|
+
n({ mode: "fromView" })
|
|
180
|
+
], i.prototype, "layout");
|
|
181
|
+
r([
|
|
182
|
+
n({
|
|
183
|
+
attribute: "offset",
|
|
184
|
+
mode: "fromView",
|
|
185
|
+
converter: f
|
|
186
|
+
})
|
|
187
|
+
], i.prototype, "offset");
|
|
188
|
+
r([
|
|
189
|
+
n({
|
|
190
|
+
mode: "boolean"
|
|
191
|
+
})
|
|
192
|
+
], i.prototype, "alternate");
|
|
193
|
+
r([
|
|
194
|
+
n({ attribute: "dismiss-button-aria-label" })
|
|
195
|
+
], i.prototype, "dismissButtonAriaLabel");
|
|
196
|
+
r([
|
|
197
|
+
n({ mode: "boolean" })
|
|
198
|
+
], i.prototype, "arrow");
|
|
199
|
+
r([
|
|
200
|
+
n({ mode: "boolean" })
|
|
201
|
+
], i.prototype, "open");
|
|
202
|
+
r([
|
|
203
|
+
v
|
|
204
|
+
], i.prototype, "anchor");
|
|
205
|
+
r([
|
|
206
|
+
v
|
|
207
|
+
], i.prototype, "_slottedAnchor");
|
|
208
|
+
const I = ({ open: a, manual: o, layout: e }) => F(
|
|
209
|
+
"control",
|
|
210
|
+
["open", !!a],
|
|
211
|
+
["manual", !!o],
|
|
212
|
+
["condensed", e === "condensed"]
|
|
213
|
+
), U = (a) => {
|
|
214
|
+
const o = a.tagFor(m), e = a.tagFor(V), s = a.tagFor(B);
|
|
215
|
+
return p`
|
|
216
|
+
<slot name="anchor" ${z("_slottedAnchor")}></slot>
|
|
217
|
+
<${o}>
|
|
218
|
+
<div class="base"
|
|
219
|
+
${d("_popoverEl")}
|
|
220
|
+
popover="${(t) => t.manual ? "manual" : "auto"}"
|
|
221
|
+
tabindex="-1"
|
|
222
|
+
autofocus
|
|
223
|
+
${L({
|
|
224
|
+
role: "dialog",
|
|
225
|
+
ariaModal: "false"
|
|
226
|
+
})}
|
|
227
|
+
>
|
|
228
|
+
<div class="${I}"
|
|
229
|
+
part="${(t) => t.alternate ? "vvd-theme-alternate" : ""}">
|
|
230
|
+
<slot></slot>
|
|
231
|
+
<slot name="footer"></slot>
|
|
232
|
+
${h(
|
|
233
|
+
(t) => t.manual,
|
|
234
|
+
p`<${e}
|
|
235
|
+
aria-label="${(t) => t.dismissButtonAriaLabel || t.locale.popover.dismissButtonLabel}"
|
|
236
|
+
type="button"
|
|
237
|
+
size="condensed"
|
|
238
|
+
class="dismiss-button"
|
|
239
|
+
@click="${(t) => t.hide()}">
|
|
240
|
+
<${s} name="close-line" slot="icon"></${s}>
|
|
241
|
+
</${e}>`
|
|
242
|
+
)}
|
|
243
|
+
${h(
|
|
244
|
+
(t) => t.arrow,
|
|
245
|
+
p`<div class="arrow" ${d("_arrowEl")}></div>`
|
|
246
|
+
)}
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
</${o}>
|
|
250
|
+
`;
|
|
251
|
+
}, j = w(
|
|
252
|
+
"popover",
|
|
253
|
+
i,
|
|
254
|
+
U,
|
|
255
|
+
[O, D, u],
|
|
256
|
+
{
|
|
257
|
+
styles: H,
|
|
258
|
+
shadowOptions: {
|
|
259
|
+
delegatesFocus: !0
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
), N = g(j);
|
|
263
|
+
N();
|