@mgdis/stencil-helpers 3.0.0 → 3.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 +87 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.es.js +556 -426
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +16 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/storybook/index.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/index.es.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ue = Object.defineProperty;
|
|
2
|
+
var fe = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
const
|
|
5
|
+
var Ze = (e, t, r) => t in e ? Ue(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
6
|
+
var $ = (e, t, r) => Ze(e, typeof t != "symbol" ? t + "" : t, r), ue = (e, t, r) => t.has(e) || fe("Cannot " + r);
|
|
7
|
+
var v = (e, t, r) => (ue(e, t, "read from private field"), r ? r.call(e) : t.get(e)), j = (e, t, r) => t.has(e) ? fe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, r), U = (e, t, r, s) => (ue(e, t, "write to private field"), s ? s.call(e, r) : t.set(e, r), r);
|
|
8
|
+
const Pt = (e = "", t = 10) => {
|
|
9
9
|
const r = new Uint8Array(t);
|
|
10
10
|
crypto.getRandomValues(r);
|
|
11
11
|
const s = Array.from(r).map((n) => n.toString(16).padStart(2, "0")).join("").slice(0, t);
|
|
12
12
|
return e !== "" ? `${e}-${s}` : s;
|
|
13
|
-
},
|
|
14
|
-
class
|
|
13
|
+
}, Ut = (e) => De(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;
|
|
14
|
+
class Zt {
|
|
15
15
|
constructor(t = []) {
|
|
16
16
|
/**
|
|
17
17
|
* Available classes
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
$(this, "classes");
|
|
20
20
|
/**
|
|
21
21
|
* Add class
|
|
22
22
|
* @param className - class name to add
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
$(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
|
+
$(this, "delete", (t) => {
|
|
32
32
|
const r = this.classes.indexOf(t);
|
|
33
33
|
r > -1 && this.classes.splice(r, 1);
|
|
34
34
|
});
|
|
@@ -37,42 +37,131 @@ class kt {
|
|
|
37
37
|
* @param className - class name to check
|
|
38
38
|
* @returns class name is in the list
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
$(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
|
+
$(this, "join", () => this.classes.join(" "));
|
|
46
46
|
this.classes = t;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
const
|
|
50
|
-
const t =
|
|
49
|
+
const Dt = (e) => Array.isArray(e) && e.every((t) => typeof t == "string"), qt = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Ht = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button', Bt = (e) => {
|
|
50
|
+
const t = _e(e), r = ve(e);
|
|
51
51
|
return [e, ...t, ...r];
|
|
52
|
-
},
|
|
52
|
+
}, _e = (e, t = []) => {
|
|
53
53
|
if (e.self !== e.top)
|
|
54
54
|
try {
|
|
55
55
|
const r = e.parent;
|
|
56
|
-
return r ? (t.push(r),
|
|
56
|
+
return r ? (t.push(r), _e(r, t)) : t;
|
|
57
57
|
} catch (r) {
|
|
58
58
|
return console.error("Different hosts between iframes:", r), t;
|
|
59
59
|
}
|
|
60
60
|
return t;
|
|
61
|
-
},
|
|
61
|
+
}, ve = (e, t = []) => {
|
|
62
62
|
if (e.frames.length > 0)
|
|
63
63
|
for (const r of Array.from(e.frames))
|
|
64
|
-
t.push(r),
|
|
64
|
+
t.push(r), ve(r, t);
|
|
65
65
|
return t;
|
|
66
|
-
},
|
|
67
|
-
|
|
66
|
+
}, De = (e) => typeof e == "string" && e.trim() !== "", Gt = (e) => typeof e == "object" ? JSON.stringify(e) : `${e}`, Wt = (e) => typeof e == "number" && !Number.isNaN(e), Jt = (e) => typeof e == "string" ? e.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g, "") : e, Xt = async (e) => {
|
|
67
|
+
if (e) return e();
|
|
68
|
+
}, ie = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, qe = (e, t, r) => {
|
|
69
|
+
const s = ".";
|
|
70
|
+
if (!ie(e) || typeof t != "string")
|
|
71
|
+
return r;
|
|
72
|
+
const [n, ...i] = t.split(s);
|
|
73
|
+
return i.length ? qe(e[n], i.join(s)) : e[n];
|
|
74
|
+
}, Kt = {
|
|
75
|
+
FIRST: "first",
|
|
76
|
+
NEXT: "next",
|
|
77
|
+
PREVIOUS: "previous",
|
|
78
|
+
LAST: "last"
|
|
79
|
+
}, we = 10;
|
|
80
|
+
class He {
|
|
81
|
+
constructor(t) {
|
|
82
|
+
/**
|
|
83
|
+
* Define items
|
|
84
|
+
*/
|
|
85
|
+
$(this, "items", []);
|
|
86
|
+
/**
|
|
87
|
+
* Define total
|
|
88
|
+
*/
|
|
89
|
+
$(this, "total");
|
|
90
|
+
/**
|
|
91
|
+
* Define top
|
|
92
|
+
*/
|
|
93
|
+
$(this, "top", we);
|
|
94
|
+
/**
|
|
95
|
+
* Define next
|
|
96
|
+
*/
|
|
97
|
+
$(this, "next");
|
|
98
|
+
/**
|
|
99
|
+
* Define base index
|
|
100
|
+
*/
|
|
101
|
+
$(this, "baseIndex", 1);
|
|
102
|
+
/**
|
|
103
|
+
* Get index of items from cursor
|
|
104
|
+
* @param cursor - cursor to find
|
|
105
|
+
* @param oldItem - previous item
|
|
106
|
+
* @returns item index
|
|
107
|
+
*/
|
|
108
|
+
$(this, "getIndexFromCursor", (t = "first", r) => {
|
|
109
|
+
if (!Array.isArray(this.items) || !this.items.length) return null;
|
|
110
|
+
const n = this.items.length - this.baseIndex;
|
|
111
|
+
let i = 0, a = 0;
|
|
112
|
+
if (["previous", "next"].includes(t) && r) {
|
|
113
|
+
const c = this.items.findIndex((l) => JSON.stringify(l) === JSON.stringify(r));
|
|
114
|
+
if (c === -1) return 0;
|
|
115
|
+
a = c;
|
|
116
|
+
}
|
|
117
|
+
return t === "first" ? i = 0 : t === "last" ? i = n : t === "previous" ? i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[0]) ? n : a - this.baseIndex : t === "next" && (i = JSON.stringify(this.items[a]) === JSON.stringify(this.items[n]) ? 0 : a + this.baseIndex), i;
|
|
118
|
+
});
|
|
119
|
+
if (ie(t))
|
|
120
|
+
Array.isArray(t.items) && (this.items = t.items), typeof t.top == "number" && (this.top = t.top), this.total = typeof t.total == "number" ? t.total : this.items.length, this.next = t.next;
|
|
121
|
+
else
|
|
122
|
+
throw new Error("Page - init must match IPage type.");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
var S, N, M;
|
|
126
|
+
class Yt {
|
|
127
|
+
constructor(t, r) {
|
|
128
|
+
/**
|
|
129
|
+
* Define paginated items
|
|
130
|
+
*/
|
|
131
|
+
$(this, "items", []);
|
|
132
|
+
/* Privates */
|
|
133
|
+
j(this, S, we);
|
|
134
|
+
j(this, N);
|
|
135
|
+
j(this, M);
|
|
136
|
+
/**
|
|
137
|
+
* Get page
|
|
138
|
+
* @param offset - pagiantion offset
|
|
139
|
+
* @param filter - filter methode
|
|
140
|
+
* @returns formated page
|
|
141
|
+
*/
|
|
142
|
+
$(this, "getPage", (t = 0, r) => {
|
|
143
|
+
const s = typeof r == "function" ? this.items.filter(r) : this.items;
|
|
144
|
+
let n;
|
|
145
|
+
return v(this, N) ? n = v(this, N) : s.length > t + v(this, S) && (n = () => this.getPage(t + v(this, S), r)), new He({
|
|
146
|
+
items: s.slice(t, t + v(this, S)),
|
|
147
|
+
total: v(this, M),
|
|
148
|
+
top: v(this, S),
|
|
149
|
+
next: n
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
Array.isArray(t) && (this.items = t), r && (["string", "function"].includes(typeof r.next) || ie(r.next) && URL.canParse(r.next)) && U(this, N, r.next), typeof (r == null ? void 0 : r.top) == "number" && U(this, S, r.top), typeof (r == null ? void 0 : r.total) == "number" && U(this, M, r.total);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
S = new WeakMap(), N = new WeakMap(), M = new WeakMap();
|
|
156
|
+
var K = {
|
|
68
157
|
updatable: !0,
|
|
69
158
|
slotRelocation: !0,
|
|
70
159
|
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
71
160
|
experimentalSlotFixes: !1
|
|
72
|
-
},
|
|
161
|
+
}, Be = Object.defineProperty, Ge = (e, t) => {
|
|
73
162
|
for (var r in t)
|
|
74
|
-
|
|
75
|
-
},
|
|
163
|
+
Be(e, r, { get: t[r], enumerable: !0 });
|
|
164
|
+
}, We = "http://www.w3.org/2000/svg", Je = "http://www.w3.org/1999/xhtml", pe = (e, t) => t in e, ge = "http://www.w3.org/1999/xlink", O = typeof window < "u" ? window : {}, z = {
|
|
76
165
|
$flags$: 0,
|
|
77
166
|
$resourcesUrl$: "",
|
|
78
167
|
jmp: (e) => e(),
|
|
@@ -80,53 +169,53 @@ var B = {
|
|
|
80
169
|
ael: (e, t, r, s) => e.addEventListener(t, r, s),
|
|
81
170
|
rel: (e, t, r, s) => e.removeEventListener(t, r, s),
|
|
82
171
|
ce: (e, t) => new CustomEvent(e, t)
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
err: () =>
|
|
86
|
-
map: () =>
|
|
87
|
-
ok: () =>
|
|
88
|
-
unwrap: () =>
|
|
89
|
-
unwrapErr: () =>
|
|
172
|
+
}, Xe = (e) => e != null && e !== void 0, xe = (e) => (e = typeof e, e === "object" || e === "function"), Ke = {};
|
|
173
|
+
Ge(Ke, {
|
|
174
|
+
err: () => me,
|
|
175
|
+
map: () => Ye,
|
|
176
|
+
ok: () => V,
|
|
177
|
+
unwrap: () => Qe,
|
|
178
|
+
unwrapErr: () => Ve
|
|
90
179
|
});
|
|
91
|
-
var
|
|
180
|
+
var V = (e) => ({
|
|
92
181
|
isOk: !0,
|
|
93
182
|
isErr: !1,
|
|
94
183
|
value: e
|
|
95
|
-
}),
|
|
184
|
+
}), me = (e) => ({
|
|
96
185
|
isOk: !1,
|
|
97
186
|
isErr: !0,
|
|
98
187
|
value: e
|
|
99
188
|
});
|
|
100
|
-
function
|
|
189
|
+
function Ye(e, t) {
|
|
101
190
|
if (e.isOk) {
|
|
102
191
|
const r = t(e.value);
|
|
103
|
-
return r instanceof Promise ? r.then((s) =>
|
|
192
|
+
return r instanceof Promise ? r.then((s) => V(s)) : V(r);
|
|
104
193
|
}
|
|
105
194
|
if (e.isErr) {
|
|
106
195
|
const r = e.value;
|
|
107
|
-
return
|
|
196
|
+
return me(r);
|
|
108
197
|
}
|
|
109
198
|
throw "should never get here";
|
|
110
199
|
}
|
|
111
|
-
var
|
|
200
|
+
var Qe = (e) => {
|
|
112
201
|
if (e.isOk)
|
|
113
202
|
return e.value;
|
|
114
203
|
throw e.value;
|
|
115
|
-
},
|
|
204
|
+
}, Ve = (e) => {
|
|
116
205
|
if (e.isErr)
|
|
117
206
|
return e.value;
|
|
118
207
|
throw e.value;
|
|
119
|
-
},
|
|
120
|
-
const t =
|
|
121
|
-
e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" &&
|
|
122
|
-
s.nodeType === 1 && s.tagName === "SLOT-FB" && (
|
|
208
|
+
}, Se = (e) => {
|
|
209
|
+
const t = de(e, "childNodes");
|
|
210
|
+
e.tagName && e.tagName.includes("-") && e["s-cr"] && e.tagName !== "SLOT-FB" && Ee(t, e.tagName).forEach((s) => {
|
|
211
|
+
s.nodeType === 1 && s.tagName === "SLOT-FB" && (tt(s, ae(s), !1).length ? s.hidden = !0 : s.hidden = !1);
|
|
123
212
|
});
|
|
124
213
|
let r = 0;
|
|
125
214
|
for (r = 0; r < t.length; r++) {
|
|
126
215
|
const s = t[r];
|
|
127
|
-
s.nodeType === 1 &&
|
|
216
|
+
s.nodeType === 1 && de(s, "childNodes").length && Se(s);
|
|
128
217
|
}
|
|
129
|
-
},
|
|
218
|
+
}, et = (e) => {
|
|
130
219
|
const t = [];
|
|
131
220
|
for (let r = 0; r < e.length; r++) {
|
|
132
221
|
const s = e[r]["s-nr"] || void 0;
|
|
@@ -134,21 +223,21 @@ var qe = (e) => {
|
|
|
134
223
|
}
|
|
135
224
|
return t;
|
|
136
225
|
};
|
|
137
|
-
function
|
|
226
|
+
function Ee(e, t, r) {
|
|
138
227
|
let s = 0, n = [], i;
|
|
139
228
|
for (; s < e.length; s++)
|
|
140
|
-
i = e[s], i["s-sr"] && (!t || i["s-hn"] === t) && r === void 0 && n.push(i), n = [...n, ...
|
|
229
|
+
i = e[s], i["s-sr"] && (!t || i["s-hn"] === t) && r === void 0 && n.push(i), n = [...n, ...Ee(i.childNodes, t, r)];
|
|
141
230
|
return n;
|
|
142
231
|
}
|
|
143
|
-
var
|
|
232
|
+
var tt = (e, t, r = !0) => {
|
|
144
233
|
const s = [];
|
|
145
234
|
(r && e["s-sr"] || !e["s-sr"]) && s.push(e);
|
|
146
235
|
let n = e;
|
|
147
236
|
for (; n = n.nextSibling; )
|
|
148
|
-
|
|
237
|
+
ae(n) === t && (r || !n["s-sr"]) && s.push(n);
|
|
149
238
|
return s;
|
|
150
|
-
},
|
|
151
|
-
function
|
|
239
|
+
}, $e = (e, t) => e.nodeType === 1 ? e.getAttribute("slot") === null && t === "" || e.getAttribute("slot") === t : e["s-sn"] === t ? !0 : t === "", ae = (e) => typeof e["s-sn"] == "string" ? e["s-sn"] : e.nodeType === 1 && e.getAttribute("slot") || void 0;
|
|
240
|
+
function rt(e) {
|
|
152
241
|
if (e.assignedElements || e.assignedNodes || !e["s-sr"]) return;
|
|
153
242
|
const t = (r) => (function(s) {
|
|
154
243
|
const n = [], i = this["s-sn"];
|
|
@@ -157,9 +246,9 @@ function Ge(e) {
|
|
|
157
246
|
You can use \`.childNodes\` to nested slot fallback content.
|
|
158
247
|
If you have a particular use case, please open an issue on the Stencil repo.
|
|
159
248
|
`);
|
|
160
|
-
const
|
|
161
|
-
return (
|
|
162
|
-
i ===
|
|
249
|
+
const a = this["s-cr"].parentElement;
|
|
250
|
+
return (a.__childNodes ? a.childNodes : et(a.childNodes)).forEach((l) => {
|
|
251
|
+
i === ae(l) && n.push(l);
|
|
163
252
|
}), r ? n.filter(
|
|
164
253
|
(l) => l.nodeType === 1
|
|
165
254
|
/* ElementNode */
|
|
@@ -167,23 +256,23 @@ function Ge(e) {
|
|
|
167
256
|
}).bind(e);
|
|
168
257
|
e.assignedElements = t(!0), e.assignedNodes = t(!1);
|
|
169
258
|
}
|
|
170
|
-
function
|
|
259
|
+
function de(e, t) {
|
|
171
260
|
if ("__" + t in e) {
|
|
172
261
|
const r = e["__" + t];
|
|
173
262
|
return typeof r != "function" ? r : r.bind(e);
|
|
174
263
|
} else
|
|
175
264
|
return typeof e[t] != "function" ? e[t] : e[t].bind(e);
|
|
176
265
|
}
|
|
177
|
-
var
|
|
178
|
-
let s = null, n = null, i = null,
|
|
179
|
-
const l = [],
|
|
180
|
-
for (let
|
|
181
|
-
s =
|
|
266
|
+
var st = (e, t, ...r) => {
|
|
267
|
+
let s = null, n = null, i = null, a = !1, c = !1;
|
|
268
|
+
const l = [], f = (o) => {
|
|
269
|
+
for (let g = 0; g < o.length; g++)
|
|
270
|
+
s = o[g], Array.isArray(s) ? f(s) : s != null && typeof s != "boolean" && ((a = !xe(s)) && (s = String(s)), a && c ? l[l.length - 1].$text$ += s : l.push(a ? ee(null, s) : s), c = a);
|
|
182
271
|
};
|
|
183
|
-
|
|
184
|
-
const
|
|
185
|
-
return
|
|
186
|
-
},
|
|
272
|
+
f(r);
|
|
273
|
+
const p = ee(e, null);
|
|
274
|
+
return p.$attrs$ = t, l.length > 0 && (p.$children$ = l), p.$key$ = n, p.$name$ = i, p;
|
|
275
|
+
}, ee = (e, t) => {
|
|
187
276
|
const r = {
|
|
188
277
|
$flags$: 0,
|
|
189
278
|
$tag$: e,
|
|
@@ -192,63 +281,63 @@ var We = (e, t, ...r) => {
|
|
|
192
281
|
$children$: null
|
|
193
282
|
};
|
|
194
283
|
return r.$attrs$ = null, r.$key$ = null, r.$name$ = null, r;
|
|
195
|
-
},
|
|
284
|
+
}, nt = {}, it = (e) => e && e.$tag$ === nt, ye = (e, t, r, s, n, i, a) => {
|
|
196
285
|
if (r === s)
|
|
197
286
|
return;
|
|
198
|
-
let
|
|
287
|
+
let c = pe(e, t), l = t.toLowerCase();
|
|
199
288
|
if (t === "class") {
|
|
200
|
-
const
|
|
201
|
-
let
|
|
202
|
-
|
|
289
|
+
const f = e.classList, p = he(r);
|
|
290
|
+
let o = he(s);
|
|
291
|
+
f.remove(...p.filter((g) => g && !o.includes(g))), f.add(...o.filter((g) => g && !p.includes(g)));
|
|
203
292
|
} else if (t === "style") {
|
|
204
|
-
for (const
|
|
205
|
-
(!s || s[
|
|
206
|
-
for (const
|
|
207
|
-
(!r || s[
|
|
293
|
+
for (const f in r)
|
|
294
|
+
(!s || s[f] == null) && (f.includes("-") ? e.style.removeProperty(f) : e.style[f] = "");
|
|
295
|
+
for (const f in s)
|
|
296
|
+
(!r || s[f] !== r[f]) && (f.includes("-") ? e.style.setProperty(f, s[f]) : e.style[f] = s[f]);
|
|
208
297
|
} else if (t !== "key") if (t === "ref")
|
|
209
298
|
s && s(e);
|
|
210
299
|
else if (!e.__lookupSetter__(t) && t[0] === "o" && t[1] === "n") {
|
|
211
|
-
if (t[2] === "-" ? t = t.slice(3) :
|
|
212
|
-
const
|
|
213
|
-
t = t.replace(
|
|
300
|
+
if (t[2] === "-" ? t = t.slice(3) : pe(O, l) ? t = l.slice(2) : t = l[2] + t.slice(3), r || s) {
|
|
301
|
+
const f = t.endsWith(Oe);
|
|
302
|
+
t = t.replace(ot, ""), r && z.rel(e, t, r, f), s && z.ael(e, t, s, f);
|
|
214
303
|
}
|
|
215
304
|
} else {
|
|
216
|
-
const
|
|
217
|
-
if ((
|
|
305
|
+
const f = xe(s);
|
|
306
|
+
if ((c || f && s !== null) && !n)
|
|
218
307
|
try {
|
|
219
308
|
if (e.tagName.includes("-"))
|
|
220
309
|
e[t] !== s && (e[t] = s);
|
|
221
310
|
else {
|
|
222
|
-
const
|
|
223
|
-
t === "list" ?
|
|
311
|
+
const o = s ?? "";
|
|
312
|
+
t === "list" ? c = !1 : (r == null || e[t] != o) && (typeof e.__lookupSetter__(t) == "function" ? e[t] = o : e.setAttribute(t, o));
|
|
224
313
|
}
|
|
225
314
|
} catch {
|
|
226
315
|
}
|
|
227
|
-
let
|
|
228
|
-
l !== (l = l.replace(/^xlink\:?/, "")) && (t = l,
|
|
316
|
+
let p = !1;
|
|
317
|
+
l !== (l = l.replace(/^xlink\:?/, "")) && (t = l, p = !0), s == null || s === !1 ? (s !== !1 || e.getAttribute(t) === "") && (p ? e.removeAttributeNS(ge, t) : e.removeAttribute(t)) : (!c || i & 4 || n) && !f && e.nodeType === 1 && (s = s === !0 ? "" : s, p ? e.setAttributeNS(ge, t, s) : e.setAttribute(t, s));
|
|
229
318
|
}
|
|
230
|
-
},
|
|
231
|
-
const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, i = e && e.$attrs$ || {},
|
|
232
|
-
for (const
|
|
233
|
-
|
|
319
|
+
}, at = /\s/, he = (e) => (typeof e == "object" && e && "baseVal" in e && (e = e.baseVal), !e || typeof e != "string" ? [] : e.split(at)), Oe = "Capture", ot = new RegExp(Oe + "$"), te = (e, t, r, s) => {
|
|
320
|
+
const n = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, i = e && e.$attrs$ || {}, a = t.$attrs$ || {};
|
|
321
|
+
for (const c of be(Object.keys(i)))
|
|
322
|
+
c in a || ye(
|
|
234
323
|
n,
|
|
235
|
-
|
|
236
|
-
i[
|
|
324
|
+
c,
|
|
325
|
+
i[c],
|
|
237
326
|
void 0,
|
|
238
327
|
r,
|
|
239
328
|
t.$flags$
|
|
240
329
|
);
|
|
241
|
-
for (const
|
|
242
|
-
|
|
330
|
+
for (const c of be(Object.keys(a)))
|
|
331
|
+
ye(
|
|
243
332
|
n,
|
|
244
|
-
|
|
245
|
-
i[
|
|
246
|
-
|
|
333
|
+
c,
|
|
334
|
+
i[c],
|
|
335
|
+
a[c],
|
|
247
336
|
r,
|
|
248
337
|
t.$flags$
|
|
249
338
|
);
|
|
250
339
|
};
|
|
251
|
-
function
|
|
340
|
+
function be(e) {
|
|
252
341
|
return e.includes("ref") ? (
|
|
253
342
|
// we need to sort these to ensure that `'ref'` is the last attr
|
|
254
343
|
[...e.filter((t) => t !== "ref"), "ref"]
|
|
@@ -257,11 +346,11 @@ function ue(e) {
|
|
|
257
346
|
e
|
|
258
347
|
);
|
|
259
348
|
}
|
|
260
|
-
var
|
|
349
|
+
var D, B, I, re = !1, G = !1, oe = !1, b = !1, W = (e, t, r) => {
|
|
261
350
|
var s;
|
|
262
351
|
const n = t.$children$[r];
|
|
263
|
-
let i = 0,
|
|
264
|
-
if (
|
|
352
|
+
let i = 0, a, c, l;
|
|
353
|
+
if (re || (oe = !0, n.$tag$ === "slot" && (n.$flags$ |= n.$children$ ? (
|
|
265
354
|
// slot element has fallback content
|
|
266
355
|
// still create an element that "mocks" the slot element
|
|
267
356
|
2
|
|
@@ -271,197 +360,198 @@ var F, C, j, Y = !1, U = !1, te = !1, b = !1, D = (e, t, r) => {
|
|
|
271
360
|
// where actual slot content should sit next to
|
|
272
361
|
1
|
|
273
362
|
))), n.$text$ !== null)
|
|
274
|
-
|
|
363
|
+
a = n.$elm$ = O.document.createTextNode(n.$text$);
|
|
275
364
|
else if (n.$flags$ & 1)
|
|
276
|
-
|
|
365
|
+
a = n.$elm$ = O.document.createTextNode(""), te(null, n, b);
|
|
277
366
|
else {
|
|
278
|
-
if (b || (b = n.$tag$ === "svg"), !
|
|
367
|
+
if (b || (b = n.$tag$ === "svg"), !O.document)
|
|
279
368
|
throw new Error(
|
|
280
369
|
"You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
|
|
281
370
|
);
|
|
282
|
-
if (
|
|
283
|
-
b ?
|
|
284
|
-
!
|
|
285
|
-
), b && n.$tag$ === "foreignObject" && (b = !1),
|
|
371
|
+
if (a = n.$elm$ = O.document.createElementNS(
|
|
372
|
+
b ? We : Je,
|
|
373
|
+
!re && K.slotRelocation && n.$flags$ & 2 ? "slot-fb" : n.$tag$
|
|
374
|
+
), b && n.$tag$ === "foreignObject" && (b = !1), te(null, n, b), Xe(D) && a["s-si"] !== D && a.classList.add(a["s-si"] = D), n.$children$)
|
|
286
375
|
for (i = 0; i < n.$children$.length; ++i)
|
|
287
|
-
|
|
288
|
-
n.$tag$ === "svg" ? b = !1 :
|
|
376
|
+
c = W(e, n, i), c && a.appendChild(c);
|
|
377
|
+
n.$tag$ === "svg" ? b = !1 : a.tagName === "foreignObject" && (b = !0);
|
|
289
378
|
}
|
|
290
|
-
return
|
|
291
|
-
},
|
|
292
|
-
|
|
379
|
+
return a["s-hn"] = I, n.$flags$ & 3 && (a["s-sr"] = !0, a["s-cr"] = B, a["s-sn"] = n.$name$ || "", a["s-rf"] = (s = n.$attrs$) == null ? void 0 : s.ref, rt(a), l = e && e.$children$ && e.$children$[r], l && l.$tag$ === n.$tag$ && e.$elm$ && L(e.$elm$, !1), Re(B, a, t.$elm$, e == null ? void 0 : e.$elm$)), a;
|
|
380
|
+
}, L = (e, t) => {
|
|
381
|
+
z.$flags$ |= 1;
|
|
293
382
|
const r = Array.from(e.__childNodes || e.childNodes);
|
|
294
|
-
e["s-sr"] &&
|
|
383
|
+
e["s-sr"] && K.experimentalSlotFixes;
|
|
295
384
|
for (let s = r.length - 1; s >= 0; s--) {
|
|
296
385
|
const n = r[s];
|
|
297
|
-
n["s-hn"] !==
|
|
386
|
+
n["s-hn"] !== I && n["s-ol"] && (T(F(n).parentNode, n, F(n)), n["s-ol"].remove(), n["s-ol"] = void 0, n["s-sh"] = void 0, oe = !0), t && L(n, t);
|
|
298
387
|
}
|
|
299
|
-
|
|
300
|
-
},
|
|
301
|
-
let
|
|
302
|
-
for (
|
|
303
|
-
s[n] && (
|
|
304
|
-
},
|
|
388
|
+
z.$flags$ &= -2;
|
|
389
|
+
}, Ae = (e, t, r, s, n, i) => {
|
|
390
|
+
let a = e["s-cr"] && e["s-cr"].parentNode || e, c;
|
|
391
|
+
for (a.shadowRoot && a.tagName === I && (a = a.shadowRoot); n <= i; ++n)
|
|
392
|
+
s[n] && (c = W(null, r, n), c && (s[n].$elm$ = c, T(a, c, F(t))));
|
|
393
|
+
}, ke = (e, t, r) => {
|
|
305
394
|
for (let s = t; s <= r; ++s) {
|
|
306
395
|
const n = e[s];
|
|
307
396
|
if (n) {
|
|
308
397
|
const i = n.$elm$;
|
|
309
|
-
|
|
398
|
+
je(n), i && (G = !0, i["s-ol"] ? i["s-ol"].remove() : L(i, !0), i.remove());
|
|
310
399
|
}
|
|
311
400
|
}
|
|
312
|
-
},
|
|
313
|
-
let i = 0,
|
|
314
|
-
for (; i <=
|
|
315
|
-
if (
|
|
316
|
-
|
|
317
|
-
else if (
|
|
318
|
-
|
|
401
|
+
}, lt = (e, t, r, s, n = !1) => {
|
|
402
|
+
let i = 0, a = 0, c = 0, l = 0, f = t.length - 1, p = t[0], o = t[f], g = s.length - 1, u = s[0], d = s[g], h, _;
|
|
403
|
+
for (; i <= f && a <= g; )
|
|
404
|
+
if (p == null)
|
|
405
|
+
p = t[++i];
|
|
406
|
+
else if (o == null)
|
|
407
|
+
o = t[--f];
|
|
319
408
|
else if (u == null)
|
|
320
|
-
u = s[++
|
|
321
|
-
else if (
|
|
322
|
-
|
|
323
|
-
else if (
|
|
324
|
-
|
|
325
|
-
else if (
|
|
326
|
-
|
|
327
|
-
else if (
|
|
328
|
-
(
|
|
329
|
-
else if (
|
|
330
|
-
(
|
|
409
|
+
u = s[++a];
|
|
410
|
+
else if (d == null)
|
|
411
|
+
d = s[--g];
|
|
412
|
+
else if (Z(p, u, n))
|
|
413
|
+
R(p, u, n), p = t[++i], u = s[++a];
|
|
414
|
+
else if (Z(o, d, n))
|
|
415
|
+
R(o, d, n), o = t[--f], d = s[--g];
|
|
416
|
+
else if (Z(p, d, n))
|
|
417
|
+
(p.$tag$ === "slot" || d.$tag$ === "slot") && L(p.$elm$.parentNode, !1), R(p, d, n), T(e, p.$elm$, o.$elm$.nextSibling), p = t[++i], d = s[--g];
|
|
418
|
+
else if (Z(o, u, n))
|
|
419
|
+
(p.$tag$ === "slot" || d.$tag$ === "slot") && L(o.$elm$.parentNode, !1), R(o, u, n), T(e, o.$elm$, p.$elm$), o = t[--f], u = s[++a];
|
|
331
420
|
else {
|
|
332
|
-
for (
|
|
421
|
+
for (c = -1, l = i; l <= f; ++l)
|
|
333
422
|
if (t[l] && t[l].$key$ !== null && t[l].$key$ === u.$key$) {
|
|
334
|
-
|
|
423
|
+
c = l;
|
|
335
424
|
break;
|
|
336
425
|
}
|
|
337
|
-
|
|
338
|
-
|
|
426
|
+
c >= 0 ? (_ = t[c], _.$tag$ !== u.$tag$ ? h = W(t && t[a], r, c) : (R(_, u, n), t[c] = void 0, h = _.$elm$), u = s[++a]) : (h = W(t && t[a], r, a), u = s[++a]), h && T(
|
|
427
|
+
F(p.$elm$).parentNode,
|
|
339
428
|
h,
|
|
340
|
-
|
|
429
|
+
F(p.$elm$)
|
|
341
430
|
);
|
|
342
431
|
}
|
|
343
|
-
i >
|
|
432
|
+
i > f ? Ae(
|
|
344
433
|
e,
|
|
345
|
-
s[
|
|
434
|
+
s[g + 1] == null ? null : s[g + 1].$elm$,
|
|
346
435
|
r,
|
|
347
436
|
s,
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
) :
|
|
351
|
-
},
|
|
352
|
-
const s = t.$elm$ = e.$elm$, n = e.$children$, i = t.$children$,
|
|
437
|
+
a,
|
|
438
|
+
g
|
|
439
|
+
) : a > g && ke(t, i, f);
|
|
440
|
+
}, Z = (e, t, r = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === "slot" ? e.$name$ === t.$name$ : r ? (r && !e.$key$ && t.$key$ && (e.$key$ = t.$key$), !0) : e.$key$ === t.$key$ : !1, F = (e) => e && e["s-ol"] || e, R = (e, t, r = !1) => {
|
|
441
|
+
const s = t.$elm$ = e.$elm$, n = e.$children$, i = t.$children$, a = t.$tag$, c = t.$text$;
|
|
353
442
|
let l;
|
|
354
|
-
|
|
443
|
+
c === null ? (b = a === "svg" ? !0 : a === "foreignObject" ? !1 : b, te(e, t, b), n !== null && i !== null ? lt(s, n, t, i, r) : i !== null ? (e.$text$ !== null && (s.textContent = ""), Ae(s, null, t, i, 0, i.length - 1)) : (
|
|
355
444
|
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
356
|
-
!r &&
|
|
357
|
-
), b &&
|
|
358
|
-
},
|
|
445
|
+
!r && K.updatable && n !== null && ke(n, 0, n.length - 1)
|
|
446
|
+
), b && a === "svg" && (b = !1)) : (l = s["s-cr"]) ? l.parentNode.textContent = c : e.$text$ !== c && (s.data = c);
|
|
447
|
+
}, x = [], Te = (e) => {
|
|
359
448
|
let t, r, s;
|
|
360
449
|
const n = e.__childNodes || e.childNodes;
|
|
361
450
|
for (const i of n) {
|
|
362
451
|
if (i["s-sr"] && (t = i["s-cr"]) && t.parentNode) {
|
|
363
452
|
r = t.parentNode.__childNodes || t.parentNode.childNodes;
|
|
364
|
-
const
|
|
453
|
+
const a = i["s-sn"];
|
|
365
454
|
for (s = r.length - 1; s >= 0; s--)
|
|
366
455
|
if (t = r[s], !t["s-cn"] && !t["s-nr"] && t["s-hn"] !== i["s-hn"])
|
|
367
|
-
if (
|
|
368
|
-
let
|
|
369
|
-
|
|
456
|
+
if ($e(t, a)) {
|
|
457
|
+
let c = x.find((l) => l.$nodeToRelocate$ === t);
|
|
458
|
+
G = !0, t["s-sn"] = t["s-sn"] || a, c ? (c.$nodeToRelocate$["s-sh"] = i["s-hn"], c.$slotRefNode$ = i) : (t["s-sh"] = i["s-hn"], x.push({
|
|
370
459
|
$slotRefNode$: i,
|
|
371
460
|
$nodeToRelocate$: t
|
|
372
|
-
})), t["s-sr"] &&
|
|
373
|
-
|
|
461
|
+
})), t["s-sr"] && x.map((l) => {
|
|
462
|
+
$e(l.$nodeToRelocate$, t["s-sn"]) && (c = x.find((f) => f.$nodeToRelocate$ === t), c && !l.$slotRefNode$ && (l.$slotRefNode$ = c.$slotRefNode$));
|
|
374
463
|
});
|
|
375
|
-
} else
|
|
464
|
+
} else x.some((c) => c.$nodeToRelocate$ === t) || x.push({
|
|
376
465
|
$nodeToRelocate$: t
|
|
377
466
|
});
|
|
378
467
|
}
|
|
379
|
-
i.nodeType === 1 &&
|
|
468
|
+
i.nodeType === 1 && Te(i);
|
|
380
469
|
}
|
|
381
|
-
},
|
|
382
|
-
e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(
|
|
383
|
-
},
|
|
384
|
-
function
|
|
470
|
+
}, je = (e) => {
|
|
471
|
+
e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map(je);
|
|
472
|
+
}, T = (e, t, r) => (typeof t["s-sn"] == "string" && t["s-sr"] && t["s-cr"] && Re(t["s-cr"], t, e, t.parentElement), e == null ? void 0 : e.insertBefore(t, r));
|
|
473
|
+
function Re(e, t, r, s) {
|
|
385
474
|
var n, i;
|
|
386
|
-
let
|
|
387
|
-
if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (
|
|
388
|
-
const
|
|
389
|
-
if ((n = r.classList) == null || n.add(
|
|
390
|
-
let
|
|
391
|
-
for (;
|
|
392
|
-
if (
|
|
393
|
-
|
|
475
|
+
let a;
|
|
476
|
+
if (e && typeof t["s-sn"] == "string" && t["s-sr"] && e.parentNode && e.parentNode["s-sc"] && (a = t["s-si"] || e.parentNode["s-sc"])) {
|
|
477
|
+
const c = t["s-sn"], l = t["s-hn"];
|
|
478
|
+
if ((n = r.classList) == null || n.add(a + "-s"), s && ((i = s.classList) != null && i.contains(a + "-s"))) {
|
|
479
|
+
let f = (s.__childNodes || s.childNodes)[0], p = !1;
|
|
480
|
+
for (; f; ) {
|
|
481
|
+
if (f["s-sn"] !== c && f["s-hn"] === l && f["s-sr"]) {
|
|
482
|
+
p = !0;
|
|
394
483
|
break;
|
|
395
484
|
}
|
|
396
|
-
|
|
485
|
+
f = f.nextSibling;
|
|
397
486
|
}
|
|
398
|
-
|
|
487
|
+
p || s.classList.remove(a + "-s");
|
|
399
488
|
}
|
|
400
489
|
}
|
|
401
490
|
}
|
|
402
|
-
var
|
|
403
|
-
var s, n, i,
|
|
404
|
-
const l = e.$hostElement$,
|
|
405
|
-
if (
|
|
406
|
-
([
|
|
407
|
-
)), r &&
|
|
408
|
-
for (const
|
|
409
|
-
l.hasAttribute(
|
|
410
|
-
|
|
491
|
+
var ct = (e, t, r = !1) => {
|
|
492
|
+
var s, n, i, a, c;
|
|
493
|
+
const l = e.$hostElement$, f = e.$cmpMeta$, p = e.$vnode$ || ee(null, null), o = it(t) ? t : st(null, null, t);
|
|
494
|
+
if (I = l.tagName, f.$attrsToReflect$ && (o.$attrs$ = o.$attrs$ || {}, f.$attrsToReflect$.map(
|
|
495
|
+
([g, u]) => o.$attrs$[u] = l[g]
|
|
496
|
+
)), r && o.$attrs$)
|
|
497
|
+
for (const g of Object.keys(o.$attrs$))
|
|
498
|
+
l.hasAttribute(g) && !["key", "ref", "style", "class"].includes(g) && (o.$attrs$[g] = l[g]);
|
|
499
|
+
o.$tag$ = null, o.$flags$ |= 4, e.$vnode$ = o, o.$elm$ = p.$elm$ = l.shadowRoot || l, D = l["s-sc"], re = !!(f.$flags$ & 1) && !(f.$flags$ & 128), B = l["s-cr"], G = !1, R(p, o, r);
|
|
411
500
|
{
|
|
412
|
-
if (
|
|
413
|
-
|
|
414
|
-
for (const
|
|
415
|
-
const u =
|
|
416
|
-
if (!u["s-ol"] &&
|
|
417
|
-
const
|
|
418
|
-
|
|
501
|
+
if (z.$flags$ |= 1, oe) {
|
|
502
|
+
Te(o.$elm$);
|
|
503
|
+
for (const g of x) {
|
|
504
|
+
const u = g.$nodeToRelocate$;
|
|
505
|
+
if (!u["s-ol"] && O.document) {
|
|
506
|
+
const d = O.document.createTextNode("");
|
|
507
|
+
d["s-nr"] = u, T(u.parentNode, u["s-ol"] = d, u);
|
|
419
508
|
}
|
|
420
509
|
}
|
|
421
|
-
for (const
|
|
422
|
-
const u =
|
|
423
|
-
if (
|
|
424
|
-
const h =
|
|
425
|
-
let
|
|
510
|
+
for (const g of x) {
|
|
511
|
+
const u = g.$nodeToRelocate$, d = g.$slotRefNode$;
|
|
512
|
+
if (d) {
|
|
513
|
+
const h = d.parentNode;
|
|
514
|
+
let _ = d.nextSibling;
|
|
426
515
|
{
|
|
427
|
-
let
|
|
428
|
-
for (;
|
|
429
|
-
let y = (n =
|
|
516
|
+
let E = (s = u["s-ol"]) == null ? void 0 : s.previousSibling;
|
|
517
|
+
for (; E; ) {
|
|
518
|
+
let y = (n = E["s-nr"]) != null ? n : null;
|
|
430
519
|
if (y && y["s-sn"] === u["s-sn"] && h === (y.__parentNode || y.parentNode)) {
|
|
431
520
|
for (y = y.nextSibling; y === u || y != null && y["s-sr"]; )
|
|
432
521
|
y = y == null ? void 0 : y.nextSibling;
|
|
433
522
|
if (!y || !y["s-nr"]) {
|
|
434
|
-
|
|
523
|
+
_ = y;
|
|
435
524
|
break;
|
|
436
525
|
}
|
|
437
526
|
}
|
|
438
|
-
|
|
527
|
+
E = E.previousSibling;
|
|
439
528
|
}
|
|
440
529
|
}
|
|
441
|
-
const
|
|
442
|
-
(!
|
|
530
|
+
const C = u.__parentNode || u.parentNode, P = u.__nextSibling || u.nextSibling;
|
|
531
|
+
(!_ && h !== C || P !== _) && u !== _ && (!u["s-hn"] && u["s-ol"] && (u["s-hn"] = u["s-ol"].parentNode.nodeName), T(h, u, _), u.nodeType === 1 && u.tagName !== "SLOT-FB" && (u.hidden = (i = u["s-ih"]) != null ? i : !1)), u && typeof d["s-rf"] == "function" && d["s-rf"](d);
|
|
443
532
|
} else
|
|
444
|
-
u.nodeType === 1 && (r && (u["s-ih"] = (
|
|
533
|
+
u.nodeType === 1 && (r && (u["s-ih"] = (a = u.hidden) != null ? a : !1), u.hidden = !0);
|
|
445
534
|
}
|
|
446
535
|
}
|
|
447
|
-
|
|
536
|
+
G && Se(o.$elm$), z.$flags$ &= -2, x.length = 0;
|
|
448
537
|
}
|
|
449
|
-
if (
|
|
450
|
-
const
|
|
451
|
-
for (const u of
|
|
452
|
-
u["s-hn"] !==
|
|
538
|
+
if (K.experimentalScopedSlotChanges && f.$flags$ & 2) {
|
|
539
|
+
const g = o.$elm$.__childNodes || o.$elm$.childNodes;
|
|
540
|
+
for (const u of g)
|
|
541
|
+
u["s-hn"] !== I && !u["s-sh"] && (r && u["s-ih"] == null && (u["s-ih"] = (c = u.hidden) != null ? c : !1), u.hidden = !0);
|
|
453
542
|
}
|
|
454
|
-
|
|
543
|
+
B = void 0;
|
|
455
544
|
};
|
|
456
|
-
const
|
|
545
|
+
const q = {
|
|
546
|
+
content_wrap: 0,
|
|
457
547
|
ignore: [],
|
|
458
548
|
ignore_with: "_!i-£___£%_",
|
|
459
549
|
strict: !1,
|
|
460
550
|
tab_size: 2,
|
|
461
|
-
tag_wrap:
|
|
551
|
+
tag_wrap: 0,
|
|
462
552
|
tag_wrap_width: 80,
|
|
463
553
|
trim: []
|
|
464
|
-
}, w = "!i-£___£%_",
|
|
554
|
+
}, m = "__!i-£___£%__", w = "!i-£___£%_", Ne = [
|
|
465
555
|
"area",
|
|
466
556
|
"base",
|
|
467
557
|
"br",
|
|
@@ -476,7 +566,7 @@ const K = {
|
|
|
476
566
|
"source",
|
|
477
567
|
"track",
|
|
478
568
|
"wbr"
|
|
479
|
-
],
|
|
569
|
+
], le = (e) => /<(?:[A-Za-z]+[A-Za-z0-9]*)(?:\s+.*?)*?\/{0,1}>/.test(e) || /<(?<Element>(?:[A-Za-z]+[A-Za-z0-9]*:)?(?:[A-Za-z]+[A-Za-z0-9]*))(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e) || /<(?<Element>(?:[a-z][a-z0-9._]*:)?[a-z][a-z0-9._]*-[a-z0-9._-]+)(?:\s+.*?)*?>(?:.|\n)*?<\/{1}\k<Element>>/.test(e), ze = (e, t) => {
|
|
480
570
|
if (!e || !t)
|
|
481
571
|
throw new Error("Both 'current' and 'updates' must be passed-in to mergeObjects()");
|
|
482
572
|
let r;
|
|
@@ -485,40 +575,50 @@ const K = {
|
|
|
485
575
|
else if (typeof e == "object") {
|
|
486
576
|
r = { ...e };
|
|
487
577
|
for (let s of Object.keys(t))
|
|
488
|
-
typeof t[s] != "object" ? r[s] = t[s] : r[s] =
|
|
578
|
+
typeof t[s] != "object" ? r[s] = t[s] : r[s] = ze(r[s] || {}, t[s]);
|
|
489
579
|
}
|
|
490
580
|
return r;
|
|
491
|
-
},
|
|
581
|
+
}, ft = (e, t) => ze(structuredClone(e), t), ut = (e) => (e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (t, r) => t.replace(r, (s) => s.replace(/\n/g, w + "nl!").replace(/\r/g, w + "cr!").replace(/\s/g, w + "ws!"))), e), pt = (e) => e.replace(/\n/g, m + "nl!").replace(/\r/g, m + "cr!").replace(/\s/g, m + "ws!"), gt = (e) => {
|
|
582
|
+
const t = /\s*<([a-zA-Z0-9:-]+)[^>]*>\n\s*<\/\1>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n)|<([a-zA-Z0-9:-]+)[^>]*>(?=\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n)(\n[ ]*\S[^\n]*\n\s*)<\/\3>/g;
|
|
583
|
+
return e.replace(t, (r, s, n, i, a) => {
|
|
584
|
+
const c = n || a;
|
|
585
|
+
if (!c)
|
|
586
|
+
return r;
|
|
587
|
+
const l = c.replace(/\n/g, m + "nl!").replace(/\r/g, m + "cr!").replace(/\s/g, m + "ws!");
|
|
588
|
+
return r.replace(c, l);
|
|
589
|
+
});
|
|
590
|
+
}, $t = (e) => {
|
|
492
591
|
const t = /<([A-Za-z][A-Za-z0-9]*|[a-z][a-z0-9._]*-[a-z0-9._-]+)((?:\s+[A-Za-z0-9_-]+="[^"]*"|\s*[a-z]*)*)>/g;
|
|
493
592
|
return e = e.replace(t, (r, s, n) => r.replace(n, (i) => i.replace(/</g, w + "lt!").replace(/>/g, w + "gt!"))), e;
|
|
494
|
-
},
|
|
593
|
+
}, dt = (e, t) => {
|
|
495
594
|
const r = t.ignore, s = t.ignore_with;
|
|
496
595
|
for (let n = 0; n < r.length; n++) {
|
|
497
596
|
const i = new RegExp(`<${r[n]}[^>]*>((.|
|
|
498
597
|
)*?)</${r[n]}>`, "g");
|
|
499
|
-
e = e.replace(i, (
|
|
598
|
+
e = e.replace(i, (a, c) => a.replace(c, (l) => l.replace(/</g, "-" + s + "lt-").replace(/>/g, "-" + s + "gt-").replace(/\n/g, "-" + s + "nl-").replace(/\r/g, "-" + s + "cr-").replace(/\s/g, "-" + s + "ws-")));
|
|
500
599
|
}
|
|
501
600
|
return e;
|
|
502
|
-
},
|
|
601
|
+
}, yt = (e, t) => {
|
|
503
602
|
for (let r = 0; r < t.length; r++) {
|
|
504
603
|
const s = new RegExp(`(<${t[r]}[^>]*>)\\s+`, "g"), n = new RegExp(`\\s+(</${t[r]}>)`, "g");
|
|
505
604
|
e = e.replace(s, "$1").replace(n, "$1");
|
|
506
605
|
}
|
|
507
606
|
return e;
|
|
508
|
-
},
|
|
509
|
-
`).replace(new RegExp(w + "cr!", "g"), "\r").replace(new RegExp(w + "ws!", "g"), " "))), e),
|
|
607
|
+
}, ht = (e) => (e = e.replace(/<[\w:\-]+([^>]*[^\/])>/g, (t, r) => t.replace(r, (s) => s.replace(new RegExp(w + "nl!", "g"), `
|
|
608
|
+
`).replace(new RegExp(w + "cr!", "g"), "\r").replace(new RegExp(w + "ws!", "g"), " "))), e), bt = (e) => (e = e.replace(/.*__!i-£___£%__[a-z]{2}!.*/g, (t) => t.replace(/__!i-£___£%__[a-z]{2}!/g, (r) => r.replace(new RegExp(m + "nl!", "g"), `
|
|
609
|
+
`).replace(new RegExp(m + "cr!", "g"), "\r").replace(new RegExp(m + "ws!", "g"), " "))), e), _t = (e) => (e = e.replace(/<[\w:\-]+([^>]*)>/g, (t, r) => t.replace(r, (s) => s.replace(new RegExp(w + "lt!", "g"), "<").replace(new RegExp(w + "gt!", "g"), ">"))), e), vt = (e, t) => {
|
|
510
610
|
const r = t.ignore, s = t.ignore_with;
|
|
511
611
|
for (let n = 0; n < r.length; n++) {
|
|
512
612
|
const i = new RegExp(`<${r[n]}[^>]*>((.|
|
|
513
613
|
)*?)</${r[n]}>`, "g");
|
|
514
|
-
e = e.replace(i, (
|
|
614
|
+
e = e.replace(i, (a, c) => a.replace(c, (l) => l.replace(new RegExp("-" + s + "lt-", "g"), "<").replace(new RegExp("-" + s + "gt-", "g"), ">").replace(new RegExp("-" + s + "nl-", "g"), `
|
|
515
615
|
`).replace(new RegExp("-" + s + "cr-", "g"), "\r").replace(new RegExp("-" + s + "ws-", "g"), " ")));
|
|
516
616
|
}
|
|
517
617
|
return e;
|
|
518
|
-
},
|
|
618
|
+
}, wt = (e) => {
|
|
519
619
|
var s, n;
|
|
520
620
|
if (typeof e != "object") throw new Error("Config must be an object.");
|
|
521
|
-
if (!(Object.hasOwn(e, "ignore") || Object.hasOwn(e, "ignore_with") || Object.hasOwn(e, "strict") || Object.hasOwn(e, "tab_size") || Object.hasOwn(e, "tag_wrap") || Object.hasOwn(e, "tag_wrap_width") || Object.hasOwn(e, "trim"))) return
|
|
621
|
+
if (!(Object.hasOwn(e, "content_wrap") || Object.hasOwn(e, "ignore") || Object.hasOwn(e, "ignore_with") || Object.hasOwn(e, "strict") || Object.hasOwn(e, "tab_size") || Object.hasOwn(e, "tag_wrap") || Object.hasOwn(e, "tag_wrap_width") || Object.hasOwn(e, "trim"))) return q;
|
|
522
622
|
let r = e.tab_size;
|
|
523
623
|
if (r) {
|
|
524
624
|
if (typeof r != "number") throw new Error(`tab_size must be a number, not ${typeof e.tab_size}.`);
|
|
@@ -526,100 +626,122 @@ const K = {
|
|
|
526
626
|
if (r = Math.floor(r), r < 1 || r > 16) throw new Error("Tab size out of range. Expecting 1 to 16.");
|
|
527
627
|
e.tab_size = r;
|
|
528
628
|
}
|
|
629
|
+
if (Object.hasOwn(e, "content_wrap") && typeof e.content_wrap != "number")
|
|
630
|
+
throw new Error(`content_wrap config must be a number, not ${typeof e.tag_wrap_width}.`);
|
|
529
631
|
if (Object.hasOwn(e, "ignore") && (!Array.isArray(e.ignore) || !((s = e.ignore) != null && s.every((i) => typeof i == "string"))))
|
|
530
632
|
throw new Error("Ignore config must be an array of strings.");
|
|
531
633
|
if (Object.hasOwn(e, "ignore_with") && typeof e.ignore_with != "string")
|
|
532
634
|
throw new Error(`Ignore_with config must be a string, not ${typeof e.ignore_with}.`);
|
|
533
635
|
if (Object.hasOwn(e, "strict") && typeof e.strict != "boolean")
|
|
534
636
|
throw new Error(`Strict config must be a boolean, not ${typeof e.strict}.`);
|
|
535
|
-
if (Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap
|
|
536
|
-
throw new Error(`tag_wrap config must be a
|
|
537
|
-
if (Object.hasOwn(e, "tag_wrap_width") && typeof e.tag_wrap_width != "number")
|
|
637
|
+
if (Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap == "boolean" && (console.warn("tag_wrap as a boolean is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."), e.tag_wrap_width ? e.tag_wrap = e.tag_wrap_width : e.tag_wrap = q.tag_wrap_width), Object.hasOwn(e, "tag_wrap") && typeof e.tag_wrap != "number")
|
|
638
|
+
throw new Error(`tag_wrap config must be a number, not ${typeof e.tag_wrap}.`);
|
|
639
|
+
if (Object.hasOwn(e, "tag_wrap_width") && console.warn("tag_wrap_width is deprecated, and will not be supported in v0.9.0+. Use `tag_wrap: <number>` instead; where <number> is the max character width acceptable before wrapping attributes."), Object.hasOwn(e, "tag_wrap_width") && typeof e.tag_wrap_width != "number")
|
|
538
640
|
throw new Error(`tag_wrap_width config must be a number, not ${typeof e.tag_wrap_width}.`);
|
|
539
641
|
if (Object.hasOwn(e, "trim") && (!Array.isArray(e.trim) || !((n = e.trim) != null && n.every((i) => typeof i == "string"))))
|
|
540
642
|
throw new Error("Trim config must be an array of strings.");
|
|
541
|
-
return
|
|
542
|
-
},
|
|
543
|
-
|
|
643
|
+
return ft(q, e);
|
|
644
|
+
}, xt = (e, t, r) => {
|
|
645
|
+
const s = e.split(/\s+/);
|
|
646
|
+
if (s.length === 0)
|
|
647
|
+
return "";
|
|
648
|
+
const n = [];
|
|
649
|
+
let i = "", a = !0;
|
|
650
|
+
s.forEach((l) => {
|
|
651
|
+
if (l !== "")
|
|
652
|
+
if (i === "")
|
|
653
|
+
i = l;
|
|
654
|
+
else if (l.length >= t)
|
|
655
|
+
a ? (n.push(i.padStart(i.length)), n.push(l.padStart(l.length)), a = !1) : (n.push(i.padStart(i.length + r)), n.push(l.padStart(l.length + r)));
|
|
656
|
+
else {
|
|
657
|
+
const f = i + " " + l;
|
|
658
|
+
f.length <= t ? i = f : (a ? (n.push(i.padStart(i.length)), a = !1) : n.push(i.padStart(i.length + r)), i = l);
|
|
659
|
+
}
|
|
660
|
+
}), i !== "" && n.push(i.padStart(i.length + r));
|
|
661
|
+
const c = n.join(`
|
|
662
|
+
`);
|
|
663
|
+
return pt(c);
|
|
664
|
+
}, mt = (e, t = !0) => t && !le(e) ? e : e.replace(/<([a-zA-Z\-0-9:]+)[^>]*>/g, (r, s) => Ne.indexOf(s) > -1 ? `${r.substring(0, r.length - 1)} />`.replace(/\/\s\//g, "/") : r.replace(/[\s]?\/>/g, `></${s}>`)), St = (e, t = !1) => (e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (r, s) => r.replace(s, (n) => n.replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\n/g, " ").replace(/\r/g, " ").replace(/\s/g, " "))), t && (e = e.replace(/<textarea[^>]*>((.|\n)*?)<\/textarea>/g, (r, s) => (r = r.replace(s, (n) => n.replace(/\n|\t/g, "").replace(/[a-z]+="\s*"/ig, "").replace(/>\s+</g, "><").replace(/\s+/g, " ")), r = r.replace(/\s+/g, " ").replace(/\s>/g, ">").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/class=["']\s/g, (n) => n.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"), r))), e), Et = (e, t = !0) => t && !le(e) ? e : (e = St(e), e.replace(/\n|\t/g, "").replace(/>\s+</g, "><").replace(/\s+/g, " ").replace(/(.+=)"\s+"/ig, '$1""').replace(/(.+=)'\s+'/ig, "$1''").replace(/\s>/g, ">").replace(/<\s\//g, "</").replace(/>\s/g, ">").replace(/\s</g, "<").replace(/class=["']\s/g, (r) => r.replace(/\s/g, "")).replace(/(class=.*)\s(["'])/g, "$1$2"));
|
|
665
|
+
let H, se;
|
|
544
666
|
const A = {
|
|
545
667
|
line: []
|
|
546
|
-
},
|
|
668
|
+
}, Ot = (e) => {
|
|
547
669
|
A.line = [];
|
|
548
670
|
let t = -1;
|
|
549
671
|
const r = /(<[^>]+>)|([^<]+)/g;
|
|
550
672
|
return e = e.replace(r, (s, n, i) => (n ? A.line.push({ type: "tag", value: s }) : i && i.trim().length > 0 && A.line.push({ type: "text", value: s }), t++, `
|
|
551
673
|
[#-# : ${t} : ${s} : #-#]
|
|
552
674
|
`)), e;
|
|
553
|
-
},
|
|
554
|
-
const r = t.tab_size, s = t.tag_wrap, n = t.
|
|
675
|
+
}, At = (e) => (e = mt(e, !1), se.length > 0 && (e = yt(e, se)), e = Et(e, !1), e = Ot(e), e), kt = (e, t) => {
|
|
676
|
+
const r = t.tab_size, s = t.tag_wrap, n = t.content_wrap;
|
|
555
677
|
let i = "";
|
|
556
|
-
A.line.forEach((l,
|
|
678
|
+
A.line.forEach((l, f) => {
|
|
557
679
|
e = e.replace(/\n+/g, `
|
|
558
|
-
`).replace(`[#-# : ${
|
|
559
|
-
var
|
|
560
|
-
let
|
|
561
|
-
const
|
|
562
|
-
i += "0",
|
|
563
|
-
const
|
|
564
|
-
if (i = i.substring(0,
|
|
565
|
-
|
|
566
|
-
if (
|
|
567
|
-
const
|
|
568
|
-
let
|
|
680
|
+
`).replace(`[#-# : ${f} : ${l.value} : #-#]`, (p) => {
|
|
681
|
+
var _, C, P;
|
|
682
|
+
let o = 0;
|
|
683
|
+
const g = `[#-# : ${f - 1} : ${(_ = A.line[f - 1]) == null ? void 0 : _.value} : #-#]`, u = /<[A-Za-z]+\b[^>]*(?:.|\n)*?\/?>/g;
|
|
684
|
+
i += "0", f === 0 && o++, p.indexOf(`#-# : ${f} : </`) > -1 && o++, g.indexOf("<!doctype") > -1 && o++, g.indexOf("<!--") > -1 && o++, g.indexOf("/> : #-#") > -1 && o++, g.indexOf(`#-# : ${f - 1} : </`) > -1 && o++, ((C = A.line[f - 1]) == null ? void 0 : C.type) === "text" && o++;
|
|
685
|
+
const d = i.length - o;
|
|
686
|
+
if (i = i.substring(0, d), H && p.indexOf("<!--") > -1) return "";
|
|
687
|
+
let h = p.replace(`[#-# : ${f} : `, "").replace(" : #-#]", "");
|
|
688
|
+
if (((P = A.line[f]) == null ? void 0 : P.type) === "text" && n > 0 && h.length >= n && (h = xt(h, n, r * d)), s > 0 && l.value.length > s && u.test(l.value)) {
|
|
689
|
+
const E = /\s{1}[A-Za-z-]+(?:=".*?")?/g, y = l.value.split(E).filter(Boolean), Fe = l.value.matchAll(E), Y = r * d, Me = Y + r;
|
|
690
|
+
let Q = y[0].padStart(y[0].length + Y) + `
|
|
569
691
|
`;
|
|
570
|
-
for (const
|
|
571
|
-
const
|
|
692
|
+
for (const ce of Fe) {
|
|
693
|
+
const Pe = ce[0].trim().padStart(ce[0].trim().length + Me) + `
|
|
572
694
|
`;
|
|
573
|
-
|
|
695
|
+
Q += Pe;
|
|
574
696
|
}
|
|
575
|
-
const
|
|
576
|
-
|
|
697
|
+
const Ce = y[1].padStart(
|
|
698
|
+
y[1].trim().length + Y + (H && Ne.includes(y[0].slice(1)) ? 1 : 0)
|
|
577
699
|
);
|
|
578
|
-
return
|
|
700
|
+
return Q += Ce, Q;
|
|
579
701
|
} else
|
|
580
|
-
return
|
|
702
|
+
return h.padStart(h.length + r * d);
|
|
581
703
|
});
|
|
582
|
-
}), s && (e =
|
|
704
|
+
}), s > 0 && (e = ut(e)), n > 0 && /\n[ ]*[^\n]*__!i-£___£%__[^\n]*\n/.test(e) && (e = gt(e)), e = e.replace(
|
|
583
705
|
/<(?<Element>.+).*>[^<]*?[^><\/\s][^<]*?<\/{1}\k<Element>|<script[^>]*>\s+<\/script>|<(\w+)>\s+<\/(\w+)|<(?:([\w:\._-]+)|([\w:\._-]+)[^>]*[^\/])>\s+<\/([\w:\._-]+)>/g,
|
|
584
706
|
(l) => l.replace(/\n|\t|\s{2,}/g, "")
|
|
585
|
-
), s && (e =
|
|
586
|
-
const
|
|
587
|
-
return
|
|
588
|
-
` && (e = e.substring(1, e.length)),
|
|
707
|
+
), n > 0 && (e = bt(e)), s > 0 && (e = ht(e)), H && (e = e.replace(/\s\/>|\/>/g, ">"));
|
|
708
|
+
const a = e.substring(0, 1), c = e.substring(e.length - 1);
|
|
709
|
+
return a === `
|
|
710
|
+
` && (e = e.substring(1, e.length)), c === `
|
|
589
711
|
` && (e = e.substring(0, e.length - 1)), e;
|
|
590
|
-
},
|
|
591
|
-
if (!
|
|
592
|
-
const r = t ?
|
|
593
|
-
|
|
712
|
+
}, Tt = (e, t) => {
|
|
713
|
+
if (!le(e)) return e;
|
|
714
|
+
const r = t ? wt(t) : q;
|
|
715
|
+
H = r.strict;
|
|
594
716
|
const s = r.ignore.length > 0;
|
|
595
|
-
return
|
|
596
|
-
},
|
|
717
|
+
return se = r.trim, s && (e = dt(e, r)), e = $t(e), e = At(e), e = kt(e, r), e = _t(e), s && (e = vt(e, r)), e;
|
|
718
|
+
}, jt = (e, t, r) => {
|
|
597
719
|
[null, void 0, "", !1].includes(r) || ["innerHTML", "style", ""].includes(t) || e.setAttribute(t, ["object", "function"].includes(typeof r) ? "⚠️ Property must be set through a script or a framework-specific syntax." : r);
|
|
598
|
-
},
|
|
720
|
+
}, Ie = (e, t, r, s, n) => {
|
|
599
721
|
if (t && typeof t == "string") {
|
|
600
722
|
const i = document.createElement(t);
|
|
601
|
-
Object.keys(r || {}).forEach((
|
|
602
|
-
|
|
603
|
-
}), s == null || s.forEach((
|
|
604
|
-
|
|
723
|
+
Object.keys(r || {}).forEach((a) => {
|
|
724
|
+
jt(i, a, r[a]);
|
|
725
|
+
}), s == null || s.forEach((a) => {
|
|
726
|
+
Ie(i, a.$tag$, a.$attrs$, a.$children$, a.$text$);
|
|
605
727
|
}), r != null && r.innerHTML && (i.innerHTML = r.innerHTML), e.appendChild(i);
|
|
606
728
|
}
|
|
607
729
|
n && (e.innerHTML = n);
|
|
608
|
-
},
|
|
730
|
+
}, Qt = (e, t, r = []) => {
|
|
609
731
|
const s = {};
|
|
610
732
|
if (typeof e != "object")
|
|
611
733
|
throw new Error("filterArgs - args isn't an object.");
|
|
612
734
|
for (const n in e)
|
|
613
735
|
if (!r.includes(n)) {
|
|
614
|
-
const i = e[n],
|
|
615
|
-
(!t || !Object.keys(t).includes(n) || t[n] !== i) && (s[
|
|
736
|
+
const i = e[n], a = n.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
737
|
+
(!t || !Object.keys(t).includes(n) || t[n] !== i) && (s[a] = i);
|
|
616
738
|
}
|
|
617
739
|
return s;
|
|
618
|
-
},
|
|
740
|
+
}, Vt = (e, t) => {
|
|
619
741
|
var s, n;
|
|
620
742
|
const r = document.getElementById("storybook-root");
|
|
621
743
|
if (r !== null)
|
|
622
|
-
return (n = document.querySelector("[lang]")) == null || n.setAttribute("lang", ((s = t.globals) == null ? void 0 : s.locale) || "en"),
|
|
744
|
+
return (n = document.querySelector("[lang]")) == null || n.setAttribute("lang", ((s = t.globals) == null ? void 0 : s.locale) || "en"), ct(
|
|
623
745
|
{
|
|
624
746
|
$cmpMeta$: {
|
|
625
747
|
$flags$: 0,
|
|
@@ -629,35 +751,38 @@ const A = {
|
|
|
629
751
|
},
|
|
630
752
|
e(t)
|
|
631
753
|
), r.children[r.children.length - 1];
|
|
632
|
-
},
|
|
754
|
+
}, er = ({ $tag$: e, $attrs$: t, $children$: r, $text$: s }) => {
|
|
633
755
|
const n = document.createElement("div");
|
|
634
|
-
return
|
|
635
|
-
|
|
756
|
+
return Ie(n, e, t, r, s), Tt(n.innerHTML, {
|
|
757
|
+
tag_wrap: 40,
|
|
758
|
+
content_wrap: 120
|
|
759
|
+
}).replace(/="true"/g, "");
|
|
760
|
+
}, J = (e, t) => {
|
|
636
761
|
if (!t)
|
|
637
762
|
return;
|
|
638
763
|
const r = t.split("/");
|
|
639
764
|
return `${e}${r.slice(2, r.length - 1).join("-")}--docs`;
|
|
640
765
|
};
|
|
641
|
-
var
|
|
642
|
-
class
|
|
766
|
+
var k, X;
|
|
767
|
+
class tr {
|
|
643
768
|
constructor(t) {
|
|
644
769
|
/**
|
|
645
770
|
* JsonDocs
|
|
646
771
|
*/
|
|
647
|
-
|
|
772
|
+
$(this, "jsonDoc");
|
|
648
773
|
/**
|
|
649
774
|
* Get component data from the jsonDoc
|
|
650
775
|
* @param tagName - tag name we want to get the data from
|
|
651
776
|
* @returns component data
|
|
652
777
|
*/
|
|
653
|
-
|
|
778
|
+
j(this, k, (t) => this.jsonDoc.components.find((r) => r.tag === t));
|
|
654
779
|
/**
|
|
655
780
|
* Get the control for the given prop
|
|
656
781
|
* Based on https://storybook.js.org/docs/api/arg-types#controltype
|
|
657
782
|
* @param prop - prop to get control for
|
|
658
783
|
* @returns control type and options if applicable
|
|
659
784
|
*/
|
|
660
|
-
|
|
785
|
+
j(this, X, (t) => {
|
|
661
786
|
const r = t.type.replace(/"([^"]+)"/g, "$1").replace(/\s/g, "").replace(/\(.*?\)/g, (s) => s.replace(/\|/g, " OR ")).split("|").map((s) => s.trim().replace(/ OR /g, "|"));
|
|
662
787
|
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" } } : r.length > 1 ? r.includes("string") ? { control: { type: "text" } } : r.every((s) => s == null ? void 0 : s.includes("[]")) ? { control: { type: "object" } } : (r.unshift(void 0), { control: { type: "select" }, options: r }) : { control: { type: "object" } };
|
|
663
788
|
});
|
|
@@ -666,57 +791,57 @@ class Ut {
|
|
|
666
791
|
* @param tagName - tag name we want to extract the arg types from
|
|
667
792
|
* @returns component arg types
|
|
668
793
|
*/
|
|
669
|
-
|
|
670
|
-
const r =
|
|
671
|
-
const { control:
|
|
794
|
+
$(this, "extractArgTypes", (t) => {
|
|
795
|
+
const r = v(this, k).call(this, t), s = r == null ? void 0 : r.props.reduce((p, o) => {
|
|
796
|
+
const { control: g, options: u } = v(this, X).call(this, o);
|
|
672
797
|
return {
|
|
673
|
-
...
|
|
674
|
-
[
|
|
675
|
-
name:
|
|
676
|
-
description:
|
|
677
|
-
type: { required:
|
|
798
|
+
...p,
|
|
799
|
+
[o.name]: {
|
|
800
|
+
name: o.attr || o.name,
|
|
801
|
+
description: o.docs,
|
|
802
|
+
type: { required: o.required },
|
|
678
803
|
table: {
|
|
679
804
|
category: "props",
|
|
680
|
-
type: { summary:
|
|
681
|
-
defaultValue: { summary:
|
|
805
|
+
type: { summary: o.type },
|
|
806
|
+
defaultValue: { summary: o.default }
|
|
682
807
|
},
|
|
683
|
-
control:
|
|
808
|
+
control: g,
|
|
684
809
|
options: u
|
|
685
810
|
}
|
|
686
811
|
};
|
|
687
812
|
}, {}), n = r == null ? void 0 : r.events.reduce(
|
|
688
|
-
(
|
|
689
|
-
...
|
|
690
|
-
[
|
|
691
|
-
name:
|
|
692
|
-
description:
|
|
813
|
+
(p, o) => ({
|
|
814
|
+
...p,
|
|
815
|
+
[o.event]: {
|
|
816
|
+
name: o.event,
|
|
817
|
+
description: o.docs,
|
|
693
818
|
table: {
|
|
694
819
|
category: "events",
|
|
695
|
-
type: { summary:
|
|
820
|
+
type: { summary: o.detail }
|
|
696
821
|
}
|
|
697
822
|
}
|
|
698
823
|
}),
|
|
699
824
|
{}
|
|
700
825
|
), i = r == null ? void 0 : r.methods.reduce(
|
|
701
|
-
(
|
|
702
|
-
...
|
|
703
|
-
[
|
|
704
|
-
name:
|
|
705
|
-
description:
|
|
826
|
+
(p, o) => ({
|
|
827
|
+
...p,
|
|
828
|
+
[o.name]: {
|
|
829
|
+
name: o.name,
|
|
830
|
+
description: o.docs,
|
|
706
831
|
table: {
|
|
707
832
|
category: "methods",
|
|
708
|
-
type: { summary:
|
|
833
|
+
type: { summary: o.signature }
|
|
709
834
|
}
|
|
710
835
|
}
|
|
711
836
|
}),
|
|
712
837
|
{}
|
|
713
|
-
),
|
|
714
|
-
(
|
|
715
|
-
...
|
|
716
|
-
[
|
|
717
|
-
name:
|
|
838
|
+
), a = r == null ? void 0 : r.slots.reduce(
|
|
839
|
+
(p, o) => ({
|
|
840
|
+
...p,
|
|
841
|
+
[o.name]: {
|
|
842
|
+
name: o.name !== "" ? o.name : "default",
|
|
718
843
|
// default slot are unnamed
|
|
719
|
-
description:
|
|
844
|
+
description: o.docs,
|
|
720
845
|
table: {
|
|
721
846
|
category: "slots",
|
|
722
847
|
type: { summary: void 0 }
|
|
@@ -724,12 +849,12 @@ class Ut {
|
|
|
724
849
|
}
|
|
725
850
|
}),
|
|
726
851
|
{}
|
|
727
|
-
),
|
|
728
|
-
(
|
|
729
|
-
...
|
|
730
|
-
[
|
|
731
|
-
name:
|
|
732
|
-
description:
|
|
852
|
+
), c = r == null ? void 0 : r.styles.reduce(
|
|
853
|
+
(p, o) => ({
|
|
854
|
+
...p,
|
|
855
|
+
[o.name]: {
|
|
856
|
+
name: o.name,
|
|
857
|
+
description: o.docs,
|
|
733
858
|
table: {
|
|
734
859
|
category: "custom properties",
|
|
735
860
|
type: { summary: void 0 }
|
|
@@ -737,41 +862,41 @@ class Ut {
|
|
|
737
862
|
}
|
|
738
863
|
}),
|
|
739
864
|
{}
|
|
740
|
-
), l = r == null ? void 0 : r.dependencies.reduce((
|
|
741
|
-
const
|
|
742
|
-
return
|
|
743
|
-
...
|
|
744
|
-
[
|
|
745
|
-
name:
|
|
746
|
-
description: `<a href="./?path=/docs/${
|
|
865
|
+
), l = r == null ? void 0 : r.dependencies.reduce((p, o) => {
|
|
866
|
+
const g = v(this, k).call(this, o);
|
|
867
|
+
return g ? {
|
|
868
|
+
...p,
|
|
869
|
+
[o]: {
|
|
870
|
+
name: o,
|
|
871
|
+
description: `<a href="./?path=/docs/${J("", g == null ? void 0 : g.filePath)}">View Component Documentation</a>`,
|
|
747
872
|
table: {
|
|
748
873
|
category: "depends on",
|
|
749
874
|
type: { summary: void 0 }
|
|
750
875
|
}
|
|
751
876
|
}
|
|
752
|
-
} :
|
|
753
|
-
}, {}),
|
|
754
|
-
const
|
|
755
|
-
return
|
|
756
|
-
...
|
|
757
|
-
[
|
|
758
|
-
name:
|
|
759
|
-
description: `<a href="./?path=/docs/${
|
|
877
|
+
} : p;
|
|
878
|
+
}, {}), f = r == null ? void 0 : r.dependents.reduce((p, o) => {
|
|
879
|
+
const g = v(this, k).call(this, o);
|
|
880
|
+
return g ? {
|
|
881
|
+
...p,
|
|
882
|
+
[o]: {
|
|
883
|
+
name: o,
|
|
884
|
+
description: `<a href="./?path=/docs/${J("", g == null ? void 0 : g.filePath)}">View Component Documentation</a>`,
|
|
760
885
|
table: {
|
|
761
886
|
category: "used by",
|
|
762
887
|
type: { summary: void 0 }
|
|
763
888
|
}
|
|
764
889
|
}
|
|
765
|
-
} :
|
|
890
|
+
} : p;
|
|
766
891
|
}, {});
|
|
767
892
|
return {
|
|
768
893
|
...s,
|
|
769
894
|
...n,
|
|
770
895
|
...i,
|
|
771
|
-
...
|
|
772
|
-
...
|
|
896
|
+
...a,
|
|
897
|
+
...c,
|
|
773
898
|
...l,
|
|
774
|
-
...
|
|
899
|
+
...f
|
|
775
900
|
};
|
|
776
901
|
});
|
|
777
902
|
/**
|
|
@@ -779,18 +904,18 @@ class Ut {
|
|
|
779
904
|
* @param tagName - tag name we want to extract the description from
|
|
780
905
|
* @returns component description
|
|
781
906
|
*/
|
|
782
|
-
|
|
783
|
-
const r =
|
|
907
|
+
$(this, "extractComponentDescription", (t) => {
|
|
908
|
+
const r = v(this, k).call(this, t);
|
|
784
909
|
return (r == null ? void 0 : r.readme) || (r == null ? void 0 : r.docs);
|
|
785
910
|
});
|
|
786
911
|
this.jsonDoc = t;
|
|
787
912
|
}
|
|
788
913
|
}
|
|
789
|
-
|
|
790
|
-
const
|
|
914
|
+
k = new WeakMap(), X = new WeakMap();
|
|
915
|
+
const Rt = (e, t) => {
|
|
791
916
|
if (t)
|
|
792
917
|
return `${e}${t}`;
|
|
793
|
-
},
|
|
918
|
+
}, Le = (e) => {
|
|
794
919
|
let t = e.overview ? `${e.overview}
|
|
795
920
|
|
|
796
921
|
` : "";
|
|
@@ -816,9 +941,9 @@ const bt = (e, t) => {
|
|
|
816
941
|
`, t += e.slots.map(({ name: n, docs: i }) => `- \`${n}\`: ${i}
|
|
817
942
|
`).join(""), t += `
|
|
818
943
|
`), t;
|
|
819
|
-
},
|
|
944
|
+
}, ne = (e) => `${e.docs}
|
|
820
945
|
|
|
821
|
-
Type: \`${e.type}\``,
|
|
946
|
+
Type: \`${e.type}\``, rr = (e, t, r, s) => ({
|
|
822
947
|
$schema: "https://json.schemastore.org/web-types",
|
|
823
948
|
name: e,
|
|
824
949
|
version: t,
|
|
@@ -826,64 +951,64 @@ Type: \`${e.type}\``, Dt = (e, t, r, s) => ({
|
|
|
826
951
|
contributions: {
|
|
827
952
|
html: {
|
|
828
953
|
elements: r.components.map((n) => {
|
|
829
|
-
const i =
|
|
954
|
+
const i = J(s, n.filePath);
|
|
830
955
|
return {
|
|
831
956
|
name: n.tag,
|
|
832
|
-
description:
|
|
957
|
+
description: Le(n),
|
|
833
958
|
"doc-url": i,
|
|
834
|
-
attributes: n.props.filter((
|
|
835
|
-
name:
|
|
836
|
-
description:
|
|
959
|
+
attributes: n.props.filter((a) => a.attr).map((a) => ({
|
|
960
|
+
name: a.attr,
|
|
961
|
+
description: ne(a),
|
|
837
962
|
"doc-url": i,
|
|
838
963
|
value: {
|
|
839
|
-
type:
|
|
840
|
-
default:
|
|
841
|
-
required:
|
|
964
|
+
type: a.type,
|
|
965
|
+
default: a.default,
|
|
966
|
+
required: a.required
|
|
842
967
|
}
|
|
843
968
|
})),
|
|
844
969
|
js: {
|
|
845
|
-
properties: n.props.map((
|
|
846
|
-
name:
|
|
847
|
-
description:
|
|
970
|
+
properties: n.props.map((a) => ({
|
|
971
|
+
name: a.name,
|
|
972
|
+
description: ne(a),
|
|
848
973
|
"doc-url": i,
|
|
849
974
|
value: {
|
|
850
|
-
type:
|
|
851
|
-
default:
|
|
852
|
-
required:
|
|
975
|
+
type: a.type,
|
|
976
|
+
default: a.default,
|
|
977
|
+
required: a.required
|
|
853
978
|
}
|
|
854
979
|
})),
|
|
855
|
-
events: n.events.map((
|
|
856
|
-
name:
|
|
857
|
-
description:
|
|
980
|
+
events: n.events.map((a) => ({
|
|
981
|
+
name: a.event,
|
|
982
|
+
description: a.docs
|
|
858
983
|
}))
|
|
859
984
|
},
|
|
860
985
|
css: {
|
|
861
|
-
properties: n.styles.map((
|
|
862
|
-
name:
|
|
863
|
-
description:
|
|
986
|
+
properties: n.styles.map((a) => ({
|
|
987
|
+
name: a.name,
|
|
988
|
+
description: a.docs
|
|
864
989
|
}))
|
|
865
990
|
}
|
|
866
991
|
};
|
|
867
992
|
})
|
|
868
993
|
}
|
|
869
994
|
}
|
|
870
|
-
}),
|
|
871
|
-
{ name: "Storybook", url:
|
|
872
|
-
{ name: "Sources", url:
|
|
873
|
-
],
|
|
995
|
+
}), Nt = (e, t, r) => [
|
|
996
|
+
{ name: "Storybook", url: J(e, r) },
|
|
997
|
+
{ name: "Sources", url: Rt(t, r) }
|
|
998
|
+
], zt = (e) => {
|
|
874
999
|
if (!e.values.some(({ value: t }) => t === void 0))
|
|
875
1000
|
return e.values.map(({ value: t }) => ({ name: t }));
|
|
876
|
-
},
|
|
1001
|
+
}, sr = (e, t, r) => ({
|
|
877
1002
|
version: 1.1,
|
|
878
1003
|
tags: e.components.map((s) => {
|
|
879
|
-
const n =
|
|
1004
|
+
const n = Nt(t, r, s.filePath);
|
|
880
1005
|
return {
|
|
881
1006
|
name: s.tag,
|
|
882
|
-
description:
|
|
1007
|
+
description: Le(s),
|
|
883
1008
|
attributes: s.props.map((i) => ({
|
|
884
1009
|
name: i.attr || i.name,
|
|
885
|
-
description:
|
|
886
|
-
values:
|
|
1010
|
+
description: ne(i),
|
|
1011
|
+
values: zt(i),
|
|
887
1012
|
references: n
|
|
888
1013
|
})),
|
|
889
1014
|
references: n
|
|
@@ -891,7 +1016,7 @@ Type: \`${e.type}\``, Dt = (e, t, r, s) => ({
|
|
|
891
1016
|
}),
|
|
892
1017
|
globalAttributes: [],
|
|
893
1018
|
valueSets: []
|
|
894
|
-
}),
|
|
1019
|
+
}), nr = (e) => ({
|
|
895
1020
|
version: 1.1,
|
|
896
1021
|
properties: e.components.flatMap(
|
|
897
1022
|
(t) => t.styles.map((r) => ({
|
|
@@ -899,47 +1024,47 @@ Type: \`${e.type}\``, Dt = (e, t, r, s) => ({
|
|
|
899
1024
|
description: r.docs
|
|
900
1025
|
}))
|
|
901
1026
|
)
|
|
902
|
-
}),
|
|
1027
|
+
}), ir = (e) => {
|
|
903
1028
|
const t = { value: "2023", pattern: "yyyy" }, r = { value: "12", pattern: "mm" }, s = { value: "24", pattern: "dd" };
|
|
904
|
-
return
|
|
905
|
-
},
|
|
906
|
-
const s = e.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(s == null ? void 0 : s.lang), i = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || r,
|
|
1029
|
+
return Ft([t.value, r.value, s.value].join("-"), e, { timeZone: "UTC" }).replace(t.value, t.pattern).replace(r.value, r.pattern).replace(s.value, s.pattern);
|
|
1030
|
+
}, ar = (e) => e.toISOString().split("T")[0], It = (e, t, r) => {
|
|
1031
|
+
const s = e.closest("[lang]"), n = Intl.NumberFormat.supportedLocalesOf(s == null ? void 0 : s.lang), i = n.length > 0 && typeof n[0] == "string" ? n[0] : navigator.language || r, a = i.split("-").shift();
|
|
907
1032
|
return Object.keys(t).length === 0 ? {
|
|
908
1033
|
locale: i,
|
|
909
1034
|
messages: { lang: r }
|
|
910
1035
|
} : {
|
|
911
1036
|
locale: i,
|
|
912
|
-
messages: t[
|
|
1037
|
+
messages: t[a] || t[r] || { lang: r }
|
|
913
1038
|
};
|
|
914
|
-
},
|
|
1039
|
+
}, or = (e, t, r) => new Intl.NumberFormat(t, { style: "currency", currency: r }).format(e), lr = (e, t, r = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: r }).format(Number(e)), cr = (e, t, r = 0) => new Intl.NumberFormat(t, {
|
|
915
1040
|
style: "percent",
|
|
916
1041
|
minimumFractionDigits: r,
|
|
917
1042
|
maximumFractionDigits: r
|
|
918
|
-
}).format(e),
|
|
1043
|
+
}).format(e), fr = (e, t, r, s = "short", n = 0) => new Intl.NumberFormat(t, {
|
|
919
1044
|
style: "unit",
|
|
920
1045
|
unit: r,
|
|
921
1046
|
unitDisplay: s,
|
|
922
1047
|
minimumFractionDigits: n,
|
|
923
1048
|
maximumFractionDigits: n
|
|
924
|
-
}).format(e),
|
|
1049
|
+
}).format(e), Lt = /^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/, Ft = (e, t, r) => typeof e != "string" || e === "" || !Lt.test(e) ? "" : new Intl.DateTimeFormat(t, r).format(new Date(e)), ur = (e, t) => (r) => It(r, e, t), pr = ({ disconnect: e, observe: t, takeRecords: r }) => {
|
|
925
1050
|
class s {
|
|
926
1051
|
constructor(i) {
|
|
927
1052
|
/**
|
|
928
1053
|
*
|
|
929
1054
|
*/
|
|
930
|
-
|
|
1055
|
+
$(this, "disconnect", e);
|
|
931
1056
|
/**
|
|
932
1057
|
*
|
|
933
1058
|
*/
|
|
934
|
-
|
|
1059
|
+
$(this, "observe", t);
|
|
935
1060
|
/**
|
|
936
1061
|
*
|
|
937
1062
|
*/
|
|
938
|
-
|
|
1063
|
+
$(this, "takeRecords", r);
|
|
939
1064
|
/**
|
|
940
1065
|
*
|
|
941
1066
|
*/
|
|
942
|
-
|
|
1067
|
+
$(this, "cb");
|
|
943
1068
|
this.cb = i;
|
|
944
1069
|
}
|
|
945
1070
|
}
|
|
@@ -950,25 +1075,25 @@ Type: \`${e.type}\``, Dt = (e, t, r, s) => ({
|
|
|
950
1075
|
value: s
|
|
951
1076
|
});
|
|
952
1077
|
}), s;
|
|
953
|
-
},
|
|
1078
|
+
}, gr = ({ disconnect: e, observe: t }) => {
|
|
954
1079
|
class r {
|
|
955
1080
|
constructor(n) {
|
|
956
1081
|
/**
|
|
957
1082
|
*
|
|
958
1083
|
*/
|
|
959
|
-
|
|
1084
|
+
$(this, "disconnect", e);
|
|
960
1085
|
/**
|
|
961
1086
|
*
|
|
962
1087
|
*/
|
|
963
|
-
|
|
1088
|
+
$(this, "observe", t);
|
|
964
1089
|
/**
|
|
965
1090
|
*
|
|
966
1091
|
*/
|
|
967
|
-
|
|
1092
|
+
$(this, "unobserve");
|
|
968
1093
|
/**
|
|
969
1094
|
*
|
|
970
1095
|
*/
|
|
971
|
-
|
|
1096
|
+
$(this, "cb");
|
|
972
1097
|
this.cb = n;
|
|
973
1098
|
}
|
|
974
1099
|
}
|
|
@@ -980,18 +1105,18 @@ Type: \`${e.type}\``, Dt = (e, t, r, s) => ({
|
|
|
980
1105
|
});
|
|
981
1106
|
}), r;
|
|
982
1107
|
};
|
|
983
|
-
class
|
|
1108
|
+
class Mt extends Event {
|
|
984
1109
|
constructor() {
|
|
985
1110
|
super(...arguments);
|
|
986
1111
|
/**
|
|
987
1112
|
*
|
|
988
1113
|
*/
|
|
989
|
-
|
|
1114
|
+
$(this, "detail");
|
|
990
1115
|
}
|
|
991
1116
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
992
1117
|
}
|
|
993
|
-
const
|
|
994
|
-
class e extends
|
|
1118
|
+
const $r = () => {
|
|
1119
|
+
class e extends Mt {
|
|
995
1120
|
}
|
|
996
1121
|
return [window, global].forEach((t) => {
|
|
997
1122
|
Object.defineProperty(t, "SubmitEvent", {
|
|
@@ -1000,7 +1125,7 @@ const Qt = () => {
|
|
|
1000
1125
|
value: e
|
|
1001
1126
|
});
|
|
1002
1127
|
}), e;
|
|
1003
|
-
},
|
|
1128
|
+
}, dr = (e) => {
|
|
1004
1129
|
const t = (r) => (setTimeout(r, 1), e(), 0);
|
|
1005
1130
|
return [window, global].forEach((r) => {
|
|
1006
1131
|
Object.defineProperty(r, "requestAnimationFrame", {
|
|
@@ -1011,39 +1136,44 @@ const Qt = () => {
|
|
|
1011
1136
|
}), t;
|
|
1012
1137
|
};
|
|
1013
1138
|
export {
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1139
|
+
Zt as ClassList,
|
|
1140
|
+
Kt as Cursor,
|
|
1141
|
+
He as Page,
|
|
1142
|
+
Yt as Paginate,
|
|
1143
|
+
tr as StorybookPreview,
|
|
1144
|
+
Dt as allItemsAreString,
|
|
1145
|
+
Jt as cleanString,
|
|
1146
|
+
Pt as createID,
|
|
1147
|
+
Lt as dateRegExp,
|
|
1148
|
+
ar as dateToString,
|
|
1149
|
+
ur as defineLocales,
|
|
1150
|
+
Qt as filterArgs,
|
|
1151
|
+
Ht as focusableElements,
|
|
1152
|
+
ir as getLocaleDatePattern,
|
|
1153
|
+
qe as getObjectValueFromKey,
|
|
1154
|
+
_e as getParentWindows,
|
|
1155
|
+
er as getStoryHTML,
|
|
1156
|
+
J as getStorybookUrl,
|
|
1157
|
+
Bt as getWindows,
|
|
1158
|
+
ie as isObject,
|
|
1159
|
+
qt as isTagName,
|
|
1160
|
+
Wt as isValidNumber,
|
|
1161
|
+
De as isValidString,
|
|
1162
|
+
Ut as isValideID,
|
|
1163
|
+
or as localeCurrency,
|
|
1164
|
+
Ft as localeDate,
|
|
1165
|
+
lr as localeNumber,
|
|
1166
|
+
cr as localePercent,
|
|
1167
|
+
fr as localeUnit,
|
|
1168
|
+
Xt as nextTick,
|
|
1169
|
+
dr as setUpRequestAnimationFrameMock,
|
|
1170
|
+
pr as setupMutationObserverMock,
|
|
1171
|
+
gr as setupResizeObserverMock,
|
|
1172
|
+
$r as setupSubmitEventMock,
|
|
1173
|
+
Vt as stencilWrapper,
|
|
1174
|
+
Gt as toString,
|
|
1175
|
+
nr as vsCodeCssGenerator,
|
|
1176
|
+
sr as vsCodeGenerator,
|
|
1177
|
+
rr as webTypesGenerator
|
|
1048
1178
|
};
|
|
1049
1179
|
//# sourceMappingURL=index.es.js.map
|