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