@trunkjs/browser-utils 1.0.24 → 1.0.25
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.d.ts +1 -0
- package/index.js +158 -131
- package/mixins/BreakPointMixin.d.ts +1 -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,7 @@
|
|
|
1
|
+
## 1.0.25 (2026-01-22)
|
|
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.24 (2025-12-23)
|
|
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.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
1
|
var A = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var L = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
const
|
|
5
|
+
var $ = (t, e, n) => e in t ? A(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
6
|
+
var l = (t, e, n) => $(t, typeof e != "symbol" ? e + "" : e, n), y = (t, e, n) => e.has(t) || L("Cannot " + n);
|
|
7
|
+
var u = (t, e, n) => (y(t, e, "read from private field"), n ? n.call(t) : e.get(t)), c = (t, e, n) => e.has(t) ? L("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), g = (t, e, n, i) => (y(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n), w = (t, e, n) => (y(t, e, "access private method"), n);
|
|
8
|
+
const b = [
|
|
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
|
+
], T = b.reduce(
|
|
16
16
|
(t, e) => (t[e.name] = e.minWidth, t),
|
|
17
17
|
{}
|
|
18
18
|
);
|
|
19
19
|
function v(t) {
|
|
20
|
-
if (!(t in
|
|
20
|
+
if (!(t in T))
|
|
21
21
|
throw new Error(`Unknown breakpoint: ${t}`);
|
|
22
|
-
return
|
|
22
|
+
return T[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 = b.length - 1; e >= 0; e--)
|
|
27
|
+
if (t >= b[e].minWidth)
|
|
28
|
+
return b[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
|
+
l(this, "timeout", null);
|
|
48
|
+
l(this, "startTimeWithMs", 0);
|
|
49
|
+
l(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(...m) {
|
|
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, m));
|
|
81
81
|
};
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function V(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
|
}
|
|
@@ -123,11 +123,11 @@ class $ {
|
|
|
123
123
|
}
|
|
124
124
|
class H {
|
|
125
125
|
constructor(e, n = !0) {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
l(this, "label");
|
|
127
|
+
l(this, "last");
|
|
128
|
+
l(this, "startTime");
|
|
129
|
+
l(this, "running", !1);
|
|
130
|
+
l(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 = (m) => {
|
|
157
|
+
t.removeEventListener(e, a, n), i(m);
|
|
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,166 @@ function G(t) {
|
|
|
180
180
|
t.addEventListener("animationend", n);
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
function
|
|
183
|
+
function X(t) {
|
|
184
184
|
var i;
|
|
185
|
-
const e = new
|
|
185
|
+
const e = new k(200, 5e3);
|
|
186
186
|
class n extends t {
|
|
187
187
|
constructor() {
|
|
188
188
|
super(...arguments);
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
await e.wait(), await
|
|
192
|
-
const
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
const
|
|
196
|
-
this.currentBreakPoint !==
|
|
189
|
+
l(this, "currentBreakPoint", null);
|
|
190
|
+
c(this, i, async () => {
|
|
191
|
+
await e.wait(), await N();
|
|
192
|
+
const m = window.innerWidth;
|
|
193
|
+
let r = getComputedStyle(this).getPropertyValue("--breakpoint");
|
|
194
|
+
r || (this.style.setProperty("--breakpoint", "md"), r = getComputedStyle(this).getPropertyValue("--breakpoint"));
|
|
195
|
+
const o = R(m);
|
|
196
|
+
this.currentBreakPoint !== o && (v(r) < v(o) ? this.setAttribute("mode", "desktop") : this.setAttribute("mode", "mobile"));
|
|
197
197
|
});
|
|
198
198
|
}
|
|
199
199
|
connectedCallback() {
|
|
200
|
-
super.connectedCallback(),
|
|
200
|
+
super.connectedCallback(), u(this, i).call(this), window.addEventListener("resize", u(this, i)), u(this, i).call(this);
|
|
201
201
|
}
|
|
202
202
|
disconnectedCallback() {
|
|
203
|
-
super.disconnectedCallback(), window.removeEventListener("resize",
|
|
203
|
+
super.disconnectedCallback(), window.removeEventListener("resize", u(this, i));
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
return i = new WeakMap(), n;
|
|
207
207
|
}
|
|
208
|
-
const
|
|
209
|
-
function
|
|
208
|
+
const E = Symbol("listenerDefs"), M = Symbol("withEventBindings");
|
|
209
|
+
function J(t, e) {
|
|
210
210
|
const n = Array.isArray(t) ? t : [t];
|
|
211
|
-
return function(i,
|
|
212
|
-
if (
|
|
213
|
-
return
|
|
214
|
-
const
|
|
215
|
-
(
|
|
216
|
-
method:
|
|
211
|
+
return function(i, s) {
|
|
212
|
+
if (s.kind !== "method") throw new Error("@Listen nur für Methoden");
|
|
213
|
+
return s.addInitializer(function() {
|
|
214
|
+
const a = this.constructor;
|
|
215
|
+
(a[E] || (a[E] = [])).push({
|
|
216
|
+
method: s.name,
|
|
217
217
|
events: n,
|
|
218
218
|
opts: e
|
|
219
219
|
});
|
|
220
|
-
}), function(...
|
|
221
|
-
if (!this[
|
|
220
|
+
}), function(...a) {
|
|
221
|
+
if (!this[M])
|
|
222
222
|
throw new Error("[EventBindings] @Listen - decorator requires EventBindingMixin.");
|
|
223
|
-
return i.apply(this,
|
|
223
|
+
return i.apply(this, a);
|
|
224
224
|
};
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function _(t, e) {
|
|
228
228
|
var n;
|
|
229
229
|
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
230
|
}
|
|
231
|
-
function
|
|
232
|
-
var n, i,
|
|
231
|
+
function K(t) {
|
|
232
|
+
var n, i, x;
|
|
233
233
|
class e extends t {
|
|
234
|
-
constructor(...
|
|
235
|
-
super(...
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
this[
|
|
234
|
+
constructor(...r) {
|
|
235
|
+
super(...r);
|
|
236
|
+
c(this, i);
|
|
237
|
+
c(this, n);
|
|
238
|
+
this[M] = !0;
|
|
239
239
|
}
|
|
240
240
|
connectedCallback() {
|
|
241
|
-
var
|
|
242
|
-
(
|
|
241
|
+
var r;
|
|
242
|
+
(r = super.connectedCallback) == null || r.call(this), w(this, i, x).call(this);
|
|
243
243
|
}
|
|
244
244
|
disconnectedCallback() {
|
|
245
|
-
var
|
|
246
|
-
(
|
|
245
|
+
var r, o;
|
|
246
|
+
(r = u(this, n)) == null || r.abort(), (o = super.disconnectedCallback) == null || o.call(this);
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
-
return n = new WeakMap(), i = new WeakSet(),
|
|
250
|
-
var
|
|
251
|
-
(
|
|
252
|
-
const
|
|
253
|
-
for (const h of
|
|
254
|
-
const
|
|
255
|
-
for (const
|
|
256
|
-
|
|
249
|
+
return n = new WeakMap(), i = new WeakSet(), x = function() {
|
|
250
|
+
var o, d, f;
|
|
251
|
+
(o = u(this, n)) == null || o.abort(), g(this, n, new AbortController());
|
|
252
|
+
const r = this.constructor[E] || [];
|
|
253
|
+
for (const h of r) {
|
|
254
|
+
const p = _(this, (d = h.opts) == null ? void 0 : d.target), C = ((f = h.opts) == null ? void 0 : f.options) ?? {}, I = this[h.method].bind(this);
|
|
255
|
+
for (const D of h.events)
|
|
256
|
+
p.addEventListener(D, I, { ...C, signal: u(this, n).signal });
|
|
257
257
|
}
|
|
258
258
|
}, e;
|
|
259
259
|
}
|
|
260
|
-
let
|
|
261
|
-
function
|
|
262
|
-
var n, i,
|
|
260
|
+
let S = 1;
|
|
261
|
+
function Q(t) {
|
|
262
|
+
var n, i, s;
|
|
263
263
|
class e extends t {
|
|
264
264
|
constructor() {
|
|
265
265
|
super(...arguments);
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
266
|
+
c(this, n, null);
|
|
267
|
+
c(this, i, S++);
|
|
268
|
+
c(this, s, null);
|
|
269
269
|
}
|
|
270
270
|
/**
|
|
271
271
|
* Clears the cached debug flag so the attribute will be checked again
|
|
272
272
|
* on the next log/warn/error call.
|
|
273
273
|
*/
|
|
274
274
|
invalidateDebugCache() {
|
|
275
|
-
|
|
275
|
+
g(this, n, null);
|
|
276
276
|
}
|
|
277
277
|
get _debug() {
|
|
278
|
-
return
|
|
278
|
+
return u(this, n) !== null ? u(this, n) : (this instanceof HTMLElement && g(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);
|
|
279
|
+
}
|
|
280
|
+
getLogger(r = "main") {
|
|
281
|
+
return u(this, s) || g(this, s, new B(this._debug, `${u(this, i)}`, r)), u(this, s);
|
|
282
|
+
}
|
|
283
|
+
log(...r) {
|
|
284
|
+
this.getLogger().log(...r);
|
|
279
285
|
}
|
|
280
|
-
|
|
281
|
-
|
|
286
|
+
warn(...r) {
|
|
287
|
+
this.getLogger().warn(...r);
|
|
282
288
|
}
|
|
283
|
-
|
|
284
|
-
this.getLogger().
|
|
289
|
+
error(...r) {
|
|
290
|
+
this.getLogger().error(...r);
|
|
285
291
|
}
|
|
286
|
-
|
|
287
|
-
this.getLogger().
|
|
292
|
+
throwError(...r) {
|
|
293
|
+
return this.getLogger().throwError(...r);
|
|
288
294
|
}
|
|
289
|
-
|
|
290
|
-
|
|
295
|
+
}
|
|
296
|
+
return n = new WeakMap(), i = new WeakMap(), s = new WeakMap(), e;
|
|
297
|
+
}
|
|
298
|
+
function Y(t) {
|
|
299
|
+
var n, W, s, P;
|
|
300
|
+
class e extends t {
|
|
301
|
+
constructor() {
|
|
302
|
+
super(...arguments);
|
|
303
|
+
c(this, n);
|
|
304
|
+
c(this, s, (o) => {
|
|
305
|
+
const d = o.target;
|
|
306
|
+
d.assignedNodes({ flatten: !0 }).filter((p) => w(this, n, P).call(this, p)).length > 0 && d.classList.remove("slot-empty");
|
|
307
|
+
});
|
|
291
308
|
}
|
|
292
|
-
|
|
293
|
-
|
|
309
|
+
firstUpdated(o) {
|
|
310
|
+
var d;
|
|
311
|
+
(d = super.firstUpdated) == null || d.call(this, o), w(this, n, W).call(this);
|
|
294
312
|
}
|
|
295
313
|
}
|
|
296
|
-
return n = new
|
|
314
|
+
return n = new WeakSet(), W = function() {
|
|
315
|
+
var d;
|
|
316
|
+
const o = (d = this.shadowRoot) == null ? void 0 : d.querySelectorAll("slot");
|
|
317
|
+
o == null || o.forEach((f) => {
|
|
318
|
+
f.classList.add("slot-empty"), f.addEventListener("slotchange", (h) => u(this, s).call(this, h));
|
|
319
|
+
});
|
|
320
|
+
}, s = new WeakMap(), P = function(o) {
|
|
321
|
+
return o.nodeType === Node.TEXT_NODE ? (o.textContent || "").trim().length > 0 : o.nodeType === Node.ELEMENT_NODE;
|
|
322
|
+
}, e;
|
|
297
323
|
}
|
|
298
324
|
export {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
325
|
+
X as BreakPointMixin,
|
|
326
|
+
k as Debouncer,
|
|
327
|
+
K as EventBindingsMixin,
|
|
328
|
+
J as Listen,
|
|
329
|
+
B as Logger,
|
|
330
|
+
Q as LoggingMixin,
|
|
331
|
+
Y as SlotVisibilityMixin,
|
|
305
332
|
H as Stopwatch,
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
333
|
+
T as breakpointMap,
|
|
334
|
+
b as breakpoints,
|
|
335
|
+
O as create_element,
|
|
336
|
+
F as debounce,
|
|
310
337
|
v as getBreakpointMinWidth,
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
338
|
+
R as getCurrentBreakpoint,
|
|
339
|
+
V as getErrorLocation,
|
|
340
|
+
j as sleep,
|
|
341
|
+
z as waitFor,
|
|
342
|
+
q as waitForAnimationEnd,
|
|
343
|
+
N as waitForDomContentLoaded,
|
|
344
|
+
G as waitForLoad
|
|
318
345
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type Constructor<T = object> = abstract new (...args: any[]) => T;
|
|
2
2
|
export declare function BreakPointMixin<TBase extends Constructor<HTMLElement>>(Base: TBase): (abstract new (...args: any[]) => {
|
|
3
3
|
currentBreakPoint: string | null;
|
|
4
|
-
"__#
|
|
4
|
+
"__#2876@#updateBreakPoint": () => Promise<void>;
|
|
5
5
|
connectedCallback(): void;
|
|
6
6
|
disconnectedCallback(): void;
|
|
7
7
|
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
|
+
"__#2877@#ac"?: AbortController;
|
|
13
13
|
connectedCallback(): void;
|
|
14
14
|
disconnectedCallback(): void;
|
|
15
|
-
"__#
|
|
15
|
+
"__#2877@#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
|
+
"__#2878@#debugCached": boolean | null;
|
|
30
|
+
"__#2878@#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
|
+
"__#2878@#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 {};
|