@trunkjs/browser-utils 1.0.53 → 1.0.54
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/CHANGELOG.md +4 -0
- package/index.js +191 -180
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
## 1.0.54 (2026-09-07)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for browser-utils to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
1
5
|
## 1.0.53 (2026-09-01)
|
|
2
6
|
|
|
3
7
|
This was a version bump only for browser-utils to align it with other projects, there were no code changes.
|
package/index.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var j = Object.defineProperty;
|
|
2
|
+
var I = (n) => {
|
|
3
3
|
throw TypeError(n);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var f = (n, t, e) =>
|
|
7
|
-
var
|
|
8
|
-
const
|
|
5
|
+
var F = (n, t, e) => t in n ? j(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
6
|
+
var f = (n, t, e) => F(n, typeof t != "symbol" ? t + "" : t, e), L = (n, t, e) => t.has(n) || I("Cannot " + e);
|
|
7
|
+
var c = (n, t, e) => (L(n, t, "read from private field"), e ? e.call(n) : t.get(n)), m = (n, t, e) => t.has(n) ? I("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(n) : t.set(n, e), p = (n, t, e, i) => (L(n, t, "write to private field"), i ? i.call(n, e) : t.set(n, e), e), g = (n, t, e) => (L(n, t, "access private method"), e);
|
|
8
|
+
const k = [
|
|
9
9
|
{ name: "xs", minWidth: 0 },
|
|
10
10
|
{ name: "sm", minWidth: 576 },
|
|
11
11
|
{ name: "md", minWidth: 768 },
|
|
12
12
|
{ name: "lg", minWidth: 992 },
|
|
13
13
|
{ name: "xl", minWidth: 1200 },
|
|
14
14
|
{ name: "xxl", minWidth: 1400 }
|
|
15
|
-
],
|
|
15
|
+
], W = k.reduce(
|
|
16
16
|
(n, t) => (n[t.name] = t.minWidth, n),
|
|
17
17
|
{}
|
|
18
18
|
);
|
|
19
|
-
function
|
|
20
|
-
if (!(n in
|
|
19
|
+
function E(n) {
|
|
20
|
+
if (!(n in W))
|
|
21
21
|
throw new Error(`Unknown breakpoint: ${n}`);
|
|
22
|
-
return
|
|
22
|
+
return W[n];
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function H() {
|
|
25
25
|
return window.visualViewport ? window.visualViewport.width : window.innerWidth;
|
|
26
26
|
}
|
|
27
27
|
function U(n) {
|
|
28
|
-
n === void 0 && (n =
|
|
29
|
-
for (let t =
|
|
30
|
-
if (n >=
|
|
31
|
-
return
|
|
28
|
+
n === void 0 && (n = H());
|
|
29
|
+
for (let t = k.length - 1; t >= 0; t--)
|
|
30
|
+
if (n >= k[t].minWidth)
|
|
31
|
+
return k[t].name;
|
|
32
32
|
return "xs";
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function it(n, t = {}, e = []) {
|
|
35
35
|
Array.isArray(e) || (e = [e]);
|
|
36
36
|
const i = document.createElement(n);
|
|
37
37
|
for (const r in t)
|
|
@@ -40,7 +40,7 @@ function nt(n, t = {}, e = []) {
|
|
|
40
40
|
i.append(typeof r == "string" ? document.createTextNode(r) : r);
|
|
41
41
|
return i;
|
|
42
42
|
}
|
|
43
|
-
class
|
|
43
|
+
class N {
|
|
44
44
|
/**
|
|
45
45
|
*
|
|
46
46
|
* @param delay Debounce delay in milliseconds
|
|
@@ -75,27 +75,27 @@ class C {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function rt(n, t = !1) {
|
|
79
79
|
const e = /* @__PURE__ */ new WeakMap();
|
|
80
80
|
return function(i, r) {
|
|
81
81
|
if (r.kind !== "method") return i;
|
|
82
82
|
const s = r.name;
|
|
83
|
-
return function(...
|
|
84
|
-
let
|
|
85
|
-
|
|
86
|
-
let
|
|
87
|
-
|
|
83
|
+
return function(...o) {
|
|
84
|
+
let a = e.get(this);
|
|
85
|
+
a || (a = /* @__PURE__ */ new Map(), e.set(this, a));
|
|
86
|
+
let d = a.get(s);
|
|
87
|
+
d || (d = new N(n, t), a.set(s, d)), d.debounce(() => i.apply(this, o));
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
const
|
|
92
|
-
function
|
|
91
|
+
const z = /* @__PURE__ */ new Set(["button", "image", "reset", "submit"]);
|
|
92
|
+
function G(n) {
|
|
93
93
|
return n.endsWith("[]") ? n.slice(0, -2) : n;
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function A(n) {
|
|
96
96
|
return n instanceof HTMLInputElement ? n.type.toLowerCase() : "";
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function K(n) {
|
|
99
99
|
if (n instanceof HTMLSelectElement && n.multiple)
|
|
100
100
|
return Array.from(n.selectedOptions, (t) => t.value);
|
|
101
101
|
if (n instanceof HTMLInputElement) {
|
|
@@ -108,7 +108,7 @@ function G(n) {
|
|
|
108
108
|
}
|
|
109
109
|
return n.value;
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function q(n, t) {
|
|
112
112
|
if (n instanceof HTMLSelectElement && n.multiple) {
|
|
113
113
|
const e = new Set(Array.isArray(t) ? t.map(String) : t == null ? [] : [String(t)]);
|
|
114
114
|
for (const i of Array.from(n.options))
|
|
@@ -131,14 +131,14 @@ function K(n, t) {
|
|
|
131
131
|
}
|
|
132
132
|
n.value = t;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function x(n, t, e) {
|
|
135
135
|
if (!(e == null || e === !1)) {
|
|
136
136
|
if (e instanceof FormData) {
|
|
137
137
|
e.forEach((i, r) => n.append(r, i));
|
|
138
138
|
return;
|
|
139
139
|
}
|
|
140
140
|
if (Array.isArray(e)) {
|
|
141
|
-
e.forEach((i) =>
|
|
141
|
+
e.forEach((i) => x(n, t, i));
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
if (e instanceof Blob) {
|
|
@@ -148,7 +148,7 @@ function A(n, t, e) {
|
|
|
148
148
|
n.append(t, String(e));
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
class
|
|
151
|
+
class st {
|
|
152
152
|
constructor(t) {
|
|
153
153
|
this.root = t;
|
|
154
154
|
}
|
|
@@ -160,10 +160,10 @@ class rt {
|
|
|
160
160
|
name: i,
|
|
161
161
|
element: e,
|
|
162
162
|
get value() {
|
|
163
|
-
return
|
|
163
|
+
return K(e);
|
|
164
164
|
},
|
|
165
165
|
set value(r) {
|
|
166
|
-
|
|
166
|
+
q(e, r);
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
169
|
}
|
|
@@ -186,20 +186,20 @@ class rt {
|
|
|
186
186
|
for (const e of this.entries) {
|
|
187
187
|
if (this.isDisabled(e.element))
|
|
188
188
|
continue;
|
|
189
|
-
const i =
|
|
189
|
+
const i = A(e.element);
|
|
190
190
|
if (i === "checkbox" || i === "radio") {
|
|
191
191
|
const r = e.element;
|
|
192
|
-
r.checked &&
|
|
192
|
+
r.checked && x(t, e.name, r.value);
|
|
193
193
|
continue;
|
|
194
194
|
}
|
|
195
|
-
|
|
195
|
+
x(t, e.name, e.value);
|
|
196
196
|
}
|
|
197
197
|
return t;
|
|
198
198
|
}
|
|
199
199
|
get groupedEntries() {
|
|
200
200
|
const t = /* @__PURE__ */ new Map();
|
|
201
201
|
for (const e of this.entries) {
|
|
202
|
-
const i =
|
|
202
|
+
const i = G(e.name), r = t.get(i) ?? [];
|
|
203
203
|
r.push(e), t.set(i, r);
|
|
204
204
|
}
|
|
205
205
|
return t;
|
|
@@ -210,7 +210,7 @@ class rt {
|
|
|
210
210
|
return (e == null ? void 0 : e.trim()) || ((i = t.getAttribute("name")) == null ? void 0 : i.trim()) || null;
|
|
211
211
|
}
|
|
212
212
|
isValueElement(t) {
|
|
213
|
-
return !("value" in t) || t instanceof HTMLButtonElement ? !1 : !(t instanceof HTMLInputElement &&
|
|
213
|
+
return !("value" in t) || t instanceof HTMLButtonElement ? !1 : !(t instanceof HTMLInputElement && z.has(t.type.toLowerCase()));
|
|
214
214
|
}
|
|
215
215
|
/** A named value element owns its value, so its descendants are not collected twice. */
|
|
216
216
|
hasValueElementParent(t) {
|
|
@@ -227,18 +227,18 @@ class rt {
|
|
|
227
227
|
}
|
|
228
228
|
readGroup(t) {
|
|
229
229
|
var r;
|
|
230
|
-
const e = new Set(t.map((s) =>
|
|
230
|
+
const e = new Set(t.map((s) => A(s.element))), i = t.some((s) => s.name.endsWith("[]"));
|
|
231
231
|
return e.size === 1 && e.has("radio") ? (r = t.find((s) => s.element.checked)) == null ? void 0 : r.element.value : e.size === 1 && e.has("checkbox") ? t.length === 1 && !i ? t[0].element.checked : t.filter((s) => s.element.checked).map((s) => s.element.value) : i ? t.flatMap((s) => {
|
|
232
|
-
const
|
|
233
|
-
return
|
|
232
|
+
const o = s.value;
|
|
233
|
+
return o === void 0 ? [] : Array.isArray(o) ? o : [o];
|
|
234
234
|
}) : t.length === 1 ? t[0].value : t.map((s) => s.value).at(-1);
|
|
235
235
|
}
|
|
236
236
|
writeGroup(t, e) {
|
|
237
|
-
const i = new Set(t.map((s) =>
|
|
237
|
+
const i = new Set(t.map((s) => A(s.element))), r = t.some((s) => s.name.endsWith("[]"));
|
|
238
238
|
if (i.size === 1 && i.has("radio")) {
|
|
239
239
|
t.forEach((s) => {
|
|
240
|
-
const
|
|
241
|
-
|
|
240
|
+
const o = s.element;
|
|
241
|
+
o.checked = o.value === String(e);
|
|
242
242
|
});
|
|
243
243
|
return;
|
|
244
244
|
}
|
|
@@ -248,15 +248,15 @@ class rt {
|
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
250
|
const s = new Set((Array.isArray(e) ? e : e == null ? [] : [e]).map(String));
|
|
251
|
-
t.forEach((
|
|
252
|
-
const
|
|
253
|
-
|
|
251
|
+
t.forEach((o) => {
|
|
252
|
+
const a = o.element;
|
|
253
|
+
a.checked = s.has(a.value);
|
|
254
254
|
});
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
if (r && Array.isArray(e) && t.length > 1) {
|
|
258
|
-
t.forEach((s,
|
|
259
|
-
s.value = e[
|
|
258
|
+
t.forEach((s, o) => {
|
|
259
|
+
s.value = e[o];
|
|
260
260
|
});
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
@@ -265,7 +265,7 @@ class rt {
|
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
267
|
}
|
|
268
|
-
function
|
|
268
|
+
function ot(n) {
|
|
269
269
|
if (typeof n.lineNumber == "number")
|
|
270
270
|
return {
|
|
271
271
|
file: n.fileName || n.sourceURL,
|
|
@@ -287,7 +287,7 @@ function st(n) {
|
|
|
287
287
|
}
|
|
288
288
|
return { file: n.fileName || n.sourceURL };
|
|
289
289
|
}
|
|
290
|
-
class
|
|
290
|
+
class J {
|
|
291
291
|
constructor(t, e, i, r = "main") {
|
|
292
292
|
this._debug = t, this.myTag = e, this.myElementId = i, this.instanceId = r;
|
|
293
293
|
}
|
|
@@ -308,7 +308,7 @@ class q {
|
|
|
308
308
|
throw this.error(...t), new Error(e);
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
class
|
|
311
|
+
class at {
|
|
312
312
|
constructor(t, e = !0) {
|
|
313
313
|
f(this, "label");
|
|
314
314
|
f(this, "last");
|
|
@@ -338,10 +338,10 @@ class ot {
|
|
|
338
338
|
return this.running;
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
function
|
|
341
|
+
function X(n) {
|
|
342
342
|
return typeof n == "object" && n !== null && !Array.isArray(n);
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function Q(n) {
|
|
345
345
|
if (n != null)
|
|
346
346
|
try {
|
|
347
347
|
return JSON.parse(n);
|
|
@@ -349,28 +349,28 @@ function X(n) {
|
|
|
349
349
|
return;
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function $(n) {
|
|
353
353
|
const t = JSON.stringify(n);
|
|
354
354
|
return t === void 0 ? "null" : t;
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function Y(n, t) {
|
|
357
357
|
const e = { ...t };
|
|
358
|
-
if (
|
|
358
|
+
if (X(n))
|
|
359
359
|
for (const i of Object.keys(t))
|
|
360
360
|
i in n && (e[i] = n[i]);
|
|
361
361
|
return e;
|
|
362
362
|
}
|
|
363
|
-
class
|
|
363
|
+
class D {
|
|
364
364
|
constructor(t, e, i) {
|
|
365
365
|
f(this, "cache");
|
|
366
366
|
this.backend = t, this.storageKey = e, this.initialValue = i;
|
|
367
367
|
}
|
|
368
368
|
read() {
|
|
369
369
|
if (this.cache) return this.cache;
|
|
370
|
-
const t = this.backend ?
|
|
370
|
+
const t = this.backend ? Q(this.backend.getItem(this.storageKey)) : void 0, e = Y(t, this.initialValue);
|
|
371
371
|
if (this.backend && this.backend.getItem(this.storageKey) == null)
|
|
372
372
|
try {
|
|
373
|
-
this.backend.setItem(this.storageKey,
|
|
373
|
+
this.backend.setItem(this.storageKey, $(e));
|
|
374
374
|
} catch {
|
|
375
375
|
}
|
|
376
376
|
return this.cache = e, e;
|
|
@@ -378,7 +378,7 @@ class I {
|
|
|
378
378
|
write(t) {
|
|
379
379
|
if (this.cache = t, !!this.backend)
|
|
380
380
|
try {
|
|
381
|
-
this.backend.setItem(this.storageKey,
|
|
381
|
+
this.backend.setItem(this.storageKey, $(t));
|
|
382
382
|
} catch {
|
|
383
383
|
}
|
|
384
384
|
}
|
|
@@ -392,8 +392,8 @@ class I {
|
|
|
392
392
|
},
|
|
393
393
|
set: (e, i, r) => {
|
|
394
394
|
if (typeof i != "string") return !1;
|
|
395
|
-
const
|
|
396
|
-
return
|
|
395
|
+
const o = { ...this.read() };
|
|
396
|
+
return o[i] = r, this.write(o), !0;
|
|
397
397
|
},
|
|
398
398
|
deleteProperty: (e, i) => {
|
|
399
399
|
if (typeof i != "string") return !1;
|
|
@@ -426,47 +426,47 @@ class I {
|
|
|
426
426
|
return new Proxy({}, t);
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function B(n) {
|
|
430
430
|
const t = globalThis.window;
|
|
431
431
|
return (n === "session" ? t == null ? void 0 : t.sessionStorage : t == null ? void 0 : t.localStorage) ?? void 0;
|
|
432
432
|
}
|
|
433
|
-
function at(n, t) {
|
|
434
|
-
return new I(W("session"), n, t).asProxy();
|
|
435
|
-
}
|
|
436
433
|
function ut(n, t) {
|
|
437
|
-
return new
|
|
434
|
+
return new D(B("session"), n, t).asProxy();
|
|
438
435
|
}
|
|
439
|
-
function
|
|
436
|
+
function ct(n, t) {
|
|
437
|
+
return new D(B("local"), n, t).asProxy();
|
|
438
|
+
}
|
|
439
|
+
function _(n, t, e) {
|
|
440
440
|
return new Promise((i, r) => {
|
|
441
|
-
const s = (
|
|
442
|
-
n.removeEventListener(t, s, e), i(
|
|
441
|
+
const s = (o) => {
|
|
442
|
+
n.removeEventListener(t, s, e), i(o);
|
|
443
443
|
};
|
|
444
444
|
n.addEventListener(t, s, e);
|
|
445
445
|
});
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function Z() {
|
|
448
448
|
return document.readyState === "loading" ? new Promise((n) => {
|
|
449
449
|
document.addEventListener("DOMContentLoaded", () => n());
|
|
450
450
|
}) : Promise.resolve();
|
|
451
451
|
}
|
|
452
|
-
function ct() {
|
|
453
|
-
return window.tj_loader_state ? window.tj_loader_state !== "loading" ? Promise.resolve() : x(window, "loader:ready") : M();
|
|
454
|
-
}
|
|
455
452
|
function dt() {
|
|
456
|
-
return window.tj_loader_state ? window.tj_loader_state
|
|
453
|
+
return window.tj_loader_state ? window.tj_loader_state !== "loading" ? Promise.resolve() : _(window, "loader:ready") : C();
|
|
457
454
|
}
|
|
458
455
|
function lt() {
|
|
459
|
-
return window.tj_loader_state ? window.tj_loader_state === "visual" ? Promise.resolve() :
|
|
456
|
+
return window.tj_loader_state ? window.tj_loader_state === "pre-visual" || window.tj_loader_state === "visual" ? Promise.resolve() : _(window, "loader:pre-visual") : C();
|
|
460
457
|
}
|
|
461
|
-
function
|
|
458
|
+
function ht() {
|
|
459
|
+
return window.tj_loader_state ? window.tj_loader_state === "visual" ? Promise.resolve() : _(window, "loader:visual") : C();
|
|
460
|
+
}
|
|
461
|
+
function C(n = window) {
|
|
462
462
|
return n || (n = window), n === window ? document.readyState === "complete" ? Promise.resolve() : new Promise((t) => window.addEventListener("load", () => t(), { once: !0 })) : n instanceof HTMLImageElement ? n.complete && n.naturalWidth !== 0 ? Promise.resolve() : new Promise((t, e) => {
|
|
463
463
|
n.addEventListener("load", () => t(), { once: !0 }), n.addEventListener("error", () => e(new Error("image error")), { once: !0 });
|
|
464
464
|
}) : n instanceof HTMLMediaElement ? n.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA ? Promise.resolve() : new Promise((t) => n.addEventListener("loadeddata", () => t(), { once: !0 })) : new Promise((t) => n.addEventListener("load", () => t(), { once: !0 }));
|
|
465
465
|
}
|
|
466
|
-
function
|
|
466
|
+
function ft(n) {
|
|
467
467
|
return new Promise((t) => setTimeout(t, n));
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function mt(n) {
|
|
470
470
|
return new Promise((t) => {
|
|
471
471
|
const e = (i) => {
|
|
472
472
|
n.removeEventListener("animationend", e), t(i);
|
|
@@ -474,99 +474,99 @@ function ft(n) {
|
|
|
474
474
|
n.addEventListener("animationend", e);
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
|
-
function
|
|
477
|
+
function gt(n) {
|
|
478
478
|
var e, i;
|
|
479
479
|
class t extends n {
|
|
480
480
|
constructor() {
|
|
481
481
|
super(...arguments);
|
|
482
|
-
m(this, e, new
|
|
482
|
+
m(this, e, new N(200, 5e3));
|
|
483
483
|
f(this, "currentBreakPoint", null);
|
|
484
484
|
m(this, i, async () => {
|
|
485
|
-
var
|
|
486
|
-
await
|
|
487
|
-
const
|
|
488
|
-
let
|
|
489
|
-
if (!
|
|
485
|
+
var h;
|
|
486
|
+
await c(this, e).wait(), await Z();
|
|
487
|
+
const o = this, a = window.innerWidth;
|
|
488
|
+
let d = getComputedStyle(o).getPropertyValue("--breakpoint");
|
|
489
|
+
if (!d || d === "")
|
|
490
490
|
return;
|
|
491
|
-
|
|
492
|
-
const
|
|
493
|
-
this.currentBreakPoint !==
|
|
491
|
+
d = d.trim().replace(/^['"]|['"]$/g, "");
|
|
492
|
+
const w = d.split(","), y = w[0].trim(), u = ((h = w[1]) == null ? void 0 : h.trim()) ?? y, l = U(a);
|
|
493
|
+
this.currentBreakPoint !== l && (E(u) <= E(l) ? o.setAttribute("mode", "desktop") : E(y) > E(l) ? o.setAttribute("mode", "mobile") : o.setAttribute("mode", "tablet"));
|
|
494
494
|
});
|
|
495
495
|
}
|
|
496
496
|
connectedCallback() {
|
|
497
497
|
super.connectedCallback();
|
|
498
498
|
try {
|
|
499
|
-
|
|
500
|
-
} catch (
|
|
501
|
-
throw console.error("Error in BreakPointMixin:",
|
|
499
|
+
c(this, i).call(this), window.addEventListener("resize", c(this, i)), c(this, i).call(this);
|
|
500
|
+
} catch (o) {
|
|
501
|
+
throw console.error("Error in BreakPointMixin:", o, "in element", this), o;
|
|
502
502
|
}
|
|
503
503
|
}
|
|
504
504
|
disconnectedCallback() {
|
|
505
|
-
super.disconnectedCallback(), window.removeEventListener("resize",
|
|
505
|
+
super.disconnectedCallback(), window.removeEventListener("resize", c(this, i));
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
return e = new WeakMap(), i = new WeakMap(), t;
|
|
509
509
|
}
|
|
510
|
-
const
|
|
511
|
-
function
|
|
510
|
+
const v = Symbol("listenerDefs"), V = Symbol("withEventBindings");
|
|
511
|
+
function wt(n, t) {
|
|
512
512
|
const e = Array.isArray(n) ? n : [n];
|
|
513
513
|
return function(i, r) {
|
|
514
514
|
if (r.kind !== "method") throw new Error("@Listen nur für Methoden");
|
|
515
515
|
return r.addInitializer(function() {
|
|
516
516
|
const s = this;
|
|
517
|
-
(s[
|
|
517
|
+
(s[v] || (s[v] = [])).push({
|
|
518
518
|
method: r.name,
|
|
519
519
|
events: [...e],
|
|
520
520
|
opts: t
|
|
521
521
|
});
|
|
522
522
|
}), function(...s) {
|
|
523
|
-
if (!this[
|
|
523
|
+
if (!this[V])
|
|
524
524
|
throw new Error("[EventBindings] @Listen - decorator requires EventBindingMixin.");
|
|
525
525
|
return i.apply(this, s);
|
|
526
526
|
};
|
|
527
527
|
};
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function tt(n, t) {
|
|
530
530
|
var e;
|
|
531
531
|
return !t || t === "host" ? n : t === "document" ? n.ownerDocument ?? document : t === "window" ? ((e = n.ownerDocument) == null ? void 0 : e.defaultView) ?? window : t === "shadowRoot" ? n.shadowRoot ?? n : typeof t == "function" ? t(n) : t;
|
|
532
532
|
}
|
|
533
|
-
function
|
|
534
|
-
var e, i,
|
|
533
|
+
function yt(n) {
|
|
534
|
+
var e, i, R;
|
|
535
535
|
class t extends n {
|
|
536
|
-
constructor(...
|
|
537
|
-
super(...
|
|
536
|
+
constructor(...a) {
|
|
537
|
+
super(...a);
|
|
538
538
|
m(this, i);
|
|
539
539
|
m(this, e);
|
|
540
|
-
this[
|
|
540
|
+
this[V] = !0;
|
|
541
541
|
}
|
|
542
542
|
connectedCallback() {
|
|
543
|
-
var
|
|
544
|
-
(
|
|
543
|
+
var a;
|
|
544
|
+
(a = super.connectedCallback) == null || a.call(this), g(this, i, R).call(this);
|
|
545
545
|
}
|
|
546
546
|
disconnectedCallback() {
|
|
547
|
-
var
|
|
548
|
-
(
|
|
547
|
+
var a, d;
|
|
548
|
+
(a = c(this, e)) == null || a.abort(), (d = super.disconnectedCallback) == null || d.call(this);
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
return e = new WeakMap(), i = new WeakSet(),
|
|
552
|
-
var
|
|
553
|
-
(
|
|
554
|
-
const
|
|
555
|
-
for (const
|
|
556
|
-
const
|
|
557
|
-
for (const
|
|
558
|
-
|
|
551
|
+
return e = new WeakMap(), i = new WeakSet(), R = function() {
|
|
552
|
+
var d, w, y;
|
|
553
|
+
(d = c(this, e)) == null || d.abort(), p(this, e, new AbortController());
|
|
554
|
+
const a = this[v] || [];
|
|
555
|
+
for (const u of a) {
|
|
556
|
+
const l = tt(this, (w = u.opts) == null ? void 0 : w.target), h = ((y = u.opts) == null ? void 0 : y.options) ?? {}, b = this[u.method].bind(this);
|
|
557
|
+
for (const T of u.events)
|
|
558
|
+
l.addEventListener(T, b, { ...h, signal: c(this, e).signal });
|
|
559
559
|
}
|
|
560
560
|
}, t;
|
|
561
561
|
}
|
|
562
|
-
let
|
|
563
|
-
function
|
|
562
|
+
let et = 1;
|
|
563
|
+
function pt(n) {
|
|
564
564
|
var e, i, r;
|
|
565
565
|
class t extends n {
|
|
566
566
|
constructor() {
|
|
567
567
|
super(...arguments);
|
|
568
568
|
m(this, e, null);
|
|
569
|
-
m(this, i,
|
|
569
|
+
m(this, i, et++);
|
|
570
570
|
m(this, r, null);
|
|
571
571
|
}
|
|
572
572
|
/**
|
|
@@ -574,33 +574,33 @@ function yt(n) {
|
|
|
574
574
|
* on the next log/warn/error call.
|
|
575
575
|
*/
|
|
576
576
|
invalidateDebugCache() {
|
|
577
|
-
|
|
577
|
+
p(this, e, null);
|
|
578
578
|
}
|
|
579
579
|
get _debug() {
|
|
580
|
-
return
|
|
580
|
+
return c(this, e) !== null ? c(this, e) : (this instanceof HTMLElement && p(this, e, this.hasAttribute("debug") && !["false", "0", "off", "no"].includes(this.getAttribute("debug") || "")), c(this, e) === !0 && console.info(
|
|
581
581
|
// @ts-expect-error - it says tagName is not defined -whatever
|
|
582
|
-
`[DEBUG][ID:${
|
|
582
|
+
`[DEBUG][ID:${c(this, i)}] LoggingMixin: Debug mode is enabled for <${this.tagName}>`,
|
|
583
583
|
this
|
|
584
|
-
),
|
|
584
|
+
), c(this, e) ?? !1);
|
|
585
585
|
}
|
|
586
|
-
getLogger(
|
|
587
|
-
const
|
|
588
|
-
return
|
|
586
|
+
getLogger(a = "main") {
|
|
587
|
+
const d = "<" + (this.tagName || this.constructor.name || "UnknownElement") + ">";
|
|
588
|
+
return c(this, r) || p(this, r, new J(this._debug, d, `${c(this, i)}`, a)), c(this, r);
|
|
589
589
|
}
|
|
590
|
-
debug(...
|
|
591
|
-
this.getLogger().debug(...
|
|
590
|
+
debug(...a) {
|
|
591
|
+
this.getLogger().debug(...a);
|
|
592
592
|
}
|
|
593
|
-
log(...
|
|
594
|
-
this.getLogger().log(...
|
|
593
|
+
log(...a) {
|
|
594
|
+
this.getLogger().log(...a);
|
|
595
595
|
}
|
|
596
|
-
warn(...
|
|
597
|
-
this.getLogger().warn(...
|
|
596
|
+
warn(...a) {
|
|
597
|
+
this.getLogger().warn(...a);
|
|
598
598
|
}
|
|
599
|
-
error(...
|
|
600
|
-
this.getLogger().error(...
|
|
599
|
+
error(...a) {
|
|
600
|
+
this.getLogger().error(...a);
|
|
601
601
|
}
|
|
602
|
-
throwError(...
|
|
603
|
-
return this.getLogger().throwError(...
|
|
602
|
+
throwError(...a) {
|
|
603
|
+
return this.getLogger().throwError(...a);
|
|
604
604
|
}
|
|
605
605
|
}
|
|
606
606
|
return e = new WeakMap(), i = new WeakMap(), r = new WeakMap(), t;
|
|
@@ -647,61 +647,72 @@ function bt(n) {
|
|
|
647
647
|
}
|
|
648
648
|
return t;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
651
|
-
var e,
|
|
650
|
+
function Et(n) {
|
|
651
|
+
var e, i, M, S, o, P, O;
|
|
652
652
|
class t extends n {
|
|
653
653
|
constructor() {
|
|
654
654
|
super(...arguments);
|
|
655
|
-
m(this,
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
655
|
+
m(this, i);
|
|
656
|
+
// Slots können bei Lit-Updates neu entstehen; die WeakMap verhindert doppelte Listener auf bestehenden Slots.
|
|
657
|
+
m(this, e, /* @__PURE__ */ new WeakMap());
|
|
658
|
+
m(this, o, (u) => {
|
|
659
|
+
g(this, i, S).call(this, u.target);
|
|
659
660
|
});
|
|
660
661
|
}
|
|
661
|
-
firstUpdated(
|
|
662
|
-
var
|
|
663
|
-
(
|
|
662
|
+
firstUpdated(u) {
|
|
663
|
+
var l;
|
|
664
|
+
(l = super.firstUpdated) == null || l.call(this, u), g(this, i, M).call(this);
|
|
665
|
+
}
|
|
666
|
+
updated(u) {
|
|
667
|
+
var l;
|
|
668
|
+
(l = super.updated) == null || l.call(this, u), g(this, i, M).call(this);
|
|
664
669
|
}
|
|
665
670
|
}
|
|
666
|
-
return e = new WeakSet(),
|
|
667
|
-
var
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
671
|
+
return e = new WeakMap(), i = new WeakSet(), M = function() {
|
|
672
|
+
var l;
|
|
673
|
+
const u = (l = this.shadowRoot) == null ? void 0 : l.querySelectorAll("slot");
|
|
674
|
+
u == null || u.forEach((h) => {
|
|
675
|
+
if (g(this, i, S).call(this, h), !c(this, e).has(h)) {
|
|
676
|
+
const b = (T) => c(this, o).call(this, T);
|
|
677
|
+
c(this, e).set(h, b), h.addEventListener("slotchange", b);
|
|
678
|
+
}
|
|
671
679
|
});
|
|
672
|
-
},
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
680
|
+
}, S = function(u) {
|
|
681
|
+
const l = g(this, i, P).call(this, u.assignedNodes({ flatten: !0 })), h = g(this, i, P).call(this, u.childNodes);
|
|
682
|
+
l || h ? u.classList.remove("slot-empty") : u.classList.add("slot-empty");
|
|
683
|
+
}, o = new WeakMap(), P = function(u) {
|
|
684
|
+
return Array.from(u).some((l) => g(this, i, O).call(this, l));
|
|
685
|
+
}, O = function(u) {
|
|
686
|
+
return u.nodeType === Node.TEXT_NODE ? (u.textContent || "").trim().length > 0 : u.nodeType === Node.ELEMENT_NODE;
|
|
676
687
|
}, t;
|
|
677
688
|
}
|
|
678
689
|
export {
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
690
|
+
gt as BreakPointMixin,
|
|
691
|
+
N as Debouncer,
|
|
692
|
+
yt as EventBindingsMixin,
|
|
693
|
+
st as FormDataAccessor,
|
|
694
|
+
wt as Listen,
|
|
684
695
|
bt as LoaderMixin,
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
696
|
+
J as Logger,
|
|
697
|
+
pt as LoggingMixin,
|
|
698
|
+
Et as SlotVisibilityMixin,
|
|
699
|
+
at as Stopwatch,
|
|
700
|
+
W as breakpointMap,
|
|
701
|
+
k as breakpoints,
|
|
702
|
+
it as create_element,
|
|
703
|
+
rt as debounce,
|
|
704
|
+
E as getBreakpointMinWidth,
|
|
694
705
|
U as getCurrentBreakpoint,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
706
|
+
ot as getErrorLocation,
|
|
707
|
+
H as getViewportWidth,
|
|
708
|
+
ct as local_storage,
|
|
709
|
+
ut as session_storage,
|
|
710
|
+
ft as sleep,
|
|
711
|
+
_ as waitFor,
|
|
712
|
+
mt as waitForAnimationEnd,
|
|
713
|
+
Z as waitForDomContentLoaded,
|
|
714
|
+
C as waitForLoad,
|
|
715
|
+
lt as waitForPreVisual,
|
|
716
|
+
dt as waitForReady,
|
|
717
|
+
ht as waitForVisual
|
|
707
718
|
};
|