@mgdis/stencil-helpers 2.0.0 → 2.1.0
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/components/index.d.ts +6 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.es.js +90 -89
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/dist/locale/index.d.ts +1 -1
- package/dist/locale/index.d.ts.map +1 -1
- package/dist/storybook/index.d.ts.map +1 -1
- package/dist/tests/unit.d.ts.map +1 -1
- package/package.json +11 -11
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
* @returns ID
|
|
6
6
|
*/
|
|
7
7
|
export declare const createID: (prefix?: string, length?: number) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Validate html `id` format
|
|
10
|
+
* @param newValue - id value to validate
|
|
11
|
+
* @returns true if `id` is valid
|
|
12
|
+
*/
|
|
13
|
+
export declare const isValideID: (newValue: unknown) => boolean;
|
|
8
14
|
/**
|
|
9
15
|
* Class to manage component classlist
|
|
10
16
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wCAA+B,MAWnD,CAAC;AAEF;;GAEG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;gBAEN,SAAS,GAAE,MAAM,EAAO;IAIpC;;;OAGG;IACH,GAAG,cAAe,MAAM,KAAG,IAAI,CAI7B;IAEF;;;OAGG;IACH,MAAM,cAAe,MAAM,KAAG,IAAI,CAKhC;IAEF;;;;OAIG;IACH,GAAG,cAAe,MAAM,KAAG,OAAO,CAEhC;IAEF;;;OAGG;IACH,IAAI,QAAO,MAAM,CAEf;CACH;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wCAA+B,MAWnD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,aAAc,OAAO,KAAG,OAA+F,CAAC;AAE/I;;GAEG;AACH,qBAAa,SAAS;IACpB;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;gBAEN,SAAS,GAAE,MAAM,EAAO;IAIpC;;;OAGG;IACH,GAAG,cAAe,MAAM,KAAG,IAAI,CAI7B;IAEF;;;OAGG;IACH,MAAM,cAAe,MAAM,KAAG,IAAI,CAKhC;IAEF;;;;OAIG;IACH,GAAG,cAAe,MAAM,KAAG,OAAO,CAEhC;IAEF;;;OAGG;IACH,IAAI,QAAO,MAAM,CAEf;CACH;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,UAAW,OAAO,KAAG,KAAK,IAAI,MAAM,EAA2E,CAAC;AAE9I;;;;;GAKG;AACH,eAAO,MAAM,SAAS,YAAa,OAAO,YAAY,MAAM,EAAE,KAAG,OAEhE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kHAAgH,CAAC;AAE/I;;;;GAIG;AACH,eAAO,MAAM,UAAU,gBAAiB,MAAM,KAAG,MAAM,EAItD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,YAAW,MAAM,EAAE,KAAQ,MAAM,EAgBpF,CAAC;AAkBF;;;;GAIG;AACH,eAAO,MAAM,aAAa,UAAW,OAAO,KAAG,KAAK,IAAI,MAA0D,CAAC;AAEnH;;;;GAIG;AACH,eAAO,MAAM,QAAQ,UAAW,OAAO,KAAG,MAGzC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,MAMjC,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,QAAQ,aAAoB,MAAM,IAAI,KAAG,OAAO,CAAC,IAAI,CAAe,CAAC"}
|
package/dist/index.es.js
CHANGED
|
@@ -4,14 +4,14 @@ var X = (e) => {
|
|
|
4
4
|
};
|
|
5
5
|
var he = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
6
6
|
var g = (e, t, s) => he(e, typeof t != "symbol" ? t + "" : t, s), ye = (e, t, s) => t.has(e) || X("Cannot " + s);
|
|
7
|
-
var k = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)),
|
|
8
|
-
const
|
|
7
|
+
var k = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)), w = (e, t, s) => t.has(e) ? X("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
8
|
+
const Ie = (e = "", t = 10) => {
|
|
9
9
|
const s = new Uint8Array(t);
|
|
10
10
|
crypto.getRandomValues(s);
|
|
11
11
|
const r = Array.from(s).map((o) => o.toString(16).padStart(2, "0")).join("").slice(0, t);
|
|
12
12
|
return e !== "" ? `${e}-${r}` : r;
|
|
13
|
-
};
|
|
14
|
-
class
|
|
13
|
+
}, Ge = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;
|
|
14
|
+
class Xe {
|
|
15
15
|
constructor(t = []) {
|
|
16
16
|
/**
|
|
17
17
|
* Available classes
|
|
@@ -46,7 +46,7 @@ class Ie {
|
|
|
46
46
|
this.classes = t;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const Je = (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
50
|
const t = te(e), s = se(e);
|
|
51
51
|
return [e, ...t, ...s];
|
|
52
52
|
}, te = (e, t = []) => {
|
|
@@ -63,7 +63,7 @@ const Ge = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), Xe =
|
|
|
63
63
|
for (const s of Array.from(e.frames))
|
|
64
64
|
t.push(s), se(s, t);
|
|
65
65
|
return t;
|
|
66
|
-
},
|
|
66
|
+
}, me = (e) => typeof e == "string" && e.trim() !== "", Ye = (e) => typeof e == "object" ? JSON.stringify(e) : `${e}`, Ve = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, et = async (e) => e();
|
|
67
67
|
var E = {
|
|
68
68
|
allRenderFn: !1,
|
|
69
69
|
cmpDidLoad: !0,
|
|
@@ -153,11 +153,11 @@ 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
|
+
}, be = Object.defineProperty, Se = (e, t) => {
|
|
157
157
|
for (var s in t)
|
|
158
|
-
|
|
159
|
-
}, J = (e, t) => t in e, K = "http://www.w3.org/1999/xlink",
|
|
160
|
-
|
|
158
|
+
be(e, s, { get: t[s], enumerable: !0 });
|
|
159
|
+
}, J = (e, t) => t in e, K = "http://www.w3.org/1999/xlink", B = typeof window < "u" ? window : {}, _ = B.document || { head: {} };
|
|
160
|
+
B.HTMLElement;
|
|
161
161
|
var L = {
|
|
162
162
|
$flags$: 0,
|
|
163
163
|
$resourcesUrl$: "",
|
|
@@ -166,13 +166,13 @@ var L = {
|
|
|
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
|
-
}, Q = {},
|
|
170
|
-
|
|
169
|
+
}, Q = {}, Te = "http://www.w3.org/2000/svg", ke = "http://www.w3.org/1999/xhtml", xe = (e) => e != null, re = (e) => (e = typeof e, e === "object" || e === "function"), Ae = {};
|
|
170
|
+
Se(Ae, {
|
|
171
171
|
err: () => oe,
|
|
172
|
-
map: () =>
|
|
172
|
+
map: () => Ee,
|
|
173
173
|
ok: () => U,
|
|
174
|
-
unwrap: () =>
|
|
175
|
-
unwrapErr: () =>
|
|
174
|
+
unwrap: () => Le,
|
|
175
|
+
unwrapErr: () => je
|
|
176
176
|
});
|
|
177
177
|
var U = (e) => ({
|
|
178
178
|
isOk: !0,
|
|
@@ -183,7 +183,7 @@ var U = (e) => ({
|
|
|
183
183
|
isErr: !0,
|
|
184
184
|
value: e
|
|
185
185
|
});
|
|
186
|
-
function
|
|
186
|
+
function Ee(e, t) {
|
|
187
187
|
if (e.isOk) {
|
|
188
188
|
const s = t(e.value);
|
|
189
189
|
return s instanceof Promise ? s.then((r) => U(r)) : U(s);
|
|
@@ -194,15 +194,15 @@ function Ae(e, t) {
|
|
|
194
194
|
}
|
|
195
195
|
throw "should never get here";
|
|
196
196
|
}
|
|
197
|
-
var
|
|
197
|
+
var Le = (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
|
-
},
|
|
205
|
+
}, Re = (e, t, ...s) => {
|
|
206
206
|
let r = null, o = null, n = null, l = !1, a = !1;
|
|
207
207
|
const c = [], d = (i) => {
|
|
208
208
|
for (let $ = 0; $ < i.length; $++)
|
|
@@ -220,7 +220,7 @@ var Ee = (e) => {
|
|
|
220
220
|
$children$: null
|
|
221
221
|
};
|
|
222
222
|
return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
|
|
223
|
-
},
|
|
223
|
+
}, Oe = {}, Me = (e) => e && e.$tag$ === Oe, Z = (e, t, s, r, o, n) => {
|
|
224
224
|
if (s !== r) {
|
|
225
225
|
let l = J(e, t), a = t.toLowerCase();
|
|
226
226
|
if (t === "class") {
|
|
@@ -234,9 +234,9 @@ var Ee = (e) => {
|
|
|
234
234
|
} else if (t !== "key") if (t === "ref")
|
|
235
235
|
r && r(e);
|
|
236
236
|
else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
|
|
237
|
-
if (t[2] === "-" ? t = t.slice(3) : J(
|
|
237
|
+
if (t[2] === "-" ? t = t.slice(3) : J(B, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {
|
|
238
238
|
const c = t.endsWith(ne);
|
|
239
|
-
t = t.replace(
|
|
239
|
+
t = t.replace(Ne, ""), s && L.rel(e, t, s, c), r && L.ael(e, t, r, c);
|
|
240
240
|
}
|
|
241
241
|
} else {
|
|
242
242
|
const c = re(r);
|
|
@@ -254,7 +254,7 @@ var Ee = (e) => {
|
|
|
254
254
|
a !== (a = a.replace(/^xlink\:?/, "")) && (t = a, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (d ? e.removeAttributeNS(K, t) : e.removeAttribute(t)) : (!l || n & 4 || o) && !c && (r = r === !0 ? "" : r, d ? e.setAttributeNS(K, t, r) : e.setAttribute(t, r));
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
},
|
|
257
|
+
}, _e = /\s/, Y = (e) => e ? e.split(_e) : [], ne = "Capture", Ne = new RegExp(ne + "$"), le = (e, t, s) => {
|
|
258
258
|
const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Q, n = t.$attrs$ || Q;
|
|
259
259
|
for (const l of V(Object.keys(o)))
|
|
260
260
|
l in n || Z(r, l, o[l], void 0, s, t.$flags$);
|
|
@@ -270,11 +270,11 @@ function V(e) {
|
|
|
270
270
|
e
|
|
271
271
|
);
|
|
272
272
|
}
|
|
273
|
-
var x, H, j, N = !1, F = !1,
|
|
273
|
+
var x, H, j, N = !1, F = !1, q = !1, h = !1, C = (e, t, s, r) => {
|
|
274
274
|
var o;
|
|
275
275
|
const n = t.$children$[s];
|
|
276
276
|
let l = 0, a, c, d;
|
|
277
|
-
if (N || (
|
|
277
|
+
if (N || (q = !0, n.$tag$ === "slot" && (x && r.classList.add(x + "-s"), n.$flags$ |= n.$children$ ? (
|
|
278
278
|
// slot element has fallback content
|
|
279
279
|
// still create an element that "mocks" the slot element
|
|
280
280
|
2
|
|
@@ -289,9 +289,9 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
|
|
|
289
289
|
a = n.$elm$ = _.createTextNode("");
|
|
290
290
|
else {
|
|
291
291
|
if (h || (h = n.$tag$ === "svg"), a = n.$elm$ = _.createElementNS(
|
|
292
|
-
h ?
|
|
292
|
+
h ? Te : ke,
|
|
293
293
|
!N && E.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
|
|
294
|
-
), h && n.$tag$ === "foreignObject" && (h = !1), le(null, n, h), !!a.getRootNode().querySelector("body") && E.scoped &&
|
|
294
|
+
), h && n.$tag$ === "foreignObject" && (h = !1), le(null, n, h), !!a.getRootNode().querySelector("body") && E.scoped && xe(x) && a["s-si"] !== x && a.classList.add(a["s-si"] = x), G(a, r), n.$children$)
|
|
295
295
|
for (l = 0; l < n.$children$.length; ++l)
|
|
296
296
|
c = C(e, n, l, a), c && a.appendChild(c);
|
|
297
297
|
n.$tag$ === "svg" ? h = !1 : a.tagName === "foreignObject" && (h = !0);
|
|
@@ -307,7 +307,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
|
|
|
307
307
|
}
|
|
308
308
|
for (let r = s.length - 1; r >= 0; r--) {
|
|
309
309
|
const o = s[r];
|
|
310
|
-
o["s-hn"] !== j && o["s-ol"] && (T(ce(o), o, I(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0,
|
|
310
|
+
o["s-hn"] !== j && o["s-ol"] && (T(ce(o), o, I(o)), o["s-ol"].remove(), o["s-ol"] = void 0, o["s-sh"] = void 0, q = !0), t && R(o, t);
|
|
311
311
|
}
|
|
312
312
|
L.$flags$ &= -2;
|
|
313
313
|
}, ie = (e, t, s, r, o, n) => {
|
|
@@ -322,7 +322,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
|
|
|
322
322
|
$e(o), n && (F = !0, n["s-ol"] ? n["s-ol"].remove() : R(n, !0), n.remove());
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
|
-
},
|
|
325
|
+
}, Fe = (e, t, s, r, o = !1) => {
|
|
326
326
|
let n = 0, l = 0, a = 0, c = 0, d = t.length - 1, f = t[0], i = t[d], $ = r.length - 1, u = r[0], p = r[$], m, y;
|
|
327
327
|
for (; n <= d && l <= $; )
|
|
328
328
|
if (f == null)
|
|
@@ -366,7 +366,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
|
|
|
366
366
|
) : s ? !0 : e.$key$ === t.$key$ : !1, I = (e) => e && e["s-ol"] || e, ce = (e) => (e["s-ol"] ? e["s-ol"] : e).parentNode, A = (e, t, s = !1) => {
|
|
367
367
|
const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, l = t.$tag$, a = t.$text$;
|
|
368
368
|
let c;
|
|
369
|
-
a === null ? (h = l === "svg" ? !0 : l === "foreignObject" ? !1 : h, l === "slot" && !N || le(e, t, h), o !== null && n !== null ?
|
|
369
|
+
a === null ? (h = l === "svg" ? !0 : l === "foreignObject" ? !1 : h, l === "slot" && !N || le(e, t, h), o !== null && n !== null ? Fe(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = ""), ie(r, null, t, n, 0, n.length - 1)) : (
|
|
370
370
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
371
371
|
!s && E.updatable && o !== null && ae(o, 0, o.length - 1)
|
|
372
372
|
), h && l === "svg" && (h = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = a : e.$text$ !== a && (r.data = a);
|
|
@@ -435,9 +435,9 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
|
|
|
435
435
|
for (const n of Array.from(e.childNodes))
|
|
436
436
|
G(n, e, !0);
|
|
437
437
|
}
|
|
438
|
-
},
|
|
438
|
+
}, Ce = (e, t, s = !1) => {
|
|
439
439
|
var r, o, n, l, a;
|
|
440
|
-
const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), i =
|
|
440
|
+
const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), i = Me(t) ? t : Re(null, null, t);
|
|
441
441
|
if (j = c.tagName, d.$attrsToReflect$ && (i.$attrs$ = i.$attrs$ || {}, d.$attrsToReflect$.map(
|
|
442
442
|
([$, u]) => i.$attrs$[u] = c[$]
|
|
443
443
|
)), s && i.$attrs$)
|
|
@@ -445,7 +445,7 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
|
|
|
445
445
|
c.hasAttribute($) && !["key", "ref", "style", "class"].includes($) && (i.$attrs$[$] = c[$]);
|
|
446
446
|
i.$tag$ = null, i.$flags$ |= 4, e.$vnode$ = i, i.$elm$ = f.$elm$ = c.shadowRoot || c, x = c["s-sc"], N = (d.$flags$ & 1) !== 0, H = c["s-cr"], F = !1, A(f, i, s);
|
|
447
447
|
{
|
|
448
|
-
if (L.$flags$ |= 1,
|
|
448
|
+
if (L.$flags$ |= 1, q) {
|
|
449
449
|
ue(i.$elm$);
|
|
450
450
|
for (const $ of b) {
|
|
451
451
|
const u = $.$nodeToRelocate$;
|
|
@@ -486,19 +486,19 @@ var x, H, j, N = !1, F = !1, z = !1, h = !1, C = (e, t, s, r) => {
|
|
|
486
486
|
$["s-hn"] !== j && !$["s-sh"] && (s && $["s-ih"] == null && ($["s-ih"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);
|
|
487
487
|
H = void 0;
|
|
488
488
|
};
|
|
489
|
-
const
|
|
489
|
+
const De = (e, t, s) => {
|
|
490
490
|
[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
491
|
}, pe = (e, t, s, r, o) => {
|
|
492
492
|
if (t && typeof t == "string") {
|
|
493
493
|
const n = document.createElement(t);
|
|
494
494
|
Object.keys(s || {}).forEach((l) => {
|
|
495
|
-
|
|
495
|
+
De(n, l, s[l]);
|
|
496
496
|
}), r == null || r.forEach((l) => {
|
|
497
497
|
pe(n, l.$tag$, l.$attrs$, l.$children$, l.$text$);
|
|
498
498
|
}), s != null && s.innerHTML && (n.innerHTML = s.innerHTML), e.appendChild(n);
|
|
499
499
|
}
|
|
500
500
|
o && (e.innerHTML = o);
|
|
501
|
-
},
|
|
501
|
+
}, tt = (e, t) => {
|
|
502
502
|
const s = {};
|
|
503
503
|
if (typeof e != "object")
|
|
504
504
|
throw new Error("filterArgs - args isn't an object.");
|
|
@@ -508,11 +508,11 @@ const Ce = (e, t, s) => {
|
|
|
508
508
|
(!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[n] = o);
|
|
509
509
|
}
|
|
510
510
|
return s;
|
|
511
|
-
},
|
|
511
|
+
}, st = (e, t) => {
|
|
512
512
|
var r, o;
|
|
513
513
|
const s = document.getElementById("storybook-root");
|
|
514
514
|
if (s !== null)
|
|
515
|
-
return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"),
|
|
515
|
+
return (o = document.querySelector("[lang]")) == null || o.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), Ce(
|
|
516
516
|
{
|
|
517
517
|
$ancestorComponent$: void 0,
|
|
518
518
|
$flags$: 0,
|
|
@@ -525,7 +525,7 @@ const Ce = (e, t, s) => {
|
|
|
525
525
|
},
|
|
526
526
|
e(t)
|
|
527
527
|
), s.children[s.children.length - 1];
|
|
528
|
-
},
|
|
528
|
+
}, rt = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
|
|
529
529
|
const o = document.createElement("div");
|
|
530
530
|
return pe(o, e, t, s, r), o.innerHTML;
|
|
531
531
|
}, D = (e, t) => {
|
|
@@ -534,8 +534,8 @@ const Ce = (e, t, s) => {
|
|
|
534
534
|
const s = t.split("/");
|
|
535
535
|
return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
|
|
536
536
|
};
|
|
537
|
-
var S,
|
|
538
|
-
class
|
|
537
|
+
var S, P;
|
|
538
|
+
class ot {
|
|
539
539
|
constructor(t) {
|
|
540
540
|
/**
|
|
541
541
|
* JsonDocs
|
|
@@ -546,14 +546,14 @@ class rt {
|
|
|
546
546
|
* @param tagName - tag name we want to get the data from
|
|
547
547
|
* @returns component data
|
|
548
548
|
*/
|
|
549
|
-
|
|
549
|
+
w(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));
|
|
550
550
|
/**
|
|
551
551
|
* Get the control for the given prop
|
|
552
552
|
* Based on https://storybook.js.org/docs/api/arg-types#controltype
|
|
553
553
|
* @param prop - prop to get control for
|
|
554
554
|
* @returns control type and options if applicable
|
|
555
555
|
*/
|
|
556
|
-
|
|
556
|
+
w(this, P, (t) => {
|
|
557
557
|
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
558
|
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
559
|
});
|
|
@@ -564,7 +564,7 @@ class rt {
|
|
|
564
564
|
*/
|
|
565
565
|
g(this, "extractArgTypes", (t) => {
|
|
566
566
|
const s = k(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((f, i) => {
|
|
567
|
-
const { control: $, options: u } = k(this,
|
|
567
|
+
const { control: $, options: u } = k(this, P).call(this, i);
|
|
568
568
|
return {
|
|
569
569
|
...f,
|
|
570
570
|
[i.name]: {
|
|
@@ -682,8 +682,8 @@ class rt {
|
|
|
682
682
|
this.jsonDoc = t;
|
|
683
683
|
}
|
|
684
684
|
}
|
|
685
|
-
S = new WeakMap(),
|
|
686
|
-
const
|
|
685
|
+
S = new WeakMap(), P = new WeakMap();
|
|
686
|
+
const Pe = (e, t) => {
|
|
687
687
|
if (t)
|
|
688
688
|
return `${e}${t}`;
|
|
689
689
|
}, ge = (e) => {
|
|
@@ -712,9 +712,9 @@ const De = (e, t) => {
|
|
|
712
712
|
`, t += e.slots.map(({ name: o, docs: n }) => `- \`${o}\`: ${n}
|
|
713
713
|
`).join(""), t += `
|
|
714
714
|
`), t;
|
|
715
|
-
},
|
|
715
|
+
}, z = (e) => `${e.docs}
|
|
716
716
|
|
|
717
|
-
Type: \`${e.type}\``,
|
|
717
|
+
Type: \`${e.type}\``, nt = (e, t, s, r) => ({
|
|
718
718
|
$schema: "https://json.schemastore.org/web-types",
|
|
719
719
|
name: e,
|
|
720
720
|
version: t,
|
|
@@ -729,7 +729,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
|
|
|
729
729
|
"doc-url": n,
|
|
730
730
|
attributes: o.props.filter((l) => l.attr).map((l) => ({
|
|
731
731
|
name: l.attr,
|
|
732
|
-
description:
|
|
732
|
+
description: z(l),
|
|
733
733
|
"doc-url": n,
|
|
734
734
|
value: {
|
|
735
735
|
type: l.type,
|
|
@@ -740,7 +740,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
|
|
|
740
740
|
js: {
|
|
741
741
|
properties: o.props.map((l) => ({
|
|
742
742
|
name: l.name,
|
|
743
|
-
description:
|
|
743
|
+
description: z(l),
|
|
744
744
|
"doc-url": n,
|
|
745
745
|
value: {
|
|
746
746
|
type: l.type,
|
|
@@ -765,11 +765,11 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
|
|
|
765
765
|
}
|
|
766
766
|
}), we = (e, t, s) => [
|
|
767
767
|
{ name: "Storybook", url: D(e, s) },
|
|
768
|
-
{ name: "Sources", url:
|
|
769
|
-
],
|
|
768
|
+
{ name: "Sources", url: Pe(t, s) }
|
|
769
|
+
], Ue = (e) => {
|
|
770
770
|
if (!e.values.some(({ value: t }) => t === void 0))
|
|
771
771
|
return e.values.map(({ value: t }) => ({ name: t }));
|
|
772
|
-
},
|
|
772
|
+
}, lt = (e, t, s) => ({
|
|
773
773
|
version: 1.1,
|
|
774
774
|
tags: e.components.map((r) => {
|
|
775
775
|
const o = we(t, s, r.filePath);
|
|
@@ -778,8 +778,8 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
|
|
|
778
778
|
description: ge(r),
|
|
779
779
|
attributes: r.props.map((n) => ({
|
|
780
780
|
name: n.attr || n.name,
|
|
781
|
-
description:
|
|
782
|
-
values:
|
|
781
|
+
description: z(n),
|
|
782
|
+
values: Ue(n),
|
|
783
783
|
references: o
|
|
784
784
|
})),
|
|
785
785
|
references: o
|
|
@@ -787,7 +787,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
|
|
|
787
787
|
}),
|
|
788
788
|
globalAttributes: [],
|
|
789
789
|
valueSets: []
|
|
790
|
-
}),
|
|
790
|
+
}), it = (e) => ({
|
|
791
791
|
version: 1.1,
|
|
792
792
|
properties: e.components.flatMap(
|
|
793
793
|
(t) => t.styles.map((s) => ({
|
|
@@ -795,16 +795,16 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
|
|
|
795
795
|
description: s.docs
|
|
796
796
|
}))
|
|
797
797
|
)
|
|
798
|
-
}),
|
|
798
|
+
}), at = (e) => {
|
|
799
799
|
const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
|
|
800
|
-
return
|
|
801
|
-
},
|
|
800
|
+
return ze([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);
|
|
801
|
+
}, ct = (e) => e.toISOString().split("T")[0], We = (e, t, s) => {
|
|
802
802
|
const r = e.closest("[lang]"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), n = o.length > 0 && typeof o[0] == "string" ? o[0] : navigator.language || s, l = n.split("-").shift();
|
|
803
803
|
return {
|
|
804
804
|
locale: n,
|
|
805
805
|
messages: t[l] || t[s]
|
|
806
806
|
};
|
|
807
|
-
},
|
|
807
|
+
}, 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), He = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ze = (e, t, s) => typeof e != "string" || e === "" || !He.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), $t = (e, t) => (s) => We(s, e, t), dt = ({ disconnect: e, observe: t, takeRecords: s }) => {
|
|
808
808
|
class r {
|
|
809
809
|
constructor(n) {
|
|
810
810
|
/**
|
|
@@ -833,7 +833,7 @@ Type: \`${e.type}\``, ot = (e, t, s, r) => ({
|
|
|
833
833
|
value: r
|
|
834
834
|
});
|
|
835
835
|
}), r;
|
|
836
|
-
},
|
|
836
|
+
}, pt = ({ disconnect: e, observe: t }) => {
|
|
837
837
|
class s {
|
|
838
838
|
constructor(o) {
|
|
839
839
|
/**
|
|
@@ -873,7 +873,7 @@ class Be extends Event {
|
|
|
873
873
|
g(this, "detail");
|
|
874
874
|
}
|
|
875
875
|
}
|
|
876
|
-
const
|
|
876
|
+
const gt = () => {
|
|
877
877
|
class e extends Be {
|
|
878
878
|
}
|
|
879
879
|
return [window, global].forEach((t) => {
|
|
@@ -885,34 +885,35 @@ const pt = () => {
|
|
|
885
885
|
}), e;
|
|
886
886
|
};
|
|
887
887
|
export {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
888
|
+
Xe as ClassList,
|
|
889
|
+
ot as StorybookPreview,
|
|
890
|
+
Je as allItemsAreString,
|
|
891
|
+
Ve as cleanString,
|
|
892
|
+
Ie as createID,
|
|
893
|
+
He as dateRegExp,
|
|
894
|
+
ct as dateToString,
|
|
895
|
+
$t as defineLocales,
|
|
896
|
+
tt as filterArgs,
|
|
897
|
+
Qe as focusableElements,
|
|
898
|
+
at as getLocaleDatePattern,
|
|
899
899
|
te as getParentWindows,
|
|
900
|
-
|
|
900
|
+
rt as getStoryHTML,
|
|
901
901
|
D as getStorybookUrl,
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
dt as
|
|
911
|
-
pt as
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
902
|
+
Ze as getWindows,
|
|
903
|
+
Ke as isTagName,
|
|
904
|
+
me as isValidString,
|
|
905
|
+
Ge as isValideID,
|
|
906
|
+
ft as localeCurrency,
|
|
907
|
+
ze as localeDate,
|
|
908
|
+
ut as localeNumber,
|
|
909
|
+
et as nextTick,
|
|
910
|
+
dt as setupMutationObserverMock,
|
|
911
|
+
pt as setupResizeObserverMock,
|
|
912
|
+
gt as setupSubmitEventMock,
|
|
913
|
+
st as stencilWrapper,
|
|
914
|
+
Ye as toString,
|
|
915
|
+
it as vsCodeCssGenerator,
|
|
916
|
+
lt as vsCodeGenerator,
|
|
917
|
+
nt as webTypesGenerator
|
|
917
918
|
};
|
|
918
919
|
//# sourceMappingURL=index.es.js.map
|