@trunkjs/browser-utils 1.0.24 → 1.0.26
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 +8 -0
- package/index.d.ts +1 -0
- package/index.js +163 -135
- package/mixins/BreakPointMixin.d.ts +3 -1
- package/mixins/EventBindingsMixin.d.ts +2 -2
- package/mixins/LoggingMixin.d.ts +3 -3
- package/mixins/SlotVisibilityMixin.d.ts +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
## 1.0.26 (2026-01-23)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for browser-utils to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 1.0.25 (2026-01-22)
|
|
6
|
+
|
|
7
|
+
This was a version bump only for browser-utils to align it with other projects, there were no code changes.
|
|
8
|
+
|
|
1
9
|
## 1.0.24 (2025-12-23)
|
|
2
10
|
|
|
3
11
|
This was a version bump only for browser-utils to align it with other projects, there were no code changes.
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var D = Object.defineProperty;
|
|
2
|
+
var T = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
const
|
|
5
|
+
var $ = (t, e, n) => e in t ? D(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
6
|
+
var c = (t, e, n) => $(t, typeof e != "symbol" ? e + "" : e, n), y = (t, e, n) => e.has(t) || T("Cannot " + n);
|
|
7
|
+
var u = (t, e, n) => (y(t, e, "read from private field"), n ? n.call(t) : e.get(t)), m = (t, e, n) => e.has(t) ? T("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), w = (t, e, n, i) => (y(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n), b = (t, e, n) => (y(t, e, "access private method"), n);
|
|
8
|
+
const p = [
|
|
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
|
+
], v = p.reduce(
|
|
16
16
|
(t, e) => (t[e.name] = e.minWidth, t),
|
|
17
17
|
{}
|
|
18
18
|
);
|
|
19
|
-
function
|
|
20
|
-
if (!(t in
|
|
19
|
+
function E(t) {
|
|
20
|
+
if (!(t in v))
|
|
21
21
|
throw new Error(`Unknown breakpoint: ${t}`);
|
|
22
|
-
return
|
|
22
|
+
return v[t];
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function R(t) {
|
|
25
25
|
t === void 0 && (t = window.innerWidth);
|
|
26
|
-
for (let e =
|
|
27
|
-
if (t >=
|
|
28
|
-
return
|
|
26
|
+
for (let e = p.length - 1; e >= 0; e--)
|
|
27
|
+
if (t >= p[e].minWidth)
|
|
28
|
+
return p[e].name;
|
|
29
29
|
return "xs";
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function O(t, e = {}, n = []) {
|
|
32
32
|
Array.isArray(n) || (n = [n]);
|
|
33
33
|
const i = document.createElement(t);
|
|
34
|
-
for (const
|
|
35
|
-
e[
|
|
36
|
-
for (const
|
|
37
|
-
i.append(typeof
|
|
34
|
+
for (const s in e)
|
|
35
|
+
e[s] !== null && e[s] !== void 0 && i.setAttribute(s, e[s] !== !0 ? e[s] : "");
|
|
36
|
+
for (const s of n)
|
|
37
|
+
i.append(typeof s == "string" ? document.createTextNode(s) : s);
|
|
38
38
|
return i;
|
|
39
39
|
}
|
|
40
|
-
class
|
|
40
|
+
class k {
|
|
41
41
|
/**
|
|
42
42
|
*
|
|
43
43
|
* @param delay Debounce delay in milliseconds
|
|
44
44
|
* @param max_delay Maximum delay in milliseconds, if false then no maximum delay is applied
|
|
45
45
|
*/
|
|
46
46
|
constructor(e, n = !1) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
c(this, "timeout", null);
|
|
48
|
+
c(this, "startTimeWithMs", 0);
|
|
49
|
+
c(this, "maxTimeout", null);
|
|
50
50
|
this.delay = e, this.max_delay = n;
|
|
51
51
|
}
|
|
52
52
|
async wait() {
|
|
@@ -63,25 +63,25 @@ class T {
|
|
|
63
63
|
this.timeout && (clearTimeout(this.timeout), this.timeout = null), this.maxTimeout && (clearTimeout(this.maxTimeout), this.maxTimeout = null), this.startTimeWithMs = 0, e();
|
|
64
64
|
};
|
|
65
65
|
if (this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(i, this.delay), this.max_delay !== !1 && !this.maxTimeout) {
|
|
66
|
-
const
|
|
67
|
-
this.maxTimeout = setTimeout(i,
|
|
66
|
+
const s = n - this.startTimeWithMs, a = Math.max(0, this.max_delay - s);
|
|
67
|
+
this.maxTimeout = setTimeout(i, a);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function F(t, e = !1) {
|
|
72
72
|
const n = /* @__PURE__ */ new WeakMap();
|
|
73
|
-
return function(i,
|
|
74
|
-
if (
|
|
75
|
-
const
|
|
76
|
-
return function(...
|
|
77
|
-
let
|
|
78
|
-
|
|
79
|
-
let
|
|
80
|
-
|
|
73
|
+
return function(i, s) {
|
|
74
|
+
if (s.kind !== "method") return i;
|
|
75
|
+
const a = s.name;
|
|
76
|
+
return function(...h) {
|
|
77
|
+
let r = n.get(this);
|
|
78
|
+
r || (r = /* @__PURE__ */ new Map(), n.set(this, r));
|
|
79
|
+
let o = r.get(a);
|
|
80
|
+
o || (o = new k(t, e), r.set(a, o)), o.debounce(() => i.apply(this, h));
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function H(t) {
|
|
85
85
|
if (typeof t.lineNumber == "number")
|
|
86
86
|
return {
|
|
87
87
|
file: t.fileName || t.sourceURL,
|
|
@@ -96,14 +96,14 @@ function F(t) {
|
|
|
96
96
|
};
|
|
97
97
|
const n = String(t.stack || t.message || "").split(`
|
|
98
98
|
`), i = /(.*?)(?:\(|@)?(.*?):(\d+):(\d+)\)?$/;
|
|
99
|
-
for (const
|
|
100
|
-
const
|
|
101
|
-
if (
|
|
102
|
-
return { file:
|
|
99
|
+
for (const s of n) {
|
|
100
|
+
const a = s.match(i);
|
|
101
|
+
if (a)
|
|
102
|
+
return { file: a[2], line: +a[3], column: +a[4] };
|
|
103
103
|
}
|
|
104
104
|
return { file: t.fileName || t.sourceURL };
|
|
105
105
|
}
|
|
106
|
-
class
|
|
106
|
+
class B {
|
|
107
107
|
constructor(e, n, i = "main") {
|
|
108
108
|
this._debug = e, this.myElementId = n, this.instanceId = i;
|
|
109
109
|
}
|
|
@@ -121,13 +121,13 @@ class $ {
|
|
|
121
121
|
throw this.error(...e), new Error(n);
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
class
|
|
124
|
+
class V {
|
|
125
125
|
constructor(e, n = !0) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
c(this, "label");
|
|
127
|
+
c(this, "last");
|
|
128
|
+
c(this, "startTime");
|
|
129
|
+
c(this, "running", !1);
|
|
130
|
+
c(this, "enabled");
|
|
131
131
|
this.label = e, this.enabled = n, this.startTime = this.last = performance.now(), this.running = !0;
|
|
132
132
|
}
|
|
133
133
|
lap(e = "") {
|
|
@@ -151,28 +151,28 @@ class H {
|
|
|
151
151
|
return this.running;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
return new Promise((i,
|
|
156
|
-
const
|
|
157
|
-
t.removeEventListener(e,
|
|
154
|
+
function z(t, e, n) {
|
|
155
|
+
return new Promise((i, s) => {
|
|
156
|
+
const a = (h) => {
|
|
157
|
+
t.removeEventListener(e, a, n), i(h);
|
|
158
158
|
};
|
|
159
|
-
t.addEventListener(e,
|
|
159
|
+
t.addEventListener(e, a, n);
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
|
-
function
|
|
162
|
+
function N() {
|
|
163
163
|
return document.readyState === "loading" ? new Promise((t) => {
|
|
164
164
|
document.addEventListener("DOMContentLoaded", () => t());
|
|
165
165
|
}) : Promise.resolve();
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function G(t = window) {
|
|
168
168
|
return t || (t = window), t === window ? document.readyState === "complete" ? Promise.resolve() : new Promise((e) => window.addEventListener("load", () => e(), { once: !0 })) : t instanceof HTMLImageElement ? t.complete && t.naturalWidth !== 0 ? Promise.resolve() : new Promise((e, n) => {
|
|
169
169
|
t.addEventListener("load", () => e(), { once: !0 }), t.addEventListener("error", () => n(new Error("image error")), { once: !0 });
|
|
170
170
|
}) : t instanceof HTMLMediaElement ? t.readyState >= HTMLMediaElement.HAVE_FUTURE_DATA ? Promise.resolve() : new Promise((e) => t.addEventListener("loadeddata", () => e(), { once: !0 })) : new Promise((e) => t.addEventListener("load", () => e(), { once: !0 }));
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function j(t) {
|
|
173
173
|
return new Promise((e) => setTimeout(e, t));
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function q(t) {
|
|
176
176
|
return new Promise((e) => {
|
|
177
177
|
const n = (i) => {
|
|
178
178
|
t.removeEventListener("animationend", n), e(i);
|
|
@@ -180,139 +180,167 @@ function G(t) {
|
|
|
180
180
|
t.addEventListener("animationend", n);
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
function
|
|
184
|
-
var i;
|
|
185
|
-
|
|
186
|
-
class n extends t {
|
|
183
|
+
function X(t) {
|
|
184
|
+
var n, i;
|
|
185
|
+
class e extends t {
|
|
187
186
|
constructor() {
|
|
188
187
|
super(...arguments);
|
|
189
|
-
|
|
188
|
+
m(this, n, new k(200, 5e3));
|
|
189
|
+
c(this, "currentBreakPoint", null);
|
|
190
190
|
m(this, i, async () => {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
191
|
+
var g;
|
|
192
|
+
await u(this, n).wait(), await N();
|
|
193
|
+
const h = window.innerWidth, r = getComputedStyle(this).getPropertyValue("--breakpoint");
|
|
194
|
+
if (!r || r === "")
|
|
195
|
+
return;
|
|
196
|
+
const o = r.split(","), d = o[0].trim(), f = ((g = o[1]) == null ? void 0 : g.trim()) ?? d, l = R(h);
|
|
197
|
+
this.currentBreakPoint !== l && (E(f) <= E(l) ? this.setAttribute("mode", "desktop") : E(d) > E(l) ? this.setAttribute("mode", "mobile") : this.setAttribute("mode", "tablet"));
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
200
|
connectedCallback() {
|
|
200
|
-
super.connectedCallback(),
|
|
201
|
+
super.connectedCallback(), u(this, i).call(this), window.addEventListener("resize", u(this, i)), u(this, i).call(this);
|
|
201
202
|
}
|
|
202
203
|
disconnectedCallback() {
|
|
203
|
-
super.disconnectedCallback(), window.removeEventListener("resize",
|
|
204
|
+
super.disconnectedCallback(), window.removeEventListener("resize", u(this, i));
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
|
-
return i = new WeakMap(),
|
|
207
|
+
return n = new WeakMap(), i = new WeakMap(), e;
|
|
207
208
|
}
|
|
208
|
-
const
|
|
209
|
-
function
|
|
209
|
+
const L = Symbol("listenerDefs"), M = Symbol("withEventBindings");
|
|
210
|
+
function J(t, e) {
|
|
210
211
|
const n = Array.isArray(t) ? t : [t];
|
|
211
|
-
return function(i,
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
214
|
-
const
|
|
215
|
-
(
|
|
216
|
-
method:
|
|
212
|
+
return function(i, s) {
|
|
213
|
+
if (s.kind !== "method") throw new Error("@Listen nur für Methoden");
|
|
214
|
+
return s.addInitializer(function() {
|
|
215
|
+
const a = this.constructor;
|
|
216
|
+
(a[L] || (a[L] = [])).push({
|
|
217
|
+
method: s.name,
|
|
217
218
|
events: n,
|
|
218
219
|
opts: e
|
|
219
220
|
});
|
|
220
|
-
}), function(...
|
|
221
|
-
if (!this[
|
|
221
|
+
}), function(...a) {
|
|
222
|
+
if (!this[M])
|
|
222
223
|
throw new Error("[EventBindings] @Listen - decorator requires EventBindingMixin.");
|
|
223
|
-
return i.apply(this,
|
|
224
|
+
return i.apply(this, a);
|
|
224
225
|
};
|
|
225
226
|
};
|
|
226
227
|
}
|
|
227
|
-
function
|
|
228
|
+
function _(t, e) {
|
|
228
229
|
var n;
|
|
229
230
|
return !e || e === "host" ? t : e === "document" ? t.ownerDocument ?? document : e === "window" ? ((n = t.ownerDocument) == null ? void 0 : n.defaultView) ?? window : e === "shadowRoot" ? t.shadowRoot ?? t : typeof e == "function" ? e(t) : e;
|
|
230
231
|
}
|
|
231
|
-
function
|
|
232
|
-
var n, i,
|
|
232
|
+
function K(t) {
|
|
233
|
+
var n, i, x;
|
|
233
234
|
class e extends t {
|
|
234
|
-
constructor(...
|
|
235
|
-
super(...
|
|
235
|
+
constructor(...r) {
|
|
236
|
+
super(...r);
|
|
236
237
|
m(this, i);
|
|
237
238
|
m(this, n);
|
|
238
|
-
this[
|
|
239
|
+
this[M] = !0;
|
|
239
240
|
}
|
|
240
241
|
connectedCallback() {
|
|
241
|
-
var
|
|
242
|
-
(
|
|
242
|
+
var r;
|
|
243
|
+
(r = super.connectedCallback) == null || r.call(this), b(this, i, x).call(this);
|
|
243
244
|
}
|
|
244
245
|
disconnectedCallback() {
|
|
245
|
-
var
|
|
246
|
-
(
|
|
246
|
+
var r, o;
|
|
247
|
+
(r = u(this, n)) == null || r.abort(), (o = super.disconnectedCallback) == null || o.call(this);
|
|
247
248
|
}
|
|
248
249
|
}
|
|
249
|
-
return n = new WeakMap(), i = new WeakSet(),
|
|
250
|
-
var
|
|
251
|
-
(
|
|
252
|
-
const
|
|
253
|
-
for (const
|
|
254
|
-
const
|
|
255
|
-
for (const
|
|
256
|
-
|
|
250
|
+
return n = new WeakMap(), i = new WeakSet(), x = function() {
|
|
251
|
+
var o, d, f;
|
|
252
|
+
(o = u(this, n)) == null || o.abort(), w(this, n, new AbortController());
|
|
253
|
+
const r = this.constructor[L] || [];
|
|
254
|
+
for (const l of r) {
|
|
255
|
+
const g = _(this, (d = l.opts) == null ? void 0 : d.target), I = ((f = l.opts) == null ? void 0 : f.options) ?? {}, C = this[l.method].bind(this);
|
|
256
|
+
for (const P of l.events)
|
|
257
|
+
g.addEventListener(P, C, { ...I, signal: u(this, n).signal });
|
|
257
258
|
}
|
|
258
259
|
}, e;
|
|
259
260
|
}
|
|
260
|
-
let
|
|
261
|
-
function
|
|
262
|
-
var n, i,
|
|
261
|
+
let S = 1;
|
|
262
|
+
function Q(t) {
|
|
263
|
+
var n, i, s;
|
|
263
264
|
class e extends t {
|
|
264
265
|
constructor() {
|
|
265
266
|
super(...arguments);
|
|
266
267
|
m(this, n, null);
|
|
267
|
-
m(this, i,
|
|
268
|
-
m(this,
|
|
268
|
+
m(this, i, S++);
|
|
269
|
+
m(this, s, null);
|
|
269
270
|
}
|
|
270
271
|
/**
|
|
271
272
|
* Clears the cached debug flag so the attribute will be checked again
|
|
272
273
|
* on the next log/warn/error call.
|
|
273
274
|
*/
|
|
274
275
|
invalidateDebugCache() {
|
|
275
|
-
|
|
276
|
+
w(this, n, null);
|
|
276
277
|
}
|
|
277
278
|
get _debug() {
|
|
278
|
-
return
|
|
279
|
+
return u(this, n) !== null ? u(this, n) : (this instanceof HTMLElement && w(this, n, this.hasAttribute("debug") && !["false", "0", "off", "no"].includes(this.getAttribute("debug") || "")), u(this, n) === !0 && console.log(`[DEBUG][ID:${u(this, i)}] LoggingMixin: Debug mode is enabled for <${this.tagName}>`, this), u(this, n) ?? !1);
|
|
280
|
+
}
|
|
281
|
+
getLogger(r = "main") {
|
|
282
|
+
return u(this, s) || w(this, s, new B(this._debug, `${u(this, i)}`, r)), u(this, s);
|
|
279
283
|
}
|
|
280
|
-
|
|
281
|
-
|
|
284
|
+
log(...r) {
|
|
285
|
+
this.getLogger().log(...r);
|
|
282
286
|
}
|
|
283
|
-
|
|
284
|
-
this.getLogger().
|
|
287
|
+
warn(...r) {
|
|
288
|
+
this.getLogger().warn(...r);
|
|
285
289
|
}
|
|
286
|
-
|
|
287
|
-
this.getLogger().
|
|
290
|
+
error(...r) {
|
|
291
|
+
this.getLogger().error(...r);
|
|
288
292
|
}
|
|
289
|
-
|
|
290
|
-
this.getLogger().
|
|
293
|
+
throwError(...r) {
|
|
294
|
+
return this.getLogger().throwError(...r);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return n = new WeakMap(), i = new WeakMap(), s = new WeakMap(), e;
|
|
298
|
+
}
|
|
299
|
+
function Y(t) {
|
|
300
|
+
var n, A, s, W;
|
|
301
|
+
class e extends t {
|
|
302
|
+
constructor() {
|
|
303
|
+
super(...arguments);
|
|
304
|
+
m(this, n);
|
|
305
|
+
m(this, s, (o) => {
|
|
306
|
+
const d = o.target;
|
|
307
|
+
d.assignedNodes({ flatten: !0 }).filter((g) => b(this, n, W).call(this, g)).length > 0 && d.classList.remove("slot-empty");
|
|
308
|
+
});
|
|
291
309
|
}
|
|
292
|
-
|
|
293
|
-
|
|
310
|
+
firstUpdated(o) {
|
|
311
|
+
var d;
|
|
312
|
+
(d = super.firstUpdated) == null || d.call(this, o), b(this, n, A).call(this);
|
|
294
313
|
}
|
|
295
314
|
}
|
|
296
|
-
return n = new
|
|
315
|
+
return n = new WeakSet(), A = function() {
|
|
316
|
+
var d;
|
|
317
|
+
const o = (d = this.shadowRoot) == null ? void 0 : d.querySelectorAll("slot");
|
|
318
|
+
o == null || o.forEach((f) => {
|
|
319
|
+
f.classList.add("slot-empty"), f.addEventListener("slotchange", (l) => u(this, s).call(this, l));
|
|
320
|
+
});
|
|
321
|
+
}, s = new WeakMap(), W = function(o) {
|
|
322
|
+
return o.nodeType === Node.TEXT_NODE ? (o.textContent || "").trim().length > 0 : o.nodeType === Node.ELEMENT_NODE;
|
|
323
|
+
}, e;
|
|
297
324
|
}
|
|
298
325
|
export {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
326
|
+
X as BreakPointMixin,
|
|
327
|
+
k as Debouncer,
|
|
328
|
+
K as EventBindingsMixin,
|
|
329
|
+
J as Listen,
|
|
330
|
+
B as Logger,
|
|
331
|
+
Q as LoggingMixin,
|
|
332
|
+
Y as SlotVisibilityMixin,
|
|
333
|
+
V as Stopwatch,
|
|
334
|
+
v as breakpointMap,
|
|
335
|
+
p as breakpoints,
|
|
336
|
+
O as create_element,
|
|
337
|
+
F as debounce,
|
|
338
|
+
E as getBreakpointMinWidth,
|
|
339
|
+
R as getCurrentBreakpoint,
|
|
340
|
+
H as getErrorLocation,
|
|
341
|
+
j as sleep,
|
|
342
|
+
z as waitFor,
|
|
343
|
+
q as waitForAnimationEnd,
|
|
344
|
+
N as waitForDomContentLoaded,
|
|
345
|
+
G as waitForLoad
|
|
318
346
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { Debouncer } from '../lib/Debouncer';
|
|
1
2
|
type Constructor<T = object> = abstract new (...args: any[]) => T;
|
|
2
3
|
export declare function BreakPointMixin<TBase extends Constructor<HTMLElement>>(Base: TBase): (abstract new (...args: any[]) => {
|
|
4
|
+
"__#2877@#debouncer": Debouncer;
|
|
3
5
|
currentBreakPoint: string | null;
|
|
4
|
-
"__#
|
|
6
|
+
"__#2877@#updateBreakPoint": () => Promise<void>;
|
|
5
7
|
connectedCallback(): void;
|
|
6
8
|
disconnectedCallback(): void;
|
|
7
9
|
accessKey: string;
|
|
@@ -9,9 +9,9 @@ type OneOrMany<N extends EventName> = N | readonly N[];
|
|
|
9
9
|
type EventFromInput<I extends OneOrMany<EventName>> = I extends readonly (infer K)[] ? K extends EventName ? DocumentEventMap[K] : never : I extends EventName ? DocumentEventMap[I] : never;
|
|
10
10
|
export declare function Listen<I extends OneOrMany<EventName>>(type: I, opts?: ListenOpts): <This, Fn extends (this: This, ev: EventFromInput<I>, ...args: any[]) => any>(value: Fn, context: ClassMethodDecoratorContext<This, Fn>) => Fn;
|
|
11
11
|
export declare function EventBindingsMixin<TBase extends Ctor<object>>(Base: TBase): (abstract new (...a: any[]) => {
|
|
12
|
-
"__#
|
|
12
|
+
"__#2878@#ac"?: AbortController;
|
|
13
13
|
connectedCallback(): void;
|
|
14
14
|
disconnectedCallback(): void;
|
|
15
|
-
"__#
|
|
15
|
+
"__#2878@#bindEventListeners"(): void;
|
|
16
16
|
}) & TBase;
|
|
17
17
|
export {};
|
package/mixins/LoggingMixin.d.ts
CHANGED
|
@@ -26,14 +26,14 @@ type Constructor<T = object> = abstract new (...args: any[]) => T;
|
|
|
26
26
|
* <my-element debug></my-element> // enables debug logging
|
|
27
27
|
*/
|
|
28
28
|
export declare function LoggingMixin<TBase extends Constructor<object>>(Base: TBase): (abstract new (...args: any[]) => {
|
|
29
|
-
"__#
|
|
30
|
-
"__#
|
|
29
|
+
"__#2879@#debugCached": boolean | null;
|
|
30
|
+
"__#2879@#myElementId": number;
|
|
31
31
|
/**
|
|
32
32
|
* Clears the cached debug flag so the attribute will be checked again
|
|
33
33
|
* on the next log/warn/error call.
|
|
34
34
|
*/
|
|
35
35
|
invalidateDebugCache(): void;
|
|
36
|
-
"__#
|
|
36
|
+
"__#2879@#myLoggerInstance": Logger | null;
|
|
37
37
|
readonly _debug: boolean;
|
|
38
38
|
getLogger(instanceId?: string): Logger;
|
|
39
39
|
log(...args: any[]): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
type Constructor<T = object> = abstract new (...args: any[]) => T;
|
|
3
|
+
export interface SlotVisibilityInterface {
|
|
4
|
+
firstUpdated(changedProperties: Map<string, unknown>): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function SlotVisibilityMixin<TBase extends Constructor<LitElement>>(Base: TBase): TBase & Constructor<SlotVisibilityInterface>;
|
|
7
|
+
export {};
|