haori 0.66.0 → 0.68.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 +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +14 -14
- package/dist/haori.es.js +568 -346
- package/dist/haori.iife.js +15 -15
- package/dist/index.d.ts +101 -3
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -34,7 +34,7 @@ const rt = "embedded";
|
|
|
34
34
|
function It(f) {
|
|
35
35
|
return f === "embedded" || f === "demo";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function rr(f) {
|
|
38
38
|
return f === null ? null : It(f) ? f : rt;
|
|
39
39
|
}
|
|
40
40
|
function dt(f) {
|
|
@@ -112,7 +112,7 @@ const te = class te {
|
|
|
112
112
|
if (e instanceof HTMLScriptElement) {
|
|
113
113
|
const r = e.getAttribute("data-prefix") || te._prefix;
|
|
114
114
|
te._prefix = r.endsWith("-") ? r : r + "-";
|
|
115
|
-
const i =
|
|
115
|
+
const i = rr(
|
|
116
116
|
e.getAttribute("data-runtime")
|
|
117
117
|
);
|
|
118
118
|
i !== null && (te._runtime = i), te._strictBind = e.hasAttribute(
|
|
@@ -179,7 +179,7 @@ class m {
|
|
|
179
179
|
console.error(e, ...t);
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
|
-
const
|
|
182
|
+
const ir = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:", I = class I {
|
|
183
183
|
/**
|
|
184
184
|
* 外部ライブラリ連携を登録します。
|
|
185
185
|
*
|
|
@@ -398,7 +398,7 @@ const rr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
398
398
|
* @returns 解決した値。解決できない場合は null
|
|
399
399
|
*/
|
|
400
400
|
static resolveGlobal(e) {
|
|
401
|
-
if (!
|
|
401
|
+
if (!ir.test(e))
|
|
402
402
|
return m.error(
|
|
403
403
|
"[Haori]",
|
|
404
404
|
`${c.prefix}enhance-new accepts a dot-separated global reference only: ${e}`
|
|
@@ -452,25 +452,25 @@ const rr = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ht = "new:
|
|
|
452
452
|
};
|
|
453
453
|
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
454
|
let le = I;
|
|
455
|
-
const Ft = "yyyy/MM/dd HH:mm",
|
|
456
|
-
function
|
|
455
|
+
const Ft = "yyyy/MM/dd HH:mm", sr = "en-US", ft = 1e4;
|
|
456
|
+
function me(f) {
|
|
457
457
|
return String(f).padStart(2, "0");
|
|
458
458
|
}
|
|
459
459
|
function Ct(f, e, t, r, i, s) {
|
|
460
460
|
return {
|
|
461
461
|
yyyy: String(f).padStart(4, "0"),
|
|
462
|
-
yy:
|
|
463
|
-
MM:
|
|
462
|
+
yy: me(f % 100),
|
|
463
|
+
MM: me(e),
|
|
464
464
|
M: String(e),
|
|
465
|
-
dd:
|
|
465
|
+
dd: me(t),
|
|
466
466
|
d: String(t),
|
|
467
|
-
HH:
|
|
467
|
+
HH: me(r),
|
|
468
468
|
H: String(r),
|
|
469
|
-
mm:
|
|
470
|
-
ss:
|
|
469
|
+
mm: me(i),
|
|
470
|
+
ss: me(s)
|
|
471
471
|
};
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function Mt(f, e) {
|
|
474
474
|
let t;
|
|
475
475
|
try {
|
|
476
476
|
t = new Intl.DateTimeFormat("en-US", {
|
|
@@ -500,7 +500,7 @@ function Ze(f, e = Ft, t) {
|
|
|
500
500
|
return "";
|
|
501
501
|
let i;
|
|
502
502
|
if (typeof t == "string" && t.trim() !== "") {
|
|
503
|
-
if (i =
|
|
503
|
+
if (i = Mt(r, t.trim()), i === null)
|
|
504
504
|
return "";
|
|
505
505
|
} else
|
|
506
506
|
i = Ct(
|
|
@@ -517,15 +517,15 @@ function Ze(f, e = Ft, t) {
|
|
|
517
517
|
(n, a) => a !== void 0 ? a === "" ? "'" : a : s[n]
|
|
518
518
|
);
|
|
519
519
|
}
|
|
520
|
-
const
|
|
521
|
-
function
|
|
520
|
+
const nr = "yyyy-MM-dd";
|
|
521
|
+
function $t(f = Ft, e) {
|
|
522
522
|
return Ze(/* @__PURE__ */ new Date(), f, e);
|
|
523
523
|
}
|
|
524
|
-
function Pt(f = 0, e =
|
|
524
|
+
function Pt(f = 0, e = nr, t) {
|
|
525
525
|
const r = Number.isFinite(f) ? Math.trunc(f) : 0, i = typeof t == "string" && t.trim() !== "" ? t.trim() : "";
|
|
526
526
|
let s, n, a;
|
|
527
527
|
if (i !== "") {
|
|
528
|
-
const l =
|
|
528
|
+
const l = Mt(/* @__PURE__ */ new Date(), i);
|
|
529
529
|
if (l === null)
|
|
530
530
|
return "";
|
|
531
531
|
s = Number(l.yyyy), n = Number(l.MM), a = Number(l.dd);
|
|
@@ -555,7 +555,7 @@ function Lt(f, e) {
|
|
|
555
555
|
const i = Math.max(0, Math.trunc(e));
|
|
556
556
|
r.minimumFractionDigits = i, r.maximumFractionDigits = i;
|
|
557
557
|
}
|
|
558
|
-
return new Intl.NumberFormat(
|
|
558
|
+
return new Intl.NumberFormat(sr, r).format(t);
|
|
559
559
|
}
|
|
560
560
|
function Ot(f, e, t) {
|
|
561
561
|
let r, i, s;
|
|
@@ -608,7 +608,7 @@ function Bt(f, e, t = {}) {
|
|
|
608
608
|
}
|
|
609
609
|
return l;
|
|
610
610
|
}
|
|
611
|
-
const
|
|
611
|
+
const ar = /^(\d{4})-(\d{1,2})$/, or = 1200;
|
|
612
612
|
function qe(f, e) {
|
|
613
613
|
const t = Number(f);
|
|
614
614
|
return Number.isFinite(t) ? Math.trunc(t) : e;
|
|
@@ -616,29 +616,29 @@ function qe(f, e) {
|
|
|
616
616
|
function Qe(f, e) {
|
|
617
617
|
if (typeof f != "string")
|
|
618
618
|
return "";
|
|
619
|
-
const t =
|
|
619
|
+
const t = ar.exec(f.trim());
|
|
620
620
|
if (!t)
|
|
621
621
|
return "";
|
|
622
622
|
const r = Number(t[1]), i = Number(t[2]);
|
|
623
623
|
if (i < 1 || i > 12)
|
|
624
624
|
return "";
|
|
625
625
|
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
|
-
return `${String(a).padStart(4, "0")}-${
|
|
626
|
+
return `${String(a).padStart(4, "0")}-${me(o)}`;
|
|
627
627
|
}
|
|
628
|
-
function
|
|
628
|
+
function lr(f) {
|
|
629
629
|
if (typeof f == "string" && f.trim() !== "")
|
|
630
630
|
return Qe(f, 0);
|
|
631
631
|
const e = /* @__PURE__ */ new Date();
|
|
632
|
-
return `${String(e.getFullYear()).padStart(4, "0")}-${
|
|
632
|
+
return `${String(e.getFullYear()).padStart(4, "0")}-${me(e.getMonth() + 1)}`;
|
|
633
633
|
}
|
|
634
634
|
function Ut(f, e) {
|
|
635
635
|
const t = Math.trunc(Number(f));
|
|
636
636
|
if (!Number.isFinite(t) || t < 0)
|
|
637
637
|
return [];
|
|
638
|
-
const r =
|
|
638
|
+
const r = lr(e);
|
|
639
639
|
if (r === "")
|
|
640
640
|
return [];
|
|
641
|
-
const i = Math.min(t,
|
|
641
|
+
const i = Math.min(t, or), s = [];
|
|
642
642
|
for (let n = 0; n <= i; n += 1) {
|
|
643
643
|
const a = Qe(r, -n);
|
|
644
644
|
s.push({ targetMonth: a, label: a.replace(/-/g, "/") });
|
|
@@ -711,9 +711,9 @@ function Kt(f, e) {
|
|
|
711
711
|
}
|
|
712
712
|
return r;
|
|
713
713
|
}
|
|
714
|
-
const
|
|
714
|
+
const cr = Object.freeze({
|
|
715
715
|
date: Ze,
|
|
716
|
-
now:
|
|
716
|
+
now: $t,
|
|
717
717
|
today: Pt,
|
|
718
718
|
number: Lt,
|
|
719
719
|
pages: Bt,
|
|
@@ -1018,7 +1018,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
1018
1018
|
"encodeURIComponent",
|
|
1019
1019
|
"decodeURI",
|
|
1020
1020
|
"decodeURIComponent"
|
|
1021
|
-
]),
|
|
1021
|
+
]), ur = [
|
|
1022
1022
|
">>>",
|
|
1023
1023
|
"===",
|
|
1024
1024
|
"!==",
|
|
@@ -1055,7 +1055,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
1055
1055
|
"!",
|
|
1056
1056
|
"<",
|
|
1057
1057
|
">"
|
|
1058
|
-
],
|
|
1058
|
+
], dr = {
|
|
1059
1059
|
"==": 1,
|
|
1060
1060
|
"!=": 1,
|
|
1061
1061
|
"===": 1,
|
|
@@ -1072,7 +1072,7 @@ const zt = /* @__PURE__ */ new Set([
|
|
|
1072
1072
|
"*": 5,
|
|
1073
1073
|
"/": 5,
|
|
1074
1074
|
"%": 5
|
|
1075
|
-
},
|
|
1075
|
+
}, hr = /* @__PURE__ */ new Set([
|
|
1076
1076
|
"undefined",
|
|
1077
1077
|
"NaN",
|
|
1078
1078
|
"Infinity"
|
|
@@ -1081,7 +1081,7 @@ function et(f) {
|
|
|
1081
1081
|
return f === `
|
|
1082
1082
|
` || f === "\r" || f === "\u2028" || f === "\u2029";
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1084
|
+
function fr(f) {
|
|
1085
1085
|
return /[A-Za-z_$]/.test(f);
|
|
1086
1086
|
}
|
|
1087
1087
|
function pt(f) {
|
|
@@ -1113,7 +1113,7 @@ const X = {
|
|
|
1113
1113
|
unaryExponent: "Unary operator used immediately before exponentiation expression",
|
|
1114
1114
|
invalidUpdate: "Invalid left-hand side expression in update operation"
|
|
1115
1115
|
};
|
|
1116
|
-
class
|
|
1116
|
+
class pr {
|
|
1117
1117
|
/**
|
|
1118
1118
|
* @param source 式の文字列
|
|
1119
1119
|
*/
|
|
@@ -1144,7 +1144,7 @@ class fr {
|
|
|
1144
1144
|
return this.readNumber(r, t);
|
|
1145
1145
|
if (i === '"' || i === "'")
|
|
1146
1146
|
return this.readString(r, t);
|
|
1147
|
-
if (
|
|
1147
|
+
if (fr(i)) {
|
|
1148
1148
|
let n = r + 1;
|
|
1149
1149
|
for (; pt(e[n]); )
|
|
1150
1150
|
n += 1;
|
|
@@ -1158,7 +1158,7 @@ class fr {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
if (i === "/" && (s === "/" || s === "*"))
|
|
1160
1160
|
throw Y(X.comment, r);
|
|
1161
|
-
for (const n of
|
|
1161
|
+
for (const n of ur)
|
|
1162
1162
|
if (e.startsWith(n, r))
|
|
1163
1163
|
return this.position = r + n.length, {
|
|
1164
1164
|
type: "punct",
|
|
@@ -1409,12 +1409,12 @@ class fr {
|
|
|
1409
1409
|
};
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
|
-
class
|
|
1412
|
+
class gr {
|
|
1413
1413
|
/**
|
|
1414
1414
|
* @param source 式の文字列
|
|
1415
1415
|
*/
|
|
1416
1416
|
constructor(e) {
|
|
1417
|
-
this.lastEnd = 0, this.lexer = new
|
|
1417
|
+
this.lastEnd = 0, this.lexer = new pr(e), this.token = this.lexer.lex();
|
|
1418
1418
|
}
|
|
1419
1419
|
/**
|
|
1420
1420
|
* 式全体を解析します。
|
|
@@ -1795,7 +1795,7 @@ class pr {
|
|
|
1795
1795
|
const t = this.token.start;
|
|
1796
1796
|
let r = this.parseExponent();
|
|
1797
1797
|
for (; ; ) {
|
|
1798
|
-
const i = this.token, s = i.type === "punct" ?
|
|
1798
|
+
const i = this.token, s = i.type === "punct" ? dr[i.value] : void 0;
|
|
1799
1799
|
if (s === void 0 || s < e)
|
|
1800
1800
|
return r;
|
|
1801
1801
|
this.advance();
|
|
@@ -1891,7 +1891,7 @@ class pr {
|
|
|
1891
1891
|
return !0;
|
|
1892
1892
|
switch (e.type) {
|
|
1893
1893
|
case "Identifier":
|
|
1894
|
-
return !
|
|
1894
|
+
return !hr.has(e.name);
|
|
1895
1895
|
case "Member":
|
|
1896
1896
|
case "Call":
|
|
1897
1897
|
return !0;
|
|
@@ -2108,8 +2108,8 @@ class pr {
|
|
|
2108
2108
|
throw this.unexpected();
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2112
|
-
return new
|
|
2111
|
+
function mr(f) {
|
|
2112
|
+
return new gr(f).parseProgram();
|
|
2113
2113
|
}
|
|
2114
2114
|
class Xt extends ReferenceError {
|
|
2115
2115
|
/**
|
|
@@ -2131,7 +2131,7 @@ function yt(f) {
|
|
|
2131
2131
|
const e = typeof f == "symbol" ? f : String(f);
|
|
2132
2132
|
return ze.has(e) ? "undefined" : e;
|
|
2133
2133
|
}
|
|
2134
|
-
function
|
|
2134
|
+
function yr(f) {
|
|
2135
2135
|
return typeof f == "bigint" ? f : Number(f);
|
|
2136
2136
|
}
|
|
2137
2137
|
function bt(f) {
|
|
@@ -2166,7 +2166,7 @@ const ct = class ct {
|
|
|
2166
2166
|
return t;
|
|
2167
2167
|
let r;
|
|
2168
2168
|
try {
|
|
2169
|
-
const i =
|
|
2169
|
+
const i = mr(e);
|
|
2170
2170
|
r = {
|
|
2171
2171
|
expression: e,
|
|
2172
2172
|
evaluator: this.compileNode(i, null)
|
|
@@ -2394,7 +2394,7 @@ const ct = class ct {
|
|
|
2394
2394
|
*/
|
|
2395
2395
|
static compileUpdate(e, t) {
|
|
2396
2396
|
const r = e.argument.name, i = e.operator === "++" ? 1 : -1, s = e.prefix, n = (u) => {
|
|
2397
|
-
const d =
|
|
2397
|
+
const d = yr(u), y = typeof d == "bigint" ? d + BigInt(i) : d + i;
|
|
2398
2398
|
return [d, y];
|
|
2399
2399
|
}, a = this.findSlot(r, t);
|
|
2400
2400
|
if (a !== null) {
|
|
@@ -4465,7 +4465,7 @@ ${u}return (${y});` + d;
|
|
|
4465
4465
|
}
|
|
4466
4466
|
};
|
|
4467
4467
|
T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HELPERS = {
|
|
4468
|
-
...
|
|
4468
|
+
...cr
|
|
4469
4469
|
}, 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
4470
|
...[...Ge].filter((e) => e !== "await"),
|
|
4471
4471
|
...it,
|
|
@@ -4964,20 +4964,20 @@ ${u.template}`,
|
|
|
4964
4964
|
};
|
|
4965
4965
|
P.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", P.ELEMENT_STORES = /* @__PURE__ */ new Map(), P.collecting = !1, P.DEFAULT_REPORT_LIMIT = 20;
|
|
4966
4966
|
let Ye = P;
|
|
4967
|
-
const
|
|
4967
|
+
const ye = class ye {
|
|
4968
4968
|
/**
|
|
4969
4969
|
* フラグメントのコンストラクタ。
|
|
4970
4970
|
*
|
|
4971
4971
|
* @param target 対象ノード
|
|
4972
4972
|
*/
|
|
4973
4973
|
constructor(e) {
|
|
4974
|
-
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e,
|
|
4974
|
+
this.parent = null, this.mounted = !1, this.skipMutationNodes = !1, this.skipMutationNodeSet = /* @__PURE__ */ new Set(), this.target = e, ye.FRAGMENT_CACHE.set(e, this);
|
|
4975
4975
|
}
|
|
4976
4976
|
static get(e) {
|
|
4977
4977
|
if (e == null)
|
|
4978
4978
|
return null;
|
|
4979
|
-
if (
|
|
4980
|
-
return
|
|
4979
|
+
if (ye.FRAGMENT_CACHE.has(e))
|
|
4980
|
+
return ye.FRAGMENT_CACHE.get(e);
|
|
4981
4981
|
let t;
|
|
4982
4982
|
switch (e.nodeType) {
|
|
4983
4983
|
case Node.ELEMENT_NODE:
|
|
@@ -5005,7 +5005,7 @@ const me = class me {
|
|
|
5005
5005
|
* @returns キャッシュ済みのフラグメント。無ければ `null`
|
|
5006
5006
|
*/
|
|
5007
5007
|
static peek(e) {
|
|
5008
|
-
return
|
|
5008
|
+
return ye.FRAGMENT_CACHE.get(e) ?? null;
|
|
5009
5009
|
}
|
|
5010
5010
|
/**
|
|
5011
5011
|
* 指定した子ノードを、エンジン自身が出し入れしている最中かどうかを返します。
|
|
@@ -5100,7 +5100,7 @@ const me = class me {
|
|
|
5100
5100
|
* @return 除去のPromise
|
|
5101
5101
|
*/
|
|
5102
5102
|
remove(e = !0) {
|
|
5103
|
-
return this.parent && this.parent.removeChild(this),
|
|
5103
|
+
return this.parent && this.parent.removeChild(this), ye.FRAGMENT_CACHE.delete(this.target), e ? this.unmount() : Promise.resolve();
|
|
5104
5104
|
}
|
|
5105
5105
|
/**
|
|
5106
5106
|
* 対象ノードを取得します。
|
|
@@ -5127,8 +5127,8 @@ const me = class me {
|
|
|
5127
5127
|
this.parent = e;
|
|
5128
5128
|
}
|
|
5129
5129
|
};
|
|
5130
|
-
|
|
5131
|
-
let D =
|
|
5130
|
+
ye.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
5131
|
+
let D = ye;
|
|
5132
5132
|
const v = class v extends D {
|
|
5133
5133
|
/**
|
|
5134
5134
|
* エレメントフラグメントのコンストラクタ。
|
|
@@ -6175,6 +6175,23 @@ const v = class v extends D {
|
|
|
6175
6175
|
const t = this.userEditSequence > this.lastChangeSequence ? this.userEditSequence : this.markUserEdit();
|
|
6176
6176
|
return this.lastChangeSequence = t, t;
|
|
6177
6177
|
}
|
|
6178
|
+
/**
|
|
6179
|
+
* 初期化中に受けた `change` によるユーザー編集を、受けた時点で記録します。
|
|
6180
|
+
*
|
|
6181
|
+
* 初期化中は `change` の手続きを `release()` まで保留しますが、編集の印まで保留
|
|
6182
|
+
* すると、初回の取得の応答を反映する再評価が宣言バインドの評価結果で入力した値を
|
|
6183
|
+
* 上書きします。そこで印だけを先に付けます。
|
|
6184
|
+
*
|
|
6185
|
+
* 時点の決め方は `markUserEditOnChange()` と同じで、直前の `change` より後に打鍵が
|
|
6186
|
+
* あれば何もしません(打鍵の時点が記録済み)。**直前の `change` の記録は進めません。**
|
|
6187
|
+
* 再生した手続きの `markUserEditOnChange()` がここで付けた印を「直前の `change` より
|
|
6188
|
+
* 後の編集」として引き継ぎ、時点を再生の時点へ打ち直さないようにするためです。
|
|
6189
|
+
*
|
|
6190
|
+
* @returns 戻り値はありません。
|
|
6191
|
+
*/
|
|
6192
|
+
markUserEditOnDeferredChange() {
|
|
6193
|
+
this.userEditSequence <= this.lastChangeSequence && this.markUserEdit();
|
|
6194
|
+
}
|
|
6178
6195
|
/**
|
|
6179
6196
|
* この入力欄を最後にユーザーが編集したときの通し番号を返します。
|
|
6180
6197
|
*
|
|
@@ -6290,6 +6307,27 @@ const v = class v extends D {
|
|
|
6290
6307
|
});
|
|
6291
6308
|
};
|
|
6292
6309
|
}
|
|
6310
|
+
/**
|
|
6311
|
+
* ラジオボタンの群の今の選択を控え、その状態へ戻す関数を返します。
|
|
6312
|
+
*
|
|
6313
|
+
* 控えるのは同名のラジオボタンです。フォームでは絞りません。`checked` 属性の
|
|
6314
|
+
* 書き込みで選択が変わるのは同じ群(同じフォームの同名の欄)だけで、ほかの欄は
|
|
6315
|
+
* 控えた状態のまま戻すことになり、結果が変わらないためです。名前で絞るのは
|
|
6316
|
+
* 走査する欄を減らすためです。
|
|
6317
|
+
*
|
|
6318
|
+
* @param radio 群に属するラジオボタン
|
|
6319
|
+
* @returns 控えた選択へ戻す関数
|
|
6320
|
+
*/
|
|
6321
|
+
static captureRadioGroup(e) {
|
|
6322
|
+
const t = e.getRootNode(), r = Array.from(
|
|
6323
|
+
t.querySelectorAll('input[type="radio"]')
|
|
6324
|
+
).filter((s) => s.name === e.name), i = r.map((s) => s.checked);
|
|
6325
|
+
return () => {
|
|
6326
|
+
r.forEach((s, n) => {
|
|
6327
|
+
s.checked = i[n];
|
|
6328
|
+
});
|
|
6329
|
+
};
|
|
6330
|
+
}
|
|
6293
6331
|
/**
|
|
6294
6332
|
* チェック状態の宣言バインドについて、利用者の操作を記録する入力欄の編集の
|
|
6295
6333
|
* 通し番号を返します。
|
|
@@ -6717,13 +6755,13 @@ const v = class v extends D {
|
|
|
6717
6755
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
6718
6756
|
const o = new Xe(e, r);
|
|
6719
6757
|
if (s) {
|
|
6720
|
-
const
|
|
6721
|
-
if (
|
|
6722
|
-
const
|
|
6758
|
+
const pe = this.attributeMap.get(e);
|
|
6759
|
+
if (pe && (pe.isEvaluate || pe.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
6760
|
+
const xe = J.enqueue(() => {
|
|
6723
6761
|
}).finally(() => {
|
|
6724
6762
|
this.releaseSelfWritingAttributes(n);
|
|
6725
6763
|
});
|
|
6726
|
-
return this.holdSelfWritingAttributes(n,
|
|
6764
|
+
return this.holdSelfWritingAttributes(n, xe), xe;
|
|
6727
6765
|
}
|
|
6728
6766
|
}
|
|
6729
6767
|
this.attributeMap.set(e, o);
|
|
@@ -6732,49 +6770,49 @@ const v = class v extends D {
|
|
|
6732
6770
|
element: l,
|
|
6733
6771
|
rawName: e,
|
|
6734
6772
|
template: r
|
|
6735
|
-
}), 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 =
|
|
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", C = w === !1 && !M, se = !o.isForceEvaluation() && (t !== e ? d.hasUnresolvedReference || w === null || w === void 0 || C : b ? d.hasUnresolvedReference || w === null || w === void 0 || w === !1 : E ? d.hasUnresolvedReference || w === null || w === void 0 || C : y && A === "");
|
|
6736
6774
|
if (se && d.hasUnresolvedReference && v.warnUnresolvedAttribute(
|
|
6737
6775
|
e,
|
|
6738
6776
|
t,
|
|
6739
6777
|
r,
|
|
6740
6778
|
l
|
|
6741
6779
|
), V.isEnabled() && w === !1 && E) {
|
|
6742
|
-
const
|
|
6743
|
-
|
|
6780
|
+
const pe = o.getSingleExpression(), xe = pe === null ? null : re.diagnoseStrictComparison(
|
|
6781
|
+
pe,
|
|
6744
6782
|
this.getBindingData()
|
|
6745
6783
|
);
|
|
6746
|
-
|
|
6784
|
+
xe !== null && v.warnTypeMismatchedComparison(
|
|
6747
6785
|
e,
|
|
6748
6786
|
r,
|
|
6749
|
-
|
|
6787
|
+
xe,
|
|
6750
6788
|
l
|
|
6751
6789
|
);
|
|
6752
6790
|
}
|
|
6753
|
-
const F = 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 || F === null || F === !1 &&
|
|
6791
|
+
const F = 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 || F === null || F === !1 && !M ? null : String(F), j = o.isEvaluate && ae !== null && v.URL_ATTRIBUTES.has(t) && Oe.hasScriptScheme(ae);
|
|
6754
6792
|
j && m.warn(
|
|
6755
6793
|
"[Haori]",
|
|
6756
6794
|
`Attribute "${t}" was removed because the evaluated URL uses a script scheme: ${e}="${r}" -> ${ae}`,
|
|
6757
6795
|
l
|
|
6758
6796
|
);
|
|
6759
|
-
const k = j ? null : ae, B = e !== t && l.getAttribute(e) !== r, ue = k === null ? l.hasAttribute(t) : l.getAttribute(t) !== k, U = k === null ? "" : k, Q = Z && !K && l.value !== U,
|
|
6797
|
+
const k = j ? null : ae, B = e !== t && l.getAttribute(e) !== r, ue = k === null ? l.hasAttribute(t) : l.getAttribute(t) !== k, U = k === null ? "" : k, Q = Z && !K && l.value !== U, fe = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), ce = t === "selected" && l instanceof HTMLOptionElement, W = ee.activeElement, G = W !== null && (fe && l === W || ce && l.closest("select") === W) || (fe || ce) && this.hasPendingCheckableUserEdit(ce), ie = this.getCheckableUserEditSequence(ce), Ae = k !== null, _e = fe && o.isEvaluate && !G && l.checked !== Ae, Ve = ce && o.isEvaluate && !G && l.selected !== Ae;
|
|
6760
6798
|
if (!B && !ue && !Q && !_e && !Ve)
|
|
6761
6799
|
return Z && !K && (this.value = this.normalizeValueForElement(
|
|
6762
6800
|
l,
|
|
6763
6801
|
U
|
|
6764
|
-
), this.clearUnappliedValueWrite()), (
|
|
6802
|
+
), this.clearUnappliedValueWrite()), (fe || ce) && !G && this.syncCheckableValueFromDom(ce), Promise.resolve();
|
|
6765
6803
|
const ut = J.enqueue(() => {
|
|
6766
|
-
const
|
|
6804
|
+
const pe = this.getCheckableUserEditSequence(ce) !== ie, _t = G || pe ? ce ? v.captureSelection(
|
|
6767
6805
|
// 守るべき選択があるのは所属する `<select>` があるときだけ。
|
|
6768
6806
|
l.closest(
|
|
6769
6807
|
"select"
|
|
6770
6808
|
)
|
|
6771
|
-
) : null;
|
|
6772
|
-
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(),
|
|
6809
|
+
) : 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(), _t?.(), Z && !K && !(v.isUserEditableValue(l) && this.isSupersededByUserEdit(ne)) && (this.value = this.normalizeValueForElement(
|
|
6773
6811
|
l,
|
|
6774
6812
|
U
|
|
6775
6813
|
), Q && (l.value = U), this.recordValueWriteResult(l.value === U));
|
|
6776
|
-
const
|
|
6777
|
-
|
|
6814
|
+
const er = _e && !pe, tr = Ve && !pe;
|
|
6815
|
+
er && (l.checked = Ae), tr && (l.selected = Ae), (_e || Ve) && this.syncCheckableValueFromDom(Ve);
|
|
6778
6816
|
}).finally(() => {
|
|
6779
6817
|
this.releaseSelfWritingAttributes(n);
|
|
6780
6818
|
});
|
|
@@ -6834,7 +6872,7 @@ const v = class v extends D {
|
|
|
6834
6872
|
value: r.results[0],
|
|
6835
6873
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6836
6874
|
} : {
|
|
6837
|
-
value:
|
|
6875
|
+
value: Ee.joinEvaluateResults(r.results),
|
|
6838
6876
|
hasUnresolvedReference: r.hasUnresolvedReference
|
|
6839
6877
|
};
|
|
6840
6878
|
}
|
|
@@ -7284,7 +7322,7 @@ class de extends D {
|
|
|
7284
7322
|
* @param target 対象テキストノード
|
|
7285
7323
|
*/
|
|
7286
7324
|
constructor(e) {
|
|
7287
|
-
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new
|
|
7325
|
+
super(e), this.skipMutation = !1, this.renderedText = null, this.text = e.textContent || "", this.contents = new Ee(this.text);
|
|
7288
7326
|
}
|
|
7289
7327
|
/**
|
|
7290
7328
|
* フラグメントをクローンします。
|
|
@@ -7329,7 +7367,7 @@ class de extends D {
|
|
|
7329
7367
|
* @returns 更新のPromise
|
|
7330
7368
|
*/
|
|
7331
7369
|
setContent(e) {
|
|
7332
|
-
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new
|
|
7370
|
+
return this.skipMutation || this.text === e ? Promise.resolve() : (this.text = e, this.contents = new Ee(e), this.evaluate());
|
|
7333
7371
|
}
|
|
7334
7372
|
/**
|
|
7335
7373
|
* フラグメントを評価します。
|
|
@@ -7345,7 +7383,7 @@ class de extends D {
|
|
|
7345
7383
|
return J.enqueue(() => {
|
|
7346
7384
|
this.skipMutation = !0;
|
|
7347
7385
|
let t = this.text;
|
|
7348
|
-
this.contents.isEvaluate && (t =
|
|
7386
|
+
this.contents.isEvaluate && (t = Ee.joinEvaluateResults(
|
|
7349
7387
|
this.contents.evaluate(this.parent.getBindingData(), {
|
|
7350
7388
|
kind: "text",
|
|
7351
7389
|
element: this.parent.getTarget(),
|
|
@@ -7549,8 +7587,8 @@ const Je = class Je {
|
|
|
7549
7587
|
}
|
|
7550
7588
|
};
|
|
7551
7589
|
Je.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
7552
|
-
let
|
|
7553
|
-
const _ = class _ extends
|
|
7590
|
+
let Ee = Je;
|
|
7591
|
+
const _ = class _ extends Ee {
|
|
7554
7592
|
/**
|
|
7555
7593
|
* コンストラクタ。
|
|
7556
7594
|
*
|
|
@@ -7933,7 +7971,7 @@ const ke = class ke {
|
|
|
7933
7971
|
* @returns 整形済みの現在日時文字列
|
|
7934
7972
|
*/
|
|
7935
7973
|
static now(e, t) {
|
|
7936
|
-
return
|
|
7974
|
+
return $t(e, t);
|
|
7937
7975
|
}
|
|
7938
7976
|
/**
|
|
7939
7977
|
* 現在日付に日数を加減した日付を指定フォーマットの文字列へ整形します。
|
|
@@ -8118,13 +8156,13 @@ ke.handlers = {
|
|
|
8118
8156
|
return le.has(e);
|
|
8119
8157
|
}
|
|
8120
8158
|
};
|
|
8121
|
-
let
|
|
8122
|
-
const
|
|
8159
|
+
let Ne = ke;
|
|
8160
|
+
const br = "入力内容を確認してください", Er = ["addErrorMessage", "clearMessages"], St = "data-haori-group-name";
|
|
8123
8161
|
function Rt() {
|
|
8124
8162
|
const e = globalThis.window?.Haori;
|
|
8125
|
-
return
|
|
8163
|
+
return Er.every(
|
|
8126
8164
|
(r) => typeof e?.[r] == "function"
|
|
8127
|
-
) ? e :
|
|
8165
|
+
) ? e : Ne;
|
|
8128
8166
|
}
|
|
8129
8167
|
const p = class p {
|
|
8130
8168
|
/**
|
|
@@ -9098,7 +9136,7 @@ const p = class p {
|
|
|
9098
9136
|
*/
|
|
9099
9137
|
static resolveValidityMessage(e) {
|
|
9100
9138
|
const t = e.getAttribute(`${c.prefix}validity-message`);
|
|
9101
|
-
return typeof t == "string" && t.trim() !== "" ? t :
|
|
9139
|
+
return typeof t == "string" && t.trim() !== "" ? t : br;
|
|
9102
9140
|
}
|
|
9103
9141
|
/**
|
|
9104
9142
|
* 条件属性の値から式を取り出します。
|
|
@@ -9363,7 +9401,7 @@ const p = class p {
|
|
|
9363
9401
|
static createRowKeyIndexes(e, t) {
|
|
9364
9402
|
const r = /* @__PURE__ */ new Map();
|
|
9365
9403
|
return e.forEach((i, s) => {
|
|
9366
|
-
const n =
|
|
9404
|
+
const n = $.createListKey(
|
|
9367
9405
|
i,
|
|
9368
9406
|
t,
|
|
9369
9407
|
s
|
|
@@ -9543,7 +9581,7 @@ const p = class p {
|
|
|
9543
9581
|
const s = { ...i };
|
|
9544
9582
|
for (const n of t)
|
|
9545
9583
|
delete s[n];
|
|
9546
|
-
return
|
|
9584
|
+
return $.setBindingData(e.getTarget(), s, {
|
|
9547
9585
|
kind: r?.kind ?? "supply",
|
|
9548
9586
|
sequence: r?.sequence ?? R.nextSequence()
|
|
9549
9587
|
});
|
|
@@ -9862,8 +9900,8 @@ const p = class p {
|
|
|
9862
9900
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
9863
9901
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
9864
9902
|
!p.isGroupedCheckable(e) && !p.isMultipleSelect(e)) {
|
|
9865
|
-
const
|
|
9866
|
-
n.set(
|
|
9903
|
+
const M = String(l), C = n.get(M) ?? 0;
|
|
9904
|
+
n.set(M, C + 1), o.push(
|
|
9867
9905
|
p.applyFragmentValue(
|
|
9868
9906
|
e,
|
|
9869
9907
|
w[C] ?? null,
|
|
@@ -9896,13 +9934,13 @@ const p = class p {
|
|
|
9896
9934
|
)
|
|
9897
9935
|
);
|
|
9898
9936
|
} else if (d) {
|
|
9899
|
-
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(), w = e.getAttribute(`${c.prefix}each-key`),
|
|
9937
|
+
const b = t[String(d)], E = Array.isArray(b) ? b : [], A = e.getChildElementFragments(), w = e.getAttribute(`${c.prefix}each-key`), M = p.isCollectedListFromEachSource(e) ? p.pairRowsWithItems(
|
|
9900
9938
|
A,
|
|
9901
9939
|
E,
|
|
9902
9940
|
w == null ? null : String(w)
|
|
9903
9941
|
) : null;
|
|
9904
9942
|
for (let C = 0; C < A.length; C++) {
|
|
9905
|
-
const se = A[C], F =
|
|
9943
|
+
const se = A[C], F = M ? M[C] : E.length > C ? E[C] : null;
|
|
9906
9944
|
o.push(
|
|
9907
9945
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
9908
9946
|
p.setPartValues(
|
|
@@ -9951,7 +9989,7 @@ const p = class p {
|
|
|
9951
9989
|
const r = p.collectBindingTargetForms(e);
|
|
9952
9990
|
if (r.length > 0 && r.every((s) => s.isSupplyStale(t)))
|
|
9953
9991
|
return;
|
|
9954
|
-
p.markResetSubtree(e, t),
|
|
9992
|
+
p.markResetSubtree(e, t), $.clearUserEditMarks(e, t), p.clearValues(e), await Promise.all([
|
|
9955
9993
|
p.clearMessages(e),
|
|
9956
9994
|
p.clearEachClones(e)
|
|
9957
9995
|
]), await J.enqueue(() => {
|
|
@@ -9965,16 +10003,16 @@ const p = class p {
|
|
|
9965
10003
|
} finally {
|
|
9966
10004
|
p.internalResetDepth -= 1;
|
|
9967
10005
|
}
|
|
9968
|
-
p.clearDeclarativeStateFromDom(e),
|
|
10006
|
+
p.clearDeclarativeStateFromDom(e), $.invalidateDerivedSubtreeSignatures(e), p.restoreEdits(s);
|
|
9969
10007
|
});
|
|
9970
10008
|
const i = r;
|
|
9971
10009
|
for (const s of i) {
|
|
9972
10010
|
const n = p.getInitialBindingData(s);
|
|
9973
|
-
n === null && s.getRawBindingData() === null || await
|
|
10011
|
+
n === null && s.getRawBindingData() === null || await $.setBindingData(s.getTarget(), n ?? {}, {
|
|
9974
10012
|
sequence: t
|
|
9975
10013
|
});
|
|
9976
10014
|
}
|
|
9977
|
-
p.syncValuesFromDom(e), await
|
|
10015
|
+
p.syncValuesFromDom(e), await $.evaluateAll(e);
|
|
9978
10016
|
for (const s of i)
|
|
9979
10017
|
p.getInitialBindingData(s) !== null || s.getRawBindingData() !== null || await p.restoreAncestorArgValues(s, {
|
|
9980
10018
|
sequence: t,
|
|
@@ -9994,7 +10032,7 @@ const p = class p {
|
|
|
9994
10032
|
));
|
|
9995
10033
|
} else
|
|
9996
10034
|
l = p.mergeCollectedValues(l, a), p.deleteAncestorOwnedKeys(s, n, l);
|
|
9997
|
-
await
|
|
10035
|
+
await $.setBindingData(s.getTarget(), l, {
|
|
9998
10036
|
sequence: t
|
|
9999
10037
|
});
|
|
10000
10038
|
}
|
|
@@ -10022,7 +10060,7 @@ const p = class p {
|
|
|
10022
10060
|
*/
|
|
10023
10061
|
static getInitialBindingData(e) {
|
|
10024
10062
|
const t = e.getInitialBindAttribute();
|
|
10025
|
-
return t === null ? null :
|
|
10063
|
+
return t === null ? null : $.parseDataBind(t);
|
|
10026
10064
|
}
|
|
10027
10065
|
/**
|
|
10028
10066
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -10304,7 +10342,7 @@ p.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), p.LAST_ANCESTOR_ARG_VA
|
|
|
10304
10342
|
"constructor",
|
|
10305
10343
|
"prototype"
|
|
10306
10344
|
]), p.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), p.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), p.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), p.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), p.warnedDerivedRowsWithoutKey = /* @__PURE__ */ new Set(), p.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
10307
|
-
let
|
|
10345
|
+
let N = p;
|
|
10308
10346
|
class O {
|
|
10309
10347
|
/**
|
|
10310
10348
|
* カスタムイベントを発火します。
|
|
@@ -10544,11 +10582,11 @@ class O {
|
|
|
10544
10582
|
O.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
10545
10583
|
}
|
|
10546
10584
|
}
|
|
10547
|
-
const
|
|
10585
|
+
const Ar = {
|
|
10548
10586
|
401: "unauthorized-redirect",
|
|
10549
10587
|
403: "forbidden-redirect"
|
|
10550
10588
|
};
|
|
10551
|
-
function
|
|
10589
|
+
function vr(f, e) {
|
|
10552
10590
|
return f.replace(/\{\{([\s\S]+?)\}\}/g, (t, r) => {
|
|
10553
10591
|
try {
|
|
10554
10592
|
const i = re.evaluate(String(r).trim(), e);
|
|
@@ -10564,10 +10602,10 @@ function Tt(f, e) {
|
|
|
10564
10602
|
return null;
|
|
10565
10603
|
if (!t.includes("{{"))
|
|
10566
10604
|
return t;
|
|
10567
|
-
const r = D.get(f), i = r instanceof R ? r.getBindingData() : {}, s =
|
|
10605
|
+
const r = D.get(f), i = r instanceof R ? r.getBindingData() : {}, s = vr(t, i);
|
|
10568
10606
|
return s === "" ? null : s;
|
|
10569
10607
|
}
|
|
10570
|
-
function
|
|
10608
|
+
function wr(f, e, t) {
|
|
10571
10609
|
const r = f.getAttribute(`${e}-return-param`);
|
|
10572
10610
|
if (r === null || r === "")
|
|
10573
10611
|
return t;
|
|
@@ -10581,7 +10619,7 @@ function vr(f, e, t) {
|
|
|
10581
10619
|
return `${l}${u}${n}${o}`;
|
|
10582
10620
|
}
|
|
10583
10621
|
function kt(f, e, t) {
|
|
10584
|
-
const r =
|
|
10622
|
+
const r = wr(f, e, t);
|
|
10585
10623
|
if (!Oe.isNavigableUrl(r))
|
|
10586
10624
|
return m.error(
|
|
10587
10625
|
"Haori",
|
|
@@ -10595,7 +10633,7 @@ function kt(f, e, t) {
|
|
|
10595
10633
|
return window.location.href = r, !0;
|
|
10596
10634
|
}
|
|
10597
10635
|
function Jt(f, e = null) {
|
|
10598
|
-
const t =
|
|
10636
|
+
const t = Ar[f];
|
|
10599
10637
|
if (t === void 0 || typeof document > "u")
|
|
10600
10638
|
return !1;
|
|
10601
10639
|
if (e !== null) {
|
|
@@ -10710,7 +10748,7 @@ class z {
|
|
|
10710
10748
|
}
|
|
10711
10749
|
}
|
|
10712
10750
|
}
|
|
10713
|
-
const
|
|
10751
|
+
const x = class x {
|
|
10714
10752
|
/**
|
|
10715
10753
|
* ストレージ種別に対応する `Storage` を解決します。
|
|
10716
10754
|
*
|
|
@@ -10728,7 +10766,7 @@ const N = class N {
|
|
|
10728
10766
|
throw new Error("storage is not available");
|
|
10729
10767
|
return t;
|
|
10730
10768
|
} catch (t) {
|
|
10731
|
-
return
|
|
10769
|
+
return x.WARNED_KINDS.has(e) || (x.WARNED_KINDS.add(e), m.warn(
|
|
10732
10770
|
"Haori",
|
|
10733
10771
|
`${e}Storage が利用できないため ${c.prefix}store を無効にします:`,
|
|
10734
10772
|
t
|
|
@@ -10765,8 +10803,8 @@ const N = class N {
|
|
|
10765
10803
|
* @param message 警告メッセージ
|
|
10766
10804
|
*/
|
|
10767
10805
|
static warnOnce(e, t, r) {
|
|
10768
|
-
let i =
|
|
10769
|
-
i || (i = /* @__PURE__ */ new Set(),
|
|
10806
|
+
let i = x.WARNED_ELEMENTS.get(e);
|
|
10807
|
+
i || (i = /* @__PURE__ */ new Set(), x.WARNED_ELEMENTS.set(e, i)), !i.has(t) && (i.add(t), m.warn("Haori", r));
|
|
10770
10808
|
}
|
|
10771
10809
|
/**
|
|
10772
10810
|
* `data-each` の行の内側かどうかを判定します。
|
|
@@ -10803,13 +10841,13 @@ const N = class N {
|
|
|
10803
10841
|
return null;
|
|
10804
10842
|
const i = r.trim();
|
|
10805
10843
|
if (i === "")
|
|
10806
|
-
return
|
|
10844
|
+
return x.warnOnce(
|
|
10807
10845
|
t,
|
|
10808
10846
|
"key",
|
|
10809
10847
|
`${c.prefix}store にストレージキーが指定されていません。`
|
|
10810
10848
|
), null;
|
|
10811
10849
|
if (i.includes("{{"))
|
|
10812
|
-
return
|
|
10850
|
+
return x.warnOnce(
|
|
10813
10851
|
t,
|
|
10814
10852
|
"expression",
|
|
10815
10853
|
`${c.prefix}store に式は使用できません(静的な文字列を指定してください): ${i}`
|
|
@@ -10818,7 +10856,7 @@ const N = class N {
|
|
|
10818
10856
|
let n = "session";
|
|
10819
10857
|
if (s !== null) {
|
|
10820
10858
|
const d = s.trim();
|
|
10821
|
-
d === "local" || d === "session" ? n = d :
|
|
10859
|
+
d === "local" || d === "session" ? n = d : x.warnOnce(
|
|
10822
10860
|
t,
|
|
10823
10861
|
"type",
|
|
10824
10862
|
`${c.prefix}store-type は session または local を指定してください(session として扱います): ${d}`
|
|
@@ -10827,14 +10865,14 @@ const N = class N {
|
|
|
10827
10865
|
const a = e.getRawAttribute(`${c.prefix}store-arg`), o = a === null || a.trim() === "" ? null : a.trim(), l = e.getRawAttribute(`${c.prefix}store-params`);
|
|
10828
10866
|
let u = null;
|
|
10829
10867
|
if (l !== null) {
|
|
10830
|
-
const d = l.split("&").map((b) => b.trim()).filter((b) => b !== ""), y = d.filter((b) => !
|
|
10831
|
-
y.length !== d.length &&
|
|
10868
|
+
const d = l.split("&").map((b) => b.trim()).filter((b) => b !== ""), y = d.filter((b) => !x.isReservedKey(b));
|
|
10869
|
+
y.length !== d.length && x.warnOnce(
|
|
10832
10870
|
t,
|
|
10833
10871
|
"reserved",
|
|
10834
10872
|
`${c.prefix}store-params の予約キー(先頭が _ のキー)は対象外です。`
|
|
10835
10873
|
), u = y.length > 0 ? y : null;
|
|
10836
10874
|
}
|
|
10837
|
-
return u === null && o === null ? (
|
|
10875
|
+
return u === null && o === null ? (x.warnOnce(
|
|
10838
10876
|
t,
|
|
10839
10877
|
"target",
|
|
10840
10878
|
`${c.prefix}store には ${c.prefix}store-params または ${c.prefix}store-arg のいずれかが必要です。`
|
|
@@ -10851,7 +10889,7 @@ const N = class N {
|
|
|
10851
10889
|
* @returns レコード。読み取れない場合は null
|
|
10852
10890
|
*/
|
|
10853
10891
|
static readRecord(e) {
|
|
10854
|
-
const t =
|
|
10892
|
+
const t = x.resolveStorage(e.kind);
|
|
10855
10893
|
if (!t)
|
|
10856
10894
|
return null;
|
|
10857
10895
|
let r;
|
|
@@ -10876,7 +10914,7 @@ const N = class N {
|
|
|
10876
10914
|
s
|
|
10877
10915
|
), null;
|
|
10878
10916
|
}
|
|
10879
|
-
return
|
|
10917
|
+
return x.isPlainRecord(i) ? i : (m.warn(
|
|
10880
10918
|
"Haori",
|
|
10881
10919
|
`保存済みデータがオブジェクトではありません: ${e.key}`
|
|
10882
10920
|
), null);
|
|
@@ -10894,7 +10932,7 @@ const N = class N {
|
|
|
10894
10932
|
const n = t[e.arg];
|
|
10895
10933
|
if (n === void 0)
|
|
10896
10934
|
return {};
|
|
10897
|
-
if (!
|
|
10935
|
+
if (!x.isPlainRecord(n))
|
|
10898
10936
|
return m.warn(
|
|
10899
10937
|
"Haori",
|
|
10900
10938
|
`保存済みデータの ${e.arg} がオブジェクトではありません: ` + e.key
|
|
@@ -10903,7 +10941,7 @@ const N = class N {
|
|
|
10903
10941
|
}
|
|
10904
10942
|
const i = e.params ?? Object.keys(r), s = {};
|
|
10905
10943
|
for (const n of i)
|
|
10906
|
-
|
|
10944
|
+
x.isReservedKey(n) || Object.prototype.hasOwnProperty.call(r, n) && (s[n] = r[n]);
|
|
10907
10945
|
return s;
|
|
10908
10946
|
}
|
|
10909
10947
|
/**
|
|
@@ -10920,7 +10958,7 @@ const N = class N {
|
|
|
10920
10958
|
static selectFromData(e, t) {
|
|
10921
10959
|
const r = e.params ?? Object.keys(t), i = {};
|
|
10922
10960
|
for (const s of r) {
|
|
10923
|
-
if (
|
|
10961
|
+
if (x.isReservedKey(s) || !Object.prototype.hasOwnProperty.call(t, s))
|
|
10924
10962
|
continue;
|
|
10925
10963
|
const n = t[s];
|
|
10926
10964
|
n !== void 0 && (i[s] = n);
|
|
@@ -10979,12 +11017,12 @@ const N = class N {
|
|
|
10979
11017
|
* @param selected 基準にする選択内容
|
|
10980
11018
|
*/
|
|
10981
11019
|
static seedSignature(e, t) {
|
|
10982
|
-
const r =
|
|
11020
|
+
const r = x.stringify(t);
|
|
10983
11021
|
if (r === null) {
|
|
10984
|
-
|
|
11022
|
+
x.SIGNATURES.delete(e);
|
|
10985
11023
|
return;
|
|
10986
11024
|
}
|
|
10987
|
-
|
|
11025
|
+
x.SIGNATURES.set(e, { json: r, refs: x.createRefs(t) });
|
|
10988
11026
|
}
|
|
10989
11027
|
/**
|
|
10990
11028
|
* レコードへ選択内容を書き込みます。
|
|
@@ -10998,12 +11036,12 @@ const N = class N {
|
|
|
10998
11036
|
* @returns 書き込めたら true
|
|
10999
11037
|
*/
|
|
11000
11038
|
static writeRecord(e, t) {
|
|
11001
|
-
const r =
|
|
11039
|
+
const r = x.resolveStorage(e.kind);
|
|
11002
11040
|
if (!r)
|
|
11003
11041
|
return !1;
|
|
11004
|
-
const i =
|
|
11042
|
+
const i = x.readRecord(e) ?? {};
|
|
11005
11043
|
if (e.arg !== null) {
|
|
11006
|
-
const s = i[e.arg], n =
|
|
11044
|
+
const s = i[e.arg], n = x.isPlainRecord(s) ? { ...s } : {};
|
|
11007
11045
|
i[e.arg] = { ...n, ...t };
|
|
11008
11046
|
} else
|
|
11009
11047
|
Object.assign(i, t);
|
|
@@ -11028,19 +11066,19 @@ const N = class N {
|
|
|
11028
11066
|
* @returns 復元完了の Promise
|
|
11029
11067
|
*/
|
|
11030
11068
|
static restore(e) {
|
|
11031
|
-
const t =
|
|
11069
|
+
const t = x.readDeclaration(e);
|
|
11032
11070
|
if (!t)
|
|
11033
11071
|
return Promise.resolve();
|
|
11034
11072
|
const r = e.getTarget();
|
|
11035
|
-
if (
|
|
11036
|
-
return
|
|
11073
|
+
if (x.isInsideEachRow(e))
|
|
11074
|
+
return x.warnOnce(
|
|
11037
11075
|
r,
|
|
11038
11076
|
"each-row",
|
|
11039
11077
|
`${c.prefix}each の行の内側では ${c.prefix}store を使用できません(行データは親要素側で配列キーを指定してください)。`
|
|
11040
11078
|
), Promise.resolve();
|
|
11041
|
-
|
|
11042
|
-
const i =
|
|
11043
|
-
return
|
|
11079
|
+
x.RESTORED_ELEMENTS.add(r);
|
|
11080
|
+
const i = x.readRecord(t), s = i ? x.extractFromRecord(t, i) : {}, n = { ...e.getRawBindingData() ?? {}, ...s };
|
|
11081
|
+
return x.seedSignature(r, x.selectFromData(t, n)), Object.keys(s).length === 0 ? Promise.resolve() : $.setBindingData(r, n, {
|
|
11044
11082
|
reentrant: !0,
|
|
11045
11083
|
kind: "nonSupply",
|
|
11046
11084
|
sequence: R.nextSequence()
|
|
@@ -11057,22 +11095,22 @@ const N = class N {
|
|
|
11057
11095
|
* @param fragment 対象フラグメント
|
|
11058
11096
|
*/
|
|
11059
11097
|
static mirror(e) {
|
|
11060
|
-
const t =
|
|
11061
|
-
if (!t ||
|
|
11098
|
+
const t = x.readDeclaration(e);
|
|
11099
|
+
if (!t || x.isInsideEachRow(e))
|
|
11062
11100
|
return;
|
|
11063
11101
|
const r = e.getTarget();
|
|
11064
|
-
if (!
|
|
11102
|
+
if (!x.RESTORED_ELEMENTS.has(r))
|
|
11065
11103
|
return;
|
|
11066
11104
|
const i = e.getRawBindingData();
|
|
11067
11105
|
if (!i)
|
|
11068
11106
|
return;
|
|
11069
|
-
const s =
|
|
11107
|
+
const s = x.selectFromData(t, i);
|
|
11070
11108
|
if (Object.keys(s).length === 0)
|
|
11071
11109
|
return;
|
|
11072
|
-
const n =
|
|
11073
|
-
if (n &&
|
|
11110
|
+
const n = x.SIGNATURES.get(r);
|
|
11111
|
+
if (n && x.hasSameRefs(n, s))
|
|
11074
11112
|
return;
|
|
11075
|
-
const a =
|
|
11113
|
+
const a = x.stringify(s);
|
|
11076
11114
|
if (a === null) {
|
|
11077
11115
|
m.warn(
|
|
11078
11116
|
"Haori",
|
|
@@ -11081,10 +11119,10 @@ const N = class N {
|
|
|
11081
11119
|
return;
|
|
11082
11120
|
}
|
|
11083
11121
|
if (n && n.json === a) {
|
|
11084
|
-
n.refs =
|
|
11122
|
+
n.refs = x.createRefs(s);
|
|
11085
11123
|
return;
|
|
11086
11124
|
}
|
|
11087
|
-
|
|
11125
|
+
x.writeRecord(t, s) && x.SIGNATURES.set(r, { json: a, refs: x.createRefs(s) });
|
|
11088
11126
|
}
|
|
11089
11127
|
/**
|
|
11090
11128
|
* レコードを破棄します。
|
|
@@ -11097,7 +11135,7 @@ const N = class N {
|
|
|
11097
11135
|
* @param kind ストレージ種別
|
|
11098
11136
|
*/
|
|
11099
11137
|
static clear(e, t) {
|
|
11100
|
-
const r =
|
|
11138
|
+
const r = x.resolveStorage(t);
|
|
11101
11139
|
if (r) {
|
|
11102
11140
|
try {
|
|
11103
11141
|
r.removeItem(e);
|
|
@@ -11105,7 +11143,7 @@ const N = class N {
|
|
|
11105
11143
|
m.warn("Haori", `ストレージの破棄に失敗しました: ${e}`, i);
|
|
11106
11144
|
return;
|
|
11107
11145
|
}
|
|
11108
|
-
|
|
11146
|
+
x.reseedDeclaringElements(e, t);
|
|
11109
11147
|
}
|
|
11110
11148
|
}
|
|
11111
11149
|
/**
|
|
@@ -11118,25 +11156,25 @@ const N = class N {
|
|
|
11118
11156
|
document.querySelectorAll(
|
|
11119
11157
|
`[${c.prefix}store]`
|
|
11120
11158
|
).forEach((i) => {
|
|
11121
|
-
if (!
|
|
11159
|
+
if (!x.RESTORED_ELEMENTS.has(i))
|
|
11122
11160
|
return;
|
|
11123
11161
|
const s = D.get(i);
|
|
11124
11162
|
if (!(s instanceof R))
|
|
11125
11163
|
return;
|
|
11126
|
-
const n =
|
|
11164
|
+
const n = x.readDeclaration(s);
|
|
11127
11165
|
if (!n || n.key !== e || n.kind !== t)
|
|
11128
11166
|
return;
|
|
11129
11167
|
const a = s.getRawBindingData();
|
|
11130
|
-
|
|
11168
|
+
x.seedSignature(
|
|
11131
11169
|
i,
|
|
11132
|
-
a ?
|
|
11170
|
+
a ? x.selectFromData(n, a) : {}
|
|
11133
11171
|
);
|
|
11134
11172
|
});
|
|
11135
11173
|
}
|
|
11136
11174
|
};
|
|
11137
|
-
|
|
11138
|
-
let Be =
|
|
11139
|
-
const
|
|
11175
|
+
x.SIGNATURES = /* @__PURE__ */ new WeakMap(), x.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), x.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), x.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
11176
|
+
let Be = x;
|
|
11177
|
+
const Ie = "[Haori]", Fe = {
|
|
11140
11178
|
bodyIgnored: (f) => `${f} is ignored because ${f}-handler is also declared.`,
|
|
11141
11179
|
notRegistered: (f, e) => `Handler "${f}" is not registered (${e}-handler). Register it with Haori.handlers.register().`,
|
|
11142
11180
|
argsNotArray: (f) => `${f}-args must evaluate to an array without unresolved references; the handler is not called.`,
|
|
@@ -11176,7 +11214,7 @@ class oe {
|
|
|
11176
11214
|
*/
|
|
11177
11215
|
static compile(e, t, r) {
|
|
11178
11216
|
const i = `${t}-handler`;
|
|
11179
|
-
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(
|
|
11217
|
+
return e.hasAttribute(i) ? (V.isEnabled() && e.hasAttribute(t) && m.warn(Ie, Fe.bodyIgnored(t), e.getTarget()), oe.compileHandler(e, t)) : oe.compileExpression(e, t, r);
|
|
11180
11218
|
}
|
|
11181
11219
|
/**
|
|
11182
11220
|
* 登録した関数を呼ぶ呼び出しを組み立てます(`-handler` / `-args`)。
|
|
@@ -11193,8 +11231,8 @@ class oe {
|
|
|
11193
11231
|
const n = De.get(r);
|
|
11194
11232
|
if (n === void 0) {
|
|
11195
11233
|
m.warn(
|
|
11196
|
-
|
|
11197
|
-
|
|
11234
|
+
Ie,
|
|
11235
|
+
Fe.notRegistered(r, t),
|
|
11198
11236
|
e.getTarget()
|
|
11199
11237
|
);
|
|
11200
11238
|
return;
|
|
@@ -11206,7 +11244,7 @@ class oe {
|
|
|
11206
11244
|
e.getBindingData()
|
|
11207
11245
|
);
|
|
11208
11246
|
if (!Array.isArray(o.value)) {
|
|
11209
|
-
m.warn(
|
|
11247
|
+
m.warn(Ie, Fe.argsNotArray(t), i);
|
|
11210
11248
|
return;
|
|
11211
11249
|
}
|
|
11212
11250
|
a = o.value;
|
|
@@ -11228,11 +11266,11 @@ class oe {
|
|
|
11228
11266
|
static compileExpression(e, t, r) {
|
|
11229
11267
|
const i = e.getRawAttribute(t);
|
|
11230
11268
|
if (i.includes("{{"))
|
|
11231
|
-
return m.warn(
|
|
11269
|
+
return m.warn(Ie, Fe.templateInBody(t), e.getTarget()), null;
|
|
11232
11270
|
try {
|
|
11233
11271
|
Le.compile(i);
|
|
11234
11272
|
} catch {
|
|
11235
|
-
return m.warn(
|
|
11273
|
+
return m.warn(Ie, Fe.notExpression(t), e.getTarget()), null;
|
|
11236
11274
|
}
|
|
11237
11275
|
return (s) => {
|
|
11238
11276
|
const n = e.getBindingData();
|
|
@@ -11255,10 +11293,10 @@ class oe {
|
|
|
11255
11293
|
*/
|
|
11256
11294
|
static reportShadowedHandlers(e, t) {
|
|
11257
11295
|
const r = Object.keys(e).filter((i) => De.has(i));
|
|
11258
|
-
r.length > 0 && m.warn(
|
|
11296
|
+
r.length > 0 && m.warn(Ie, Fe.shadowed(r, t));
|
|
11259
11297
|
}
|
|
11260
11298
|
}
|
|
11261
|
-
const
|
|
11299
|
+
const Sr = [
|
|
11262
11300
|
"addErrorMessage",
|
|
11263
11301
|
"clearMessages",
|
|
11264
11302
|
"closeDialog",
|
|
@@ -11266,26 +11304,26 @@ const wr = [
|
|
|
11266
11304
|
"dialog",
|
|
11267
11305
|
"openDialog",
|
|
11268
11306
|
"toast"
|
|
11269
|
-
],
|
|
11307
|
+
], Rr = "__haoriHistoryState__", tt = "data-haori-click-lock", Dt = "ファイルを保存できませんでした", Tr = 100;
|
|
11270
11308
|
let Pe = null;
|
|
11271
|
-
const
|
|
11272
|
-
function
|
|
11309
|
+
const kr = ["info", "warning", "error", "success"], Nt = /^(\d{3})-(click|click-await|close|toast|toast-level|no-message|bind)$/;
|
|
11310
|
+
function ge() {
|
|
11273
11311
|
const e = globalThis.window?.Haori;
|
|
11274
|
-
return
|
|
11312
|
+
return Sr.every(
|
|
11275
11313
|
(r) => typeof e?.[r] == "function"
|
|
11276
|
-
) ? e :
|
|
11314
|
+
) ? e : Ne;
|
|
11277
11315
|
}
|
|
11278
|
-
const
|
|
11316
|
+
const Dr = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
11279
11317
|
function je(f) {
|
|
11280
|
-
return
|
|
11318
|
+
return Dr.has(f.toUpperCase());
|
|
11281
11319
|
}
|
|
11282
|
-
function
|
|
11320
|
+
function Nr(f, e) {
|
|
11283
11321
|
for (const [t, r] of Object.entries(e))
|
|
11284
11322
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
11285
|
-
f.append(t,
|
|
11286
|
-
}) : f.append(t,
|
|
11323
|
+
f.append(t, Ce(i));
|
|
11324
|
+
}) : f.append(t, Ce(r)));
|
|
11287
11325
|
}
|
|
11288
|
-
function
|
|
11326
|
+
function Ce(f) {
|
|
11289
11327
|
if (f == null)
|
|
11290
11328
|
return "";
|
|
11291
11329
|
if (typeof f == "object" || typeof f == "function")
|
|
@@ -11298,7 +11336,7 @@ function Fe(f) {
|
|
|
11298
11336
|
}
|
|
11299
11337
|
function Zt(f, e) {
|
|
11300
11338
|
const t = new URL(f, window.location.href), r = new URLSearchParams(t.search);
|
|
11301
|
-
return
|
|
11339
|
+
return Nr(r, e), t.search = r.toString(), t.toString();
|
|
11302
11340
|
}
|
|
11303
11341
|
function xr(f) {
|
|
11304
11342
|
if (f == null)
|
|
@@ -11317,12 +11355,12 @@ function xr(f) {
|
|
|
11317
11355
|
return { payload: {}, dropped: !0 };
|
|
11318
11356
|
}
|
|
11319
11357
|
return e.includes("=") ? {
|
|
11320
|
-
payload:
|
|
11358
|
+
payload: xt(new URLSearchParams(e)),
|
|
11321
11359
|
dropped: !1
|
|
11322
11360
|
} : { payload: {}, dropped: !0 };
|
|
11323
11361
|
}
|
|
11324
11362
|
if (f instanceof URLSearchParams)
|
|
11325
|
-
return { payload:
|
|
11363
|
+
return { payload: xt(f), dropped: !1 };
|
|
11326
11364
|
if (typeof FormData < "u" && f instanceof FormData) {
|
|
11327
11365
|
const e = {};
|
|
11328
11366
|
let t = !1;
|
|
@@ -11337,7 +11375,7 @@ function xr(f) {
|
|
|
11337
11375
|
}
|
|
11338
11376
|
return { payload: {}, dropped: !0 };
|
|
11339
11377
|
}
|
|
11340
|
-
function
|
|
11378
|
+
function xt(f) {
|
|
11341
11379
|
const e = {};
|
|
11342
11380
|
for (const [t, r] of f.entries())
|
|
11343
11381
|
Qt(e, t, r);
|
|
@@ -11348,7 +11386,7 @@ function Qt(f, e, t) {
|
|
|
11348
11386
|
r === void 0 ? f[e] = t : Array.isArray(r) ? r.push(t) : f[e] = [r, t];
|
|
11349
11387
|
}
|
|
11350
11388
|
function we(f, e) {
|
|
11351
|
-
if (
|
|
11389
|
+
if (N.isCompleteSetValue(e))
|
|
11352
11390
|
return e;
|
|
11353
11391
|
if (Array.isArray(e)) {
|
|
11354
11392
|
const t = Array.isArray(f) ? f.slice() : [];
|
|
@@ -11367,11 +11405,11 @@ function we(f, e) {
|
|
|
11367
11405
|
}
|
|
11368
11406
|
return e;
|
|
11369
11407
|
}
|
|
11370
|
-
function
|
|
11408
|
+
function Ir(f) {
|
|
11371
11409
|
const e = f?.body;
|
|
11372
11410
|
return e == null ? !1 : typeof e == "string" ? e !== "" : !0;
|
|
11373
11411
|
}
|
|
11374
|
-
function
|
|
11412
|
+
function Fr(f, e) {
|
|
11375
11413
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
11376
11414
|
if (c.runtime !== "demo" || je(r))
|
|
11377
11415
|
return {
|
|
@@ -11401,7 +11439,7 @@ function Ir(f, e) {
|
|
|
11401
11439
|
queryString: new URL(n, window.location.href).search || void 0
|
|
11402
11440
|
};
|
|
11403
11441
|
}
|
|
11404
|
-
function
|
|
11442
|
+
function Cr(f) {
|
|
11405
11443
|
return f == null ? null : typeof f == "string" ? f : f instanceof URLSearchParams ? f.toString() : f instanceof FormData ? Array.from(f.entries()).map(([e, t]) => t instanceof File ? [
|
|
11406
11444
|
e,
|
|
11407
11445
|
{
|
|
@@ -11417,13 +11455,13 @@ function Ue(f) {
|
|
|
11417
11455
|
Ue
|
|
11418
11456
|
) : !1;
|
|
11419
11457
|
}
|
|
11420
|
-
function
|
|
11458
|
+
function Mr(f) {
|
|
11421
11459
|
return Object.values(f).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
11422
11460
|
(t) => !(t instanceof Blob) && Ue(t)
|
|
11423
11461
|
) : Ue(e));
|
|
11424
11462
|
}
|
|
11425
11463
|
function We(f) {
|
|
11426
|
-
return st(
|
|
11464
|
+
return st(N.getValues(f));
|
|
11427
11465
|
}
|
|
11428
11466
|
function st(f) {
|
|
11429
11467
|
const e = (r) => {
|
|
@@ -11433,7 +11471,7 @@ function st(f) {
|
|
|
11433
11471
|
return "";
|
|
11434
11472
|
if (Array.isArray(r)) {
|
|
11435
11473
|
const i = r.map(e);
|
|
11436
|
-
return
|
|
11474
|
+
return N.carryCollectedRowIdentity(r, i), i;
|
|
11437
11475
|
}
|
|
11438
11476
|
if (r !== null && typeof r == "object") {
|
|
11439
11477
|
const i = {};
|
|
@@ -11441,13 +11479,13 @@ function st(f) {
|
|
|
11441
11479
|
r
|
|
11442
11480
|
))
|
|
11443
11481
|
i[s] = e(n);
|
|
11444
|
-
return
|
|
11482
|
+
return N.carryCollectedRowIdentity(r, i), i;
|
|
11445
11483
|
}
|
|
11446
11484
|
return r;
|
|
11447
11485
|
}, t = {};
|
|
11448
11486
|
for (const [r, i] of Object.entries(f))
|
|
11449
11487
|
t[r] = e(i);
|
|
11450
|
-
return
|
|
11488
|
+
return N.carryCollectedRowIdentity(f, t), t;
|
|
11451
11489
|
}
|
|
11452
11490
|
function $r(f, e) {
|
|
11453
11491
|
const t = new Headers(
|
|
@@ -11459,7 +11497,7 @@ function $r(f, e) {
|
|
|
11459
11497
|
url: f,
|
|
11460
11498
|
method: String(e.method || "GET").toUpperCase(),
|
|
11461
11499
|
headers: r,
|
|
11462
|
-
body:
|
|
11500
|
+
body: Cr(e.body || null)
|
|
11463
11501
|
});
|
|
11464
11502
|
}
|
|
11465
11503
|
const g = class g {
|
|
@@ -11605,7 +11643,7 @@ const g = class g {
|
|
|
11605
11643
|
);
|
|
11606
11644
|
const s = g.attrName(r, "error-"), n = /* @__PURE__ */ new Map();
|
|
11607
11645
|
for (const a of e.getAttributeNames()) {
|
|
11608
|
-
const o = a.startsWith(s) ?
|
|
11646
|
+
const o = a.startsWith(s) ? Nt.exec(a.slice(s.length)) : null;
|
|
11609
11647
|
o && o[2] === "no-message" && n.set(Number(o[1]), {
|
|
11610
11648
|
key: `error-${o[1]}`,
|
|
11611
11649
|
clickFragments: null,
|
|
@@ -11637,7 +11675,7 @@ const g = class g {
|
|
|
11637
11675
|
for (const a of e.getAttributeNames()) {
|
|
11638
11676
|
if (!a.startsWith(i))
|
|
11639
11677
|
continue;
|
|
11640
|
-
const o =
|
|
11678
|
+
const o = Nt.exec(
|
|
11641
11679
|
a.slice(i.length)
|
|
11642
11680
|
);
|
|
11643
11681
|
o && s.add(o[1]);
|
|
@@ -11683,7 +11721,7 @@ const g = class g {
|
|
|
11683
11721
|
* @returns レベル。4 つの値のどれとも一致しない場合は null(`info` で表示する)
|
|
11684
11722
|
*/
|
|
11685
11723
|
static toToastLevel(e) {
|
|
11686
|
-
return
|
|
11724
|
+
return kr.includes(e) ? e : null;
|
|
11687
11725
|
}
|
|
11688
11726
|
/**
|
|
11689
11727
|
* `data-{event}-error-status` の値を、ステータスの一覧へ変換します。
|
|
@@ -11772,7 +11810,7 @@ const g = class g {
|
|
|
11772
11810
|
const r = e.getRawAttribute(t);
|
|
11773
11811
|
let i;
|
|
11774
11812
|
try {
|
|
11775
|
-
i =
|
|
11813
|
+
i = $.parseDataBind(r);
|
|
11776
11814
|
} catch (s) {
|
|
11777
11815
|
return m.error("Haori", `Invalid fetch headers: ${s}`), null;
|
|
11778
11816
|
}
|
|
@@ -11970,7 +12008,7 @@ const g = class g {
|
|
|
11970
12008
|
const a = r.trim();
|
|
11971
12009
|
if (g.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
11972
12010
|
return {
|
|
11973
|
-
value:
|
|
12011
|
+
value: $.parseDataBind(s),
|
|
11974
12012
|
hasUnresolvedReference: n
|
|
11975
12013
|
};
|
|
11976
12014
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
@@ -11979,7 +12017,7 @@ const g = class g {
|
|
|
11979
12017
|
e.getBindingData()
|
|
11980
12018
|
);
|
|
11981
12019
|
return {
|
|
11982
|
-
value:
|
|
12020
|
+
value: $.parseDataBind(l.value),
|
|
11983
12021
|
hasUnresolvedReference: n || l.hasUnresolvedReference
|
|
11984
12022
|
};
|
|
11985
12023
|
}
|
|
@@ -11988,7 +12026,7 @@ const g = class g {
|
|
|
11988
12026
|
e.getBindingData()
|
|
11989
12027
|
);
|
|
11990
12028
|
return {
|
|
11991
|
-
value:
|
|
12029
|
+
value: $.parseDataBind(o.value),
|
|
11992
12030
|
hasUnresolvedReference: n || o.hasUnresolvedReference
|
|
11993
12031
|
};
|
|
11994
12032
|
}
|
|
@@ -12005,7 +12043,7 @@ const g = class g {
|
|
|
12005
12043
|
}, i = t ? g.attrName(t, "if") : g.attrName(null, "if", !0);
|
|
12006
12044
|
if (e.hasAttribute(i)) {
|
|
12007
12045
|
const k = e.getRawAttribute(i);
|
|
12008
|
-
typeof k == "string" && k.trim() !== "" ? (r.conditionExpression =
|
|
12046
|
+
typeof k == "string" && k.trim() !== "" ? (r.conditionExpression = N.unwrapConditionExpression(k), r.conditionAttributeName = i) : m.warn(
|
|
12009
12047
|
"Haori",
|
|
12010
12048
|
`${i} に条件式が指定されていません。`
|
|
12011
12049
|
);
|
|
@@ -12025,16 +12063,16 @@ const g = class g {
|
|
|
12025
12063
|
U,
|
|
12026
12064
|
g.attrName(t, "form")
|
|
12027
12065
|
);
|
|
12028
|
-
Q !== null ? r.formFragment =
|
|
12066
|
+
Q !== null ? r.formFragment = N.getFormFragment(
|
|
12029
12067
|
D.get(Q)
|
|
12030
12068
|
) : m.error(
|
|
12031
12069
|
"Haori",
|
|
12032
12070
|
`Form element not found: ${U} (${g.attrName(t, "form")})`
|
|
12033
12071
|
);
|
|
12034
12072
|
} else
|
|
12035
|
-
r.formFragment =
|
|
12073
|
+
r.formFragment = N.getFormFragment(e);
|
|
12036
12074
|
} else if (t === "change" || t === "input") {
|
|
12037
|
-
r.formFragment =
|
|
12075
|
+
r.formFragment = N.getFormFragment(e);
|
|
12038
12076
|
const U = `${c.prefix}${t}-`;
|
|
12039
12077
|
r.implicitFormFragment = !e.getAttributeNames().some((Q) => Q.startsWith(U)), r.formFragment === null && g.isNamedInputFragment(e) && (r.selfValueFragment = e);
|
|
12040
12078
|
}
|
|
@@ -12045,7 +12083,7 @@ const g = class g {
|
|
|
12045
12083
|
"fetchUrl",
|
|
12046
12084
|
"fetchOptions"
|
|
12047
12085
|
]);
|
|
12048
|
-
U && (r.beforeCallback = (Q,
|
|
12086
|
+
U && (r.beforeCallback = (Q, fe) => U([Q, fe]));
|
|
12049
12087
|
} else if (e.hasAttribute(k)) {
|
|
12050
12088
|
const U = e.getRawAttribute(k);
|
|
12051
12089
|
try {
|
|
@@ -12080,14 +12118,24 @@ ${U}
|
|
|
12080
12118
|
Q = new Function("event", `"use strict";
|
|
12081
12119
|
${U}
|
|
12082
12120
|
`);
|
|
12083
|
-
} catch (
|
|
12084
|
-
m.error("Haori", `Invalid run script: ${
|
|
12121
|
+
} catch (fe) {
|
|
12122
|
+
m.error("Haori", `Invalid run script: ${fe}`);
|
|
12085
12123
|
}
|
|
12086
12124
|
}
|
|
12087
12125
|
Q && (r.runScript = Q);
|
|
12088
12126
|
}
|
|
12089
12127
|
const ue = g.attrName(t, "clipboard");
|
|
12090
|
-
e.hasAttribute(ue) && (r.clipboardAttrName = ue
|
|
12128
|
+
e.hasAttribute(ue) && (r.clipboardAttrName = ue, r.clipboardErrorToastMessage = g.readLateAttribute(
|
|
12129
|
+
e,
|
|
12130
|
+
r,
|
|
12131
|
+
"clipboard-error-toast",
|
|
12132
|
+
g.attrName(t, "clipboard-error-toast")
|
|
12133
|
+
), r.clipboardErrorToastLevel = g.readToastLevel(
|
|
12134
|
+
e,
|
|
12135
|
+
r,
|
|
12136
|
+
"clipboard-error-toast-level",
|
|
12137
|
+
g.attrName(t, "clipboard-error-toast-level")
|
|
12138
|
+
));
|
|
12091
12139
|
}
|
|
12092
12140
|
const s = g.attrName(t, "fetch"), n = e.hasAttribute(s);
|
|
12093
12141
|
if (n) {
|
|
@@ -12155,9 +12203,9 @@ ${U}
|
|
|
12155
12203
|
);
|
|
12156
12204
|
}
|
|
12157
12205
|
}
|
|
12158
|
-
const w = g.attrName(t, "bind-arg"),
|
|
12159
|
-
t ? e.hasAttribute(w) && (r.bindArg = e.getRawAttribute(w)) : e.hasAttribute(
|
|
12160
|
-
|
|
12206
|
+
const w = g.attrName(t, "bind-arg"), M = g.attrName(null, "arg", !0), C = g.attrName(null, "bind-arg", !0);
|
|
12207
|
+
t ? e.hasAttribute(w) && (r.bindArg = e.getRawAttribute(w)) : e.hasAttribute(M) ? r.bindArg = e.getRawAttribute(
|
|
12208
|
+
M
|
|
12161
12209
|
) : e.hasAttribute(C) && (r.bindArg = e.getRawAttribute(C));
|
|
12162
12210
|
const se = t ? g.attrName(t, "bind-params") : g.attrName(null, "bind-params", !0);
|
|
12163
12211
|
if (e.hasAttribute(se)) {
|
|
@@ -12192,8 +12240,8 @@ ${U}
|
|
|
12192
12240
|
g.attrName(t, "adjust")
|
|
12193
12241
|
);
|
|
12194
12242
|
G.length > 0 ? (r.adjustFragments = [], G.forEach((ie) => {
|
|
12195
|
-
const
|
|
12196
|
-
|
|
12243
|
+
const Ae = D.get(ie);
|
|
12244
|
+
Ae && r.adjustFragments.push(Ae);
|
|
12197
12245
|
})) : m.error(
|
|
12198
12246
|
"Haori",
|
|
12199
12247
|
`Adjust element not found: ${W} (${g.attrName(t, "adjust")})`
|
|
@@ -12310,14 +12358,14 @@ ${W}
|
|
|
12310
12358
|
W,
|
|
12311
12359
|
g.attrName(t, "history-form")
|
|
12312
12360
|
);
|
|
12313
|
-
G !== null ? r.historyFormFragment =
|
|
12361
|
+
G !== null ? r.historyFormFragment = N.getFormFragment(
|
|
12314
12362
|
D.get(G)
|
|
12315
12363
|
) : m.error(
|
|
12316
12364
|
"Haori",
|
|
12317
12365
|
`Form element not found: ${W} (${g.attrName(t, "history-form")})`
|
|
12318
12366
|
);
|
|
12319
12367
|
} else
|
|
12320
|
-
r.historyFormFragment =
|
|
12368
|
+
r.historyFormFragment = N.getFormFragment(e);
|
|
12321
12369
|
}
|
|
12322
12370
|
[
|
|
12323
12371
|
"reset-before",
|
|
@@ -12407,14 +12455,14 @@ ${W}
|
|
|
12407
12455
|
k,
|
|
12408
12456
|
g.attrName(null, "form", !0)
|
|
12409
12457
|
);
|
|
12410
|
-
B !== null ? r.formFragment =
|
|
12458
|
+
B !== null ? r.formFragment = N.getFormFragment(
|
|
12411
12459
|
D.get(B)
|
|
12412
12460
|
) : m.error(
|
|
12413
12461
|
"Haori",
|
|
12414
12462
|
`Form element not found: ${k} (${g.attrName(null, "fetch-form", !0)})`
|
|
12415
12463
|
);
|
|
12416
12464
|
} else
|
|
12417
|
-
r.formFragment =
|
|
12465
|
+
r.formFragment = N.getFormFragment(e);
|
|
12418
12466
|
}
|
|
12419
12467
|
(!t || t === "poll") && g.readNoMessageDeclarations(e, r, t ?? "fetch");
|
|
12420
12468
|
const ae = t ? g.attrName(t, "fetch-state") : g.attrName(null, "state", !0);
|
|
@@ -12576,6 +12624,31 @@ ${W}
|
|
|
12576
12624
|
return m.warn("Haori", `${e}: failed to write: ${n}`), Promise.resolve(!1);
|
|
12577
12625
|
}
|
|
12578
12626
|
}
|
|
12627
|
+
/**
|
|
12628
|
+
* クリップボードへ書けずに止まったことをトーストで知らせます。
|
|
12629
|
+
*
|
|
12630
|
+
* 仕様「`data-{event}-clipboard`」の「書けなかったことを知らせる」です。文言と
|
|
12631
|
+
* レベルは表示直前に評価し直します。
|
|
12632
|
+
*
|
|
12633
|
+
* @returns 表示を終えたら解決する Promise
|
|
12634
|
+
*/
|
|
12635
|
+
async showClipboardErrorToast() {
|
|
12636
|
+
const e = g.normalizeAttributeText(
|
|
12637
|
+
this.resolveLateAttribute(
|
|
12638
|
+
"clipboard-error-toast",
|
|
12639
|
+
this.options.clipboardErrorToastMessage
|
|
12640
|
+
)
|
|
12641
|
+
);
|
|
12642
|
+
if (!e)
|
|
12643
|
+
return;
|
|
12644
|
+
const t = g.toToastLevel(
|
|
12645
|
+
this.resolveLateAttribute(
|
|
12646
|
+
"clipboard-error-toast-level",
|
|
12647
|
+
this.options.clipboardErrorToastLevel
|
|
12648
|
+
)
|
|
12649
|
+
);
|
|
12650
|
+
await ge().toast(e, t ?? "info");
|
|
12651
|
+
}
|
|
12579
12652
|
/**
|
|
12580
12653
|
* 一連の処理を実行します。成功結果を内部で扱うための実体です。
|
|
12581
12654
|
*
|
|
@@ -12590,8 +12663,8 @@ ${W}
|
|
|
12590
12663
|
return this.skipped = !0, !1;
|
|
12591
12664
|
if (this.options.formFragment && this.validate(this.options.formFragment) === !1)
|
|
12592
12665
|
return await this.commitEditOnStop(), !1;
|
|
12593
|
-
if (!this.options.formFragment && this.options.targetFragment &&
|
|
12594
|
-
|
|
12666
|
+
if (!this.options.formFragment && this.options.targetFragment && N.warnUnvalidatedCustomValidity(
|
|
12667
|
+
N.getFormFragment(this.options.targetFragment),
|
|
12595
12668
|
`${c.prefix}${this.eventType ?? "fetch"}-form が解決できません`
|
|
12596
12669
|
), !this.evaluateExecutionCondition())
|
|
12597
12670
|
return this.skipped = !0, await this.commitEditOnStop(), !1;
|
|
@@ -12612,14 +12685,14 @@ ${W}
|
|
|
12612
12685
|
m.error("Haori", `Run script execution error: ${A}`);
|
|
12613
12686
|
}
|
|
12614
12687
|
if (r && !await r)
|
|
12615
|
-
return await this.commitEditOnStop(), !1;
|
|
12688
|
+
return await this.commitEditOnStop(), await this.showClipboardErrorToast(), !1;
|
|
12616
12689
|
if (!await this.confirm())
|
|
12617
12690
|
return await this.commitEditOnStop(), !1;
|
|
12618
12691
|
if (this.options.downloadFolder && await this.prepareDownloadFolder() === "cancelled")
|
|
12619
12692
|
return !1;
|
|
12620
12693
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
12621
12694
|
this.options.resetBeforeFragments.map(
|
|
12622
|
-
(A) =>
|
|
12695
|
+
(A) => N.reset(A, this.operationSequence)
|
|
12623
12696
|
)
|
|
12624
12697
|
), this.captureHistorySnapshots());
|
|
12625
12698
|
const s = this.prepareFetchRequest();
|
|
@@ -12646,8 +12719,8 @@ ${W}
|
|
|
12646
12719
|
n,
|
|
12647
12720
|
e
|
|
12648
12721
|
);
|
|
12649
|
-
const A = (l?.method || "GET").toUpperCase(),
|
|
12650
|
-
|
|
12722
|
+
const A = (l?.method || "GET").toUpperCase(), M = !u && d && s.transportMode === "query-get" && Ir(l) && !je(A) ? s.baseUrl ?? o : o, C = Fr(
|
|
12723
|
+
M,
|
|
12651
12724
|
l
|
|
12652
12725
|
);
|
|
12653
12726
|
o = C.url;
|
|
@@ -12754,22 +12827,22 @@ ${W}
|
|
|
12754
12827
|
let l;
|
|
12755
12828
|
if (o) {
|
|
12756
12829
|
l = { ...n ?? {} };
|
|
12757
|
-
const u = String(o), d =
|
|
12758
|
-
l[u] =
|
|
12830
|
+
const u = String(o), d = N.resolveAncestorArgOwner(e, u);
|
|
12831
|
+
l[u] = N.mergeCollectedValues(
|
|
12759
12832
|
(d ? d.value : l[u]) ?? null,
|
|
12760
12833
|
a
|
|
12761
12834
|
);
|
|
12762
12835
|
} else
|
|
12763
|
-
l =
|
|
12836
|
+
l = N.mergeCollectedValues(
|
|
12764
12837
|
n,
|
|
12765
12838
|
a,
|
|
12766
|
-
|
|
12839
|
+
N.ancestorBaseResolver(e)
|
|
12767
12840
|
);
|
|
12768
|
-
await
|
|
12841
|
+
await $.setBindingData(i, l, {
|
|
12769
12842
|
skipFragments: s,
|
|
12770
12843
|
kind: "nonSupply",
|
|
12771
12844
|
sequence: this.operationSequence,
|
|
12772
|
-
editedPaths:
|
|
12845
|
+
editedPaths: N.collectEditedPaths(
|
|
12773
12846
|
e,
|
|
12774
12847
|
this.operationSequence,
|
|
12775
12848
|
o ? String(o) : "",
|
|
@@ -12840,7 +12913,7 @@ ${W}
|
|
|
12840
12913
|
t.removeAttribute("disabled");
|
|
12841
12914
|
return;
|
|
12842
12915
|
}
|
|
12843
|
-
|
|
12916
|
+
$.setAttribute(t, r.name, r.value).catch(
|
|
12844
12917
|
(i) => {
|
|
12845
12918
|
m.error(
|
|
12846
12919
|
"Haori",
|
|
@@ -12934,7 +13007,7 @@ ${W}
|
|
|
12934
13007
|
break;
|
|
12935
13008
|
await t(n), this.downloadReceivedBytes += n.byteLength, this.dropTotalBytesIfExceeded();
|
|
12936
13009
|
const a = Date.now();
|
|
12937
|
-
a - r >=
|
|
13010
|
+
a - r >= Tr && (r = a, await this.injectFetchState("loading"));
|
|
12938
13011
|
}
|
|
12939
13012
|
} catch (s) {
|
|
12940
13013
|
return m.error("Haori", `応答をファイルとして読み取れませんでした: ${s}`), !1;
|
|
@@ -13008,7 +13081,7 @@ ${W}
|
|
|
13008
13081
|
`保存先のフォルダを確かめられなかったため、今までどおり保存します: ${l}`
|
|
13009
13082
|
), "fallback";
|
|
13010
13083
|
}
|
|
13011
|
-
if (n && !await
|
|
13084
|
+
if (n && !await ge().confirm(
|
|
13012
13085
|
`${s} は既にあります。上書きしますか?`
|
|
13013
13086
|
))
|
|
13014
13087
|
return "cancelled";
|
|
@@ -13094,7 +13167,7 @@ ${W}
|
|
|
13094
13167
|
* @returns 表示の完了 Promise
|
|
13095
13168
|
*/
|
|
13096
13169
|
async showDownloadFailure(e) {
|
|
13097
|
-
const t = this.resolveMessageScope(), r =
|
|
13170
|
+
const t = this.resolveMessageScope(), r = ge();
|
|
13098
13171
|
await r.clearMessages(t), e && await r.addErrorMessage(t, Dt);
|
|
13099
13172
|
}
|
|
13100
13173
|
/**
|
|
@@ -13178,7 +13251,7 @@ ${W}
|
|
|
13178
13251
|
* フェッチ後の処理を実行します。
|
|
13179
13252
|
*/
|
|
13180
13253
|
async handleFetchResult(e, t, r) {
|
|
13181
|
-
const i =
|
|
13254
|
+
const i = ge();
|
|
13182
13255
|
if (!e.ok) {
|
|
13183
13256
|
if (Jt(e.status, {
|
|
13184
13257
|
element: this.options.targetFragment.getTarget(),
|
|
@@ -13196,8 +13269,8 @@ ${W}
|
|
|
13196
13269
|
A ? e.clone() : e,
|
|
13197
13270
|
E?.noMessage !== !0 && !A
|
|
13198
13271
|
);
|
|
13199
|
-
return A && await this.bindResult(e).catch((
|
|
13200
|
-
m.error("Haori", "Failed to bind the error response:",
|
|
13272
|
+
return A && await this.bindResult(e).catch((M) => {
|
|
13273
|
+
m.error("Haori", "Failed to bind the error response:", M);
|
|
13201
13274
|
}), await this.injectFetchState(
|
|
13202
13275
|
"error",
|
|
13203
13276
|
e.status,
|
|
@@ -13235,7 +13308,7 @@ ${W}
|
|
|
13235
13308
|
const s = [];
|
|
13236
13309
|
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(
|
|
13237
13310
|
this.options.resetFragments.map(
|
|
13238
|
-
(E) =>
|
|
13311
|
+
(E) => N.reset(E, this.operationSequence)
|
|
13239
13312
|
)
|
|
13240
13313
|
), await this.copy();
|
|
13241
13314
|
const n = [];
|
|
@@ -13299,12 +13372,12 @@ ${W}
|
|
|
13299
13372
|
this.options.redirectReturnParam
|
|
13300
13373
|
);
|
|
13301
13374
|
if (A) {
|
|
13302
|
-
const
|
|
13303
|
-
if (
|
|
13304
|
-
const C =
|
|
13375
|
+
const M = new URLSearchParams(window.location.search).get(A);
|
|
13376
|
+
if (M !== null) {
|
|
13377
|
+
const C = M.trim();
|
|
13305
13378
|
Oe.isSafeLocalPath(C) ? E = C : m.warn(
|
|
13306
13379
|
"Haori",
|
|
13307
|
-
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${
|
|
13380
|
+
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${M}`
|
|
13308
13381
|
);
|
|
13309
13382
|
}
|
|
13310
13383
|
}
|
|
@@ -13341,7 +13414,7 @@ ${W}
|
|
|
13341
13414
|
if (!e || e.length === 0)
|
|
13342
13415
|
return !1;
|
|
13343
13416
|
for (const i of e) {
|
|
13344
|
-
await
|
|
13417
|
+
await $.evaluateAll(i);
|
|
13345
13418
|
const s = i.getTarget();
|
|
13346
13419
|
if (t && g.takeClickOutcome(s), typeof s.click == "function" ? s.click() : s.dispatchEvent(
|
|
13347
13420
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
@@ -13377,7 +13450,7 @@ ${W}
|
|
|
13377
13450
|
`${t.key}-click-await`
|
|
13378
13451
|
))
|
|
13379
13452
|
return;
|
|
13380
|
-
const i =
|
|
13453
|
+
const i = ge(), s = [];
|
|
13381
13454
|
t.closeFragments?.forEach((a) => {
|
|
13382
13455
|
const o = a.getTarget();
|
|
13383
13456
|
o instanceof HTMLElement ? s.push(i.closeDialog(o)) : m.error("Haori", "Element is not an HTML element: ", o);
|
|
@@ -13475,10 +13548,10 @@ ${W}
|
|
|
13475
13548
|
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)));
|
|
13476
13549
|
};
|
|
13477
13550
|
s && l(r), n && l(i), history.pushState(
|
|
13478
|
-
{ [
|
|
13551
|
+
{ [Rr]: !0 },
|
|
13479
13552
|
"",
|
|
13480
13553
|
o.toString()
|
|
13481
|
-
),
|
|
13554
|
+
), $.refreshUrlParams();
|
|
13482
13555
|
} catch (a) {
|
|
13483
13556
|
m.error("Haori", `history.pushState failed: ${a}`);
|
|
13484
13557
|
}
|
|
@@ -13492,7 +13565,7 @@ ${W}
|
|
|
13492
13565
|
* @returns 失敗の表示先の要素
|
|
13493
13566
|
*/
|
|
13494
13567
|
resolveMessageScope() {
|
|
13495
|
-
const e = this.options.formFragment ?? (this.options.targetFragment ?
|
|
13568
|
+
const e = this.options.formFragment ?? (this.options.targetFragment ? N.getFormFragment(this.options.targetFragment) || this.options.targetFragment : null);
|
|
13496
13569
|
return e ? e.getTarget() : document.body;
|
|
13497
13570
|
}
|
|
13498
13571
|
/**
|
|
@@ -13507,12 +13580,12 @@ ${W}
|
|
|
13507
13580
|
*/
|
|
13508
13581
|
async handleFetchError(e, t) {
|
|
13509
13582
|
let r = null;
|
|
13510
|
-
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r =
|
|
13583
|
+
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r = N.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
|
|
13511
13584
|
const i = r ? r.getTarget() : document.body;
|
|
13512
|
-
await
|
|
13585
|
+
await ge().clearMessages(i);
|
|
13513
13586
|
const s = async (u) => {
|
|
13514
13587
|
const d = r ? r.getTarget() : document.body;
|
|
13515
|
-
await
|
|
13588
|
+
await ge().addErrorMessage(d, u);
|
|
13516
13589
|
}, n = () => {
|
|
13517
13590
|
if (!this.options.scrollOnError)
|
|
13518
13591
|
return;
|
|
@@ -13524,7 +13597,7 @@ ${W}
|
|
|
13524
13597
|
if (t) {
|
|
13525
13598
|
u.length === 0 && await s(`${e.status} ${e.statusText}`);
|
|
13526
13599
|
for (const d of u)
|
|
13527
|
-
d.key && r ? await
|
|
13600
|
+
d.key && r ? await N.addErrorMessage(r, d.key, d.message) : await s(d.message);
|
|
13528
13601
|
n();
|
|
13529
13602
|
}
|
|
13530
13603
|
return u.length === 0 ? null : u.map((d) => d.message).join(`
|
|
@@ -13537,12 +13610,12 @@ ${W}
|
|
|
13537
13610
|
const y = /* @__PURE__ */ new Map(), b = [];
|
|
13538
13611
|
for (const E of u)
|
|
13539
13612
|
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
13540
|
-
const A = E.key, w = E.message,
|
|
13613
|
+
const A = E.key, w = E.message, M = typeof A == "string" && A.length > 0 ? A : null, C = typeof w == "string" ? w : w != null ? String(w) : "";
|
|
13541
13614
|
if (C.length === 0)
|
|
13542
13615
|
continue;
|
|
13543
|
-
if (
|
|
13544
|
-
const se = y.get(
|
|
13545
|
-
se.push(C), y.set(
|
|
13616
|
+
if (M !== null) {
|
|
13617
|
+
const se = y.get(M) ?? [];
|
|
13618
|
+
se.push(C), y.set(M, se);
|
|
13546
13619
|
} else
|
|
13547
13620
|
b.push(C);
|
|
13548
13621
|
} else typeof E == "string" && E.length > 0 && b.push(E);
|
|
@@ -13583,11 +13656,11 @@ ${W}
|
|
|
13583
13656
|
*/
|
|
13584
13657
|
validate(e) {
|
|
13585
13658
|
if (this.options.valid !== !0)
|
|
13586
|
-
return this.options.implicitFormFragment ||
|
|
13659
|
+
return this.options.implicitFormFragment || N.warnUnvalidatedCustomValidity(
|
|
13587
13660
|
e,
|
|
13588
13661
|
`${c.prefix}${this.eventType ?? "fetch"}-validate の指定がありません`
|
|
13589
13662
|
), !0;
|
|
13590
|
-
|
|
13663
|
+
N.applyCustomValidity(e);
|
|
13591
13664
|
const t = this.findFirstInvalid(e);
|
|
13592
13665
|
if (t === null)
|
|
13593
13666
|
return !0;
|
|
@@ -13678,7 +13751,7 @@ ${W}
|
|
|
13678
13751
|
const r = this.options.targetFragment;
|
|
13679
13752
|
if (!r)
|
|
13680
13753
|
return !0;
|
|
13681
|
-
const i = this.options.conditionAttributeName ?? `${c.prefix}if`, s =
|
|
13754
|
+
const i = this.options.conditionAttributeName ?? `${c.prefix}if`, s = N.buildConditionScope(
|
|
13682
13755
|
r,
|
|
13683
13756
|
this.options.formFragment ?? null
|
|
13684
13757
|
), n = re.evaluateDetailed(t, s);
|
|
@@ -13726,7 +13799,7 @@ ${W}
|
|
|
13726
13799
|
*/
|
|
13727
13800
|
confirm() {
|
|
13728
13801
|
const e = this.options.confirmMessage;
|
|
13729
|
-
return e == null ? Promise.resolve(!0) :
|
|
13802
|
+
return e == null ? Promise.resolve(!0) : ge().confirm(e);
|
|
13730
13803
|
}
|
|
13731
13804
|
/**
|
|
13732
13805
|
* 結果データを対象のフラグメントにバインドします。
|
|
@@ -13778,11 +13851,11 @@ ${W}
|
|
|
13778
13851
|
apply: (b) => {
|
|
13779
13852
|
const E = this.resolveCurrentRowItem(o, b), A = { ...E };
|
|
13780
13853
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
13781
|
-
const w = E[y],
|
|
13854
|
+
const w = E[y], M = w !== null && typeof w == "object" && !Array.isArray(w) ? w : {};
|
|
13782
13855
|
A[y] = this.mergeAppendBindingData(
|
|
13783
13856
|
o,
|
|
13784
13857
|
i,
|
|
13785
|
-
|
|
13858
|
+
M
|
|
13786
13859
|
);
|
|
13787
13860
|
} else
|
|
13788
13861
|
A[y] = i;
|
|
@@ -13802,7 +13875,7 @@ ${W}
|
|
|
13802
13875
|
} else
|
|
13803
13876
|
u[d] = i;
|
|
13804
13877
|
s.push(
|
|
13805
|
-
|
|
13878
|
+
$.setBindingData(
|
|
13806
13879
|
o.getTarget(),
|
|
13807
13880
|
this.reconcileUserEditsForBind(o, u, [d]),
|
|
13808
13881
|
{
|
|
@@ -13860,7 +13933,7 @@ ${W}
|
|
|
13860
13933
|
i
|
|
13861
13934
|
), d = this.options.bindMerge ? { ...o.getRawBindingData() ?? {}, ...u } : u;
|
|
13862
13935
|
s.push(
|
|
13863
|
-
|
|
13936
|
+
$.setBindingData(
|
|
13864
13937
|
o.getTarget(),
|
|
13865
13938
|
this.reconcileUserEditsForBind(
|
|
13866
13939
|
o,
|
|
@@ -13892,7 +13965,9 @@ ${W}
|
|
|
13892
13965
|
* 1. **送信より前の編集の印を解除する**。バインドは明示的な値の供給なので、
|
|
13893
13966
|
* リクエストを組み立てた時点までの編集は応答(またはバインド指定)に権威を
|
|
13894
13967
|
* 譲ります。解除しないと、宣言バインドの再適用が抑止されたままになり
|
|
13895
|
-
*
|
|
13968
|
+
* 「再取得したのに古い入力が残る」状態になります。譲るのは応答で値が決まる欄
|
|
13969
|
+
* (宣言バインドが応答のキーを参照する欄)だけです
|
|
13970
|
+
* (`Core.clearUserEditMarksSuppliedBy()`)。
|
|
13896
13971
|
* ただしフェッチを伴わない `change` / `input` のバインドは例外で、解除しません
|
|
13897
13972
|
* (`twoWayCommitBind`)。供給されるデータが入力欄から収集した編集値そのもの
|
|
13898
13973
|
* であり、権威を譲る相手がいないためです。解除すると、参照キーと書込キーが
|
|
@@ -13922,14 +13997,14 @@ ${W}
|
|
|
13922
13997
|
if (i === null)
|
|
13923
13998
|
return t;
|
|
13924
13999
|
const s = this.eventType === "poll";
|
|
13925
|
-
if (!s && !this.twoWayCommitBind &&
|
|
14000
|
+
if (!s && !this.twoWayCommitBind && $.clearUserEditMarksSuppliedBy(e, r, i), !(e.getTarget() instanceof HTMLFormElement))
|
|
13926
14001
|
return this.reconcileAncestorArgFormEdits(
|
|
13927
14002
|
e,
|
|
13928
14003
|
t,
|
|
13929
14004
|
r,
|
|
13930
14005
|
s ? 0 : i
|
|
13931
14006
|
);
|
|
13932
|
-
const n =
|
|
14007
|
+
const n = N.getValuesEditedAfter(
|
|
13933
14008
|
e,
|
|
13934
14009
|
s ? 0 : i
|
|
13935
14010
|
);
|
|
@@ -13962,8 +14037,8 @@ ${W}
|
|
|
13962
14037
|
if (r === null)
|
|
13963
14038
|
return t;
|
|
13964
14039
|
const i = this.eventType === "poll";
|
|
13965
|
-
!i && !this.twoWayCommitBind &&
|
|
13966
|
-
const s =
|
|
14040
|
+
!i && !this.twoWayCommitBind && $.clearUserEditMarks(e, r);
|
|
14041
|
+
const s = N.getValuesEditedAfter(
|
|
13967
14042
|
e,
|
|
13968
14043
|
i ? 0 : r
|
|
13969
14044
|
);
|
|
@@ -13986,10 +14061,10 @@ ${W}
|
|
|
13986
14061
|
*/
|
|
13987
14062
|
reconcileAncestorArgFormEdits(e, t, r, i) {
|
|
13988
14063
|
let s = t;
|
|
13989
|
-
for (const { form: n, key: a } of
|
|
14064
|
+
for (const { form: n, key: a } of N.collectArgForms(e)) {
|
|
13990
14065
|
if (!r.includes(a))
|
|
13991
14066
|
continue;
|
|
13992
|
-
const o =
|
|
14067
|
+
const o = N.getValuesEditedAfter(n, i);
|
|
13993
14068
|
if (Object.keys(o).length === 0)
|
|
13994
14069
|
continue;
|
|
13995
14070
|
const l = s[a], u = l && typeof l == "object" && !Array.isArray(l) ? l : {};
|
|
@@ -14036,7 +14111,7 @@ ${W}
|
|
|
14036
14111
|
...t
|
|
14037
14112
|
};
|
|
14038
14113
|
s.push(
|
|
14039
|
-
|
|
14114
|
+
$.setBindingData(n.getTarget(), o, {
|
|
14040
14115
|
// 通番はコピーを起こした操作のもの(フェッチ応答の反映と同じ理由)。
|
|
14041
14116
|
sequence: this.operationSequence
|
|
14042
14117
|
})
|
|
@@ -14069,7 +14144,7 @@ ${W}
|
|
|
14069
14144
|
* @returns 行の入力欄の状態を反映した要素データ
|
|
14070
14145
|
*/
|
|
14071
14146
|
resolveCurrentRowItem(e, t) {
|
|
14072
|
-
const r =
|
|
14147
|
+
const r = N.getValuesEditedAfter(e, 0);
|
|
14073
14148
|
return Object.keys(r).length === 0 ? t : we(t, r);
|
|
14074
14149
|
}
|
|
14075
14150
|
/**
|
|
@@ -14098,9 +14173,9 @@ ${W}
|
|
|
14098
14173
|
* @returns コピー元のデータ
|
|
14099
14174
|
*/
|
|
14100
14175
|
resolveCopySourceData() {
|
|
14101
|
-
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? We(this.options.copySourceFragment) :
|
|
14176
|
+
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? We(this.options.copySourceFragment) : $.withoutReservedBindingKeys(
|
|
14102
14177
|
this.options.copySourceFragment.getRawBindingData() ?? {}
|
|
14103
|
-
) : this.options.formFragment ? We(this.options.formFragment) : this.options.targetFragment ?
|
|
14178
|
+
) : this.options.formFragment ? We(this.options.formFragment) : this.options.targetFragment ? $.withoutReservedBindingKeys(
|
|
14104
14179
|
this.options.targetFragment.getRawBindingData() ?? {}
|
|
14105
14180
|
) : {};
|
|
14106
14181
|
}
|
|
@@ -14114,8 +14189,8 @@ ${W}
|
|
|
14114
14189
|
let t = !1;
|
|
14115
14190
|
const r = this.options.formFragment ?? this.options.selfValueFragment;
|
|
14116
14191
|
if (r) {
|
|
14117
|
-
const i =
|
|
14118
|
-
Object.assign(e, i),
|
|
14192
|
+
const i = N.getValues(r);
|
|
14193
|
+
Object.assign(e, i), N.carryCollectedRowIdentity(i, e);
|
|
14119
14194
|
}
|
|
14120
14195
|
if (this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
|
|
14121
14196
|
const i = g.resolveDataAttributeDetailed(
|
|
@@ -14214,7 +14289,7 @@ ${W}
|
|
|
14214
14289
|
), o = (n.method || "GET").toUpperCase(), l = c.runtime === "demo" && !je(o), u = l ? "GET" : o;
|
|
14215
14290
|
if (n.method = u, Object.keys(i).length > 0 && Ue(i)) {
|
|
14216
14291
|
const y = a.get("Content-Type") || "";
|
|
14217
|
-
!je(o) && /multipart\/form-data/i.test(y) ?
|
|
14292
|
+
!je(o) && /multipart\/form-data/i.test(y) ? Mr(i) && m.warn(
|
|
14218
14293
|
"Haori",
|
|
14219
14294
|
`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.`
|
|
14220
14295
|
) : m.warn(
|
|
@@ -14231,13 +14306,13 @@ ${W}
|
|
|
14231
14306
|
const b = new FormData();
|
|
14232
14307
|
for (const [E, A] of Object.entries(i))
|
|
14233
14308
|
A == null ? b.append(E, "") : A instanceof Blob ? b.append(E, A) : Array.isArray(A) ? A.forEach((w) => {
|
|
14234
|
-
w instanceof Blob ? b.append(E, w) : b.append(E,
|
|
14235
|
-
}) : b.append(E,
|
|
14309
|
+
w instanceof Blob ? b.append(E, w) : b.append(E, Ce(w));
|
|
14310
|
+
}) : b.append(E, Ce(A));
|
|
14236
14311
|
n.body = b;
|
|
14237
14312
|
} else if (/application\/x-www-form-urlencoded/i.test(y)) {
|
|
14238
14313
|
const b = new URLSearchParams();
|
|
14239
14314
|
for (const [E, A] of Object.entries(i))
|
|
14240
|
-
A !== void 0 && (Array.isArray(A) ? A.forEach((w) => b.append(E,
|
|
14315
|
+
A !== void 0 && (Array.isArray(A) ? A.forEach((w) => b.append(E, Ce(w))) : b.append(E, Ce(A)));
|
|
14241
14316
|
n.body = b;
|
|
14242
14317
|
} else
|
|
14243
14318
|
a.set("Content-Type", "application/json"), n.body = JSON.stringify(i);
|
|
@@ -14632,11 +14707,11 @@ ${W}
|
|
|
14632
14707
|
);
|
|
14633
14708
|
continue;
|
|
14634
14709
|
}
|
|
14635
|
-
a[d] = b, o = !0, u.syncWhenUnchanged === "supply" &&
|
|
14710
|
+
a[d] = b, o = !0, u.syncWhenUnchanged === "supply" && N.clearRowUserEditMarksForChangedKeys(u.row, b);
|
|
14636
14711
|
}
|
|
14637
14712
|
if (!o)
|
|
14638
14713
|
return;
|
|
14639
|
-
const l =
|
|
14714
|
+
const l = $.setBindingData(
|
|
14640
14715
|
n.owner.getTarget(),
|
|
14641
14716
|
g.withPathValue(n.ownerData, n.path, a),
|
|
14642
14717
|
{
|
|
@@ -14652,7 +14727,7 @@ ${W}
|
|
|
14652
14727
|
sequence: this.operationSequence
|
|
14653
14728
|
}
|
|
14654
14729
|
);
|
|
14655
|
-
if (
|
|
14730
|
+
if ($.isEachUpdateRunning(s)) {
|
|
14656
14731
|
l.catch((u) => {
|
|
14657
14732
|
m.error("Haori", "Failed to write row data.", u);
|
|
14658
14733
|
});
|
|
@@ -14682,7 +14757,7 @@ ${W}
|
|
|
14682
14757
|
* @returns 反映完了の Promise
|
|
14683
14758
|
*/
|
|
14684
14759
|
static syncUnchangedRowValues(e, t, r) {
|
|
14685
|
-
return r === "supply" &&
|
|
14760
|
+
return r === "supply" && N.clearRowUserEditMarksForChangedKeys(e, t), N.syncRowValues(e, t);
|
|
14686
14761
|
}
|
|
14687
14762
|
/**
|
|
14688
14763
|
* 行の要素データが同じ内容かどうかを判定します。
|
|
@@ -14748,7 +14823,7 @@ ${W}
|
|
|
14748
14823
|
if (a && o !== null) {
|
|
14749
14824
|
const l = [];
|
|
14750
14825
|
r.forEach((y, b) => {
|
|
14751
|
-
|
|
14826
|
+
$.createListKey(
|
|
14752
14827
|
y,
|
|
14753
14828
|
String(a),
|
|
14754
14829
|
b
|
|
@@ -14867,14 +14942,14 @@ ${W}
|
|
|
14867
14942
|
if (g.isSameRowItem(i.array[E], b))
|
|
14868
14943
|
return;
|
|
14869
14944
|
const A = y.get(
|
|
14870
|
-
|
|
14945
|
+
$.createListKey(
|
|
14871
14946
|
b,
|
|
14872
14947
|
null,
|
|
14873
14948
|
E
|
|
14874
14949
|
)
|
|
14875
14950
|
);
|
|
14876
|
-
A &&
|
|
14877
|
-
}),
|
|
14951
|
+
A && $.clearUserEditMarks(A);
|
|
14952
|
+
}), $.setBindingData(
|
|
14878
14953
|
i.owner.getTarget(),
|
|
14879
14954
|
g.withPathValue(i.ownerData, i.path, d),
|
|
14880
14955
|
{
|
|
@@ -14919,7 +14994,7 @@ ${W}
|
|
|
14919
14994
|
...a.getRawBindingData() ?? {},
|
|
14920
14995
|
_fetch: n
|
|
14921
14996
|
};
|
|
14922
|
-
return
|
|
14997
|
+
return $.setBindingData(o, l, {
|
|
14923
14998
|
reflectToAttribute: !1,
|
|
14924
14999
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
14925
15000
|
// 解除しない)。
|
|
@@ -14932,7 +15007,7 @@ ${W}
|
|
|
14932
15007
|
};
|
|
14933
15008
|
g.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, g.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, g.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet(), g.CLICK_OUTCOMES = /* @__PURE__ */ new WeakMap(), g.validationReportGeneration = 0, g.VALIDATION_SCROLL_TIMEOUT_MS = 1e3, g.VALIDATION_SCROLL_STABLE_FRAMES = 2;
|
|
14934
15009
|
let he = g;
|
|
14935
|
-
class
|
|
15010
|
+
class Pr {
|
|
14936
15011
|
/**
|
|
14937
15012
|
* 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
|
|
14938
15013
|
*
|
|
@@ -15081,6 +15156,109 @@ const h = class h {
|
|
|
15081
15156
|
r instanceof R && h.clearUserEditMarks(r, t);
|
|
15082
15157
|
});
|
|
15083
15158
|
}
|
|
15159
|
+
/**
|
|
15160
|
+
* 取得の応答で値が決まる入力欄から、ユーザー編集の印を解除します。
|
|
15161
|
+
*
|
|
15162
|
+
* 印が抑止するのは宣言バインド(`value` / `checked` / `selected` と `data-attr-*`)
|
|
15163
|
+
* の再適用だけです。`name` で流し込まれる値は、印ではなく通番で適用の可否が
|
|
15164
|
+
* 決まります(`ElementFragment.canApplyValue()`)。そのため、解除するのは宣言
|
|
15165
|
+
* バインドが応答のキーを参照する欄に限ります。応答と関係のない宣言(定数や、
|
|
15166
|
+
* 別のデータを参照する式)の欄の印まで解除すると、その応答の反映で入力した値が
|
|
15167
|
+
* 既定値へ戻ります(仕様「ユーザー編集と宣言バインドの権威」)。
|
|
15168
|
+
*
|
|
15169
|
+
* @param fragment 応答を反映するフラグメント
|
|
15170
|
+
* @param keys 応答が持つキー
|
|
15171
|
+
* @param upTo この通し番号までの編集を解除対象とする
|
|
15172
|
+
* @return 戻り値はありません。
|
|
15173
|
+
*/
|
|
15174
|
+
static clearUserEditMarksSuppliedBy(e, t, r) {
|
|
15175
|
+
h.clearUserEditMarksReferencing(e, new Set(t), r);
|
|
15176
|
+
}
|
|
15177
|
+
/**
|
|
15178
|
+
* 指定した名前を参照する宣言バインドを持つ入力欄から、ユーザー編集の印を解除
|
|
15179
|
+
* します。
|
|
15180
|
+
*
|
|
15181
|
+
* `option` の `selected` は所属する `<select>` の印で守られるため、`<select>` の
|
|
15182
|
+
* 印を解除します(`ElementFragment.hasPendingCheckableUserEdit()` と同じ対応)。
|
|
15183
|
+
* `option` の `value` など、選択を決めない宣言では解除しません。選択肢を取り直した
|
|
15184
|
+
* だけで、`<select>` で選んだ値が既定値へ戻らないようにするためです。
|
|
15185
|
+
*
|
|
15186
|
+
* @param fragment 走査中のフラグメント
|
|
15187
|
+
* @param names このフラグメントから見て応答の値に解決される名前
|
|
15188
|
+
* @param upTo この通し番号までの編集を解除対象とする
|
|
15189
|
+
* @return 戻り値はありません。
|
|
15190
|
+
*/
|
|
15191
|
+
static clearUserEditMarksReferencing(e, t, r) {
|
|
15192
|
+
const i = e.getTarget(), s = i instanceof HTMLOptionElement;
|
|
15193
|
+
if (h.declaresReferencing(
|
|
15194
|
+
e,
|
|
15195
|
+
s ? h.OPTION_BINDING_ATTRIBUTES : h.VALUE_BINDING_ATTRIBUTES,
|
|
15196
|
+
t
|
|
15197
|
+
)) {
|
|
15198
|
+
const n = s ? D.get(i.closest("select")) : e;
|
|
15199
|
+
n instanceof R && n.clearUserEditMark(r);
|
|
15200
|
+
}
|
|
15201
|
+
e.getChildren().forEach((n) => {
|
|
15202
|
+
n instanceof R && h.clearUserEditMarksReferencing(
|
|
15203
|
+
n,
|
|
15204
|
+
h.resolveNamesInChild(e, n, t),
|
|
15205
|
+
r
|
|
15206
|
+
);
|
|
15207
|
+
});
|
|
15208
|
+
}
|
|
15209
|
+
/**
|
|
15210
|
+
* 子のフラグメントから見て、応答の値に解決される名前を返します。
|
|
15211
|
+
*
|
|
15212
|
+
* 子が自身のバインドデータで同じ名前を持つと、その名前は子の値に解決されます
|
|
15213
|
+
* (遮蔽)。`data-each` の行は例外で、行の名前(`data-each-arg` など)は要素データ
|
|
15214
|
+
* に解決されるため、`data-each` の式が応答の値を参照していれば応答の値に解決
|
|
15215
|
+
* されるとみなします。
|
|
15216
|
+
*
|
|
15217
|
+
* @param parent 親のフラグメント
|
|
15218
|
+
* @param child 子のフラグメント
|
|
15219
|
+
* @param names 親から見て応答の値に解決される名前
|
|
15220
|
+
* @returns 子から見て応答の値に解決される名前
|
|
15221
|
+
*/
|
|
15222
|
+
static resolveNamesInChild(e, t, r) {
|
|
15223
|
+
const i = Object.keys(t.getRawBindingData() ?? {}), s = e.getRawAttribute(`${c.prefix}each`), n = t.getListKey() !== null && typeof s == "string" && h.referencesAny([s], r), a = new Set(r);
|
|
15224
|
+
return i.forEach((o) => {
|
|
15225
|
+
n ? a.add(o) : a.delete(o);
|
|
15226
|
+
}), a;
|
|
15227
|
+
}
|
|
15228
|
+
/**
|
|
15229
|
+
* 指定した属性の宣言バインド(素の属性の式と `data-attr-*`)が、指定した名前を
|
|
15230
|
+
* 参照するかを判定します。
|
|
15231
|
+
*
|
|
15232
|
+
* @param fragment 判定対象のフラグメント
|
|
15233
|
+
* @param attributes 属性の名前(接頭辞なし)
|
|
15234
|
+
* @param names 名前の集合
|
|
15235
|
+
* @returns 参照する場合 true
|
|
15236
|
+
*/
|
|
15237
|
+
static declaresReferencing(e, t, r) {
|
|
15238
|
+
return t.some(
|
|
15239
|
+
(i) => [i, `${c.prefix}attr-${i}`].some((s) => {
|
|
15240
|
+
const n = e.getRawAttribute(s);
|
|
15241
|
+
return typeof n == "string" && h.referencesAny(h.extractInterpolations(n), r);
|
|
15242
|
+
})
|
|
15243
|
+
);
|
|
15244
|
+
}
|
|
15245
|
+
/**
|
|
15246
|
+
* 式のいずれかが、指定した名前のいずれかを参照するかを判定します。
|
|
15247
|
+
*
|
|
15248
|
+
* 参照名を取り出せない式(解析できない式や定数)は、どの名前も参照しないものと
|
|
15249
|
+
* して扱います。
|
|
15250
|
+
*
|
|
15251
|
+
* @param expressions 式の一覧
|
|
15252
|
+
* @param names 名前の集合
|
|
15253
|
+
* @returns 参照する場合 true
|
|
15254
|
+
*/
|
|
15255
|
+
static referencesAny(e, t) {
|
|
15256
|
+
return e.some(
|
|
15257
|
+
(r) => re.getFreeIdentifiers(r).some(
|
|
15258
|
+
(i) => t.has(i)
|
|
15259
|
+
)
|
|
15260
|
+
);
|
|
15261
|
+
}
|
|
15084
15262
|
/**
|
|
15085
15263
|
* data-fetch の再評価状態を取得します。
|
|
15086
15264
|
*
|
|
@@ -15126,7 +15304,7 @@ const h = class h {
|
|
|
15126
15304
|
if (t.has(e) || !e.isInitialized())
|
|
15127
15305
|
return Promise.resolve();
|
|
15128
15306
|
const r = [];
|
|
15129
|
-
return e.hasAttribute(`${c.prefix}validity`) &&
|
|
15307
|
+
return e.hasAttribute(`${c.prefix}validity`) && N.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) => {
|
|
15130
15308
|
i instanceof R && r.push(
|
|
15131
15309
|
h.reevaluateReactiveSpecialAttributes(i, t)
|
|
15132
15310
|
);
|
|
@@ -15180,7 +15358,7 @@ const h = class h {
|
|
|
15180
15358
|
return Promise.resolve();
|
|
15181
15359
|
r.lastUrl = s, r.running = !0;
|
|
15182
15360
|
const n = performance.now();
|
|
15183
|
-
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, s),
|
|
15361
|
+
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, s), Pr.load(s, void 0, {
|
|
15184
15362
|
element: t,
|
|
15185
15363
|
attrPrefix: `${c.prefix}import-`
|
|
15186
15364
|
}).then((a) => {
|
|
@@ -15248,7 +15426,7 @@ const h = class h {
|
|
|
15248
15426
|
if (!r)
|
|
15249
15427
|
return Promise.resolve();
|
|
15250
15428
|
const i = h.initializeElementFragment(r, !1).then(
|
|
15251
|
-
() =>
|
|
15429
|
+
() => N.restoreInitialValues(e)
|
|
15252
15430
|
);
|
|
15253
15431
|
return h.initialValueRestores.add(i), i.then(() => {
|
|
15254
15432
|
h.initialValueRestores.delete(i), t && le.applySubtree(e);
|
|
@@ -15362,7 +15540,7 @@ const h = class h {
|
|
|
15362
15540
|
e.getRawAttribute(s)
|
|
15363
15541
|
))), r.add(s));
|
|
15364
15542
|
}
|
|
15365
|
-
return t.then(() => (e.markInitialized(),
|
|
15543
|
+
return t.then(() => (e.markInitialized(), N.prepareFormName(e)));
|
|
15366
15544
|
}
|
|
15367
15545
|
/**
|
|
15368
15546
|
* 子孫初期化をスキップすべきかどうかを返します。
|
|
@@ -15465,7 +15643,7 @@ const h = class h {
|
|
|
15465
15643
|
break;
|
|
15466
15644
|
case `${c.prefix}validity`:
|
|
15467
15645
|
case `${c.prefix}validity-message`:
|
|
15468
|
-
return r !== null &&
|
|
15646
|
+
return r !== null && N.applyCustomValidity(n), Promise.all(o).then(() => {
|
|
15469
15647
|
});
|
|
15470
15648
|
case `${c.prefix}url-param`: {
|
|
15471
15649
|
const y = n.getAttribute(`${c.prefix}url-arg`), b = Oe.readParams();
|
|
@@ -15538,27 +15716,27 @@ const h = class h {
|
|
|
15538
15716
|
const A = () => {
|
|
15539
15717
|
i.markBindingWorkStart();
|
|
15540
15718
|
const w = i.getRawBindingData() ?? E;
|
|
15541
|
-
let
|
|
15719
|
+
let M = a ? i.setAttribute(
|
|
15542
15720
|
`${c.prefix}bind`,
|
|
15543
15721
|
JSON.stringify(h.withoutReservedBindingKeys(w))
|
|
15544
15722
|
) : Promise.resolve();
|
|
15545
|
-
return e.tagName === "FORM" && (
|
|
15723
|
+
return e.tagName === "FORM" && (M = M.then(() => {
|
|
15546
15724
|
if (i.wasResetAfter(y))
|
|
15547
15725
|
return;
|
|
15548
15726
|
const C = i.getRawBindingData() ?? E;
|
|
15549
|
-
return
|
|
15727
|
+
return N.syncValues(
|
|
15550
15728
|
i,
|
|
15551
|
-
|
|
15729
|
+
N.resolveSyncValues(i, C),
|
|
15552
15730
|
!1,
|
|
15553
15731
|
u
|
|
15554
15732
|
);
|
|
15555
|
-
})),
|
|
15556
|
-
() =>
|
|
15557
|
-
),
|
|
15733
|
+
})), M = M.then(
|
|
15734
|
+
() => N.syncAncestorArgForms(i, y, u, b)
|
|
15735
|
+
), M = M.then(() => h.evaluateAll(i, s)), M = M.then(
|
|
15558
15736
|
() => R.retryUnappliedValueWrites(e, y)
|
|
15559
|
-
),
|
|
15737
|
+
), M = M.then(
|
|
15560
15738
|
() => h.reevaluateReactiveSpecialAttributes(i, s)
|
|
15561
|
-
),
|
|
15739
|
+
), M.then(
|
|
15562
15740
|
() => i.markBindingWorkEnd(),
|
|
15563
15741
|
(C) => {
|
|
15564
15742
|
throw i.markBindingWorkEnd(), C;
|
|
@@ -15634,12 +15812,12 @@ const h = class h {
|
|
|
15634
15812
|
...Object.keys(y)
|
|
15635
15813
|
]);
|
|
15636
15814
|
for (const w of A) {
|
|
15637
|
-
const
|
|
15815
|
+
const M = s === "" ? w : `${s}.${w}`, C = h.mergePathAuthority(
|
|
15638
15816
|
e,
|
|
15639
15817
|
Object.prototype.hasOwnProperty.call(d, w) ? d[w] : h.ABSENT_PATH,
|
|
15640
15818
|
Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH,
|
|
15641
15819
|
i,
|
|
15642
|
-
|
|
15820
|
+
M,
|
|
15643
15821
|
n
|
|
15644
15822
|
);
|
|
15645
15823
|
C !== h.ABSENT_PATH && (b[w] = C), C !== (Object.prototype.hasOwnProperty.call(y, w) ? y[w] : h.ABSENT_PATH) && (E = !0);
|
|
@@ -15980,20 +16158,20 @@ const h = class h {
|
|
|
15980
16158
|
i.push(r.setValue(t));
|
|
15981
16159
|
const s = h.getFormFragment(r);
|
|
15982
16160
|
if (s) {
|
|
15983
|
-
const n =
|
|
16161
|
+
const n = N.getValues(s), a = s.getAttribute(`${c.prefix}form-arg`), o = s.getRawBindingData();
|
|
15984
16162
|
let l;
|
|
15985
16163
|
if (a) {
|
|
15986
16164
|
l = { ...o ?? {} };
|
|
15987
|
-
const u = String(a), d =
|
|
15988
|
-
l[u] =
|
|
16165
|
+
const u = String(a), d = N.resolveAncestorArgOwner(s, u);
|
|
16166
|
+
l[u] = N.mergeCollectedValues(
|
|
15989
16167
|
(d ? d.value : l[u]) ?? null,
|
|
15990
16168
|
n
|
|
15991
16169
|
);
|
|
15992
16170
|
} else
|
|
15993
|
-
l =
|
|
16171
|
+
l = N.mergeCollectedValues(
|
|
15994
16172
|
o,
|
|
15995
16173
|
n,
|
|
15996
|
-
|
|
16174
|
+
N.ancestorBaseResolver(s)
|
|
15997
16175
|
);
|
|
15998
16176
|
i.push(
|
|
15999
16177
|
// 値の設定に伴うコミットなので、値の供給ではない更新として扱う(権威を
|
|
@@ -17079,7 +17257,7 @@ ${i}
|
|
|
17079
17257
|
const ee = A.get(Z);
|
|
17080
17258
|
ee ? ee.push(F) : A.set(Z, [F]);
|
|
17081
17259
|
});
|
|
17082
|
-
const w = e.getChildElementFragments().filter((F) => !b.has(F)),
|
|
17260
|
+
const w = e.getChildElementFragments().filter((F) => !b.has(F)), M = w.filter(
|
|
17083
17261
|
(F) => F.hasAttribute(`${c.prefix}each-before`)
|
|
17084
17262
|
).length;
|
|
17085
17263
|
let C = Promise.resolve();
|
|
@@ -17090,7 +17268,7 @@ ${i}
|
|
|
17090
17268
|
const ae = A.get(F)?.shift();
|
|
17091
17269
|
if (ae) {
|
|
17092
17270
|
K = ae;
|
|
17093
|
-
const j =
|
|
17271
|
+
const j = M + Z;
|
|
17094
17272
|
C = C.then(
|
|
17095
17273
|
() => h.updateRowFragment(
|
|
17096
17274
|
K,
|
|
@@ -17113,7 +17291,7 @@ ${i}
|
|
|
17113
17291
|
B !== null && O.rowMove(
|
|
17114
17292
|
K.getTarget(),
|
|
17115
17293
|
F,
|
|
17116
|
-
B -
|
|
17294
|
+
B - M,
|
|
17117
17295
|
Z
|
|
17118
17296
|
), !(!k && h.isRowLocalEachTemplate(e)) && se.push(
|
|
17119
17297
|
h.evaluateAll(
|
|
@@ -17127,7 +17305,7 @@ ${i}
|
|
|
17127
17305
|
);
|
|
17128
17306
|
} else {
|
|
17129
17307
|
K = r.clone();
|
|
17130
|
-
const j =
|
|
17308
|
+
const j = M + Z;
|
|
17131
17309
|
C = C.then(
|
|
17132
17310
|
() => h.updateRowFragment(
|
|
17133
17311
|
K,
|
|
@@ -17263,7 +17441,7 @@ ${i}
|
|
|
17263
17441
|
* @returns 反映完了の Promise
|
|
17264
17442
|
*/
|
|
17265
17443
|
static applyRowFormValues(e, t, r) {
|
|
17266
|
-
return !e.hasAttribute(`${c.prefix}form-list`) || !
|
|
17444
|
+
return !e.hasAttribute(`${c.prefix}form-list`) || !N.isCollectedListFromEachSource(e) || typeof r != "object" || r === null || Array.isArray(r) ? Promise.resolve() : N.syncRowValues(t, r);
|
|
17267
17445
|
}
|
|
17268
17446
|
/**
|
|
17269
17447
|
* リスト比較用のキーを生成します。
|
|
@@ -17450,9 +17628,9 @@ h.ATTRIBUTE_ALIAS_SUFFIX = "attr-", h.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
17450
17628
|
"store-type",
|
|
17451
17629
|
"enhance",
|
|
17452
17630
|
"enhance-new"
|
|
17453
|
-
]), h.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), h.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), h.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), h.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), h.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), h.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), h.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), h.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), h.ABSENT_PATH = Symbol("absent");
|
|
17454
|
-
let
|
|
17455
|
-
const
|
|
17631
|
+
]), h.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), h.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), h.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), h.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), h.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), h.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), h.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), h.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), h.VALUE_BINDING_ATTRIBUTES = ["value", "checked"], h.OPTION_BINDING_ATTRIBUTES = ["selected"], h.ABSENT_PATH = Symbol("absent");
|
|
17632
|
+
let $ = h;
|
|
17633
|
+
const be = class be {
|
|
17456
17634
|
/**
|
|
17457
17635
|
* コンストラクタ。
|
|
17458
17636
|
*
|
|
@@ -17460,7 +17638,7 @@ const Me = class Me {
|
|
|
17460
17638
|
*/
|
|
17461
17639
|
constructor(e = document) {
|
|
17462
17640
|
this.customEventHandlers = /* @__PURE__ */ new Map(), this.builtinListenersAdded = !1, this.deferred = !1, this.deferredProcedures = [], this.onClick = (t) => this.delegate(t, "click"), this.onReset = (t) => {
|
|
17463
|
-
if (t.defaultPrevented ||
|
|
17641
|
+
if (t.defaultPrevented || N.isResettingInternally())
|
|
17464
17642
|
return;
|
|
17465
17643
|
const r = t.target;
|
|
17466
17644
|
r instanceof HTMLElement && setTimeout(() => le.refreshSubtree(r), 0);
|
|
@@ -17472,8 +17650,8 @@ const Me = class Me {
|
|
|
17472
17650
|
this.runWindowLoadProcedure();
|
|
17473
17651
|
}, this.onPopstate = (t) => {
|
|
17474
17652
|
const r = t.state;
|
|
17475
|
-
if (!r || r[
|
|
17476
|
-
|
|
17653
|
+
if (!r || r[be.HISTORY_STATE_KEY] !== !0) {
|
|
17654
|
+
$.refreshUrlParams();
|
|
17477
17655
|
return;
|
|
17478
17656
|
}
|
|
17479
17657
|
location.reload();
|
|
@@ -17580,7 +17758,7 @@ const Me = class Me {
|
|
|
17580
17758
|
subscribeCustomEvent(e) {
|
|
17581
17759
|
if (e === null || e === "")
|
|
17582
17760
|
return;
|
|
17583
|
-
if (
|
|
17761
|
+
if (be.BUILTIN_EVENT_NAMES.has(e)) {
|
|
17584
17762
|
m.warn(
|
|
17585
17763
|
"[Haori]",
|
|
17586
17764
|
`data-on="${e}" は組み込みイベントです。data-${e}-* を使用してください(data-on はカスタムイベント専用)。`
|
|
@@ -17676,7 +17854,7 @@ const Me = class Me {
|
|
|
17676
17854
|
}
|
|
17677
17855
|
}
|
|
17678
17856
|
if (r.hasAttribute(`${c.prefix}${t}-prevent`) && e.preventDefault(), this.deferred) {
|
|
17679
|
-
this.deferredProcedures.push(() => {
|
|
17857
|
+
(t === "change" || t === "input") && this.markUserEditDuringInit(r, t === "change"), this.deferredProcedures.push(() => {
|
|
17680
17858
|
r.isConnected && this.runProcedureFor(r, t, e);
|
|
17681
17859
|
});
|
|
17682
17860
|
return;
|
|
@@ -17732,12 +17910,17 @@ const Me = class Me {
|
|
|
17732
17910
|
* 対象は値を持つ入力要素だけです。`contenteditable` など値収集の対象でない要素で
|
|
17733
17911
|
* `input` が発火しても、記録すべき編集はありません。
|
|
17734
17912
|
*
|
|
17913
|
+
* 初期化中も受けた時点で記録します(`markUserEditDuringInit()`)。フラグメントが
|
|
17914
|
+
* まだ無い要素だけは、初期化完了後に記録します。
|
|
17915
|
+
*
|
|
17735
17916
|
* @param element 編集された要素
|
|
17736
17917
|
* @returns 戻り値はない。
|
|
17737
17918
|
*/
|
|
17738
17919
|
recordUserEdit(e) {
|
|
17739
17920
|
if (!(!(e instanceof HTMLInputElement) && !(e instanceof HTMLSelectElement) && !(e instanceof HTMLTextAreaElement))) {
|
|
17740
17921
|
if (this.deferred) {
|
|
17922
|
+
if (this.markUserEditDuringInit(e, !1))
|
|
17923
|
+
return;
|
|
17741
17924
|
this.deferredProcedures.push(() => {
|
|
17742
17925
|
e.isConnected && this.markUserEditOnly(e);
|
|
17743
17926
|
});
|
|
@@ -17756,6 +17939,51 @@ const Me = class Me {
|
|
|
17756
17939
|
const t = D.get(e);
|
|
17757
17940
|
t instanceof R && t.markUserEdit();
|
|
17758
17941
|
}
|
|
17942
|
+
/**
|
|
17943
|
+
* 初期化中に受けた `input` / `change` について、ユーザー編集の印だけを付けます。
|
|
17944
|
+
*
|
|
17945
|
+
* 初期化中は手続きの実行を `release()` まで保留しますが、編集の印は手続きでは
|
|
17946
|
+
* ありません。印まで保留すると、初回の取得の応答を反映する再評価が、宣言バインドの
|
|
17947
|
+
* 評価結果で入力した値を上書きします(仕様「初期スキャン中に発火したイベントの
|
|
17948
|
+
* 扱い」)。内部値の同期は、今までどおり再生した手続きで行います。
|
|
17949
|
+
*
|
|
17950
|
+
* `change` の時点の決め方は `syncUserEdit()` と同じです。打鍵が先にあればその時点を
|
|
17951
|
+
* 保ち(`markUserEditOnDeferredChange()`)、ラジオボタンは排他で外れた同名の欄にも
|
|
17952
|
+
* 印を付けます。
|
|
17953
|
+
*
|
|
17954
|
+
* 編集された要素のフラグメントがまだ無い場合は作らず、今までどおり初期化完了後に
|
|
17955
|
+
* 記録します。走査より先にフラグメントを作ると、その要素を既知のノードとして扱って
|
|
17956
|
+
* しまうためです。
|
|
17957
|
+
*
|
|
17958
|
+
* @param element 編集された要素
|
|
17959
|
+
* @param isChange `change` による呼び出しかどうか
|
|
17960
|
+
* @returns 印を付けた場合 true。フラグメントがまだ無い場合 false
|
|
17961
|
+
*/
|
|
17962
|
+
markUserEditDuringInit(e, t) {
|
|
17963
|
+
const r = D.peek(e);
|
|
17964
|
+
return r instanceof R ? t ? (r.markUserEditOnDeferredChange(), be.radioGroupMembers(e).forEach(
|
|
17965
|
+
(i) => i.markUserEdit()
|
|
17966
|
+
), !0) : (r.markUserEdit(), !0) : !1;
|
|
17967
|
+
}
|
|
17968
|
+
/**
|
|
17969
|
+
* ラジオボタンについて、同一フォームスコープの同名のラジオボタン(自身を除く)の
|
|
17970
|
+
* フラグメントを返します。ラジオボタンでなければ空です。
|
|
17971
|
+
*
|
|
17972
|
+
* @param element 対象の要素
|
|
17973
|
+
* @returns 同名のラジオボタンのフラグメント
|
|
17974
|
+
*/
|
|
17975
|
+
static radioGroupMembers(e) {
|
|
17976
|
+
if (!(e instanceof HTMLInputElement) || e.type !== "radio" || !e.name)
|
|
17977
|
+
return [];
|
|
17978
|
+
const t = [];
|
|
17979
|
+
for (const r of Array.from(document.getElementsByName(e.name))) {
|
|
17980
|
+
if (r === e || !(r instanceof HTMLInputElement) || r.type !== "radio" || r.form !== e.form)
|
|
17981
|
+
continue;
|
|
17982
|
+
const i = D.get(r);
|
|
17983
|
+
i instanceof R && t.push(i);
|
|
17984
|
+
}
|
|
17985
|
+
return t;
|
|
17986
|
+
}
|
|
17759
17987
|
/**
|
|
17760
17988
|
* `change` / `input` の対象要素について、内部値の同期とユーザー編集の記録を行います。
|
|
17761
17989
|
*
|
|
@@ -17770,15 +17998,9 @@ const Me = class Me {
|
|
|
17770
17998
|
*/
|
|
17771
17999
|
syncUserEdit(e, t) {
|
|
17772
18000
|
const r = D.get(e);
|
|
17773
|
-
|
|
17774
|
-
|
|
17775
|
-
|
|
17776
|
-
if (s === e || !(s instanceof HTMLInputElement) || s.type !== "radio" || s.form !== e.form)
|
|
17777
|
-
continue;
|
|
17778
|
-
const n = D.get(s);
|
|
17779
|
-
n instanceof R && (n.syncValue(), n.markUserEdit());
|
|
17780
|
-
}
|
|
17781
|
-
}
|
|
18001
|
+
r instanceof R && (r.syncValue(), t ? r.markUserEditOnChange() : r.markUserEdit(), be.radioGroupMembers(e).forEach((i) => {
|
|
18002
|
+
i.syncValue(), i.markUserEdit();
|
|
18003
|
+
}));
|
|
17782
18004
|
}
|
|
17783
18005
|
/**
|
|
17784
18006
|
* イベントのターゲットから HTMLElement を取得します。
|
|
@@ -17823,13 +18045,13 @@ const Me = class Me {
|
|
|
17823
18045
|
return null;
|
|
17824
18046
|
}
|
|
17825
18047
|
};
|
|
17826
|
-
|
|
18048
|
+
be.HISTORY_STATE_KEY = "__haoriHistoryState__", be.BUILTIN_EVENT_NAMES = /* @__PURE__ */ new Set([
|
|
17827
18049
|
"click",
|
|
17828
18050
|
"change",
|
|
17829
18051
|
"input",
|
|
17830
18052
|
"load"
|
|
17831
18053
|
]);
|
|
17832
|
-
let nt =
|
|
18054
|
+
let nt = be;
|
|
17833
18055
|
const q = class q {
|
|
17834
18056
|
/**
|
|
17835
18057
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
@@ -18027,7 +18249,7 @@ q.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
18027
18249
|
"disabled",
|
|
18028
18250
|
"once"
|
|
18029
18251
|
]), q.registrations = /* @__PURE__ */ new Map();
|
|
18030
|
-
let
|
|
18252
|
+
let Me = q;
|
|
18031
18253
|
const S = class S {
|
|
18032
18254
|
/**
|
|
18033
18255
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
@@ -18368,7 +18590,7 @@ const S = class S {
|
|
|
18368
18590
|
...i.getRawBindingData() ?? {},
|
|
18369
18591
|
_poll: r
|
|
18370
18592
|
};
|
|
18371
|
-
return
|
|
18593
|
+
return $.setBindingData(s, n, {
|
|
18372
18594
|
reflectToAttribute: !1,
|
|
18373
18595
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
18374
18596
|
// 解除しない)。
|
|
@@ -18555,8 +18777,8 @@ S.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
18555
18777
|
"state"
|
|
18556
18778
|
]), S.DEFAULT_INTERVAL_MS = 5e3, S.MIN_INTERVAL_MS = 100, S.registrations = /* @__PURE__ */ new Map(), S.visibilityListener = null;
|
|
18557
18779
|
let $e = S;
|
|
18558
|
-
const
|
|
18559
|
-
function
|
|
18780
|
+
const Lr = "0.68.0";
|
|
18781
|
+
function Or(f) {
|
|
18560
18782
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => f()) : Promise.resolve().then(f);
|
|
18561
18783
|
}
|
|
18562
18784
|
const L = class L {
|
|
@@ -18738,7 +18960,7 @@ const L = class L {
|
|
|
18738
18960
|
* @param registration 対象の登録
|
|
18739
18961
|
*/
|
|
18740
18962
|
static scheduleCompute(e) {
|
|
18741
|
-
e.scheduled || (e.scheduled = !0,
|
|
18963
|
+
e.scheduled || (e.scheduled = !0, Or(() => {
|
|
18742
18964
|
e.scheduled = !1;
|
|
18743
18965
|
const t = e.fragment.getTarget();
|
|
18744
18966
|
L.registrations.get(t) === e && L.computeAndPublish(e);
|
|
@@ -18805,7 +19027,7 @@ const L = class L {
|
|
|
18805
19027
|
};
|
|
18806
19028
|
s[e.varName] = { ...t };
|
|
18807
19029
|
const n = e.fragment.getTarget(), a = i === n ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([e.fragment]);
|
|
18808
|
-
|
|
19030
|
+
$.setBindingData(i, s, {
|
|
18809
19031
|
skipFragments: a,
|
|
18810
19032
|
reflectToAttribute: !1,
|
|
18811
19033
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
@@ -18859,8 +19081,8 @@ const H = class H {
|
|
|
18859
19081
|
H._dispatcher = e, e.startDeferred(), H._initialIntakes = [];
|
|
18860
19082
|
try {
|
|
18861
19083
|
const t = await Promise.allSettled([
|
|
18862
|
-
|
|
18863
|
-
|
|
19084
|
+
$.scan(document.head),
|
|
19085
|
+
$.scan(document.body)
|
|
18864
19086
|
]), [r, i] = t;
|
|
18865
19087
|
r.status !== "fulfilled" && m.error(
|
|
18866
19088
|
"[Haori]",
|
|
@@ -18870,11 +19092,11 @@ const H = class H {
|
|
|
18870
19092
|
"[Haori]",
|
|
18871
19093
|
"Failed to build body fragment:",
|
|
18872
19094
|
i.reason
|
|
18873
|
-
), await H.waitInitialIntakes(), await J.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body),
|
|
19095
|
+
), await H.waitInitialIntakes(), await J.wait(), document.body.setAttribute("data-haori-ready", ""), H.observe(document.head), H.observe(document.body), Me.syncTree(document.body), $e.syncTree(document.body), Se.syncTree(document.body);
|
|
18874
19096
|
} finally {
|
|
18875
19097
|
H._initialIntakes = null, e.release();
|
|
18876
19098
|
}
|
|
18877
|
-
O.ready(
|
|
19099
|
+
O.ready(Lr);
|
|
18878
19100
|
}
|
|
18879
19101
|
/**
|
|
18880
19102
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -19094,31 +19316,31 @@ const H = class H {
|
|
|
19094
19316
|
r.attributeName === "style" && R.reassertHiddenDisplay(i);
|
|
19095
19317
|
break;
|
|
19096
19318
|
}
|
|
19097
|
-
if (r.attributeName &&
|
|
19319
|
+
if (r.attributeName && $.isAliasedAttributeReflection(i, r.attributeName))
|
|
19098
19320
|
break;
|
|
19099
|
-
const s =
|
|
19321
|
+
const s = $.setAttribute(
|
|
19100
19322
|
i,
|
|
19101
19323
|
r.attributeName,
|
|
19102
19324
|
i.getAttribute(r.attributeName),
|
|
19103
19325
|
!0,
|
|
19104
19326
|
t
|
|
19105
19327
|
);
|
|
19106
|
-
H._initialIntakes?.push(s),
|
|
19328
|
+
H._initialIntakes?.push(s), Me.syncElement(i), $e.syncElement(i), Se.syncElement(i);
|
|
19107
19329
|
break;
|
|
19108
19330
|
}
|
|
19109
19331
|
case "childList": {
|
|
19110
19332
|
Array.from(r.removedNodes).forEach((i) => {
|
|
19111
|
-
H.isStaleExternalRemoval(r, i) || (
|
|
19333
|
+
H.isStaleExternalRemoval(r, i) || (Me.cleanupTree(i), $e.cleanupTree(i), Se.cleanupTree(i), $.removeNode(i));
|
|
19112
19334
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
19113
19335
|
if (!(i.parentElement instanceof Element))
|
|
19114
19336
|
return;
|
|
19115
|
-
const s =
|
|
19116
|
-
H._initialIntakes?.push(s),
|
|
19337
|
+
const s = $.addNode(i.parentElement, i);
|
|
19338
|
+
H._initialIntakes?.push(s), Me.syncTree(i), $e.syncTree(i), Se.syncTree(i);
|
|
19117
19339
|
}), r.target instanceof Element && Se.syncElement(r.target);
|
|
19118
19340
|
break;
|
|
19119
19341
|
}
|
|
19120
19342
|
case "characterData": {
|
|
19121
|
-
r.target instanceof Text || r.target instanceof Comment ?
|
|
19343
|
+
r.target instanceof Text || r.target instanceof Comment ? $.changeText(r.target, r.target.textContent) : m.warn(
|
|
19122
19344
|
"[Haori]",
|
|
19123
19345
|
"Unsupported character data type:",
|
|
19124
19346
|
r.target
|
|
@@ -19138,20 +19360,20 @@ H._initialized = !1, H._mutationObservers = [], H._dispatcher = null, H._initial
|
|
|
19138
19360
|
let He = H;
|
|
19139
19361
|
le.setMutationCapture((f) => He.captureMutations(f));
|
|
19140
19362
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", He.init) : He.init();
|
|
19141
|
-
const
|
|
19363
|
+
const Br = () => Ne.waitForRenders(), Ur = Ne.enhancers, Hr = Ne.handlers;
|
|
19142
19364
|
export {
|
|
19143
|
-
|
|
19365
|
+
$ as Core,
|
|
19144
19366
|
le as Enhance,
|
|
19145
19367
|
c as Env,
|
|
19146
|
-
|
|
19368
|
+
N as Form,
|
|
19147
19369
|
D as Fragment,
|
|
19148
|
-
|
|
19370
|
+
Ne as Haori,
|
|
19149
19371
|
m as Log,
|
|
19150
19372
|
J as Queue,
|
|
19151
|
-
|
|
19152
|
-
|
|
19153
|
-
|
|
19154
|
-
|
|
19155
|
-
|
|
19373
|
+
Ne as default,
|
|
19374
|
+
Ur as enhancers,
|
|
19375
|
+
Hr as handlers,
|
|
19376
|
+
Lr as version,
|
|
19377
|
+
Br as waitForRenders
|
|
19156
19378
|
};
|
|
19157
19379
|
//# sourceMappingURL=haori.es.js.map
|