haori 0.41.4 → 0.42.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 +4 -2
- package/README.md +4 -2
- package/dist/haori.cjs.js +13 -13
- package/dist/haori.es.js +835 -616
- package/dist/haori.iife.js +13 -13
- package/dist/index.d.ts +116 -3
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -521,16 +521,16 @@ function rt(g, e, t = {}) {
|
|
|
521
521
|
a.add(d);
|
|
522
522
|
for (let d = Math.max(0, i - n); d <= Math.min(r - 1, i + n); d += 1)
|
|
523
523
|
a.add(d);
|
|
524
|
-
const o = Array.from(a).sort((d,
|
|
524
|
+
const o = Array.from(a).sort((d, p) => d - p), l = [];
|
|
525
525
|
let c = null;
|
|
526
526
|
for (const d of o) {
|
|
527
527
|
if (c !== null && d - c > 1)
|
|
528
528
|
if (d - c === 2) {
|
|
529
|
-
const
|
|
529
|
+
const p = c + 1;
|
|
530
530
|
l.push({
|
|
531
|
-
page:
|
|
532
|
-
label:
|
|
533
|
-
active:
|
|
531
|
+
page: p,
|
|
532
|
+
label: p + 1,
|
|
533
|
+
active: p === i,
|
|
534
534
|
ellipsis: !1
|
|
535
535
|
});
|
|
536
536
|
} else
|
|
@@ -794,7 +794,7 @@ const He = class He {
|
|
|
794
794
|
};
|
|
795
795
|
He.ASYNC_QUEUE = new Be();
|
|
796
796
|
let W = He;
|
|
797
|
-
const
|
|
797
|
+
const k = class k {
|
|
798
798
|
/**
|
|
799
799
|
* ストレージを、参照が例外になる環境でも安全に読み出します。
|
|
800
800
|
*
|
|
@@ -832,8 +832,8 @@ const M = class M {
|
|
|
832
832
|
e.history,
|
|
833
833
|
// 参照だけで例外になり得るのはこの 2 つのみ(他は同一オリジンの自 window
|
|
834
834
|
// 由来で常に読める)。ホットパスなので、囲むのも必要な箇所だけに絞る。
|
|
835
|
-
|
|
836
|
-
|
|
835
|
+
k.readStorageSafely(() => e.localStorage),
|
|
836
|
+
k.readStorageSafely(() => e.sessionStorage),
|
|
837
837
|
e.fetch,
|
|
838
838
|
e.Function,
|
|
839
839
|
e.setTimeout,
|
|
@@ -1147,6 +1147,56 @@ let ${e.join(", ")};`;
|
|
|
1147
1147
|
}
|
|
1148
1148
|
return this.OPTIONAL_CHAIN_CACHE.set(e, i), i;
|
|
1149
1149
|
}
|
|
1150
|
+
/**
|
|
1151
|
+
* 計算プロパティ名を評価時に検査する形へ書き換えます。
|
|
1152
|
+
*
|
|
1153
|
+
* `obj[key]` を `obj[(_hk=>禁止名なら undefined:_hk)(key)]` へ包み、キーの評価結果が
|
|
1154
|
+
* `constructor` / `__proto__` / `prototype` のときプロパティ名を `undefined` へ
|
|
1155
|
+
* 差し替えます(仕様「評価メカニズム」の「`constructor`、`__proto__`、`prototype`
|
|
1156
|
+
* へのアクセスを遮断」。遮断されたアクセスは同節のとおり `undefined` になります)。
|
|
1157
|
+
*
|
|
1158
|
+
* 静的な検証(`hasAllowedSyntax()`)は文字列リテラルのトークンを 1 個ずつ照合する
|
|
1159
|
+
* ため、`["con"+"structor"]` のように**式で組み立てた名前**を検出できません。連結・
|
|
1160
|
+
* `String.fromCharCode`・`join`・Unicode エスケープと作り方は無限にあるので、名前が
|
|
1161
|
+
* 確定する評価時に見るのが唯一の確実な位置です。
|
|
1162
|
+
*
|
|
1163
|
+
* 書き換えはメンバーアクセスの `[` … `]` に限り、配列リテラルには触れません。
|
|
1164
|
+
* トークン位置に基づく差し替えのみで行い、それ以外の文字列は元のまま保持します。
|
|
1165
|
+
*
|
|
1166
|
+
* @param expression 変換対象の式(暗黙のオプショナルチェーン変換の後)
|
|
1167
|
+
* @returns 変換後の式
|
|
1168
|
+
*/
|
|
1169
|
+
static toGuardedMemberExpression(e) {
|
|
1170
|
+
const t = this.GUARDED_MEMBER_CACHE.get(e);
|
|
1171
|
+
if (t !== void 0)
|
|
1172
|
+
return t;
|
|
1173
|
+
const r = this.tokenizeExpression(e);
|
|
1174
|
+
let i = e;
|
|
1175
|
+
if (r !== null) {
|
|
1176
|
+
const n = [], s = [];
|
|
1177
|
+
let a = null;
|
|
1178
|
+
for (const o of r) {
|
|
1179
|
+
if (o.value === "[") {
|
|
1180
|
+
const l = this.startsMemberAccess(a);
|
|
1181
|
+
s.push(l), l && n.push({
|
|
1182
|
+
start: o.position + 1,
|
|
1183
|
+
end: o.position + 1,
|
|
1184
|
+
text: k.MEMBER_KEY_GUARD_OPEN
|
|
1185
|
+
});
|
|
1186
|
+
} else o.value === "]" && s.pop() === !0 && n.push({
|
|
1187
|
+
start: o.position,
|
|
1188
|
+
end: o.position,
|
|
1189
|
+
text: ")"
|
|
1190
|
+
});
|
|
1191
|
+
a = o;
|
|
1192
|
+
}
|
|
1193
|
+
for (let o = n.length - 1; o >= 0; o -= 1) {
|
|
1194
|
+
const l = n[o];
|
|
1195
|
+
i = i.slice(0, l.start) + l.text + i.slice(l.end);
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return this.GUARDED_MEMBER_CACHE.set(e, i), i;
|
|
1199
|
+
}
|
|
1150
1200
|
/**
|
|
1151
1201
|
* TDZ の `ReferenceError` から実際に参照された識別子名を取り出します。
|
|
1152
1202
|
*
|
|
@@ -1366,11 +1416,11 @@ ${t}`;
|
|
|
1366
1416
|
if (this.containsDangerousPatterns(e)) {
|
|
1367
1417
|
const d = this.detectDisallowedKeywords(e);
|
|
1368
1418
|
if (d.length > 0) {
|
|
1369
|
-
const
|
|
1419
|
+
const p = d.some((y) => y === "function" || y === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
|
|
1370
1420
|
m.warn(
|
|
1371
1421
|
"[Haori]",
|
|
1372
1422
|
e,
|
|
1373
|
-
"Expression uses disallowed keyword(s): " + d.join(", ") + "." +
|
|
1423
|
+
"Expression uses disallowed keyword(s): " + d.join(", ") + "." + p
|
|
1374
1424
|
);
|
|
1375
1425
|
} else
|
|
1376
1426
|
m.warn(
|
|
@@ -1425,7 +1475,7 @@ ${t}`;
|
|
|
1425
1475
|
if (j.isEnabled()) {
|
|
1426
1476
|
const d = this.extractBoundIdentifiers(e);
|
|
1427
1477
|
this.recordScopeMissingIdentifiers(
|
|
1428
|
-
d.size === 0 ? l : l.filter((
|
|
1478
|
+
d.size === 0 ? l : l.filter((p) => !d.has(p)),
|
|
1429
1479
|
e
|
|
1430
1480
|
);
|
|
1431
1481
|
}
|
|
@@ -1434,20 +1484,20 @@ ${t}`;
|
|
|
1434
1484
|
});
|
|
1435
1485
|
const c = o ? [] : l;
|
|
1436
1486
|
for (let d = 0; d <= this.MAX_IDENTIFIER_RECOVERY_COUNT; d += 1) {
|
|
1437
|
-
const
|
|
1487
|
+
const p = this.prepareEvaluator(
|
|
1438
1488
|
e,
|
|
1439
1489
|
a,
|
|
1440
1490
|
c
|
|
1441
1491
|
);
|
|
1442
|
-
if (
|
|
1492
|
+
if (p.compileFailed || p.evaluator === null)
|
|
1443
1493
|
return { value: null, unresolvedReference: !1 };
|
|
1444
1494
|
try {
|
|
1445
1495
|
const y = [], A = this.wrapBoundValues(a);
|
|
1446
|
-
|
|
1447
|
-
y.push(A[
|
|
1496
|
+
p.bindKeys.forEach((D) => {
|
|
1497
|
+
y.push(A[D]);
|
|
1448
1498
|
});
|
|
1449
1499
|
const S = this.withBlockedPropertyAccess(
|
|
1450
|
-
() =>
|
|
1500
|
+
() => p.evaluator(...y)
|
|
1451
1501
|
);
|
|
1452
1502
|
return S === void 0 && this.warnBlockedIdentifiers(e), {
|
|
1453
1503
|
value: S,
|
|
@@ -1510,10 +1560,12 @@ ${t}`;
|
|
|
1510
1560
|
evaluator: c,
|
|
1511
1561
|
compileFailed: !1
|
|
1512
1562
|
};
|
|
1513
|
-
const d = this.buildAssignments(n),
|
|
1563
|
+
const d = this.buildAssignments(n), p = this.buildShadowDeclarations(o), y = this.toGuardedMemberExpression(
|
|
1564
|
+
this.toOptionalChainExpression(e)
|
|
1565
|
+
), A = d ? `"use strict";
|
|
1514
1566
|
${d};
|
|
1515
|
-
return (${y});${
|
|
1516
|
-
return (${y});${
|
|
1567
|
+
return (${y});${p}` : `"use strict";
|
|
1568
|
+
return (${y});${p}`;
|
|
1517
1569
|
try {
|
|
1518
1570
|
return c = new Function(...n, A), this.EXPRESSION_CACHE.set(l, c), this.compileFailedExpressions.delete(e), {
|
|
1519
1571
|
bindKeys: n,
|
|
@@ -1802,11 +1854,15 @@ return (${y});${h}`;
|
|
|
1802
1854
|
/**
|
|
1803
1855
|
* 角括弧がメンバーアクセスかどうかを判定します。
|
|
1804
1856
|
*
|
|
1857
|
+
* 文字列リテラルも基点に含めます。含めないと `""["constructor"]` の `[` を配列
|
|
1858
|
+
* リテラルの開始と誤って分類し、メンバーアクセスに対する禁止プロパティ名の検証
|
|
1859
|
+
* (`hasAllowedSyntax()`)を素通りして `String` へ到達できてしまいます。
|
|
1860
|
+
*
|
|
1805
1861
|
* @param previous 直前のトークン
|
|
1806
1862
|
* @returns メンバーアクセスであればtrue
|
|
1807
1863
|
*/
|
|
1808
1864
|
static startsMemberAccess(e) {
|
|
1809
|
-
return e === null ? !1 : e.type === "identifier" || e.type === "number" ? !0 : e.value === ")" || e.value === "]" || e.value === "?.";
|
|
1865
|
+
return e === null ? !1 : e.type === "identifier" || e.type === "number" || e.type === "string" ? !0 : e.value === ")" || e.value === "]" || e.value === "?.";
|
|
1810
1866
|
}
|
|
1811
1867
|
/**
|
|
1812
1868
|
* object literal 内で次のトークンがキー位置かどうかを判定します。
|
|
@@ -2024,9 +2080,9 @@ return (${y});${h}`;
|
|
|
2024
2080
|
return this.forbiddenBindingValueCache.set(e, !1), !1;
|
|
2025
2081
|
}
|
|
2026
2082
|
};
|
|
2027
|
-
|
|
2083
|
+
k.MAX_IDENTIFIER_RECOVERY_COUNT = 8, k.BUILTIN_NAMESPACE = "haori", k.BUILTIN_HELPERS = {
|
|
2028
2084
|
...vt
|
|
2029
|
-
},
|
|
2085
|
+
}, k.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, k.BUILTIN_DATA_PROPERTY = "data", k.BUILTIN_DATA_REFERENCE_PATTERN = /(^|[^\w$.])haori\s*(\.\s*data(?![\w$])|\[)/, k.IDENTIFIER_NAME_PATTERN = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u, k.usableBindingKeyCache = /* @__PURE__ */ new Map(), k.loggedUnusableBindingKeys = /* @__PURE__ */ new Set(), k.compileFailedExpressions = /* @__PURE__ */ new Set(), k.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), k.forbiddenBindingValueCacheResetScheduled = !1, k.loggedForbiddenKeySignatures = /* @__PURE__ */ new Set(), k.loggedForbiddenKeyResetScheduled = !1, k.FORBIDDEN_NAMES = [
|
|
2030
2086
|
// グローバルオブジェクト
|
|
2031
2087
|
"window",
|
|
2032
2088
|
"self",
|
|
@@ -2058,7 +2114,7 @@ M.MAX_IDENTIFIER_RECOVERY_COUNT = 8, M.BUILTIN_NAMESPACE = "haori", M.BUILTIN_HE
|
|
|
2058
2114
|
"sessionStorage",
|
|
2059
2115
|
"IndexedDB",
|
|
2060
2116
|
"history"
|
|
2061
|
-
],
|
|
2117
|
+
], k.STRICT_FORBIDDEN_NAMES = ["eval", "arguments"], k.REBINDABLE_FORBIDDEN_NAMES = /* @__PURE__ */ new Set([
|
|
2062
2118
|
"location",
|
|
2063
2119
|
"history",
|
|
2064
2120
|
"document",
|
|
@@ -2066,23 +2122,23 @@ M.MAX_IDENTIFIER_RECOVERY_COUNT = 8, M.BUILTIN_NAMESPACE = "haori", M.BUILTIN_HE
|
|
|
2066
2122
|
"localStorage",
|
|
2067
2123
|
"sessionStorage",
|
|
2068
2124
|
"IndexedDB"
|
|
2069
|
-
]),
|
|
2070
|
-
...
|
|
2071
|
-
(e) => !
|
|
2125
|
+
]), k.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
|
|
2126
|
+
...k.FORBIDDEN_NAMES.filter(
|
|
2127
|
+
(e) => !k.REBINDABLE_FORBIDDEN_NAMES.has(e)
|
|
2072
2128
|
),
|
|
2073
2129
|
"constructor",
|
|
2074
2130
|
"__proto__",
|
|
2075
2131
|
"prototype",
|
|
2076
|
-
...
|
|
2077
|
-
]),
|
|
2132
|
+
...k.STRICT_FORBIDDEN_NAMES
|
|
2133
|
+
]), k.FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
|
|
2078
2134
|
"constructor",
|
|
2079
2135
|
"__proto__",
|
|
2080
2136
|
"prototype"
|
|
2081
|
-
]),
|
|
2137
|
+
]), k.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
|
|
2082
2138
|
"get",
|
|
2083
2139
|
"set",
|
|
2084
2140
|
"async"
|
|
2085
|
-
]),
|
|
2141
|
+
]), k.DISALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
|
|
2086
2142
|
"await",
|
|
2087
2143
|
"break",
|
|
2088
2144
|
"case",
|
|
@@ -2116,7 +2172,7 @@ M.MAX_IDENTIFIER_RECOVERY_COUNT = 8, M.BUILTIN_NAMESPACE = "haori", M.BUILTIN_HE
|
|
|
2116
2172
|
"while",
|
|
2117
2173
|
"with",
|
|
2118
2174
|
"yield"
|
|
2119
|
-
]),
|
|
2175
|
+
]), k.NON_SHADOWABLE_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
2120
2176
|
// リテラル・グローバル定数
|
|
2121
2177
|
"true",
|
|
2122
2178
|
"false",
|
|
@@ -2134,7 +2190,7 @@ M.MAX_IDENTIFIER_RECOVERY_COUNT = 8, M.BUILTIN_NAMESPACE = "haori", M.BUILTIN_HE
|
|
|
2134
2190
|
"public",
|
|
2135
2191
|
"static",
|
|
2136
2192
|
"super"
|
|
2137
|
-
]),
|
|
2193
|
+
]), k.ALLOWED_GLOBAL_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
2138
2194
|
// 名前空間オブジェクト
|
|
2139
2195
|
"Math",
|
|
2140
2196
|
"JSON",
|
|
@@ -2190,11 +2246,11 @@ M.MAX_IDENTIFIER_RECOVERY_COUNT = 8, M.BUILTIN_NAMESPACE = "haori", M.BUILTIN_HE
|
|
|
2190
2246
|
"encodeURIComponent",
|
|
2191
2247
|
"decodeURI",
|
|
2192
2248
|
"decodeURIComponent"
|
|
2193
|
-
]),
|
|
2249
|
+
]), k.EXPRESSION_CACHE = /* @__PURE__ */ new Map(), k.FREE_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), k.BOUND_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), k.OPTIONAL_CHAIN_CACHE = /* @__PURE__ */ new Map(), k.GUARDED_MEMBER_CACHE = /* @__PURE__ */ new Map(), k.MEMBER_KEY_GUARD_OPEN = "(_hk=>_hk==='constructor'||_hk==='__proto__'||_hk==='prototype'?undefined:_hk)(", k.FORBIDDEN_NAME_PATTERNS = k.FORBIDDEN_NAMES.map((e) => ({
|
|
2194
2250
|
name: e,
|
|
2195
2251
|
pattern: new RegExp(`(^|[^\\w$.])${e}(?![\\w$])`)
|
|
2196
|
-
})),
|
|
2197
|
-
let J =
|
|
2252
|
+
})), k.FORBIDDEN_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), k.pendingUnresolvedIdentifiers = /* @__PURE__ */ new Set(), k.unresolvedReportScheduled = !1, k.suppliedIdentifiers = /* @__PURE__ */ new Set(), k.pendingScopeMissingIdentifiers = /* @__PURE__ */ new Map(), k.scopeMissingReportScheduled = !1, k.rowScopeIdentifiers = /* @__PURE__ */ new Set(), k.loggedScopeMissingIdentifiers = /* @__PURE__ */ new Set(), k.loggedBlockedIdentifierExpressions = /* @__PURE__ */ new Set();
|
|
2253
|
+
let J = k;
|
|
2198
2254
|
const pe = "data-haori-if-disabled", je = "input, select, textarea, button, fieldset", q = class q {
|
|
2199
2255
|
/**
|
|
2200
2256
|
* 集計状態を初期化します。
|
|
@@ -2554,7 +2610,7 @@ const oe = class oe {
|
|
|
2554
2610
|
};
|
|
2555
2611
|
oe.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
2556
2612
|
let N = oe;
|
|
2557
|
-
const
|
|
2613
|
+
const M = class M extends N {
|
|
2558
2614
|
/**
|
|
2559
2615
|
* エレメントフラグメントのコンストラクタ。
|
|
2560
2616
|
* アトリビュートや子フラグメントの作成も行います。
|
|
@@ -2588,7 +2644,7 @@ const C = class C extends N {
|
|
|
2588
2644
|
*/
|
|
2589
2645
|
getChildElementFragments() {
|
|
2590
2646
|
return this.children.filter(
|
|
2591
|
-
(e) => e instanceof
|
|
2647
|
+
(e) => e instanceof M
|
|
2592
2648
|
);
|
|
2593
2649
|
}
|
|
2594
2650
|
/**
|
|
@@ -2620,7 +2676,7 @@ const C = class C extends N {
|
|
|
2620
2676
|
* @returns クローンされたフラグメント
|
|
2621
2677
|
*/
|
|
2622
2678
|
clone() {
|
|
2623
|
-
const e = new
|
|
2679
|
+
const e = new M(
|
|
2624
2680
|
this.target.cloneNode(!1)
|
|
2625
2681
|
);
|
|
2626
2682
|
return this.attributeMap.forEach((t, r) => {
|
|
@@ -2635,7 +2691,7 @@ const C = class C extends N {
|
|
|
2635
2691
|
*/
|
|
2636
2692
|
normalizeClonedVisibilityState() {
|
|
2637
2693
|
(this.visible === !1 || this.getTarget().style.display === "none" || this.getTarget().hasAttribute(`${u.prefix}if-false`)) && (this.visible = !0, this.display = null, this.displayPriority = null, this.getTarget().style.removeProperty("display"), this.getTarget().removeAttribute(`${u.prefix}if-false`), this.restoreFormControlsDisabledByIf()), this.children.forEach((e) => {
|
|
2638
|
-
e instanceof
|
|
2694
|
+
e instanceof M && e.normalizeClonedVisibilityState();
|
|
2639
2695
|
});
|
|
2640
2696
|
}
|
|
2641
2697
|
/**
|
|
@@ -2755,19 +2811,19 @@ const C = class C extends N {
|
|
|
2755
2811
|
* @returns 実行中なら true
|
|
2756
2812
|
*/
|
|
2757
2813
|
static isExecutingAnyBindingWork() {
|
|
2758
|
-
return
|
|
2814
|
+
return M.bindingWorkActiveCount > 0;
|
|
2759
2815
|
}
|
|
2760
2816
|
/**
|
|
2761
2817
|
* バインドワークの実行開始を記録します(`Core.setBindingData` の work 開始時に呼ぶ)。
|
|
2762
2818
|
*/
|
|
2763
2819
|
markBindingWorkStart() {
|
|
2764
|
-
this.bindingWorkActive++,
|
|
2820
|
+
this.bindingWorkActive++, M.bindingWorkActiveCount++;
|
|
2765
2821
|
}
|
|
2766
2822
|
/**
|
|
2767
2823
|
* バインドワークの実行終了を記録します(work 完了時に呼ぶ)。
|
|
2768
2824
|
*/
|
|
2769
2825
|
markBindingWorkEnd() {
|
|
2770
|
-
this.bindingWorkActive > 0 && (this.bindingWorkActive--,
|
|
2826
|
+
this.bindingWorkActive > 0 && (this.bindingWorkActive--, M.bindingWorkActiveCount--);
|
|
2771
2827
|
}
|
|
2772
2828
|
/**
|
|
2773
2829
|
* このフラグメントへ供給が適用されたことを記録します。
|
|
@@ -2859,7 +2915,7 @@ const C = class C extends N {
|
|
|
2859
2915
|
*/
|
|
2860
2916
|
clearBindingDataCache() {
|
|
2861
2917
|
this.bindingDataCache = null, this.descendantBindingDataCache = null, this.children.forEach((e) => {
|
|
2862
|
-
e instanceof
|
|
2918
|
+
e instanceof M && e.clearBindingDataCache();
|
|
2863
2919
|
});
|
|
2864
2920
|
}
|
|
2865
2921
|
/**
|
|
@@ -3077,7 +3133,7 @@ const C = class C extends N {
|
|
|
3077
3133
|
this.value = this.normalizeValueForElement(i, e);
|
|
3078
3134
|
const s = this.userEditSequence;
|
|
3079
3135
|
return this.enqueueValueWrite(() => {
|
|
3080
|
-
this.isSupersededByUserEdit(s) || r && !this.canApplyValue(r) || (i.value = n, this.recordValueWriteResult(i.value === n), t && ((i instanceof HTMLInputElement &&
|
|
3136
|
+
this.isSupersededByUserEdit(s) || r && !this.canApplyValue(r) || (i.value = n, this.recordValueWriteResult(i.value === n), t && ((i instanceof HTMLInputElement && M.INPUT_EVENT_TYPES.includes(i.type) || i instanceof HTMLTextAreaElement) && i.dispatchEvent(new Event("input", { bubbles: !0 })), i.dispatchEvent(new Event("change", { bubbles: !0 }))));
|
|
3081
3137
|
});
|
|
3082
3138
|
}
|
|
3083
3139
|
/**
|
|
@@ -3158,10 +3214,10 @@ const C = class C extends N {
|
|
|
3158
3214
|
* @returns 再試行の完了 Promise
|
|
3159
3215
|
*/
|
|
3160
3216
|
static retryUnappliedValueWrites(e, t) {
|
|
3161
|
-
if (
|
|
3217
|
+
if (M.UNAPPLIED_VALUE_WRITES.size === 0)
|
|
3162
3218
|
return Promise.resolve();
|
|
3163
3219
|
const r = [];
|
|
3164
|
-
for (const i of Array.from(
|
|
3220
|
+
for (const i of Array.from(M.UNAPPLIED_VALUE_WRITES)) {
|
|
3165
3221
|
const n = i.getTarget();
|
|
3166
3222
|
if (i.wasResetAfter(t)) {
|
|
3167
3223
|
i.clearUnappliedValueWrite();
|
|
@@ -3203,7 +3259,7 @@ const C = class C extends N {
|
|
|
3203
3259
|
* @returns 戻り値はありません。
|
|
3204
3260
|
*/
|
|
3205
3261
|
clearUnappliedValueWrite() {
|
|
3206
|
-
this.valueWriteUnapplied = !1,
|
|
3262
|
+
this.valueWriteUnapplied = !1, M.UNAPPLIED_VALUE_WRITES.delete(this);
|
|
3207
3263
|
}
|
|
3208
3264
|
/**
|
|
3209
3265
|
* 入力エレメントの値を取得します。
|
|
@@ -3224,7 +3280,7 @@ const C = class C extends N {
|
|
|
3224
3280
|
* @returns 直近に発番した通番(未発番なら 0)
|
|
3225
3281
|
*/
|
|
3226
3282
|
static currentSequence() {
|
|
3227
|
-
return
|
|
3283
|
+
return M.sequenceCounter;
|
|
3228
3284
|
}
|
|
3229
3285
|
/**
|
|
3230
3286
|
* 新しい通番を発番します。
|
|
@@ -3237,7 +3293,7 @@ const C = class C extends N {
|
|
|
3237
3293
|
* @returns 発番した通番
|
|
3238
3294
|
*/
|
|
3239
3295
|
static nextSequence() {
|
|
3240
|
-
return
|
|
3296
|
+
return M.sequenceCounter += 1, M.sequenceCounter;
|
|
3241
3297
|
}
|
|
3242
3298
|
/**
|
|
3243
3299
|
* 保留中の外部 DOM 変更を取り込む処理を登録します。
|
|
@@ -3246,7 +3302,7 @@ const C = class C extends N {
|
|
|
3246
3302
|
* @returns 戻り値はありません。
|
|
3247
3303
|
*/
|
|
3248
3304
|
static setPendingMutationFlusher(e) {
|
|
3249
|
-
|
|
3305
|
+
M.pendingMutationFlusher = e;
|
|
3250
3306
|
}
|
|
3251
3307
|
/**
|
|
3252
3308
|
* 利用者の操作を起点とする通番を発番します。
|
|
@@ -3267,7 +3323,7 @@ const C = class C extends N {
|
|
|
3267
3323
|
* @returns 発番した通番
|
|
3268
3324
|
*/
|
|
3269
3325
|
static nextOperationSequence() {
|
|
3270
|
-
return
|
|
3326
|
+
return M.pendingMutationFlusher && !M.isExecutingAnyBindingWork() && M.pendingMutationFlusher(), M.nextSequence();
|
|
3271
3327
|
}
|
|
3272
3328
|
/**
|
|
3273
3329
|
* この入力欄へ値を適用してよいかを返します。
|
|
@@ -3288,7 +3344,7 @@ const C = class C extends N {
|
|
|
3288
3344
|
* @returns 適用してよい場合は true
|
|
3289
3345
|
*/
|
|
3290
3346
|
canApplyValue(e) {
|
|
3291
|
-
return
|
|
3347
|
+
return M.isApplicable(
|
|
3292
3348
|
{ sequence: this.lastValueSequence, kind: this.lastValueKind },
|
|
3293
3349
|
e
|
|
3294
3350
|
);
|
|
@@ -3311,7 +3367,7 @@ const C = class C extends N {
|
|
|
3311
3367
|
* @returns 適用してよい場合は true
|
|
3312
3368
|
*/
|
|
3313
3369
|
canApplyPath(e, t) {
|
|
3314
|
-
return
|
|
3370
|
+
return M.isApplicable(
|
|
3315
3371
|
this.lastPathApplied.get(e) ?? null,
|
|
3316
3372
|
t
|
|
3317
3373
|
);
|
|
@@ -3360,7 +3416,7 @@ const C = class C extends N {
|
|
|
3360
3416
|
* @returns 発番した編集の通番
|
|
3361
3417
|
*/
|
|
3362
3418
|
markUserEdit() {
|
|
3363
|
-
return this.userEditSequence =
|
|
3419
|
+
return this.userEditSequence = M.nextSequence(), this.markValueApplied({ sequence: this.userEditSequence, kind: "edit" }), this.userEditSequence;
|
|
3364
3420
|
}
|
|
3365
3421
|
/**
|
|
3366
3422
|
* この入力欄を最後にユーザーが編集したときの通し番号を返します。
|
|
@@ -3395,7 +3451,7 @@ const C = class C extends N {
|
|
|
3395
3451
|
* @param upTo この通し番号までの編集を解除対象とする(既定は現在の最新)
|
|
3396
3452
|
* @return 戻り値はありません。
|
|
3397
3453
|
*/
|
|
3398
|
-
clearUserEditMark(e =
|
|
3454
|
+
clearUserEditMark(e = M.currentSequence()) {
|
|
3399
3455
|
e > this.authoritativeValueSequence && (this.authoritativeValueSequence = e), this.lastValueKind === "edit" && this.lastValueSequence <= e && (this.lastValueKind = "supply");
|
|
3400
3456
|
}
|
|
3401
3457
|
/**
|
|
@@ -3416,7 +3472,7 @@ const C = class C extends N {
|
|
|
3416
3472
|
if (!j.isEnabled())
|
|
3417
3473
|
return;
|
|
3418
3474
|
const n = `${e} ${r}`;
|
|
3419
|
-
|
|
3475
|
+
M.loggedUnresolvedAttributes.has(n) || (M.loggedUnresolvedAttributes.add(n), m.warn(
|
|
3420
3476
|
"[Haori]",
|
|
3421
3477
|
`Attribute "${t}" was not applied because the expression has an unresolved reference; the attribute is removed and the synchronized value is emptied: ${e}="${r}"`,
|
|
3422
3478
|
i
|
|
@@ -3438,7 +3494,7 @@ const C = class C extends N {
|
|
|
3438
3494
|
if (!t)
|
|
3439
3495
|
return !1;
|
|
3440
3496
|
const r = N.get(t);
|
|
3441
|
-
return r instanceof
|
|
3497
|
+
return r instanceof M ? r.hasPendingUserEdit() : !1;
|
|
3442
3498
|
}
|
|
3443
3499
|
/**
|
|
3444
3500
|
* 内部の値をクリアします。エレメントのvalue値は変化しません。
|
|
@@ -3453,8 +3509,10 @@ const C = class C extends N {
|
|
|
3453
3509
|
* 入力要素の種別に応じて値を正規化します。
|
|
3454
3510
|
*
|
|
3455
3511
|
* `type="number"` の input では、文字列の入力値・バインド値を数値へ変換します
|
|
3456
|
-
* (DTO
|
|
3457
|
-
*
|
|
3512
|
+
* (DTO が数値型を期待する場合に文字列で送られるのを防ぐため)。数値として採用
|
|
3513
|
+
* するのは、ブラウザが `<input type="number">` の値として受け付ける文字列だけで
|
|
3514
|
+
* す(`NUMBER_INPUT_PATTERN`)。空文字・`null`・受け付けない文字列・有限でない数値
|
|
3515
|
+
* は `null` を返します。それ以外の要素では値をそのまま返します。
|
|
3458
3516
|
*
|
|
3459
3517
|
* @param element 対象の入力要素
|
|
3460
3518
|
* @param value 正規化する値
|
|
@@ -3464,8 +3522,12 @@ const C = class C extends N {
|
|
|
3464
3522
|
if (e instanceof HTMLInputElement && e.type === "number") {
|
|
3465
3523
|
if (t === null || t === "")
|
|
3466
3524
|
return null;
|
|
3467
|
-
|
|
3468
|
-
|
|
3525
|
+
if (typeof t == "number")
|
|
3526
|
+
return Number.isFinite(t) ? t : null;
|
|
3527
|
+
if (typeof t != "string" || !M.NUMBER_INPUT_PATTERN.test(t))
|
|
3528
|
+
return null;
|
|
3529
|
+
const r = Number(t);
|
|
3530
|
+
return Number.isFinite(r) ? r : null;
|
|
3469
3531
|
}
|
|
3470
3532
|
return t;
|
|
3471
3533
|
}
|
|
@@ -3484,7 +3546,7 @@ const C = class C extends N {
|
|
|
3484
3546
|
* @returns 同期対象の場合true
|
|
3485
3547
|
*/
|
|
3486
3548
|
static isValuePropertyTarget(e) {
|
|
3487
|
-
return e instanceof HTMLInputElement ?
|
|
3549
|
+
return e instanceof HTMLInputElement ? M.INPUT_EVENT_TYPES.includes(e.type) || e.type === "hidden" : e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement;
|
|
3488
3550
|
}
|
|
3489
3551
|
/**
|
|
3490
3552
|
* 内部の値をDOMの値と同期します。
|
|
@@ -3532,7 +3594,7 @@ const C = class C extends N {
|
|
|
3532
3594
|
*/
|
|
3533
3595
|
recordValueWriteResult(e) {
|
|
3534
3596
|
if (!e && this.value !== null && this.value !== "") {
|
|
3535
|
-
this.valueWriteUnapplied = !0,
|
|
3597
|
+
this.valueWriteUnapplied = !0, M.UNAPPLIED_VALUE_WRITES.add(this);
|
|
3536
3598
|
return;
|
|
3537
3599
|
}
|
|
3538
3600
|
this.clearUnappliedValueWrite();
|
|
@@ -3562,7 +3624,7 @@ const C = class C extends N {
|
|
|
3562
3624
|
* @returns 収集する値
|
|
3563
3625
|
*/
|
|
3564
3626
|
getValueForCollection() {
|
|
3565
|
-
return this.skipChangeValue || this.valueWriteUnapplied ? this.value :
|
|
3627
|
+
return this.skipChangeValue || this.valueWriteUnapplied ? this.value : M.isValuePropertyTarget(this.getTarget()) ? this.readValueFromDom() : this.value;
|
|
3566
3628
|
}
|
|
3567
3629
|
/**
|
|
3568
3630
|
* チェック状態の DOM 反映に合わせて内部値を DOM から同期します。
|
|
@@ -3582,7 +3644,7 @@ const C = class C extends N {
|
|
|
3582
3644
|
if (!t)
|
|
3583
3645
|
return;
|
|
3584
3646
|
const r = N.get(t);
|
|
3585
|
-
r instanceof
|
|
3647
|
+
r instanceof M && r.syncValue();
|
|
3586
3648
|
}
|
|
3587
3649
|
/**
|
|
3588
3650
|
* 指定した属性のいずれかを自身が書き込み中なら、その完了 Promise を返します。
|
|
@@ -3698,8 +3760,8 @@ const C = class C extends N {
|
|
|
3698
3760
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
3699
3761
|
const o = new we(e, r);
|
|
3700
3762
|
if (n) {
|
|
3701
|
-
const
|
|
3702
|
-
if (
|
|
3763
|
+
const Me = this.attributeMap.get(e);
|
|
3764
|
+
if (Me && (Me.isEvaluate || Me.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
3703
3765
|
const Ve = W.enqueue(() => {
|
|
3704
3766
|
}).finally(() => {
|
|
3705
3767
|
this.releaseSelfWritingAttributes(s);
|
|
@@ -3713,24 +3775,24 @@ const C = class C extends N {
|
|
|
3713
3775
|
element: l,
|
|
3714
3776
|
rawName: e,
|
|
3715
3777
|
template: r
|
|
3716
|
-
}), d = o.isEvaluate || o.isRawEvaluate,
|
|
3717
|
-
|
|
3778
|
+
}), d = o.isEvaluate || o.isRawEvaluate, p = e === t && M.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), A = ie.joinEvaluateResults(c.results), S = c.results.length === 1 ? c.results[0] : A, D = !o.isForceEvaluation() && (t !== e || p || y ? c.hasUnresolvedReference || S === null || S === void 0 || S === !1 : d && A === "");
|
|
3779
|
+
D && c.hasUnresolvedReference && M.warnUnresolvedAttribute(
|
|
3718
3780
|
e,
|
|
3719
3781
|
t,
|
|
3720
3782
|
r,
|
|
3721
3783
|
l
|
|
3722
3784
|
);
|
|
3723
|
-
const
|
|
3724
|
-
if (!
|
|
3725
|
-
return
|
|
3785
|
+
const P = o.isForceEvaluation() ? r : y ? S : A, H = i && o.isEvaluate && t === "value" && M.isValuePropertyTarget(l), E = l.getRootNode(), v = H && (l === E.activeElement || this.hasPendingUserEdit()), R = D || P === null || P === !1 ? null : String(P), C = e !== t && l.getAttribute(e) !== r, x = R === null ? l.hasAttribute(t) : l.getAttribute(t) !== R, V = R === null ? "" : R, z = H && !v && l.value !== V, _ = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), Z = t === "selected" && l instanceof HTMLOptionElement, Ne = E.activeElement, Fe = Ne !== null && (_ && l === Ne || Z && l.closest("select") === Ne) || (_ || Z) && this.hasPendingCheckableUserEdit(Z), be = R !== null, ke = _ && !Fe && l.checked !== be, ye = Z && !Fe && l.selected !== be;
|
|
3786
|
+
if (!C && !x && !z && !ke && !ye)
|
|
3787
|
+
return H && !v && (this.value = this.normalizeValueForElement(
|
|
3726
3788
|
l,
|
|
3727
3789
|
V
|
|
3728
3790
|
), this.clearUnappliedValueWrite()), (_ || Z) && !Fe && this.syncCheckableValueFromDom(Z), Promise.resolve();
|
|
3729
3791
|
const Ue = W.enqueue(() => {
|
|
3730
|
-
|
|
3792
|
+
C && l.setAttribute(e, r), R === null ? l.removeAttribute(t) : x && (l.setAttribute(t, R), t === `${u.prefix}bind` && this.recordSelfWrittenBind(R)), H && !v && (this.value = this.normalizeValueForElement(
|
|
3731
3793
|
l,
|
|
3732
3794
|
V
|
|
3733
|
-
),
|
|
3795
|
+
), z && (l.value = V), this.recordValueWriteResult(l.value === V)), ke && (l.checked = be), ye && (l.selected = be), (ke || ye) && this.syncCheckableValueFromDom(ye);
|
|
3734
3796
|
}).finally(() => {
|
|
3735
3797
|
this.releaseSelfWritingAttributes(s);
|
|
3736
3798
|
});
|
|
@@ -3873,8 +3935,8 @@ const C = class C extends N {
|
|
|
3873
3935
|
if (t === null)
|
|
3874
3936
|
this.children.push(e);
|
|
3875
3937
|
else {
|
|
3876
|
-
let
|
|
3877
|
-
if (s ? a !== -1 && a < o ?
|
|
3938
|
+
let p;
|
|
3939
|
+
if (s ? a !== -1 && a < o ? p = o - 1 : p = o : p = this.children.indexOf(t), p === -1) {
|
|
3878
3940
|
const y = this.resolveInsertionPointFromDom(
|
|
3879
3941
|
t,
|
|
3880
3942
|
!1
|
|
@@ -3885,7 +3947,7 @@ const C = class C extends N {
|
|
|
3885
3947
|
t
|
|
3886
3948
|
), this.children.push(e)) : (this.children.splice(y.index, 0, e), c = y.referenceNode);
|
|
3887
3949
|
} else
|
|
3888
|
-
this.children.splice(
|
|
3950
|
+
this.children.splice(p, 0, e);
|
|
3889
3951
|
}
|
|
3890
3952
|
e.setParent(this), e.setMounted(this.mounted);
|
|
3891
3953
|
const d = this.skipMutationNodes;
|
|
@@ -3967,7 +4029,7 @@ const C = class C extends N {
|
|
|
3967
4029
|
return Promise.resolve();
|
|
3968
4030
|
this.visible = !1;
|
|
3969
4031
|
const e = this.getTarget();
|
|
3970
|
-
return this.display = e.style.getPropertyValue("display"), this.displayPriority = e.style.getPropertyPriority("display"), e.style.setProperty("display", "none", "important"), e.setAttribute(`${u.prefix}if-false`, ""),
|
|
4032
|
+
return this.display = e.style.getPropertyValue("display"), this.displayPriority = e.style.getPropertyPriority("display"), e.style.setProperty("display", "none", "important"), e.setAttribute(`${u.prefix}if-false`, ""), M.disableFormControlsInBranch(e), Promise.resolve();
|
|
3971
4033
|
}
|
|
3972
4034
|
/**
|
|
3973
4035
|
* 分岐配下のフォームコントロールを順に処理します。
|
|
@@ -4005,7 +4067,7 @@ const C = class C extends N {
|
|
|
4005
4067
|
* @returns 戻り値はありません。
|
|
4006
4068
|
*/
|
|
4007
4069
|
static disableFormControlsInBranch(e) {
|
|
4008
|
-
|
|
4070
|
+
M.forEachFormControlInBranch(e, (t) => {
|
|
4009
4071
|
t.hasAttribute("disabled") || (t.setAttribute(pe, ""), t.setAttribute("disabled", ""));
|
|
4010
4072
|
});
|
|
4011
4073
|
}
|
|
@@ -4019,7 +4081,7 @@ const C = class C extends N {
|
|
|
4019
4081
|
* @returns 戻り値はありません。
|
|
4020
4082
|
*/
|
|
4021
4083
|
restoreFormControlsDisabledByIf() {
|
|
4022
|
-
|
|
4084
|
+
M.forEachFormControlInBranch(this.getTarget(), (e) => {
|
|
4023
4085
|
e.hasAttribute(pe) && (e.removeAttribute(pe), e.removeAttribute("disabled"));
|
|
4024
4086
|
});
|
|
4025
4087
|
}
|
|
@@ -4052,7 +4114,7 @@ const C = class C extends N {
|
|
|
4052
4114
|
return t === null ? null : t.closestByAttribute(e);
|
|
4053
4115
|
}
|
|
4054
4116
|
};
|
|
4055
|
-
|
|
4117
|
+
M.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, M.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
4056
4118
|
"allowfullscreen",
|
|
4057
4119
|
"async",
|
|
4058
4120
|
"autofocus",
|
|
@@ -4076,7 +4138,7 @@ C.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
4076
4138
|
"required",
|
|
4077
4139
|
"reversed",
|
|
4078
4140
|
"selected"
|
|
4079
|
-
]),
|
|
4141
|
+
]), M.INPUT_EVENT_TYPES = [
|
|
4080
4142
|
"text",
|
|
4081
4143
|
"password",
|
|
4082
4144
|
"email",
|
|
@@ -4091,8 +4153,8 @@ C.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
4091
4153
|
"month",
|
|
4092
4154
|
"time",
|
|
4093
4155
|
"week"
|
|
4094
|
-
],
|
|
4095
|
-
let T =
|
|
4156
|
+
], M.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), M.sequenceCounter = 0, M.bindingWorkActiveCount = 0, M.pendingMutationFlusher = null, M.loggedUnresolvedAttributes = /* @__PURE__ */ new Set();
|
|
4157
|
+
let T = M;
|
|
4096
4158
|
class Q extends N {
|
|
4097
4159
|
/**
|
|
4098
4160
|
* テキストフラグメントのコンストラクタ。
|
|
@@ -4758,13 +4820,13 @@ de.enhancers = {
|
|
|
4758
4820
|
};
|
|
4759
4821
|
let he = de;
|
|
4760
4822
|
const St = "入力内容を確認してください", wt = ["addErrorMessage", "clearMessages"], Ke = "data-haori-group-name";
|
|
4761
|
-
function
|
|
4823
|
+
function Ge() {
|
|
4762
4824
|
const e = globalThis.window?.Haori;
|
|
4763
4825
|
return wt.every(
|
|
4764
4826
|
(r) => typeof e?.[r] == "function"
|
|
4765
4827
|
) ? e : he;
|
|
4766
4828
|
}
|
|
4767
|
-
const
|
|
4829
|
+
const h = class h {
|
|
4768
4830
|
/**
|
|
4769
4831
|
* フォーム内にある入力エレメントの値をオブジェクトとして取得します。
|
|
4770
4832
|
* data-form-object属性があると、そのエレメント内の値はオブジェクトとして処理されます。
|
|
@@ -4775,7 +4837,7 @@ const p = class p {
|
|
|
4775
4837
|
*/
|
|
4776
4838
|
static getValues(e) {
|
|
4777
4839
|
const t = {}, r = /* @__PURE__ */ new Set();
|
|
4778
|
-
return
|
|
4840
|
+
return h.getPartValues(e, t, null, r), h.registerCollectedExcludedKeys(t, r), t;
|
|
4779
4841
|
}
|
|
4780
4842
|
/**
|
|
4781
4843
|
* 入力エレメントから収集する値を解決します。
|
|
@@ -4796,11 +4858,11 @@ const p = class p {
|
|
|
4796
4858
|
*/
|
|
4797
4859
|
static resolveCollectedValue(e) {
|
|
4798
4860
|
const t = e.getTarget();
|
|
4799
|
-
if (
|
|
4861
|
+
if (h.isFileInput(e)) {
|
|
4800
4862
|
const r = t, i = r.files ? Array.from(r.files) : [];
|
|
4801
4863
|
return r.multiple ? i : i.length > 0 ? i[0] : null;
|
|
4802
4864
|
}
|
|
4803
|
-
if (
|
|
4865
|
+
if (h.isBooleanCheckbox(e)) {
|
|
4804
4866
|
const r = t;
|
|
4805
4867
|
return r.value === "false" ? !r.checked : r.checked;
|
|
4806
4868
|
}
|
|
@@ -4869,7 +4931,7 @@ const p = class p {
|
|
|
4869
4931
|
const r = e.getTarget();
|
|
4870
4932
|
if (!(r instanceof HTMLInputElement) || r.type !== "radio" || r.hasAttribute("name") && !r.hasAttribute(Ke))
|
|
4871
4933
|
return;
|
|
4872
|
-
const i =
|
|
4934
|
+
const i = h.resolveGroupScope(e), n = `${String(t)}--haori${h.resolveGroupScopeId(
|
|
4873
4935
|
i
|
|
4874
4936
|
)}`;
|
|
4875
4937
|
if (r.getAttribute("name") !== n)
|
|
@@ -4903,8 +4965,8 @@ const p = class p {
|
|
|
4903
4965
|
* @returns スコープの識別番号
|
|
4904
4966
|
*/
|
|
4905
4967
|
static resolveGroupScopeId(e) {
|
|
4906
|
-
const t =
|
|
4907
|
-
return t !== void 0 ? t : (
|
|
4968
|
+
const t = h.GROUP_SCOPE_IDS.get(e);
|
|
4969
|
+
return t !== void 0 ? t : (h.groupScopeSequence += 1, h.GROUP_SCOPE_IDS.set(e, h.groupScopeSequence), h.groupScopeSequence);
|
|
4908
4970
|
}
|
|
4909
4971
|
/**
|
|
4910
4972
|
* 宣言バインドで値・状態が決まり、その評価が解決している入力かどうかを判定します。
|
|
@@ -4922,17 +4984,17 @@ const p = class p {
|
|
|
4922
4984
|
* @returns 宣言バインドで値・状態が決まり、その評価が解決している場合 true
|
|
4923
4985
|
*/
|
|
4924
4986
|
static hasResolvedDeclarativeState(e) {
|
|
4925
|
-
if (!
|
|
4987
|
+
if (!h.isDeclarativeStateBound(e))
|
|
4926
4988
|
return !1;
|
|
4927
4989
|
const t = e.getTarget();
|
|
4928
4990
|
if (t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio"))
|
|
4929
|
-
return
|
|
4930
|
-
if (
|
|
4931
|
-
return
|
|
4991
|
+
return h.isDeclarationResolved(e, "checked");
|
|
4992
|
+
if (h.hasDeclarativeBinding(e, "value"))
|
|
4993
|
+
return h.isDeclarationResolved(e, "value");
|
|
4932
4994
|
if (t instanceof HTMLSelectElement) {
|
|
4933
4995
|
for (const r of Array.from(t.options)) {
|
|
4934
4996
|
const i = N.get(r);
|
|
4935
|
-
if (i instanceof T &&
|
|
4997
|
+
if (i instanceof T && h.hasDeclarativeBinding(i, "selected") && !h.isDeclarationResolved(i, "selected"))
|
|
4936
4998
|
return !1;
|
|
4937
4999
|
}
|
|
4938
5000
|
return !0;
|
|
@@ -4975,7 +5037,7 @@ const p = class p {
|
|
|
4975
5037
|
*/
|
|
4976
5038
|
static isDeclarativeStateBound(e) {
|
|
4977
5039
|
const t = e.getTarget();
|
|
4978
|
-
return t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ?
|
|
5040
|
+
return t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ? h.hasDeclarativeBinding(e, "checked") : T.isValuePropertyTarget(t) ? h.hasDeclarativeBinding(e, "value") ? !0 : t instanceof HTMLSelectElement ? h.hasDeclarativeSelectedOption(t) : !1 : !1;
|
|
4979
5041
|
}
|
|
4980
5042
|
/**
|
|
4981
5043
|
* 宣言バインドで値・状態が決まる入力について、DOM 側の値を空へ揃えます。
|
|
@@ -4987,14 +5049,14 @@ const p = class p {
|
|
|
4987
5049
|
* @return 戻り値はありません。
|
|
4988
5050
|
*/
|
|
4989
5051
|
static clearDeclarativeStateFromDom(e) {
|
|
4990
|
-
if (
|
|
5052
|
+
if (h.isDeclarativeStateBound(e)) {
|
|
4991
5053
|
const t = e.getTarget();
|
|
4992
5054
|
t instanceof HTMLInputElement && (t.type === "checkbox" || t.type === "radio") ? t.checked = !1 : t instanceof HTMLSelectElement ? (Array.from(t.options).forEach((r) => {
|
|
4993
5055
|
r.selected = !1;
|
|
4994
5056
|
}), t.selectedIndex = -1) : (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) && (t.value = "");
|
|
4995
5057
|
}
|
|
4996
5058
|
e.getChildren().forEach((t) => {
|
|
4997
|
-
t instanceof T &&
|
|
5059
|
+
t instanceof T && h.clearDeclarativeStateFromDom(t);
|
|
4998
5060
|
});
|
|
4999
5061
|
}
|
|
5000
5062
|
/**
|
|
@@ -5024,7 +5086,7 @@ const p = class p {
|
|
|
5024
5086
|
static hasDeclarativeSelectedOption(e) {
|
|
5025
5087
|
for (const t of Array.from(e.options)) {
|
|
5026
5088
|
const r = N.get(t);
|
|
5027
|
-
if (r instanceof T &&
|
|
5089
|
+
if (r instanceof T && h.hasDeclarativeBinding(r, "selected"))
|
|
5028
5090
|
return !0;
|
|
5029
5091
|
}
|
|
5030
5092
|
return !1;
|
|
@@ -5055,7 +5117,7 @@ const p = class p {
|
|
|
5055
5117
|
* @returns 編集された入力欄だけを含む値のオブジェクト
|
|
5056
5118
|
*/
|
|
5057
5119
|
static getValuesEditedAfter(e, t) {
|
|
5058
|
-
return
|
|
5120
|
+
return h.getPartValues(e, {}, t);
|
|
5059
5121
|
}
|
|
5060
5122
|
/**
|
|
5061
5123
|
* 利用者が編集した入力欄に対応するバインドデータの経路を集めます。
|
|
@@ -5086,7 +5148,7 @@ const p = class p {
|
|
|
5086
5148
|
*/
|
|
5087
5149
|
static collectEditedPaths(e, t = "", r = null) {
|
|
5088
5150
|
const i = /* @__PURE__ */ new Set();
|
|
5089
|
-
return
|
|
5151
|
+
return h.walkEditedPaths(h.getValuesEditedAfter(e, 0), t, i), h.walkExcludedPaths(r ?? h.getValues(e), t, i), i;
|
|
5090
5152
|
}
|
|
5091
5153
|
/**
|
|
5092
5154
|
* 収集値をたどって、除外されたキーの経路を集めます。
|
|
@@ -5101,15 +5163,15 @@ const p = class p {
|
|
|
5101
5163
|
static walkExcludedPaths(e, t, r) {
|
|
5102
5164
|
if (Array.isArray(e))
|
|
5103
5165
|
return;
|
|
5104
|
-
const i =
|
|
5166
|
+
const i = h.asPlainRecord(e);
|
|
5105
5167
|
if (i === null)
|
|
5106
5168
|
return;
|
|
5107
|
-
const n =
|
|
5169
|
+
const n = h.COLLECTED_EXCLUDED_KEYS.get(i);
|
|
5108
5170
|
if (n)
|
|
5109
5171
|
for (const s of n)
|
|
5110
5172
|
s in i || r.add(t === "" ? s : `${t}.${s}`);
|
|
5111
5173
|
for (const [s, a] of Object.entries(i))
|
|
5112
|
-
|
|
5174
|
+
h.walkExcludedPaths(
|
|
5113
5175
|
a,
|
|
5114
5176
|
t === "" ? s : `${t}.${s}`,
|
|
5115
5177
|
r
|
|
@@ -5125,10 +5187,10 @@ const p = class p {
|
|
|
5125
5187
|
static walkEditedPaths(e, t, r) {
|
|
5126
5188
|
if (Array.isArray(e))
|
|
5127
5189
|
return;
|
|
5128
|
-
const i =
|
|
5190
|
+
const i = h.asPlainRecord(e);
|
|
5129
5191
|
if (i !== null) {
|
|
5130
5192
|
for (const [n, s] of Object.entries(i))
|
|
5131
|
-
|
|
5193
|
+
h.walkEditedPaths(
|
|
5132
5194
|
s,
|
|
5133
5195
|
t === "" ? n : `${t}.${n}`,
|
|
5134
5196
|
r
|
|
@@ -5150,67 +5212,79 @@ const p = class p {
|
|
|
5150
5212
|
* @returns values と同じオブジェクト
|
|
5151
5213
|
*/
|
|
5152
5214
|
static getPartValues(e, t, r = null, i = null) {
|
|
5215
|
+
if (e.hasAttribute(`${u.prefix}form-detach`))
|
|
5216
|
+
return t;
|
|
5153
5217
|
if (e.getTarget().hasAttribute(`${u.prefix}if-false`)) {
|
|
5154
5218
|
if (i !== null)
|
|
5155
|
-
for (const c of
|
|
5219
|
+
for (const c of h.collectDeclaredKeysInFragment(e))
|
|
5156
5220
|
i.add(c);
|
|
5157
5221
|
return t;
|
|
5158
5222
|
}
|
|
5159
|
-
const n =
|
|
5223
|
+
const n = h.resolveFieldName(e), s = e.getAttribute(`${u.prefix}form-object`), a = e.getAttribute(`${u.prefix}form-list`), o = e.hasAttribute(`${u.prefix}form-list`), l = r !== null && e.getUserEditSequence() <= r;
|
|
5160
5224
|
if (n) {
|
|
5161
|
-
if (
|
|
5225
|
+
if (r !== null && h.isGroupedCheckable(e)) {
|
|
5226
|
+
const c = h.collectGroupSelection(
|
|
5227
|
+
e,
|
|
5228
|
+
o,
|
|
5229
|
+
r
|
|
5230
|
+
);
|
|
5231
|
+
c.edited && (t[String(n)] = c.value);
|
|
5232
|
+
} else if (o && h.isGroupedCheckable(e)) {
|
|
5233
|
+
const c = String(n), d = e.getTarget();
|
|
5234
|
+
r === null && !Array.isArray(t[c]) && (t[c] = []), !l && d.checked && (Array.isArray(t[c]) || (t[c] = []), t[c].push(d.value));
|
|
5235
|
+
} else if (o && l)
|
|
5162
5236
|
Array.isArray(t[String(n)]) ? t[String(n)].push(null) : t[String(n)] = [null];
|
|
5163
5237
|
else if (!l) if (o) {
|
|
5164
|
-
const c =
|
|
5238
|
+
const c = h.resolveCollectedValue(e), d = h.isFileInput(e) && Array.isArray(c) ? c : [c];
|
|
5165
5239
|
Array.isArray(t[String(n)]) ? t[String(n)].push(...d) : t[String(n)] = d;
|
|
5166
|
-
} else if (
|
|
5167
|
-
const c = e.getTarget(), d = c instanceof HTMLInputElement ? c.checked : !0,
|
|
5240
|
+
} else if (h.isGroupedCheckable(e)) {
|
|
5241
|
+
const c = e.getTarget(), d = c instanceof HTMLInputElement ? c.checked : !0, p = c instanceof HTMLInputElement ? c.value : e.getValue(), y = d ? p : null, A = String(n);
|
|
5168
5242
|
y === null ? A in t || (t[A] = null) : t[A] === null || t[A] === void 0 ? t[A] = y : Array.isArray(t[A]) ? t[A].push(y) : t[A] = [t[A], y];
|
|
5169
5243
|
} else
|
|
5170
|
-
t[String(n)] =
|
|
5244
|
+
t[String(n)] = h.resolveCollectedValue(e);
|
|
5171
5245
|
s && m.warn(
|
|
5172
5246
|
"Haori",
|
|
5173
5247
|
`Element cannot have both ${u.prefix}form-object and name attributes.`
|
|
5174
5248
|
);
|
|
5175
5249
|
for (const c of e.getChildElementFragments())
|
|
5176
|
-
|
|
5250
|
+
h.getPartValues(c, t, r, i);
|
|
5177
5251
|
} else if (s) {
|
|
5178
5252
|
const c = {}, d = i === null ? null : /* @__PURE__ */ new Set();
|
|
5179
|
-
for (const
|
|
5180
|
-
|
|
5181
|
-
|
|
5253
|
+
for (const p of e.getChildElementFragments())
|
|
5254
|
+
h.getPartValues(
|
|
5255
|
+
p,
|
|
5182
5256
|
c,
|
|
5183
5257
|
r,
|
|
5184
5258
|
d
|
|
5185
5259
|
);
|
|
5186
|
-
d !== null &&
|
|
5260
|
+
d !== null && h.registerCollectedExcludedKeys(c, d), Object.keys(c).length > 0 ? t[String(s)] = c : i !== null && (d?.size ?? 0) > 0 && i.add(String(s)), a && m.warn(
|
|
5187
5261
|
"Haori",
|
|
5188
5262
|
`Element cannot have both ${u.prefix}form-list and ${u.prefix}form-object attributes.`
|
|
5189
5263
|
);
|
|
5190
5264
|
} else if (a) {
|
|
5191
5265
|
const c = [], d = [];
|
|
5192
|
-
let
|
|
5266
|
+
let p = !1;
|
|
5193
5267
|
for (const y of e.getChildElementFragments()) {
|
|
5194
5268
|
const A = {}, S = i === null ? null : /* @__PURE__ */ new Set();
|
|
5195
|
-
|
|
5269
|
+
h.getPartValues(
|
|
5196
5270
|
y,
|
|
5197
5271
|
A,
|
|
5198
5272
|
r,
|
|
5199
5273
|
S
|
|
5200
|
-
), S !== null &&
|
|
5274
|
+
), S !== null && h.registerCollectedExcludedKeys(A, S), Object.keys(A).length > 0 ? (p = !0, c.push(A), d.push(y.getListKey())) : r !== null && (c.push({}), d.push(y.getListKey()));
|
|
5201
5275
|
}
|
|
5202
5276
|
if (r === null) {
|
|
5203
5277
|
const y = e.getAttribute(`${u.prefix}each-key`);
|
|
5204
|
-
|
|
5278
|
+
h.registerCollectedRowIdentity(
|
|
5205
5279
|
c,
|
|
5206
5280
|
y == null ? null : String(y),
|
|
5207
5281
|
d,
|
|
5208
|
-
|
|
5282
|
+
h.isCollectedListFromEachSource(e)
|
|
5209
5283
|
), t[String(a)] = c;
|
|
5210
|
-
} else
|
|
5284
|
+
} else p && (t[String(a)] = c);
|
|
5211
5285
|
} else
|
|
5212
5286
|
for (const c of e.getChildElementFragments())
|
|
5213
|
-
|
|
5287
|
+
h.getPartValues(c, t, r, i);
|
|
5214
5288
|
return t;
|
|
5215
5289
|
}
|
|
5216
5290
|
/**
|
|
@@ -5223,7 +5297,7 @@ const p = class p {
|
|
|
5223
5297
|
* @returns Promise(DOMの更新が完了したら解決される)
|
|
5224
5298
|
*/
|
|
5225
5299
|
static setValues(e, t, r = !1) {
|
|
5226
|
-
return
|
|
5300
|
+
return h.setPartValues(e, t, r, !0);
|
|
5227
5301
|
}
|
|
5228
5302
|
/**
|
|
5229
5303
|
* フォーム内にある入力エレメントに値をイベントなしで設定します。
|
|
@@ -5236,7 +5310,7 @@ const p = class p {
|
|
|
5236
5310
|
* @returns Promise(DOMの更新が完了したら解決される)
|
|
5237
5311
|
*/
|
|
5238
5312
|
static syncValues(e, t, r = !1, i = null) {
|
|
5239
|
-
return
|
|
5313
|
+
return h.setPartValues(
|
|
5240
5314
|
e,
|
|
5241
5315
|
t,
|
|
5242
5316
|
r,
|
|
@@ -5259,7 +5333,7 @@ const p = class p {
|
|
|
5259
5333
|
* @returns 反映完了の Promise
|
|
5260
5334
|
*/
|
|
5261
5335
|
static syncRowValues(e, t, r = null) {
|
|
5262
|
-
return
|
|
5336
|
+
return h.setPartValues(
|
|
5263
5337
|
e,
|
|
5264
5338
|
t,
|
|
5265
5339
|
!1,
|
|
@@ -5289,7 +5363,7 @@ const p = class p {
|
|
|
5289
5363
|
if (!r)
|
|
5290
5364
|
return t;
|
|
5291
5365
|
const i = String(r);
|
|
5292
|
-
return Object.prototype.hasOwnProperty.call(t, i) ?
|
|
5366
|
+
return Object.prototype.hasOwnProperty.call(t, i) ? h.asPlainRecord(t[i]) ?? {} : h.resolveAncestorArgOwner(e, i)?.value ?? {};
|
|
5293
5367
|
}
|
|
5294
5368
|
/**
|
|
5295
5369
|
* `data-form-arg` のキーを所有する祖先を解決します。
|
|
@@ -5314,7 +5388,7 @@ const p = class p {
|
|
|
5314
5388
|
if (i && Object.prototype.hasOwnProperty.call(i, t)) {
|
|
5315
5389
|
if (r.getListKey() !== null)
|
|
5316
5390
|
return null;
|
|
5317
|
-
const n =
|
|
5391
|
+
const n = h.asPlainRecord(i[t]);
|
|
5318
5392
|
return n ? { owner: r, value: n } : null;
|
|
5319
5393
|
}
|
|
5320
5394
|
r = r.getParent();
|
|
@@ -5338,18 +5412,18 @@ const p = class p {
|
|
|
5338
5412
|
static buildConditionScope(e, t = null) {
|
|
5339
5413
|
const r = { ...e.getBindingData() }, i = t ? {
|
|
5340
5414
|
source: t,
|
|
5341
|
-
argKey:
|
|
5342
|
-
} :
|
|
5415
|
+
argKey: h.resolveFormArgKey(t)
|
|
5416
|
+
} : h.resolveConditionValueSource(e);
|
|
5343
5417
|
if (!i)
|
|
5344
5418
|
return r;
|
|
5345
|
-
const n =
|
|
5419
|
+
const n = h.getValues(i.source), s = h.collectDeclaredFieldKeys(i.source);
|
|
5346
5420
|
if (i.argKey === null) {
|
|
5347
5421
|
for (const o of s)
|
|
5348
5422
|
r[o] = n[o];
|
|
5349
5423
|
return r;
|
|
5350
5424
|
}
|
|
5351
5425
|
const a = {
|
|
5352
|
-
...
|
|
5426
|
+
...h.asPlainRecord(r[i.argKey]) ?? {}
|
|
5353
5427
|
};
|
|
5354
5428
|
for (const o of s)
|
|
5355
5429
|
a[o] = n[o];
|
|
@@ -5379,8 +5453,8 @@ const p = class p {
|
|
|
5379
5453
|
}
|
|
5380
5454
|
t = i;
|
|
5381
5455
|
}
|
|
5382
|
-
const r =
|
|
5383
|
-
return r ? { source: r, argKey:
|
|
5456
|
+
const r = h.getFormFragment(e);
|
|
5457
|
+
return r ? { source: r, argKey: h.resolveFormArgKey(r) } : null;
|
|
5384
5458
|
}
|
|
5385
5459
|
/**
|
|
5386
5460
|
* フォームコンテナの `data-form-arg` のキー名を返します。
|
|
@@ -5412,7 +5486,7 @@ const p = class p {
|
|
|
5412
5486
|
* @returns 宣言されている最上位のキー名
|
|
5413
5487
|
*/
|
|
5414
5488
|
static collectDeclaredFieldKeys(e) {
|
|
5415
|
-
return
|
|
5489
|
+
return h.collectDeclaredKeysInFragment(e);
|
|
5416
5490
|
}
|
|
5417
5491
|
/**
|
|
5418
5492
|
* フラグメントの配下で収集対象として**宣言されている**最上位のキー名を列挙します。
|
|
@@ -5424,7 +5498,7 @@ const p = class p {
|
|
|
5424
5498
|
* @returns 宣言されている最上位のキー名
|
|
5425
5499
|
*/
|
|
5426
5500
|
static collectDeclaredKeysInFragment(e) {
|
|
5427
|
-
const t = /* @__PURE__ */ new Set(), r = e.getTarget(), i =
|
|
5501
|
+
const t = /* @__PURE__ */ new Set(), r = e.getTarget(), i = h.resolveFieldName(e);
|
|
5428
5502
|
i && t.add(String(i));
|
|
5429
5503
|
const n = `${u.prefix}form-object`, s = `${u.prefix}form-list`, a = r.getAttribute(n) ?? r.getAttribute(s);
|
|
5430
5504
|
if (a)
|
|
@@ -5433,11 +5507,13 @@ const p = class p {
|
|
|
5433
5507
|
return r.querySelectorAll(o).forEach((l) => {
|
|
5434
5508
|
if (!(l instanceof HTMLElement))
|
|
5435
5509
|
return;
|
|
5436
|
-
let c = null, d = l;
|
|
5437
|
-
for (;
|
|
5438
|
-
(d.hasAttribute(n) ||
|
|
5439
|
-
|
|
5440
|
-
|
|
5510
|
+
let c = null, d = !1, p = l;
|
|
5511
|
+
for (; p && p !== r; )
|
|
5512
|
+
p.hasAttribute(`${u.prefix}form-detach`) && (d = !0), (p.hasAttribute(n) || p.hasAttribute(s)) && (c = p), p = p.parentElement;
|
|
5513
|
+
if (d)
|
|
5514
|
+
return;
|
|
5515
|
+
const y = c ?? l, A = y.getAttribute(n) || y.getAttribute(s) || y.getAttribute(`${u.prefix}form-name`) || y.getAttribute("name");
|
|
5516
|
+
A && t.add(A);
|
|
5441
5517
|
}), t;
|
|
5442
5518
|
}
|
|
5443
5519
|
/**
|
|
@@ -5452,7 +5528,7 @@ const p = class p {
|
|
|
5452
5528
|
*/
|
|
5453
5529
|
static applyCustomValidity(e) {
|
|
5454
5530
|
const t = `${u.prefix}validity`, r = (i) => {
|
|
5455
|
-
i.hasAttribute(t) &&
|
|
5531
|
+
i.hasAttribute(t) && h.applyOneCustomValidity(i, t), i.getChildElementFragments().forEach(r);
|
|
5456
5532
|
};
|
|
5457
5533
|
r(e);
|
|
5458
5534
|
}
|
|
@@ -5477,19 +5553,19 @@ const p = class p {
|
|
|
5477
5553
|
r.setCustomValidity("");
|
|
5478
5554
|
return;
|
|
5479
5555
|
}
|
|
5480
|
-
const n =
|
|
5481
|
-
|
|
5556
|
+
const n = h.buildConditionScope(e), s = J.evaluateDetailed(
|
|
5557
|
+
h.unwrapConditionExpression(i),
|
|
5482
5558
|
n
|
|
5483
5559
|
);
|
|
5484
5560
|
if (s.unresolvedReference) {
|
|
5485
5561
|
m.warn(
|
|
5486
5562
|
"Haori",
|
|
5487
5563
|
`${t} の参照が解決できないため無効として扱います: ${i}`
|
|
5488
|
-
), r.setCustomValidity(
|
|
5564
|
+
), r.setCustomValidity(h.resolveValidityMessage(e));
|
|
5489
5565
|
return;
|
|
5490
5566
|
}
|
|
5491
5567
|
r.setCustomValidity(
|
|
5492
|
-
s.value ? "" :
|
|
5568
|
+
s.value ? "" : h.resolveValidityMessage(e)
|
|
5493
5569
|
);
|
|
5494
5570
|
}
|
|
5495
5571
|
/**
|
|
@@ -5551,7 +5627,7 @@ const p = class p {
|
|
|
5551
5627
|
* @param identifiesItems リストキーで収集先の配列要素を識別できるかどうか
|
|
5552
5628
|
*/
|
|
5553
5629
|
static registerCollectedRowIdentity(e, t, r, i) {
|
|
5554
|
-
|
|
5630
|
+
h.COLLECTED_ROW_IDENTITY.set(e, { keyArg: t, keys: r, identifiesItems: i });
|
|
5555
5631
|
}
|
|
5556
5632
|
/**
|
|
5557
5633
|
* 収集値の階層に、除外されたキーの集合を結び付けます。
|
|
@@ -5560,7 +5636,7 @@ const p = class p {
|
|
|
5560
5636
|
* @param keys 除外されたキー
|
|
5561
5637
|
*/
|
|
5562
5638
|
static registerCollectedExcludedKeys(e, t) {
|
|
5563
|
-
t.size > 0 &&
|
|
5639
|
+
t.size > 0 && h.COLLECTED_EXCLUDED_KEYS.set(e, t);
|
|
5564
5640
|
}
|
|
5565
5641
|
/**
|
|
5566
5642
|
* 収集値に控えた情報を、複製した値へ引き継ぎます。
|
|
@@ -5573,10 +5649,10 @@ const p = class p {
|
|
|
5573
5649
|
* @param to 複製した値
|
|
5574
5650
|
*/
|
|
5575
5651
|
static carryCollectedRowIdentity(e, t) {
|
|
5576
|
-
const r =
|
|
5577
|
-
r &&
|
|
5578
|
-
const i =
|
|
5579
|
-
i &&
|
|
5652
|
+
const r = h.COLLECTED_ROW_IDENTITY.get(e);
|
|
5653
|
+
r && h.COLLECTED_ROW_IDENTITY.set(t, r);
|
|
5654
|
+
const i = h.COLLECTED_EXCLUDED_KEYS.get(e);
|
|
5655
|
+
i && h.COLLECTED_EXCLUDED_KEYS.set(t, i);
|
|
5580
5656
|
}
|
|
5581
5657
|
/**
|
|
5582
5658
|
* 行の対応付けが出現順へ退いたことを、開発モードで一度だけ知らせます。
|
|
@@ -5588,7 +5664,7 @@ const p = class p {
|
|
|
5588
5664
|
* @param reason 退いた理由
|
|
5589
5665
|
*/
|
|
5590
5666
|
static warnPositionalRowFallback(e) {
|
|
5591
|
-
!j.isEnabled() ||
|
|
5667
|
+
!j.isEnabled() || h.warnedPositionalRowFallbacks.has(e) || (h.warnedPositionalRowFallbacks.add(e), m.warn(
|
|
5592
5668
|
"[Haori]",
|
|
5593
5669
|
`${u.prefix}form-list の行を出現順で対応付けます(${e})。配列と画面の行数・並びが一致していない場合、行の値を取り違えます。`
|
|
5594
5670
|
));
|
|
@@ -5626,8 +5702,8 @@ const p = class p {
|
|
|
5626
5702
|
static mergeCollectedValues(e, t) {
|
|
5627
5703
|
const r = { ...e ?? {} };
|
|
5628
5704
|
for (const [n, s] of Object.entries(t))
|
|
5629
|
-
|
|
5630
|
-
const i =
|
|
5705
|
+
h.UNSAFE_MERGE_KEYS.has(n) || (r[n] = h.overlayCollectedValue(e?.[n], s));
|
|
5706
|
+
const i = h.COLLECTED_EXCLUDED_KEYS.get(t);
|
|
5631
5707
|
if (i)
|
|
5632
5708
|
for (const n of i)
|
|
5633
5709
|
n in t || delete r[n];
|
|
@@ -5644,13 +5720,13 @@ const p = class p {
|
|
|
5644
5720
|
if (Array.isArray(t)) {
|
|
5645
5721
|
if (!Array.isArray(e))
|
|
5646
5722
|
return t;
|
|
5647
|
-
const n =
|
|
5723
|
+
const n = h.overlayIdentifiedRows(e, t);
|
|
5648
5724
|
return n !== null ? n : t.map(
|
|
5649
|
-
(s, a) =>
|
|
5725
|
+
(s, a) => h.overlayCollectedValue(e[a], s)
|
|
5650
5726
|
);
|
|
5651
5727
|
}
|
|
5652
|
-
const r =
|
|
5653
|
-
return r === null || i === null ? t :
|
|
5728
|
+
const r = h.asPlainRecord(t), i = h.asPlainRecord(e);
|
|
5729
|
+
return r === null || i === null ? t : h.mergeCollectedValues(i, r);
|
|
5654
5730
|
}
|
|
5655
5731
|
/**
|
|
5656
5732
|
* 式の先頭にある素の経路を返します。
|
|
@@ -5668,7 +5744,7 @@ const p = class p {
|
|
|
5668
5744
|
* @returns 先頭の経路。経路として読めない場合は null
|
|
5669
5745
|
*/
|
|
5670
5746
|
static resolveLeadingPath(e) {
|
|
5671
|
-
const t =
|
|
5747
|
+
const t = h.LEADING_PATH_PATTERN.exec(e);
|
|
5672
5748
|
if (!t)
|
|
5673
5749
|
return null;
|
|
5674
5750
|
const r = t[2].trim();
|
|
@@ -5705,7 +5781,7 @@ const p = class p {
|
|
|
5705
5781
|
const r = e.getRawAttribute(`${u.prefix}each`);
|
|
5706
5782
|
if (typeof r != "string" || r.trim() === "")
|
|
5707
5783
|
return !0;
|
|
5708
|
-
const i =
|
|
5784
|
+
const i = h.resolveLeadingPath(r);
|
|
5709
5785
|
if (i === null)
|
|
5710
5786
|
return !0;
|
|
5711
5787
|
const n = i.split(".");
|
|
@@ -5729,7 +5805,7 @@ const p = class p {
|
|
|
5729
5805
|
static createRowKeyIndexes(e, t) {
|
|
5730
5806
|
const r = /* @__PURE__ */ new Map();
|
|
5731
5807
|
return e.forEach((i, n) => {
|
|
5732
|
-
const s =
|
|
5808
|
+
const s = B.createListKey(
|
|
5733
5809
|
i,
|
|
5734
5810
|
t,
|
|
5735
5811
|
n
|
|
@@ -5760,7 +5836,7 @@ const p = class p {
|
|
|
5760
5836
|
const i = e.map((s) => s.getListKey());
|
|
5761
5837
|
if (i.some((s) => s === null))
|
|
5762
5838
|
return null;
|
|
5763
|
-
const n =
|
|
5839
|
+
const n = h.createRowKeyIndexes(t, r);
|
|
5764
5840
|
return i.map((s) => {
|
|
5765
5841
|
const a = n.get(s);
|
|
5766
5842
|
return !a || a.length === 0 ? null : t[a.shift()];
|
|
@@ -5782,23 +5858,23 @@ const p = class p {
|
|
|
5782
5858
|
* @returns 重ね合わせた配列。対応付けができない場合は null(出現順へ退く)
|
|
5783
5859
|
*/
|
|
5784
5860
|
static overlayIdentifiedRows(e, t) {
|
|
5785
|
-
const r =
|
|
5861
|
+
const r = h.COLLECTED_ROW_IDENTITY.get(t);
|
|
5786
5862
|
if (r && !r.identifiesItems)
|
|
5787
5863
|
return null;
|
|
5788
5864
|
if (!r)
|
|
5789
|
-
return t.some((s) =>
|
|
5865
|
+
return t.some((s) => h.asPlainRecord(s) !== null) && h.warnPositionalRowFallback("識別情報が引き継がれていません"), null;
|
|
5790
5866
|
if (r.keys.length !== t.length)
|
|
5791
|
-
return
|
|
5867
|
+
return h.warnPositionalRowFallback("収集後に行の数が変わっています"), null;
|
|
5792
5868
|
if (r.keys.some((s) => s === null))
|
|
5793
5869
|
return null;
|
|
5794
|
-
const i =
|
|
5870
|
+
const i = h.createRowKeyIndexes(e, r.keyArg), n = [];
|
|
5795
5871
|
for (let s = 0; s < t.length; s += 1) {
|
|
5796
5872
|
const a = r.keys[s], o = i.get(a);
|
|
5797
5873
|
if (!o || o.length === 0)
|
|
5798
5874
|
continue;
|
|
5799
5875
|
const l = o.shift();
|
|
5800
5876
|
n.push(
|
|
5801
|
-
|
|
5877
|
+
h.overlayCollectedValue(e[l], t[s])
|
|
5802
5878
|
);
|
|
5803
5879
|
}
|
|
5804
5880
|
return n;
|
|
@@ -5819,11 +5895,11 @@ const p = class p {
|
|
|
5819
5895
|
*/
|
|
5820
5896
|
static syncAncestorArgForms(e, t, r = null) {
|
|
5821
5897
|
const i = [];
|
|
5822
|
-
for (const { form: n, key: s } of
|
|
5898
|
+
for (const { form: n, key: s } of h.collectArgForms(e)) {
|
|
5823
5899
|
if (n.wasResetAfter(t))
|
|
5824
5900
|
continue;
|
|
5825
|
-
const a =
|
|
5826
|
-
!a || a.owner !== e || i.push(
|
|
5901
|
+
const a = h.resolveAncestorArgOwner(n, s);
|
|
5902
|
+
!a || a.owner !== e || i.push(h.pushAncestorArgValue(n, s, a.value, r));
|
|
5827
5903
|
}
|
|
5828
5904
|
return Promise.all(i).then(() => {
|
|
5829
5905
|
});
|
|
@@ -5861,22 +5937,22 @@ const p = class p {
|
|
|
5861
5937
|
* @returns 反映完了の Promise
|
|
5862
5938
|
*/
|
|
5863
5939
|
static pushAncestorArgValue(e, t, r, i = null) {
|
|
5864
|
-
const n = e.getTarget(), s =
|
|
5940
|
+
const n = e.getTarget(), s = h.createArgValueSignature(r);
|
|
5865
5941
|
if (s !== null) {
|
|
5866
|
-
if (
|
|
5942
|
+
if (h.LAST_ANCESTOR_ARG_VALUES.get(n) === s)
|
|
5867
5943
|
return Promise.resolve();
|
|
5868
|
-
|
|
5944
|
+
h.LAST_ANCESTOR_ARG_VALUES.set(n, s);
|
|
5869
5945
|
} else
|
|
5870
|
-
|
|
5946
|
+
h.LAST_ANCESTOR_ARG_VALUES.delete(n);
|
|
5871
5947
|
const a = e.getRawBindingData();
|
|
5872
5948
|
if (a && Object.prototype.hasOwnProperty.call(a, t)) {
|
|
5873
5949
|
const o = { ...a };
|
|
5874
|
-
return delete o[t],
|
|
5950
|
+
return delete o[t], B.setBindingData(n, o, {
|
|
5875
5951
|
kind: i?.kind ?? "supply",
|
|
5876
5952
|
sequence: i?.sequence ?? T.nextSequence()
|
|
5877
5953
|
});
|
|
5878
5954
|
}
|
|
5879
|
-
return
|
|
5955
|
+
return h.syncValues(e, r, !1, i);
|
|
5880
5956
|
}
|
|
5881
5957
|
/**
|
|
5882
5958
|
* 流し込み済み判定に使う値の署名を作ります。
|
|
@@ -5915,23 +5991,23 @@ const p = class p {
|
|
|
5915
5991
|
});
|
|
5916
5992
|
const r = [];
|
|
5917
5993
|
for (const i of t) {
|
|
5918
|
-
if (
|
|
5994
|
+
if (h.INITIAL_RESTORED_FORMS.has(i))
|
|
5919
5995
|
continue;
|
|
5920
5996
|
const n = N.get(i);
|
|
5921
5997
|
if (!(n instanceof T))
|
|
5922
5998
|
continue;
|
|
5923
|
-
const s = n.getRawBindingData(), a = n.getAttribute(`${u.prefix}form-arg`), o = a ? String(a) : null, l = o !== null && !(s && Object.prototype.hasOwnProperty.call(s, o)) ?
|
|
5999
|
+
const s = n.getRawBindingData(), a = n.getAttribute(`${u.prefix}form-arg`), o = a ? String(a) : null, l = o !== null && !(s && Object.prototype.hasOwnProperty.call(s, o)) ? h.resolveAncestorArgOwner(n, o) : null;
|
|
5924
6000
|
if (!(!s && !l)) {
|
|
5925
|
-
if (
|
|
6001
|
+
if (h.INITIAL_RESTORED_FORMS.add(i), l) {
|
|
5926
6002
|
r.push(
|
|
5927
|
-
|
|
6003
|
+
h.pushAncestorArgValue(n, o, l.value)
|
|
5928
6004
|
);
|
|
5929
6005
|
continue;
|
|
5930
6006
|
}
|
|
5931
6007
|
r.push(
|
|
5932
|
-
|
|
6008
|
+
h.syncValues(
|
|
5933
6009
|
n,
|
|
5934
|
-
|
|
6010
|
+
h.resolveSyncValues(n, s)
|
|
5935
6011
|
)
|
|
5936
6012
|
);
|
|
5937
6013
|
}
|
|
@@ -5939,6 +6015,151 @@ const p = class p {
|
|
|
5939
6015
|
return Promise.all(r).then(() => {
|
|
5940
6016
|
});
|
|
5941
6017
|
}
|
|
6018
|
+
/**
|
|
6019
|
+
* 同名チェックボックス・ラジオの群を、群単位で収集します。
|
|
6020
|
+
*
|
|
6021
|
+
* 仕様「反映待ちの間に起きた変化」の「**同名チェックボックス・ラジオの群は、欄ごと
|
|
6022
|
+
* ではなく群単位で保護します**」「群のいずれかの欄が要求より後に操作されていれば、
|
|
6023
|
+
* その群の現在の選択集合をそのまま保護します」に対応します。群の値は 1 つのキーに
|
|
6024
|
+
* 対する選択の集合なので、操作された欄だけを取り出すと集合が壊れます。
|
|
6025
|
+
*
|
|
6026
|
+
* 群の範囲は仕様「反映待ちの間に起きた変化」の「群の範囲は、収集値の同じ階層です」
|
|
6027
|
+
* に従い、`resolveCollectionScope()` が返す階層の中だけを数えます。収集の対象外の
|
|
6028
|
+
* 部分木(`data-form-detach`・非表示分岐)と、別の階層(入れ子の `data-form-object` /
|
|
6029
|
+
* `data-form-list` の行)は数えません。同じ群かどうかは「群の同一性は**収集キー**で
|
|
6030
|
+
* 判断します」のとおり `resolveFieldName()` の結果で判定します(DOM の `name` で
|
|
6031
|
+
* 判定すると、`data-form-name` だけを宣言した別のキーの群と混ざる)。
|
|
6032
|
+
*
|
|
6033
|
+
* 走査は DOM 検索ではなくフラグメントの木で行います。収集(`getPartValues()`)と
|
|
6034
|
+
* 同じ木をたどることで階層と除外の判定を一致させ、Haori が管理していない要素
|
|
6035
|
+
* (外部ウィジェットの内部の入力欄など)へフラグメントを生やさないためです。
|
|
6036
|
+
* チェック状態と送信値は仕様「収集は DOM を真とする」のとおり DOM から読みます。
|
|
6037
|
+
*
|
|
6038
|
+
* @param fragment 群のいずれかの入力欄のフラグメント
|
|
6039
|
+
* @param isValueList `data-form-list` を併記しているかどうか
|
|
6040
|
+
* @param minUserEditSequence 編集の基準となる通し番号
|
|
6041
|
+
* @returns 基準より後の操作があったかどうかと、現在の選択集合
|
|
6042
|
+
*/
|
|
6043
|
+
static collectGroupSelection(e, t, r) {
|
|
6044
|
+
const i = [];
|
|
6045
|
+
h.collectGroupMembers(
|
|
6046
|
+
h.resolveCollectionScope(e),
|
|
6047
|
+
String(h.resolveFieldName(e)),
|
|
6048
|
+
i
|
|
6049
|
+
);
|
|
6050
|
+
let n = !1;
|
|
6051
|
+
const s = [];
|
|
6052
|
+
for (const a of i) {
|
|
6053
|
+
a.getUserEditSequence() > r && (n = !0);
|
|
6054
|
+
const o = a.getTarget();
|
|
6055
|
+
o instanceof HTMLInputElement && o.checked && s.push(o.value);
|
|
6056
|
+
}
|
|
6057
|
+
return t ? { edited: n, value: h.markCompleteSet(s) } : s.length === 0 ? { edited: n, value: null } : {
|
|
6058
|
+
edited: n,
|
|
6059
|
+
value: s.length === 1 ? s[0] : h.markCompleteSet(s)
|
|
6060
|
+
};
|
|
6061
|
+
}
|
|
6062
|
+
/**
|
|
6063
|
+
* 収集値の新しい階層を始める要素かどうかを判定します。
|
|
6064
|
+
*
|
|
6065
|
+
* `getPartValues()` の分岐と同じ規則です。収集キー(`name` / `data-form-name`)を
|
|
6066
|
+
* 持つ要素は値そのものを表すため階層を作らず、`data-form-object` /
|
|
6067
|
+
* `data-form-list` に**属性値がある**ときだけ階層が変わります(属性値の無い
|
|
6068
|
+
* `data-form-list` は入力要素の値を配列として集める印で、階層は作りません)。
|
|
6069
|
+
*
|
|
6070
|
+
* @param fragment 判定するフラグメント
|
|
6071
|
+
* @returns 新しい階層を始める場合は true
|
|
6072
|
+
*/
|
|
6073
|
+
static startsCollectionLevel(e) {
|
|
6074
|
+
return h.resolveFieldName(e) ? !1 : !!(e.getAttribute(`${u.prefix}form-object`) || e.getAttribute(`${u.prefix}form-list`));
|
|
6075
|
+
}
|
|
6076
|
+
/**
|
|
6077
|
+
* 収集値の階層(同じキーの集まる範囲)となるフラグメントを解決します。
|
|
6078
|
+
*
|
|
6079
|
+
* 仕様「反映待ちの間に起きた変化」の「群の範囲は、収集値の同じ階層です」
|
|
6080
|
+
* 「`data-form-list` の**行**、`data-form-object`、最近傍のフォーム(`<form>` または
|
|
6081
|
+
* `data-form`)のうち最も内側の範囲です」に対応します。`data-form-object` は自身が
|
|
6082
|
+
* 階層、`data-form-list` はその直下の要素(= 行)が階層です。フォームの外(どの
|
|
6083
|
+
* 階層にも囲まれていない構成)では、たどり着いた最上位の要素を範囲とします。
|
|
6084
|
+
*
|
|
6085
|
+
* ラジオの排他制御の範囲(`resolveGroupScope()`)とは別の概念です。あちらは HTML の
|
|
6086
|
+
* グループの範囲で `data-form-object` を境界としませんが、こちらは収集値のキーの
|
|
6087
|
+
* 範囲なので `data-form-object` も境界になります。
|
|
6088
|
+
*
|
|
6089
|
+
* @param fragment 起点のフラグメント
|
|
6090
|
+
* @returns 階層となるフラグメント
|
|
6091
|
+
*/
|
|
6092
|
+
static resolveCollectionScope(e) {
|
|
6093
|
+
let t = e, r = t.getParent();
|
|
6094
|
+
for (; r !== null; ) {
|
|
6095
|
+
if (h.startsCollectionLevel(r))
|
|
6096
|
+
return r.getAttribute(`${u.prefix}form-object`) ? r : t;
|
|
6097
|
+
if (h.isFormScopeRoot(r))
|
|
6098
|
+
return r;
|
|
6099
|
+
t = r, r = r.getParent();
|
|
6100
|
+
}
|
|
6101
|
+
return t;
|
|
6102
|
+
}
|
|
6103
|
+
/**
|
|
6104
|
+
* フォームの範囲の根(`<form>` または `data-form`)かどうかを判定します。
|
|
6105
|
+
*
|
|
6106
|
+
* @param fragment 判定するフラグメント
|
|
6107
|
+
* @returns フォームの範囲の根であれば true
|
|
6108
|
+
*/
|
|
6109
|
+
static isFormScopeRoot(e) {
|
|
6110
|
+
return e.getTarget() instanceof HTMLFormElement || e.hasAttribute(`${u.prefix}form`);
|
|
6111
|
+
}
|
|
6112
|
+
/**
|
|
6113
|
+
* 階層の中から、同じ収集キーを持つ群の欄を集めます。
|
|
6114
|
+
*
|
|
6115
|
+
* 収集(`getPartValues()`)と同じ判定で部分木を刈ります。別の階層(入れ子の
|
|
6116
|
+
* `data-form-object` / `data-form-list`)と、収集の対象外の部分木
|
|
6117
|
+
* (`data-form-detach`・非表示分岐の `data-if-false`)へは入りません。仕様
|
|
6118
|
+
* 「反映待ちの間に起きた変化」の「収集の対象外である部分木の欄も群に含めません」
|
|
6119
|
+
* に対応します。
|
|
6120
|
+
*
|
|
6121
|
+
* 入れ子のフォームはここでは刈りません。範囲の解決(`resolveCollectionScope()`)が
|
|
6122
|
+
* 最近傍のフォームで止まるため、内側の欄は内側のフォームを範囲として数え直され、
|
|
6123
|
+
* 同じキーへの書き込みはそちらが後に来ます(刈っても結果は変わらない)。
|
|
6124
|
+
*
|
|
6125
|
+
* @param fragment 走査するフラグメント(最初の呼び出しでは階層の根)
|
|
6126
|
+
* @param key 群の収集キー
|
|
6127
|
+
* @param members 集める先
|
|
6128
|
+
*/
|
|
6129
|
+
static collectGroupMembers(e, t, r) {
|
|
6130
|
+
h.isGroupedCheckable(e) && String(h.resolveFieldName(e)) === t && r.push(e);
|
|
6131
|
+
for (const i of e.getChildElementFragments())
|
|
6132
|
+
h.startsCollectionLevel(i) || i.hasAttribute(`${u.prefix}form-detach`) || // `data-if-false` は hide() が DOM へ直接付与するため実 DOM 属性を見る
|
|
6133
|
+
// (`getPartValues()` と同じ理由)。
|
|
6134
|
+
i.getTarget().hasAttribute(`${u.prefix}if-false`) || h.collectGroupMembers(i, t, r);
|
|
6135
|
+
}
|
|
6136
|
+
/**
|
|
6137
|
+
* 「集合として完結した値」として印を付けます。
|
|
6138
|
+
*
|
|
6139
|
+
* 群の選択集合は 1 つのキーに対する完全な値なので、応答データへ重ねるときに
|
|
6140
|
+
* 位置合わせで要素ごとに混ぜてはいけません(`data-form-list` の行の配列とは
|
|
6141
|
+
* 意味が違います)。印は `Procedure` の `mergeUserEdits()` が見て、丸ごと
|
|
6142
|
+
* 置き換えます。
|
|
6143
|
+
*
|
|
6144
|
+
* @param value 印を付ける配列
|
|
6145
|
+
* @returns 同じ配列
|
|
6146
|
+
*/
|
|
6147
|
+
static markCompleteSet(e) {
|
|
6148
|
+
return h.COMPLETE_SET_VALUES.add(e), e;
|
|
6149
|
+
}
|
|
6150
|
+
/**
|
|
6151
|
+
* 「集合として完結した値」の印が付いているかを返します。
|
|
6152
|
+
*
|
|
6153
|
+
* `Procedure` の `mergeUserEdits()` から参照するためだけに公開しています。仕様書に
|
|
6154
|
+
* 載る API ではないため、利用者向けの機能として扱わないでください。
|
|
6155
|
+
*
|
|
6156
|
+
* @internal
|
|
6157
|
+
* @param value 判定する値
|
|
6158
|
+
* @returns 印が付いていれば true
|
|
6159
|
+
*/
|
|
6160
|
+
static isCompleteSetValue(e) {
|
|
6161
|
+
return e !== null && typeof e == "object" && h.COMPLETE_SET_VALUES.has(e);
|
|
6162
|
+
}
|
|
5942
6163
|
/**
|
|
5943
6164
|
* 値による上書きをグループ単位で扱うべき入力要素(boolean 型でない
|
|
5944
6165
|
* チェックボックス、またはラジオボタン)かどうかを判定します。
|
|
@@ -5986,77 +6207,73 @@ const p = class p {
|
|
|
5986
6207
|
* @returns Promise(DOMの更新が完了したら解決される)
|
|
5987
6208
|
*/
|
|
5988
6209
|
static setPartValues(e, t, r = !1, i = !0, n = !1, s = /* @__PURE__ */ new Map(), a = null) {
|
|
5989
|
-
const o = []
|
|
6210
|
+
const o = [];
|
|
6211
|
+
if (e.hasAttribute(`${u.prefix}form-detach`) && !r)
|
|
6212
|
+
return Promise.resolve();
|
|
6213
|
+
const l = h.resolveFieldName(e), c = e.getAttribute(`${u.prefix}form-object`), d = e.getAttribute(`${u.prefix}form-list`), p = e.hasAttribute(`${u.prefix}form-list`);
|
|
5990
6214
|
if (l) {
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
p.applyFragmentValue(
|
|
6006
|
-
e,
|
|
6007
|
-
D[E] ?? null,
|
|
6008
|
-
i,
|
|
6009
|
-
a
|
|
6010
|
-
)
|
|
6011
|
-
);
|
|
6012
|
-
} else typeof D > "u" || (Array.isArray(D) && p.isGroupedCheckable(e) || Array.isArray(D) && p.isMultipleSelect(e) || typeof D == "string" || typeof D == "number" || typeof D == "boolean" || D === null ? o.push(
|
|
6013
|
-
p.applyFragmentValue(
|
|
6014
|
-
e,
|
|
6015
|
-
D,
|
|
6016
|
-
i,
|
|
6017
|
-
a
|
|
6018
|
-
)
|
|
6019
|
-
) : o.push(
|
|
6020
|
-
p.applyFragmentValue(
|
|
6215
|
+
const y = t[String(l)], A = n && h.hasResolvedDeclarativeState(e), S = n && typeof y > "u" && !h.isDeclarativeStateBound(e);
|
|
6216
|
+
let D = y;
|
|
6217
|
+
if (A ? D = void 0 : S && (D = null), h.isFileInput(e))
|
|
6218
|
+
return (D === null || D === "") && o.push(
|
|
6219
|
+
h.applyFragmentValue(e, null, i, a)
|
|
6220
|
+
), Promise.all(o).then(() => {
|
|
6221
|
+
});
|
|
6222
|
+
if (p && Array.isArray(D) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
6223
|
+
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
6224
|
+
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
6225
|
+
!h.isGroupedCheckable(e) && !h.isMultipleSelect(e)) {
|
|
6226
|
+
const P = String(l), H = s.get(P) ?? 0;
|
|
6227
|
+
s.set(P, H + 1), o.push(
|
|
6228
|
+
h.applyFragmentValue(
|
|
6021
6229
|
e,
|
|
6022
|
-
|
|
6230
|
+
D[H] ?? null,
|
|
6023
6231
|
i,
|
|
6024
6232
|
a
|
|
6025
6233
|
)
|
|
6026
|
-
)
|
|
6027
|
-
}
|
|
6234
|
+
);
|
|
6235
|
+
} else typeof D > "u" || (Array.isArray(D) && h.isGroupedCheckable(e) || Array.isArray(D) && h.isMultipleSelect(e) || typeof D == "string" || typeof D == "number" || typeof D == "boolean" || D === null ? o.push(
|
|
6236
|
+
h.applyFragmentValue(
|
|
6237
|
+
e,
|
|
6238
|
+
D,
|
|
6239
|
+
i,
|
|
6240
|
+
a
|
|
6241
|
+
)
|
|
6242
|
+
) : o.push(
|
|
6243
|
+
h.applyFragmentValue(e, String(D), i, a)
|
|
6244
|
+
));
|
|
6028
6245
|
} else if (c) {
|
|
6029
|
-
const
|
|
6030
|
-
if (
|
|
6031
|
-
const
|
|
6032
|
-
for (const
|
|
6246
|
+
const y = t[String(c)];
|
|
6247
|
+
if (y && typeof y == "object") {
|
|
6248
|
+
const A = /* @__PURE__ */ new Map();
|
|
6249
|
+
for (const S of e.getChildElementFragments())
|
|
6033
6250
|
o.push(
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6251
|
+
h.setPartValues(
|
|
6252
|
+
S,
|
|
6253
|
+
y,
|
|
6037
6254
|
r,
|
|
6038
6255
|
i,
|
|
6039
6256
|
n,
|
|
6040
|
-
|
|
6257
|
+
A,
|
|
6041
6258
|
a
|
|
6042
6259
|
)
|
|
6043
6260
|
);
|
|
6044
6261
|
}
|
|
6045
6262
|
} else if (d) {
|
|
6046
|
-
const
|
|
6047
|
-
if (Array.isArray(
|
|
6048
|
-
const
|
|
6049
|
-
S,
|
|
6263
|
+
const y = t[String(d)];
|
|
6264
|
+
if (Array.isArray(y)) {
|
|
6265
|
+
const A = e.getChildElementFragments(), S = e.getAttribute(`${u.prefix}each-key`), D = h.isCollectedListFromEachSource(e) ? h.pairRowsWithItems(
|
|
6050
6266
|
A,
|
|
6051
|
-
|
|
6267
|
+
y,
|
|
6268
|
+
S == null ? null : String(S)
|
|
6052
6269
|
) : null;
|
|
6053
|
-
for (let
|
|
6054
|
-
const
|
|
6270
|
+
for (let P = 0; P < A.length; P++) {
|
|
6271
|
+
const H = A[P], E = D ? D[P] : y.length > P ? y[P] : null;
|
|
6055
6272
|
o.push(
|
|
6056
6273
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6274
|
+
h.setPartValues(
|
|
6275
|
+
H,
|
|
6276
|
+
h.asPlainRecord(E) ?? {},
|
|
6060
6277
|
r,
|
|
6061
6278
|
i,
|
|
6062
6279
|
n,
|
|
@@ -6067,10 +6284,10 @@ const p = class p {
|
|
|
6067
6284
|
}
|
|
6068
6285
|
}
|
|
6069
6286
|
} else
|
|
6070
|
-
for (const
|
|
6287
|
+
for (const y of e.getChildElementFragments())
|
|
6071
6288
|
o.push(
|
|
6072
|
-
|
|
6073
|
-
|
|
6289
|
+
h.setPartValues(
|
|
6290
|
+
y,
|
|
6074
6291
|
t,
|
|
6075
6292
|
r,
|
|
6076
6293
|
i,
|
|
@@ -6098,14 +6315,14 @@ const p = class p {
|
|
|
6098
6315
|
* @returns すべての初期化処理が完了するPromise
|
|
6099
6316
|
*/
|
|
6100
6317
|
static async reset(e, t = T.nextSequence()) {
|
|
6101
|
-
const r =
|
|
6318
|
+
const r = h.collectBindingTargetForms(e);
|
|
6102
6319
|
if (r.length > 0 && r.every((n) => n.isSupplyStale(t)))
|
|
6103
6320
|
return;
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6321
|
+
h.markResetSubtree(e, t), B.clearUserEditMarks(e), h.clearValues(e), await Promise.all([
|
|
6322
|
+
h.clearMessages(e),
|
|
6323
|
+
h.clearEachClones(e)
|
|
6107
6324
|
]), await W.enqueue(() => {
|
|
6108
|
-
const n =
|
|
6325
|
+
const n = h.collectEditsAfter(
|
|
6109
6326
|
e,
|
|
6110
6327
|
t
|
|
6111
6328
|
), s = e.getTarget();
|
|
@@ -6119,36 +6336,36 @@ const p = class p {
|
|
|
6119
6336
|
l.appendChild(s), l.reset(), a.insertBefore(s, o);
|
|
6120
6337
|
}
|
|
6121
6338
|
}
|
|
6122
|
-
|
|
6339
|
+
h.clearDeclarativeStateFromDom(e), h.restoreEdits(n);
|
|
6123
6340
|
});
|
|
6124
6341
|
const i = r;
|
|
6125
6342
|
for (const n of i) {
|
|
6126
|
-
const s =
|
|
6127
|
-
s === null && n.getRawBindingData() === null || await
|
|
6343
|
+
const s = h.getInitialBindingData(n);
|
|
6344
|
+
s === null && n.getRawBindingData() === null || await B.setBindingData(n.getTarget(), s ?? {}, {
|
|
6128
6345
|
sequence: t
|
|
6129
6346
|
});
|
|
6130
6347
|
}
|
|
6131
|
-
|
|
6348
|
+
h.syncValuesFromDom(e), await B.evaluateAll(e);
|
|
6132
6349
|
for (const n of i)
|
|
6133
|
-
|
|
6350
|
+
h.getInitialBindingData(n) !== null || n.getRawBindingData() !== null || await h.restoreAncestorArgValues(n, {
|
|
6134
6351
|
sequence: t,
|
|
6135
6352
|
kind: "supply"
|
|
6136
6353
|
});
|
|
6137
6354
|
for (const n of i) {
|
|
6138
|
-
const s =
|
|
6355
|
+
const s = h.getInitialBindingData(n);
|
|
6139
6356
|
if (n.getRawBindingData() === null && s === null)
|
|
6140
6357
|
continue;
|
|
6141
|
-
const a =
|
|
6358
|
+
const a = h.getValues(n), o = n.getAttribute(`${u.prefix}form-arg`);
|
|
6142
6359
|
let l = { ...s || {} };
|
|
6143
6360
|
if (o) {
|
|
6144
6361
|
const c = String(o);
|
|
6145
|
-
!Object.prototype.hasOwnProperty.call(s ?? {}, c) &&
|
|
6362
|
+
!Object.prototype.hasOwnProperty.call(s ?? {}, c) && h.resolveAncestorArgOwner(n, c) !== null || (l[c] = h.mergeCollectedValues(
|
|
6146
6363
|
l[c] ?? null,
|
|
6147
6364
|
a
|
|
6148
6365
|
));
|
|
6149
6366
|
} else
|
|
6150
|
-
l =
|
|
6151
|
-
await
|
|
6367
|
+
l = h.mergeCollectedValues(l, a);
|
|
6368
|
+
await B.setBindingData(n.getTarget(), l, {
|
|
6152
6369
|
sequence: t
|
|
6153
6370
|
});
|
|
6154
6371
|
}
|
|
@@ -6161,7 +6378,7 @@ const p = class p {
|
|
|
6161
6378
|
*/
|
|
6162
6379
|
static getInitialBindingData(e) {
|
|
6163
6380
|
const t = e.getInitialBindAttribute();
|
|
6164
|
-
return t === null ? null :
|
|
6381
|
+
return t === null ? null : B.parseDataBind(t);
|
|
6165
6382
|
}
|
|
6166
6383
|
/**
|
|
6167
6384
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -6172,7 +6389,7 @@ const p = class p {
|
|
|
6172
6389
|
const t = e.getTarget();
|
|
6173
6390
|
(t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement || t instanceof HTMLSelectElement) && e.syncValue();
|
|
6174
6391
|
for (const r of e.getChildElementFragments())
|
|
6175
|
-
|
|
6392
|
+
h.syncValuesFromDom(r);
|
|
6176
6393
|
}
|
|
6177
6394
|
/**
|
|
6178
6395
|
* リセット後にバインドデータを更新すべきフォームフラグメントを収集します。
|
|
@@ -6227,7 +6444,7 @@ const p = class p {
|
|
|
6227
6444
|
static clearValues(e) {
|
|
6228
6445
|
e.clearValue();
|
|
6229
6446
|
for (const t of e.getChildElementFragments())
|
|
6230
|
-
|
|
6447
|
+
h.clearValues(t);
|
|
6231
6448
|
}
|
|
6232
6449
|
/**
|
|
6233
6450
|
* 指定した通番より後に編集された入力欄の DOM の状態を控えます。
|
|
@@ -6251,7 +6468,7 @@ const p = class p {
|
|
|
6251
6468
|
)
|
|
6252
6469
|
}) : r.push({ element: i, value: i.value }));
|
|
6253
6470
|
for (const n of e.getChildElementFragments())
|
|
6254
|
-
|
|
6471
|
+
h.collectEditsAfter(n, t, r);
|
|
6255
6472
|
return r;
|
|
6256
6473
|
}
|
|
6257
6474
|
/**
|
|
@@ -6293,8 +6510,8 @@ const p = class p {
|
|
|
6293
6510
|
const r = e.getAttribute(`${u.prefix}form-arg`);
|
|
6294
6511
|
if (!r)
|
|
6295
6512
|
return;
|
|
6296
|
-
const i = String(r), n =
|
|
6297
|
-
n && (
|
|
6513
|
+
const i = String(r), n = h.resolveAncestorArgOwner(e, i);
|
|
6514
|
+
n && (h.LAST_ANCESTOR_ARG_VALUES.delete(e.getTarget()), await h.pushAncestorArgValue(e, i, n.value, t));
|
|
6298
6515
|
}
|
|
6299
6516
|
/**
|
|
6300
6517
|
* 初期化の通番を部分木のすべてのフラグメントへ記録します。
|
|
@@ -6310,7 +6527,7 @@ const p = class p {
|
|
|
6310
6527
|
static markResetSubtree(e, t) {
|
|
6311
6528
|
e.markResetAt(t), e.markSupplyApplied(t);
|
|
6312
6529
|
for (const r of e.getChildElementFragments())
|
|
6313
|
-
|
|
6530
|
+
h.markResetSubtree(r, t);
|
|
6314
6531
|
}
|
|
6315
6532
|
/**
|
|
6316
6533
|
* フラグメントとその子要素のメッセージをクリアします。
|
|
@@ -6319,7 +6536,7 @@ const p = class p {
|
|
|
6319
6536
|
* @returns Promise(メッセージのクリアが完了したら解決される)
|
|
6320
6537
|
*/
|
|
6321
6538
|
static clearMessages(e) {
|
|
6322
|
-
return
|
|
6539
|
+
return Ge().clearMessages(
|
|
6323
6540
|
e.getTarget()
|
|
6324
6541
|
);
|
|
6325
6542
|
}
|
|
@@ -6333,7 +6550,7 @@ const p = class p {
|
|
|
6333
6550
|
* @return Promise(メッセージの追加が完了したら解決される)
|
|
6334
6551
|
*/
|
|
6335
6552
|
static addErrorMessage(e, t, r) {
|
|
6336
|
-
return
|
|
6553
|
+
return h.addMessage(e, t, r, "error");
|
|
6337
6554
|
}
|
|
6338
6555
|
/**
|
|
6339
6556
|
* キーに一致するフラグメントにレベル付きメッセージを追加します。
|
|
@@ -6346,7 +6563,7 @@ const p = class p {
|
|
|
6346
6563
|
* @return Promise(メッセージの追加が完了したら解決される)
|
|
6347
6564
|
*/
|
|
6348
6565
|
static addMessage(e, t, r, i) {
|
|
6349
|
-
const n = [], s =
|
|
6566
|
+
const n = [], s = Ge(), a = s.addMessage, o = (c) => typeof a == "function" ? a.call(s, c, r, i) : s.addErrorMessage(c, r), l = h.findFragmentsByKey(e, t);
|
|
6350
6567
|
return l.forEach((c) => {
|
|
6351
6568
|
n.push(o(c.getTarget()));
|
|
6352
6569
|
}), l.length === 0 && n.push(o(e.getTarget())), Promise.all(n).then(() => {
|
|
@@ -6360,7 +6577,7 @@ const p = class p {
|
|
|
6360
6577
|
* @returns 一致するフラグメントの配列
|
|
6361
6578
|
*/
|
|
6362
6579
|
static findFragmentsByKey(e, t) {
|
|
6363
|
-
return
|
|
6580
|
+
return h.findFragmentByKeyParts(e, t.split("."));
|
|
6364
6581
|
}
|
|
6365
6582
|
/**
|
|
6366
6583
|
* 指定されたキーに一致するフラグメントを検索します。
|
|
@@ -6372,9 +6589,9 @@ const p = class p {
|
|
|
6372
6589
|
*/
|
|
6373
6590
|
static findFragmentByKeyParts(e, t) {
|
|
6374
6591
|
const r = [], i = t[0];
|
|
6375
|
-
if (t.length == 1 &&
|
|
6592
|
+
if (t.length == 1 && h.resolveFieldName(e) === i && r.push(e), e.hasAttribute(`${u.prefix}form-object`))
|
|
6376
6593
|
t.length > 1 && e.getAttribute(`${u.prefix}form-object`) === i && e.getChildElementFragments().forEach((s) => {
|
|
6377
|
-
r.push(...
|
|
6594
|
+
r.push(...h.findFragmentByKeyParts(s, t.slice(1)));
|
|
6378
6595
|
});
|
|
6379
6596
|
else if (e.hasAttribute(`${u.prefix}form-list`)) {
|
|
6380
6597
|
if (t.length > 1) {
|
|
@@ -6386,9 +6603,9 @@ const p = class p {
|
|
|
6386
6603
|
if (isNaN(c))
|
|
6387
6604
|
m.error("Haori", `Invalid index: ${i}`);
|
|
6388
6605
|
else {
|
|
6389
|
-
const d = e.getChildElementFragments().filter((
|
|
6606
|
+
const d = e.getChildElementFragments().filter((p) => p.hasAttribute(`${u.prefix}row`));
|
|
6390
6607
|
c < d.length && r.push(
|
|
6391
|
-
...
|
|
6608
|
+
...h.findFragmentByKeyParts(d[c], t.slice(1))
|
|
6392
6609
|
);
|
|
6393
6610
|
}
|
|
6394
6611
|
}
|
|
@@ -6396,7 +6613,7 @@ const p = class p {
|
|
|
6396
6613
|
}
|
|
6397
6614
|
} else
|
|
6398
6615
|
e.getChildElementFragments().forEach((n) => {
|
|
6399
|
-
r.push(...
|
|
6616
|
+
r.push(...h.findFragmentByKeyParts(n, t));
|
|
6400
6617
|
});
|
|
6401
6618
|
return r;
|
|
6402
6619
|
}
|
|
@@ -6419,13 +6636,13 @@ const p = class p {
|
|
|
6419
6636
|
return r ? this.getFormFragment(r) : null;
|
|
6420
6637
|
}
|
|
6421
6638
|
};
|
|
6422
|
-
|
|
6639
|
+
h.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), h.LAST_ANCESTOR_ARG_VALUES = /* @__PURE__ */ new WeakMap(), h.GROUP_SCOPE_IDS = /* @__PURE__ */ new WeakMap(), h.groupScopeSequence = 0, h.UNSAFE_MERGE_KEYS = /* @__PURE__ */ new Set([
|
|
6423
6640
|
"__proto__",
|
|
6424
6641
|
"constructor",
|
|
6425
6642
|
"prototype"
|
|
6426
|
-
]),
|
|
6427
|
-
let F =
|
|
6428
|
-
class
|
|
6643
|
+
]), h.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), h.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), h.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), h.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), h.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
6644
|
+
let F = h;
|
|
6645
|
+
class O {
|
|
6429
6646
|
/**
|
|
6430
6647
|
* カスタムイベントを発火します。
|
|
6431
6648
|
*
|
|
@@ -6449,7 +6666,7 @@ class H {
|
|
|
6449
6666
|
* @param version ライブラリバージョン
|
|
6450
6667
|
*/
|
|
6451
6668
|
static ready(e) {
|
|
6452
|
-
|
|
6669
|
+
O.dispatch(document, "ready", { version: e });
|
|
6453
6670
|
}
|
|
6454
6671
|
/**
|
|
6455
6672
|
* importstartイベントを発火します。
|
|
@@ -6458,7 +6675,7 @@ class H {
|
|
|
6458
6675
|
* @param url インポート対象URL
|
|
6459
6676
|
*/
|
|
6460
6677
|
static importStart(e, t) {
|
|
6461
|
-
|
|
6678
|
+
O.dispatch(e, "importstart", {
|
|
6462
6679
|
url: t,
|
|
6463
6680
|
startedAt: performance.now()
|
|
6464
6681
|
});
|
|
@@ -6472,7 +6689,7 @@ class H {
|
|
|
6472
6689
|
* @param startedAt 開始時刻
|
|
6473
6690
|
*/
|
|
6474
6691
|
static importEnd(e, t, r, i) {
|
|
6475
|
-
|
|
6692
|
+
O.dispatch(e, "importend", {
|
|
6476
6693
|
url: t,
|
|
6477
6694
|
bytes: r,
|
|
6478
6695
|
durationMs: performance.now() - i
|
|
@@ -6486,7 +6703,7 @@ class H {
|
|
|
6486
6703
|
* @param error エラー内容
|
|
6487
6704
|
*/
|
|
6488
6705
|
static importError(e, t, r) {
|
|
6489
|
-
|
|
6706
|
+
O.dispatch(e, "importerror", { url: t, error: r });
|
|
6490
6707
|
}
|
|
6491
6708
|
/**
|
|
6492
6709
|
* bindchangeイベントを発火します。
|
|
@@ -6502,7 +6719,7 @@ class H {
|
|
|
6502
6719
|
const c = t?.[l], d = r[l];
|
|
6503
6720
|
c !== d && n.push(l);
|
|
6504
6721
|
}
|
|
6505
|
-
|
|
6722
|
+
O.dispatch(e, "bindchange", {
|
|
6506
6723
|
previous: t || {},
|
|
6507
6724
|
next: r,
|
|
6508
6725
|
changedKeys: n,
|
|
@@ -6521,7 +6738,7 @@ class H {
|
|
|
6521
6738
|
* @param reason 変更理由
|
|
6522
6739
|
*/
|
|
6523
6740
|
static bindComplete(e, t = null, r = "other") {
|
|
6524
|
-
|
|
6741
|
+
O.dispatch(e, "bindcomplete", { bindArg: t, reason: r });
|
|
6525
6742
|
}
|
|
6526
6743
|
/**
|
|
6527
6744
|
* eachupdateイベントを発火します。
|
|
@@ -6532,7 +6749,7 @@ class H {
|
|
|
6532
6749
|
* @param order 現在の順序
|
|
6533
6750
|
*/
|
|
6534
6751
|
static eachUpdate(e, t, r, i) {
|
|
6535
|
-
|
|
6752
|
+
O.dispatch(e, "eachupdate", {
|
|
6536
6753
|
added: t,
|
|
6537
6754
|
removed: r,
|
|
6538
6755
|
order: i,
|
|
@@ -6548,7 +6765,7 @@ class H {
|
|
|
6548
6765
|
* @param item 行データ
|
|
6549
6766
|
*/
|
|
6550
6767
|
static rowAdd(e, t, r, i) {
|
|
6551
|
-
|
|
6768
|
+
O.dispatch(e, "rowadd", { key: t, index: r, item: i });
|
|
6552
6769
|
}
|
|
6553
6770
|
/**
|
|
6554
6771
|
* rowremoveイベントを発火します。
|
|
@@ -6558,7 +6775,7 @@ class H {
|
|
|
6558
6775
|
* @param index インデックス
|
|
6559
6776
|
*/
|
|
6560
6777
|
static rowRemove(e, t, r) {
|
|
6561
|
-
|
|
6778
|
+
O.dispatch(e, "rowremove", { key: t, index: r });
|
|
6562
6779
|
}
|
|
6563
6780
|
/**
|
|
6564
6781
|
* rowmoveイベントを発火します。
|
|
@@ -6569,7 +6786,7 @@ class H {
|
|
|
6569
6786
|
* @param to 移動後インデックス
|
|
6570
6787
|
*/
|
|
6571
6788
|
static rowMove(e, t, r, i) {
|
|
6572
|
-
|
|
6789
|
+
O.dispatch(e, "rowmove", { key: t, from: r, to: i });
|
|
6573
6790
|
}
|
|
6574
6791
|
/**
|
|
6575
6792
|
* showイベントを発火します。
|
|
@@ -6577,7 +6794,7 @@ class H {
|
|
|
6577
6794
|
* @param target data-if要素
|
|
6578
6795
|
*/
|
|
6579
6796
|
static show(e) {
|
|
6580
|
-
|
|
6797
|
+
O.dispatch(e, "show", { visible: !0 });
|
|
6581
6798
|
}
|
|
6582
6799
|
/**
|
|
6583
6800
|
* hideイベントを発火します。
|
|
@@ -6585,7 +6802,7 @@ class H {
|
|
|
6585
6802
|
* @param target data-if要素
|
|
6586
6803
|
*/
|
|
6587
6804
|
static hide(e) {
|
|
6588
|
-
|
|
6805
|
+
O.dispatch(e, "hide", { visible: !1 });
|
|
6589
6806
|
}
|
|
6590
6807
|
/**
|
|
6591
6808
|
* fetchstartイベントを発火します。
|
|
@@ -6598,7 +6815,7 @@ class H {
|
|
|
6598
6815
|
* @return 戻り値はありません。
|
|
6599
6816
|
*/
|
|
6600
6817
|
static fetchStart(e, t, r, i, n) {
|
|
6601
|
-
|
|
6818
|
+
O.dispatch(e, "fetchstart", {
|
|
6602
6819
|
url: t,
|
|
6603
6820
|
options: r || {},
|
|
6604
6821
|
payload: i,
|
|
@@ -6615,7 +6832,7 @@ class H {
|
|
|
6615
6832
|
* @param startedAt 開始時刻
|
|
6616
6833
|
*/
|
|
6617
6834
|
static fetchEnd(e, t, r, i) {
|
|
6618
|
-
|
|
6835
|
+
O.dispatch(e, "fetchend", {
|
|
6619
6836
|
url: t,
|
|
6620
6837
|
status: r,
|
|
6621
6838
|
durationMs: performance.now() - i
|
|
@@ -6631,7 +6848,7 @@ class H {
|
|
|
6631
6848
|
* @param startedAt 開始時刻(存在する場合)
|
|
6632
6849
|
*/
|
|
6633
6850
|
static fetchError(e, t, r, i, n) {
|
|
6634
|
-
|
|
6851
|
+
O.dispatch(e, "fetcherror", {
|
|
6635
6852
|
url: t,
|
|
6636
6853
|
status: i,
|
|
6637
6854
|
error: r,
|
|
@@ -6647,7 +6864,7 @@ class H {
|
|
|
6647
6864
|
* @return 戻り値はありません。
|
|
6648
6865
|
*/
|
|
6649
6866
|
static pollTimeout(e, t, r) {
|
|
6650
|
-
|
|
6867
|
+
O.dispatch(e, "polltimeout", { count: t, elapsedMs: r });
|
|
6651
6868
|
}
|
|
6652
6869
|
/**
|
|
6653
6870
|
* pollstopイベントを発火します。
|
|
@@ -6661,7 +6878,7 @@ class H {
|
|
|
6661
6878
|
* @return 戻り値はありません。
|
|
6662
6879
|
*/
|
|
6663
6880
|
static pollStop(e, t, r, i) {
|
|
6664
|
-
|
|
6881
|
+
O.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
6665
6882
|
}
|
|
6666
6883
|
}
|
|
6667
6884
|
const Rt = {
|
|
@@ -6720,7 +6937,7 @@ function ct(g) {
|
|
|
6720
6937
|
}
|
|
6721
6938
|
return !1;
|
|
6722
6939
|
}
|
|
6723
|
-
class
|
|
6940
|
+
class G {
|
|
6724
6941
|
/**
|
|
6725
6942
|
* セレクタ属性の値を評価済みの文字列として読み取ります。
|
|
6726
6943
|
*
|
|
@@ -6892,12 +7109,12 @@ const I = class I {
|
|
|
6892
7109
|
const a = e.getRawAttribute(`${u.prefix}store-arg`), o = a === null || a.trim() === "" ? null : a.trim(), l = e.getRawAttribute(`${u.prefix}store-params`);
|
|
6893
7110
|
let c = null;
|
|
6894
7111
|
if (l !== null) {
|
|
6895
|
-
const d = l.split("&").map((y) => y.trim()).filter((y) => y !== ""),
|
|
6896
|
-
|
|
7112
|
+
const d = l.split("&").map((y) => y.trim()).filter((y) => y !== ""), p = d.filter((y) => !I.isReservedKey(y));
|
|
7113
|
+
p.length !== d.length && I.warnOnce(
|
|
6897
7114
|
t,
|
|
6898
7115
|
"reserved",
|
|
6899
7116
|
`${u.prefix}store-params の予約キー(先頭が _ のキー)は対象外です。`
|
|
6900
|
-
), c =
|
|
7117
|
+
), c = p.length > 0 ? p : null;
|
|
6901
7118
|
}
|
|
6902
7119
|
return c === null && o === null ? (I.warnOnce(
|
|
6903
7120
|
t,
|
|
@@ -7105,7 +7322,7 @@ const I = class I {
|
|
|
7105
7322
|
), Promise.resolve();
|
|
7106
7323
|
I.RESTORED_ELEMENTS.add(r);
|
|
7107
7324
|
const i = I.readRecord(t), n = i ? I.extractFromRecord(t, i) : {}, s = { ...e.getRawBindingData() ?? {}, ...n };
|
|
7108
|
-
return I.seedSignature(r, I.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() :
|
|
7325
|
+
return I.seedSignature(r, I.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() : B.setBindingData(r, s, {
|
|
7109
7326
|
reentrant: !0,
|
|
7110
7327
|
kind: "nonSupply",
|
|
7111
7328
|
sequence: T.nextSequence()
|
|
@@ -7247,7 +7464,7 @@ const Nt = [
|
|
|
7247
7464
|
"dialog",
|
|
7248
7465
|
"openDialog",
|
|
7249
7466
|
"toast"
|
|
7250
|
-
], Ft = "__haoriHistoryState__",
|
|
7467
|
+
], Ft = "__haoriHistoryState__", xe = "data-haori-click-lock";
|
|
7251
7468
|
function Ae() {
|
|
7252
7469
|
const e = globalThis.window?.Haori;
|
|
7253
7470
|
return Nt.every(
|
|
@@ -7258,7 +7475,7 @@ const kt = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
|
7258
7475
|
function Pe(g) {
|
|
7259
7476
|
return kt.has(g.toUpperCase());
|
|
7260
7477
|
}
|
|
7261
|
-
function
|
|
7478
|
+
function Mt(g, e) {
|
|
7262
7479
|
for (const [t, r] of Object.entries(e))
|
|
7263
7480
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
7264
7481
|
g.append(t, le(i));
|
|
@@ -7277,9 +7494,9 @@ function le(g) {
|
|
|
7277
7494
|
}
|
|
7278
7495
|
function ft(g, e) {
|
|
7279
7496
|
const t = new URL(g, window.location.href), r = new URLSearchParams(t.search);
|
|
7280
|
-
return
|
|
7497
|
+
return Mt(r, e), t.search = r.toString(), t.toString();
|
|
7281
7498
|
}
|
|
7282
|
-
function
|
|
7499
|
+
function xt(g) {
|
|
7283
7500
|
if (g == null)
|
|
7284
7501
|
return { payload: {}, dropped: !1 };
|
|
7285
7502
|
if (typeof g == "string") {
|
|
@@ -7296,12 +7513,12 @@ function Mt(g) {
|
|
|
7296
7513
|
return { payload: {}, dropped: !0 };
|
|
7297
7514
|
}
|
|
7298
7515
|
return e.includes("=") ? {
|
|
7299
|
-
payload:
|
|
7516
|
+
payload: ze(new URLSearchParams(e)),
|
|
7300
7517
|
dropped: !1
|
|
7301
7518
|
} : { payload: {}, dropped: !0 };
|
|
7302
7519
|
}
|
|
7303
7520
|
if (g instanceof URLSearchParams)
|
|
7304
|
-
return { payload:
|
|
7521
|
+
return { payload: ze(g), dropped: !1 };
|
|
7305
7522
|
if (typeof FormData < "u" && g instanceof FormData) {
|
|
7306
7523
|
const e = {};
|
|
7307
7524
|
let t = !1;
|
|
@@ -7316,7 +7533,7 @@ function Mt(g) {
|
|
|
7316
7533
|
}
|
|
7317
7534
|
return { payload: {}, dropped: !0 };
|
|
7318
7535
|
}
|
|
7319
|
-
function
|
|
7536
|
+
function ze(g) {
|
|
7320
7537
|
const e = {};
|
|
7321
7538
|
for (const [t, r] of g.entries())
|
|
7322
7539
|
ht(e, t, r);
|
|
@@ -7327,6 +7544,8 @@ function ht(g, e, t) {
|
|
|
7327
7544
|
r === void 0 ? g[e] = t : Array.isArray(r) ? r.push(t) : g[e] = [r, t];
|
|
7328
7545
|
}
|
|
7329
7546
|
function ne(g, e) {
|
|
7547
|
+
if (F.isCompleteSetValue(e))
|
|
7548
|
+
return e;
|
|
7330
7549
|
if (Array.isArray(e)) {
|
|
7331
7550
|
const t = Array.isArray(g) ? g.slice() : [];
|
|
7332
7551
|
let r = !1;
|
|
@@ -7358,7 +7577,7 @@ function Pt(g, e) {
|
|
|
7358
7577
|
effectiveMethod: r,
|
|
7359
7578
|
normalized: !1
|
|
7360
7579
|
};
|
|
7361
|
-
const { payload: i, dropped: n } =
|
|
7580
|
+
const { payload: i, dropped: n } = xt(
|
|
7362
7581
|
t.body
|
|
7363
7582
|
);
|
|
7364
7583
|
let s = g;
|
|
@@ -7608,7 +7827,7 @@ const b = class b {
|
|
|
7608
7827
|
const a = r.trim();
|
|
7609
7828
|
if (b.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
7610
7829
|
return {
|
|
7611
|
-
value:
|
|
7830
|
+
value: B.parseDataBind(n),
|
|
7612
7831
|
hasUnresolvedReference: s
|
|
7613
7832
|
};
|
|
7614
7833
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
@@ -7617,7 +7836,7 @@ const b = class b {
|
|
|
7617
7836
|
e.getBindingData()
|
|
7618
7837
|
);
|
|
7619
7838
|
return {
|
|
7620
|
-
value:
|
|
7839
|
+
value: B.parseDataBind(l.value),
|
|
7621
7840
|
hasUnresolvedReference: s || l.hasUnresolvedReference
|
|
7622
7841
|
};
|
|
7623
7842
|
}
|
|
@@ -7626,7 +7845,7 @@ const b = class b {
|
|
|
7626
7845
|
e.getBindingData()
|
|
7627
7846
|
);
|
|
7628
7847
|
return {
|
|
7629
|
-
value:
|
|
7848
|
+
value: B.parseDataBind(o.value),
|
|
7630
7849
|
hasUnresolvedReference: s || o.hasUnresolvedReference
|
|
7631
7850
|
};
|
|
7632
7851
|
}
|
|
@@ -7651,12 +7870,12 @@ const b = class b {
|
|
|
7651
7870
|
if (t) {
|
|
7652
7871
|
if (e.hasAttribute(b.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(b.attrName(t, "confirm")) && (r.confirmMessage = e.getAttribute(b.attrName(t, "confirm")).replace(/\\n/g, `
|
|
7653
7872
|
`)), e.hasAttribute(b.attrName(t, "data")) && (r.dataAttrName = b.attrName(t, "data")), e.hasAttribute(b.attrName(t, "form"))) {
|
|
7654
|
-
const v =
|
|
7873
|
+
const v = G.read(
|
|
7655
7874
|
e,
|
|
7656
7875
|
b.attrName(t, "form")
|
|
7657
7876
|
);
|
|
7658
7877
|
if (v) {
|
|
7659
|
-
const R =
|
|
7878
|
+
const R = G.query(
|
|
7660
7879
|
v,
|
|
7661
7880
|
b.attrName(t, "form")
|
|
7662
7881
|
);
|
|
@@ -7702,8 +7921,8 @@ ${v}
|
|
|
7702
7921
|
R = new Function("event", `"use strict";
|
|
7703
7922
|
${v}
|
|
7704
7923
|
`);
|
|
7705
|
-
} catch (
|
|
7706
|
-
m.error("Haori", `Invalid run script: ${
|
|
7924
|
+
} catch (C) {
|
|
7925
|
+
m.error("Haori", `Invalid run script: ${C}`);
|
|
7707
7926
|
}
|
|
7708
7927
|
}
|
|
7709
7928
|
R && (r.runScript = R);
|
|
@@ -7737,7 +7956,7 @@ ${v}
|
|
|
7737
7956
|
E
|
|
7738
7957
|
);
|
|
7739
7958
|
try {
|
|
7740
|
-
a.headers =
|
|
7959
|
+
a.headers = B.parseDataBind(v);
|
|
7741
7960
|
} catch (R) {
|
|
7742
7961
|
m.error("Haori", `Invalid fetch headers: ${R}`);
|
|
7743
7962
|
}
|
|
@@ -7753,7 +7972,7 @@ ${v}
|
|
|
7753
7972
|
E
|
|
7754
7973
|
);
|
|
7755
7974
|
try {
|
|
7756
|
-
a.headers =
|
|
7975
|
+
a.headers = B.parseDataBind(v);
|
|
7757
7976
|
} catch (R) {
|
|
7758
7977
|
m.error("Haori", `Invalid fetch headers: ${R}`);
|
|
7759
7978
|
}
|
|
@@ -7803,12 +8022,12 @@ ${v}
|
|
|
7803
8022
|
Object.keys(a).length > 0 && (r.fetchOptions = a);
|
|
7804
8023
|
const o = t ? b.attrName(t, "bind") : b.attrName(null, "bind", !0);
|
|
7805
8024
|
if (e.hasAttribute(o)) {
|
|
7806
|
-
const E =
|
|
8025
|
+
const E = G.read(e, o);
|
|
7807
8026
|
if (E) {
|
|
7808
|
-
const v =
|
|
8027
|
+
const v = G.queryAll(E, o);
|
|
7809
8028
|
v.length > 0 ? (r.bindFragments = [], v.forEach((R) => {
|
|
7810
|
-
const
|
|
7811
|
-
|
|
8029
|
+
const C = N.get(R);
|
|
8030
|
+
C && r.bindFragments.push(C);
|
|
7812
8031
|
})) : m.error(
|
|
7813
8032
|
"Haori",
|
|
7814
8033
|
`Bind element not found: ${E} (${o})`
|
|
@@ -7819,9 +8038,9 @@ ${v}
|
|
|
7819
8038
|
t ? e.hasAttribute(l) && (r.bindArg = e.getRawAttribute(l)) : e.hasAttribute(c) ? r.bindArg = e.getRawAttribute(
|
|
7820
8039
|
c
|
|
7821
8040
|
) : e.hasAttribute(d) && (r.bindArg = e.getRawAttribute(d));
|
|
7822
|
-
const
|
|
7823
|
-
if (e.hasAttribute(
|
|
7824
|
-
const E = e.getRawAttribute(
|
|
8041
|
+
const p = t ? b.attrName(t, "bind-params") : b.attrName(null, "bind-params", !0);
|
|
8042
|
+
if (e.hasAttribute(p)) {
|
|
8043
|
+
const E = e.getRawAttribute(p);
|
|
7825
8044
|
r.bindParams = E.split("&").map((v) => v.trim());
|
|
7826
8045
|
}
|
|
7827
8046
|
const y = t ? b.attrName(t, "bind-append") : b.attrName(null, "bind-append", !0);
|
|
@@ -7833,24 +8052,24 @@ ${v}
|
|
|
7833
8052
|
e.hasAttribute(A) && (r.bindMerge = !0);
|
|
7834
8053
|
const S = t ? b.attrName(t, "bind-transform") : b.attrName(null, "bind-transform", !0);
|
|
7835
8054
|
e.hasAttribute(S) && (r.bindTransform = e.getRawAttribute(S));
|
|
7836
|
-
const
|
|
7837
|
-
if (
|
|
7838
|
-
const E = e.getRawAttribute(
|
|
8055
|
+
const D = t ? b.attrName(t, "copy-params") : null;
|
|
8056
|
+
if (D && e.hasAttribute(D)) {
|
|
8057
|
+
const E = e.getRawAttribute(D);
|
|
7839
8058
|
r.copyParams = E.split("&").map((v) => v.trim()).filter(Boolean);
|
|
7840
8059
|
}
|
|
7841
8060
|
if (t) {
|
|
7842
8061
|
if (e.hasAttribute(b.attrName(t, "adjust"))) {
|
|
7843
|
-
const R =
|
|
8062
|
+
const R = G.read(
|
|
7844
8063
|
e,
|
|
7845
8064
|
b.attrName(t, "adjust")
|
|
7846
8065
|
);
|
|
7847
8066
|
if (R) {
|
|
7848
|
-
const
|
|
8067
|
+
const C = G.queryAll(
|
|
7849
8068
|
R,
|
|
7850
8069
|
b.attrName(t, "adjust")
|
|
7851
8070
|
);
|
|
7852
|
-
|
|
7853
|
-
const V = N.get(
|
|
8071
|
+
C.length > 0 ? (r.adjustFragments = [], C.forEach((x) => {
|
|
8072
|
+
const V = N.get(x);
|
|
7854
8073
|
V && r.adjustFragments.push(V);
|
|
7855
8074
|
})) : m.error(
|
|
7856
8075
|
"Haori",
|
|
@@ -7858,10 +8077,10 @@ ${v}
|
|
|
7858
8077
|
);
|
|
7859
8078
|
}
|
|
7860
8079
|
if (e.hasAttribute(b.attrName(t, "adjust-value"))) {
|
|
7861
|
-
const
|
|
8080
|
+
const C = e.getRawAttribute(
|
|
7862
8081
|
b.attrName(t, "adjust-value")
|
|
7863
|
-
),
|
|
7864
|
-
isNaN(
|
|
8082
|
+
), x = Number(C);
|
|
8083
|
+
isNaN(x) || (r.adjustValue = x);
|
|
7865
8084
|
}
|
|
7866
8085
|
}
|
|
7867
8086
|
if (e.hasAttribute(b.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(b.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(b.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(b.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${u.prefix}${t}-after-run`)) {
|
|
@@ -7876,8 +8095,8 @@ ${v}
|
|
|
7876
8095
|
${R}
|
|
7877
8096
|
`
|
|
7878
8097
|
);
|
|
7879
|
-
} catch (
|
|
7880
|
-
m.error("Haori", `Invalid after script: ${
|
|
8098
|
+
} catch (C) {
|
|
8099
|
+
m.error("Haori", `Invalid after script: ${C}`);
|
|
7881
8100
|
}
|
|
7882
8101
|
}
|
|
7883
8102
|
if (e.hasAttribute(b.attrName(t, "dialog")) && (r.dialogMessage = b.unescapeNewlines(
|
|
@@ -7896,8 +8115,8 @@ ${R}
|
|
|
7896
8115
|
);
|
|
7897
8116
|
const R = e.getRawAttribute(
|
|
7898
8117
|
b.attrName(t, "toast-level")
|
|
7899
|
-
),
|
|
7900
|
-
r.toastLevel =
|
|
8118
|
+
), x = ["info", "warning", "error", "success"].includes(R);
|
|
8119
|
+
r.toastLevel = x ? R : null;
|
|
7901
8120
|
}
|
|
7902
8121
|
if (e.hasAttribute(b.attrName(t, "redirect"))) {
|
|
7903
8122
|
r.redirectUrl = b.readLateAttribute(
|
|
@@ -7928,17 +8147,17 @@ ${R}
|
|
|
7928
8147
|
"history",
|
|
7929
8148
|
b.attrName(t, "history")
|
|
7930
8149
|
)), e.hasAttribute(b.attrName(t, "history-data")) && (r.historyDataAttrName = b.attrName(t, "history-data")), e.hasAttribute(b.attrName(t, "history-form"))) {
|
|
7931
|
-
const R =
|
|
8150
|
+
const R = G.read(
|
|
7932
8151
|
e,
|
|
7933
8152
|
b.attrName(t, "history-form")
|
|
7934
8153
|
);
|
|
7935
8154
|
if (R) {
|
|
7936
|
-
const
|
|
8155
|
+
const C = G.query(
|
|
7937
8156
|
R,
|
|
7938
8157
|
b.attrName(t, "history-form")
|
|
7939
8158
|
);
|
|
7940
|
-
|
|
7941
|
-
N.get(
|
|
8159
|
+
C !== null ? r.historyFormFragment = F.getFormFragment(
|
|
8160
|
+
N.get(C)
|
|
7942
8161
|
) : m.error(
|
|
7943
8162
|
"Haori",
|
|
7944
8163
|
`Form element not found: ${R} (${b.attrName(t, "history-form")})`
|
|
@@ -7955,18 +8174,18 @@ ${R}
|
|
|
7955
8174
|
"open",
|
|
7956
8175
|
"close"
|
|
7957
8176
|
].forEach((R) => {
|
|
7958
|
-
const
|
|
7959
|
-
if (!e.hasAttribute(
|
|
8177
|
+
const C = b.attrName(t, R);
|
|
8178
|
+
if (!e.hasAttribute(C))
|
|
7960
8179
|
return;
|
|
7961
|
-
const
|
|
7962
|
-
if (
|
|
7963
|
-
|
|
8180
|
+
const x = G.read(e, C), V = [];
|
|
8181
|
+
if (x)
|
|
8182
|
+
G.queryAll(x, C).forEach((_) => {
|
|
7964
8183
|
const Z = N.get(_);
|
|
7965
8184
|
Z && V.push(Z);
|
|
7966
|
-
}), V.length === 0 && m.error("Haori", `Element not found: ${
|
|
8185
|
+
}), V.length === 0 && m.error("Haori", `Element not found: ${x} (${C})`);
|
|
7967
8186
|
else if (R === "open" || R === "close") {
|
|
7968
|
-
const
|
|
7969
|
-
|
|
8187
|
+
const z = e.getTarget().closest("dialog");
|
|
8188
|
+
z ? V.push(N.get(z)) : m.error("Haori", `Ancestor <dialog> not found (${C})`);
|
|
7970
8189
|
} else
|
|
7971
8190
|
V.push(e);
|
|
7972
8191
|
if (V.length > 0)
|
|
@@ -7996,12 +8215,12 @@ ${R}
|
|
|
7996
8215
|
});
|
|
7997
8216
|
const v = b.attrName(t, "copy-source");
|
|
7998
8217
|
if (e.hasAttribute(v)) {
|
|
7999
|
-
const R =
|
|
8218
|
+
const R = G.read(e, v);
|
|
8000
8219
|
if (R) {
|
|
8001
|
-
const
|
|
8002
|
-
if (
|
|
8003
|
-
const
|
|
8004
|
-
|
|
8220
|
+
const C = G.query(R, v);
|
|
8221
|
+
if (C !== null) {
|
|
8222
|
+
const x = N.get(C);
|
|
8223
|
+
x ? r.copySourceFragment = x : m.error(
|
|
8005
8224
|
"Haori",
|
|
8006
8225
|
`Element is not managed by Haori: ${R} (${v})`
|
|
8007
8226
|
);
|
|
@@ -8015,12 +8234,12 @@ ${R}
|
|
|
8015
8234
|
}
|
|
8016
8235
|
}
|
|
8017
8236
|
if (!t && (e.hasAttribute(b.attrName(null, "data", !0)) && (r.dataAttrName = b.attrName(null, "data", !0)), e.hasAttribute(b.attrName(null, "form", !0)))) {
|
|
8018
|
-
const E =
|
|
8237
|
+
const E = G.read(
|
|
8019
8238
|
e,
|
|
8020
8239
|
b.attrName(null, "form", !0)
|
|
8021
8240
|
);
|
|
8022
8241
|
if (E) {
|
|
8023
|
-
const v =
|
|
8242
|
+
const v = G.query(
|
|
8024
8243
|
E,
|
|
8025
8244
|
b.attrName(null, "form", !0)
|
|
8026
8245
|
);
|
|
@@ -8033,33 +8252,33 @@ ${R}
|
|
|
8033
8252
|
} else
|
|
8034
8253
|
r.formFragment = F.getFormFragment(e);
|
|
8035
8254
|
}
|
|
8036
|
-
const
|
|
8037
|
-
if (e.hasAttribute(
|
|
8038
|
-
const E =
|
|
8039
|
-
E ? (
|
|
8040
|
-
const
|
|
8041
|
-
|
|
8255
|
+
const P = t ? b.attrName(t, "fetch-state") : b.attrName(null, "state", !0);
|
|
8256
|
+
if (e.hasAttribute(P)) {
|
|
8257
|
+
const E = G.read(e, P), v = [];
|
|
8258
|
+
E ? (G.queryAll(E, P).forEach((C) => {
|
|
8259
|
+
const x = N.get(C);
|
|
8260
|
+
x && v.push(x);
|
|
8042
8261
|
}), v.length === 0 && m.error(
|
|
8043
8262
|
"Haori",
|
|
8044
|
-
`Element not found: ${E} (${
|
|
8263
|
+
`Element not found: ${E} (${P})`
|
|
8045
8264
|
)) : v.push(e), v.length > 0 && (r.fetchStateFragments = v);
|
|
8046
8265
|
}
|
|
8047
|
-
const
|
|
8048
|
-
if (e.hasAttribute(
|
|
8049
|
-
const E = e.getRawAttribute(
|
|
8266
|
+
const H = t ? b.attrName(t, "store-clear") : b.attrName(null, "store-clear", !0);
|
|
8267
|
+
if (e.hasAttribute(H)) {
|
|
8268
|
+
const E = e.getRawAttribute(H), v = E === null ? "" : E.trim();
|
|
8050
8269
|
if (v === "")
|
|
8051
8270
|
m.error(
|
|
8052
8271
|
"Haori",
|
|
8053
|
-
`ストレージキーが指定されていません (${
|
|
8272
|
+
`ストレージキーが指定されていません (${H})`
|
|
8054
8273
|
);
|
|
8055
8274
|
else {
|
|
8056
8275
|
r.storeClearKey = v;
|
|
8057
8276
|
const R = e.getRawAttribute(
|
|
8058
|
-
`${
|
|
8059
|
-
),
|
|
8060
|
-
|
|
8277
|
+
`${H}-type`
|
|
8278
|
+
), C = R === null ? "session" : R.trim();
|
|
8279
|
+
C === "local" || C === "session" ? r.storeClearKind = C : (m.warn(
|
|
8061
8280
|
"Haori",
|
|
8062
|
-
`${
|
|
8281
|
+
`${H}-type は session または local を指定してください(session として扱います): ${C}`
|
|
8063
8282
|
), r.storeClearKind = "session");
|
|
8064
8283
|
}
|
|
8065
8284
|
}
|
|
@@ -8165,10 +8384,10 @@ ${R}
|
|
|
8165
8384
|
), !this.evaluateExecutionCondition()))
|
|
8166
8385
|
return !1;
|
|
8167
8386
|
if (this.options.runScript) {
|
|
8168
|
-
const
|
|
8387
|
+
const p = this.options.targetFragment?.getTarget() ?? null;
|
|
8169
8388
|
try {
|
|
8170
8389
|
const y = this.options.runScript.call(
|
|
8171
|
-
|
|
8390
|
+
p,
|
|
8172
8391
|
this.domEvent
|
|
8173
8392
|
);
|
|
8174
8393
|
y === !1 && this.domEvent && this.domEvent.preventDefault(), y != null && typeof y.then == "function" && await y;
|
|
@@ -8180,7 +8399,7 @@ ${R}
|
|
|
8180
8399
|
return !1;
|
|
8181
8400
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
8182
8401
|
this.options.resetBeforeFragments.map(
|
|
8183
|
-
(
|
|
8402
|
+
(p) => F.reset(p, this.operationSequence)
|
|
8184
8403
|
)
|
|
8185
8404
|
), this.captureHistorySnapshots());
|
|
8186
8405
|
const r = this.prepareFetchRequest();
|
|
@@ -8188,86 +8407,86 @@ ${R}
|
|
|
8188
8407
|
const i = r.payload;
|
|
8189
8408
|
let n = r.url, s = r.options, a = !1, o = !1;
|
|
8190
8409
|
if (this.options.beforeCallback) {
|
|
8191
|
-
const
|
|
8410
|
+
const p = this.options.beforeCallback(
|
|
8192
8411
|
n || null,
|
|
8193
8412
|
s || null
|
|
8194
8413
|
);
|
|
8195
|
-
if (
|
|
8196
|
-
if (
|
|
8414
|
+
if (p != null) {
|
|
8415
|
+
if (p === !1 || typeof p == "object" && p.stop)
|
|
8197
8416
|
return !1;
|
|
8198
|
-
typeof
|
|
8417
|
+
typeof p == "object" && (a = "fetchUrl" in p, o = "fetchOptions" in p, n = a ? p.fetchUrl : n, s = o ? p.fetchOptions : s);
|
|
8199
8418
|
}
|
|
8200
8419
|
}
|
|
8201
8420
|
const l = Object.keys(i).length > 0;
|
|
8202
8421
|
if (n) {
|
|
8203
|
-
const
|
|
8422
|
+
const p = (s?.method || "GET").toUpperCase(), A = !a && o && r.transportMode === "query-get" && Ct(s) && !Pe(p) ? r.baseUrl ?? n : n, S = Pt(
|
|
8204
8423
|
A,
|
|
8205
8424
|
s
|
|
8206
8425
|
);
|
|
8207
8426
|
n = S.url;
|
|
8208
|
-
const
|
|
8427
|
+
const D = { ...S.options }, P = S.normalized ? S.requestedMethod : r.requestedMethod, H = S.effectiveMethod, E = r.transportMode === "query-get" || S.normalized, v = S.queryString ?? r.queryString;
|
|
8209
8428
|
if (E && m.info("Haori demo fetch normalization", {
|
|
8210
8429
|
runtime: u.runtime,
|
|
8211
|
-
requestedMethod:
|
|
8212
|
-
effectiveMethod:
|
|
8430
|
+
requestedMethod: P,
|
|
8431
|
+
effectiveMethod: H,
|
|
8213
8432
|
transportMode: "query-get",
|
|
8214
8433
|
url: n,
|
|
8215
8434
|
payload: l ? i : void 0,
|
|
8216
8435
|
queryString: v
|
|
8217
8436
|
}), this.options.targetFragment && n) {
|
|
8218
|
-
const R = performance.now(),
|
|
8437
|
+
const R = performance.now(), C = {
|
|
8219
8438
|
runtime: u.runtime,
|
|
8220
|
-
requestedMethod:
|
|
8221
|
-
effectiveMethod:
|
|
8439
|
+
requestedMethod: P,
|
|
8440
|
+
effectiveMethod: H,
|
|
8222
8441
|
transportMode: E ? "query-get" : "http",
|
|
8223
8442
|
...E ? { queryString: v } : {}
|
|
8224
8443
|
};
|
|
8225
|
-
return
|
|
8444
|
+
return O.fetchStart(
|
|
8226
8445
|
this.options.targetFragment.getTarget(),
|
|
8227
8446
|
n,
|
|
8228
|
-
|
|
8447
|
+
D,
|
|
8229
8448
|
l ? i : void 0,
|
|
8230
|
-
|
|
8231
|
-
), await this.injectFetchState("loading"), fetch(n,
|
|
8232
|
-
|
|
8449
|
+
C
|
|
8450
|
+
), await this.injectFetchState("loading"), await fetch(n, D).then((x) => this.handleFetchResult(
|
|
8451
|
+
x,
|
|
8233
8452
|
n || void 0,
|
|
8234
8453
|
R
|
|
8235
|
-
)).catch(async (
|
|
8236
|
-
throw n &&
|
|
8454
|
+
)).catch(async (x) => {
|
|
8455
|
+
throw n && O.fetchError(
|
|
8237
8456
|
this.options.targetFragment.getTarget(),
|
|
8238
8457
|
n,
|
|
8239
|
-
|
|
8458
|
+
x
|
|
8240
8459
|
), await this.injectFetchState(
|
|
8241
8460
|
"error",
|
|
8242
8461
|
null,
|
|
8243
|
-
|
|
8244
|
-
),
|
|
8462
|
+
x instanceof Error ? x.message : String(x)
|
|
8463
|
+
), x;
|
|
8245
8464
|
});
|
|
8246
8465
|
}
|
|
8247
|
-
return fetch(n,
|
|
8466
|
+
return await fetch(n, D).then((R) => this.handleFetchResult(R, n || void 0));
|
|
8248
8467
|
}
|
|
8249
8468
|
if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && l) {
|
|
8250
|
-
const
|
|
8469
|
+
const p = this.options.formFragment, y = p.getTarget(), A = /* @__PURE__ */ new Set();
|
|
8251
8470
|
e && e.appliedDisabledAttribute && this.options.targetFragment && A.add(this.options.targetFragment);
|
|
8252
|
-
const S =
|
|
8253
|
-
let
|
|
8254
|
-
if (
|
|
8255
|
-
|
|
8256
|
-
const E = String(
|
|
8257
|
-
|
|
8258
|
-
(v ? v.value :
|
|
8259
|
-
|
|
8471
|
+
const S = p.getRawBindingData(), D = $e(i), P = p.getAttribute(`${u.prefix}form-arg`);
|
|
8472
|
+
let H;
|
|
8473
|
+
if (P) {
|
|
8474
|
+
H = { ...S ?? {} };
|
|
8475
|
+
const E = String(P), v = F.resolveAncestorArgOwner(p, E);
|
|
8476
|
+
H[E] = F.mergeCollectedValues(
|
|
8477
|
+
(v ? v.value : H[E]) ?? null,
|
|
8478
|
+
D
|
|
8260
8479
|
);
|
|
8261
8480
|
} else
|
|
8262
|
-
|
|
8263
|
-
await
|
|
8481
|
+
H = F.mergeCollectedValues(S, D);
|
|
8482
|
+
await B.setBindingData(y, H, {
|
|
8264
8483
|
skipFragments: A,
|
|
8265
8484
|
kind: "nonSupply",
|
|
8266
8485
|
sequence: this.operationSequence,
|
|
8267
8486
|
editedPaths: F.collectEditedPaths(
|
|
8268
|
-
|
|
8269
|
-
|
|
8270
|
-
|
|
8487
|
+
p,
|
|
8488
|
+
P ? String(P) : "",
|
|
8489
|
+
D
|
|
8271
8490
|
)
|
|
8272
8491
|
});
|
|
8273
8492
|
}
|
|
@@ -8275,7 +8494,7 @@ ${R}
|
|
|
8275
8494
|
const c = l ? $e(i) : {}, d = new Response(JSON.stringify(c), {
|
|
8276
8495
|
headers: { "Content-Type": "application/json" }
|
|
8277
8496
|
});
|
|
8278
|
-
return this.handleFetchResult(d);
|
|
8497
|
+
return await this.handleFetchResult(d);
|
|
8279
8498
|
} finally {
|
|
8280
8499
|
this.releaseExecutionLock(e);
|
|
8281
8500
|
}
|
|
@@ -8289,10 +8508,10 @@ ${R}
|
|
|
8289
8508
|
if (this.eventType !== "click" || !this.options.targetFragment)
|
|
8290
8509
|
return null;
|
|
8291
8510
|
const t = this.options.targetFragment.getTarget();
|
|
8292
|
-
if (b.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(
|
|
8511
|
+
if (b.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(xe))
|
|
8293
8512
|
return !1;
|
|
8294
8513
|
const r = t.hasAttribute(`${u.prefix}click-no-disabled`);
|
|
8295
|
-
return b.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(
|
|
8514
|
+
return b.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(xe, ""), r || t.setAttribute("disabled", ""), {
|
|
8296
8515
|
target: t,
|
|
8297
8516
|
appliedDisabledAttribute: !r
|
|
8298
8517
|
};
|
|
@@ -8304,7 +8523,7 @@ ${R}
|
|
|
8304
8523
|
* @returns 戻り値はありません。
|
|
8305
8524
|
*/
|
|
8306
8525
|
releaseExecutionLock(e) {
|
|
8307
|
-
e && (b.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(
|
|
8526
|
+
e && (b.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(xe), e.appliedDisabledAttribute && e.target.removeAttribute("disabled"));
|
|
8308
8527
|
}
|
|
8309
8528
|
/**
|
|
8310
8529
|
* フェッチ後の処理を実行します。
|
|
@@ -8312,7 +8531,7 @@ ${R}
|
|
|
8312
8531
|
async handleFetchResult(e, t, r) {
|
|
8313
8532
|
const i = Ae();
|
|
8314
8533
|
if (!e.ok)
|
|
8315
|
-
return ct(e.status) || (this.options.targetFragment && t &&
|
|
8534
|
+
return ct(e.status) || (this.options.targetFragment && t && O.fetchError(
|
|
8316
8535
|
this.options.targetFragment.getTarget(),
|
|
8317
8536
|
t,
|
|
8318
8537
|
new Error(`${e.status} ${e.statusText}`),
|
|
@@ -8323,7 +8542,7 @@ ${R}
|
|
|
8323
8542
|
e.status,
|
|
8324
8543
|
e.statusText || null
|
|
8325
8544
|
)), !1;
|
|
8326
|
-
if (this.options.targetFragment && t && r &&
|
|
8545
|
+
if (this.options.targetFragment && t && r && O.fetchEnd(
|
|
8327
8546
|
this.options.targetFragment.getTarget(),
|
|
8328
8547
|
t,
|
|
8329
8548
|
e.status,
|
|
@@ -8347,18 +8566,18 @@ ${R}
|
|
|
8347
8566
|
s.push(new b(d, null).run());
|
|
8348
8567
|
}), this.options.clickFragments && this.options.clickFragments.length > 0)
|
|
8349
8568
|
for (const d of this.options.clickFragments) {
|
|
8350
|
-
await
|
|
8351
|
-
const
|
|
8352
|
-
typeof
|
|
8569
|
+
await B.evaluateAll(d);
|
|
8570
|
+
const p = d.getTarget();
|
|
8571
|
+
typeof p.click == "function" ? p.click() : p.dispatchEvent(
|
|
8353
8572
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
8354
8573
|
);
|
|
8355
8574
|
}
|
|
8356
8575
|
this.options.openFragments && this.options.openFragments.length > 0 && this.options.openFragments.forEach((d) => {
|
|
8357
|
-
const
|
|
8358
|
-
|
|
8576
|
+
const p = d.getTarget();
|
|
8577
|
+
p instanceof HTMLElement ? s.push(i.openDialog(p)) : m.error("Haori", "Element is not an HTML element: ", p);
|
|
8359
8578
|
}), this.options.closeFragments && this.options.closeFragments.length > 0 && this.options.closeFragments.forEach((d) => {
|
|
8360
|
-
const
|
|
8361
|
-
|
|
8579
|
+
const p = d.getTarget();
|
|
8580
|
+
p instanceof HTMLElement ? s.push(i.closeDialog(p)) : m.error("Haori", "Element is not an HTML element: ", p);
|
|
8362
8581
|
}), await Promise.all(s);
|
|
8363
8582
|
const a = b.unescapeNewlines(
|
|
8364
8583
|
this.resolveLateAttribute("dialog", this.options.dialogMessage)
|
|
@@ -8373,7 +8592,7 @@ ${R}
|
|
|
8373
8592
|
"scroll",
|
|
8374
8593
|
this.options.scrollTarget
|
|
8375
8594
|
);
|
|
8376
|
-
l &&
|
|
8595
|
+
l && G.query(
|
|
8377
8596
|
l,
|
|
8378
8597
|
b.attrName(this.eventType, "scroll"),
|
|
8379
8598
|
document
|
|
@@ -8384,12 +8603,12 @@ ${R}
|
|
|
8384
8603
|
);
|
|
8385
8604
|
if (c) {
|
|
8386
8605
|
let d = c;
|
|
8387
|
-
const
|
|
8606
|
+
const p = this.resolveLateAttribute(
|
|
8388
8607
|
"redirect-return-param",
|
|
8389
8608
|
this.options.redirectReturnParam
|
|
8390
8609
|
);
|
|
8391
|
-
if (
|
|
8392
|
-
const A = new URLSearchParams(window.location.search).get(
|
|
8610
|
+
if (p) {
|
|
8611
|
+
const A = new URLSearchParams(window.location.search).get(p);
|
|
8393
8612
|
if (A !== null) {
|
|
8394
8613
|
const S = A.trim();
|
|
8395
8614
|
dt.isSafeLocalPath(S) ? d = S : m.warn(
|
|
@@ -8455,8 +8674,8 @@ ${R}
|
|
|
8455
8674
|
return;
|
|
8456
8675
|
}
|
|
8457
8676
|
const l = (c) => {
|
|
8458
|
-
for (const [d,
|
|
8459
|
-
|
|
8677
|
+
for (const [d, p] of Object.entries(c))
|
|
8678
|
+
p != null && (Array.isArray(p) ? p.forEach((y) => o.searchParams.append(d, String(y))) : typeof p == "object" ? o.searchParams.set(d, JSON.stringify(p)) : o.searchParams.set(d, String(p)));
|
|
8460
8679
|
};
|
|
8461
8680
|
n && l(r), s && l(i), history.pushState(
|
|
8462
8681
|
{ [Ft]: !0 },
|
|
@@ -8491,17 +8710,17 @@ ${R}
|
|
|
8491
8710
|
const l = /* @__PURE__ */ new Map(), c = [];
|
|
8492
8711
|
for (const d of a)
|
|
8493
8712
|
if (d && typeof d == "object" && !Array.isArray(d)) {
|
|
8494
|
-
const
|
|
8713
|
+
const p = d.key, y = d.message, A = typeof p == "string" && p.length > 0 ? p : null, S = typeof y == "string" ? y : y != null ? String(y) : "";
|
|
8495
8714
|
if (S.length === 0)
|
|
8496
8715
|
continue;
|
|
8497
8716
|
if (A !== null) {
|
|
8498
|
-
const
|
|
8499
|
-
|
|
8717
|
+
const D = l.get(A) ?? [];
|
|
8718
|
+
D.push(S), l.set(A, D);
|
|
8500
8719
|
} else
|
|
8501
8720
|
c.push(S);
|
|
8502
8721
|
} else typeof d == "string" && d.length > 0 && c.push(d);
|
|
8503
|
-
for (const [d,
|
|
8504
|
-
o.push({ key: d, message:
|
|
8722
|
+
for (const [d, p] of l)
|
|
8723
|
+
o.push({ key: d, message: p.join(`
|
|
8505
8724
|
`) });
|
|
8506
8725
|
for (const d of c)
|
|
8507
8726
|
o.push({ message: d });
|
|
@@ -8728,7 +8947,7 @@ ${R}
|
|
|
8728
8947
|
if (l.kind === "skip")
|
|
8729
8948
|
return;
|
|
8730
8949
|
if (l.kind === "row") {
|
|
8731
|
-
const
|
|
8950
|
+
const p = this.options.bindArg;
|
|
8732
8951
|
a.push({
|
|
8733
8952
|
container: l.container,
|
|
8734
8953
|
row: o,
|
|
@@ -8737,14 +8956,14 @@ ${R}
|
|
|
8737
8956
|
apply: (y) => {
|
|
8738
8957
|
const A = this.resolveCurrentRowItem(o, y), S = { ...A };
|
|
8739
8958
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
8740
|
-
const
|
|
8741
|
-
S[
|
|
8959
|
+
const D = A[p], P = D !== null && typeof D == "object" && !Array.isArray(D) ? D : {};
|
|
8960
|
+
S[p] = this.mergeAppendBindingData(
|
|
8742
8961
|
o,
|
|
8743
8962
|
i,
|
|
8744
|
-
|
|
8963
|
+
P
|
|
8745
8964
|
);
|
|
8746
8965
|
} else
|
|
8747
|
-
S[
|
|
8966
|
+
S[p] = i;
|
|
8748
8967
|
return this.reconcileRowUserEdits(o, S);
|
|
8749
8968
|
}
|
|
8750
8969
|
});
|
|
@@ -8752,7 +8971,7 @@ ${R}
|
|
|
8752
8971
|
}
|
|
8753
8972
|
const c = { ...o.getRawBindingData() ?? {} }, d = this.options.bindArg;
|
|
8754
8973
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
8755
|
-
const
|
|
8974
|
+
const p = c[d], y = p && typeof p == "object" && !Array.isArray(p) ? p : {};
|
|
8756
8975
|
c[d] = this.mergeAppendBindingData(
|
|
8757
8976
|
o,
|
|
8758
8977
|
i,
|
|
@@ -8761,7 +8980,7 @@ ${R}
|
|
|
8761
8980
|
} else
|
|
8762
8981
|
c[d] = i;
|
|
8763
8982
|
n.push(
|
|
8764
|
-
|
|
8983
|
+
B.setBindingData(
|
|
8765
8984
|
o.getTarget(),
|
|
8766
8985
|
this.reconcileUserEditsForBind(o, c),
|
|
8767
8986
|
{
|
|
@@ -8803,8 +9022,8 @@ ${R}
|
|
|
8803
9022
|
row: o,
|
|
8804
9023
|
attributeName: s,
|
|
8805
9024
|
syncWhenUnchanged: "reflect",
|
|
8806
|
-
apply: (
|
|
8807
|
-
const y = this.options.bindMerge ? this.resolveCurrentRowItem(o,
|
|
9025
|
+
apply: (p) => {
|
|
9026
|
+
const y = this.options.bindMerge ? this.resolveCurrentRowItem(o, p) : p, A = this.mergeAppendBindingData(
|
|
8808
9027
|
o,
|
|
8809
9028
|
i,
|
|
8810
9029
|
y
|
|
@@ -8819,7 +9038,7 @@ ${R}
|
|
|
8819
9038
|
i
|
|
8820
9039
|
), d = this.options.bindMerge ? { ...o.getRawBindingData() ?? {}, ...c } : c;
|
|
8821
9040
|
n.push(
|
|
8822
|
-
|
|
9041
|
+
B.setBindingData(
|
|
8823
9042
|
o.getTarget(),
|
|
8824
9043
|
this.reconcileUserEditsForBind(o, d),
|
|
8825
9044
|
{
|
|
@@ -8834,7 +9053,7 @@ ${R}
|
|
|
8834
9053
|
return n.push(this.applyRowWrites(a)), Promise.all(n).then(() => {
|
|
8835
9054
|
const o = this.options.bindArg ?? null;
|
|
8836
9055
|
this.options.bindFragments.forEach((l) => {
|
|
8837
|
-
|
|
9056
|
+
O.bindComplete(l.getTarget(), o);
|
|
8838
9057
|
});
|
|
8839
9058
|
});
|
|
8840
9059
|
});
|
|
@@ -8875,7 +9094,7 @@ ${R}
|
|
|
8875
9094
|
if (r === null)
|
|
8876
9095
|
return t;
|
|
8877
9096
|
const i = this.eventType === "poll";
|
|
8878
|
-
if (!i && !this.twoWayCommitBind &&
|
|
9097
|
+
if (!i && !this.twoWayCommitBind && B.clearUserEditMarks(e, r), !(e.getTarget() instanceof HTMLFormElement))
|
|
8879
9098
|
return this.reconcileAncestorArgFormEdits(
|
|
8880
9099
|
e,
|
|
8881
9100
|
t,
|
|
@@ -8914,7 +9133,7 @@ ${R}
|
|
|
8914
9133
|
if (r === null)
|
|
8915
9134
|
return t;
|
|
8916
9135
|
const i = this.eventType === "poll";
|
|
8917
|
-
!i && !this.twoWayCommitBind &&
|
|
9136
|
+
!i && !this.twoWayCommitBind && B.clearUserEditMarks(e, r);
|
|
8918
9137
|
const n = F.getValuesEditedAfter(
|
|
8919
9138
|
e,
|
|
8920
9139
|
i ? 0 : r
|
|
@@ -8987,7 +9206,7 @@ ${R}
|
|
|
8987
9206
|
...t
|
|
8988
9207
|
};
|
|
8989
9208
|
n.push(
|
|
8990
|
-
|
|
9209
|
+
B.setBindingData(s.getTarget(), o, {
|
|
8991
9210
|
// 通番はコピーを起こした操作のもの(フェッチ応答の反映と同じ理由)。
|
|
8992
9211
|
sequence: this.operationSequence
|
|
8993
9212
|
})
|
|
@@ -9129,17 +9348,17 @@ ${R}
|
|
|
9129
9348
|
const d = s.get("Content-Type") || "";
|
|
9130
9349
|
if (/multipart\/form-data/i.test(d)) {
|
|
9131
9350
|
s.delete("Content-Type");
|
|
9132
|
-
const
|
|
9351
|
+
const p = new FormData();
|
|
9133
9352
|
for (const [y, A] of Object.entries(t))
|
|
9134
|
-
A == null ?
|
|
9135
|
-
S instanceof Blob ?
|
|
9136
|
-
}) :
|
|
9137
|
-
n.body =
|
|
9353
|
+
A == null ? p.append(y, "") : A instanceof Blob ? p.append(y, A) : Array.isArray(A) ? A.forEach((S) => {
|
|
9354
|
+
S instanceof Blob ? p.append(y, S) : p.append(y, le(S));
|
|
9355
|
+
}) : p.append(y, le(A));
|
|
9356
|
+
n.body = p;
|
|
9138
9357
|
} else if (/application\/x-www-form-urlencoded/i.test(d)) {
|
|
9139
|
-
const
|
|
9358
|
+
const p = new URLSearchParams();
|
|
9140
9359
|
for (const [y, A] of Object.entries(t))
|
|
9141
|
-
A !== void 0 && (Array.isArray(A) ? A.forEach((S) =>
|
|
9142
|
-
n.body =
|
|
9360
|
+
A !== void 0 && (Array.isArray(A) ? A.forEach((S) => p.append(y, le(S))) : p.append(y, le(A)));
|
|
9361
|
+
n.body = p;
|
|
9143
9362
|
} else
|
|
9144
9363
|
s.set("Content-Type", "application/json"), n.body = JSON.stringify(t);
|
|
9145
9364
|
}
|
|
@@ -9256,9 +9475,9 @@ ${R}
|
|
|
9256
9475
|
const t = this.options.targetFragment;
|
|
9257
9476
|
if (!t)
|
|
9258
9477
|
return m.error("Haori", "Target fragment is not specified for row operation."), null;
|
|
9259
|
-
const r = b.attrName(this.eventType, e), i =
|
|
9478
|
+
const r = b.attrName(this.eventType, e), i = G.read(t, r);
|
|
9260
9479
|
if (i !== null && i.trim() !== "") {
|
|
9261
|
-
const s =
|
|
9480
|
+
const s = G.query(i, r, document);
|
|
9262
9481
|
if (s === null)
|
|
9263
9482
|
return m.error(
|
|
9264
9483
|
"Haori",
|
|
@@ -9411,16 +9630,16 @@ ${R}
|
|
|
9411
9630
|
const d = b.resolveRowArrayIndex(c, a);
|
|
9412
9631
|
if (d === null)
|
|
9413
9632
|
continue;
|
|
9414
|
-
const
|
|
9415
|
-
if (
|
|
9633
|
+
const p = a[d];
|
|
9634
|
+
if (p === null || typeof p != "object" || Array.isArray(p)) {
|
|
9416
9635
|
m.warn(
|
|
9417
9636
|
"Haori",
|
|
9418
9637
|
`Row data is not an object; the write was skipped (${c.attributeName}).`
|
|
9419
9638
|
);
|
|
9420
9639
|
continue;
|
|
9421
9640
|
}
|
|
9422
|
-
const y = c.apply(
|
|
9423
|
-
if (b.isSameRowItem(
|
|
9641
|
+
const y = c.apply(p);
|
|
9642
|
+
if (b.isSameRowItem(p, y)) {
|
|
9424
9643
|
c.syncWhenUnchanged && r.push(
|
|
9425
9644
|
b.syncUnchangedRowValues(
|
|
9426
9645
|
c.row,
|
|
@@ -9434,7 +9653,7 @@ ${R}
|
|
|
9434
9653
|
}
|
|
9435
9654
|
if (!o)
|
|
9436
9655
|
return;
|
|
9437
|
-
const l =
|
|
9656
|
+
const l = B.setBindingData(
|
|
9438
9657
|
s.owner.getTarget(),
|
|
9439
9658
|
b.withPathValue(s.ownerData, s.path, a),
|
|
9440
9659
|
{
|
|
@@ -9450,7 +9669,7 @@ ${R}
|
|
|
9450
9669
|
sequence: this.operationSequence
|
|
9451
9670
|
}
|
|
9452
9671
|
);
|
|
9453
|
-
if (
|
|
9672
|
+
if (B.isEachUpdateRunning(n)) {
|
|
9454
9673
|
l.catch((c) => {
|
|
9455
9674
|
m.error("Haori", "Failed to write row data.", c);
|
|
9456
9675
|
});
|
|
@@ -9480,7 +9699,7 @@ ${R}
|
|
|
9480
9699
|
* @returns 反映完了の Promise
|
|
9481
9700
|
*/
|
|
9482
9701
|
static syncUnchangedRowValues(e, t, r) {
|
|
9483
|
-
return r === "supply" &&
|
|
9702
|
+
return r === "supply" && B.clearUserEditMarks(e), F.syncRowValues(e, t);
|
|
9484
9703
|
}
|
|
9485
9704
|
/**
|
|
9486
9705
|
* 行の要素データが同じ内容かどうかを判定します。
|
|
@@ -9526,7 +9745,7 @@ ${R}
|
|
|
9526
9745
|
if (n && s !== null) {
|
|
9527
9746
|
const a = [];
|
|
9528
9747
|
t.forEach((c, d) => {
|
|
9529
|
-
|
|
9748
|
+
B.createListKey(
|
|
9530
9749
|
c,
|
|
9531
9750
|
String(n),
|
|
9532
9751
|
d
|
|
@@ -9612,7 +9831,7 @@ ${R}
|
|
|
9612
9831
|
if (!i)
|
|
9613
9832
|
return Promise.reject(new Error("Row array not resolved."));
|
|
9614
9833
|
const n = this.options.targetFragment, s = n ? n.closestByAttribute(`${u.prefix}row`) : null, a = b.getRowFragments(r), o = s ? a.indexOf(s) : a.length - 1, l = i.array.slice();
|
|
9615
|
-
return t(l, o) ?
|
|
9834
|
+
return t(l, o) ? B.setBindingData(
|
|
9616
9835
|
i.owner.getTarget(),
|
|
9617
9836
|
b.withPathValue(i.ownerData, i.path, l),
|
|
9618
9837
|
{
|
|
@@ -9655,7 +9874,7 @@ ${R}
|
|
|
9655
9874
|
...s.getRawBindingData() ?? {},
|
|
9656
9875
|
_fetch: n
|
|
9657
9876
|
};
|
|
9658
|
-
return
|
|
9877
|
+
return B.setBindingData(a, o, {
|
|
9659
9878
|
reflectToAttribute: !1,
|
|
9660
9879
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
9661
9880
|
// 解除しない)。
|
|
@@ -9908,12 +10127,12 @@ const f = class f {
|
|
|
9908
10127
|
return Promise.resolve();
|
|
9909
10128
|
r.lastUrl = n, r.running = !0;
|
|
9910
10129
|
const s = performance.now();
|
|
9911
|
-
return t.setAttribute(`${u.prefix}importing`, ""),
|
|
10130
|
+
return t.setAttribute(`${u.prefix}importing`, ""), O.importStart(t, n), Ot.load(n).then((a) => {
|
|
9912
10131
|
const o = new TextEncoder().encode(a).length;
|
|
9913
10132
|
return W.enqueue(() => {
|
|
9914
10133
|
t.innerHTML = a;
|
|
9915
10134
|
}).then(() => {
|
|
9916
|
-
t.removeAttribute(`${u.prefix}importing`),
|
|
10135
|
+
t.removeAttribute(`${u.prefix}importing`), O.importEnd(t, n, o, s), f.adoptImportedChildren(e);
|
|
9917
10136
|
const l = [];
|
|
9918
10137
|
return e.getChildren().forEach((c) => {
|
|
9919
10138
|
c instanceof T ? l.push(f.scan(c.getTarget())) : c instanceof Q && l.push(f.evaluateText(c));
|
|
@@ -9921,7 +10140,7 @@ const f = class f {
|
|
|
9921
10140
|
});
|
|
9922
10141
|
});
|
|
9923
10142
|
}).catch((a) => {
|
|
9924
|
-
t.removeAttribute(`${u.prefix}importing`),
|
|
10143
|
+
t.removeAttribute(`${u.prefix}importing`), O.importError(t, n, a), m.error("[Haori]", "Failed to import HTML:", n, a);
|
|
9925
10144
|
}).finally(() => {
|
|
9926
10145
|
if (r.running = !1, r.rerunRequested)
|
|
9927
10146
|
return r.rerunRequested = !1, f.executeManagedImport(e);
|
|
@@ -10088,22 +10307,22 @@ const f = class f {
|
|
|
10088
10307
|
case `${u.prefix}bind`: {
|
|
10089
10308
|
if (r !== null && i && s instanceof T && s.consumeSelfWrittenBind(r))
|
|
10090
10309
|
break;
|
|
10091
|
-
const
|
|
10310
|
+
const p = r === null ? {} : f.parseDataBind(r);
|
|
10092
10311
|
if (i) {
|
|
10093
10312
|
const y = n ?? T.nextSequence();
|
|
10094
10313
|
return r === null ? (o.push(
|
|
10095
|
-
f.setBindingData(e,
|
|
10314
|
+
f.setBindingData(e, p, {
|
|
10096
10315
|
reflectToAttribute: !1,
|
|
10097
10316
|
sequence: y
|
|
10098
10317
|
})
|
|
10099
10318
|
), o.push(s.removeAttribute(t))) : o.push(
|
|
10100
|
-
f.setBindingData(e,
|
|
10319
|
+
f.setBindingData(e, p, {
|
|
10101
10320
|
sequence: y
|
|
10102
10321
|
})
|
|
10103
10322
|
), Promise.all(o).then(() => {
|
|
10104
10323
|
});
|
|
10105
10324
|
}
|
|
10106
|
-
r === null && s.clearBindingDataCache(), s.setBindingData(
|
|
10325
|
+
r === null && s.clearBindingDataCache(), s.setBindingData(p);
|
|
10107
10326
|
break;
|
|
10108
10327
|
}
|
|
10109
10328
|
case `${u.prefix}derive`:
|
|
@@ -10150,8 +10369,8 @@ const f = class f {
|
|
|
10150
10369
|
return r !== null && F.applyCustomValidity(s), Promise.all(o).then(() => {
|
|
10151
10370
|
});
|
|
10152
10371
|
case `${u.prefix}url-param`: {
|
|
10153
|
-
const
|
|
10154
|
-
|
|
10372
|
+
const p = s.getAttribute(`${u.prefix}url-arg`), y = dt.readParams();
|
|
10373
|
+
p === null && s.hasAttribute(`${u.prefix}store`) && m.warn(
|
|
10155
10374
|
"Haori",
|
|
10156
10375
|
`${u.prefix}url-param を ${u.prefix}url-arg なしで ${u.prefix}store と併用すると復元した値が消えます(${u.prefix}url-arg を指定してください)。`
|
|
10157
10376
|
);
|
|
@@ -10160,11 +10379,11 @@ const f = class f {
|
|
|
10160
10379
|
kind: "nonSupply",
|
|
10161
10380
|
sequence: T.nextSequence()
|
|
10162
10381
|
};
|
|
10163
|
-
if (
|
|
10382
|
+
if (p === null)
|
|
10164
10383
|
o.push(f.setBindingData(e, y, A));
|
|
10165
10384
|
else {
|
|
10166
10385
|
const S = s.getRawBindingData() || {};
|
|
10167
|
-
S[String(
|
|
10386
|
+
S[String(p)] = y, o.push(f.setBindingData(e, S, A));
|
|
10168
10387
|
}
|
|
10169
10388
|
break;
|
|
10170
10389
|
}
|
|
@@ -10173,8 +10392,8 @@ const f = class f {
|
|
|
10173
10392
|
() => d === null ? void 0 : d()
|
|
10174
10393
|
).then(() => {
|
|
10175
10394
|
if (l !== null)
|
|
10176
|
-
return s.setDeriveInputSignature(c), l.then((
|
|
10177
|
-
if (
|
|
10395
|
+
return s.setDeriveInputSignature(c), l.then((p) => {
|
|
10396
|
+
if (p)
|
|
10178
10397
|
return f.reevaluateChildren(s);
|
|
10179
10398
|
});
|
|
10180
10399
|
}).then(() => {
|
|
@@ -10213,34 +10432,34 @@ const f = class f {
|
|
|
10213
10432
|
...r.editedPaths === void 0 ? {} : { editedPaths: r.editedPaths }
|
|
10214
10433
|
}, d = o === "supply";
|
|
10215
10434
|
d && i.markSupplyApplied(l);
|
|
10216
|
-
const
|
|
10435
|
+
const p = T.currentSequence(), y = i.getRawBindingData();
|
|
10217
10436
|
d && (r.clearUserEdits ?? !0) && f.clearUserEditMarks(i, l);
|
|
10218
10437
|
const A = a ? f.resolveByPathAuthority(i, y, t, c) : t;
|
|
10219
|
-
i.setBindingData(A), a && (
|
|
10438
|
+
i.setBindingData(A), a && (O.bindChange(e, y, A, "manual"), ge.mirror(i));
|
|
10220
10439
|
const S = () => {
|
|
10221
10440
|
i.markBindingWorkStart();
|
|
10222
|
-
const
|
|
10223
|
-
let
|
|
10224
|
-
return e.tagName === "FORM" && (
|
|
10225
|
-
if (i.wasResetAfter(
|
|
10441
|
+
const D = i.getRawBindingData() ?? A;
|
|
10442
|
+
let P = a ? i.setAttribute(`${u.prefix}bind`, JSON.stringify(D)) : Promise.resolve();
|
|
10443
|
+
return e.tagName === "FORM" && (P = P.then(() => {
|
|
10444
|
+
if (i.wasResetAfter(p))
|
|
10226
10445
|
return;
|
|
10227
|
-
const
|
|
10446
|
+
const H = i.getRawBindingData() ?? A;
|
|
10228
10447
|
return F.syncValues(
|
|
10229
10448
|
i,
|
|
10230
|
-
F.resolveSyncValues(i,
|
|
10449
|
+
F.resolveSyncValues(i, H),
|
|
10231
10450
|
!1,
|
|
10232
10451
|
c
|
|
10233
10452
|
);
|
|
10234
|
-
})),
|
|
10235
|
-
() => F.syncAncestorArgForms(i,
|
|
10236
|
-
),
|
|
10237
|
-
() => T.retryUnappliedValueWrites(e,
|
|
10238
|
-
),
|
|
10453
|
+
})), P = P.then(
|
|
10454
|
+
() => F.syncAncestorArgForms(i, p, c)
|
|
10455
|
+
), P = P.then(() => f.evaluateAll(i, n)), P = P.then(
|
|
10456
|
+
() => T.retryUnappliedValueWrites(e, p)
|
|
10457
|
+
), P = P.then(
|
|
10239
10458
|
() => f.reevaluateReactiveSpecialAttributes(i, n)
|
|
10240
|
-
),
|
|
10459
|
+
), P.then(
|
|
10241
10460
|
() => i.markBindingWorkEnd(),
|
|
10242
|
-
(
|
|
10243
|
-
throw i.markBindingWorkEnd(),
|
|
10461
|
+
(H) => {
|
|
10462
|
+
throw i.markBindingWorkEnd(), H;
|
|
10244
10463
|
}
|
|
10245
10464
|
);
|
|
10246
10465
|
};
|
|
@@ -10284,7 +10503,7 @@ const f = class f {
|
|
|
10284
10503
|
static mergePathAuthority(e, t, r, i, n) {
|
|
10285
10504
|
if (f.isPlainRecord(t) && f.isPlainRecord(r)) {
|
|
10286
10505
|
const l = t, c = r, d = {};
|
|
10287
|
-
let
|
|
10506
|
+
let p = Object.keys(l).some(
|
|
10288
10507
|
(A) => !Object.prototype.hasOwnProperty.call(c, A)
|
|
10289
10508
|
);
|
|
10290
10509
|
const y = /* @__PURE__ */ new Set([
|
|
@@ -10292,29 +10511,29 @@ const f = class f {
|
|
|
10292
10511
|
...Object.keys(c)
|
|
10293
10512
|
]);
|
|
10294
10513
|
for (const A of y) {
|
|
10295
|
-
const S = n === "" ? A : `${n}.${A}`,
|
|
10514
|
+
const S = n === "" ? A : `${n}.${A}`, D = f.mergePathAuthority(
|
|
10296
10515
|
e,
|
|
10297
10516
|
Object.prototype.hasOwnProperty.call(l, A) ? l[A] : f.ABSENT_PATH,
|
|
10298
10517
|
Object.prototype.hasOwnProperty.call(c, A) ? c[A] : f.ABSENT_PATH,
|
|
10299
10518
|
i,
|
|
10300
10519
|
S
|
|
10301
10520
|
);
|
|
10302
|
-
|
|
10521
|
+
D !== f.ABSENT_PATH && (d[A] = D), D !== (Object.prototype.hasOwnProperty.call(c, A) ? c[A] : f.ABSENT_PATH) && (p = !0);
|
|
10303
10522
|
}
|
|
10304
|
-
return
|
|
10523
|
+
return p ? d : c;
|
|
10305
10524
|
}
|
|
10306
10525
|
const s = f.resolveArrayPairing(e, t, r, n);
|
|
10307
10526
|
if (s !== null) {
|
|
10308
10527
|
const l = t, c = r, d = c.map(
|
|
10309
|
-
(
|
|
10528
|
+
(p, y) => f.mergePathAuthority(
|
|
10310
10529
|
e,
|
|
10311
10530
|
l[y],
|
|
10312
|
-
|
|
10531
|
+
p,
|
|
10313
10532
|
i,
|
|
10314
10533
|
`${n}[${s[y]}]`
|
|
10315
10534
|
)
|
|
10316
10535
|
);
|
|
10317
|
-
return d.some((
|
|
10536
|
+
return d.some((p, y) => p !== c[y]) ? d : c;
|
|
10318
10537
|
}
|
|
10319
10538
|
if (f.isSameBindingValue(t, r))
|
|
10320
10539
|
return r;
|
|
@@ -10490,14 +10709,14 @@ const f = class f {
|
|
|
10490
10709
|
const r = t.getBindingData(), i = {}, n = (l) => {
|
|
10491
10710
|
const c = l.getTarget(), d = f.resolveElementId(c);
|
|
10492
10711
|
return d !== "" ? `#${d}` : c.tagName.toLowerCase();
|
|
10493
|
-
}, s = (l, c, d,
|
|
10712
|
+
}, s = (l, c, d, p) => {
|
|
10494
10713
|
if (l)
|
|
10495
10714
|
for (const y of Object.keys(l))
|
|
10496
10715
|
y in i || (i[y] = {
|
|
10497
10716
|
value: l[y],
|
|
10498
10717
|
source: n(c),
|
|
10499
10718
|
kind: d,
|
|
10500
|
-
depth:
|
|
10719
|
+
depth: p
|
|
10501
10720
|
});
|
|
10502
10721
|
};
|
|
10503
10722
|
let a = t, o = 0;
|
|
@@ -10630,22 +10849,22 @@ const f = class f {
|
|
|
10630
10849
|
const i = e.hasAttribute(`${u.prefix}derive`), n = e.hasAttribute(`${u.prefix}if`), s = e.hasAttribute(`${u.prefix}each`), a = e.getRawAttribute(`${u.prefix}derive`), o = e.getRawAttribute(`${u.prefix}derive-name`);
|
|
10631
10850
|
let l = !1, c = !1, d = null;
|
|
10632
10851
|
if (!i && e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), !i && e.getDeriveInputSignature() !== null && e.setDeriveInputSignature(null), i) {
|
|
10633
|
-
const
|
|
10852
|
+
const p = f.createDeriveInputSignature(
|
|
10634
10853
|
e,
|
|
10635
10854
|
a,
|
|
10636
10855
|
o
|
|
10637
10856
|
);
|
|
10638
|
-
|
|
10857
|
+
p === null ? (e.getDeriveInputSignature() !== null && e.setDeriveInputSignature(null), r = r.then(
|
|
10639
10858
|
() => f.evaluateDerive(e, a, o).then(
|
|
10640
10859
|
() => {
|
|
10641
10860
|
}
|
|
10642
10861
|
)
|
|
10643
|
-
)) : e.getDeriveInputSignature() !==
|
|
10862
|
+
)) : e.getDeriveInputSignature() !== p && (r = r.then(() => f.evaluateDerive(
|
|
10644
10863
|
e,
|
|
10645
10864
|
a,
|
|
10646
10865
|
o
|
|
10647
10866
|
).then(() => {
|
|
10648
|
-
e.setDeriveInputSignature(
|
|
10867
|
+
e.setDeriveInputSignature(p);
|
|
10649
10868
|
})));
|
|
10650
10869
|
}
|
|
10651
10870
|
return n && (r = r.then(() => f.evaluateIf(e))), s ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => f.evaluateEach(e))) : n ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => {
|
|
@@ -10664,14 +10883,14 @@ const f = class f {
|
|
|
10664
10883
|
})), r.then(() => {
|
|
10665
10884
|
if (l)
|
|
10666
10885
|
return;
|
|
10667
|
-
const
|
|
10886
|
+
const p = [];
|
|
10668
10887
|
return e.getChildren().forEach((y) => {
|
|
10669
10888
|
if (y instanceof T) {
|
|
10670
10889
|
if (f.canSkipUnchangedNestedEach(y))
|
|
10671
10890
|
return;
|
|
10672
|
-
|
|
10673
|
-
} else y instanceof Q &&
|
|
10674
|
-
}), Promise.all(
|
|
10891
|
+
p.push(f.evaluateAll(y, t));
|
|
10892
|
+
} else y instanceof Q && p.push(f.evaluateText(y));
|
|
10893
|
+
}), Promise.all(p).then(() => {
|
|
10675
10894
|
});
|
|
10676
10895
|
}).then(() => {
|
|
10677
10896
|
c && d !== null && e.setDeriveSubtreeSignature(d);
|
|
@@ -10778,7 +10997,7 @@ const f = class f {
|
|
|
10778
10997
|
if (f.isHiddenIfCondition(r))
|
|
10779
10998
|
j.isEnabled() && f.logFalsyIfDiagnostics(e), t.push(
|
|
10780
10999
|
e.hide().then(() => {
|
|
10781
|
-
|
|
11000
|
+
O.hide(e.getTarget());
|
|
10782
11001
|
})
|
|
10783
11002
|
);
|
|
10784
11003
|
else {
|
|
@@ -10790,7 +11009,7 @@ const f = class f {
|
|
|
10790
11009
|
) : s instanceof Q && n.push(f.evaluateText(s));
|
|
10791
11010
|
}), t.push(
|
|
10792
11011
|
e.show().then(() => {
|
|
10793
|
-
|
|
11012
|
+
O.show(e.getTarget()), i || (f.triggerLoadOnShow(e), te.refreshSubtree(e.getTarget()));
|
|
10794
11013
|
})
|
|
10795
11014
|
), t.push(Promise.all(n).then(() => {
|
|
10796
11015
|
}));
|
|
@@ -11438,15 +11657,15 @@ ${r}
|
|
|
11438
11657
|
let d = e.getChildren().filter((E) => E instanceof T).filter(
|
|
11439
11658
|
(E) => !E.hasAttribute(`${u.prefix}each-before`) && !E.hasAttribute(`${u.prefix}each-after`)
|
|
11440
11659
|
);
|
|
11441
|
-
const
|
|
11660
|
+
const p = d.map((E) => E.getListKey()), y = /* @__PURE__ */ new Set();
|
|
11442
11661
|
d = d.filter((E, v) => {
|
|
11443
|
-
const R = String(E.getListKey()),
|
|
11444
|
-
if (
|
|
11662
|
+
const R = String(E.getListKey()), C = l.get(R) ?? 0;
|
|
11663
|
+
if (C === 0) {
|
|
11445
11664
|
y.add(E);
|
|
11446
|
-
const
|
|
11447
|
-
return
|
|
11665
|
+
const x = E.getListKey();
|
|
11666
|
+
return x !== null && O.rowRemove(E.getTarget(), x, v), c.push(E.remove()), !1;
|
|
11448
11667
|
}
|
|
11449
|
-
return l.set(R,
|
|
11668
|
+
return l.set(R, C - 1), !0;
|
|
11450
11669
|
});
|
|
11451
11670
|
const A = d.map((E) => E.getListKey()), S = /* @__PURE__ */ new Map();
|
|
11452
11671
|
d.forEach((E) => {
|
|
@@ -11456,23 +11675,23 @@ ${r}
|
|
|
11456
11675
|
const R = S.get(v);
|
|
11457
11676
|
R ? R.push(E) : S.set(v, [E]);
|
|
11458
11677
|
});
|
|
11459
|
-
const
|
|
11678
|
+
const D = e.getChildElementFragments().filter((E) => !y.has(E)), P = D.filter(
|
|
11460
11679
|
(E) => E.hasAttribute(`${u.prefix}each-before`)
|
|
11461
11680
|
).length;
|
|
11462
|
-
let
|
|
11681
|
+
let H = Promise.resolve();
|
|
11463
11682
|
return a.forEach((E, v) => {
|
|
11464
|
-
const R = t[v],
|
|
11465
|
-
let
|
|
11683
|
+
const R = t[v], C = v;
|
|
11684
|
+
let x;
|
|
11466
11685
|
const V = S.get(E)?.shift();
|
|
11467
11686
|
if (V) {
|
|
11468
|
-
|
|
11469
|
-
const
|
|
11470
|
-
|
|
11687
|
+
x = V;
|
|
11688
|
+
const z = P + v;
|
|
11689
|
+
H = H.then(
|
|
11471
11690
|
() => f.updateRowFragment(
|
|
11472
|
-
|
|
11691
|
+
x,
|
|
11473
11692
|
R,
|
|
11474
11693
|
i,
|
|
11475
|
-
|
|
11694
|
+
C,
|
|
11476
11695
|
s ? String(s) : null,
|
|
11477
11696
|
E
|
|
11478
11697
|
).then(
|
|
@@ -11482,57 +11701,57 @@ ${r}
|
|
|
11482
11701
|
// される)で DOM の順序が古いまま残る。
|
|
11483
11702
|
f.repositionEachRow(
|
|
11484
11703
|
e,
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11704
|
+
x,
|
|
11705
|
+
D,
|
|
11706
|
+
z
|
|
11488
11707
|
).then((Z) => {
|
|
11489
|
-
if (Z !== null &&
|
|
11490
|
-
|
|
11708
|
+
if (Z !== null && O.rowMove(
|
|
11709
|
+
x.getTarget(),
|
|
11491
11710
|
E,
|
|
11492
|
-
Z -
|
|
11711
|
+
Z - P,
|
|
11493
11712
|
v
|
|
11494
11713
|
), !!_)
|
|
11495
|
-
return f.clearUserEditMarks(
|
|
11496
|
-
() => f.applyRowFormValues(e,
|
|
11714
|
+
return f.clearUserEditMarks(x), f.evaluateAll(x).then(
|
|
11715
|
+
() => f.applyRowFormValues(e, x, R)
|
|
11497
11716
|
);
|
|
11498
11717
|
})
|
|
11499
11718
|
)
|
|
11500
11719
|
)
|
|
11501
11720
|
);
|
|
11502
11721
|
} else {
|
|
11503
|
-
|
|
11504
|
-
const
|
|
11505
|
-
|
|
11722
|
+
x = r.clone();
|
|
11723
|
+
const z = P + v;
|
|
11724
|
+
H = H.then(
|
|
11506
11725
|
() => f.updateRowFragment(
|
|
11507
|
-
|
|
11726
|
+
x,
|
|
11508
11727
|
R,
|
|
11509
11728
|
i,
|
|
11510
|
-
|
|
11729
|
+
C,
|
|
11511
11730
|
s ? String(s) : null,
|
|
11512
11731
|
E
|
|
11513
11732
|
).then(() => {
|
|
11514
|
-
const _ =
|
|
11515
|
-
return e.insertBefore(
|
|
11516
|
-
|
|
11517
|
-
}).then(() => f.initializeFreshEachRow(
|
|
11518
|
-
|
|
11733
|
+
const _ = D[z] ?? null;
|
|
11734
|
+
return e.insertBefore(x, _).then(() => {
|
|
11735
|
+
D.splice(z, 0, x);
|
|
11736
|
+
}).then(() => f.initializeFreshEachRow(x)).then(() => f.applyRowFormValues(e, x, R)).then(() => {
|
|
11737
|
+
O.rowAdd(x.getTarget(), E, C, R);
|
|
11519
11738
|
});
|
|
11520
11739
|
})
|
|
11521
11740
|
);
|
|
11522
11741
|
}
|
|
11523
|
-
}), Promise.all(c).then(() =>
|
|
11742
|
+
}), Promise.all(c).then(() => H).then(() => {
|
|
11524
11743
|
const E = a.filter(
|
|
11525
|
-
(
|
|
11744
|
+
(z) => z !== null
|
|
11526
11745
|
), v = A.filter(
|
|
11527
|
-
(
|
|
11528
|
-
), R = new Set(v),
|
|
11529
|
-
(
|
|
11746
|
+
(z) => z !== null
|
|
11747
|
+
), R = new Set(v), C = E.filter((z) => !R.has(z)), V = p.filter(
|
|
11748
|
+
(z) => z !== null
|
|
11530
11749
|
).filter(
|
|
11531
|
-
(
|
|
11750
|
+
(z) => !o.has(z)
|
|
11532
11751
|
);
|
|
11533
|
-
|
|
11752
|
+
O.eachUpdate(
|
|
11534
11753
|
e.getTarget(),
|
|
11535
|
-
|
|
11754
|
+
C,
|
|
11536
11755
|
V,
|
|
11537
11756
|
E
|
|
11538
11757
|
);
|
|
@@ -11789,7 +12008,7 @@ f.ATTRIBUTE_ALIAS_SUFFIX = "attr-", f.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
11789
12008
|
"enhance",
|
|
11790
12009
|
"enhance-new"
|
|
11791
12010
|
]), f.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), f.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), f.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), f.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), f.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), f.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), f.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), f.ABSENT_PATH = Symbol("absent");
|
|
11792
|
-
let
|
|
12011
|
+
let B = f;
|
|
11793
12012
|
const fe = class fe {
|
|
11794
12013
|
/**
|
|
11795
12014
|
* コンストラクタ。
|
|
@@ -12173,17 +12392,17 @@ const U = class U {
|
|
|
12173
12392
|
(l) => {
|
|
12174
12393
|
const c = U.registrations.get(e);
|
|
12175
12394
|
c && l.forEach((d) => {
|
|
12176
|
-
!d.isIntersecting || c.running || U.isDisabled(c.fragment) || (c.running = !0, new ee(c.fragment, "intersect").runWithResult().then((
|
|
12177
|
-
|
|
12178
|
-
}).catch((
|
|
12395
|
+
!d.isIntersecting || c.running || U.isDisabled(c.fragment) || (c.running = !0, new ee(c.fragment, "intersect").runWithResult().then((p) => {
|
|
12396
|
+
p && c.once && (c.observer.disconnect(), U.registrations.delete(e));
|
|
12397
|
+
}).catch((p) => {
|
|
12179
12398
|
m.error(
|
|
12180
12399
|
"[Haori]",
|
|
12181
12400
|
"Intersect procedure execution error:",
|
|
12182
|
-
|
|
12401
|
+
p
|
|
12183
12402
|
);
|
|
12184
12403
|
}).finally(() => {
|
|
12185
|
-
const
|
|
12186
|
-
|
|
12404
|
+
const p = U.registrations.get(e);
|
|
12405
|
+
p && (p.running = !1);
|
|
12187
12406
|
}));
|
|
12188
12407
|
});
|
|
12189
12408
|
},
|
|
@@ -12230,7 +12449,7 @@ const U = class U {
|
|
|
12230
12449
|
const r = e.getAttribute(t);
|
|
12231
12450
|
if (typeof r != "string" || r.trim() === "")
|
|
12232
12451
|
return null;
|
|
12233
|
-
const i =
|
|
12452
|
+
const i = G.query(r, t, document);
|
|
12234
12453
|
return U.isHtmlElement(i) ? i : (m.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
12235
12454
|
}
|
|
12236
12455
|
static resolveRootMargin(e) {
|
|
@@ -12496,7 +12715,7 @@ const w = class w {
|
|
|
12496
12715
|
*/
|
|
12497
12716
|
static async handleTimeout(e) {
|
|
12498
12717
|
const t = w.registrations.get(e);
|
|
12499
|
-
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected &&
|
|
12718
|
+
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected && O.pollTimeout(
|
|
12500
12719
|
e,
|
|
12501
12720
|
t.count,
|
|
12502
12721
|
w.elapsed(t)
|
|
@@ -12516,7 +12735,7 @@ const w = class w {
|
|
|
12516
12735
|
w.registrations.delete(e);
|
|
12517
12736
|
return;
|
|
12518
12737
|
}
|
|
12519
|
-
await w.injectState(t), e.isConnected &&
|
|
12738
|
+
await w.injectState(t), e.isConnected && O.pollStop(
|
|
12520
12739
|
e,
|
|
12521
12740
|
r,
|
|
12522
12741
|
t.count,
|
|
@@ -12602,7 +12821,7 @@ const w = class w {
|
|
|
12602
12821
|
...i.getRawBindingData() ?? {},
|
|
12603
12822
|
_poll: r
|
|
12604
12823
|
};
|
|
12605
|
-
return
|
|
12824
|
+
return B.setBindingData(n, s, {
|
|
12606
12825
|
reflectToAttribute: !1,
|
|
12607
12826
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
12608
12827
|
// 解除しない)。
|
|
@@ -12646,7 +12865,7 @@ const w = class w {
|
|
|
12646
12865
|
const i = r.getAttribute(t);
|
|
12647
12866
|
if (typeof i != "string" || i.trim() === "")
|
|
12648
12867
|
return r.getTarget().isConnected ? [r] : [];
|
|
12649
|
-
const n =
|
|
12868
|
+
const n = G.queryAll(
|
|
12650
12869
|
i,
|
|
12651
12870
|
t,
|
|
12652
12871
|
document
|
|
@@ -12806,11 +13025,11 @@ w.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
12806
13025
|
"state"
|
|
12807
13026
|
]), w.DEFAULT_INTERVAL_MS = 5e3, w.MIN_INTERVAL_MS = 100, w.registrations = /* @__PURE__ */ new Map(), w.visibilityListener = null;
|
|
12808
13027
|
let ce = w;
|
|
12809
|
-
const Ht = "0.
|
|
13028
|
+
const Ht = "0.42.0";
|
|
12810
13029
|
function Ut(g) {
|
|
12811
13030
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => g()) : Promise.resolve().then(g);
|
|
12812
13031
|
}
|
|
12813
|
-
const
|
|
13032
|
+
const L = class L {
|
|
12814
13033
|
/**
|
|
12815
13034
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
12816
13035
|
*
|
|
@@ -12829,8 +13048,8 @@ const B = class B {
|
|
|
12829
13048
|
* @param root 走査の起点ノード
|
|
12830
13049
|
*/
|
|
12831
13050
|
static syncTree(e) {
|
|
12832
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
12833
|
-
|
|
13051
|
+
(e instanceof Element || e instanceof DocumentFragment) && (L.isHtmlElement(e) && L.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
13052
|
+
L.syncElement(t);
|
|
12834
13053
|
}));
|
|
12835
13054
|
}
|
|
12836
13055
|
/**
|
|
@@ -12840,42 +13059,42 @@ const B = class B {
|
|
|
12840
13059
|
* @param element 対象要素
|
|
12841
13060
|
*/
|
|
12842
13061
|
static syncElement(e) {
|
|
12843
|
-
const t =
|
|
12844
|
-
if (!(r instanceof T) || !
|
|
12845
|
-
t && (t.observer.disconnect(),
|
|
13062
|
+
const t = L.registrations.get(e), r = N.get(e);
|
|
13063
|
+
if (!(r instanceof T) || !L.shouldObserve(r)) {
|
|
13064
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
12846
13065
|
return;
|
|
12847
13066
|
}
|
|
12848
13067
|
if (typeof IntersectionObserver > "u")
|
|
12849
13068
|
return;
|
|
12850
|
-
const i =
|
|
13069
|
+
const i = L.resolveVarName(r);
|
|
12851
13070
|
if (i === "") {
|
|
12852
|
-
t && (t.observer.disconnect(),
|
|
13071
|
+
t && (t.observer.disconnect(), L.registrations.delete(e)), m.warn(
|
|
12853
13072
|
"[Haori]",
|
|
12854
13073
|
'data-each-visible requires a variable name (e.g. data-each-visible="visibleRange").'
|
|
12855
13074
|
);
|
|
12856
13075
|
return;
|
|
12857
13076
|
}
|
|
12858
|
-
const n =
|
|
13077
|
+
const n = L.resolveRoot(r), s = L.resolveRootMargin(r);
|
|
12859
13078
|
if (t && t.observer.root === n && t.observer.rootMargin === s && t.varName === i) {
|
|
12860
|
-
t.fragment = r,
|
|
13079
|
+
t.fragment = r, L.refreshRows(t);
|
|
12861
13080
|
return;
|
|
12862
13081
|
}
|
|
12863
|
-
t && (t.observer.disconnect(),
|
|
13082
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
12864
13083
|
const a = new IntersectionObserver(
|
|
12865
13084
|
(l) => {
|
|
12866
|
-
const c =
|
|
13085
|
+
const c = L.registrations.get(e);
|
|
12867
13086
|
if (!c)
|
|
12868
13087
|
return;
|
|
12869
13088
|
let d = !1;
|
|
12870
|
-
l.forEach((
|
|
12871
|
-
const y =
|
|
12872
|
-
c.observedRows.has(y) && (
|
|
12873
|
-
}), d &&
|
|
13089
|
+
l.forEach((p) => {
|
|
13090
|
+
const y = p.target;
|
|
13091
|
+
c.observedRows.has(y) && (p.isIntersecting ? c.visibleRows.has(y) || (c.visibleRows.add(y), d = !0) : c.visibleRows.delete(y) && (d = !0));
|
|
13092
|
+
}), d && L.scheduleCompute(c);
|
|
12874
13093
|
},
|
|
12875
13094
|
{
|
|
12876
13095
|
root: n,
|
|
12877
13096
|
rootMargin: s,
|
|
12878
|
-
threshold:
|
|
13097
|
+
threshold: L.THRESHOLD
|
|
12879
13098
|
}
|
|
12880
13099
|
), o = {
|
|
12881
13100
|
fragment: r,
|
|
@@ -12888,7 +13107,7 @@ const B = class B {
|
|
|
12888
13107
|
scheduled: !1,
|
|
12889
13108
|
lastSnapshot: null
|
|
12890
13109
|
};
|
|
12891
|
-
|
|
13110
|
+
L.registrations.set(e, o), L.refreshRows(o);
|
|
12892
13111
|
}
|
|
12893
13112
|
/**
|
|
12894
13113
|
* 指定ノード配下の監視登録を解放します。
|
|
@@ -12896,22 +13115,22 @@ const B = class B {
|
|
|
12896
13115
|
* @param root 走査の起点ノード
|
|
12897
13116
|
*/
|
|
12898
13117
|
static cleanupTree(e) {
|
|
12899
|
-
if (
|
|
12900
|
-
const t =
|
|
12901
|
-
t && (t.observer.disconnect(),
|
|
13118
|
+
if (L.isHtmlElement(e)) {
|
|
13119
|
+
const t = L.registrations.get(e);
|
|
13120
|
+
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
12902
13121
|
}
|
|
12903
13122
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
12904
|
-
const r =
|
|
12905
|
-
r && (r.observer.disconnect(),
|
|
13123
|
+
const r = L.registrations.get(t);
|
|
13124
|
+
r && (r.observer.disconnect(), L.registrations.delete(t));
|
|
12906
13125
|
});
|
|
12907
13126
|
}
|
|
12908
13127
|
/**
|
|
12909
13128
|
* すべての監視登録を解放します。
|
|
12910
13129
|
*/
|
|
12911
13130
|
static disconnectAll() {
|
|
12912
|
-
|
|
13131
|
+
L.registrations.forEach((e) => {
|
|
12913
13132
|
e.observer.disconnect();
|
|
12914
|
-
}),
|
|
13133
|
+
}), L.registrations.clear();
|
|
12915
13134
|
}
|
|
12916
13135
|
/**
|
|
12917
13136
|
* 監視対象(`data-each` かつ `data-each-visible`)かどうかを判定します。
|
|
@@ -12945,8 +13164,8 @@ const B = class B {
|
|
|
12945
13164
|
const r = e.getAttribute(t);
|
|
12946
13165
|
if (typeof r != "string" || r.trim() === "")
|
|
12947
13166
|
return null;
|
|
12948
|
-
const i =
|
|
12949
|
-
return
|
|
13167
|
+
const i = G.query(r, t, document);
|
|
13168
|
+
return L.isHtmlElement(i) ? i : (m.error("[Haori]", `Visible range root element not found: ${r}`), null);
|
|
12950
13169
|
}
|
|
12951
13170
|
/**
|
|
12952
13171
|
* rootMargin を解決します。
|
|
@@ -12956,7 +13175,7 @@ const B = class B {
|
|
|
12956
13175
|
*/
|
|
12957
13176
|
static resolveRootMargin(e) {
|
|
12958
13177
|
const t = `${u.prefix}each-visible-margin`, r = e.getAttribute(t);
|
|
12959
|
-
return r === null || r === !1 || r === "" ?
|
|
13178
|
+
return r === null || r === !1 || r === "" ? L.DEFAULT_ROOT_MARGIN : String(r);
|
|
12960
13179
|
}
|
|
12961
13180
|
/**
|
|
12962
13181
|
* コンテナ直下の実際の行要素(`each-before`/`each-after` を除く)を描画順で返します。
|
|
@@ -12976,12 +13195,12 @@ const B = class B {
|
|
|
12976
13195
|
* @param registration 対象の登録
|
|
12977
13196
|
*/
|
|
12978
13197
|
static refreshRows(e) {
|
|
12979
|
-
const t =
|
|
13198
|
+
const t = L.realRowElements(e.fragment), r = new Set(t);
|
|
12980
13199
|
for (const i of [...e.observedRows])
|
|
12981
13200
|
r.has(i) || (e.observer.unobserve(i), e.observedRows.delete(i), e.visibleRows.delete(i));
|
|
12982
13201
|
for (const i of t)
|
|
12983
13202
|
e.observedRows.has(i) || (e.observer.observe(i), e.observedRows.add(i));
|
|
12984
|
-
|
|
13203
|
+
L.scheduleCompute(e);
|
|
12985
13204
|
}
|
|
12986
13205
|
/**
|
|
12987
13206
|
* 次フレームでの集計・公開を予約します(多発する交差イベントを 1 回にまとめる)。
|
|
@@ -12992,7 +13211,7 @@ const B = class B {
|
|
|
12992
13211
|
e.scheduled || (e.scheduled = !0, Ut(() => {
|
|
12993
13212
|
e.scheduled = !1;
|
|
12994
13213
|
const t = e.fragment.getTarget();
|
|
12995
|
-
|
|
13214
|
+
L.registrations.get(t) === e && L.computeAndPublish(e);
|
|
12996
13215
|
}));
|
|
12997
13216
|
}
|
|
12998
13217
|
/**
|
|
@@ -13001,7 +13220,7 @@ const B = class B {
|
|
|
13001
13220
|
* @param registration 対象の登録
|
|
13002
13221
|
*/
|
|
13003
13222
|
static computeAndPublish(e) {
|
|
13004
|
-
const t =
|
|
13223
|
+
const t = L.realRowElements(e.fragment), r = /* @__PURE__ */ new Map();
|
|
13005
13224
|
t.forEach((a, o) => r.set(a, o));
|
|
13006
13225
|
const i = [];
|
|
13007
13226
|
for (const a of e.visibleRows) {
|
|
@@ -13034,7 +13253,7 @@ const B = class B {
|
|
|
13034
13253
|
};
|
|
13035
13254
|
}
|
|
13036
13255
|
const s = JSON.stringify(n);
|
|
13037
|
-
s !== e.lastSnapshot && (e.lastSnapshot = s,
|
|
13256
|
+
s !== e.lastSnapshot && (e.lastSnapshot = s, L.publish(e, n));
|
|
13038
13257
|
}
|
|
13039
13258
|
/**
|
|
13040
13259
|
* 可視範囲スナップショットを最近接の上位 `data-bind` スコープへ公開します。
|
|
@@ -13043,7 +13262,7 @@ const B = class B {
|
|
|
13043
13262
|
* @param snapshot 公開するスナップショット
|
|
13044
13263
|
*/
|
|
13045
13264
|
static publish(e, t) {
|
|
13046
|
-
const r =
|
|
13265
|
+
const r = L.resolveBindOwner(e.fragment);
|
|
13047
13266
|
if (!r) {
|
|
13048
13267
|
m.warn(
|
|
13049
13268
|
"[Haori]",
|
|
@@ -13056,7 +13275,7 @@ const B = class B {
|
|
|
13056
13275
|
};
|
|
13057
13276
|
n[e.varName] = { ...t };
|
|
13058
13277
|
const s = e.fragment.getTarget(), a = i === s ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([e.fragment]);
|
|
13059
|
-
|
|
13278
|
+
B.setBindingData(i, n, {
|
|
13060
13279
|
skipFragments: a,
|
|
13061
13280
|
reflectToAttribute: !1,
|
|
13062
13281
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
@@ -13085,8 +13304,8 @@ const B = class B {
|
|
|
13085
13304
|
return e.hasAttribute(t) ? e : null;
|
|
13086
13305
|
}
|
|
13087
13306
|
};
|
|
13088
|
-
|
|
13089
|
-
let se =
|
|
13307
|
+
L.THRESHOLD = 0, L.DEFAULT_ROOT_MARGIN = "0px", L.registrations = /* @__PURE__ */ new Map();
|
|
13308
|
+
let se = L;
|
|
13090
13309
|
const K = class K {
|
|
13091
13310
|
/**
|
|
13092
13311
|
* 既存の MutationObserver をすべて停止します。
|
|
@@ -13110,8 +13329,8 @@ const K = class K {
|
|
|
13110
13329
|
K._dispatcher = e, e.startDeferred();
|
|
13111
13330
|
try {
|
|
13112
13331
|
const t = await Promise.allSettled([
|
|
13113
|
-
|
|
13114
|
-
|
|
13332
|
+
B.scan(document.head),
|
|
13333
|
+
B.scan(document.body)
|
|
13115
13334
|
]), [r, i] = t;
|
|
13116
13335
|
r.status !== "fulfilled" && m.error(
|
|
13117
13336
|
"[Haori]",
|
|
@@ -13125,7 +13344,7 @@ const K = class K {
|
|
|
13125
13344
|
} finally {
|
|
13126
13345
|
e.release();
|
|
13127
13346
|
}
|
|
13128
|
-
|
|
13347
|
+
O.ready(Ht);
|
|
13129
13348
|
}
|
|
13130
13349
|
/**
|
|
13131
13350
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -13226,9 +13445,9 @@ const K = class K {
|
|
|
13226
13445
|
switch (r.type) {
|
|
13227
13446
|
case "attributes": {
|
|
13228
13447
|
const i = r.target;
|
|
13229
|
-
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(pe) && (r.attributeName === "disabled" || r.attributeName === pe) || r.attributeName &&
|
|
13448
|
+
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(pe) && (r.attributeName === "disabled" || r.attributeName === pe) || r.attributeName && B.isAliasedAttributeReflection(i, r.attributeName))
|
|
13230
13449
|
break;
|
|
13231
|
-
|
|
13450
|
+
B.setAttribute(
|
|
13232
13451
|
i,
|
|
13233
13452
|
r.attributeName,
|
|
13234
13453
|
i.getAttribute(r.attributeName),
|
|
@@ -13239,14 +13458,14 @@ const K = class K {
|
|
|
13239
13458
|
}
|
|
13240
13459
|
case "childList": {
|
|
13241
13460
|
Array.from(r.removedNodes).forEach((i) => {
|
|
13242
|
-
ue.cleanupTree(i), ce.cleanupTree(i), se.cleanupTree(i),
|
|
13461
|
+
ue.cleanupTree(i), ce.cleanupTree(i), se.cleanupTree(i), B.removeNode(i);
|
|
13243
13462
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
13244
|
-
i.parentElement instanceof Element && (
|
|
13463
|
+
i.parentElement instanceof Element && (B.addNode(i.parentElement, i), ue.syncTree(i), ce.syncTree(i), se.syncTree(i));
|
|
13245
13464
|
}), r.target instanceof Element && se.syncElement(r.target);
|
|
13246
13465
|
break;
|
|
13247
13466
|
}
|
|
13248
13467
|
case "characterData": {
|
|
13249
|
-
r.target instanceof Text || r.target instanceof Comment ?
|
|
13468
|
+
r.target instanceof Text || r.target instanceof Comment ? B.changeText(r.target, r.target.textContent) : m.warn(
|
|
13250
13469
|
"[Haori]",
|
|
13251
13470
|
"Unsupported character data type:",
|
|
13252
13471
|
r.target
|
|
@@ -13267,7 +13486,7 @@ let Re = K;
|
|
|
13267
13486
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Re.init) : Re.init();
|
|
13268
13487
|
const Vt = () => he.waitForRenders(), qt = he.enhancers;
|
|
13269
13488
|
export {
|
|
13270
|
-
|
|
13489
|
+
B as Core,
|
|
13271
13490
|
te as Enhance,
|
|
13272
13491
|
u as Env,
|
|
13273
13492
|
F as Form,
|