haori 0.68.0 → 0.69.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/README.ja.md +2 -1
- package/README.md +2 -1
- package/dist/haori.cjs.js +15 -15
- package/dist/haori.es.js +911 -868
- package/dist/haori.iife.js +15 -15
- package/dist/index.d.ts +12 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -30,15 +30,44 @@ const Re = class Re {
|
|
|
30
30
|
};
|
|
31
31
|
Re.devMode = !1;
|
|
32
32
|
let V = Re;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
class m {
|
|
34
|
+
/**
|
|
35
|
+
* 開発モードでのみコンソールに情報を出力します。
|
|
36
|
+
*
|
|
37
|
+
* @param message 出力するメッセージ
|
|
38
|
+
* @param args 追加の引数
|
|
39
|
+
*/
|
|
40
|
+
static info(e, ...t) {
|
|
41
|
+
V.isEnabled() && console.log && console.log(e, ...t);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* 開発モードでのみコンソールに警告を出力します。
|
|
45
|
+
*
|
|
46
|
+
* @param message 出力するメッセージ
|
|
47
|
+
* @param args 追加の引数
|
|
48
|
+
*/
|
|
49
|
+
static warn(e, ...t) {
|
|
50
|
+
V.isEnabled() && console.warn && console.warn(e, ...t);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* モードに関係なくコンソールにエラーを出力します。
|
|
54
|
+
*
|
|
55
|
+
* @param message 出力するメッセージ
|
|
56
|
+
* @param args 追加の引数
|
|
57
|
+
*/
|
|
58
|
+
static error(e, ...t) {
|
|
59
|
+
console.error(e, ...t);
|
|
60
|
+
}
|
|
36
61
|
}
|
|
37
|
-
|
|
38
|
-
|
|
62
|
+
const rt = "embedded", dt = "data-";
|
|
63
|
+
function Ct(p) {
|
|
64
|
+
return p === "embedded" || p === "demo";
|
|
39
65
|
}
|
|
40
|
-
function
|
|
41
|
-
|
|
66
|
+
function ir(p) {
|
|
67
|
+
return p === null ? null : Ct(p) ? p : rt;
|
|
68
|
+
}
|
|
69
|
+
function ht(p) {
|
|
70
|
+
const e = p.trim().toLowerCase();
|
|
42
71
|
return e !== "false" && e !== "off" && e !== "0";
|
|
43
72
|
}
|
|
44
73
|
const te = class te {
|
|
@@ -98,7 +127,7 @@ const te = class te {
|
|
|
98
127
|
* @return 戻り値はありません。
|
|
99
128
|
*/
|
|
100
129
|
static setRuntime(e) {
|
|
101
|
-
te._runtime =
|
|
130
|
+
te._runtime = Ct(e) ? e : rt;
|
|
102
131
|
}
|
|
103
132
|
/**
|
|
104
133
|
* 実行環境からプレフィックスと開発モードかどうかを自動検出します。
|
|
@@ -111,19 +140,19 @@ const te = class te {
|
|
|
111
140
|
const e = document.currentScript || document.querySelector('script[src*="haori"]');
|
|
112
141
|
if (e instanceof HTMLScriptElement) {
|
|
113
142
|
const r = e.getAttribute("data-prefix") || te._prefix;
|
|
114
|
-
te._prefix =
|
|
115
|
-
const i =
|
|
143
|
+
te._prefix = te.normalizePrefix(r);
|
|
144
|
+
const i = ir(
|
|
116
145
|
e.getAttribute("data-runtime")
|
|
117
146
|
);
|
|
118
147
|
i !== null && (te._runtime = i), te._strictBind = e.hasAttribute(
|
|
119
148
|
`${te._prefix}strict-bind`
|
|
120
149
|
);
|
|
121
150
|
const s = e.getAttribute(`${te._prefix}csp`);
|
|
122
|
-
s !== null && (te._csp =
|
|
151
|
+
s !== null && (te._csp = ht(s));
|
|
123
152
|
}
|
|
124
153
|
if (e instanceof HTMLScriptElement && e.hasAttribute(`${te._prefix}dev`)) {
|
|
125
154
|
V.set(
|
|
126
|
-
|
|
155
|
+
ht(
|
|
127
156
|
e.getAttribute(`${te._prefix}dev`) ?? ""
|
|
128
157
|
)
|
|
129
158
|
);
|
|
@@ -138,6 +167,23 @@ const te = class te {
|
|
|
138
167
|
} catch {
|
|
139
168
|
}
|
|
140
169
|
}
|
|
170
|
+
/**
|
|
171
|
+
* `data-prefix` の値を接頭辞へ正規化します。
|
|
172
|
+
*
|
|
173
|
+
* 仕様「接頭辞の規則」の「末尾を除いてハイフンを含められません」。使えない値は
|
|
174
|
+
* エラーを記録し、既定の `data-` を返します。エンジンが付ける属性
|
|
175
|
+
* (`data-haori-*`)と、利用者の宣言が同じ名前にならないようにするためです。
|
|
176
|
+
*
|
|
177
|
+
* @param prefix `data-prefix` の値
|
|
178
|
+
* @returns 末尾にハイフンを付けた接頭辞
|
|
179
|
+
*/
|
|
180
|
+
static normalizePrefix(e) {
|
|
181
|
+
const t = e.endsWith("-") ? e.slice(0, -1) : e;
|
|
182
|
+
return t.includes("-") ? (m.error(
|
|
183
|
+
"Haori",
|
|
184
|
+
`data-prefix の値「${e}」は使えません。末尾を除いてハイフンを含められません。既定の data- で動きます。`
|
|
185
|
+
), dt) : `${t}-`;
|
|
186
|
+
}
|
|
141
187
|
/**
|
|
142
188
|
* プレフィックスを取得します。
|
|
143
189
|
*
|
|
@@ -147,39 +193,10 @@ const te = class te {
|
|
|
147
193
|
return te._prefix;
|
|
148
194
|
}
|
|
149
195
|
};
|
|
150
|
-
te._prefix =
|
|
196
|
+
te._prefix = dt, te._runtime = rt, te._strictBind = !1, te._csp = !0;
|
|
151
197
|
let c = te;
|
|
152
198
|
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", c.detect) : c.detect());
|
|
153
|
-
class
|
|
154
|
-
/**
|
|
155
|
-
* 開発モードでのみコンソールに情報を出力します。
|
|
156
|
-
*
|
|
157
|
-
* @param message 出力するメッセージ
|
|
158
|
-
* @param args 追加の引数
|
|
159
|
-
*/
|
|
160
|
-
static info(e, ...t) {
|
|
161
|
-
V.isEnabled() && console.log && console.log(e, ...t);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* 開発モードでのみコンソールに警告を出力します。
|
|
165
|
-
*
|
|
166
|
-
* @param message 出力するメッセージ
|
|
167
|
-
* @param args 追加の引数
|
|
168
|
-
*/
|
|
169
|
-
static warn(e, ...t) {
|
|
170
|
-
V.isEnabled() && console.warn && console.warn(e, ...t);
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* モードに関係なくコンソールにエラーを出力します。
|
|
174
|
-
*
|
|
175
|
-
* @param message 出力するメッセージ
|
|
176
|
-
* @param args 追加の引数
|
|
177
|
-
*/
|
|
178
|
-
static error(e, ...t) {
|
|
179
|
-
console.error(e, ...t);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
const ir = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:", I = class I {
|
|
199
|
+
const sr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ft = "new:", I = class I {
|
|
183
200
|
/**
|
|
184
201
|
* 外部ライブラリ連携を登録します。
|
|
185
202
|
*
|
|
@@ -315,7 +332,7 @@ const ir = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
315
332
|
I.appliedKeys(e).set(r, s);
|
|
316
333
|
});
|
|
317
334
|
}), I.names(e, `${c.prefix}enhance-new`).forEach((r) => {
|
|
318
|
-
const i = `${
|
|
335
|
+
const i = `${ft}${r}`;
|
|
319
336
|
if (I.instances.get(e)?.has(i))
|
|
320
337
|
return;
|
|
321
338
|
const s = I.resolveGlobal(r);
|
|
@@ -352,7 +369,7 @@ const ir = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
352
369
|
static destroyElement(e) {
|
|
353
370
|
const t = I.instances.get(e);
|
|
354
371
|
t && (t.forEach((r, i) => {
|
|
355
|
-
if (i.startsWith(
|
|
372
|
+
if (i.startsWith(ft))
|
|
356
373
|
return;
|
|
357
374
|
const s = I.enhancers.get(i);
|
|
358
375
|
!s || typeof s.destroy != "function" || I.run(`enhance "${i}" destroy`, () => {
|
|
@@ -398,7 +415,7 @@ const ir = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
398
415
|
* @returns 解決した値。解決できない場合は null
|
|
399
416
|
*/
|
|
400
417
|
static resolveGlobal(e) {
|
|
401
|
-
if (!
|
|
418
|
+
if (!sr.test(e))
|
|
402
419
|
return m.error(
|
|
403
420
|
"[Haori]",
|
|
404
421
|
`${c.prefix}enhance-new accepts a dot-separated global reference only: ${e}`
|
|
@@ -452,14 +469,14 @@ const ir = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
452
469
|
};
|
|
453
470
|
I.enhancers = /* @__PURE__ */ new Map(), I.instances = /* @__PURE__ */ new WeakMap(), I.warnedUnknownNames = /* @__PURE__ */ new Set(), I.warnedMissingGlobals = /* @__PURE__ */ new Set(), I.visited = /* @__PURE__ */ new WeakSet(), I.mutationCapture = null;
|
|
454
471
|
let le = I;
|
|
455
|
-
const Ft = "yyyy/MM/dd HH:mm",
|
|
456
|
-
function me(
|
|
457
|
-
return String(
|
|
472
|
+
const Ft = "yyyy/MM/dd HH:mm", nr = "en-US", pt = 1e4;
|
|
473
|
+
function me(p) {
|
|
474
|
+
return String(p).padStart(2, "0");
|
|
458
475
|
}
|
|
459
|
-
function
|
|
476
|
+
function Mt(p, e, t, r, i, s) {
|
|
460
477
|
return {
|
|
461
|
-
yyyy: String(
|
|
462
|
-
yy: me(
|
|
478
|
+
yyyy: String(p).padStart(4, "0"),
|
|
479
|
+
yy: me(p % 100),
|
|
463
480
|
MM: me(e),
|
|
464
481
|
M: String(e),
|
|
465
482
|
dd: me(t),
|
|
@@ -470,7 +487,7 @@ function Ct(f, e, t, r, i, s) {
|
|
|
470
487
|
ss: me(s)
|
|
471
488
|
};
|
|
472
489
|
}
|
|
473
|
-
function
|
|
490
|
+
function $t(p, e) {
|
|
474
491
|
let t;
|
|
475
492
|
try {
|
|
476
493
|
t = new Intl.DateTimeFormat("en-US", {
|
|
@@ -482,7 +499,7 @@ function Mt(f, e) {
|
|
|
482
499
|
hour: "2-digit",
|
|
483
500
|
minute: "2-digit",
|
|
484
501
|
second: "2-digit"
|
|
485
|
-
}).formatToParts(
|
|
502
|
+
}).formatToParts(p);
|
|
486
503
|
} catch {
|
|
487
504
|
return null;
|
|
488
505
|
}
|
|
@@ -490,20 +507,20 @@ function Mt(f, e) {
|
|
|
490
507
|
for (const u of t)
|
|
491
508
|
u.type !== "literal" && (r[u.type] = u.value);
|
|
492
509
|
const i = Number(r.year), s = Number(r.month), n = Number(r.day), a = Number(r.hour), o = Number(r.minute), l = Number(r.second);
|
|
493
|
-
return !Number.isFinite(i) || !Number.isFinite(s) || !Number.isFinite(n) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(l) ? null :
|
|
510
|
+
return !Number.isFinite(i) || !Number.isFinite(s) || !Number.isFinite(n) || !Number.isFinite(a) || !Number.isFinite(o) || !Number.isFinite(l) ? null : Mt(i, s, n, a, o, l);
|
|
494
511
|
}
|
|
495
|
-
function Ze(
|
|
496
|
-
if (
|
|
512
|
+
function Ze(p, e = Ft, t) {
|
|
513
|
+
if (p == null || p === "")
|
|
497
514
|
return "";
|
|
498
|
-
const r =
|
|
515
|
+
const r = p instanceof Date ? p : new Date(p);
|
|
499
516
|
if (Number.isNaN(r.getTime()))
|
|
500
517
|
return "";
|
|
501
518
|
let i;
|
|
502
519
|
if (typeof t == "string" && t.trim() !== "") {
|
|
503
|
-
if (i =
|
|
520
|
+
if (i = $t(r, t.trim()), i === null)
|
|
504
521
|
return "";
|
|
505
522
|
} else
|
|
506
|
-
i =
|
|
523
|
+
i = Mt(
|
|
507
524
|
r.getFullYear(),
|
|
508
525
|
r.getMonth() + 1,
|
|
509
526
|
r.getDate(),
|
|
@@ -517,15 +534,15 @@ function Ze(f, e = Ft, t) {
|
|
|
517
534
|
(n, a) => a !== void 0 ? a === "" ? "'" : a : s[n]
|
|
518
535
|
);
|
|
519
536
|
}
|
|
520
|
-
const
|
|
521
|
-
function
|
|
522
|
-
return Ze(/* @__PURE__ */ new Date(),
|
|
537
|
+
const ar = "yyyy-MM-dd";
|
|
538
|
+
function Pt(p = Ft, e) {
|
|
539
|
+
return Ze(/* @__PURE__ */ new Date(), p, e);
|
|
523
540
|
}
|
|
524
|
-
function
|
|
525
|
-
const r = Number.isFinite(
|
|
541
|
+
function Lt(p = 0, e = ar, t) {
|
|
542
|
+
const r = Number.isFinite(p) ? Math.trunc(p) : 0, i = typeof t == "string" && t.trim() !== "" ? t.trim() : "";
|
|
526
543
|
let s, n, a;
|
|
527
544
|
if (i !== "") {
|
|
528
|
-
const l =
|
|
545
|
+
const l = $t(/* @__PURE__ */ new Date(), i);
|
|
529
546
|
if (l === null)
|
|
530
547
|
return "";
|
|
531
548
|
s = Number(l.yyyy), n = Number(l.MM), a = Number(l.dd);
|
|
@@ -536,14 +553,14 @@ function Pt(f = 0, e = nr, t) {
|
|
|
536
553
|
const o = new Date(Date.UTC(s, n - 1, a + r));
|
|
537
554
|
return Ze(o, e, "UTC");
|
|
538
555
|
}
|
|
539
|
-
function
|
|
540
|
-
if (
|
|
556
|
+
function Ot(p, e) {
|
|
557
|
+
if (p == null)
|
|
541
558
|
return "";
|
|
542
559
|
let t;
|
|
543
|
-
if (typeof
|
|
544
|
-
t =
|
|
560
|
+
if (typeof p == "number")
|
|
561
|
+
t = p;
|
|
545
562
|
else {
|
|
546
|
-
const i = String(
|
|
563
|
+
const i = String(p).trim();
|
|
547
564
|
if (i === "")
|
|
548
565
|
return "";
|
|
549
566
|
t = Number(i);
|
|
@@ -555,24 +572,24 @@ function Lt(f, e) {
|
|
|
555
572
|
const i = Math.max(0, Math.trunc(e));
|
|
556
573
|
r.minimumFractionDigits = i, r.maximumFractionDigits = i;
|
|
557
574
|
}
|
|
558
|
-
return new Intl.NumberFormat(
|
|
575
|
+
return new Intl.NumberFormat(nr, r).format(t);
|
|
559
576
|
}
|
|
560
|
-
function
|
|
577
|
+
function Bt(p, e, t) {
|
|
561
578
|
let r, i, s;
|
|
562
|
-
if (e === void 0 ? (r = 0, i =
|
|
579
|
+
if (e === void 0 ? (r = 0, i = p, s = 1) : (r = p, i = e, s = t === void 0 ? 1 : t), !Number.isFinite(r) || !Number.isFinite(i) || !Number.isFinite(s) || s === 0)
|
|
563
580
|
return [];
|
|
564
581
|
r = Math.trunc(r), i = Math.trunc(i), s = Math.trunc(s);
|
|
565
582
|
const n = [];
|
|
566
583
|
if (s > 0)
|
|
567
|
-
for (let a = r; a < i && n.length <
|
|
584
|
+
for (let a = r; a < i && n.length < pt; a += s)
|
|
568
585
|
n.push(a);
|
|
569
586
|
else
|
|
570
|
-
for (let a = r; a > i && n.length <
|
|
587
|
+
for (let a = r; a > i && n.length < pt; a += s)
|
|
571
588
|
n.push(a);
|
|
572
589
|
return n;
|
|
573
590
|
}
|
|
574
|
-
function
|
|
575
|
-
const r = Math.trunc(Number(
|
|
591
|
+
function Ut(p, e, t = {}) {
|
|
592
|
+
const r = Math.trunc(Number(p));
|
|
576
593
|
if (!Number.isFinite(r) || r <= 0)
|
|
577
594
|
return [];
|
|
578
595
|
const i = Math.min(
|
|
@@ -608,15 +625,15 @@ function Bt(f, e, t = {}) {
|
|
|
608
625
|
}
|
|
609
626
|
return l;
|
|
610
627
|
}
|
|
611
|
-
const
|
|
612
|
-
function qe(
|
|
613
|
-
const t = Number(
|
|
628
|
+
const or = /^(\d{4})-(\d{1,2})$/, lr = 1200;
|
|
629
|
+
function qe(p, e) {
|
|
630
|
+
const t = Number(p);
|
|
614
631
|
return Number.isFinite(t) ? Math.trunc(t) : e;
|
|
615
632
|
}
|
|
616
|
-
function Qe(
|
|
617
|
-
if (typeof
|
|
633
|
+
function Qe(p, e) {
|
|
634
|
+
if (typeof p != "string")
|
|
618
635
|
return "";
|
|
619
|
-
const t =
|
|
636
|
+
const t = or.exec(p.trim());
|
|
620
637
|
if (!t)
|
|
621
638
|
return "";
|
|
622
639
|
const r = Number(t[1]), i = Number(t[2]);
|
|
@@ -625,31 +642,31 @@ function Qe(f, e) {
|
|
|
625
642
|
const s = Number.isFinite(e) ? Math.trunc(e) : 0, n = r * 12 + (i - 1) + s, a = Math.floor(n / 12), o = n - a * 12 + 1;
|
|
626
643
|
return `${String(a).padStart(4, "0")}-${me(o)}`;
|
|
627
644
|
}
|
|
628
|
-
function
|
|
629
|
-
if (typeof
|
|
630
|
-
return Qe(
|
|
645
|
+
function cr(p) {
|
|
646
|
+
if (typeof p == "string" && p.trim() !== "")
|
|
647
|
+
return Qe(p, 0);
|
|
631
648
|
const e = /* @__PURE__ */ new Date();
|
|
632
649
|
return `${String(e.getFullYear()).padStart(4, "0")}-${me(e.getMonth() + 1)}`;
|
|
633
650
|
}
|
|
634
|
-
function
|
|
635
|
-
const t = Math.trunc(Number(
|
|
651
|
+
function Ht(p, e) {
|
|
652
|
+
const t = Math.trunc(Number(p));
|
|
636
653
|
if (!Number.isFinite(t) || t < 0)
|
|
637
654
|
return [];
|
|
638
|
-
const r =
|
|
655
|
+
const r = cr(e);
|
|
639
656
|
if (r === "")
|
|
640
657
|
return [];
|
|
641
|
-
const i = Math.min(t,
|
|
658
|
+
const i = Math.min(t, lr), s = [];
|
|
642
659
|
for (let n = 0; n <= i; n += 1) {
|
|
643
660
|
const a = Qe(r, -n);
|
|
644
661
|
s.push({ targetMonth: a, label: a.replace(/-/g, "/") });
|
|
645
662
|
}
|
|
646
663
|
return s;
|
|
647
664
|
}
|
|
648
|
-
function
|
|
665
|
+
function Vt(p, e) {
|
|
649
666
|
const t = { start: 0, end: 0, total: 0, empty: !0 };
|
|
650
|
-
if (!
|
|
667
|
+
if (!p || typeof p != "object")
|
|
651
668
|
return t;
|
|
652
|
-
const r =
|
|
669
|
+
const r = p, i = qe(r.totalElements ?? r.totalCount, 0);
|
|
653
670
|
if (i <= 0)
|
|
654
671
|
return t;
|
|
655
672
|
const s = Math.max(0, qe(r.number, 0)), n = Math.max(0, qe(r.size, 0)), a = s * n, o = Math.min(a + 1, i);
|
|
@@ -663,19 +680,19 @@ function Ht(f, e) {
|
|
|
663
680
|
const u = Math.min(a + l, i);
|
|
664
681
|
return { start: o, end: Math.max(u, o), total: i, empty: !1 };
|
|
665
682
|
}
|
|
666
|
-
function
|
|
667
|
-
if (!Array.isArray(
|
|
683
|
+
function qt(p, e, t) {
|
|
684
|
+
if (!Array.isArray(p) || p.length === 0)
|
|
668
685
|
return null;
|
|
669
|
-
const r = String(t), i =
|
|
686
|
+
const r = String(t), i = p.find(
|
|
670
687
|
(s) => s != null && String(s[e]) === r
|
|
671
688
|
);
|
|
672
689
|
return i === void 0 ? null : i;
|
|
673
690
|
}
|
|
674
|
-
function
|
|
675
|
-
if (!Array.isArray(
|
|
691
|
+
function Wt(p, e) {
|
|
692
|
+
if (!Array.isArray(p))
|
|
676
693
|
return 0;
|
|
677
694
|
let t = 0;
|
|
678
|
-
for (const r of
|
|
695
|
+
for (const r of p) {
|
|
679
696
|
const i = e == null ? r : r?.[e];
|
|
680
697
|
if (i == null || i === "")
|
|
681
698
|
continue;
|
|
@@ -684,25 +701,25 @@ function qt(f, e) {
|
|
|
684
701
|
}
|
|
685
702
|
return t;
|
|
686
703
|
}
|
|
687
|
-
function
|
|
688
|
-
return e == null ||
|
|
704
|
+
function jt(p, e) {
|
|
705
|
+
return e == null || p == null ? String(p) : String(p[e]);
|
|
689
706
|
}
|
|
690
|
-
function
|
|
691
|
-
if (!Array.isArray(
|
|
707
|
+
function Kt(p, e) {
|
|
708
|
+
if (!Array.isArray(p))
|
|
692
709
|
return [];
|
|
693
710
|
const t = /* @__PURE__ */ new Set(), r = [];
|
|
694
|
-
for (const i of
|
|
695
|
-
const s =
|
|
711
|
+
for (const i of p) {
|
|
712
|
+
const s = jt(i, e);
|
|
696
713
|
t.has(s) || (t.add(s), r.push(i));
|
|
697
714
|
}
|
|
698
715
|
return r;
|
|
699
716
|
}
|
|
700
|
-
function
|
|
701
|
-
if (!Array.isArray(
|
|
717
|
+
function zt(p, e) {
|
|
718
|
+
if (!Array.isArray(p))
|
|
702
719
|
return [];
|
|
703
720
|
const t = /* @__PURE__ */ new Map(), r = [];
|
|
704
|
-
for (const i of
|
|
705
|
-
const s =
|
|
721
|
+
for (const i of p) {
|
|
722
|
+
const s = jt(i, e), n = t.get(s);
|
|
706
723
|
if (n === void 0) {
|
|
707
724
|
const a = i == null ? i : i[e];
|
|
708
725
|
t.set(s, r.length), r.push({ key: a, items: [i] });
|
|
@@ -711,20 +728,20 @@ function Kt(f, e) {
|
|
|
711
728
|
}
|
|
712
729
|
return r;
|
|
713
730
|
}
|
|
714
|
-
const
|
|
731
|
+
const ur = Object.freeze({
|
|
715
732
|
date: Ze,
|
|
716
|
-
now:
|
|
717
|
-
today:
|
|
718
|
-
number:
|
|
719
|
-
pages:
|
|
720
|
-
range:
|
|
733
|
+
now: Pt,
|
|
734
|
+
today: Lt,
|
|
735
|
+
number: Ot,
|
|
736
|
+
pages: Ut,
|
|
737
|
+
range: Bt,
|
|
721
738
|
monthAdd: Qe,
|
|
722
|
-
monthRange:
|
|
723
|
-
pageSummary:
|
|
724
|
-
findBy:
|
|
725
|
-
sum:
|
|
726
|
-
distinct:
|
|
727
|
-
groupBy:
|
|
739
|
+
monthRange: Ht,
|
|
740
|
+
pageSummary: Vt,
|
|
741
|
+
findBy: qt,
|
|
742
|
+
sum: Wt,
|
|
743
|
+
distinct: Kt,
|
|
744
|
+
groupBy: zt
|
|
728
745
|
});
|
|
729
746
|
class at {
|
|
730
747
|
constructor() {
|
|
@@ -880,7 +897,7 @@ const lt = class lt {
|
|
|
880
897
|
};
|
|
881
898
|
lt.ASYNC_QUEUE = new at();
|
|
882
899
|
let J = lt;
|
|
883
|
-
const
|
|
900
|
+
const Gt = /* @__PURE__ */ new Set([
|
|
884
901
|
"window",
|
|
885
902
|
"self",
|
|
886
903
|
"globalThis",
|
|
@@ -911,7 +928,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
911
928
|
]), Ke = /* @__PURE__ */ new Set([
|
|
912
929
|
"eval",
|
|
913
930
|
"arguments"
|
|
914
|
-
]),
|
|
931
|
+
]), Yt = /* @__PURE__ */ new Set([
|
|
915
932
|
"location",
|
|
916
933
|
"history",
|
|
917
934
|
"document",
|
|
@@ -967,7 +984,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
967
984
|
"public",
|
|
968
985
|
"static",
|
|
969
986
|
"super"
|
|
970
|
-
]),
|
|
987
|
+
]), Xt = /* @__PURE__ */ new Set([
|
|
971
988
|
"Math",
|
|
972
989
|
"JSON",
|
|
973
990
|
"Intl",
|
|
@@ -1018,7 +1035,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
1018
1035
|
"encodeURIComponent",
|
|
1019
1036
|
"decodeURI",
|
|
1020
1037
|
"decodeURIComponent"
|
|
1021
|
-
]),
|
|
1038
|
+
]), dr = [
|
|
1022
1039
|
">>>",
|
|
1023
1040
|
"===",
|
|
1024
1041
|
"!==",
|
|
@@ -1055,7 +1072,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
1055
1072
|
"!",
|
|
1056
1073
|
"<",
|
|
1057
1074
|
">"
|
|
1058
|
-
],
|
|
1075
|
+
], hr = {
|
|
1059
1076
|
"==": 1,
|
|
1060
1077
|
"!=": 1,
|
|
1061
1078
|
"===": 1,
|
|
@@ -1072,29 +1089,29 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
1072
1089
|
"*": 5,
|
|
1073
1090
|
"/": 5,
|
|
1074
1091
|
"%": 5
|
|
1075
|
-
},
|
|
1092
|
+
}, fr = /* @__PURE__ */ new Set([
|
|
1076
1093
|
"undefined",
|
|
1077
1094
|
"NaN",
|
|
1078
1095
|
"Infinity"
|
|
1079
1096
|
]);
|
|
1080
|
-
function et(
|
|
1081
|
-
return
|
|
1082
|
-
` ||
|
|
1097
|
+
function et(p) {
|
|
1098
|
+
return p === `
|
|
1099
|
+
` || p === "\r" || p === "\u2028" || p === "\u2029";
|
|
1083
1100
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return /[A-Za-z_$]/.test(
|
|
1101
|
+
function pr(p) {
|
|
1102
|
+
return /[A-Za-z_$]/.test(p);
|
|
1086
1103
|
}
|
|
1087
|
-
function
|
|
1088
|
-
return
|
|
1104
|
+
function gt(p) {
|
|
1105
|
+
return p !== void 0 && /[A-Za-z0-9_$]/.test(p);
|
|
1089
1106
|
}
|
|
1090
|
-
function Y(
|
|
1091
|
-
return new SyntaxError(`${
|
|
1107
|
+
function Y(p, e) {
|
|
1108
|
+
return new SyntaxError(`${p} (at position ${e})`);
|
|
1092
1109
|
}
|
|
1093
1110
|
const X = {
|
|
1094
1111
|
comment: "Comments are not allowed in expressions",
|
|
1095
|
-
unexpectedCharacter: (
|
|
1112
|
+
unexpectedCharacter: (p) => `Unexpected character '${p}'`,
|
|
1096
1113
|
unterminatedRegExp: "Unterminated regular expression",
|
|
1097
|
-
invalidRegExp: (
|
|
1114
|
+
invalidRegExp: (p) => `Invalid regular expression: ${p}`,
|
|
1098
1115
|
numericSeparator: "Numeric separators are not allowed here",
|
|
1099
1116
|
invalidToken: "Invalid or unexpected token",
|
|
1100
1117
|
octalLiteral: "Octal literals are not allowed in strict mode",
|
|
@@ -1103,17 +1120,17 @@ const X = {
|
|
|
1103
1120
|
invalidHex: "Invalid hexadecimal escape sequence",
|
|
1104
1121
|
invalidUnicode: "Invalid Unicode escape sequence",
|
|
1105
1122
|
unexpectedEnd: "Unexpected end of expression",
|
|
1106
|
-
unexpectedToken: (
|
|
1107
|
-
notInExpressions: (
|
|
1108
|
-
notParameter: (
|
|
1109
|
-
notProperty: (
|
|
1123
|
+
unexpectedToken: (p) => `Unexpected token '${p}'`,
|
|
1124
|
+
notInExpressions: (p) => `'${p}' cannot be used in expressions`,
|
|
1125
|
+
notParameter: (p) => `'${p}' cannot be used as a parameter`,
|
|
1126
|
+
notProperty: (p) => `'${p}' cannot be used as a property`,
|
|
1110
1127
|
duplicateParameter: "Duplicate parameter name",
|
|
1111
1128
|
blockBody: "Arrow functions with a block body are not supported",
|
|
1112
1129
|
mixNullish: "Cannot mix ?? with || or &&",
|
|
1113
1130
|
unaryExponent: "Unary operator used immediately before exponentiation expression",
|
|
1114
1131
|
invalidUpdate: "Invalid left-hand side expression in update operation"
|
|
1115
1132
|
};
|
|
1116
|
-
class
|
|
1133
|
+
class gr {
|
|
1117
1134
|
/**
|
|
1118
1135
|
* @param source 式の文字列
|
|
1119
1136
|
*/
|
|
@@ -1144,9 +1161,9 @@ class pr {
|
|
|
1144
1161
|
return this.readNumber(r, t);
|
|
1145
1162
|
if (i === '"' || i === "'")
|
|
1146
1163
|
return this.readString(r, t);
|
|
1147
|
-
if (
|
|
1164
|
+
if (pr(i)) {
|
|
1148
1165
|
let n = r + 1;
|
|
1149
|
-
for (;
|
|
1166
|
+
for (; gt(e[n]); )
|
|
1150
1167
|
n += 1;
|
|
1151
1168
|
return this.position = n, {
|
|
1152
1169
|
type: "identifier",
|
|
@@ -1158,7 +1175,7 @@ class pr {
|
|
|
1158
1175
|
}
|
|
1159
1176
|
if (i === "/" && (s === "/" || s === "*"))
|
|
1160
1177
|
throw Y(X.comment, r);
|
|
1161
|
-
for (const n of
|
|
1178
|
+
for (const n of dr)
|
|
1162
1179
|
if (e.startsWith(n, r))
|
|
1163
1180
|
return this.position = r + n.length, {
|
|
1164
1181
|
type: "punct",
|
|
@@ -1205,7 +1222,7 @@ class pr {
|
|
|
1205
1222
|
const n = r.slice(e + 1, i);
|
|
1206
1223
|
i += 1;
|
|
1207
1224
|
const a = i;
|
|
1208
|
-
for (;
|
|
1225
|
+
for (; gt(r[i]); )
|
|
1209
1226
|
i += 1;
|
|
1210
1227
|
const o = r.slice(a, i);
|
|
1211
1228
|
try {
|
|
@@ -1409,12 +1426,12 @@ class pr {
|
|
|
1409
1426
|
};
|
|
1410
1427
|
}
|
|
1411
1428
|
}
|
|
1412
|
-
class
|
|
1429
|
+
class mr {
|
|
1413
1430
|
/**
|
|
1414
1431
|
* @param source 式の文字列
|
|
1415
1432
|
*/
|
|
1416
1433
|
constructor(e) {
|
|
1417
|
-
this.lastEnd = 0, this.lexer = new
|
|
1434
|
+
this.lastEnd = 0, this.lexer = new gr(e), this.token = this.lexer.lex();
|
|
1418
1435
|
}
|
|
1419
1436
|
/**
|
|
1420
1437
|
* 式全体を解析します。
|
|
@@ -1795,7 +1812,7 @@ class gr {
|
|
|
1795
1812
|
const t = this.token.start;
|
|
1796
1813
|
let r = this.parseExponent();
|
|
1797
1814
|
for (; ; ) {
|
|
1798
|
-
const i = this.token, s = i.type === "punct" ?
|
|
1815
|
+
const i = this.token, s = i.type === "punct" ? hr[i.value] : void 0;
|
|
1799
1816
|
if (s === void 0 || s < e)
|
|
1800
1817
|
return r;
|
|
1801
1818
|
this.advance();
|
|
@@ -1891,7 +1908,7 @@ class gr {
|
|
|
1891
1908
|
return !0;
|
|
1892
1909
|
switch (e.type) {
|
|
1893
1910
|
case "Identifier":
|
|
1894
|
-
return !
|
|
1911
|
+
return !fr.has(e.name);
|
|
1895
1912
|
case "Member":
|
|
1896
1913
|
case "Call":
|
|
1897
1914
|
return !0;
|
|
@@ -2108,10 +2125,10 @@ class gr {
|
|
|
2108
2125
|
throw this.unexpected();
|
|
2109
2126
|
}
|
|
2110
2127
|
}
|
|
2111
|
-
function
|
|
2112
|
-
return new
|
|
2128
|
+
function yr(p) {
|
|
2129
|
+
return new mr(p).parseProgram();
|
|
2113
2130
|
}
|
|
2114
|
-
class
|
|
2131
|
+
class Jt extends ReferenceError {
|
|
2115
2132
|
/**
|
|
2116
2133
|
* @param identifier 参照された名前
|
|
2117
2134
|
*/
|
|
@@ -2119,30 +2136,30 @@ class Xt extends ReferenceError {
|
|
|
2119
2136
|
super(`${e} is not defined`), this.identifier = e;
|
|
2120
2137
|
}
|
|
2121
2138
|
}
|
|
2122
|
-
const
|
|
2139
|
+
const mt = /* @__PURE__ */ new Map([
|
|
2123
2140
|
["undefined", void 0],
|
|
2124
2141
|
["NaN", NaN],
|
|
2125
2142
|
["Infinity", 1 / 0]
|
|
2126
2143
|
]);
|
|
2127
|
-
function
|
|
2128
|
-
return Object.prototype.propertyIsEnumerable.call(
|
|
2144
|
+
function yt(p, e) {
|
|
2145
|
+
return Object.prototype.propertyIsEnumerable.call(p, e);
|
|
2129
2146
|
}
|
|
2130
|
-
function
|
|
2131
|
-
const e = typeof
|
|
2147
|
+
function bt(p) {
|
|
2148
|
+
const e = typeof p == "symbol" ? p : String(p);
|
|
2132
2149
|
return ze.has(e) ? "undefined" : e;
|
|
2133
2150
|
}
|
|
2134
|
-
function
|
|
2135
|
-
return typeof
|
|
2151
|
+
function br(p) {
|
|
2152
|
+
return typeof p == "bigint" ? p : Number(p);
|
|
2136
2153
|
}
|
|
2137
|
-
function
|
|
2138
|
-
return
|
|
2154
|
+
function Et(p) {
|
|
2155
|
+
return p[Symbol.iterator]();
|
|
2139
2156
|
}
|
|
2140
|
-
function
|
|
2157
|
+
function At(p, e, t) {
|
|
2141
2158
|
const r = Object(e);
|
|
2142
2159
|
for (const i of Reflect.ownKeys(r)) {
|
|
2143
2160
|
if (t?.has(i))
|
|
2144
2161
|
continue;
|
|
2145
|
-
Reflect.getOwnPropertyDescriptor(r, i)?.enumerable && Object.defineProperty(
|
|
2162
|
+
Reflect.getOwnPropertyDescriptor(r, i)?.enumerable && Object.defineProperty(p, i, {
|
|
2146
2163
|
value: r[i],
|
|
2147
2164
|
writable: !0,
|
|
2148
2165
|
enumerable: !0,
|
|
@@ -2166,7 +2183,7 @@ const ct = class ct {
|
|
|
2166
2183
|
return t;
|
|
2167
2184
|
let r;
|
|
2168
2185
|
try {
|
|
2169
|
-
const i =
|
|
2186
|
+
const i = yr(e);
|
|
2170
2187
|
r = {
|
|
2171
2188
|
expression: e,
|
|
2172
2189
|
evaluator: this.compileNode(i, null)
|
|
@@ -2330,7 +2347,7 @@ const ct = class ct {
|
|
|
2330
2347
|
* @returns 種類
|
|
2331
2348
|
*/
|
|
2332
2349
|
static classify(e) {
|
|
2333
|
-
return
|
|
2350
|
+
return Yt.has(e) ? "rebindable" : Gt.has(e) ? "forbidden" : mt.has(e) ? "constant" : Xt.has(e) ? "builtin" : "free";
|
|
2334
2351
|
}
|
|
2335
2352
|
/**
|
|
2336
2353
|
* バインドに無い識別子を参照したときの値を返します。
|
|
@@ -2341,7 +2358,7 @@ const ct = class ct {
|
|
|
2341
2358
|
*/
|
|
2342
2359
|
static missing(e, t) {
|
|
2343
2360
|
if (e.missingIdentifier === "throw")
|
|
2344
|
-
throw new
|
|
2361
|
+
throw new Jt(t);
|
|
2345
2362
|
}
|
|
2346
2363
|
/**
|
|
2347
2364
|
* 識別子の参照を変換します。
|
|
@@ -2366,14 +2383,14 @@ const ct = class ct {
|
|
|
2366
2383
|
const n = s.run;
|
|
2367
2384
|
if (n.overlay !== null && n.overlay.has(e))
|
|
2368
2385
|
return n.overlay.get(e);
|
|
2369
|
-
if (
|
|
2386
|
+
if (yt(n.bindings, e))
|
|
2370
2387
|
return n.bindings[e];
|
|
2371
2388
|
switch (i) {
|
|
2372
2389
|
// 再バインドできる禁止識別子は、バインド値に無ければ `undefined`
|
|
2373
2390
|
// (`CONSTANTS` に無い名前なので、定数の分岐と同じ結果になる)。
|
|
2374
2391
|
case "rebindable":
|
|
2375
2392
|
case "constant":
|
|
2376
|
-
return
|
|
2393
|
+
return mt.get(e);
|
|
2377
2394
|
case "builtin":
|
|
2378
2395
|
return globalThis[e];
|
|
2379
2396
|
default:
|
|
@@ -2394,7 +2411,7 @@ const ct = class ct {
|
|
|
2394
2411
|
*/
|
|
2395
2412
|
static compileUpdate(e, t) {
|
|
2396
2413
|
const r = e.argument.name, i = e.operator === "++" ? 1 : -1, s = e.prefix, n = (u) => {
|
|
2397
|
-
const d =
|
|
2414
|
+
const d = br(u), y = typeof d == "bigint" ? d + BigInt(i) : d + i;
|
|
2398
2415
|
return [d, y];
|
|
2399
2416
|
}, a = this.findSlot(r, t);
|
|
2400
2417
|
if (a !== null) {
|
|
@@ -2407,7 +2424,7 @@ const ct = class ct {
|
|
|
2407
2424
|
const o = this.classify(r), l = this.compileIdentifier(r, null);
|
|
2408
2425
|
return (u) => {
|
|
2409
2426
|
const d = u.run;
|
|
2410
|
-
if (!(o !== "forbidden" &&
|
|
2427
|
+
if (!(o !== "forbidden" && yt(d.bindings, r)) && o !== "free")
|
|
2411
2428
|
throw new TypeError(`Assignment to constant variable '${r}'.`);
|
|
2412
2429
|
const [b, E] = n(l(u));
|
|
2413
2430
|
return d.overlay === null && (d.overlay = /* @__PURE__ */ new Map()), d.overlay.set(r, E), s ? E : b;
|
|
@@ -2483,7 +2500,7 @@ const ct = class ct {
|
|
|
2483
2500
|
return (s) => {
|
|
2484
2501
|
const n = r(s);
|
|
2485
2502
|
if (n != null)
|
|
2486
|
-
return n[
|
|
2503
|
+
return n[bt(i(s))];
|
|
2487
2504
|
};
|
|
2488
2505
|
}
|
|
2489
2506
|
/**
|
|
@@ -2508,7 +2525,7 @@ const ct = class ct {
|
|
|
2508
2525
|
if (a === null)
|
|
2509
2526
|
n += 1;
|
|
2510
2527
|
else if (a.spread) {
|
|
2511
|
-
const o =
|
|
2528
|
+
const o = Et(a.evaluate(i));
|
|
2512
2529
|
for (; ; ) {
|
|
2513
2530
|
const l = o.next();
|
|
2514
2531
|
if (l.done)
|
|
@@ -2550,7 +2567,7 @@ const ct = class ct {
|
|
|
2550
2567
|
return (i) => {
|
|
2551
2568
|
const s = {};
|
|
2552
2569
|
for (const n of r)
|
|
2553
|
-
n.key === null ?
|
|
2570
|
+
n.key === null ? At(s, n.evaluate(i), null) : s[n.key] = n.evaluate(i);
|
|
2554
2571
|
return s;
|
|
2555
2572
|
};
|
|
2556
2573
|
}
|
|
@@ -2581,7 +2598,7 @@ const ct = class ct {
|
|
|
2581
2598
|
const y = o(d);
|
|
2582
2599
|
if (y == null)
|
|
2583
2600
|
return;
|
|
2584
|
-
const b = u === null ? l :
|
|
2601
|
+
const b = u === null ? l : bt(u(d));
|
|
2585
2602
|
return s(y[b], y, d);
|
|
2586
2603
|
};
|
|
2587
2604
|
}
|
|
@@ -2626,7 +2643,7 @@ const ct = class ct {
|
|
|
2626
2643
|
);
|
|
2627
2644
|
if (i !== null) {
|
|
2628
2645
|
const o = {};
|
|
2629
|
-
|
|
2646
|
+
At(o, a, s), n.slots[i] = o;
|
|
2630
2647
|
}
|
|
2631
2648
|
};
|
|
2632
2649
|
}
|
|
@@ -2635,7 +2652,7 @@ const ct = class ct {
|
|
|
2635
2652
|
(s) => s === null ? null : this.compilePattern(s, t)
|
|
2636
2653
|
), i = e.rest === null ? null : this.compilePattern(e.rest, t);
|
|
2637
2654
|
return (s, n) => {
|
|
2638
|
-
const a =
|
|
2655
|
+
const a = Et(n);
|
|
2639
2656
|
let o = !1;
|
|
2640
2657
|
try {
|
|
2641
2658
|
for (const l of r) {
|
|
@@ -3169,7 +3186,7 @@ let ${e.join(", ")};`;
|
|
|
3169
3186
|
* @returns 未解決として報告する識別子名の一覧
|
|
3170
3187
|
*/
|
|
3171
3188
|
static extractUninitializedIdentifiers(e, t) {
|
|
3172
|
-
if (e instanceof
|
|
3189
|
+
if (e instanceof Jt)
|
|
3173
3190
|
return [e.identifier];
|
|
3174
3191
|
const r = String(e.message || ""), i = t.filter(
|
|
3175
3192
|
(s) => ["'", '"', "`"].some(
|
|
@@ -4465,7 +4482,7 @@ ${u}return (${y});` + d;
|
|
|
4465
4482
|
}
|
|
4466
4483
|
};
|
|
4467
4484
|
T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HELPERS = {
|
|
4468
|
-
...
|
|
4485
|
+
...ur
|
|
4469
4486
|
}, T.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, T.BUILTIN_DATA_PROPERTY = "data", T.BUILTIN_DATA_REFERENCE_PATTERN = /(^|[^\w$.])haori\s*(\.\s*data(?![\w$])|\[)/, T.IDENTIFIER_NAME_PATTERN = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u, T.STRICT_PARAMETER_RESERVED_WORDS = /* @__PURE__ */ new Set([
|
|
4470
4487
|
...[...Ge].filter((e) => e !== "await"),
|
|
4471
4488
|
...it,
|
|
@@ -4475,10 +4492,10 @@ T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HE
|
|
|
4475
4492
|
"false",
|
|
4476
4493
|
"null"
|
|
4477
4494
|
]), T.evalBlockedReported = !1, T.usableBindingKeyCache = /* @__PURE__ */ new Map(), T.loggedUnusableBindingKeys = /* @__PURE__ */ new Set(), T.compileFailedExpressions = /* @__PURE__ */ new Set(), T.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), T.forbiddenBindingValueSet = null, T.forbiddenBindingValueCacheResetScheduled = !1, T.loggedForbiddenKeySignatures = /* @__PURE__ */ new Set(), T.loggedForbiddenKeyResetScheduled = !1, T.FORBIDDEN_NAMES = [
|
|
4478
|
-
...
|
|
4495
|
+
...Gt
|
|
4479
4496
|
], T.STRICT_FORBIDDEN_NAMES = [
|
|
4480
4497
|
...Ke
|
|
4481
|
-
], T.REBINDABLE_FORBIDDEN_NAMES =
|
|
4498
|
+
], T.REBINDABLE_FORBIDDEN_NAMES = Yt, T.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
|
|
4482
4499
|
...T.FORBIDDEN_NAMES.filter(
|
|
4483
4500
|
(e) => !T.REBINDABLE_FORBIDDEN_NAMES.has(e)
|
|
4484
4501
|
),
|
|
@@ -4500,7 +4517,7 @@ T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HE
|
|
|
4500
4517
|
"Infinity",
|
|
4501
4518
|
// strict モードの予約語(`let` 宣言が構文エラーになる)
|
|
4502
4519
|
...it
|
|
4503
|
-
]), T.ALLOWED_GLOBAL_IDENTIFIERS =
|
|
4520
|
+
]), T.ALLOWED_GLOBAL_IDENTIFIERS = Xt, T.BUILTIN_HOLDER = Object.freeze(
|
|
4504
4521
|
Object.defineProperties(
|
|
4505
4522
|
{},
|
|
4506
4523
|
Object.fromEntries(
|
|
@@ -4618,7 +4635,7 @@ class Oe {
|
|
|
4618
4635
|
return /^(?:javascript|vbscript):/i.test(t);
|
|
4619
4636
|
}
|
|
4620
4637
|
}
|
|
4621
|
-
const ve = "data-haori-if-disabled",
|
|
4638
|
+
const ve = "data-haori-if-disabled", vt = "input, select, textarea, button, fieldset", P = class P {
|
|
4622
4639
|
/**
|
|
4623
4640
|
* 集計状態を初期化します。
|
|
4624
4641
|
*/
|
|
@@ -5128,8 +5145,8 @@ const ye = class ye {
|
|
|
5128
5145
|
}
|
|
5129
5146
|
};
|
|
5130
5147
|
ye.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
5131
|
-
let
|
|
5132
|
-
const v = class v extends
|
|
5148
|
+
let N = ye;
|
|
5149
|
+
const v = class v extends N {
|
|
5133
5150
|
/**
|
|
5134
5151
|
* エレメントフラグメントのコンストラクタ。
|
|
5135
5152
|
* アトリビュートや子フラグメントの作成も行います。
|
|
@@ -5149,7 +5166,7 @@ const v = class v extends D {
|
|
|
5149
5166
|
e.childNodes.forEach((i) => {
|
|
5150
5167
|
if (v.isOwnedWithinExternal(i))
|
|
5151
5168
|
return;
|
|
5152
|
-
const s =
|
|
5169
|
+
const s = N.peek(i)?.getParent() ?? null, n = N.get(i);
|
|
5153
5170
|
s !== null && s !== this && (t = t ?? s, s === t && r.push(n)), n.setParent(this), this.children.push(n);
|
|
5154
5171
|
}), t !== null && this.takeOverPlaceOf(t, r);
|
|
5155
5172
|
}
|
|
@@ -5189,7 +5206,7 @@ const v = class v extends D {
|
|
|
5189
5206
|
* @returns 取り込まない場合 true
|
|
5190
5207
|
*/
|
|
5191
5208
|
static isOwnedWithinExternal(e) {
|
|
5192
|
-
const r =
|
|
5209
|
+
const r = N.peek(e)?.getParent() ?? null;
|
|
5193
5210
|
if (r === null)
|
|
5194
5211
|
return !1;
|
|
5195
5212
|
const i = r.getTarget().closest(`[${c.prefix}external]`);
|
|
@@ -6290,7 +6307,7 @@ const v = class v extends D {
|
|
|
6290
6307
|
const t = this.getTarget().closest("select");
|
|
6291
6308
|
if (!t)
|
|
6292
6309
|
return !1;
|
|
6293
|
-
const r =
|
|
6310
|
+
const r = N.get(t);
|
|
6294
6311
|
return r instanceof v ? r.hasPendingUserEdit() : !1;
|
|
6295
6312
|
}
|
|
6296
6313
|
/**
|
|
@@ -6341,7 +6358,7 @@ const v = class v extends D {
|
|
|
6341
6358
|
getCheckableUserEditSequence(e) {
|
|
6342
6359
|
if (!e)
|
|
6343
6360
|
return this.userEditSequence;
|
|
6344
|
-
const t =
|
|
6361
|
+
const t = N.get(
|
|
6345
6362
|
this.getTarget().closest("select")
|
|
6346
6363
|
);
|
|
6347
6364
|
return t instanceof v ? t.userEditSequence : null;
|
|
@@ -6627,7 +6644,7 @@ const v = class v extends D {
|
|
|
6627
6644
|
const t = this.getTarget().closest("select");
|
|
6628
6645
|
if (!t)
|
|
6629
6646
|
return;
|
|
6630
|
-
const r =
|
|
6647
|
+
const r = N.get(t);
|
|
6631
6648
|
r instanceof v && r.syncValue();
|
|
6632
6649
|
}
|
|
6633
6650
|
/**
|
|
@@ -6770,7 +6787,7 @@ const v = class v extends D {
|
|
|
6770
6787
|
element: l,
|
|
6771
6788
|
rawName: e,
|
|
6772
6789
|
template: r
|
|
6773
|
-
}), d = v.isLateActionAttribute(e) ? re.withoutDiagnosis(u) : u(), y = o.isEvaluate || o.isRawEvaluate, b = e === t && v.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), E = o.isSingleExpression(), A = Ee.joinEvaluateResults(d.results), w = d.results.length === 1 ? d.results[0] : A, M = t === "value" && v.resolveDeclaredValueType(l) === "boolean",
|
|
6790
|
+
}), d = v.isLateActionAttribute(e) ? re.withoutDiagnosis(u) : u(), y = o.isEvaluate || o.isRawEvaluate, b = e === t && v.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), E = o.isSingleExpression(), A = Ee.joinEvaluateResults(d.results), w = d.results.length === 1 ? d.results[0] : A, M = t === "value" && v.resolveDeclaredValueType(l) === "boolean", F = w === !1 && !M, se = !o.isForceEvaluation() && (t !== e ? d.hasUnresolvedReference || w === null || w === void 0 || F : b ? d.hasUnresolvedReference || w === null || w === void 0 || w === !1 : E ? d.hasUnresolvedReference || w === null || w === void 0 || F : y && A === "");
|
|
6774
6791
|
if (se && d.hasUnresolvedReference && v.warnUnresolvedAttribute(
|
|
6775
6792
|
e,
|
|
6776
6793
|
t,
|
|
@@ -6788,7 +6805,7 @@ const v = class v extends D {
|
|
|
6788
6805
|
l
|
|
6789
6806
|
);
|
|
6790
6807
|
}
|
|
6791
|
-
const
|
|
6808
|
+
const C = o.isForceEvaluation() ? r : E ? w : A, Z = i && o.isEvaluate && t === "value" && v.isValuePropertyTarget(l), ee = l.getRootNode(), ne = this.userEditSequence, K = Z && v.isUserEditableValue(l) && (l === ee.activeElement || this.hasPendingUserEdit()), ae = se || C === null || C === !1 && !M ? null : String(C), j = o.isEvaluate && ae !== null && v.URL_ATTRIBUTES.has(t) && Oe.hasScriptScheme(ae);
|
|
6792
6809
|
j && m.warn(
|
|
6793
6810
|
"[Haori]",
|
|
6794
6811
|
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${ae}`,
|
|
@@ -6801,18 +6818,18 @@ const v = class v extends D {
|
|
|
6801
6818
|
U
|
|
6802
6819
|
), this.clearUnappliedValueWrite()), (fe || ce) && !G && this.syncCheckableValueFromDom(ce), Promise.resolve();
|
|
6803
6820
|
const ut = J.enqueue(() => {
|
|
6804
|
-
const pe = this.getCheckableUserEditSequence(ce) !== ie,
|
|
6821
|
+
const pe = this.getCheckableUserEditSequence(ce) !== ie, er = G || pe ? ce ? v.captureSelection(
|
|
6805
6822
|
// 守るべき選択があるのは所属する `<select>` があるときだけ。
|
|
6806
6823
|
l.closest(
|
|
6807
6824
|
"select"
|
|
6808
6825
|
)
|
|
6809
6826
|
) : fe && l.type === "radio" ? v.captureRadioGroup(l) : null : null;
|
|
6810
|
-
B && l.setAttribute(e, r), k === null ? l.removeAttribute(t) : ue && (l.setAttribute(t, k), t === `${c.prefix}bind` && this.recordSelfWrittenBind(k)), t === "style" && this.captureAndHideDisplay(),
|
|
6827
|
+
B && l.setAttribute(e, r), k === null ? l.removeAttribute(t) : ue && (l.setAttribute(t, k), t === `${c.prefix}bind` && this.recordSelfWrittenBind(k)), t === "style" && this.captureAndHideDisplay(), er?.(), Z && !K && !(v.isUserEditableValue(l) && this.isSupersededByUserEdit(ne)) && (this.value = this.normalizeValueForElement(
|
|
6811
6828
|
l,
|
|
6812
6829
|
U
|
|
6813
6830
|
), Q && (l.value = U), this.recordValueWriteResult(l.value === U));
|
|
6814
|
-
const
|
|
6815
|
-
|
|
6831
|
+
const tr = _e && !pe, rr = Ve && !pe;
|
|
6832
|
+
tr && (l.checked = Ae), rr && (l.selected = Ae), (_e || Ve) && this.syncCheckableValueFromDom(Ve);
|
|
6816
6833
|
}).finally(() => {
|
|
6817
6834
|
this.releaseSelfWritingAttributes(n);
|
|
6818
6835
|
});
|
|
@@ -6917,7 +6934,7 @@ const v = class v extends D {
|
|
|
6917
6934
|
const i = t ? r.nextSibling : r;
|
|
6918
6935
|
let s = t ? r.nextSibling : r;
|
|
6919
6936
|
for (; s !== null; ) {
|
|
6920
|
-
const n =
|
|
6937
|
+
const n = N.get(s);
|
|
6921
6938
|
if (n !== null) {
|
|
6922
6939
|
const a = this.children.indexOf(n);
|
|
6923
6940
|
if (a !== -1)
|
|
@@ -7158,7 +7175,7 @@ const v = class v extends D {
|
|
|
7158
7175
|
* @returns 戻り値はありません。
|
|
7159
7176
|
*/
|
|
7160
7177
|
static reassertHiddenDisplay(e) {
|
|
7161
|
-
const t =
|
|
7178
|
+
const t = N.get(e);
|
|
7162
7179
|
t instanceof v && t.hideDisplayWithoutCapture();
|
|
7163
7180
|
}
|
|
7164
7181
|
/**
|
|
@@ -7185,10 +7202,10 @@ const v = class v extends D {
|
|
|
7185
7202
|
* @returns 戻り値はありません。
|
|
7186
7203
|
*/
|
|
7187
7204
|
static forEachFormControlInBranch(e, t) {
|
|
7188
|
-
e.matches(
|
|
7205
|
+
e.matches(vt) && t(e);
|
|
7189
7206
|
const r = (i) => {
|
|
7190
7207
|
Array.from(i.children).forEach((s) => {
|
|
7191
|
-
s.hasAttribute(`${c.prefix}if-false`) || (s instanceof HTMLElement && s.matches(
|
|
7208
|
+
s.hasAttribute(`${c.prefix}if-false`) || (s instanceof HTMLElement && s.matches(vt) && t(s), r(s));
|
|
7192
7209
|
});
|
|
7193
7210
|
};
|
|
7194
7211
|
r(e);
|
|
@@ -7314,7 +7331,7 @@ v.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, v.VALUE
|
|
|
7314
7331
|
"^.+-(?:dialog|toast|toast-level|history|scroll|redirect|redirect-replace|redirect-return-param)$"
|
|
7315
7332
|
);
|
|
7316
7333
|
let R = v;
|
|
7317
|
-
class de extends
|
|
7334
|
+
class de extends N {
|
|
7318
7335
|
/**
|
|
7319
7336
|
* テキストフラグメントのコンストラクタ。
|
|
7320
7337
|
* 対象テキストノードの内容を初期化します。
|
|
@@ -7398,7 +7415,7 @@ class de extends D {
|
|
|
7398
7415
|
});
|
|
7399
7416
|
}
|
|
7400
7417
|
}
|
|
7401
|
-
class ot extends
|
|
7418
|
+
class ot extends N {
|
|
7402
7419
|
/**
|
|
7403
7420
|
* コメントフラグメントのコンストラクタ。
|
|
7404
7421
|
* 対象コメントノードの内容を初期化します。
|
|
@@ -7737,9 +7754,9 @@ const _ = class _ extends Ee {
|
|
|
7737
7754
|
};
|
|
7738
7755
|
_.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], _.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], _.forceEvaluationNames = null, _.forceEvaluationPrefix = null, _.WARNED_EVENT_HANDLER_PLACEHOLDERS = /* @__PURE__ */ new Set(), _.WARNED_URL_PATH_VALUES = /* @__PURE__ */ new Set();
|
|
7739
7756
|
let Xe = _;
|
|
7740
|
-
const
|
|
7757
|
+
const wt = "[Haori]", St = {
|
|
7741
7758
|
nameRequired: "Handler name is required.",
|
|
7742
|
-
notFunction: (
|
|
7759
|
+
notFunction: (p) => `Handler "${p}" must be a function.`
|
|
7743
7760
|
}, Te = class Te {
|
|
7744
7761
|
/**
|
|
7745
7762
|
* 関数を登録します。同じ名前で登録し直すと置き換えます。
|
|
@@ -7751,11 +7768,11 @@ const vt = "[Haori]", wt = {
|
|
|
7751
7768
|
static register(e, t) {
|
|
7752
7769
|
const r = typeof e == "string" ? e.trim() : "";
|
|
7753
7770
|
if (r === "") {
|
|
7754
|
-
m.error(
|
|
7771
|
+
m.error(wt, St.nameRequired);
|
|
7755
7772
|
return;
|
|
7756
7773
|
}
|
|
7757
7774
|
if (typeof t != "function") {
|
|
7758
|
-
m.error(
|
|
7775
|
+
m.error(wt, St.notFunction(r));
|
|
7759
7776
|
return;
|
|
7760
7777
|
}
|
|
7761
7778
|
Te.handlers.set(r, t);
|
|
@@ -7788,7 +7805,7 @@ const vt = "[Haori]", wt = {
|
|
|
7788
7805
|
}
|
|
7789
7806
|
};
|
|
7790
7807
|
Te.handlers = /* @__PURE__ */ new Map();
|
|
7791
|
-
let
|
|
7808
|
+
let Ne = Te;
|
|
7792
7809
|
const ke = class ke {
|
|
7793
7810
|
/**
|
|
7794
7811
|
* 実行モードを取得します。
|
|
@@ -7971,7 +7988,7 @@ const ke = class ke {
|
|
|
7971
7988
|
* @returns 整形済みの現在日時文字列
|
|
7972
7989
|
*/
|
|
7973
7990
|
static now(e, t) {
|
|
7974
|
-
return
|
|
7991
|
+
return Pt(e, t);
|
|
7975
7992
|
}
|
|
7976
7993
|
/**
|
|
7977
7994
|
* 現在日付に日数を加減した日付を指定フォーマットの文字列へ整形します。
|
|
@@ -7985,7 +8002,7 @@ const ke = class ke {
|
|
|
7985
8002
|
* @returns 整形済みの日付文字列。timeZone が不正な場合は空文字
|
|
7986
8003
|
*/
|
|
7987
8004
|
static today(e, t, r) {
|
|
7988
|
-
return
|
|
8005
|
+
return Lt(e, t, r);
|
|
7989
8006
|
}
|
|
7990
8007
|
/**
|
|
7991
8008
|
* 数値を桁区切り・小数桁付きの文字列へ整形します。
|
|
@@ -7997,7 +8014,7 @@ const ke = class ke {
|
|
|
7997
8014
|
* @returns 整形済み文字列。整形できない場合は空文字
|
|
7998
8015
|
*/
|
|
7999
8016
|
static number(e, t) {
|
|
8000
|
-
return
|
|
8017
|
+
return Ot(e, t);
|
|
8001
8018
|
}
|
|
8002
8019
|
/**
|
|
8003
8020
|
* 整数の配列を生成します(終端は排他)。
|
|
@@ -8010,7 +8027,7 @@ const ke = class ke {
|
|
|
8010
8027
|
* @returns 整数配列
|
|
8011
8028
|
*/
|
|
8012
8029
|
static range(e, t, r) {
|
|
8013
|
-
return
|
|
8030
|
+
return Bt(e, t, r);
|
|
8014
8031
|
}
|
|
8015
8032
|
/**
|
|
8016
8033
|
* 番号ページネーション用の表示要素列を生成します。
|
|
@@ -8023,7 +8040,7 @@ const ke = class ke {
|
|
|
8023
8040
|
* @returns 表示要素の配列
|
|
8024
8041
|
*/
|
|
8025
8042
|
static pages(e, t, r) {
|
|
8026
|
-
return
|
|
8043
|
+
return Ut(e, t, r);
|
|
8027
8044
|
}
|
|
8028
8045
|
/**
|
|
8029
8046
|
* `YYYY-MM` 形式の年月文字列に月数を加算します。
|
|
@@ -8047,7 +8064,7 @@ const ke = class ke {
|
|
|
8047
8064
|
* @returns 年月情報の降順配列。不正な入力は空配列
|
|
8048
8065
|
*/
|
|
8049
8066
|
static monthRange(e, t) {
|
|
8050
|
-
return
|
|
8067
|
+
return Ht(e, t);
|
|
8051
8068
|
}
|
|
8052
8069
|
/**
|
|
8053
8070
|
* ページレスポンスから表示用サマリーを作ります。
|
|
@@ -8059,7 +8076,7 @@ const ke = class ke {
|
|
|
8059
8076
|
* @returns 表示サマリー
|
|
8060
8077
|
*/
|
|
8061
8078
|
static pageSummary(e, t) {
|
|
8062
|
-
return
|
|
8079
|
+
return Vt(e, t);
|
|
8063
8080
|
}
|
|
8064
8081
|
/**
|
|
8065
8082
|
* 配列から `item[key]` が指定値に一致する最初の要素を返します。
|
|
@@ -8073,7 +8090,7 @@ const ke = class ke {
|
|
|
8073
8090
|
* @returns 一致した最初の要素。無ければ null
|
|
8074
8091
|
*/
|
|
8075
8092
|
static findBy(e, t, r) {
|
|
8076
|
-
return
|
|
8093
|
+
return qt(e, t, r);
|
|
8077
8094
|
}
|
|
8078
8095
|
/**
|
|
8079
8096
|
* 配列の数値合計を返します。
|
|
@@ -8086,7 +8103,7 @@ const ke = class ke {
|
|
|
8086
8103
|
* @returns 数値の合計。対象が無ければ 0
|
|
8087
8104
|
*/
|
|
8088
8105
|
static sum(e, t) {
|
|
8089
|
-
return
|
|
8106
|
+
return Wt(e, t);
|
|
8090
8107
|
}
|
|
8091
8108
|
/**
|
|
8092
8109
|
* 配列から重複を取り除いた新しい配列を返します。
|
|
@@ -8099,7 +8116,7 @@ const ke = class ke {
|
|
|
8099
8116
|
* @returns 重複排除後の新しい配列。非配列は空配列
|
|
8100
8117
|
*/
|
|
8101
8118
|
static distinct(e, t) {
|
|
8102
|
-
return
|
|
8119
|
+
return Kt(e, t);
|
|
8103
8120
|
}
|
|
8104
8121
|
/**
|
|
8105
8122
|
* 配列を `item[key]` ごとのグループへ分けて返します。
|
|
@@ -8112,7 +8129,7 @@ const ke = class ke {
|
|
|
8112
8129
|
* @returns グループ情報の配列。非配列は空配列
|
|
8113
8130
|
*/
|
|
8114
8131
|
static groupBy(e, t) {
|
|
8115
|
-
return
|
|
8132
|
+
return zt(e, t);
|
|
8116
8133
|
}
|
|
8117
8134
|
};
|
|
8118
8135
|
ke.handlers = {
|
|
@@ -8124,7 +8141,7 @@ ke.handlers = {
|
|
|
8124
8141
|
* @return 戻り値はありません。
|
|
8125
8142
|
*/
|
|
8126
8143
|
register(e, t) {
|
|
8127
|
-
|
|
8144
|
+
Ne.register(e, t);
|
|
8128
8145
|
},
|
|
8129
8146
|
/**
|
|
8130
8147
|
* 登録した関数かどうかを返します。
|
|
@@ -8133,7 +8150,7 @@ ke.handlers = {
|
|
|
8133
8150
|
* @return 登録してあれば true
|
|
8134
8151
|
*/
|
|
8135
8152
|
has(e) {
|
|
8136
|
-
return
|
|
8153
|
+
return Ne.has(e);
|
|
8137
8154
|
}
|
|
8138
8155
|
}, ke.enhancers = {
|
|
8139
8156
|
/**
|
|
@@ -8156,15 +8173,15 @@ ke.handlers = {
|
|
|
8156
8173
|
return le.has(e);
|
|
8157
8174
|
}
|
|
8158
8175
|
};
|
|
8159
|
-
let
|
|
8160
|
-
const
|
|
8161
|
-
function
|
|
8176
|
+
let De = ke;
|
|
8177
|
+
const Er = "入力内容を確認してください", Ar = ["addErrorMessage", "clearMessages"], Rt = "data-haori-group-name";
|
|
8178
|
+
function Tt() {
|
|
8162
8179
|
const e = globalThis.window?.Haori;
|
|
8163
|
-
return
|
|
8180
|
+
return Ar.every(
|
|
8164
8181
|
(r) => typeof e?.[r] == "function"
|
|
8165
|
-
) ? e :
|
|
8182
|
+
) ? e : De;
|
|
8166
8183
|
}
|
|
8167
|
-
const
|
|
8184
|
+
const g = class g {
|
|
8168
8185
|
/**
|
|
8169
8186
|
* フォーム内にある入力エレメントの値をオブジェクトとして取得します。
|
|
8170
8187
|
* data-form-object属性があると、そのエレメント内の値はオブジェクトとして処理されます。
|
|
@@ -8175,7 +8192,7 @@ const p = class p {
|
|
|
8175
8192
|
*/
|
|
8176
8193
|
static getValues(e) {
|
|
8177
8194
|
const t = {}, r = /* @__PURE__ */ new Set();
|
|
8178
|
-
return
|
|
8195
|
+
return g.getPartValues(e, t, null, r), g.registerCollectedExcludedKeys(t, r), t;
|
|
8179
8196
|
}
|
|
8180
8197
|
/**
|
|
8181
8198
|
* 入力エレメントから収集する値を解決します。
|
|
@@ -8196,11 +8213,11 @@ const p = class p {
|
|
|
8196
8213
|
*/
|
|
8197
8214
|
static resolveCollectedValue(e) {
|
|
8198
8215
|
const t = e.getTarget();
|
|
8199
|
-
if (
|
|
8216
|
+
if (g.isFileInput(e)) {
|
|
8200
8217
|
const r = t, i = r.files ? Array.from(r.files) : [];
|
|
8201
8218
|
return r.multiple ? i : i.length > 0 ? i[0] : null;
|
|
8202
8219
|
}
|
|
8203
|
-
if (
|
|
8220
|
+
if (g.isBooleanCheckbox(e)) {
|
|
8204
8221
|
const r = t;
|
|
8205
8222
|
return r.value === "false" ? !r.checked : r.checked;
|
|
8206
8223
|
}
|
|
@@ -8253,13 +8270,13 @@ const p = class p {
|
|
|
8253
8270
|
* @returns 戻り値はありません。
|
|
8254
8271
|
*/
|
|
8255
8272
|
static clearRowUserEditMarksForChangedKeys(e, t) {
|
|
8256
|
-
const r =
|
|
8273
|
+
const r = g.getValues(e), i = /* @__PURE__ */ new Set();
|
|
8257
8274
|
for (const s of /* @__PURE__ */ new Set([
|
|
8258
8275
|
...Object.keys(r),
|
|
8259
8276
|
...Object.keys(t)
|
|
8260
8277
|
]))
|
|
8261
|
-
|
|
8262
|
-
i.size !== 0 &&
|
|
8278
|
+
g.isSameCollectedValue(r[s], t[s]) || i.add(s);
|
|
8279
|
+
i.size !== 0 && g.clearUserEditMarksForKeys(e, e, i);
|
|
8263
8280
|
}
|
|
8264
8281
|
/**
|
|
8265
8282
|
* 収集値と要素データの値が同じ内容かどうかを判定します。
|
|
@@ -8288,9 +8305,9 @@ const p = class p {
|
|
|
8288
8305
|
* @returns 戻り値はありません。
|
|
8289
8306
|
*/
|
|
8290
8307
|
static clearUserEditMarksForKeys(e, t, r) {
|
|
8291
|
-
const i =
|
|
8308
|
+
const i = g.resolveRowTopLevelKey(e, t);
|
|
8292
8309
|
i !== null && r.has(i) && e.clearUserEditMark(), e.getChildElementFragments().forEach((s) => {
|
|
8293
|
-
|
|
8310
|
+
g.clearUserEditMarksForKeys(s, t, r);
|
|
8294
8311
|
});
|
|
8295
8312
|
}
|
|
8296
8313
|
/**
|
|
@@ -8306,7 +8323,7 @@ const p = class p {
|
|
|
8306
8323
|
static resolveRowTopLevelKey(e, t) {
|
|
8307
8324
|
let r = null, i = e;
|
|
8308
8325
|
for (; i !== null && i !== t; ) {
|
|
8309
|
-
const s = i.getAttribute(`${c.prefix}form-object`) || i.getAttribute(`${c.prefix}form-list`) ||
|
|
8326
|
+
const s = i.getAttribute(`${c.prefix}form-object`) || i.getAttribute(`${c.prefix}form-list`) || g.resolveFieldName(i);
|
|
8310
8327
|
s != null && String(s) !== "" && (r = String(s)), i = i.getParent();
|
|
8311
8328
|
}
|
|
8312
8329
|
return r;
|
|
@@ -8345,13 +8362,13 @@ const p = class p {
|
|
|
8345
8362
|
return;
|
|
8346
8363
|
}
|
|
8347
8364
|
const r = e.getTarget();
|
|
8348
|
-
if (!(r instanceof HTMLInputElement) || r.type !== "radio" || r.hasAttribute("name") && !r.hasAttribute(
|
|
8365
|
+
if (!(r instanceof HTMLInputElement) || r.type !== "radio" || r.hasAttribute("name") && !r.hasAttribute(Rt))
|
|
8349
8366
|
return;
|
|
8350
|
-
const i =
|
|
8367
|
+
const i = g.resolveGroupScope(e), s = `${String(t)}--haori${g.resolveGroupScopeId(
|
|
8351
8368
|
i
|
|
8352
8369
|
)}`;
|
|
8353
8370
|
if (r.getAttribute("name") !== s)
|
|
8354
|
-
return e.setAttribute(
|
|
8371
|
+
return e.setAttribute(Rt, "").then(() => e.setAttribute("name", s));
|
|
8355
8372
|
}
|
|
8356
8373
|
/**
|
|
8357
8374
|
* ラジオグループのスコープとなるフラグメントを解決します。
|
|
@@ -8381,8 +8398,8 @@ const p = class p {
|
|
|
8381
8398
|
* @returns スコープの識別番号
|
|
8382
8399
|
*/
|
|
8383
8400
|
static resolveGroupScopeId(e) {
|
|
8384
|
-
const t =
|
|
8385
|
-
return t !== void 0 ? t : (
|
|
8401
|
+
const t = g.GROUP_SCOPE_IDS.get(e);
|
|
8402
|
+
return t !== void 0 ? t : (g.groupScopeSequence += 1, g.GROUP_SCOPE_IDS.set(e, g.groupScopeSequence), g.groupScopeSequence);
|
|
8386
8403
|
}
|
|
8387
8404
|
/**
|
|
8388
8405
|
* 宣言バインドで値・状態が決まり、その評価が解決している入力かどうかを判定します。
|
|
@@ -8400,17 +8417,17 @@ const p = class p {
|
|
|
8400
8417
|
* @returns 宣言バインドで値・状態が決まり、その評価が解決している場合 true
|
|
8401
8418
|
*/
|
|
8402
8419
|
static hasResolvedDeclarativeState(e) {
|
|
8403
|
-
if (!
|
|
8420
|
+
if (!g.isDeclarativeStateBound(e))
|
|
8404
8421
|
return !1;
|
|
8405
8422
|
const t = e.getTarget();
|
|
8406
8423
|
if (t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio"))
|
|
8407
|
-
return
|
|
8408
|
-
if (
|
|
8409
|
-
return
|
|
8424
|
+
return g.isDeclarationResolved(e, "checked");
|
|
8425
|
+
if (g.hasDeclarativeBinding(e, "value"))
|
|
8426
|
+
return g.isDeclarationResolved(e, "value");
|
|
8410
8427
|
if (t instanceof HTMLSelectElement) {
|
|
8411
8428
|
for (const r of Array.from(t.options)) {
|
|
8412
|
-
const i =
|
|
8413
|
-
if (i instanceof R &&
|
|
8429
|
+
const i = N.get(r);
|
|
8430
|
+
if (i instanceof R && g.hasDeclarativeBinding(i, "selected") && !g.isDeclarationResolved(i, "selected"))
|
|
8414
8431
|
return !1;
|
|
8415
8432
|
}
|
|
8416
8433
|
return !0;
|
|
@@ -8453,7 +8470,7 @@ const p = class p {
|
|
|
8453
8470
|
*/
|
|
8454
8471
|
static isDeclarativeStateBound(e) {
|
|
8455
8472
|
const t = e.getTarget();
|
|
8456
|
-
return t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ?
|
|
8473
|
+
return t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ? g.hasDeclarativeBinding(e, "checked") : R.isValuePropertyTarget(t) ? g.hasDeclarativeBinding(e, "value") ? !0 : t instanceof HTMLSelectElement ? g.hasDeclarativeSelectedOption(t) : !1 : !1;
|
|
8457
8474
|
}
|
|
8458
8475
|
/**
|
|
8459
8476
|
* 対象の部分木にある入力欄を、ネイティブのフォームリセットと同じ既定値へ戻します。
|
|
@@ -8473,7 +8490,7 @@ const p = class p {
|
|
|
8473
8490
|
const t = "input, textarea, select", r = [];
|
|
8474
8491
|
e.matches(t) && r.push(e), r.push(...e.querySelectorAll(t));
|
|
8475
8492
|
for (const i of r)
|
|
8476
|
-
i instanceof HTMLInputElement ? i.type === "checkbox" || i.type === "radio" ? i.checked = i.defaultChecked : i.type === "file" ? i.value = "" : i.value = i.defaultValue : i instanceof HTMLTextAreaElement ? i.value = i.defaultValue : i instanceof HTMLSelectElement &&
|
|
8493
|
+
i instanceof HTMLInputElement ? i.type === "checkbox" || i.type === "radio" ? i.checked = i.defaultChecked : i.type === "file" ? i.value = "" : i.value = i.defaultValue : i instanceof HTMLTextAreaElement ? i.value = i.defaultValue : i instanceof HTMLSelectElement && g.restoreDefaultSelection(i);
|
|
8477
8494
|
}
|
|
8478
8495
|
/**
|
|
8479
8496
|
* `<select>` の選択状態を既定の選択(`defaultSelected`)へ戻します。
|
|
@@ -8503,14 +8520,14 @@ const p = class p {
|
|
|
8503
8520
|
* @return 戻り値はありません。
|
|
8504
8521
|
*/
|
|
8505
8522
|
static clearDeclarativeStateFromDom(e) {
|
|
8506
|
-
if (
|
|
8523
|
+
if (g.isDeclarativeStateBound(e)) {
|
|
8507
8524
|
const t = e.getTarget();
|
|
8508
8525
|
t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ? t.checked = !1 : t instanceof HTMLSelectElement ? (Array.from(t.options).forEach((r) => {
|
|
8509
8526
|
r.selected = !1;
|
|
8510
8527
|
}), t.selectedIndex = -1) : (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) && (t.value = "");
|
|
8511
8528
|
}
|
|
8512
8529
|
e.getChildren().forEach((t) => {
|
|
8513
|
-
t instanceof R &&
|
|
8530
|
+
t instanceof R && g.clearDeclarativeStateFromDom(t);
|
|
8514
8531
|
});
|
|
8515
8532
|
}
|
|
8516
8533
|
/**
|
|
@@ -8539,8 +8556,8 @@ const p = class p {
|
|
|
8539
8556
|
*/
|
|
8540
8557
|
static hasDeclarativeSelectedOption(e) {
|
|
8541
8558
|
for (const t of Array.from(e.options)) {
|
|
8542
|
-
const r =
|
|
8543
|
-
if (r instanceof R &&
|
|
8559
|
+
const r = N.get(t);
|
|
8560
|
+
if (r instanceof R && g.hasDeclarativeBinding(r, "selected"))
|
|
8544
8561
|
return !0;
|
|
8545
8562
|
}
|
|
8546
8563
|
return !1;
|
|
@@ -8571,7 +8588,7 @@ const p = class p {
|
|
|
8571
8588
|
* @returns 編集された入力欄だけを含む値のオブジェクト
|
|
8572
8589
|
*/
|
|
8573
8590
|
static getValuesEditedAfter(e, t) {
|
|
8574
|
-
return
|
|
8591
|
+
return g.getPartValues(e, {}, t);
|
|
8575
8592
|
}
|
|
8576
8593
|
/**
|
|
8577
8594
|
* 利用者が編集した入力欄に対応するバインドデータの経路を集めます。
|
|
@@ -8613,10 +8630,10 @@ const p = class p {
|
|
|
8613
8630
|
*/
|
|
8614
8631
|
static collectEditedPaths(e, t, r = "", i = null) {
|
|
8615
8632
|
const s = /* @__PURE__ */ new Map();
|
|
8616
|
-
for (const a of
|
|
8633
|
+
for (const a of g.collectUserEditSequences(e)) {
|
|
8617
8634
|
const o = /* @__PURE__ */ new Set();
|
|
8618
|
-
|
|
8619
|
-
|
|
8635
|
+
g.walkEditedPaths(
|
|
8636
|
+
g.getValuesEditedAfter(e, a - 1),
|
|
8620
8637
|
r,
|
|
8621
8638
|
o
|
|
8622
8639
|
);
|
|
@@ -8624,7 +8641,7 @@ const p = class p {
|
|
|
8624
8641
|
s.has(l) || s.set(l, a);
|
|
8625
8642
|
}
|
|
8626
8643
|
const n = /* @__PURE__ */ new Set();
|
|
8627
|
-
|
|
8644
|
+
g.walkExcludedPaths(i ?? g.getValues(e), r, n);
|
|
8628
8645
|
for (const a of n)
|
|
8629
8646
|
s.has(a) || s.set(a, t);
|
|
8630
8647
|
return s;
|
|
@@ -8637,7 +8654,7 @@ const p = class p {
|
|
|
8637
8654
|
*/
|
|
8638
8655
|
static collectUserEditSequences(e) {
|
|
8639
8656
|
const t = /* @__PURE__ */ new Set();
|
|
8640
|
-
return
|
|
8657
|
+
return g.walkUserEditSequences(e, t), [...t].sort((r, i) => i - r);
|
|
8641
8658
|
}
|
|
8642
8659
|
/**
|
|
8643
8660
|
* 部分木をたどってユーザー編集の通番を集めます。
|
|
@@ -8650,7 +8667,7 @@ const p = class p {
|
|
|
8650
8667
|
const r = e.getUserEditSequence();
|
|
8651
8668
|
r > 0 && t.add(r);
|
|
8652
8669
|
for (const i of e.getChildElementFragments())
|
|
8653
|
-
|
|
8670
|
+
g.walkUserEditSequences(i, t);
|
|
8654
8671
|
}
|
|
8655
8672
|
/**
|
|
8656
8673
|
* 収集値をたどって、除外されたキーの経路を集めます。
|
|
@@ -8665,15 +8682,15 @@ const p = class p {
|
|
|
8665
8682
|
static walkExcludedPaths(e, t, r) {
|
|
8666
8683
|
if (Array.isArray(e))
|
|
8667
8684
|
return;
|
|
8668
|
-
const i =
|
|
8685
|
+
const i = g.asPlainRecord(e);
|
|
8669
8686
|
if (i === null)
|
|
8670
8687
|
return;
|
|
8671
|
-
const s =
|
|
8688
|
+
const s = g.COLLECTED_EXCLUDED_KEYS.get(i);
|
|
8672
8689
|
if (s)
|
|
8673
8690
|
for (const n of s)
|
|
8674
8691
|
n in i || r.add(t === "" ? n : `${t}.${n}`);
|
|
8675
8692
|
for (const [n, a] of Object.entries(i))
|
|
8676
|
-
|
|
8693
|
+
g.walkExcludedPaths(
|
|
8677
8694
|
a,
|
|
8678
8695
|
t === "" ? n : `${t}.${n}`,
|
|
8679
8696
|
r
|
|
@@ -8689,10 +8706,10 @@ const p = class p {
|
|
|
8689
8706
|
static walkEditedPaths(e, t, r) {
|
|
8690
8707
|
if (Array.isArray(e))
|
|
8691
8708
|
return;
|
|
8692
|
-
const i =
|
|
8709
|
+
const i = g.asPlainRecord(e);
|
|
8693
8710
|
if (i !== null) {
|
|
8694
8711
|
for (const [s, n] of Object.entries(i))
|
|
8695
|
-
|
|
8712
|
+
g.walkEditedPaths(
|
|
8696
8713
|
n,
|
|
8697
8714
|
t === "" ? s : `${t}.${s}`,
|
|
8698
8715
|
r
|
|
@@ -8707,7 +8724,7 @@ const p = class p {
|
|
|
8707
8724
|
* @returns 最中なら true
|
|
8708
8725
|
*/
|
|
8709
8726
|
static isResettingInternally() {
|
|
8710
|
-
return
|
|
8727
|
+
return g.internalResetDepth > 0;
|
|
8711
8728
|
}
|
|
8712
8729
|
/**
|
|
8713
8730
|
* フォーム内の各入力エレメントから値を取得し、オブジェクトとして返します。
|
|
@@ -8726,48 +8743,48 @@ const p = class p {
|
|
|
8726
8743
|
return t;
|
|
8727
8744
|
if (e.getTarget().hasAttribute(`${c.prefix}if-false`)) {
|
|
8728
8745
|
if (i !== null)
|
|
8729
|
-
for (const u of
|
|
8746
|
+
for (const u of g.collectDeclaredKeysInFragment(e))
|
|
8730
8747
|
i.add(u);
|
|
8731
8748
|
return t;
|
|
8732
8749
|
}
|
|
8733
|
-
const s =
|
|
8750
|
+
const s = g.resolveFieldName(e), n = e.getAttribute(`${c.prefix}form-object`), a = e.getAttribute(`${c.prefix}form-list`), o = e.hasAttribute(`${c.prefix}form-list`), l = r !== null && e.getUserEditSequence() <= r;
|
|
8734
8751
|
if (s) {
|
|
8735
|
-
if (r !== null &&
|
|
8736
|
-
const u =
|
|
8752
|
+
if (r !== null && g.isGroupedCheckable(e)) {
|
|
8753
|
+
const u = g.collectGroupSelection(
|
|
8737
8754
|
e,
|
|
8738
8755
|
o,
|
|
8739
8756
|
r
|
|
8740
8757
|
);
|
|
8741
8758
|
u.edited && (t[String(s)] = u.value);
|
|
8742
|
-
} else if (o &&
|
|
8759
|
+
} else if (o && g.isGroupedCheckable(e)) {
|
|
8743
8760
|
const u = String(s), d = e.getTarget();
|
|
8744
8761
|
r === null && !Array.isArray(t[u]) && (t[u] = []), !l && d.checked && (Array.isArray(t[u]) || (t[u] = []), t[u].push(d.value));
|
|
8745
8762
|
} else if (o && l)
|
|
8746
8763
|
Array.isArray(t[String(s)]) ? t[String(s)].push(null) : t[String(s)] = [null];
|
|
8747
8764
|
else if (!l) if (o) {
|
|
8748
|
-
const u =
|
|
8765
|
+
const u = g.resolveCollectedValue(e), d = g.isFileInput(e) && Array.isArray(u) ? u : [u];
|
|
8749
8766
|
Array.isArray(t[String(s)]) ? t[String(s)].push(...d) : t[String(s)] = d;
|
|
8750
|
-
} else if (
|
|
8767
|
+
} else if (g.isGroupedCheckable(e)) {
|
|
8751
8768
|
const u = e.getTarget(), d = u instanceof HTMLInputElement ? u.checked : !0, y = u instanceof HTMLInputElement ? u.value : e.getValue(), b = d ? y : null, E = String(s);
|
|
8752
8769
|
b === null ? E in t || (t[E] = null) : t[E] === null || t[E] === void 0 ? t[E] = b : Array.isArray(t[E]) ? t[E].push(b) : t[E] = [t[E], b];
|
|
8753
8770
|
} else
|
|
8754
|
-
t[String(s)] =
|
|
8771
|
+
t[String(s)] = g.resolveCollectedValue(e);
|
|
8755
8772
|
n && m.warn(
|
|
8756
8773
|
"Haori",
|
|
8757
8774
|
`Element cannot have both ${c.prefix}form-object and name attributes.`
|
|
8758
8775
|
);
|
|
8759
8776
|
for (const u of e.getChildElementFragments())
|
|
8760
|
-
|
|
8777
|
+
g.getPartValues(u, t, r, i);
|
|
8761
8778
|
} else if (n) {
|
|
8762
8779
|
const u = {}, d = i === null ? null : /* @__PURE__ */ new Set();
|
|
8763
8780
|
for (const y of e.getChildElementFragments())
|
|
8764
|
-
|
|
8781
|
+
g.getPartValues(
|
|
8765
8782
|
y,
|
|
8766
8783
|
u,
|
|
8767
8784
|
r,
|
|
8768
8785
|
d
|
|
8769
8786
|
);
|
|
8770
|
-
d !== null &&
|
|
8787
|
+
d !== null && g.registerCollectedExcludedKeys(u, d), Object.keys(u).length > 0 ? t[String(n)] = u : i !== null && (d?.size ?? 0) > 0 && i.add(String(n)), a && m.warn(
|
|
8771
8788
|
"Haori",
|
|
8772
8789
|
`Element cannot have both ${c.prefix}form-list and ${c.prefix}form-object attributes.`
|
|
8773
8790
|
);
|
|
@@ -8776,25 +8793,25 @@ const p = class p {
|
|
|
8776
8793
|
let y = !1;
|
|
8777
8794
|
for (const b of e.getChildElementFragments()) {
|
|
8778
8795
|
const E = {}, A = i === null ? null : /* @__PURE__ */ new Set();
|
|
8779
|
-
|
|
8796
|
+
g.getPartValues(
|
|
8780
8797
|
b,
|
|
8781
8798
|
E,
|
|
8782
8799
|
r,
|
|
8783
8800
|
A
|
|
8784
|
-
), A !== null &&
|
|
8801
|
+
), A !== null && g.registerCollectedExcludedKeys(E, A), Object.keys(E).length > 0 ? (y = !0, u.push(E), d.push(b.getListKey())) : r !== null && (u.push({}), d.push(b.getListKey()));
|
|
8785
8802
|
}
|
|
8786
8803
|
if (r === null) {
|
|
8787
8804
|
const b = e.getAttribute(`${c.prefix}each-key`);
|
|
8788
|
-
|
|
8805
|
+
g.registerCollectedRowIdentity(
|
|
8789
8806
|
u,
|
|
8790
8807
|
b == null ? null : String(b),
|
|
8791
8808
|
d,
|
|
8792
|
-
|
|
8793
|
-
),
|
|
8809
|
+
g.isCollectedListFromEachSource(e)
|
|
8810
|
+
), g.warnDerivedRowsWithoutKey(e), t[String(a)] = u;
|
|
8794
8811
|
} else y && (t[String(a)] = u);
|
|
8795
8812
|
} else
|
|
8796
8813
|
for (const u of e.getChildElementFragments())
|
|
8797
|
-
|
|
8814
|
+
g.getPartValues(u, t, r, i);
|
|
8798
8815
|
return t;
|
|
8799
8816
|
}
|
|
8800
8817
|
/**
|
|
@@ -8807,7 +8824,7 @@ const p = class p {
|
|
|
8807
8824
|
* @returns Promise(DOMの更新が完了したら解決される)
|
|
8808
8825
|
*/
|
|
8809
8826
|
static setValues(e, t, r = !1) {
|
|
8810
|
-
return
|
|
8827
|
+
return g.setPartValues(e, t, r, !0);
|
|
8811
8828
|
}
|
|
8812
8829
|
/**
|
|
8813
8830
|
* フォーム内にある入力エレメントに値をイベントなしで設定します。
|
|
@@ -8820,7 +8837,7 @@ const p = class p {
|
|
|
8820
8837
|
* @returns Promise(DOMの更新が完了したら解決される)
|
|
8821
8838
|
*/
|
|
8822
8839
|
static syncValues(e, t, r = !1, i = null) {
|
|
8823
|
-
return
|
|
8840
|
+
return g.setPartValues(
|
|
8824
8841
|
e,
|
|
8825
8842
|
t,
|
|
8826
8843
|
r,
|
|
@@ -8843,7 +8860,7 @@ const p = class p {
|
|
|
8843
8860
|
* @returns 反映完了の Promise
|
|
8844
8861
|
*/
|
|
8845
8862
|
static syncRowValues(e, t, r = null) {
|
|
8846
|
-
return
|
|
8863
|
+
return g.setPartValues(
|
|
8847
8864
|
e,
|
|
8848
8865
|
t,
|
|
8849
8866
|
!1,
|
|
@@ -8873,7 +8890,7 @@ const p = class p {
|
|
|
8873
8890
|
if (!r)
|
|
8874
8891
|
return t;
|
|
8875
8892
|
const i = String(r);
|
|
8876
|
-
return Object.prototype.hasOwnProperty.call(t, i) ?
|
|
8893
|
+
return Object.prototype.hasOwnProperty.call(t, i) ? g.asPlainRecord(t[i]) ?? {} : g.resolveAncestorArgOwner(e, i)?.value ?? {};
|
|
8877
8894
|
}
|
|
8878
8895
|
/**
|
|
8879
8896
|
* キーを所有する祖先を、値の型を問わず解決します。
|
|
@@ -8919,11 +8936,11 @@ const p = class p {
|
|
|
8919
8936
|
* @returns 所有する祖先フラグメントとその値。見つからない場合は null
|
|
8920
8937
|
*/
|
|
8921
8938
|
static resolveAncestorArgOwner(e, t) {
|
|
8922
|
-
const r =
|
|
8939
|
+
const r = g.resolveAncestorKeyOwner(e, t);
|
|
8923
8940
|
if (r === null)
|
|
8924
8941
|
return null;
|
|
8925
|
-
const i =
|
|
8926
|
-
return i === null ? (
|
|
8942
|
+
const i = g.asPlainRecord(r.value);
|
|
8943
|
+
return i === null ? (g.warnArgOwnerIsNotRecord(e, t, r.value), null) : { owner: r.owner, value: i };
|
|
8927
8944
|
}
|
|
8928
8945
|
/**
|
|
8929
8946
|
* 収集キーの土台を祖先から解決する関数を返します。
|
|
@@ -8937,7 +8954,7 @@ const p = class p {
|
|
|
8937
8954
|
* @returns キーを受け取り、祖先が所有する値を返す関数(所有者が無ければ undefined)
|
|
8938
8955
|
*/
|
|
8939
8956
|
static ancestorBaseResolver(e) {
|
|
8940
|
-
return (t) =>
|
|
8957
|
+
return (t) => g.resolveAncestorKeyOwner(e, t)?.value;
|
|
8941
8958
|
}
|
|
8942
8959
|
/**
|
|
8943
8960
|
* `data-form-arg` のキーをレコード以外で所有している構成を、開発モードで知らせます。
|
|
@@ -8949,8 +8966,8 @@ const p = class p {
|
|
|
8949
8966
|
static warnArgOwnerIsNotRecord(e, t, r) {
|
|
8950
8967
|
if (!V.isEnabled() || r == null)
|
|
8951
8968
|
return;
|
|
8952
|
-
const i = e.getTarget(), s =
|
|
8953
|
-
s?.has(t) || (s ? s.add(t) :
|
|
8969
|
+
const i = e.getTarget(), s = g.warnedArgOwnerNotRecord.get(i);
|
|
8970
|
+
s?.has(t) || (s ? s.add(t) : g.warnedArgOwnerNotRecord.set(i, /* @__PURE__ */ new Set([t])), m.warn(
|
|
8954
8971
|
"[Haori]",
|
|
8955
8972
|
`${c.prefix}form-arg="${t}" のキーを祖先が${Array.isArray(r) ? "配列" : `${typeof r} 型の値`}で持っています。${c.prefix}form-arg はそのキーの配下に入力欄が対応することを宣言するため、値はレコード(オブジェクト)である必要があります。このままでは収集値がそのキーへ直接入り、値の型が変わります。`
|
|
8956
8973
|
));
|
|
@@ -8972,18 +8989,18 @@ const p = class p {
|
|
|
8972
8989
|
static buildConditionScope(e, t = null) {
|
|
8973
8990
|
const r = { ...e.getBindingData() }, i = t ? {
|
|
8974
8991
|
source: t,
|
|
8975
|
-
argKey:
|
|
8976
|
-
} :
|
|
8992
|
+
argKey: g.resolveFormArgKey(t)
|
|
8993
|
+
} : g.resolveConditionValueSource(e);
|
|
8977
8994
|
if (!i)
|
|
8978
8995
|
return r;
|
|
8979
|
-
const s =
|
|
8996
|
+
const s = g.getValues(i.source), n = g.collectDeclaredFieldKeys(i.source);
|
|
8980
8997
|
if (i.argKey === null) {
|
|
8981
8998
|
for (const o of n)
|
|
8982
8999
|
r[o] = s[o];
|
|
8983
9000
|
return r;
|
|
8984
9001
|
}
|
|
8985
9002
|
const a = {
|
|
8986
|
-
...
|
|
9003
|
+
...g.asPlainRecord(r[i.argKey]) ?? {}
|
|
8987
9004
|
};
|
|
8988
9005
|
for (const o of n)
|
|
8989
9006
|
a[o] = s[o];
|
|
@@ -9013,8 +9030,8 @@ const p = class p {
|
|
|
9013
9030
|
}
|
|
9014
9031
|
t = i;
|
|
9015
9032
|
}
|
|
9016
|
-
const r =
|
|
9017
|
-
return r ? { source: r, argKey:
|
|
9033
|
+
const r = g.getFormFragment(e);
|
|
9034
|
+
return r ? { source: r, argKey: g.resolveFormArgKey(r) } : null;
|
|
9018
9035
|
}
|
|
9019
9036
|
/**
|
|
9020
9037
|
* フォームコンテナの `data-form-arg` のキー名を返します。
|
|
@@ -9046,7 +9063,7 @@ const p = class p {
|
|
|
9046
9063
|
* @returns 宣言されている最上位のキー名
|
|
9047
9064
|
*/
|
|
9048
9065
|
static collectDeclaredFieldKeys(e) {
|
|
9049
|
-
return
|
|
9066
|
+
return g.collectDeclaredKeysInFragment(e);
|
|
9050
9067
|
}
|
|
9051
9068
|
/**
|
|
9052
9069
|
* フラグメントの配下で収集対象として**宣言されている**最上位のキー名を列挙します。
|
|
@@ -9058,7 +9075,7 @@ const p = class p {
|
|
|
9058
9075
|
* @returns 宣言されている最上位のキー名
|
|
9059
9076
|
*/
|
|
9060
9077
|
static collectDeclaredKeysInFragment(e) {
|
|
9061
|
-
const t = /* @__PURE__ */ new Set(), r = e.getTarget(), i =
|
|
9078
|
+
const t = /* @__PURE__ */ new Set(), r = e.getTarget(), i = g.resolveFieldName(e);
|
|
9062
9079
|
i && t.add(String(i));
|
|
9063
9080
|
const s = `${c.prefix}form-object`, n = `${c.prefix}form-list`, a = r.getAttribute(s) ?? r.getAttribute(n);
|
|
9064
9081
|
if (a)
|
|
@@ -9088,7 +9105,7 @@ const p = class p {
|
|
|
9088
9105
|
*/
|
|
9089
9106
|
static applyCustomValidity(e) {
|
|
9090
9107
|
const t = `${c.prefix}validity`, r = (i) => {
|
|
9091
|
-
i.hasAttribute(t) &&
|
|
9108
|
+
i.hasAttribute(t) && g.applyOneCustomValidity(i, t), i.getChildElementFragments().forEach(r);
|
|
9092
9109
|
};
|
|
9093
9110
|
r(e);
|
|
9094
9111
|
}
|
|
@@ -9113,19 +9130,19 @@ const p = class p {
|
|
|
9113
9130
|
r.setCustomValidity("");
|
|
9114
9131
|
return;
|
|
9115
9132
|
}
|
|
9116
|
-
const s =
|
|
9117
|
-
|
|
9133
|
+
const s = g.buildConditionScope(e), n = re.evaluateDetailed(
|
|
9134
|
+
g.unwrapConditionExpression(i),
|
|
9118
9135
|
s
|
|
9119
9136
|
);
|
|
9120
9137
|
if (n.unresolvedReference) {
|
|
9121
9138
|
m.warn(
|
|
9122
9139
|
"Haori",
|
|
9123
9140
|
`${t} の参照が解決できないため無効として扱います: ${i}`
|
|
9124
|
-
), r.setCustomValidity(
|
|
9141
|
+
), r.setCustomValidity(g.resolveValidityMessage(e));
|
|
9125
9142
|
return;
|
|
9126
9143
|
}
|
|
9127
9144
|
r.setCustomValidity(
|
|
9128
|
-
n.value ? "" :
|
|
9145
|
+
n.value ? "" : g.resolveValidityMessage(e)
|
|
9129
9146
|
);
|
|
9130
9147
|
}
|
|
9131
9148
|
/**
|
|
@@ -9136,7 +9153,7 @@ const p = class p {
|
|
|
9136
9153
|
*/
|
|
9137
9154
|
static resolveValidityMessage(e) {
|
|
9138
9155
|
const t = e.getAttribute(`${c.prefix}validity-message`);
|
|
9139
|
-
return typeof t == "string" && t.trim() !== "" ? t :
|
|
9156
|
+
return typeof t == "string" && t.trim() !== "" ? t : Er;
|
|
9140
9157
|
}
|
|
9141
9158
|
/**
|
|
9142
9159
|
* 条件属性の値から式を取り出します。
|
|
@@ -9187,7 +9204,7 @@ const p = class p {
|
|
|
9187
9204
|
* @param identifiesItems リストキーで収集先の配列要素を識別できるかどうか
|
|
9188
9205
|
*/
|
|
9189
9206
|
static registerCollectedRowIdentity(e, t, r, i) {
|
|
9190
|
-
|
|
9207
|
+
g.COLLECTED_ROW_IDENTITY.set(e, { keyArg: t, keys: r, identifiesItems: i });
|
|
9191
9208
|
}
|
|
9192
9209
|
/**
|
|
9193
9210
|
* 収集値の階層に、除外されたキーの集合を結び付けます。
|
|
@@ -9196,7 +9213,7 @@ const p = class p {
|
|
|
9196
9213
|
* @param keys 除外されたキー
|
|
9197
9214
|
*/
|
|
9198
9215
|
static registerCollectedExcludedKeys(e, t) {
|
|
9199
|
-
t.size > 0 &&
|
|
9216
|
+
t.size > 0 && g.COLLECTED_EXCLUDED_KEYS.set(e, t);
|
|
9200
9217
|
}
|
|
9201
9218
|
/**
|
|
9202
9219
|
* 収集値に控えた情報を、複製した値へ引き継ぎます。
|
|
@@ -9209,10 +9226,10 @@ const p = class p {
|
|
|
9209
9226
|
* @param to 複製した値
|
|
9210
9227
|
*/
|
|
9211
9228
|
static carryCollectedRowIdentity(e, t) {
|
|
9212
|
-
const r =
|
|
9213
|
-
r &&
|
|
9214
|
-
const i =
|
|
9215
|
-
i &&
|
|
9229
|
+
const r = g.COLLECTED_ROW_IDENTITY.get(e);
|
|
9230
|
+
r && g.COLLECTED_ROW_IDENTITY.set(t, r);
|
|
9231
|
+
const i = g.COLLECTED_EXCLUDED_KEYS.get(e);
|
|
9232
|
+
i && g.COLLECTED_EXCLUDED_KEYS.set(t, i);
|
|
9216
9233
|
}
|
|
9217
9234
|
/**
|
|
9218
9235
|
* 行の対応付けが出現順へ退いたことを、開発モードで一度だけ知らせます。
|
|
@@ -9224,7 +9241,7 @@ const p = class p {
|
|
|
9224
9241
|
* @param reason 退いた理由
|
|
9225
9242
|
*/
|
|
9226
9243
|
static warnPositionalRowFallback(e) {
|
|
9227
|
-
!V.isEnabled() ||
|
|
9244
|
+
!V.isEnabled() || g.warnedPositionalRowFallbacks.has(e) || (g.warnedPositionalRowFallbacks.add(e), m.warn(
|
|
9228
9245
|
"[Haori]",
|
|
9229
9246
|
`${c.prefix}form-list の行を出現順で対応付けます(${e})。配列と画面の行数・並びが一致していない場合、行の値を取り違えます。`
|
|
9230
9247
|
));
|
|
@@ -9247,7 +9264,7 @@ const p = class p {
|
|
|
9247
9264
|
if (!V.isEnabled() || e.getRawAttribute(`${c.prefix}each-key`) !== null)
|
|
9248
9265
|
return;
|
|
9249
9266
|
const t = e.getRawAttribute(`${c.prefix}each`);
|
|
9250
|
-
t === null ||
|
|
9267
|
+
t === null || g.resolveLeadingPath(t) !== null || g.warnedDerivedRowsWithoutKey.has(t) || (g.warnedDerivedRowsWithoutKey.add(t), m.warn(
|
|
9251
9268
|
"[Haori]",
|
|
9252
9269
|
`${c.prefix}each="${t}" の一覧を ${c.prefix}form-list で収集していますが、${c.prefix}each-key がありません。行と配列要素を出現順で対応付けるため、画面に出ていない要素があると行の値を取り違えます。${c.prefix}each-key を宣言してください。`
|
|
9253
9270
|
));
|
|
@@ -9294,12 +9311,12 @@ const p = class p {
|
|
|
9294
9311
|
static mergeCollectedValues(e, t, r = null) {
|
|
9295
9312
|
const i = { ...e ?? {} };
|
|
9296
9313
|
for (const [n, a] of Object.entries(t)) {
|
|
9297
|
-
if (
|
|
9314
|
+
if (g.UNSAFE_MERGE_KEYS.has(n))
|
|
9298
9315
|
continue;
|
|
9299
9316
|
const o = e && Object.prototype.hasOwnProperty.call(e, n) ? e[n] : r?.(n);
|
|
9300
|
-
i[n] =
|
|
9317
|
+
i[n] = g.overlayCollectedValue(o, a);
|
|
9301
9318
|
}
|
|
9302
|
-
const s =
|
|
9319
|
+
const s = g.COLLECTED_EXCLUDED_KEYS.get(t);
|
|
9303
9320
|
if (s)
|
|
9304
9321
|
for (const n of s)
|
|
9305
9322
|
n in t || delete i[n];
|
|
@@ -9316,13 +9333,13 @@ const p = class p {
|
|
|
9316
9333
|
if (Array.isArray(t)) {
|
|
9317
9334
|
if (!Array.isArray(e))
|
|
9318
9335
|
return t;
|
|
9319
|
-
const s =
|
|
9336
|
+
const s = g.overlayIdentifiedRows(e, t);
|
|
9320
9337
|
return s !== null ? s : t.map(
|
|
9321
|
-
(n, a) =>
|
|
9338
|
+
(n, a) => g.overlayCollectedValue(e[a], n)
|
|
9322
9339
|
);
|
|
9323
9340
|
}
|
|
9324
|
-
const r =
|
|
9325
|
-
return r === null || i === null ? t :
|
|
9341
|
+
const r = g.asPlainRecord(t), i = g.asPlainRecord(e);
|
|
9342
|
+
return r === null || i === null ? t : g.mergeCollectedValues(i, r);
|
|
9326
9343
|
}
|
|
9327
9344
|
/**
|
|
9328
9345
|
* 式の先頭にある素の経路を返します。
|
|
@@ -9340,7 +9357,7 @@ const p = class p {
|
|
|
9340
9357
|
* @returns 先頭の経路。経路として読めない場合は null
|
|
9341
9358
|
*/
|
|
9342
9359
|
static resolveLeadingPath(e) {
|
|
9343
|
-
const t =
|
|
9360
|
+
const t = g.LEADING_PATH_PATTERN.exec(e);
|
|
9344
9361
|
if (!t)
|
|
9345
9362
|
return null;
|
|
9346
9363
|
const r = t[2].trim();
|
|
@@ -9377,7 +9394,7 @@ const p = class p {
|
|
|
9377
9394
|
const r = e.getRawAttribute(`${c.prefix}each`);
|
|
9378
9395
|
if (typeof r != "string" || r.trim() === "")
|
|
9379
9396
|
return !0;
|
|
9380
|
-
const i =
|
|
9397
|
+
const i = g.resolveLeadingPath(r);
|
|
9381
9398
|
if (i === null)
|
|
9382
9399
|
return !0;
|
|
9383
9400
|
const s = i.split(".");
|
|
@@ -9432,7 +9449,7 @@ const p = class p {
|
|
|
9432
9449
|
const i = e.map((n) => n.getListKey());
|
|
9433
9450
|
if (i.some((n) => n === null))
|
|
9434
9451
|
return null;
|
|
9435
|
-
const s =
|
|
9452
|
+
const s = g.createRowKeyIndexes(t, r);
|
|
9436
9453
|
return i.map((n) => {
|
|
9437
9454
|
const a = s.get(n);
|
|
9438
9455
|
return !a || a.length === 0 ? null : t[a.shift()];
|
|
@@ -9462,22 +9479,22 @@ const p = class p {
|
|
|
9462
9479
|
* @returns 重ね合わせた配列。対応付けができない場合は null(出現順へ退く)
|
|
9463
9480
|
*/
|
|
9464
9481
|
static overlayIdentifiedRows(e, t) {
|
|
9465
|
-
const r =
|
|
9482
|
+
const r = g.COLLECTED_ROW_IDENTITY.get(t);
|
|
9466
9483
|
if (r && !r.identifiesItems)
|
|
9467
9484
|
return null;
|
|
9468
9485
|
if (!r)
|
|
9469
|
-
return t.some((n) =>
|
|
9486
|
+
return t.some((n) => g.asPlainRecord(n) !== null) && g.warnPositionalRowFallback("識別情報が引き継がれていません"), null;
|
|
9470
9487
|
if (r.keys.length !== t.length)
|
|
9471
|
-
return
|
|
9488
|
+
return g.warnPositionalRowFallback("収集後に行の数が変わっています"), null;
|
|
9472
9489
|
if (r.keys.some((n) => n === null))
|
|
9473
9490
|
return null;
|
|
9474
|
-
const i =
|
|
9491
|
+
const i = g.createRowKeyIndexes(e, r.keyArg), s = e.slice();
|
|
9475
9492
|
for (let n = 0; n < t.length; n += 1) {
|
|
9476
9493
|
const a = r.keys[n], o = i.get(a);
|
|
9477
9494
|
if (!o || o.length === 0)
|
|
9478
9495
|
continue;
|
|
9479
9496
|
const l = o.shift();
|
|
9480
|
-
s[l] =
|
|
9497
|
+
s[l] = g.overlayCollectedValue(
|
|
9481
9498
|
e[l],
|
|
9482
9499
|
t[n]
|
|
9483
9500
|
);
|
|
@@ -9511,20 +9528,20 @@ const p = class p {
|
|
|
9511
9528
|
*/
|
|
9512
9529
|
static syncAncestorArgForms(e, t, r = null, i = null) {
|
|
9513
9530
|
const s = [];
|
|
9514
|
-
for (const { form: a, key: o } of
|
|
9531
|
+
for (const { form: a, key: o } of g.collectArgForms(e)) {
|
|
9515
9532
|
if (a.wasResetAfter(t))
|
|
9516
9533
|
continue;
|
|
9517
|
-
const l =
|
|
9518
|
-
!l || l.owner !== e || s.push(
|
|
9534
|
+
const l = g.resolveAncestorArgOwner(a, o);
|
|
9535
|
+
!l || l.owner !== e || s.push(g.pushAncestorArgValue(a, o, l.value, r));
|
|
9519
9536
|
}
|
|
9520
9537
|
const n = e.getRawBindingData();
|
|
9521
|
-
for (const { form: a, keys: o } of
|
|
9538
|
+
for (const { form: a, keys: o } of g.collectShadowingContainers(e)) {
|
|
9522
9539
|
if (a.wasResetAfter(t))
|
|
9523
9540
|
continue;
|
|
9524
9541
|
const l = o.filter(
|
|
9525
|
-
(u) =>
|
|
9542
|
+
(u) => g.createArgValueSignature(i?.[u]) !== g.createArgValueSignature(n?.[u])
|
|
9526
9543
|
);
|
|
9527
|
-
l.length !== 0 && s.push(
|
|
9544
|
+
l.length !== 0 && s.push(g.releaseOwnCopy(a, l, r));
|
|
9528
9545
|
}
|
|
9529
9546
|
return Promise.all(s).then(() => {
|
|
9530
9547
|
});
|
|
@@ -9552,13 +9569,13 @@ const p = class p {
|
|
|
9552
9569
|
static collectShadowingContainers(e) {
|
|
9553
9570
|
const t = `${c.prefix}form-arg`, r = [];
|
|
9554
9571
|
return e.getTarget().querySelectorAll(`form:not([${t}]), [${c.prefix}form]`).forEach((i) => {
|
|
9555
|
-
const s =
|
|
9572
|
+
const s = N.get(i);
|
|
9556
9573
|
if (!(s instanceof R))
|
|
9557
9574
|
return;
|
|
9558
9575
|
const n = s.getRawBindingData();
|
|
9559
9576
|
if (n === null)
|
|
9560
9577
|
return;
|
|
9561
|
-
const a =
|
|
9578
|
+
const a = g.getInitialBindingData(s), o = Object.keys(n).filter((l) => Object.prototype.hasOwnProperty.call(a ?? {}, l) ? !1 : g.resolveAncestorKeyOwner(s, l)?.owner === e);
|
|
9562
9579
|
o.length > 0 && r.push({ form: s, keys: o });
|
|
9563
9580
|
}), r;
|
|
9564
9581
|
}
|
|
@@ -9595,7 +9612,7 @@ const p = class p {
|
|
|
9595
9612
|
static collectArgForms(e) {
|
|
9596
9613
|
const t = `${c.prefix}form-arg`, r = e.getTarget().querySelectorAll(`form[${t}]`), i = [];
|
|
9597
9614
|
return r.forEach((s) => {
|
|
9598
|
-
const n =
|
|
9615
|
+
const n = N.get(s);
|
|
9599
9616
|
if (!(n instanceof R))
|
|
9600
9617
|
return;
|
|
9601
9618
|
const a = n.getAttribute(t);
|
|
@@ -9619,15 +9636,15 @@ const p = class p {
|
|
|
9619
9636
|
* @returns 反映完了の Promise
|
|
9620
9637
|
*/
|
|
9621
9638
|
static pushAncestorArgValue(e, t, r, i = null) {
|
|
9622
|
-
const s = e.getTarget(), n =
|
|
9639
|
+
const s = e.getTarget(), n = g.createArgValueSignature(r);
|
|
9623
9640
|
if (n !== null) {
|
|
9624
|
-
if (
|
|
9641
|
+
if (g.LAST_ANCESTOR_ARG_VALUES.get(s) === n)
|
|
9625
9642
|
return Promise.resolve();
|
|
9626
|
-
|
|
9643
|
+
g.LAST_ANCESTOR_ARG_VALUES.set(s, n);
|
|
9627
9644
|
} else
|
|
9628
|
-
|
|
9645
|
+
g.LAST_ANCESTOR_ARG_VALUES.delete(s);
|
|
9629
9646
|
const a = e.getRawBindingData();
|
|
9630
|
-
return a && Object.prototype.hasOwnProperty.call(a, t) ?
|
|
9647
|
+
return a && Object.prototype.hasOwnProperty.call(a, t) ? g.releaseOwnCopy(e, [t], i) : g.syncValues(e, r, !1, i);
|
|
9631
9648
|
}
|
|
9632
9649
|
/**
|
|
9633
9650
|
* 流し込み済み判定に使う値の署名を作ります。
|
|
@@ -9666,23 +9683,23 @@ const p = class p {
|
|
|
9666
9683
|
});
|
|
9667
9684
|
const r = [];
|
|
9668
9685
|
for (const i of t) {
|
|
9669
|
-
if (
|
|
9686
|
+
if (g.INITIAL_RESTORED_FORMS.has(i))
|
|
9670
9687
|
continue;
|
|
9671
|
-
const s =
|
|
9688
|
+
const s = N.get(i);
|
|
9672
9689
|
if (!(s instanceof R))
|
|
9673
9690
|
continue;
|
|
9674
|
-
const n = s.getRawBindingData(), a = s.getAttribute(`${c.prefix}form-arg`), o = a ? String(a) : null, l = o !== null && !(n && Object.prototype.hasOwnProperty.call(n, o)) ?
|
|
9691
|
+
const n = s.getRawBindingData(), a = s.getAttribute(`${c.prefix}form-arg`), o = a ? String(a) : null, l = o !== null && !(n && Object.prototype.hasOwnProperty.call(n, o)) ? g.resolveAncestorArgOwner(s, o) : null;
|
|
9675
9692
|
if (!(!n && !l)) {
|
|
9676
|
-
if (
|
|
9693
|
+
if (g.INITIAL_RESTORED_FORMS.add(i), l) {
|
|
9677
9694
|
r.push(
|
|
9678
|
-
|
|
9695
|
+
g.pushAncestorArgValue(s, o, l.value)
|
|
9679
9696
|
);
|
|
9680
9697
|
continue;
|
|
9681
9698
|
}
|
|
9682
9699
|
r.push(
|
|
9683
|
-
|
|
9700
|
+
g.syncValues(
|
|
9684
9701
|
s,
|
|
9685
|
-
|
|
9702
|
+
g.resolveSyncValues(s, n)
|
|
9686
9703
|
)
|
|
9687
9704
|
);
|
|
9688
9705
|
}
|
|
@@ -9717,9 +9734,9 @@ const p = class p {
|
|
|
9717
9734
|
*/
|
|
9718
9735
|
static collectGroupSelection(e, t, r) {
|
|
9719
9736
|
const i = [];
|
|
9720
|
-
|
|
9721
|
-
|
|
9722
|
-
String(
|
|
9737
|
+
g.collectGroupMembers(
|
|
9738
|
+
g.resolveCollectionScope(e),
|
|
9739
|
+
String(g.resolveFieldName(e)),
|
|
9723
9740
|
i
|
|
9724
9741
|
);
|
|
9725
9742
|
let s = !1;
|
|
@@ -9729,9 +9746,9 @@ const p = class p {
|
|
|
9729
9746
|
const o = a.getTarget();
|
|
9730
9747
|
o instanceof HTMLInputElement && o.checked && n.push(o.value);
|
|
9731
9748
|
}
|
|
9732
|
-
return t ? { edited: s, value:
|
|
9749
|
+
return t ? { edited: s, value: g.markCompleteSet(n) } : n.length === 0 ? { edited: s, value: null } : {
|
|
9733
9750
|
edited: s,
|
|
9734
|
-
value: n.length === 1 ? n[0] :
|
|
9751
|
+
value: n.length === 1 ? n[0] : g.markCompleteSet(n)
|
|
9735
9752
|
};
|
|
9736
9753
|
}
|
|
9737
9754
|
/**
|
|
@@ -9746,7 +9763,7 @@ const p = class p {
|
|
|
9746
9763
|
* @returns 新しい階層を始める場合は true
|
|
9747
9764
|
*/
|
|
9748
9765
|
static startsCollectionLevel(e) {
|
|
9749
|
-
return
|
|
9766
|
+
return g.resolveFieldName(e) ? !1 : !!(e.getAttribute(`${c.prefix}form-object`) || e.getAttribute(`${c.prefix}form-list`));
|
|
9750
9767
|
}
|
|
9751
9768
|
/**
|
|
9752
9769
|
* 収集値の階層(同じキーの集まる範囲)となるフラグメントを解決します。
|
|
@@ -9767,9 +9784,9 @@ const p = class p {
|
|
|
9767
9784
|
static resolveCollectionScope(e) {
|
|
9768
9785
|
let t = e, r = t.getParent();
|
|
9769
9786
|
for (; r !== null; ) {
|
|
9770
|
-
if (
|
|
9787
|
+
if (g.startsCollectionLevel(r))
|
|
9771
9788
|
return r.getAttribute(`${c.prefix}form-object`) ? r : t;
|
|
9772
|
-
if (
|
|
9789
|
+
if (g.isFormScopeRoot(r))
|
|
9773
9790
|
return r;
|
|
9774
9791
|
t = r, r = r.getParent();
|
|
9775
9792
|
}
|
|
@@ -9802,11 +9819,11 @@ const p = class p {
|
|
|
9802
9819
|
* @param members 集める先
|
|
9803
9820
|
*/
|
|
9804
9821
|
static collectGroupMembers(e, t, r) {
|
|
9805
|
-
|
|
9822
|
+
g.isGroupedCheckable(e) && String(g.resolveFieldName(e)) === t && r.push(e);
|
|
9806
9823
|
for (const i of e.getChildElementFragments())
|
|
9807
|
-
|
|
9824
|
+
g.startsCollectionLevel(i) || i.hasAttribute(`${c.prefix}form-detach`) || // `data-if-false` は hide() が DOM へ直接付与するため実 DOM 属性を見る
|
|
9808
9825
|
// (`getPartValues()` と同じ理由)。
|
|
9809
|
-
i.getTarget().hasAttribute(`${c.prefix}if-false`) ||
|
|
9826
|
+
i.getTarget().hasAttribute(`${c.prefix}if-false`) || g.collectGroupMembers(i, t, r);
|
|
9810
9827
|
}
|
|
9811
9828
|
/**
|
|
9812
9829
|
* 「集合として完結した値」として印を付けます。
|
|
@@ -9820,7 +9837,7 @@ const p = class p {
|
|
|
9820
9837
|
* @returns 同じ配列
|
|
9821
9838
|
*/
|
|
9822
9839
|
static markCompleteSet(e) {
|
|
9823
|
-
return
|
|
9840
|
+
return g.COMPLETE_SET_VALUES.add(e), e;
|
|
9824
9841
|
}
|
|
9825
9842
|
/**
|
|
9826
9843
|
* 「集合として完結した値」の印が付いているかを返します。
|
|
@@ -9833,7 +9850,7 @@ const p = class p {
|
|
|
9833
9850
|
* @returns 印が付いていれば true
|
|
9834
9851
|
*/
|
|
9835
9852
|
static isCompleteSetValue(e) {
|
|
9836
|
-
return e !== null && typeof e == "object" &&
|
|
9853
|
+
return e !== null && typeof e == "object" && g.COMPLETE_SET_VALUES.has(e);
|
|
9837
9854
|
}
|
|
9838
9855
|
/**
|
|
9839
9856
|
* 値による上書きをグループ単位で扱うべき入力要素(boolean 型でない
|
|
@@ -9885,45 +9902,45 @@ const p = class p {
|
|
|
9885
9902
|
const o = [];
|
|
9886
9903
|
if (e.hasAttribute(`${c.prefix}form-detach`) && !r)
|
|
9887
9904
|
return Promise.resolve();
|
|
9888
|
-
const l =
|
|
9905
|
+
const l = g.resolveFieldName(e), u = e.getAttribute(`${c.prefix}form-object`), d = e.getAttribute(`${c.prefix}form-list`), y = e.hasAttribute(`${c.prefix}form-list`);
|
|
9889
9906
|
if (l) {
|
|
9890
9907
|
const b = t[String(l)], E = s && re.withoutDiagnosis(
|
|
9891
|
-
() =>
|
|
9892
|
-
), A = s && typeof b > "u" && !
|
|
9908
|
+
() => g.hasResolvedDeclarativeState(e)
|
|
9909
|
+
), A = s && typeof b > "u" && !g.isDeclarativeStateBound(e);
|
|
9893
9910
|
let w = b;
|
|
9894
|
-
if (E ? w = void 0 : A && (w = null),
|
|
9911
|
+
if (E ? w = void 0 : A && (w = null), g.isFileInput(e))
|
|
9895
9912
|
return (w === null || w === "") && o.push(
|
|
9896
|
-
|
|
9913
|
+
g.applyFragmentValue(e, null, i, a)
|
|
9897
9914
|
), Promise.all(o).then(() => {
|
|
9898
9915
|
});
|
|
9899
9916
|
if (y && Array.isArray(w) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
9900
9917
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
9901
9918
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
9902
|
-
!
|
|
9903
|
-
const M = String(l),
|
|
9904
|
-
n.set(M,
|
|
9905
|
-
|
|
9919
|
+
!g.isGroupedCheckable(e) && !g.isMultipleSelect(e)) {
|
|
9920
|
+
const M = String(l), F = n.get(M) ?? 0;
|
|
9921
|
+
n.set(M, F + 1), o.push(
|
|
9922
|
+
g.applyFragmentValue(
|
|
9906
9923
|
e,
|
|
9907
|
-
w[
|
|
9924
|
+
w[F] ?? null,
|
|
9908
9925
|
i,
|
|
9909
9926
|
a
|
|
9910
9927
|
)
|
|
9911
9928
|
);
|
|
9912
|
-
} else typeof w > "u" || (Array.isArray(w) &&
|
|
9913
|
-
|
|
9929
|
+
} else typeof w > "u" || (Array.isArray(w) && g.isGroupedCheckable(e) || Array.isArray(w) && g.isMultipleSelect(e) || typeof w == "string" || typeof w == "number" || typeof w == "boolean" || w === null || Array.isArray(w) && e.collectsLines() ? o.push(
|
|
9930
|
+
g.applyFragmentValue(
|
|
9914
9931
|
e,
|
|
9915
9932
|
w,
|
|
9916
9933
|
i,
|
|
9917
9934
|
a
|
|
9918
9935
|
)
|
|
9919
9936
|
) : o.push(
|
|
9920
|
-
|
|
9937
|
+
g.applyFragmentValue(e, String(w), i, a)
|
|
9921
9938
|
));
|
|
9922
9939
|
} else if (u) {
|
|
9923
9940
|
const b = t[String(u)], E = b && typeof b == "object" ? b : {}, A = /* @__PURE__ */ new Map();
|
|
9924
9941
|
for (const w of e.getChildElementFragments())
|
|
9925
9942
|
o.push(
|
|
9926
|
-
|
|
9943
|
+
g.setPartValues(
|
|
9927
9944
|
w,
|
|
9928
9945
|
E,
|
|
9929
9946
|
r,
|
|
@@ -9934,18 +9951,18 @@ const p = class p {
|
|
|
9934
9951
|
)
|
|
9935
9952
|
);
|
|
9936
9953
|
} else if (d) {
|
|
9937
|
-
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(), w = e.getAttribute(`${c.prefix}each-key`), M =
|
|
9954
|
+
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(), w = e.getAttribute(`${c.prefix}each-key`), M = g.isCollectedListFromEachSource(e) ? g.pairRowsWithItems(
|
|
9938
9955
|
A,
|
|
9939
9956
|
E,
|
|
9940
9957
|
w == null ? null : String(w)
|
|
9941
9958
|
) : null;
|
|
9942
|
-
for (let
|
|
9943
|
-
const se = A[
|
|
9959
|
+
for (let F = 0; F < A.length; F++) {
|
|
9960
|
+
const se = A[F], C = M ? M[F] : E.length > F ? E[F] : null;
|
|
9944
9961
|
o.push(
|
|
9945
9962
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
9946
|
-
|
|
9963
|
+
g.setPartValues(
|
|
9947
9964
|
se,
|
|
9948
|
-
|
|
9965
|
+
g.asPlainRecord(C) ?? {},
|
|
9949
9966
|
r,
|
|
9950
9967
|
i,
|
|
9951
9968
|
s,
|
|
@@ -9957,7 +9974,7 @@ const p = class p {
|
|
|
9957
9974
|
} else
|
|
9958
9975
|
for (const b of e.getChildElementFragments())
|
|
9959
9976
|
o.push(
|
|
9960
|
-
|
|
9977
|
+
g.setPartValues(
|
|
9961
9978
|
b,
|
|
9962
9979
|
t,
|
|
9963
9980
|
r,
|
|
@@ -9986,52 +10003,52 @@ const p = class p {
|
|
|
9986
10003
|
* @returns すべての初期化処理が完了するPromise
|
|
9987
10004
|
*/
|
|
9988
10005
|
static async reset(e, t = R.nextSequence()) {
|
|
9989
|
-
const r =
|
|
10006
|
+
const r = g.collectBindingTargetForms(e);
|
|
9990
10007
|
if (r.length > 0 && r.every((s) => s.isSupplyStale(t)))
|
|
9991
10008
|
return;
|
|
9992
|
-
|
|
9993
|
-
|
|
9994
|
-
|
|
10009
|
+
g.markResetSubtree(e, t), $.clearUserEditMarks(e, t), g.clearValues(e), await Promise.all([
|
|
10010
|
+
g.clearMessages(e),
|
|
10011
|
+
g.clearEachClones(e)
|
|
9995
10012
|
]), await J.enqueue(() => {
|
|
9996
|
-
const s =
|
|
10013
|
+
const s = g.collectEditsAfter(
|
|
9997
10014
|
e,
|
|
9998
10015
|
t
|
|
9999
10016
|
), n = e.getTarget();
|
|
10000
|
-
|
|
10017
|
+
g.internalResetDepth += 1;
|
|
10001
10018
|
try {
|
|
10002
|
-
n instanceof HTMLFormElement ? n.reset() : (n.querySelectorAll("form").forEach((a) => a.reset()),
|
|
10019
|
+
n instanceof HTMLFormElement ? n.reset() : (n.querySelectorAll("form").forEach((a) => a.reset()), g.restoreDefaultValues(n));
|
|
10003
10020
|
} finally {
|
|
10004
|
-
|
|
10021
|
+
g.internalResetDepth -= 1;
|
|
10005
10022
|
}
|
|
10006
|
-
|
|
10023
|
+
g.clearDeclarativeStateFromDom(e), $.invalidateDerivedSubtreeSignatures(e), g.restoreEdits(s);
|
|
10007
10024
|
});
|
|
10008
10025
|
const i = r;
|
|
10009
10026
|
for (const s of i) {
|
|
10010
|
-
const n =
|
|
10027
|
+
const n = g.getInitialBindingData(s);
|
|
10011
10028
|
n === null && s.getRawBindingData() === null || await $.setBindingData(s.getTarget(), n ?? {}, {
|
|
10012
10029
|
sequence: t
|
|
10013
10030
|
});
|
|
10014
10031
|
}
|
|
10015
|
-
|
|
10032
|
+
g.syncValuesFromDom(e), await $.evaluateAll(e);
|
|
10016
10033
|
for (const s of i)
|
|
10017
|
-
|
|
10034
|
+
g.getInitialBindingData(s) !== null || s.getRawBindingData() !== null || await g.restoreAncestorArgValues(s, {
|
|
10018
10035
|
sequence: t,
|
|
10019
10036
|
kind: "supply"
|
|
10020
10037
|
});
|
|
10021
10038
|
for (const s of i) {
|
|
10022
|
-
const n =
|
|
10039
|
+
const n = g.getInitialBindingData(s);
|
|
10023
10040
|
if (s.getRawBindingData() === null && n === null)
|
|
10024
10041
|
continue;
|
|
10025
|
-
const a =
|
|
10042
|
+
const a = g.getValues(s), o = s.getAttribute(`${c.prefix}form-arg`);
|
|
10026
10043
|
let l = { ...n || {} };
|
|
10027
10044
|
if (o) {
|
|
10028
10045
|
const u = String(o);
|
|
10029
|
-
!Object.prototype.hasOwnProperty.call(n ?? {}, u) &&
|
|
10046
|
+
!Object.prototype.hasOwnProperty.call(n ?? {}, u) && g.resolveAncestorArgOwner(s, u) !== null || (l[u] = g.mergeCollectedValues(
|
|
10030
10047
|
l[u] ?? null,
|
|
10031
10048
|
a
|
|
10032
10049
|
));
|
|
10033
10050
|
} else
|
|
10034
|
-
l =
|
|
10051
|
+
l = g.mergeCollectedValues(l, a), g.deleteAncestorOwnedKeys(s, n, l);
|
|
10035
10052
|
await $.setBindingData(s.getTarget(), l, {
|
|
10036
10053
|
sequence: t
|
|
10037
10054
|
});
|
|
@@ -10050,7 +10067,7 @@ const p = class p {
|
|
|
10050
10067
|
*/
|
|
10051
10068
|
static deleteAncestorOwnedKeys(e, t, r) {
|
|
10052
10069
|
for (const i of Object.keys(r))
|
|
10053
|
-
Object.prototype.hasOwnProperty.call(t ?? {}, i) ||
|
|
10070
|
+
Object.prototype.hasOwnProperty.call(t ?? {}, i) || g.resolveAncestorKeyOwner(e, i) !== null && delete r[i];
|
|
10054
10071
|
}
|
|
10055
10072
|
/**
|
|
10056
10073
|
* data-bind 属性で宣言された初期バインドデータを取得します。
|
|
@@ -10071,7 +10088,7 @@ const p = class p {
|
|
|
10071
10088
|
const t = e.getTarget();
|
|
10072
10089
|
(t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) && e.syncValue();
|
|
10073
10090
|
for (const r of e.getChildElementFragments())
|
|
10074
|
-
|
|
10091
|
+
g.syncValuesFromDom(r);
|
|
10075
10092
|
}
|
|
10076
10093
|
/**
|
|
10077
10094
|
* リセット後にバインドデータを更新すべきフォームフラグメントを収集します。
|
|
@@ -10087,7 +10104,7 @@ const p = class p {
|
|
|
10087
10104
|
t instanceof HTMLFormElement ? r.push(t) : r.push(...Array.from(t.querySelectorAll("form")));
|
|
10088
10105
|
const i = [];
|
|
10089
10106
|
for (const s of r) {
|
|
10090
|
-
const n =
|
|
10107
|
+
const n = N.get(s);
|
|
10091
10108
|
n instanceof R && i.push(n);
|
|
10092
10109
|
}
|
|
10093
10110
|
return i;
|
|
@@ -10126,7 +10143,7 @@ const p = class p {
|
|
|
10126
10143
|
static clearValues(e) {
|
|
10127
10144
|
e.clearValue();
|
|
10128
10145
|
for (const t of e.getChildElementFragments())
|
|
10129
|
-
|
|
10146
|
+
g.clearValues(t);
|
|
10130
10147
|
}
|
|
10131
10148
|
/**
|
|
10132
10149
|
* 指定した通番より後に編集された入力欄の DOM の状態を控えます。
|
|
@@ -10150,7 +10167,7 @@ const p = class p {
|
|
|
10150
10167
|
)
|
|
10151
10168
|
}) : r.push({ element: i, value: i.value }));
|
|
10152
10169
|
for (const s of e.getChildElementFragments())
|
|
10153
|
-
|
|
10170
|
+
g.collectEditsAfter(s, t, r);
|
|
10154
10171
|
return r;
|
|
10155
10172
|
}
|
|
10156
10173
|
/**
|
|
@@ -10192,8 +10209,8 @@ const p = class p {
|
|
|
10192
10209
|
const r = e.getAttribute(`${c.prefix}form-arg`);
|
|
10193
10210
|
if (!r)
|
|
10194
10211
|
return;
|
|
10195
|
-
const i = String(r), s =
|
|
10196
|
-
s && (
|
|
10212
|
+
const i = String(r), s = g.resolveAncestorArgOwner(e, i);
|
|
10213
|
+
s && (g.LAST_ANCESTOR_ARG_VALUES.delete(e.getTarget()), await g.pushAncestorArgValue(e, i, s.value, t));
|
|
10197
10214
|
}
|
|
10198
10215
|
/**
|
|
10199
10216
|
* 初期化の通番を部分木のすべてのフラグメントへ記録します。
|
|
@@ -10209,7 +10226,7 @@ const p = class p {
|
|
|
10209
10226
|
static markResetSubtree(e, t) {
|
|
10210
10227
|
e.markResetAt(t), e.markSupplyApplied(t);
|
|
10211
10228
|
for (const r of e.getChildElementFragments())
|
|
10212
|
-
|
|
10229
|
+
g.markResetSubtree(r, t);
|
|
10213
10230
|
}
|
|
10214
10231
|
/**
|
|
10215
10232
|
* フラグメントとその子要素のメッセージをクリアします。
|
|
@@ -10218,7 +10235,7 @@ const p = class p {
|
|
|
10218
10235
|
* @returns Promise(メッセージのクリアが完了したら解決される)
|
|
10219
10236
|
*/
|
|
10220
10237
|
static clearMessages(e) {
|
|
10221
|
-
return
|
|
10238
|
+
return Tt().clearMessages(
|
|
10222
10239
|
e.getTarget()
|
|
10223
10240
|
);
|
|
10224
10241
|
}
|
|
@@ -10232,7 +10249,7 @@ const p = class p {
|
|
|
10232
10249
|
* @return Promise(メッセージの追加が完了したら解決される)
|
|
10233
10250
|
*/
|
|
10234
10251
|
static addErrorMessage(e, t, r) {
|
|
10235
|
-
return
|
|
10252
|
+
return g.addMessage(e, t, r, "error");
|
|
10236
10253
|
}
|
|
10237
10254
|
/**
|
|
10238
10255
|
* キーに一致するフラグメントにレベル付きメッセージを追加します。
|
|
@@ -10245,8 +10262,8 @@ const p = class p {
|
|
|
10245
10262
|
* @return Promise(メッセージの追加が完了したら解決される)
|
|
10246
10263
|
*/
|
|
10247
10264
|
static addMessage(e, t, r, i) {
|
|
10248
|
-
const s = [], n =
|
|
10249
|
-
|
|
10265
|
+
const s = [], n = Tt(), a = n.addMessage, o = (u) => typeof a == "function" ? a.call(n, u, r, i) : n.addErrorMessage(u, r), l = g.keepFirstRadio(
|
|
10266
|
+
g.findFragmentsByKey(e, t)
|
|
10250
10267
|
);
|
|
10251
10268
|
return l.forEach((u) => {
|
|
10252
10269
|
s.push(o(u.getTarget()));
|
|
@@ -10278,7 +10295,7 @@ const p = class p {
|
|
|
10278
10295
|
* @returns 一致するフラグメントの配列
|
|
10279
10296
|
*/
|
|
10280
10297
|
static findFragmentsByKey(e, t) {
|
|
10281
|
-
return
|
|
10298
|
+
return g.findFragmentByKeyParts(e, t.split("."));
|
|
10282
10299
|
}
|
|
10283
10300
|
/**
|
|
10284
10301
|
* 指定されたキーに一致するフラグメントを検索します。
|
|
@@ -10290,9 +10307,9 @@ const p = class p {
|
|
|
10290
10307
|
*/
|
|
10291
10308
|
static findFragmentByKeyParts(e, t) {
|
|
10292
10309
|
const r = [], i = t[0];
|
|
10293
|
-
if (t.length == 1 &&
|
|
10310
|
+
if (t.length == 1 && g.resolveFieldName(e) === i && r.push(e), e.hasAttribute(`${c.prefix}form-object`))
|
|
10294
10311
|
t.length > 1 && e.getAttribute(`${c.prefix}form-object`) === i && e.getChildElementFragments().forEach((n) => {
|
|
10295
|
-
r.push(...
|
|
10312
|
+
r.push(...g.findFragmentByKeyParts(n, t.slice(1)));
|
|
10296
10313
|
});
|
|
10297
10314
|
else if (e.hasAttribute(`${c.prefix}form-list`)) {
|
|
10298
10315
|
if (t.length > 1) {
|
|
@@ -10306,7 +10323,7 @@ const p = class p {
|
|
|
10306
10323
|
else {
|
|
10307
10324
|
const d = e.getChildElementFragments().filter((y) => y.hasAttribute(`${c.prefix}row`));
|
|
10308
10325
|
u < d.length && r.push(
|
|
10309
|
-
...
|
|
10326
|
+
...g.findFragmentByKeyParts(d[u], t.slice(1))
|
|
10310
10327
|
);
|
|
10311
10328
|
}
|
|
10312
10329
|
}
|
|
@@ -10314,7 +10331,7 @@ const p = class p {
|
|
|
10314
10331
|
}
|
|
10315
10332
|
} else
|
|
10316
10333
|
e.getChildElementFragments().forEach((s) => {
|
|
10317
|
-
r.push(...
|
|
10334
|
+
r.push(...g.findFragmentByKeyParts(s, t));
|
|
10318
10335
|
});
|
|
10319
10336
|
return r;
|
|
10320
10337
|
}
|
|
@@ -10337,12 +10354,12 @@ const p = class p {
|
|
|
10337
10354
|
return r ? this.getFormFragment(r) : null;
|
|
10338
10355
|
}
|
|
10339
10356
|
};
|
|
10340
|
-
|
|
10357
|
+
g.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), g.LAST_ANCESTOR_ARG_VALUES = /* @__PURE__ */ new WeakMap(), g.GROUP_SCOPE_IDS = /* @__PURE__ */ new WeakMap(), g.groupScopeSequence = 0, g.internalResetDepth = 0, g.warnedArgOwnerNotRecord = /* @__PURE__ */ new WeakMap(), g.UNSAFE_MERGE_KEYS = /* @__PURE__ */ new Set([
|
|
10341
10358
|
"__proto__",
|
|
10342
10359
|
"constructor",
|
|
10343
10360
|
"prototype"
|
|
10344
|
-
]),
|
|
10345
|
-
let
|
|
10361
|
+
]), g.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), g.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), g.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), g.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), g.warnedDerivedRowsWithoutKey = /* @__PURE__ */ new Set(), g.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
10362
|
+
let D = g;
|
|
10346
10363
|
class O {
|
|
10347
10364
|
/**
|
|
10348
10365
|
* カスタムイベントを発火します。
|
|
@@ -10582,12 +10599,12 @@ class O {
|
|
|
10582
10599
|
O.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
10583
10600
|
}
|
|
10584
10601
|
}
|
|
10585
|
-
const
|
|
10602
|
+
const vr = {
|
|
10586
10603
|
401: "unauthorized-redirect",
|
|
10587
10604
|
403: "forbidden-redirect"
|
|
10588
10605
|
};
|
|
10589
|
-
function
|
|
10590
|
-
return
|
|
10606
|
+
function wr(p, e) {
|
|
10607
|
+
return p.replace(/\{\{([\s\S]+?)\}\}/g, (t, r) => {
|
|
10591
10608
|
try {
|
|
10592
10609
|
const i = re.evaluate(String(r).trim(), e);
|
|
10593
10610
|
return i == null ? "" : String(i);
|
|
@@ -10596,17 +10613,17 @@ function vr(f, e) {
|
|
|
10596
10613
|
}
|
|
10597
10614
|
});
|
|
10598
10615
|
}
|
|
10599
|
-
function
|
|
10600
|
-
const t =
|
|
10616
|
+
function kt(p, e) {
|
|
10617
|
+
const t = p.getAttribute(e);
|
|
10601
10618
|
if (t === null || t === "")
|
|
10602
10619
|
return null;
|
|
10603
10620
|
if (!t.includes("{{"))
|
|
10604
10621
|
return t;
|
|
10605
|
-
const r =
|
|
10622
|
+
const r = N.get(p), i = r instanceof R ? r.getBindingData() : {}, s = wr(t, i);
|
|
10606
10623
|
return s === "" ? null : s;
|
|
10607
10624
|
}
|
|
10608
|
-
function
|
|
10609
|
-
const r =
|
|
10625
|
+
function Sr(p, e, t) {
|
|
10626
|
+
const r = p.getAttribute(`${e}-return-param`);
|
|
10610
10627
|
if (r === null || r === "")
|
|
10611
10628
|
return t;
|
|
10612
10629
|
try {
|
|
@@ -10618,8 +10635,8 @@ function wr(f, e, t) {
|
|
|
10618
10635
|
const i = window.location.pathname + window.location.search + window.location.hash, n = `${encodeURIComponent(r)}=${encodeURIComponent(i)}`, a = t.indexOf("#"), o = a >= 0 ? t.slice(a) : "", l = a >= 0 ? t.slice(0, a) : t, u = l.includes("?") ? "&" : "?";
|
|
10619
10636
|
return `${l}${u}${n}${o}`;
|
|
10620
10637
|
}
|
|
10621
|
-
function
|
|
10622
|
-
const r =
|
|
10638
|
+
function Nt(p, e, t) {
|
|
10639
|
+
const r = Sr(p, e, t);
|
|
10623
10640
|
if (!Oe.isNavigableUrl(r))
|
|
10624
10641
|
return m.error(
|
|
10625
10642
|
"Haori",
|
|
@@ -10632,23 +10649,23 @@ function kt(f, e, t) {
|
|
|
10632
10649
|
}
|
|
10633
10650
|
return window.location.href = r, !0;
|
|
10634
10651
|
}
|
|
10635
|
-
function
|
|
10636
|
-
const t =
|
|
10652
|
+
function Zt(p, e = null) {
|
|
10653
|
+
const t = vr[p];
|
|
10637
10654
|
if (t === void 0 || typeof document > "u")
|
|
10638
10655
|
return !1;
|
|
10639
10656
|
if (e !== null) {
|
|
10640
10657
|
const s = `${e.attrPrefix}${t}`;
|
|
10641
10658
|
if (e.element.hasAttribute(s)) {
|
|
10642
|
-
const n =
|
|
10643
|
-
return n !== null &&
|
|
10659
|
+
const n = kt(e.element, s);
|
|
10660
|
+
return n !== null && Nt(e.element, s, n);
|
|
10644
10661
|
}
|
|
10645
10662
|
}
|
|
10646
10663
|
const r = `${c.prefix}${t}`, i = [];
|
|
10647
10664
|
document.body && i.push(document.body), document.documentElement && i.push(document.documentElement);
|
|
10648
10665
|
for (const s of i) {
|
|
10649
|
-
const n =
|
|
10666
|
+
const n = kt(s, r);
|
|
10650
10667
|
if (n !== null)
|
|
10651
|
-
return
|
|
10668
|
+
return Nt(s, r, n);
|
|
10652
10669
|
}
|
|
10653
10670
|
return !1;
|
|
10654
10671
|
}
|
|
@@ -11158,7 +11175,7 @@ const x = class x {
|
|
|
11158
11175
|
).forEach((i) => {
|
|
11159
11176
|
if (!x.RESTORED_ELEMENTS.has(i))
|
|
11160
11177
|
return;
|
|
11161
|
-
const s =
|
|
11178
|
+
const s = N.get(i);
|
|
11162
11179
|
if (!(s instanceof R))
|
|
11163
11180
|
return;
|
|
11164
11181
|
const n = x.readDeclaration(s);
|
|
@@ -11174,13 +11191,13 @@ const x = class x {
|
|
|
11174
11191
|
};
|
|
11175
11192
|
x.SIGNATURES = /* @__PURE__ */ new WeakMap(), x.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), x.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), x.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
11176
11193
|
let Be = x;
|
|
11177
|
-
const Ie = "[Haori]",
|
|
11178
|
-
bodyIgnored: (
|
|
11179
|
-
notRegistered: (
|
|
11180
|
-
argsNotArray: (
|
|
11181
|
-
templateInBody: (
|
|
11182
|
-
notExpression: (
|
|
11183
|
-
shadowed: (
|
|
11194
|
+
const Ie = "[Haori]", Ce = {
|
|
11195
|
+
bodyIgnored: (p) => `${p} is ignored because ${p}-handler is also declared.`,
|
|
11196
|
+
notRegistered: (p, e) => `Handler "${p}" is not registered (${e}-handler). Register it with Haori.handlers.register().`,
|
|
11197
|
+
argsNotArray: (p) => `${p}-args must evaluate to an array without unresolved references; the handler is not called.`,
|
|
11198
|
+
templateInBody: (p) => `${p} with {{...}} is not run in the CSP mode (the default). Write the expression without {{...}}, or use ${p}-handler and ${p}-args. To run it as JavaScript, select the legacy mode with <script data-csp="false">.`,
|
|
11199
|
+
notExpression: (p) => `${p} is not run in the CSP mode (the default) because it is not a single expression. Use ${p}-handler and ${p}-args. To run it as JavaScript, select the legacy mode with <script data-csp="false">.`,
|
|
11200
|
+
shadowed: (p, e) => `Handler(s) ${p.join(", ")} are shadowed by binding keys of the same name in ${e}; the binding values are used.`
|
|
11184
11201
|
};
|
|
11185
11202
|
class oe {
|
|
11186
11203
|
/**
|
|
@@ -11214,7 +11231,7 @@ class oe {
|
|
|
11214
11231
|
*/
|
|
11215
11232
|
static compile(e, t, r) {
|
|
11216
11233
|
const i = `${t}-handler`;
|
|
11217
|
-
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(Ie,
|
|
11234
|
+
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(Ie, Ce.bodyIgnored(t), e.getTarget()), oe.compileHandler(e, t)) : oe.compileExpression(e, t, r);
|
|
11218
11235
|
}
|
|
11219
11236
|
/**
|
|
11220
11237
|
* 登録した関数を呼ぶ呼び出しを組み立てます(`-handler` / `-args`)。
|
|
@@ -11228,11 +11245,11 @@ class oe {
|
|
|
11228
11245
|
static compileHandler(e, t) {
|
|
11229
11246
|
const r = e.getRawAttribute(`${t}-handler`), i = e.getRawAttribute(`${t}-args`);
|
|
11230
11247
|
return (s) => {
|
|
11231
|
-
const n =
|
|
11248
|
+
const n = Ne.get(r);
|
|
11232
11249
|
if (n === void 0) {
|
|
11233
11250
|
m.warn(
|
|
11234
11251
|
Ie,
|
|
11235
|
-
|
|
11252
|
+
Ce.notRegistered(r, t),
|
|
11236
11253
|
e.getTarget()
|
|
11237
11254
|
);
|
|
11238
11255
|
return;
|
|
@@ -11244,7 +11261,7 @@ class oe {
|
|
|
11244
11261
|
e.getBindingData()
|
|
11245
11262
|
);
|
|
11246
11263
|
if (!Array.isArray(o.value)) {
|
|
11247
|
-
m.warn(Ie,
|
|
11264
|
+
m.warn(Ie, Ce.argsNotArray(t), i);
|
|
11248
11265
|
return;
|
|
11249
11266
|
}
|
|
11250
11267
|
a = o.value;
|
|
@@ -11266,17 +11283,17 @@ class oe {
|
|
|
11266
11283
|
static compileExpression(e, t, r) {
|
|
11267
11284
|
const i = e.getRawAttribute(t);
|
|
11268
11285
|
if (i.includes("{{"))
|
|
11269
|
-
return m.warn(Ie,
|
|
11286
|
+
return m.warn(Ie, Ce.templateInBody(t), e.getTarget()), null;
|
|
11270
11287
|
try {
|
|
11271
11288
|
Le.compile(i);
|
|
11272
11289
|
} catch {
|
|
11273
|
-
return m.warn(Ie,
|
|
11290
|
+
return m.warn(Ie, Ce.notExpression(t), e.getTarget()), null;
|
|
11274
11291
|
}
|
|
11275
11292
|
return (s) => {
|
|
11276
11293
|
const n = e.getBindingData();
|
|
11277
11294
|
V.isEnabled() && oe.reportShadowedHandlers(n, t);
|
|
11278
11295
|
const a = {
|
|
11279
|
-
...
|
|
11296
|
+
...Ne.entries(),
|
|
11280
11297
|
...n
|
|
11281
11298
|
};
|
|
11282
11299
|
return r.forEach((o, l) => {
|
|
@@ -11292,11 +11309,11 @@ class oe {
|
|
|
11292
11309
|
* @returns 戻り値はありません。
|
|
11293
11310
|
*/
|
|
11294
11311
|
static reportShadowedHandlers(e, t) {
|
|
11295
|
-
const r = Object.keys(e).filter((i) =>
|
|
11296
|
-
r.length > 0 && m.warn(Ie,
|
|
11312
|
+
const r = Object.keys(e).filter((i) => Ne.has(i));
|
|
11313
|
+
r.length > 0 && m.warn(Ie, Ce.shadowed(r, t));
|
|
11297
11314
|
}
|
|
11298
11315
|
}
|
|
11299
|
-
const
|
|
11316
|
+
const Rr = [
|
|
11300
11317
|
"addErrorMessage",
|
|
11301
11318
|
"clearMessages",
|
|
11302
11319
|
"closeDialog",
|
|
@@ -11304,45 +11321,45 @@ const Sr = [
|
|
|
11304
11321
|
"dialog",
|
|
11305
11322
|
"openDialog",
|
|
11306
11323
|
"toast"
|
|
11307
|
-
],
|
|
11324
|
+
], Tr = "__haoriHistoryState__", tt = "data-haori-click-lock", Dt = "ファイルを保存できませんでした", kr = 100;
|
|
11308
11325
|
let Pe = null;
|
|
11309
|
-
const
|
|
11326
|
+
const Nr = ["info", "warning", "error", "success"], xt = /^(\d{3})-(click|click-await|close|toast|toast-level|no-message|bind)$/;
|
|
11310
11327
|
function ge() {
|
|
11311
11328
|
const e = globalThis.window?.Haori;
|
|
11312
|
-
return
|
|
11329
|
+
return Rr.every(
|
|
11313
11330
|
(r) => typeof e?.[r] == "function"
|
|
11314
|
-
) ? e :
|
|
11331
|
+
) ? e : De;
|
|
11315
11332
|
}
|
|
11316
11333
|
const Dr = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
11317
|
-
function je(
|
|
11318
|
-
return Dr.has(
|
|
11334
|
+
function je(p) {
|
|
11335
|
+
return Dr.has(p.toUpperCase());
|
|
11319
11336
|
}
|
|
11320
|
-
function
|
|
11337
|
+
function xr(p, e) {
|
|
11321
11338
|
for (const [t, r] of Object.entries(e))
|
|
11322
11339
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
11323
|
-
|
|
11324
|
-
}) :
|
|
11340
|
+
p.append(t, Fe(i));
|
|
11341
|
+
}) : p.append(t, Fe(r)));
|
|
11325
11342
|
}
|
|
11326
|
-
function
|
|
11327
|
-
if (
|
|
11343
|
+
function Fe(p) {
|
|
11344
|
+
if (p == null)
|
|
11328
11345
|
return "";
|
|
11329
|
-
if (typeof
|
|
11346
|
+
if (typeof p == "object" || typeof p == "function")
|
|
11330
11347
|
try {
|
|
11331
|
-
return JSON.stringify(
|
|
11348
|
+
return JSON.stringify(p) ?? "";
|
|
11332
11349
|
} catch {
|
|
11333
11350
|
return "";
|
|
11334
11351
|
}
|
|
11335
|
-
return String(
|
|
11352
|
+
return String(p);
|
|
11336
11353
|
}
|
|
11337
|
-
function
|
|
11338
|
-
const t = new URL(
|
|
11339
|
-
return
|
|
11354
|
+
function Qt(p, e) {
|
|
11355
|
+
const t = new URL(p, window.location.href), r = new URLSearchParams(t.search);
|
|
11356
|
+
return xr(r, e), t.search = r.toString(), t.toString();
|
|
11340
11357
|
}
|
|
11341
|
-
function
|
|
11342
|
-
if (
|
|
11358
|
+
function Ir(p) {
|
|
11359
|
+
if (p == null)
|
|
11343
11360
|
return { payload: {}, dropped: !1 };
|
|
11344
|
-
if (typeof
|
|
11345
|
-
const e =
|
|
11361
|
+
if (typeof p == "string") {
|
|
11362
|
+
const e = p.trim();
|
|
11346
11363
|
if (e === "")
|
|
11347
11364
|
return { payload: {}, dropped: !1 };
|
|
11348
11365
|
if (e.startsWith("{")) {
|
|
@@ -11355,48 +11372,48 @@ function xr(f) {
|
|
|
11355
11372
|
return { payload: {}, dropped: !0 };
|
|
11356
11373
|
}
|
|
11357
11374
|
return e.includes("=") ? {
|
|
11358
|
-
payload:
|
|
11375
|
+
payload: It(new URLSearchParams(e)),
|
|
11359
11376
|
dropped: !1
|
|
11360
11377
|
} : { payload: {}, dropped: !0 };
|
|
11361
11378
|
}
|
|
11362
|
-
if (
|
|
11363
|
-
return { payload:
|
|
11364
|
-
if (typeof FormData < "u" &&
|
|
11379
|
+
if (p instanceof URLSearchParams)
|
|
11380
|
+
return { payload: It(p), dropped: !1 };
|
|
11381
|
+
if (typeof FormData < "u" && p instanceof FormData) {
|
|
11365
11382
|
const e = {};
|
|
11366
11383
|
let t = !1;
|
|
11367
|
-
for (const [r, i] of
|
|
11384
|
+
for (const [r, i] of p.entries()) {
|
|
11368
11385
|
if (typeof i != "string") {
|
|
11369
11386
|
t = !0;
|
|
11370
11387
|
continue;
|
|
11371
11388
|
}
|
|
11372
|
-
|
|
11389
|
+
_t(e, r, i);
|
|
11373
11390
|
}
|
|
11374
11391
|
return { payload: e, dropped: t };
|
|
11375
11392
|
}
|
|
11376
11393
|
return { payload: {}, dropped: !0 };
|
|
11377
11394
|
}
|
|
11378
|
-
function
|
|
11395
|
+
function It(p) {
|
|
11379
11396
|
const e = {};
|
|
11380
|
-
for (const [t, r] of
|
|
11381
|
-
|
|
11397
|
+
for (const [t, r] of p.entries())
|
|
11398
|
+
_t(e, t, r);
|
|
11382
11399
|
return e;
|
|
11383
11400
|
}
|
|
11384
|
-
function
|
|
11385
|
-
const r =
|
|
11386
|
-
r === void 0 ?
|
|
11401
|
+
function _t(p, e, t) {
|
|
11402
|
+
const r = p[e];
|
|
11403
|
+
r === void 0 ? p[e] = t : Array.isArray(r) ? r.push(t) : p[e] = [r, t];
|
|
11387
11404
|
}
|
|
11388
|
-
function we(
|
|
11389
|
-
if (
|
|
11405
|
+
function we(p, e) {
|
|
11406
|
+
if (D.isCompleteSetValue(e))
|
|
11390
11407
|
return e;
|
|
11391
11408
|
if (Array.isArray(e)) {
|
|
11392
|
-
const t = Array.isArray(
|
|
11409
|
+
const t = Array.isArray(p) ? p.slice() : [];
|
|
11393
11410
|
let r = !1;
|
|
11394
11411
|
return e.forEach((i, s) => {
|
|
11395
11412
|
i != null && (typeof i == "object" && !Array.isArray(i) && Object.keys(i).length === 0 || (t[s] = we(t[s], i), r = !0));
|
|
11396
|
-
}), r ? t :
|
|
11413
|
+
}), r ? t : p;
|
|
11397
11414
|
}
|
|
11398
11415
|
if (e !== null && typeof e == "object") {
|
|
11399
|
-
const t =
|
|
11416
|
+
const t = p !== null && typeof p == "object" && !Array.isArray(p) ? { ...p } : {};
|
|
11400
11417
|
for (const [r, i] of Object.entries(
|
|
11401
11418
|
e
|
|
11402
11419
|
))
|
|
@@ -11405,25 +11422,25 @@ function we(f, e) {
|
|
|
11405
11422
|
}
|
|
11406
11423
|
return e;
|
|
11407
11424
|
}
|
|
11408
|
-
function
|
|
11409
|
-
const e =
|
|
11425
|
+
function Cr(p) {
|
|
11426
|
+
const e = p?.body;
|
|
11410
11427
|
return e == null ? !1 : typeof e == "string" ? e !== "" : !0;
|
|
11411
11428
|
}
|
|
11412
|
-
function Fr(
|
|
11429
|
+
function Fr(p, e) {
|
|
11413
11430
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
11414
11431
|
if (c.runtime !== "demo" || je(r))
|
|
11415
11432
|
return {
|
|
11416
|
-
url:
|
|
11433
|
+
url: p,
|
|
11417
11434
|
options: t,
|
|
11418
11435
|
requestedMethod: r,
|
|
11419
11436
|
effectiveMethod: r,
|
|
11420
11437
|
normalized: !1
|
|
11421
11438
|
};
|
|
11422
|
-
const { payload: i, dropped: s } =
|
|
11439
|
+
const { payload: i, dropped: s } = Ir(
|
|
11423
11440
|
t.body
|
|
11424
11441
|
);
|
|
11425
|
-
let n =
|
|
11426
|
-
Object.keys(i).length > 0 && (n =
|
|
11442
|
+
let n = p;
|
|
11443
|
+
Object.keys(i).length > 0 && (n = Qt(n, i)), s && m.warn(
|
|
11427
11444
|
"Haori",
|
|
11428
11445
|
`The ${r} body cannot be converted into a query string and is dropped by the demo runtime normalization. Send the values with ${c.prefix}{event}-data / ${c.prefix}{event}-form, or use the embedded runtime.`
|
|
11429
11446
|
), delete t.body, t.method = "GET";
|
|
@@ -11439,8 +11456,8 @@ function Fr(f, e) {
|
|
|
11439
11456
|
queryString: new URL(n, window.location.href).search || void 0
|
|
11440
11457
|
};
|
|
11441
11458
|
}
|
|
11442
|
-
function
|
|
11443
|
-
return
|
|
11459
|
+
function Mr(p) {
|
|
11460
|
+
return p == null ? null : typeof p == "string" ? p : p instanceof URLSearchParams ? p.toString() : p instanceof FormData ? Array.from(p.entries()).map(([e, t]) => t instanceof File ? [
|
|
11444
11461
|
e,
|
|
11445
11462
|
{
|
|
11446
11463
|
type: "file",
|
|
@@ -11448,22 +11465,22 @@ function Cr(f) {
|
|
|
11448
11465
|
size: t.size,
|
|
11449
11466
|
mimeType: t.type
|
|
11450
11467
|
}
|
|
11451
|
-
] : [e, String(t)]) : String(
|
|
11468
|
+
] : [e, String(t)]) : String(p);
|
|
11452
11469
|
}
|
|
11453
|
-
function Ue(
|
|
11454
|
-
return
|
|
11470
|
+
function Ue(p) {
|
|
11471
|
+
return p instanceof Blob ? !0 : Array.isArray(p) ? p.some(Ue) : p !== null && typeof p == "object" ? Object.values(p).some(
|
|
11455
11472
|
Ue
|
|
11456
11473
|
) : !1;
|
|
11457
11474
|
}
|
|
11458
|
-
function
|
|
11459
|
-
return Object.values(
|
|
11475
|
+
function $r(p) {
|
|
11476
|
+
return Object.values(p).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
11460
11477
|
(t) => !(t instanceof Blob) && Ue(t)
|
|
11461
11478
|
) : Ue(e));
|
|
11462
11479
|
}
|
|
11463
|
-
function We(
|
|
11464
|
-
return st(
|
|
11480
|
+
function We(p) {
|
|
11481
|
+
return st(D.getValues(p));
|
|
11465
11482
|
}
|
|
11466
|
-
function st(
|
|
11483
|
+
function st(p) {
|
|
11467
11484
|
const e = (r) => {
|
|
11468
11485
|
if (r instanceof File)
|
|
11469
11486
|
return r.name;
|
|
@@ -11471,7 +11488,7 @@ function st(f) {
|
|
|
11471
11488
|
return "";
|
|
11472
11489
|
if (Array.isArray(r)) {
|
|
11473
11490
|
const i = r.map(e);
|
|
11474
|
-
return
|
|
11491
|
+
return D.carryCollectedRowIdentity(r, i), i;
|
|
11475
11492
|
}
|
|
11476
11493
|
if (r !== null && typeof r == "object") {
|
|
11477
11494
|
const i = {};
|
|
@@ -11479,28 +11496,28 @@ function st(f) {
|
|
|
11479
11496
|
r
|
|
11480
11497
|
))
|
|
11481
11498
|
i[s] = e(n);
|
|
11482
|
-
return
|
|
11499
|
+
return D.carryCollectedRowIdentity(r, i), i;
|
|
11483
11500
|
}
|
|
11484
11501
|
return r;
|
|
11485
11502
|
}, t = {};
|
|
11486
|
-
for (const [r, i] of Object.entries(
|
|
11503
|
+
for (const [r, i] of Object.entries(p))
|
|
11487
11504
|
t[r] = e(i);
|
|
11488
|
-
return
|
|
11505
|
+
return D.carryCollectedRowIdentity(p, t), t;
|
|
11489
11506
|
}
|
|
11490
|
-
function
|
|
11507
|
+
function Pr(p, e) {
|
|
11491
11508
|
const t = new Headers(
|
|
11492
11509
|
e.headers || void 0
|
|
11493
11510
|
), r = Array.from(t.entries()).sort(
|
|
11494
11511
|
([i], [s]) => i.localeCompare(s)
|
|
11495
11512
|
);
|
|
11496
11513
|
return JSON.stringify({
|
|
11497
|
-
url:
|
|
11514
|
+
url: p,
|
|
11498
11515
|
method: String(e.method || "GET").toUpperCase(),
|
|
11499
11516
|
headers: r,
|
|
11500
|
-
body:
|
|
11517
|
+
body: Mr(e.body || null)
|
|
11501
11518
|
});
|
|
11502
11519
|
}
|
|
11503
|
-
const
|
|
11520
|
+
const f = class f {
|
|
11504
11521
|
/**
|
|
11505
11522
|
* コンストラクタ。
|
|
11506
11523
|
*
|
|
@@ -11509,7 +11526,7 @@ const g = class g {
|
|
|
11509
11526
|
* @param domEvent 起点となった DOM イベント
|
|
11510
11527
|
*/
|
|
11511
11528
|
constructor(e, t = null, r = null) {
|
|
11512
|
-
this.reentrantBind = !1, this.suppressEmptyReplaceBind = !1, this.requestUserEditSequence = null, this.downloadReceivedBytes = 0, this.downloadTotalBytes = null, this.downloadFolder = null, this.twoWayCommitBind = !1, this.skipped = !1, this.operationSequence = r != null ? R.nextOperationSequence() : R.nextSequence(),
|
|
11529
|
+
this.reentrantBind = !1, this.suppressEmptyReplaceBind = !1, this.requestUserEditSequence = null, this.downloadReceivedBytes = 0, this.downloadTotalBytes = null, this.downloadFolder = null, this.twoWayCommitBind = !1, this.skipped = !1, this.operationSequence = r != null ? R.nextOperationSequence() : R.nextSequence(), f.isElementFragment(e) ? (this.options = f.buildOptions(e, t), this.eventType = t) : (this.options = e, this.eventType = null), this.domEvent = r;
|
|
11513
11530
|
}
|
|
11514
11531
|
/**
|
|
11515
11532
|
* クリックで起動した手続きの結果を控えます。
|
|
@@ -11519,7 +11536,7 @@ const g = class g {
|
|
|
11519
11536
|
* @returns 戻り値はありません。
|
|
11520
11537
|
*/
|
|
11521
11538
|
static recordClickOutcome(e, t) {
|
|
11522
|
-
|
|
11539
|
+
f.CLICK_OUTCOMES.set(e, t);
|
|
11523
11540
|
}
|
|
11524
11541
|
/**
|
|
11525
11542
|
* 直前のクリックで起動した手続きの結果を取り出します。
|
|
@@ -11531,8 +11548,8 @@ const g = class g {
|
|
|
11531
11548
|
* @returns 手続きの結果。起動していない場合は null
|
|
11532
11549
|
*/
|
|
11533
11550
|
static takeClickOutcome(e) {
|
|
11534
|
-
const t =
|
|
11535
|
-
return t ? (
|
|
11551
|
+
const t = f.CLICK_OUTCOMES.get(e);
|
|
11552
|
+
return t ? (f.CLICK_OUTCOMES.delete(e), t) : null;
|
|
11536
11553
|
}
|
|
11537
11554
|
/**
|
|
11538
11555
|
* イベント属性名を正しく生成します。
|
|
@@ -11556,11 +11573,11 @@ const g = class g {
|
|
|
11556
11573
|
* @returns 戻り値はありません。
|
|
11557
11574
|
*/
|
|
11558
11575
|
static warnAuthRedirectWithoutFetch(e, t) {
|
|
11559
|
-
if (!e.hasAttribute(
|
|
11576
|
+
if (!e.hasAttribute(f.attrName(t, "fetch")))
|
|
11560
11577
|
for (const r of ["unauthorized-redirect", "forbidden-redirect"]) {
|
|
11561
|
-
const i =
|
|
11578
|
+
const i = f.attrName(t, r);
|
|
11562
11579
|
if (e.hasAttribute(i)) {
|
|
11563
|
-
const s =
|
|
11580
|
+
const s = f.attrName(t, "fetch");
|
|
11564
11581
|
m.warn(
|
|
11565
11582
|
"Haori",
|
|
11566
11583
|
`${i} has no effect without ${s}.`,
|
|
@@ -11587,7 +11604,7 @@ const g = class g {
|
|
|
11587
11604
|
const i = z.read(e, t), s = [];
|
|
11588
11605
|
if (i)
|
|
11589
11606
|
(r === "click" || r === "error-click" ? z.queryAllInListOrder(i, t) : z.queryAll(i, t)).forEach((a) => {
|
|
11590
|
-
const o =
|
|
11607
|
+
const o = N.get(a);
|
|
11591
11608
|
o && s.push(o);
|
|
11592
11609
|
}), s.length === 0 && m.error("Haori", `Element not found: ${i} (${t})`);
|
|
11593
11610
|
else if (r === "error-click")
|
|
@@ -11597,7 +11614,7 @@ const g = class g {
|
|
|
11597
11614
|
);
|
|
11598
11615
|
else if (r === "open" || r === "close" || r === "error-close") {
|
|
11599
11616
|
const n = e.getTarget().closest("dialog");
|
|
11600
|
-
n ? s.push(
|
|
11617
|
+
n ? s.push(N.get(n)) : m.error("Haori", `Ancestor <dialog> not found (${t})`);
|
|
11601
11618
|
} else
|
|
11602
11619
|
s.push(e);
|
|
11603
11620
|
return s;
|
|
@@ -11616,8 +11633,8 @@ const g = class g {
|
|
|
11616
11633
|
* @returns 開始時のレベル。属性が無いか値が不正な場合は null(`info` で表示する)
|
|
11617
11634
|
*/
|
|
11618
11635
|
static readToastLevel(e, t, r, i) {
|
|
11619
|
-
return
|
|
11620
|
-
|
|
11636
|
+
return f.toToastLevel(
|
|
11637
|
+
f.readLateAttribute(e, t, r, i)
|
|
11621
11638
|
);
|
|
11622
11639
|
}
|
|
11623
11640
|
/**
|
|
@@ -11634,16 +11651,16 @@ const g = class g {
|
|
|
11634
11651
|
* @returns 戻り値はありません。
|
|
11635
11652
|
*/
|
|
11636
11653
|
static readNoMessageDeclarations(e, t, r) {
|
|
11637
|
-
const i =
|
|
11638
|
-
e.hasAttribute(i) && (t.errorStatuses =
|
|
11654
|
+
const i = f.attrName(r, "error-status");
|
|
11655
|
+
e.hasAttribute(i) && (t.errorStatuses = f.parseErrorStatuses(
|
|
11639
11656
|
e.getRawAttribute(i),
|
|
11640
11657
|
i
|
|
11641
11658
|
)), t.errorNoMessage = e.hasAttribute(
|
|
11642
|
-
|
|
11659
|
+
f.attrName(r, "error-no-message")
|
|
11643
11660
|
);
|
|
11644
|
-
const s =
|
|
11661
|
+
const s = f.attrName(r, "error-"), n = /* @__PURE__ */ new Map();
|
|
11645
11662
|
for (const a of e.getAttributeNames()) {
|
|
11646
|
-
const o = a.startsWith(s) ?
|
|
11663
|
+
const o = a.startsWith(s) ? xt.exec(a.slice(s.length)) : null;
|
|
11647
11664
|
o && o[2] === "no-message" && n.set(Number(o[1]), {
|
|
11648
11665
|
key: `error-${o[1]}`,
|
|
11649
11666
|
clickFragments: null,
|
|
@@ -11671,39 +11688,39 @@ const g = class g {
|
|
|
11671
11688
|
* @returns ステータスと組の対応(宣言が無い場合は空)
|
|
11672
11689
|
*/
|
|
11673
11690
|
static readErrorStatusActions(e, t, r) {
|
|
11674
|
-
const i =
|
|
11691
|
+
const i = f.attrName(r, "error-"), s = /* @__PURE__ */ new Set();
|
|
11675
11692
|
for (const a of e.getAttributeNames()) {
|
|
11676
11693
|
if (!a.startsWith(i))
|
|
11677
11694
|
continue;
|
|
11678
|
-
const o =
|
|
11695
|
+
const o = xt.exec(
|
|
11679
11696
|
a.slice(i.length)
|
|
11680
11697
|
);
|
|
11681
11698
|
o && s.add(o[1]);
|
|
11682
11699
|
}
|
|
11683
11700
|
const n = /* @__PURE__ */ new Map();
|
|
11684
11701
|
return s.forEach((a) => {
|
|
11685
|
-
const o = `error-${a}`, l = (u) =>
|
|
11702
|
+
const o = `error-${a}`, l = (u) => f.attrName(r, `${o}-${u}`);
|
|
11686
11703
|
n.set(Number(a), {
|
|
11687
11704
|
key: o,
|
|
11688
|
-
clickFragments: e.hasAttribute(l("click")) ?
|
|
11705
|
+
clickFragments: e.hasAttribute(l("click")) ? f.resolveSelectorTargets(
|
|
11689
11706
|
e,
|
|
11690
11707
|
l("click"),
|
|
11691
11708
|
"error-click"
|
|
11692
11709
|
) : null,
|
|
11693
11710
|
clickAwait: e.hasAttribute(l("click-await")),
|
|
11694
|
-
closeFragments: e.hasAttribute(l("close")) ?
|
|
11711
|
+
closeFragments: e.hasAttribute(l("close")) ? f.resolveSelectorTargets(
|
|
11695
11712
|
e,
|
|
11696
11713
|
l("close"),
|
|
11697
11714
|
"error-close"
|
|
11698
11715
|
) : null,
|
|
11699
11716
|
// `-toast` / `-toast-level` が無い場合は、どちらも null になる。
|
|
11700
|
-
toastMessage:
|
|
11717
|
+
toastMessage: f.readLateAttribute(
|
|
11701
11718
|
e,
|
|
11702
11719
|
t,
|
|
11703
11720
|
`${o}-toast`,
|
|
11704
11721
|
l("toast")
|
|
11705
11722
|
),
|
|
11706
|
-
toastLevel:
|
|
11723
|
+
toastLevel: f.readToastLevel(
|
|
11707
11724
|
e,
|
|
11708
11725
|
t,
|
|
11709
11726
|
`${o}-toast-level`,
|
|
@@ -11721,7 +11738,7 @@ const g = class g {
|
|
|
11721
11738
|
* @returns レベル。4 つの値のどれとも一致しない場合は null(`info` で表示する)
|
|
11722
11739
|
*/
|
|
11723
11740
|
static toToastLevel(e) {
|
|
11724
|
-
return
|
|
11741
|
+
return Nr.includes(e) ? e : null;
|
|
11725
11742
|
}
|
|
11726
11743
|
/**
|
|
11727
11744
|
* `data-{event}-error-status` の値を、ステータスの一覧へ変換します。
|
|
@@ -11899,7 +11916,7 @@ const g = class g {
|
|
|
11899
11916
|
static resolveDataParamStringDetailed(e, t) {
|
|
11900
11917
|
let r = !1;
|
|
11901
11918
|
return { value: e.replace(
|
|
11902
|
-
|
|
11919
|
+
f.DATA_PLACEHOLDER_REGEX,
|
|
11903
11920
|
(s, n, a) => {
|
|
11904
11921
|
const o = re.evaluateDetailed(
|
|
11905
11922
|
n ?? a ?? "",
|
|
@@ -11956,7 +11973,7 @@ const g = class g {
|
|
|
11956
11973
|
static stringifyJsonTemplateStringContent(e) {
|
|
11957
11974
|
if (e == null || Number.isNaN(e))
|
|
11958
11975
|
return "";
|
|
11959
|
-
const t = typeof e == "object" ?
|
|
11976
|
+
const t = typeof e == "object" ? f.stringifyJsonTemplateValue(e) : String(e);
|
|
11960
11977
|
return JSON.stringify(t).slice(1, -1);
|
|
11961
11978
|
}
|
|
11962
11979
|
/**
|
|
@@ -11969,13 +11986,13 @@ const g = class g {
|
|
|
11969
11986
|
static resolveDataJsonStringDetailed(e, t) {
|
|
11970
11987
|
let r = !1;
|
|
11971
11988
|
return { value: e.replace(
|
|
11972
|
-
|
|
11989
|
+
f.DATA_PLACEHOLDER_REGEX,
|
|
11973
11990
|
(s, n, a, o) => {
|
|
11974
11991
|
const l = re.evaluateDetailed(
|
|
11975
11992
|
n ?? a ?? "",
|
|
11976
11993
|
t
|
|
11977
11994
|
);
|
|
11978
|
-
return r = r || l.unresolvedReference,
|
|
11995
|
+
return r = r || l.unresolvedReference, f.isJsonStringContext(e, o) ? f.stringifyJsonTemplateStringContent(l.value) : f.stringifyJsonTemplateValue(l.value);
|
|
11979
11996
|
}
|
|
11980
11997
|
), hasUnresolvedReference: r };
|
|
11981
11998
|
}
|
|
@@ -11987,7 +12004,7 @@ const g = class g {
|
|
|
11987
12004
|
* @returns 送信データ
|
|
11988
12005
|
*/
|
|
11989
12006
|
static resolveDataAttribute(e, t) {
|
|
11990
|
-
return
|
|
12007
|
+
return f.resolveDataAttributeDetailed(e, t).value;
|
|
11991
12008
|
}
|
|
11992
12009
|
/**
|
|
11993
12010
|
* data 属性を評価済みの値として取得し、未解決参照の有無を返します。
|
|
@@ -12006,13 +12023,13 @@ const g = class g {
|
|
|
12006
12023
|
if (typeof s != "string" || r === null)
|
|
12007
12024
|
return { value: null, hasUnresolvedReference: n };
|
|
12008
12025
|
const a = r.trim();
|
|
12009
|
-
if (
|
|
12026
|
+
if (f.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
12010
12027
|
return {
|
|
12011
12028
|
value: $.parseDataBind(s),
|
|
12012
12029
|
hasUnresolvedReference: n
|
|
12013
12030
|
};
|
|
12014
12031
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
12015
|
-
const l =
|
|
12032
|
+
const l = f.resolveDataJsonStringDetailed(
|
|
12016
12033
|
r,
|
|
12017
12034
|
e.getBindingData()
|
|
12018
12035
|
);
|
|
@@ -12021,7 +12038,7 @@ const g = class g {
|
|
|
12021
12038
|
hasUnresolvedReference: n || l.hasUnresolvedReference
|
|
12022
12039
|
};
|
|
12023
12040
|
}
|
|
12024
|
-
const o =
|
|
12041
|
+
const o = f.resolveDataParamStringDetailed(
|
|
12025
12042
|
r,
|
|
12026
12043
|
e.getBindingData()
|
|
12027
12044
|
);
|
|
@@ -12040,43 +12057,43 @@ const g = class g {
|
|
|
12040
12057
|
static buildOptions(e, t) {
|
|
12041
12058
|
const r = {
|
|
12042
12059
|
targetFragment: e
|
|
12043
|
-
}, i = t ?
|
|
12060
|
+
}, i = t ? f.attrName(t, "if") : f.attrName(null, "if", !0);
|
|
12044
12061
|
if (e.hasAttribute(i)) {
|
|
12045
12062
|
const k = e.getRawAttribute(i);
|
|
12046
|
-
typeof k == "string" && k.trim() !== "" ? (r.conditionExpression =
|
|
12063
|
+
typeof k == "string" && k.trim() !== "" ? (r.conditionExpression = D.unwrapConditionExpression(k), r.conditionAttributeName = i) : m.warn(
|
|
12047
12064
|
"Haori",
|
|
12048
12065
|
`${i} に条件式が指定されていません。`
|
|
12049
12066
|
);
|
|
12050
12067
|
}
|
|
12051
12068
|
if (t) {
|
|
12052
|
-
if (e.hasAttribute(
|
|
12053
|
-
|
|
12054
|
-
e.getAttribute(
|
|
12069
|
+
if (e.hasAttribute(f.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(f.attrName(t, "confirm")) && (r.confirmMessage = f.unescapeNewlines(
|
|
12070
|
+
f.normalizeAttributeText(
|
|
12071
|
+
e.getAttribute(f.attrName(t, "confirm"))
|
|
12055
12072
|
)
|
|
12056
|
-
)), e.hasAttribute(
|
|
12073
|
+
)), e.hasAttribute(f.attrName(t, "data")) && (r.dataAttrName = f.attrName(t, "data")), e.hasAttribute(f.attrName(t, "form"))) {
|
|
12057
12074
|
const U = z.read(
|
|
12058
12075
|
e,
|
|
12059
|
-
|
|
12076
|
+
f.attrName(t, "form")
|
|
12060
12077
|
);
|
|
12061
12078
|
if (U) {
|
|
12062
12079
|
const Q = z.query(
|
|
12063
12080
|
U,
|
|
12064
|
-
|
|
12081
|
+
f.attrName(t, "form")
|
|
12065
12082
|
);
|
|
12066
|
-
Q !== null ? r.formFragment =
|
|
12067
|
-
|
|
12083
|
+
Q !== null ? r.formFragment = D.getFormFragment(
|
|
12084
|
+
N.get(Q)
|
|
12068
12085
|
) : m.error(
|
|
12069
12086
|
"Haori",
|
|
12070
|
-
`Form element not found: ${U} (${
|
|
12087
|
+
`Form element not found: ${U} (${f.attrName(t, "form")})`
|
|
12071
12088
|
);
|
|
12072
12089
|
} else
|
|
12073
|
-
r.formFragment =
|
|
12090
|
+
r.formFragment = D.getFormFragment(e);
|
|
12074
12091
|
} else if (t === "change" || t === "input") {
|
|
12075
|
-
r.formFragment =
|
|
12092
|
+
r.formFragment = D.getFormFragment(e);
|
|
12076
12093
|
const U = `${c.prefix}${t}-`;
|
|
12077
|
-
r.implicitFormFragment = !e.getAttributeNames().some((Q) => Q.startsWith(U)), r.formFragment === null &&
|
|
12094
|
+
r.implicitFormFragment = !e.getAttributeNames().some((Q) => Q.startsWith(U)), r.formFragment === null && f.isNamedInputFragment(e) && (r.selfValueFragment = e);
|
|
12078
12095
|
}
|
|
12079
|
-
V.isEnabled() &&
|
|
12096
|
+
V.isEnabled() && f.warnAuthRedirectWithoutFetch(e, t);
|
|
12080
12097
|
const k = `${c.prefix}${t}-before-run`;
|
|
12081
12098
|
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12082
12099
|
const U = oe.compile(e, k, [
|
|
@@ -12099,7 +12116,7 @@ ${U}
|
|
|
12099
12116
|
m.error("Haori", `Invalid before script: ${Q}`);
|
|
12100
12117
|
}
|
|
12101
12118
|
}
|
|
12102
|
-
const B =
|
|
12119
|
+
const B = f.attrName(t, "run");
|
|
12103
12120
|
if (oe.declared(e, B) && oe.applies(e, B)) {
|
|
12104
12121
|
const U = oe.compile(e, B, ["event"]);
|
|
12105
12122
|
U && (r.runScript = (Q) => U([Q]));
|
|
@@ -12124,56 +12141,56 @@ ${U}
|
|
|
12124
12141
|
}
|
|
12125
12142
|
Q && (r.runScript = Q);
|
|
12126
12143
|
}
|
|
12127
|
-
const ue =
|
|
12128
|
-
e.hasAttribute(ue) && (r.clipboardAttrName = ue, r.clipboardErrorToastMessage =
|
|
12144
|
+
const ue = f.attrName(t, "clipboard");
|
|
12145
|
+
e.hasAttribute(ue) && (r.clipboardAttrName = ue, r.clipboardErrorToastMessage = f.readLateAttribute(
|
|
12129
12146
|
e,
|
|
12130
12147
|
r,
|
|
12131
12148
|
"clipboard-error-toast",
|
|
12132
|
-
|
|
12133
|
-
), r.clipboardErrorToastLevel =
|
|
12149
|
+
f.attrName(t, "clipboard-error-toast")
|
|
12150
|
+
), r.clipboardErrorToastLevel = f.readToastLevel(
|
|
12134
12151
|
e,
|
|
12135
12152
|
r,
|
|
12136
12153
|
"clipboard-error-toast-level",
|
|
12137
|
-
|
|
12154
|
+
f.attrName(t, "clipboard-error-toast-level")
|
|
12138
12155
|
));
|
|
12139
12156
|
}
|
|
12140
|
-
const s =
|
|
12157
|
+
const s = f.attrName(t, "fetch"), n = e.hasAttribute(s);
|
|
12141
12158
|
if (n) {
|
|
12142
12159
|
const k = e.getAttributeEvaluation(s);
|
|
12143
12160
|
k && (r.fetchHasUnresolvedReference = k.hasUnresolvedReference, r.fetchUrl = k.hasUnresolvedReference ? null : k.value);
|
|
12144
12161
|
}
|
|
12145
|
-
const a = {}, o = t ?
|
|
12162
|
+
const a = {}, o = t ? f.attrName(t, "fetch-method") : f.attrName(null, "method", !0);
|
|
12146
12163
|
if (e.hasAttribute(o)) {
|
|
12147
12164
|
const k = e.getAttributeEvaluation(o);
|
|
12148
|
-
k?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method =
|
|
12165
|
+
k?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method = f.normalizeAttributeText(k?.value) ?? void 0;
|
|
12149
12166
|
}
|
|
12150
|
-
const l = t ?
|
|
12167
|
+
const l = t ? f.attrName(t, "fetch-headers") : f.attrName(null, "headers", !0), u = f.readFetchHeaders(
|
|
12151
12168
|
e,
|
|
12152
12169
|
l
|
|
12153
12170
|
);
|
|
12154
12171
|
u !== null && (a.headers = u);
|
|
12155
|
-
const d = t ?
|
|
12172
|
+
const d = t ? f.attrName(t, "fetch-content-type") : f.attrName(null, "content-type", !0);
|
|
12156
12173
|
let y = null;
|
|
12157
12174
|
if (e.hasAttribute(d)) {
|
|
12158
12175
|
const k = e.getAttributeEvaluation(d);
|
|
12159
|
-
k?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), y =
|
|
12176
|
+
k?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), y = f.normalizeAttributeText(
|
|
12160
12177
|
k?.value
|
|
12161
12178
|
);
|
|
12162
12179
|
}
|
|
12163
12180
|
if (y !== null)
|
|
12164
|
-
a.headers =
|
|
12181
|
+
a.headers = f.withContentType(
|
|
12165
12182
|
a.headers,
|
|
12166
12183
|
y
|
|
12167
12184
|
);
|
|
12168
|
-
else if (a.method && !
|
|
12185
|
+
else if (a.method && !f.hasDeclaredContentType(a.headers)) {
|
|
12169
12186
|
const k = a.method.toUpperCase();
|
|
12170
|
-
a.headers =
|
|
12187
|
+
a.headers = f.withContentType(
|
|
12171
12188
|
a.headers,
|
|
12172
12189
|
k === "GET" || k === "HEAD" || k === "OPTIONS" ? "application/x-www-form-urlencoded" : "application/json"
|
|
12173
12190
|
);
|
|
12174
12191
|
}
|
|
12175
12192
|
Object.keys(a).length > 0 && (r.fetchOptions = a);
|
|
12176
|
-
const b = t ?
|
|
12193
|
+
const b = t ? f.attrName(t, "fetch-download") : f.attrName(null, "download", !0);
|
|
12177
12194
|
if (e.hasAttribute(b) && !n)
|
|
12178
12195
|
m.warn(
|
|
12179
12196
|
"Haori",
|
|
@@ -12182,20 +12199,20 @@ ${U}
|
|
|
12182
12199
|
else if (e.hasAttribute(b)) {
|
|
12183
12200
|
r.download = !0;
|
|
12184
12201
|
const k = e.getAttributeEvaluation(b);
|
|
12185
|
-
r.downloadFileName = k?.hasUnresolvedReference ? null :
|
|
12202
|
+
r.downloadFileName = k?.hasUnresolvedReference ? null : f.normalizeAttributeText(k?.value);
|
|
12186
12203
|
}
|
|
12187
|
-
const E = t ?
|
|
12204
|
+
const E = t ? f.attrName(t, "fetch-download-folder") : f.attrName(null, "download-folder", !0);
|
|
12188
12205
|
e.hasAttribute(E) && (r.download ? r.downloadFolder = !0 : m.warn(
|
|
12189
12206
|
"Haori",
|
|
12190
12207
|
`${E} は ${b} と併せて指定してください(書き出す応答が無いため、この宣言は無視します)。`
|
|
12191
12208
|
));
|
|
12192
|
-
const A = t ?
|
|
12209
|
+
const A = t ? f.attrName(t, "bind") : f.attrName(null, "bind", !0);
|
|
12193
12210
|
if (e.hasAttribute(A)) {
|
|
12194
12211
|
const k = z.read(e, A);
|
|
12195
12212
|
if (k) {
|
|
12196
12213
|
const B = z.queryAll(k, A);
|
|
12197
12214
|
B.length > 0 ? (r.bindFragments = [], B.forEach((ue) => {
|
|
12198
|
-
const U =
|
|
12215
|
+
const U = N.get(ue);
|
|
12199
12216
|
U && r.bindFragments.push(U);
|
|
12200
12217
|
})) : m.error(
|
|
12201
12218
|
"Haori",
|
|
@@ -12203,58 +12220,58 @@ ${U}
|
|
|
12203
12220
|
);
|
|
12204
12221
|
}
|
|
12205
12222
|
}
|
|
12206
|
-
const w =
|
|
12223
|
+
const w = f.attrName(t, "bind-arg"), M = f.attrName(null, "arg", !0), F = f.attrName(null, "bind-arg", !0);
|
|
12207
12224
|
t ? e.hasAttribute(w) && (r.bindArg = e.getRawAttribute(w)) : e.hasAttribute(M) ? r.bindArg = e.getRawAttribute(
|
|
12208
12225
|
M
|
|
12209
|
-
) : e.hasAttribute(
|
|
12210
|
-
const se = t ?
|
|
12226
|
+
) : e.hasAttribute(F) && (r.bindArg = e.getRawAttribute(F));
|
|
12227
|
+
const se = t ? f.attrName(t, "bind-params") : f.attrName(null, "bind-params", !0);
|
|
12211
12228
|
if (e.hasAttribute(se)) {
|
|
12212
12229
|
const k = e.getRawAttribute(se);
|
|
12213
12230
|
r.bindParams = k.split("&").map((B) => B.trim());
|
|
12214
12231
|
}
|
|
12215
|
-
const
|
|
12216
|
-
if (e.hasAttribute(
|
|
12217
|
-
const k = e.getRawAttribute(
|
|
12232
|
+
const C = t ? f.attrName(t, "bind-append") : f.attrName(null, "bind-append", !0);
|
|
12233
|
+
if (e.hasAttribute(C)) {
|
|
12234
|
+
const k = e.getRawAttribute(C);
|
|
12218
12235
|
r.bindAppendParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12219
12236
|
}
|
|
12220
|
-
const Z = t ?
|
|
12237
|
+
const Z = t ? f.attrName(t, "bind-merge") : f.attrName(null, "bind-merge", !0);
|
|
12221
12238
|
e.hasAttribute(Z) && (r.bindMerge = !0);
|
|
12222
|
-
const ee = t ?
|
|
12239
|
+
const ee = t ? f.attrName(t, "bind-transform") : f.attrName(null, "bind-transform", !0);
|
|
12223
12240
|
e.hasAttribute(ee) && (r.bindTransform = e.getRawAttribute(ee));
|
|
12224
|
-
const ne = t ?
|
|
12241
|
+
const ne = t ? f.attrName(t, "payload-transform") : f.attrName(null, "payload-transform", !0);
|
|
12225
12242
|
e.hasAttribute(ne) && (r.payloadTransform = e.getRawAttribute(ne));
|
|
12226
|
-
const K = t ?
|
|
12243
|
+
const K = t ? f.attrName(t, "copy-params") : null;
|
|
12227
12244
|
if (K && e.hasAttribute(K)) {
|
|
12228
12245
|
const k = e.getRawAttribute(K);
|
|
12229
12246
|
r.copyParams = k.split("&").map((B) => B.trim()).filter(Boolean);
|
|
12230
12247
|
}
|
|
12231
12248
|
if (t) {
|
|
12232
|
-
if (e.hasAttribute(
|
|
12249
|
+
if (e.hasAttribute(f.attrName(t, "adjust"))) {
|
|
12233
12250
|
const W = z.read(
|
|
12234
12251
|
e,
|
|
12235
|
-
|
|
12252
|
+
f.attrName(t, "adjust")
|
|
12236
12253
|
);
|
|
12237
12254
|
if (W) {
|
|
12238
12255
|
const G = z.queryAll(
|
|
12239
12256
|
W,
|
|
12240
|
-
|
|
12257
|
+
f.attrName(t, "adjust")
|
|
12241
12258
|
);
|
|
12242
12259
|
G.length > 0 ? (r.adjustFragments = [], G.forEach((ie) => {
|
|
12243
|
-
const Ae =
|
|
12260
|
+
const Ae = N.get(ie);
|
|
12244
12261
|
Ae && r.adjustFragments.push(Ae);
|
|
12245
12262
|
})) : m.error(
|
|
12246
12263
|
"Haori",
|
|
12247
|
-
`Adjust element not found: ${W} (${
|
|
12264
|
+
`Adjust element not found: ${W} (${f.attrName(t, "adjust")})`
|
|
12248
12265
|
);
|
|
12249
12266
|
}
|
|
12250
|
-
if (e.hasAttribute(
|
|
12267
|
+
if (e.hasAttribute(f.attrName(t, "adjust-value"))) {
|
|
12251
12268
|
const G = e.getRawAttribute(
|
|
12252
|
-
|
|
12269
|
+
f.attrName(t, "adjust-value")
|
|
12253
12270
|
), ie = Number(G);
|
|
12254
12271
|
isNaN(ie) || (r.adjustValue = ie);
|
|
12255
12272
|
}
|
|
12256
12273
|
}
|
|
12257
|
-
e.hasAttribute(
|
|
12274
|
+
e.hasAttribute(f.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(f.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(f.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(f.attrName(t, "row-next")) && (r.rowMoveNext = !0);
|
|
12258
12275
|
const k = `${c.prefix}${t}-after-run`;
|
|
12259
12276
|
if (oe.declared(e, k) && oe.applies(e, k)) {
|
|
12260
12277
|
const W = oe.compile(e, k, [
|
|
@@ -12275,97 +12292,97 @@ ${W}
|
|
|
12275
12292
|
m.error("Haori", `Invalid after script: ${G}`);
|
|
12276
12293
|
}
|
|
12277
12294
|
}
|
|
12278
|
-
if (e.hasAttribute(
|
|
12279
|
-
|
|
12295
|
+
if (e.hasAttribute(f.attrName(t, "dialog")) && (r.dialogMessage = f.unescapeNewlines(
|
|
12296
|
+
f.readLateAttribute(
|
|
12280
12297
|
e,
|
|
12281
12298
|
r,
|
|
12282
12299
|
"dialog",
|
|
12283
|
-
|
|
12300
|
+
f.attrName(t, "dialog")
|
|
12284
12301
|
)
|
|
12285
|
-
)), e.hasAttribute(
|
|
12302
|
+
)), e.hasAttribute(f.attrName(t, "toast")) && (r.toastMessage = f.readLateAttribute(
|
|
12286
12303
|
e,
|
|
12287
12304
|
r,
|
|
12288
12305
|
"toast",
|
|
12289
|
-
|
|
12290
|
-
), r.toastLevel =
|
|
12306
|
+
f.attrName(t, "toast")
|
|
12307
|
+
), r.toastLevel = f.readToastLevel(
|
|
12291
12308
|
e,
|
|
12292
12309
|
r,
|
|
12293
12310
|
"toast-level",
|
|
12294
|
-
|
|
12311
|
+
f.attrName(t, "toast-level")
|
|
12295
12312
|
)), t !== "poll") {
|
|
12296
|
-
const W =
|
|
12297
|
-
e.hasAttribute(W) && (r.errorToastMessage =
|
|
12313
|
+
const W = f.attrName(t, "error-toast");
|
|
12314
|
+
e.hasAttribute(W) && (r.errorToastMessage = f.readLateAttribute(
|
|
12298
12315
|
e,
|
|
12299
12316
|
r,
|
|
12300
12317
|
"error-toast",
|
|
12301
12318
|
W
|
|
12302
|
-
), r.errorToastLevel =
|
|
12319
|
+
), r.errorToastLevel = f.readToastLevel(
|
|
12303
12320
|
e,
|
|
12304
12321
|
r,
|
|
12305
12322
|
"error-toast-level",
|
|
12306
|
-
|
|
12323
|
+
f.attrName(t, "error-toast-level")
|
|
12307
12324
|
));
|
|
12308
|
-
const G =
|
|
12309
|
-
e.hasAttribute(G) && (r.errorStatuses =
|
|
12325
|
+
const G = f.attrName(t, "error-status");
|
|
12326
|
+
e.hasAttribute(G) && (r.errorStatuses = f.parseErrorStatuses(
|
|
12310
12327
|
e.getRawAttribute(G),
|
|
12311
12328
|
G
|
|
12312
12329
|
)), r.errorNoMessage = e.hasAttribute(
|
|
12313
|
-
|
|
12330
|
+
f.attrName(t, "error-no-message")
|
|
12314
12331
|
), r.errorBind = e.hasAttribute(
|
|
12315
|
-
|
|
12332
|
+
f.attrName(t, "error-bind")
|
|
12316
12333
|
);
|
|
12317
12334
|
}
|
|
12318
|
-
const B =
|
|
12319
|
-
if (U && (r.redirectUrl =
|
|
12335
|
+
const B = f.attrName(t, "redirect"), ue = f.attrName(t, "redirect-replace"), U = e.hasAttribute(B), Q = e.hasAttribute(ue);
|
|
12336
|
+
if (U && (r.redirectUrl = f.readLateAttribute(
|
|
12320
12337
|
e,
|
|
12321
12338
|
r,
|
|
12322
12339
|
"redirect",
|
|
12323
12340
|
B
|
|
12324
|
-
)), Q && (r.redirectReplaceUrl =
|
|
12341
|
+
)), Q && (r.redirectReplaceUrl = f.readLateAttribute(
|
|
12325
12342
|
e,
|
|
12326
12343
|
r,
|
|
12327
12344
|
"redirect-replace",
|
|
12328
12345
|
ue
|
|
12329
12346
|
)), U || Q) {
|
|
12330
|
-
const W =
|
|
12347
|
+
const W = f.attrName(
|
|
12331
12348
|
t,
|
|
12332
12349
|
"redirect-return-param"
|
|
12333
12350
|
);
|
|
12334
|
-
e.hasAttribute(W) && (r.redirectReturnParam =
|
|
12351
|
+
e.hasAttribute(W) && (r.redirectReturnParam = f.readLateAttribute(
|
|
12335
12352
|
e,
|
|
12336
12353
|
r,
|
|
12337
12354
|
"redirect-return-param",
|
|
12338
12355
|
W
|
|
12339
12356
|
));
|
|
12340
12357
|
}
|
|
12341
|
-
if (e.hasAttribute(
|
|
12358
|
+
if (e.hasAttribute(f.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(f.attrName(t, "clear-messages")) && (r.clearMessagesOnSuccess = !0), e.hasAttribute(f.attrName(t, "scroll")) && (r.scrollTarget = f.readLateAttribute(
|
|
12342
12359
|
e,
|
|
12343
12360
|
r,
|
|
12344
12361
|
"scroll",
|
|
12345
|
-
|
|
12346
|
-
)), e.hasAttribute(
|
|
12362
|
+
f.attrName(t, "scroll")
|
|
12363
|
+
)), e.hasAttribute(f.attrName(t, "history")) && (r.historyUrl = f.readLateAttribute(
|
|
12347
12364
|
e,
|
|
12348
12365
|
r,
|
|
12349
12366
|
"history",
|
|
12350
|
-
|
|
12351
|
-
)), e.hasAttribute(
|
|
12367
|
+
f.attrName(t, "history")
|
|
12368
|
+
)), e.hasAttribute(f.attrName(t, "history-data")) && (r.historyDataAttrName = f.attrName(t, "history-data")), e.hasAttribute(f.attrName(t, "history-form"))) {
|
|
12352
12369
|
const W = z.read(
|
|
12353
12370
|
e,
|
|
12354
|
-
|
|
12371
|
+
f.attrName(t, "history-form")
|
|
12355
12372
|
);
|
|
12356
12373
|
if (W) {
|
|
12357
12374
|
const G = z.query(
|
|
12358
12375
|
W,
|
|
12359
|
-
|
|
12376
|
+
f.attrName(t, "history-form")
|
|
12360
12377
|
);
|
|
12361
|
-
G !== null ? r.historyFormFragment =
|
|
12362
|
-
|
|
12378
|
+
G !== null ? r.historyFormFragment = D.getFormFragment(
|
|
12379
|
+
N.get(G)
|
|
12363
12380
|
) : m.error(
|
|
12364
12381
|
"Haori",
|
|
12365
|
-
`Form element not found: ${W} (${
|
|
12382
|
+
`Form element not found: ${W} (${f.attrName(t, "history-form")})`
|
|
12366
12383
|
);
|
|
12367
12384
|
} else
|
|
12368
|
-
r.historyFormFragment =
|
|
12385
|
+
r.historyFormFragment = D.getFormFragment(e);
|
|
12369
12386
|
}
|
|
12370
12387
|
[
|
|
12371
12388
|
"reset-before",
|
|
@@ -12380,10 +12397,10 @@ ${W}
|
|
|
12380
12397
|
].forEach((W) => {
|
|
12381
12398
|
if (W.startsWith("error-") && t === "poll")
|
|
12382
12399
|
return;
|
|
12383
|
-
const G =
|
|
12400
|
+
const G = f.attrName(t, W);
|
|
12384
12401
|
if (!e.hasAttribute(G))
|
|
12385
12402
|
return;
|
|
12386
|
-
const ie =
|
|
12403
|
+
const ie = f.resolveSelectorTargets(
|
|
12387
12404
|
e,
|
|
12388
12405
|
G,
|
|
12389
12406
|
W
|
|
@@ -12420,18 +12437,18 @@ ${W}
|
|
|
12420
12437
|
r.errorCloseFragments = ie;
|
|
12421
12438
|
break;
|
|
12422
12439
|
}
|
|
12423
|
-
}), t !== "poll" && (r.errorStatusActions =
|
|
12440
|
+
}), t !== "poll" && (r.errorStatusActions = f.readErrorStatusActions(
|
|
12424
12441
|
e,
|
|
12425
12442
|
r,
|
|
12426
12443
|
t
|
|
12427
12444
|
));
|
|
12428
|
-
const ce =
|
|
12445
|
+
const ce = f.attrName(t, "copy-source");
|
|
12429
12446
|
if (e.hasAttribute(ce)) {
|
|
12430
12447
|
const W = z.read(e, ce);
|
|
12431
12448
|
if (W) {
|
|
12432
12449
|
const G = z.query(W, ce);
|
|
12433
12450
|
if (G !== null) {
|
|
12434
|
-
const ie =
|
|
12451
|
+
const ie = N.get(G);
|
|
12435
12452
|
ie ? r.copySourceFragment = ie : m.error(
|
|
12436
12453
|
"Haori",
|
|
12437
12454
|
`Element is not managed by Haori: ${W} (${ce})`
|
|
@@ -12445,38 +12462,38 @@ ${W}
|
|
|
12445
12462
|
r.copySourceFragment = e;
|
|
12446
12463
|
}
|
|
12447
12464
|
}
|
|
12448
|
-
if (!t && (e.hasAttribute(
|
|
12465
|
+
if (!t && (e.hasAttribute(f.attrName(null, "data", !0)) && (r.dataAttrName = f.attrName(null, "data", !0)), e.hasAttribute(f.attrName(null, "form", !0)))) {
|
|
12449
12466
|
const k = z.read(
|
|
12450
12467
|
e,
|
|
12451
|
-
|
|
12468
|
+
f.attrName(null, "form", !0)
|
|
12452
12469
|
);
|
|
12453
12470
|
if (k) {
|
|
12454
12471
|
const B = z.query(
|
|
12455
12472
|
k,
|
|
12456
|
-
|
|
12473
|
+
f.attrName(null, "form", !0)
|
|
12457
12474
|
);
|
|
12458
|
-
B !== null ? r.formFragment =
|
|
12459
|
-
|
|
12475
|
+
B !== null ? r.formFragment = D.getFormFragment(
|
|
12476
|
+
N.get(B)
|
|
12460
12477
|
) : m.error(
|
|
12461
12478
|
"Haori",
|
|
12462
|
-
`Form element not found: ${k} (${
|
|
12479
|
+
`Form element not found: ${k} (${f.attrName(null, "fetch-form", !0)})`
|
|
12463
12480
|
);
|
|
12464
12481
|
} else
|
|
12465
|
-
r.formFragment =
|
|
12482
|
+
r.formFragment = D.getFormFragment(e);
|
|
12466
12483
|
}
|
|
12467
|
-
(!t || t === "poll") &&
|
|
12468
|
-
const ae = t ?
|
|
12484
|
+
(!t || t === "poll") && f.readNoMessageDeclarations(e, r, t ?? "fetch");
|
|
12485
|
+
const ae = t ? f.attrName(t, "fetch-state") : f.attrName(null, "state", !0);
|
|
12469
12486
|
if (e.hasAttribute(ae)) {
|
|
12470
12487
|
const k = z.read(e, ae), B = [];
|
|
12471
12488
|
k ? (z.queryAll(k, ae).forEach((U) => {
|
|
12472
|
-
const Q =
|
|
12489
|
+
const Q = N.get(U);
|
|
12473
12490
|
Q && B.push(Q);
|
|
12474
12491
|
}), B.length === 0 && m.error(
|
|
12475
12492
|
"Haori",
|
|
12476
12493
|
`Element not found: ${k} (${ae})`
|
|
12477
12494
|
)) : B.push(e), B.length > 0 && (r.fetchStateFragments = B);
|
|
12478
12495
|
}
|
|
12479
|
-
const j = t ?
|
|
12496
|
+
const j = t ? f.attrName(t, "store-clear") : f.attrName(null, "store-clear", !0);
|
|
12480
12497
|
if (e.hasAttribute(j)) {
|
|
12481
12498
|
const k = e.getRawAttribute(j), B = k === null ? "" : k.trim();
|
|
12482
12499
|
if (B === "")
|
|
@@ -12498,7 +12515,7 @@ ${W}
|
|
|
12498
12515
|
return n && !r.download && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [e], r.defaultSelfBind = !0), r.download && r.bindFragments && r.bindFragments.length > 0 && (m.warn(
|
|
12499
12516
|
"Haori",
|
|
12500
12517
|
`${b} と同時にバインド先が指定されています(応答はファイルとして保存し、バインドは行いません)。`
|
|
12501
|
-
), r.bindFragments = null),
|
|
12518
|
+
), r.bindFragments = null), f.recordRowWriteTargets(r), r;
|
|
12502
12519
|
}
|
|
12503
12520
|
/**
|
|
12504
12521
|
* バインド先・コピー先のうち、編集可能な行にあたるものを記録します。
|
|
@@ -12522,7 +12539,7 @@ ${W}
|
|
|
12522
12539
|
const s = i.getParent();
|
|
12523
12540
|
!s || !s.hasAttribute(`${c.prefix}each`) || !s.hasAttribute(`${c.prefix}form-list`) || t.set(
|
|
12524
12541
|
i,
|
|
12525
|
-
|
|
12542
|
+
f.getRowFragments(s).includes(i) ? s : null
|
|
12526
12543
|
);
|
|
12527
12544
|
}
|
|
12528
12545
|
t.size > 0 && (e.rowWriteTargets = t);
|
|
@@ -12558,7 +12575,7 @@ ${W}
|
|
|
12558
12575
|
* @returns フェッチシグネチャと未解決参照の有無
|
|
12559
12576
|
*/
|
|
12560
12577
|
static resolveAutoFetchSignature(e) {
|
|
12561
|
-
return new
|
|
12578
|
+
return new f(e, null).resolveFetchSignature();
|
|
12562
12579
|
}
|
|
12563
12580
|
/**
|
|
12564
12581
|
* 一連の処理を実行します。オプションが空の場合は即座にresolveされます。
|
|
@@ -12633,7 +12650,7 @@ ${W}
|
|
|
12633
12650
|
* @returns 表示を終えたら解決する Promise
|
|
12634
12651
|
*/
|
|
12635
12652
|
async showClipboardErrorToast() {
|
|
12636
|
-
const e =
|
|
12653
|
+
const e = f.normalizeAttributeText(
|
|
12637
12654
|
this.resolveLateAttribute(
|
|
12638
12655
|
"clipboard-error-toast",
|
|
12639
12656
|
this.options.clipboardErrorToastMessage
|
|
@@ -12641,7 +12658,7 @@ ${W}
|
|
|
12641
12658
|
);
|
|
12642
12659
|
if (!e)
|
|
12643
12660
|
return;
|
|
12644
|
-
const t =
|
|
12661
|
+
const t = f.toToastLevel(
|
|
12645
12662
|
this.resolveLateAttribute(
|
|
12646
12663
|
"clipboard-error-toast-level",
|
|
12647
12664
|
this.options.clipboardErrorToastLevel
|
|
@@ -12663,8 +12680,8 @@ ${W}
|
|
|
12663
12680
|
return this.skipped = !0, !1;
|
|
12664
12681
|
if (this.options.formFragment && this.validate(this.options.formFragment) === !1)
|
|
12665
12682
|
return await this.commitEditOnStop(), !1;
|
|
12666
|
-
if (!this.options.formFragment && this.options.targetFragment &&
|
|
12667
|
-
|
|
12683
|
+
if (!this.options.formFragment && this.options.targetFragment && D.warnUnvalidatedCustomValidity(
|
|
12684
|
+
D.getFormFragment(this.options.targetFragment),
|
|
12668
12685
|
`${c.prefix}${this.eventType ?? "fetch"}-form が解決できません`
|
|
12669
12686
|
), !this.evaluateExecutionCondition())
|
|
12670
12687
|
return this.skipped = !0, await this.commitEditOnStop(), !1;
|
|
@@ -12692,7 +12709,7 @@ ${W}
|
|
|
12692
12709
|
return !1;
|
|
12693
12710
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
12694
12711
|
this.options.resetBeforeFragments.map(
|
|
12695
|
-
(A) =>
|
|
12712
|
+
(A) => D.reset(A, this.operationSequence)
|
|
12696
12713
|
)
|
|
12697
12714
|
), this.captureHistorySnapshots());
|
|
12698
12715
|
const s = this.prepareFetchRequest();
|
|
@@ -12719,15 +12736,15 @@ ${W}
|
|
|
12719
12736
|
n,
|
|
12720
12737
|
e
|
|
12721
12738
|
);
|
|
12722
|
-
const A = (l?.method || "GET").toUpperCase(), M = !u && d && s.transportMode === "query-get" &&
|
|
12739
|
+
const A = (l?.method || "GET").toUpperCase(), M = !u && d && s.transportMode === "query-get" && Cr(l) && !je(A) ? s.baseUrl ?? o : o, F = Fr(
|
|
12723
12740
|
M,
|
|
12724
12741
|
l
|
|
12725
12742
|
);
|
|
12726
|
-
o =
|
|
12727
|
-
const se = { ...
|
|
12743
|
+
o = F.url;
|
|
12744
|
+
const se = { ...F.options }, C = F.normalized ? F.requestedMethod : s.requestedMethod, Z = F.effectiveMethod, ee = s.transportMode === "query-get" || F.normalized, ne = F.queryString ?? s.queryString;
|
|
12728
12745
|
if (ee && m.info("Haori demo fetch normalization", {
|
|
12729
12746
|
runtime: c.runtime,
|
|
12730
|
-
requestedMethod:
|
|
12747
|
+
requestedMethod: C,
|
|
12731
12748
|
effectiveMethod: Z,
|
|
12732
12749
|
transportMode: "query-get",
|
|
12733
12750
|
url: o,
|
|
@@ -12736,7 +12753,7 @@ ${W}
|
|
|
12736
12753
|
}), this.options.targetFragment && o) {
|
|
12737
12754
|
const K = performance.now(), ae = {
|
|
12738
12755
|
runtime: c.runtime,
|
|
12739
|
-
requestedMethod:
|
|
12756
|
+
requestedMethod: C,
|
|
12740
12757
|
effectiveMethod: Z,
|
|
12741
12758
|
transportMode: ee ? "query-get" : "http",
|
|
12742
12759
|
...ee ? { queryString: ne } : {}
|
|
@@ -12747,7 +12764,7 @@ ${W}
|
|
|
12747
12764
|
se,
|
|
12748
12765
|
a,
|
|
12749
12766
|
ae
|
|
12750
|
-
), await this.injectFetchState("loading"), await
|
|
12767
|
+
), await this.injectFetchState("loading"), await f.invokeFetch(o, se).then((j) => this.handleFetchResult(
|
|
12751
12768
|
j,
|
|
12752
12769
|
o || void 0,
|
|
12753
12770
|
K
|
|
@@ -12827,22 +12844,22 @@ ${W}
|
|
|
12827
12844
|
let l;
|
|
12828
12845
|
if (o) {
|
|
12829
12846
|
l = { ...n ?? {} };
|
|
12830
|
-
const u = String(o), d =
|
|
12831
|
-
l[u] =
|
|
12847
|
+
const u = String(o), d = D.resolveAncestorArgOwner(e, u);
|
|
12848
|
+
l[u] = D.mergeCollectedValues(
|
|
12832
12849
|
(d ? d.value : l[u]) ?? null,
|
|
12833
12850
|
a
|
|
12834
12851
|
);
|
|
12835
12852
|
} else
|
|
12836
|
-
l =
|
|
12853
|
+
l = D.mergeCollectedValues(
|
|
12837
12854
|
n,
|
|
12838
12855
|
a,
|
|
12839
|
-
|
|
12856
|
+
D.ancestorBaseResolver(e)
|
|
12840
12857
|
);
|
|
12841
12858
|
await $.setBindingData(i, l, {
|
|
12842
12859
|
skipFragments: s,
|
|
12843
12860
|
kind: "nonSupply",
|
|
12844
12861
|
sequence: this.operationSequence,
|
|
12845
|
-
editedPaths:
|
|
12862
|
+
editedPaths: D.collectEditedPaths(
|
|
12846
12863
|
e,
|
|
12847
12864
|
this.operationSequence,
|
|
12848
12865
|
o ? String(o) : "",
|
|
@@ -12858,15 +12875,34 @@ ${W}
|
|
|
12858
12875
|
acquireExecutionLock() {
|
|
12859
12876
|
if (this.eventType !== "click" || !this.options.targetFragment)
|
|
12860
12877
|
return null;
|
|
12861
|
-
const e = this.options.targetFragment, t = e.getTarget();
|
|
12862
|
-
if (
|
|
12878
|
+
const e = this.options.targetFragment, t = e.getTarget(), r = f.readLockName(t);
|
|
12879
|
+
if (f.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(tt) || r !== null && f.RUNNING_LOCK_NAMES.has(r))
|
|
12863
12880
|
return !1;
|
|
12864
|
-
|
|
12865
|
-
|
|
12866
|
-
|
|
12867
|
-
|
|
12868
|
-
|
|
12869
|
-
|
|
12881
|
+
f.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(tt, "");
|
|
12882
|
+
const i = f.lockElement(t, e), s = [];
|
|
12883
|
+
return r !== null && (f.RUNNING_LOCK_NAMES.add(r), t.ownerDocument.querySelectorAll(`[${c.prefix}click-lock]`).forEach((n) => {
|
|
12884
|
+
f.readLockName(n) === r && !n.hasAttribute("disabled") && s.push(f.lockElement(n, N.get(n)));
|
|
12885
|
+
})), { ...i, lockName: r, members: s };
|
|
12886
|
+
}
|
|
12887
|
+
/**
|
|
12888
|
+
* 要素の `data-click-lock` の名前を読みます。
|
|
12889
|
+
*
|
|
12890
|
+
* @param element 対象要素
|
|
12891
|
+
* @returns 名前。属性が無いか値が空なら null
|
|
12892
|
+
*/
|
|
12893
|
+
static readLockName(e) {
|
|
12894
|
+
return e.getAttribute(`${c.prefix}click-lock`) || null;
|
|
12895
|
+
}
|
|
12896
|
+
/**
|
|
12897
|
+
* 要素へ `disabled` を付けます。
|
|
12898
|
+
*
|
|
12899
|
+
* @param target 対象要素
|
|
12900
|
+
* @param fragment 対象要素のフラグメント
|
|
12901
|
+
* @returns 付けたものの記録
|
|
12902
|
+
*/
|
|
12903
|
+
static lockElement(e, t) {
|
|
12904
|
+
const r = e.hasAttribute(`${c.prefix}click-no-disabled`);
|
|
12905
|
+
return r || e.setAttribute("disabled", ""), { target: e, fragment: t, appliedDisabledAttribute: !r };
|
|
12870
12906
|
}
|
|
12871
12907
|
/**
|
|
12872
12908
|
* 起点要素が持つ `disabled` の宣言を探します。
|
|
@@ -12901,14 +12937,19 @@ ${W}
|
|
|
12901
12937
|
* @returns 戻り値はありません。
|
|
12902
12938
|
*/
|
|
12903
12939
|
releaseExecutionLock(e) {
|
|
12904
|
-
|
|
12905
|
-
|
|
12940
|
+
e && (f.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(tt), e.lockName !== null && f.RUNNING_LOCK_NAMES.delete(e.lockName), f.unlockElement(e), e.members.forEach((t) => f.unlockElement(t)));
|
|
12941
|
+
}
|
|
12942
|
+
/**
|
|
12943
|
+
* 付けた `disabled` を宣言の評価結果へ揃えます。
|
|
12944
|
+
*
|
|
12945
|
+
* @param locked 付けたものの記録
|
|
12946
|
+
* @returns 戻り値はありません。
|
|
12947
|
+
*/
|
|
12948
|
+
static unlockElement(e) {
|
|
12906
12949
|
const t = e.target;
|
|
12907
|
-
if (
|
|
12950
|
+
if (!e.appliedDisabledAttribute)
|
|
12908
12951
|
return;
|
|
12909
|
-
const r =
|
|
12910
|
-
e.fragment
|
|
12911
|
-
);
|
|
12952
|
+
const r = f.findDisabledDeclaration(e.fragment);
|
|
12912
12953
|
if (r === null) {
|
|
12913
12954
|
t.removeAttribute("disabled");
|
|
12914
12955
|
return;
|
|
@@ -13007,7 +13048,7 @@ ${W}
|
|
|
13007
13048
|
break;
|
|
13008
13049
|
await t(n), this.downloadReceivedBytes += n.byteLength, this.dropTotalBytesIfExceeded();
|
|
13009
13050
|
const a = Date.now();
|
|
13010
|
-
a - r >=
|
|
13051
|
+
a - r >= kr && (r = a, await this.injectFetchState("loading"));
|
|
13011
13052
|
}
|
|
13012
13053
|
} catch (s) {
|
|
13013
13054
|
return m.error("Haori", `応答をファイルとして読み取れませんでした: ${s}`), !1;
|
|
@@ -13064,7 +13105,7 @@ ${W}
|
|
|
13064
13105
|
const i = t.body;
|
|
13065
13106
|
if (!i || typeof i.getReader != "function")
|
|
13066
13107
|
return "fallback";
|
|
13067
|
-
const s =
|
|
13108
|
+
const s = f.resolveDownloadFileName(
|
|
13068
13109
|
t,
|
|
13069
13110
|
this.options.downloadFileName ?? null,
|
|
13070
13111
|
r ?? this.options.fetchUrl ?? null
|
|
@@ -13130,7 +13171,7 @@ ${W}
|
|
|
13130
13171
|
* @returns 保存の結果
|
|
13131
13172
|
*/
|
|
13132
13173
|
async saveResponseAsFile(e, t) {
|
|
13133
|
-
if (this.downloadTotalBytes =
|
|
13174
|
+
if (this.downloadTotalBytes = f.resolveDownloadTotalBytes(e), this.downloadFolder) {
|
|
13134
13175
|
const a = await this.saveResponseToFolder(
|
|
13135
13176
|
this.downloadFolder,
|
|
13136
13177
|
e,
|
|
@@ -13143,7 +13184,7 @@ ${W}
|
|
|
13143
13184
|
const r = await this.readResponseBody(e);
|
|
13144
13185
|
if (r === null)
|
|
13145
13186
|
return "failed";
|
|
13146
|
-
const i =
|
|
13187
|
+
const i = f.resolveDownloadFileName(
|
|
13147
13188
|
e,
|
|
13148
13189
|
this.options.downloadFileName ?? null,
|
|
13149
13190
|
t ?? this.options.fetchUrl ?? null
|
|
@@ -13182,11 +13223,11 @@ ${W}
|
|
|
13182
13223
|
* @returns 保存に使うファイル名
|
|
13183
13224
|
*/
|
|
13184
13225
|
static resolveDownloadFileName(e, t, r) {
|
|
13185
|
-
const s = [
|
|
13226
|
+
const s = [f.readContentDispositionFileName(
|
|
13186
13227
|
e.headers.get("Content-Disposition")
|
|
13187
|
-
), t,
|
|
13228
|
+
), t, f.readUrlFileName(r)];
|
|
13188
13229
|
for (const n of s) {
|
|
13189
|
-
const a =
|
|
13230
|
+
const a = f.sanitizeFileName(n);
|
|
13190
13231
|
if (a !== null)
|
|
13191
13232
|
return a;
|
|
13192
13233
|
}
|
|
@@ -13253,9 +13294,9 @@ ${W}
|
|
|
13253
13294
|
async handleFetchResult(e, t, r) {
|
|
13254
13295
|
const i = ge();
|
|
13255
13296
|
if (!e.ok) {
|
|
13256
|
-
if (
|
|
13297
|
+
if (Zt(e.status, {
|
|
13257
13298
|
element: this.options.targetFragment.getTarget(),
|
|
13258
|
-
attrPrefix:
|
|
13299
|
+
attrPrefix: f.attrName(this.eventType, "", !0)
|
|
13259
13300
|
}))
|
|
13260
13301
|
return !1;
|
|
13261
13302
|
this.options.targetFragment && t && O.fetchError(
|
|
@@ -13308,12 +13349,12 @@ ${W}
|
|
|
13308
13349
|
const s = [];
|
|
13309
13350
|
s.push(this.bindResult(e)), s.push(this.adjust()), s.push(this.addRow()), s.push(this.removeRow()), s.push(this.movePrevRow()), s.push(this.moveNextRow()), await Promise.all(s), await this.injectFetchState("success", e.status, null), this.options.resetFragments && this.options.resetFragments.length > 0 && await Promise.all(
|
|
13310
13351
|
this.options.resetFragments.map(
|
|
13311
|
-
(E) =>
|
|
13352
|
+
(E) => D.reset(E, this.operationSequence)
|
|
13312
13353
|
)
|
|
13313
13354
|
), await this.copy();
|
|
13314
13355
|
const n = [];
|
|
13315
13356
|
this.options.refetchFragments && this.options.refetchFragments.length > 0 && this.options.refetchFragments.forEach((E) => {
|
|
13316
|
-
n.push(new
|
|
13357
|
+
n.push(new f(E, null).run());
|
|
13317
13358
|
});
|
|
13318
13359
|
const a = await this.clickTargets(
|
|
13319
13360
|
this.options.clickFragments,
|
|
@@ -13328,17 +13369,17 @@ ${W}
|
|
|
13328
13369
|
A instanceof HTMLElement ? n.push(i.closeDialog(A)) : m.error("Haori", "Element is not an HTML element: ", A);
|
|
13329
13370
|
}), await Promise.all(n), a)
|
|
13330
13371
|
return !1;
|
|
13331
|
-
const o =
|
|
13332
|
-
|
|
13372
|
+
const o = f.unescapeNewlines(
|
|
13373
|
+
f.normalizeAttributeText(
|
|
13333
13374
|
this.resolveLateAttribute("dialog", this.options.dialogMessage)
|
|
13334
13375
|
)
|
|
13335
13376
|
);
|
|
13336
13377
|
o && await i.dialog(o);
|
|
13337
|
-
const l =
|
|
13378
|
+
const l = f.normalizeAttributeText(
|
|
13338
13379
|
this.resolveLateAttribute("toast", this.options.toastMessage)
|
|
13339
13380
|
);
|
|
13340
13381
|
if (l) {
|
|
13341
|
-
const E =
|
|
13382
|
+
const E = f.toToastLevel(
|
|
13342
13383
|
this.resolveLateAttribute("toast-level", this.options.toastLevel)
|
|
13343
13384
|
);
|
|
13344
13385
|
await i.toast(l, E ?? "info");
|
|
@@ -13350,7 +13391,7 @@ ${W}
|
|
|
13350
13391
|
);
|
|
13351
13392
|
u && z.query(
|
|
13352
13393
|
u,
|
|
13353
|
-
|
|
13394
|
+
f.attrName(this.eventType, "scroll"),
|
|
13354
13395
|
document
|
|
13355
13396
|
)?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
13356
13397
|
const d = this.resolveLateAttribute(
|
|
@@ -13362,7 +13403,7 @@ ${W}
|
|
|
13362
13403
|
);
|
|
13363
13404
|
d && y && m.warn(
|
|
13364
13405
|
"Haori",
|
|
13365
|
-
`${
|
|
13406
|
+
`${f.attrName(this.eventType, "redirect")} と ${f.attrName(this.eventType, "redirect-replace")} の両方が指定されています。履歴を置き換える方を採用します。`
|
|
13366
13407
|
);
|
|
13367
13408
|
const b = y || d;
|
|
13368
13409
|
if (b) {
|
|
@@ -13374,8 +13415,8 @@ ${W}
|
|
|
13374
13415
|
if (A) {
|
|
13375
13416
|
const M = new URLSearchParams(window.location.search).get(A);
|
|
13376
13417
|
if (M !== null) {
|
|
13377
|
-
const
|
|
13378
|
-
Oe.isSafeLocalPath(
|
|
13418
|
+
const F = M.trim();
|
|
13419
|
+
Oe.isSafeLocalPath(F) ? E = F : m.warn(
|
|
13379
13420
|
"Haori",
|
|
13380
13421
|
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${M}`
|
|
13381
13422
|
);
|
|
@@ -13416,11 +13457,11 @@ ${W}
|
|
|
13416
13457
|
for (const i of e) {
|
|
13417
13458
|
await $.evaluateAll(i);
|
|
13418
13459
|
const s = i.getTarget();
|
|
13419
|
-
if (t &&
|
|
13460
|
+
if (t && f.takeClickOutcome(s), typeof s.click == "function" ? s.click() : s.dispatchEvent(
|
|
13420
13461
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
13421
13462
|
), !t)
|
|
13422
13463
|
continue;
|
|
13423
|
-
const n =
|
|
13464
|
+
const n = f.takeClickOutcome(s);
|
|
13424
13465
|
if (n === null) {
|
|
13425
13466
|
m.warn(
|
|
13426
13467
|
"Haori",
|
|
@@ -13455,11 +13496,11 @@ ${W}
|
|
|
13455
13496
|
const o = a.getTarget();
|
|
13456
13497
|
o instanceof HTMLElement ? s.push(i.closeDialog(o)) : m.error("Haori", "Element is not an HTML element: ", o);
|
|
13457
13498
|
}), await Promise.all(s);
|
|
13458
|
-
const n =
|
|
13499
|
+
const n = f.normalizeAttributeText(
|
|
13459
13500
|
this.resolveLateAttribute(`${t.key}-toast`, t.toastMessage)
|
|
13460
13501
|
);
|
|
13461
13502
|
if (n) {
|
|
13462
|
-
const a =
|
|
13503
|
+
const a = f.toToastLevel(
|
|
13463
13504
|
this.resolveLateAttribute(
|
|
13464
13505
|
`${t.key}-toast-level`,
|
|
13465
13506
|
t.toastLevel
|
|
@@ -13548,7 +13589,7 @@ ${W}
|
|
|
13548
13589
|
y != null && (Array.isArray(y) ? (o.searchParams.delete(d), y.forEach((b) => o.searchParams.append(d, String(b)))) : typeof y == "object" ? o.searchParams.set(d, JSON.stringify(y)) : o.searchParams.set(d, String(y)));
|
|
13549
13590
|
};
|
|
13550
13591
|
s && l(r), n && l(i), history.pushState(
|
|
13551
|
-
{ [
|
|
13592
|
+
{ [Tr]: !0 },
|
|
13552
13593
|
"",
|
|
13553
13594
|
o.toString()
|
|
13554
13595
|
), $.refreshUrlParams();
|
|
@@ -13565,7 +13606,7 @@ ${W}
|
|
|
13565
13606
|
* @returns 失敗の表示先の要素
|
|
13566
13607
|
*/
|
|
13567
13608
|
resolveMessageScope() {
|
|
13568
|
-
const e = this.options.formFragment ?? (this.options.targetFragment ?
|
|
13609
|
+
const e = this.options.formFragment ?? (this.options.targetFragment ? D.getFormFragment(this.options.targetFragment) || this.options.targetFragment : null);
|
|
13569
13610
|
return e ? e.getTarget() : document.body;
|
|
13570
13611
|
}
|
|
13571
13612
|
/**
|
|
@@ -13580,7 +13621,7 @@ ${W}
|
|
|
13580
13621
|
*/
|
|
13581
13622
|
async handleFetchError(e, t) {
|
|
13582
13623
|
let r = null;
|
|
13583
|
-
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r =
|
|
13624
|
+
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r = D.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
|
|
13584
13625
|
const i = r ? r.getTarget() : document.body;
|
|
13585
13626
|
await ge().clearMessages(i);
|
|
13586
13627
|
const s = async (u) => {
|
|
@@ -13597,7 +13638,7 @@ ${W}
|
|
|
13597
13638
|
if (t) {
|
|
13598
13639
|
u.length === 0 && await s(`${e.status} ${e.statusText}`);
|
|
13599
13640
|
for (const d of u)
|
|
13600
|
-
d.key && r ? await
|
|
13641
|
+
d.key && r ? await D.addErrorMessage(r, d.key, d.message) : await s(d.message);
|
|
13601
13642
|
n();
|
|
13602
13643
|
}
|
|
13603
13644
|
return u.length === 0 ? null : u.map((d) => d.message).join(`
|
|
@@ -13610,14 +13651,14 @@ ${W}
|
|
|
13610
13651
|
const y = /* @__PURE__ */ new Map(), b = [];
|
|
13611
13652
|
for (const E of u)
|
|
13612
13653
|
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
13613
|
-
const A = E.key, w = E.message, M = typeof A == "string" && A.length > 0 ? A : null,
|
|
13614
|
-
if (
|
|
13654
|
+
const A = E.key, w = E.message, M = typeof A == "string" && A.length > 0 ? A : null, F = typeof w == "string" ? w : w != null ? String(w) : "";
|
|
13655
|
+
if (F.length === 0)
|
|
13615
13656
|
continue;
|
|
13616
13657
|
if (M !== null) {
|
|
13617
13658
|
const se = y.get(M) ?? [];
|
|
13618
|
-
se.push(
|
|
13659
|
+
se.push(F), y.set(M, se);
|
|
13619
13660
|
} else
|
|
13620
|
-
b.push(
|
|
13661
|
+
b.push(F);
|
|
13621
13662
|
} else typeof E == "string" && E.length > 0 && b.push(E);
|
|
13622
13663
|
for (const [E, A] of y)
|
|
13623
13664
|
d.push({ key: E, message: A.join(`
|
|
@@ -13656,16 +13697,16 @@ ${W}
|
|
|
13656
13697
|
*/
|
|
13657
13698
|
validate(e) {
|
|
13658
13699
|
if (this.options.valid !== !0)
|
|
13659
|
-
return this.options.implicitFormFragment ||
|
|
13700
|
+
return this.options.implicitFormFragment || D.warnUnvalidatedCustomValidity(
|
|
13660
13701
|
e,
|
|
13661
13702
|
`${c.prefix}${this.eventType ?? "fetch"}-validate の指定がありません`
|
|
13662
13703
|
), !0;
|
|
13663
|
-
|
|
13704
|
+
D.applyCustomValidity(e);
|
|
13664
13705
|
const t = this.findFirstInvalid(e);
|
|
13665
13706
|
if (t === null)
|
|
13666
13707
|
return !0;
|
|
13667
13708
|
const r = t;
|
|
13668
|
-
return
|
|
13709
|
+
return f.isRectFullyVisible(t.getBoundingClientRect()) ? (r.reportValidity(), t.focus(), this.options.scrollOnError && t.scrollIntoView({ behavior: "smooth", block: "nearest" }), !1) : (t.focus({ preventScroll: !0 }), t.scrollIntoView({ behavior: "smooth", block: "nearest" }), f.reportValidityAfterScroll(r), !1);
|
|
13669
13710
|
}
|
|
13670
13711
|
/**
|
|
13671
13712
|
* スクロールが止まってから、対象の入力要素の検証 UI(バブル)を表示します。
|
|
@@ -13679,13 +13720,13 @@ ${W}
|
|
|
13679
13720
|
* @param target 検証エラーの入力要素
|
|
13680
13721
|
*/
|
|
13681
13722
|
static reportValidityAfterScroll(e) {
|
|
13682
|
-
const t = ++
|
|
13723
|
+
const t = ++f.validationReportGeneration, r = performance.now();
|
|
13683
13724
|
let i = null, s = 0;
|
|
13684
13725
|
const n = () => {
|
|
13685
|
-
if (t !==
|
|
13726
|
+
if (t !== f.validationReportGeneration || !e.isConnected)
|
|
13686
13727
|
return;
|
|
13687
13728
|
const a = e.getBoundingClientRect(), o = `${Math.round(a.top)}:${Math.round(a.left)}`;
|
|
13688
|
-
if (s = o === i ? s + 1 : 0, i = o, s >=
|
|
13729
|
+
if (s = o === i ? s + 1 : 0, i = o, s >= f.VALIDATION_SCROLL_STABLE_FRAMES && f.isRectPartlyVisible(a) || performance.now() - r >= f.VALIDATION_SCROLL_TIMEOUT_MS) {
|
|
13689
13730
|
e.reportValidity();
|
|
13690
13731
|
return;
|
|
13691
13732
|
}
|
|
@@ -13715,7 +13756,7 @@ ${W}
|
|
|
13715
13756
|
* @returns 全体が画面内にあれば true
|
|
13716
13757
|
*/
|
|
13717
13758
|
static isRectFullyVisible(e) {
|
|
13718
|
-
const { width: t, height: r } =
|
|
13759
|
+
const { width: t, height: r } = f.getViewportSize();
|
|
13719
13760
|
return e.top >= 0 && e.left >= 0 && e.bottom <= r && e.right <= t;
|
|
13720
13761
|
}
|
|
13721
13762
|
/**
|
|
@@ -13728,7 +13769,7 @@ ${W}
|
|
|
13728
13769
|
* @returns 一部でも画面内にあれば true
|
|
13729
13770
|
*/
|
|
13730
13771
|
static isRectPartlyVisible(e) {
|
|
13731
|
-
const { width: t, height: r } =
|
|
13772
|
+
const { width: t, height: r } = f.getViewportSize();
|
|
13732
13773
|
return e.top < r && e.bottom > 0 && e.left < t && e.right > 0;
|
|
13733
13774
|
}
|
|
13734
13775
|
/**
|
|
@@ -13751,7 +13792,7 @@ ${W}
|
|
|
13751
13792
|
const r = this.options.targetFragment;
|
|
13752
13793
|
if (!r)
|
|
13753
13794
|
return !0;
|
|
13754
|
-
const i = this.options.conditionAttributeName ?? `${c.prefix}if`, s =
|
|
13795
|
+
const i = this.options.conditionAttributeName ?? `${c.prefix}if`, s = D.buildConditionScope(
|
|
13755
13796
|
r,
|
|
13756
13797
|
this.options.formFragment ?? null
|
|
13757
13798
|
), n = re.evaluateDetailed(t, s);
|
|
@@ -13835,7 +13876,7 @@ ${W}
|
|
|
13835
13876
|
);
|
|
13836
13877
|
return;
|
|
13837
13878
|
}
|
|
13838
|
-
const s = [], n = this.eventType ?
|
|
13879
|
+
const s = [], n = this.eventType ? f.attrName(this.eventType, "bind") : f.attrName(null, "bind", !0), a = [];
|
|
13839
13880
|
if (this.options.bindArg)
|
|
13840
13881
|
this.options.bindFragments.forEach((o) => {
|
|
13841
13882
|
const l = this.resolveRowWrite(o, n);
|
|
@@ -14004,7 +14045,7 @@ ${W}
|
|
|
14004
14045
|
r,
|
|
14005
14046
|
s ? 0 : i
|
|
14006
14047
|
);
|
|
14007
|
-
const n =
|
|
14048
|
+
const n = D.getValuesEditedAfter(
|
|
14008
14049
|
e,
|
|
14009
14050
|
s ? 0 : i
|
|
14010
14051
|
);
|
|
@@ -14038,7 +14079,7 @@ ${W}
|
|
|
14038
14079
|
return t;
|
|
14039
14080
|
const i = this.eventType === "poll";
|
|
14040
14081
|
!i && !this.twoWayCommitBind && $.clearUserEditMarks(e, r);
|
|
14041
|
-
const s =
|
|
14082
|
+
const s = D.getValuesEditedAfter(
|
|
14042
14083
|
e,
|
|
14043
14084
|
i ? 0 : r
|
|
14044
14085
|
);
|
|
@@ -14061,10 +14102,10 @@ ${W}
|
|
|
14061
14102
|
*/
|
|
14062
14103
|
reconcileAncestorArgFormEdits(e, t, r, i) {
|
|
14063
14104
|
let s = t;
|
|
14064
|
-
for (const { form: n, key: a } of
|
|
14105
|
+
for (const { form: n, key: a } of D.collectArgForms(e)) {
|
|
14065
14106
|
if (!r.includes(a))
|
|
14066
14107
|
continue;
|
|
14067
|
-
const o =
|
|
14108
|
+
const o = D.getValuesEditedAfter(n, i);
|
|
14068
14109
|
if (Object.keys(o).length === 0)
|
|
14069
14110
|
continue;
|
|
14070
14111
|
const l = s[a], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
@@ -14091,7 +14132,7 @@ ${W}
|
|
|
14091
14132
|
copy() {
|
|
14092
14133
|
if (!this.options.copyFragments || this.options.copyFragments.length === 0)
|
|
14093
14134
|
return Promise.resolve();
|
|
14094
|
-
const e = this.resolveCopySourceData(), t = this.pickCopyData(e), r =
|
|
14135
|
+
const e = this.resolveCopySourceData(), t = this.pickCopyData(e), r = f.attrName(this.eventType, "copy"), i = [], s = [];
|
|
14095
14136
|
return this.options.copyFragments.forEach((n) => {
|
|
14096
14137
|
const a = this.resolveRowWrite(n, r);
|
|
14097
14138
|
if (a.kind === "skip")
|
|
@@ -14144,7 +14185,7 @@ ${W}
|
|
|
14144
14185
|
* @returns 行の入力欄の状態を反映した要素データ
|
|
14145
14186
|
*/
|
|
14146
14187
|
resolveCurrentRowItem(e, t) {
|
|
14147
|
-
const r =
|
|
14188
|
+
const r = D.getValuesEditedAfter(e, 0);
|
|
14148
14189
|
return Object.keys(r).length === 0 ? t : we(t, r);
|
|
14149
14190
|
}
|
|
14150
14191
|
/**
|
|
@@ -14189,11 +14230,11 @@ ${W}
|
|
|
14189
14230
|
let t = !1;
|
|
14190
14231
|
const r = this.options.formFragment ?? this.options.selfValueFragment;
|
|
14191
14232
|
if (r) {
|
|
14192
|
-
const i =
|
|
14193
|
-
Object.assign(e, i),
|
|
14233
|
+
const i = D.getValues(r);
|
|
14234
|
+
Object.assign(e, i), D.carryCollectedRowIdentity(i, e);
|
|
14194
14235
|
}
|
|
14195
14236
|
if (this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
|
|
14196
|
-
const i =
|
|
14237
|
+
const i = f.resolveDataAttributeDetailed(
|
|
14197
14238
|
this.options.targetFragment,
|
|
14198
14239
|
this.options.dataAttrName
|
|
14199
14240
|
);
|
|
@@ -14289,7 +14330,7 @@ ${W}
|
|
|
14289
14330
|
), o = (n.method || "GET").toUpperCase(), l = c.runtime === "demo" && !je(o), u = l ? "GET" : o;
|
|
14290
14331
|
if (n.method = u, Object.keys(i).length > 0 && Ue(i)) {
|
|
14291
14332
|
const y = a.get("Content-Type") || "";
|
|
14292
|
-
!je(o) && /multipart\/form-data/i.test(y) ?
|
|
14333
|
+
!je(o) && /multipart\/form-data/i.test(y) ? $r(i) && m.warn(
|
|
14293
14334
|
"Haori",
|
|
14294
14335
|
`A File value nested under ${c.prefix}form-object / ${c.prefix}form-list cannot be sent. Place file inputs at the top level of the collected form values.`
|
|
14295
14336
|
) : m.warn(
|
|
@@ -14298,7 +14339,7 @@ ${W}
|
|
|
14298
14339
|
);
|
|
14299
14340
|
}
|
|
14300
14341
|
if (u === "GET" || u === "HEAD" || u === "OPTIONS")
|
|
14301
|
-
Object.keys(i).length > 0 && (s =
|
|
14342
|
+
Object.keys(i).length > 0 && (s = Qt(s, i));
|
|
14302
14343
|
else if (Object.keys(i).length > 0) {
|
|
14303
14344
|
const y = a.get("Content-Type") || "";
|
|
14304
14345
|
if (/multipart\/form-data/i.test(y)) {
|
|
@@ -14306,13 +14347,13 @@ ${W}
|
|
|
14306
14347
|
const b = new FormData();
|
|
14307
14348
|
for (const [E, A] of Object.entries(i))
|
|
14308
14349
|
A == null ? b.append(E, "") : A instanceof Blob ? b.append(E, A) : Array.isArray(A) ? A.forEach((w) => {
|
|
14309
|
-
w instanceof Blob ? b.append(E, w) : b.append(E,
|
|
14310
|
-
}) : b.append(E,
|
|
14350
|
+
w instanceof Blob ? b.append(E, w) : b.append(E, Fe(w));
|
|
14351
|
+
}) : b.append(E, Fe(A));
|
|
14311
14352
|
n.body = b;
|
|
14312
14353
|
} else if (/application\/x-www-form-urlencoded/i.test(y)) {
|
|
14313
14354
|
const b = new URLSearchParams();
|
|
14314
14355
|
for (const [E, A] of Object.entries(i))
|
|
14315
|
-
A !== void 0 && (Array.isArray(A) ? A.forEach((w) => b.append(E,
|
|
14356
|
+
A !== void 0 && (Array.isArray(A) ? A.forEach((w) => b.append(E, Fe(w))) : b.append(E, Fe(A)));
|
|
14316
14357
|
n.body = b;
|
|
14317
14358
|
} else
|
|
14318
14359
|
a.set("Content-Type", "application/json"), n.body = JSON.stringify(i);
|
|
@@ -14330,14 +14371,14 @@ ${W}
|
|
|
14330
14371
|
effectiveMethod: u,
|
|
14331
14372
|
queryString: d,
|
|
14332
14373
|
transportMode: l ? "query-get" : "http",
|
|
14333
|
-
signature:
|
|
14374
|
+
signature: Pr(s, n)
|
|
14334
14375
|
};
|
|
14335
14376
|
}
|
|
14336
14377
|
/**
|
|
14337
14378
|
* reset-before 後の history 用スナップショットを保存します。
|
|
14338
14379
|
*/
|
|
14339
14380
|
captureHistorySnapshots() {
|
|
14340
|
-
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot =
|
|
14381
|
+
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = f.resolveDataAttribute(
|
|
14341
14382
|
this.options.targetFragment,
|
|
14342
14383
|
this.options.historyDataAttrName
|
|
14343
14384
|
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? We(this.options.historyFormFragment) : void 0;
|
|
@@ -14348,7 +14389,7 @@ ${W}
|
|
|
14348
14389
|
* @returns history-data の評価値。
|
|
14349
14390
|
*/
|
|
14350
14391
|
resolveHistoryDataValues() {
|
|
14351
|
-
return this.historyDataSnapshot !== void 0 ? this.historyDataSnapshot : this.options.targetFragment && this.options.historyDataAttrName ?
|
|
14392
|
+
return this.historyDataSnapshot !== void 0 ? this.historyDataSnapshot : this.options.targetFragment && this.options.historyDataAttrName ? f.resolveDataAttribute(
|
|
14352
14393
|
this.options.targetFragment,
|
|
14353
14394
|
this.options.historyDataAttrName
|
|
14354
14395
|
) : this.options.historyData;
|
|
@@ -14431,7 +14472,7 @@ ${W}
|
|
|
14431
14472
|
const t = this.options.targetFragment;
|
|
14432
14473
|
if (!t)
|
|
14433
14474
|
return m.error("Haori", "Target fragment is not specified for row operation."), null;
|
|
14434
|
-
const r =
|
|
14475
|
+
const r = f.attrName(this.eventType, e), i = z.read(t, r);
|
|
14435
14476
|
if (i !== null && i.trim() !== "") {
|
|
14436
14477
|
const n = z.query(i, r, document);
|
|
14437
14478
|
if (n === null)
|
|
@@ -14439,7 +14480,7 @@ ${W}
|
|
|
14439
14480
|
"Haori",
|
|
14440
14481
|
`Row container not found: ${i} (${r})`
|
|
14441
14482
|
), null;
|
|
14442
|
-
const a =
|
|
14483
|
+
const a = N.get(n);
|
|
14443
14484
|
return a instanceof R ? a.hasAttribute(`${c.prefix}each`) ? a : (m.error(
|
|
14444
14485
|
"Haori",
|
|
14445
14486
|
`Row container must have ${c.prefix}each: ${i} (${r})`
|
|
@@ -14485,7 +14526,7 @@ ${W}
|
|
|
14485
14526
|
"Haori",
|
|
14486
14527
|
`${c.prefix}each-array requires ${c.prefix}each-key (${c.prefix}each-array="${a}").`
|
|
14487
14528
|
), null;
|
|
14488
|
-
const u =
|
|
14529
|
+
const u = f.resolveRowScopeBase(e, o[0]);
|
|
14489
14530
|
if (u === "unresolvable")
|
|
14490
14531
|
return null;
|
|
14491
14532
|
let d, y, b;
|
|
@@ -14494,7 +14535,7 @@ ${W}
|
|
|
14494
14535
|
else {
|
|
14495
14536
|
for (d = e, y = null; d; ) {
|
|
14496
14537
|
const A = d.getRawBindingData();
|
|
14497
|
-
if (A && o[0] in A && !
|
|
14538
|
+
if (A && o[0] in A && !f.isRowScopeKey(d, o[0])) {
|
|
14498
14539
|
y = A;
|
|
14499
14540
|
break;
|
|
14500
14541
|
}
|
|
@@ -14507,7 +14548,7 @@ ${W}
|
|
|
14507
14548
|
"Haori",
|
|
14508
14549
|
`Binding data owner not found for ${n}="${a}".`
|
|
14509
14550
|
), null;
|
|
14510
|
-
const E =
|
|
14551
|
+
const E = f.readPathValue(y, b);
|
|
14511
14552
|
return Array.isArray(E) ? { owner: d, ownerData: y, array: E, path: b, mapped: s } : (t || m.error(
|
|
14512
14553
|
"Haori",
|
|
14513
14554
|
`${n}="${a}" does not resolve to an array.`
|
|
@@ -14539,7 +14580,7 @@ ${W}
|
|
|
14539
14580
|
if (!s)
|
|
14540
14581
|
return null;
|
|
14541
14582
|
if (s.getAttribute(`${c.prefix}each-arg`) === t) {
|
|
14542
|
-
const n =
|
|
14583
|
+
const n = f.resolveEachArray(s, !0);
|
|
14543
14584
|
if (!n)
|
|
14544
14585
|
return m.error(
|
|
14545
14586
|
"Haori",
|
|
@@ -14549,7 +14590,7 @@ ${W}
|
|
|
14549
14590
|
`${c.prefix}each`
|
|
14550
14591
|
)}") does not resolve to a writable array. Build the outer list with ${c.prefix}derive and declare ${c.prefix}each-array on this ${c.prefix}each.`
|
|
14551
14592
|
), "unresolvable";
|
|
14552
|
-
const a =
|
|
14593
|
+
const a = f.resolveRowIndex(
|
|
14553
14594
|
s,
|
|
14554
14595
|
i,
|
|
14555
14596
|
n.array,
|
|
@@ -14655,7 +14696,7 @@ ${W}
|
|
|
14655
14696
|
return i === null ? (m.warn(
|
|
14656
14697
|
"Haori",
|
|
14657
14698
|
`Target is not a row of the ${c.prefix}each container (${t}).`
|
|
14658
|
-
), { kind: "skip" }) :
|
|
14699
|
+
), { kind: "skip" }) : f.getRowFragments(i).includes(e) ? { kind: "row", container: i } : (m.warn(
|
|
14659
14700
|
"Haori",
|
|
14660
14701
|
`The target row is no longer in the ${c.prefix}each container; the write was skipped (${t}).`
|
|
14661
14702
|
), { kind: "skip" });
|
|
@@ -14679,13 +14720,13 @@ ${W}
|
|
|
14679
14720
|
}
|
|
14680
14721
|
const r = [];
|
|
14681
14722
|
return t.forEach((i, s) => {
|
|
14682
|
-
const n =
|
|
14723
|
+
const n = f.resolveEachArray(s);
|
|
14683
14724
|
if (!n)
|
|
14684
14725
|
return;
|
|
14685
14726
|
const a = n.array.slice();
|
|
14686
14727
|
let o = !1;
|
|
14687
14728
|
for (const u of i) {
|
|
14688
|
-
const d =
|
|
14729
|
+
const d = f.resolveRowArrayIndex(u, a);
|
|
14689
14730
|
if (d === null)
|
|
14690
14731
|
continue;
|
|
14691
14732
|
const y = a[d];
|
|
@@ -14697,9 +14738,9 @@ ${W}
|
|
|
14697
14738
|
continue;
|
|
14698
14739
|
}
|
|
14699
14740
|
const b = u.apply(y);
|
|
14700
|
-
if (
|
|
14741
|
+
if (f.isSameRowItem(y, b)) {
|
|
14701
14742
|
u.syncWhenUnchanged && r.push(
|
|
14702
|
-
|
|
14743
|
+
f.syncUnchangedRowValues(
|
|
14703
14744
|
u.row,
|
|
14704
14745
|
b,
|
|
14705
14746
|
u.syncWhenUnchanged
|
|
@@ -14707,13 +14748,13 @@ ${W}
|
|
|
14707
14748
|
);
|
|
14708
14749
|
continue;
|
|
14709
14750
|
}
|
|
14710
|
-
a[d] = b, o = !0, u.syncWhenUnchanged === "supply" &&
|
|
14751
|
+
a[d] = b, o = !0, u.syncWhenUnchanged === "supply" && D.clearRowUserEditMarksForChangedKeys(u.row, b);
|
|
14711
14752
|
}
|
|
14712
14753
|
if (!o)
|
|
14713
14754
|
return;
|
|
14714
14755
|
const l = $.setBindingData(
|
|
14715
14756
|
n.owner.getTarget(),
|
|
14716
|
-
|
|
14757
|
+
f.withPathValue(n.ownerData, n.path, a),
|
|
14717
14758
|
{
|
|
14718
14759
|
// マネージド `data-fetch` はバインドワークの内部から起動・await される。
|
|
14719
14760
|
// 所有者が実行中のバインドワークを持つときに FIFO キューへ積むと、相互に
|
|
@@ -14757,7 +14798,7 @@ ${W}
|
|
|
14757
14798
|
* @returns 反映完了の Promise
|
|
14758
14799
|
*/
|
|
14759
14800
|
static syncUnchangedRowValues(e, t, r) {
|
|
14760
|
-
return r === "supply" &&
|
|
14801
|
+
return r === "supply" && D.clearRowUserEditMarksForChangedKeys(e, t), D.syncRowValues(e, t);
|
|
14761
14802
|
}
|
|
14762
14803
|
/**
|
|
14763
14804
|
* 行の要素データが同じ内容かどうかを判定します。
|
|
@@ -14793,7 +14834,7 @@ ${W}
|
|
|
14793
14834
|
* @returns 配列のインデックス。解決できない場合は null
|
|
14794
14835
|
*/
|
|
14795
14836
|
static resolveRowArrayIndex(e, t) {
|
|
14796
|
-
return
|
|
14837
|
+
return f.resolveRowIndex(
|
|
14797
14838
|
e.container,
|
|
14798
14839
|
e.row,
|
|
14799
14840
|
t,
|
|
@@ -14813,7 +14854,7 @@ ${W}
|
|
|
14813
14854
|
* @returns 配列のインデックス。解決できない場合は null
|
|
14814
14855
|
*/
|
|
14815
14856
|
static resolveRowIndex(e, t, r, i) {
|
|
14816
|
-
const s =
|
|
14857
|
+
const s = f.getRowFragments(e), n = s.indexOf(t);
|
|
14817
14858
|
if (n === -1)
|
|
14818
14859
|
return m.warn(
|
|
14819
14860
|
"Haori",
|
|
@@ -14857,7 +14898,7 @@ ${W}
|
|
|
14857
14898
|
if (this.options.rowRemove !== !0)
|
|
14858
14899
|
return Promise.resolve();
|
|
14859
14900
|
const e = this.options.targetFragment?.hasAttribute(
|
|
14860
|
-
|
|
14901
|
+
f.attrName(this.eventType, "row-remove-empty")
|
|
14861
14902
|
);
|
|
14862
14903
|
return this.spliceRows("row-remove", (t, r) => r < 0 || r >= t.length || !e && t.length <= 1 ? !1 : (t.splice(r, 1), !0));
|
|
14863
14904
|
}
|
|
@@ -14915,14 +14956,14 @@ ${W}
|
|
|
14915
14956
|
const r = this.resolveRowContainer(e);
|
|
14916
14957
|
if (!r)
|
|
14917
14958
|
return Promise.reject(new Error("Row container not found."));
|
|
14918
|
-
const i =
|
|
14959
|
+
const i = f.resolveEachArray(r);
|
|
14919
14960
|
if (!i)
|
|
14920
14961
|
return Promise.reject(new Error("Row array not resolved."));
|
|
14921
|
-
const s = this.options.targetFragment, n = s ? s.closestByAttribute(`${c.prefix}row`) : null, a =
|
|
14962
|
+
const s = this.options.targetFragment, n = s ? s.closestByAttribute(`${c.prefix}row`) : null, a = f.getRowFragments(r), o = n ? a.indexOf(n) : a.length - 1, l = (b) => b < 0 || b >= a.length ? null : i.mapped ? f.resolveRowIndex(
|
|
14922
14963
|
r,
|
|
14923
14964
|
a[b],
|
|
14924
14965
|
i.array,
|
|
14925
|
-
|
|
14966
|
+
f.attrName(this.eventType, e)
|
|
14926
14967
|
) : b, u = o >= 0 ? l(o) : i.mapped ? i.array.length - 1 : o;
|
|
14927
14968
|
if (u === null)
|
|
14928
14969
|
return Promise.resolve();
|
|
@@ -14939,7 +14980,7 @@ ${W}
|
|
|
14939
14980
|
const E = b.getListKey();
|
|
14940
14981
|
E !== null && !y.has(String(E)) && y.set(String(E), b);
|
|
14941
14982
|
}), d.forEach((b, E) => {
|
|
14942
|
-
if (
|
|
14983
|
+
if (f.isSameRowItem(i.array[E], b))
|
|
14943
14984
|
return;
|
|
14944
14985
|
const A = y.get(
|
|
14945
14986
|
$.createListKey(
|
|
@@ -14951,7 +14992,7 @@ ${W}
|
|
|
14951
14992
|
A && $.clearUserEditMarks(A);
|
|
14952
14993
|
}), $.setBindingData(
|
|
14953
14994
|
i.owner.getTarget(),
|
|
14954
|
-
|
|
14995
|
+
f.withPathValue(i.ownerData, i.path, d),
|
|
14955
14996
|
{
|
|
14956
14997
|
// 対象は配列の 1 要素だけなので、所有者の部分木を丸ごと供給の宛先にはしない
|
|
14957
14998
|
// (行の書き戻し `applyRowWrites()` と同じ扱い)。
|
|
@@ -15005,9 +15046,9 @@ ${W}
|
|
|
15005
15046
|
);
|
|
15006
15047
|
}
|
|
15007
15048
|
};
|
|
15008
|
-
|
|
15009
|
-
let he =
|
|
15010
|
-
class
|
|
15049
|
+
f.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, f.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, f.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet(), f.RUNNING_LOCK_NAMES = /* @__PURE__ */ new Set(), f.CLICK_OUTCOMES = /* @__PURE__ */ new WeakMap(), f.validationReportGeneration = 0, f.VALIDATION_SCROLL_TIMEOUT_MS = 1e3, f.VALIDATION_SCROLL_STABLE_FRAMES = 2;
|
|
15050
|
+
let he = f;
|
|
15051
|
+
class Lr {
|
|
15011
15052
|
/**
|
|
15012
15053
|
* 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
|
|
15013
15054
|
*
|
|
@@ -15029,7 +15070,7 @@ class Pr {
|
|
|
15029
15070
|
throw m.error("[Haori]", "Failed to fetch import source:", e, n), new Error(`Failed to fetch: ${e}`);
|
|
15030
15071
|
}
|
|
15031
15072
|
if (!i.ok) {
|
|
15032
|
-
|
|
15073
|
+
Zt(i.status, r);
|
|
15033
15074
|
const n = `${i.status} ${i.statusText}`;
|
|
15034
15075
|
throw m.error("[Haori]", "Import HTTP error:", e, n), new Error(`Failed to load ${e}: ${n}`);
|
|
15035
15076
|
}
|
|
@@ -15098,7 +15139,7 @@ const h = class h {
|
|
|
15098
15139
|
* @returns data-attr-* の内部反映なら true
|
|
15099
15140
|
*/
|
|
15100
15141
|
static isAliasedAttributeReflection(e, t) {
|
|
15101
|
-
const r =
|
|
15142
|
+
const r = N.get(e);
|
|
15102
15143
|
return r instanceof R ? r.hasAttribute(
|
|
15103
15144
|
`${c.prefix}${h.ATTRIBUTE_ALIAS_SUFFIX}${t}`
|
|
15104
15145
|
) : !1;
|
|
@@ -15195,7 +15236,7 @@ const h = class h {
|
|
|
15195
15236
|
s ? h.OPTION_BINDING_ATTRIBUTES : h.VALUE_BINDING_ATTRIBUTES,
|
|
15196
15237
|
t
|
|
15197
15238
|
)) {
|
|
15198
|
-
const n = s ?
|
|
15239
|
+
const n = s ? N.get(i.closest("select")) : e;
|
|
15199
15240
|
n instanceof R && n.clearUserEditMark(r);
|
|
15200
15241
|
}
|
|
15201
15242
|
e.getChildren().forEach((n) => {
|
|
@@ -15304,7 +15345,7 @@ const h = class h {
|
|
|
15304
15345
|
if (t.has(e) || !e.isInitialized())
|
|
15305
15346
|
return Promise.resolve();
|
|
15306
15347
|
const r = [];
|
|
15307
|
-
return e.hasAttribute(`${c.prefix}validity`) &&
|
|
15348
|
+
return e.hasAttribute(`${c.prefix}validity`) && D.applyCustomValidity(e), e.hasAttribute(`${c.prefix}fetch`) && r.push(h.executeManagedFetch(e)), e.hasAttribute(`${c.prefix}import`) && r.push(h.executeManagedImport(e)), e.isVisible() ? (e.getChildren().forEach((i) => {
|
|
15308
15349
|
i instanceof R && r.push(
|
|
15309
15350
|
h.reevaluateReactiveSpecialAttributes(i, t)
|
|
15310
15351
|
);
|
|
@@ -15358,7 +15399,7 @@ const h = class h {
|
|
|
15358
15399
|
return Promise.resolve();
|
|
15359
15400
|
r.lastUrl = s, r.running = !0;
|
|
15360
15401
|
const n = performance.now();
|
|
15361
|
-
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, s),
|
|
15402
|
+
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, s), Lr.load(s, void 0, {
|
|
15362
15403
|
element: t,
|
|
15363
15404
|
attrPrefix: `${c.prefix}import-`
|
|
15364
15405
|
}).then((a) => {
|
|
@@ -15397,7 +15438,7 @@ const h = class h {
|
|
|
15397
15438
|
e.getChildren().filter((r) => r.getTarget().parentNode !== t).forEach((r) => {
|
|
15398
15439
|
r.remove(!1);
|
|
15399
15440
|
}), t.childNodes.forEach((r) => {
|
|
15400
|
-
const i =
|
|
15441
|
+
const i = N.get(r);
|
|
15401
15442
|
i !== null && i.getParent() !== e && e.pushChild(i);
|
|
15402
15443
|
});
|
|
15403
15444
|
}
|
|
@@ -15422,11 +15463,11 @@ const h = class h {
|
|
|
15422
15463
|
* @returns Promise (スキャンが完了したときに解決される)
|
|
15423
15464
|
*/
|
|
15424
15465
|
static scanElement(e, t) {
|
|
15425
|
-
const r =
|
|
15466
|
+
const r = N.get(e);
|
|
15426
15467
|
if (!r)
|
|
15427
15468
|
return Promise.resolve();
|
|
15428
15469
|
const i = h.initializeElementFragment(r, !1).then(
|
|
15429
|
-
() =>
|
|
15470
|
+
() => D.restoreInitialValues(e)
|
|
15430
15471
|
);
|
|
15431
15472
|
return h.initialValueRestores.add(i), i.then(() => {
|
|
15432
15473
|
h.initialValueRestores.delete(i), t && le.applySubtree(e);
|
|
@@ -15540,7 +15581,7 @@ const h = class h {
|
|
|
15540
15581
|
e.getRawAttribute(s)
|
|
15541
15582
|
))), r.add(s));
|
|
15542
15583
|
}
|
|
15543
|
-
return t.then(() => (e.markInitialized(),
|
|
15584
|
+
return t.then(() => (e.markInitialized(), D.prepareFormName(e)));
|
|
15544
15585
|
}
|
|
15545
15586
|
/**
|
|
15546
15587
|
* 子孫初期化をスキップすべきかどうかを返します。
|
|
@@ -15570,7 +15611,7 @@ const h = class h {
|
|
|
15570
15611
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
15571
15612
|
*/
|
|
15572
15613
|
static setAttribute(e, t, r, i = !1, s) {
|
|
15573
|
-
const n =
|
|
15614
|
+
const n = N.get(e), a = h.getAliasedAttributeName(t);
|
|
15574
15615
|
if (a !== null)
|
|
15575
15616
|
return r === null ? n.removeAliasedAttribute(t, a) : n.setAliasedAttribute(
|
|
15576
15617
|
t,
|
|
@@ -15643,7 +15684,7 @@ const h = class h {
|
|
|
15643
15684
|
break;
|
|
15644
15685
|
case `${c.prefix}validity`:
|
|
15645
15686
|
case `${c.prefix}validity-message`:
|
|
15646
|
-
return r !== null &&
|
|
15687
|
+
return r !== null && D.applyCustomValidity(n), Promise.all(o).then(() => {
|
|
15647
15688
|
});
|
|
15648
15689
|
case `${c.prefix}url-param`: {
|
|
15649
15690
|
const y = n.getAttribute(`${c.prefix}url-arg`), b = Oe.readParams();
|
|
@@ -15703,7 +15744,7 @@ const h = class h {
|
|
|
15703
15744
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
15704
15745
|
*/
|
|
15705
15746
|
static setBindingData(e, t, r = {}) {
|
|
15706
|
-
const i =
|
|
15747
|
+
const i = N.get(e), s = r.skipFragments ?? /* @__PURE__ */ new Set(), n = r.reentrant ?? !1, a = r.reflectToAttribute ?? !0, o = r.kind ?? "supply", l = r.sequence ?? R.nextOperationSequence(), u = {
|
|
15707
15748
|
sequence: l,
|
|
15708
15749
|
kind: o,
|
|
15709
15750
|
...r.editedPaths === void 0 ? {} : { editedPaths: r.editedPaths }
|
|
@@ -15723,23 +15764,23 @@ const h = class h {
|
|
|
15723
15764
|
return e.tagName === "FORM" && (M = M.then(() => {
|
|
15724
15765
|
if (i.wasResetAfter(y))
|
|
15725
15766
|
return;
|
|
15726
|
-
const
|
|
15727
|
-
return
|
|
15767
|
+
const F = i.getRawBindingData() ?? E;
|
|
15768
|
+
return D.syncValues(
|
|
15728
15769
|
i,
|
|
15729
|
-
|
|
15770
|
+
D.resolveSyncValues(i, F),
|
|
15730
15771
|
!1,
|
|
15731
15772
|
u
|
|
15732
15773
|
);
|
|
15733
15774
|
})), M = M.then(
|
|
15734
|
-
() =>
|
|
15775
|
+
() => D.syncAncestorArgForms(i, y, u, b)
|
|
15735
15776
|
), M = M.then(() => h.evaluateAll(i, s)), M = M.then(
|
|
15736
15777
|
() => R.retryUnappliedValueWrites(e, y)
|
|
15737
15778
|
), M = M.then(
|
|
15738
15779
|
() => h.reevaluateReactiveSpecialAttributes(i, s)
|
|
15739
15780
|
), M.then(
|
|
15740
15781
|
() => i.markBindingWorkEnd(),
|
|
15741
|
-
(
|
|
15742
|
-
throw i.markBindingWorkEnd(),
|
|
15782
|
+
(F) => {
|
|
15783
|
+
throw i.markBindingWorkEnd(), F;
|
|
15743
15784
|
}
|
|
15744
15785
|
);
|
|
15745
15786
|
};
|
|
@@ -15812,7 +15853,7 @@ const h = class h {
|
|
|
15812
15853
|
...Object.keys(y)
|
|
15813
15854
|
]);
|
|
15814
15855
|
for (const w of A) {
|
|
15815
|
-
const M = s === "" ? w : `${s}.${w}`,
|
|
15856
|
+
const M = s === "" ? w : `${s}.${w}`, F = h.mergePathAuthority(
|
|
15816
15857
|
e,
|
|
15817
15858
|
Object.prototype.hasOwnProperty.call(d, w) ? d[w] : h.ABSENT_PATH,
|
|
15818
15859
|
Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH,
|
|
@@ -15820,7 +15861,7 @@ const h = class h {
|
|
|
15820
15861
|
M,
|
|
15821
15862
|
n
|
|
15822
15863
|
);
|
|
15823
|
-
|
|
15864
|
+
F !== h.ABSENT_PATH && (b[w] = F), F !== (Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH) && (E = !0);
|
|
15824
15865
|
}
|
|
15825
15866
|
return E ? b : y;
|
|
15826
15867
|
}
|
|
@@ -16018,7 +16059,7 @@ const h = class h {
|
|
|
16018
16059
|
* `resolved: true` のときは解決済みスコープ(常にオブジェクト)。
|
|
16019
16060
|
*/
|
|
16020
16061
|
static getBindingData(e, t = {}) {
|
|
16021
|
-
const r =
|
|
16062
|
+
const r = N.get(e);
|
|
16022
16063
|
return r instanceof R ? t.resolved ? r.getBindingData() : r.getRawBindingData() : null;
|
|
16023
16064
|
}
|
|
16024
16065
|
/**
|
|
@@ -16051,7 +16092,7 @@ const h = class h {
|
|
|
16051
16092
|
* @return 解決済みスコープと各キーの由来情報
|
|
16052
16093
|
*/
|
|
16053
16094
|
static collectScope(e) {
|
|
16054
|
-
const t =
|
|
16095
|
+
const t = N.get(e);
|
|
16055
16096
|
if (!t)
|
|
16056
16097
|
return { resolved: {}, sources: {} };
|
|
16057
16098
|
const r = t.getBindingData(), i = {}, s = (l) => {
|
|
@@ -16100,10 +16141,10 @@ const h = class h {
|
|
|
16100
16141
|
* @returns 追加したノードの走査(評価)の Promise。走査しない場合は解決済みの Promise
|
|
16101
16142
|
*/
|
|
16102
16143
|
static addNode(e, t) {
|
|
16103
|
-
const r =
|
|
16144
|
+
const r = N.get(e);
|
|
16104
16145
|
if (r.isSkipMutationNode(t))
|
|
16105
16146
|
return Promise.resolve();
|
|
16106
|
-
const i =
|
|
16147
|
+
const i = N.get(t.nextSibling), s = N.get(t);
|
|
16107
16148
|
if (s) {
|
|
16108
16149
|
if (s.getParent() === r)
|
|
16109
16150
|
return Promise.resolve();
|
|
@@ -16120,7 +16161,7 @@ const h = class h {
|
|
|
16120
16161
|
* @param node 削除するノード
|
|
16121
16162
|
*/
|
|
16122
16163
|
static removeNode(e) {
|
|
16123
|
-
const t =
|
|
16164
|
+
const t = N.get(e);
|
|
16124
16165
|
if (t) {
|
|
16125
16166
|
const r = t.getParent();
|
|
16126
16167
|
if (r && r.isSkipMutationNode(e))
|
|
@@ -16139,7 +16180,7 @@ const h = class h {
|
|
|
16139
16180
|
* @param text 新しいテキスト
|
|
16140
16181
|
*/
|
|
16141
16182
|
static changeText(e, t) {
|
|
16142
|
-
const r =
|
|
16183
|
+
const r = N.get(e);
|
|
16143
16184
|
r && r.setContent(t);
|
|
16144
16185
|
}
|
|
16145
16186
|
/**
|
|
@@ -16151,27 +16192,27 @@ const h = class h {
|
|
|
16151
16192
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
16152
16193
|
*/
|
|
16153
16194
|
static changeValue(e, t) {
|
|
16154
|
-
const r =
|
|
16195
|
+
const r = N.get(e);
|
|
16155
16196
|
if (r.getValue() === t)
|
|
16156
16197
|
return Promise.resolve();
|
|
16157
16198
|
const i = [];
|
|
16158
16199
|
i.push(r.setValue(t));
|
|
16159
16200
|
const s = h.getFormFragment(r);
|
|
16160
16201
|
if (s) {
|
|
16161
|
-
const n =
|
|
16202
|
+
const n = D.getValues(s), a = s.getAttribute(`${c.prefix}form-arg`), o = s.getRawBindingData();
|
|
16162
16203
|
let l;
|
|
16163
16204
|
if (a) {
|
|
16164
16205
|
l = { ...o ?? {} };
|
|
16165
|
-
const u = String(a), d =
|
|
16166
|
-
l[u] =
|
|
16206
|
+
const u = String(a), d = D.resolveAncestorArgOwner(s, u);
|
|
16207
|
+
l[u] = D.mergeCollectedValues(
|
|
16167
16208
|
(d ? d.value : l[u]) ?? null,
|
|
16168
16209
|
n
|
|
16169
16210
|
);
|
|
16170
16211
|
} else
|
|
16171
|
-
l =
|
|
16212
|
+
l = D.mergeCollectedValues(
|
|
16172
16213
|
o,
|
|
16173
16214
|
n,
|
|
16174
|
-
|
|
16215
|
+
D.ancestorBaseResolver(s)
|
|
16175
16216
|
);
|
|
16176
16217
|
i.push(
|
|
16177
16218
|
// 値の設定に伴うコミットなので、値の供給ではない更新として扱う(権威を
|
|
@@ -16584,7 +16625,7 @@ const h = class h {
|
|
|
16584
16625
|
* @param target data-each コンテナ要素
|
|
16585
16626
|
*/
|
|
16586
16627
|
static runEachRenderedScript(e) {
|
|
16587
|
-
const t = `${c.prefix}each-rendered-run`, r =
|
|
16628
|
+
const t = `${c.prefix}each-rendered-run`, r = N.get(e);
|
|
16588
16629
|
if (r === null || !oe.declared(r, t))
|
|
16589
16630
|
return;
|
|
16590
16631
|
if (oe.applies(r, t)) {
|
|
@@ -16711,10 +16752,10 @@ ${i}
|
|
|
16711
16752
|
(l) => !l.hasAttribute(`${c.prefix}each-before`) && !l.hasAttribute(`${c.prefix}each-after`)
|
|
16712
16753
|
).forEach((l) => {
|
|
16713
16754
|
if (!n) {
|
|
16714
|
-
const d =
|
|
16755
|
+
const d = N.get(l);
|
|
16715
16756
|
d instanceof R && (r = d.clone(), h.markFreshInitializationSkippable(r), e.setTemplate(r), n = !0);
|
|
16716
16757
|
}
|
|
16717
|
-
const u =
|
|
16758
|
+
const u = N.get(l);
|
|
16718
16759
|
u instanceof R && e.getChildren().includes(u) && (e.removeChild(u), u.setMounted(!1)), l.parentNode && l.parentNode.removeChild(l);
|
|
16719
16760
|
});
|
|
16720
16761
|
}
|
|
@@ -17014,7 +17055,7 @@ ${i}
|
|
|
17014
17055
|
const e = `${c.prefix}url-param`, r = Array.from(
|
|
17015
17056
|
document.querySelectorAll(`[${e}]`)
|
|
17016
17057
|
).map((i) => {
|
|
17017
|
-
const s =
|
|
17058
|
+
const s = N.peek(i);
|
|
17018
17059
|
return s instanceof R ? h.setAttribute(
|
|
17019
17060
|
i,
|
|
17020
17061
|
e,
|
|
@@ -17230,53 +17271,53 @@ ${i}
|
|
|
17230
17271
|
let i = e.getAttribute(`${c.prefix}each-index`);
|
|
17231
17272
|
i && (i = String(i));
|
|
17232
17273
|
const s = e.getAttribute(`${c.prefix}each-key`), n = e.getAttribute(`${c.prefix}each-arg`), a = t.map(
|
|
17233
|
-
(
|
|
17274
|
+
(C, Z) => h.createListKey(C, s ? String(s) : null, Z)
|
|
17234
17275
|
), o = new Set(a), l = /* @__PURE__ */ new Map();
|
|
17235
|
-
a.forEach((
|
|
17236
|
-
l.set(
|
|
17276
|
+
a.forEach((C) => {
|
|
17277
|
+
l.set(C, (l.get(C) ?? 0) + 1);
|
|
17237
17278
|
}), s && o.size !== a.length && h.warnDuplicateEachKey(String(s));
|
|
17238
17279
|
const u = [];
|
|
17239
|
-
let d = e.getChildren().filter((
|
|
17240
|
-
(
|
|
17280
|
+
let d = e.getChildren().filter((C) => C instanceof R).filter(
|
|
17281
|
+
(C) => !C.hasAttribute(`${c.prefix}each-before`) && !C.hasAttribute(`${c.prefix}each-after`)
|
|
17241
17282
|
);
|
|
17242
|
-
const y = d.map((
|
|
17243
|
-
d = d.filter((
|
|
17244
|
-
const ee = String(
|
|
17283
|
+
const y = d.map((C) => C.getListKey()), b = /* @__PURE__ */ new Set();
|
|
17284
|
+
d = d.filter((C, Z) => {
|
|
17285
|
+
const ee = String(C.getListKey()), ne = l.get(ee) ?? 0;
|
|
17245
17286
|
if (ne === 0) {
|
|
17246
|
-
b.add(
|
|
17247
|
-
const K =
|
|
17248
|
-
return K !== null && O.rowRemove(
|
|
17287
|
+
b.add(C);
|
|
17288
|
+
const K = C.getListKey();
|
|
17289
|
+
return K !== null && O.rowRemove(C.getTarget(), K, Z), u.push(C.remove()), !1;
|
|
17249
17290
|
}
|
|
17250
17291
|
return l.set(ee, ne - 1), !0;
|
|
17251
17292
|
});
|
|
17252
|
-
const E = d.map((
|
|
17253
|
-
d.forEach((
|
|
17254
|
-
const Z =
|
|
17293
|
+
const E = d.map((C) => C.getListKey()), A = /* @__PURE__ */ new Map();
|
|
17294
|
+
d.forEach((C) => {
|
|
17295
|
+
const Z = C.getListKey();
|
|
17255
17296
|
if (Z === null)
|
|
17256
17297
|
return;
|
|
17257
17298
|
const ee = A.get(Z);
|
|
17258
|
-
ee ? ee.push(
|
|
17299
|
+
ee ? ee.push(C) : A.set(Z, [C]);
|
|
17259
17300
|
});
|
|
17260
|
-
const w = e.getChildElementFragments().filter((
|
|
17261
|
-
(
|
|
17301
|
+
const w = e.getChildElementFragments().filter((C) => !b.has(C)), M = w.filter(
|
|
17302
|
+
(C) => C.hasAttribute(`${c.prefix}each-before`)
|
|
17262
17303
|
).length;
|
|
17263
|
-
let
|
|
17304
|
+
let F = Promise.resolve();
|
|
17264
17305
|
const se = [];
|
|
17265
|
-
return a.forEach((
|
|
17306
|
+
return a.forEach((C, Z) => {
|
|
17266
17307
|
const ee = t[Z], ne = Z;
|
|
17267
17308
|
let K;
|
|
17268
|
-
const ae = A.get(
|
|
17309
|
+
const ae = A.get(C)?.shift();
|
|
17269
17310
|
if (ae) {
|
|
17270
17311
|
K = ae;
|
|
17271
17312
|
const j = M + Z;
|
|
17272
|
-
|
|
17313
|
+
F = F.then(
|
|
17273
17314
|
() => h.updateRowFragment(
|
|
17274
17315
|
K,
|
|
17275
17316
|
ee,
|
|
17276
17317
|
i,
|
|
17277
17318
|
ne,
|
|
17278
17319
|
n ? String(n) : null,
|
|
17279
|
-
|
|
17320
|
+
C
|
|
17280
17321
|
).then(
|
|
17281
17322
|
(k) => (
|
|
17282
17323
|
// 再利用行も新しい並び順の位置へ移動する。移動しないと、配列を並べ替え
|
|
@@ -17290,7 +17331,7 @@ ${i}
|
|
|
17290
17331
|
).then((B) => {
|
|
17291
17332
|
B !== null && O.rowMove(
|
|
17292
17333
|
K.getTarget(),
|
|
17293
|
-
|
|
17334
|
+
C,
|
|
17294
17335
|
B - M,
|
|
17295
17336
|
Z
|
|
17296
17337
|
), !(!k && h.isRowLocalEachTemplate(e)) && se.push(
|
|
@@ -17306,30 +17347,30 @@ ${i}
|
|
|
17306
17347
|
} else {
|
|
17307
17348
|
K = r.clone();
|
|
17308
17349
|
const j = M + Z;
|
|
17309
|
-
|
|
17350
|
+
F = F.then(
|
|
17310
17351
|
() => h.updateRowFragment(
|
|
17311
17352
|
K,
|
|
17312
17353
|
ee,
|
|
17313
17354
|
i,
|
|
17314
17355
|
ne,
|
|
17315
17356
|
n ? String(n) : null,
|
|
17316
|
-
|
|
17357
|
+
C
|
|
17317
17358
|
).then(() => {
|
|
17318
17359
|
const k = w[j] ?? null;
|
|
17319
17360
|
return e.insertBefore(K, k).then(() => {
|
|
17320
17361
|
w.splice(j, 0, K);
|
|
17321
17362
|
}).then(() => h.initializeFreshEachRow(K)).then(() => h.applyRowFormValues(e, K, ee)).then(() => {
|
|
17322
|
-
O.rowAdd(K.getTarget(),
|
|
17363
|
+
O.rowAdd(K.getTarget(), C, ne, ee);
|
|
17323
17364
|
});
|
|
17324
17365
|
})
|
|
17325
17366
|
);
|
|
17326
17367
|
}
|
|
17327
|
-
}), Promise.all(u).then(() =>
|
|
17328
|
-
const
|
|
17368
|
+
}), Promise.all(u).then(() => F).then(() => Promise.all(se)).then(() => {
|
|
17369
|
+
const C = a.filter(
|
|
17329
17370
|
(j) => j !== null
|
|
17330
17371
|
), Z = E.filter(
|
|
17331
17372
|
(j) => j !== null
|
|
17332
|
-
), ee = new Set(Z), ne =
|
|
17373
|
+
), ee = new Set(Z), ne = C.filter((j) => !ee.has(j)), ae = y.filter(
|
|
17333
17374
|
(j) => j !== null
|
|
17334
17375
|
).filter(
|
|
17335
17376
|
(j) => !o.has(j)
|
|
@@ -17338,7 +17379,7 @@ ${i}
|
|
|
17338
17379
|
e.getTarget(),
|
|
17339
17380
|
ne,
|
|
17340
17381
|
ae,
|
|
17341
|
-
|
|
17382
|
+
C
|
|
17342
17383
|
);
|
|
17343
17384
|
});
|
|
17344
17385
|
}
|
|
@@ -17441,7 +17482,7 @@ ${i}
|
|
|
17441
17482
|
* @returns 反映完了の Promise
|
|
17442
17483
|
*/
|
|
17443
17484
|
static applyRowFormValues(e, t, r) {
|
|
17444
|
-
return !e.hasAttribute(`${c.prefix}form-list`) || !
|
|
17485
|
+
return !e.hasAttribute(`${c.prefix}form-list`) || !D.isCollectedListFromEachSource(e) || typeof r != "object" || r === null || Array.isArray(r) ? Promise.resolve() : D.syncRowValues(t, r);
|
|
17445
17486
|
}
|
|
17446
17487
|
/**
|
|
17447
17488
|
* リスト比較用のキーを生成します。
|
|
@@ -17638,7 +17679,7 @@ const be = class be {
|
|
|
17638
17679
|
*/
|
|
17639
17680
|
constructor(e = document) {
|
|
17640
17681
|
this.customEventHandlers = /* @__PURE__ */ new Map(), this.builtinListenersAdded = !1, this.deferred = !1, this.deferredProcedures = [], this.onClick = (t) => this.delegate(t, "click"), this.onReset = (t) => {
|
|
17641
|
-
if (t.defaultPrevented ||
|
|
17682
|
+
if (t.defaultPrevented || D.isResettingInternally())
|
|
17642
17683
|
return;
|
|
17643
17684
|
const r = t.target;
|
|
17644
17685
|
r instanceof HTMLElement && setTimeout(() => le.refreshSubtree(r), 0);
|
|
@@ -17663,7 +17704,7 @@ const be = class be {
|
|
|
17663
17704
|
* @returns 戻り値はない。
|
|
17664
17705
|
*/
|
|
17665
17706
|
runWindowLoadProcedure() {
|
|
17666
|
-
const e = document.documentElement, t =
|
|
17707
|
+
const e = document.documentElement, t = N.get(e);
|
|
17667
17708
|
t && new he(t, "load").run();
|
|
17668
17709
|
}
|
|
17669
17710
|
/**
|
|
@@ -17787,7 +17828,7 @@ const be = class be {
|
|
|
17787
17828
|
this.root.querySelectorAll(`[${this.onAttributeName}]`).forEach((i) => {
|
|
17788
17829
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
17789
17830
|
return;
|
|
17790
|
-
const s =
|
|
17831
|
+
const s = N.get(i);
|
|
17791
17832
|
s instanceof R && this.isFromTarget(s, t) && new he(s, "on", t).run().catch((n) => {
|
|
17792
17833
|
m.error("[Haori]", "Procedure execution error:", n);
|
|
17793
17834
|
});
|
|
@@ -17871,7 +17912,7 @@ const be = class be {
|
|
|
17871
17912
|
* @returns 戻り値はない。
|
|
17872
17913
|
*/
|
|
17873
17914
|
runProcedureFor(e, t, r) {
|
|
17874
|
-
const i =
|
|
17915
|
+
const i = N.get(e);
|
|
17875
17916
|
if (!i)
|
|
17876
17917
|
return;
|
|
17877
17918
|
(t === "change" || t === "input") && this.syncUserEdit(e, t === "change");
|
|
@@ -17936,7 +17977,7 @@ const be = class be {
|
|
|
17936
17977
|
* @returns 戻り値はない。
|
|
17937
17978
|
*/
|
|
17938
17979
|
markUserEditOnly(e) {
|
|
17939
|
-
const t =
|
|
17980
|
+
const t = N.get(e);
|
|
17940
17981
|
t instanceof R && t.markUserEdit();
|
|
17941
17982
|
}
|
|
17942
17983
|
/**
|
|
@@ -17960,7 +18001,7 @@ const be = class be {
|
|
|
17960
18001
|
* @returns 印を付けた場合 true。フラグメントがまだ無い場合 false
|
|
17961
18002
|
*/
|
|
17962
18003
|
markUserEditDuringInit(e, t) {
|
|
17963
|
-
const r =
|
|
18004
|
+
const r = N.peek(e);
|
|
17964
18005
|
return r instanceof R ? t ? (r.markUserEditOnDeferredChange(), be.radioGroupMembers(e).forEach(
|
|
17965
18006
|
(i) => i.markUserEdit()
|
|
17966
18007
|
), !0) : (r.markUserEdit(), !0) : !1;
|
|
@@ -17979,7 +18020,7 @@ const be = class be {
|
|
|
17979
18020
|
for (const r of Array.from(document.getElementsByName(e.name))) {
|
|
17980
18021
|
if (r === e || !(r instanceof HTMLInputElement) || r.type !== "radio" || r.form !== e.form)
|
|
17981
18022
|
continue;
|
|
17982
|
-
const i =
|
|
18023
|
+
const i = N.get(r);
|
|
17983
18024
|
i instanceof R && t.push(i);
|
|
17984
18025
|
}
|
|
17985
18026
|
return t;
|
|
@@ -17997,7 +18038,7 @@ const be = class be {
|
|
|
17997
18038
|
* @returns 戻り値はない。
|
|
17998
18039
|
*/
|
|
17999
18040
|
syncUserEdit(e, t) {
|
|
18000
|
-
const r =
|
|
18041
|
+
const r = N.get(e);
|
|
18001
18042
|
r instanceof R && (r.syncValue(), t ? r.markUserEditOnChange() : r.markUserEdit(), be.radioGroupMembers(e).forEach((i) => {
|
|
18002
18043
|
i.syncValue(), i.markUserEdit();
|
|
18003
18044
|
}));
|
|
@@ -18033,14 +18074,16 @@ const be = class be {
|
|
|
18033
18074
|
* @returns 処理対象要素。見つからない場合は null
|
|
18034
18075
|
*/
|
|
18035
18076
|
findClickableElement(e) {
|
|
18036
|
-
const t = `${c.prefix}click-`, r = `${c.prefix}click-passive`;
|
|
18037
|
-
let
|
|
18038
|
-
for (;
|
|
18039
|
-
if (
|
|
18040
|
-
|
|
18041
|
-
|
|
18077
|
+
const t = `${c.prefix}click-`, r = `${c.prefix}click-passive`, i = `${c.prefix}click-lock`;
|
|
18078
|
+
let s = e;
|
|
18079
|
+
for (; s; ) {
|
|
18080
|
+
if (s.getAttributeNames().some(
|
|
18081
|
+
(a) => a.startsWith(t) && a !== r && a !== i
|
|
18082
|
+
))
|
|
18083
|
+
return s;
|
|
18084
|
+
if (s.hasAttribute(r))
|
|
18042
18085
|
return null;
|
|
18043
|
-
|
|
18086
|
+
s = s.parentElement;
|
|
18044
18087
|
}
|
|
18045
18088
|
return null;
|
|
18046
18089
|
}
|
|
@@ -18090,7 +18133,7 @@ const q = class q {
|
|
|
18090
18133
|
* @returns 戻り値はありません。
|
|
18091
18134
|
*/
|
|
18092
18135
|
static syncElement(e) {
|
|
18093
|
-
const t = q.registrations.get(e), r =
|
|
18136
|
+
const t = q.registrations.get(e), r = N.get(e);
|
|
18094
18137
|
if (!r || !q.shouldObserve(r)) {
|
|
18095
18138
|
t && (t.observer.disconnect(), q.registrations.delete(e));
|
|
18096
18139
|
return;
|
|
@@ -18275,7 +18318,7 @@ const S = class S {
|
|
|
18275
18318
|
const t = S.registrations.get(e);
|
|
18276
18319
|
if (!t && !S.hasPollAttribute(e))
|
|
18277
18320
|
return;
|
|
18278
|
-
const r =
|
|
18321
|
+
const r = N.get(e);
|
|
18279
18322
|
if (!(r instanceof R) || !S.shouldObserve(r)) {
|
|
18280
18323
|
t && S.teardown(e, t);
|
|
18281
18324
|
return;
|
|
@@ -18628,7 +18671,7 @@ const S = class S {
|
|
|
18628
18671
|
return s.forEach((a) => {
|
|
18629
18672
|
if (!a.isConnected)
|
|
18630
18673
|
return;
|
|
18631
|
-
const o =
|
|
18674
|
+
const o = N.get(a);
|
|
18632
18675
|
o instanceof R && n.push(o);
|
|
18633
18676
|
}), n;
|
|
18634
18677
|
}
|
|
@@ -18777,9 +18820,9 @@ S.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
18777
18820
|
"state"
|
|
18778
18821
|
]), S.DEFAULT_INTERVAL_MS = 5e3, S.MIN_INTERVAL_MS = 100, S.registrations = /* @__PURE__ */ new Map(), S.visibilityListener = null;
|
|
18779
18822
|
let $e = S;
|
|
18780
|
-
const
|
|
18781
|
-
function
|
|
18782
|
-
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() =>
|
|
18823
|
+
const Or = "0.69.0";
|
|
18824
|
+
function Br(p) {
|
|
18825
|
+
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => p()) : Promise.resolve().then(p);
|
|
18783
18826
|
}
|
|
18784
18827
|
const L = class L {
|
|
18785
18828
|
/**
|
|
@@ -18811,7 +18854,7 @@ const L = class L {
|
|
|
18811
18854
|
* @param element 対象要素
|
|
18812
18855
|
*/
|
|
18813
18856
|
static syncElement(e) {
|
|
18814
|
-
const t = L.registrations.get(e), r =
|
|
18857
|
+
const t = L.registrations.get(e), r = N.get(e);
|
|
18815
18858
|
if (!(r instanceof R) || !L.shouldObserve(r)) {
|
|
18816
18859
|
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
18817
18860
|
return;
|
|
@@ -18960,7 +19003,7 @@ const L = class L {
|
|
|
18960
19003
|
* @param registration 対象の登録
|
|
18961
19004
|
*/
|
|
18962
19005
|
static scheduleCompute(e) {
|
|
18963
|
-
e.scheduled || (e.scheduled = !0,
|
|
19006
|
+
e.scheduled || (e.scheduled = !0, Br(() => {
|
|
18964
19007
|
e.scheduled = !1;
|
|
18965
19008
|
const t = e.fragment.getTarget();
|
|
18966
19009
|
L.registrations.get(t) === e && L.computeAndPublish(e);
|
|
@@ -19096,7 +19139,7 @@ const H = class H {
|
|
|
19096
19139
|
} finally {
|
|
19097
19140
|
H._initialIntakes = null, e.release();
|
|
19098
19141
|
}
|
|
19099
|
-
O.ready(
|
|
19142
|
+
O.ready(Or);
|
|
19100
19143
|
}
|
|
19101
19144
|
/**
|
|
19102
19145
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -19358,22 +19401,22 @@ const H = class H {
|
|
|
19358
19401
|
};
|
|
19359
19402
|
H._initialized = !1, H._mutationObservers = [], H._dispatcher = null, H._initialIntakes = null;
|
|
19360
19403
|
let He = H;
|
|
19361
|
-
le.setMutationCapture((
|
|
19404
|
+
le.setMutationCapture((p) => He.captureMutations(p));
|
|
19362
19405
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", He.init) : He.init();
|
|
19363
|
-
const
|
|
19406
|
+
const Ur = () => De.waitForRenders(), Hr = De.enhancers, Vr = De.handlers;
|
|
19364
19407
|
export {
|
|
19365
19408
|
$ as Core,
|
|
19366
19409
|
le as Enhance,
|
|
19367
19410
|
c as Env,
|
|
19368
|
-
|
|
19369
|
-
|
|
19370
|
-
|
|
19411
|
+
D as Form,
|
|
19412
|
+
N as Fragment,
|
|
19413
|
+
De as Haori,
|
|
19371
19414
|
m as Log,
|
|
19372
19415
|
J as Queue,
|
|
19373
|
-
|
|
19374
|
-
|
|
19375
|
-
|
|
19376
|
-
|
|
19377
|
-
|
|
19416
|
+
De as default,
|
|
19417
|
+
Hr as enhancers,
|
|
19418
|
+
Vr as handlers,
|
|
19419
|
+
Or as version,
|
|
19420
|
+
Ur as waitForRenders
|
|
19378
19421
|
};
|
|
19379
19422
|
//# sourceMappingURL=haori.es.js.map
|