wrec 0.18.0 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wrec.es.js +152 -141
- package/dist/wrec.js +19 -27
- package/dist/wrec.js.map +1 -1
- package/dist/wrec.min.js +1 -1
- package/dist/wrec.umd.js +2 -2
- package/package.json +1 -1
package/dist/wrec.es.js
CHANGED
|
@@ -1,83 +1,89 @@
|
|
|
1
|
-
function M(
|
|
2
|
-
let e =
|
|
1
|
+
function M(n, t) {
|
|
2
|
+
let e = n;
|
|
3
3
|
for (const s of t.split("."))
|
|
4
4
|
e = e[s];
|
|
5
5
|
return e;
|
|
6
6
|
}
|
|
7
|
-
function H(
|
|
7
|
+
function H(n, t, e) {
|
|
8
8
|
const s = t.split("."), o = s.length - 1;
|
|
9
|
-
let i =
|
|
10
|
-
s.forEach((
|
|
11
|
-
h === o ? i[
|
|
9
|
+
let i = n;
|
|
10
|
+
s.forEach((r, h) => {
|
|
11
|
+
h === o ? i[r] = e : i = i[r];
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
class m extends Error {
|
|
15
15
|
}
|
|
16
|
-
const O = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, P = "a-zA-Z_$", F = P + "0-9", b = `[${P}][${F}]*`, j = /<!--\s*(.*?)\s*-->/, V = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, A = new RegExp(`^this\\.${b}$`), E = new RegExp(`this\\.${b}(\\.${b})*`, "g"),
|
|
17
|
-
function I(
|
|
18
|
-
return
|
|
16
|
+
const O = /([a-zA-Z-]+)\s*:\s*([^;}]+)/g, P = "a-zA-Z_$", F = P + "0-9", b = `[${P}][${F}]*`, j = /<!--\s*(.*?)\s*-->/, V = /<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g, A = new RegExp(`^this\\.${b}$`), E = new RegExp(`this\\.${b}(\\.${b})*`, "g"), $ = new RegExp(`this\\.${b}(\\.${b})*`), _ = /* @__PURE__ */ new Set(["class", "style"]), N = 5;
|
|
17
|
+
function I(n) {
|
|
18
|
+
return n instanceof HTMLButtonElement || n instanceof HTMLFieldSetElement || n instanceof HTMLInputElement || n instanceof HTMLSelectElement || n instanceof HTMLTextAreaElement || n instanceof u;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const
|
|
20
|
+
function D(n) {
|
|
21
|
+
const t = new CSSStyleSheet();
|
|
22
|
+
for (const e of Array.from(n.cssRules))
|
|
23
|
+
t.insertRule(e.cssText);
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
function z(n, t, e) {
|
|
27
|
+
const s = document.createElement(n);
|
|
22
28
|
if (t)
|
|
23
29
|
for (const [o, i] of Object.entries(t))
|
|
24
30
|
s.setAttribute(o, i);
|
|
25
31
|
return e && (s.innerHTML = e), s;
|
|
26
32
|
}
|
|
27
|
-
const
|
|
28
|
-
function w(
|
|
33
|
+
const B = (n) => n === String ? "" : n === Number ? 0 : n === Boolean ? !1 : n === Array ? [] : n === Object ? {} : void 0;
|
|
34
|
+
function w(n) {
|
|
29
35
|
const t = [];
|
|
30
|
-
let e =
|
|
36
|
+
let e = n.firstElementChild;
|
|
31
37
|
for (; e; )
|
|
32
38
|
t.push(e), e.shadowRoot && t.push(...w(e.shadowRoot)), e.firstElementChild && t.push(...w(e)), e = e.nextElementSibling;
|
|
33
39
|
return t;
|
|
34
40
|
}
|
|
35
|
-
const g = (
|
|
36
|
-
function x(
|
|
37
|
-
let e =
|
|
41
|
+
const g = (n) => n.substring(N).split(".")[0];
|
|
42
|
+
function x(n, t) {
|
|
43
|
+
let e = n[0];
|
|
38
44
|
return t.forEach((s, o) => {
|
|
39
|
-
e += s +
|
|
45
|
+
e += s + n[o + 1];
|
|
40
46
|
}), e;
|
|
41
47
|
}
|
|
42
|
-
function T(
|
|
43
|
-
const t = typeof
|
|
48
|
+
function T(n) {
|
|
49
|
+
const t = typeof n;
|
|
44
50
|
return t === "string" || t === "number" || t === "boolean";
|
|
45
51
|
}
|
|
46
|
-
function d(
|
|
47
|
-
return
|
|
52
|
+
function d(n) {
|
|
53
|
+
return n.localName === "textarea";
|
|
48
54
|
}
|
|
49
|
-
function R(
|
|
50
|
-
const { localName: t } =
|
|
55
|
+
function R(n) {
|
|
56
|
+
const { localName: t } = n;
|
|
51
57
|
return t === "input" || t === "select";
|
|
52
58
|
}
|
|
53
|
-
const
|
|
54
|
-
function L(
|
|
55
|
-
return
|
|
59
|
+
const q = (n) => n.replace(/<!--[\s\S]*?-->/g, "");
|
|
60
|
+
function L(n, t, e, s) {
|
|
61
|
+
return n.slice(0, t) + s + n.slice(t + e);
|
|
56
62
|
}
|
|
57
|
-
function S(
|
|
58
|
-
const t = Number(
|
|
59
|
-
if (isNaN(t)) throw new m(`can't convert "${
|
|
63
|
+
function S(n) {
|
|
64
|
+
const t = Number(n);
|
|
65
|
+
if (isNaN(t)) throw new m(`can't convert "${n}" to a number`);
|
|
60
66
|
return t;
|
|
61
67
|
}
|
|
62
|
-
function k(
|
|
68
|
+
function k(n, t, e) {
|
|
63
69
|
const [s, o] = t.split(":");
|
|
64
70
|
if (T(e))
|
|
65
71
|
if (typeof e == "boolean") {
|
|
66
|
-
e ?
|
|
72
|
+
e ? n.setAttribute(s, s) : n.removeAttribute(s);
|
|
67
73
|
const i = u.getPropName(s);
|
|
68
|
-
|
|
74
|
+
n[i] = e;
|
|
69
75
|
} else {
|
|
70
|
-
const i =
|
|
71
|
-
i !==
|
|
76
|
+
const i = n.getAttribute(t), r = String(e);
|
|
77
|
+
i !== r && (n.setAttribute(s, r), s === "value" && R(n) && (n.value = r));
|
|
72
78
|
}
|
|
73
79
|
else {
|
|
74
80
|
const i = u.getPropName(t);
|
|
75
|
-
|
|
81
|
+
n[i] = e;
|
|
76
82
|
}
|
|
77
83
|
}
|
|
78
|
-
function C(
|
|
84
|
+
function C(n, t, e) {
|
|
79
85
|
const [s, o] = t.split(":");
|
|
80
|
-
|
|
86
|
+
n instanceof CSSStyleRule ? n.style.setProperty(s, e) : (k(n, s, e), s === "value" && R(n) && (n.value = e));
|
|
81
87
|
}
|
|
82
88
|
class u extends HTMLElement {
|
|
83
89
|
// This is used to lookup the camelCase property name
|
|
@@ -121,7 +127,7 @@ class u extends HTMLElement {
|
|
|
121
127
|
// attribute values, and CSS property values.
|
|
122
128
|
// Each component instance needs its own map.
|
|
123
129
|
#s = /* @__PURE__ */ new Map();
|
|
124
|
-
#
|
|
130
|
+
#a = {};
|
|
125
131
|
#i;
|
|
126
132
|
// For components that set `formAssociated` to true,
|
|
127
133
|
// this stores in the initial value of each property
|
|
@@ -148,24 +154,29 @@ class u extends HTMLElement {
|
|
|
148
154
|
if (this.#r(o)) {
|
|
149
155
|
const i = this.#E(o, String(s));
|
|
150
156
|
this[o] = i;
|
|
151
|
-
const
|
|
152
|
-
|
|
157
|
+
const r = this.#a[o];
|
|
158
|
+
r && this.setFormValue(r, String(i)), this.propertyChangedCallback(o, e, s);
|
|
153
159
|
}
|
|
154
160
|
}
|
|
155
161
|
#w() {
|
|
156
162
|
if (!this.shadowRoot) return;
|
|
157
163
|
const t = this.#t;
|
|
158
164
|
if (t.css) {
|
|
159
|
-
let s = t
|
|
165
|
+
let { stylesheet: s } = t;
|
|
160
166
|
if (!s) {
|
|
161
167
|
s = t.stylesheet = new CSSStyleSheet();
|
|
162
168
|
const o = `:host([hidden]) { display: none; } ${t.css}`;
|
|
163
169
|
s.replaceSync(o);
|
|
164
170
|
}
|
|
165
|
-
this.shadowRoot.adoptedStyleSheets = [s];
|
|
171
|
+
this.shadowRoot.adoptedStyleSheets = [D(s)];
|
|
166
172
|
}
|
|
167
173
|
let e = t.template;
|
|
168
|
-
|
|
174
|
+
if (!e) {
|
|
175
|
+
e = t.template = document.createElement("template");
|
|
176
|
+
const s = t.html.trim();
|
|
177
|
+
e.innerHTML = s.startsWith("<") ? s : `<span><!--${s}--></span>`;
|
|
178
|
+
}
|
|
179
|
+
this.shadowRoot.replaceChildren(e.content.cloneNode(!0));
|
|
169
180
|
}
|
|
170
181
|
changed(t, e, s) {
|
|
171
182
|
this[e] = s;
|
|
@@ -175,7 +186,7 @@ class u extends HTMLElement {
|
|
|
175
186
|
if (this.shadowRoot) {
|
|
176
187
|
this.#C(this.shadowRoot), this.#b(this.shadowRoot);
|
|
177
188
|
for (const t of this.shadowRoot.adoptedStyleSheets)
|
|
178
|
-
this
|
|
189
|
+
this.#N(t);
|
|
179
190
|
}
|
|
180
191
|
this.#T();
|
|
181
192
|
});
|
|
@@ -193,23 +204,23 @@ class u extends HTMLElement {
|
|
|
193
204
|
#v(t, e, s) {
|
|
194
205
|
const o = u.getAttrName(t), i = this.hasAttribute(o);
|
|
195
206
|
e.required && !i && this.#e(this, t, "is a required attribute");
|
|
196
|
-
let
|
|
197
|
-
this.hasOwnProperty(t) && (
|
|
198
|
-
const { type: h } = e,
|
|
199
|
-
this[f] =
|
|
207
|
+
let r = e.value;
|
|
208
|
+
this.hasOwnProperty(t) && (r = this[t], delete this[t]);
|
|
209
|
+
const { type: h } = e, c = h === Boolean ? r || i : s.includes(o) && i ? this.#A(t, o) : r || B(h), f = "#" + t;
|
|
210
|
+
this[f] = c, e.computed && this.#x(t, e), Object.defineProperty(this, t, {
|
|
200
211
|
enumerable: !0,
|
|
201
212
|
get() {
|
|
202
213
|
return this[f];
|
|
203
214
|
},
|
|
204
|
-
set(
|
|
205
|
-
h === Number && typeof
|
|
215
|
+
set(a) {
|
|
216
|
+
h === Number && typeof a == "string" && (a = S(a));
|
|
206
217
|
const l = this[f];
|
|
207
|
-
if (
|
|
208
|
-
this.#j(t, h,
|
|
218
|
+
if (a === l) return;
|
|
219
|
+
this.#j(t, h, a), this[f] = a;
|
|
209
220
|
const { state: p, stateProp: y } = this.#t.properties[t];
|
|
210
|
-
y && H(p, y,
|
|
211
|
-
const v = this.#
|
|
212
|
-
v && this.setFormValue(v, String(
|
|
221
|
+
y && H(p, y, a), this.#k(t), this.#L(t, h, a, o), this.#g(t), this.#H(t, a);
|
|
222
|
+
const v = this.#a[t];
|
|
223
|
+
v && this.setFormValue(v, String(a)), this.propertyChangedCallback(t, l, a), e.dispatch && this.dispatch("change", { [t]: a });
|
|
213
224
|
}
|
|
214
225
|
});
|
|
215
226
|
}
|
|
@@ -245,10 +256,10 @@ class u extends HTMLElement {
|
|
|
245
256
|
for (const s of t.getAttributeNames()) {
|
|
246
257
|
const o = t.getAttribute(s), i = this.#y(t, o);
|
|
247
258
|
if (i) {
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
let [h,
|
|
251
|
-
h === "value" && (
|
|
259
|
+
const r = this[i];
|
|
260
|
+
r === void 0 && this.#c(t, s, i), t[i] = r;
|
|
261
|
+
let [h, c] = s.split(":");
|
|
262
|
+
h === "value" && (c ? (t["on" + c] === void 0 && this.#e(t, s, "refers to an unsupported event name"), t.setAttribute(h, this[i])) : c = "change"), e && t.#l.set(
|
|
252
263
|
u.getPropName(h),
|
|
253
264
|
i
|
|
254
265
|
);
|
|
@@ -264,13 +275,13 @@ class u extends HTMLElement {
|
|
|
264
275
|
const { localName: e } = t;
|
|
265
276
|
if (e === "style") {
|
|
266
277
|
const { sheet: s } = t, o = s?.cssRules ?? [], i = Array.from(o);
|
|
267
|
-
for (const
|
|
268
|
-
if (
|
|
269
|
-
const h = Array.from(
|
|
270
|
-
for (const
|
|
271
|
-
if (
|
|
272
|
-
const f =
|
|
273
|
-
this.#n(f,
|
|
278
|
+
for (const r of i)
|
|
279
|
+
if (r.constructor === CSSStyleRule) {
|
|
280
|
+
const h = Array.from(r.style);
|
|
281
|
+
for (const c of h)
|
|
282
|
+
if (c.startsWith("--")) {
|
|
283
|
+
const f = r.style.getPropertyValue(c);
|
|
284
|
+
this.#n(f, r, c);
|
|
274
285
|
}
|
|
275
286
|
}
|
|
276
287
|
} else {
|
|
@@ -298,24 +309,24 @@ class u extends HTMLElement {
|
|
|
298
309
|
formAssociatedCallback() {
|
|
299
310
|
let t = this.getAttribute("form-assoc");
|
|
300
311
|
if (!t) {
|
|
301
|
-
const
|
|
302
|
-
if (
|
|
312
|
+
const r = this.getAttribute("name");
|
|
313
|
+
if (r)
|
|
303
314
|
if (this.#r("value"))
|
|
304
|
-
t = `value:${
|
|
315
|
+
t = `value:${r}`;
|
|
305
316
|
else
|
|
306
317
|
return;
|
|
307
318
|
else
|
|
308
319
|
return;
|
|
309
320
|
}
|
|
310
321
|
const e = {}, s = t.split(",");
|
|
311
|
-
for (const
|
|
312
|
-
const [h,
|
|
313
|
-
e[h.trim()] =
|
|
322
|
+
for (const r of s) {
|
|
323
|
+
const [h, c] = r.split(":");
|
|
324
|
+
e[h.trim()] = c.trim();
|
|
314
325
|
}
|
|
315
|
-
this.#
|
|
326
|
+
this.#a = e, this.#i = new FormData(), this.#h = this.attachInternals(), this.#h.setFormValue(this.#i);
|
|
316
327
|
const o = Object.keys(this.#t.properties), i = this.#f;
|
|
317
|
-
for (const
|
|
318
|
-
i[
|
|
328
|
+
for (const r of o)
|
|
329
|
+
i[r] = this[r];
|
|
319
330
|
}
|
|
320
331
|
formResetCallback() {
|
|
321
332
|
const t = this.#f;
|
|
@@ -332,17 +343,17 @@ class u extends HTMLElement {
|
|
|
332
343
|
let e = u.#p.get(t);
|
|
333
344
|
return e || (e = t.replace(/-([a-z])/g, (s, o) => o.toUpperCase()), u.#p.set(t, e)), e;
|
|
334
345
|
}
|
|
335
|
-
|
|
346
|
+
#$(t, e, s) {
|
|
336
347
|
if (s.length !== 1) return;
|
|
337
348
|
const [o] = s;
|
|
338
349
|
if (!A.test(o)) return;
|
|
339
350
|
const i = R(t) || d(t);
|
|
340
|
-
let [
|
|
341
|
-
if (!(i &&
|
|
351
|
+
let [r, h] = (e ?? "").split(":");
|
|
352
|
+
if (!(i && r === "value" || d(t))) return;
|
|
342
353
|
h ? t["on" + h] === void 0 && this.#e(t, e, "refers to an unsupported event name") : h = "change";
|
|
343
354
|
const f = g(o);
|
|
344
|
-
t.addEventListener(h, (
|
|
345
|
-
const { target: l } =
|
|
355
|
+
t.addEventListener(h, (a) => {
|
|
356
|
+
const { target: l } = a;
|
|
346
357
|
if (!l) return;
|
|
347
358
|
const p = l.value, { type: y } = this.#t.properties[f];
|
|
348
359
|
this[f] = y === Number ? S(p) : p, this.#g(f);
|
|
@@ -356,8 +367,8 @@ class u extends HTMLElement {
|
|
|
356
367
|
for (const s of e)
|
|
357
368
|
this.#M(s), s.firstElementChild || this.#P(s);
|
|
358
369
|
}
|
|
359
|
-
|
|
360
|
-
const e = t.cssRules
|
|
370
|
+
#N(t) {
|
|
371
|
+
const e = t.cssRules;
|
|
361
372
|
for (const s of Array.from(e))
|
|
362
373
|
if (s instanceof CSSStyleRule) {
|
|
363
374
|
for (const o of Array.from(s.style))
|
|
@@ -377,19 +388,19 @@ class u extends HTMLElement {
|
|
|
377
388
|
#y(t, e) {
|
|
378
389
|
if (!e || !A.test(e)) return;
|
|
379
390
|
const s = g(e);
|
|
380
|
-
return this[s] === void 0 && this.#
|
|
391
|
+
return this[s] === void 0 && this.#c(t, "", s), s;
|
|
381
392
|
}
|
|
382
393
|
#g(t) {
|
|
383
394
|
const o = this.#t.propToExprsMap.get(t) || [];
|
|
384
395
|
for (const i of o) {
|
|
385
|
-
let
|
|
396
|
+
let r = this.#o(i);
|
|
386
397
|
const h = this.#s.get(i) ?? [];
|
|
387
|
-
for (const
|
|
388
|
-
if (
|
|
389
|
-
this.#S(
|
|
390
|
-
else if (!(
|
|
391
|
-
const { element: f, attrName:
|
|
392
|
-
f instanceof CSSStyleRule ? f.style.setProperty(
|
|
398
|
+
for (const c of h)
|
|
399
|
+
if (c instanceof HTMLElement)
|
|
400
|
+
this.#S(c, r);
|
|
401
|
+
else if (!(c instanceof CSSStyleRule)) {
|
|
402
|
+
const { element: f, attrName: a } = c;
|
|
403
|
+
f instanceof CSSStyleRule ? f.style.setProperty(a, r) : C(f, a, r);
|
|
393
404
|
}
|
|
394
405
|
}
|
|
395
406
|
}
|
|
@@ -399,18 +410,18 @@ class u extends HTMLElement {
|
|
|
399
410
|
}
|
|
400
411
|
#x(t, e) {
|
|
401
412
|
const { computed: s, uses: o } = e, i = this.#t.propToComputedMap;
|
|
402
|
-
function
|
|
403
|
-
let
|
|
404
|
-
|
|
413
|
+
function r(c, f) {
|
|
414
|
+
let a = i.get(c);
|
|
415
|
+
a || (a = [], i.set(c, a)), a.push([t, f]);
|
|
405
416
|
}
|
|
406
417
|
const h = s.match(E) || [];
|
|
407
|
-
for (const
|
|
408
|
-
const f =
|
|
409
|
-
this[f] === void 0 && this.#
|
|
418
|
+
for (const c of h) {
|
|
419
|
+
const f = c.substring(N);
|
|
420
|
+
this[f] === void 0 && this.#c(null, t, f), typeof this[f] != "function" && r(f, s);
|
|
410
421
|
}
|
|
411
422
|
if (o)
|
|
412
|
-
for (const
|
|
413
|
-
|
|
423
|
+
for (const c of o.split(","))
|
|
424
|
+
r(c, s);
|
|
414
425
|
}
|
|
415
426
|
// WARNING: Do not place untrusted JavaScript expressions
|
|
416
427
|
// in attribute values or the text content of elements!
|
|
@@ -418,28 +429,28 @@ class u extends HTMLElement {
|
|
|
418
429
|
if (!t) return;
|
|
419
430
|
const o = this.#u(e, s, t);
|
|
420
431
|
if (!o) {
|
|
421
|
-
const
|
|
422
|
-
s ? C(e, s,
|
|
432
|
+
const c = t.replaceAll("this..", "this.");
|
|
433
|
+
s ? C(e, s, c) : "textContent" in e && (e.textContent = c);
|
|
423
434
|
return;
|
|
424
435
|
}
|
|
425
436
|
const i = this.#t;
|
|
426
|
-
o.forEach((
|
|
427
|
-
const f = g(
|
|
437
|
+
o.forEach((c) => {
|
|
438
|
+
const f = g(c);
|
|
428
439
|
if (typeof this[f] == "function") return;
|
|
429
|
-
const
|
|
430
|
-
let l =
|
|
431
|
-
l || (l = [],
|
|
440
|
+
const a = i.propToExprsMap;
|
|
441
|
+
let l = a.get(f);
|
|
442
|
+
l || (l = [], a.set(f, l)), l.includes(t) || l.push(t);
|
|
432
443
|
});
|
|
433
|
-
for (const [
|
|
434
|
-
for (const
|
|
435
|
-
const l =
|
|
444
|
+
for (const [c, f] of this.#s.entries())
|
|
445
|
+
for (const a of f) {
|
|
446
|
+
const l = a instanceof HTMLElement || a instanceof CSSStyleRule ? a : a.element;
|
|
436
447
|
l instanceof CSSStyleRule || l.isConnected || this.#s.set(
|
|
437
|
-
|
|
438
|
-
f.filter((p) => p !==
|
|
448
|
+
c,
|
|
449
|
+
f.filter((p) => p !== a)
|
|
439
450
|
);
|
|
440
451
|
}
|
|
441
|
-
let
|
|
442
|
-
|
|
452
|
+
let r = this.#s.get(t);
|
|
453
|
+
r || (r = [], this.#s.set(t, r)), r.push(s ? { element: e, attrName: s } : e), e instanceof HTMLElement && this.#$(e, s, o);
|
|
443
454
|
const h = this.#o(t);
|
|
444
455
|
s ? C(e, s, h) : this.#S(e, h);
|
|
445
456
|
}
|
|
@@ -457,7 +468,7 @@ class u extends HTMLElement {
|
|
|
457
468
|
`component ${o.elementName()}` + (t ? `, element "${i}"` : "") + (e ? `, attribute "${e}"` : "") + ` ${s}`
|
|
458
469
|
);
|
|
459
470
|
}
|
|
460
|
-
#
|
|
471
|
+
#c(t, e, s) {
|
|
461
472
|
this.#e(t, e, `refers to missing property "${s}"`);
|
|
462
473
|
}
|
|
463
474
|
#A(t, e) {
|
|
@@ -508,8 +519,8 @@ class u extends HTMLElement {
|
|
|
508
519
|
if (!(o instanceof ShadowRoot)) return;
|
|
509
520
|
const { host: i } = o;
|
|
510
521
|
if (!i) return;
|
|
511
|
-
const
|
|
512
|
-
|
|
522
|
+
const r = i;
|
|
523
|
+
r[s] = e;
|
|
513
524
|
}
|
|
514
525
|
/**
|
|
515
526
|
* @param state - WrecState object
|
|
@@ -527,8 +538,8 @@ class u extends HTMLElement {
|
|
|
527
538
|
if (this.#r(o)) {
|
|
528
539
|
const i = M(t, s);
|
|
529
540
|
i !== void 0 && (this[o] = i);
|
|
530
|
-
const
|
|
531
|
-
|
|
541
|
+
const r = this.#t.properties[o];
|
|
542
|
+
r.state = t, r.stateProp = s;
|
|
532
543
|
}
|
|
533
544
|
t.addListener(this, e);
|
|
534
545
|
}
|
|
@@ -565,8 +576,8 @@ class u extends HTMLElement {
|
|
|
565
576
|
const o = s.match(E);
|
|
566
577
|
if (o)
|
|
567
578
|
return o.forEach((i) => {
|
|
568
|
-
const
|
|
569
|
-
this[
|
|
579
|
+
const r = g(i);
|
|
580
|
+
this[r] === void 0 && this.#c(t, e, r);
|
|
570
581
|
}), o;
|
|
571
582
|
}
|
|
572
583
|
#F(t, e) {
|
|
@@ -604,14 +615,14 @@ class u extends HTMLElement {
|
|
|
604
615
|
for (const s of e) {
|
|
605
616
|
const o = [];
|
|
606
617
|
for (const i of Array.from(s.attributes)) {
|
|
607
|
-
const
|
|
608
|
-
if (
|
|
609
|
-
let h =
|
|
618
|
+
const r = i.name;
|
|
619
|
+
if (r.startsWith("on")) {
|
|
620
|
+
let h = r.slice(2);
|
|
610
621
|
h = h[0].toLowerCase() + h.slice(1).toLowerCase();
|
|
611
|
-
const
|
|
612
|
-
this.#u(s,
|
|
622
|
+
const c = i.value;
|
|
623
|
+
this.#u(s, r, c);
|
|
613
624
|
let f;
|
|
614
|
-
typeof this[
|
|
625
|
+
typeof this[c] == "function" ? f = (a) => this[c](a) : (this.#u(s, r, c), f = () => this.#o(c)), s.addEventListener(h, f), o.push(r);
|
|
615
626
|
}
|
|
616
627
|
}
|
|
617
628
|
for (const i of o)
|
|
@@ -619,39 +630,39 @@ class u extends HTMLElement {
|
|
|
619
630
|
}
|
|
620
631
|
}
|
|
621
632
|
}
|
|
622
|
-
function
|
|
623
|
-
let e = x(
|
|
633
|
+
function Z(n, ...t) {
|
|
634
|
+
let e = x(n, t);
|
|
624
635
|
for (; ; ) {
|
|
625
636
|
const s = O.exec(e);
|
|
626
637
|
if (!s) break;
|
|
627
638
|
const o = s[2];
|
|
628
|
-
if (
|
|
639
|
+
if ($.test(o)) {
|
|
629
640
|
const i = s[1];
|
|
630
641
|
if (!i.startsWith("--")) {
|
|
631
|
-
const
|
|
632
|
-
|
|
633
|
-
e = L(e, s.index, s[0].length,
|
|
642
|
+
const r = `--${i}: ${o};
|
|
643
|
+
${i}: var(--${i})`;
|
|
644
|
+
e = L(e, s.index, s[0].length, r);
|
|
634
645
|
}
|
|
635
646
|
}
|
|
636
647
|
}
|
|
637
648
|
return e;
|
|
638
649
|
}
|
|
639
|
-
function
|
|
640
|
-
let e = x(
|
|
650
|
+
function K(n, ...t) {
|
|
651
|
+
let e = x(n, t);
|
|
641
652
|
for (; ; ) {
|
|
642
653
|
const s = V.exec(e);
|
|
643
654
|
if (!s || s[1] === "style") break;
|
|
644
|
-
const o =
|
|
645
|
-
if (
|
|
646
|
-
const i = `<!-- ${o.trim()} -->`,
|
|
647
|
-
e = L(e,
|
|
655
|
+
const o = q(s[2]);
|
|
656
|
+
if ($.test(o)) {
|
|
657
|
+
const i = `<!-- ${o.trim()} -->`, r = s.index + s[0].indexOf(">") + 1;
|
|
658
|
+
e = L(e, r, o.length, i);
|
|
648
659
|
}
|
|
649
660
|
}
|
|
650
661
|
return e;
|
|
651
662
|
}
|
|
652
663
|
export {
|
|
653
664
|
u as Wrec,
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
665
|
+
z as createElement,
|
|
666
|
+
Z as css,
|
|
667
|
+
K as html
|
|
657
668
|
};
|
package/dist/wrec.js
CHANGED
|
@@ -21,6 +21,13 @@ function canDisable(element) {
|
|
|
21
21
|
element instanceof HTMLTextAreaElement ||
|
|
22
22
|
element instanceof Wrec);
|
|
23
23
|
}
|
|
24
|
+
function cloneStylesheet(original) {
|
|
25
|
+
const clone = new CSSStyleSheet();
|
|
26
|
+
for (const rule of Array.from(original.cssRules)) {
|
|
27
|
+
clone.insertRule(rule.cssText);
|
|
28
|
+
}
|
|
29
|
+
return clone;
|
|
30
|
+
}
|
|
24
31
|
export function createElement(name, attributes, innerHTML) {
|
|
25
32
|
const element = document.createElement(name);
|
|
26
33
|
if (attributes) {
|
|
@@ -61,26 +68,6 @@ function getAllDescendants(root) {
|
|
|
61
68
|
}
|
|
62
69
|
return elements;
|
|
63
70
|
}
|
|
64
|
-
// This differs from document.getElementById
|
|
65
|
-
// in that it searches across open shadow DOMs.
|
|
66
|
-
function getElementById(root, id) {
|
|
67
|
-
if (root.id === id)
|
|
68
|
-
return root;
|
|
69
|
-
const { shadowRoot } = root;
|
|
70
|
-
if (shadowRoot) {
|
|
71
|
-
for (const child of Array.from(shadowRoot.children)) {
|
|
72
|
-
const el = getElementById(child, id);
|
|
73
|
-
if (el)
|
|
74
|
-
return el;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
for (const child of Array.from(root.children)) {
|
|
78
|
-
const el = getElementById(child, id);
|
|
79
|
-
if (el)
|
|
80
|
-
return el;
|
|
81
|
-
}
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
71
|
// This takes a string like "this.foo.bar" and returns "foo".
|
|
85
72
|
const getPropName = (str) => str.substring(SKIP).split('.')[0];
|
|
86
73
|
function interpolate(strings, values) {
|
|
@@ -149,7 +136,7 @@ function updateAttribute(element, attrName, value) {
|
|
|
149
136
|
}
|
|
150
137
|
function updateValue(element, attrName, value) {
|
|
151
138
|
const [realAttrName, _eventName] = attrName.split(':');
|
|
152
|
-
if (element instanceof
|
|
139
|
+
if (element instanceof CSSStyleRule) {
|
|
153
140
|
element.style.setProperty(realAttrName, value); // CSS variable
|
|
154
141
|
}
|
|
155
142
|
else {
|
|
@@ -249,7 +236,7 @@ export class Wrec extends HTMLElement {
|
|
|
249
236
|
return;
|
|
250
237
|
const ctor = this.#ctor;
|
|
251
238
|
if (ctor.css) {
|
|
252
|
-
let stylesheet = ctor
|
|
239
|
+
let { stylesheet } = ctor;
|
|
253
240
|
if (!stylesheet) {
|
|
254
241
|
stylesheet = ctor.stylesheet = new CSSStyleSheet();
|
|
255
242
|
// Include a CSS rule that respects the "hidden" attribute.
|
|
@@ -257,12 +244,17 @@ export class Wrec extends HTMLElement {
|
|
|
257
244
|
const css = `:host([hidden]) { display: none; } ${ctor.css}`;
|
|
258
245
|
stylesheet.replaceSync(css);
|
|
259
246
|
}
|
|
260
|
-
this.shadowRoot.adoptedStyleSheets = [stylesheet];
|
|
247
|
+
this.shadowRoot.adoptedStyleSheets = [cloneStylesheet(stylesheet)];
|
|
261
248
|
}
|
|
262
249
|
let template = ctor.template;
|
|
263
250
|
if (!template) {
|
|
264
251
|
template = ctor.template = document.createElement('template');
|
|
265
|
-
|
|
252
|
+
const html = ctor.html.trim();
|
|
253
|
+
// If the HTML string does not start with <,
|
|
254
|
+
// assume it is a JavaScript expression.
|
|
255
|
+
template.innerHTML = html.startsWith('<')
|
|
256
|
+
? html
|
|
257
|
+
: `<span><!--${html}--></span>`;
|
|
266
258
|
}
|
|
267
259
|
this.shadowRoot.replaceChildren(template.content.cloneNode(true));
|
|
268
260
|
}
|
|
@@ -603,7 +595,7 @@ export class Wrec extends HTMLElement {
|
|
|
603
595
|
this.#evaluateText(element);
|
|
604
596
|
}
|
|
605
597
|
/* These lines are useful for debugging.
|
|
606
|
-
if (this.constructor.name === '
|
|
598
|
+
if (this.constructor.name === 'ColorDemo') {
|
|
607
599
|
console.log('=== this.constructor.name =', this.constructor.name);
|
|
608
600
|
console.log('propToExprsMap =', this.#ctor.propToExprsMap);
|
|
609
601
|
console.log('#exprToRefsMap =', this.#exprToRefsMap);
|
|
@@ -614,7 +606,7 @@ export class Wrec extends HTMLElement {
|
|
|
614
606
|
*/
|
|
615
607
|
}
|
|
616
608
|
#makeReactiveStyleSheet(styleSheet) {
|
|
617
|
-
const rules = styleSheet.cssRules
|
|
609
|
+
const rules = styleSheet.cssRules;
|
|
618
610
|
for (const rule of Array.from(rules)) {
|
|
619
611
|
if (rule instanceof CSSStyleRule) {
|
|
620
612
|
for (const prop of Array.from(rule.style)) {
|
|
@@ -1025,7 +1017,7 @@ export function css(strings, ...values) {
|
|
|
1025
1017
|
const propName = match[1];
|
|
1026
1018
|
if (!propName.startsWith('--')) {
|
|
1027
1019
|
const replacement = `--${propName}: ${propValue};
|
|
1028
|
-
|
|
1020
|
+
${propName}: var(--${propName})`;
|
|
1029
1021
|
result = replace(result, match.index, match[0].length, replacement);
|
|
1030
1022
|
}
|
|
1031
1023
|
}
|
package/dist/wrec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrec.js","sourceRoot":"","sources":["../src/wrec.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,YAAY,EAAE,YAAY,EAAC,MAAM,YAAY,CAAC;AActD,MAAM,SAAU,SAAQ,KAAK;CAAG;AAEhC,MAAM,eAAe,GAAG,8BAA8B,CAAC;AACvD,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,UAAU,GAAG,UAAU,GAAG,KAAK,CAAC;AACtC,MAAM,UAAU,GAAG,IAAI,UAAU,KAAK,UAAU,IAAI,CAAC;AACrD,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAClD,MAAM,oBAAoB,GAAG,gDAAgD,CAAC;AAC9E,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,WAAW,UAAU,GAAG,CAAC,CAAC;AACpD,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,UAAU,UAAU,OAAO,UAAU,IAAI,EAAE,GAAG,CAAC,CAAC;AAC3E,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,UAAU,UAAU,OAAO,UAAU,IAAI,CAAC,CAAC;AAC3E,8CAA8C;AAC9C,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AACnD,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC;AAE5B,SAAS,UAAU,CAAC,OAAgB;IAClC,OAAO,CACL,OAAO,YAAY,iBAAiB;QACpC,OAAO,YAAY,mBAAmB;QACtC,OAAO,YAAY,gBAAgB;QACnC,OAAO,YAAY,iBAAiB;QACpC,OAAO,YAAY,mBAAmB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
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getPathValue,setPathValue}from"./paths.js";class WrecError extends Error{}const CSS_PROPERTY_RE=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,FIRST_CHAR="a-zA-Z_$",OTHER_CHAR="a-zA-Z_$0-9",IDENTIFIER=`[a-zA-Z_$][${OTHER_CHAR}]*`,HTML_COMMENT_TEXT_RE=/<!--\s*(.*?)\s*-->/,HTML_ELEMENT_TEXT_RE=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,REF_RE=new RegExp(`^this\\.${IDENTIFIER}$`),REFS_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`,"g"),REFS_TEST_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`),RESERVED_ATTRS=new Set(["class","style"]),SKIP=5;function canDisable(t){return t instanceof HTMLButtonElement||t instanceof HTMLFieldSetElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof Wrec}export function createElement(t,e,s){const r=document.createElement(t);if(e)for(const[t,s]of Object.entries(e))r.setAttribute(t,s);return s&&(r.innerHTML=s),r}const defaultForType=t=>t===String?"":t===Number?0:t!==Boolean&&(t===Array?[]:t===Object?{}:void 0);function getAllDescendants(t){const e=[];let s=t.firstElementChild;for(;s;)e.push(s),s.shadowRoot&&e.push(...getAllDescendants(s.shadowRoot)),s.firstElementChild&&e.push(...getAllDescendants(s)),s=s.nextElementSibling;return e}function getElementById(t,e){if(t.id===e)return t;const{shadowRoot:s}=t;if(s)for(const t of Array.from(s.children)){const s=getElementById(t,e);if(s)return s}for(const s of Array.from(t.children)){const t=getElementById(s,e);if(t)return t}return null}const getPropName=t=>t.substring(5).split(".")[0];function interpolate(t,e){let s=t[0];return e.forEach((e,r)=>{s+=e+t[r+1]}),s}function isPrimitive(t){const e=typeof t;return"string"===e||"number"===e||"boolean"===e}function isTextArea(t){return"textarea"===t.localName}function isValueElement(t){const{localName:e}=t;return"input"===e||"select"===e}const removeHtmlComments=t=>t.replace(/<!--[\s\S]*?-->/g,"");function replace(t,e,s,r){return t.slice(0,e)+r+t.slice(e+s)}function stringToNumber(t){const e=Number(t);if(isNaN(e))throw new WrecError(`can't convert "${t}" to a number`);return e}function updateAttribute(t,e,s){const[r,o]=e.split(":");if(isPrimitive(s))if("boolean"==typeof s){s?t.setAttribute(r,r):t.removeAttribute(r);t[Wrec.getPropName(r)]=s}else{const o=t.getAttribute(e),i=String(s);o!==i&&(t.setAttribute(r,i),"value"===r&&isValueElement(t)&&(t.value=i))}else{t[Wrec.getPropName(e)]=s}}function updateValue(t,e,s){const[r,o]=e.split(":");t instanceof CSSRule?t.style.setProperty(r,s):(updateAttribute(t,r,s),"value"===r&&isValueElement(t)&&(t.value=s))}export class Wrec extends HTMLElement{static#t=new Map;static#e=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static stylesheet=null;static template=null;#s=this.constructor;#r=new Map;#o={};#i;#n={};#a=null;#c=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#s;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){"disabled"===t&&this.#l();const r=Wrec.getPropName(t);if(this.#p(r)){const t=this.#h(r,String(s));this[r]=t;const o=this.#o[r];o&&this.setFormValue(o,String(t)),this.propertyChangedCallback(r,e,s)}}#u(){if(!this.shadowRoot)return;const t=this.#s;if(t.css){let e=t.stylesheet;if(!e){e=t.stylesheet=new CSSStyleSheet;const s=`:host([hidden]) { display: none; } ${t.css}`;e.replaceSync(s)}this.shadowRoot.adoptedStyleSheets=[e]}let e=t.template;e||(e=t.template=document.createElement("template"),e.innerHTML=t.html),this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#f(),this.#d(),this.#u(),this.hasAttribute("disabled")&&this.#l(),requestAnimationFrame(()=>{if(this.shadowRoot){this.#m(this.shadowRoot),this.#E(this.shadowRoot);for(const t of this.shadowRoot.adoptedStyleSheets)this.#b(t)}this.#y()})}#y(){const t=this.#s,{properties:e}=t;for(const[t,{computed:s}]of Object.entries(e))s&&(this[t]=this.#g(s))}#d(){const t=this.#s,{observedAttributes:e,properties:s}=t;for(const[t,r]of Object.entries(s))this.#R(t,r,e)}#R(t,e,s){const r=Wrec.getAttrName(t),o=this.hasAttribute(r);e.required&&!o&&this.#T(this,t,"is a required attribute");let i=e.value;this.hasOwnProperty(t)&&(i=this[t],delete this[t]);const{type:n}=e,a=n===Boolean?i||o:s.includes(r)&&o?this.#w(t,r):i||defaultForType(n),c="#"+t;this[c]=a,e.computed&&this.#S(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[c]},set(s){n===Number&&"string"==typeof s&&(s=stringToNumber(s));const o=this[c];if(s===o)return;this.#A(t,n,s),this[c]=s;const{state:i,stateProp:a}=this.#s.properties[t];a&&setPathValue(i,a,s),this.#v(t),this.#M(t,n,s,r),this.#P(t),this.#x(t,s);const l=this.#o[t];l&&this.setFormValue(l,String(s)),this.propertyChangedCallback(t,o,s),e.dispatch&&this.dispatch("change",{[t]:s})}})}#l(){const t=this.hasAttribute("disabled"),e=getAllDescendants(this.shadowRoot);for(const s of e)canDisable(s)&&(s.disabled=t)}disconnectedCallback(){this.#r.clear(),this.#n.clear(),this.#c.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#C(t){const e=t instanceof Wrec;for(const s of t.getAttributeNames()){const r=t.getAttribute(s),o=this.#N(t,r);if(o){const r=this[o];void 0===r&&this.#I(t,s,o),t[o]=r;let[i,n]=s.split(":");if("value"===i)if(n){if(void 0===t["on"+n]){const e="refers to an unsupported event name";this.#T(t,s,e)}t.setAttribute(i,this[o])}else n="change";e&&t.#c.set(Wrec.getPropName(i),o)}this.#_(r,t,s)}}#g(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#$(t){const{localName:e}=t;if("style"===e){const{sheet:e}=t,s=e?.cssRules??[],r=Array.from(s);for(const t of r)if(t.constructor===CSSStyleRule){const e=Array.from(t.style);for(const s of e)if(s.startsWith("--")){const e=t.style.getPropertyValue(s);this.#_(e,t,s)}}}else{let e="";if(isTextArea(t)){this.#_(t.textContent,t);const s=t.textContent?.match(HTML_COMMENT_TEXT_RE);s&&(e=s[1])}else{const s=Array.from(t.childNodes).find(t=>t.nodeType===Node.COMMENT_NODE);s&&(e=s.textContent?.trim()??"")}if(e){const s=this.#N(t,e);s&&isTextArea(t)?t.textContent=this[s]:this.#_(e,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const e=this.getAttribute("name");if(!e)return;if(!this.#p("value"))return;t=`value:${e}`}const e={},s=t.split(",");for(const t of s){const[s,r]=t.split(":");e[s.trim()]=r.trim()}this.#o=e,this.#i=new FormData,this.#a=this.attachInternals(),this.#a.setFormValue(this.#i);const r=Object.keys(this.#s.properties),o=this.#n;for(const t of r)o[t]=this[t]}formResetCallback(){const t=this.#n;for(const e of Object.keys(t)){let s=t[e];REF_RE.test(s)&&(s=this.#g(s)),this[e]=s}}static getAttrName(t){let e=Wrec.#e.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wrec.#e.set(t,e)),e}static getPropName(t){let e=Wrec.#t.get(t);return e||(e=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()),Wrec.#t.set(t,e)),e}#O(t,e,s){if(1!==s.length)return;const[r]=s;if(!REF_RE.test(r))return;const o=isValueElement(t)||isTextArea(t);let[i,n]=(e??"").split(":");if(!(o&&"value"===i||isTextArea(t)))return;if(n){if(void 0===t["on"+n]){const s="refers to an unsupported event name";this.#T(t,e,s)}}else n="change";const a=getPropName(r);t.addEventListener(n,t=>{const{target:e}=t;if(!e)return;const s=e.value,{type:r}=this.#s.properties[a];this[a]=r===Number?stringToNumber(s):s,this.#P(a)})}#p(t){return Boolean(this.#s.properties[t])}#E(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e)this.#C(t),t.firstElementChild||this.#$(t)}#b(t){const e=t.cssRules||t.rules;for(const t of Array.from(e))if(t instanceof CSSStyleRule)for(const e of Array.from(t.style))if(e.startsWith("--")){const s=t.style.getPropertyValue(e);this.#_(s,t,e)}}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(Wrec.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#N(t,e){if(!e||!REF_RE.test(e))return;const s=getPropName(e);return void 0===this[s]&&this.#I(t,"",s),s}#P(t){const e=this.#s.propToExprsMap.get(t)||[];for(const t of e){let e=this.#g(t);const s=this.#r.get(t)??[];for(const t of s)if(t instanceof HTMLElement)this.#W(t,e);else if(t instanceof CSSStyleRule);else{const{element:s,attrName:r}=t;s instanceof CSSStyleRule?s.style.setProperty(r,e):updateValue(s,r,e)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#S(t,e){const{computed:s,uses:r}=e,o=this.#s.propToComputedMap;function i(e,s){let r=o.get(e);r||(r=[],o.set(e,r)),r.push([t,s])}const n=s.match(REFS_RE)||[];for(const e of n){const r=e.substring(5);void 0===this[r]&&this.#I(null,t,r),"function"!=typeof this[r]&&i(r,s)}if(r)for(const t of r.split(","))i(t,s)}#_(t,e,s=void 0){if(!t)return;const r=this.#H(e,s,t);if(!r){const r=t.replaceAll("this..","this.");return void(s?updateValue(e,s,r):"textContent"in e&&(e.textContent=r))}const o=this.#s;r.forEach(e=>{const s=getPropName(e);if("function"==typeof this[s])return;const r=o.propToExprsMap;let i=r.get(s);i||(i=[],r.set(s,i)),i.includes(t)||i.push(t)});for(const[t,e]of this.#r.entries())for(const s of e){const r=s instanceof HTMLElement||s instanceof CSSStyleRule?s:s.element;r instanceof CSSStyleRule||(r.isConnected||this.#r.set(t,e.filter(t=>t!==s)))}let i=this.#r.get(t);i||(i=[],this.#r.set(t,i)),i.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#O(e,s,r);const n=this.#g(t);s?updateValue(e,s,n):this.#W(e,n)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){this.#i&&isPrimitive(e)&&(this.#i.set(t,e),this.#a?.setFormValue(this.#i))}#T(t,e,s){const r=this.#s,o=t instanceof HTMLElement?t.localName:"CSS rule";throw new WrecError(`component ${r.elementName()}`+(t?`, element "${o}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#I(t,e,s){this.#T(t,e,`refers to missing property "${s}"`)}#w(t,e){return this.#h(t,this.getAttribute(e))}#h(t,e){if(e?.match(REFS_RE))return e;const s=this.#s,{type:r}=s.properties[t];return r||this.#T(null,t,"does not specify its type"),r===String?e:r===Number?stringToNumber(e):r===Boolean?"true"===e||"false"!==e&&"null"!==e&&(e&&e!==t&&this.#T(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t):void 0}#M(t,e,s,r){if(isPrimitive(s)&&this.hasAttribute(r)){s!==(e===Boolean?this.hasAttribute(r):this.#w(t,r))&&updateAttribute(this,t,s)}}#v(t){const e=this.#s.propToComputedMap.get(t)||[];for(const[t,s]of e)this[t]=this.#g(s)}#W(t,e){if(void 0===e)return;const s=t instanceof HTMLElement,r=typeof e;"string"!==r&&"number"!==r&&this.#T(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&isTextArea(t)?t.value=e:s&&"string"===r&&e.trim().startsWith("<")?(t.innerHTML=e,this.#m(t),this.#E(t)):s&&(t.textContent=e)}#x(t,e){const s=this.#c.get(t);if(!s)return;const r=this.getRootNode();if(!(r instanceof ShadowRoot))return;const{host:o}=r;if(!o)return;o[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#L(t,e);for(const[s,r]of Object.entries(e))if(this.#p(r)){const e=getPathValue(t,s);void 0!==e&&(this[r]=e);const o=this.#s.properties[r];o.state=t,o.stateProp=s}t.addListener(this,e)}#f(){const t=this.#s,e=new Set(Object.keys(t.properties));for(const t of e)RESERVED_ATTRS.has(t)&&this.#T(null,"",`property "${t}" is not allowed because it is a reserved attribute`);const s=this.#s.name;for(const r of this.getAttributeNames())if("class"!==r&&"id"!==r&&"disabled"!==r&&!r.startsWith("on"))if("form-assoc"!==r){if(!e.has(Wrec.getPropName(r))){if("name"===r){if(t.formAssociated)continue;throw new WrecError(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#T(null,r,"is not a supported attribute")}}else if(!t.formAssociated)throw new WrecError(`add "static formAssociated = true;" to class ${s}`)}#H(t,e,s){const r=s.match(REFS_RE);if(r)return r.forEach(s=>{const r=getPropName(s);void 0===this[r]&&this.#I(t,e,r)}),r}#L(t,e){for(const[s,r]of Object.entries(e)){let e=getPathValue(t,s);if(void 0===e)throw new WrecError(`invalid state path "${s}"`);e=this[r],this.#p(r)||this.#T(null,r,"refers to missing property in useState map")}}#A(t,e,s){if(s instanceof e)return;let r=typeof s;if("object"===r){const{constructor:o}=s;r=o.name,o!==e&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}r!==e.name.toLowerCase()&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}#m(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e){const e=[];for(const s of Array.from(t.attributes)){const r=s.name;if(r.startsWith("on")){let o=r.slice(2);o=o[0].toLowerCase()+o.slice(1).toLowerCase();const i=s.value;let n;this.#H(t,r,i),"function"==typeof this[i]?n=t=>this[i](t):(this.#H(t,r,i),n=()=>this.#g(i)),t.addEventListener(o,n),e.push(r)}}for(const s of e)t.removeAttribute(s)}}}export function css(t,...e){let s=interpolate(t,e);for(;;){const t=CSS_PROPERTY_RE.exec(s);if(!t)break;const e=t[2];if(REFS_TEST_RE.test(e)){const r=t[1];if(!r.startsWith("--")){const o=`--${r}: ${e};\n ${r}: var(--${r});`;s=replace(s,t.index,t[0].length,o)}}}return s}export function html(t,...e){let s=interpolate(t,e);for(;;){const t=HTML_ELEMENT_TEXT_RE.exec(s);if(!t||"style"===t[1])break;const e=removeHtmlComments(t[2]);if(REFS_TEST_RE.test(e)){const r=`\x3c!-- ${e.trim()} --\x3e`;s=replace(s,t.index+t[0].indexOf(">")+1,e.length,r)}}return s}import{createDeepProxy,proxyToPlainObject}from"./proxies.js";const inBrowser="undefined"!=typeof window&&void 0!==window.document;class WrecError extends Error{}export class WrecState{static#V=new Map;static{inBrowser&&window.addEventListener("beforeunload",()=>{for(const[t,e]of this.#V.entries())if(e.#F){const s=proxyToPlainObject(e);sessionStorage.setItem("wrec-state-"+t,JSON.stringify(s))}})}static get(t){return this.#V.get(t)}#D=Symbol("objectId");#j=[];#k;#F;#B;constructor(t,e,s){if(!t)throw new WrecError("name cannot be empty");if(WrecState.#V.has(t))throw new WrecError(`WrecState with name "${t}" already exists`);if(this.#k=t,this.#F=e,this.#B=createDeepProxy({},this.#z.bind(this)),e&&inBrowser){const e=sessionStorage.getItem("wrec-state-"+t),r=e?JSON.parse(e):void 0;r&&(s=r)}if(s)for(const[t,e]of Object.entries(s))this.addProperty(t,e);WrecState.#V.set(t,this)}addListener(t,e={}){const s=this.#j.find(e=>e.listenerRef.deref()===t);if(s){const{propertyMap:t}=s;for(const[s,r]of Object.entries(e))t[s]=r}else this.#j.push({listenerRef:new WeakRef(t),propertyMap:e})}addProperty(t,e){Object.defineProperty(this,t,{enumerable:!0,get(){return this.#B[t]},set(e){this.#B[t]=e}}),this.#B[t]=e}get id(){return this.#D}log(){console.log("WrecState:",this.#k);for(const[t,e]of Object.entries(this.#B))console.log(` ${t} = ${JSON.stringify(e)}`)}#z(t,e,s){const r=new Set;for(const o of this.#j){const i=o.listenerRef.deref();if(i)if(inBrowser&&i instanceof HTMLElement&&!i.isConnected)r.add(o);else{const{propertyMap:r}=o,n=Object.keys(r);(0===n.length||n.includes(t))&&i.changed(t,r[t],s,e,this)}else r.add(o)}this.#j=this.#j.filter(t=>!r.has(t))}removeListener(t){this.#j=this.#j.filter(e=>e.listenerRef.deref()!==t)}}if(inBrowser){"development"===process.env.NODE_ENV&&(window.WrecState=WrecState)}
|
|
1
|
+
import{getPathValue,setPathValue}from"./paths.js";class WrecError extends Error{}const CSS_PROPERTY_RE=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,FIRST_CHAR="a-zA-Z_$",OTHER_CHAR="a-zA-Z_$0-9",IDENTIFIER=`[a-zA-Z_$][${OTHER_CHAR}]*`,HTML_COMMENT_TEXT_RE=/<!--\s*(.*?)\s*-->/,HTML_ELEMENT_TEXT_RE=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,REF_RE=new RegExp(`^this\\.${IDENTIFIER}$`),REFS_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`,"g"),REFS_TEST_RE=new RegExp(`this\\.${IDENTIFIER}(\\.${IDENTIFIER})*`),RESERVED_ATTRS=new Set(["class","style"]),SKIP=5;function canDisable(t){return t instanceof HTMLButtonElement||t instanceof HTMLFieldSetElement||t instanceof HTMLInputElement||t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof Wrec}function cloneStylesheet(t){const e=new CSSStyleSheet;for(const s of Array.from(t.cssRules))e.insertRule(s.cssText);return e}export function createElement(t,e,s){const r=document.createElement(t);if(e)for(const[t,s]of Object.entries(e))r.setAttribute(t,s);return s&&(r.innerHTML=s),r}const defaultForType=t=>t===String?"":t===Number?0:t!==Boolean&&(t===Array?[]:t===Object?{}:void 0);function getAllDescendants(t){const e=[];let s=t.firstElementChild;for(;s;)e.push(s),s.shadowRoot&&e.push(...getAllDescendants(s.shadowRoot)),s.firstElementChild&&e.push(...getAllDescendants(s)),s=s.nextElementSibling;return e}const getPropName=t=>t.substring(5).split(".")[0];function interpolate(t,e){let s=t[0];return e.forEach((e,r)=>{s+=e+t[r+1]}),s}function isPrimitive(t){const e=typeof t;return"string"===e||"number"===e||"boolean"===e}function isTextArea(t){return"textarea"===t.localName}function isValueElement(t){const{localName:e}=t;return"input"===e||"select"===e}const removeHtmlComments=t=>t.replace(/<!--[\s\S]*?-->/g,"");function replace(t,e,s,r){return t.slice(0,e)+r+t.slice(e+s)}function stringToNumber(t){const e=Number(t);if(isNaN(e))throw new WrecError(`can't convert "${t}" to a number`);return e}function updateAttribute(t,e,s){const[r,o]=e.split(":");if(isPrimitive(s))if("boolean"==typeof s){s?t.setAttribute(r,r):t.removeAttribute(r);t[Wrec.getPropName(r)]=s}else{const o=t.getAttribute(e),i=String(s);o!==i&&(t.setAttribute(r,i),"value"===r&&isValueElement(t)&&(t.value=i))}else{t[Wrec.getPropName(e)]=s}}function updateValue(t,e,s){const[r,o]=e.split(":");t instanceof CSSStyleRule?t.style.setProperty(r,s):(updateAttribute(t,r,s),"value"===r&&isValueElement(t)&&(t.value=s))}export class Wrec extends HTMLElement{static#t=new Map;static#e=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static stylesheet=null;static template=null;#s=this.constructor;#r=new Map;#o={};#i;#n={};#a=null;#c=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#s;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){"disabled"===t&&this.#l();const r=Wrec.getPropName(t);if(this.#p(r)){const t=this.#h(r,String(s));this[r]=t;const o=this.#o[r];o&&this.setFormValue(o,String(t)),this.propertyChangedCallback(r,e,s)}}#u(){if(!this.shadowRoot)return;const t=this.#s;if(t.css){let{stylesheet:e}=t;if(!e){e=t.stylesheet=new CSSStyleSheet;const s=`:host([hidden]) { display: none; } ${t.css}`;e.replaceSync(s)}this.shadowRoot.adoptedStyleSheets=[cloneStylesheet(e)]}let e=t.template;if(!e){e=t.template=document.createElement("template");const s=t.html.trim();e.innerHTML=s.startsWith("<")?s:`<span>\x3c!--${s}--\x3e</span>`}this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#f(),this.#d(),this.#u(),this.hasAttribute("disabled")&&this.#l(),requestAnimationFrame(()=>{if(this.shadowRoot){this.#m(this.shadowRoot),this.#E(this.shadowRoot);for(const t of this.shadowRoot.adoptedStyleSheets)this.#b(t)}this.#y()})}#y(){const t=this.#s,{properties:e}=t;for(const[t,{computed:s}]of Object.entries(e))s&&(this[t]=this.#g(s))}#d(){const t=this.#s,{observedAttributes:e,properties:s}=t;for(const[t,r]of Object.entries(s))this.#R(t,r,e)}#R(t,e,s){const r=Wrec.getAttrName(t),o=this.hasAttribute(r);e.required&&!o&&this.#T(this,t,"is a required attribute");let i=e.value;this.hasOwnProperty(t)&&(i=this[t],delete this[t]);const{type:n}=e,a=n===Boolean?i||o:s.includes(r)&&o?this.#S(t,r):i||defaultForType(n),c="#"+t;this[c]=a,e.computed&&this.#w(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[c]},set(s){n===Number&&"string"==typeof s&&(s=stringToNumber(s));const o=this[c];if(s===o)return;this.#v(t,n,s),this[c]=s;const{state:i,stateProp:a}=this.#s.properties[t];a&&setPathValue(i,a,s),this.#A(t),this.#M(t,n,s,r),this.#P(t),this.#x(t,s);const l=this.#o[t];l&&this.setFormValue(l,String(s)),this.propertyChangedCallback(t,o,s),e.dispatch&&this.dispatch("change",{[t]:s})}})}#l(){const t=this.hasAttribute("disabled"),e=getAllDescendants(this.shadowRoot);for(const s of e)canDisable(s)&&(s.disabled=t)}disconnectedCallback(){this.#r.clear(),this.#n.clear(),this.#c.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#C(t){const e=t instanceof Wrec;for(const s of t.getAttributeNames()){const r=t.getAttribute(s),o=this.#N(t,r);if(o){const r=this[o];void 0===r&&this.#$(t,s,o),t[o]=r;let[i,n]=s.split(":");if("value"===i)if(n){if(void 0===t["on"+n]){const e="refers to an unsupported event name";this.#T(t,s,e)}t.setAttribute(i,this[o])}else n="change";e&&t.#c.set(Wrec.getPropName(i),o)}this.#_(r,t,s)}}#g(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#I(t){const{localName:e}=t;if("style"===e){const{sheet:e}=t,s=e?.cssRules??[],r=Array.from(s);for(const t of r)if(t.constructor===CSSStyleRule){const e=Array.from(t.style);for(const s of e)if(s.startsWith("--")){const e=t.style.getPropertyValue(s);this.#_(e,t,s)}}}else{let e="";if(isTextArea(t)){this.#_(t.textContent,t);const s=t.textContent?.match(HTML_COMMENT_TEXT_RE);s&&(e=s[1])}else{const s=Array.from(t.childNodes).find(t=>t.nodeType===Node.COMMENT_NODE);s&&(e=s.textContent?.trim()??"")}if(e){const s=this.#N(t,e);s&&isTextArea(t)?t.textContent=this[s]:this.#_(e,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const e=this.getAttribute("name");if(!e)return;if(!this.#p("value"))return;t=`value:${e}`}const e={},s=t.split(",");for(const t of s){const[s,r]=t.split(":");e[s.trim()]=r.trim()}this.#o=e,this.#i=new FormData,this.#a=this.attachInternals(),this.#a.setFormValue(this.#i);const r=Object.keys(this.#s.properties),o=this.#n;for(const t of r)o[t]=this[t]}formResetCallback(){const t=this.#n;for(const e of Object.keys(t)){let s=t[e];REF_RE.test(s)&&(s=this.#g(s)),this[e]=s}}static getAttrName(t){let e=Wrec.#e.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Wrec.#e.set(t,e)),e}static getPropName(t){let e=Wrec.#t.get(t);return e||(e=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase()),Wrec.#t.set(t,e)),e}#O(t,e,s){if(1!==s.length)return;const[r]=s;if(!REF_RE.test(r))return;const o=isValueElement(t)||isTextArea(t);let[i,n]=(e??"").split(":");if(!(o&&"value"===i||isTextArea(t)))return;if(n){if(void 0===t["on"+n]){const s="refers to an unsupported event name";this.#T(t,e,s)}}else n="change";const a=getPropName(r);t.addEventListener(n,t=>{const{target:e}=t;if(!e)return;const s=e.value,{type:r}=this.#s.properties[a];this[a]=r===Number?stringToNumber(s):s,this.#P(a)})}#p(t){return Boolean(this.#s.properties[t])}#E(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e)this.#C(t),t.firstElementChild||this.#I(t)}#b(t){const e=t.cssRules;for(const t of Array.from(e))if(t instanceof CSSStyleRule)for(const e of Array.from(t.style))if(e.startsWith("--")){const s=t.style.getPropertyValue(e);this.#_(s,t,e)}}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(Wrec.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#N(t,e){if(!e||!REF_RE.test(e))return;const s=getPropName(e);return void 0===this[s]&&this.#$(t,"",s),s}#P(t){const e=this.#s.propToExprsMap.get(t)||[];for(const t of e){let e=this.#g(t);const s=this.#r.get(t)??[];for(const t of s)if(t instanceof HTMLElement)this.#W(t,e);else if(t instanceof CSSStyleRule);else{const{element:s,attrName:r}=t;s instanceof CSSStyleRule?s.style.setProperty(r,e):updateValue(s,r,e)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#w(t,e){const{computed:s,uses:r}=e,o=this.#s.propToComputedMap;function i(e,s){let r=o.get(e);r||(r=[],o.set(e,r)),r.push([t,s])}const n=s.match(REFS_RE)||[];for(const e of n){const r=e.substring(5);void 0===this[r]&&this.#$(null,t,r),"function"!=typeof this[r]&&i(r,s)}if(r)for(const t of r.split(","))i(t,s)}#_(t,e,s=void 0){if(!t)return;const r=this.#H(e,s,t);if(!r){const r=t.replaceAll("this..","this.");return void(s?updateValue(e,s,r):"textContent"in e&&(e.textContent=r))}const o=this.#s;r.forEach(e=>{const s=getPropName(e);if("function"==typeof this[s])return;const r=o.propToExprsMap;let i=r.get(s);i||(i=[],r.set(s,i)),i.includes(t)||i.push(t)});for(const[t,e]of this.#r.entries())for(const s of e){const r=s instanceof HTMLElement||s instanceof CSSStyleRule?s:s.element;r instanceof CSSStyleRule||(r.isConnected||this.#r.set(t,e.filter(t=>t!==s)))}let i=this.#r.get(t);i||(i=[],this.#r.set(t,i)),i.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#O(e,s,r);const n=this.#g(t);s?updateValue(e,s,n):this.#W(e,n)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){this.#i&&isPrimitive(e)&&(this.#i.set(t,e),this.#a?.setFormValue(this.#i))}#T(t,e,s){const r=this.#s,o=t instanceof HTMLElement?t.localName:"CSS rule";throw new WrecError(`component ${r.elementName()}`+(t?`, element "${o}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#$(t,e,s){this.#T(t,e,`refers to missing property "${s}"`)}#S(t,e){return this.#h(t,this.getAttribute(e))}#h(t,e){if(e?.match(REFS_RE))return e;const s=this.#s,{type:r}=s.properties[t];return r||this.#T(null,t,"does not specify its type"),r===String?e:r===Number?stringToNumber(e):r===Boolean?"true"===e||"false"!==e&&"null"!==e&&(e&&e!==t&&this.#T(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t):void 0}#M(t,e,s,r){if(isPrimitive(s)&&this.hasAttribute(r)){s!==(e===Boolean?this.hasAttribute(r):this.#S(t,r))&&updateAttribute(this,t,s)}}#A(t){const e=this.#s.propToComputedMap.get(t)||[];for(const[t,s]of e)this[t]=this.#g(s)}#W(t,e){if(void 0===e)return;const s=t instanceof HTMLElement,r=typeof e;"string"!==r&&"number"!==r&&this.#T(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&isTextArea(t)?t.value=e:s&&"string"===r&&e.trim().startsWith("<")?(t.innerHTML=e,this.#m(t),this.#E(t)):s&&(t.textContent=e)}#x(t,e){const s=this.#c.get(t);if(!s)return;const r=this.getRootNode();if(!(r instanceof ShadowRoot))return;const{host:o}=r;if(!o)return;o[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#L(t,e);for(const[s,r]of Object.entries(e))if(this.#p(r)){const e=getPathValue(t,s);void 0!==e&&(this[r]=e);const o=this.#s.properties[r];o.state=t,o.stateProp=s}t.addListener(this,e)}#f(){const t=this.#s,e=new Set(Object.keys(t.properties));for(const t of e)RESERVED_ATTRS.has(t)&&this.#T(null,"",`property "${t}" is not allowed because it is a reserved attribute`);const s=this.#s.name;for(const r of this.getAttributeNames())if("class"!==r&&"id"!==r&&"disabled"!==r&&!r.startsWith("on"))if("form-assoc"!==r){if(!e.has(Wrec.getPropName(r))){if("name"===r){if(t.formAssociated)continue;throw new WrecError(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#T(null,r,"is not a supported attribute")}}else if(!t.formAssociated)throw new WrecError(`add "static formAssociated = true;" to class ${s}`)}#H(t,e,s){const r=s.match(REFS_RE);if(r)return r.forEach(s=>{const r=getPropName(s);void 0===this[r]&&this.#$(t,e,r)}),r}#L(t,e){for(const[s,r]of Object.entries(e)){let e=getPathValue(t,s);if(void 0===e)throw new WrecError(`invalid state path "${s}"`);e=this[r],this.#p(r)||this.#T(null,r,"refers to missing property in useState map")}}#v(t,e,s){if(s instanceof e)return;let r=typeof s;if("object"===r){const{constructor:o}=s;r=o.name,o!==e&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}r!==e.name.toLowerCase()&&this.#T(null,t,`was set to a ${r}, but must be a ${e.name}`)}#m(t){const e=Array.from(t.querySelectorAll("*"));for(const t of e){const e=[];for(const s of Array.from(t.attributes)){const r=s.name;if(r.startsWith("on")){let o=r.slice(2);o=o[0].toLowerCase()+o.slice(1).toLowerCase();const i=s.value;let n;this.#H(t,r,i),"function"==typeof this[i]?n=t=>this[i](t):(this.#H(t,r,i),n=()=>this.#g(i)),t.addEventListener(o,n),e.push(r)}}for(const s of e)t.removeAttribute(s)}}}export function css(t,...e){let s=interpolate(t,e);for(;;){const t=CSS_PROPERTY_RE.exec(s);if(!t)break;const e=t[2];if(REFS_TEST_RE.test(e)){const r=t[1];if(!r.startsWith("--")){const o=`--${r}: ${e};\n ${r}: var(--${r})`;s=replace(s,t.index,t[0].length,o)}}}return s}export function html(t,...e){let s=interpolate(t,e);for(;;){const t=HTML_ELEMENT_TEXT_RE.exec(s);if(!t||"style"===t[1])break;const e=removeHtmlComments(t[2]);if(REFS_TEST_RE.test(e)){const r=`\x3c!-- ${e.trim()} --\x3e`;s=replace(s,t.index+t[0].indexOf(">")+1,e.length,r)}}return s}import{createDeepProxy,proxyToPlainObject}from"./proxies.js";const inBrowser="undefined"!=typeof window&&void 0!==window.document;class WrecError extends Error{}export class WrecState{static#V=new Map;static{inBrowser&&window.addEventListener("beforeunload",()=>{for(const[t,e]of this.#V.entries())if(e.#F){const s=proxyToPlainObject(e);sessionStorage.setItem("wrec-state-"+t,JSON.stringify(s))}})}static get(t){return this.#V.get(t)}#D=Symbol("objectId");#j=[];#k;#F;#B;constructor(t,e,s){if(!t)throw new WrecError("name cannot be empty");if(WrecState.#V.has(t))throw new WrecError(`WrecState with name "${t}" already exists`);if(this.#k=t,this.#F=e,this.#B=createDeepProxy({},this.#z.bind(this)),e&&inBrowser){const e=sessionStorage.getItem("wrec-state-"+t),r=e?JSON.parse(e):void 0;r&&(s=r)}if(s)for(const[t,e]of Object.entries(s))this.addProperty(t,e);WrecState.#V.set(t,this)}addListener(t,e={}){const s=this.#j.find(e=>e.listenerRef.deref()===t);if(s){const{propertyMap:t}=s;for(const[s,r]of Object.entries(e))t[s]=r}else this.#j.push({listenerRef:new WeakRef(t),propertyMap:e})}addProperty(t,e){Object.defineProperty(this,t,{enumerable:!0,get(){return this.#B[t]},set(e){this.#B[t]=e}}),this.#B[t]=e}get id(){return this.#D}log(){console.log("WrecState:",this.#k);for(const[t,e]of Object.entries(this.#B))console.log(` ${t} = ${JSON.stringify(e)}`)}#z(t,e,s){const r=new Set;for(const o of this.#j){const i=o.listenerRef.deref();if(i)if(inBrowser&&i instanceof HTMLElement&&!i.isConnected)r.add(o);else{const{propertyMap:r}=o,n=Object.keys(r);(0===n.length||n.includes(t))&&i.changed(t,r[t],s,e,this)}else r.add(o)}this.#j=this.#j.filter(t=>!r.has(t))}removeListener(t){this.#j=this.#j.filter(e=>e.listenerRef.deref()!==t)}}if(inBrowser){"development"===process.env.NODE_ENV&&(window.WrecState=WrecState)}
|
package/dist/wrec.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(p,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(p=typeof globalThis<"u"?globalThis:p||self,d(p.wrec={}))})(this,(function(p){"use strict";function d(r,t){let e=r;for(const s of t.split("."))e=e[s];return e}function H(r,t,e){const s=t.split("."),o=s.length-1;let i=r;s.forEach((n,h)=>{h===o?i[n]=e:i=i[n]})}class b extends Error{}const j=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,P="a-zA-Z_$",F=P+"0-9",y=`[${P}][${F}]*`,V=/<!--\s*(.*?)\s*-->/,_=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,S=new RegExp(`^this\\.${y}$`),C=new RegExp(`this\\.${y}(\\.${y})*`,"g"),N=new RegExp(`this\\.${y}(\\.${y})*`),I=new Set(["class","style"]),$=5;function D(r){return r instanceof HTMLButtonElement||r instanceof HTMLFieldSetElement||r instanceof HTMLInputElement||r instanceof HTMLSelectElement||r instanceof HTMLTextAreaElement||r instanceof l}function B(r,t,e){const s=document.createElement(r);if(t)for(const[o,i]of Object.entries(t))s.setAttribute(o,i);return e&&(s.innerHTML=e),s}const q=r=>r===String?"":r===Number?0:r===Boolean?!1:r===Array?[]:r===Object?{}:void 0;function T(r){const t=[];let e=r.firstElementChild;for(;e;)t.push(e),e.shadowRoot&&t.push(...T(e.shadowRoot)),e.firstElementChild&&t.push(...T(e)),e=e.nextElementSibling;return t}const E=r=>r.substring($).split(".")[0];function x(r,t){let e=r[0];return t.forEach((s,o)=>{e+=s+r[o+1]}),e}function w(r){const t=typeof r;return t==="string"||t==="number"||t==="boolean"}function g(r){return r.localName==="textarea"}function R(r){const{localName:t}=r;return t==="input"||t==="select"}const z=r=>r.replace(/<!--[\s\S]*?-->/g,"");function L(r,t,e,s){return r.slice(0,t)+s+r.slice(t+e)}function v(r){const t=Number(r);if(isNaN(t))throw new b(`can't convert "${r}" to a number`);return t}function O(r,t,e){const[s,o]=t.split(":");if(w(e))if(typeof e=="boolean"){e?r.setAttribute(s,s):r.removeAttribute(s);const i=l.getPropName(s);r[i]=e}else{const i=r.getAttribute(t),n=String(e);i!==n&&(r.setAttribute(s,n),s==="value"&&R(r)&&(r.value=n))}else{const i=l.getPropName(t);r[i]=e}}function M(r,t,e){const[s,o]=t.split(":");r instanceof CSSRule?r.style.setProperty(s,e):(O(r,s,e),s==="value"&&R(r)&&(r.value=e))}class l extends HTMLElement{static#p=new Map;static#d=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static stylesheet=null;static template=null;#t=this.constructor;#s=new Map;#a={};#i;#f={};#h=null;#l=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#t;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){t==="disabled"&&this.#m();const o=l.getPropName(t);if(this.#r(o)){const i=this.#A(o,String(s));this[o]=i;const n=this.#a[o];n&&this.setFormValue(n,String(i)),this.propertyChangedCallback(o,e,s)}}#T(){if(!this.shadowRoot)return;const t=this.#t;if(t.css){let s=t.stylesheet;if(!s){s=t.stylesheet=new CSSStyleSheet;const o=`:host([hidden]) { display: none; } ${t.css}`;s.replaceSync(o)}this.shadowRoot.adoptedStyleSheets=[s]}let e=t.template;e||(e=t.template=document.createElement("template"),e.innerHTML=t.html),this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#H(),this.#R(),this.#T(),this.hasAttribute("disabled")&&this.#m(),requestAnimationFrame(()=>{if(this.shadowRoot){this.#C(this.shadowRoot),this.#b(this.shadowRoot);for(const t of this.shadowRoot.adoptedStyleSheets)this.#$(t)}this.#w()})}#w(){const t=this.#t,{properties:e}=t;for(const[s,{computed:o}]of Object.entries(e))o&&(this[s]=this.#o(o))}#R(){const t=this.#t,{observedAttributes:e,properties:s}=t;for(const[o,i]of Object.entries(s))this.#v(o,i,e)}#v(t,e,s){const o=l.getAttrName(t),i=this.hasAttribute(o);e.required&&!i&&this.#e(this,t,"is a required attribute");let n=e.value;this.hasOwnProperty(t)&&(n=this[t],delete this[t]);const{type:h}=e,c=h===Boolean?n||i:s.includes(o)&&i?this.#E(t,o):n||q(h),f="#"+t;this[f]=c,e.computed&&this.#x(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[f]},set(a){h===Number&&typeof a=="string"&&(a=v(a));const u=this[f];if(a===u)return;this.#F(t,h,a),this[f]=a;const{state:m,stateProp:A}=this.#t.properties[t];A&&H(m,A,a),this.#O(t),this.#L(t,h,a,o),this.#g(t),this.#k(t,a);const k=this.#a[t];k&&this.setFormValue(k,String(a)),this.propertyChangedCallback(t,u,a),e.dispatch&&this.dispatch("change",{[t]:a})}})}#m(){const t=this.hasAttribute("disabled"),e=T(this.shadowRoot);for(const s of e)D(s)&&(s.disabled=t)}disconnectedCallback(){this.#s.clear(),this.#f.clear(),this.#l.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#M(t){const e=t instanceof l;for(const s of t.getAttributeNames()){const o=t.getAttribute(s),i=this.#y(t,o);if(i){const n=this[i];n===void 0&&this.#c(t,s,i),t[i]=n;let[h,c]=s.split(":");h==="value"&&(c?(t["on"+c]===void 0&&this.#e(t,s,"refers to an unsupported event name"),t.setAttribute(h,this[i])):c="change"),e&&t.#l.set(l.getPropName(h),i)}this.#n(o,t,s)}}#o(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#P(t){const{localName:e}=t;if(e==="style"){const{sheet:s}=t,o=s?.cssRules??[],i=Array.from(o);for(const n of i)if(n.constructor===CSSStyleRule){const h=Array.from(n.style);for(const c of h)if(c.startsWith("--")){const f=n.style.getPropertyValue(c);this.#n(f,n,c)}}}else{let s="";if(g(t)){this.#n(t.textContent,t);const o=t.textContent?.match(V);o&&(s=o[1])}else{const o=Array.from(t.childNodes).find(i=>i.nodeType===Node.COMMENT_NODE);o&&(s=o.textContent?.trim()??"")}if(s){const o=this.#y(t,s);o&&g(t)?t.textContent=this[o]:this.#n(s,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const n=this.getAttribute("name");if(n)if(this.#r("value"))t=`value:${n}`;else return;else return}const e={},s=t.split(",");for(const n of s){const[h,c]=n.split(":");e[h.trim()]=c.trim()}this.#a=e,this.#i=new FormData,this.#h=this.attachInternals(),this.#h.setFormValue(this.#i);const o=Object.keys(this.#t.properties),i=this.#f;for(const n of o)i[n]=this[n]}formResetCallback(){const t=this.#f;for(const e of Object.keys(t)){let s=t[e];S.test(s)&&(s=this.#o(s)),this[e]=s}}static getAttrName(t){let e=l.#d.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l.#d.set(t,e)),e}static getPropName(t){let e=l.#p.get(t);return e||(e=t.replace(/-([a-z])/g,(s,o)=>o.toUpperCase()),l.#p.set(t,e)),e}#N(t,e,s){if(s.length!==1)return;const[o]=s;if(!S.test(o))return;const i=R(t)||g(t);let[n,h]=(e??"").split(":");if(!(i&&n==="value"||g(t)))return;h?t["on"+h]===void 0&&this.#e(t,e,"refers to an unsupported event name"):h="change";const f=E(o);t.addEventListener(h,a=>{const{target:u}=a;if(!u)return;const m=u.value,{type:A}=this.#t.properties[f];this[f]=A===Number?v(m):m,this.#g(f)})}#r(t){return!!this.#t.properties[t]}#b(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e)this.#M(s),s.firstElementChild||this.#P(s)}#$(t){const e=t.cssRules||t.rules;for(const s of Array.from(e))if(s instanceof CSSStyleRule){for(const o of Array.from(s.style))if(o.startsWith("--")){const i=s.style.getPropertyValue(o);this.#n(i,s,o)}}}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(l.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#y(t,e){if(!e||!S.test(e))return;const s=E(e);return this[s]===void 0&&this.#c(t,"",s),s}#g(t){const o=this.#t.propToExprsMap.get(t)||[];for(const i of o){let n=this.#o(i);const h=this.#s.get(i)??[];for(const c of h)if(c instanceof HTMLElement)this.#S(c,n);else if(!(c instanceof CSSStyleRule)){const{element:f,attrName:a}=c;f instanceof CSSStyleRule?f.style.setProperty(a,n):M(f,a,n)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#x(t,e){const{computed:s,uses:o}=e,i=this.#t.propToComputedMap;function n(c,f){let a=i.get(c);a||(a=[],i.set(c,a)),a.push([t,f])}const h=s.match(C)||[];for(const c of h){const f=c.substring($);this[f]===void 0&&this.#c(null,t,f),typeof this[f]!="function"&&n(f,s)}if(o)for(const c of o.split(","))n(c,s)}#n(t,e,s=void 0){if(!t)return;const o=this.#u(e,s,t);if(!o){const c=t.replaceAll("this..","this.");s?M(e,s,c):"textContent"in e&&(e.textContent=c);return}const i=this.#t;o.forEach(c=>{const f=E(c);if(typeof this[f]=="function")return;const a=i.propToExprsMap;let u=a.get(f);u||(u=[],a.set(f,u)),u.includes(t)||u.push(t)});for(const[c,f]of this.#s.entries())for(const a of f){const u=a instanceof HTMLElement||a instanceof CSSStyleRule?a:a.element;u instanceof CSSStyleRule||u.isConnected||this.#s.set(c,f.filter(m=>m!==a))}let n=this.#s.get(t);n||(n=[],this.#s.set(t,n)),n.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#N(e,s,o);const h=this.#o(t);s?M(e,s,h):this.#S(e,h)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){!this.#i||!w(e)||(this.#i.set(t,e),this.#h?.setFormValue(this.#i))}#e(t,e,s){const o=this.#t,i=t instanceof HTMLElement?t.localName:"CSS rule";throw new b(`component ${o.elementName()}`+(t?`, element "${i}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#c(t,e,s){this.#e(t,e,`refers to missing property "${s}"`)}#E(t,e){return this.#A(t,this.getAttribute(e))}#A(t,e){if(e?.match(C))return e;const s=this.#t,{type:o}=s.properties[t];if(o||this.#e(null,t,"does not specify its type"),o===String)return e;if(o===Number)return v(e);if(o===Boolean)return e==="true"?!0:e==="false"||e==="null"?!1:(e&&e!==t&&this.#e(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t)}#L(t,e,s,o){if(w(s)&&this.hasAttribute(o)){const i=e===Boolean?this.hasAttribute(o):this.#E(t,o);s!==i&&O(this,t,s)}}#O(t){const s=this.#t.propToComputedMap.get(t)||[];for(const[o,i]of s)this[o]=this.#o(i)}#S(t,e){if(e===void 0)return;const s=t instanceof HTMLElement,o=typeof e;o!=="string"&&o!=="number"&&this.#e(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&g(t)?t.value=e:s&&o==="string"&&e.trim().startsWith("<")?(t.innerHTML=e,this.#C(t),this.#b(t)):s&&(t.textContent=e)}#k(t,e){const s=this.#l.get(t);if(!s)return;const o=this.getRootNode();if(!(o instanceof ShadowRoot))return;const{host:i}=o;if(!i)return;const n=i;n[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#j(t,e);for(const[s,o]of Object.entries(e))if(this.#r(o)){const i=d(t,s);i!==void 0&&(this[o]=i);const n=this.#t.properties[o];n.state=t,n.stateProp=s}t.addListener(this,e)}#H(){const t=this.#t,e=new Set(Object.keys(t.properties));for(const o of e)I.has(o)&&this.#e(null,"",`property "${o}" is not allowed because it is a reserved attribute`);const s=this.#t.name;for(const o of this.getAttributeNames())if(o!=="class"&&o!=="id"&&o!=="disabled"&&!o.startsWith("on")){if(o==="form-assoc"){if(!t.formAssociated)throw new b(`add "static formAssociated = true;" to class ${s}`);continue}if(!e.has(l.getPropName(o))){if(o==="name"){if(t.formAssociated)continue;throw new b(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#e(null,o,"is not a supported attribute")}}}#u(t,e,s){const o=s.match(C);if(o)return o.forEach(i=>{const n=E(i);this[n]===void 0&&this.#c(t,e,n)}),o}#j(t,e){for(const[s,o]of Object.entries(e)){let i=d(t,s);if(i===void 0)throw new b(`invalid state path "${s}"`);i=this[o],this.#r(o)||this.#e(null,o,"refers to missing property in useState map")}}#F(t,e,s){if(s instanceof e)return;let o=typeof s;if(o==="object"){const{constructor:i}=s;o=i.name,i!==e&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}o!==e.name.toLowerCase()&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}#C(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e){const o=[];for(const i of Array.from(s.attributes)){const n=i.name;if(n.startsWith("on")){let h=n.slice(2);h=h[0].toLowerCase()+h.slice(1).toLowerCase();const c=i.value;this.#u(s,n,c);let f;typeof this[c]=="function"?f=a=>this[c](a):(this.#u(s,n,c),f=()=>this.#o(c)),s.addEventListener(h,f),o.push(n)}}for(const i of o)s.removeAttribute(i)}}}function Z(r,...t){let e=x(r,t);for(;;){const s=j.exec(e);if(!s)break;const o=s[2];if(N.test(o)){const i=s[1];if(!i.startsWith("--")){const n=`--${i}: ${o};
|
|
2
|
-
|
|
1
|
+
(function(p,d){typeof exports=="object"&&typeof module<"u"?d(exports):typeof define=="function"&&define.amd?define(["exports"],d):(p=typeof globalThis<"u"?globalThis:p||self,d(p.wrec={}))})(this,(function(p){"use strict";function d(n,t){let e=n;for(const s of t.split("."))e=e[s];return e}function H(n,t,e){const s=t.split("."),o=s.length-1;let i=n;s.forEach((r,h)=>{h===o?i[r]=e:i=i[r]})}class b extends Error{}const j=/([a-zA-Z-]+)\s*:\s*([^;}]+)/g,P="a-zA-Z_$",F=P+"0-9",y=`[${P}][${F}]*`,V=/<!--\s*(.*?)\s*-->/,_=/<(\w+)(?:\s[^>]*)?>((?:[^<]|<(?!\w))*?)<\/\1>/g,E=new RegExp(`^this\\.${y}$`),C=new RegExp(`this\\.${y}(\\.${y})*`,"g"),$=new RegExp(`this\\.${y}(\\.${y})*`),I=new Set(["class","style"]),N=5;function D(n){return n instanceof HTMLButtonElement||n instanceof HTMLFieldSetElement||n instanceof HTMLInputElement||n instanceof HTMLSelectElement||n instanceof HTMLTextAreaElement||n instanceof l}function B(n){const t=new CSSStyleSheet;for(const e of Array.from(n.cssRules))t.insertRule(e.cssText);return t}function q(n,t,e){const s=document.createElement(n);if(t)for(const[o,i]of Object.entries(t))s.setAttribute(o,i);return e&&(s.innerHTML=e),s}const z=n=>n===String?"":n===Number?0:n===Boolean?!1:n===Array?[]:n===Object?{}:void 0;function T(n){const t=[];let e=n.firstElementChild;for(;e;)t.push(e),e.shadowRoot&&t.push(...T(e.shadowRoot)),e.firstElementChild&&t.push(...T(e)),e=e.nextElementSibling;return t}const S=n=>n.substring(N).split(".")[0];function x(n,t){let e=n[0];return t.forEach((s,o)=>{e+=s+n[o+1]}),e}function w(n){const t=typeof n;return t==="string"||t==="number"||t==="boolean"}function g(n){return n.localName==="textarea"}function R(n){const{localName:t}=n;return t==="input"||t==="select"}const Z=n=>n.replace(/<!--[\s\S]*?-->/g,"");function L(n,t,e,s){return n.slice(0,t)+s+n.slice(t+e)}function v(n){const t=Number(n);if(isNaN(t))throw new b(`can't convert "${n}" to a number`);return t}function O(n,t,e){const[s,o]=t.split(":");if(w(e))if(typeof e=="boolean"){e?n.setAttribute(s,s):n.removeAttribute(s);const i=l.getPropName(s);n[i]=e}else{const i=n.getAttribute(t),r=String(e);i!==r&&(n.setAttribute(s,r),s==="value"&&R(n)&&(n.value=r))}else{const i=l.getPropName(t);n[i]=e}}function M(n,t,e){const[s,o]=t.split(":");n instanceof CSSStyleRule?n.style.setProperty(s,e):(O(n,s,e),s==="value"&&R(n)&&(n.value=e))}class l extends HTMLElement{static#p=new Map;static#d=new Map;static css="";static formAssociated=!1;static html="";static properties;static propToComputedMap;static propToExprsMap;static stylesheet=null;static template=null;#t=this.constructor;#s=new Map;#a={};#i;#f={};#h=null;#l=new Map;constructor(){super(),this.attachShadow({mode:"open"});const t=this.#t;t.properties||(t.properties={}),t.propToComputedMap||(t.propToComputedMap=new Map),t.propToExprsMap||(t.propToExprsMap=new Map)}attributeChangedCallback(t,e,s){t==="disabled"&&this.#m();const o=l.getPropName(t);if(this.#r(o)){const i=this.#A(o,String(s));this[o]=i;const r=this.#a[o];r&&this.setFormValue(r,String(i)),this.propertyChangedCallback(o,e,s)}}#T(){if(!this.shadowRoot)return;const t=this.#t;if(t.css){let{stylesheet:s}=t;if(!s){s=t.stylesheet=new CSSStyleSheet;const o=`:host([hidden]) { display: none; } ${t.css}`;s.replaceSync(o)}this.shadowRoot.adoptedStyleSheets=[B(s)]}let e=t.template;if(!e){e=t.template=document.createElement("template");const s=t.html.trim();e.innerHTML=s.startsWith("<")?s:`<span><!--${s}--></span>`}this.shadowRoot.replaceChildren(e.content.cloneNode(!0))}changed(t,e,s){this[e]=s}connectedCallback(){this.#H(),this.#R(),this.#T(),this.hasAttribute("disabled")&&this.#m(),requestAnimationFrame(()=>{if(this.shadowRoot){this.#C(this.shadowRoot),this.#b(this.shadowRoot);for(const t of this.shadowRoot.adoptedStyleSheets)this.#N(t)}this.#w()})}#w(){const t=this.#t,{properties:e}=t;for(const[s,{computed:o}]of Object.entries(e))o&&(this[s]=this.#o(o))}#R(){const t=this.#t,{observedAttributes:e,properties:s}=t;for(const[o,i]of Object.entries(s))this.#v(o,i,e)}#v(t,e,s){const o=l.getAttrName(t),i=this.hasAttribute(o);e.required&&!i&&this.#e(this,t,"is a required attribute");let r=e.value;this.hasOwnProperty(t)&&(r=this[t],delete this[t]);const{type:h}=e,c=h===Boolean?r||i:s.includes(o)&&i?this.#S(t,o):r||z(h),f="#"+t;this[f]=c,e.computed&&this.#x(t,e),Object.defineProperty(this,t,{enumerable:!0,get(){return this[f]},set(a){h===Number&&typeof a=="string"&&(a=v(a));const u=this[f];if(a===u)return;this.#F(t,h,a),this[f]=a;const{state:m,stateProp:A}=this.#t.properties[t];A&&H(m,A,a),this.#O(t),this.#L(t,h,a,o),this.#g(t),this.#k(t,a);const k=this.#a[t];k&&this.setFormValue(k,String(a)),this.propertyChangedCallback(t,u,a),e.dispatch&&this.dispatch("change",{[t]:a})}})}#m(){const t=this.hasAttribute("disabled"),e=T(this.shadowRoot);for(const s of e)D(s)&&(s.disabled=t)}disconnectedCallback(){this.#s.clear(),this.#f.clear(),this.#l.clear()}dispatch(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}displayIfSet(t,e="block"){return`display: ${t?e:"none"}`}static elementName(){return this.name.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}#M(t){const e=t instanceof l;for(const s of t.getAttributeNames()){const o=t.getAttribute(s),i=this.#y(t,o);if(i){const r=this[i];r===void 0&&this.#c(t,s,i),t[i]=r;let[h,c]=s.split(":");h==="value"&&(c?(t["on"+c]===void 0&&this.#e(t,s,"refers to an unsupported event name"),t.setAttribute(h,this[i])):c="change"),e&&t.#l.set(l.getPropName(h),i)}this.#n(o,t,s)}}#o(t){const e=new Function("return "+t).call(this);return Array.isArray(e)?e.join(""):e}#P(t){const{localName:e}=t;if(e==="style"){const{sheet:s}=t,o=s?.cssRules??[],i=Array.from(o);for(const r of i)if(r.constructor===CSSStyleRule){const h=Array.from(r.style);for(const c of h)if(c.startsWith("--")){const f=r.style.getPropertyValue(c);this.#n(f,r,c)}}}else{let s="";if(g(t)){this.#n(t.textContent,t);const o=t.textContent?.match(V);o&&(s=o[1])}else{const o=Array.from(t.childNodes).find(i=>i.nodeType===Node.COMMENT_NODE);o&&(s=o.textContent?.trim()??"")}if(s){const o=this.#y(t,s);o&&g(t)?t.textContent=this[o]:this.#n(s,t)}}}formAssociatedCallback(){let t=this.getAttribute("form-assoc");if(!t){const r=this.getAttribute("name");if(r)if(this.#r("value"))t=`value:${r}`;else return;else return}const e={},s=t.split(",");for(const r of s){const[h,c]=r.split(":");e[h.trim()]=c.trim()}this.#a=e,this.#i=new FormData,this.#h=this.attachInternals(),this.#h.setFormValue(this.#i);const o=Object.keys(this.#t.properties),i=this.#f;for(const r of o)i[r]=this[r]}formResetCallback(){const t=this.#f;for(const e of Object.keys(t)){let s=t[e];E.test(s)&&(s=this.#o(s)),this[e]=s}}static getAttrName(t){let e=l.#d.get(t);return e||(e=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),l.#d.set(t,e)),e}static getPropName(t){let e=l.#p.get(t);return e||(e=t.replace(/-([a-z])/g,(s,o)=>o.toUpperCase()),l.#p.set(t,e)),e}#$(t,e,s){if(s.length!==1)return;const[o]=s;if(!E.test(o))return;const i=R(t)||g(t);let[r,h]=(e??"").split(":");if(!(i&&r==="value"||g(t)))return;h?t["on"+h]===void 0&&this.#e(t,e,"refers to an unsupported event name"):h="change";const f=S(o);t.addEventListener(h,a=>{const{target:u}=a;if(!u)return;const m=u.value,{type:A}=this.#t.properties[f];this[f]=A===Number?v(m):m,this.#g(f)})}#r(t){return!!this.#t.properties[t]}#b(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e)this.#M(s),s.firstElementChild||this.#P(s)}#N(t){const e=t.cssRules;for(const s of Array.from(e))if(s instanceof CSSStyleRule){for(const o of Array.from(s.style))if(o.startsWith("--")){const i=s.style.getPropertyValue(o);this.#n(i,s,o)}}}static get observedAttributes(){const t=Object.keys(this.properties||{}).map(l.getAttrName);return t.includes("disabled")||t.push("disabled"),t}propertyChangedCallback(t,e,s){}#y(t,e){if(!e||!E.test(e))return;const s=S(e);return this[s]===void 0&&this.#c(t,"",s),s}#g(t){const o=this.#t.propToExprsMap.get(t)||[];for(const i of o){let r=this.#o(i);const h=this.#s.get(i)??[];for(const c of h)if(c instanceof HTMLElement)this.#E(c,r);else if(!(c instanceof CSSStyleRule)){const{element:f,attrName:a}=c;f instanceof CSSStyleRule?f.style.setProperty(a,r):M(f,a,r)}}}static register(){const t=this.elementName();customElements.get(t)||customElements.define(t,this)}#x(t,e){const{computed:s,uses:o}=e,i=this.#t.propToComputedMap;function r(c,f){let a=i.get(c);a||(a=[],i.set(c,a)),a.push([t,f])}const h=s.match(C)||[];for(const c of h){const f=c.substring(N);this[f]===void 0&&this.#c(null,t,f),typeof this[f]!="function"&&r(f,s)}if(o)for(const c of o.split(","))r(c,s)}#n(t,e,s=void 0){if(!t)return;const o=this.#u(e,s,t);if(!o){const c=t.replaceAll("this..","this.");s?M(e,s,c):"textContent"in e&&(e.textContent=c);return}const i=this.#t;o.forEach(c=>{const f=S(c);if(typeof this[f]=="function")return;const a=i.propToExprsMap;let u=a.get(f);u||(u=[],a.set(f,u)),u.includes(t)||u.push(t)});for(const[c,f]of this.#s.entries())for(const a of f){const u=a instanceof HTMLElement||a instanceof CSSStyleRule?a:a.element;u instanceof CSSStyleRule||u.isConnected||this.#s.set(c,f.filter(m=>m!==a))}let r=this.#s.get(t);r||(r=[],this.#s.set(t,r)),r.push(s?{element:e,attrName:s}:e),e instanceof HTMLElement&&this.#$(e,s,o);const h=this.#o(t);s?M(e,s,h):this.#E(e,h)}setAttributeSafe(t,e){this.hasAttribute(t)||this.setAttribute(t,e)}setFormValue(t,e){!this.#i||!w(e)||(this.#i.set(t,e),this.#h?.setFormValue(this.#i))}#e(t,e,s){const o=this.#t,i=t instanceof HTMLElement?t.localName:"CSS rule";throw new b(`component ${o.elementName()}`+(t?`, element "${i}"`:"")+(e?`, attribute "${e}"`:"")+` ${s}`)}#c(t,e,s){this.#e(t,e,`refers to missing property "${s}"`)}#S(t,e){return this.#A(t,this.getAttribute(e))}#A(t,e){if(e?.match(C))return e;const s=this.#t,{type:o}=s.properties[t];if(o||this.#e(null,t,"does not specify its type"),o===String)return e;if(o===Number)return v(e);if(o===Boolean)return e==="true"?!0:e==="false"||e==="null"?!1:(e&&e!==t&&this.#e(null,t,"is a Boolean attribute, so its value must match attribute name or be missing"),e===t)}#L(t,e,s,o){if(w(s)&&this.hasAttribute(o)){const i=e===Boolean?this.hasAttribute(o):this.#S(t,o);s!==i&&O(this,t,s)}}#O(t){const s=this.#t.propToComputedMap.get(t)||[];for(const[o,i]of s)this[o]=this.#o(i)}#E(t,e){if(e===void 0)return;const s=t instanceof HTMLElement,o=typeof e;o!=="string"&&o!=="number"&&this.#e(t,void 0," computed content is not a string or number"),t instanceof HTMLElement&&g(t)?t.value=e:s&&o==="string"&&e.trim().startsWith("<")?(t.innerHTML=e,this.#C(t),this.#b(t)):s&&(t.textContent=e)}#k(t,e){const s=this.#l.get(t);if(!s)return;const o=this.getRootNode();if(!(o instanceof ShadowRoot))return;const{host:i}=o;if(!i)return;const r=i;r[s]=e}useState(t,e){if(!e){e={};for(const s of Object.keys(t))e[s]=s}this.#j(t,e);for(const[s,o]of Object.entries(e))if(this.#r(o)){const i=d(t,s);i!==void 0&&(this[o]=i);const r=this.#t.properties[o];r.state=t,r.stateProp=s}t.addListener(this,e)}#H(){const t=this.#t,e=new Set(Object.keys(t.properties));for(const o of e)I.has(o)&&this.#e(null,"",`property "${o}" is not allowed because it is a reserved attribute`);const s=this.#t.name;for(const o of this.getAttributeNames())if(o!=="class"&&o!=="id"&&o!=="disabled"&&!o.startsWith("on")){if(o==="form-assoc"){if(!t.formAssociated)throw new b(`add "static formAssociated = true;" to class ${s}`);continue}if(!e.has(l.getPropName(o))){if(o==="name"){if(t.formAssociated)continue;throw new b(`name attribute requires "static formAssociated = true;" in class ${s}`)}this.#e(null,o,"is not a supported attribute")}}}#u(t,e,s){const o=s.match(C);if(o)return o.forEach(i=>{const r=S(i);this[r]===void 0&&this.#c(t,e,r)}),o}#j(t,e){for(const[s,o]of Object.entries(e)){let i=d(t,s);if(i===void 0)throw new b(`invalid state path "${s}"`);i=this[o],this.#r(o)||this.#e(null,o,"refers to missing property in useState map")}}#F(t,e,s){if(s instanceof e)return;let o=typeof s;if(o==="object"){const{constructor:i}=s;o=i.name,i!==e&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}o!==e.name.toLowerCase()&&this.#e(null,t,`was set to a ${o}, but must be a ${e.name}`)}#C(t){const e=Array.from(t.querySelectorAll("*"));for(const s of e){const o=[];for(const i of Array.from(s.attributes)){const r=i.name;if(r.startsWith("on")){let h=r.slice(2);h=h[0].toLowerCase()+h.slice(1).toLowerCase();const c=i.value;this.#u(s,r,c);let f;typeof this[c]=="function"?f=a=>this[c](a):(this.#u(s,r,c),f=()=>this.#o(c)),s.addEventListener(h,f),o.push(r)}}for(const i of o)s.removeAttribute(i)}}}function K(n,...t){let e=x(n,t);for(;;){const s=j.exec(e);if(!s)break;const o=s[2];if($.test(o)){const i=s[1];if(!i.startsWith("--")){const r=`--${i}: ${o};
|
|
2
|
+
${i}: var(--${i})`;e=L(e,s.index,s[0].length,r)}}}return e}function X(n,...t){let e=x(n,t);for(;;){const s=_.exec(e);if(!s||s[1]==="style")break;const o=Z(s[2]);if($.test(o)){const i=`<!-- ${o.trim()} -->`,r=s.index+s[0].indexOf(">")+1;e=L(e,r,o.length,i)}}return e}p.Wrec=l,p.createElement=q,p.css=K,p.html=X,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})}));
|