haori 0.45.1 → 0.45.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +4 -2
- package/README.md +4 -2
- package/dist/haori.cjs.js +15 -15
- package/dist/haori.es.js +496 -357
- package/dist/haori.iife.js +15 -15
- package/dist/index.d.ts +12 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -29,7 +29,7 @@ const le = class le {
|
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
le.devMode = !1;
|
|
32
|
-
let
|
|
32
|
+
let j = le;
|
|
33
33
|
const Le = "embedded";
|
|
34
34
|
function Je(m) {
|
|
35
35
|
return m === "embedded" || m === "demo";
|
|
@@ -95,15 +95,16 @@ const J = class J {
|
|
|
95
95
|
);
|
|
96
96
|
}
|
|
97
97
|
if (e instanceof HTMLScriptElement && e.hasAttribute(`${J._prefix}dev`)) {
|
|
98
|
-
|
|
98
|
+
const r = (e.getAttribute(`${J._prefix}dev`) ?? "").trim().toLowerCase();
|
|
99
|
+
j.set(r !== "false" && r !== "off" && r !== "0");
|
|
99
100
|
return;
|
|
100
101
|
}
|
|
101
102
|
const t = window.location.hostname;
|
|
102
103
|
if (t === "localhost" || t.endsWith(".localhost") || t === "127.0.0.1" || t === "::1" || t.endsWith(".local")) {
|
|
103
|
-
|
|
104
|
+
j.set(!0);
|
|
104
105
|
return;
|
|
105
106
|
}
|
|
106
|
-
|
|
107
|
+
j.set(!1);
|
|
107
108
|
} catch {
|
|
108
109
|
}
|
|
109
110
|
}
|
|
@@ -127,7 +128,7 @@ class y {
|
|
|
127
128
|
* @param args 追加の引数
|
|
128
129
|
*/
|
|
129
130
|
static info(e, ...t) {
|
|
130
|
-
|
|
131
|
+
j.isEnabled() && console.log && console.log(e, ...t);
|
|
131
132
|
}
|
|
132
133
|
/**
|
|
133
134
|
* 開発モードでのみコンソールに警告を出力します。
|
|
@@ -136,7 +137,7 @@ class y {
|
|
|
136
137
|
* @param args 追加の引数
|
|
137
138
|
*/
|
|
138
139
|
static warn(e, ...t) {
|
|
139
|
-
|
|
140
|
+
j.isEnabled() && console.warn && console.warn(e, ...t);
|
|
140
141
|
}
|
|
141
142
|
/**
|
|
142
143
|
* モードに関係なくコンソールにエラーを出力します。
|
|
@@ -352,7 +353,7 @@ const yt = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, je = "new:
|
|
|
352
353
|
if (t = t[r], t === void 0)
|
|
353
354
|
break;
|
|
354
355
|
}
|
|
355
|
-
return typeof t != "function" ? (
|
|
356
|
+
return typeof t != "function" ? (j.isEnabled() && !$.warnedMissingGlobals.has(e) && ($.warnedMissingGlobals.add(e), y.warn(
|
|
356
357
|
"[Haori]",
|
|
357
358
|
`${c.prefix}enhance-new could not resolve the global reference (load the library before Haori runs): ${e}`
|
|
358
359
|
)), null) : t;
|
|
@@ -364,7 +365,7 @@ const yt = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, je = "new:
|
|
|
364
365
|
* @returns 戻り値はありません。
|
|
365
366
|
*/
|
|
366
367
|
static warnUnknownName(e) {
|
|
367
|
-
!
|
|
368
|
+
!j.isEnabled() || $.warnedUnknownNames.has(e) || ($.warnedUnknownNames.add(e), y.warn(
|
|
368
369
|
"[Haori]",
|
|
369
370
|
`Enhancer "${e}" is not registered yet; the declaration is kept pending and applied when it is registered (Haori.enhancers.register('${e}', {init(el) {...}})).`
|
|
370
371
|
));
|
|
@@ -940,7 +941,7 @@ const T = class T {
|
|
|
940
941
|
* @returns 戻り値はありません。
|
|
941
942
|
*/
|
|
942
943
|
static reportUnusableBindingKeys(e) {
|
|
943
|
-
if (e.length === 0 || !
|
|
944
|
+
if (e.length === 0 || !j.isEnabled())
|
|
944
945
|
return;
|
|
945
946
|
const t = e.filter(
|
|
946
947
|
(r) => !this.loggedUnusableBindingKeys.has(r)
|
|
@@ -1238,7 +1239,7 @@ let ${e.join(", ")};`;
|
|
|
1238
1239
|
);
|
|
1239
1240
|
return;
|
|
1240
1241
|
}
|
|
1241
|
-
|
|
1242
|
+
j.isEnabled() && (e.forEach((r) => {
|
|
1242
1243
|
this.pendingUnresolvedIdentifiers.add(r);
|
|
1243
1244
|
}), this.scheduleUnresolvedIdentifierReport());
|
|
1244
1245
|
}
|
|
@@ -1295,7 +1296,7 @@ let ${e.join(", ")};`;
|
|
|
1295
1296
|
* @return 戻り値はありません。
|
|
1296
1297
|
*/
|
|
1297
1298
|
static recordRowScopeIdentifiers(e) {
|
|
1298
|
-
if (
|
|
1299
|
+
if (j.isEnabled())
|
|
1299
1300
|
for (const t of e)
|
|
1300
1301
|
typeof t == "string" && t !== "" && this.rowScopeIdentifiers.add(t);
|
|
1301
1302
|
}
|
|
@@ -1465,14 +1466,14 @@ ${t}`;
|
|
|
1465
1466
|
s && (this.BUILTIN_DATA_REFERENCE_PATTERN.test(n) ? a[this.BUILTIN_NAMESPACE] = {
|
|
1466
1467
|
...this.BUILTIN_HELPERS,
|
|
1467
1468
|
[this.BUILTIN_DATA_PROPERTY]: { ...a }
|
|
1468
|
-
} : a[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(a),
|
|
1469
|
+
} : a[this.BUILTIN_NAMESPACE] = this.BUILTIN_HELPERS), this.pruneResolvedIdentifiers(a), j.isEnabled() && this.recordSuppliedIdentifiers(a);
|
|
1469
1470
|
const o = this.canAttemptMissingIdentifierRecovery(e), l = this.extractFreeIdentifiers(e).filter(
|
|
1470
1471
|
(d) => !(d in a) && // 禁止グローバルは buildAssignments が `const` で遮蔽するため対象外
|
|
1471
1472
|
// (二重宣言は構文エラーになる)。
|
|
1472
1473
|
!this.FORBIDDEN_NAMES.includes(d) && // 標準組み込み(`Math` など)は式から参照できる仕様のため遮蔽しない。
|
|
1473
1474
|
!this.ALLOWED_GLOBAL_IDENTIFIERS.has(d)
|
|
1474
1475
|
);
|
|
1475
|
-
if (
|
|
1476
|
+
if (j.isEnabled()) {
|
|
1476
1477
|
const d = this.extractBoundIdentifiers(e);
|
|
1477
1478
|
this.recordScopeMissingIdentifiers(
|
|
1478
1479
|
d.size === 0 ? l : l.filter((p) => !d.has(p)),
|
|
@@ -2375,12 +2376,36 @@ T.MAX_IDENTIFIER_RECOVERY_COUNT = 8, T.BUILTIN_NAMESPACE = "haori", T.BUILTIN_HE
|
|
|
2375
2376
|
"..."
|
|
2376
2377
|
]), T.strictComparisonSplits = /* @__PURE__ */ new Map();
|
|
2377
2378
|
let Q = T;
|
|
2378
|
-
const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fieldset",
|
|
2379
|
+
const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fieldset", U = class U {
|
|
2379
2380
|
/**
|
|
2380
2381
|
* 集計状態を初期化します。
|
|
2381
2382
|
*/
|
|
2382
2383
|
static reset() {
|
|
2383
|
-
|
|
2384
|
+
U.ELEMENT_STORES.clear(), U.ensureGlobalAccess();
|
|
2385
|
+
}
|
|
2386
|
+
/**
|
|
2387
|
+
* 集計を開始します。
|
|
2388
|
+
*
|
|
2389
|
+
* @returns 戻り値はありません。
|
|
2390
|
+
*/
|
|
2391
|
+
static start() {
|
|
2392
|
+
U.collecting = !0;
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* 集計を停止します。
|
|
2396
|
+
*
|
|
2397
|
+
* @returns 戻り値はありません。
|
|
2398
|
+
*/
|
|
2399
|
+
static stop() {
|
|
2400
|
+
U.collecting = !1;
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* 集計中かどうかを返します。
|
|
2404
|
+
*
|
|
2405
|
+
* @returns 集計中なら true
|
|
2406
|
+
*/
|
|
2407
|
+
static isCollecting() {
|
|
2408
|
+
return U.collecting && j.isEnabled();
|
|
2384
2409
|
}
|
|
2385
2410
|
/**
|
|
2386
2411
|
* 現在の集計結果スナップショットを返します。
|
|
@@ -2388,7 +2413,7 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2388
2413
|
* @returns エレメントごとの集計結果
|
|
2389
2414
|
*/
|
|
2390
2415
|
static snapshot() {
|
|
2391
|
-
return
|
|
2416
|
+
return U.ensureGlobalAccess(), [...U.ELEMENT_STORES.entries()].map(([e, t]) => ({
|
|
2392
2417
|
elementId: e,
|
|
2393
2418
|
tagName: t.tagName,
|
|
2394
2419
|
attributes: [...t.attributes.entries()].map(([r, i]) => ({
|
|
@@ -2397,7 +2422,7 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2397
2422
|
calls: i.calls,
|
|
2398
2423
|
totalDurationMs: i.totalDurationMs,
|
|
2399
2424
|
maxDurationMs: i.maxDurationMs,
|
|
2400
|
-
placeholders:
|
|
2425
|
+
placeholders: U.sortPlaceholders(
|
|
2401
2426
|
i.placeholders
|
|
2402
2427
|
)
|
|
2403
2428
|
})).sort((r, i) => i.calls - r.calls),
|
|
@@ -2407,7 +2432,7 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2407
2432
|
calls: i.calls,
|
|
2408
2433
|
totalDurationMs: i.totalDurationMs,
|
|
2409
2434
|
maxDurationMs: i.maxDurationMs,
|
|
2410
|
-
placeholders:
|
|
2435
|
+
placeholders: U.sortPlaceholders(
|
|
2411
2436
|
i.placeholders
|
|
2412
2437
|
)
|
|
2413
2438
|
})).sort((r, i) => i.calls - r.calls)
|
|
@@ -2423,31 +2448,30 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2423
2448
|
* @param expressions 今回評価した式一覧
|
|
2424
2449
|
*/
|
|
2425
2450
|
static record(e, t, r) {
|
|
2426
|
-
if (!
|
|
2451
|
+
if (!j.isEnabled() || !e || t.length === 0 || (U.ensureGlobalAccess(), !U.isCollecting()))
|
|
2427
2452
|
return;
|
|
2428
|
-
|
|
2429
|
-
const i = j.getOrCreateElementStore(
|
|
2453
|
+
const i = U.getOrCreateElementStore(
|
|
2430
2454
|
e.element
|
|
2431
2455
|
);
|
|
2432
2456
|
if (e.kind === "attribute") {
|
|
2433
|
-
const s =
|
|
2457
|
+
const s = U.getOrCreateCounter(
|
|
2434
2458
|
i.attributes,
|
|
2435
2459
|
e.rawName,
|
|
2436
2460
|
e.template
|
|
2437
2461
|
);
|
|
2438
|
-
|
|
2462
|
+
U.updateCounter(
|
|
2439
2463
|
s,
|
|
2440
2464
|
t,
|
|
2441
2465
|
r
|
|
2442
2466
|
);
|
|
2443
2467
|
return;
|
|
2444
2468
|
}
|
|
2445
|
-
const n =
|
|
2469
|
+
const n = U.getOrCreateCounter(
|
|
2446
2470
|
i.texts,
|
|
2447
2471
|
String(e.childIndex),
|
|
2448
2472
|
e.template
|
|
2449
2473
|
);
|
|
2450
|
-
|
|
2474
|
+
U.updateCounter(
|
|
2451
2475
|
n,
|
|
2452
2476
|
t,
|
|
2453
2477
|
r
|
|
@@ -2457,12 +2481,14 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2457
2481
|
* globalThis から dev-only の取得窓口を参照できるようにします。
|
|
2458
2482
|
*/
|
|
2459
2483
|
static ensureGlobalAccess() {
|
|
2460
|
-
if (!
|
|
2484
|
+
if (!j.isEnabled())
|
|
2461
2485
|
return;
|
|
2462
2486
|
const e = globalThis;
|
|
2463
|
-
e[
|
|
2464
|
-
|
|
2465
|
-
|
|
2487
|
+
e[U.GLOBAL_KEY] === void 0 && (e[U.GLOBAL_KEY] = {
|
|
2488
|
+
start: () => U.start(),
|
|
2489
|
+
stop: () => U.stop(),
|
|
2490
|
+
reset: () => U.reset(),
|
|
2491
|
+
snapshot: () => U.snapshot()
|
|
2466
2492
|
});
|
|
2467
2493
|
}
|
|
2468
2494
|
/**
|
|
@@ -2472,7 +2498,7 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2472
2498
|
* @returns 集計ストア
|
|
2473
2499
|
*/
|
|
2474
2500
|
static getOrCreateElementStore(e) {
|
|
2475
|
-
const t =
|
|
2501
|
+
const t = U.createElementId(e), r = U.ELEMENT_STORES.get(t);
|
|
2476
2502
|
if (r)
|
|
2477
2503
|
return r;
|
|
2478
2504
|
const i = {
|
|
@@ -2480,7 +2506,7 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2480
2506
|
attributes: /* @__PURE__ */ new Map(),
|
|
2481
2507
|
texts: /* @__PURE__ */ new Map()
|
|
2482
2508
|
};
|
|
2483
|
-
return
|
|
2509
|
+
return U.ELEMENT_STORES.set(t, i), i;
|
|
2484
2510
|
}
|
|
2485
2511
|
/**
|
|
2486
2512
|
* カウンタを取得または初期化します。
|
|
@@ -2530,7 +2556,7 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2530
2556
|
*/
|
|
2531
2557
|
static updateCounter(e, t, r) {
|
|
2532
2558
|
e.calls += 1, e.totalDurationMs += r, e.maxDurationMs = Math.max(e.maxDurationMs, r), t.forEach((i) => {
|
|
2533
|
-
const n =
|
|
2559
|
+
const n = U.getOrCreatePlaceholder(
|
|
2534
2560
|
e.placeholders,
|
|
2535
2561
|
i.expression
|
|
2536
2562
|
);
|
|
@@ -2569,10 +2595,12 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2569
2595
|
* @returns 結果と所要時間
|
|
2570
2596
|
*/
|
|
2571
2597
|
static measure(e) {
|
|
2572
|
-
|
|
2598
|
+
if (!U.isCollecting())
|
|
2599
|
+
return { value: e(), durationMs: 0 };
|
|
2600
|
+
const t = U.now();
|
|
2573
2601
|
return {
|
|
2574
2602
|
value: e(),
|
|
2575
|
-
durationMs:
|
|
2603
|
+
durationMs: U.now() - t
|
|
2576
2604
|
};
|
|
2577
2605
|
}
|
|
2578
2606
|
/**
|
|
@@ -2599,8 +2627,8 @@ const Ae = "data-haori-if-disabled", Ge = "input, select, textarea, button, fiel
|
|
|
2599
2627
|
return t.join(" > ");
|
|
2600
2628
|
}
|
|
2601
2629
|
};
|
|
2602
|
-
|
|
2603
|
-
let Ne =
|
|
2630
|
+
U.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", U.ELEMENT_STORES = /* @__PURE__ */ new Map(), U.collecting = !1;
|
|
2631
|
+
let Ne = U;
|
|
2604
2632
|
const ce = class ce {
|
|
2605
2633
|
/**
|
|
2606
2634
|
* フラグメントのコンストラクタ。
|
|
@@ -2733,8 +2761,8 @@ const ce = class ce {
|
|
|
2733
2761
|
}
|
|
2734
2762
|
};
|
|
2735
2763
|
ce.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
2736
|
-
let
|
|
2737
|
-
const R = class R extends
|
|
2764
|
+
let C = ce;
|
|
2765
|
+
const R = class R extends C {
|
|
2738
2766
|
/**
|
|
2739
2767
|
* エレメントフラグメントのコンストラクタ。
|
|
2740
2768
|
* アトリビュートや子フラグメントの作成も行います。
|
|
@@ -2749,7 +2777,7 @@ const R = class R extends k {
|
|
|
2749
2777
|
this.attributeMap.set(t, i);
|
|
2750
2778
|
}
|
|
2751
2779
|
}), e.childNodes.forEach((t) => {
|
|
2752
|
-
const r =
|
|
2780
|
+
const r = C.get(t);
|
|
2753
2781
|
r.setParent(this), this.children.push(r);
|
|
2754
2782
|
});
|
|
2755
2783
|
}
|
|
@@ -3622,7 +3650,7 @@ const R = class R extends k {
|
|
|
3622
3650
|
* @return 戻り値はありません。
|
|
3623
3651
|
*/
|
|
3624
3652
|
static warnUnresolvedAttribute(e, t, r, i) {
|
|
3625
|
-
if (!
|
|
3653
|
+
if (!j.isEnabled())
|
|
3626
3654
|
return;
|
|
3627
3655
|
const n = `${e} ${r}`;
|
|
3628
3656
|
R.loggedUnresolvedAttributes.has(n) || (R.loggedUnresolvedAttributes.add(n), y.warn(
|
|
@@ -3669,7 +3697,7 @@ const R = class R extends k {
|
|
|
3669
3697
|
const t = this.getTarget().closest("select");
|
|
3670
3698
|
if (!t)
|
|
3671
3699
|
return !1;
|
|
3672
|
-
const r =
|
|
3700
|
+
const r = C.get(t);
|
|
3673
3701
|
return r instanceof R ? r.hasPendingUserEdit() : !1;
|
|
3674
3702
|
}
|
|
3675
3703
|
/**
|
|
@@ -3793,7 +3821,7 @@ const R = class R extends k {
|
|
|
3793
3821
|
* @returns 戻り値はありません。
|
|
3794
3822
|
*/
|
|
3795
3823
|
static warnValueTypeDeclaration(e, t, r) {
|
|
3796
|
-
if (!
|
|
3824
|
+
if (!j.isEnabled())
|
|
3797
3825
|
return;
|
|
3798
3826
|
const i = e instanceof HTMLInputElement ? `[type=${e.type}]` : "", n = `${e.tagName}${i} ${t} ${r}`;
|
|
3799
3827
|
R.loggedValueTypeDeclarations.has(n) || (R.loggedValueTypeDeclarations.add(n), y.warn(
|
|
@@ -3934,7 +3962,7 @@ const R = class R extends k {
|
|
|
3934
3962
|
const t = this.getTarget().closest("select");
|
|
3935
3963
|
if (!t)
|
|
3936
3964
|
return;
|
|
3937
|
-
const r =
|
|
3965
|
+
const r = C.get(t);
|
|
3938
3966
|
r instanceof R && r.syncValue();
|
|
3939
3967
|
}
|
|
3940
3968
|
/**
|
|
@@ -4066,13 +4094,13 @@ const R = class R extends k {
|
|
|
4066
4094
|
element: l,
|
|
4067
4095
|
rawName: e,
|
|
4068
4096
|
template: r
|
|
4069
|
-
}), d = o.isEvaluate || o.isRawEvaluate, p = e === t && R.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), g = o.isSingleExpression(), A = se.joinEvaluateResults(u.results), v = u.results.length === 1 ? u.results[0] : A, D = t === "value" && R.resolveDeclaredValueType(l) === "boolean",
|
|
4070
|
-
if (
|
|
4097
|
+
}), d = o.isEvaluate || o.isRawEvaluate, p = e === t && R.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), g = o.isSingleExpression(), A = se.joinEvaluateResults(u.results), v = u.results.length === 1 ? u.results[0] : A, D = t === "value" && R.resolveDeclaredValueType(l) === "boolean", k = v === !1 && !D, H = !o.isForceEvaluation() && (t !== e ? u.hasUnresolvedReference || v === null || v === void 0 || k : p ? u.hasUnresolvedReference || v === null || v === void 0 || v === !1 : g ? u.hasUnresolvedReference || v === null || v === void 0 || k : d && A === "");
|
|
4098
|
+
if (H && u.hasUnresolvedReference && R.warnUnresolvedAttribute(
|
|
4071
4099
|
e,
|
|
4072
4100
|
t,
|
|
4073
4101
|
r,
|
|
4074
4102
|
l
|
|
4075
|
-
),
|
|
4103
|
+
), j.isEnabled() && v === !1 && g) {
|
|
4076
4104
|
const de = o.getSingleExpression(), Ee = de === null ? null : Q.diagnoseStrictComparison(
|
|
4077
4105
|
de,
|
|
4078
4106
|
this.getBindingData()
|
|
@@ -4084,17 +4112,17 @@ const R = class R extends k {
|
|
|
4084
4112
|
l
|
|
4085
4113
|
);
|
|
4086
4114
|
}
|
|
4087
|
-
const E = o.isForceEvaluation() ? r : g ? v : A, S = i && o.isEvaluate && t === "value" && R.isValuePropertyTarget(l), M = l.getRootNode(),
|
|
4115
|
+
const E = o.isForceEvaluation() ? r : g ? v : A, S = i && o.isEvaluate && t === "value" && R.isValuePropertyTarget(l), M = l.getRootNode(), V = S && R.isUserEditableValue(l) && (l === M.activeElement || this.hasPendingUserEdit()), P = H || E === null || E === !1 && !D ? null : String(E), _ = e !== t && l.getAttribute(e) !== r, x = P === null ? l.hasAttribute(t) : l.getAttribute(t) !== P, q = P === null ? "" : P, X = S && !V && l.value !== q, Y = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), te = t === "selected" && l instanceof HTMLOptionElement, be = M.activeElement, ue = be !== null && (Y && l === be || te && l.closest("select") === be) || (Y || te) && this.hasPendingCheckableUserEdit(te), we = P !== null, $e = Y && !ue && l.checked !== we, Re = te && !ue && l.selected !== we;
|
|
4088
4116
|
if (!_ && !x && !X && !$e && !Re)
|
|
4089
|
-
return S && !
|
|
4117
|
+
return S && !V && (this.value = this.normalizeValueForElement(
|
|
4090
4118
|
l,
|
|
4091
|
-
|
|
4119
|
+
q
|
|
4092
4120
|
), this.clearUnappliedValueWrite()), (Y || te) && !ue && this.syncCheckableValueFromDom(te), Promise.resolve();
|
|
4093
4121
|
const We = K.enqueue(() => {
|
|
4094
|
-
_ && l.setAttribute(e, r), P === null ? l.removeAttribute(t) : x && (l.setAttribute(t, P), t === `${c.prefix}bind` && this.recordSelfWrittenBind(P)), S && !
|
|
4122
|
+
_ && l.setAttribute(e, r), P === null ? l.removeAttribute(t) : x && (l.setAttribute(t, P), t === `${c.prefix}bind` && this.recordSelfWrittenBind(P)), S && !V && (this.value = this.normalizeValueForElement(
|
|
4095
4123
|
l,
|
|
4096
|
-
|
|
4097
|
-
), X && (l.value =
|
|
4124
|
+
q
|
|
4125
|
+
), X && (l.value = q), this.recordValueWriteResult(l.value === q)), $e && (l.checked = we), Re && (l.selected = we), ($e || Re) && this.syncCheckableValueFromDom(Re);
|
|
4098
4126
|
}).finally(() => {
|
|
4099
4127
|
this.releaseSelfWritingAttributes(s);
|
|
4100
4128
|
});
|
|
@@ -4199,7 +4227,7 @@ const R = class R extends k {
|
|
|
4199
4227
|
const i = t ? r.nextSibling : r;
|
|
4200
4228
|
let n = t ? r.nextSibling : r;
|
|
4201
4229
|
for (; n !== null; ) {
|
|
4202
|
-
const s =
|
|
4230
|
+
const s = C.get(n);
|
|
4203
4231
|
if (s !== null) {
|
|
4204
4232
|
const a = this.children.indexOf(s);
|
|
4205
4233
|
if (a !== -1)
|
|
@@ -4461,7 +4489,7 @@ R.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, R.VALUE
|
|
|
4461
4489
|
"week"
|
|
4462
4490
|
], R.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), R.sequenceCounter = 0, R.bindingWorkActiveCount = 0, R.pendingMutationFlusher = null, R.loggedUnresolvedAttributes = /* @__PURE__ */ new Set(), R.loggedTypeMismatchedComparisons = /* @__PURE__ */ new Set();
|
|
4463
4491
|
let I = R;
|
|
4464
|
-
class ee extends
|
|
4492
|
+
class ee extends C {
|
|
4465
4493
|
/**
|
|
4466
4494
|
* テキストフラグメントのコンストラクタ。
|
|
4467
4495
|
* 対象テキストノードの内容を初期化します。
|
|
@@ -4547,7 +4575,7 @@ class ee extends k {
|
|
|
4547
4575
|
});
|
|
4548
4576
|
}
|
|
4549
4577
|
}
|
|
4550
|
-
class Ve extends
|
|
4578
|
+
class Ve extends C {
|
|
4551
4579
|
/**
|
|
4552
4580
|
* コメントフラグメントのコンストラクタ。
|
|
4553
4581
|
* 対象コメントノードの内容を初期化します。
|
|
@@ -4588,7 +4616,7 @@ class Ve extends k {
|
|
|
4588
4616
|
}));
|
|
4589
4617
|
}
|
|
4590
4618
|
}
|
|
4591
|
-
const
|
|
4619
|
+
const ke = class ke {
|
|
4592
4620
|
/**
|
|
4593
4621
|
* コンストラクタ。
|
|
4594
4622
|
*
|
|
@@ -4596,7 +4624,7 @@ const Ce = class Ce {
|
|
|
4596
4624
|
*/
|
|
4597
4625
|
constructor(e) {
|
|
4598
4626
|
this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = e;
|
|
4599
|
-
const t = [...e.matchAll(
|
|
4627
|
+
const t = [...e.matchAll(ke.PLACEHOLDER_REGEX)];
|
|
4600
4628
|
let r = 0, i = !1, n = !1;
|
|
4601
4629
|
for (const s of t) {
|
|
4602
4630
|
s.index > r && this.contents.push({
|
|
@@ -4727,8 +4755,8 @@ const Ce = class Ce {
|
|
|
4727
4755
|
), { results: n, hasUnresolvedReference: o };
|
|
4728
4756
|
}
|
|
4729
4757
|
};
|
|
4730
|
-
|
|
4731
|
-
let se =
|
|
4758
|
+
ke.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
4759
|
+
let se = ke;
|
|
4732
4760
|
const Z = class Z extends se {
|
|
4733
4761
|
/**
|
|
4734
4762
|
* コンストラクタ。
|
|
@@ -5385,7 +5413,7 @@ const f = class f {
|
|
|
5385
5413
|
return f.isDeclarationResolved(e, "value");
|
|
5386
5414
|
if (t instanceof HTMLSelectElement) {
|
|
5387
5415
|
for (const r of Array.from(t.options)) {
|
|
5388
|
-
const i =
|
|
5416
|
+
const i = C.get(r);
|
|
5389
5417
|
if (i instanceof I && f.hasDeclarativeBinding(i, "selected") && !f.isDeclarationResolved(i, "selected"))
|
|
5390
5418
|
return !1;
|
|
5391
5419
|
}
|
|
@@ -5515,7 +5543,7 @@ const f = class f {
|
|
|
5515
5543
|
*/
|
|
5516
5544
|
static hasDeclarativeSelectedOption(e) {
|
|
5517
5545
|
for (const t of Array.from(e.options)) {
|
|
5518
|
-
const r =
|
|
5546
|
+
const r = C.get(t);
|
|
5519
5547
|
if (r instanceof I && f.hasDeclarativeBinding(r, "selected"))
|
|
5520
5548
|
return !0;
|
|
5521
5549
|
}
|
|
@@ -6079,7 +6107,7 @@ const f = class f {
|
|
|
6079
6107
|
* @returns 戻り値はありません。
|
|
6080
6108
|
*/
|
|
6081
6109
|
static warnUnvalidatedCustomValidity(e, t) {
|
|
6082
|
-
if (!
|
|
6110
|
+
if (!j.isEnabled() || !e)
|
|
6083
6111
|
return;
|
|
6084
6112
|
const r = `${c.prefix}validity`;
|
|
6085
6113
|
(e.hasAttribute(r) || e.getTarget().querySelector(`[${r}]`) !== null) && y.warn(
|
|
@@ -6142,7 +6170,7 @@ const f = class f {
|
|
|
6142
6170
|
* @param reason 退いた理由
|
|
6143
6171
|
*/
|
|
6144
6172
|
static warnPositionalRowFallback(e) {
|
|
6145
|
-
!
|
|
6173
|
+
!j.isEnabled() || f.warnedPositionalRowFallbacks.has(e) || (f.warnedPositionalRowFallbacks.add(e), y.warn(
|
|
6146
6174
|
"[Haori]",
|
|
6147
6175
|
`${c.prefix}form-list の行を出現順で対応付けます(${e})。配列と画面の行数・並びが一致していない場合、行の値を取り違えます。`
|
|
6148
6176
|
));
|
|
@@ -6283,7 +6311,7 @@ const f = class f {
|
|
|
6283
6311
|
static createRowKeyIndexes(e, t) {
|
|
6284
6312
|
const r = /* @__PURE__ */ new Map();
|
|
6285
6313
|
return e.forEach((i, n) => {
|
|
6286
|
-
const s =
|
|
6314
|
+
const s = B.createListKey(
|
|
6287
6315
|
i,
|
|
6288
6316
|
t,
|
|
6289
6317
|
n
|
|
@@ -6391,7 +6419,7 @@ const f = class f {
|
|
|
6391
6419
|
static collectArgForms(e) {
|
|
6392
6420
|
const t = `${c.prefix}form-arg`, r = e.getTarget().querySelectorAll(`form[${t}]`), i = [];
|
|
6393
6421
|
return r.forEach((n) => {
|
|
6394
|
-
const s =
|
|
6422
|
+
const s = C.get(n);
|
|
6395
6423
|
if (!(s instanceof I))
|
|
6396
6424
|
return;
|
|
6397
6425
|
const a = s.getAttribute(t);
|
|
@@ -6425,7 +6453,7 @@ const f = class f {
|
|
|
6425
6453
|
const a = e.getRawBindingData();
|
|
6426
6454
|
if (a && Object.prototype.hasOwnProperty.call(a, t)) {
|
|
6427
6455
|
const o = { ...a };
|
|
6428
|
-
return delete o[t],
|
|
6456
|
+
return delete o[t], B.setBindingData(n, o, {
|
|
6429
6457
|
kind: i?.kind ?? "supply",
|
|
6430
6458
|
sequence: i?.sequence ?? I.nextSequence()
|
|
6431
6459
|
});
|
|
@@ -6471,7 +6499,7 @@ const f = class f {
|
|
|
6471
6499
|
for (const i of t) {
|
|
6472
6500
|
if (f.INITIAL_RESTORED_FORMS.has(i))
|
|
6473
6501
|
continue;
|
|
6474
|
-
const n =
|
|
6502
|
+
const n = C.get(i);
|
|
6475
6503
|
if (!(n instanceof I))
|
|
6476
6504
|
continue;
|
|
6477
6505
|
const s = n.getRawBindingData(), a = n.getAttribute(`${c.prefix}form-arg`), o = a ? String(a) : null, l = o !== null && !(s && Object.prototype.hasOwnProperty.call(s, o)) ? f.resolveAncestorArgOwner(n, o) : null;
|
|
@@ -6701,11 +6729,11 @@ const f = class f {
|
|
|
6701
6729
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
6702
6730
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
6703
6731
|
!f.isGroupedCheckable(e) && !f.isMultipleSelect(e)) {
|
|
6704
|
-
const
|
|
6705
|
-
s.set(
|
|
6732
|
+
const k = String(l), H = s.get(k) ?? 0;
|
|
6733
|
+
s.set(k, H + 1), o.push(
|
|
6706
6734
|
f.applyFragmentValue(
|
|
6707
6735
|
e,
|
|
6708
|
-
D[
|
|
6736
|
+
D[H] ?? null,
|
|
6709
6737
|
i,
|
|
6710
6738
|
a
|
|
6711
6739
|
)
|
|
@@ -6745,12 +6773,12 @@ const f = class f {
|
|
|
6745
6773
|
g,
|
|
6746
6774
|
v == null ? null : String(v)
|
|
6747
6775
|
) : null;
|
|
6748
|
-
for (let
|
|
6749
|
-
const
|
|
6776
|
+
for (let k = 0; k < A.length; k++) {
|
|
6777
|
+
const H = A[k], E = D ? D[k] : g.length > k ? g[k] : null;
|
|
6750
6778
|
o.push(
|
|
6751
6779
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
6752
6780
|
f.setPartValues(
|
|
6753
|
-
|
|
6781
|
+
H,
|
|
6754
6782
|
f.asPlainRecord(E) ?? {},
|
|
6755
6783
|
r,
|
|
6756
6784
|
i,
|
|
@@ -6796,7 +6824,7 @@ const f = class f {
|
|
|
6796
6824
|
const r = f.collectBindingTargetForms(e);
|
|
6797
6825
|
if (r.length > 0 && r.every((n) => n.isSupplyStale(t)))
|
|
6798
6826
|
return;
|
|
6799
|
-
f.markResetSubtree(e, t),
|
|
6827
|
+
f.markResetSubtree(e, t), B.clearUserEditMarks(e, t), f.clearValues(e), await Promise.all([
|
|
6800
6828
|
f.clearMessages(e),
|
|
6801
6829
|
f.clearEachClones(e)
|
|
6802
6830
|
]), await K.enqueue(() => {
|
|
@@ -6809,11 +6837,11 @@ const f = class f {
|
|
|
6809
6837
|
const i = r;
|
|
6810
6838
|
for (const n of i) {
|
|
6811
6839
|
const s = f.getInitialBindingData(n);
|
|
6812
|
-
s === null && n.getRawBindingData() === null || await
|
|
6840
|
+
s === null && n.getRawBindingData() === null || await B.setBindingData(n.getTarget(), s ?? {}, {
|
|
6813
6841
|
sequence: t
|
|
6814
6842
|
});
|
|
6815
6843
|
}
|
|
6816
|
-
f.syncValuesFromDom(e), await
|
|
6844
|
+
f.syncValuesFromDom(e), await B.evaluateAll(e);
|
|
6817
6845
|
for (const n of i)
|
|
6818
6846
|
f.getInitialBindingData(n) !== null || n.getRawBindingData() !== null || await f.restoreAncestorArgValues(n, {
|
|
6819
6847
|
sequence: t,
|
|
@@ -6833,7 +6861,7 @@ const f = class f {
|
|
|
6833
6861
|
));
|
|
6834
6862
|
} else
|
|
6835
6863
|
l = f.mergeCollectedValues(l, a);
|
|
6836
|
-
await
|
|
6864
|
+
await B.setBindingData(n.getTarget(), l, {
|
|
6837
6865
|
sequence: t
|
|
6838
6866
|
});
|
|
6839
6867
|
}
|
|
@@ -6846,7 +6874,7 @@ const f = class f {
|
|
|
6846
6874
|
*/
|
|
6847
6875
|
static getInitialBindingData(e) {
|
|
6848
6876
|
const t = e.getInitialBindAttribute();
|
|
6849
|
-
return t === null ? null :
|
|
6877
|
+
return t === null ? null : B.parseDataBind(t);
|
|
6850
6878
|
}
|
|
6851
6879
|
/**
|
|
6852
6880
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -6873,7 +6901,7 @@ const f = class f {
|
|
|
6873
6901
|
t instanceof HTMLFormElement ? r.push(t) : r.push(...Array.from(t.querySelectorAll("form")));
|
|
6874
6902
|
const i = [];
|
|
6875
6903
|
for (const n of r) {
|
|
6876
|
-
const s =
|
|
6904
|
+
const s = C.get(n);
|
|
6877
6905
|
s instanceof I && i.push(s);
|
|
6878
6906
|
}
|
|
6879
6907
|
return i;
|
|
@@ -7110,7 +7138,7 @@ f.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), f.LAST_ANCESTOR_ARG_VA
|
|
|
7110
7138
|
"prototype"
|
|
7111
7139
|
]), f.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), f.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), f.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), f.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), f.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
7112
7140
|
let F = f;
|
|
7113
|
-
class
|
|
7141
|
+
class O {
|
|
7114
7142
|
/**
|
|
7115
7143
|
* カスタムイベントを発火します。
|
|
7116
7144
|
*
|
|
@@ -7134,7 +7162,7 @@ class B {
|
|
|
7134
7162
|
* @param version ライブラリバージョン
|
|
7135
7163
|
*/
|
|
7136
7164
|
static ready(e) {
|
|
7137
|
-
|
|
7165
|
+
O.dispatch(document, "ready", { version: e });
|
|
7138
7166
|
}
|
|
7139
7167
|
/**
|
|
7140
7168
|
* importstartイベントを発火します。
|
|
@@ -7143,7 +7171,7 @@ class B {
|
|
|
7143
7171
|
* @param url インポート対象URL
|
|
7144
7172
|
*/
|
|
7145
7173
|
static importStart(e, t) {
|
|
7146
|
-
|
|
7174
|
+
O.dispatch(e, "importstart", {
|
|
7147
7175
|
url: t,
|
|
7148
7176
|
startedAt: performance.now()
|
|
7149
7177
|
});
|
|
@@ -7157,7 +7185,7 @@ class B {
|
|
|
7157
7185
|
* @param startedAt 開始時刻
|
|
7158
7186
|
*/
|
|
7159
7187
|
static importEnd(e, t, r, i) {
|
|
7160
|
-
|
|
7188
|
+
O.dispatch(e, "importend", {
|
|
7161
7189
|
url: t,
|
|
7162
7190
|
bytes: r,
|
|
7163
7191
|
durationMs: performance.now() - i
|
|
@@ -7171,7 +7199,7 @@ class B {
|
|
|
7171
7199
|
* @param error エラー内容
|
|
7172
7200
|
*/
|
|
7173
7201
|
static importError(e, t, r) {
|
|
7174
|
-
|
|
7202
|
+
O.dispatch(e, "importerror", { url: t, error: r });
|
|
7175
7203
|
}
|
|
7176
7204
|
/**
|
|
7177
7205
|
* bindchangeイベントを発火します。
|
|
@@ -7187,7 +7215,7 @@ class B {
|
|
|
7187
7215
|
const u = t?.[l], d = r[l];
|
|
7188
7216
|
u !== d && n.push(l);
|
|
7189
7217
|
}
|
|
7190
|
-
|
|
7218
|
+
O.dispatch(e, "bindchange", {
|
|
7191
7219
|
previous: t || {},
|
|
7192
7220
|
next: r,
|
|
7193
7221
|
changedKeys: n,
|
|
@@ -7206,7 +7234,7 @@ class B {
|
|
|
7206
7234
|
* @param reason 変更理由
|
|
7207
7235
|
*/
|
|
7208
7236
|
static bindComplete(e, t = null, r = "other") {
|
|
7209
|
-
|
|
7237
|
+
O.dispatch(e, "bindcomplete", { bindArg: t, reason: r });
|
|
7210
7238
|
}
|
|
7211
7239
|
/**
|
|
7212
7240
|
* eachupdateイベントを発火します。
|
|
@@ -7217,7 +7245,7 @@ class B {
|
|
|
7217
7245
|
* @param order 現在の順序
|
|
7218
7246
|
*/
|
|
7219
7247
|
static eachUpdate(e, t, r, i) {
|
|
7220
|
-
|
|
7248
|
+
O.dispatch(e, "eachupdate", {
|
|
7221
7249
|
added: t,
|
|
7222
7250
|
removed: r,
|
|
7223
7251
|
order: i,
|
|
@@ -7233,7 +7261,7 @@ class B {
|
|
|
7233
7261
|
* @param item 行データ
|
|
7234
7262
|
*/
|
|
7235
7263
|
static rowAdd(e, t, r, i) {
|
|
7236
|
-
|
|
7264
|
+
O.dispatch(e, "rowadd", { key: t, index: r, item: i });
|
|
7237
7265
|
}
|
|
7238
7266
|
/**
|
|
7239
7267
|
* rowremoveイベントを発火します。
|
|
@@ -7243,7 +7271,7 @@ class B {
|
|
|
7243
7271
|
* @param index インデックス
|
|
7244
7272
|
*/
|
|
7245
7273
|
static rowRemove(e, t, r) {
|
|
7246
|
-
|
|
7274
|
+
O.dispatch(e, "rowremove", { key: t, index: r });
|
|
7247
7275
|
}
|
|
7248
7276
|
/**
|
|
7249
7277
|
* rowmoveイベントを発火します。
|
|
@@ -7254,7 +7282,7 @@ class B {
|
|
|
7254
7282
|
* @param to 移動後インデックス
|
|
7255
7283
|
*/
|
|
7256
7284
|
static rowMove(e, t, r, i) {
|
|
7257
|
-
|
|
7285
|
+
O.dispatch(e, "rowmove", { key: t, from: r, to: i });
|
|
7258
7286
|
}
|
|
7259
7287
|
/**
|
|
7260
7288
|
* showイベントを発火します。
|
|
@@ -7262,7 +7290,7 @@ class B {
|
|
|
7262
7290
|
* @param target data-if要素
|
|
7263
7291
|
*/
|
|
7264
7292
|
static show(e) {
|
|
7265
|
-
|
|
7293
|
+
O.dispatch(e, "show", { visible: !0 });
|
|
7266
7294
|
}
|
|
7267
7295
|
/**
|
|
7268
7296
|
* hideイベントを発火します。
|
|
@@ -7270,7 +7298,7 @@ class B {
|
|
|
7270
7298
|
* @param target data-if要素
|
|
7271
7299
|
*/
|
|
7272
7300
|
static hide(e) {
|
|
7273
|
-
|
|
7301
|
+
O.dispatch(e, "hide", { visible: !1 });
|
|
7274
7302
|
}
|
|
7275
7303
|
/**
|
|
7276
7304
|
* fetchstartイベントを発火します。
|
|
@@ -7283,7 +7311,7 @@ class B {
|
|
|
7283
7311
|
* @return 戻り値はありません。
|
|
7284
7312
|
*/
|
|
7285
7313
|
static fetchStart(e, t, r, i, n) {
|
|
7286
|
-
|
|
7314
|
+
O.dispatch(e, "fetchstart", {
|
|
7287
7315
|
url: t,
|
|
7288
7316
|
options: r || {},
|
|
7289
7317
|
payload: i,
|
|
@@ -7300,7 +7328,7 @@ class B {
|
|
|
7300
7328
|
* @param startedAt 開始時刻
|
|
7301
7329
|
*/
|
|
7302
7330
|
static fetchEnd(e, t, r, i) {
|
|
7303
|
-
|
|
7331
|
+
O.dispatch(e, "fetchend", {
|
|
7304
7332
|
url: t,
|
|
7305
7333
|
status: r,
|
|
7306
7334
|
durationMs: performance.now() - i
|
|
@@ -7316,7 +7344,7 @@ class B {
|
|
|
7316
7344
|
* @param startedAt 開始時刻(存在する場合)
|
|
7317
7345
|
*/
|
|
7318
7346
|
static fetchError(e, t, r, i, n) {
|
|
7319
|
-
|
|
7347
|
+
O.dispatch(e, "fetcherror", {
|
|
7320
7348
|
url: t,
|
|
7321
7349
|
status: i,
|
|
7322
7350
|
error: r,
|
|
@@ -7332,7 +7360,7 @@ class B {
|
|
|
7332
7360
|
* @return 戻り値はありません。
|
|
7333
7361
|
*/
|
|
7334
7362
|
static pollTimeout(e, t, r) {
|
|
7335
|
-
|
|
7363
|
+
O.dispatch(e, "polltimeout", { count: t, elapsedMs: r });
|
|
7336
7364
|
}
|
|
7337
7365
|
/**
|
|
7338
7366
|
* pollstopイベントを発火します。
|
|
@@ -7346,7 +7374,7 @@ class B {
|
|
|
7346
7374
|
* @return 戻り値はありません。
|
|
7347
7375
|
*/
|
|
7348
7376
|
static pollStop(e, t, r, i) {
|
|
7349
|
-
|
|
7377
|
+
O.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
7350
7378
|
}
|
|
7351
7379
|
}
|
|
7352
7380
|
const Dt = {
|
|
@@ -7369,7 +7397,7 @@ function Nt(m, e) {
|
|
|
7369
7397
|
return null;
|
|
7370
7398
|
if (!t.includes("{{"))
|
|
7371
7399
|
return t;
|
|
7372
|
-
const r =
|
|
7400
|
+
const r = C.get(m), i = r instanceof I ? r.getBindingData() : {}, n = It(t, i);
|
|
7373
7401
|
return n === "" ? null : n;
|
|
7374
7402
|
}
|
|
7375
7403
|
function Ft(m, e, t) {
|
|
@@ -7790,7 +7818,7 @@ const N = class N {
|
|
|
7790
7818
|
), Promise.resolve();
|
|
7791
7819
|
N.RESTORED_ELEMENTS.add(r);
|
|
7792
7820
|
const i = N.readRecord(t), n = i ? N.extractFromRecord(t, i) : {}, s = { ...e.getRawBindingData() ?? {}, ...n };
|
|
7793
|
-
return N.seedSignature(r, N.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() :
|
|
7821
|
+
return N.seedSignature(r, N.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() : B.setBindingData(r, s, {
|
|
7794
7822
|
reentrant: !0,
|
|
7795
7823
|
kind: "nonSupply",
|
|
7796
7824
|
sequence: I.nextSequence()
|
|
@@ -7870,7 +7898,7 @@ const N = class N {
|
|
|
7870
7898
|
).forEach((i) => {
|
|
7871
7899
|
if (!N.RESTORED_ELEMENTS.has(i))
|
|
7872
7900
|
return;
|
|
7873
|
-
const n =
|
|
7901
|
+
const n = C.get(i);
|
|
7874
7902
|
if (!(n instanceof I))
|
|
7875
7903
|
return;
|
|
7876
7904
|
const s = N.readDeclaration(n);
|
|
@@ -7924,7 +7952,7 @@ class ht {
|
|
|
7924
7952
|
}
|
|
7925
7953
|
}
|
|
7926
7954
|
}
|
|
7927
|
-
const
|
|
7955
|
+
const Ct = [
|
|
7928
7956
|
"addErrorMessage",
|
|
7929
7957
|
"clearMessages",
|
|
7930
7958
|
"closeDialog",
|
|
@@ -7932,15 +7960,15 @@ const kt = [
|
|
|
7932
7960
|
"dialog",
|
|
7933
7961
|
"openDialog",
|
|
7934
7962
|
"toast"
|
|
7935
|
-
],
|
|
7963
|
+
], kt = "__haoriHistoryState__", Pe = "data-haori-click-lock";
|
|
7936
7964
|
function De() {
|
|
7937
7965
|
const e = globalThis.window?.Haori;
|
|
7938
|
-
return
|
|
7966
|
+
return Ct.every(
|
|
7939
7967
|
(r) => typeof e?.[r] == "function"
|
|
7940
7968
|
) ? e : ye;
|
|
7941
7969
|
}
|
|
7942
7970
|
const Mt = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
7943
|
-
function
|
|
7971
|
+
function Be(m) {
|
|
7944
7972
|
return Mt.has(m.toUpperCase());
|
|
7945
7973
|
}
|
|
7946
7974
|
function xt(m, e) {
|
|
@@ -8037,7 +8065,7 @@ function Pt(m) {
|
|
|
8037
8065
|
}
|
|
8038
8066
|
function Lt(m, e) {
|
|
8039
8067
|
const t = { ...e || {} }, r = (t.method || "GET").toUpperCase();
|
|
8040
|
-
if (c.runtime !== "demo" ||
|
|
8068
|
+
if (c.runtime !== "demo" || Be(r))
|
|
8041
8069
|
return {
|
|
8042
8070
|
url: m,
|
|
8043
8071
|
options: t,
|
|
@@ -8065,7 +8093,7 @@ function Lt(m, e) {
|
|
|
8065
8093
|
queryString: new URL(s, window.location.href).search || void 0
|
|
8066
8094
|
};
|
|
8067
8095
|
}
|
|
8068
|
-
function
|
|
8096
|
+
function Bt(m) {
|
|
8069
8097
|
return m == null ? null : typeof m == "string" ? m : m instanceof URLSearchParams ? m.toString() : m instanceof FormData ? Array.from(m.entries()).map(([e, t]) => t instanceof File ? [
|
|
8070
8098
|
e,
|
|
8071
8099
|
{
|
|
@@ -8081,15 +8109,15 @@ function Se(m) {
|
|
|
8081
8109
|
Se
|
|
8082
8110
|
) : !1;
|
|
8083
8111
|
}
|
|
8084
|
-
function
|
|
8112
|
+
function Ot(m) {
|
|
8085
8113
|
return Object.values(m).some((e) => e instanceof Blob ? !1 : Array.isArray(e) ? e.some(
|
|
8086
8114
|
(t) => !(t instanceof Blob) && Se(t)
|
|
8087
8115
|
) : Se(e));
|
|
8088
8116
|
}
|
|
8089
8117
|
function Ie(m) {
|
|
8090
|
-
return
|
|
8118
|
+
return Oe(F.getValues(m));
|
|
8091
8119
|
}
|
|
8092
|
-
function
|
|
8120
|
+
function Oe(m) {
|
|
8093
8121
|
const e = (r) => {
|
|
8094
8122
|
if (r instanceof File)
|
|
8095
8123
|
return r.name;
|
|
@@ -8123,7 +8151,7 @@ function Ut(m, e) {
|
|
|
8123
8151
|
url: m,
|
|
8124
8152
|
method: String(e.method || "GET").toUpperCase(),
|
|
8125
8153
|
headers: r,
|
|
8126
|
-
body:
|
|
8154
|
+
body: Bt(e.body || null)
|
|
8127
8155
|
});
|
|
8128
8156
|
}
|
|
8129
8157
|
const b = class b {
|
|
@@ -8295,7 +8323,7 @@ const b = class b {
|
|
|
8295
8323
|
const a = r.trim();
|
|
8296
8324
|
if (b.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
8297
8325
|
return {
|
|
8298
|
-
value:
|
|
8326
|
+
value: B.parseDataBind(n),
|
|
8299
8327
|
hasUnresolvedReference: s
|
|
8300
8328
|
};
|
|
8301
8329
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
@@ -8304,7 +8332,7 @@ const b = class b {
|
|
|
8304
8332
|
e.getBindingData()
|
|
8305
8333
|
);
|
|
8306
8334
|
return {
|
|
8307
|
-
value:
|
|
8335
|
+
value: B.parseDataBind(l.value),
|
|
8308
8336
|
hasUnresolvedReference: s || l.hasUnresolvedReference
|
|
8309
8337
|
};
|
|
8310
8338
|
}
|
|
@@ -8313,7 +8341,7 @@ const b = class b {
|
|
|
8313
8341
|
e.getBindingData()
|
|
8314
8342
|
);
|
|
8315
8343
|
return {
|
|
8316
|
-
value:
|
|
8344
|
+
value: B.parseDataBind(o.value),
|
|
8317
8345
|
hasUnresolvedReference: s || o.hasUnresolvedReference
|
|
8318
8346
|
};
|
|
8319
8347
|
}
|
|
@@ -8348,7 +8376,7 @@ const b = class b {
|
|
|
8348
8376
|
b.attrName(t, "form")
|
|
8349
8377
|
);
|
|
8350
8378
|
M !== null ? r.formFragment = F.getFormFragment(
|
|
8351
|
-
|
|
8379
|
+
C.get(M)
|
|
8352
8380
|
) : y.error(
|
|
8353
8381
|
"Haori",
|
|
8354
8382
|
`Form element not found: ${S} (${b.attrName(t, "form")})`
|
|
@@ -8389,8 +8417,8 @@ ${S}
|
|
|
8389
8417
|
M = new Function("event", `"use strict";
|
|
8390
8418
|
${S}
|
|
8391
8419
|
`);
|
|
8392
|
-
} catch (
|
|
8393
|
-
y.error("Haori", `Invalid run script: ${
|
|
8420
|
+
} catch (V) {
|
|
8421
|
+
y.error("Haori", `Invalid run script: ${V}`);
|
|
8394
8422
|
}
|
|
8395
8423
|
}
|
|
8396
8424
|
M && (r.runScript = M);
|
|
@@ -8424,7 +8452,7 @@ ${S}
|
|
|
8424
8452
|
E
|
|
8425
8453
|
);
|
|
8426
8454
|
try {
|
|
8427
|
-
a.headers =
|
|
8455
|
+
a.headers = B.parseDataBind(S);
|
|
8428
8456
|
} catch (M) {
|
|
8429
8457
|
y.error("Haori", `Invalid fetch headers: ${M}`);
|
|
8430
8458
|
}
|
|
@@ -8440,7 +8468,7 @@ ${S}
|
|
|
8440
8468
|
E
|
|
8441
8469
|
);
|
|
8442
8470
|
try {
|
|
8443
|
-
a.headers =
|
|
8471
|
+
a.headers = B.parseDataBind(S);
|
|
8444
8472
|
} catch (M) {
|
|
8445
8473
|
y.error("Haori", `Invalid fetch headers: ${M}`);
|
|
8446
8474
|
}
|
|
@@ -8494,8 +8522,8 @@ ${S}
|
|
|
8494
8522
|
if (E) {
|
|
8495
8523
|
const S = z.queryAll(E, o);
|
|
8496
8524
|
S.length > 0 ? (r.bindFragments = [], S.forEach((M) => {
|
|
8497
|
-
const
|
|
8498
|
-
|
|
8525
|
+
const V = C.get(M);
|
|
8526
|
+
V && r.bindFragments.push(V);
|
|
8499
8527
|
})) : y.error(
|
|
8500
8528
|
"Haori",
|
|
8501
8529
|
`Bind element not found: ${E} (${o})`
|
|
@@ -8532,12 +8560,12 @@ ${S}
|
|
|
8532
8560
|
b.attrName(t, "adjust")
|
|
8533
8561
|
);
|
|
8534
8562
|
if (x) {
|
|
8535
|
-
const
|
|
8563
|
+
const q = z.queryAll(
|
|
8536
8564
|
x,
|
|
8537
8565
|
b.attrName(t, "adjust")
|
|
8538
8566
|
);
|
|
8539
|
-
|
|
8540
|
-
const Y =
|
|
8567
|
+
q.length > 0 ? (r.adjustFragments = [], q.forEach((X) => {
|
|
8568
|
+
const Y = C.get(X);
|
|
8541
8569
|
Y && r.adjustFragments.push(Y);
|
|
8542
8570
|
})) : y.error(
|
|
8543
8571
|
"Haori",
|
|
@@ -8545,9 +8573,9 @@ ${S}
|
|
|
8545
8573
|
);
|
|
8546
8574
|
}
|
|
8547
8575
|
if (e.hasAttribute(b.attrName(t, "adjust-value"))) {
|
|
8548
|
-
const
|
|
8576
|
+
const q = e.getRawAttribute(
|
|
8549
8577
|
b.attrName(t, "adjust-value")
|
|
8550
|
-
), X = Number(
|
|
8578
|
+
), X = Number(q);
|
|
8551
8579
|
isNaN(X) || (r.adjustValue = X);
|
|
8552
8580
|
}
|
|
8553
8581
|
}
|
|
@@ -8563,8 +8591,8 @@ ${S}
|
|
|
8563
8591
|
${x}
|
|
8564
8592
|
`
|
|
8565
8593
|
);
|
|
8566
|
-
} catch (
|
|
8567
|
-
y.error("Haori", `Invalid after script: ${
|
|
8594
|
+
} catch (q) {
|
|
8595
|
+
y.error("Haori", `Invalid after script: ${q}`);
|
|
8568
8596
|
}
|
|
8569
8597
|
}
|
|
8570
8598
|
if (e.hasAttribute(b.attrName(t, "dialog")) && (r.dialogMessage = b.unescapeNewlines(
|
|
@@ -8586,18 +8614,18 @@ ${x}
|
|
|
8586
8614
|
), X = ["info", "warning", "error", "success"].includes(x);
|
|
8587
8615
|
r.toastLevel = X ? x : null;
|
|
8588
8616
|
}
|
|
8589
|
-
const E = b.attrName(t, "redirect"), S = b.attrName(t, "redirect-replace"), M = e.hasAttribute(E),
|
|
8617
|
+
const E = b.attrName(t, "redirect"), S = b.attrName(t, "redirect-replace"), M = e.hasAttribute(E), V = e.hasAttribute(S);
|
|
8590
8618
|
if (M && (r.redirectUrl = b.readLateAttribute(
|
|
8591
8619
|
e,
|
|
8592
8620
|
r,
|
|
8593
8621
|
"redirect",
|
|
8594
8622
|
E
|
|
8595
|
-
)),
|
|
8623
|
+
)), V && (r.redirectReplaceUrl = b.readLateAttribute(
|
|
8596
8624
|
e,
|
|
8597
8625
|
r,
|
|
8598
8626
|
"redirect-replace",
|
|
8599
8627
|
S
|
|
8600
|
-
)), M ||
|
|
8628
|
+
)), M || V) {
|
|
8601
8629
|
const x = b.attrName(
|
|
8602
8630
|
t,
|
|
8603
8631
|
"redirect-return-param"
|
|
@@ -8625,12 +8653,12 @@ ${x}
|
|
|
8625
8653
|
b.attrName(t, "history-form")
|
|
8626
8654
|
);
|
|
8627
8655
|
if (x) {
|
|
8628
|
-
const
|
|
8656
|
+
const q = z.query(
|
|
8629
8657
|
x,
|
|
8630
8658
|
b.attrName(t, "history-form")
|
|
8631
8659
|
);
|
|
8632
|
-
|
|
8633
|
-
|
|
8660
|
+
q !== null ? r.historyFormFragment = F.getFormFragment(
|
|
8661
|
+
C.get(q)
|
|
8634
8662
|
) : y.error(
|
|
8635
8663
|
"Haori",
|
|
8636
8664
|
`Form element not found: ${x} (${b.attrName(t, "history-form")})`
|
|
@@ -8647,18 +8675,18 @@ ${x}
|
|
|
8647
8675
|
"open",
|
|
8648
8676
|
"close"
|
|
8649
8677
|
].forEach((x) => {
|
|
8650
|
-
const
|
|
8651
|
-
if (!e.hasAttribute(
|
|
8678
|
+
const q = b.attrName(t, x);
|
|
8679
|
+
if (!e.hasAttribute(q))
|
|
8652
8680
|
return;
|
|
8653
|
-
const X = z.read(e,
|
|
8681
|
+
const X = z.read(e, q), Y = [];
|
|
8654
8682
|
if (X)
|
|
8655
|
-
z.queryAll(X,
|
|
8656
|
-
const ue =
|
|
8683
|
+
z.queryAll(X, q).forEach((be) => {
|
|
8684
|
+
const ue = C.get(be);
|
|
8657
8685
|
ue && Y.push(ue);
|
|
8658
|
-
}), Y.length === 0 && y.error("Haori", `Element not found: ${X} (${
|
|
8686
|
+
}), Y.length === 0 && y.error("Haori", `Element not found: ${X} (${q})`);
|
|
8659
8687
|
else if (x === "open" || x === "close") {
|
|
8660
8688
|
const te = e.getTarget().closest("dialog");
|
|
8661
|
-
te ? Y.push(
|
|
8689
|
+
te ? Y.push(C.get(te)) : y.error("Haori", `Ancestor <dialog> not found (${q})`);
|
|
8662
8690
|
} else
|
|
8663
8691
|
Y.push(e);
|
|
8664
8692
|
if (Y.length > 0)
|
|
@@ -8690,9 +8718,9 @@ ${x}
|
|
|
8690
8718
|
if (e.hasAttribute(_)) {
|
|
8691
8719
|
const x = z.read(e, _);
|
|
8692
8720
|
if (x) {
|
|
8693
|
-
const
|
|
8694
|
-
if (
|
|
8695
|
-
const X =
|
|
8721
|
+
const q = z.query(x, _);
|
|
8722
|
+
if (q !== null) {
|
|
8723
|
+
const X = C.get(q);
|
|
8696
8724
|
X ? r.copySourceFragment = X : y.error(
|
|
8697
8725
|
"Haori",
|
|
8698
8726
|
`Element is not managed by Haori: ${x} (${_})`
|
|
@@ -8717,7 +8745,7 @@ ${x}
|
|
|
8717
8745
|
b.attrName(null, "form", !0)
|
|
8718
8746
|
);
|
|
8719
8747
|
S !== null ? r.formFragment = F.getFormFragment(
|
|
8720
|
-
|
|
8748
|
+
C.get(S)
|
|
8721
8749
|
) : y.error(
|
|
8722
8750
|
"Haori",
|
|
8723
8751
|
`Form element not found: ${E} (${b.attrName(null, "fetch-form", !0)})`
|
|
@@ -8725,33 +8753,33 @@ ${x}
|
|
|
8725
8753
|
} else
|
|
8726
8754
|
r.formFragment = F.getFormFragment(e);
|
|
8727
8755
|
}
|
|
8728
|
-
const
|
|
8729
|
-
if (e.hasAttribute(
|
|
8730
|
-
const E = z.read(e,
|
|
8731
|
-
E ? (z.queryAll(E,
|
|
8732
|
-
const P =
|
|
8756
|
+
const k = t ? b.attrName(t, "fetch-state") : b.attrName(null, "state", !0);
|
|
8757
|
+
if (e.hasAttribute(k)) {
|
|
8758
|
+
const E = z.read(e, k), S = [];
|
|
8759
|
+
E ? (z.queryAll(E, k).forEach((V) => {
|
|
8760
|
+
const P = C.get(V);
|
|
8733
8761
|
P && S.push(P);
|
|
8734
8762
|
}), S.length === 0 && y.error(
|
|
8735
8763
|
"Haori",
|
|
8736
|
-
`Element not found: ${E} (${
|
|
8764
|
+
`Element not found: ${E} (${k})`
|
|
8737
8765
|
)) : S.push(e), S.length > 0 && (r.fetchStateFragments = S);
|
|
8738
8766
|
}
|
|
8739
|
-
const
|
|
8740
|
-
if (e.hasAttribute(
|
|
8741
|
-
const E = e.getRawAttribute(
|
|
8767
|
+
const H = t ? b.attrName(t, "store-clear") : b.attrName(null, "store-clear", !0);
|
|
8768
|
+
if (e.hasAttribute(H)) {
|
|
8769
|
+
const E = e.getRawAttribute(H), S = E === null ? "" : E.trim();
|
|
8742
8770
|
if (S === "")
|
|
8743
8771
|
y.error(
|
|
8744
8772
|
"Haori",
|
|
8745
|
-
`ストレージキーが指定されていません (${
|
|
8773
|
+
`ストレージキーが指定されていません (${H})`
|
|
8746
8774
|
);
|
|
8747
8775
|
else {
|
|
8748
8776
|
r.storeClearKey = S;
|
|
8749
8777
|
const M = e.getRawAttribute(
|
|
8750
|
-
`${
|
|
8751
|
-
),
|
|
8752
|
-
|
|
8778
|
+
`${H}-type`
|
|
8779
|
+
), V = M === null ? "session" : M.trim();
|
|
8780
|
+
V === "local" || V === "session" ? r.storeClearKind = V : (y.warn(
|
|
8753
8781
|
"Haori",
|
|
8754
|
-
`${
|
|
8782
|
+
`${H}-type は session または local を指定してください(session として扱います): ${V}`
|
|
8755
8783
|
), r.storeClearKind = "session");
|
|
8756
8784
|
}
|
|
8757
8785
|
}
|
|
@@ -8892,40 +8920,40 @@ ${x}
|
|
|
8892
8920
|
}
|
|
8893
8921
|
const l = Object.keys(i).length > 0;
|
|
8894
8922
|
if (n) {
|
|
8895
|
-
const p = (s?.method || "GET").toUpperCase(), A = !a && o && r.transportMode === "query-get" && Pt(s) && !
|
|
8923
|
+
const p = (s?.method || "GET").toUpperCase(), A = !a && o && r.transportMode === "query-get" && Pt(s) && !Be(p) ? r.baseUrl ?? n : n, v = Lt(
|
|
8896
8924
|
A,
|
|
8897
8925
|
s
|
|
8898
8926
|
);
|
|
8899
8927
|
n = v.url;
|
|
8900
|
-
const D = { ...v.options },
|
|
8928
|
+
const D = { ...v.options }, k = v.normalized ? v.requestedMethod : r.requestedMethod, H = v.effectiveMethod, E = r.transportMode === "query-get" || v.normalized, S = v.queryString ?? r.queryString;
|
|
8901
8929
|
if (E && y.info("Haori demo fetch normalization", {
|
|
8902
8930
|
runtime: c.runtime,
|
|
8903
|
-
requestedMethod:
|
|
8904
|
-
effectiveMethod:
|
|
8931
|
+
requestedMethod: k,
|
|
8932
|
+
effectiveMethod: H,
|
|
8905
8933
|
transportMode: "query-get",
|
|
8906
8934
|
url: n,
|
|
8907
8935
|
payload: l ? i : void 0,
|
|
8908
8936
|
queryString: S
|
|
8909
8937
|
}), this.options.targetFragment && n) {
|
|
8910
|
-
const M = performance.now(),
|
|
8938
|
+
const M = performance.now(), V = {
|
|
8911
8939
|
runtime: c.runtime,
|
|
8912
|
-
requestedMethod:
|
|
8913
|
-
effectiveMethod:
|
|
8940
|
+
requestedMethod: k,
|
|
8941
|
+
effectiveMethod: H,
|
|
8914
8942
|
transportMode: E ? "query-get" : "http",
|
|
8915
8943
|
...E ? { queryString: S } : {}
|
|
8916
8944
|
};
|
|
8917
|
-
return
|
|
8945
|
+
return O.fetchStart(
|
|
8918
8946
|
this.options.targetFragment.getTarget(),
|
|
8919
8947
|
n,
|
|
8920
8948
|
D,
|
|
8921
8949
|
l ? i : void 0,
|
|
8922
|
-
|
|
8950
|
+
V
|
|
8923
8951
|
), await this.injectFetchState("loading"), await fetch(n, D).then((P) => this.handleFetchResult(
|
|
8924
8952
|
P,
|
|
8925
8953
|
n || void 0,
|
|
8926
8954
|
M
|
|
8927
8955
|
)).catch(async (P) => {
|
|
8928
|
-
throw n &&
|
|
8956
|
+
throw n && O.fetchError(
|
|
8929
8957
|
this.options.targetFragment.getTarget(),
|
|
8930
8958
|
n,
|
|
8931
8959
|
P
|
|
@@ -8941,31 +8969,31 @@ ${x}
|
|
|
8941
8969
|
if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && l) {
|
|
8942
8970
|
const p = this.options.formFragment, g = p.getTarget(), A = /* @__PURE__ */ new Set();
|
|
8943
8971
|
e && e.appliedDisabledAttribute && this.options.targetFragment && A.add(this.options.targetFragment);
|
|
8944
|
-
const v = p.getRawBindingData(), D =
|
|
8945
|
-
let
|
|
8946
|
-
if (
|
|
8947
|
-
|
|
8948
|
-
const E = String(
|
|
8949
|
-
|
|
8950
|
-
(S ? S.value :
|
|
8972
|
+
const v = p.getRawBindingData(), D = Oe(i), k = p.getAttribute(`${c.prefix}form-arg`);
|
|
8973
|
+
let H;
|
|
8974
|
+
if (k) {
|
|
8975
|
+
H = { ...v ?? {} };
|
|
8976
|
+
const E = String(k), S = F.resolveAncestorArgOwner(p, E);
|
|
8977
|
+
H[E] = F.mergeCollectedValues(
|
|
8978
|
+
(S ? S.value : H[E]) ?? null,
|
|
8951
8979
|
D
|
|
8952
8980
|
);
|
|
8953
8981
|
} else
|
|
8954
|
-
|
|
8955
|
-
await
|
|
8982
|
+
H = F.mergeCollectedValues(v, D);
|
|
8983
|
+
await B.setBindingData(g, H, {
|
|
8956
8984
|
skipFragments: A,
|
|
8957
8985
|
kind: "nonSupply",
|
|
8958
8986
|
sequence: this.operationSequence,
|
|
8959
8987
|
editedPaths: F.collectEditedPaths(
|
|
8960
8988
|
p,
|
|
8961
8989
|
this.operationSequence,
|
|
8962
|
-
|
|
8990
|
+
k ? String(k) : "",
|
|
8963
8991
|
D
|
|
8964
8992
|
)
|
|
8965
8993
|
});
|
|
8966
8994
|
}
|
|
8967
8995
|
this.suppressEmptyReplaceBind = !l && !this.options.formFragment && (this.eventType === "change" || this.eventType === "input"), this.twoWayCommitBind = this.eventType === "change" || this.eventType === "input";
|
|
8968
|
-
const u = l ?
|
|
8996
|
+
const u = l ? Oe(i) : {}, d = new Response(JSON.stringify(u), {
|
|
8969
8997
|
headers: { "Content-Type": "application/json" }
|
|
8970
8998
|
});
|
|
8971
8999
|
return await this.handleFetchResult(d);
|
|
@@ -9005,7 +9033,7 @@ ${x}
|
|
|
9005
9033
|
async handleFetchResult(e, t, r) {
|
|
9006
9034
|
const i = De();
|
|
9007
9035
|
if (!e.ok)
|
|
9008
|
-
return ft(e.status) || (this.options.targetFragment && t &&
|
|
9036
|
+
return ft(e.status) || (this.options.targetFragment && t && O.fetchError(
|
|
9009
9037
|
this.options.targetFragment.getTarget(),
|
|
9010
9038
|
t,
|
|
9011
9039
|
new Error(`${e.status} ${e.statusText}`),
|
|
@@ -9016,7 +9044,7 @@ ${x}
|
|
|
9016
9044
|
e.status,
|
|
9017
9045
|
e.statusText || null
|
|
9018
9046
|
)), !1;
|
|
9019
|
-
if (this.options.targetFragment && t && r &&
|
|
9047
|
+
if (this.options.targetFragment && t && r && O.fetchEnd(
|
|
9020
9048
|
this.options.targetFragment.getTarget(),
|
|
9021
9049
|
t,
|
|
9022
9050
|
e.status,
|
|
@@ -9040,7 +9068,7 @@ ${x}
|
|
|
9040
9068
|
s.push(new b(g, null).run());
|
|
9041
9069
|
}), this.options.clickFragments && this.options.clickFragments.length > 0)
|
|
9042
9070
|
for (const g of this.options.clickFragments) {
|
|
9043
|
-
await
|
|
9071
|
+
await B.evaluateAll(g);
|
|
9044
9072
|
const A = g.getTarget();
|
|
9045
9073
|
typeof A.click == "function" ? A.click() : A.dispatchEvent(
|
|
9046
9074
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
@@ -9092,8 +9120,8 @@ ${x}
|
|
|
9092
9120
|
if (A) {
|
|
9093
9121
|
const D = new URLSearchParams(window.location.search).get(A);
|
|
9094
9122
|
if (D !== null) {
|
|
9095
|
-
const
|
|
9096
|
-
ht.isSafeLocalPath(
|
|
9123
|
+
const k = D.trim();
|
|
9124
|
+
ht.isSafeLocalPath(k) ? g = k : y.warn(
|
|
9097
9125
|
"Haori",
|
|
9098
9126
|
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${D}`
|
|
9099
9127
|
);
|
|
@@ -9130,7 +9158,7 @@ ${x}
|
|
|
9130
9158
|
if (!i || !n || !n.hasAttribute(i.attributeName))
|
|
9131
9159
|
return r;
|
|
9132
9160
|
const s = n.getAttributeEvaluation(i.attributeName);
|
|
9133
|
-
return s === null ? r : s.hasUnresolvedReference && !i.hasUnresolvedReference ? (
|
|
9161
|
+
return s === null ? r : s.hasUnresolvedReference && !i.hasUnresolvedReference ? (j.isEnabled() && y.warn(
|
|
9134
9162
|
"Haori",
|
|
9135
9163
|
`${i.attributeName} の参照が手続きの途中で解決できなくなったため、手続き開始時の値を使います`
|
|
9136
9164
|
), r) : s.value ?? null;
|
|
@@ -9160,7 +9188,7 @@ ${x}
|
|
|
9160
9188
|
p != null && (Array.isArray(p) ? p.forEach((g) => o.searchParams.append(d, String(g))) : typeof p == "object" ? o.searchParams.set(d, JSON.stringify(p)) : o.searchParams.set(d, String(p)));
|
|
9161
9189
|
};
|
|
9162
9190
|
n && l(r), s && l(i), history.pushState(
|
|
9163
|
-
{ [
|
|
9191
|
+
{ [kt]: !0 },
|
|
9164
9192
|
"",
|
|
9165
9193
|
o.toString()
|
|
9166
9194
|
);
|
|
@@ -9345,7 +9373,7 @@ ${x}
|
|
|
9345
9373
|
return s.unresolvedReference ? (e || y.warn(
|
|
9346
9374
|
"Haori",
|
|
9347
9375
|
`${i} の参照が解決できないため実行しません: ${t}`
|
|
9348
|
-
), !1) : s.value ? !0 : (!e &&
|
|
9376
|
+
), !1) : s.value ? !0 : (!e && j.isEnabled() && y.warn(
|
|
9349
9377
|
"Haori",
|
|
9350
9378
|
`${i} の条件が偽のため手続きを中断しました: ${t}`
|
|
9351
9379
|
), !1);
|
|
@@ -9438,11 +9466,11 @@ ${x}
|
|
|
9438
9466
|
apply: (g) => {
|
|
9439
9467
|
const A = this.resolveCurrentRowItem(o, g), v = { ...A };
|
|
9440
9468
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
9441
|
-
const D = A[p],
|
|
9469
|
+
const D = A[p], k = D !== null && typeof D == "object" && !Array.isArray(D) ? D : {};
|
|
9442
9470
|
v[p] = this.mergeAppendBindingData(
|
|
9443
9471
|
o,
|
|
9444
9472
|
i,
|
|
9445
|
-
|
|
9473
|
+
k
|
|
9446
9474
|
);
|
|
9447
9475
|
} else
|
|
9448
9476
|
v[p] = i;
|
|
@@ -9462,7 +9490,7 @@ ${x}
|
|
|
9462
9490
|
} else
|
|
9463
9491
|
u[d] = i;
|
|
9464
9492
|
n.push(
|
|
9465
|
-
|
|
9493
|
+
B.setBindingData(
|
|
9466
9494
|
o.getTarget(),
|
|
9467
9495
|
this.reconcileUserEditsForBind(o, u),
|
|
9468
9496
|
{
|
|
@@ -9520,7 +9548,7 @@ ${x}
|
|
|
9520
9548
|
i
|
|
9521
9549
|
), d = this.options.bindMerge ? { ...o.getRawBindingData() ?? {}, ...u } : u;
|
|
9522
9550
|
n.push(
|
|
9523
|
-
|
|
9551
|
+
B.setBindingData(
|
|
9524
9552
|
o.getTarget(),
|
|
9525
9553
|
this.reconcileUserEditsForBind(o, d),
|
|
9526
9554
|
{
|
|
@@ -9535,7 +9563,7 @@ ${x}
|
|
|
9535
9563
|
return n.push(this.applyRowWrites(a)), Promise.all(n).then(() => {
|
|
9536
9564
|
const o = this.options.bindArg ?? null;
|
|
9537
9565
|
this.options.bindFragments.forEach((l) => {
|
|
9538
|
-
|
|
9566
|
+
O.bindComplete(l.getTarget(), o);
|
|
9539
9567
|
});
|
|
9540
9568
|
});
|
|
9541
9569
|
});
|
|
@@ -9576,7 +9604,7 @@ ${x}
|
|
|
9576
9604
|
if (r === null)
|
|
9577
9605
|
return t;
|
|
9578
9606
|
const i = this.eventType === "poll";
|
|
9579
|
-
if (!i && !this.twoWayCommitBind &&
|
|
9607
|
+
if (!i && !this.twoWayCommitBind && B.clearUserEditMarks(e, r), !(e.getTarget() instanceof HTMLFormElement))
|
|
9580
9608
|
return this.reconcileAncestorArgFormEdits(
|
|
9581
9609
|
e,
|
|
9582
9610
|
t,
|
|
@@ -9615,7 +9643,7 @@ ${x}
|
|
|
9615
9643
|
if (r === null)
|
|
9616
9644
|
return t;
|
|
9617
9645
|
const i = this.eventType === "poll";
|
|
9618
|
-
!i && !this.twoWayCommitBind &&
|
|
9646
|
+
!i && !this.twoWayCommitBind && B.clearUserEditMarks(e, r);
|
|
9619
9647
|
const n = F.getValuesEditedAfter(
|
|
9620
9648
|
e,
|
|
9621
9649
|
i ? 0 : r
|
|
@@ -9688,7 +9716,7 @@ ${x}
|
|
|
9688
9716
|
...t
|
|
9689
9717
|
};
|
|
9690
9718
|
n.push(
|
|
9691
|
-
|
|
9719
|
+
B.setBindingData(s.getTarget(), o, {
|
|
9692
9720
|
// 通番はコピーを起こした操作のもの(フェッチ応答の反映と同じ理由)。
|
|
9693
9721
|
sequence: this.operationSequence
|
|
9694
9722
|
})
|
|
@@ -9813,10 +9841,10 @@ ${x}
|
|
|
9813
9841
|
let i = this.options.fetchUrl;
|
|
9814
9842
|
const n = { ...this.options.fetchOptions || {} }, s = new Headers(
|
|
9815
9843
|
n.headers || void 0
|
|
9816
|
-
), a = (n.method || "GET").toUpperCase(), o = c.runtime === "demo" && !
|
|
9844
|
+
), a = (n.method || "GET").toUpperCase(), o = c.runtime === "demo" && !Be(a), l = o ? "GET" : a;
|
|
9817
9845
|
if (n.method = l, Object.keys(t).length > 0 && Se(t)) {
|
|
9818
9846
|
const d = s.get("Content-Type") || "";
|
|
9819
|
-
l !== "GET" && l !== "HEAD" && l !== "OPTIONS" && /multipart\/form-data/i.test(d) ?
|
|
9847
|
+
l !== "GET" && l !== "HEAD" && l !== "OPTIONS" && /multipart\/form-data/i.test(d) ? Ot(t) && y.warn(
|
|
9820
9848
|
"Haori",
|
|
9821
9849
|
`A File value nested under ${c.prefix}form-object / ${c.prefix}form-list cannot be sent. Place file inputs at the top level of the collected form values.`
|
|
9822
9850
|
) : y.warn(
|
|
@@ -9965,7 +9993,7 @@ ${x}
|
|
|
9965
9993
|
"Haori",
|
|
9966
9994
|
`Row container not found: ${i} (${r})`
|
|
9967
9995
|
), null;
|
|
9968
|
-
const a =
|
|
9996
|
+
const a = C.get(s);
|
|
9969
9997
|
return a instanceof I ? a.hasAttribute(`${c.prefix}each`) ? a : (y.error(
|
|
9970
9998
|
"Haori",
|
|
9971
9999
|
`Row container must have ${c.prefix}each: ${i} (${r})`
|
|
@@ -9993,38 +10021,115 @@ ${x}
|
|
|
9993
10021
|
if (t === null)
|
|
9994
10022
|
return y.error("Haori", `Row container has no ${c.prefix}each expression.`), null;
|
|
9995
10023
|
const r = t.trim().split(".");
|
|
9996
|
-
if (!(r.length > 0 && r.every((
|
|
10024
|
+
if (!(r.length > 0 && r.every((u) => /^[A-Za-z_$][\w$]*$/.test(u))))
|
|
9997
10025
|
return y.error(
|
|
9998
10026
|
"Haori",
|
|
9999
10027
|
`Row operations require a plain identifier path for ${c.prefix}each (got: ${t}).`
|
|
10000
10028
|
), null;
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10029
|
+
const n = b.resolveRowScopeBase(e, r[0]);
|
|
10030
|
+
let s, a, o;
|
|
10031
|
+
if (n)
|
|
10032
|
+
s = n.owner, a = n.ownerData, o = [...n.path, ...r.slice(1)];
|
|
10033
|
+
else {
|
|
10034
|
+
for (s = e, a = null; s; ) {
|
|
10035
|
+
const u = s.getRawBindingData();
|
|
10036
|
+
if (u && r[0] in u && !b.isRowScopeKey(s, r[0])) {
|
|
10037
|
+
a = u;
|
|
10038
|
+
break;
|
|
10039
|
+
}
|
|
10040
|
+
s = s.getParent();
|
|
10007
10041
|
}
|
|
10008
|
-
|
|
10042
|
+
o = r;
|
|
10009
10043
|
}
|
|
10010
|
-
if (!
|
|
10044
|
+
if (!s || !a)
|
|
10011
10045
|
return y.error(
|
|
10012
10046
|
"Haori",
|
|
10013
10047
|
`Binding data owner not found for ${c.prefix}each="${t}".`
|
|
10014
10048
|
), null;
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
if (a === null || typeof a != "object" || Array.isArray(a)) {
|
|
10018
|
-
a = void 0;
|
|
10019
|
-
break;
|
|
10020
|
-
}
|
|
10021
|
-
a = a[o];
|
|
10022
|
-
}
|
|
10023
|
-
return Array.isArray(a) ? { owner: n, ownerData: s, array: a, path: r } : (y.error(
|
|
10049
|
+
const l = b.readPathValue(a, o);
|
|
10050
|
+
return Array.isArray(l) ? { owner: s, ownerData: a, array: l, path: o } : (y.error(
|
|
10024
10051
|
"Haori",
|
|
10025
10052
|
`${c.prefix}each="${t}" does not resolve to an array.`
|
|
10026
10053
|
), null);
|
|
10027
10054
|
}
|
|
10055
|
+
/**
|
|
10056
|
+
* 行スコープ名を根に持つ経路の土台(所有者と行までの経路)を解決します。
|
|
10057
|
+
*
|
|
10058
|
+
* `data-each="g.rules"` のように、外側の `data-each` が公開する行スコープ名を
|
|
10059
|
+
* 根に持つ式のための解決です。行スコープ名を宣言している最も近い祖先の
|
|
10060
|
+
* `data-each` コンテナを見つけ、そのコンテナ自身を再帰的に解決して
|
|
10061
|
+
* 「所有者・所有者データ・配列までの経路」を得たうえで、経路の末尾へ行の位置を
|
|
10062
|
+
* 足して返します。再帰するため、入れ子が何段でも解けます。
|
|
10063
|
+
*
|
|
10064
|
+
* @param container `data-each` コンテナのフラグメント
|
|
10065
|
+
* @param rootName 経路の根の識別子
|
|
10066
|
+
* @returns 所有者・所有者データ・行までの経路。行スコープ名でない場合は null
|
|
10067
|
+
*/
|
|
10068
|
+
static resolveRowScopeBase(e, t) {
|
|
10069
|
+
let r = e;
|
|
10070
|
+
for (; r; ) {
|
|
10071
|
+
const i = r.closestByAttribute(`${c.prefix}row`);
|
|
10072
|
+
if (!i)
|
|
10073
|
+
return null;
|
|
10074
|
+
const n = i.getParent();
|
|
10075
|
+
if (!n)
|
|
10076
|
+
return null;
|
|
10077
|
+
if (n.getAttribute(`${c.prefix}each-arg`) === t) {
|
|
10078
|
+
const s = b.resolveEachArray(n);
|
|
10079
|
+
if (!s)
|
|
10080
|
+
return null;
|
|
10081
|
+
const a = b.resolveRowIndex(
|
|
10082
|
+
n,
|
|
10083
|
+
i,
|
|
10084
|
+
s.array,
|
|
10085
|
+
`${c.prefix}each="${n.getRawAttribute(`${c.prefix}each`)}"`
|
|
10086
|
+
);
|
|
10087
|
+
return a === null ? null : {
|
|
10088
|
+
owner: s.owner,
|
|
10089
|
+
ownerData: s.ownerData,
|
|
10090
|
+
path: [...s.path, String(a)]
|
|
10091
|
+
};
|
|
10092
|
+
}
|
|
10093
|
+
r = n;
|
|
10094
|
+
}
|
|
10095
|
+
return null;
|
|
10096
|
+
}
|
|
10097
|
+
/**
|
|
10098
|
+
* 指定した名前が、そのフラグメントの行データ由来のキーかどうかを判定します。
|
|
10099
|
+
*
|
|
10100
|
+
* 行データ(`data-each-arg` / `data-each-index` で公開する値)は描画のたびに
|
|
10101
|
+
* 親配列から作り直す仮想スコープです。行操作の書き戻し先にすると次の描画で
|
|
10102
|
+
* 消えるため、所有者の候補から外すために使います。
|
|
10103
|
+
*
|
|
10104
|
+
* @param fragment 判定するフラグメント
|
|
10105
|
+
* @param name キーの名前
|
|
10106
|
+
* @returns 行データ由来なら true
|
|
10107
|
+
*/
|
|
10108
|
+
static isRowScopeKey(e, t) {
|
|
10109
|
+
if (!e.hasAttribute(`${c.prefix}row`))
|
|
10110
|
+
return !1;
|
|
10111
|
+
const r = e.getParent();
|
|
10112
|
+
return r ? r.getAttribute(`${c.prefix}each-arg`) === t || r.getAttribute(`${c.prefix}each-index`) === t : !1;
|
|
10113
|
+
}
|
|
10114
|
+
/**
|
|
10115
|
+
* 経路をたどって値を読み出します。
|
|
10116
|
+
*
|
|
10117
|
+
* 配列の要素を指す数値の経路要素も辿ります(行スコープ名を根に持つ経路は
|
|
10118
|
+
* 途中に行の位置が入るため)。
|
|
10119
|
+
*
|
|
10120
|
+
* @param data 起点のデータ
|
|
10121
|
+
* @param path キーの並び
|
|
10122
|
+
* @returns 経路の値。辿れない場合は undefined
|
|
10123
|
+
*/
|
|
10124
|
+
static readPathValue(e, t) {
|
|
10125
|
+
let r = e;
|
|
10126
|
+
for (const i of t) {
|
|
10127
|
+
if (r === null || typeof r != "object")
|
|
10128
|
+
return;
|
|
10129
|
+
r = r[i];
|
|
10130
|
+
}
|
|
10131
|
+
return r;
|
|
10132
|
+
}
|
|
10028
10133
|
/**
|
|
10029
10134
|
* 指定パスの値を差し替えた新しいオブジェクトを返します。
|
|
10030
10135
|
*
|
|
@@ -10041,7 +10146,7 @@ ${x}
|
|
|
10041
10146
|
const i = { ...e };
|
|
10042
10147
|
let n = i;
|
|
10043
10148
|
for (let s = 0; s < t.length - 1; s += 1) {
|
|
10044
|
-
const a = t[s],
|
|
10149
|
+
const a = t[s], o = n[a], l = Array.isArray(o) ? o.slice() : { ...o };
|
|
10045
10150
|
n[a] = l, n = l;
|
|
10046
10151
|
}
|
|
10047
10152
|
return n[t[t.length - 1]] = r, i;
|
|
@@ -10135,7 +10240,7 @@ ${x}
|
|
|
10135
10240
|
}
|
|
10136
10241
|
if (!o)
|
|
10137
10242
|
return;
|
|
10138
|
-
const l =
|
|
10243
|
+
const l = B.setBindingData(
|
|
10139
10244
|
s.owner.getTarget(),
|
|
10140
10245
|
b.withPathValue(s.ownerData, s.path, a),
|
|
10141
10246
|
{
|
|
@@ -10151,7 +10256,7 @@ ${x}
|
|
|
10151
10256
|
sequence: this.operationSequence
|
|
10152
10257
|
}
|
|
10153
10258
|
);
|
|
10154
|
-
if (
|
|
10259
|
+
if (B.isEachUpdateRunning(n)) {
|
|
10155
10260
|
l.catch((u) => {
|
|
10156
10261
|
y.error("Haori", "Failed to write row data.", u);
|
|
10157
10262
|
});
|
|
@@ -10217,32 +10322,52 @@ ${x}
|
|
|
10217
10322
|
* @returns 配列のインデックス。解決できない場合は null
|
|
10218
10323
|
*/
|
|
10219
10324
|
static resolveRowArrayIndex(e, t) {
|
|
10220
|
-
|
|
10221
|
-
|
|
10325
|
+
return b.resolveRowIndex(
|
|
10326
|
+
e.container,
|
|
10327
|
+
e.row,
|
|
10328
|
+
t,
|
|
10329
|
+
e.attributeName
|
|
10330
|
+
);
|
|
10331
|
+
}
|
|
10332
|
+
/**
|
|
10333
|
+
* 行に対応する配列要素のインデックスを解決します。
|
|
10334
|
+
*
|
|
10335
|
+
* `resolveRowArrayIndex()` の本体です。行への書き込み以外(行スコープ名を根に
|
|
10336
|
+
* 持つ `data-each` の解決)からも使うため、コンテナと行を直接受け取ります。
|
|
10337
|
+
*
|
|
10338
|
+
* @param container `data-each` コンテナのフラグメント
|
|
10339
|
+
* @param row 対象の行フラグメント
|
|
10340
|
+
* @param array 現在の配列
|
|
10341
|
+
* @param label 警告に添える宣言の名前
|
|
10342
|
+
* @returns 配列のインデックス。解決できない場合は null
|
|
10343
|
+
*/
|
|
10344
|
+
static resolveRowIndex(e, t, r, i) {
|
|
10345
|
+
const n = b.getRowFragments(e), s = n.indexOf(t);
|
|
10346
|
+
if (s === -1)
|
|
10222
10347
|
return y.warn(
|
|
10223
10348
|
"Haori",
|
|
10224
|
-
`The target row is no longer in the ${c.prefix}each container; the write was skipped (${
|
|
10349
|
+
`The target row is no longer in the ${c.prefix}each container; the write was skipped (${i}).`
|
|
10225
10350
|
), null;
|
|
10226
|
-
const
|
|
10227
|
-
if (
|
|
10228
|
-
const
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10232
|
-
String(
|
|
10233
|
-
|
|
10234
|
-
) ===
|
|
10351
|
+
const a = e.getAttribute(`${c.prefix}each-key`), o = t.getListKey();
|
|
10352
|
+
if (a && o !== null) {
|
|
10353
|
+
const l = [];
|
|
10354
|
+
r.forEach((p, g) => {
|
|
10355
|
+
B.createListKey(
|
|
10356
|
+
p,
|
|
10357
|
+
String(a),
|
|
10358
|
+
g
|
|
10359
|
+
) === o && l.push(g);
|
|
10235
10360
|
});
|
|
10236
|
-
const
|
|
10237
|
-
return
|
|
10361
|
+
const u = n.slice(0, s).filter((p) => p.getListKey() === o).length, d = l[u] ?? -1;
|
|
10362
|
+
return d === -1 ? (y.warn(
|
|
10238
10363
|
"Haori",
|
|
10239
|
-
`No array element corresponds to the target row (key "${
|
|
10240
|
-
), null) :
|
|
10364
|
+
`No array element corresponds to the target row (key "${o}"); the write was skipped (${i}).`
|
|
10365
|
+
), null) : d;
|
|
10241
10366
|
}
|
|
10242
|
-
return
|
|
10367
|
+
return s >= r.length ? (y.warn(
|
|
10243
10368
|
"Haori",
|
|
10244
|
-
`The target row index is out of range; the write was skipped (${
|
|
10245
|
-
), null) :
|
|
10369
|
+
`The target row index is out of range; the write was skipped (${i}).`
|
|
10370
|
+
), null) : s;
|
|
10246
10371
|
}
|
|
10247
10372
|
/**
|
|
10248
10373
|
* 行を追加します。
|
|
@@ -10323,14 +10448,14 @@ ${x}
|
|
|
10323
10448
|
if (b.isSameRowItem(i.array[p], d))
|
|
10324
10449
|
return;
|
|
10325
10450
|
const g = u.get(
|
|
10326
|
-
|
|
10451
|
+
B.createListKey(
|
|
10327
10452
|
d,
|
|
10328
10453
|
null,
|
|
10329
10454
|
p
|
|
10330
10455
|
)
|
|
10331
10456
|
);
|
|
10332
|
-
g &&
|
|
10333
|
-
}),
|
|
10457
|
+
g && B.clearUserEditMarks(g);
|
|
10458
|
+
}), B.setBindingData(
|
|
10334
10459
|
i.owner.getTarget(),
|
|
10335
10460
|
b.withPathValue(i.ownerData, i.path, l),
|
|
10336
10461
|
{
|
|
@@ -10373,7 +10498,7 @@ ${x}
|
|
|
10373
10498
|
...s.getRawBindingData() ?? {},
|
|
10374
10499
|
_fetch: n
|
|
10375
10500
|
};
|
|
10376
|
-
return
|
|
10501
|
+
return B.setBindingData(a, o, {
|
|
10377
10502
|
reflectToAttribute: !1,
|
|
10378
10503
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
10379
10504
|
// 解除しない)。
|
|
@@ -10476,7 +10601,7 @@ const h = class h {
|
|
|
10476
10601
|
* @returns data-attr-* の内部反映なら true
|
|
10477
10602
|
*/
|
|
10478
10603
|
static isAliasedAttributeReflection(e, t) {
|
|
10479
|
-
const r =
|
|
10604
|
+
const r = C.get(e);
|
|
10480
10605
|
return r instanceof I ? r.hasAttribute(
|
|
10481
10606
|
`${c.prefix}${h.ATTRIBUTE_ALIAS_SUFFIX}${t}`
|
|
10482
10607
|
) : !1;
|
|
@@ -10626,12 +10751,12 @@ const h = class h {
|
|
|
10626
10751
|
return Promise.resolve();
|
|
10627
10752
|
r.lastUrl = n, r.running = !0;
|
|
10628
10753
|
const s = performance.now();
|
|
10629
|
-
return t.setAttribute(`${c.prefix}importing`, ""),
|
|
10754
|
+
return t.setAttribute(`${c.prefix}importing`, ""), O.importStart(t, n), Ht.load(n).then((a) => {
|
|
10630
10755
|
const o = new TextEncoder().encode(a).length;
|
|
10631
10756
|
return K.enqueue(() => {
|
|
10632
10757
|
t.innerHTML = a;
|
|
10633
10758
|
}).then(() => {
|
|
10634
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
10759
|
+
t.removeAttribute(`${c.prefix}importing`), O.importEnd(t, n, o, s), h.adoptImportedChildren(e);
|
|
10635
10760
|
const l = [];
|
|
10636
10761
|
return e.getChildren().forEach((u) => {
|
|
10637
10762
|
u instanceof I ? l.push(h.scan(u.getTarget())) : u instanceof ee && l.push(h.evaluateText(u));
|
|
@@ -10639,7 +10764,7 @@ const h = class h {
|
|
|
10639
10764
|
});
|
|
10640
10765
|
});
|
|
10641
10766
|
}).catch((a) => {
|
|
10642
|
-
t.removeAttribute(`${c.prefix}importing`),
|
|
10767
|
+
t.removeAttribute(`${c.prefix}importing`), O.importError(t, n, a), y.error("[Haori]", "Failed to import HTML:", n, a);
|
|
10643
10768
|
}).finally(() => {
|
|
10644
10769
|
if (r.running = !1, r.rerunRequested)
|
|
10645
10770
|
return r.rerunRequested = !1, h.executeManagedImport(e);
|
|
@@ -10662,7 +10787,7 @@ const h = class h {
|
|
|
10662
10787
|
e.getChildren().filter((r) => r.getTarget().parentNode !== t).forEach((r) => {
|
|
10663
10788
|
r.remove(!1);
|
|
10664
10789
|
}), t.childNodes.forEach((r) => {
|
|
10665
|
-
const i =
|
|
10790
|
+
const i = C.get(r);
|
|
10666
10791
|
i !== null && i.getParent() !== e && e.pushChild(i);
|
|
10667
10792
|
});
|
|
10668
10793
|
}
|
|
@@ -10673,7 +10798,7 @@ const h = class h {
|
|
|
10673
10798
|
* @returns Promise (スキャンが完了したときに解決される)
|
|
10674
10799
|
*/
|
|
10675
10800
|
static scan(e) {
|
|
10676
|
-
const t =
|
|
10801
|
+
const t = C.get(e);
|
|
10677
10802
|
return t ? h.initializeElementFragment(t, !1).then(() => F.restoreInitialValues(e)).then(() => {
|
|
10678
10803
|
ie.applySubtree(e);
|
|
10679
10804
|
}) : Promise.resolve();
|
|
@@ -10792,7 +10917,7 @@ const h = class h {
|
|
|
10792
10917
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
10793
10918
|
*/
|
|
10794
10919
|
static setAttribute(e, t, r, i = !1, n) {
|
|
10795
|
-
const s =
|
|
10920
|
+
const s = C.get(e), a = h.getAliasedAttributeName(t);
|
|
10796
10921
|
if (a !== null)
|
|
10797
10922
|
return r === null ? s.removeAliasedAttribute(t, a) : s.setAliasedAttribute(
|
|
10798
10923
|
t,
|
|
@@ -10925,7 +11050,7 @@ const h = class h {
|
|
|
10925
11050
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
10926
11051
|
*/
|
|
10927
11052
|
static setBindingData(e, t, r = {}) {
|
|
10928
|
-
const i =
|
|
11053
|
+
const i = C.get(e), n = r.skipFragments ?? /* @__PURE__ */ new Set(), s = r.reentrant ?? !1, a = r.reflectToAttribute ?? !0, o = r.kind ?? "supply", l = r.sequence ?? I.nextOperationSequence(), u = {
|
|
10929
11054
|
sequence: l,
|
|
10930
11055
|
kind: o,
|
|
10931
11056
|
...r.editedPaths === void 0 ? {} : { editedPaths: r.editedPaths }
|
|
@@ -10934,31 +11059,31 @@ const h = class h {
|
|
|
10934
11059
|
const p = I.currentSequence(), g = i.getRawBindingData();
|
|
10935
11060
|
d && (r.clearUserEdits ?? !0) && h.clearUserEditMarks(i, l);
|
|
10936
11061
|
const A = a ? h.resolveByPathAuthority(i, g, t, u) : t;
|
|
10937
|
-
i.setBindingData(A), a && (
|
|
11062
|
+
i.setBindingData(A), a && (O.bindChange(e, g, A, "manual"), ve.mirror(i));
|
|
10938
11063
|
const v = () => {
|
|
10939
11064
|
i.markBindingWorkStart();
|
|
10940
11065
|
const D = i.getRawBindingData() ?? A;
|
|
10941
|
-
let
|
|
10942
|
-
return e.tagName === "FORM" && (
|
|
11066
|
+
let k = a ? i.setAttribute(`${c.prefix}bind`, JSON.stringify(D)) : Promise.resolve();
|
|
11067
|
+
return e.tagName === "FORM" && (k = k.then(() => {
|
|
10943
11068
|
if (i.wasResetAfter(p))
|
|
10944
11069
|
return;
|
|
10945
|
-
const
|
|
11070
|
+
const H = i.getRawBindingData() ?? A;
|
|
10946
11071
|
return F.syncValues(
|
|
10947
11072
|
i,
|
|
10948
|
-
F.resolveSyncValues(i,
|
|
11073
|
+
F.resolveSyncValues(i, H),
|
|
10949
11074
|
!1,
|
|
10950
11075
|
u
|
|
10951
11076
|
);
|
|
10952
|
-
})),
|
|
11077
|
+
})), k = k.then(
|
|
10953
11078
|
() => F.syncAncestorArgForms(i, p, u)
|
|
10954
|
-
),
|
|
11079
|
+
), k = k.then(() => h.evaluateAll(i, n)), k = k.then(
|
|
10955
11080
|
() => I.retryUnappliedValueWrites(e, p)
|
|
10956
|
-
),
|
|
11081
|
+
), k = k.then(
|
|
10957
11082
|
() => h.reevaluateReactiveSpecialAttributes(i, n)
|
|
10958
|
-
),
|
|
11083
|
+
), k.then(
|
|
10959
11084
|
() => i.markBindingWorkEnd(),
|
|
10960
|
-
(
|
|
10961
|
-
throw i.markBindingWorkEnd(),
|
|
11085
|
+
(H) => {
|
|
11086
|
+
throw i.markBindingWorkEnd(), H;
|
|
10962
11087
|
}
|
|
10963
11088
|
);
|
|
10964
11089
|
};
|
|
@@ -11010,14 +11135,14 @@ const h = class h {
|
|
|
11010
11135
|
...Object.keys(d)
|
|
11011
11136
|
]);
|
|
11012
11137
|
for (const v of A) {
|
|
11013
|
-
const D = n === "" ? v : `${n}.${v}`,
|
|
11138
|
+
const D = n === "" ? v : `${n}.${v}`, k = h.mergePathAuthority(
|
|
11014
11139
|
e,
|
|
11015
11140
|
Object.prototype.hasOwnProperty.call(u, v) ? u[v] : h.ABSENT_PATH,
|
|
11016
11141
|
Object.prototype.hasOwnProperty.call(d, v) ? d[v] : h.ABSENT_PATH,
|
|
11017
11142
|
i,
|
|
11018
11143
|
D
|
|
11019
11144
|
);
|
|
11020
|
-
|
|
11145
|
+
k !== h.ABSENT_PATH && (p[v] = k), k !== (Object.prototype.hasOwnProperty.call(d, v) ? d[v] : h.ABSENT_PATH) && (g = !0);
|
|
11021
11146
|
}
|
|
11022
11147
|
return g ? p : d;
|
|
11023
11148
|
}
|
|
@@ -11186,7 +11311,7 @@ const h = class h {
|
|
|
11186
11311
|
* `resolved: true` のときは解決済みスコープ(常にオブジェクト)。
|
|
11187
11312
|
*/
|
|
11188
11313
|
static getBindingData(e, t = {}) {
|
|
11189
|
-
const r =
|
|
11314
|
+
const r = C.get(e);
|
|
11190
11315
|
return r instanceof I ? t.resolved ? r.getBindingData() : r.getRawBindingData() : null;
|
|
11191
11316
|
}
|
|
11192
11317
|
/**
|
|
@@ -11205,7 +11330,21 @@ const h = class h {
|
|
|
11205
11330
|
* @return 解決済みスコープと各キーの由来情報
|
|
11206
11331
|
*/
|
|
11207
11332
|
static dumpScope(e) {
|
|
11208
|
-
const t =
|
|
11333
|
+
const t = h.collectScope(e);
|
|
11334
|
+
return j.isEnabled() && y.info("[Haori]", "scope dump for", e, t), t;
|
|
11335
|
+
}
|
|
11336
|
+
/**
|
|
11337
|
+
* スコープの解決結果と由来を収集します。
|
|
11338
|
+
*
|
|
11339
|
+
* `dumpScope()` の本体です。こちらは出力しません。診断(`data-if` の falsy 報告)は
|
|
11340
|
+
* 自分で 1 行だけ出すため、ここで出すと同じ内容が二重に出て、再描画のたびに
|
|
11341
|
+
* コンソールへ積み上がります。
|
|
11342
|
+
*
|
|
11343
|
+
* @param element 対象要素
|
|
11344
|
+
* @return 解決済みスコープと各キーの由来情報
|
|
11345
|
+
*/
|
|
11346
|
+
static collectScope(e) {
|
|
11347
|
+
const t = C.get(e);
|
|
11209
11348
|
if (!t)
|
|
11210
11349
|
return { resolved: {}, sources: {} };
|
|
11211
11350
|
const r = t.getBindingData(), i = {}, n = (l) => {
|
|
@@ -11224,7 +11363,7 @@ const h = class h {
|
|
|
11224
11363
|
let a = t, o = 0;
|
|
11225
11364
|
for (; a; )
|
|
11226
11365
|
a !== t && s(a.getRawDerivedBindingData(), a, "derive", o), s(a.getRawBindingData(), a, "bind", o), a = a.getParent(), o += 1;
|
|
11227
|
-
return
|
|
11366
|
+
return { resolved: r, sources: i };
|
|
11228
11367
|
}
|
|
11229
11368
|
/**
|
|
11230
11369
|
* data-bind 属性の値をパースします。
|
|
@@ -11253,10 +11392,10 @@ const h = class h {
|
|
|
11253
11392
|
* @param node 追加するノード
|
|
11254
11393
|
*/
|
|
11255
11394
|
static addNode(e, t) {
|
|
11256
|
-
const r =
|
|
11395
|
+
const r = C.get(e);
|
|
11257
11396
|
if (r.isSkipMutationNodes())
|
|
11258
11397
|
return;
|
|
11259
|
-
const i =
|
|
11398
|
+
const i = C.get(t.nextSibling), n = C.get(t);
|
|
11260
11399
|
if (n) {
|
|
11261
11400
|
if (n.getParent() === r)
|
|
11262
11401
|
return;
|
|
@@ -11269,7 +11408,7 @@ const h = class h {
|
|
|
11269
11408
|
* @param node 削除するノード
|
|
11270
11409
|
*/
|
|
11271
11410
|
static removeNode(e) {
|
|
11272
|
-
const t =
|
|
11411
|
+
const t = C.get(e);
|
|
11273
11412
|
if (t) {
|
|
11274
11413
|
const r = t.getParent();
|
|
11275
11414
|
if (r && r.isSkipMutationNodes())
|
|
@@ -11284,7 +11423,7 @@ const h = class h {
|
|
|
11284
11423
|
* @param text 新しいテキスト
|
|
11285
11424
|
*/
|
|
11286
11425
|
static changeText(e, t) {
|
|
11287
|
-
const r =
|
|
11426
|
+
const r = C.get(e);
|
|
11288
11427
|
r && r.setContent(t);
|
|
11289
11428
|
}
|
|
11290
11429
|
/**
|
|
@@ -11296,7 +11435,7 @@ const h = class h {
|
|
|
11296
11435
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
11297
11436
|
*/
|
|
11298
11437
|
static changeValue(e, t) {
|
|
11299
|
-
const r =
|
|
11438
|
+
const r = C.get(e);
|
|
11300
11439
|
if (r.getValue() === t)
|
|
11301
11440
|
return Promise.resolve();
|
|
11302
11441
|
const i = [];
|
|
@@ -11469,7 +11608,7 @@ const h = class h {
|
|
|
11469
11608
|
);
|
|
11470
11609
|
return;
|
|
11471
11610
|
}
|
|
11472
|
-
const { sources: r } = h.
|
|
11611
|
+
const { sources: r } = h.collectScope(e.getTarget()), i = /* @__PURE__ */ new Set(), n = t.match(/[A-Za-z_$][\w$]*/g) ?? [];
|
|
11473
11612
|
let s = 0;
|
|
11474
11613
|
n.forEach((o) => {
|
|
11475
11614
|
const l = t.indexOf(o, s);
|
|
@@ -11497,9 +11636,9 @@ const h = class h {
|
|
|
11497
11636
|
static evaluateIf(e) {
|
|
11498
11637
|
const t = [], r = e.getAttribute(`${c.prefix}if`);
|
|
11499
11638
|
if (h.isHiddenIfCondition(r))
|
|
11500
|
-
|
|
11639
|
+
j.isEnabled() && e.isVisible() && h.logFalsyIfDiagnostics(e), t.push(
|
|
11501
11640
|
e.hide().then(() => {
|
|
11502
|
-
|
|
11641
|
+
O.hide(e.getTarget());
|
|
11503
11642
|
})
|
|
11504
11643
|
);
|
|
11505
11644
|
else {
|
|
@@ -11511,7 +11650,7 @@ const h = class h {
|
|
|
11511
11650
|
) : s instanceof ee && n.push(h.evaluateText(s));
|
|
11512
11651
|
}), t.push(
|
|
11513
11652
|
e.show().then(() => {
|
|
11514
|
-
|
|
11653
|
+
O.show(e.getTarget()), i || (h.triggerLoadOnShow(e), ie.refreshSubtree(e.getTarget()));
|
|
11515
11654
|
})
|
|
11516
11655
|
), t.push(Promise.all(n).then(() => {
|
|
11517
11656
|
}));
|
|
@@ -11558,7 +11697,7 @@ const h = class h {
|
|
|
11558
11697
|
* @return 差分更新(再実行を含む)の完了 Promise
|
|
11559
11698
|
*/
|
|
11560
11699
|
static evaluateEach(e) {
|
|
11561
|
-
if (
|
|
11700
|
+
if (j.isEnabled() && Q.recordRowScopeIdentifiers([
|
|
11562
11701
|
h.getRowScopeName(e, "each-arg"),
|
|
11563
11702
|
h.getRowScopeName(e, "each-index")
|
|
11564
11703
|
]), !e.isVisible() || !e.isMounted())
|
|
@@ -11745,10 +11884,10 @@ ${r}
|
|
|
11745
11884
|
(l) => !l.hasAttribute(`${c.prefix}each-before`) && !l.hasAttribute(`${c.prefix}each-after`)
|
|
11746
11885
|
).forEach((l) => {
|
|
11747
11886
|
if (!s) {
|
|
11748
|
-
const d =
|
|
11887
|
+
const d = C.get(l);
|
|
11749
11888
|
d instanceof I && (r = d.clone(), h.markFreshInitializationSkippable(r), e.setTemplate(r), s = !0);
|
|
11750
11889
|
}
|
|
11751
|
-
const u =
|
|
11890
|
+
const u = C.get(l);
|
|
11752
11891
|
u instanceof I && e.getChildren().includes(u) && (e.removeChild(u), u.setMounted(!1)), l.parentNode && l.parentNode.removeChild(l);
|
|
11753
11892
|
});
|
|
11754
11893
|
}
|
|
@@ -11994,7 +12133,7 @@ ${r}
|
|
|
11994
12133
|
* @returns プロファイル
|
|
11995
12134
|
*/
|
|
11996
12135
|
static getOrCreateDerivedSubtreeProfile(e) {
|
|
11997
|
-
if (!
|
|
12136
|
+
if (!j.isEnabled() || !e.hasAttribute(`${c.prefix}derive`))
|
|
11998
12137
|
return null;
|
|
11999
12138
|
const t = h.DERIVE_SUBTREE_PROFILES.get(e);
|
|
12000
12139
|
if (t)
|
|
@@ -12161,13 +12300,13 @@ ${r}
|
|
|
12161
12300
|
);
|
|
12162
12301
|
const p = d.map((E) => E.getListKey()), g = /* @__PURE__ */ new Set();
|
|
12163
12302
|
d = d.filter((E, S) => {
|
|
12164
|
-
const M = String(E.getListKey()),
|
|
12165
|
-
if (
|
|
12303
|
+
const M = String(E.getListKey()), V = l.get(M) ?? 0;
|
|
12304
|
+
if (V === 0) {
|
|
12166
12305
|
g.add(E);
|
|
12167
12306
|
const P = E.getListKey();
|
|
12168
|
-
return P !== null &&
|
|
12307
|
+
return P !== null && O.rowRemove(E.getTarget(), P, S), u.push(E.remove()), !1;
|
|
12169
12308
|
}
|
|
12170
|
-
return l.set(M,
|
|
12309
|
+
return l.set(M, V - 1), !0;
|
|
12171
12310
|
});
|
|
12172
12311
|
const A = d.map((E) => E.getListKey()), v = /* @__PURE__ */ new Map();
|
|
12173
12312
|
d.forEach((E) => {
|
|
@@ -12177,27 +12316,27 @@ ${r}
|
|
|
12177
12316
|
const M = v.get(S);
|
|
12178
12317
|
M ? M.push(E) : v.set(S, [E]);
|
|
12179
12318
|
});
|
|
12180
|
-
const D = e.getChildElementFragments().filter((E) => !g.has(E)),
|
|
12319
|
+
const D = e.getChildElementFragments().filter((E) => !g.has(E)), k = D.filter(
|
|
12181
12320
|
(E) => E.hasAttribute(`${c.prefix}each-before`)
|
|
12182
12321
|
).length;
|
|
12183
|
-
let
|
|
12322
|
+
let H = Promise.resolve();
|
|
12184
12323
|
return a.forEach((E, S) => {
|
|
12185
|
-
const M = t[S],
|
|
12324
|
+
const M = t[S], V = S;
|
|
12186
12325
|
let P;
|
|
12187
12326
|
const _ = v.get(E)?.shift();
|
|
12188
12327
|
if (_) {
|
|
12189
12328
|
P = _;
|
|
12190
|
-
const x =
|
|
12191
|
-
|
|
12329
|
+
const x = k + S;
|
|
12330
|
+
H = H.then(
|
|
12192
12331
|
() => h.updateRowFragment(
|
|
12193
12332
|
P,
|
|
12194
12333
|
M,
|
|
12195
12334
|
i,
|
|
12196
|
-
|
|
12335
|
+
V,
|
|
12197
12336
|
s ? String(s) : null,
|
|
12198
12337
|
E
|
|
12199
12338
|
).then(
|
|
12200
|
-
(
|
|
12339
|
+
(q) => (
|
|
12201
12340
|
// 再利用行も新しい並び順の位置へ移動する。移動しないと、配列を並べ替え
|
|
12202
12341
|
// ただけの更新(data-each-key 指定時はキーが変わらないため全行が再利用
|
|
12203
12342
|
// される)で DOM の順序が古いまま残る。
|
|
@@ -12207,12 +12346,12 @@ ${r}
|
|
|
12207
12346
|
D,
|
|
12208
12347
|
x
|
|
12209
12348
|
).then((X) => {
|
|
12210
|
-
if (X !== null &&
|
|
12349
|
+
if (X !== null && O.rowMove(
|
|
12211
12350
|
P.getTarget(),
|
|
12212
12351
|
E,
|
|
12213
|
-
X -
|
|
12352
|
+
X - k,
|
|
12214
12353
|
S
|
|
12215
|
-
), !!
|
|
12354
|
+
), !!q)
|
|
12216
12355
|
return h.evaluateAll(P).then(
|
|
12217
12356
|
() => h.applyRowFormValues(e, P, M)
|
|
12218
12357
|
);
|
|
@@ -12222,38 +12361,38 @@ ${r}
|
|
|
12222
12361
|
);
|
|
12223
12362
|
} else {
|
|
12224
12363
|
P = r.clone();
|
|
12225
|
-
const x =
|
|
12226
|
-
|
|
12364
|
+
const x = k + S;
|
|
12365
|
+
H = H.then(
|
|
12227
12366
|
() => h.updateRowFragment(
|
|
12228
12367
|
P,
|
|
12229
12368
|
M,
|
|
12230
12369
|
i,
|
|
12231
|
-
|
|
12370
|
+
V,
|
|
12232
12371
|
s ? String(s) : null,
|
|
12233
12372
|
E
|
|
12234
12373
|
).then(() => {
|
|
12235
|
-
const
|
|
12236
|
-
return e.insertBefore(P,
|
|
12374
|
+
const q = D[x] ?? null;
|
|
12375
|
+
return e.insertBefore(P, q).then(() => {
|
|
12237
12376
|
D.splice(x, 0, P);
|
|
12238
12377
|
}).then(() => h.initializeFreshEachRow(P)).then(() => h.applyRowFormValues(e, P, M)).then(() => {
|
|
12239
|
-
|
|
12378
|
+
O.rowAdd(P.getTarget(), E, V, M);
|
|
12240
12379
|
});
|
|
12241
12380
|
})
|
|
12242
12381
|
);
|
|
12243
12382
|
}
|
|
12244
|
-
}), Promise.all(u).then(() =>
|
|
12383
|
+
}), Promise.all(u).then(() => H).then(() => {
|
|
12245
12384
|
const E = a.filter(
|
|
12246
12385
|
(x) => x !== null
|
|
12247
12386
|
), S = A.filter(
|
|
12248
12387
|
(x) => x !== null
|
|
12249
|
-
), M = new Set(S),
|
|
12388
|
+
), M = new Set(S), V = E.filter((x) => !M.has(x)), _ = p.filter(
|
|
12250
12389
|
(x) => x !== null
|
|
12251
12390
|
).filter(
|
|
12252
12391
|
(x) => !o.has(x)
|
|
12253
12392
|
);
|
|
12254
|
-
|
|
12393
|
+
O.eachUpdate(
|
|
12255
12394
|
e.getTarget(),
|
|
12256
|
-
|
|
12395
|
+
V,
|
|
12257
12396
|
_,
|
|
12258
12397
|
E
|
|
12259
12398
|
);
|
|
@@ -12271,7 +12410,7 @@ ${r}
|
|
|
12271
12410
|
* @returns 戻り値はありません。
|
|
12272
12411
|
*/
|
|
12273
12412
|
static warnDuplicateEachKey(e) {
|
|
12274
|
-
!
|
|
12413
|
+
!j.isEnabled() || h.WARNED_DUPLICATE_EACH_KEYS.has(e) || (h.WARNED_DUPLICATE_EACH_KEYS.add(e), y.warn(
|
|
12275
12414
|
"[Haori]",
|
|
12276
12415
|
`${c.prefix}each-key="${e}" の値が配列の中で重複しています。行は出現順で対応付けますが、キーによる行の識別はできません。`
|
|
12277
12416
|
));
|
|
@@ -12511,7 +12650,7 @@ h.ATTRIBUTE_ALIAS_SUFFIX = "attr-", h.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
12511
12650
|
"enhance",
|
|
12512
12651
|
"enhance-new"
|
|
12513
12652
|
]), h.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), h.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), h.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), h.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), h.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), h.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), h.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), h.ABSENT_PATH = Symbol("absent");
|
|
12514
|
-
let
|
|
12653
|
+
let B = h;
|
|
12515
12654
|
const me = class me {
|
|
12516
12655
|
/**
|
|
12517
12656
|
* コンストラクタ。
|
|
@@ -12536,7 +12675,7 @@ const me = class me {
|
|
|
12536
12675
|
* @returns 戻り値はない。
|
|
12537
12676
|
*/
|
|
12538
12677
|
runWindowLoadProcedure() {
|
|
12539
|
-
const e = document.documentElement, t =
|
|
12678
|
+
const e = document.documentElement, t = C.get(e);
|
|
12540
12679
|
t && new re(t, "load").run();
|
|
12541
12680
|
}
|
|
12542
12681
|
/**
|
|
@@ -12660,7 +12799,7 @@ const me = class me {
|
|
|
12660
12799
|
this.root.querySelectorAll(`[${this.onAttributeName}]`).forEach((i) => {
|
|
12661
12800
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
12662
12801
|
return;
|
|
12663
|
-
const n =
|
|
12802
|
+
const n = C.get(i);
|
|
12664
12803
|
n instanceof I && new re(n, "on", t).run().catch((s) => {
|
|
12665
12804
|
y.error("[Haori]", "Procedure execution error:", s);
|
|
12666
12805
|
});
|
|
@@ -12724,7 +12863,7 @@ const me = class me {
|
|
|
12724
12863
|
* @returns 戻り値はない。
|
|
12725
12864
|
*/
|
|
12726
12865
|
runProcedureFor(e, t, r) {
|
|
12727
|
-
const i =
|
|
12866
|
+
const i = C.get(e);
|
|
12728
12867
|
if (!i)
|
|
12729
12868
|
return;
|
|
12730
12869
|
(t === "change" || t === "input") && this.syncUserEdit(e, t === "change");
|
|
@@ -12781,7 +12920,7 @@ const me = class me {
|
|
|
12781
12920
|
* @returns 戻り値はない。
|
|
12782
12921
|
*/
|
|
12783
12922
|
markUserEditOnly(e) {
|
|
12784
|
-
const t =
|
|
12923
|
+
const t = C.get(e);
|
|
12785
12924
|
t instanceof I && t.markUserEdit();
|
|
12786
12925
|
}
|
|
12787
12926
|
/**
|
|
@@ -12797,13 +12936,13 @@ const me = class me {
|
|
|
12797
12936
|
* @returns 戻り値はない。
|
|
12798
12937
|
*/
|
|
12799
12938
|
syncUserEdit(e, t) {
|
|
12800
|
-
const r =
|
|
12939
|
+
const r = C.get(e);
|
|
12801
12940
|
if (r instanceof I && (r.syncValue(), t ? r.markUserEditOnChange() : r.markUserEdit(), e instanceof HTMLInputElement && e.type === "radio" && e.name)) {
|
|
12802
12941
|
const i = document.getElementsByName(e.name);
|
|
12803
12942
|
for (const n of Array.from(i)) {
|
|
12804
12943
|
if (n === e || !(n instanceof HTMLInputElement) || n.type !== "radio" || n.form !== e.form)
|
|
12805
12944
|
continue;
|
|
12806
|
-
const s =
|
|
12945
|
+
const s = C.get(n);
|
|
12807
12946
|
s instanceof I && (s.syncValue(), s.markUserEdit());
|
|
12808
12947
|
}
|
|
12809
12948
|
}
|
|
@@ -12858,7 +12997,7 @@ me.HISTORY_STATE_KEY = "__haoriHistoryState__", me.BUILTIN_EVENT_NAMES = /* @__P
|
|
|
12858
12997
|
"load"
|
|
12859
12998
|
]);
|
|
12860
12999
|
let Ue = me;
|
|
12861
|
-
const
|
|
13000
|
+
const W = class W {
|
|
12862
13001
|
/**
|
|
12863
13002
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
12864
13003
|
*
|
|
@@ -12872,33 +13011,33 @@ const q = class q {
|
|
|
12872
13011
|
return typeof t < "u" && e instanceof t;
|
|
12873
13012
|
}
|
|
12874
13013
|
static syncTree(e) {
|
|
12875
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
12876
|
-
|
|
13014
|
+
(e instanceof Element || e instanceof DocumentFragment) && (W.isHtmlElement(e) && W.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
13015
|
+
W.syncElement(t);
|
|
12877
13016
|
}));
|
|
12878
13017
|
}
|
|
12879
13018
|
static syncElement(e) {
|
|
12880
|
-
const t =
|
|
12881
|
-
if (!r || !
|
|
12882
|
-
t && (t.observer.disconnect(),
|
|
13019
|
+
const t = W.registrations.get(e), r = C.get(e);
|
|
13020
|
+
if (!r || !W.shouldObserve(r)) {
|
|
13021
|
+
t && (t.observer.disconnect(), W.registrations.delete(e));
|
|
12883
13022
|
return;
|
|
12884
13023
|
}
|
|
12885
13024
|
if (typeof IntersectionObserver > "u")
|
|
12886
13025
|
return;
|
|
12887
|
-
const i =
|
|
12888
|
-
if (t && t.observer.root === i && t.observer.rootMargin === n &&
|
|
13026
|
+
const i = W.resolveRoot(r), n = W.resolveRootMargin(r), s = W.resolveThreshold(r), a = r.hasAttribute(`${c.prefix}intersect-once`);
|
|
13027
|
+
if (t && t.observer.root === i && t.observer.rootMargin === n && W.sameThreshold(
|
|
12889
13028
|
t.observer.thresholds,
|
|
12890
13029
|
s
|
|
12891
13030
|
) && t.once === a) {
|
|
12892
13031
|
t.fragment = r;
|
|
12893
13032
|
return;
|
|
12894
13033
|
}
|
|
12895
|
-
t && (t.observer.disconnect(),
|
|
13034
|
+
t && (t.observer.disconnect(), W.registrations.delete(e));
|
|
12896
13035
|
const o = new IntersectionObserver(
|
|
12897
13036
|
(l) => {
|
|
12898
|
-
const u =
|
|
13037
|
+
const u = W.registrations.get(e);
|
|
12899
13038
|
u && l.forEach((d) => {
|
|
12900
|
-
!d.isIntersecting || u.running ||
|
|
12901
|
-
p && u.once && (u.observer.disconnect(),
|
|
13039
|
+
!d.isIntersecting || u.running || W.isDisabled(u.fragment) || (u.running = !0, new re(u.fragment, "intersect").runWithResult().then((p) => {
|
|
13040
|
+
p && u.once && (u.observer.disconnect(), W.registrations.delete(e));
|
|
12902
13041
|
}).catch((p) => {
|
|
12903
13042
|
y.error(
|
|
12904
13043
|
"[Haori]",
|
|
@@ -12906,7 +13045,7 @@ const q = class q {
|
|
|
12906
13045
|
p
|
|
12907
13046
|
);
|
|
12908
13047
|
}).finally(() => {
|
|
12909
|
-
const p =
|
|
13048
|
+
const p = W.registrations.get(e);
|
|
12910
13049
|
p && (p.running = !1);
|
|
12911
13050
|
}));
|
|
12912
13051
|
});
|
|
@@ -12917,7 +13056,7 @@ const q = class q {
|
|
|
12917
13056
|
threshold: s
|
|
12918
13057
|
}
|
|
12919
13058
|
);
|
|
12920
|
-
o.observe(e),
|
|
13059
|
+
o.observe(e), W.registrations.set(e, {
|
|
12921
13060
|
fragment: r,
|
|
12922
13061
|
observer: o,
|
|
12923
13062
|
once: a,
|
|
@@ -12925,26 +13064,26 @@ const q = class q {
|
|
|
12925
13064
|
});
|
|
12926
13065
|
}
|
|
12927
13066
|
static cleanupTree(e) {
|
|
12928
|
-
if (
|
|
12929
|
-
const t =
|
|
12930
|
-
t && (t.observer.disconnect(),
|
|
13067
|
+
if (W.isHtmlElement(e)) {
|
|
13068
|
+
const t = W.registrations.get(e);
|
|
13069
|
+
t && (t.observer.disconnect(), W.registrations.delete(e));
|
|
12931
13070
|
}
|
|
12932
13071
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
12933
|
-
const r =
|
|
12934
|
-
r && (r.observer.disconnect(),
|
|
13072
|
+
const r = W.registrations.get(t);
|
|
13073
|
+
r && (r.observer.disconnect(), W.registrations.delete(t));
|
|
12935
13074
|
});
|
|
12936
13075
|
}
|
|
12937
13076
|
static disconnectAll() {
|
|
12938
|
-
|
|
13077
|
+
W.registrations.forEach((e) => {
|
|
12939
13078
|
e.observer.disconnect();
|
|
12940
|
-
}),
|
|
13079
|
+
}), W.registrations.clear();
|
|
12941
13080
|
}
|
|
12942
13081
|
static shouldObserve(e) {
|
|
12943
13082
|
return e.getAttributeNames().some((t) => {
|
|
12944
13083
|
if (!t.startsWith(`${c.prefix}intersect-`))
|
|
12945
13084
|
return !1;
|
|
12946
13085
|
const r = t.slice(`${c.prefix}intersect-`.length);
|
|
12947
|
-
return !
|
|
13086
|
+
return !W.CONFIG_KEYS.has(r);
|
|
12948
13087
|
});
|
|
12949
13088
|
}
|
|
12950
13089
|
static resolveRoot(e) {
|
|
@@ -12955,7 +13094,7 @@ const q = class q {
|
|
|
12955
13094
|
if (typeof r != "string" || r.trim() === "")
|
|
12956
13095
|
return null;
|
|
12957
13096
|
const i = z.query(r, t, document);
|
|
12958
|
-
return
|
|
13097
|
+
return W.isHtmlElement(i) ? i : (y.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
12959
13098
|
}
|
|
12960
13099
|
static resolveRootMargin(e) {
|
|
12961
13100
|
const t = `${c.prefix}intersect-root-margin`, r = e.getAttribute(t);
|
|
@@ -12978,14 +13117,14 @@ const q = class q {
|
|
|
12978
13117
|
return e.length === 1 && e[0] === t;
|
|
12979
13118
|
}
|
|
12980
13119
|
};
|
|
12981
|
-
|
|
13120
|
+
W.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
12982
13121
|
"root",
|
|
12983
13122
|
"root-margin",
|
|
12984
13123
|
"threshold",
|
|
12985
13124
|
"disabled",
|
|
12986
13125
|
"once"
|
|
12987
|
-
]),
|
|
12988
|
-
let he =
|
|
13126
|
+
]), W.registrations = /* @__PURE__ */ new Map();
|
|
13127
|
+
let he = W;
|
|
12989
13128
|
const w = class w {
|
|
12990
13129
|
/**
|
|
12991
13130
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
@@ -13011,7 +13150,7 @@ const w = class w {
|
|
|
13011
13150
|
const t = w.registrations.get(e);
|
|
13012
13151
|
if (!t && !w.hasPollAttribute(e))
|
|
13013
13152
|
return;
|
|
13014
|
-
const r =
|
|
13153
|
+
const r = C.get(e);
|
|
13015
13154
|
if (!(r instanceof I) || !w.shouldObserve(r)) {
|
|
13016
13155
|
t && w.teardown(e, t);
|
|
13017
13156
|
return;
|
|
@@ -13220,7 +13359,7 @@ const w = class w {
|
|
|
13220
13359
|
*/
|
|
13221
13360
|
static async handleTimeout(e) {
|
|
13222
13361
|
const t = w.registrations.get(e);
|
|
13223
|
-
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected &&
|
|
13362
|
+
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected && O.pollTimeout(
|
|
13224
13363
|
e,
|
|
13225
13364
|
t.count,
|
|
13226
13365
|
w.elapsed(t)
|
|
@@ -13240,7 +13379,7 @@ const w = class w {
|
|
|
13240
13379
|
w.registrations.delete(e);
|
|
13241
13380
|
return;
|
|
13242
13381
|
}
|
|
13243
|
-
await w.injectState(t), e.isConnected &&
|
|
13382
|
+
await w.injectState(t), e.isConnected && O.pollStop(
|
|
13244
13383
|
e,
|
|
13245
13384
|
r,
|
|
13246
13385
|
t.count,
|
|
@@ -13326,7 +13465,7 @@ const w = class w {
|
|
|
13326
13465
|
...i.getRawBindingData() ?? {},
|
|
13327
13466
|
_poll: r
|
|
13328
13467
|
};
|
|
13329
|
-
return
|
|
13468
|
+
return B.setBindingData(n, s, {
|
|
13330
13469
|
reflectToAttribute: !1,
|
|
13331
13470
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
13332
13471
|
// 解除しない)。
|
|
@@ -13381,7 +13520,7 @@ const w = class w {
|
|
|
13381
13520
|
return n.forEach((a) => {
|
|
13382
13521
|
if (!a.isConnected)
|
|
13383
13522
|
return;
|
|
13384
|
-
const o =
|
|
13523
|
+
const o = C.get(a);
|
|
13385
13524
|
o instanceof I && s.push(o);
|
|
13386
13525
|
}), s;
|
|
13387
13526
|
}
|
|
@@ -13530,7 +13669,7 @@ w.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
13530
13669
|
"state"
|
|
13531
13670
|
]), w.DEFAULT_INTERVAL_MS = 5e3, w.MIN_INTERVAL_MS = 100, w.registrations = /* @__PURE__ */ new Map(), w.visibilityListener = null;
|
|
13532
13671
|
let pe = w;
|
|
13533
|
-
const Vt = "0.45.
|
|
13672
|
+
const Vt = "0.45.2";
|
|
13534
13673
|
function qt(m) {
|
|
13535
13674
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => m()) : Promise.resolve().then(m);
|
|
13536
13675
|
}
|
|
@@ -13564,7 +13703,7 @@ const L = class L {
|
|
|
13564
13703
|
* @param element 対象要素
|
|
13565
13704
|
*/
|
|
13566
13705
|
static syncElement(e) {
|
|
13567
|
-
const t = L.registrations.get(e), r =
|
|
13706
|
+
const t = L.registrations.get(e), r = C.get(e);
|
|
13568
13707
|
if (!(r instanceof I) || !L.shouldObserve(r)) {
|
|
13569
13708
|
t && (t.observer.disconnect(), L.registrations.delete(e));
|
|
13570
13709
|
return;
|
|
@@ -13780,7 +13919,7 @@ const L = class L {
|
|
|
13780
13919
|
};
|
|
13781
13920
|
n[e.varName] = { ...t };
|
|
13782
13921
|
const s = e.fragment.getTarget(), a = i === s ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([e.fragment]);
|
|
13783
|
-
|
|
13922
|
+
B.setBindingData(i, n, {
|
|
13784
13923
|
skipFragments: a,
|
|
13785
13924
|
reflectToAttribute: !1,
|
|
13786
13925
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
@@ -13834,8 +13973,8 @@ const G = class G {
|
|
|
13834
13973
|
G._dispatcher = e, e.startDeferred();
|
|
13835
13974
|
try {
|
|
13836
13975
|
const t = await Promise.allSettled([
|
|
13837
|
-
|
|
13838
|
-
|
|
13976
|
+
B.scan(document.head),
|
|
13977
|
+
B.scan(document.body)
|
|
13839
13978
|
]), [r, i] = t;
|
|
13840
13979
|
r.status !== "fulfilled" && y.error(
|
|
13841
13980
|
"[Haori]",
|
|
@@ -13849,7 +13988,7 @@ const G = class G {
|
|
|
13849
13988
|
} finally {
|
|
13850
13989
|
e.release();
|
|
13851
13990
|
}
|
|
13852
|
-
|
|
13991
|
+
O.ready(Vt);
|
|
13853
13992
|
}
|
|
13854
13993
|
/**
|
|
13855
13994
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -13950,9 +14089,9 @@ const G = class G {
|
|
|
13950
14089
|
switch (r.type) {
|
|
13951
14090
|
case "attributes": {
|
|
13952
14091
|
const i = r.target;
|
|
13953
|
-
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(Ae) && (r.attributeName === "disabled" || r.attributeName === Ae) || r.attributeName &&
|
|
14092
|
+
if (r.attributeName && i.hasAttribute("data-haori-click-lock") && (r.attributeName === "disabled" || r.attributeName === "data-haori-click-lock") || r.attributeName && i.hasAttribute(Ae) && (r.attributeName === "disabled" || r.attributeName === Ae) || r.attributeName && (r.attributeName === `${c.prefix}if-false` || r.attributeName === "style" && i.hasAttribute(`${c.prefix}if-false`)) || r.attributeName && B.isAliasedAttributeReflection(i, r.attributeName))
|
|
13954
14093
|
break;
|
|
13955
|
-
|
|
14094
|
+
B.setAttribute(
|
|
13956
14095
|
i,
|
|
13957
14096
|
r.attributeName,
|
|
13958
14097
|
i.getAttribute(r.attributeName),
|
|
@@ -13963,14 +14102,14 @@ const G = class G {
|
|
|
13963
14102
|
}
|
|
13964
14103
|
case "childList": {
|
|
13965
14104
|
Array.from(r.removedNodes).forEach((i) => {
|
|
13966
|
-
he.cleanupTree(i), pe.cleanupTree(i), oe.cleanupTree(i),
|
|
14105
|
+
he.cleanupTree(i), pe.cleanupTree(i), oe.cleanupTree(i), B.removeNode(i);
|
|
13967
14106
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
13968
|
-
i.parentElement instanceof Element && (
|
|
14107
|
+
i.parentElement instanceof Element && (B.addNode(i.parentElement, i), he.syncTree(i), pe.syncTree(i), oe.syncTree(i));
|
|
13969
14108
|
}), r.target instanceof Element && oe.syncElement(r.target);
|
|
13970
14109
|
break;
|
|
13971
14110
|
}
|
|
13972
14111
|
case "characterData": {
|
|
13973
|
-
r.target instanceof Text || r.target instanceof Comment ?
|
|
14112
|
+
r.target instanceof Text || r.target instanceof Comment ? B.changeText(r.target, r.target.textContent) : y.warn(
|
|
13974
14113
|
"[Haori]",
|
|
13975
14114
|
"Unsupported character data type:",
|
|
13976
14115
|
r.target
|
|
@@ -13987,15 +14126,15 @@ const G = class G {
|
|
|
13987
14126
|
}
|
|
13988
14127
|
};
|
|
13989
14128
|
G._initialized = !1, G._mutationObservers = [], G._dispatcher = null;
|
|
13990
|
-
let
|
|
13991
|
-
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
|
|
14129
|
+
let Ce = G;
|
|
14130
|
+
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Ce.init) : Ce.init();
|
|
13992
14131
|
const Wt = () => ye.waitForRenders(), jt = ye.enhancers;
|
|
13993
14132
|
export {
|
|
13994
|
-
|
|
14133
|
+
B as Core,
|
|
13995
14134
|
ie as Enhance,
|
|
13996
14135
|
c as Env,
|
|
13997
14136
|
F as Form,
|
|
13998
|
-
|
|
14137
|
+
C as Fragment,
|
|
13999
14138
|
ye as Haori,
|
|
14000
14139
|
y as Log,
|
|
14001
14140
|
K as Queue,
|