@mgdis/stencil-helpers 2.2.1 → 2.2.3
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/index.es.js +392 -371
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/dist/tests/unit.d.ts +10 -0
- package/dist/tests/unit.d.ts.map +1 -1
- package/package.json +9 -9
package/dist/index.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var he = Object.defineProperty;
|
|
2
|
+
var G = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var g = (e, t, s) =>
|
|
7
|
-
var
|
|
8
|
-
const
|
|
5
|
+
var ye = (e, t, s) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
6
|
+
var g = (e, t, s) => ye(e, typeof t != "symbol" ? t + "" : t, s), ve = (e, t, s) => t.has(e) || G("Cannot " + s);
|
|
7
|
+
var T = (e, t, s) => (ve(e, t, "read from private field"), s ? s.call(e) : t.get(e)), B = (e, t, s) => t.has(e) ? G("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
8
|
+
const Ge = (e = "", t = 10) => {
|
|
9
9
|
const s = new Uint8Array(t);
|
|
10
10
|
crypto.getRandomValues(s);
|
|
11
|
-
const r = Array.from(s).map((
|
|
11
|
+
const r = Array.from(s).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, t);
|
|
12
12
|
return e !== "" ? `${e}-${r}` : r;
|
|
13
|
-
},
|
|
14
|
-
class
|
|
13
|
+
}, Xe = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;
|
|
14
|
+
class Ke {
|
|
15
15
|
constructor(t = []) {
|
|
16
16
|
/**
|
|
17
17
|
* Available classes
|
|
@@ -46,25 +46,25 @@ class Xe {
|
|
|
46
46
|
this.classes = t;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
const t =
|
|
49
|
+
const Qe = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Ze = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Je = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Ye = (e) => {
|
|
50
|
+
const t = V(e), s = ee(e);
|
|
51
51
|
return [e, ...t, ...s];
|
|
52
|
-
},
|
|
52
|
+
}, V = (e, t = []) => {
|
|
53
53
|
if (e.self !== e.top)
|
|
54
54
|
try {
|
|
55
55
|
const s = e.parent;
|
|
56
|
-
return s ? (t.push(s),
|
|
56
|
+
return s ? (t.push(s), V(s, t)) : t;
|
|
57
57
|
} catch (s) {
|
|
58
58
|
return console.error("Different hosts between iframes:", s), t;
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
|
-
},
|
|
61
|
+
}, ee = (e, t = []) => {
|
|
62
62
|
if (e.frames.length > 0)
|
|
63
63
|
for (const s of Array.from(e.frames))
|
|
64
|
-
t.push(s),
|
|
64
|
+
t.push(s), ee(s, t);
|
|
65
65
|
return t;
|
|
66
|
-
}, me = (e) => typeof e == "string" && e.trim() !== "",
|
|
67
|
-
var
|
|
66
|
+
}, me = (e) => typeof e == "string" && e.trim() !== "", Ve = (e) => typeof e == "object" ? JSON.stringify(e) : `${e}`, et = (e) => typeof e == "number" && !Number.isNaN(e), tt = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, st = async (e) => e();
|
|
67
|
+
var w = {
|
|
68
68
|
allRenderFn: !1,
|
|
69
69
|
cmpDidLoad: !0,
|
|
70
70
|
cmpDidUnload: !1,
|
|
@@ -156,9 +156,9 @@ var E = {
|
|
|
156
156
|
}, be = Object.defineProperty, Se = (e, t) => {
|
|
157
157
|
for (var s in t)
|
|
158
158
|
be(e, s, { get: t[s], enumerable: !0 });
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
var
|
|
159
|
+
}, ke = "http://www.w3.org/2000/svg", Te = "http://www.w3.org/1999/xhtml", X = (e, t) => t in e, K = "http://www.w3.org/1999/xlink", z = typeof window < "u" ? window : {}, R = z.document || { head: {} };
|
|
160
|
+
z.HTMLElement;
|
|
161
|
+
var A = {
|
|
162
162
|
$flags$: 0,
|
|
163
163
|
$resourcesUrl$: "",
|
|
164
164
|
jmp: (e) => e(),
|
|
@@ -166,19 +166,19 @@ var j = {
|
|
|
166
166
|
ael: (e, t, s, r) => e.addEventListener(t, s, r),
|
|
167
167
|
rel: (e, t, s, r) => e.removeEventListener(t, s, r),
|
|
168
168
|
ce: (e, t) => new CustomEvent(e, t)
|
|
169
|
-
},
|
|
169
|
+
}, xe = (e) => e != null && e !== void 0, te = (e) => (e = typeof e, e === "object" || e === "function"), Ae = {};
|
|
170
170
|
Se(Ae, {
|
|
171
|
-
err: () =>
|
|
171
|
+
err: () => se,
|
|
172
172
|
map: () => Ee,
|
|
173
|
-
ok: () =>
|
|
174
|
-
unwrap: () =>
|
|
175
|
-
unwrapErr: () =>
|
|
173
|
+
ok: () => P,
|
|
174
|
+
unwrap: () => _e,
|
|
175
|
+
unwrapErr: () => je
|
|
176
176
|
});
|
|
177
|
-
var
|
|
177
|
+
var P = (e) => ({
|
|
178
178
|
isOk: !0,
|
|
179
179
|
isErr: !1,
|
|
180
180
|
value: e
|
|
181
|
-
}),
|
|
181
|
+
}), se = (e) => ({
|
|
182
182
|
isOk: !1,
|
|
183
183
|
isErr: !0,
|
|
184
184
|
value: e
|
|
@@ -186,32 +186,52 @@ var U = (e) => ({
|
|
|
186
186
|
function Ee(e, t) {
|
|
187
187
|
if (e.isOk) {
|
|
188
188
|
const s = t(e.value);
|
|
189
|
-
return s instanceof Promise ? s.then((r) =>
|
|
189
|
+
return s instanceof Promise ? s.then((r) => P(r)) : P(s);
|
|
190
190
|
}
|
|
191
191
|
if (e.isErr) {
|
|
192
192
|
const s = e.value;
|
|
193
|
-
return
|
|
193
|
+
return se(s);
|
|
194
194
|
}
|
|
195
195
|
throw "should never get here";
|
|
196
196
|
}
|
|
197
|
-
var
|
|
197
|
+
var _e = (e) => {
|
|
198
198
|
if (e.isOk)
|
|
199
199
|
return e.value;
|
|
200
200
|
throw e.value;
|
|
201
|
-
},
|
|
201
|
+
}, je = (e) => {
|
|
202
202
|
if (e.isErr)
|
|
203
203
|
return e.value;
|
|
204
204
|
throw e.value;
|
|
205
|
-
},
|
|
206
|
-
|
|
207
|
-
|
|
205
|
+
}, re = (e) => {
|
|
206
|
+
const t = e.__childNodes || e.childNodes;
|
|
207
|
+
e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && ne(t, e.tagName).forEach((s) => {
|
|
208
|
+
var r;
|
|
209
|
+
s.nodeType === 1 && s.tagName === "SLOT-FB" && ((r = Le(s, s["s-sn"], !1)) != null && r.length ? s.hidden = !0 : s.hidden = !1);
|
|
210
|
+
});
|
|
211
|
+
for (const s of t)
|
|
212
|
+
s.nodeType === 1 && (s.__childNodes || s.childNodes).length && re(s);
|
|
213
|
+
};
|
|
214
|
+
function ne(e, t, s) {
|
|
215
|
+
let r = 0, n = [], i;
|
|
216
|
+
for (; r < e.length; r++)
|
|
217
|
+
i = e[r], i["s-sr"] && i["s-hn"] === t && s === void 0 && n.push(i), n = [...n, ...ne(i.childNodes, t, s)];
|
|
218
|
+
return n;
|
|
219
|
+
}
|
|
220
|
+
var Le = (e, t, s = !0) => {
|
|
221
|
+
const r = [];
|
|
222
|
+
for ((s && e["s-sr"] || !e["s-sr"]) && r.push(e); (e = e.nextSibling) && e["s-sn"] === t; )
|
|
223
|
+
r.push(e);
|
|
224
|
+
return r;
|
|
225
|
+
}, Q = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", Oe = (e, t, ...s) => {
|
|
226
|
+
let r = null, n = null, i = null, o = !1, f = !1;
|
|
227
|
+
const c = [], u = (l) => {
|
|
208
228
|
for (let $ = 0; $ < l.length; $++)
|
|
209
|
-
r = l[$], Array.isArray(r) ?
|
|
229
|
+
r = l[$], Array.isArray(r) ? u(r) : r != null && typeof r != "boolean" && ((o = !te(r)) && (r = String(r)), o && f ? c[c.length - 1].$text$ += r : c.push(o ? q(null, r) : r), f = o);
|
|
210
230
|
};
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
return
|
|
214
|
-
},
|
|
231
|
+
u(s);
|
|
232
|
+
const d = q(e, null);
|
|
233
|
+
return d.$attrs$ = t, c.length > 0 && (d.$children$ = c), d.$key$ = n, d.$name$ = i, d;
|
|
234
|
+
}, q = (e, t) => {
|
|
215
235
|
const s = {
|
|
216
236
|
$flags$: 0,
|
|
217
237
|
$tag$: e,
|
|
@@ -220,48 +240,63 @@ var je = (e) => {
|
|
|
220
240
|
$children$: null
|
|
221
241
|
};
|
|
222
242
|
return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
|
|
223
|
-
},
|
|
243
|
+
}, Re = {}, Fe = (e) => e && e.$tag$ === Re, Z = (e, t, s, r, n, i, o) => {
|
|
224
244
|
if (s !== r) {
|
|
225
|
-
let
|
|
245
|
+
let f = X(e, t), c = t.toLowerCase();
|
|
226
246
|
if (t === "class") {
|
|
227
|
-
const
|
|
228
|
-
|
|
247
|
+
const u = e.classList, d = J(s);
|
|
248
|
+
let l = J(r);
|
|
249
|
+
u.remove(...d.filter(($) => $ && !l.includes($))), u.add(...l.filter(($) => $ && !d.includes($)));
|
|
229
250
|
} else if (t === "style") {
|
|
230
|
-
for (const
|
|
231
|
-
(!r || r[
|
|
232
|
-
for (const
|
|
233
|
-
(!s || r[
|
|
251
|
+
for (const u in s)
|
|
252
|
+
(!r || r[u] == null) && (u.includes("-") ? e.style.removeProperty(u) : e.style[u] = "");
|
|
253
|
+
for (const u in r)
|
|
254
|
+
(!s || r[u] !== s[u]) && (u.includes("-") ? e.style.setProperty(u, r[u]) : e.style[u] = r[u]);
|
|
234
255
|
} else if (t !== "key") if (t === "ref")
|
|
235
256
|
r && r(e);
|
|
236
257
|
else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
|
|
237
|
-
if (t[2] === "-" ? t = t.slice(3) :
|
|
238
|
-
const
|
|
239
|
-
t = t.replace(
|
|
258
|
+
if (t[2] === "-" ? t = t.slice(3) : X(z, c) ? t = c.slice(2) : t = c[2] + t.slice(3), s || r) {
|
|
259
|
+
const u = t.endsWith(ie);
|
|
260
|
+
t = t.replace(Ne, ""), s && A.rel(e, t, s, u), r && A.ael(e, t, r, u);
|
|
240
261
|
}
|
|
241
262
|
} else {
|
|
242
|
-
const
|
|
243
|
-
if ((
|
|
263
|
+
const u = te(r);
|
|
264
|
+
if ((f || u && r !== null) && !n)
|
|
244
265
|
try {
|
|
245
266
|
if (e.tagName.includes("-"))
|
|
246
|
-
e[t] = r;
|
|
267
|
+
e[t] !== r && (e[t] = r);
|
|
247
268
|
else {
|
|
248
|
-
const
|
|
249
|
-
t === "list" ?
|
|
269
|
+
const l = r ?? "";
|
|
270
|
+
t === "list" ? f = !1 : (s == null || e[t] != l) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = l : e.setAttribute(t, l));
|
|
250
271
|
}
|
|
251
272
|
} catch {
|
|
252
273
|
}
|
|
253
274
|
let d = !1;
|
|
254
|
-
|
|
275
|
+
c !== (c = c.replace(/^xlink\:?/, "")) && (t = c, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (d ? e.removeAttributeNS(K, t) : e.removeAttribute(t)) : (!f || i & 4 || n) && !u && (r = r === !0 ? "" : r, d ? e.setAttributeNS(K, t, r) : e.setAttribute(t, r));
|
|
255
276
|
}
|
|
256
277
|
}
|
|
257
|
-
}, Me = /\s/,
|
|
258
|
-
const
|
|
259
|
-
for (const
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
278
|
+
}, Me = /\s/, J = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(Me)), ie = "Capture", Ne = new RegExp(ie + "$"), oe = (e, t, s, r) => {
|
|
279
|
+
const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, i = e && e.$attrs$ || {}, o = t.$attrs$ || {};
|
|
280
|
+
for (const f of Y(Object.keys(i)))
|
|
281
|
+
f in o || Z(
|
|
282
|
+
n,
|
|
283
|
+
f,
|
|
284
|
+
i[f],
|
|
285
|
+
void 0,
|
|
286
|
+
s,
|
|
287
|
+
t.$flags$
|
|
288
|
+
);
|
|
289
|
+
for (const f of Y(Object.keys(o)))
|
|
290
|
+
Z(
|
|
291
|
+
n,
|
|
292
|
+
f,
|
|
293
|
+
i[f],
|
|
294
|
+
o[f],
|
|
295
|
+
s,
|
|
296
|
+
t.$flags$
|
|
297
|
+
);
|
|
263
298
|
};
|
|
264
|
-
function
|
|
299
|
+
function Y(e) {
|
|
265
300
|
return e.includes("ref") ? (
|
|
266
301
|
// we need to sort these to ensure that `'ref'` is the last attr
|
|
267
302
|
[...e.filter((t) => t !== "ref"), "ref"]
|
|
@@ -270,11 +305,11 @@ function V(e) {
|
|
|
270
305
|
e
|
|
271
306
|
);
|
|
272
307
|
}
|
|
273
|
-
var
|
|
274
|
-
var
|
|
308
|
+
var F, M, E, N = !1, D = !1, I = !1, y = !1, C = (e, t, s) => {
|
|
309
|
+
var r;
|
|
275
310
|
const n = t.$children$[s];
|
|
276
|
-
let i = 0,
|
|
277
|
-
if (
|
|
311
|
+
let i = 0, o, f, c;
|
|
312
|
+
if (N || (I = !0, n.$tag$ === "slot" && (n.$flags$ |= n.$children$ ? (
|
|
278
313
|
// slot element has fallback content
|
|
279
314
|
// still create an element that "mocks" the slot element
|
|
280
315
|
2
|
|
@@ -284,235 +319,211 @@ var x, H, R, F = !1, _ = !1, I = !1, h = !1, D = (e, t, s, r) => {
|
|
|
284
319
|
// where actual slot content should sit next to
|
|
285
320
|
1
|
|
286
321
|
))), n.$text$ !== null)
|
|
287
|
-
|
|
322
|
+
o = n.$elm$ = R.createTextNode(n.$text$);
|
|
288
323
|
else if (n.$flags$ & 1)
|
|
289
|
-
|
|
324
|
+
o = n.$elm$ = R.createTextNode("");
|
|
290
325
|
else {
|
|
291
|
-
if (
|
|
292
|
-
|
|
293
|
-
!
|
|
294
|
-
),
|
|
326
|
+
if (y || (y = n.$tag$ === "svg"), o = n.$elm$ = R.createElementNS(
|
|
327
|
+
y ? ke : Te,
|
|
328
|
+
!N && w.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
|
|
329
|
+
), y && n.$tag$ === "foreignObject" && (y = !1), oe(null, n, y), xe(F) && o["s-si"] !== F && o.classList.add(o["s-si"] = F), n.$children$)
|
|
295
330
|
for (i = 0; i < n.$children$.length; ++i)
|
|
296
|
-
|
|
297
|
-
n.$tag$ === "svg" ?
|
|
298
|
-
}
|
|
299
|
-
return a["s-hn"] = R, n.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = H, a["s-sn"] = n.$name$ || "", a["s-rf"] = (o = n.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === n.$tag$ && e.$elm$ && L(e.$elm$, !1)), a;
|
|
300
|
-
}, L = (e, t) => {
|
|
301
|
-
j.$flags$ |= 1;
|
|
302
|
-
const s = Array.from(e.childNodes);
|
|
303
|
-
if (e["s-sr"] && E.experimentalSlotFixes) {
|
|
304
|
-
let r = e;
|
|
305
|
-
for (; r = r.nextSibling; )
|
|
306
|
-
r && r["s-sn"] === e["s-sn"] && r["s-sh"] === R && s.push(r);
|
|
331
|
+
f = C(e, n, i), f && o.appendChild(f);
|
|
332
|
+
n.$tag$ === "svg" ? y = !1 : o.tagName === "foreignObject" && (y = !0);
|
|
307
333
|
}
|
|
334
|
+
return o["s-hn"] = E, n.$flags$ & 3 && (o["s-sr"] = !0, o["s-cr"] = M, o["s-sn"] = n.$name$ || "", o["s-rf"] = (r = n.$attrs$) == null ? void 0 : r.ref, c = e && e.$children$ && e.$children$[s], c && c.$tag$ === n.$tag$ && e.$elm$ && _(e.$elm$, !1), ue(M, o, t.$elm$, e == null ? void 0 : e.$elm$)), o;
|
|
335
|
+
}, _ = (e, t) => {
|
|
336
|
+
A.$flags$ |= 1;
|
|
337
|
+
const s = Array.from(e.__childNodes || e.childNodes);
|
|
338
|
+
e["s-sr"] && w.experimentalSlotFixes;
|
|
308
339
|
for (let r = s.length - 1; r >= 0; r--) {
|
|
309
|
-
const
|
|
310
|
-
|
|
340
|
+
const n = s[r];
|
|
341
|
+
n["s-hn"] !== E && n["s-ol"] && (k(j(n).parentNode, n, j(n)), n["s-ol"].remove(), n["s-ol"] = void 0, n["s-sh"] = void 0, I = !0), t && _(n, t);
|
|
311
342
|
}
|
|
312
|
-
|
|
313
|
-
}, le = (e, t, s, r,
|
|
314
|
-
let
|
|
315
|
-
for (
|
|
316
|
-
r[
|
|
343
|
+
A.$flags$ &= -2;
|
|
344
|
+
}, le = (e, t, s, r, n, i) => {
|
|
345
|
+
let o = e["s-cr"] && e["s-cr"].parentNode || e, f;
|
|
346
|
+
for (o.shadowRoot && o.tagName === E && (o = o.shadowRoot); n <= i; ++n)
|
|
347
|
+
r[n] && (f = C(null, s, n), f && (r[n].$elm$ = f, k(o, f, j(t))));
|
|
317
348
|
}, ae = (e, t, s) => {
|
|
318
349
|
for (let r = t; r <= s; ++r) {
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
const
|
|
322
|
-
|
|
350
|
+
const n = e[r];
|
|
351
|
+
if (n) {
|
|
352
|
+
const i = n.$elm$;
|
|
353
|
+
fe(n), i && (D = !0, i["s-ol"] ? i["s-ol"].remove() : _(i, !0), i.remove());
|
|
323
354
|
}
|
|
324
355
|
}
|
|
325
|
-
},
|
|
326
|
-
let
|
|
327
|
-
for (;
|
|
328
|
-
if (
|
|
329
|
-
|
|
356
|
+
}, De = (e, t, s, r, n = !1) => {
|
|
357
|
+
let i = 0, o = 0, f = 0, c = 0, u = t.length - 1, d = t[0], l = t[u], $ = r.length - 1, a = r[0], p = r[$], m, v;
|
|
358
|
+
for (; i <= u && o <= $; )
|
|
359
|
+
if (d == null)
|
|
360
|
+
d = t[++i];
|
|
330
361
|
else if (l == null)
|
|
331
|
-
l = t[--
|
|
332
|
-
else if (
|
|
333
|
-
|
|
362
|
+
l = t[--u];
|
|
363
|
+
else if (a == null)
|
|
364
|
+
a = r[++o];
|
|
334
365
|
else if (p == null)
|
|
335
366
|
p = r[--$];
|
|
336
|
-
else if (
|
|
337
|
-
|
|
338
|
-
else if (
|
|
339
|
-
|
|
340
|
-
else if (
|
|
341
|
-
(
|
|
342
|
-
else if (
|
|
343
|
-
(
|
|
367
|
+
else if (O(d, a, n))
|
|
368
|
+
x(d, a, n), d = t[++i], a = r[++o];
|
|
369
|
+
else if (O(l, p, n))
|
|
370
|
+
x(l, p, n), l = t[--u], p = r[--$];
|
|
371
|
+
else if (O(d, p, n))
|
|
372
|
+
(d.$tag$ === "slot" || p.$tag$ === "slot") && _(d.$elm$.parentNode, !1), x(d, p, n), k(e, d.$elm$, l.$elm$.nextSibling), d = t[++i], p = r[--$];
|
|
373
|
+
else if (O(l, a, n))
|
|
374
|
+
(d.$tag$ === "slot" || p.$tag$ === "slot") && _(l.$elm$.parentNode, !1), x(l, a, n), k(e, l.$elm$, d.$elm$), l = t[--u], a = r[++o];
|
|
344
375
|
else {
|
|
345
|
-
for (
|
|
346
|
-
if (t[c] && t[c].$key$ !== null && t[c].$key$ ===
|
|
347
|
-
|
|
376
|
+
for (f = -1, c = i; c <= u; ++c)
|
|
377
|
+
if (t[c] && t[c].$key$ !== null && t[c].$key$ === a.$key$) {
|
|
378
|
+
f = c;
|
|
348
379
|
break;
|
|
349
380
|
}
|
|
350
|
-
|
|
381
|
+
f >= 0 ? (v = t[f], v.$tag$ !== a.$tag$ ? m = C(t && t[o], s, f) : (x(v, a, n), t[f] = void 0, m = v.$elm$), a = r[++o]) : (m = C(t && t[o], s, o), a = r[++o]), m && k(
|
|
382
|
+
j(d.$elm$).parentNode,
|
|
383
|
+
m,
|
|
384
|
+
j(d.$elm$)
|
|
385
|
+
);
|
|
351
386
|
}
|
|
352
|
-
|
|
387
|
+
i > u ? le(
|
|
353
388
|
e,
|
|
354
389
|
r[$ + 1] == null ? null : r[$ + 1].$elm$,
|
|
355
390
|
s,
|
|
356
391
|
r,
|
|
357
|
-
|
|
392
|
+
o,
|
|
358
393
|
$
|
|
359
|
-
) :
|
|
360
|
-
},
|
|
361
|
-
|
|
362
|
-
// Here the comparison can't happen as $name$ property is not set for `leftNode`.
|
|
363
|
-
"$nodeId$" in e && s && // `leftNode` is not from type HTMLComment which would cause many
|
|
364
|
-
// hydration comments to be removed
|
|
365
|
-
e.$elm$.nodeType !== 8 ? !1 : e.$name$ === t.$name$
|
|
366
|
-
) : s ? !0 : e.$key$ === t.$key$ : !1, q = (e) => e && e["s-ol"] || e, ce = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, A = (e, t, s = !1) => {
|
|
367
|
-
const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, i = t.$tag$, a = t.$text$;
|
|
394
|
+
) : o > $ && ae(t, i, u);
|
|
395
|
+
}, O = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : s ? (s && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, j = (e) => e && e["s-ol"] || e, x = (e, t, s = !1) => {
|
|
396
|
+
const r = t.$elm$ = e.$elm$, n = e.$children$, i = t.$children$, o = t.$tag$, f = t.$text$;
|
|
368
397
|
let c;
|
|
369
|
-
|
|
398
|
+
f === null ? (y = o === "svg" ? !0 : o === "foreignObject" ? !1 : y, o === "slot" && !N || oe(e, t, y), n !== null && i !== null ? De(r, n, t, i, s) : i !== null ? (e.$text$ !== null && (r.textContent = ""), le(r, null, t, i, 0, i.length - 1)) : (
|
|
370
399
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
371
|
-
!s &&
|
|
372
|
-
),
|
|
373
|
-
},
|
|
374
|
-
const t = e.childNodes;
|
|
375
|
-
for (const s of t)
|
|
376
|
-
if (s.nodeType === 1) {
|
|
377
|
-
if (s["s-sr"]) {
|
|
378
|
-
const r = s["s-sn"];
|
|
379
|
-
s.hidden = !1;
|
|
380
|
-
for (const o of t)
|
|
381
|
-
if (o !== s) {
|
|
382
|
-
if (o["s-hn"] !== s["s-hn"] || r !== "") {
|
|
383
|
-
if (o.nodeType === 1 && (r === o.getAttribute("slot") || r === o["s-sn"]) || o.nodeType === 3 && r === o["s-sn"]) {
|
|
384
|
-
s.hidden = !0;
|
|
385
|
-
break;
|
|
386
|
-
}
|
|
387
|
-
} else if (o.nodeType === 1 || o.nodeType === 3 && o.textContent.trim() !== "") {
|
|
388
|
-
s.hidden = !0;
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
fe(s);
|
|
394
|
-
}
|
|
395
|
-
}, b = [], ue = (e) => {
|
|
400
|
+
!s && w.updatable && n !== null && ae(n, 0, n.length - 1)
|
|
401
|
+
), y && o === "svg" && (y = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = f : e.$text$ !== f && (r.data = f);
|
|
402
|
+
}, b = [], ce = (e) => {
|
|
396
403
|
let t, s, r;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
404
|
+
const n = e.__childNodes || e.childNodes;
|
|
405
|
+
for (const i of n) {
|
|
406
|
+
if (i["s-sr"] && (t = i["s-cr"]) && t.parentNode) {
|
|
407
|
+
s = t.parentNode.__childNodes || t.parentNode.childNodes;
|
|
408
|
+
const o = i["s-sn"];
|
|
401
409
|
for (r = s.length - 1; r >= 0; r--)
|
|
402
|
-
if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !==
|
|
403
|
-
if (
|
|
404
|
-
let
|
|
405
|
-
|
|
406
|
-
$slotRefNode$:
|
|
410
|
+
if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== i["s-hn"])
|
|
411
|
+
if (Q(t, o)) {
|
|
412
|
+
let f = b.find((c) => c.$nodeToRelocate$ === t);
|
|
413
|
+
D = !0, t["s-sn"] = t["s-sn"] || o, f ? (f.$nodeToRelocate$["s-sh"] = i["s-hn"], f.$slotRefNode$ = i) : (t["s-sh"] = i["s-hn"], b.push({
|
|
414
|
+
$slotRefNode$: i,
|
|
407
415
|
$nodeToRelocate$: t
|
|
408
|
-
})), t["s-sr"] && b.map((
|
|
409
|
-
|
|
416
|
+
})), t["s-sr"] && b.map((c) => {
|
|
417
|
+
Q(c.$nodeToRelocate$, t["s-sn"]) && (f = b.find((u) => u.$nodeToRelocate$ === t), f && !c.$slotRefNode$ && (c.$slotRefNode$ = f.$slotRefNode$));
|
|
410
418
|
});
|
|
411
|
-
} else b.some((
|
|
419
|
+
} else b.some((f) => f.$nodeToRelocate$ === t) || b.push({
|
|
412
420
|
$nodeToRelocate$: t
|
|
413
421
|
});
|
|
414
422
|
}
|
|
415
|
-
|
|
423
|
+
i.nodeType === 1 && ce(i);
|
|
416
424
|
}
|
|
417
|
-
},
|
|
418
|
-
e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(
|
|
419
|
-
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
G(n, e, !0);
|
|
425
|
+
}, fe = (e) => {
|
|
426
|
+
e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(fe);
|
|
427
|
+
}, k = (e, t, s) => (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"] && ue(t["s-cr"], t, e, t.parentElement), e == null ? void 0 : e.insertBefore(t, s));
|
|
428
|
+
function ue(e, t, s, r) {
|
|
429
|
+
var n;
|
|
430
|
+
let i;
|
|
431
|
+
if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (i = t["s-si"] || e.parentNode["s-sc"])) {
|
|
432
|
+
const o = t["s-sn"], f = t["s-hn"];
|
|
433
|
+
if ((n = s.classList) == null || n.add(i + "-s"), r && r.classList.contains(i + "-s")) {
|
|
434
|
+
let c = (r.__childNodes || r.childNodes)[0], u = !1;
|
|
435
|
+
for (; c; ) {
|
|
436
|
+
if (c["s-sn"] !== o && c["s-hn"] === f && c["s-sr"]) {
|
|
437
|
+
u = !0;
|
|
438
|
+
break;
|
|
439
|
+
}
|
|
440
|
+
c = c.nextSibling;
|
|
441
|
+
}
|
|
442
|
+
u || r.classList.remove(i + "-s");
|
|
443
|
+
}
|
|
437
444
|
}
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
445
|
+
}
|
|
446
|
+
var Ce = (e, t, s = !1) => {
|
|
447
|
+
var r, n, i, o, f;
|
|
448
|
+
const c = e.$hostElement$, u = e.$cmpMeta$, d = e.$vnode$ || q(null, null), l = Fe(t) ? t : Oe(null, null, t);
|
|
449
|
+
if (E = c.tagName, u.$attrsToReflect$ && (l.$attrs$ = l.$attrs$ || {}, u.$attrsToReflect$.map(
|
|
450
|
+
([$, a]) => l.$attrs$[a] = c[$]
|
|
443
451
|
)), s && l.$attrs$)
|
|
444
452
|
for (const $ of Object.keys(l.$attrs$))
|
|
445
453
|
c.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (l.$attrs$[$] = c[$]);
|
|
446
|
-
l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ =
|
|
454
|
+
l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = d.$elm$ = c.shadowRoot || c, F = c["s-sc"], N = (u.$flags$ & 1) !== 0, M = c["s-cr"], D = !1, x(d, l, s);
|
|
447
455
|
{
|
|
448
|
-
if (
|
|
449
|
-
|
|
456
|
+
if (A.$flags$ |= 1, I) {
|
|
457
|
+
ce(l.$elm$);
|
|
450
458
|
for (const $ of b) {
|
|
451
|
-
const
|
|
452
|
-
if (!
|
|
453
|
-
const p =
|
|
454
|
-
p["s-nr"] =
|
|
459
|
+
const a = $.$nodeToRelocate$;
|
|
460
|
+
if (!a["s-ol"]) {
|
|
461
|
+
const p = R.createTextNode("");
|
|
462
|
+
p["s-nr"] = a, k(a.parentNode, a["s-ol"] = p, a);
|
|
455
463
|
}
|
|
456
464
|
}
|
|
457
465
|
for (const $ of b) {
|
|
458
|
-
const
|
|
466
|
+
const a = $.$nodeToRelocate$, p = $.$slotRefNode$;
|
|
459
467
|
if (p) {
|
|
460
468
|
const m = p.parentNode;
|
|
461
|
-
let
|
|
469
|
+
let v = p.nextSibling;
|
|
462
470
|
{
|
|
463
|
-
let
|
|
464
|
-
for (;
|
|
465
|
-
let
|
|
466
|
-
if (
|
|
467
|
-
for (
|
|
468
|
-
|
|
469
|
-
if (!
|
|
470
|
-
|
|
471
|
+
let L = (r = a["s-ol"]) == null ? void 0 : r.previousSibling;
|
|
472
|
+
for (; L; ) {
|
|
473
|
+
let h = (n = L["s-nr"]) != null ? n : null;
|
|
474
|
+
if (h && h["s-sn"] === a["s-sn"] && m === (h.__parentNode || h.parentNode)) {
|
|
475
|
+
for (h = h.nextSibling; h === a || h != null && h["s-sr"]; )
|
|
476
|
+
h = h == null ? void 0 : h.nextSibling;
|
|
477
|
+
if (!h || !h["s-nr"]) {
|
|
478
|
+
v = h;
|
|
471
479
|
break;
|
|
472
480
|
}
|
|
473
481
|
}
|
|
474
|
-
|
|
482
|
+
L = L.previousSibling;
|
|
475
483
|
}
|
|
476
484
|
}
|
|
477
|
-
|
|
485
|
+
const pe = a.__parentNode || a.parentNode, ge = a.__nextSibling || a.nextSibling;
|
|
486
|
+
(!v && m !== pe || ge !== v) && a !== v && (!a["s-hn"] && a["s-ol"] && (a["s-hn"] = a["s-ol"].parentNode.nodeName), k(m, a, v), a.nodeType === 1 && a.tagName !== "SLOT-FB" && (a.hidden = (i = a["s-ih"]) != null ? i : !1)), a && typeof p["s-rf"] == "function" && p["s-rf"](a);
|
|
478
487
|
} else
|
|
479
|
-
|
|
488
|
+
a.nodeType === 1 && (s && (a["s-ih"] = (o = a.hidden) != null ? o : !1), a.hidden = !0);
|
|
480
489
|
}
|
|
481
490
|
}
|
|
482
|
-
|
|
491
|
+
D && re(l.$elm$), A.$flags$ &= -2, b.length = 0;
|
|
492
|
+
}
|
|
493
|
+
if (w.experimentalScopedSlotChanges && u.$flags$ & 2) {
|
|
494
|
+
const $ = l.$elm$.__childNodes || l.$elm$.childNodes;
|
|
495
|
+
for (const a of $)
|
|
496
|
+
a["s-hn"] !== E && !a["s-sh"] && (s && a["s-ih"] == null && (a["s-ih"] = (f = a.hidden) != null ? f : !1), a.hidden = !0);
|
|
483
497
|
}
|
|
484
|
-
|
|
485
|
-
for (const $ of l.$elm$.childNodes)
|
|
486
|
-
$["s-hn"] !== R && !$["s-sh"] && (s && $["s-ih"] == null && ($["s-ih"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);
|
|
487
|
-
H = void 0;
|
|
498
|
+
M = void 0;
|
|
488
499
|
};
|
|
489
|
-
const
|
|
500
|
+
const Ue = (e, t, s) => {
|
|
490
501
|
[null, void 0, "", !1].includes(s) || ["innerHTML", "style"].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof s) ? "/!\\ Object props are not rendered in the code example" : s);
|
|
491
|
-
},
|
|
502
|
+
}, de = (e, t, s, r, n) => {
|
|
492
503
|
if (t && typeof t == "string") {
|
|
493
|
-
const
|
|
494
|
-
Object.keys(s || {}).forEach((
|
|
495
|
-
|
|
496
|
-
}), r == null || r.forEach((
|
|
497
|
-
|
|
498
|
-
}), s != null && s.innerHTML && (
|
|
504
|
+
const i = document.createElement(t);
|
|
505
|
+
Object.keys(s || {}).forEach((o) => {
|
|
506
|
+
Ue(i, o, s[o]);
|
|
507
|
+
}), r == null || r.forEach((o) => {
|
|
508
|
+
de(i, o.$tag$, o.$attrs$, o.$children$, o.$text$);
|
|
509
|
+
}), s != null && s.innerHTML && (i.innerHTML = s.innerHTML), e.appendChild(i);
|
|
499
510
|
}
|
|
500
|
-
|
|
501
|
-
},
|
|
511
|
+
n && (e.innerHTML = n);
|
|
512
|
+
}, rt = (e, t) => {
|
|
502
513
|
const s = {};
|
|
503
514
|
if (typeof e != "object")
|
|
504
515
|
throw new Error("filterArgs - args isn't an object.");
|
|
505
516
|
for (const r in e)
|
|
506
517
|
if (!r.startsWith("slot")) {
|
|
507
|
-
const
|
|
508
|
-
(!t || !Object.keys(t).includes(r) || t[r] !==
|
|
518
|
+
const n = e[r], i = r.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
519
|
+
(!t || !Object.keys(t).includes(r) || t[r] !== n) && (s[i] = n);
|
|
509
520
|
}
|
|
510
521
|
return s;
|
|
511
|
-
},
|
|
512
|
-
var r,
|
|
522
|
+
}, nt = (e, t) => {
|
|
523
|
+
var r, n;
|
|
513
524
|
const s = document.getElementById("storybook-root");
|
|
514
525
|
if (s !== null)
|
|
515
|
-
return (
|
|
526
|
+
return (n = document.querySelector("[lang]")) == null || n.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), Ce(
|
|
516
527
|
{
|
|
517
528
|
$ancestorComponent$: void 0,
|
|
518
529
|
$flags$: 0,
|
|
@@ -525,17 +536,17 @@ const Ce = (e, t, s) => {
|
|
|
525
536
|
},
|
|
526
537
|
e(t)
|
|
527
538
|
), s.children[s.children.length - 1];
|
|
528
|
-
},
|
|
529
|
-
const
|
|
530
|
-
return
|
|
531
|
-
},
|
|
539
|
+
}, it = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
|
|
540
|
+
const n = document.createElement("div");
|
|
541
|
+
return de(n, e, t, s, r), n.innerHTML;
|
|
542
|
+
}, U = (e, t) => {
|
|
532
543
|
if (!t)
|
|
533
544
|
return;
|
|
534
545
|
const s = t.split("/");
|
|
535
546
|
return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
|
|
536
547
|
};
|
|
537
|
-
var S,
|
|
538
|
-
class
|
|
548
|
+
var S, H;
|
|
549
|
+
class ot {
|
|
539
550
|
constructor(t) {
|
|
540
551
|
/**
|
|
541
552
|
* JsonDocs
|
|
@@ -546,14 +557,14 @@ class nt {
|
|
|
546
557
|
* @param tagName - tag name we want to get the data from
|
|
547
558
|
* @returns component data
|
|
548
559
|
*/
|
|
549
|
-
|
|
560
|
+
B(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));
|
|
550
561
|
/**
|
|
551
562
|
* Get the control for the given prop
|
|
552
563
|
* Based on https://storybook.js.org/docs/api/arg-types#controltype
|
|
553
564
|
* @param prop - prop to get control for
|
|
554
565
|
* @returns control type and options if applicable
|
|
555
566
|
*/
|
|
556
|
-
|
|
567
|
+
B(this, H, (t) => {
|
|
557
568
|
const s = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (r) => r.replace(/\|/g, " OR ")).split("|").map((r) => r.trim().replace(/ OR /g, "|"));
|
|
558
569
|
return t.type === "string" ? { control: { type: "text" } } : t.type === "number" ? { control: { type: "number" } } : t.type === "boolean" ? { control: { type: "boolean" } } : t.type.startsWith("{") && t.type.endsWith("}") ? { control: { type: "object" } } : s.length > 1 ? s.includes("string") ? { control: { type: "text" } } : s.every((r) => r == null ? void 0 : r.includes("[]")) ? { control: { type: "object" } } : (s.unshift(void 0), { control: { type: "select" }, options: s }) : { control: { type: "object" } };
|
|
559
570
|
});
|
|
@@ -563,10 +574,10 @@ class nt {
|
|
|
563
574
|
* @returns component arg types
|
|
564
575
|
*/
|
|
565
576
|
g(this, "extractArgTypes", (t) => {
|
|
566
|
-
const s =
|
|
567
|
-
const { control: $, options:
|
|
577
|
+
const s = T(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((d, l) => {
|
|
578
|
+
const { control: $, options: a } = T(this, H).call(this, l);
|
|
568
579
|
return {
|
|
569
|
-
...
|
|
580
|
+
...d,
|
|
570
581
|
[l.name]: {
|
|
571
582
|
name: l.attr || l.name,
|
|
572
583
|
description: l.docs,
|
|
@@ -577,12 +588,12 @@ class nt {
|
|
|
577
588
|
defaultValue: { summary: l.default }
|
|
578
589
|
},
|
|
579
590
|
control: $,
|
|
580
|
-
options:
|
|
591
|
+
options: a
|
|
581
592
|
}
|
|
582
593
|
};
|
|
583
|
-
}, {}),
|
|
584
|
-
(
|
|
585
|
-
...
|
|
594
|
+
}, {}), n = s == null ? void 0 : s.events.reduce(
|
|
595
|
+
(d, l) => ({
|
|
596
|
+
...d,
|
|
586
597
|
[l.event]: {
|
|
587
598
|
name: l.event,
|
|
588
599
|
description: l.docs,
|
|
@@ -593,9 +604,9 @@ class nt {
|
|
|
593
604
|
}
|
|
594
605
|
}),
|
|
595
606
|
{}
|
|
596
|
-
),
|
|
597
|
-
(
|
|
598
|
-
...
|
|
607
|
+
), i = s == null ? void 0 : s.methods.reduce(
|
|
608
|
+
(d, l) => ({
|
|
609
|
+
...d,
|
|
599
610
|
[l.name]: {
|
|
600
611
|
name: l.name,
|
|
601
612
|
description: l.docs,
|
|
@@ -606,9 +617,9 @@ class nt {
|
|
|
606
617
|
}
|
|
607
618
|
}),
|
|
608
619
|
{}
|
|
609
|
-
),
|
|
610
|
-
(
|
|
611
|
-
...
|
|
620
|
+
), o = s == null ? void 0 : s.slots.reduce(
|
|
621
|
+
(d, l) => ({
|
|
622
|
+
...d,
|
|
612
623
|
[l.name]: {
|
|
613
624
|
name: l.name !== "" ? l.name : "default",
|
|
614
625
|
// default slot are unnamed
|
|
@@ -620,9 +631,9 @@ class nt {
|
|
|
620
631
|
}
|
|
621
632
|
}),
|
|
622
633
|
{}
|
|
623
|
-
),
|
|
624
|
-
(
|
|
625
|
-
...
|
|
634
|
+
), f = s == null ? void 0 : s.styles.reduce(
|
|
635
|
+
(d, l) => ({
|
|
636
|
+
...d,
|
|
626
637
|
[l.name]: {
|
|
627
638
|
name: l.name,
|
|
628
639
|
description: l.docs,
|
|
@@ -633,26 +644,26 @@ class nt {
|
|
|
633
644
|
}
|
|
634
645
|
}),
|
|
635
646
|
{}
|
|
636
|
-
), c = s == null ? void 0 : s.dependencies.reduce((
|
|
637
|
-
const $ =
|
|
647
|
+
), c = s == null ? void 0 : s.dependencies.reduce((d, l) => {
|
|
648
|
+
const $ = T(this, S).call(this, l);
|
|
638
649
|
return {
|
|
639
|
-
...
|
|
650
|
+
...d,
|
|
640
651
|
[l]: {
|
|
641
652
|
name: l,
|
|
642
|
-
description: `<a href="./?path=/docs/${
|
|
653
|
+
description: `<a href="./?path=/docs/${U("", $ == null ? void 0 : $.filePath)}">View Component Documentation</a>`,
|
|
643
654
|
table: {
|
|
644
655
|
category: "depends on",
|
|
645
656
|
type: { summary: void 0 }
|
|
646
657
|
}
|
|
647
658
|
}
|
|
648
659
|
};
|
|
649
|
-
}, {}),
|
|
650
|
-
const $ =
|
|
660
|
+
}, {}), u = s == null ? void 0 : s.dependents.reduce((d, l) => {
|
|
661
|
+
const $ = T(this, S).call(this, l);
|
|
651
662
|
return {
|
|
652
|
-
...
|
|
663
|
+
...d,
|
|
653
664
|
[l]: {
|
|
654
665
|
name: l,
|
|
655
|
-
description: `<a href="./?path=/docs/${
|
|
666
|
+
description: `<a href="./?path=/docs/${U("", $ == null ? void 0 : $.filePath)}">View Component Documentation</a>`,
|
|
656
667
|
table: {
|
|
657
668
|
category: "used by",
|
|
658
669
|
type: { summary: void 0 }
|
|
@@ -662,12 +673,12 @@ class nt {
|
|
|
662
673
|
}, {});
|
|
663
674
|
return {
|
|
664
675
|
...r,
|
|
665
|
-
...o,
|
|
666
676
|
...n,
|
|
667
677
|
...i,
|
|
668
|
-
...
|
|
678
|
+
...o,
|
|
679
|
+
...f,
|
|
669
680
|
...c,
|
|
670
|
-
...
|
|
681
|
+
...u
|
|
671
682
|
};
|
|
672
683
|
});
|
|
673
684
|
/**
|
|
@@ -676,118 +687,118 @@ class nt {
|
|
|
676
687
|
* @returns component description
|
|
677
688
|
*/
|
|
678
689
|
g(this, "extractComponentDescription", (t) => {
|
|
679
|
-
const s =
|
|
690
|
+
const s = T(this, S).call(this, t);
|
|
680
691
|
return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);
|
|
681
692
|
});
|
|
682
693
|
this.jsonDoc = t;
|
|
683
694
|
}
|
|
684
695
|
}
|
|
685
|
-
S = new WeakMap(),
|
|
686
|
-
const
|
|
696
|
+
S = new WeakMap(), H = new WeakMap();
|
|
697
|
+
const He = (e, t) => {
|
|
687
698
|
if (t)
|
|
688
699
|
return `${e}${t}`;
|
|
689
|
-
},
|
|
700
|
+
}, $e = (e) => {
|
|
690
701
|
let t = e.overview ? `${e.overview}
|
|
691
702
|
|
|
692
703
|
` : "";
|
|
693
|
-
const s = e.props.filter(({ attr:
|
|
704
|
+
const s = e.props.filter(({ attr: n }) => n !== void 0);
|
|
694
705
|
s.length && (t += `Attributes:
|
|
695
|
-
`, t += s.map(({ attr:
|
|
706
|
+
`, t += s.map(({ attr: n, docs: i }) => `- \`${n}\`: ${i}
|
|
696
707
|
`).join(""), t += `
|
|
697
708
|
`);
|
|
698
|
-
const r = e.props.filter(({ attr:
|
|
709
|
+
const r = e.props.filter(({ attr: n }) => n === void 0);
|
|
699
710
|
return r.length && (t += `Properties:
|
|
700
|
-
`, t += r.map(({ name:
|
|
711
|
+
`, t += r.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
|
|
701
712
|
`).join(""), t += `
|
|
702
713
|
`), e.methods.length && (t += `Methods:
|
|
703
|
-
`, t += e.methods.map(({ name:
|
|
714
|
+
`, t += e.methods.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
|
|
704
715
|
`).join(""), t += `
|
|
705
716
|
`), e.events.length && (t += `Events:
|
|
706
|
-
`, t += e.events.map(({ event:
|
|
717
|
+
`, t += e.events.map(({ event: n, docs: i }) => `- \`${n}\`: ${i}
|
|
707
718
|
`).join(""), t += `
|
|
708
719
|
`), e.listeners.length && (t += `Listeners:
|
|
709
|
-
`, t += e.listeners.map(({ event:
|
|
720
|
+
`, t += e.listeners.map(({ event: n }) => `- \`${n}\`
|
|
710
721
|
`).join(""), t += `
|
|
711
722
|
`), e.slots.length && (t += `Slots:
|
|
712
|
-
`, t += e.slots.map(({ name:
|
|
723
|
+
`, t += e.slots.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
|
|
713
724
|
`).join(""), t += `
|
|
714
725
|
`), t;
|
|
715
|
-
},
|
|
726
|
+
}, W = (e) => `${e.docs}
|
|
716
727
|
|
|
717
|
-
Type: \`${e.type}\``,
|
|
728
|
+
Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
718
729
|
$schema: "https://json.schemastore.org/web-types",
|
|
719
730
|
name: e,
|
|
720
731
|
version: t,
|
|
721
732
|
"description-markup": "markdown",
|
|
722
733
|
contributions: {
|
|
723
734
|
html: {
|
|
724
|
-
elements: s.components.map((
|
|
725
|
-
const
|
|
735
|
+
elements: s.components.map((n) => {
|
|
736
|
+
const i = U(r, n.filePath);
|
|
726
737
|
return {
|
|
727
|
-
name:
|
|
728
|
-
description:
|
|
729
|
-
"doc-url":
|
|
730
|
-
attributes:
|
|
731
|
-
name:
|
|
732
|
-
description:
|
|
733
|
-
"doc-url":
|
|
738
|
+
name: n.tag,
|
|
739
|
+
description: $e(n),
|
|
740
|
+
"doc-url": i,
|
|
741
|
+
attributes: n.props.filter((o) => o.attr).map((o) => ({
|
|
742
|
+
name: o.attr,
|
|
743
|
+
description: W(o),
|
|
744
|
+
"doc-url": i,
|
|
734
745
|
value: {
|
|
735
|
-
type:
|
|
736
|
-
default:
|
|
737
|
-
required:
|
|
746
|
+
type: o.type,
|
|
747
|
+
default: o.default,
|
|
748
|
+
required: o.required
|
|
738
749
|
}
|
|
739
750
|
})),
|
|
740
751
|
js: {
|
|
741
|
-
properties:
|
|
742
|
-
name:
|
|
743
|
-
description:
|
|
744
|
-
"doc-url":
|
|
752
|
+
properties: n.props.map((o) => ({
|
|
753
|
+
name: o.name,
|
|
754
|
+
description: W(o),
|
|
755
|
+
"doc-url": i,
|
|
745
756
|
value: {
|
|
746
|
-
type:
|
|
747
|
-
default:
|
|
748
|
-
required:
|
|
757
|
+
type: o.type,
|
|
758
|
+
default: o.default,
|
|
759
|
+
required: o.required
|
|
749
760
|
}
|
|
750
761
|
})),
|
|
751
|
-
events:
|
|
752
|
-
name:
|
|
753
|
-
description:
|
|
762
|
+
events: n.events.map((o) => ({
|
|
763
|
+
name: o.event,
|
|
764
|
+
description: o.docs
|
|
754
765
|
}))
|
|
755
766
|
},
|
|
756
767
|
css: {
|
|
757
|
-
properties:
|
|
758
|
-
name:
|
|
759
|
-
description:
|
|
768
|
+
properties: n.styles.map((o) => ({
|
|
769
|
+
name: o.name,
|
|
770
|
+
description: o.docs
|
|
760
771
|
}))
|
|
761
772
|
}
|
|
762
773
|
};
|
|
763
774
|
})
|
|
764
775
|
}
|
|
765
776
|
}
|
|
766
|
-
}),
|
|
767
|
-
{ name: "Storybook", url:
|
|
768
|
-
{ name: "Sources", url:
|
|
769
|
-
],
|
|
777
|
+
}), we = (e, t, s) => [
|
|
778
|
+
{ name: "Storybook", url: U(e, s) },
|
|
779
|
+
{ name: "Sources", url: He(t, s) }
|
|
780
|
+
], Be = (e) => {
|
|
770
781
|
if (!e.values.some(({ value: t }) => t === void 0))
|
|
771
782
|
return e.values.map(({ value: t }) => ({ name: t }));
|
|
772
|
-
},
|
|
783
|
+
}, at = (e, t, s) => ({
|
|
773
784
|
version: 1.1,
|
|
774
785
|
tags: e.components.map((r) => {
|
|
775
|
-
const
|
|
786
|
+
const n = we(t, s, r.filePath);
|
|
776
787
|
return {
|
|
777
788
|
name: r.tag,
|
|
778
|
-
description:
|
|
779
|
-
attributes: r.props.map((
|
|
780
|
-
name:
|
|
781
|
-
description:
|
|
782
|
-
values:
|
|
783
|
-
references:
|
|
789
|
+
description: $e(r),
|
|
790
|
+
attributes: r.props.map((i) => ({
|
|
791
|
+
name: i.attr || i.name,
|
|
792
|
+
description: W(i),
|
|
793
|
+
values: Be(i),
|
|
794
|
+
references: n
|
|
784
795
|
})),
|
|
785
|
-
references:
|
|
796
|
+
references: n
|
|
786
797
|
};
|
|
787
798
|
}),
|
|
788
799
|
globalAttributes: [],
|
|
789
800
|
valueSets: []
|
|
790
|
-
}),
|
|
801
|
+
}), ct = (e) => ({
|
|
791
802
|
version: 1.1,
|
|
792
803
|
properties: e.components.flatMap(
|
|
793
804
|
(t) => t.styles.map((s) => ({
|
|
@@ -795,31 +806,31 @@ Type: \`${e.type}\``, it = (e, t, s, r) => ({
|
|
|
795
806
|
description: s.docs
|
|
796
807
|
}))
|
|
797
808
|
)
|
|
798
|
-
}),
|
|
809
|
+
}), ft = (e) => {
|
|
799
810
|
const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
|
|
800
|
-
return
|
|
801
|
-
},
|
|
802
|
-
const r = e.closest("[lang]"),
|
|
811
|
+
return We([t.value, s.value, r.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);
|
|
812
|
+
}, ut = (e) => e.toISOString().split("T")[0], Pe = (e, t, s) => {
|
|
813
|
+
const r = e.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), i = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || s, o = i.split("-").shift();
|
|
803
814
|
return Object.keys(t).length === 0 ? {
|
|
804
|
-
locale:
|
|
815
|
+
locale: i,
|
|
805
816
|
messages: { lang: s }
|
|
806
817
|
} : {
|
|
807
|
-
locale:
|
|
808
|
-
messages: t[
|
|
818
|
+
locale: i,
|
|
819
|
+
messages: t[o] || t[s] || { lang: s }
|
|
809
820
|
};
|
|
810
|
-
},
|
|
821
|
+
}, dt = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), $t = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), pt = (e, t, s = 0) => new Intl.NumberFormat(t, {
|
|
811
822
|
style: "percent",
|
|
812
823
|
minimumFractionDigits: s,
|
|
813
824
|
maximumFractionDigits: s
|
|
814
|
-
}).format(e),
|
|
825
|
+
}).format(e), gt = (e, t, s, r = "short", n = 0) => new Intl.NumberFormat(t, {
|
|
815
826
|
style: "unit",
|
|
816
827
|
unit: s,
|
|
817
828
|
unitDisplay: r,
|
|
818
|
-
minimumFractionDigits:
|
|
819
|
-
maximumFractionDigits:
|
|
820
|
-
}).format(e),
|
|
829
|
+
minimumFractionDigits: n,
|
|
830
|
+
maximumFractionDigits: n
|
|
831
|
+
}).format(e), qe = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, We = (e, t, s) => typeof e != "string" || e === "" || !qe.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), ht = (e, t) => (s) => Pe(s, e, t), yt = ({ disconnect: e, observe: t, takeRecords: s }) => {
|
|
821
832
|
class r {
|
|
822
|
-
constructor(
|
|
833
|
+
constructor(i) {
|
|
823
834
|
/**
|
|
824
835
|
*
|
|
825
836
|
*/
|
|
@@ -836,19 +847,19 @@ Type: \`${e.type}\``, it = (e, t, s, r) => ({
|
|
|
836
847
|
*
|
|
837
848
|
*/
|
|
838
849
|
g(this, "cb");
|
|
839
|
-
this.cb =
|
|
850
|
+
this.cb = i;
|
|
840
851
|
}
|
|
841
852
|
}
|
|
842
|
-
return [window, global].forEach((
|
|
843
|
-
Object.defineProperty(
|
|
853
|
+
return [window, global].forEach((n) => {
|
|
854
|
+
Object.defineProperty(n, "MutationObserver", {
|
|
844
855
|
writable: !0,
|
|
845
856
|
configurable: !0,
|
|
846
857
|
value: r
|
|
847
858
|
});
|
|
848
859
|
}), r;
|
|
849
|
-
},
|
|
860
|
+
}, vt = ({ disconnect: e, observe: t }) => {
|
|
850
861
|
class s {
|
|
851
|
-
constructor(
|
|
862
|
+
constructor(n) {
|
|
852
863
|
/**
|
|
853
864
|
*
|
|
854
865
|
*/
|
|
@@ -865,7 +876,7 @@ Type: \`${e.type}\``, it = (e, t, s, r) => ({
|
|
|
865
876
|
*
|
|
866
877
|
*/
|
|
867
878
|
g(this, "cb");
|
|
868
|
-
this.cb =
|
|
879
|
+
this.cb = n;
|
|
869
880
|
}
|
|
870
881
|
}
|
|
871
882
|
return [window, global].forEach((r) => {
|
|
@@ -876,7 +887,7 @@ Type: \`${e.type}\``, it = (e, t, s, r) => ({
|
|
|
876
887
|
});
|
|
877
888
|
}), s;
|
|
878
889
|
};
|
|
879
|
-
class
|
|
890
|
+
class ze extends Event {
|
|
880
891
|
constructor() {
|
|
881
892
|
super(...arguments);
|
|
882
893
|
/**
|
|
@@ -886,8 +897,8 @@ class Be extends Event {
|
|
|
886
897
|
}
|
|
887
898
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
888
899
|
}
|
|
889
|
-
const
|
|
890
|
-
class e extends
|
|
900
|
+
const mt = () => {
|
|
901
|
+
class e extends ze {
|
|
891
902
|
}
|
|
892
903
|
return [window, global].forEach((t) => {
|
|
893
904
|
Object.defineProperty(t, "SubmitEvent", {
|
|
@@ -896,40 +907,50 @@ const yt = () => {
|
|
|
896
907
|
value: e
|
|
897
908
|
});
|
|
898
909
|
}), e;
|
|
910
|
+
}, bt = (e) => {
|
|
911
|
+
const t = (s) => (setTimeout(s, 1), e(), 0);
|
|
912
|
+
return [window, global].forEach((s) => {
|
|
913
|
+
Object.defineProperty(s, "requestAnimationFrame", {
|
|
914
|
+
writable: !0,
|
|
915
|
+
configurable: !0,
|
|
916
|
+
value: t
|
|
917
|
+
});
|
|
918
|
+
}), t;
|
|
899
919
|
};
|
|
900
920
|
export {
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
921
|
+
Ke as ClassList,
|
|
922
|
+
ot as StorybookPreview,
|
|
923
|
+
Qe as allItemsAreString,
|
|
924
|
+
tt as cleanString,
|
|
925
|
+
Ge as createID,
|
|
926
|
+
qe as dateRegExp,
|
|
927
|
+
ut as dateToString,
|
|
928
|
+
ht as defineLocales,
|
|
929
|
+
rt as filterArgs,
|
|
930
|
+
Je as focusableElements,
|
|
931
|
+
ft as getLocaleDatePattern,
|
|
932
|
+
V as getParentWindows,
|
|
933
|
+
it as getStoryHTML,
|
|
934
|
+
U as getStorybookUrl,
|
|
935
|
+
Ye as getWindows,
|
|
936
|
+
Ze as isTagName,
|
|
937
|
+
et as isValidNumber,
|
|
918
938
|
me as isValidString,
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
939
|
+
Xe as isValideID,
|
|
940
|
+
dt as localeCurrency,
|
|
941
|
+
We as localeDate,
|
|
922
942
|
$t as localeNumber,
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
943
|
+
pt as localePercent,
|
|
944
|
+
gt as localeUnit,
|
|
945
|
+
st as nextTick,
|
|
946
|
+
bt as setUpRequestAnimationFrameMock,
|
|
947
|
+
yt as setupMutationObserverMock,
|
|
948
|
+
vt as setupResizeObserverMock,
|
|
949
|
+
mt as setupSubmitEventMock,
|
|
950
|
+
nt as stencilWrapper,
|
|
951
|
+
Ve as toString,
|
|
952
|
+
ct as vsCodeCssGenerator,
|
|
953
|
+
at as vsCodeGenerator,
|
|
954
|
+
lt as webTypesGenerator
|
|
934
955
|
};
|
|
935
956
|
//# sourceMappingURL=index.es.js.map
|