@voidable/ui 0.9.0 → 0.11.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/dist/base-entry.d.ts +1 -0
- package/dist/base.d.ts +8 -1
- package/dist/base.js +5 -1
- package/dist/chunks/base-BGrS4eIl.js +307 -0
- package/dist/chunks/data-BpiiNapL.js +95 -0
- package/dist/chunks/{keyboard-MQpfTX5I.js → keyboard-CEhMSkws.js} +19 -3
- package/dist/chunks/{modal-hivQ4YoU.js → modal-DWGkNdNG.js} +3 -3
- package/dist/chunks/{overlay-BywGMcDW.js → overlay-CH7L4N-h.js} +2 -2
- package/dist/chunks/{parts-CMQQop0D.js → parts-DI_3VpSy.js} +21 -17
- package/dist/chunks/{base-CMruMbxC.js → projection-oPe6ipjL.js} +105 -389
- package/dist/components/accordion.js +2 -2
- package/dist/components/action-input.d.ts +2 -2
- package/dist/components/action-input.js +56 -54
- package/dist/components/alert.d.ts +11 -0
- package/dist/components/alert.js +11 -4
- package/dist/components/avatar.js +13 -11
- package/dist/components/badge.d.ts +8 -2
- package/dist/components/badge.js +1 -4
- package/dist/components/banner.d.ts +9 -0
- package/dist/components/banner.js +11 -4
- package/dist/components/bar-chart.d.ts +21 -7
- package/dist/components/bar-chart.js +67 -43
- package/dist/components/breadcrumbs.js +2 -2
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.d.ts +40 -2
- package/dist/components/calendar.js +170 -79
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +20 -19
- package/dist/components/charts/data.d.ts +72 -0
- package/dist/components/checkbox-group.js +13 -12
- package/dist/components/checkbox.js +17 -16
- package/dist/components/collapsible.js +2 -2
- package/dist/components/color-picker.js +26 -24
- package/dist/components/combobox.js +17 -16
- package/dist/components/compose-input.js +13 -11
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +11 -9
- package/dist/components/donut-chart.d.ts +22 -6
- package/dist/components/donut-chart.js +96 -68
- package/dist/components/drawer.d.ts +2 -2
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +4 -4
- package/dist/components/editable.js +13 -12
- package/dist/components/error-fallback.js +2 -2
- package/dist/components/field.js +10 -9
- package/dist/components/file-upload.d.ts +20 -5
- package/dist/components/file-upload.js +52 -20
- package/dist/components/gauge.d.ts +32 -8
- package/dist/components/gauge.js +209 -135
- package/dist/components/hamburger.d.ts +12 -1
- package/dist/components/hamburger.js +33 -20
- package/dist/components/hover-card.js +3 -3
- package/dist/components/indicator.js +14 -12
- package/dist/components/input.js +41 -39
- package/dist/components/line-chart.d.ts +22 -7
- package/dist/components/line-chart.js +80 -56
- package/dist/components/list.js +1 -1
- package/dist/components/menu.js +3 -3
- package/dist/components/multiselect.js +30 -29
- package/dist/components/nav-bar.d.ts +9 -0
- package/dist/components/nav-bar.js +16 -3
- package/dist/components/nav-menu.js +20 -19
- package/dist/components/number-input.js +17 -15
- package/dist/components/pagination.js +22 -20
- package/dist/components/panel.js +2 -2
- package/dist/components/pin-input.js +32 -30
- package/dist/components/popover.js +3 -3
- package/dist/components/progress.js +14 -12
- package/dist/components/radio-group.js +13 -11
- package/dist/components/radio.d.ts +25 -0
- package/dist/components/radio.js +78 -29
- package/dist/components/scroll-area.js +8 -7
- package/dist/components/segmented-control.js +21 -21
- package/dist/components/select.js +49 -47
- package/dist/components/sidebar.d.ts +2 -2
- package/dist/components/sidebar.js +2 -2
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +16 -14
- package/dist/components/spinner.js +11 -9
- package/dist/components/stat.d.ts +13 -1
- package/dist/components/stat.js +29 -19
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.js +15 -13
- package/dist/components/switch.js +14 -12
- package/dist/components/table.d.ts +4 -0
- package/dist/components/table.js +42 -29
- package/dist/components/tabs.js +29 -29
- package/dist/components/tag.js +9 -8
- package/dist/components/tags-input.js +24 -22
- package/dist/components/textarea.js +34 -32
- package/dist/components/toast.d.ts +19 -2
- package/dist/components/toast.js +43 -10
- package/dist/components/toggle-group.js +16 -15
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.js +3 -3
- package/dist/components.json +15 -13
- package/dist/custom-elements.json +320 -88
- package/dist/dev/types.d.ts +3 -1
- package/dist/dev.js +85 -16
- package/dist/index.js +1 -1
- package/dist/keyboard.d.ts +10 -0
- package/dist/llms.txt +1 -1
- package/dist/parts.d.ts +5 -0
- package/dist/projection-api.d.ts +23 -0
- package/dist/projection.d.ts +8 -2
- package/dist/reference.md +84 -59
- package/dist/types/elements.d.ts +13 -13
- package/dist/types/react.d.ts +2 -2
- package/dist/types/solid.d.ts +2 -2
- package/dist/types/svelte.d.ts +2 -2
- package/dist/types/vue.d.ts +2 -2
- package/dist/vscode.html-custom-data.json +108 -28
- package/dist/web-types.json +189 -60
- package/package.json +1 -1
|
@@ -1,19 +1,28 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, r as t } from "./base-BGrS4eIl.js";
|
|
2
2
|
//#region src/projection.ts
|
|
3
|
-
var n =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
var n = {
|
|
4
|
+
create: (e) => void new k(e),
|
|
5
|
+
strip: (e) => D(e),
|
|
6
|
+
isFocusParked: (e) => b(e),
|
|
7
|
+
restoreParkedFocus: (e) => x(e)
|
|
8
|
+
};
|
|
9
|
+
function r() {
|
|
10
|
+
t.current = n;
|
|
7
11
|
}
|
|
12
|
+
var i = "void-projection", a = "/void-projection", o = "data-void-projection", s = "data-void-chrome", c = "data-void-wrap", l = "void-item", u = Symbol.for("@voidable/ui:projection-park");
|
|
8
13
|
function d(e) {
|
|
14
|
+
let t = e, n = t[u];
|
|
15
|
+
return (!n || n.parentNode !== e.documentElement) && (n = e.createElement("void-projection-park"), n.hidden = !0, e.documentElement.appendChild(n), t[u] = n), n;
|
|
16
|
+
}
|
|
17
|
+
function f(e) {
|
|
9
18
|
if (e.firstChild) return;
|
|
10
19
|
let t = e.ownerDocument;
|
|
11
|
-
t[
|
|
20
|
+
t[u] === e && delete t[u], e.remove();
|
|
12
21
|
}
|
|
13
|
-
var
|
|
14
|
-
function
|
|
22
|
+
var p = (e) => e.nodeType === Node.ELEMENT_NODE, m = (e) => e.nodeType === Node.COMMENT_NODE, h = (e) => m(e) && (e.data === i || e.data === a) || p(e) && e.hasAttribute(s), g = (e) => m(e) || e.nodeType === Node.TEXT_NODE && !(e.textContent ?? "").trim(), _ = (e) => m(e) && e.data === l, v = Symbol.for("@voidable/ui:projection-focus");
|
|
23
|
+
function y(e) {
|
|
15
24
|
let t = e.ownerDocument, n = t.activeElement;
|
|
16
|
-
if (t[
|
|
25
|
+
if (t[v] && !t[v].restored || !n || n === t.body || !e.contains(n)) return;
|
|
17
26
|
let r = n, i = null;
|
|
18
27
|
try {
|
|
19
28
|
typeof r.selectionStart == "number" && typeof r.selectionEnd == "number" && (i = [
|
|
@@ -33,23 +42,23 @@ function v(e) {
|
|
|
33
42
|
scroll: [n.scrollTop, n.scrollLeft],
|
|
34
43
|
within: o
|
|
35
44
|
};
|
|
36
|
-
t[
|
|
37
|
-
t[
|
|
45
|
+
t[v] = s, setTimeout(() => {
|
|
46
|
+
t[v] === s && delete t[v];
|
|
38
47
|
}, 100);
|
|
39
48
|
}
|
|
40
|
-
function y(e) {
|
|
41
|
-
let t = e.ownerDocument[_];
|
|
42
|
-
return !!t && !t.restored && (t.within.has(e) || e.contains(t.el));
|
|
43
|
-
}
|
|
44
49
|
function b(e) {
|
|
45
|
-
|
|
50
|
+
let t = e.ownerDocument[v];
|
|
51
|
+
return !!t && !t.restored && (t.within.has(e) || e.contains(t.el));
|
|
46
52
|
}
|
|
47
53
|
function x(e) {
|
|
48
|
-
|
|
54
|
+
S(e);
|
|
55
|
+
}
|
|
56
|
+
function S(e) {
|
|
57
|
+
let t = e[v];
|
|
49
58
|
if (!t || !t.el.isConnected) return;
|
|
50
59
|
let { el: n } = t, r = e.activeElement;
|
|
51
60
|
if (r && r !== e.body && r !== n && !t.within.has(r)) {
|
|
52
|
-
delete e[
|
|
61
|
+
delete e[v];
|
|
53
62
|
return;
|
|
54
63
|
}
|
|
55
64
|
if (e.activeElement === n && t.restored || (e.activeElement !== n && (t.restored = !1, n.focus({ preventScroll: !0 })), e.activeElement !== n)) return;
|
|
@@ -60,25 +69,25 @@ function x(e) {
|
|
|
60
69
|
} catch {}
|
|
61
70
|
n.scrollTop !== t.scroll[0] && (n.scrollTop = t.scroll[0]), n.scrollLeft !== t.scroll[1] && (n.scrollLeft = t.scroll[1]);
|
|
62
71
|
}
|
|
63
|
-
function
|
|
72
|
+
function C(e, t, n) {
|
|
64
73
|
if (t.parentNode === e && t.nextSibling === n && t !== n) return;
|
|
65
74
|
let r = e;
|
|
66
|
-
if (typeof r.moveBefore == "function" && t.isConnected && e.isConnected && !
|
|
75
|
+
if (typeof r.moveBefore == "function" && t.isConnected && e.isConnected && !w(e, t)) try {
|
|
67
76
|
r.moveBefore(t, n);
|
|
68
77
|
return;
|
|
69
78
|
} catch {}
|
|
70
|
-
let i =
|
|
79
|
+
let i = T(t);
|
|
71
80
|
Node.prototype.insertBefore.call(e, t, n), i?.();
|
|
72
81
|
}
|
|
73
|
-
function
|
|
74
|
-
let n = (e) =>
|
|
82
|
+
function w(e, t) {
|
|
83
|
+
let n = (e) => p(e) ? e.localName : "";
|
|
75
84
|
return [
|
|
76
85
|
"select",
|
|
77
86
|
"optgroup",
|
|
78
87
|
"datalist"
|
|
79
88
|
].includes(n(e)) || ["option", "optgroup"].includes(n(t));
|
|
80
89
|
}
|
|
81
|
-
function
|
|
90
|
+
function T(e) {
|
|
82
91
|
let t = e.ownerDocument, n = t?.activeElement;
|
|
83
92
|
if (!t || !n || n === t.body || !e.contains(n)) return null;
|
|
84
93
|
let r = n, i = null;
|
|
@@ -97,38 +106,38 @@ function w(e) {
|
|
|
97
106
|
} catch {}
|
|
98
107
|
};
|
|
99
108
|
}
|
|
100
|
-
function
|
|
101
|
-
for (let t = e.firstChild; t; t = t.nextSibling) if (
|
|
109
|
+
function E(e) {
|
|
110
|
+
for (let t = e.firstChild; t; t = t.nextSibling) if (h(t)) return !0;
|
|
102
111
|
return !1;
|
|
103
112
|
}
|
|
104
|
-
function
|
|
113
|
+
function D(e) {
|
|
105
114
|
let t = e;
|
|
106
|
-
if (!
|
|
107
|
-
t[
|
|
108
|
-
let n = Array.from(e.childNodes),
|
|
115
|
+
if (!E(e)) return !!t[O];
|
|
116
|
+
t[O] = !0;
|
|
117
|
+
let n = Array.from(e.childNodes), r = n.findIndex((e) => m(e) && e.data === i), s = n.findIndex((e, t) => t > r && m(e) && e.data === a), l = n.filter((e, t) => h(e) || r >= 0 && s > r && t > r && t < s);
|
|
109
118
|
for (let t of l) {
|
|
110
|
-
if (!
|
|
111
|
-
let n = (e) => e.hasAttribute(
|
|
119
|
+
if (!p(t)) continue;
|
|
120
|
+
let n = (e) => e.hasAttribute(o), r = [t, ...Array.from(t.querySelectorAll(`[${o}]`))].filter(n);
|
|
112
121
|
for (let i of r) {
|
|
113
122
|
let r = !0;
|
|
114
123
|
for (let t = i.parentElement; t && t !== e; t = t.parentElement) t !== i && (n(t) || t.localName.includes("-")) && (r = !1);
|
|
115
124
|
if (r) for (let n of Array.from(i.childNodes)) {
|
|
116
|
-
let r =
|
|
117
|
-
for (let i of r ? Array.from(n.childNodes) : [n])
|
|
125
|
+
let r = p(n) && n.hasAttribute(c);
|
|
126
|
+
for (let i of r ? Array.from(n.childNodes) : [n]) _(i) || Node.prototype.insertBefore.call(e, i, t);
|
|
118
127
|
}
|
|
119
128
|
}
|
|
120
129
|
}
|
|
121
130
|
for (let t of l) t.parentNode === e && Node.prototype.removeChild.call(e, t);
|
|
122
131
|
return !0;
|
|
123
132
|
}
|
|
124
|
-
var
|
|
125
|
-
constructor(
|
|
133
|
+
var O = Symbol.for("@voidable/ui:serialized-copy"), k = class {
|
|
134
|
+
constructor(t, n = {}) {
|
|
126
135
|
this._start = null, this._end = null, this._observer = null, this._observedContainers = /* @__PURE__ */ new Set(), this._placed = /* @__PURE__ */ new WeakMap(), this._chromeTop = [], this._chromeAll = /* @__PURE__ */ new WeakSet(), this._containers = /* @__PURE__ */ new WeakSet(), this._wrapperOf = /* @__PURE__ */ new WeakMap(), this._wrappers = /* @__PURE__ */ new WeakSet(), this._litText = /* @__PURE__ */ new WeakMap(), this._signature = [], this._rendered = !1, this._recovered = !1, this._initialPass = !1, this._sawElement = !1, this._parked = null, this._warned = !1, this._scrolled = null, this._onScroll = (e) => {
|
|
127
136
|
let t = e.target;
|
|
128
137
|
t instanceof Element && t !== this._host && (this._scrolled ??= /* @__PURE__ */ new Set()).add(t);
|
|
129
|
-
}, this._owned = /* @__PURE__ */ new WeakSet(), this._anchorAfter = /* @__PURE__ */ new Map(), this._host =
|
|
130
|
-
let
|
|
131
|
-
|
|
138
|
+
}, this._owned = /* @__PURE__ */ new WeakSet(), this._anchorAfter = /* @__PURE__ */ new Map(), r(), this._host = t, this._regions = n.regions ?? [], this._placement = n.placement ?? (this._regions.length ? "start" : "end"), this._onChange = n.onChange;
|
|
139
|
+
let i = this._host[e];
|
|
140
|
+
i && i !== this && t.removeController(i), this._host[e] = this, t.addController(this);
|
|
132
141
|
}
|
|
133
142
|
hostConnected() {
|
|
134
143
|
let e = this._host;
|
|
@@ -142,12 +151,12 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
142
151
|
!this._observer || !e || !this._host.isConnected || this._observedContainers.has(e) || (this._observedContainers.add(e), this._observer.observe(e, { characterData: !0 }));
|
|
143
152
|
}
|
|
144
153
|
_redirectMarkerText() {
|
|
145
|
-
for (let [e, t] of [[this._start,
|
|
154
|
+
for (let [e, t] of [[this._start, i], [this._end, a]]) {
|
|
146
155
|
if (!e || e.data === t) continue;
|
|
147
156
|
let n = e.data;
|
|
148
157
|
e.data = t;
|
|
149
158
|
let r = this._regions.flatMap((e) => this._regionNodes(e)).find((e) => e.nodeType === Node.TEXT_NODE);
|
|
150
|
-
r ? r.data !== n && (r.data = n) : n &&
|
|
159
|
+
r ? r.data !== n && (r.data = n) : n && C(this._host, this._host.ownerDocument.createTextNode(n), this._placement === "end" ? this._start : null);
|
|
151
160
|
}
|
|
152
161
|
}
|
|
153
162
|
hostDisconnected() {
|
|
@@ -166,12 +175,12 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
166
175
|
let e = [];
|
|
167
176
|
for (let t = this._start.nextSibling; t && t !== this._end; t = t.nextSibling) e.push(t);
|
|
168
177
|
if (this._placement === "end") {
|
|
169
|
-
for (let t of e)
|
|
178
|
+
for (let t of e) C(this._host, t, this._start);
|
|
170
179
|
this._end.nextSibling && (Node.prototype.insertBefore.call(this._host, this._start, null), Node.prototype.insertBefore.call(this._host, this._end, null));
|
|
171
180
|
return;
|
|
172
181
|
}
|
|
173
182
|
let t = this._end.nextSibling;
|
|
174
|
-
for (let n of e)
|
|
183
|
+
for (let n of e) C(this._host, n, t);
|
|
175
184
|
}
|
|
176
185
|
hostUpdated() {
|
|
177
186
|
let e = !this._rendered;
|
|
@@ -196,7 +205,7 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
196
205
|
return n === r || this._wrappers.has(n) && n.parentNode === r;
|
|
197
206
|
}
|
|
198
207
|
append(e) {
|
|
199
|
-
if (!
|
|
208
|
+
if (!p(e) || this._parked || !this._rendered || !this._intact()) return !1;
|
|
200
209
|
let t = this._placed.get(e) ?? this._route(e, "after");
|
|
201
210
|
return !t || typeof t.target != "function" || !t.target() ? !1 : this._place(e, t, null);
|
|
202
211
|
}
|
|
@@ -212,12 +221,12 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
212
221
|
zone: "insert"
|
|
213
222
|
}))) {
|
|
214
223
|
let o = this._wrapperFor(e, a), s = this._anchorAfter.get(t), c = s && s !== o && s.parentNode === r ? s.nextSibling : i ? n.nextSibling : n;
|
|
215
|
-
o !== n &&
|
|
216
|
-
} else
|
|
224
|
+
o !== n && C(r, o, c), this._anchorAfter.set(t, o), C(o, e, this._wrapEnd(o)), this._placed.set(e, a), p(e) && (this._sawElement = !0), this._observeContainer(o);
|
|
225
|
+
} else C(this._host, e, null);
|
|
217
226
|
return e;
|
|
218
227
|
}
|
|
219
228
|
let n = this._route(e, "insert");
|
|
220
|
-
return n?.wrap && n === this._placed.get(t) ? this._place(e, n, t) : n && n === this._placed.get(t) && t.parentNode ? (
|
|
229
|
+
return n?.wrap && n === this._placed.get(t) ? this._place(e, n, t) : n && n === this._placed.get(t) && t.parentNode ? (C(t.parentNode, e, t), this._placed.set(e, n), p(e) && (this._sawElement = !0)) : (!n || !this._place(e, n, null)) && C(this._host, e, null), e;
|
|
221
230
|
}
|
|
222
231
|
replaceContent(e) {
|
|
223
232
|
if (!this._intact()) return !1;
|
|
@@ -228,14 +237,14 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
228
237
|
for (let t of n) e.includes(t) || t.parentNode?.removeChild(t);
|
|
229
238
|
this._sawElement = !1;
|
|
230
239
|
let i = this._placement === "end" ? this._start : null;
|
|
231
|
-
for (let n of e)
|
|
240
|
+
for (let n of e) C(t, n, i);
|
|
232
241
|
return this._rendered && this._reconcile(!0), !0;
|
|
233
242
|
}
|
|
234
243
|
unproject() {
|
|
235
244
|
let e = this._host, t = this._start, n = this._end;
|
|
236
245
|
if (this._parked || !this._rendered || !t || !n || !this._intact()) return !1;
|
|
237
246
|
let r = this._regions.filter((e) => typeof e.target == "function").map((e) => [e, e.target()]).filter((e) => !!e[1]).sort((e, t) => e[1].compareDocumentPosition(t[1]) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1), i = e.ownerDocument, a = i.documentElement, o = !!a && e.isConnected && typeof a.moveBefore == "function";
|
|
238
|
-
|
|
247
|
+
y(e);
|
|
239
248
|
let s = [];
|
|
240
249
|
for (let [e, t] of r) e.scrolls && !this._scrolled?.has(t) && (t.scrollTop || t.scrollLeft) && (this._scrolled ??= /* @__PURE__ */ new Set()).add(t);
|
|
241
250
|
if (this._scrolled) for (let t of this._scrolled) {
|
|
@@ -249,7 +258,7 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
249
258
|
t.scrollLeft
|
|
250
259
|
]) : this._scrolled.delete(t);
|
|
251
260
|
}
|
|
252
|
-
for (let [n] of r) for (let r of this._regionNodes(n))
|
|
261
|
+
for (let [n] of r) for (let r of this._regionNodes(n)) C(e, r, t);
|
|
253
262
|
let c = [];
|
|
254
263
|
for (let e = t; e && (c.push(e), e !== n); e = e.nextSibling);
|
|
255
264
|
let l = {
|
|
@@ -260,8 +269,8 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
260
269
|
scroll: s
|
|
261
270
|
};
|
|
262
271
|
if (o) {
|
|
263
|
-
let e =
|
|
264
|
-
for (let t of c)
|
|
272
|
+
let e = d(i);
|
|
273
|
+
for (let t of c) C(e, t, null);
|
|
265
274
|
l.park = e;
|
|
266
275
|
} else {
|
|
267
276
|
let e = i.createDocumentFragment();
|
|
@@ -276,15 +285,15 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
276
285
|
_restore() {
|
|
277
286
|
let e = this._host, t = this._parked;
|
|
278
287
|
if (!t) return;
|
|
279
|
-
if (this._parked = null, Array.from(e.childNodes).some(
|
|
288
|
+
if (this._parked = null, Array.from(e.childNodes).some(h)) {
|
|
280
289
|
for (let e of t.nodes) e.parentNode?.removeChild(e);
|
|
281
|
-
t.park &&
|
|
290
|
+
t.park && f(t.park), this._init(!0), e.requestUpdate();
|
|
282
291
|
return;
|
|
283
292
|
}
|
|
284
293
|
let n = this._regions.length ? e.firstChild : t.anchor && t.anchor.parentNode === e ? t.anchor : this._placement === "end" ? null : e.firstChild;
|
|
285
294
|
if (t.fragment) Node.prototype.insertBefore.call(e, t.fragment, n);
|
|
286
|
-
else for (let r of t.nodes)
|
|
287
|
-
t.park &&
|
|
295
|
+
else for (let r of t.nodes) C(e, r, n);
|
|
296
|
+
t.park && f(t.park), this._signature = [], this._reconcile(!0), S(e.ownerDocument);
|
|
288
297
|
for (let [e, n, r] of t.scroll) e.scrollTop !== n && (e.scrollTop = n), e.scrollLeft !== r && (e.scrollLeft = r);
|
|
289
298
|
}
|
|
290
299
|
_needsInit() {
|
|
@@ -298,21 +307,21 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
298
307
|
r = !0;
|
|
299
308
|
break;
|
|
300
309
|
}
|
|
301
|
-
return r ? this._chromeTop.every((t) => t.parentNode === e && t.hasAttribute(
|
|
310
|
+
return r ? this._chromeTop.every((t) => t.parentNode === e && t.hasAttribute(s)) : !1;
|
|
302
311
|
}
|
|
303
312
|
_init(e) {
|
|
304
313
|
let t = this._host;
|
|
305
314
|
this._start = null, this._end = null, this._purgeStale();
|
|
306
|
-
let n = t.ownerDocument,
|
|
307
|
-
Node.prototype.insertBefore.call(t, o, this._placement === "end" ? null : t.firstChild), Node.prototype.insertBefore.call(t,
|
|
315
|
+
let n = t.ownerDocument, r = n.createComment(i), o = n.createComment(a);
|
|
316
|
+
Node.prototype.insertBefore.call(t, o, this._placement === "end" ? null : t.firstChild), Node.prototype.insertBefore.call(t, r, o), this._start = r, this._end = o, t.renderOptions.renderBefore = o, this._placed = /* @__PURE__ */ new WeakMap(), this._litText = /* @__PURE__ */ new WeakMap(), this._chromeTop = [], this._chromeAll = /* @__PURE__ */ new WeakSet(), this._containers = /* @__PURE__ */ new WeakSet(), this._wrapperOf = /* @__PURE__ */ new WeakMap(), this._wrappers = /* @__PURE__ */ new WeakSet(), this._observedContainers.clear(), this._signature = [], this._rendered = !1, this._recovered = e, this._sawElement = !1, this._parked = null;
|
|
308
317
|
}
|
|
309
318
|
_purgeStale() {
|
|
310
319
|
let e = this._host, t = [], n = !1;
|
|
311
320
|
for (let r = e.firstChild; r; r = r.nextSibling) r === this._start ? n = !0 : r === this._end ? n = !1 : n || t.push(r);
|
|
312
|
-
let
|
|
321
|
+
let r = t.findIndex((e) => m(e) && e.data === i), o = t.findIndex((e, t) => t > r && m(e) && e.data === a), l = t.filter((e, t) => m(e) && (e.data === i || e.data === a) || r >= 0 && o > r && t > r && t < o ? !0 : p(e) ? e.hasAttribute(s) : this._litText.get(e) === e.data);
|
|
313
322
|
for (let t of l) for (let n of this._staleContainers(t)) for (let r of Array.from(n.childNodes)) {
|
|
314
|
-
let n =
|
|
315
|
-
for (let i of n ? Array.from(r.childNodes) : [r])
|
|
323
|
+
let n = p(r) && (r.hasAttribute(c) || this._wrappers.has(r));
|
|
324
|
+
for (let i of n ? Array.from(r.childNodes) : [r]) _(i) || C(e, i, t);
|
|
316
325
|
}
|
|
317
326
|
for (let t of l) t.parentNode === e && Node.prototype.removeChild.call(e, t);
|
|
318
327
|
this._replaceRecycledChrome();
|
|
@@ -323,14 +332,14 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
323
332
|
let t = e.parentNode;
|
|
324
333
|
if (!t) continue;
|
|
325
334
|
let n = e.cloneNode(!1);
|
|
326
|
-
n.removeAttribute(
|
|
327
|
-
for (let t of Array.from(e.childNodes))
|
|
335
|
+
n.removeAttribute(s), n.removeAttribute(o), n.removeAttribute(c), Node.prototype.insertBefore.call(t, n, e);
|
|
336
|
+
for (let t of Array.from(e.childNodes)) C(n, t, null);
|
|
328
337
|
Node.prototype.removeChild.call(t, e);
|
|
329
338
|
}
|
|
330
339
|
}
|
|
331
340
|
_staleContainers(e) {
|
|
332
|
-
if (!
|
|
333
|
-
let t = (e) => e.hasAttribute(
|
|
341
|
+
if (!p(e)) return [];
|
|
342
|
+
let t = (e) => e.hasAttribute(o) || this._containers.has(e);
|
|
334
343
|
return [e, ...Array.from(e.querySelectorAll("*"))].filter(t).filter((n) => {
|
|
335
344
|
for (let r = n.parentElement; r && r !== e.parentNode; r = r.parentElement) if (r !== n && (t(r) || r.localName.includes("-"))) return !1;
|
|
336
345
|
return !0;
|
|
@@ -340,13 +349,13 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
340
349
|
for (let e of this._regions) {
|
|
341
350
|
if (typeof e.target != "function") continue;
|
|
342
351
|
let t = e.target();
|
|
343
|
-
if (t && (t.hasAttribute(
|
|
352
|
+
if (t && (t.hasAttribute(o) || t.setAttribute(o, e.name), !this._containers.has(t))) {
|
|
344
353
|
for (let e = t.firstChild; e; e = e.nextSibling) this._placed.has(e) || this._owned.add(e);
|
|
345
354
|
this._containers.add(t);
|
|
346
355
|
}
|
|
347
356
|
}
|
|
348
357
|
let e = [];
|
|
349
|
-
for (let t = this._start?.nextSibling; t && t !== this._end; t = t.nextSibling)
|
|
358
|
+
for (let t = this._start?.nextSibling; t && t !== this._end; t = t.nextSibling) p(t) ? (t.hasAttribute(s) || t.setAttribute(s, ""), e.push(t), this._trackChrome(t)) : this._litText.set(t, t.data);
|
|
350
359
|
this._chromeTop = e;
|
|
351
360
|
}
|
|
352
361
|
_trackChrome(e) {
|
|
@@ -372,18 +381,18 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
372
381
|
}
|
|
373
382
|
_place(e, t, n) {
|
|
374
383
|
let r = this._host, i = n && n !== e && this._placed.get(n) === t ? n : null;
|
|
375
|
-
if (t.target === "before")
|
|
376
|
-
else if (t.target === "after") e.parentNode === r && this._isAfterEnd(e) || (i && i.parentNode === r && this._isAfterEnd(i) ?
|
|
384
|
+
if (t.target === "before") C(r, e, i && i.parentNode === r && !this._isAfterEnd(i) ? i : this._start);
|
|
385
|
+
else if (t.target === "after") e.parentNode === r && this._isAfterEnd(e) || (i && i.parentNode === r && this._isAfterEnd(i) ? C(r, e, i) : C(r, e, null));
|
|
377
386
|
else {
|
|
378
387
|
let n = t.target();
|
|
379
388
|
if (!n) return !1;
|
|
380
|
-
if (n.hasAttribute(
|
|
389
|
+
if (n.hasAttribute(o) || n.setAttribute(o, t.name), this._containers.add(n), t.wrap) {
|
|
381
390
|
let r = this._wrapperFor(e, t), a = i ? this._wrapperOf.get(i) : void 0;
|
|
382
|
-
|
|
383
|
-
} else
|
|
391
|
+
C(n, r, a && a.parentNode === n && i.parentNode === a ? a : null), C(r, e, this._wrapEnd(r)), this._observeContainer(r);
|
|
392
|
+
} else C(n, e, i && i.parentNode === n ? i : null);
|
|
384
393
|
this._observeContainer(n);
|
|
385
394
|
}
|
|
386
|
-
return this._placed.set(e, t),
|
|
395
|
+
return this._placed.set(e, t), p(e) && (this._sawElement = !0), !0;
|
|
387
396
|
}
|
|
388
397
|
own(e) {
|
|
389
398
|
this._owned.add(e);
|
|
@@ -393,24 +402,24 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
393
402
|
if (!(!t || !this._containers.has(t))) for (let n = t.firstChild; n; n = n.nextSibling) this._placed.has(n) || this._owned.has(n) || e.accepts && !e.accepts(n, {
|
|
394
403
|
initial: !1,
|
|
395
404
|
zone: "insert"
|
|
396
|
-
}) || (this._placed.set(n, e),
|
|
405
|
+
}) || (this._placed.set(n, e), p(n) && (this._sawElement = !0));
|
|
397
406
|
}
|
|
398
407
|
_wrapperFor(e, t) {
|
|
399
408
|
let n = this._wrapperOf.get(e);
|
|
400
|
-
return n && (e.parentNode === n || Array.from(n.childNodes).some((t) => t !== e && !
|
|
409
|
+
return n && (e.parentNode === n || Array.from(n.childNodes).some((t) => t !== e && !_(t))) && (n = void 0), n || (n = t.wrap(e), n.setAttribute(c, ""), this._wrapperOf.set(e, n), this._wrappers.add(n)), n;
|
|
401
410
|
}
|
|
402
411
|
_wrapEnd(e) {
|
|
403
412
|
let t = e.lastChild;
|
|
404
|
-
if (t &&
|
|
405
|
-
let n = Array.from(e.childNodes).find(
|
|
413
|
+
if (t && _(t)) return t;
|
|
414
|
+
let n = Array.from(e.childNodes).find(_) ?? e.ownerDocument.createComment(l);
|
|
406
415
|
return Node.prototype.insertBefore.call(e, n, null), n;
|
|
407
416
|
}
|
|
408
417
|
_normalizeWrappers(e) {
|
|
409
418
|
let t = e.target();
|
|
410
419
|
if (t) for (let n of Array.from(t.childNodes)) {
|
|
411
|
-
if (!
|
|
420
|
+
if (!p(n) || !this._wrappers.has(n)) continue;
|
|
412
421
|
let r = n, i = !1;
|
|
413
|
-
for (let n of Array.from(r.childNodes)) if (!
|
|
422
|
+
for (let n of Array.from(r.childNodes)) if (!_(n)) {
|
|
414
423
|
if (this._placed.get(n) === e && this._wrapperOf.get(n) === r) {
|
|
415
424
|
i = !0;
|
|
416
425
|
continue;
|
|
@@ -420,17 +429,17 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
420
429
|
zone: "insert"
|
|
421
430
|
})) {
|
|
422
431
|
let a = this._wrapperFor(n, e);
|
|
423
|
-
|
|
432
|
+
C(t, a, i ? r.nextSibling : r), C(a, n, this._wrapEnd(a)), this._placed.set(n, e), p(n) && (this._sawElement = !0), this._observeContainer(a);
|
|
424
433
|
}
|
|
425
434
|
}
|
|
426
435
|
if (!Array.from(r.childNodes).filter((t) => this._placed.get(t) === e && this._wrapperOf.get(t) === r).length) {
|
|
427
|
-
for (let e of Array.from(r.childNodes))
|
|
436
|
+
for (let e of Array.from(r.childNodes)) _(e) || C(t, e, r);
|
|
428
437
|
Node.prototype.removeChild.call(t, r);
|
|
429
438
|
}
|
|
430
439
|
}
|
|
431
440
|
}
|
|
432
441
|
isWrapEnd(e) {
|
|
433
|
-
return
|
|
442
|
+
return _(e) && !!e.parentNode && this._wrappers.has(e.parentNode);
|
|
434
443
|
}
|
|
435
444
|
_isAfterEnd(e) {
|
|
436
445
|
for (let t = this._end?.nextSibling; t; t = t.nextSibling) if (t === e) return !0;
|
|
@@ -454,8 +463,8 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
454
463
|
let t = this._host, n = this._start, r = this._end;
|
|
455
464
|
if (!this._rendered || !n || !r || !this._intact()) return;
|
|
456
465
|
this._redirectMarkerText();
|
|
457
|
-
let i = [],
|
|
458
|
-
for (let e = t.firstChild; e; e = e.nextSibling) e === n ?
|
|
466
|
+
let i = [], a = "before", s = !1, c = this._regions.length > 0;
|
|
467
|
+
for (let e = t.firstChild; e; e = e.nextSibling) e === n ? a = "lit" : e === r ? a = "after" : c ? a !== "lit" && this._placed.get(e)?.target !== a && (i.push([e, a]), s ||= h(e)) : s ||= a !== "lit" && h(e);
|
|
459
468
|
if (s) {
|
|
460
469
|
this._purgeStale(), this._reconcile(e);
|
|
461
470
|
return;
|
|
@@ -463,14 +472,14 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
463
472
|
if (!c && this._placement === "end" && r.nextSibling) {
|
|
464
473
|
let e = [];
|
|
465
474
|
for (let t = r.nextSibling; t; t = t.nextSibling) e.push(t);
|
|
466
|
-
for (let r of e)
|
|
475
|
+
for (let r of e) C(t, r, n);
|
|
467
476
|
}
|
|
468
477
|
if (i.length) {
|
|
469
|
-
let e = new Map(this._regions.map((e) => [e, this._regionNodes(e)[0] ?? null])), n = this._regions.find((e) => e.target === "before"), r = /* @__PURE__ */ new Map(),
|
|
478
|
+
let e = new Map(this._regions.map((e) => [e, this._regionNodes(e)[0] ?? null])), n = this._regions.find((e) => e.target === "before"), r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), s = new Set(i.map((e) => e[0]));
|
|
470
479
|
for (let e = t.lastChild; e; e = e.previousSibling) {
|
|
471
|
-
s.has(e) && r.set(e, new Map(
|
|
480
|
+
s.has(e) && r.set(e, new Map(a));
|
|
472
481
|
let t = this._placed.get(e);
|
|
473
|
-
t &&
|
|
482
|
+
t && a.set(t, e);
|
|
474
483
|
}
|
|
475
484
|
let c = null, l = t.ownerDocument.activeElement, u = () => {
|
|
476
485
|
let e = c;
|
|
@@ -482,12 +491,12 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
482
491
|
}
|
|
483
492
|
let r = t.ownerDocument.createDocumentFragment();
|
|
484
493
|
for (let t of e.nodes) r.appendChild(t);
|
|
485
|
-
Node.prototype.insertBefore.call(n, r, null), n.hasAttribute(
|
|
486
|
-
for (let t of e.nodes) this._placed.set(t, e.region),
|
|
494
|
+
Node.prototype.insertBefore.call(n, r, null), n.hasAttribute(o) || n.setAttribute(o, e.region.name), this._containers.add(n);
|
|
495
|
+
for (let t of e.nodes) this._placed.set(t, e.region), p(t) && (this._sawElement = !0);
|
|
487
496
|
this._observeContainer(n);
|
|
488
497
|
};
|
|
489
498
|
for (let [a, o] of i) {
|
|
490
|
-
if (o === "before" && n && !this._initialPass &&
|
|
499
|
+
if (o === "before" && n && !this._initialPass && g(a)) {
|
|
491
500
|
u(), this._placed.set(a, n);
|
|
492
501
|
continue;
|
|
493
502
|
}
|
|
@@ -498,7 +507,7 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
498
507
|
c && c.region !== i && u(), (c ??= {
|
|
499
508
|
region: i,
|
|
500
509
|
nodes: []
|
|
501
|
-
}).nodes.push(a),
|
|
510
|
+
}).nodes.push(a), p(a) && (this._sawElement = !0);
|
|
502
511
|
continue;
|
|
503
512
|
}
|
|
504
513
|
u(), this._place(a, i, s);
|
|
@@ -508,7 +517,7 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
508
517
|
this._anchorAfter.clear();
|
|
509
518
|
for (let e of this._regions) if (e.wrap && typeof e.target == "function" ? this._normalizeWrappers(e) : typeof e.target == "function" && this._adoptForeign(e), typeof e.target == "function") {
|
|
510
519
|
let t = e.target();
|
|
511
|
-
t && (t.hasAttribute(
|
|
520
|
+
t && (t.hasAttribute(o) || t.setAttribute(o, e.name), this._containers.add(t), this._observeContainer(t));
|
|
512
521
|
}
|
|
513
522
|
if (this._observeMarker(), this._observer?.takeRecords(), this._warnIfRequiredMissing(), !this._onChange) return;
|
|
514
523
|
let l = this._regions.flatMap((e) => this._regionNodes(e)), u = l.length !== this._signature.length || l.some((e, t) => e !== this._signature[t]);
|
|
@@ -516,7 +525,7 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
516
525
|
}
|
|
517
526
|
_warnIfRequiredMissing() {
|
|
518
527
|
if (this._warned || this._host.constructor.enabledWarnings === void 0) return;
|
|
519
|
-
let e = (e) => this._regionNodes(e).some(
|
|
528
|
+
let e = (e) => this._regionNodes(e).some(p);
|
|
520
529
|
for (let t of this._regions) {
|
|
521
530
|
if (!t.required || e(t) || !this._regions.some((n) => n !== t && e(n))) continue;
|
|
522
531
|
let n = t.required();
|
|
@@ -526,299 +535,6 @@ var D = Symbol.for("@voidable/ui:serialized-copy"), O = class {
|
|
|
526
535
|
}
|
|
527
536
|
}
|
|
528
537
|
}
|
|
529
|
-
}, k = Symbol("voidReflectedDefaults"), A = Symbol("voidDefaultsProbe"), j = Symbol("voidReflectAgain");
|
|
530
|
-
function M(e) {
|
|
531
|
-
let t = e.constructor;
|
|
532
|
-
if (Object.prototype.hasOwnProperty.call(t, k)) return t[k];
|
|
533
|
-
let n = /* @__PURE__ */ new Map();
|
|
534
|
-
t[k] = n;
|
|
535
|
-
let r = null;
|
|
536
|
-
try {
|
|
537
|
-
customElements.get(e.localName) === t && (r = Object.assign(new t(), { [A]: !0 }));
|
|
538
|
-
} catch {
|
|
539
|
-
r = null;
|
|
540
|
-
}
|
|
541
|
-
if (!r) return n;
|
|
542
|
-
for (let [e, i] of t.elementProperties) {
|
|
543
|
-
if (!i.reflect || i.attribute === !1) continue;
|
|
544
|
-
let t = typeof i.attribute == "string" ? i.attribute : String(e).toLowerCase(), a = typeof i.converter == "function" || !!i.converter?.fromAttribute;
|
|
545
|
-
n.set(t, {
|
|
546
|
-
prop: e,
|
|
547
|
-
value: r[e],
|
|
548
|
-
custom: a,
|
|
549
|
-
options: i
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
return n;
|
|
553
|
-
}
|
|
554
|
-
var N = Symbol("voidMorphMeta");
|
|
555
|
-
function P(e) {
|
|
556
|
-
let t = e.constructor;
|
|
557
|
-
if (Object.prototype.hasOwnProperty.call(t, N)) return t[N];
|
|
558
|
-
let n = /* @__PURE__ */ new Map();
|
|
559
|
-
for (let [e, r] of t.elementProperties) {
|
|
560
|
-
if (r.attribute === !1) continue;
|
|
561
|
-
let t = typeof r.attribute == "string" ? r.attribute : String(e).toLowerCase();
|
|
562
|
-
n.set(t, !!r.reflect);
|
|
563
|
-
}
|
|
564
|
-
let r = {
|
|
565
|
-
attrs: n,
|
|
566
|
-
drafts: Object.entries(t.clientState ?? {}),
|
|
567
|
-
hook: e.morphedCallback !== B.prototype.morphedCallback,
|
|
568
|
-
edits: t.editState ?? []
|
|
569
|
-
};
|
|
570
|
-
return t[N] = r, r;
|
|
571
|
-
}
|
|
572
|
-
var F = 10, I = 1e3, L = Symbol.for("voidable.dev"), R = Symbol.for("@voidable/ui:morph-participants"), z = /* @__PURE__ */ new WeakMap(), B = class r extends e {
|
|
573
|
-
#e = null;
|
|
574
|
-
#t = null;
|
|
575
|
-
#n = !1;
|
|
576
|
-
#r = !1;
|
|
577
|
-
#i = null;
|
|
578
|
-
#a = void 0;
|
|
579
|
-
#o = void 0;
|
|
580
|
-
#s = !1;
|
|
581
|
-
#c = null;
|
|
582
|
-
static get observedAttributes() {
|
|
583
|
-
let e = super.observedAttributes;
|
|
584
|
-
return this.labelTarget ? [
|
|
585
|
-
...e,
|
|
586
|
-
"aria-label",
|
|
587
|
-
"aria-labelledby"
|
|
588
|
-
] : e;
|
|
589
|
-
}
|
|
590
|
-
#l = null;
|
|
591
|
-
#u(e, t) {
|
|
592
|
-
this.#l || (this.#l = {
|
|
593
|
-
"aria-label": null,
|
|
594
|
-
"aria-labelledby": null,
|
|
595
|
-
written: /* @__PURE__ */ new Map()
|
|
596
|
-
}, this.addController({ hostUpdated: () => this.#d() })), this.#l[e] = t || null, this.removeAttribute(e), this.#d();
|
|
597
|
-
}
|
|
598
|
-
#d() {
|
|
599
|
-
let e = this.#l, t = this.constructor.labelTarget;
|
|
600
|
-
if (!e || !t) return;
|
|
601
|
-
let n = Array.from(this.querySelectorAll(t));
|
|
602
|
-
for (let [t, r] of e.written) if (!n.includes(t)) {
|
|
603
|
-
e.written.delete(t);
|
|
604
|
-
for (let [e, n] of Object.entries(r)) n !== null && t.getAttribute(e) === n && t.removeAttribute(e);
|
|
605
|
-
}
|
|
606
|
-
for (let t of n) {
|
|
607
|
-
let n = e.written.get(t);
|
|
608
|
-
n || e.written.set(t, n = {
|
|
609
|
-
"aria-label": null,
|
|
610
|
-
"aria-labelledby": null
|
|
611
|
-
});
|
|
612
|
-
for (let r of ["aria-label", "aria-labelledby"]) {
|
|
613
|
-
let i = e[r], a = t.getAttribute(r);
|
|
614
|
-
r === "aria-labelledby" && a !== null && a !== n[r] || (i === null ? (n[r] !== null && a === n[r] && a !== null && t.removeAttribute(r), n[r] = null) : (a !== i && t.setAttribute(r, i), n[r] = i));
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
createRenderRoot() {
|
|
619
|
-
return this;
|
|
620
|
-
}
|
|
621
|
-
connectedCallback() {
|
|
622
|
-
this.#a === void 0 && (this.#a = this.#f(this), this.#o = this.outerHTML, !this.__voidProjection && this.render !== e.prototype.render && new O(this)), super.connectedCallback();
|
|
623
|
-
}
|
|
624
|
-
connectedMoveCallback() {}
|
|
625
|
-
#f(e) {
|
|
626
|
-
if (!e.hasAttributes()) return null;
|
|
627
|
-
let { attrs: t } = P(this), n = e.attributes, r = null;
|
|
628
|
-
for (let e = 0; e < n.length; e++) {
|
|
629
|
-
let i = n[e];
|
|
630
|
-
t.has(i.name) && (r ??= /* @__PURE__ */ new Map()).set(i.name, i.value);
|
|
631
|
-
}
|
|
632
|
-
return r;
|
|
633
|
-
}
|
|
634
|
-
shouldUpdate(e) {
|
|
635
|
-
return !this[A] && super.shouldUpdate(e);
|
|
636
|
-
}
|
|
637
|
-
update(n) {
|
|
638
|
-
this.#r = !0;
|
|
639
|
-
try {
|
|
640
|
-
this.render === e.prototype.render ? t.prototype.update.call(this, n) : super.update(n);
|
|
641
|
-
} finally {
|
|
642
|
-
this.#r = !1;
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
setHostAttribute(e, t) {
|
|
646
|
-
let n = t === !0 ? "" : t === !1 || t == null ? null : String(t), r = this.#e ??= /* @__PURE__ */ new Map();
|
|
647
|
-
this.#i && r.get(e) !== n && this.#i.delete(e), r.set(e, n), n === null ? this.hasAttribute(e) && super.removeAttribute(e) : this.getAttribute(e) !== n && super.setAttribute(e, n);
|
|
648
|
-
}
|
|
649
|
-
setHostStyle(e, t) {
|
|
650
|
-
t == null || t === "" ? (this.#t?.delete(e), this.style.removeProperty(e)) : ((this.#t ??= /* @__PURE__ */ new Map()).set(e, t), this.style.getPropertyValue(e) !== t && this.style.setProperty(e, t));
|
|
651
|
-
}
|
|
652
|
-
removeAttribute(e) {
|
|
653
|
-
super.removeAttribute(e), this.#p(e);
|
|
654
|
-
}
|
|
655
|
-
removeAttributeNS(e, t) {
|
|
656
|
-
super.removeAttributeNS(e, t), e || this.#p(t);
|
|
657
|
-
}
|
|
658
|
-
toggleAttribute(e, t) {
|
|
659
|
-
let n = super.toggleAttribute(e, t);
|
|
660
|
-
return n || this.#p(e), n;
|
|
661
|
-
}
|
|
662
|
-
setAttribute(e, t) {
|
|
663
|
-
super.setAttribute(e, t), e === "style" && this.#t?.size && this.#m();
|
|
664
|
-
}
|
|
665
|
-
#p(e) {
|
|
666
|
-
(e === "style" ? this.#t?.size : this.#e?.get(e) != null) && this.#m();
|
|
667
|
-
}
|
|
668
|
-
#m() {
|
|
669
|
-
this.#n || (this.#n = !0, queueMicrotask(() => {
|
|
670
|
-
this.#n = !1, this.#h();
|
|
671
|
-
}));
|
|
672
|
-
}
|
|
673
|
-
#h() {
|
|
674
|
-
if (this.#e) for (let [e, t] of this.#e) t !== null && !this.hasAttribute(e) && this.#g(e) && super.setAttribute(e, t);
|
|
675
|
-
if (this.#t) {
|
|
676
|
-
let e;
|
|
677
|
-
for (let [t, n] of this.#t) if (this.style.getPropertyValue(t) !== n) {
|
|
678
|
-
if (!(e ??= this.#g("style"))) break;
|
|
679
|
-
this.style.setProperty(t, n);
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
#g(e) {
|
|
684
|
-
let t = Date.now(), n = this.#i ??= /* @__PURE__ */ new Map(), r = n.get(e);
|
|
685
|
-
return r && r[0] === Infinity ? !1 : ((!r || t - r[1] > I) && n.set(e, r = [0, t]), ++r[0] <= F ? !0 : (r[0] = Infinity, globalThis[L]?.report?.({
|
|
686
|
-
kind: "attribute-fight",
|
|
687
|
-
tag: this.localName,
|
|
688
|
-
subject: e,
|
|
689
|
-
message: `<${this.localName}> ${e}: something keeps removing this attribute, which the component manages; after ${F} restorations within ${I} ms it is no longer put back. Find the script that removes it (a MutationObserver, a sanitiser) and leave the attribute alone.`,
|
|
690
|
-
element: this
|
|
691
|
-
}), !1));
|
|
692
|
-
}
|
|
693
|
-
attributeChangedCallback(e, t, n) {
|
|
694
|
-
if ((e === "aria-label" || e === "aria-labelledby") && this.constructor.labelTarget) {
|
|
695
|
-
n !== null && this.#u(e, n);
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
if (super.attributeChangedCallback(e, t, n), n !== null || t === null || this.#r) return;
|
|
699
|
-
let r = M(this).get(e);
|
|
700
|
-
if (!r) return;
|
|
701
|
-
let i = this;
|
|
702
|
-
if (!r.custom && r.value !== void 0 && i[r.prop] !== r.value) {
|
|
703
|
-
i[r.prop] = r.value;
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
let { options: a } = r, o = i[r.prop], s = typeof a.converter == "object" ? a.converter : void 0;
|
|
707
|
-
(s?.toAttribute ? s.toAttribute(o, a.type) : a.type === Boolean ? o ? "" : null : o ?? null) != null && this.requestUpdate(r.prop, j);
|
|
708
|
-
}
|
|
709
|
-
insertBefore(e, t) {
|
|
710
|
-
let r = this[n];
|
|
711
|
-
return r && t && t.parentNode !== this && (r.isProjected(t) || r.isWrapEnd(t)) ? r.insertBefore(e, t) : r && !t && r.append(e) ? e : super.insertBefore(e, t);
|
|
712
|
-
}
|
|
713
|
-
removeChild(e) {
|
|
714
|
-
let t = this[n];
|
|
715
|
-
return t && e.parentNode !== this && t.isProjected(e) ? e.parentNode.removeChild(e) : super.removeChild(e);
|
|
716
|
-
}
|
|
717
|
-
replaceChild(e, t) {
|
|
718
|
-
let r = this[n];
|
|
719
|
-
return r && t.parentNode !== this && r.isProjected(t) ? (r.insertBefore(e, t), t.parentNode.removeChild(t)) : super.replaceChild(e, t);
|
|
720
|
-
}
|
|
721
|
-
get textContent() {
|
|
722
|
-
return super.textContent ?? "";
|
|
723
|
-
}
|
|
724
|
-
set textContent(e) {
|
|
725
|
-
let t = this[n], r = e == null ? "" : String(e), i = r ? [this.ownerDocument.createTextNode(r)] : [];
|
|
726
|
-
(!t || !t.replaceContent(i)) && (super.textContent = e);
|
|
727
|
-
}
|
|
728
|
-
replaceChildren(...e) {
|
|
729
|
-
let t = this[n];
|
|
730
|
-
if (t) {
|
|
731
|
-
let n = [];
|
|
732
|
-
for (let t of e) typeof t == "string" ? n.push(this.ownerDocument.createTextNode(t)) : t.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? n.push(...Array.from(t.childNodes)) : n.push(t);
|
|
733
|
-
for (let e of n) if (e.nodeType === Node.DOCUMENT_NODE || e.nodeType === Node.DOCUMENT_TYPE_NODE || e.contains(this)) throw new DOMException(`Failed to execute 'replaceChildren' on '${this.localName}': the new child cannot be inserted here.`, "HierarchyRequestError");
|
|
734
|
-
if (t.replaceContent(n)) return;
|
|
735
|
-
}
|
|
736
|
-
super.replaceChildren(...e);
|
|
737
|
-
}
|
|
738
|
-
voidBeforeMorph(e) {
|
|
739
|
-
if (e && e !== this) {
|
|
740
|
-
e instanceof r && e[n]?.unproject();
|
|
741
|
-
let t = E(e) || (this[R] ?? []).some((t) => t.isCopy?.(e)), i = this.#l;
|
|
742
|
-
if (i) {
|
|
743
|
-
for (let t of ["aria-label", "aria-labelledby"]) i[t] !== null && !e.hasAttribute(t) && (i[t] = null);
|
|
744
|
-
this.#d();
|
|
745
|
-
}
|
|
746
|
-
if (z.get(e) !== this) {
|
|
747
|
-
z.set(e, this);
|
|
748
|
-
for (let t of this[R] ?? []) t.voidBeforeMorph(e);
|
|
749
|
-
this.#_(e, t);
|
|
750
|
-
}
|
|
751
|
-
this.#y(e);
|
|
752
|
-
}
|
|
753
|
-
this.isConnected || E(this);
|
|
754
|
-
let t = this[n];
|
|
755
|
-
return t ? t.parked || t.unproject() : !1;
|
|
756
|
-
}
|
|
757
|
-
voidUnchanged(e) {
|
|
758
|
-
let t = e.outerHTML;
|
|
759
|
-
return t === this.#o && !this.__voidProjection?.parked ? !0 : (this.#o = t, !1);
|
|
760
|
-
}
|
|
761
|
-
voidAfterMorph() {
|
|
762
|
-
return this.__voidProjection?.reproject() ?? this.updateComplete;
|
|
763
|
-
}
|
|
764
|
-
#_(e, t = !1) {
|
|
765
|
-
let n = P(this), i = this.#a ?? null, a = e instanceof r && e.#a !== void 0 ? e.#a : t ? i : this.#f(e), o = null;
|
|
766
|
-
if (i) for (let [e, t] of i) a?.get(e) !== t && (o ??= /* @__PURE__ */ new Set()).add(e);
|
|
767
|
-
if (a) for (let [e, t] of a) i?.get(e) !== t && (o ??= /* @__PURE__ */ new Set()).add(e);
|
|
768
|
-
if (o && (this.#a = a), o && n.edits.length && this.#v()) {
|
|
769
|
-
for (let t of n.edits) {
|
|
770
|
-
if (!o.delete(t)) continue;
|
|
771
|
-
let n = this.getAttribute(t);
|
|
772
|
-
n === null ? e.removeAttribute(t) : e.getAttribute(t) !== n && e.setAttribute(t, n);
|
|
773
|
-
}
|
|
774
|
-
o.size || (o = null);
|
|
775
|
-
}
|
|
776
|
-
let s = this.attributes;
|
|
777
|
-
for (let t = 0; t < s.length; t++) {
|
|
778
|
-
let r = s[t];
|
|
779
|
-
n.attrs.get(r.name) !== !0 || o?.has(r.name) || e.getAttribute(r.name) !== r.value && e.setAttribute(r.name, r.value);
|
|
780
|
-
}
|
|
781
|
-
if (e instanceof r) {
|
|
782
|
-
let t = e.attributes;
|
|
783
|
-
for (let r = t.length - 1; r >= 0; r--) {
|
|
784
|
-
let i = t[r].name;
|
|
785
|
-
n.attrs.get(i) === !0 && !a?.has(i) && !this.hasAttribute(i) && e.removeAttribute(i);
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
if (a) for (let t of a.keys()) n.attrs.get(t) === !0 && !o?.has(t) && !this.hasAttribute(t) && e.removeAttribute(t);
|
|
789
|
-
if (o && n.drafts.length) {
|
|
790
|
-
let e = this;
|
|
791
|
-
for (let [t, r] of n.drafts) r !== null && o.has(r) && e[t] != null && (e[t] = null, this.requestUpdate());
|
|
792
|
-
}
|
|
793
|
-
if (o) for (let e of o) (this.#c ??= /* @__PURE__ */ new Set()).add(e);
|
|
794
|
-
(n.hook || this.#c) && !this.#s && (this.#s = !0, queueMicrotask(() => {
|
|
795
|
-
this.updateComplete.then(() => {
|
|
796
|
-
this.#s = !1;
|
|
797
|
-
let e = this.#c;
|
|
798
|
-
this.#c = null, this.isConnected && (e && this.serverChangedCallback(e), n.hook && this.morphedCallback());
|
|
799
|
-
});
|
|
800
|
-
}));
|
|
801
|
-
}
|
|
802
|
-
#v() {
|
|
803
|
-
let e = this.ownerDocument.activeElement;
|
|
804
|
-
return !!e && e !== this && this.contains(e) || y(this);
|
|
805
|
-
}
|
|
806
|
-
serverChangedCallback(e) {}
|
|
807
|
-
morphedCallback() {}
|
|
808
|
-
#y(e) {
|
|
809
|
-
if (this.#e) {
|
|
810
|
-
let t = e instanceof r ? e.#e : null;
|
|
811
|
-
for (let [n, r] of this.#e) {
|
|
812
|
-
if (r === null) continue;
|
|
813
|
-
let i = e.getAttribute(n);
|
|
814
|
-
(i === null || t?.has(n) && t.get(n) === i) && i !== r && e.setAttribute(n, r);
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
if (this.#t?.size && "style" in e) {
|
|
818
|
-
let t = e.style;
|
|
819
|
-
for (let [e, n] of this.#t) t.getPropertyValue(e) || t.setProperty(e, n);
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
538
|
};
|
|
823
539
|
//#endregion
|
|
824
|
-
export { b as
|
|
540
|
+
export { b as n, r, k as t };
|