@mgdis/stencil-helpers 2.2.3 → 2.2.4
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 +210 -299
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/dist/tests/unit.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/index.es.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
var he = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var W = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var ve = (e, t, s) => t in e ? he(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
6
|
+
var p = (e, t, s) => ve(e, typeof t != "symbol" ? t + "" : t, s), ye = (e, t, s) => t.has(e) || W("Cannot " + s);
|
|
7
|
+
var x = (e, t, s) => (ye(e, t, "read from private field"), s ? s.call(e) : t.get(e)), B = (e, t, s) => t.has(e) ? W("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, s);
|
|
8
8
|
const Ge = (e = "", t = 10) => {
|
|
9
9
|
const s = new Uint8Array(t);
|
|
10
10
|
crypto.getRandomValues(s);
|
|
11
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
13
|
}, Xe = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;
|
|
14
|
-
class
|
|
14
|
+
class Ze {
|
|
15
15
|
constructor(t = []) {
|
|
16
16
|
/**
|
|
17
17
|
* Available classes
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
p(this, "classes");
|
|
20
20
|
/**
|
|
21
21
|
* Add class
|
|
22
22
|
* @param className - class name to add
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
p(this, "add", (t) => {
|
|
25
25
|
this.has(t) || this.classes.push(t);
|
|
26
26
|
});
|
|
27
27
|
/**
|
|
28
28
|
* Delete class
|
|
29
29
|
* @param className - class name to delete
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
p(this, "delete", (t) => {
|
|
32
32
|
const s = this.classes.indexOf(t);
|
|
33
33
|
s > -1 && this.classes.splice(s, 1);
|
|
34
34
|
});
|
|
@@ -37,128 +37,42 @@ class Ke {
|
|
|
37
37
|
* @param className - class name to check
|
|
38
38
|
* @returns class name is in the list
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
p(this, "has", (t) => this.classes.includes(t));
|
|
41
41
|
/**
|
|
42
42
|
* Join classes seperated by spaces
|
|
43
43
|
* @returns joined values
|
|
44
44
|
*/
|
|
45
|
-
|
|
45
|
+
p(this, "join", () => this.classes.join(" "));
|
|
46
46
|
this.classes = t;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
const t =
|
|
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', Ye = (e) => {
|
|
50
|
+
const t = Y(e), s = V(e);
|
|
51
51
|
return [e, ...t, ...s];
|
|
52
|
-
},
|
|
52
|
+
}, Y = (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), Y(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
|
+
}, V = (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), V(s, t);
|
|
65
65
|
return t;
|
|
66
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
|
|
68
|
-
allRenderFn: !1,
|
|
69
|
-
cmpDidLoad: !0,
|
|
70
|
-
cmpDidUnload: !1,
|
|
71
|
-
cmpDidUpdate: !0,
|
|
72
|
-
cmpDidRender: !0,
|
|
73
|
-
cmpWillLoad: !0,
|
|
74
|
-
cmpWillUpdate: !0,
|
|
75
|
-
cmpWillRender: !0,
|
|
76
|
-
connectedCallback: !0,
|
|
77
|
-
disconnectedCallback: !0,
|
|
78
|
-
element: !0,
|
|
79
|
-
event: !0,
|
|
80
|
-
hasRenderFn: !0,
|
|
81
|
-
lifecycle: !0,
|
|
82
|
-
hostListener: !0,
|
|
83
|
-
hostListenerTargetWindow: !0,
|
|
84
|
-
hostListenerTargetDocument: !0,
|
|
85
|
-
hostListenerTargetBody: !0,
|
|
86
|
-
hostListenerTargetParent: !1,
|
|
87
|
-
hostListenerTarget: !0,
|
|
88
|
-
member: !0,
|
|
89
|
-
method: !0,
|
|
90
|
-
mode: !0,
|
|
91
|
-
observeAttribute: !0,
|
|
92
|
-
prop: !0,
|
|
93
|
-
propMutable: !0,
|
|
94
|
-
reflect: !0,
|
|
95
|
-
scoped: !0,
|
|
96
|
-
shadowDom: !0,
|
|
97
|
-
slot: !0,
|
|
98
|
-
cssAnnotations: !0,
|
|
99
|
-
state: !0,
|
|
100
|
-
style: !0,
|
|
101
|
-
formAssociated: !1,
|
|
102
|
-
svg: !0,
|
|
67
|
+
var C = {
|
|
103
68
|
updatable: !0,
|
|
104
|
-
vdomAttribute: !0,
|
|
105
|
-
vdomXlink: !0,
|
|
106
|
-
vdomClass: !0,
|
|
107
|
-
vdomFunctional: !0,
|
|
108
|
-
vdomKey: !0,
|
|
109
|
-
vdomListener: !0,
|
|
110
|
-
vdomRef: !0,
|
|
111
|
-
vdomPropOrAttr: !0,
|
|
112
|
-
vdomRender: !0,
|
|
113
|
-
vdomStyle: !0,
|
|
114
|
-
vdomText: !0,
|
|
115
|
-
watchCallback: !0,
|
|
116
|
-
taskQueue: !0,
|
|
117
|
-
hotModuleReplacement: !1,
|
|
118
|
-
isDebug: !1,
|
|
119
|
-
isDev: !1,
|
|
120
|
-
isTesting: !1,
|
|
121
|
-
hydrateServerSide: !1,
|
|
122
|
-
hydrateClientSide: !1,
|
|
123
|
-
lifecycleDOMEvents: !1,
|
|
124
|
-
lazyLoad: !1,
|
|
125
|
-
profile: !1,
|
|
126
69
|
slotRelocation: !0,
|
|
127
70
|
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
128
|
-
appendChildSlotFix: !1,
|
|
129
|
-
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
130
|
-
cloneNodeFix: !1,
|
|
131
|
-
hydratedAttribute: !1,
|
|
132
|
-
hydratedClass: !0,
|
|
133
|
-
// TODO(STENCIL-1305): remove this option
|
|
134
|
-
scriptDataOpts: !1,
|
|
135
|
-
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
136
|
-
scopedSlotTextContentFix: !1,
|
|
137
|
-
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
138
|
-
shadowDomShim: !1,
|
|
139
|
-
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
140
|
-
slotChildNodesFix: !1,
|
|
141
|
-
invisiblePrehydration: !0,
|
|
142
|
-
propBoolean: !0,
|
|
143
|
-
propNumber: !0,
|
|
144
|
-
propString: !0,
|
|
145
|
-
constructableCSS: !0,
|
|
146
|
-
cmpShouldUpdate: !0,
|
|
147
|
-
devTools: !1,
|
|
148
|
-
shadowDelegatesFocus: !0,
|
|
149
|
-
initializeNextTick: !1,
|
|
150
|
-
asyncLoading: !0,
|
|
151
|
-
asyncQueue: !1,
|
|
152
|
-
transformTagName: !1,
|
|
153
|
-
attachStyles: !0,
|
|
154
|
-
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
155
71
|
experimentalSlotFixes: !1
|
|
156
72
|
}, be = Object.defineProperty, Se = (e, t) => {
|
|
157
73
|
for (var s in t)
|
|
158
74
|
be(e, s, { get: t[s], enumerable: !0 });
|
|
159
|
-
}, ke = "http://www.w3.org/2000/svg",
|
|
160
|
-
z.HTMLElement;
|
|
161
|
-
var A = {
|
|
75
|
+
}, ke = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml", G = (e, t) => t in e, X = "http://www.w3.org/1999/xlink", ee = typeof window < "u" ? window : {}, L = ee.document || { head: {} }, _ = {
|
|
162
76
|
$flags$: 0,
|
|
163
77
|
$resourcesUrl$: "",
|
|
164
78
|
jmp: (e) => e(),
|
|
@@ -166,12 +80,12 @@ var A = {
|
|
|
166
80
|
ael: (e, t, s, r) => e.addEventListener(t, s, r),
|
|
167
81
|
rel: (e, t, s, r) => e.removeEventListener(t, s, r),
|
|
168
82
|
ce: (e, t) => new CustomEvent(e, t)
|
|
169
|
-
},
|
|
170
|
-
Se(
|
|
83
|
+
}, Te = (e) => e != null && e !== void 0, te = (e) => (e = typeof e, e === "object" || e === "function"), _e = {};
|
|
84
|
+
Se(_e, {
|
|
171
85
|
err: () => se,
|
|
172
86
|
map: () => Ee,
|
|
173
87
|
ok: () => P,
|
|
174
|
-
unwrap: () =>
|
|
88
|
+
unwrap: () => Ae,
|
|
175
89
|
unwrapErr: () => je
|
|
176
90
|
});
|
|
177
91
|
var P = (e) => ({
|
|
@@ -194,7 +108,7 @@ function Ee(e, t) {
|
|
|
194
108
|
}
|
|
195
109
|
throw "should never get here";
|
|
196
110
|
}
|
|
197
|
-
var
|
|
111
|
+
var Ae = (e) => {
|
|
198
112
|
if (e.isOk)
|
|
199
113
|
return e.value;
|
|
200
114
|
throw e.value;
|
|
@@ -206,7 +120,7 @@ var _e = (e) => {
|
|
|
206
120
|
const t = e.__childNodes || e.childNodes;
|
|
207
121
|
e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && ne(t, e.tagName).forEach((s) => {
|
|
208
122
|
var r;
|
|
209
|
-
s.nodeType === 1 && s.tagName === "SLOT-FB" && ((r =
|
|
123
|
+
s.nodeType === 1 && s.tagName === "SLOT-FB" && ((r = Oe(s, s["s-sn"], !1)) != null && r.length ? s.hidden = !0 : s.hidden = !1);
|
|
210
124
|
});
|
|
211
125
|
for (const s of t)
|
|
212
126
|
s.nodeType === 1 && (s.__childNodes || s.childNodes).length && re(s);
|
|
@@ -217,21 +131,21 @@ function ne(e, t, s) {
|
|
|
217
131
|
i = e[r], i["s-sr"] && i["s-hn"] === t && s === void 0 && n.push(i), n = [...n, ...ne(i.childNodes, t, s)];
|
|
218
132
|
return n;
|
|
219
133
|
}
|
|
220
|
-
var
|
|
134
|
+
var Oe = (e, t, s = !0) => {
|
|
221
135
|
const r = [];
|
|
222
136
|
for ((s && e["s-sr"] || !e["s-sr"]) && r.push(e); (e = e.nextSibling) && e["s-sn"] === t; )
|
|
223
137
|
r.push(e);
|
|
224
138
|
return r;
|
|
225
|
-
},
|
|
139
|
+
}, Z = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", Re = (e, t, ...s) => {
|
|
226
140
|
let r = null, n = null, i = null, o = !1, f = !1;
|
|
227
|
-
const c = [],
|
|
228
|
-
for (let
|
|
229
|
-
r = l[
|
|
141
|
+
const c = [], $ = (l) => {
|
|
142
|
+
for (let d = 0; d < l.length; d++)
|
|
143
|
+
r = l[d], Array.isArray(r) ? $(r) : r != null && typeof r != "boolean" && ((o = !te(r)) && (r = String(r)), o && f ? c[c.length - 1].$text$ += r : c.push(o ? w(null, r) : r), f = o);
|
|
230
144
|
};
|
|
231
|
-
|
|
232
|
-
const
|
|
233
|
-
return
|
|
234
|
-
},
|
|
145
|
+
$(s);
|
|
146
|
+
const u = w(e, null);
|
|
147
|
+
return u.$attrs$ = t, c.length > 0 && (u.$children$ = c), u.$key$ = n, u.$name$ = i, u;
|
|
148
|
+
}, w = (e, t) => {
|
|
235
149
|
const s = {
|
|
236
150
|
$flags$: 0,
|
|
237
151
|
$tag$: e,
|
|
@@ -240,28 +154,28 @@ var Le = (e, t, s = !0) => {
|
|
|
240
154
|
$children$: null
|
|
241
155
|
};
|
|
242
156
|
return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;
|
|
243
|
-
},
|
|
157
|
+
}, Le = {}, Me = (e) => e && e.$tag$ === Le, J = (e, t, s, r, n, i, o) => {
|
|
244
158
|
if (s !== r) {
|
|
245
|
-
let f =
|
|
159
|
+
let f = G(e, t), c = t.toLowerCase();
|
|
246
160
|
if (t === "class") {
|
|
247
|
-
const
|
|
248
|
-
let l =
|
|
249
|
-
|
|
161
|
+
const $ = e.classList, u = K(s);
|
|
162
|
+
let l = K(r);
|
|
163
|
+
$.remove(...u.filter((d) => d && !l.includes(d))), $.add(...l.filter((d) => d && !u.includes(d)));
|
|
250
164
|
} else if (t === "style") {
|
|
251
|
-
for (const
|
|
252
|
-
(!r || r[
|
|
253
|
-
for (const
|
|
254
|
-
(!s || r[
|
|
165
|
+
for (const $ in s)
|
|
166
|
+
(!r || r[$] == null) && ($.includes("-") ? e.style.removeProperty($) : e.style[$] = "");
|
|
167
|
+
for (const $ in r)
|
|
168
|
+
(!s || r[$] !== s[$]) && ($.includes("-") ? e.style.setProperty($, r[$]) : e.style[$] = r[$]);
|
|
255
169
|
} else if (t !== "key") if (t === "ref")
|
|
256
170
|
r && r(e);
|
|
257
171
|
else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
|
|
258
|
-
if (t[2] === "-" ? t = t.slice(3) :
|
|
259
|
-
const
|
|
260
|
-
t = t.replace(Ne, ""), s &&
|
|
172
|
+
if (t[2] === "-" ? t = t.slice(3) : G(ee, c) ? t = c.slice(2) : t = c[2] + t.slice(3), s || r) {
|
|
173
|
+
const $ = t.endsWith(ie);
|
|
174
|
+
t = t.replace(Ne, ""), s && _.rel(e, t, s, $), r && _.ael(e, t, r, $);
|
|
261
175
|
}
|
|
262
176
|
} else {
|
|
263
|
-
const
|
|
264
|
-
if ((f ||
|
|
177
|
+
const $ = te(r);
|
|
178
|
+
if ((f || $ && r !== null) && !n)
|
|
265
179
|
try {
|
|
266
180
|
if (e.tagName.includes("-"))
|
|
267
181
|
e[t] !== r && (e[t] = r);
|
|
@@ -271,14 +185,14 @@ var Le = (e, t, s = !0) => {
|
|
|
271
185
|
}
|
|
272
186
|
} catch {
|
|
273
187
|
}
|
|
274
|
-
let
|
|
275
|
-
c !== (c = c.replace(/^xlink\:?/, "")) && (t = c,
|
|
188
|
+
let u = !1;
|
|
189
|
+
c !== (c = c.replace(/^xlink\:?/, "")) && (t = c, u = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === "") && (u ? e.removeAttributeNS(X, t) : e.removeAttribute(t)) : (!f || i & 4 || n) && !$ && (r = r === !0 ? "" : r, u ? e.setAttributeNS(X, t, r) : e.setAttribute(t, r));
|
|
276
190
|
}
|
|
277
191
|
}
|
|
278
|
-
},
|
|
192
|
+
}, Fe = /\s/, K = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(Fe)), ie = "Capture", Ne = new RegExp(ie + "$"), oe = (e, t, s, r) => {
|
|
279
193
|
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
|
|
281
|
-
f in o ||
|
|
194
|
+
for (const f of Q(Object.keys(i)))
|
|
195
|
+
f in o || J(
|
|
282
196
|
n,
|
|
283
197
|
f,
|
|
284
198
|
i[f],
|
|
@@ -286,8 +200,8 @@ var Le = (e, t, s = !0) => {
|
|
|
286
200
|
s,
|
|
287
201
|
t.$flags$
|
|
288
202
|
);
|
|
289
|
-
for (const f of
|
|
290
|
-
|
|
203
|
+
for (const f of Q(Object.keys(o)))
|
|
204
|
+
J(
|
|
291
205
|
n,
|
|
292
206
|
f,
|
|
293
207
|
i[f],
|
|
@@ -296,7 +210,7 @@ var Le = (e, t, s = !0) => {
|
|
|
296
210
|
t.$flags$
|
|
297
211
|
);
|
|
298
212
|
};
|
|
299
|
-
function
|
|
213
|
+
function Q(e) {
|
|
300
214
|
return e.includes("ref") ? (
|
|
301
215
|
// we need to sort these to ensure that `'ref'` is the last attr
|
|
302
216
|
[...e.filter((t) => t !== "ref"), "ref"]
|
|
@@ -305,7 +219,7 @@ function Y(e) {
|
|
|
305
219
|
e
|
|
306
220
|
);
|
|
307
221
|
}
|
|
308
|
-
var
|
|
222
|
+
var M, F, E, N = !1, H = !1, I = !1, v = !1, D = (e, t, s) => {
|
|
309
223
|
var r;
|
|
310
224
|
const n = t.$children$[s];
|
|
311
225
|
let i = 0, o, f, c;
|
|
@@ -319,86 +233,86 @@ var F, M, E, N = !1, D = !1, I = !1, y = !1, C = (e, t, s) => {
|
|
|
319
233
|
// where actual slot content should sit next to
|
|
320
234
|
1
|
|
321
235
|
))), n.$text$ !== null)
|
|
322
|
-
o = n.$elm$ =
|
|
236
|
+
o = n.$elm$ = L.createTextNode(n.$text$);
|
|
323
237
|
else if (n.$flags$ & 1)
|
|
324
|
-
o = n.$elm$ =
|
|
238
|
+
o = n.$elm$ = L.createTextNode("");
|
|
325
239
|
else {
|
|
326
|
-
if (
|
|
327
|
-
|
|
328
|
-
!N &&
|
|
329
|
-
),
|
|
240
|
+
if (v || (v = n.$tag$ === "svg"), o = n.$elm$ = L.createElementNS(
|
|
241
|
+
v ? ke : xe,
|
|
242
|
+
!N && C.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
|
|
243
|
+
), v && n.$tag$ === "foreignObject" && (v = !1), oe(null, n, v), Te(M) && o["s-si"] !== M && o.classList.add(o["s-si"] = M), n.$children$)
|
|
330
244
|
for (i = 0; i < n.$children$.length; ++i)
|
|
331
|
-
f =
|
|
332
|
-
n.$tag$ === "svg" ?
|
|
245
|
+
f = D(e, n, i), f && o.appendChild(f);
|
|
246
|
+
n.$tag$ === "svg" ? v = !1 : o.tagName === "foreignObject" && (v = !0);
|
|
333
247
|
}
|
|
334
|
-
return o["s-hn"] = E, n.$flags$ & 3 && (o["s-sr"] = !0, o["s-cr"] =
|
|
335
|
-
},
|
|
336
|
-
|
|
248
|
+
return o["s-hn"] = E, n.$flags$ & 3 && (o["s-sr"] = !0, o["s-cr"] = F, 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$ && A(e.$elm$, !1), $e(F, o, t.$elm$, e == null ? void 0 : e.$elm$)), o;
|
|
249
|
+
}, A = (e, t) => {
|
|
250
|
+
_.$flags$ |= 1;
|
|
337
251
|
const s = Array.from(e.__childNodes || e.childNodes);
|
|
338
|
-
e["s-sr"] &&
|
|
252
|
+
e["s-sr"] && C.experimentalSlotFixes;
|
|
339
253
|
for (let r = s.length - 1; r >= 0; r--) {
|
|
340
254
|
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 &&
|
|
255
|
+
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 && A(n, t);
|
|
342
256
|
}
|
|
343
|
-
|
|
257
|
+
_.$flags$ &= -2;
|
|
344
258
|
}, le = (e, t, s, r, n, i) => {
|
|
345
259
|
let o = e["s-cr"] && e["s-cr"].parentNode || e, f;
|
|
346
260
|
for (o.shadowRoot && o.tagName === E && (o = o.shadowRoot); n <= i; ++n)
|
|
347
|
-
r[n] && (f =
|
|
261
|
+
r[n] && (f = D(null, s, n), f && (r[n].$elm$ = f, k(o, f, j(t))));
|
|
348
262
|
}, ae = (e, t, s) => {
|
|
349
263
|
for (let r = t; r <= s; ++r) {
|
|
350
264
|
const n = e[r];
|
|
351
265
|
if (n) {
|
|
352
266
|
const i = n.$elm$;
|
|
353
|
-
fe(n), i && (
|
|
267
|
+
fe(n), i && (H = !0, i["s-ol"] ? i["s-ol"].remove() : A(i, !0), i.remove());
|
|
354
268
|
}
|
|
355
269
|
}
|
|
356
|
-
},
|
|
357
|
-
let i = 0, o = 0, f = 0, c = 0,
|
|
358
|
-
for (; i <=
|
|
359
|
-
if (
|
|
360
|
-
|
|
270
|
+
}, He = (e, t, s, r, n = !1) => {
|
|
271
|
+
let i = 0, o = 0, f = 0, c = 0, $ = t.length - 1, u = t[0], l = t[$], d = r.length - 1, a = r[0], g = r[d], m, y;
|
|
272
|
+
for (; i <= $ && o <= d; )
|
|
273
|
+
if (u == null)
|
|
274
|
+
u = t[++i];
|
|
361
275
|
else if (l == null)
|
|
362
|
-
l = t[
|
|
276
|
+
l = t[--$];
|
|
363
277
|
else if (a == null)
|
|
364
278
|
a = r[++o];
|
|
365
|
-
else if (
|
|
366
|
-
|
|
367
|
-
else if (
|
|
368
|
-
|
|
369
|
-
else if (
|
|
370
|
-
|
|
371
|
-
else if (
|
|
372
|
-
(
|
|
373
|
-
else if (
|
|
374
|
-
(
|
|
279
|
+
else if (g == null)
|
|
280
|
+
g = r[--d];
|
|
281
|
+
else if (R(u, a, n))
|
|
282
|
+
T(u, a, n), u = t[++i], a = r[++o];
|
|
283
|
+
else if (R(l, g, n))
|
|
284
|
+
T(l, g, n), l = t[--$], g = r[--d];
|
|
285
|
+
else if (R(u, g, n))
|
|
286
|
+
(u.$tag$ === "slot" || g.$tag$ === "slot") && A(u.$elm$.parentNode, !1), T(u, g, n), k(e, u.$elm$, l.$elm$.nextSibling), u = t[++i], g = r[--d];
|
|
287
|
+
else if (R(l, a, n))
|
|
288
|
+
(u.$tag$ === "slot" || g.$tag$ === "slot") && A(l.$elm$.parentNode, !1), T(l, a, n), k(e, l.$elm$, u.$elm$), l = t[--$], a = r[++o];
|
|
375
289
|
else {
|
|
376
|
-
for (f = -1, c = i; c <=
|
|
290
|
+
for (f = -1, c = i; c <= $; ++c)
|
|
377
291
|
if (t[c] && t[c].$key$ !== null && t[c].$key$ === a.$key$) {
|
|
378
292
|
f = c;
|
|
379
293
|
break;
|
|
380
294
|
}
|
|
381
|
-
f >= 0 ? (
|
|
382
|
-
j(
|
|
295
|
+
f >= 0 ? (y = t[f], y.$tag$ !== a.$tag$ ? m = D(t && t[o], s, f) : (T(y, a, n), t[f] = void 0, m = y.$elm$), a = r[++o]) : (m = D(t && t[o], s, o), a = r[++o]), m && k(
|
|
296
|
+
j(u.$elm$).parentNode,
|
|
383
297
|
m,
|
|
384
|
-
j(
|
|
298
|
+
j(u.$elm$)
|
|
385
299
|
);
|
|
386
300
|
}
|
|
387
|
-
i >
|
|
301
|
+
i > $ ? le(
|
|
388
302
|
e,
|
|
389
|
-
r[
|
|
303
|
+
r[d + 1] == null ? null : r[d + 1].$elm$,
|
|
390
304
|
s,
|
|
391
305
|
r,
|
|
392
306
|
o,
|
|
393
|
-
|
|
394
|
-
) : o >
|
|
395
|
-
},
|
|
307
|
+
d
|
|
308
|
+
) : o > d && ae(t, i, $);
|
|
309
|
+
}, R = (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, T = (e, t, s = !1) => {
|
|
396
310
|
const r = t.$elm$ = e.$elm$, n = e.$children$, i = t.$children$, o = t.$tag$, f = t.$text$;
|
|
397
311
|
let c;
|
|
398
|
-
f === null ? (
|
|
312
|
+
f === null ? (v = o === "svg" ? !0 : o === "foreignObject" ? !1 : v, o === "slot" && !N || oe(e, t, v), n !== null && i !== null ? He(r, n, t, i, s) : i !== null ? (e.$text$ !== null && (r.textContent = ""), le(r, null, t, i, 0, i.length - 1)) : (
|
|
399
313
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
400
|
-
!s &&
|
|
401
|
-
),
|
|
314
|
+
!s && C.updatable && n !== null && ae(n, 0, n.length - 1)
|
|
315
|
+
), v && o === "svg" && (v = !1)) : (c = r["s-cr"]) ? c.parentNode.textContent = f : e.$text$ !== f && (r.data = f);
|
|
402
316
|
}, b = [], ce = (e) => {
|
|
403
317
|
let t, s, r;
|
|
404
318
|
const n = e.__childNodes || e.childNodes;
|
|
@@ -408,13 +322,13 @@ var F, M, E, N = !1, D = !1, I = !1, y = !1, C = (e, t, s) => {
|
|
|
408
322
|
const o = i["s-sn"];
|
|
409
323
|
for (r = s.length - 1; r >= 0; r--)
|
|
410
324
|
if (t = s[r], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== i["s-hn"])
|
|
411
|
-
if (
|
|
325
|
+
if (Z(t, o)) {
|
|
412
326
|
let f = b.find((c) => c.$nodeToRelocate$ === t);
|
|
413
|
-
|
|
327
|
+
H = !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
328
|
$slotRefNode$: i,
|
|
415
329
|
$nodeToRelocate$: t
|
|
416
330
|
})), t["s-sr"] && b.map((c) => {
|
|
417
|
-
|
|
331
|
+
Z(c.$nodeToRelocate$, t["s-sn"]) && (f = b.find(($) => $.$nodeToRelocate$ === t), f && !c.$slotRefNode$ && (c.$slotRefNode$ = f.$slotRefNode$));
|
|
418
332
|
});
|
|
419
333
|
} else b.some((f) => f.$nodeToRelocate$ === t) || b.push({
|
|
420
334
|
$nodeToRelocate$: t
|
|
@@ -424,88 +338,88 @@ var F, M, E, N = !1, D = !1, I = !1, y = !1, C = (e, t, s) => {
|
|
|
424
338
|
}
|
|
425
339
|
}, fe = (e) => {
|
|
426
340
|
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"] &&
|
|
428
|
-
function
|
|
341
|
+
}, k = (e, t, s) => (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"] && $e(t["s-cr"], t, e, t.parentElement), e == null ? void 0 : e.insertBefore(t, s));
|
|
342
|
+
function $e(e, t, s, r) {
|
|
429
343
|
var n;
|
|
430
344
|
let i;
|
|
431
345
|
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
346
|
const o = t["s-sn"], f = t["s-hn"];
|
|
433
347
|
if ((n = s.classList) == null || n.add(i + "-s"), r && r.classList.contains(i + "-s")) {
|
|
434
|
-
let c = (r.__childNodes || r.childNodes)[0],
|
|
348
|
+
let c = (r.__childNodes || r.childNodes)[0], $ = !1;
|
|
435
349
|
for (; c; ) {
|
|
436
350
|
if (c["s-sn"] !== o && c["s-hn"] === f && c["s-sr"]) {
|
|
437
|
-
|
|
351
|
+
$ = !0;
|
|
438
352
|
break;
|
|
439
353
|
}
|
|
440
354
|
c = c.nextSibling;
|
|
441
355
|
}
|
|
442
|
-
|
|
356
|
+
$ || r.classList.remove(i + "-s");
|
|
443
357
|
}
|
|
444
358
|
}
|
|
445
359
|
}
|
|
446
|
-
var
|
|
360
|
+
var De = (e, t, s = !1) => {
|
|
447
361
|
var r, n, i, o, f;
|
|
448
|
-
const c = e.$hostElement$,
|
|
449
|
-
if (E = c.tagName,
|
|
450
|
-
([
|
|
362
|
+
const c = e.$hostElement$, $ = e.$cmpMeta$, u = e.$vnode$ || w(null, null), l = Me(t) ? t : Re(null, null, t);
|
|
363
|
+
if (E = c.tagName, $.$attrsToReflect$ && (l.$attrs$ = l.$attrs$ || {}, $.$attrsToReflect$.map(
|
|
364
|
+
([d, a]) => l.$attrs$[a] = c[d]
|
|
451
365
|
)), s && l.$attrs$)
|
|
452
|
-
for (const
|
|
453
|
-
c.hasAttribute(
|
|
454
|
-
l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ =
|
|
366
|
+
for (const d of Object.keys(l.$attrs$))
|
|
367
|
+
c.hasAttribute(d) && !["key", "ref", "style", "class"].includes(d) && (l.$attrs$[d] = c[d]);
|
|
368
|
+
l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = u.$elm$ = c.shadowRoot || c, M = c["s-sc"], N = ($.$flags$ & 1) !== 0, F = c["s-cr"], H = !1, T(u, l, s);
|
|
455
369
|
{
|
|
456
|
-
if (
|
|
370
|
+
if (_.$flags$ |= 1, I) {
|
|
457
371
|
ce(l.$elm$);
|
|
458
|
-
for (const
|
|
459
|
-
const a =
|
|
372
|
+
for (const d of b) {
|
|
373
|
+
const a = d.$nodeToRelocate$;
|
|
460
374
|
if (!a["s-ol"]) {
|
|
461
|
-
const
|
|
462
|
-
|
|
375
|
+
const g = L.createTextNode("");
|
|
376
|
+
g["s-nr"] = a, k(a.parentNode, a["s-ol"] = g, a);
|
|
463
377
|
}
|
|
464
378
|
}
|
|
465
|
-
for (const
|
|
466
|
-
const a =
|
|
467
|
-
if (
|
|
468
|
-
const m =
|
|
469
|
-
let
|
|
379
|
+
for (const d of b) {
|
|
380
|
+
const a = d.$nodeToRelocate$, g = d.$slotRefNode$;
|
|
381
|
+
if (g) {
|
|
382
|
+
const m = g.parentNode;
|
|
383
|
+
let y = g.nextSibling;
|
|
470
384
|
{
|
|
471
|
-
let
|
|
472
|
-
for (;
|
|
473
|
-
let h = (n =
|
|
385
|
+
let O = (r = a["s-ol"]) == null ? void 0 : r.previousSibling;
|
|
386
|
+
for (; O; ) {
|
|
387
|
+
let h = (n = O["s-nr"]) != null ? n : null;
|
|
474
388
|
if (h && h["s-sn"] === a["s-sn"] && m === (h.__parentNode || h.parentNode)) {
|
|
475
389
|
for (h = h.nextSibling; h === a || h != null && h["s-sr"]; )
|
|
476
390
|
h = h == null ? void 0 : h.nextSibling;
|
|
477
391
|
if (!h || !h["s-nr"]) {
|
|
478
|
-
|
|
392
|
+
y = h;
|
|
479
393
|
break;
|
|
480
394
|
}
|
|
481
395
|
}
|
|
482
|
-
|
|
396
|
+
O = O.previousSibling;
|
|
483
397
|
}
|
|
484
398
|
}
|
|
485
|
-
const
|
|
486
|
-
(!
|
|
399
|
+
const ge = a.__parentNode || a.parentNode, pe = a.__nextSibling || a.nextSibling;
|
|
400
|
+
(!y && m !== ge || pe !== y) && a !== y && (!a["s-hn"] && a["s-ol"] && (a["s-hn"] = a["s-ol"].parentNode.nodeName), k(m, a, y), a.nodeType === 1 && a.tagName !== "SLOT-FB" && (a.hidden = (i = a["s-ih"]) != null ? i : !1)), a && typeof g["s-rf"] == "function" && g["s-rf"](a);
|
|
487
401
|
} else
|
|
488
402
|
a.nodeType === 1 && (s && (a["s-ih"] = (o = a.hidden) != null ? o : !1), a.hidden = !0);
|
|
489
403
|
}
|
|
490
404
|
}
|
|
491
|
-
|
|
405
|
+
H && re(l.$elm$), _.$flags$ &= -2, b.length = 0;
|
|
492
406
|
}
|
|
493
|
-
if (
|
|
494
|
-
const
|
|
495
|
-
for (const a of
|
|
407
|
+
if (C.experimentalScopedSlotChanges && $.$flags$ & 2) {
|
|
408
|
+
const d = l.$elm$.__childNodes || l.$elm$.childNodes;
|
|
409
|
+
for (const a of d)
|
|
496
410
|
a["s-hn"] !== E && !a["s-sh"] && (s && a["s-ih"] == null && (a["s-ih"] = (f = a.hidden) != null ? f : !1), a.hidden = !0);
|
|
497
411
|
}
|
|
498
|
-
|
|
412
|
+
F = void 0;
|
|
499
413
|
};
|
|
500
414
|
const Ue = (e, t, s) => {
|
|
501
415
|
[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);
|
|
502
|
-
},
|
|
416
|
+
}, ue = (e, t, s, r, n) => {
|
|
503
417
|
if (t && typeof t == "string") {
|
|
504
418
|
const i = document.createElement(t);
|
|
505
419
|
Object.keys(s || {}).forEach((o) => {
|
|
506
420
|
Ue(i, o, s[o]);
|
|
507
421
|
}), r == null || r.forEach((o) => {
|
|
508
|
-
|
|
422
|
+
ue(i, o.$tag$, o.$attrs$, o.$children$, o.$text$);
|
|
509
423
|
}), s != null && s.innerHTML && (i.innerHTML = s.innerHTML), e.appendChild(i);
|
|
510
424
|
}
|
|
511
425
|
n && (e.innerHTML = n);
|
|
@@ -523,11 +437,8 @@ const Ue = (e, t, s) => {
|
|
|
523
437
|
var r, n;
|
|
524
438
|
const s = document.getElementById("storybook-root");
|
|
525
439
|
if (s !== null)
|
|
526
|
-
return (n = document.querySelector("[lang]")) == null || n.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"),
|
|
440
|
+
return (n = document.querySelector("[lang]")) == null || n.setAttribute("lang", ((r = t.globals) == null ? void 0 : r.locale) || "en"), De(
|
|
527
441
|
{
|
|
528
|
-
$ancestorComponent$: void 0,
|
|
529
|
-
$flags$: 0,
|
|
530
|
-
$modeName$: void 0,
|
|
531
442
|
$cmpMeta$: {
|
|
532
443
|
$flags$: 0,
|
|
533
444
|
$tagName$: s.tagName
|
|
@@ -538,20 +449,20 @@ const Ue = (e, t, s) => {
|
|
|
538
449
|
), s.children[s.children.length - 1];
|
|
539
450
|
}, it = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {
|
|
540
451
|
const n = document.createElement("div");
|
|
541
|
-
return
|
|
452
|
+
return ue(n, e, t, s, r), n.innerHTML;
|
|
542
453
|
}, U = (e, t) => {
|
|
543
454
|
if (!t)
|
|
544
455
|
return;
|
|
545
456
|
const s = t.split("/");
|
|
546
457
|
return `${e}${s.slice(2, s.length - 1).join("-")}--docs`;
|
|
547
458
|
};
|
|
548
|
-
var S,
|
|
459
|
+
var S, q;
|
|
549
460
|
class ot {
|
|
550
461
|
constructor(t) {
|
|
551
462
|
/**
|
|
552
463
|
* JsonDocs
|
|
553
464
|
*/
|
|
554
|
-
|
|
465
|
+
p(this, "jsonDoc");
|
|
555
466
|
/**
|
|
556
467
|
* Get component data from the jsonDoc
|
|
557
468
|
* @param tagName - tag name we want to get the data from
|
|
@@ -564,7 +475,7 @@ class ot {
|
|
|
564
475
|
* @param prop - prop to get control for
|
|
565
476
|
* @returns control type and options if applicable
|
|
566
477
|
*/
|
|
567
|
-
B(this,
|
|
478
|
+
B(this, q, (t) => {
|
|
568
479
|
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, "|"));
|
|
569
480
|
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" } };
|
|
570
481
|
});
|
|
@@ -573,11 +484,11 @@ class ot {
|
|
|
573
484
|
* @param tagName - tag name we want to extract the arg types from
|
|
574
485
|
* @returns component arg types
|
|
575
486
|
*/
|
|
576
|
-
|
|
577
|
-
const s =
|
|
578
|
-
const { control:
|
|
487
|
+
p(this, "extractArgTypes", (t) => {
|
|
488
|
+
const s = x(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((u, l) => {
|
|
489
|
+
const { control: d, options: a } = x(this, q).call(this, l);
|
|
579
490
|
return {
|
|
580
|
-
...
|
|
491
|
+
...u,
|
|
581
492
|
[l.name]: {
|
|
582
493
|
name: l.attr || l.name,
|
|
583
494
|
description: l.docs,
|
|
@@ -587,13 +498,13 @@ class ot {
|
|
|
587
498
|
type: { summary: l.type },
|
|
588
499
|
defaultValue: { summary: l.default }
|
|
589
500
|
},
|
|
590
|
-
control:
|
|
501
|
+
control: d,
|
|
591
502
|
options: a
|
|
592
503
|
}
|
|
593
504
|
};
|
|
594
505
|
}, {}), n = s == null ? void 0 : s.events.reduce(
|
|
595
|
-
(
|
|
596
|
-
...
|
|
506
|
+
(u, l) => ({
|
|
507
|
+
...u,
|
|
597
508
|
[l.event]: {
|
|
598
509
|
name: l.event,
|
|
599
510
|
description: l.docs,
|
|
@@ -605,8 +516,8 @@ class ot {
|
|
|
605
516
|
}),
|
|
606
517
|
{}
|
|
607
518
|
), i = s == null ? void 0 : s.methods.reduce(
|
|
608
|
-
(
|
|
609
|
-
...
|
|
519
|
+
(u, l) => ({
|
|
520
|
+
...u,
|
|
610
521
|
[l.name]: {
|
|
611
522
|
name: l.name,
|
|
612
523
|
description: l.docs,
|
|
@@ -618,8 +529,8 @@ class ot {
|
|
|
618
529
|
}),
|
|
619
530
|
{}
|
|
620
531
|
), o = s == null ? void 0 : s.slots.reduce(
|
|
621
|
-
(
|
|
622
|
-
...
|
|
532
|
+
(u, l) => ({
|
|
533
|
+
...u,
|
|
623
534
|
[l.name]: {
|
|
624
535
|
name: l.name !== "" ? l.name : "default",
|
|
625
536
|
// default slot are unnamed
|
|
@@ -632,8 +543,8 @@ class ot {
|
|
|
632
543
|
}),
|
|
633
544
|
{}
|
|
634
545
|
), f = s == null ? void 0 : s.styles.reduce(
|
|
635
|
-
(
|
|
636
|
-
...
|
|
546
|
+
(u, l) => ({
|
|
547
|
+
...u,
|
|
637
548
|
[l.name]: {
|
|
638
549
|
name: l.name,
|
|
639
550
|
description: l.docs,
|
|
@@ -644,26 +555,26 @@ class ot {
|
|
|
644
555
|
}
|
|
645
556
|
}),
|
|
646
557
|
{}
|
|
647
|
-
), c = s == null ? void 0 : s.dependencies.reduce((
|
|
648
|
-
const
|
|
558
|
+
), c = s == null ? void 0 : s.dependencies.reduce((u, l) => {
|
|
559
|
+
const d = x(this, S).call(this, l);
|
|
649
560
|
return {
|
|
650
|
-
...
|
|
561
|
+
...u,
|
|
651
562
|
[l]: {
|
|
652
563
|
name: l,
|
|
653
|
-
description: `<a href="./?path=/docs/${U("",
|
|
564
|
+
description: `<a href="./?path=/docs/${U("", d == null ? void 0 : d.filePath)}">View Component Documentation</a>`,
|
|
654
565
|
table: {
|
|
655
566
|
category: "depends on",
|
|
656
567
|
type: { summary: void 0 }
|
|
657
568
|
}
|
|
658
569
|
}
|
|
659
570
|
};
|
|
660
|
-
}, {}),
|
|
661
|
-
const
|
|
571
|
+
}, {}), $ = s == null ? void 0 : s.dependents.reduce((u, l) => {
|
|
572
|
+
const d = x(this, S).call(this, l);
|
|
662
573
|
return {
|
|
663
|
-
...
|
|
574
|
+
...u,
|
|
664
575
|
[l]: {
|
|
665
576
|
name: l,
|
|
666
|
-
description: `<a href="./?path=/docs/${U("",
|
|
577
|
+
description: `<a href="./?path=/docs/${U("", d == null ? void 0 : d.filePath)}">View Component Documentation</a>`,
|
|
667
578
|
table: {
|
|
668
579
|
category: "used by",
|
|
669
580
|
type: { summary: void 0 }
|
|
@@ -678,7 +589,7 @@ class ot {
|
|
|
678
589
|
...o,
|
|
679
590
|
...f,
|
|
680
591
|
...c,
|
|
681
|
-
|
|
592
|
+
...$
|
|
682
593
|
};
|
|
683
594
|
});
|
|
684
595
|
/**
|
|
@@ -686,18 +597,18 @@ class ot {
|
|
|
686
597
|
* @param tagName - tag name we want to extract the description from
|
|
687
598
|
* @returns component description
|
|
688
599
|
*/
|
|
689
|
-
|
|
690
|
-
const s =
|
|
600
|
+
p(this, "extractComponentDescription", (t) => {
|
|
601
|
+
const s = x(this, S).call(this, t);
|
|
691
602
|
return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);
|
|
692
603
|
});
|
|
693
604
|
this.jsonDoc = t;
|
|
694
605
|
}
|
|
695
606
|
}
|
|
696
|
-
S = new WeakMap(),
|
|
697
|
-
const
|
|
607
|
+
S = new WeakMap(), q = new WeakMap();
|
|
608
|
+
const qe = (e, t) => {
|
|
698
609
|
if (t)
|
|
699
610
|
return `${e}${t}`;
|
|
700
|
-
},
|
|
611
|
+
}, de = (e) => {
|
|
701
612
|
let t = e.overview ? `${e.overview}
|
|
702
613
|
|
|
703
614
|
` : "";
|
|
@@ -723,7 +634,7 @@ const He = (e, t) => {
|
|
|
723
634
|
`, t += e.slots.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
|
|
724
635
|
`).join(""), t += `
|
|
725
636
|
`), t;
|
|
726
|
-
},
|
|
637
|
+
}, z = (e) => `${e.docs}
|
|
727
638
|
|
|
728
639
|
Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
729
640
|
$schema: "https://json.schemastore.org/web-types",
|
|
@@ -736,11 +647,11 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
|
736
647
|
const i = U(r, n.filePath);
|
|
737
648
|
return {
|
|
738
649
|
name: n.tag,
|
|
739
|
-
description:
|
|
650
|
+
description: de(n),
|
|
740
651
|
"doc-url": i,
|
|
741
652
|
attributes: n.props.filter((o) => o.attr).map((o) => ({
|
|
742
653
|
name: o.attr,
|
|
743
|
-
description:
|
|
654
|
+
description: z(o),
|
|
744
655
|
"doc-url": i,
|
|
745
656
|
value: {
|
|
746
657
|
type: o.type,
|
|
@@ -751,7 +662,7 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
|
751
662
|
js: {
|
|
752
663
|
properties: n.props.map((o) => ({
|
|
753
664
|
name: o.name,
|
|
754
|
-
description:
|
|
665
|
+
description: z(o),
|
|
755
666
|
"doc-url": i,
|
|
756
667
|
value: {
|
|
757
668
|
type: o.type,
|
|
@@ -774,22 +685,22 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
|
774
685
|
})
|
|
775
686
|
}
|
|
776
687
|
}
|
|
777
|
-
}),
|
|
688
|
+
}), Ce = (e, t, s) => [
|
|
778
689
|
{ name: "Storybook", url: U(e, s) },
|
|
779
|
-
{ name: "Sources", url:
|
|
690
|
+
{ name: "Sources", url: qe(t, s) }
|
|
780
691
|
], Be = (e) => {
|
|
781
692
|
if (!e.values.some(({ value: t }) => t === void 0))
|
|
782
693
|
return e.values.map(({ value: t }) => ({ name: t }));
|
|
783
694
|
}, at = (e, t, s) => ({
|
|
784
695
|
version: 1.1,
|
|
785
696
|
tags: e.components.map((r) => {
|
|
786
|
-
const n =
|
|
697
|
+
const n = Ce(t, s, r.filePath);
|
|
787
698
|
return {
|
|
788
699
|
name: r.tag,
|
|
789
|
-
description:
|
|
700
|
+
description: de(r),
|
|
790
701
|
attributes: r.props.map((i) => ({
|
|
791
702
|
name: i.attr || i.name,
|
|
792
|
-
description:
|
|
703
|
+
description: z(i),
|
|
793
704
|
values: Be(i),
|
|
794
705
|
references: n
|
|
795
706
|
})),
|
|
@@ -808,8 +719,8 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
|
808
719
|
)
|
|
809
720
|
}), ft = (e) => {
|
|
810
721
|
const t = { value: "2023", pattern: "yyyy" }, s = { value: "12", pattern: "mm" }, r = { value: "24", pattern: "dd" };
|
|
811
|
-
return
|
|
812
|
-
},
|
|
722
|
+
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);
|
|
723
|
+
}, $t = (e) => e.toISOString().split("T")[0], Pe = (e, t, s) => {
|
|
813
724
|
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();
|
|
814
725
|
return Object.keys(t).length === 0 ? {
|
|
815
726
|
locale: i,
|
|
@@ -818,35 +729,35 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
|
818
729
|
locale: i,
|
|
819
730
|
messages: t[o] || t[s] || { lang: s }
|
|
820
731
|
};
|
|
821
|
-
},
|
|
732
|
+
}, ut = (e, t, s) => new Intl.NumberFormat(t, { style: "currency", currency: s }).format(e), dt = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), gt = (e, t, s = 0) => new Intl.NumberFormat(t, {
|
|
822
733
|
style: "percent",
|
|
823
734
|
minimumFractionDigits: s,
|
|
824
735
|
maximumFractionDigits: s
|
|
825
|
-
}).format(e),
|
|
736
|
+
}).format(e), pt = (e, t, s, r = "short", n = 0) => new Intl.NumberFormat(t, {
|
|
826
737
|
style: "unit",
|
|
827
738
|
unit: s,
|
|
828
739
|
unitDisplay: r,
|
|
829
740
|
minimumFractionDigits: n,
|
|
830
741
|
maximumFractionDigits: n
|
|
831
|
-
}).format(e),
|
|
742
|
+
}).format(e), we = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, ze = (e, t, s) => typeof e != "string" || e === "" || !we.test(e) ? "" : new Intl.DateTimeFormat(t, s).format(new Date(e)), ht = (e, t) => (s) => Pe(s, e, t), vt = ({ disconnect: e, observe: t, takeRecords: s }) => {
|
|
832
743
|
class r {
|
|
833
744
|
constructor(i) {
|
|
834
745
|
/**
|
|
835
746
|
*
|
|
836
747
|
*/
|
|
837
|
-
|
|
748
|
+
p(this, "disconnect", e);
|
|
838
749
|
/**
|
|
839
750
|
*
|
|
840
751
|
*/
|
|
841
|
-
|
|
752
|
+
p(this, "observe", t);
|
|
842
753
|
/**
|
|
843
754
|
*
|
|
844
755
|
*/
|
|
845
|
-
|
|
756
|
+
p(this, "takeRecords", s);
|
|
846
757
|
/**
|
|
847
758
|
*
|
|
848
759
|
*/
|
|
849
|
-
|
|
760
|
+
p(this, "cb");
|
|
850
761
|
this.cb = i;
|
|
851
762
|
}
|
|
852
763
|
}
|
|
@@ -857,25 +768,25 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
|
857
768
|
value: r
|
|
858
769
|
});
|
|
859
770
|
}), r;
|
|
860
|
-
},
|
|
771
|
+
}, yt = ({ disconnect: e, observe: t }) => {
|
|
861
772
|
class s {
|
|
862
773
|
constructor(n) {
|
|
863
774
|
/**
|
|
864
775
|
*
|
|
865
776
|
*/
|
|
866
|
-
|
|
777
|
+
p(this, "disconnect", e);
|
|
867
778
|
/**
|
|
868
779
|
*
|
|
869
780
|
*/
|
|
870
|
-
|
|
781
|
+
p(this, "observe", t);
|
|
871
782
|
/**
|
|
872
783
|
*
|
|
873
784
|
*/
|
|
874
|
-
|
|
785
|
+
p(this, "unobserve");
|
|
875
786
|
/**
|
|
876
787
|
*
|
|
877
788
|
*/
|
|
878
|
-
|
|
789
|
+
p(this, "cb");
|
|
879
790
|
this.cb = n;
|
|
880
791
|
}
|
|
881
792
|
}
|
|
@@ -887,18 +798,18 @@ Type: \`${e.type}\``, lt = (e, t, s, r) => ({
|
|
|
887
798
|
});
|
|
888
799
|
}), s;
|
|
889
800
|
};
|
|
890
|
-
class
|
|
801
|
+
class Ie extends Event {
|
|
891
802
|
constructor() {
|
|
892
803
|
super(...arguments);
|
|
893
804
|
/**
|
|
894
805
|
*
|
|
895
806
|
*/
|
|
896
|
-
|
|
807
|
+
p(this, "detail");
|
|
897
808
|
}
|
|
898
809
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
899
810
|
}
|
|
900
811
|
const mt = () => {
|
|
901
|
-
class e extends
|
|
812
|
+
class e extends Ie {
|
|
902
813
|
}
|
|
903
814
|
return [window, global].forEach((t) => {
|
|
904
815
|
Object.defineProperty(t, "SubmitEvent", {
|
|
@@ -918,34 +829,34 @@ const mt = () => {
|
|
|
918
829
|
}), t;
|
|
919
830
|
};
|
|
920
831
|
export {
|
|
921
|
-
|
|
832
|
+
Ze as ClassList,
|
|
922
833
|
ot as StorybookPreview,
|
|
923
|
-
|
|
834
|
+
Je as allItemsAreString,
|
|
924
835
|
tt as cleanString,
|
|
925
836
|
Ge as createID,
|
|
926
|
-
|
|
927
|
-
|
|
837
|
+
we as dateRegExp,
|
|
838
|
+
$t as dateToString,
|
|
928
839
|
ht as defineLocales,
|
|
929
840
|
rt as filterArgs,
|
|
930
|
-
|
|
841
|
+
Qe as focusableElements,
|
|
931
842
|
ft as getLocaleDatePattern,
|
|
932
|
-
|
|
843
|
+
Y as getParentWindows,
|
|
933
844
|
it as getStoryHTML,
|
|
934
845
|
U as getStorybookUrl,
|
|
935
846
|
Ye as getWindows,
|
|
936
|
-
|
|
847
|
+
Ke as isTagName,
|
|
937
848
|
et as isValidNumber,
|
|
938
849
|
me as isValidString,
|
|
939
850
|
Xe as isValideID,
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
851
|
+
ut as localeCurrency,
|
|
852
|
+
ze as localeDate,
|
|
853
|
+
dt as localeNumber,
|
|
854
|
+
gt as localePercent,
|
|
855
|
+
pt as localeUnit,
|
|
945
856
|
st as nextTick,
|
|
946
857
|
bt as setUpRequestAnimationFrameMock,
|
|
947
|
-
|
|
948
|
-
|
|
858
|
+
vt as setupMutationObserverMock,
|
|
859
|
+
yt as setupResizeObserverMock,
|
|
949
860
|
mt as setupSubmitEventMock,
|
|
950
861
|
nt as stencilWrapper,
|
|
951
862
|
Ve as toString,
|