haori 0.55.0 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +2 -2
- package/README.md +2 -2
- package/dist/haori.cjs.js +19 -18
- package/dist/haori.es.js +834 -801
- package/dist/haori.iife.js +19 -18
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -149,7 +149,7 @@ class m {
|
|
|
149
149
|
console.error(e, ...t);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:",
|
|
152
|
+
const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:", C = class C {
|
|
153
153
|
/**
|
|
154
154
|
* 外部ライブラリ連携を登録します。
|
|
155
155
|
*
|
|
@@ -171,8 +171,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
171
171
|
m.error("[Haori]", `Enhancer "${r}" must have an init function.`);
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
C.enhancers.set(r, t), C.warnedUnknownNames.delete(r), typeof document < "u" && document.body && C.forEachTarget(document.body, (i) => {
|
|
175
|
+
C.visited.has(i) && C.applyElement(i);
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
178
|
/**
|
|
@@ -183,7 +183,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
183
183
|
* @returns 戻り値はありません。
|
|
184
184
|
*/
|
|
185
185
|
static setMutationCapture(e) {
|
|
186
|
-
|
|
186
|
+
C.mutationCapture = e;
|
|
187
187
|
}
|
|
188
188
|
/**
|
|
189
189
|
* 登録済みの連携かどうかを返します。
|
|
@@ -192,7 +192,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
192
192
|
* @returns 登録済みなら true
|
|
193
193
|
*/
|
|
194
194
|
static has(e) {
|
|
195
|
-
return
|
|
195
|
+
return C.enhancers.has(e);
|
|
196
196
|
}
|
|
197
197
|
/**
|
|
198
198
|
* 対象要素とその子孫へ、まだ適用していない連携を適用します。
|
|
@@ -204,8 +204,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
204
204
|
* @returns 戻り値はありません。
|
|
205
205
|
*/
|
|
206
206
|
static applySubtree(e) {
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
C.forEachTarget(e, (t) => {
|
|
208
|
+
C.visited.add(t), C.applyElement(t);
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
@@ -215,7 +215,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
215
215
|
* @returns 1 つでも適用済みの連携があれば true
|
|
216
216
|
*/
|
|
217
217
|
static isApplied(e) {
|
|
218
|
-
return (
|
|
218
|
+
return (C.instances.get(e)?.size ?? 0) > 0;
|
|
219
219
|
}
|
|
220
220
|
/**
|
|
221
221
|
* 対象要素とその子孫の連携を再同期します。
|
|
@@ -230,8 +230,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
230
230
|
* @returns 戻り値はありません。
|
|
231
231
|
*/
|
|
232
232
|
static refreshSubtree(e, t = !0) {
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
C.forEachTarget(e, (r) => {
|
|
234
|
+
C.refreshElement(r, t);
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
/**
|
|
@@ -243,8 +243,8 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
243
243
|
* @returns 戻り値はありません。
|
|
244
244
|
*/
|
|
245
245
|
static destroySubtree(e) {
|
|
246
|
-
|
|
247
|
-
|
|
246
|
+
C.forEachTarget(e, (t) => {
|
|
247
|
+
C.destroyElement(t);
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
/**
|
|
@@ -271,27 +271,27 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
271
271
|
static applyElement(e) {
|
|
272
272
|
if (e.closest(`[${l.prefix}if-false]`))
|
|
273
273
|
return;
|
|
274
|
-
const t =
|
|
275
|
-
|
|
274
|
+
const t = C.instances.get(e) ?? null;
|
|
275
|
+
C.names(e, `${l.prefix}enhance`).forEach((r) => {
|
|
276
276
|
if (t?.has(r))
|
|
277
277
|
return;
|
|
278
|
-
const i =
|
|
278
|
+
const i = C.enhancers.get(r);
|
|
279
279
|
if (!i) {
|
|
280
|
-
|
|
280
|
+
C.warnUnknownName(r);
|
|
281
281
|
return;
|
|
282
282
|
}
|
|
283
|
-
|
|
283
|
+
C.run(`enhance "${r}"`, () => {
|
|
284
284
|
const n = i.init(e);
|
|
285
|
-
|
|
285
|
+
C.appliedKeys(e).set(r, n);
|
|
286
286
|
});
|
|
287
|
-
}),
|
|
287
|
+
}), C.names(e, `${l.prefix}enhance-new`).forEach((r) => {
|
|
288
288
|
const i = `${ze}${r}`;
|
|
289
|
-
if (
|
|
289
|
+
if (C.instances.get(e)?.has(i))
|
|
290
290
|
return;
|
|
291
|
-
const n =
|
|
292
|
-
n !== null &&
|
|
291
|
+
const n = C.resolveGlobal(r);
|
|
292
|
+
n !== null && C.run(`enhance-new "${r}"`, () => {
|
|
293
293
|
const s = new n(e);
|
|
294
|
-
|
|
294
|
+
C.appliedKeys(e).set(i, s);
|
|
295
295
|
});
|
|
296
296
|
});
|
|
297
297
|
}
|
|
@@ -303,15 +303,15 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
303
303
|
* @returns 戻り値はありません。
|
|
304
304
|
*/
|
|
305
305
|
static refreshElement(e, t) {
|
|
306
|
-
const r =
|
|
307
|
-
|
|
306
|
+
const r = C.instances.get(e);
|
|
307
|
+
C.names(e, `${l.prefix}enhance`).forEach((i) => {
|
|
308
308
|
if (!r || !r.has(i))
|
|
309
309
|
return;
|
|
310
|
-
const n =
|
|
311
|
-
!n || typeof n.refresh != "function" ||
|
|
310
|
+
const n = C.enhancers.get(i);
|
|
311
|
+
!n || typeof n.refresh != "function" || C.run(`enhance "${i}" refresh`, () => {
|
|
312
312
|
n.refresh(e, r.get(i));
|
|
313
313
|
});
|
|
314
|
-
}), t &&
|
|
314
|
+
}), t && C.applyElement(e);
|
|
315
315
|
}
|
|
316
316
|
/**
|
|
317
317
|
* 1 要素の連携を破棄します。
|
|
@@ -320,15 +320,15 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
320
320
|
* @returns 戻り値はありません。
|
|
321
321
|
*/
|
|
322
322
|
static destroyElement(e) {
|
|
323
|
-
const t =
|
|
323
|
+
const t = C.instances.get(e);
|
|
324
324
|
t && (t.forEach((r, i) => {
|
|
325
325
|
if (i.startsWith(ze))
|
|
326
326
|
return;
|
|
327
|
-
const n =
|
|
328
|
-
!n || typeof n.destroy != "function" ||
|
|
327
|
+
const n = C.enhancers.get(i);
|
|
328
|
+
!n || typeof n.destroy != "function" || C.run(`enhance "${i}" destroy`, () => {
|
|
329
329
|
n.destroy(e, r);
|
|
330
330
|
});
|
|
331
|
-
}),
|
|
331
|
+
}), C.instances.delete(e));
|
|
332
332
|
}
|
|
333
333
|
/**
|
|
334
334
|
* 要素の適用状況を返します(無ければ作成します)。
|
|
@@ -337,11 +337,11 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
337
337
|
* @returns キー → インスタンスの対応
|
|
338
338
|
*/
|
|
339
339
|
static appliedKeys(e) {
|
|
340
|
-
const t =
|
|
340
|
+
const t = C.instances.get(e);
|
|
341
341
|
if (t)
|
|
342
342
|
return t;
|
|
343
343
|
const r = /* @__PURE__ */ new Map();
|
|
344
|
-
return
|
|
344
|
+
return C.instances.set(e, r), r;
|
|
345
345
|
}
|
|
346
346
|
/**
|
|
347
347
|
* 空白区切りの属性値を名前の一覧へ分解します。
|
|
@@ -382,7 +382,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
382
382
|
if (t = t[r], t === void 0)
|
|
383
383
|
break;
|
|
384
384
|
}
|
|
385
|
-
return typeof t != "function" ? (W.isEnabled() && !
|
|
385
|
+
return typeof t != "function" ? (W.isEnabled() && !C.warnedMissingGlobals.has(e) && (C.warnedMissingGlobals.add(e), m.warn(
|
|
386
386
|
"[Haori]",
|
|
387
387
|
`${l.prefix}enhance-new could not resolve the global reference (load the library before Haori runs): ${e}`
|
|
388
388
|
)), null) : t;
|
|
@@ -394,7 +394,7 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
394
394
|
* @returns 戻り値はありません。
|
|
395
395
|
*/
|
|
396
396
|
static warnUnknownName(e) {
|
|
397
|
-
!W.isEnabled() ||
|
|
397
|
+
!W.isEnabled() || C.warnedUnknownNames.has(e) || (C.warnedUnknownNames.add(e), m.warn(
|
|
398
398
|
"[Haori]",
|
|
399
399
|
`Enhancer "${e}" is not registered yet; the declaration is kept pending and applied when it is registered (Haori.enhancers.register('${e}', {init(el) {...}})).`
|
|
400
400
|
));
|
|
@@ -417,11 +417,11 @@ const At = /^[A-Za-z_$][A-Za-z0-9_$]*(\.[A-Za-z_$][A-Za-z0-9_$]*)*$/, ze = "new:
|
|
|
417
417
|
m.error("[Haori]", `${e} failed:`, i);
|
|
418
418
|
}
|
|
419
419
|
};
|
|
420
|
-
|
|
420
|
+
C.mutationCapture ? C.mutationCapture(r) : r();
|
|
421
421
|
}
|
|
422
422
|
};
|
|
423
|
-
|
|
424
|
-
let re =
|
|
423
|
+
C.enhancers = /* @__PURE__ */ new Map(), C.instances = /* @__PURE__ */ new WeakMap(), C.warnedUnknownNames = /* @__PURE__ */ new Set(), C.warnedMissingGlobals = /* @__PURE__ */ new Set(), C.visited = /* @__PURE__ */ new WeakSet(), C.mutationCapture = null;
|
|
424
|
+
let re = C;
|
|
425
425
|
const et = "yyyy/MM/dd HH:mm", vt = "en-US", Ge = 1e4;
|
|
426
426
|
function ue(b) {
|
|
427
427
|
return String(b).padStart(2, "0");
|
|
@@ -555,16 +555,16 @@ function ot(b, e, t = {}) {
|
|
|
555
555
|
a.add(d);
|
|
556
556
|
for (let d = Math.max(0, i - n); d <= Math.min(r - 1, i + n); d += 1)
|
|
557
557
|
a.add(d);
|
|
558
|
-
const o = Array.from(a).sort((d,
|
|
558
|
+
const o = Array.from(a).sort((d, p) => d - p), c = [];
|
|
559
559
|
let u = null;
|
|
560
560
|
for (const d of o) {
|
|
561
561
|
if (u !== null && d - u > 1)
|
|
562
562
|
if (d - u === 2) {
|
|
563
|
-
const
|
|
563
|
+
const p = u + 1;
|
|
564
564
|
c.push({
|
|
565
|
-
page:
|
|
566
|
-
label:
|
|
567
|
-
active:
|
|
565
|
+
page: p,
|
|
566
|
+
label: p + 1,
|
|
567
|
+
active: p === i,
|
|
568
568
|
ellipsis: !1
|
|
569
569
|
});
|
|
570
570
|
} else
|
|
@@ -1450,11 +1450,11 @@ ${t}`;
|
|
|
1450
1450
|
if (this.containsDangerousPatterns(e)) {
|
|
1451
1451
|
const d = this.detectDisallowedKeywords(e);
|
|
1452
1452
|
if (d.length > 0) {
|
|
1453
|
-
const
|
|
1453
|
+
const p = d.some((y) => y === "function" || y === "return") ? " Statement keywords are not allowed in expressions; use an arrow function such as `x => ({key: value})` instead of `function(x){ return {key: value}; }`." : " These are statement keywords and cannot be used in expressions.";
|
|
1454
1454
|
m.warn(
|
|
1455
1455
|
"[Haori]",
|
|
1456
1456
|
e,
|
|
1457
|
-
"Expression uses disallowed keyword(s): " + d.join(", ") + "." +
|
|
1457
|
+
"Expression uses disallowed keyword(s): " + d.join(", ") + "." + p
|
|
1458
1458
|
);
|
|
1459
1459
|
} else
|
|
1460
1460
|
m.warn(
|
|
@@ -1509,7 +1509,7 @@ ${t}`;
|
|
|
1509
1509
|
if (W.isEnabled()) {
|
|
1510
1510
|
const d = this.extractBoundIdentifiers(e);
|
|
1511
1511
|
this.recordScopeMissingIdentifiers(
|
|
1512
|
-
d.size === 0 ? c : c.filter((
|
|
1512
|
+
d.size === 0 ? c : c.filter((p) => !d.has(p)),
|
|
1513
1513
|
e
|
|
1514
1514
|
);
|
|
1515
1515
|
}
|
|
@@ -1518,20 +1518,20 @@ ${t}`;
|
|
|
1518
1518
|
});
|
|
1519
1519
|
const u = o ? [] : c;
|
|
1520
1520
|
for (let d = 0; d <= this.MAX_IDENTIFIER_RECOVERY_COUNT; d += 1) {
|
|
1521
|
-
const
|
|
1521
|
+
const p = this.prepareEvaluator(
|
|
1522
1522
|
e,
|
|
1523
1523
|
a,
|
|
1524
1524
|
u
|
|
1525
1525
|
);
|
|
1526
|
-
if (
|
|
1526
|
+
if (p.compileFailed || p.evaluator === null)
|
|
1527
1527
|
return { value: null, unresolvedReference: !1 };
|
|
1528
1528
|
try {
|
|
1529
1529
|
const y = [], E = this.wrapBoundValues(a);
|
|
1530
|
-
|
|
1531
|
-
y.push(E[
|
|
1530
|
+
p.bindKeys.forEach((D) => {
|
|
1531
|
+
y.push(E[D]);
|
|
1532
1532
|
});
|
|
1533
1533
|
const A = this.withBlockedPropertyAccess(
|
|
1534
|
-
() =>
|
|
1534
|
+
() => p.evaluator(...y)
|
|
1535
1535
|
);
|
|
1536
1536
|
return A === void 0 && this.warnBlockedIdentifiers(e), {
|
|
1537
1537
|
value: A,
|
|
@@ -1594,12 +1594,12 @@ ${t}`;
|
|
|
1594
1594
|
evaluator: u,
|
|
1595
1595
|
compileFailed: !1
|
|
1596
1596
|
};
|
|
1597
|
-
const d = this.buildAssignments(n),
|
|
1597
|
+
const d = this.buildAssignments(n), p = this.buildShadowDeclarations(o), y = this.toGuardedMemberExpression(
|
|
1598
1598
|
this.toOptionalChainExpression(e)
|
|
1599
1599
|
), E = d ? `"use strict";
|
|
1600
1600
|
${d};
|
|
1601
|
-
return (${y});${
|
|
1602
|
-
return (${y});${
|
|
1601
|
+
return (${y});${p}` : `"use strict";
|
|
1602
|
+
return (${y});${p}`;
|
|
1603
1603
|
try {
|
|
1604
1604
|
return u = new Function(...n, E), this.EXPRESSION_CACHE.set(c, u), this.compileFailedExpressions.delete(e), {
|
|
1605
1605
|
bindKeys: n,
|
|
@@ -2497,12 +2497,12 @@ R.MAX_IDENTIFIER_RECOVERY_COUNT = 8, R.BUILTIN_NAMESPACE = "haori", R.BUILTIN_HE
|
|
|
2497
2497
|
"..."
|
|
2498
2498
|
]), R.strictComparisonSplits = /* @__PURE__ */ new Map(), R.WRAPPED_VALUES = /* @__PURE__ */ new WeakSet();
|
|
2499
2499
|
let ne = R;
|
|
2500
|
-
const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fieldset",
|
|
2500
|
+
const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fieldset", $ = class $ {
|
|
2501
2501
|
/**
|
|
2502
2502
|
* 集計状態を初期化します。
|
|
2503
2503
|
*/
|
|
2504
2504
|
static reset() {
|
|
2505
|
-
|
|
2505
|
+
$.ELEMENT_STORES.clear(), $.ensureGlobalAccess();
|
|
2506
2506
|
}
|
|
2507
2507
|
/**
|
|
2508
2508
|
* 集計を開始します。
|
|
@@ -2510,7 +2510,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2510
2510
|
* @returns 戻り値はありません。
|
|
2511
2511
|
*/
|
|
2512
2512
|
static start() {
|
|
2513
|
-
|
|
2513
|
+
$.collecting = !0;
|
|
2514
2514
|
}
|
|
2515
2515
|
/**
|
|
2516
2516
|
* 集計を停止します。
|
|
@@ -2518,7 +2518,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2518
2518
|
* @returns 戻り値はありません。
|
|
2519
2519
|
*/
|
|
2520
2520
|
static stop() {
|
|
2521
|
-
|
|
2521
|
+
$.collecting = !1;
|
|
2522
2522
|
}
|
|
2523
2523
|
/**
|
|
2524
2524
|
* 集計中かどうかを返します。
|
|
@@ -2526,7 +2526,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2526
2526
|
* @returns 集計中なら true
|
|
2527
2527
|
*/
|
|
2528
2528
|
static isCollecting() {
|
|
2529
|
-
return
|
|
2529
|
+
return $.collecting && W.isEnabled();
|
|
2530
2530
|
}
|
|
2531
2531
|
/**
|
|
2532
2532
|
* 現在の集計結果スナップショットを返します。
|
|
@@ -2534,7 +2534,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2534
2534
|
* @returns エレメントごとの集計結果
|
|
2535
2535
|
*/
|
|
2536
2536
|
static snapshot() {
|
|
2537
|
-
return
|
|
2537
|
+
return $.ensureGlobalAccess(), [...$.ELEMENT_STORES.entries()].map(([e, t]) => ({
|
|
2538
2538
|
elementId: e,
|
|
2539
2539
|
tagName: t.tagName,
|
|
2540
2540
|
attributes: [...t.attributes.entries()].map(([r, i]) => ({
|
|
@@ -2543,7 +2543,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2543
2543
|
calls: i.calls,
|
|
2544
2544
|
totalDurationMs: i.totalDurationMs,
|
|
2545
2545
|
maxDurationMs: i.maxDurationMs,
|
|
2546
|
-
placeholders:
|
|
2546
|
+
placeholders: $.sortPlaceholders(
|
|
2547
2547
|
i.placeholders
|
|
2548
2548
|
)
|
|
2549
2549
|
})).sort((r, i) => i.calls - r.calls),
|
|
@@ -2553,7 +2553,7 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2553
2553
|
calls: i.calls,
|
|
2554
2554
|
totalDurationMs: i.totalDurationMs,
|
|
2555
2555
|
maxDurationMs: i.maxDurationMs,
|
|
2556
|
-
placeholders:
|
|
2556
|
+
placeholders: $.sortPlaceholders(
|
|
2557
2557
|
i.placeholders
|
|
2558
2558
|
)
|
|
2559
2559
|
})).sort((r, i) => i.calls - r.calls)
|
|
@@ -2577,13 +2577,13 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2577
2577
|
* @param limit 出力する宣言の数。既定は 20
|
|
2578
2578
|
* @returns 要約。合計は `limit` で絞る前の全件から求める
|
|
2579
2579
|
*/
|
|
2580
|
-
static report(e =
|
|
2580
|
+
static report(e = $.DEFAULT_REPORT_LIMIT) {
|
|
2581
2581
|
const t = /* @__PURE__ */ new Map();
|
|
2582
2582
|
let r = 0, i = 0;
|
|
2583
2583
|
const n = (c, u, d) => {
|
|
2584
2584
|
r += d.totalDurationMs, i += d.calls;
|
|
2585
|
-
const
|
|
2586
|
-
if (
|
|
2585
|
+
const p = t.get(c);
|
|
2586
|
+
if (p === void 0) {
|
|
2587
2587
|
t.set(c, {
|
|
2588
2588
|
where: u,
|
|
2589
2589
|
template: d.template,
|
|
@@ -2596,12 +2596,12 @@ const me = "data-haori-if-disabled", Ye = "input, select, textarea, button, fiel
|
|
|
2596
2596
|
});
|
|
2597
2597
|
return;
|
|
2598
2598
|
}
|
|
2599
|
-
|
|
2600
|
-
|
|
2599
|
+
p.elements += 1, p.calls += d.calls, p.totalDurationMs += d.totalDurationMs, p.maxDurationMs = Math.max(
|
|
2600
|
+
p.maxDurationMs,
|
|
2601
2601
|
d.maxDurationMs
|
|
2602
|
-
), d.totalDurationMs >
|
|
2602
|
+
), d.totalDurationMs > p.representativeDurationMs && (p.where = u, p.representativeDurationMs = d.totalDurationMs);
|
|
2603
2603
|
};
|
|
2604
|
-
|
|
2604
|
+
$.snapshot().forEach((c) => {
|
|
2605
2605
|
c.attributes.forEach((u) => {
|
|
2606
2606
|
n(
|
|
2607
2607
|
`@${u.name}
|
|
@@ -2631,7 +2631,7 @@ ${u.template}`,
|
|
|
2631
2631
|
entryCount: s.length,
|
|
2632
2632
|
top: a
|
|
2633
2633
|
};
|
|
2634
|
-
return
|
|
2634
|
+
return $.logReport(o), o;
|
|
2635
2635
|
}
|
|
2636
2636
|
/**
|
|
2637
2637
|
* 要約を表形式でコンソールへ出力します。
|
|
@@ -2661,30 +2661,30 @@ ${u.template}`,
|
|
|
2661
2661
|
* @param expressions 今回評価した式一覧
|
|
2662
2662
|
*/
|
|
2663
2663
|
static record(e, t, r) {
|
|
2664
|
-
if (!W.isEnabled() || !e || t.length === 0 || (
|
|
2664
|
+
if (!W.isEnabled() || !e || t.length === 0 || ($.ensureGlobalAccess(), !$.isCollecting()))
|
|
2665
2665
|
return;
|
|
2666
|
-
const i =
|
|
2666
|
+
const i = $.getOrCreateElementStore(
|
|
2667
2667
|
e.element
|
|
2668
2668
|
);
|
|
2669
2669
|
if (e.kind === "attribute") {
|
|
2670
|
-
const s =
|
|
2670
|
+
const s = $.getOrCreateCounter(
|
|
2671
2671
|
i.attributes,
|
|
2672
2672
|
e.rawName,
|
|
2673
2673
|
e.template
|
|
2674
2674
|
);
|
|
2675
|
-
|
|
2675
|
+
$.updateCounter(
|
|
2676
2676
|
s,
|
|
2677
2677
|
t,
|
|
2678
2678
|
r
|
|
2679
2679
|
);
|
|
2680
2680
|
return;
|
|
2681
2681
|
}
|
|
2682
|
-
const n =
|
|
2682
|
+
const n = $.getOrCreateCounter(
|
|
2683
2683
|
i.texts,
|
|
2684
2684
|
String(e.childIndex),
|
|
2685
2685
|
e.template
|
|
2686
2686
|
);
|
|
2687
|
-
|
|
2687
|
+
$.updateCounter(
|
|
2688
2688
|
n,
|
|
2689
2689
|
t,
|
|
2690
2690
|
r
|
|
@@ -2697,12 +2697,12 @@ ${u.template}`,
|
|
|
2697
2697
|
if (!W.isEnabled())
|
|
2698
2698
|
return;
|
|
2699
2699
|
const e = globalThis;
|
|
2700
|
-
e[
|
|
2701
|
-
start: () =>
|
|
2702
|
-
stop: () =>
|
|
2703
|
-
reset: () =>
|
|
2704
|
-
snapshot: () =>
|
|
2705
|
-
report: (t) =>
|
|
2700
|
+
e[$.GLOBAL_KEY] === void 0 && (e[$.GLOBAL_KEY] = {
|
|
2701
|
+
start: () => $.start(),
|
|
2702
|
+
stop: () => $.stop(),
|
|
2703
|
+
reset: () => $.reset(),
|
|
2704
|
+
snapshot: () => $.snapshot(),
|
|
2705
|
+
report: (t) => $.report(t)
|
|
2706
2706
|
});
|
|
2707
2707
|
}
|
|
2708
2708
|
/**
|
|
@@ -2712,7 +2712,7 @@ ${u.template}`,
|
|
|
2712
2712
|
* @returns 集計ストア
|
|
2713
2713
|
*/
|
|
2714
2714
|
static getOrCreateElementStore(e) {
|
|
2715
|
-
const t =
|
|
2715
|
+
const t = $.createElementId(e), r = $.ELEMENT_STORES.get(t);
|
|
2716
2716
|
if (r)
|
|
2717
2717
|
return r;
|
|
2718
2718
|
const i = {
|
|
@@ -2720,7 +2720,7 @@ ${u.template}`,
|
|
|
2720
2720
|
attributes: /* @__PURE__ */ new Map(),
|
|
2721
2721
|
texts: /* @__PURE__ */ new Map()
|
|
2722
2722
|
};
|
|
2723
|
-
return
|
|
2723
|
+
return $.ELEMENT_STORES.set(t, i), i;
|
|
2724
2724
|
}
|
|
2725
2725
|
/**
|
|
2726
2726
|
* カウンタを取得または初期化します。
|
|
@@ -2770,7 +2770,7 @@ ${u.template}`,
|
|
|
2770
2770
|
*/
|
|
2771
2771
|
static updateCounter(e, t, r) {
|
|
2772
2772
|
e.calls += 1, e.totalDurationMs += r, e.maxDurationMs = Math.max(e.maxDurationMs, r), t.forEach((i) => {
|
|
2773
|
-
const n =
|
|
2773
|
+
const n = $.getOrCreatePlaceholder(
|
|
2774
2774
|
e.placeholders,
|
|
2775
2775
|
i.expression
|
|
2776
2776
|
);
|
|
@@ -2809,12 +2809,12 @@ ${u.template}`,
|
|
|
2809
2809
|
* @returns 結果と所要時間
|
|
2810
2810
|
*/
|
|
2811
2811
|
static measure(e) {
|
|
2812
|
-
if (
|
|
2812
|
+
if (!$.isCollecting())
|
|
2813
2813
|
return { value: e(), durationMs: 0 };
|
|
2814
|
-
const t =
|
|
2814
|
+
const t = $.now();
|
|
2815
2815
|
return {
|
|
2816
2816
|
value: e(),
|
|
2817
|
-
durationMs:
|
|
2817
|
+
durationMs: $.now() - t
|
|
2818
2818
|
};
|
|
2819
2819
|
}
|
|
2820
2820
|
/**
|
|
@@ -2841,8 +2841,8 @@ ${u.template}`,
|
|
|
2841
2841
|
return t.join(" > ");
|
|
2842
2842
|
}
|
|
2843
2843
|
};
|
|
2844
|
-
|
|
2845
|
-
let Ce =
|
|
2844
|
+
$.GLOBAL_KEY = "__HAORI_EVALUATION_PROFILE__", $.ELEMENT_STORES = /* @__PURE__ */ new Map(), $.collecting = !1, $.DEFAULT_REPORT_LIMIT = 20;
|
|
2845
|
+
let Ce = $;
|
|
2846
2846
|
const de = class de {
|
|
2847
2847
|
/**
|
|
2848
2848
|
* フラグメントのコンストラクタ。
|
|
@@ -3007,8 +3007,8 @@ const de = class de {
|
|
|
3007
3007
|
}
|
|
3008
3008
|
};
|
|
3009
3009
|
de.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
3010
|
-
let
|
|
3011
|
-
const w = class w extends
|
|
3010
|
+
let I = de;
|
|
3011
|
+
const w = class w extends I {
|
|
3012
3012
|
/**
|
|
3013
3013
|
* エレメントフラグメントのコンストラクタ。
|
|
3014
3014
|
* アトリビュートや子フラグメントの作成も行います。
|
|
@@ -3019,7 +3019,7 @@ const w = class w extends D {
|
|
|
3019
3019
|
super(e), this.children = [], this.attributeMap = /* @__PURE__ */ new Map(), this.bindingData = null, this.bindingWorkChain = Promise.resolve(), this.bindingWorkActive = 0, this.lastSupplySequence = 0, this.lastResetSequence = 0, this.initialBindAttribute = null, this.derivedBindingData = null, this.bindingDataCache = null, this.descendantBindingDataCache = null, this.visible = !0, this.display = null, this.displayPriority = null, this.template = null, this.rowLocalTemplate = null, this.listKey = null, this.renderSignature = null, this.eachInputSignature = null, this.deriveSubtreeSignature = null, this.deriveInputSignature = null, this.freshInitializationSkippable = !1, this.initialized = !1, this.value = null, this.selfWritingAttributes = /* @__PURE__ */ new Map(), this.skipChangeValue = !1, this.valueWriteUnapplied = !1, this.pendingValueWrite = null, this.userEditSequence = 0, this.authoritativeValueSequence = 0, this.lastValueSequence = 0, this.lastValueKind = "nonSupply", this.selfWrittenBind = /* @__PURE__ */ new Map(), this.lastPathApplied = /* @__PURE__ */ new Map(), this.lastChangeSequence = 0, w.dropFollowUpArtifacts(e), this.syncValue(), this.initialBindAttribute = e.getAttribute(`${l.prefix}bind`), e.getAttributeNames().forEach((i) => {
|
|
3020
3020
|
const n = e.getAttribute(i);
|
|
3021
3021
|
if (n !== null && !this.attributeMap.has(i)) {
|
|
3022
|
-
const s = new
|
|
3022
|
+
const s = new Me(i, n);
|
|
3023
3023
|
this.attributeMap.set(i, s);
|
|
3024
3024
|
}
|
|
3025
3025
|
});
|
|
@@ -3028,7 +3028,7 @@ const w = class w extends D {
|
|
|
3028
3028
|
e.childNodes.forEach((i) => {
|
|
3029
3029
|
if (w.isOwnedWithinExternal(i))
|
|
3030
3030
|
return;
|
|
3031
|
-
const n =
|
|
3031
|
+
const n = I.peek(i)?.getParent() ?? null, s = I.get(i);
|
|
3032
3032
|
n !== null && n !== this && (t = t ?? n, n === t && r.push(s)), s.setParent(this), this.children.push(s);
|
|
3033
3033
|
}), t !== null && this.takeOverPlaceOf(t, r);
|
|
3034
3034
|
}
|
|
@@ -3068,7 +3068,7 @@ const w = class w extends D {
|
|
|
3068
3068
|
* @returns 取り込まない場合 true
|
|
3069
3069
|
*/
|
|
3070
3070
|
static isOwnedWithinExternal(e) {
|
|
3071
|
-
const r =
|
|
3071
|
+
const r = I.peek(e)?.getParent() ?? null;
|
|
3072
3072
|
if (r === null)
|
|
3073
3073
|
return !1;
|
|
3074
3074
|
const i = r.getTarget().closest(`[${l.prefix}external]`);
|
|
@@ -4103,7 +4103,7 @@ const w = class w extends D {
|
|
|
4103
4103
|
const t = this.getTarget().closest("select");
|
|
4104
4104
|
if (!t)
|
|
4105
4105
|
return !1;
|
|
4106
|
-
const r =
|
|
4106
|
+
const r = I.get(t);
|
|
4107
4107
|
return r instanceof w ? r.hasPendingUserEdit() : !1;
|
|
4108
4108
|
}
|
|
4109
4109
|
/**
|
|
@@ -4368,7 +4368,7 @@ const w = class w extends D {
|
|
|
4368
4368
|
const t = this.getTarget().closest("select");
|
|
4369
4369
|
if (!t)
|
|
4370
4370
|
return;
|
|
4371
|
-
const r =
|
|
4371
|
+
const r = I.get(t);
|
|
4372
4372
|
r instanceof w && r.syncValue();
|
|
4373
4373
|
}
|
|
4374
4374
|
/**
|
|
@@ -4483,7 +4483,7 @@ const w = class w extends D {
|
|
|
4483
4483
|
);
|
|
4484
4484
|
if (r === null)
|
|
4485
4485
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
4486
|
-
const o = new
|
|
4486
|
+
const o = new Me(e, r);
|
|
4487
4487
|
if (n) {
|
|
4488
4488
|
const le = this.attributeMap.get(e);
|
|
4489
4489
|
if (le && (le.isEvaluate || le.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
@@ -4500,8 +4500,8 @@ const w = class w extends D {
|
|
|
4500
4500
|
element: c,
|
|
4501
4501
|
rawName: e,
|
|
4502
4502
|
template: r
|
|
4503
|
-
}), d = o.isEvaluate || o.isRawEvaluate,
|
|
4504
|
-
if (
|
|
4503
|
+
}), d = o.isEvaluate || o.isRawEvaluate, p = e === t && w.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), E = fe.joinEvaluateResults(u.results), A = u.results.length === 1 ? u.results[0] : E, D = t === "value" && w.resolveDeclaredValueType(c) === "boolean", x = A === !1 && !D, B = !o.isForceEvaluation() && (t !== e ? u.hasUnresolvedReference || A === null || A === void 0 || x : p ? u.hasUnresolvedReference || A === null || A === void 0 || A === !1 : y ? u.hasUnresolvedReference || A === null || A === void 0 || x : d && E === "");
|
|
4504
|
+
if (B && u.hasUnresolvedReference && w.warnUnresolvedAttribute(
|
|
4505
4505
|
e,
|
|
4506
4506
|
t,
|
|
4507
4507
|
r,
|
|
@@ -4518,7 +4518,7 @@ const w = class w extends D {
|
|
|
4518
4518
|
c
|
|
4519
4519
|
);
|
|
4520
4520
|
}
|
|
4521
|
-
const
|
|
4521
|
+
const F = o.isForceEvaluation() ? r : y ? A : E, j = i && o.isEvaluate && t === "value" && w.isValuePropertyTarget(c), X = c.getRootNode(), _ = j && w.isUserEditableValue(c) && (c === X.activeElement || this.hasPendingUserEdit()), P = B || F === null || F === !1 && !D ? null : String(F), ae = e !== t && c.getAttribute(e) !== r, G = P === null ? c.hasAttribute(t) : c.getAttribute(t) !== P, T = P === null ? "" : P, L = j && !_ && c.value !== T, Y = t === "checked" && c instanceof HTMLInputElement && (c.type === "checkbox" || c.type === "radio"), Z = t === "selected" && c instanceof HTMLOptionElement, he = X.activeElement, ce = he !== null && (Y && c === he || Z && c.closest("select") === he) || (Y || Z) && this.hasPendingCheckableUserEdit(Z), V = P !== null, K = Y && o.isEvaluate && !ce && c.checked !== V, te = Z && o.isEvaluate && !ce && c.selected !== V;
|
|
4522
4522
|
if (!ae && !G && !L && !K && !te)
|
|
4523
4523
|
return j && !_ && (this.value = this.normalizeValueForElement(
|
|
4524
4524
|
c,
|
|
@@ -4528,7 +4528,7 @@ const w = class w extends D {
|
|
|
4528
4528
|
ae && c.setAttribute(e, r), P === null ? c.removeAttribute(t) : G && (c.setAttribute(t, P), t === `${l.prefix}bind` && this.recordSelfWrittenBind(P)), t === "style" && this.captureAndHideDisplay(), j && !_ && (this.value = this.normalizeValueForElement(
|
|
4529
4529
|
c,
|
|
4530
4530
|
T
|
|
4531
|
-
), L && (c.value = T), this.recordValueWriteResult(c.value === T)), K && (c.checked =
|
|
4531
|
+
), L && (c.value = T), this.recordValueWriteResult(c.value === T)), K && (c.checked = V), te && (c.selected = V), (K || te) && this.syncCheckableValueFromDom(te);
|
|
4532
4532
|
}).finally(() => {
|
|
4533
4533
|
this.releaseSelfWritingAttributes(s);
|
|
4534
4534
|
});
|
|
@@ -4633,7 +4633,7 @@ const w = class w extends D {
|
|
|
4633
4633
|
const i = t ? r.nextSibling : r;
|
|
4634
4634
|
let n = t ? r.nextSibling : r;
|
|
4635
4635
|
for (; n !== null; ) {
|
|
4636
|
-
const s =
|
|
4636
|
+
const s = I.get(n);
|
|
4637
4637
|
if (s !== null) {
|
|
4638
4638
|
const a = this.children.indexOf(s);
|
|
4639
4639
|
if (a !== -1)
|
|
@@ -4671,8 +4671,8 @@ const w = class w extends D {
|
|
|
4671
4671
|
if (t === null)
|
|
4672
4672
|
this.children.push(e);
|
|
4673
4673
|
else {
|
|
4674
|
-
let
|
|
4675
|
-
if (s ? a !== -1 && a < o ?
|
|
4674
|
+
let p;
|
|
4675
|
+
if (s ? a !== -1 && a < o ? p = o - 1 : p = o : p = this.children.indexOf(t), p === -1) {
|
|
4676
4676
|
const y = this.resolveInsertionPointFromDom(
|
|
4677
4677
|
t,
|
|
4678
4678
|
!1
|
|
@@ -4683,7 +4683,7 @@ const w = class w extends D {
|
|
|
4683
4683
|
t
|
|
4684
4684
|
), this.children.push(e)) : (this.children.splice(y.index, 0, e), u = y.referenceNode);
|
|
4685
4685
|
} else
|
|
4686
|
-
this.children.splice(
|
|
4686
|
+
this.children.splice(p, 0, e);
|
|
4687
4687
|
}
|
|
4688
4688
|
e.setParent(this), e.setMounted(this.mounted);
|
|
4689
4689
|
const d = this.skipMutationNodes;
|
|
@@ -4822,7 +4822,7 @@ const w = class w extends D {
|
|
|
4822
4822
|
* @returns 戻り値はありません。
|
|
4823
4823
|
*/
|
|
4824
4824
|
static reassertHiddenDisplay(e) {
|
|
4825
|
-
const t =
|
|
4825
|
+
const t = I.get(e);
|
|
4826
4826
|
t instanceof w && t.hideDisplayWithoutCapture();
|
|
4827
4827
|
}
|
|
4828
4828
|
/**
|
|
@@ -4965,7 +4965,7 @@ w.NUMBER_INPUT_PATTERN = /^-?(?:\d+(?:\.\d+)?|\.\d+)(?:[eE][+-]?\d+)?$/, w.VALUE
|
|
|
4965
4965
|
"week"
|
|
4966
4966
|
], w.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), w.sequenceCounter = 0, w.bindingWorkActiveCount = 0, w.pendingMutationFlusher = null, w.loggedUnresolvedAttributes = /* @__PURE__ */ new Set(), w.loggedTypeMismatchedComparisons = /* @__PURE__ */ new Set();
|
|
4967
4967
|
let S = w;
|
|
4968
|
-
class se extends
|
|
4968
|
+
class se extends I {
|
|
4969
4969
|
/**
|
|
4970
4970
|
* テキストフラグメントのコンストラクタ。
|
|
4971
4971
|
* 対象テキストノードの内容を初期化します。
|
|
@@ -5051,7 +5051,7 @@ class se extends D {
|
|
|
5051
5051
|
});
|
|
5052
5052
|
}
|
|
5053
5053
|
}
|
|
5054
|
-
class We extends
|
|
5054
|
+
class We extends I {
|
|
5055
5055
|
/**
|
|
5056
5056
|
* コメントフラグメントのコンストラクタ。
|
|
5057
5057
|
* 対象コメントノードの内容を初期化します。
|
|
@@ -5092,7 +5092,7 @@ class We extends D {
|
|
|
5092
5092
|
}));
|
|
5093
5093
|
}
|
|
5094
5094
|
}
|
|
5095
|
-
const
|
|
5095
|
+
const $e = class $e {
|
|
5096
5096
|
/**
|
|
5097
5097
|
* コンストラクタ。
|
|
5098
5098
|
*
|
|
@@ -5100,7 +5100,7 @@ const Me = class Me {
|
|
|
5100
5100
|
*/
|
|
5101
5101
|
constructor(e) {
|
|
5102
5102
|
this.contents = [], this.isEvaluate = !1, this.isRawEvaluate = !1, this.value = e;
|
|
5103
|
-
const t = [...e.matchAll(
|
|
5103
|
+
const t = [...e.matchAll($e.PLACEHOLDER_REGEX)];
|
|
5104
5104
|
let r = 0, i = !1, n = !1;
|
|
5105
5105
|
for (const s of t) {
|
|
5106
5106
|
s.index > r && this.contents.push({
|
|
@@ -5231,8 +5231,8 @@ const Me = class Me {
|
|
|
5231
5231
|
), { results: n, hasUnresolvedReference: o };
|
|
5232
5232
|
}
|
|
5233
5233
|
};
|
|
5234
|
-
|
|
5235
|
-
let fe =
|
|
5234
|
+
$e.PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g;
|
|
5235
|
+
let fe = $e;
|
|
5236
5236
|
const ie = class ie extends fe {
|
|
5237
5237
|
/**
|
|
5238
5238
|
* コンストラクタ。
|
|
@@ -5312,7 +5312,7 @@ const ie = class ie extends fe {
|
|
|
5312
5312
|
}
|
|
5313
5313
|
};
|
|
5314
5314
|
ie.FORCE_EVALUATION_SUFFIXES = ["if", "each", "derive"], ie.FORCE_EVALUATION_PREFIXES = ["data-", "hor-"], ie.forceEvaluationNames = null, ie.forceEvaluationPrefix = null;
|
|
5315
|
-
let
|
|
5315
|
+
let Me = ie;
|
|
5316
5316
|
const Se = class Se {
|
|
5317
5317
|
/**
|
|
5318
5318
|
* 実行モードを取得します。
|
|
@@ -5889,7 +5889,7 @@ const h = class h {
|
|
|
5889
5889
|
return h.isDeclarationResolved(e, "value");
|
|
5890
5890
|
if (t instanceof HTMLSelectElement) {
|
|
5891
5891
|
for (const r of Array.from(t.options)) {
|
|
5892
|
-
const i =
|
|
5892
|
+
const i = I.get(r);
|
|
5893
5893
|
if (i instanceof S && h.hasDeclarativeBinding(i, "selected") && !h.isDeclarationResolved(i, "selected"))
|
|
5894
5894
|
return !1;
|
|
5895
5895
|
}
|
|
@@ -6019,7 +6019,7 @@ const h = class h {
|
|
|
6019
6019
|
*/
|
|
6020
6020
|
static hasDeclarativeSelectedOption(e) {
|
|
6021
6021
|
for (const t of Array.from(e.options)) {
|
|
6022
|
-
const r =
|
|
6022
|
+
const r = I.get(t);
|
|
6023
6023
|
if (r instanceof S && h.hasDeclarativeBinding(r, "selected"))
|
|
6024
6024
|
return !0;
|
|
6025
6025
|
}
|
|
@@ -6228,7 +6228,7 @@ const h = class h {
|
|
|
6228
6228
|
const u = h.resolveCollectedValue(e), d = h.isFileInput(e) && Array.isArray(u) ? u : [u];
|
|
6229
6229
|
Array.isArray(t[String(n)]) ? t[String(n)].push(...d) : t[String(n)] = d;
|
|
6230
6230
|
} else if (h.isGroupedCheckable(e)) {
|
|
6231
|
-
const u = e.getTarget(), d = u instanceof HTMLInputElement ? u.checked : !0,
|
|
6231
|
+
const u = e.getTarget(), d = u instanceof HTMLInputElement ? u.checked : !0, p = u instanceof HTMLInputElement ? u.value : e.getValue(), y = d ? p : null, E = String(n);
|
|
6232
6232
|
y === null ? E in t || (t[E] = null) : t[E] === null || t[E] === void 0 ? t[E] = y : Array.isArray(t[E]) ? t[E].push(y) : t[E] = [t[E], y];
|
|
6233
6233
|
} else
|
|
6234
6234
|
t[String(n)] = h.resolveCollectedValue(e);
|
|
@@ -6240,9 +6240,9 @@ const h = class h {
|
|
|
6240
6240
|
h.getPartValues(u, t, r, i);
|
|
6241
6241
|
} else if (s) {
|
|
6242
6242
|
const u = {}, d = i === null ? null : /* @__PURE__ */ new Set();
|
|
6243
|
-
for (const
|
|
6243
|
+
for (const p of e.getChildElementFragments())
|
|
6244
6244
|
h.getPartValues(
|
|
6245
|
-
|
|
6245
|
+
p,
|
|
6246
6246
|
u,
|
|
6247
6247
|
r,
|
|
6248
6248
|
d
|
|
@@ -6253,7 +6253,7 @@ const h = class h {
|
|
|
6253
6253
|
);
|
|
6254
6254
|
} else if (a) {
|
|
6255
6255
|
const u = [], d = [];
|
|
6256
|
-
let
|
|
6256
|
+
let p = !1;
|
|
6257
6257
|
for (const y of e.getChildElementFragments()) {
|
|
6258
6258
|
const E = {}, A = i === null ? null : /* @__PURE__ */ new Set();
|
|
6259
6259
|
h.getPartValues(
|
|
@@ -6261,7 +6261,7 @@ const h = class h {
|
|
|
6261
6261
|
E,
|
|
6262
6262
|
r,
|
|
6263
6263
|
A
|
|
6264
|
-
), A !== null && h.registerCollectedExcludedKeys(E, A), Object.keys(E).length > 0 ? (
|
|
6264
|
+
), A !== null && h.registerCollectedExcludedKeys(E, A), Object.keys(E).length > 0 ? (p = !0, u.push(E), d.push(y.getListKey())) : r !== null && (u.push({}), d.push(y.getListKey()));
|
|
6265
6265
|
}
|
|
6266
6266
|
if (r === null) {
|
|
6267
6267
|
const y = e.getAttribute(`${l.prefix}each-key`);
|
|
@@ -6271,7 +6271,7 @@ const h = class h {
|
|
|
6271
6271
|
d,
|
|
6272
6272
|
h.isCollectedListFromEachSource(e)
|
|
6273
6273
|
), h.warnDerivedRowsWithoutKey(e), t[String(a)] = u;
|
|
6274
|
-
} else
|
|
6274
|
+
} else p && (t[String(a)] = u);
|
|
6275
6275
|
} else
|
|
6276
6276
|
for (const u of e.getChildElementFragments())
|
|
6277
6277
|
h.getPartValues(u, t, r, i);
|
|
@@ -6547,9 +6547,9 @@ const h = class h {
|
|
|
6547
6547
|
return r.querySelectorAll(o).forEach((c) => {
|
|
6548
6548
|
if (!(c instanceof HTMLElement))
|
|
6549
6549
|
return;
|
|
6550
|
-
let u = null, d = !1,
|
|
6551
|
-
for (;
|
|
6552
|
-
|
|
6550
|
+
let u = null, d = !1, p = c;
|
|
6551
|
+
for (; p && p !== r; )
|
|
6552
|
+
p.hasAttribute(`${l.prefix}form-detach`) && (d = !0), (p.hasAttribute(n) || p.hasAttribute(s)) && (u = p), p = p.parentElement;
|
|
6553
6553
|
if (d)
|
|
6554
6554
|
return;
|
|
6555
6555
|
const y = u ?? c, E = y.getAttribute(n) || y.getAttribute(s) || y.getAttribute(`${l.prefix}form-name`) || y.getAttribute("name");
|
|
@@ -6881,7 +6881,7 @@ const h = class h {
|
|
|
6881
6881
|
static createRowKeyIndexes(e, t) {
|
|
6882
6882
|
const r = /* @__PURE__ */ new Map();
|
|
6883
6883
|
return e.forEach((i, n) => {
|
|
6884
|
-
const s =
|
|
6884
|
+
const s = M.createListKey(
|
|
6885
6885
|
i,
|
|
6886
6886
|
t,
|
|
6887
6887
|
n
|
|
@@ -7032,7 +7032,7 @@ const h = class h {
|
|
|
7032
7032
|
static collectShadowingContainers(e) {
|
|
7033
7033
|
const t = `${l.prefix}form-arg`, r = [];
|
|
7034
7034
|
return e.getTarget().querySelectorAll(`form:not([${t}]), [${l.prefix}form]`).forEach((i) => {
|
|
7035
|
-
const n =
|
|
7035
|
+
const n = I.get(i);
|
|
7036
7036
|
if (!(n instanceof S))
|
|
7037
7037
|
return;
|
|
7038
7038
|
const s = n.getRawBindingData();
|
|
@@ -7061,7 +7061,7 @@ const h = class h {
|
|
|
7061
7061
|
const n = { ...i };
|
|
7062
7062
|
for (const s of t)
|
|
7063
7063
|
delete n[s];
|
|
7064
|
-
return
|
|
7064
|
+
return M.setBindingData(e.getTarget(), n, {
|
|
7065
7065
|
kind: r?.kind ?? "supply",
|
|
7066
7066
|
sequence: r?.sequence ?? S.nextSequence()
|
|
7067
7067
|
});
|
|
@@ -7075,7 +7075,7 @@ const h = class h {
|
|
|
7075
7075
|
static collectArgForms(e) {
|
|
7076
7076
|
const t = `${l.prefix}form-arg`, r = e.getTarget().querySelectorAll(`form[${t}]`), i = [];
|
|
7077
7077
|
return r.forEach((n) => {
|
|
7078
|
-
const s =
|
|
7078
|
+
const s = I.get(n);
|
|
7079
7079
|
if (!(s instanceof S))
|
|
7080
7080
|
return;
|
|
7081
7081
|
const a = s.getAttribute(t);
|
|
@@ -7148,7 +7148,7 @@ const h = class h {
|
|
|
7148
7148
|
for (const i of t) {
|
|
7149
7149
|
if (h.INITIAL_RESTORED_FORMS.has(i))
|
|
7150
7150
|
continue;
|
|
7151
|
-
const n =
|
|
7151
|
+
const n = I.get(i);
|
|
7152
7152
|
if (!(n instanceof S))
|
|
7153
7153
|
continue;
|
|
7154
7154
|
const s = n.getRawBindingData(), a = n.getAttribute(`${l.prefix}form-arg`), o = a ? String(a) : null, c = o !== null && !(s && Object.prototype.hasOwnProperty.call(s, o)) ? h.resolveAncestorArgOwner(n, o) : null;
|
|
@@ -7365,37 +7365,37 @@ const h = class h {
|
|
|
7365
7365
|
const o = [];
|
|
7366
7366
|
if (e.hasAttribute(`${l.prefix}form-detach`) && !r)
|
|
7367
7367
|
return Promise.resolve();
|
|
7368
|
-
const c = h.resolveFieldName(e), u = e.getAttribute(`${l.prefix}form-object`), d = e.getAttribute(`${l.prefix}form-list`),
|
|
7368
|
+
const c = h.resolveFieldName(e), u = e.getAttribute(`${l.prefix}form-object`), d = e.getAttribute(`${l.prefix}form-list`), p = e.hasAttribute(`${l.prefix}form-list`);
|
|
7369
7369
|
if (c) {
|
|
7370
7370
|
const y = t[String(c)], E = n && h.hasResolvedDeclarativeState(e), A = n && typeof y > "u" && !h.isDeclarativeStateBound(e);
|
|
7371
|
-
let
|
|
7372
|
-
if (E ?
|
|
7373
|
-
return (
|
|
7371
|
+
let D = y;
|
|
7372
|
+
if (E ? D = void 0 : A && (D = null), h.isFileInput(e))
|
|
7373
|
+
return (D === null || D === "") && o.push(
|
|
7374
7374
|
h.applyFragmentValue(e, null, i, a)
|
|
7375
7375
|
), Promise.all(o).then(() => {
|
|
7376
7376
|
});
|
|
7377
|
-
if (
|
|
7377
|
+
if (p && Array.isArray(D) && // チェックボックスグループと複数選択 select は配列そのものを状態として
|
|
7378
7378
|
// 解釈する(後続の分岐)。位置で配ると選択状態を決められないため、
|
|
7379
7379
|
// `data-form-list` を併記していても従来どおりそちらへ渡す。
|
|
7380
7380
|
!h.isGroupedCheckable(e) && !h.isMultipleSelect(e)) {
|
|
7381
|
-
const
|
|
7382
|
-
s.set(
|
|
7381
|
+
const x = String(c), B = s.get(x) ?? 0;
|
|
7382
|
+
s.set(x, B + 1), o.push(
|
|
7383
7383
|
h.applyFragmentValue(
|
|
7384
7384
|
e,
|
|
7385
|
-
|
|
7385
|
+
D[B] ?? null,
|
|
7386
7386
|
i,
|
|
7387
7387
|
a
|
|
7388
7388
|
)
|
|
7389
7389
|
);
|
|
7390
|
-
} else typeof
|
|
7390
|
+
} else typeof D > "u" || (Array.isArray(D) && h.isGroupedCheckable(e) || Array.isArray(D) && h.isMultipleSelect(e) || typeof D == "string" || typeof D == "number" || typeof D == "boolean" || D === null ? o.push(
|
|
7391
7391
|
h.applyFragmentValue(
|
|
7392
7392
|
e,
|
|
7393
|
-
|
|
7393
|
+
D,
|
|
7394
7394
|
i,
|
|
7395
7395
|
a
|
|
7396
7396
|
)
|
|
7397
7397
|
) : o.push(
|
|
7398
|
-
h.applyFragmentValue(e, String(
|
|
7398
|
+
h.applyFragmentValue(e, String(D), i, a)
|
|
7399
7399
|
));
|
|
7400
7400
|
} else if (u) {
|
|
7401
7401
|
const y = t[String(u)];
|
|
@@ -7417,18 +7417,18 @@ const h = class h {
|
|
|
7417
7417
|
} else if (d) {
|
|
7418
7418
|
const y = t[String(d)];
|
|
7419
7419
|
if (Array.isArray(y)) {
|
|
7420
|
-
const E = e.getChildElementFragments(), A = e.getAttribute(`${l.prefix}each-key`),
|
|
7420
|
+
const E = e.getChildElementFragments(), A = e.getAttribute(`${l.prefix}each-key`), D = h.isCollectedListFromEachSource(e) ? h.pairRowsWithItems(
|
|
7421
7421
|
E,
|
|
7422
7422
|
y,
|
|
7423
7423
|
A == null ? null : String(A)
|
|
7424
7424
|
) : null;
|
|
7425
|
-
for (let
|
|
7426
|
-
const
|
|
7425
|
+
for (let x = 0; x < E.length; x++) {
|
|
7426
|
+
const B = E[x], F = D ? D[x] : y.length > x ? y[x] : null;
|
|
7427
7427
|
o.push(
|
|
7428
7428
|
// 行ごとに values が切り替わるので出現位置も行単位で数える。
|
|
7429
7429
|
h.setPartValues(
|
|
7430
|
-
|
|
7431
|
-
h.asPlainRecord(
|
|
7430
|
+
B,
|
|
7431
|
+
h.asPlainRecord(F) ?? {},
|
|
7432
7432
|
r,
|
|
7433
7433
|
i,
|
|
7434
7434
|
n,
|
|
@@ -7473,7 +7473,7 @@ const h = class h {
|
|
|
7473
7473
|
const r = h.collectBindingTargetForms(e);
|
|
7474
7474
|
if (r.length > 0 && r.every((n) => n.isSupplyStale(t)))
|
|
7475
7475
|
return;
|
|
7476
|
-
h.markResetSubtree(e, t),
|
|
7476
|
+
h.markResetSubtree(e, t), M.clearUserEditMarks(e, t), h.clearValues(e), await Promise.all([
|
|
7477
7477
|
h.clearMessages(e),
|
|
7478
7478
|
h.clearEachClones(e)
|
|
7479
7479
|
]), await z.enqueue(() => {
|
|
@@ -7487,16 +7487,16 @@ const h = class h {
|
|
|
7487
7487
|
} finally {
|
|
7488
7488
|
h.internalResetDepth -= 1;
|
|
7489
7489
|
}
|
|
7490
|
-
h.clearDeclarativeStateFromDom(e),
|
|
7490
|
+
h.clearDeclarativeStateFromDom(e), M.invalidateDerivedSubtreeSignatures(e), h.restoreEdits(n);
|
|
7491
7491
|
});
|
|
7492
7492
|
const i = r;
|
|
7493
7493
|
for (const n of i) {
|
|
7494
7494
|
const s = h.getInitialBindingData(n);
|
|
7495
|
-
s === null && n.getRawBindingData() === null || await
|
|
7495
|
+
s === null && n.getRawBindingData() === null || await M.setBindingData(n.getTarget(), s ?? {}, {
|
|
7496
7496
|
sequence: t
|
|
7497
7497
|
});
|
|
7498
7498
|
}
|
|
7499
|
-
h.syncValuesFromDom(e), await
|
|
7499
|
+
h.syncValuesFromDom(e), await M.evaluateAll(e);
|
|
7500
7500
|
for (const n of i)
|
|
7501
7501
|
h.getInitialBindingData(n) !== null || n.getRawBindingData() !== null || await h.restoreAncestorArgValues(n, {
|
|
7502
7502
|
sequence: t,
|
|
@@ -7516,7 +7516,7 @@ const h = class h {
|
|
|
7516
7516
|
));
|
|
7517
7517
|
} else
|
|
7518
7518
|
c = h.mergeCollectedValues(c, a), h.deleteAncestorOwnedKeys(n, s, c);
|
|
7519
|
-
await
|
|
7519
|
+
await M.setBindingData(n.getTarget(), c, {
|
|
7520
7520
|
sequence: t
|
|
7521
7521
|
});
|
|
7522
7522
|
}
|
|
@@ -7544,7 +7544,7 @@ const h = class h {
|
|
|
7544
7544
|
*/
|
|
7545
7545
|
static getInitialBindingData(e) {
|
|
7546
7546
|
const t = e.getInitialBindAttribute();
|
|
7547
|
-
return t === null ? null :
|
|
7547
|
+
return t === null ? null : M.parseDataBind(t);
|
|
7548
7548
|
}
|
|
7549
7549
|
/**
|
|
7550
7550
|
* フラグメント配下の入力要素について、内部値を現在の DOM 値と再同期します。
|
|
@@ -7571,7 +7571,7 @@ const h = class h {
|
|
|
7571
7571
|
t instanceof HTMLFormElement ? r.push(t) : r.push(...Array.from(t.querySelectorAll("form")));
|
|
7572
7572
|
const i = [];
|
|
7573
7573
|
for (const n of r) {
|
|
7574
|
-
const s =
|
|
7574
|
+
const s = I.get(n);
|
|
7575
7575
|
s instanceof S && i.push(s);
|
|
7576
7576
|
}
|
|
7577
7577
|
return i;
|
|
@@ -7769,7 +7769,7 @@ const h = class h {
|
|
|
7769
7769
|
if (isNaN(u))
|
|
7770
7770
|
m.error("Haori", `Invalid index: ${i}`);
|
|
7771
7771
|
else {
|
|
7772
|
-
const d = e.getChildElementFragments().filter((
|
|
7772
|
+
const d = e.getChildElementFragments().filter((p) => p.hasAttribute(`${l.prefix}row`));
|
|
7773
7773
|
u < d.length && r.push(
|
|
7774
7774
|
...h.findFragmentByKeyParts(d[u], t.slice(1))
|
|
7775
7775
|
);
|
|
@@ -7807,8 +7807,8 @@ h.INITIAL_RESTORED_FORMS = /* @__PURE__ */ new WeakSet(), h.LAST_ANCESTOR_ARG_VA
|
|
|
7807
7807
|
"constructor",
|
|
7808
7808
|
"prototype"
|
|
7809
7809
|
]), h.COLLECTED_ROW_IDENTITY = /* @__PURE__ */ new WeakMap(), h.COMPLETE_SET_VALUES = /* @__PURE__ */ new WeakSet(), h.COLLECTED_EXCLUDED_KEYS = /* @__PURE__ */ new WeakMap(), h.warnedPositionalRowFallbacks = /* @__PURE__ */ new Set(), h.warnedDerivedRowsWithoutKey = /* @__PURE__ */ new Set(), h.LEADING_PATH_PATTERN = /^\s*([A-Za-z_$][\w$]*(?:\s*\.\s*[A-Za-z_$][\w$]*)*)\s*([\s\S]*)$/;
|
|
7810
|
-
let
|
|
7811
|
-
class
|
|
7810
|
+
let N = h;
|
|
7811
|
+
class H {
|
|
7812
7812
|
/**
|
|
7813
7813
|
* カスタムイベントを発火します。
|
|
7814
7814
|
*
|
|
@@ -7832,7 +7832,7 @@ class B {
|
|
|
7832
7832
|
* @param version ライブラリバージョン
|
|
7833
7833
|
*/
|
|
7834
7834
|
static ready(e) {
|
|
7835
|
-
|
|
7835
|
+
H.dispatch(document, "ready", { version: e });
|
|
7836
7836
|
}
|
|
7837
7837
|
/**
|
|
7838
7838
|
* importstartイベントを発火します。
|
|
@@ -7841,7 +7841,7 @@ class B {
|
|
|
7841
7841
|
* @param url インポート対象URL
|
|
7842
7842
|
*/
|
|
7843
7843
|
static importStart(e, t) {
|
|
7844
|
-
|
|
7844
|
+
H.dispatch(e, "importstart", {
|
|
7845
7845
|
url: t,
|
|
7846
7846
|
startedAt: performance.now()
|
|
7847
7847
|
});
|
|
@@ -7855,7 +7855,7 @@ class B {
|
|
|
7855
7855
|
* @param startedAt 開始時刻
|
|
7856
7856
|
*/
|
|
7857
7857
|
static importEnd(e, t, r, i) {
|
|
7858
|
-
|
|
7858
|
+
H.dispatch(e, "importend", {
|
|
7859
7859
|
url: t,
|
|
7860
7860
|
bytes: r,
|
|
7861
7861
|
durationMs: performance.now() - i
|
|
@@ -7869,7 +7869,7 @@ class B {
|
|
|
7869
7869
|
* @param error エラー内容
|
|
7870
7870
|
*/
|
|
7871
7871
|
static importError(e, t, r) {
|
|
7872
|
-
|
|
7872
|
+
H.dispatch(e, "importerror", { url: t, error: r });
|
|
7873
7873
|
}
|
|
7874
7874
|
/**
|
|
7875
7875
|
* bindchangeイベントを発火します。
|
|
@@ -7885,7 +7885,7 @@ class B {
|
|
|
7885
7885
|
const u = t?.[c], d = r[c];
|
|
7886
7886
|
u !== d && n.push(c);
|
|
7887
7887
|
}
|
|
7888
|
-
|
|
7888
|
+
H.dispatch(e, "bindchange", {
|
|
7889
7889
|
previous: t || {},
|
|
7890
7890
|
next: r,
|
|
7891
7891
|
changedKeys: n,
|
|
@@ -7904,7 +7904,7 @@ class B {
|
|
|
7904
7904
|
* @param reason 変更理由
|
|
7905
7905
|
*/
|
|
7906
7906
|
static bindComplete(e, t = null, r = "other") {
|
|
7907
|
-
|
|
7907
|
+
H.dispatch(e, "bindcomplete", { bindArg: t, reason: r });
|
|
7908
7908
|
}
|
|
7909
7909
|
/**
|
|
7910
7910
|
* eachupdateイベントを発火します。
|
|
@@ -7915,7 +7915,7 @@ class B {
|
|
|
7915
7915
|
* @param order 現在の順序
|
|
7916
7916
|
*/
|
|
7917
7917
|
static eachUpdate(e, t, r, i) {
|
|
7918
|
-
|
|
7918
|
+
H.dispatch(e, "eachupdate", {
|
|
7919
7919
|
added: t,
|
|
7920
7920
|
removed: r,
|
|
7921
7921
|
order: i,
|
|
@@ -7931,7 +7931,7 @@ class B {
|
|
|
7931
7931
|
* @param item 行データ
|
|
7932
7932
|
*/
|
|
7933
7933
|
static rowAdd(e, t, r, i) {
|
|
7934
|
-
|
|
7934
|
+
H.dispatch(e, "rowadd", { key: t, index: r, item: i });
|
|
7935
7935
|
}
|
|
7936
7936
|
/**
|
|
7937
7937
|
* rowremoveイベントを発火します。
|
|
@@ -7941,7 +7941,7 @@ class B {
|
|
|
7941
7941
|
* @param index インデックス
|
|
7942
7942
|
*/
|
|
7943
7943
|
static rowRemove(e, t, r) {
|
|
7944
|
-
|
|
7944
|
+
H.dispatch(e, "rowremove", { key: t, index: r });
|
|
7945
7945
|
}
|
|
7946
7946
|
/**
|
|
7947
7947
|
* rowmoveイベントを発火します。
|
|
@@ -7952,7 +7952,7 @@ class B {
|
|
|
7952
7952
|
* @param to 移動後インデックス
|
|
7953
7953
|
*/
|
|
7954
7954
|
static rowMove(e, t, r, i) {
|
|
7955
|
-
|
|
7955
|
+
H.dispatch(e, "rowmove", { key: t, from: r, to: i });
|
|
7956
7956
|
}
|
|
7957
7957
|
/**
|
|
7958
7958
|
* showイベントを発火します。
|
|
@@ -7960,7 +7960,7 @@ class B {
|
|
|
7960
7960
|
* @param target data-if要素
|
|
7961
7961
|
*/
|
|
7962
7962
|
static show(e) {
|
|
7963
|
-
|
|
7963
|
+
H.dispatch(e, "show", { visible: !0 });
|
|
7964
7964
|
}
|
|
7965
7965
|
/**
|
|
7966
7966
|
* hideイベントを発火します。
|
|
@@ -7968,7 +7968,7 @@ class B {
|
|
|
7968
7968
|
* @param target data-if要素
|
|
7969
7969
|
*/
|
|
7970
7970
|
static hide(e) {
|
|
7971
|
-
|
|
7971
|
+
H.dispatch(e, "hide", { visible: !1 });
|
|
7972
7972
|
}
|
|
7973
7973
|
/**
|
|
7974
7974
|
* fetchstartイベントを発火します。
|
|
@@ -7981,7 +7981,7 @@ class B {
|
|
|
7981
7981
|
* @return 戻り値はありません。
|
|
7982
7982
|
*/
|
|
7983
7983
|
static fetchStart(e, t, r, i, n) {
|
|
7984
|
-
|
|
7984
|
+
H.dispatch(e, "fetchstart", {
|
|
7985
7985
|
url: t,
|
|
7986
7986
|
options: r || {},
|
|
7987
7987
|
payload: i,
|
|
@@ -7998,7 +7998,7 @@ class B {
|
|
|
7998
7998
|
* @param startedAt 開始時刻
|
|
7999
7999
|
*/
|
|
8000
8000
|
static fetchEnd(e, t, r, i) {
|
|
8001
|
-
|
|
8001
|
+
H.dispatch(e, "fetchend", {
|
|
8002
8002
|
url: t,
|
|
8003
8003
|
status: r,
|
|
8004
8004
|
durationMs: performance.now() - i
|
|
@@ -8014,7 +8014,7 @@ class B {
|
|
|
8014
8014
|
* @param startedAt 開始時刻(存在する場合)
|
|
8015
8015
|
*/
|
|
8016
8016
|
static fetchError(e, t, r, i, n) {
|
|
8017
|
-
|
|
8017
|
+
H.dispatch(e, "fetcherror", {
|
|
8018
8018
|
url: t,
|
|
8019
8019
|
status: i,
|
|
8020
8020
|
error: r,
|
|
@@ -8030,7 +8030,7 @@ class B {
|
|
|
8030
8030
|
* @return 戻り値はありません。
|
|
8031
8031
|
*/
|
|
8032
8032
|
static pollTimeout(e, t, r) {
|
|
8033
|
-
|
|
8033
|
+
H.dispatch(e, "polltimeout", { count: t, elapsedMs: r });
|
|
8034
8034
|
}
|
|
8035
8035
|
/**
|
|
8036
8036
|
* pollstopイベントを発火します。
|
|
@@ -8044,7 +8044,7 @@ class B {
|
|
|
8044
8044
|
* @return 戻り値はありません。
|
|
8045
8045
|
*/
|
|
8046
8046
|
static pollStop(e, t, r, i) {
|
|
8047
|
-
|
|
8047
|
+
H.dispatch(e, "pollstop", { reason: t, count: r, elapsedMs: i });
|
|
8048
8048
|
}
|
|
8049
8049
|
}
|
|
8050
8050
|
const Nt = {
|
|
@@ -8067,7 +8067,7 @@ function kt(b, e) {
|
|
|
8067
8067
|
return null;
|
|
8068
8068
|
if (!t.includes("{{"))
|
|
8069
8069
|
return t;
|
|
8070
|
-
const r =
|
|
8070
|
+
const r = I.get(b), i = r instanceof S ? r.getBindingData() : {}, n = xt(t, i);
|
|
8071
8071
|
return n === "" ? null : n;
|
|
8072
8072
|
}
|
|
8073
8073
|
function Ct(b, e, t) {
|
|
@@ -8160,7 +8160,7 @@ class J {
|
|
|
8160
8160
|
}
|
|
8161
8161
|
}
|
|
8162
8162
|
}
|
|
8163
|
-
const
|
|
8163
|
+
const k = class k {
|
|
8164
8164
|
/**
|
|
8165
8165
|
* ストレージ種別に対応する `Storage` を解決します。
|
|
8166
8166
|
*
|
|
@@ -8178,7 +8178,7 @@ const x = class x {
|
|
|
8178
8178
|
throw new Error("storage is not available");
|
|
8179
8179
|
return t;
|
|
8180
8180
|
} catch (t) {
|
|
8181
|
-
return
|
|
8181
|
+
return k.WARNED_KINDS.has(e) || (k.WARNED_KINDS.add(e), m.warn(
|
|
8182
8182
|
"Haori",
|
|
8183
8183
|
`${e}Storage が利用できないため ${l.prefix}store を無効にします:`,
|
|
8184
8184
|
t
|
|
@@ -8215,8 +8215,8 @@ const x = class x {
|
|
|
8215
8215
|
* @param message 警告メッセージ
|
|
8216
8216
|
*/
|
|
8217
8217
|
static warnOnce(e, t, r) {
|
|
8218
|
-
let i =
|
|
8219
|
-
i || (i = /* @__PURE__ */ new Set(),
|
|
8218
|
+
let i = k.WARNED_ELEMENTS.get(e);
|
|
8219
|
+
i || (i = /* @__PURE__ */ new Set(), k.WARNED_ELEMENTS.set(e, i)), !i.has(t) && (i.add(t), m.warn("Haori", r));
|
|
8220
8220
|
}
|
|
8221
8221
|
/**
|
|
8222
8222
|
* `data-each` の行の内側かどうかを判定します。
|
|
@@ -8253,13 +8253,13 @@ const x = class x {
|
|
|
8253
8253
|
return null;
|
|
8254
8254
|
const i = r.trim();
|
|
8255
8255
|
if (i === "")
|
|
8256
|
-
return
|
|
8256
|
+
return k.warnOnce(
|
|
8257
8257
|
t,
|
|
8258
8258
|
"key",
|
|
8259
8259
|
`${l.prefix}store にストレージキーが指定されていません。`
|
|
8260
8260
|
), null;
|
|
8261
8261
|
if (i.includes("{{"))
|
|
8262
|
-
return
|
|
8262
|
+
return k.warnOnce(
|
|
8263
8263
|
t,
|
|
8264
8264
|
"expression",
|
|
8265
8265
|
`${l.prefix}store に式は使用できません(静的な文字列を指定してください): ${i}`
|
|
@@ -8268,7 +8268,7 @@ const x = class x {
|
|
|
8268
8268
|
let s = "session";
|
|
8269
8269
|
if (n !== null) {
|
|
8270
8270
|
const d = n.trim();
|
|
8271
|
-
d === "local" || d === "session" ? s = d :
|
|
8271
|
+
d === "local" || d === "session" ? s = d : k.warnOnce(
|
|
8272
8272
|
t,
|
|
8273
8273
|
"type",
|
|
8274
8274
|
`${l.prefix}store-type は session または local を指定してください(session として扱います): ${d}`
|
|
@@ -8277,14 +8277,14 @@ const x = class x {
|
|
|
8277
8277
|
const a = e.getRawAttribute(`${l.prefix}store-arg`), o = a === null || a.trim() === "" ? null : a.trim(), c = e.getRawAttribute(`${l.prefix}store-params`);
|
|
8278
8278
|
let u = null;
|
|
8279
8279
|
if (c !== null) {
|
|
8280
|
-
const d = c.split("&").map((y) => y.trim()).filter((y) => y !== ""),
|
|
8281
|
-
|
|
8280
|
+
const d = c.split("&").map((y) => y.trim()).filter((y) => y !== ""), p = d.filter((y) => !k.isReservedKey(y));
|
|
8281
|
+
p.length !== d.length && k.warnOnce(
|
|
8282
8282
|
t,
|
|
8283
8283
|
"reserved",
|
|
8284
8284
|
`${l.prefix}store-params の予約キー(先頭が _ のキー)は対象外です。`
|
|
8285
|
-
), u =
|
|
8285
|
+
), u = p.length > 0 ? p : null;
|
|
8286
8286
|
}
|
|
8287
|
-
return u === null && o === null ? (
|
|
8287
|
+
return u === null && o === null ? (k.warnOnce(
|
|
8288
8288
|
t,
|
|
8289
8289
|
"target",
|
|
8290
8290
|
`${l.prefix}store には ${l.prefix}store-params または ${l.prefix}store-arg のいずれかが必要です。`
|
|
@@ -8301,7 +8301,7 @@ const x = class x {
|
|
|
8301
8301
|
* @returns レコード。読み取れない場合は null
|
|
8302
8302
|
*/
|
|
8303
8303
|
static readRecord(e) {
|
|
8304
|
-
const t =
|
|
8304
|
+
const t = k.resolveStorage(e.kind);
|
|
8305
8305
|
if (!t)
|
|
8306
8306
|
return null;
|
|
8307
8307
|
let r;
|
|
@@ -8326,7 +8326,7 @@ const x = class x {
|
|
|
8326
8326
|
n
|
|
8327
8327
|
), null;
|
|
8328
8328
|
}
|
|
8329
|
-
return
|
|
8329
|
+
return k.isPlainRecord(i) ? i : (m.warn(
|
|
8330
8330
|
"Haori",
|
|
8331
8331
|
`保存済みデータがオブジェクトではありません: ${e.key}`
|
|
8332
8332
|
), null);
|
|
@@ -8344,7 +8344,7 @@ const x = class x {
|
|
|
8344
8344
|
const s = t[e.arg];
|
|
8345
8345
|
if (s === void 0)
|
|
8346
8346
|
return {};
|
|
8347
|
-
if (!
|
|
8347
|
+
if (!k.isPlainRecord(s))
|
|
8348
8348
|
return m.warn(
|
|
8349
8349
|
"Haori",
|
|
8350
8350
|
`保存済みデータの ${e.arg} がオブジェクトではありません: ` + e.key
|
|
@@ -8353,7 +8353,7 @@ const x = class x {
|
|
|
8353
8353
|
}
|
|
8354
8354
|
const i = e.params ?? Object.keys(r), n = {};
|
|
8355
8355
|
for (const s of i)
|
|
8356
|
-
|
|
8356
|
+
k.isReservedKey(s) || Object.prototype.hasOwnProperty.call(r, s) && (n[s] = r[s]);
|
|
8357
8357
|
return n;
|
|
8358
8358
|
}
|
|
8359
8359
|
/**
|
|
@@ -8370,7 +8370,7 @@ const x = class x {
|
|
|
8370
8370
|
static selectFromData(e, t) {
|
|
8371
8371
|
const r = e.params ?? Object.keys(t), i = {};
|
|
8372
8372
|
for (const n of r) {
|
|
8373
|
-
if (
|
|
8373
|
+
if (k.isReservedKey(n) || !Object.prototype.hasOwnProperty.call(t, n))
|
|
8374
8374
|
continue;
|
|
8375
8375
|
const s = t[n];
|
|
8376
8376
|
s !== void 0 && (i[n] = s);
|
|
@@ -8429,12 +8429,12 @@ const x = class x {
|
|
|
8429
8429
|
* @param selected 基準にする選択内容
|
|
8430
8430
|
*/
|
|
8431
8431
|
static seedSignature(e, t) {
|
|
8432
|
-
const r =
|
|
8432
|
+
const r = k.stringify(t);
|
|
8433
8433
|
if (r === null) {
|
|
8434
|
-
|
|
8434
|
+
k.SIGNATURES.delete(e);
|
|
8435
8435
|
return;
|
|
8436
8436
|
}
|
|
8437
|
-
|
|
8437
|
+
k.SIGNATURES.set(e, { json: r, refs: k.createRefs(t) });
|
|
8438
8438
|
}
|
|
8439
8439
|
/**
|
|
8440
8440
|
* レコードへ選択内容を書き込みます。
|
|
@@ -8448,12 +8448,12 @@ const x = class x {
|
|
|
8448
8448
|
* @returns 書き込めたら true
|
|
8449
8449
|
*/
|
|
8450
8450
|
static writeRecord(e, t) {
|
|
8451
|
-
const r =
|
|
8451
|
+
const r = k.resolveStorage(e.kind);
|
|
8452
8452
|
if (!r)
|
|
8453
8453
|
return !1;
|
|
8454
|
-
const i =
|
|
8454
|
+
const i = k.readRecord(e) ?? {};
|
|
8455
8455
|
if (e.arg !== null) {
|
|
8456
|
-
const n = i[e.arg], s =
|
|
8456
|
+
const n = i[e.arg], s = k.isPlainRecord(n) ? { ...n } : {};
|
|
8457
8457
|
i[e.arg] = { ...s, ...t };
|
|
8458
8458
|
} else
|
|
8459
8459
|
Object.assign(i, t);
|
|
@@ -8478,19 +8478,19 @@ const x = class x {
|
|
|
8478
8478
|
* @returns 復元完了の Promise
|
|
8479
8479
|
*/
|
|
8480
8480
|
static restore(e) {
|
|
8481
|
-
const t =
|
|
8481
|
+
const t = k.readDeclaration(e);
|
|
8482
8482
|
if (!t)
|
|
8483
8483
|
return Promise.resolve();
|
|
8484
8484
|
const r = e.getTarget();
|
|
8485
|
-
if (
|
|
8486
|
-
return
|
|
8485
|
+
if (k.isInsideEachRow(e))
|
|
8486
|
+
return k.warnOnce(
|
|
8487
8487
|
r,
|
|
8488
8488
|
"each-row",
|
|
8489
8489
|
`${l.prefix}each の行の内側では ${l.prefix}store を使用できません(行データは親要素側で配列キーを指定してください)。`
|
|
8490
8490
|
), Promise.resolve();
|
|
8491
|
-
|
|
8492
|
-
const i =
|
|
8493
|
-
return
|
|
8491
|
+
k.RESTORED_ELEMENTS.add(r);
|
|
8492
|
+
const i = k.readRecord(t), n = i ? k.extractFromRecord(t, i) : {}, s = { ...e.getRawBindingData() ?? {}, ...n };
|
|
8493
|
+
return k.seedSignature(r, k.selectFromData(t, s)), Object.keys(n).length === 0 ? Promise.resolve() : M.setBindingData(r, s, {
|
|
8494
8494
|
reentrant: !0,
|
|
8495
8495
|
kind: "nonSupply",
|
|
8496
8496
|
sequence: S.nextSequence()
|
|
@@ -8507,22 +8507,22 @@ const x = class x {
|
|
|
8507
8507
|
* @param fragment 対象フラグメント
|
|
8508
8508
|
*/
|
|
8509
8509
|
static mirror(e) {
|
|
8510
|
-
const t =
|
|
8511
|
-
if (!t ||
|
|
8510
|
+
const t = k.readDeclaration(e);
|
|
8511
|
+
if (!t || k.isInsideEachRow(e))
|
|
8512
8512
|
return;
|
|
8513
8513
|
const r = e.getTarget();
|
|
8514
|
-
if (!
|
|
8514
|
+
if (!k.RESTORED_ELEMENTS.has(r))
|
|
8515
8515
|
return;
|
|
8516
8516
|
const i = e.getRawBindingData();
|
|
8517
8517
|
if (!i)
|
|
8518
8518
|
return;
|
|
8519
|
-
const n =
|
|
8519
|
+
const n = k.selectFromData(t, i);
|
|
8520
8520
|
if (Object.keys(n).length === 0)
|
|
8521
8521
|
return;
|
|
8522
|
-
const s =
|
|
8523
|
-
if (s &&
|
|
8522
|
+
const s = k.SIGNATURES.get(r);
|
|
8523
|
+
if (s && k.hasSameRefs(s, n))
|
|
8524
8524
|
return;
|
|
8525
|
-
const a =
|
|
8525
|
+
const a = k.stringify(n);
|
|
8526
8526
|
if (a === null) {
|
|
8527
8527
|
m.warn(
|
|
8528
8528
|
"Haori",
|
|
@@ -8531,10 +8531,10 @@ const x = class x {
|
|
|
8531
8531
|
return;
|
|
8532
8532
|
}
|
|
8533
8533
|
if (s && s.json === a) {
|
|
8534
|
-
s.refs =
|
|
8534
|
+
s.refs = k.createRefs(n);
|
|
8535
8535
|
return;
|
|
8536
8536
|
}
|
|
8537
|
-
|
|
8537
|
+
k.writeRecord(t, n) && k.SIGNATURES.set(r, { json: a, refs: k.createRefs(n) });
|
|
8538
8538
|
}
|
|
8539
8539
|
/**
|
|
8540
8540
|
* レコードを破棄します。
|
|
@@ -8547,7 +8547,7 @@ const x = class x {
|
|
|
8547
8547
|
* @param kind ストレージ種別
|
|
8548
8548
|
*/
|
|
8549
8549
|
static clear(e, t) {
|
|
8550
|
-
const r =
|
|
8550
|
+
const r = k.resolveStorage(t);
|
|
8551
8551
|
if (r) {
|
|
8552
8552
|
try {
|
|
8553
8553
|
r.removeItem(e);
|
|
@@ -8555,7 +8555,7 @@ const x = class x {
|
|
|
8555
8555
|
m.warn("Haori", `ストレージの破棄に失敗しました: ${e}`, i);
|
|
8556
8556
|
return;
|
|
8557
8557
|
}
|
|
8558
|
-
|
|
8558
|
+
k.reseedDeclaringElements(e, t);
|
|
8559
8559
|
}
|
|
8560
8560
|
}
|
|
8561
8561
|
/**
|
|
@@ -8568,24 +8568,24 @@ const x = class x {
|
|
|
8568
8568
|
document.querySelectorAll(
|
|
8569
8569
|
`[${l.prefix}store]`
|
|
8570
8570
|
).forEach((i) => {
|
|
8571
|
-
if (!
|
|
8571
|
+
if (!k.RESTORED_ELEMENTS.has(i))
|
|
8572
8572
|
return;
|
|
8573
|
-
const n =
|
|
8573
|
+
const n = I.get(i);
|
|
8574
8574
|
if (!(n instanceof S))
|
|
8575
8575
|
return;
|
|
8576
|
-
const s =
|
|
8576
|
+
const s = k.readDeclaration(n);
|
|
8577
8577
|
if (!s || s.key !== e || s.kind !== t)
|
|
8578
8578
|
return;
|
|
8579
8579
|
const a = n.getRawBindingData();
|
|
8580
|
-
|
|
8580
|
+
k.seedSignature(
|
|
8581
8581
|
i,
|
|
8582
|
-
a ?
|
|
8582
|
+
a ? k.selectFromData(s, a) : {}
|
|
8583
8583
|
);
|
|
8584
8584
|
});
|
|
8585
8585
|
}
|
|
8586
8586
|
};
|
|
8587
|
-
|
|
8588
|
-
let Fe =
|
|
8587
|
+
k.SIGNATURES = /* @__PURE__ */ new WeakMap(), k.RESTORED_ELEMENTS = /* @__PURE__ */ new WeakSet(), k.WARNED_ELEMENTS = /* @__PURE__ */ new WeakMap(), k.WARNED_KINDS = /* @__PURE__ */ new Set();
|
|
8588
|
+
let Fe = k;
|
|
8589
8589
|
class mt {
|
|
8590
8590
|
/**
|
|
8591
8591
|
* URLのクエリパラメータを取得します。
|
|
@@ -8632,7 +8632,7 @@ class mt {
|
|
|
8632
8632
|
}
|
|
8633
8633
|
}
|
|
8634
8634
|
}
|
|
8635
|
-
const
|
|
8635
|
+
const Mt = [
|
|
8636
8636
|
"addErrorMessage",
|
|
8637
8637
|
"clearMessages",
|
|
8638
8638
|
"closeDialog",
|
|
@@ -8640,11 +8640,11 @@ const $t = [
|
|
|
8640
8640
|
"dialog",
|
|
8641
8641
|
"openDialog",
|
|
8642
8642
|
"toast"
|
|
8643
|
-
],
|
|
8643
|
+
], $t = "__haoriHistoryState__", Oe = "data-haori-click-lock", Ze = "ファイルを保存できませんでした", Pt = 100;
|
|
8644
8644
|
let De = null;
|
|
8645
8645
|
function ge() {
|
|
8646
8646
|
const e = globalThis.window?.Haori;
|
|
8647
|
-
return
|
|
8647
|
+
return Mt.every(
|
|
8648
8648
|
(r) => typeof e?.[r] == "function"
|
|
8649
8649
|
) ? e : Te;
|
|
8650
8650
|
}
|
|
@@ -8721,7 +8721,7 @@ function bt(b, e, t) {
|
|
|
8721
8721
|
r === void 0 ? b[e] = t : Array.isArray(r) ? r.push(t) : b[e] = [r, t];
|
|
8722
8722
|
}
|
|
8723
8723
|
function ye(b, e) {
|
|
8724
|
-
if (
|
|
8724
|
+
if (N.isCompleteSetValue(e))
|
|
8725
8725
|
return e;
|
|
8726
8726
|
if (Array.isArray(e)) {
|
|
8727
8727
|
const t = Array.isArray(b) ? b.slice() : [];
|
|
@@ -8796,7 +8796,7 @@ function qt(b) {
|
|
|
8796
8796
|
) : Ie(e));
|
|
8797
8797
|
}
|
|
8798
8798
|
function ke(b) {
|
|
8799
|
-
return Ue(
|
|
8799
|
+
return Ue(N.getValues(b));
|
|
8800
8800
|
}
|
|
8801
8801
|
function Ue(b) {
|
|
8802
8802
|
const e = (r) => {
|
|
@@ -8806,7 +8806,7 @@ function Ue(b) {
|
|
|
8806
8806
|
return "";
|
|
8807
8807
|
if (Array.isArray(r)) {
|
|
8808
8808
|
const i = r.map(e);
|
|
8809
|
-
return
|
|
8809
|
+
return N.carryCollectedRowIdentity(r, i), i;
|
|
8810
8810
|
}
|
|
8811
8811
|
if (r !== null && typeof r == "object") {
|
|
8812
8812
|
const i = {};
|
|
@@ -8814,13 +8814,13 @@ function Ue(b) {
|
|
|
8814
8814
|
r
|
|
8815
8815
|
))
|
|
8816
8816
|
i[n] = e(s);
|
|
8817
|
-
return
|
|
8817
|
+
return N.carryCollectedRowIdentity(r, i), i;
|
|
8818
8818
|
}
|
|
8819
8819
|
return r;
|
|
8820
8820
|
}, t = {};
|
|
8821
8821
|
for (const [r, i] of Object.entries(b))
|
|
8822
8822
|
t[r] = e(i);
|
|
8823
|
-
return
|
|
8823
|
+
return N.carryCollectedRowIdentity(b, t), t;
|
|
8824
8824
|
}
|
|
8825
8825
|
function Wt(b, e) {
|
|
8826
8826
|
const t = new Headers(
|
|
@@ -8835,7 +8835,7 @@ function Wt(b, e) {
|
|
|
8835
8835
|
body: Vt(e.body || null)
|
|
8836
8836
|
});
|
|
8837
8837
|
}
|
|
8838
|
-
const
|
|
8838
|
+
const g = class g {
|
|
8839
8839
|
/**
|
|
8840
8840
|
* コンストラクタ。
|
|
8841
8841
|
*
|
|
@@ -8844,7 +8844,7 @@ const p = class p {
|
|
|
8844
8844
|
* @param domEvent 起点となった DOM イベント
|
|
8845
8845
|
*/
|
|
8846
8846
|
constructor(e, t = null, r = null) {
|
|
8847
|
-
this.reentrantBind = !1, this.suppressEmptyReplaceBind = !1, this.requestUserEditSequence = null, this.downloadReceivedBytes = 0, this.downloadTotalBytes = null, this.downloadFolder = null, this.twoWayCommitBind = !1, this.skipped = !1, this.operationSequence = r != null ? S.nextOperationSequence() : S.nextSequence(),
|
|
8847
|
+
this.reentrantBind = !1, this.suppressEmptyReplaceBind = !1, this.requestUserEditSequence = null, this.downloadReceivedBytes = 0, this.downloadTotalBytes = null, this.downloadFolder = null, this.twoWayCommitBind = !1, this.skipped = !1, this.operationSequence = r != null ? S.nextOperationSequence() : S.nextSequence(), g.isElementFragment(e) ? (this.options = g.buildOptions(e, t), this.eventType = t) : (this.options = e, this.eventType = null), this.domEvent = r;
|
|
8848
8848
|
}
|
|
8849
8849
|
/**
|
|
8850
8850
|
* クリックで起動した手続きの結果を控えます。
|
|
@@ -8854,7 +8854,7 @@ const p = class p {
|
|
|
8854
8854
|
* @returns 戻り値はありません。
|
|
8855
8855
|
*/
|
|
8856
8856
|
static recordClickOutcome(e, t) {
|
|
8857
|
-
|
|
8857
|
+
g.CLICK_OUTCOMES.set(e, t);
|
|
8858
8858
|
}
|
|
8859
8859
|
/**
|
|
8860
8860
|
* 直前のクリックで起動した手続きの結果を取り出します。
|
|
@@ -8866,8 +8866,8 @@ const p = class p {
|
|
|
8866
8866
|
* @returns 手続きの結果。起動していない場合は null
|
|
8867
8867
|
*/
|
|
8868
8868
|
static takeClickOutcome(e) {
|
|
8869
|
-
const t =
|
|
8870
|
-
return t ? (
|
|
8869
|
+
const t = g.CLICK_OUTCOMES.get(e);
|
|
8870
|
+
return t ? (g.CLICK_OUTCOMES.delete(e), t) : null;
|
|
8871
8871
|
}
|
|
8872
8872
|
/**
|
|
8873
8873
|
* イベント属性名を正しく生成します。
|
|
@@ -8976,7 +8976,7 @@ const p = class p {
|
|
|
8976
8976
|
const r = e.getRawAttribute(t);
|
|
8977
8977
|
let i;
|
|
8978
8978
|
try {
|
|
8979
|
-
i =
|
|
8979
|
+
i = M.parseDataBind(r);
|
|
8980
8980
|
} catch (n) {
|
|
8981
8981
|
return m.error("Haori", `Invalid fetch headers: ${n}`), null;
|
|
8982
8982
|
}
|
|
@@ -9065,7 +9065,7 @@ const p = class p {
|
|
|
9065
9065
|
static resolveDataParamStringDetailed(e, t) {
|
|
9066
9066
|
let r = !1;
|
|
9067
9067
|
return { value: e.replace(
|
|
9068
|
-
|
|
9068
|
+
g.DATA_PLACEHOLDER_REGEX,
|
|
9069
9069
|
(n, s, a) => {
|
|
9070
9070
|
const o = ne.evaluateDetailed(
|
|
9071
9071
|
s ?? a ?? "",
|
|
@@ -9122,7 +9122,7 @@ const p = class p {
|
|
|
9122
9122
|
static stringifyJsonTemplateStringContent(e) {
|
|
9123
9123
|
if (e == null || Number.isNaN(e))
|
|
9124
9124
|
return "";
|
|
9125
|
-
const t = typeof e == "object" ?
|
|
9125
|
+
const t = typeof e == "object" ? g.stringifyJsonTemplateValue(e) : String(e);
|
|
9126
9126
|
return JSON.stringify(t).slice(1, -1);
|
|
9127
9127
|
}
|
|
9128
9128
|
/**
|
|
@@ -9135,13 +9135,13 @@ const p = class p {
|
|
|
9135
9135
|
static resolveDataJsonStringDetailed(e, t) {
|
|
9136
9136
|
let r = !1;
|
|
9137
9137
|
return { value: e.replace(
|
|
9138
|
-
|
|
9138
|
+
g.DATA_PLACEHOLDER_REGEX,
|
|
9139
9139
|
(n, s, a, o) => {
|
|
9140
9140
|
const c = ne.evaluateDetailed(
|
|
9141
9141
|
s ?? a ?? "",
|
|
9142
9142
|
t
|
|
9143
9143
|
);
|
|
9144
|
-
return r = r || c.unresolvedReference,
|
|
9144
|
+
return r = r || c.unresolvedReference, g.isJsonStringContext(e, o) ? g.stringifyJsonTemplateStringContent(c.value) : g.stringifyJsonTemplateValue(c.value);
|
|
9145
9145
|
}
|
|
9146
9146
|
), hasUnresolvedReference: r };
|
|
9147
9147
|
}
|
|
@@ -9153,7 +9153,7 @@ const p = class p {
|
|
|
9153
9153
|
* @returns 送信データ
|
|
9154
9154
|
*/
|
|
9155
9155
|
static resolveDataAttribute(e, t) {
|
|
9156
|
-
return
|
|
9156
|
+
return g.resolveDataAttributeDetailed(e, t).value;
|
|
9157
9157
|
}
|
|
9158
9158
|
/**
|
|
9159
9159
|
* data 属性を評価済みの値として取得し、未解決参照の有無を返します。
|
|
@@ -9172,27 +9172,27 @@ const p = class p {
|
|
|
9172
9172
|
if (typeof n != "string" || r === null)
|
|
9173
9173
|
return { value: null, hasUnresolvedReference: s };
|
|
9174
9174
|
const a = r.trim();
|
|
9175
|
-
if (
|
|
9175
|
+
if (g.SINGLE_PLACEHOLDER_REGEX.test(a))
|
|
9176
9176
|
return {
|
|
9177
|
-
value:
|
|
9177
|
+
value: M.parseDataBind(n),
|
|
9178
9178
|
hasUnresolvedReference: s
|
|
9179
9179
|
};
|
|
9180
9180
|
if (a.startsWith("{") || a.startsWith("[")) {
|
|
9181
|
-
const c =
|
|
9181
|
+
const c = g.resolveDataJsonStringDetailed(
|
|
9182
9182
|
r,
|
|
9183
9183
|
e.getBindingData()
|
|
9184
9184
|
);
|
|
9185
9185
|
return {
|
|
9186
|
-
value:
|
|
9186
|
+
value: M.parseDataBind(c.value),
|
|
9187
9187
|
hasUnresolvedReference: s || c.hasUnresolvedReference
|
|
9188
9188
|
};
|
|
9189
9189
|
}
|
|
9190
|
-
const o =
|
|
9190
|
+
const o = g.resolveDataParamStringDetailed(
|
|
9191
9191
|
r,
|
|
9192
9192
|
e.getBindingData()
|
|
9193
9193
|
);
|
|
9194
9194
|
return {
|
|
9195
|
-
value:
|
|
9195
|
+
value: M.parseDataBind(o.value),
|
|
9196
9196
|
hasUnresolvedReference: s || o.hasUnresolvedReference
|
|
9197
9197
|
};
|
|
9198
9198
|
}
|
|
@@ -9206,38 +9206,38 @@ const p = class p {
|
|
|
9206
9206
|
static buildOptions(e, t) {
|
|
9207
9207
|
const r = {
|
|
9208
9208
|
targetFragment: e
|
|
9209
|
-
}, i = t ?
|
|
9209
|
+
}, i = t ? g.attrName(t, "if") : g.attrName(null, "if", !0);
|
|
9210
9210
|
if (e.hasAttribute(i)) {
|
|
9211
9211
|
const T = e.getRawAttribute(i);
|
|
9212
|
-
typeof T == "string" && T.trim() !== "" ? (r.conditionExpression =
|
|
9212
|
+
typeof T == "string" && T.trim() !== "" ? (r.conditionExpression = N.unwrapConditionExpression(T), r.conditionAttributeName = i) : m.warn(
|
|
9213
9213
|
"Haori",
|
|
9214
9214
|
`${i} に条件式が指定されていません。`
|
|
9215
9215
|
);
|
|
9216
9216
|
}
|
|
9217
9217
|
if (t) {
|
|
9218
|
-
if (e.hasAttribute(
|
|
9219
|
-
|
|
9220
|
-
e.getAttribute(
|
|
9218
|
+
if (e.hasAttribute(g.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(g.attrName(t, "confirm")) && (r.confirmMessage = g.unescapeNewlines(
|
|
9219
|
+
g.normalizeAttributeText(
|
|
9220
|
+
e.getAttribute(g.attrName(t, "confirm"))
|
|
9221
9221
|
)
|
|
9222
|
-
)), e.hasAttribute(
|
|
9222
|
+
)), e.hasAttribute(g.attrName(t, "data")) && (r.dataAttrName = g.attrName(t, "data")), e.hasAttribute(g.attrName(t, "form"))) {
|
|
9223
9223
|
const L = J.read(
|
|
9224
9224
|
e,
|
|
9225
|
-
|
|
9225
|
+
g.attrName(t, "form")
|
|
9226
9226
|
);
|
|
9227
9227
|
if (L) {
|
|
9228
9228
|
const Y = J.query(
|
|
9229
9229
|
L,
|
|
9230
|
-
|
|
9230
|
+
g.attrName(t, "form")
|
|
9231
9231
|
);
|
|
9232
|
-
Y !== null ? r.formFragment =
|
|
9233
|
-
|
|
9232
|
+
Y !== null ? r.formFragment = N.getFormFragment(
|
|
9233
|
+
I.get(Y)
|
|
9234
9234
|
) : m.error(
|
|
9235
9235
|
"Haori",
|
|
9236
|
-
`Form element not found: ${L} (${
|
|
9236
|
+
`Form element not found: ${L} (${g.attrName(t, "form")})`
|
|
9237
9237
|
);
|
|
9238
9238
|
} else
|
|
9239
|
-
r.formFragment =
|
|
9240
|
-
} else (t === "change" || t === "input") && (r.formFragment =
|
|
9239
|
+
r.formFragment = N.getFormFragment(e);
|
|
9240
|
+
} else (t === "change" || t === "input") && (r.formFragment = N.getFormFragment(e), r.formFragment === null && g.isNamedInputFragment(e) && (r.selfValueFragment = e));
|
|
9241
9241
|
if (e.hasAttribute(`${l.prefix}${t}-before-run`)) {
|
|
9242
9242
|
const L = e.getRawAttribute(
|
|
9243
9243
|
`${l.prefix}${t}-before-run`
|
|
@@ -9255,7 +9255,7 @@ ${L}
|
|
|
9255
9255
|
m.error("Haori", `Invalid before script: ${Y}`);
|
|
9256
9256
|
}
|
|
9257
9257
|
}
|
|
9258
|
-
const T =
|
|
9258
|
+
const T = g.attrName(t, "run");
|
|
9259
9259
|
if (e.hasAttribute(T)) {
|
|
9260
9260
|
const L = String(e.getAttribute(T) ?? "");
|
|
9261
9261
|
let Y = null;
|
|
@@ -9278,43 +9278,43 @@ ${L}
|
|
|
9278
9278
|
Y && (r.runScript = Y);
|
|
9279
9279
|
}
|
|
9280
9280
|
}
|
|
9281
|
-
const n =
|
|
9281
|
+
const n = g.attrName(t, "fetch"), s = e.hasAttribute(n);
|
|
9282
9282
|
if (s) {
|
|
9283
9283
|
const T = e.getAttributeEvaluation(n);
|
|
9284
9284
|
T && (r.fetchHasUnresolvedReference = T.hasUnresolvedReference, r.fetchUrl = T.hasUnresolvedReference ? null : T.value);
|
|
9285
9285
|
}
|
|
9286
|
-
const a = {}, o = t ?
|
|
9286
|
+
const a = {}, o = t ? g.attrName(t, "fetch-method") : g.attrName(null, "method", !0);
|
|
9287
9287
|
if (e.hasAttribute(o)) {
|
|
9288
9288
|
const T = e.getAttributeEvaluation(o);
|
|
9289
|
-
T?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method =
|
|
9289
|
+
T?.hasUnresolvedReference ? r.fetchHasUnresolvedReference = !0 : a.method = g.normalizeAttributeText(T?.value) ?? void 0;
|
|
9290
9290
|
}
|
|
9291
|
-
const c = t ?
|
|
9291
|
+
const c = t ? g.attrName(t, "fetch-headers") : g.attrName(null, "headers", !0), u = g.readFetchHeaders(
|
|
9292
9292
|
e,
|
|
9293
9293
|
c
|
|
9294
9294
|
);
|
|
9295
9295
|
u !== null && (a.headers = u);
|
|
9296
|
-
const d = t ?
|
|
9297
|
-
let
|
|
9296
|
+
const d = t ? g.attrName(t, "fetch-content-type") : g.attrName(null, "content-type", !0);
|
|
9297
|
+
let p = null;
|
|
9298
9298
|
if (e.hasAttribute(d)) {
|
|
9299
9299
|
const T = e.getAttributeEvaluation(d);
|
|
9300
|
-
T?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0),
|
|
9300
|
+
T?.hasUnresolvedReference && (r.fetchHasUnresolvedReference = !0), p = g.normalizeAttributeText(
|
|
9301
9301
|
T?.value
|
|
9302
9302
|
);
|
|
9303
9303
|
}
|
|
9304
|
-
if (
|
|
9305
|
-
a.headers =
|
|
9304
|
+
if (p !== null)
|
|
9305
|
+
a.headers = g.withContentType(
|
|
9306
9306
|
a.headers,
|
|
9307
|
-
|
|
9307
|
+
p
|
|
9308
9308
|
);
|
|
9309
|
-
else if (a.method && !
|
|
9309
|
+
else if (a.method && !g.hasDeclaredContentType(a.headers)) {
|
|
9310
9310
|
const T = a.method.toUpperCase();
|
|
9311
|
-
a.headers =
|
|
9311
|
+
a.headers = g.withContentType(
|
|
9312
9312
|
a.headers,
|
|
9313
9313
|
T === "GET" || T === "HEAD" || T === "OPTIONS" ? "application/x-www-form-urlencoded" : "application/json"
|
|
9314
9314
|
);
|
|
9315
9315
|
}
|
|
9316
9316
|
Object.keys(a).length > 0 && (r.fetchOptions = a);
|
|
9317
|
-
const y = t ?
|
|
9317
|
+
const y = t ? g.attrName(t, "fetch-download") : g.attrName(null, "download", !0);
|
|
9318
9318
|
if (e.hasAttribute(y) && !s)
|
|
9319
9319
|
m.warn(
|
|
9320
9320
|
"Haori",
|
|
@@ -9323,20 +9323,20 @@ ${L}
|
|
|
9323
9323
|
else if (e.hasAttribute(y)) {
|
|
9324
9324
|
r.download = !0;
|
|
9325
9325
|
const T = e.getAttributeEvaluation(y);
|
|
9326
|
-
r.downloadFileName = T?.hasUnresolvedReference ? null :
|
|
9326
|
+
r.downloadFileName = T?.hasUnresolvedReference ? null : g.normalizeAttributeText(T?.value);
|
|
9327
9327
|
}
|
|
9328
|
-
const E = t ?
|
|
9328
|
+
const E = t ? g.attrName(t, "fetch-download-folder") : g.attrName(null, "download-folder", !0);
|
|
9329
9329
|
e.hasAttribute(E) && (r.download ? r.downloadFolder = !0 : m.warn(
|
|
9330
9330
|
"Haori",
|
|
9331
9331
|
`${E} は ${y} と併せて指定してください(書き出す応答が無いため、この宣言は無視します)。`
|
|
9332
9332
|
));
|
|
9333
|
-
const A = t ?
|
|
9333
|
+
const A = t ? g.attrName(t, "bind") : g.attrName(null, "bind", !0);
|
|
9334
9334
|
if (e.hasAttribute(A)) {
|
|
9335
9335
|
const T = J.read(e, A);
|
|
9336
9336
|
if (T) {
|
|
9337
9337
|
const L = J.queryAll(T, A);
|
|
9338
9338
|
L.length > 0 ? (r.bindFragments = [], L.forEach((Y) => {
|
|
9339
|
-
const Z =
|
|
9339
|
+
const Z = I.get(Y);
|
|
9340
9340
|
Z && r.bindFragments.push(Z);
|
|
9341
9341
|
})) : m.error(
|
|
9342
9342
|
"Haori",
|
|
@@ -9344,57 +9344,57 @@ ${L}
|
|
|
9344
9344
|
);
|
|
9345
9345
|
}
|
|
9346
9346
|
}
|
|
9347
|
-
const
|
|
9348
|
-
t ? e.hasAttribute(
|
|
9349
|
-
|
|
9350
|
-
) : e.hasAttribute(
|
|
9351
|
-
const
|
|
9352
|
-
if (e.hasAttribute(
|
|
9353
|
-
const T = e.getRawAttribute(
|
|
9347
|
+
const D = g.attrName(t, "bind-arg"), x = g.attrName(null, "arg", !0), B = g.attrName(null, "bind-arg", !0);
|
|
9348
|
+
t ? e.hasAttribute(D) && (r.bindArg = e.getRawAttribute(D)) : e.hasAttribute(x) ? r.bindArg = e.getRawAttribute(
|
|
9349
|
+
x
|
|
9350
|
+
) : e.hasAttribute(B) && (r.bindArg = e.getRawAttribute(B));
|
|
9351
|
+
const F = t ? g.attrName(t, "bind-params") : g.attrName(null, "bind-params", !0);
|
|
9352
|
+
if (e.hasAttribute(F)) {
|
|
9353
|
+
const T = e.getRawAttribute(F);
|
|
9354
9354
|
r.bindParams = T.split("&").map((L) => L.trim());
|
|
9355
9355
|
}
|
|
9356
|
-
const j = t ?
|
|
9356
|
+
const j = t ? g.attrName(t, "bind-append") : g.attrName(null, "bind-append", !0);
|
|
9357
9357
|
if (e.hasAttribute(j)) {
|
|
9358
9358
|
const T = e.getRawAttribute(j);
|
|
9359
9359
|
r.bindAppendParams = T.split("&").map((L) => L.trim()).filter(Boolean);
|
|
9360
9360
|
}
|
|
9361
|
-
const X = t ?
|
|
9361
|
+
const X = t ? g.attrName(t, "bind-merge") : g.attrName(null, "bind-merge", !0);
|
|
9362
9362
|
e.hasAttribute(X) && (r.bindMerge = !0);
|
|
9363
|
-
const _ = t ?
|
|
9363
|
+
const _ = t ? g.attrName(t, "bind-transform") : g.attrName(null, "bind-transform", !0);
|
|
9364
9364
|
e.hasAttribute(_) && (r.bindTransform = e.getRawAttribute(_));
|
|
9365
|
-
const P = t ?
|
|
9365
|
+
const P = t ? g.attrName(t, "copy-params") : null;
|
|
9366
9366
|
if (P && e.hasAttribute(P)) {
|
|
9367
9367
|
const T = e.getRawAttribute(P);
|
|
9368
9368
|
r.copyParams = T.split("&").map((L) => L.trim()).filter(Boolean);
|
|
9369
9369
|
}
|
|
9370
9370
|
if (t) {
|
|
9371
|
-
if (e.hasAttribute(
|
|
9372
|
-
const
|
|
9371
|
+
if (e.hasAttribute(g.attrName(t, "adjust"))) {
|
|
9372
|
+
const V = J.read(
|
|
9373
9373
|
e,
|
|
9374
|
-
|
|
9374
|
+
g.attrName(t, "adjust")
|
|
9375
9375
|
);
|
|
9376
|
-
if (
|
|
9376
|
+
if (V) {
|
|
9377
9377
|
const K = J.queryAll(
|
|
9378
|
-
|
|
9379
|
-
|
|
9378
|
+
V,
|
|
9379
|
+
g.attrName(t, "adjust")
|
|
9380
9380
|
);
|
|
9381
9381
|
K.length > 0 ? (r.adjustFragments = [], K.forEach((te) => {
|
|
9382
|
-
const Q =
|
|
9382
|
+
const Q = I.get(te);
|
|
9383
9383
|
Q && r.adjustFragments.push(Q);
|
|
9384
9384
|
})) : m.error(
|
|
9385
9385
|
"Haori",
|
|
9386
|
-
`Adjust element not found: ${
|
|
9386
|
+
`Adjust element not found: ${V} (${g.attrName(t, "adjust")})`
|
|
9387
9387
|
);
|
|
9388
9388
|
}
|
|
9389
|
-
if (e.hasAttribute(
|
|
9389
|
+
if (e.hasAttribute(g.attrName(t, "adjust-value"))) {
|
|
9390
9390
|
const K = e.getRawAttribute(
|
|
9391
|
-
|
|
9391
|
+
g.attrName(t, "adjust-value")
|
|
9392
9392
|
), te = Number(K);
|
|
9393
9393
|
isNaN(te) || (r.adjustValue = te);
|
|
9394
9394
|
}
|
|
9395
9395
|
}
|
|
9396
|
-
if (e.hasAttribute(
|
|
9397
|
-
const
|
|
9396
|
+
if (e.hasAttribute(g.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(g.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(g.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(g.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${l.prefix}${t}-after-run`)) {
|
|
9397
|
+
const V = e.getRawAttribute(
|
|
9398
9398
|
`${l.prefix}${t}-after-run`
|
|
9399
9399
|
);
|
|
9400
9400
|
try {
|
|
@@ -9402,96 +9402,98 @@ ${L}
|
|
|
9402
9402
|
"response",
|
|
9403
9403
|
`
|
|
9404
9404
|
"use strict";
|
|
9405
|
-
${
|
|
9405
|
+
${V}
|
|
9406
9406
|
`
|
|
9407
9407
|
);
|
|
9408
9408
|
} catch (K) {
|
|
9409
9409
|
m.error("Haori", `Invalid after script: ${K}`);
|
|
9410
9410
|
}
|
|
9411
9411
|
}
|
|
9412
|
-
if (e.hasAttribute(
|
|
9413
|
-
|
|
9412
|
+
if (e.hasAttribute(g.attrName(t, "dialog")) && (r.dialogMessage = g.unescapeNewlines(
|
|
9413
|
+
g.readLateAttribute(
|
|
9414
9414
|
e,
|
|
9415
9415
|
r,
|
|
9416
9416
|
"dialog",
|
|
9417
|
-
|
|
9417
|
+
g.attrName(t, "dialog")
|
|
9418
9418
|
)
|
|
9419
|
-
)), e.hasAttribute(
|
|
9419
|
+
)), e.hasAttribute(g.attrName(t, "toast")) && (r.toastMessage = g.readLateAttribute(
|
|
9420
9420
|
e,
|
|
9421
9421
|
r,
|
|
9422
9422
|
"toast",
|
|
9423
|
-
|
|
9424
|
-
), r.toastLevel =
|
|
9423
|
+
g.attrName(t, "toast")
|
|
9424
|
+
), r.toastLevel = g.readToastLevel(
|
|
9425
9425
|
e,
|
|
9426
|
-
|
|
9426
|
+
g.attrName(t, "toast-level")
|
|
9427
9427
|
)), t !== "poll") {
|
|
9428
|
-
const
|
|
9429
|
-
e.hasAttribute(
|
|
9428
|
+
const V = g.attrName(t, "error-toast");
|
|
9429
|
+
e.hasAttribute(V) && (r.errorToastMessage = g.readLateAttribute(
|
|
9430
9430
|
e,
|
|
9431
9431
|
r,
|
|
9432
9432
|
"error-toast",
|
|
9433
|
-
|
|
9434
|
-
), r.errorToastLevel =
|
|
9433
|
+
V
|
|
9434
|
+
), r.errorToastLevel = g.readToastLevel(
|
|
9435
9435
|
e,
|
|
9436
|
-
|
|
9436
|
+
g.attrName(t, "error-toast-level")
|
|
9437
9437
|
));
|
|
9438
|
-
const K =
|
|
9439
|
-
e.hasAttribute(K) && (r.errorStatuses =
|
|
9438
|
+
const K = g.attrName(t, "error-status");
|
|
9439
|
+
e.hasAttribute(K) && (r.errorStatuses = g.parseErrorStatuses(
|
|
9440
9440
|
e.getRawAttribute(K),
|
|
9441
9441
|
K
|
|
9442
|
-
))
|
|
9442
|
+
)), r.errorNoMessage = e.hasAttribute(
|
|
9443
|
+
g.attrName(t, "error-no-message")
|
|
9444
|
+
);
|
|
9443
9445
|
}
|
|
9444
|
-
const T =
|
|
9445
|
-
if (Y && (r.redirectUrl =
|
|
9446
|
+
const T = g.attrName(t, "redirect"), L = g.attrName(t, "redirect-replace"), Y = e.hasAttribute(T), Z = e.hasAttribute(L);
|
|
9447
|
+
if (Y && (r.redirectUrl = g.readLateAttribute(
|
|
9446
9448
|
e,
|
|
9447
9449
|
r,
|
|
9448
9450
|
"redirect",
|
|
9449
9451
|
T
|
|
9450
|
-
)), Z && (r.redirectReplaceUrl =
|
|
9452
|
+
)), Z && (r.redirectReplaceUrl = g.readLateAttribute(
|
|
9451
9453
|
e,
|
|
9452
9454
|
r,
|
|
9453
9455
|
"redirect-replace",
|
|
9454
9456
|
L
|
|
9455
9457
|
)), Y || Z) {
|
|
9456
|
-
const
|
|
9458
|
+
const V = g.attrName(
|
|
9457
9459
|
t,
|
|
9458
9460
|
"redirect-return-param"
|
|
9459
9461
|
);
|
|
9460
|
-
e.hasAttribute(
|
|
9462
|
+
e.hasAttribute(V) && (r.redirectReturnParam = g.readLateAttribute(
|
|
9461
9463
|
e,
|
|
9462
9464
|
r,
|
|
9463
9465
|
"redirect-return-param",
|
|
9464
|
-
|
|
9466
|
+
V
|
|
9465
9467
|
));
|
|
9466
9468
|
}
|
|
9467
|
-
if (e.hasAttribute(
|
|
9469
|
+
if (e.hasAttribute(g.attrName(t, "scroll-error")) && (r.scrollOnError = !0), e.hasAttribute(g.attrName(t, "scroll")) && (r.scrollTarget = g.readLateAttribute(
|
|
9468
9470
|
e,
|
|
9469
9471
|
r,
|
|
9470
9472
|
"scroll",
|
|
9471
|
-
|
|
9472
|
-
)), e.hasAttribute(
|
|
9473
|
+
g.attrName(t, "scroll")
|
|
9474
|
+
)), e.hasAttribute(g.attrName(t, "history")) && (r.historyUrl = g.readLateAttribute(
|
|
9473
9475
|
e,
|
|
9474
9476
|
r,
|
|
9475
9477
|
"history",
|
|
9476
|
-
|
|
9477
|
-
)), e.hasAttribute(
|
|
9478
|
-
const
|
|
9478
|
+
g.attrName(t, "history")
|
|
9479
|
+
)), e.hasAttribute(g.attrName(t, "history-data")) && (r.historyDataAttrName = g.attrName(t, "history-data")), e.hasAttribute(g.attrName(t, "history-form"))) {
|
|
9480
|
+
const V = J.read(
|
|
9479
9481
|
e,
|
|
9480
|
-
|
|
9482
|
+
g.attrName(t, "history-form")
|
|
9481
9483
|
);
|
|
9482
|
-
if (
|
|
9484
|
+
if (V) {
|
|
9483
9485
|
const K = J.query(
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
+
V,
|
|
9487
|
+
g.attrName(t, "history-form")
|
|
9486
9488
|
);
|
|
9487
|
-
K !== null ? r.historyFormFragment =
|
|
9488
|
-
|
|
9489
|
+
K !== null ? r.historyFormFragment = N.getFormFragment(
|
|
9490
|
+
I.get(K)
|
|
9489
9491
|
) : m.error(
|
|
9490
9492
|
"Haori",
|
|
9491
|
-
`Form element not found: ${
|
|
9493
|
+
`Form element not found: ${V} (${g.attrName(t, "history-form")})`
|
|
9492
9494
|
);
|
|
9493
9495
|
} else
|
|
9494
|
-
r.historyFormFragment =
|
|
9496
|
+
r.historyFormFragment = N.getFormFragment(e);
|
|
9495
9497
|
}
|
|
9496
9498
|
[
|
|
9497
9499
|
"reset-before",
|
|
@@ -9503,30 +9505,30 @@ ${U}
|
|
|
9503
9505
|
"close",
|
|
9504
9506
|
"error-click",
|
|
9505
9507
|
"error-close"
|
|
9506
|
-
].forEach((
|
|
9507
|
-
if (
|
|
9508
|
+
].forEach((V) => {
|
|
9509
|
+
if (V.startsWith("error-") && t === "poll")
|
|
9508
9510
|
return;
|
|
9509
|
-
const K =
|
|
9511
|
+
const K = g.attrName(t, V);
|
|
9510
9512
|
if (!e.hasAttribute(K))
|
|
9511
9513
|
return;
|
|
9512
9514
|
const te = J.read(e, K), Q = [];
|
|
9513
9515
|
if (te)
|
|
9514
9516
|
J.queryAll(te, K).forEach((pe) => {
|
|
9515
|
-
const Ke =
|
|
9517
|
+
const Ke = I.get(pe);
|
|
9516
9518
|
Ke && Q.push(Ke);
|
|
9517
9519
|
}), Q.length === 0 && m.error("Haori", `Element not found: ${te} (${K})`);
|
|
9518
|
-
else if (
|
|
9520
|
+
else if (V === "error-click")
|
|
9519
9521
|
m.error(
|
|
9520
9522
|
"Haori",
|
|
9521
9523
|
`${K} にはクリックする要素のセレクタが必要です。`
|
|
9522
9524
|
);
|
|
9523
|
-
else if (
|
|
9525
|
+
else if (V === "open" || V === "close" || V === "error-close") {
|
|
9524
9526
|
const le = e.getTarget().closest("dialog");
|
|
9525
|
-
le ? Q.push(
|
|
9527
|
+
le ? Q.push(I.get(le)) : m.error("Haori", `Ancestor <dialog> not found (${K})`);
|
|
9526
9528
|
} else
|
|
9527
9529
|
Q.push(e);
|
|
9528
9530
|
if (Q.length > 0)
|
|
9529
|
-
switch (
|
|
9531
|
+
switch (V) {
|
|
9530
9532
|
case "reset-before":
|
|
9531
9533
|
r.resetBeforeFragments = Q;
|
|
9532
9534
|
break;
|
|
@@ -9558,57 +9560,57 @@ ${U}
|
|
|
9558
9560
|
break;
|
|
9559
9561
|
}
|
|
9560
9562
|
});
|
|
9561
|
-
const ce =
|
|
9563
|
+
const ce = g.attrName(t, "copy-source");
|
|
9562
9564
|
if (e.hasAttribute(ce)) {
|
|
9563
|
-
const
|
|
9564
|
-
if (
|
|
9565
|
-
const K = J.query(
|
|
9565
|
+
const V = J.read(e, ce);
|
|
9566
|
+
if (V) {
|
|
9567
|
+
const K = J.query(V, ce);
|
|
9566
9568
|
if (K !== null) {
|
|
9567
|
-
const te =
|
|
9569
|
+
const te = I.get(K);
|
|
9568
9570
|
te ? r.copySourceFragment = te : m.error(
|
|
9569
9571
|
"Haori",
|
|
9570
|
-
`Element is not managed by Haori: ${
|
|
9572
|
+
`Element is not managed by Haori: ${V} (${ce})`
|
|
9571
9573
|
);
|
|
9572
9574
|
} else
|
|
9573
9575
|
m.error(
|
|
9574
9576
|
"Haori",
|
|
9575
|
-
`Element not found: ${
|
|
9577
|
+
`Element not found: ${V} (${ce})`
|
|
9576
9578
|
);
|
|
9577
9579
|
} else
|
|
9578
9580
|
r.copySourceFragment = e;
|
|
9579
9581
|
}
|
|
9580
9582
|
}
|
|
9581
|
-
if (!t && (e.hasAttribute(
|
|
9583
|
+
if (!t && (e.hasAttribute(g.attrName(null, "data", !0)) && (r.dataAttrName = g.attrName(null, "data", !0)), e.hasAttribute(g.attrName(null, "form", !0)))) {
|
|
9582
9584
|
const T = J.read(
|
|
9583
9585
|
e,
|
|
9584
|
-
|
|
9586
|
+
g.attrName(null, "form", !0)
|
|
9585
9587
|
);
|
|
9586
9588
|
if (T) {
|
|
9587
9589
|
const L = J.query(
|
|
9588
9590
|
T,
|
|
9589
|
-
|
|
9591
|
+
g.attrName(null, "form", !0)
|
|
9590
9592
|
);
|
|
9591
|
-
L !== null ? r.formFragment =
|
|
9592
|
-
|
|
9593
|
+
L !== null ? r.formFragment = N.getFormFragment(
|
|
9594
|
+
I.get(L)
|
|
9593
9595
|
) : m.error(
|
|
9594
9596
|
"Haori",
|
|
9595
|
-
`Form element not found: ${T} (${
|
|
9597
|
+
`Form element not found: ${T} (${g.attrName(null, "fetch-form", !0)})`
|
|
9596
9598
|
);
|
|
9597
9599
|
} else
|
|
9598
|
-
r.formFragment =
|
|
9600
|
+
r.formFragment = N.getFormFragment(e);
|
|
9599
9601
|
}
|
|
9600
|
-
const ae = t ?
|
|
9602
|
+
const ae = t ? g.attrName(t, "fetch-state") : g.attrName(null, "state", !0);
|
|
9601
9603
|
if (e.hasAttribute(ae)) {
|
|
9602
9604
|
const T = J.read(e, ae), L = [];
|
|
9603
9605
|
T ? (J.queryAll(T, ae).forEach((Z) => {
|
|
9604
|
-
const he =
|
|
9606
|
+
const he = I.get(Z);
|
|
9605
9607
|
he && L.push(he);
|
|
9606
9608
|
}), L.length === 0 && m.error(
|
|
9607
9609
|
"Haori",
|
|
9608
9610
|
`Element not found: ${T} (${ae})`
|
|
9609
9611
|
)) : L.push(e), L.length > 0 && (r.fetchStateFragments = L);
|
|
9610
9612
|
}
|
|
9611
|
-
const G = t ?
|
|
9613
|
+
const G = t ? g.attrName(t, "store-clear") : g.attrName(null, "store-clear", !0);
|
|
9612
9614
|
if (e.hasAttribute(G)) {
|
|
9613
9615
|
const T = e.getRawAttribute(G), L = T === null ? "" : T.trim();
|
|
9614
9616
|
if (L === "")
|
|
@@ -9630,7 +9632,7 @@ ${U}
|
|
|
9630
9632
|
return s && !r.download && (!r.bindFragments || r.bindFragments.length === 0) && (r.bindFragments = [e], r.defaultSelfBind = !0), r.download && r.bindFragments && r.bindFragments.length > 0 && (m.warn(
|
|
9631
9633
|
"Haori",
|
|
9632
9634
|
`${y} と同時にバインド先が指定されています(応答はファイルとして保存し、バインドは行いません)。`
|
|
9633
|
-
), r.bindFragments = null),
|
|
9635
|
+
), r.bindFragments = null), g.recordRowWriteTargets(r), r;
|
|
9634
9636
|
}
|
|
9635
9637
|
/**
|
|
9636
9638
|
* バインド先・コピー先のうち、編集可能な行にあたるものを記録します。
|
|
@@ -9654,7 +9656,7 @@ ${U}
|
|
|
9654
9656
|
const n = i.getParent();
|
|
9655
9657
|
!n || !n.hasAttribute(`${l.prefix}each`) || !n.hasAttribute(`${l.prefix}form-list`) || t.set(
|
|
9656
9658
|
i,
|
|
9657
|
-
|
|
9659
|
+
g.getRowFragments(n).includes(i) ? n : null
|
|
9658
9660
|
);
|
|
9659
9661
|
}
|
|
9660
9662
|
t.size > 0 && (e.rowWriteTargets = t);
|
|
@@ -9690,7 +9692,7 @@ ${U}
|
|
|
9690
9692
|
* @returns フェッチシグネチャと未解決参照の有無
|
|
9691
9693
|
*/
|
|
9692
9694
|
static resolveAutoFetchSignature(e) {
|
|
9693
|
-
return new
|
|
9695
|
+
return new g(e, null).resolveFetchSignature();
|
|
9694
9696
|
}
|
|
9695
9697
|
/**
|
|
9696
9698
|
* 一連の処理を実行します。オプションが空の場合は即座にresolveされます。
|
|
@@ -9737,16 +9739,16 @@ ${U}
|
|
|
9737
9739
|
return this.skipped = !0, !1;
|
|
9738
9740
|
if (this.options.formFragment && this.validate(this.options.formFragment) === !1)
|
|
9739
9741
|
return !1;
|
|
9740
|
-
if (!this.options.formFragment && this.options.targetFragment &&
|
|
9741
|
-
|
|
9742
|
+
if (!this.options.formFragment && this.options.targetFragment && N.warnUnvalidatedCustomValidity(
|
|
9743
|
+
N.getFormFragment(this.options.targetFragment),
|
|
9742
9744
|
`${l.prefix}${this.eventType ?? "fetch"}-form が解決できません`
|
|
9743
9745
|
), !this.evaluateExecutionCondition())
|
|
9744
9746
|
return this.skipped = !0, !1;
|
|
9745
9747
|
if (this.options.runScript) {
|
|
9746
|
-
const
|
|
9748
|
+
const p = this.options.targetFragment?.getTarget() ?? null;
|
|
9747
9749
|
try {
|
|
9748
9750
|
const y = this.options.runScript.call(
|
|
9749
|
-
|
|
9751
|
+
p,
|
|
9750
9752
|
this.domEvent
|
|
9751
9753
|
);
|
|
9752
9754
|
y === !1 && this.domEvent && this.domEvent.preventDefault(), y != null && typeof y.then == "function" && await y;
|
|
@@ -9758,7 +9760,7 @@ ${U}
|
|
|
9758
9760
|
return !1;
|
|
9759
9761
|
this.options.resetBeforeFragments && this.options.resetBeforeFragments.length > 0 && (await Promise.all(
|
|
9760
9762
|
this.options.resetBeforeFragments.map(
|
|
9761
|
-
(
|
|
9763
|
+
(p) => N.reset(p, this.operationSequence)
|
|
9762
9764
|
)
|
|
9763
9765
|
), this.captureHistorySnapshots());
|
|
9764
9766
|
const r = this.prepareFetchRequest();
|
|
@@ -9766,28 +9768,28 @@ ${U}
|
|
|
9766
9768
|
const i = r.payload;
|
|
9767
9769
|
let n = r.url, s = r.options, a = !1, o = !1;
|
|
9768
9770
|
if (this.options.beforeCallback) {
|
|
9769
|
-
const
|
|
9771
|
+
const p = this.options.beforeCallback(
|
|
9770
9772
|
n || null,
|
|
9771
9773
|
s || null
|
|
9772
9774
|
);
|
|
9773
|
-
if (
|
|
9774
|
-
if (
|
|
9775
|
+
if (p != null) {
|
|
9776
|
+
if (p === !1 || typeof p == "object" && p.stop)
|
|
9775
9777
|
return !1;
|
|
9776
|
-
typeof
|
|
9778
|
+
typeof p == "object" && (a = "fetchUrl" in p, o = "fetchOptions" in p, n = a ? p.fetchUrl : n, s = o ? p.fetchOptions : s);
|
|
9777
9779
|
}
|
|
9778
9780
|
}
|
|
9779
9781
|
const c = Object.keys(i).length > 0;
|
|
9780
9782
|
if (n) {
|
|
9781
|
-
const
|
|
9783
|
+
const p = (s?.method || "GET").toUpperCase(), E = !a && o && r.transportMode === "query-get" && Ht(s) && !He(p) ? r.baseUrl ?? n : n, A = Ut(
|
|
9782
9784
|
E,
|
|
9783
9785
|
s
|
|
9784
9786
|
);
|
|
9785
9787
|
n = A.url;
|
|
9786
|
-
const
|
|
9787
|
-
if (
|
|
9788
|
+
const D = { ...A.options }, x = A.normalized ? A.requestedMethod : r.requestedMethod, B = A.effectiveMethod, F = r.transportMode === "query-get" || A.normalized, j = A.queryString ?? r.queryString;
|
|
9789
|
+
if (F && m.info("Haori demo fetch normalization", {
|
|
9788
9790
|
runtime: l.runtime,
|
|
9789
|
-
requestedMethod:
|
|
9790
|
-
effectiveMethod:
|
|
9791
|
+
requestedMethod: x,
|
|
9792
|
+
effectiveMethod: B,
|
|
9791
9793
|
transportMode: "query-get",
|
|
9792
9794
|
url: n,
|
|
9793
9795
|
payload: c ? i : void 0,
|
|
@@ -9795,23 +9797,23 @@ ${U}
|
|
|
9795
9797
|
}), this.options.targetFragment && n) {
|
|
9796
9798
|
const X = performance.now(), _ = {
|
|
9797
9799
|
runtime: l.runtime,
|
|
9798
|
-
requestedMethod:
|
|
9799
|
-
effectiveMethod:
|
|
9800
|
-
transportMode:
|
|
9801
|
-
...
|
|
9800
|
+
requestedMethod: x,
|
|
9801
|
+
effectiveMethod: B,
|
|
9802
|
+
transportMode: F ? "query-get" : "http",
|
|
9803
|
+
...F ? { queryString: j } : {}
|
|
9802
9804
|
};
|
|
9803
|
-
return
|
|
9805
|
+
return H.fetchStart(
|
|
9804
9806
|
this.options.targetFragment.getTarget(),
|
|
9805
9807
|
n,
|
|
9806
|
-
|
|
9808
|
+
D,
|
|
9807
9809
|
c ? i : void 0,
|
|
9808
9810
|
_
|
|
9809
|
-
), await this.injectFetchState("loading"), await
|
|
9811
|
+
), await this.injectFetchState("loading"), await g.invokeFetch(n, D).then((P) => this.handleFetchResult(
|
|
9810
9812
|
P,
|
|
9811
9813
|
n || void 0,
|
|
9812
9814
|
X
|
|
9813
9815
|
)).catch(async (P) => {
|
|
9814
|
-
throw n &&
|
|
9816
|
+
throw n && H.fetchError(
|
|
9815
9817
|
this.options.targetFragment.getTarget(),
|
|
9816
9818
|
n,
|
|
9817
9819
|
P
|
|
@@ -9822,35 +9824,35 @@ ${U}
|
|
|
9822
9824
|
), await this.runErrorActions(null), P;
|
|
9823
9825
|
});
|
|
9824
9826
|
}
|
|
9825
|
-
return await fetch(n,
|
|
9827
|
+
return await fetch(n, D).then((X) => this.handleFetchResult(X, n || void 0));
|
|
9826
9828
|
}
|
|
9827
9829
|
if ((!this.options.bindFragments || this.options.bindFragments.length === 0) && this.options.formFragment && c) {
|
|
9828
|
-
const
|
|
9830
|
+
const p = this.options.formFragment, y = p.getTarget(), E = /* @__PURE__ */ new Set();
|
|
9829
9831
|
e && e.appliedDisabledAttribute && this.options.targetFragment && E.add(this.options.targetFragment);
|
|
9830
|
-
const A =
|
|
9831
|
-
let
|
|
9832
|
-
if (
|
|
9833
|
-
|
|
9834
|
-
const
|
|
9835
|
-
|
|
9836
|
-
(j ? j.value :
|
|
9837
|
-
|
|
9832
|
+
const A = p.getRawBindingData(), D = Ue(i), x = p.getAttribute(`${l.prefix}form-arg`);
|
|
9833
|
+
let B;
|
|
9834
|
+
if (x) {
|
|
9835
|
+
B = { ...A ?? {} };
|
|
9836
|
+
const F = String(x), j = N.resolveAncestorArgOwner(p, F);
|
|
9837
|
+
B[F] = N.mergeCollectedValues(
|
|
9838
|
+
(j ? j.value : B[F]) ?? null,
|
|
9839
|
+
D
|
|
9838
9840
|
);
|
|
9839
9841
|
} else
|
|
9840
|
-
|
|
9842
|
+
B = N.mergeCollectedValues(
|
|
9841
9843
|
A,
|
|
9842
|
-
|
|
9843
|
-
|
|
9844
|
+
D,
|
|
9845
|
+
N.ancestorBaseResolver(p)
|
|
9844
9846
|
);
|
|
9845
|
-
await
|
|
9847
|
+
await M.setBindingData(y, B, {
|
|
9846
9848
|
skipFragments: E,
|
|
9847
9849
|
kind: "nonSupply",
|
|
9848
9850
|
sequence: this.operationSequence,
|
|
9849
|
-
editedPaths:
|
|
9850
|
-
|
|
9851
|
+
editedPaths: N.collectEditedPaths(
|
|
9852
|
+
p,
|
|
9851
9853
|
this.operationSequence,
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
+
x ? String(x) : "",
|
|
9855
|
+
D
|
|
9854
9856
|
)
|
|
9855
9857
|
});
|
|
9856
9858
|
}
|
|
@@ -9872,10 +9874,10 @@ ${U}
|
|
|
9872
9874
|
if (this.eventType !== "click" || !this.options.targetFragment)
|
|
9873
9875
|
return null;
|
|
9874
9876
|
const e = this.options.targetFragment, t = e.getTarget();
|
|
9875
|
-
if (
|
|
9877
|
+
if (g.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(Oe))
|
|
9876
9878
|
return !1;
|
|
9877
9879
|
const r = t.hasAttribute(`${l.prefix}click-no-disabled`);
|
|
9878
|
-
return
|
|
9880
|
+
return g.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(Oe, ""), r || t.setAttribute("disabled", ""), {
|
|
9879
9881
|
target: t,
|
|
9880
9882
|
fragment: e,
|
|
9881
9883
|
appliedDisabledAttribute: !r
|
|
@@ -9917,16 +9919,16 @@ ${U}
|
|
|
9917
9919
|
if (!e)
|
|
9918
9920
|
return;
|
|
9919
9921
|
const t = e.target;
|
|
9920
|
-
if (
|
|
9922
|
+
if (g.RUNNING_CLICK_TARGETS.delete(t), t.removeAttribute(Oe), !e.appliedDisabledAttribute)
|
|
9921
9923
|
return;
|
|
9922
|
-
const r =
|
|
9924
|
+
const r = g.findDisabledDeclaration(
|
|
9923
9925
|
e.fragment
|
|
9924
9926
|
);
|
|
9925
9927
|
if (r === null) {
|
|
9926
9928
|
t.removeAttribute("disabled");
|
|
9927
9929
|
return;
|
|
9928
9930
|
}
|
|
9929
|
-
|
|
9931
|
+
M.setAttribute(t, r.name, r.value).catch(
|
|
9930
9932
|
(i) => {
|
|
9931
9933
|
m.error(
|
|
9932
9934
|
"Haori",
|
|
@@ -10077,7 +10079,7 @@ ${U}
|
|
|
10077
10079
|
const i = t.body;
|
|
10078
10080
|
if (!i || typeof i.getReader != "function")
|
|
10079
10081
|
return "fallback";
|
|
10080
|
-
const n =
|
|
10082
|
+
const n = g.resolveDownloadFileName(
|
|
10081
10083
|
t,
|
|
10082
10084
|
this.options.downloadFileName ?? null,
|
|
10083
10085
|
r ?? this.options.fetchUrl ?? null
|
|
@@ -10143,7 +10145,7 @@ ${U}
|
|
|
10143
10145
|
* @returns 保存の結果
|
|
10144
10146
|
*/
|
|
10145
10147
|
async saveResponseAsFile(e, t) {
|
|
10146
|
-
if (this.downloadTotalBytes =
|
|
10148
|
+
if (this.downloadTotalBytes = g.resolveDownloadTotalBytes(e), this.downloadFolder) {
|
|
10147
10149
|
const a = await this.saveResponseToFolder(
|
|
10148
10150
|
this.downloadFolder,
|
|
10149
10151
|
e,
|
|
@@ -10156,7 +10158,7 @@ ${U}
|
|
|
10156
10158
|
const r = await this.readResponseBody(e);
|
|
10157
10159
|
if (r === null)
|
|
10158
10160
|
return "failed";
|
|
10159
|
-
const i =
|
|
10161
|
+
const i = g.resolveDownloadFileName(
|
|
10160
10162
|
e,
|
|
10161
10163
|
this.options.downloadFileName ?? null,
|
|
10162
10164
|
t ?? this.options.fetchUrl ?? null
|
|
@@ -10178,7 +10180,7 @@ ${U}
|
|
|
10178
10180
|
* @returns 表示の完了 Promise
|
|
10179
10181
|
*/
|
|
10180
10182
|
async showDownloadFailure() {
|
|
10181
|
-
const e = this.options.formFragment ?? (this.options.targetFragment ?
|
|
10183
|
+
const e = this.options.formFragment ?? (this.options.targetFragment ? N.getFormFragment(this.options.targetFragment) || this.options.targetFragment : null), t = e ? e.getTarget() : document.body, r = ge();
|
|
10182
10184
|
await r.clearMessages(t), await r.addErrorMessage(t, Ze);
|
|
10183
10185
|
}
|
|
10184
10186
|
/**
|
|
@@ -10193,11 +10195,11 @@ ${U}
|
|
|
10193
10195
|
* @returns 保存に使うファイル名
|
|
10194
10196
|
*/
|
|
10195
10197
|
static resolveDownloadFileName(e, t, r) {
|
|
10196
|
-
const n = [
|
|
10198
|
+
const n = [g.readContentDispositionFileName(
|
|
10197
10199
|
e.headers.get("Content-Disposition")
|
|
10198
|
-
), t,
|
|
10200
|
+
), t, g.readUrlFileName(r)];
|
|
10199
10201
|
for (const s of n) {
|
|
10200
|
-
const a =
|
|
10202
|
+
const a = g.sanitizeFileName(s);
|
|
10201
10203
|
if (a !== null)
|
|
10202
10204
|
return a;
|
|
10203
10205
|
}
|
|
@@ -10263,19 +10265,28 @@ ${U}
|
|
|
10263
10265
|
*/
|
|
10264
10266
|
async handleFetchResult(e, t, r) {
|
|
10265
10267
|
const i = ge();
|
|
10266
|
-
if (!e.ok)
|
|
10267
|
-
|
|
10268
|
+
if (!e.ok) {
|
|
10269
|
+
if (gt(e.status))
|
|
10270
|
+
return !1;
|
|
10271
|
+
this.options.targetFragment && t && H.fetchError(
|
|
10268
10272
|
this.options.targetFragment.getTarget(),
|
|
10269
10273
|
t,
|
|
10270
10274
|
new Error(`${e.status} ${e.statusText}`),
|
|
10271
10275
|
e.status,
|
|
10272
10276
|
r
|
|
10273
|
-
)
|
|
10277
|
+
);
|
|
10278
|
+
const E = await this.handleFetchError(
|
|
10279
|
+
e,
|
|
10280
|
+
!(this.options.errorNoMessage === !0 && this.appliesErrorActions(e.status))
|
|
10281
|
+
);
|
|
10282
|
+
return await this.injectFetchState(
|
|
10274
10283
|
"error",
|
|
10275
10284
|
e.status,
|
|
10276
|
-
e.statusText || null
|
|
10277
|
-
|
|
10278
|
-
|
|
10285
|
+
e.statusText || null,
|
|
10286
|
+
E
|
|
10287
|
+
), await this.runErrorActions(e.status), !1;
|
|
10288
|
+
}
|
|
10289
|
+
if (this.options.targetFragment && t && r && H.fetchEnd(
|
|
10279
10290
|
this.options.targetFragment.getTarget(),
|
|
10280
10291
|
t,
|
|
10281
10292
|
e.status,
|
|
@@ -10302,12 +10313,12 @@ ${U}
|
|
|
10302
10313
|
const n = [];
|
|
10303
10314
|
n.push(this.bindResult(e)), n.push(this.adjust()), n.push(this.addRow()), n.push(this.removeRow()), n.push(this.movePrevRow()), n.push(this.moveNextRow()), await Promise.all(n), await this.injectFetchState("success", e.status, null), this.options.resetFragments && this.options.resetFragments.length > 0 && await Promise.all(
|
|
10304
10315
|
this.options.resetFragments.map(
|
|
10305
|
-
(E) =>
|
|
10316
|
+
(E) => N.reset(E, this.operationSequence)
|
|
10306
10317
|
)
|
|
10307
10318
|
), await this.copy();
|
|
10308
10319
|
const s = [];
|
|
10309
10320
|
this.options.refetchFragments && this.options.refetchFragments.length > 0 && this.options.refetchFragments.forEach((E) => {
|
|
10310
|
-
s.push(new
|
|
10321
|
+
s.push(new g(E, null).run());
|
|
10311
10322
|
});
|
|
10312
10323
|
const a = await this.clickTargets(
|
|
10313
10324
|
this.options.clickFragments,
|
|
@@ -10322,13 +10333,13 @@ ${U}
|
|
|
10322
10333
|
A instanceof HTMLElement ? s.push(i.closeDialog(A)) : m.error("Haori", "Element is not an HTML element: ", A);
|
|
10323
10334
|
}), await Promise.all(s), a)
|
|
10324
10335
|
return !1;
|
|
10325
|
-
const o =
|
|
10326
|
-
|
|
10336
|
+
const o = g.unescapeNewlines(
|
|
10337
|
+
g.normalizeAttributeText(
|
|
10327
10338
|
this.resolveLateAttribute("dialog", this.options.dialogMessage)
|
|
10328
10339
|
)
|
|
10329
10340
|
);
|
|
10330
10341
|
o && await i.dialog(o);
|
|
10331
|
-
const c =
|
|
10342
|
+
const c = g.normalizeAttributeText(
|
|
10332
10343
|
this.resolveLateAttribute("toast", this.options.toastMessage)
|
|
10333
10344
|
);
|
|
10334
10345
|
c && await i.toast(c, this.options.toastLevel ?? "info"), this.clearStore(), this.pushHistory();
|
|
@@ -10338,21 +10349,21 @@ ${U}
|
|
|
10338
10349
|
);
|
|
10339
10350
|
u && J.query(
|
|
10340
10351
|
u,
|
|
10341
|
-
|
|
10352
|
+
g.attrName(this.eventType, "scroll"),
|
|
10342
10353
|
document
|
|
10343
10354
|
)?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
10344
10355
|
const d = this.resolveLateAttribute(
|
|
10345
10356
|
"redirect",
|
|
10346
10357
|
this.options.redirectUrl
|
|
10347
|
-
),
|
|
10358
|
+
), p = this.resolveLateAttribute(
|
|
10348
10359
|
"redirect-replace",
|
|
10349
10360
|
this.options.redirectReplaceUrl
|
|
10350
10361
|
);
|
|
10351
|
-
d &&
|
|
10362
|
+
d && p && m.warn(
|
|
10352
10363
|
"Haori",
|
|
10353
|
-
`${
|
|
10364
|
+
`${g.attrName(this.eventType, "redirect")} と ${g.attrName(this.eventType, "redirect-replace")} の両方が指定されています。履歴を置き換える方を採用します。`
|
|
10354
10365
|
);
|
|
10355
|
-
const y =
|
|
10366
|
+
const y = p || d;
|
|
10356
10367
|
if (y) {
|
|
10357
10368
|
let E = y;
|
|
10358
10369
|
const A = this.resolveLateAttribute(
|
|
@@ -10360,16 +10371,16 @@ ${U}
|
|
|
10360
10371
|
this.options.redirectReturnParam
|
|
10361
10372
|
);
|
|
10362
10373
|
if (A) {
|
|
10363
|
-
const
|
|
10364
|
-
if (
|
|
10365
|
-
const
|
|
10366
|
-
mt.isSafeLocalPath(
|
|
10374
|
+
const x = new URLSearchParams(window.location.search).get(A);
|
|
10375
|
+
if (x !== null) {
|
|
10376
|
+
const B = x.trim();
|
|
10377
|
+
mt.isSafeLocalPath(B) ? E = B : m.warn(
|
|
10367
10378
|
"Haori",
|
|
10368
|
-
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${
|
|
10379
|
+
`戻り先パスが安全なローカルパスではないため、既定の遷移先へフォールバックします: ${x}`
|
|
10369
10380
|
);
|
|
10370
10381
|
}
|
|
10371
10382
|
}
|
|
10372
|
-
|
|
10383
|
+
p ? window.location.replace(E) : window.location.href = E;
|
|
10373
10384
|
}
|
|
10374
10385
|
return !0;
|
|
10375
10386
|
}
|
|
@@ -10399,13 +10410,13 @@ ${U}
|
|
|
10399
10410
|
if (!e || e.length === 0)
|
|
10400
10411
|
return !1;
|
|
10401
10412
|
for (const i of e) {
|
|
10402
|
-
await
|
|
10413
|
+
await M.evaluateAll(i);
|
|
10403
10414
|
const n = i.getTarget();
|
|
10404
|
-
if (t &&
|
|
10415
|
+
if (t && g.takeClickOutcome(n), typeof n.click == "function" ? n.click() : n.dispatchEvent(
|
|
10405
10416
|
new MouseEvent("click", { bubbles: !0, cancelable: !0 })
|
|
10406
10417
|
), !t)
|
|
10407
10418
|
continue;
|
|
10408
|
-
const s =
|
|
10419
|
+
const s = g.takeClickOutcome(n);
|
|
10409
10420
|
if (s === null) {
|
|
10410
10421
|
m.warn(
|
|
10411
10422
|
"Haori",
|
|
@@ -10428,26 +10439,35 @@ ${U}
|
|
|
10428
10439
|
* @returns 実行完了の Promise
|
|
10429
10440
|
*/
|
|
10430
10441
|
async runErrorActions(e) {
|
|
10431
|
-
|
|
10432
|
-
if (t !== void 0 && (e === null || !t.includes(e)) || await this.clickTargets(
|
|
10442
|
+
if (!this.appliesErrorActions(e) || await this.clickTargets(
|
|
10433
10443
|
this.options.errorClickFragments,
|
|
10434
10444
|
this.options.errorClickAwait === !0,
|
|
10435
10445
|
"error-click-await"
|
|
10436
10446
|
))
|
|
10437
10447
|
return;
|
|
10438
|
-
const
|
|
10439
|
-
this.options.errorCloseFragments?.forEach((
|
|
10440
|
-
const
|
|
10441
|
-
|
|
10442
|
-
}), await Promise.all(
|
|
10443
|
-
const
|
|
10448
|
+
const r = ge(), i = [];
|
|
10449
|
+
this.options.errorCloseFragments?.forEach((s) => {
|
|
10450
|
+
const a = s.getTarget();
|
|
10451
|
+
a instanceof HTMLElement ? i.push(r.closeDialog(a)) : m.error("Haori", "Element is not an HTML element: ", a);
|
|
10452
|
+
}), await Promise.all(i);
|
|
10453
|
+
const n = g.normalizeAttributeText(
|
|
10444
10454
|
this.resolveLateAttribute("error-toast", this.options.errorToastMessage)
|
|
10445
10455
|
);
|
|
10446
|
-
|
|
10447
|
-
|
|
10456
|
+
n && await r.toast(
|
|
10457
|
+
n,
|
|
10448
10458
|
this.options.errorToastLevel ?? "info"
|
|
10449
10459
|
);
|
|
10450
10460
|
}
|
|
10461
|
+
/**
|
|
10462
|
+
* 失敗時のアクションを実行する失敗かどうかを判定します。
|
|
10463
|
+
*
|
|
10464
|
+
* @param status HTTP ステータス。通信の例外では null
|
|
10465
|
+
* @returns `data-{event}-error-status` の宣言に当たる場合(宣言が無い場合を含む)は true
|
|
10466
|
+
*/
|
|
10467
|
+
appliesErrorActions(e) {
|
|
10468
|
+
const t = this.options.errorStatuses;
|
|
10469
|
+
return t === void 0 || e !== null && t.includes(e);
|
|
10470
|
+
}
|
|
10451
10471
|
/**
|
|
10452
10472
|
* bind より後で使うアクション属性を、使用直前に評価し直します。
|
|
10453
10473
|
*
|
|
@@ -10491,83 +10511,94 @@ ${U}
|
|
|
10491
10511
|
return;
|
|
10492
10512
|
}
|
|
10493
10513
|
const c = (u) => {
|
|
10494
|
-
for (const [d,
|
|
10495
|
-
|
|
10514
|
+
for (const [d, p] of Object.entries(u))
|
|
10515
|
+
p != null && (Array.isArray(p) ? (o.searchParams.delete(d), p.forEach((y) => o.searchParams.append(d, String(y)))) : typeof p == "object" ? o.searchParams.set(d, JSON.stringify(p)) : o.searchParams.set(d, String(p)));
|
|
10496
10516
|
};
|
|
10497
10517
|
n && c(r), s && c(i), history.pushState(
|
|
10498
|
-
{ [
|
|
10518
|
+
{ [$t]: !0 },
|
|
10499
10519
|
"",
|
|
10500
10520
|
o.toString()
|
|
10501
|
-
),
|
|
10521
|
+
), M.refreshUrlParams();
|
|
10502
10522
|
} catch (a) {
|
|
10503
10523
|
m.error("Haori", `history.pushState failed: ${a}`);
|
|
10504
10524
|
}
|
|
10505
10525
|
}
|
|
10506
10526
|
/**
|
|
10507
10527
|
* フェッチエラー応答のメッセージを適切な要素へ伝播します。
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10513
|
-
|
|
10514
|
-
|
|
10515
|
-
|
|
10516
|
-
|
|
10517
|
-
|
|
10528
|
+
*
|
|
10529
|
+
* 表示しない場合も、既存メッセージのクリアと本文の解析は行います。
|
|
10530
|
+
*
|
|
10531
|
+
* @param response エラー応答
|
|
10532
|
+
* @param showMessages 本文のメッセージを表示するかどうか
|
|
10533
|
+
* @returns 本文から取り出した文言を、表示する順に改行で連結した文字列
|
|
10534
|
+
* (`_fetch.responseMessage`)。取り出せない場合は null
|
|
10535
|
+
*/
|
|
10536
|
+
async handleFetchError(e, t) {
|
|
10537
|
+
let r = null;
|
|
10538
|
+
this.options.formFragment ? r = this.options.formFragment : this.options.targetFragment && (r = N.getFormFragment(this.options.targetFragment) || this.options.targetFragment);
|
|
10539
|
+
const i = r ? r.getTarget() : document.body;
|
|
10540
|
+
await ge().clearMessages(i);
|
|
10541
|
+
const n = async (u) => {
|
|
10542
|
+
const d = r ? r.getTarget() : document.body;
|
|
10543
|
+
await ge().addErrorMessage(d, u);
|
|
10544
|
+
}, s = () => {
|
|
10518
10545
|
if (!this.options.scrollOnError)
|
|
10519
10546
|
return;
|
|
10520
|
-
const
|
|
10521
|
-
(
|
|
10547
|
+
const u = r ? r.getTarget() : document.body;
|
|
10548
|
+
(u.getAttribute("data-message-level") === "error" ? u : u.parentElement?.getAttribute("data-message-level") === "error" ? u.parentElement : u.querySelector('[data-message-level="error"]'))?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
10549
|
+
}, a = async (u) => {
|
|
10550
|
+
if (t) {
|
|
10551
|
+
u.length === 0 && await n(`${e.status} ${e.statusText}`);
|
|
10552
|
+
for (const d of u)
|
|
10553
|
+
d.key && r ? await N.addErrorMessage(r, d.key, d.message) : await n(d.message);
|
|
10554
|
+
s();
|
|
10555
|
+
}
|
|
10556
|
+
return u.length === 0 ? null : u.map((d) => d.message).join(`
|
|
10557
|
+
`);
|
|
10522
10558
|
};
|
|
10523
10559
|
if ((e.headers.get("Content-Type") || "").includes("application/json"))
|
|
10524
10560
|
try {
|
|
10525
|
-
const
|
|
10526
|
-
if (Array.isArray(
|
|
10527
|
-
const
|
|
10528
|
-
for (const
|
|
10529
|
-
if (
|
|
10530
|
-
const
|
|
10531
|
-
if (
|
|
10561
|
+
const u = await e.json(), d = [];
|
|
10562
|
+
if (Array.isArray(u)) {
|
|
10563
|
+
const p = /* @__PURE__ */ new Map(), y = [];
|
|
10564
|
+
for (const E of u)
|
|
10565
|
+
if (E && typeof E == "object" && !Array.isArray(E)) {
|
|
10566
|
+
const A = E.key, D = E.message, x = typeof A == "string" && A.length > 0 ? A : null, B = typeof D == "string" ? D : D != null ? String(D) : "";
|
|
10567
|
+
if (B.length === 0)
|
|
10532
10568
|
continue;
|
|
10533
|
-
if (
|
|
10534
|
-
const
|
|
10535
|
-
|
|
10569
|
+
if (x !== null) {
|
|
10570
|
+
const F = p.get(x) ?? [];
|
|
10571
|
+
F.push(B), p.set(x, F);
|
|
10536
10572
|
} else
|
|
10537
|
-
|
|
10538
|
-
} else typeof
|
|
10539
|
-
for (const [
|
|
10540
|
-
|
|
10573
|
+
y.push(B);
|
|
10574
|
+
} else typeof E == "string" && E.length > 0 && y.push(E);
|
|
10575
|
+
for (const [E, A] of p)
|
|
10576
|
+
d.push({ key: E, message: A.join(`
|
|
10541
10577
|
`) });
|
|
10542
|
-
for (const
|
|
10543
|
-
|
|
10544
|
-
} else if (
|
|
10545
|
-
if (typeof
|
|
10546
|
-
for (const
|
|
10547
|
-
typeof
|
|
10548
|
-
if (
|
|
10549
|
-
for (const [
|
|
10550
|
-
Array.isArray(
|
|
10551
|
-
`) }) : typeof
|
|
10552
|
-
if (
|
|
10553
|
-
for (const [
|
|
10554
|
-
|
|
10555
|
-
`) }) : typeof
|
|
10578
|
+
for (const E of y)
|
|
10579
|
+
d.push({ message: E });
|
|
10580
|
+
} else if (u && typeof u == "object") {
|
|
10581
|
+
if (typeof u.message == "string" && d.push({ message: u.message }), Array.isArray(u.messages))
|
|
10582
|
+
for (const p of u.messages)
|
|
10583
|
+
typeof p == "string" && d.push({ message: p });
|
|
10584
|
+
if (u.errors && typeof u.errors == "object")
|
|
10585
|
+
for (const [p, y] of Object.entries(u.errors))
|
|
10586
|
+
Array.isArray(y) ? d.push({ key: p, message: y.join(`
|
|
10587
|
+
`) }) : typeof y == "string" ? d.push({ key: p, message: y }) : y != null && d.push({ key: p, message: String(y) });
|
|
10588
|
+
if (d.length === 0)
|
|
10589
|
+
for (const [p, y] of Object.entries(u))
|
|
10590
|
+
p === "message" || p === "messages" || p === "errors" || (Array.isArray(y) ? d.push({ key: p, message: y.join(`
|
|
10591
|
+
`) }) : typeof y == "string" && d.push({ key: p, message: y }));
|
|
10556
10592
|
}
|
|
10557
|
-
|
|
10558
|
-
return await i(`${e.status} ${e.statusText}`), n(), !1;
|
|
10559
|
-
for (const c of o)
|
|
10560
|
-
c.key && t ? await F.addErrorMessage(t, c.key, c.message) : await i(c.message);
|
|
10561
|
-
return n(), !1;
|
|
10593
|
+
return await a(d);
|
|
10562
10594
|
} catch {
|
|
10563
10595
|
}
|
|
10596
|
+
let c = "";
|
|
10564
10597
|
try {
|
|
10565
|
-
|
|
10566
|
-
a && a.trim().length > 0 ? await i(a.trim()) : await i(`${e.status} ${e.statusText}`);
|
|
10598
|
+
c = (await e.text()).trim();
|
|
10567
10599
|
} catch {
|
|
10568
|
-
await i(`${e.status} ${e.statusText}`);
|
|
10569
10600
|
}
|
|
10570
|
-
return
|
|
10601
|
+
return await a(c.length > 0 ? [{ message: c }] : []);
|
|
10571
10602
|
}
|
|
10572
10603
|
/**
|
|
10573
10604
|
* 対象のフラグメント以下の入力要素に対してバリデーションを実行します。
|
|
@@ -10578,16 +10609,16 @@ ${U}
|
|
|
10578
10609
|
*/
|
|
10579
10610
|
validate(e) {
|
|
10580
10611
|
if (this.options.valid !== !0)
|
|
10581
|
-
return
|
|
10612
|
+
return N.warnUnvalidatedCustomValidity(
|
|
10582
10613
|
e,
|
|
10583
10614
|
`${l.prefix}${this.eventType ?? "fetch"}-validate の指定がありません`
|
|
10584
10615
|
), !0;
|
|
10585
|
-
|
|
10616
|
+
N.applyCustomValidity(e);
|
|
10586
10617
|
const t = this.findFirstInvalid(e);
|
|
10587
10618
|
if (t === null)
|
|
10588
10619
|
return !0;
|
|
10589
10620
|
const r = t;
|
|
10590
|
-
return
|
|
10621
|
+
return g.isRectFullyVisible(t.getBoundingClientRect()) ? (r.reportValidity(), t.focus(), this.options.scrollOnError && t.scrollIntoView({ behavior: "smooth", block: "nearest" }), !1) : (t.focus({ preventScroll: !0 }), t.scrollIntoView({ behavior: "smooth", block: "nearest" }), g.reportValidityAfterScroll(r), !1);
|
|
10591
10622
|
}
|
|
10592
10623
|
/**
|
|
10593
10624
|
* スクロールが止まってから、対象の入力要素の検証 UI(バブル)を表示します。
|
|
@@ -10601,13 +10632,13 @@ ${U}
|
|
|
10601
10632
|
* @param target 検証エラーの入力要素
|
|
10602
10633
|
*/
|
|
10603
10634
|
static reportValidityAfterScroll(e) {
|
|
10604
|
-
const t = ++
|
|
10635
|
+
const t = ++g.validationReportGeneration, r = performance.now();
|
|
10605
10636
|
let i = null, n = 0;
|
|
10606
10637
|
const s = () => {
|
|
10607
|
-
if (t !==
|
|
10638
|
+
if (t !== g.validationReportGeneration || !e.isConnected)
|
|
10608
10639
|
return;
|
|
10609
10640
|
const a = e.getBoundingClientRect(), o = `${Math.round(a.top)}:${Math.round(a.left)}`;
|
|
10610
|
-
if (n = o === i ? n + 1 : 0, i = o, n >=
|
|
10641
|
+
if (n = o === i ? n + 1 : 0, i = o, n >= g.VALIDATION_SCROLL_STABLE_FRAMES && g.isRectPartlyVisible(a) || performance.now() - r >= g.VALIDATION_SCROLL_TIMEOUT_MS) {
|
|
10611
10642
|
e.reportValidity();
|
|
10612
10643
|
return;
|
|
10613
10644
|
}
|
|
@@ -10637,7 +10668,7 @@ ${U}
|
|
|
10637
10668
|
* @returns 全体が画面内にあれば true
|
|
10638
10669
|
*/
|
|
10639
10670
|
static isRectFullyVisible(e) {
|
|
10640
|
-
const { width: t, height: r } =
|
|
10671
|
+
const { width: t, height: r } = g.getViewportSize();
|
|
10641
10672
|
return e.top >= 0 && e.left >= 0 && e.bottom <= r && e.right <= t;
|
|
10642
10673
|
}
|
|
10643
10674
|
/**
|
|
@@ -10650,7 +10681,7 @@ ${U}
|
|
|
10650
10681
|
* @returns 一部でも画面内にあれば true
|
|
10651
10682
|
*/
|
|
10652
10683
|
static isRectPartlyVisible(e) {
|
|
10653
|
-
const { width: t, height: r } =
|
|
10684
|
+
const { width: t, height: r } = g.getViewportSize();
|
|
10654
10685
|
return e.top < r && e.bottom > 0 && e.left < t && e.right > 0;
|
|
10655
10686
|
}
|
|
10656
10687
|
/**
|
|
@@ -10673,7 +10704,7 @@ ${U}
|
|
|
10673
10704
|
const r = this.options.targetFragment;
|
|
10674
10705
|
if (!r)
|
|
10675
10706
|
return !0;
|
|
10676
|
-
const i = this.options.conditionAttributeName ?? `${l.prefix}if`, n =
|
|
10707
|
+
const i = this.options.conditionAttributeName ?? `${l.prefix}if`, n = N.buildConditionScope(
|
|
10677
10708
|
r,
|
|
10678
10709
|
this.options.formFragment ?? null
|
|
10679
10710
|
), s = ne.evaluateDetailed(t, n);
|
|
@@ -10757,14 +10788,14 @@ ${U}
|
|
|
10757
10788
|
);
|
|
10758
10789
|
return;
|
|
10759
10790
|
}
|
|
10760
|
-
const n = [], s = this.eventType ?
|
|
10791
|
+
const n = [], s = this.eventType ? g.attrName(this.eventType, "bind") : g.attrName(null, "bind", !0), a = [];
|
|
10761
10792
|
if (this.options.bindArg)
|
|
10762
10793
|
this.options.bindFragments.forEach((o) => {
|
|
10763
10794
|
const c = this.resolveRowWrite(o, s);
|
|
10764
10795
|
if (c.kind === "skip")
|
|
10765
10796
|
return;
|
|
10766
10797
|
if (c.kind === "row") {
|
|
10767
|
-
const
|
|
10798
|
+
const p = this.options.bindArg;
|
|
10768
10799
|
a.push({
|
|
10769
10800
|
container: c.container,
|
|
10770
10801
|
row: o,
|
|
@@ -10773,14 +10804,14 @@ ${U}
|
|
|
10773
10804
|
apply: (y) => {
|
|
10774
10805
|
const E = this.resolveCurrentRowItem(o, y), A = { ...E };
|
|
10775
10806
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
10776
|
-
const
|
|
10777
|
-
A[
|
|
10807
|
+
const D = E[p], x = D !== null && typeof D == "object" && !Array.isArray(D) ? D : {};
|
|
10808
|
+
A[p] = this.mergeAppendBindingData(
|
|
10778
10809
|
o,
|
|
10779
10810
|
i,
|
|
10780
|
-
|
|
10811
|
+
x
|
|
10781
10812
|
);
|
|
10782
10813
|
} else
|
|
10783
|
-
A[
|
|
10814
|
+
A[p] = i;
|
|
10784
10815
|
return this.reconcileRowUserEdits(o, A);
|
|
10785
10816
|
}
|
|
10786
10817
|
});
|
|
@@ -10788,7 +10819,7 @@ ${U}
|
|
|
10788
10819
|
}
|
|
10789
10820
|
const u = { ...o.getRawBindingData() ?? {} }, d = this.options.bindArg;
|
|
10790
10821
|
if (i && typeof i == "object" && !Array.isArray(i)) {
|
|
10791
|
-
const
|
|
10822
|
+
const p = u[d], y = p && typeof p == "object" && !Array.isArray(p) ? p : {};
|
|
10792
10823
|
u[d] = this.mergeAppendBindingData(
|
|
10793
10824
|
o,
|
|
10794
10825
|
i,
|
|
@@ -10797,7 +10828,7 @@ ${U}
|
|
|
10797
10828
|
} else
|
|
10798
10829
|
u[d] = i;
|
|
10799
10830
|
n.push(
|
|
10800
|
-
|
|
10831
|
+
M.setBindingData(
|
|
10801
10832
|
o.getTarget(),
|
|
10802
10833
|
this.reconcileUserEditsForBind(o, u),
|
|
10803
10834
|
{
|
|
@@ -10839,8 +10870,8 @@ ${U}
|
|
|
10839
10870
|
row: o,
|
|
10840
10871
|
attributeName: s,
|
|
10841
10872
|
syncWhenUnchanged: "reflect",
|
|
10842
|
-
apply: (
|
|
10843
|
-
const y = this.options.bindMerge ? this.resolveCurrentRowItem(o,
|
|
10873
|
+
apply: (p) => {
|
|
10874
|
+
const y = this.options.bindMerge ? this.resolveCurrentRowItem(o, p) : p, E = this.mergeAppendBindingData(
|
|
10844
10875
|
o,
|
|
10845
10876
|
i,
|
|
10846
10877
|
y
|
|
@@ -10855,7 +10886,7 @@ ${U}
|
|
|
10855
10886
|
i
|
|
10856
10887
|
), d = this.options.bindMerge ? { ...o.getRawBindingData() ?? {}, ...u } : u;
|
|
10857
10888
|
n.push(
|
|
10858
|
-
|
|
10889
|
+
M.setBindingData(
|
|
10859
10890
|
o.getTarget(),
|
|
10860
10891
|
this.reconcileUserEditsForBind(o, d),
|
|
10861
10892
|
{
|
|
@@ -10870,7 +10901,7 @@ ${U}
|
|
|
10870
10901
|
return n.push(this.applyRowWrites(a)), Promise.all(n).then(() => {
|
|
10871
10902
|
const o = this.options.bindArg ?? null;
|
|
10872
10903
|
this.options.bindFragments.forEach((c) => {
|
|
10873
|
-
|
|
10904
|
+
H.bindComplete(c.getTarget(), o);
|
|
10874
10905
|
});
|
|
10875
10906
|
});
|
|
10876
10907
|
});
|
|
@@ -10911,13 +10942,13 @@ ${U}
|
|
|
10911
10942
|
if (r === null)
|
|
10912
10943
|
return t;
|
|
10913
10944
|
const i = this.eventType === "poll";
|
|
10914
|
-
if (!i && !this.twoWayCommitBind &&
|
|
10945
|
+
if (!i && !this.twoWayCommitBind && M.clearUserEditMarks(e, r), !(e.getTarget() instanceof HTMLFormElement))
|
|
10915
10946
|
return this.reconcileAncestorArgFormEdits(
|
|
10916
10947
|
e,
|
|
10917
10948
|
t,
|
|
10918
10949
|
i ? 0 : r
|
|
10919
10950
|
);
|
|
10920
|
-
const n =
|
|
10951
|
+
const n = N.getValuesEditedAfter(
|
|
10921
10952
|
e,
|
|
10922
10953
|
i ? 0 : r
|
|
10923
10954
|
);
|
|
@@ -10950,8 +10981,8 @@ ${U}
|
|
|
10950
10981
|
if (r === null)
|
|
10951
10982
|
return t;
|
|
10952
10983
|
const i = this.eventType === "poll";
|
|
10953
|
-
!i && !this.twoWayCommitBind &&
|
|
10954
|
-
const n =
|
|
10984
|
+
!i && !this.twoWayCommitBind && M.clearUserEditMarks(e, r);
|
|
10985
|
+
const n = N.getValuesEditedAfter(
|
|
10955
10986
|
e,
|
|
10956
10987
|
i ? 0 : r
|
|
10957
10988
|
);
|
|
@@ -10973,10 +11004,10 @@ ${U}
|
|
|
10973
11004
|
*/
|
|
10974
11005
|
reconcileAncestorArgFormEdits(e, t, r) {
|
|
10975
11006
|
let i = t;
|
|
10976
|
-
for (const { form: n, key: s } of
|
|
11007
|
+
for (const { form: n, key: s } of N.collectArgForms(e)) {
|
|
10977
11008
|
if (!Object.prototype.hasOwnProperty.call(i, s))
|
|
10978
11009
|
continue;
|
|
10979
|
-
const a =
|
|
11010
|
+
const a = N.getValuesEditedAfter(n, r);
|
|
10980
11011
|
if (Object.keys(a).length === 0)
|
|
10981
11012
|
continue;
|
|
10982
11013
|
const o = i[s], c = o && typeof o == "object" && !Array.isArray(o) ? o : {};
|
|
@@ -11003,7 +11034,7 @@ ${U}
|
|
|
11003
11034
|
copy() {
|
|
11004
11035
|
if (!this.options.copyFragments || this.options.copyFragments.length === 0)
|
|
11005
11036
|
return Promise.resolve();
|
|
11006
|
-
const e = this.resolveCopySourceData(), t = this.pickCopyData(e), r =
|
|
11037
|
+
const e = this.resolveCopySourceData(), t = this.pickCopyData(e), r = g.attrName(this.eventType, "copy"), i = [], n = [];
|
|
11007
11038
|
return this.options.copyFragments.forEach((s) => {
|
|
11008
11039
|
const a = this.resolveRowWrite(s, r);
|
|
11009
11040
|
if (a.kind === "skip")
|
|
@@ -11023,7 +11054,7 @@ ${U}
|
|
|
11023
11054
|
...t
|
|
11024
11055
|
};
|
|
11025
11056
|
n.push(
|
|
11026
|
-
|
|
11057
|
+
M.setBindingData(s.getTarget(), o, {
|
|
11027
11058
|
// 通番はコピーを起こした操作のもの(フェッチ応答の反映と同じ理由)。
|
|
11028
11059
|
sequence: this.operationSequence
|
|
11029
11060
|
})
|
|
@@ -11056,7 +11087,7 @@ ${U}
|
|
|
11056
11087
|
* @returns 行の入力欄の状態を反映した要素データ
|
|
11057
11088
|
*/
|
|
11058
11089
|
resolveCurrentRowItem(e, t) {
|
|
11059
|
-
const r =
|
|
11090
|
+
const r = N.getValuesEditedAfter(e, 0);
|
|
11060
11091
|
return Object.keys(r).length === 0 ? t : ye(t, r);
|
|
11061
11092
|
}
|
|
11062
11093
|
/**
|
|
@@ -11085,9 +11116,9 @@ ${U}
|
|
|
11085
11116
|
* @returns コピー元のデータ
|
|
11086
11117
|
*/
|
|
11087
11118
|
resolveCopySourceData() {
|
|
11088
|
-
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? ke(this.options.copySourceFragment) :
|
|
11119
|
+
return this.options.copySourceFragment ? this.options.copySourceFragment.getTarget().tagName === "FORM" ? ke(this.options.copySourceFragment) : M.withoutReservedBindingKeys(
|
|
11089
11120
|
this.options.copySourceFragment.getRawBindingData() ?? {}
|
|
11090
|
-
) : this.options.formFragment ? ke(this.options.formFragment) : this.options.targetFragment ?
|
|
11121
|
+
) : this.options.formFragment ? ke(this.options.formFragment) : this.options.targetFragment ? M.withoutReservedBindingKeys(
|
|
11091
11122
|
this.options.targetFragment.getRawBindingData() ?? {}
|
|
11092
11123
|
) : {};
|
|
11093
11124
|
}
|
|
@@ -11101,11 +11132,11 @@ ${U}
|
|
|
11101
11132
|
let t = !1;
|
|
11102
11133
|
const r = this.options.formFragment ?? this.options.selfValueFragment;
|
|
11103
11134
|
if (r) {
|
|
11104
|
-
const i =
|
|
11105
|
-
Object.assign(e, i),
|
|
11135
|
+
const i = N.getValues(r);
|
|
11136
|
+
Object.assign(e, i), N.carryCollectedRowIdentity(i, e);
|
|
11106
11137
|
}
|
|
11107
11138
|
if (this.options.data && typeof this.options.data == "object" && Object.assign(e, this.options.data), this.options.targetFragment && this.options.dataAttrName) {
|
|
11108
|
-
const i =
|
|
11139
|
+
const i = g.resolveDataAttributeDetailed(
|
|
11109
11140
|
this.options.targetFragment,
|
|
11110
11141
|
this.options.dataAttrName
|
|
11111
11142
|
);
|
|
@@ -11169,17 +11200,17 @@ ${U}
|
|
|
11169
11200
|
const d = s.get("Content-Type") || "";
|
|
11170
11201
|
if (/multipart\/form-data/i.test(d)) {
|
|
11171
11202
|
s.delete("Content-Type");
|
|
11172
|
-
const
|
|
11203
|
+
const p = new FormData();
|
|
11173
11204
|
for (const [y, E] of Object.entries(t))
|
|
11174
|
-
E == null ?
|
|
11175
|
-
A instanceof Blob ?
|
|
11176
|
-
}) :
|
|
11177
|
-
n.body =
|
|
11205
|
+
E == null ? p.append(y, "") : E instanceof Blob ? p.append(y, E) : Array.isArray(E) ? E.forEach((A) => {
|
|
11206
|
+
A instanceof Blob ? p.append(y, A) : p.append(y, Ae(A));
|
|
11207
|
+
}) : p.append(y, Ae(E));
|
|
11208
|
+
n.body = p;
|
|
11178
11209
|
} else if (/application\/x-www-form-urlencoded/i.test(d)) {
|
|
11179
|
-
const
|
|
11210
|
+
const p = new URLSearchParams();
|
|
11180
11211
|
for (const [y, E] of Object.entries(t))
|
|
11181
|
-
E !== void 0 && (Array.isArray(E) ? E.forEach((A) =>
|
|
11182
|
-
n.body =
|
|
11212
|
+
E !== void 0 && (Array.isArray(E) ? E.forEach((A) => p.append(y, Ae(A))) : p.append(y, Ae(E)));
|
|
11213
|
+
n.body = p;
|
|
11183
11214
|
} else
|
|
11184
11215
|
s.set("Content-Type", "application/json"), n.body = JSON.stringify(t);
|
|
11185
11216
|
}
|
|
@@ -11202,7 +11233,7 @@ ${U}
|
|
|
11202
11233
|
* reset-before 後の history 用スナップショットを保存します。
|
|
11203
11234
|
*/
|
|
11204
11235
|
captureHistorySnapshots() {
|
|
11205
|
-
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot =
|
|
11236
|
+
this.options.targetFragment && this.options.historyDataAttrName ? this.historyDataSnapshot = g.resolveDataAttribute(
|
|
11206
11237
|
this.options.targetFragment,
|
|
11207
11238
|
this.options.historyDataAttrName
|
|
11208
11239
|
) : this.historyDataSnapshot = void 0, this.historyFormSnapshot = this.options.historyFormFragment ? ke(this.options.historyFormFragment) : void 0;
|
|
@@ -11213,7 +11244,7 @@ ${U}
|
|
|
11213
11244
|
* @returns history-data の評価値。
|
|
11214
11245
|
*/
|
|
11215
11246
|
resolveHistoryDataValues() {
|
|
11216
|
-
return this.historyDataSnapshot !== void 0 ? this.historyDataSnapshot : this.options.targetFragment && this.options.historyDataAttrName ?
|
|
11247
|
+
return this.historyDataSnapshot !== void 0 ? this.historyDataSnapshot : this.options.targetFragment && this.options.historyDataAttrName ? g.resolveDataAttribute(
|
|
11217
11248
|
this.options.targetFragment,
|
|
11218
11249
|
this.options.historyDataAttrName
|
|
11219
11250
|
) : this.options.historyData;
|
|
@@ -11296,7 +11327,7 @@ ${U}
|
|
|
11296
11327
|
const t = this.options.targetFragment;
|
|
11297
11328
|
if (!t)
|
|
11298
11329
|
return m.error("Haori", "Target fragment is not specified for row operation."), null;
|
|
11299
|
-
const r =
|
|
11330
|
+
const r = g.attrName(this.eventType, e), i = J.read(t, r);
|
|
11300
11331
|
if (i !== null && i.trim() !== "") {
|
|
11301
11332
|
const s = J.query(i, r, document);
|
|
11302
11333
|
if (s === null)
|
|
@@ -11304,7 +11335,7 @@ ${U}
|
|
|
11304
11335
|
"Haori",
|
|
11305
11336
|
`Row container not found: ${i} (${r})`
|
|
11306
11337
|
), null;
|
|
11307
|
-
const a =
|
|
11338
|
+
const a = I.get(s);
|
|
11308
11339
|
return a instanceof S ? a.hasAttribute(`${l.prefix}each`) ? a : (m.error(
|
|
11309
11340
|
"Haori",
|
|
11310
11341
|
`Row container must have ${l.prefix}each: ${i} (${r})`
|
|
@@ -11350,30 +11381,30 @@ ${U}
|
|
|
11350
11381
|
"Haori",
|
|
11351
11382
|
`${l.prefix}each-array requires ${l.prefix}each-key (${l.prefix}each-array="${a}").`
|
|
11352
11383
|
), null;
|
|
11353
|
-
const u =
|
|
11384
|
+
const u = g.resolveRowScopeBase(e, o[0]);
|
|
11354
11385
|
if (u === "unresolvable")
|
|
11355
11386
|
return null;
|
|
11356
|
-
let d,
|
|
11387
|
+
let d, p, y;
|
|
11357
11388
|
if (u)
|
|
11358
|
-
d = u.owner,
|
|
11389
|
+
d = u.owner, p = u.ownerData, y = [...u.path, ...o.slice(1)];
|
|
11359
11390
|
else {
|
|
11360
|
-
for (d = e,
|
|
11391
|
+
for (d = e, p = null; d; ) {
|
|
11361
11392
|
const A = d.getRawBindingData();
|
|
11362
|
-
if (A && o[0] in A && !
|
|
11363
|
-
|
|
11393
|
+
if (A && o[0] in A && !g.isRowScopeKey(d, o[0])) {
|
|
11394
|
+
p = A;
|
|
11364
11395
|
break;
|
|
11365
11396
|
}
|
|
11366
11397
|
d = d.getParent();
|
|
11367
11398
|
}
|
|
11368
11399
|
y = o;
|
|
11369
11400
|
}
|
|
11370
|
-
if (!d || !
|
|
11401
|
+
if (!d || !p)
|
|
11371
11402
|
return t || m.error(
|
|
11372
11403
|
"Haori",
|
|
11373
11404
|
`Binding data owner not found for ${s}="${a}".`
|
|
11374
11405
|
), null;
|
|
11375
|
-
const E =
|
|
11376
|
-
return Array.isArray(E) ? { owner: d, ownerData:
|
|
11406
|
+
const E = g.readPathValue(p, y);
|
|
11407
|
+
return Array.isArray(E) ? { owner: d, ownerData: p, array: E, path: y, mapped: n } : (t || m.error(
|
|
11377
11408
|
"Haori",
|
|
11378
11409
|
`${s}="${a}" does not resolve to an array.`
|
|
11379
11410
|
), null);
|
|
@@ -11404,7 +11435,7 @@ ${U}
|
|
|
11404
11435
|
if (!n)
|
|
11405
11436
|
return null;
|
|
11406
11437
|
if (n.getAttribute(`${l.prefix}each-arg`) === t) {
|
|
11407
|
-
const s =
|
|
11438
|
+
const s = g.resolveEachArray(n, !0);
|
|
11408
11439
|
if (!s)
|
|
11409
11440
|
return m.error(
|
|
11410
11441
|
"Haori",
|
|
@@ -11414,7 +11445,7 @@ ${U}
|
|
|
11414
11445
|
`${l.prefix}each`
|
|
11415
11446
|
)}") does not resolve to a writable array. Build the outer list with ${l.prefix}derive and declare ${l.prefix}each-array on this ${l.prefix}each.`
|
|
11416
11447
|
), "unresolvable";
|
|
11417
|
-
const a =
|
|
11448
|
+
const a = g.resolveRowIndex(
|
|
11418
11449
|
n,
|
|
11419
11450
|
i,
|
|
11420
11451
|
s.array,
|
|
@@ -11520,7 +11551,7 @@ ${U}
|
|
|
11520
11551
|
return i === null ? (m.warn(
|
|
11521
11552
|
"Haori",
|
|
11522
11553
|
`Target is not a row of the ${l.prefix}each container (${t}).`
|
|
11523
|
-
), { kind: "skip" }) :
|
|
11554
|
+
), { kind: "skip" }) : g.getRowFragments(i).includes(e) ? { kind: "row", container: i } : (m.warn(
|
|
11524
11555
|
"Haori",
|
|
11525
11556
|
`The target row is no longer in the ${l.prefix}each container; the write was skipped (${t}).`
|
|
11526
11557
|
), { kind: "skip" });
|
|
@@ -11544,27 +11575,27 @@ ${U}
|
|
|
11544
11575
|
}
|
|
11545
11576
|
const r = [];
|
|
11546
11577
|
return t.forEach((i, n) => {
|
|
11547
|
-
const s =
|
|
11578
|
+
const s = g.resolveEachArray(n);
|
|
11548
11579
|
if (!s)
|
|
11549
11580
|
return;
|
|
11550
11581
|
const a = s.array.slice();
|
|
11551
11582
|
let o = !1;
|
|
11552
11583
|
for (const u of i) {
|
|
11553
|
-
const d =
|
|
11584
|
+
const d = g.resolveRowArrayIndex(u, a);
|
|
11554
11585
|
if (d === null)
|
|
11555
11586
|
continue;
|
|
11556
|
-
const
|
|
11557
|
-
if (
|
|
11587
|
+
const p = a[d];
|
|
11588
|
+
if (p === null || typeof p != "object" || Array.isArray(p)) {
|
|
11558
11589
|
m.warn(
|
|
11559
11590
|
"Haori",
|
|
11560
11591
|
`Row data is not an object; the write was skipped (${u.attributeName}).`
|
|
11561
11592
|
);
|
|
11562
11593
|
continue;
|
|
11563
11594
|
}
|
|
11564
|
-
const y = u.apply(
|
|
11565
|
-
if (
|
|
11595
|
+
const y = u.apply(p);
|
|
11596
|
+
if (g.isSameRowItem(p, y)) {
|
|
11566
11597
|
u.syncWhenUnchanged && r.push(
|
|
11567
|
-
|
|
11598
|
+
g.syncUnchangedRowValues(
|
|
11568
11599
|
u.row,
|
|
11569
11600
|
y,
|
|
11570
11601
|
u.syncWhenUnchanged
|
|
@@ -11572,13 +11603,13 @@ ${U}
|
|
|
11572
11603
|
);
|
|
11573
11604
|
continue;
|
|
11574
11605
|
}
|
|
11575
|
-
a[d] = y, o = !0, u.syncWhenUnchanged === "supply" &&
|
|
11606
|
+
a[d] = y, o = !0, u.syncWhenUnchanged === "supply" && N.clearRowUserEditMarksForChangedKeys(u.row, y);
|
|
11576
11607
|
}
|
|
11577
11608
|
if (!o)
|
|
11578
11609
|
return;
|
|
11579
|
-
const c =
|
|
11610
|
+
const c = M.setBindingData(
|
|
11580
11611
|
s.owner.getTarget(),
|
|
11581
|
-
|
|
11612
|
+
g.withPathValue(s.ownerData, s.path, a),
|
|
11582
11613
|
{
|
|
11583
11614
|
// マネージド `data-fetch` はバインドワークの内部から起動・await される。
|
|
11584
11615
|
// 所有者が実行中のバインドワークを持つときに FIFO キューへ積むと、相互に
|
|
@@ -11592,7 +11623,7 @@ ${U}
|
|
|
11592
11623
|
sequence: this.operationSequence
|
|
11593
11624
|
}
|
|
11594
11625
|
);
|
|
11595
|
-
if (
|
|
11626
|
+
if (M.isEachUpdateRunning(n)) {
|
|
11596
11627
|
c.catch((u) => {
|
|
11597
11628
|
m.error("Haori", "Failed to write row data.", u);
|
|
11598
11629
|
});
|
|
@@ -11622,7 +11653,7 @@ ${U}
|
|
|
11622
11653
|
* @returns 反映完了の Promise
|
|
11623
11654
|
*/
|
|
11624
11655
|
static syncUnchangedRowValues(e, t, r) {
|
|
11625
|
-
return r === "supply" &&
|
|
11656
|
+
return r === "supply" && N.clearRowUserEditMarksForChangedKeys(e, t), N.syncRowValues(e, t);
|
|
11626
11657
|
}
|
|
11627
11658
|
/**
|
|
11628
11659
|
* 行の要素データが同じ内容かどうかを判定します。
|
|
@@ -11658,7 +11689,7 @@ ${U}
|
|
|
11658
11689
|
* @returns 配列のインデックス。解決できない場合は null
|
|
11659
11690
|
*/
|
|
11660
11691
|
static resolveRowArrayIndex(e, t) {
|
|
11661
|
-
return
|
|
11692
|
+
return g.resolveRowIndex(
|
|
11662
11693
|
e.container,
|
|
11663
11694
|
e.row,
|
|
11664
11695
|
t,
|
|
@@ -11678,7 +11709,7 @@ ${U}
|
|
|
11678
11709
|
* @returns 配列のインデックス。解決できない場合は null
|
|
11679
11710
|
*/
|
|
11680
11711
|
static resolveRowIndex(e, t, r, i) {
|
|
11681
|
-
const n =
|
|
11712
|
+
const n = g.getRowFragments(e), s = n.indexOf(t);
|
|
11682
11713
|
if (s === -1)
|
|
11683
11714
|
return m.warn(
|
|
11684
11715
|
"Haori",
|
|
@@ -11687,14 +11718,14 @@ ${U}
|
|
|
11687
11718
|
const a = e.getAttribute(`${l.prefix}each-key`), o = t.getListKey();
|
|
11688
11719
|
if (a && o !== null) {
|
|
11689
11720
|
const c = [];
|
|
11690
|
-
r.forEach((
|
|
11691
|
-
|
|
11692
|
-
|
|
11721
|
+
r.forEach((p, y) => {
|
|
11722
|
+
M.createListKey(
|
|
11723
|
+
p,
|
|
11693
11724
|
String(a),
|
|
11694
11725
|
y
|
|
11695
11726
|
) === o && c.push(y);
|
|
11696
11727
|
});
|
|
11697
|
-
const u = n.slice(0, s).filter((
|
|
11728
|
+
const u = n.slice(0, s).filter((p) => p.getListKey() === o).length, d = c[u] ?? -1;
|
|
11698
11729
|
return d === -1 ? (m.warn(
|
|
11699
11730
|
"Haori",
|
|
11700
11731
|
`No array element corresponds to the target row (key "${o}"); the write was skipped (${i}).`
|
|
@@ -11722,7 +11753,7 @@ ${U}
|
|
|
11722
11753
|
if (this.options.rowRemove !== !0)
|
|
11723
11754
|
return Promise.resolve();
|
|
11724
11755
|
const e = this.options.targetFragment?.hasAttribute(
|
|
11725
|
-
|
|
11756
|
+
g.attrName(this.eventType, "row-remove-empty")
|
|
11726
11757
|
);
|
|
11727
11758
|
return this.spliceRows("row-remove", (t, r) => r < 0 || r >= t.length || !e && t.length <= 1 ? !1 : (t.splice(r, 1), !0));
|
|
11728
11759
|
}
|
|
@@ -11780,14 +11811,14 @@ ${U}
|
|
|
11780
11811
|
const r = this.resolveRowContainer(e);
|
|
11781
11812
|
if (!r)
|
|
11782
11813
|
return Promise.reject(new Error("Row container not found."));
|
|
11783
|
-
const i =
|
|
11814
|
+
const i = g.resolveEachArray(r);
|
|
11784
11815
|
if (!i)
|
|
11785
11816
|
return Promise.reject(new Error("Row array not resolved."));
|
|
11786
|
-
const n = this.options.targetFragment, s = n ? n.closestByAttribute(`${l.prefix}row`) : null, a =
|
|
11817
|
+
const n = this.options.targetFragment, s = n ? n.closestByAttribute(`${l.prefix}row`) : null, a = g.getRowFragments(r), o = s ? a.indexOf(s) : a.length - 1, c = (y) => y < 0 || y >= a.length ? null : i.mapped ? g.resolveRowIndex(
|
|
11787
11818
|
r,
|
|
11788
11819
|
a[y],
|
|
11789
11820
|
i.array,
|
|
11790
|
-
|
|
11821
|
+
g.attrName(this.eventType, e)
|
|
11791
11822
|
) : y, u = o >= 0 ? c(o) : i.mapped ? i.array.length - 1 : o;
|
|
11792
11823
|
if (u === null)
|
|
11793
11824
|
return Promise.resolve();
|
|
@@ -11799,24 +11830,24 @@ ${U}
|
|
|
11799
11830
|
() => c(o + 1)
|
|
11800
11831
|
))
|
|
11801
11832
|
return Promise.resolve();
|
|
11802
|
-
const
|
|
11833
|
+
const p = /* @__PURE__ */ new Map();
|
|
11803
11834
|
return a.forEach((y) => {
|
|
11804
11835
|
const E = y.getListKey();
|
|
11805
|
-
E !== null && !
|
|
11836
|
+
E !== null && !p.has(String(E)) && p.set(String(E), y);
|
|
11806
11837
|
}), d.forEach((y, E) => {
|
|
11807
|
-
if (
|
|
11838
|
+
if (g.isSameRowItem(i.array[E], y))
|
|
11808
11839
|
return;
|
|
11809
|
-
const A =
|
|
11810
|
-
|
|
11840
|
+
const A = p.get(
|
|
11841
|
+
M.createListKey(
|
|
11811
11842
|
y,
|
|
11812
11843
|
null,
|
|
11813
11844
|
E
|
|
11814
11845
|
)
|
|
11815
11846
|
);
|
|
11816
|
-
A &&
|
|
11817
|
-
}),
|
|
11847
|
+
A && M.clearUserEditMarks(A);
|
|
11848
|
+
}), M.setBindingData(
|
|
11818
11849
|
i.owner.getTarget(),
|
|
11819
|
-
|
|
11850
|
+
g.withPathValue(i.ownerData, i.path, d),
|
|
11820
11851
|
{
|
|
11821
11852
|
// 対象は配列の 1 要素だけなので、所有者の部分木を丸ごと供給の宛先にはしない
|
|
11822
11853
|
// (行の書き戻し `applyRowWrites()` と同じ扱い)。
|
|
@@ -11837,27 +11868,29 @@ ${U}
|
|
|
11837
11868
|
* @param status フェッチ状態('loading' | 'success' | 'error')
|
|
11838
11869
|
* @param statusCode HTTP ステータスコード(無い場合は null)
|
|
11839
11870
|
* @param message エラーメッセージ等(無い場合は null)
|
|
11871
|
+
* @param responseMessage エラー応答の本文から取り出した文言(無い場合は null)
|
|
11840
11872
|
* @returns 注入完了の Promise
|
|
11841
11873
|
*/
|
|
11842
|
-
async injectFetchState(e, t = null, r = null) {
|
|
11843
|
-
const
|
|
11844
|
-
if (!
|
|
11874
|
+
async injectFetchState(e, t = null, r = null, i = null) {
|
|
11875
|
+
const n = this.options.fetchStateFragments;
|
|
11876
|
+
if (!n || n.length === 0)
|
|
11845
11877
|
return;
|
|
11846
|
-
const
|
|
11878
|
+
const s = {
|
|
11847
11879
|
status: e,
|
|
11848
11880
|
loading: e === "loading",
|
|
11849
11881
|
success: e === "success",
|
|
11850
11882
|
error: e === "error",
|
|
11851
11883
|
statusCode: t,
|
|
11852
|
-
message: r
|
|
11884
|
+
message: r,
|
|
11885
|
+
responseMessage: i
|
|
11853
11886
|
};
|
|
11854
|
-
this.options.download && (
|
|
11855
|
-
|
|
11856
|
-
const
|
|
11857
|
-
...
|
|
11858
|
-
_fetch:
|
|
11887
|
+
this.options.download && (s.receivedBytes = this.downloadReceivedBytes, s.totalBytes = this.downloadTotalBytes), await Promise.all(
|
|
11888
|
+
n.map((a) => {
|
|
11889
|
+
const o = a.getTarget(), c = {
|
|
11890
|
+
...a.getRawBindingData() ?? {},
|
|
11891
|
+
_fetch: s
|
|
11859
11892
|
};
|
|
11860
|
-
return
|
|
11893
|
+
return M.setBindingData(o, c, {
|
|
11861
11894
|
reflectToAttribute: !1,
|
|
11862
11895
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
11863
11896
|
// 解除しない)。
|
|
@@ -11868,8 +11901,8 @@ ${U}
|
|
|
11868
11901
|
);
|
|
11869
11902
|
}
|
|
11870
11903
|
};
|
|
11871
|
-
|
|
11872
|
-
let oe =
|
|
11904
|
+
g.DATA_PLACEHOLDER_REGEX = /\{\{\{([\s\S]+?)\}\}\}|\{\{([\s\S]+?)\}\}/g, g.SINGLE_PLACEHOLDER_REGEX = /^(\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\})$/, g.RUNNING_CLICK_TARGETS = /* @__PURE__ */ new WeakSet(), g.CLICK_OUTCOMES = /* @__PURE__ */ new WeakMap(), g.validationReportGeneration = 0, g.VALIDATION_SCROLL_TIMEOUT_MS = 1e3, g.VALIDATION_SCROLL_STABLE_FRAMES = 2;
|
|
11905
|
+
let oe = g;
|
|
11873
11906
|
class jt {
|
|
11874
11907
|
/**
|
|
11875
11908
|
* 指定URLから HTML を取得し、body 内の HTML 文字列を返します。
|
|
@@ -11960,7 +11993,7 @@ const f = class f {
|
|
|
11960
11993
|
* @returns data-attr-* の内部反映なら true
|
|
11961
11994
|
*/
|
|
11962
11995
|
static isAliasedAttributeReflection(e, t) {
|
|
11963
|
-
const r =
|
|
11996
|
+
const r = I.get(e);
|
|
11964
11997
|
return r instanceof S ? r.hasAttribute(
|
|
11965
11998
|
`${l.prefix}${f.ATTRIBUTE_ALIAS_SUFFIX}${t}`
|
|
11966
11999
|
) : !1;
|
|
@@ -12063,7 +12096,7 @@ const f = class f {
|
|
|
12063
12096
|
if (t.has(e) || !e.isInitialized())
|
|
12064
12097
|
return Promise.resolve();
|
|
12065
12098
|
const r = [];
|
|
12066
|
-
return e.hasAttribute(`${l.prefix}validity`) &&
|
|
12099
|
+
return e.hasAttribute(`${l.prefix}validity`) && N.applyCustomValidity(e), e.hasAttribute(`${l.prefix}fetch`) && r.push(f.executeManagedFetch(e)), e.hasAttribute(`${l.prefix}import`) && r.push(f.executeManagedImport(e)), e.isVisible() ? (e.getChildren().forEach((i) => {
|
|
12067
12100
|
i instanceof S && r.push(
|
|
12068
12101
|
f.reevaluateReactiveSpecialAttributes(i, t)
|
|
12069
12102
|
);
|
|
@@ -12116,12 +12149,12 @@ const f = class f {
|
|
|
12116
12149
|
return Promise.resolve();
|
|
12117
12150
|
r.lastUrl = n, r.running = !0;
|
|
12118
12151
|
const s = performance.now();
|
|
12119
|
-
return t.setAttribute(`${l.prefix}importing`, ""),
|
|
12152
|
+
return t.setAttribute(`${l.prefix}importing`, ""), H.importStart(t, n), jt.load(n).then((a) => {
|
|
12120
12153
|
const o = new TextEncoder().encode(a).length;
|
|
12121
12154
|
return z.enqueue(() => {
|
|
12122
12155
|
t.innerHTML = a;
|
|
12123
12156
|
}).then(() => {
|
|
12124
|
-
t.removeAttribute(`${l.prefix}importing`),
|
|
12157
|
+
t.removeAttribute(`${l.prefix}importing`), H.importEnd(t, n, o, s), f.adoptImportedChildren(e);
|
|
12125
12158
|
const c = [];
|
|
12126
12159
|
return e.getChildren().forEach((u) => {
|
|
12127
12160
|
u instanceof S ? c.push(f.scan(u.getTarget())) : u instanceof se && c.push(f.evaluateText(u));
|
|
@@ -12129,7 +12162,7 @@ const f = class f {
|
|
|
12129
12162
|
});
|
|
12130
12163
|
});
|
|
12131
12164
|
}).catch((a) => {
|
|
12132
|
-
t.removeAttribute(`${l.prefix}importing`),
|
|
12165
|
+
t.removeAttribute(`${l.prefix}importing`), H.importError(t, n, a), m.error("[Haori]", "Failed to import HTML:", n, a);
|
|
12133
12166
|
}).finally(() => {
|
|
12134
12167
|
if (r.running = !1, r.rerunRequested)
|
|
12135
12168
|
return r.rerunRequested = !1, f.executeManagedImport(e);
|
|
@@ -12152,7 +12185,7 @@ const f = class f {
|
|
|
12152
12185
|
e.getChildren().filter((r) => r.getTarget().parentNode !== t).forEach((r) => {
|
|
12153
12186
|
r.remove(!1);
|
|
12154
12187
|
}), t.childNodes.forEach((r) => {
|
|
12155
|
-
const i =
|
|
12188
|
+
const i = I.get(r);
|
|
12156
12189
|
i !== null && i.getParent() !== e && e.pushChild(i);
|
|
12157
12190
|
});
|
|
12158
12191
|
}
|
|
@@ -12177,11 +12210,11 @@ const f = class f {
|
|
|
12177
12210
|
* @returns Promise (スキャンが完了したときに解決される)
|
|
12178
12211
|
*/
|
|
12179
12212
|
static scanElement(e, t) {
|
|
12180
|
-
const r =
|
|
12213
|
+
const r = I.get(e);
|
|
12181
12214
|
if (!r)
|
|
12182
12215
|
return Promise.resolve();
|
|
12183
12216
|
const i = f.initializeElementFragment(r, !1).then(
|
|
12184
|
-
() =>
|
|
12217
|
+
() => N.restoreInitialValues(e)
|
|
12185
12218
|
), n = f.initialValueRestore;
|
|
12186
12219
|
return f.initialValueRestore = i, i.then(() => {
|
|
12187
12220
|
f.initialValueRestore = n, t && re.applySubtree(e);
|
|
@@ -12292,7 +12325,7 @@ const f = class f {
|
|
|
12292
12325
|
e.getRawAttribute(n)
|
|
12293
12326
|
))), r.add(n));
|
|
12294
12327
|
}
|
|
12295
|
-
return t.then(() => (e.markInitialized(),
|
|
12328
|
+
return t.then(() => (e.markInitialized(), N.prepareFormName(e)));
|
|
12296
12329
|
}
|
|
12297
12330
|
/**
|
|
12298
12331
|
* 子孫初期化をスキップすべきかどうかを返します。
|
|
@@ -12319,7 +12352,7 @@ const f = class f {
|
|
|
12319
12352
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
12320
12353
|
*/
|
|
12321
12354
|
static setAttribute(e, t, r, i = !1, n) {
|
|
12322
|
-
const s =
|
|
12355
|
+
const s = I.get(e), a = f.getAliasedAttributeName(t);
|
|
12323
12356
|
if (a !== null)
|
|
12324
12357
|
return r === null ? s.removeAliasedAttribute(t, a) : s.setAliasedAttribute(
|
|
12325
12358
|
t,
|
|
@@ -12333,22 +12366,22 @@ const f = class f {
|
|
|
12333
12366
|
case `${l.prefix}bind`: {
|
|
12334
12367
|
if (r !== null && i && s instanceof S && s.consumeSelfWrittenBind(r))
|
|
12335
12368
|
break;
|
|
12336
|
-
const
|
|
12369
|
+
const p = r === null ? {} : f.parseDataBind(r);
|
|
12337
12370
|
if (i) {
|
|
12338
12371
|
const y = n ?? S.nextSequence();
|
|
12339
12372
|
return r === null ? (o.push(
|
|
12340
|
-
f.setBindingData(e,
|
|
12373
|
+
f.setBindingData(e, p, {
|
|
12341
12374
|
reflectToAttribute: !1,
|
|
12342
12375
|
sequence: y
|
|
12343
12376
|
})
|
|
12344
12377
|
), o.push(s.removeAttribute(t))) : o.push(
|
|
12345
|
-
f.setBindingData(e,
|
|
12378
|
+
f.setBindingData(e, p, {
|
|
12346
12379
|
sequence: y
|
|
12347
12380
|
})
|
|
12348
12381
|
), Promise.all(o).then(() => {
|
|
12349
12382
|
});
|
|
12350
12383
|
}
|
|
12351
|
-
r === null && s.clearBindingDataCache(), s.setBindingData(
|
|
12384
|
+
r === null && s.clearBindingDataCache(), s.setBindingData(p);
|
|
12352
12385
|
break;
|
|
12353
12386
|
}
|
|
12354
12387
|
case `${l.prefix}derive`:
|
|
@@ -12392,11 +12425,11 @@ const f = class f {
|
|
|
12392
12425
|
break;
|
|
12393
12426
|
case `${l.prefix}validity`:
|
|
12394
12427
|
case `${l.prefix}validity-message`:
|
|
12395
|
-
return r !== null &&
|
|
12428
|
+
return r !== null && N.applyCustomValidity(s), Promise.all(o).then(() => {
|
|
12396
12429
|
});
|
|
12397
12430
|
case `${l.prefix}url-param`: {
|
|
12398
|
-
const
|
|
12399
|
-
|
|
12431
|
+
const p = s.getAttribute(`${l.prefix}url-arg`), y = mt.readParams();
|
|
12432
|
+
p === null && s.hasAttribute(`${l.prefix}store`) && m.warn(
|
|
12400
12433
|
"Haori",
|
|
12401
12434
|
`${l.prefix}url-param を ${l.prefix}url-arg なしで ${l.prefix}store と併用すると復元した値が消えます(${l.prefix}url-arg を指定してください)。`
|
|
12402
12435
|
);
|
|
@@ -12405,11 +12438,11 @@ const f = class f {
|
|
|
12405
12438
|
kind: "nonSupply",
|
|
12406
12439
|
sequence: S.nextSequence()
|
|
12407
12440
|
};
|
|
12408
|
-
if (
|
|
12441
|
+
if (p === null)
|
|
12409
12442
|
o.push(f.setBindingData(e, y, E));
|
|
12410
12443
|
else {
|
|
12411
12444
|
const A = s.getRawBindingData() || {};
|
|
12412
|
-
A[String(
|
|
12445
|
+
A[String(p)] = y, o.push(f.setBindingData(e, A, E));
|
|
12413
12446
|
}
|
|
12414
12447
|
break;
|
|
12415
12448
|
}
|
|
@@ -12418,8 +12451,8 @@ const f = class f {
|
|
|
12418
12451
|
() => d === null ? void 0 : d()
|
|
12419
12452
|
).then(() => {
|
|
12420
12453
|
if (c !== null)
|
|
12421
|
-
return s.setDeriveInputSignature(u), c.then((
|
|
12422
|
-
if (
|
|
12454
|
+
return s.setDeriveInputSignature(u), c.then((p) => {
|
|
12455
|
+
if (p)
|
|
12423
12456
|
return f.reevaluateChildren(s);
|
|
12424
12457
|
});
|
|
12425
12458
|
}).then(() => {
|
|
@@ -12452,43 +12485,43 @@ const f = class f {
|
|
|
12452
12485
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
12453
12486
|
*/
|
|
12454
12487
|
static setBindingData(e, t, r = {}) {
|
|
12455
|
-
const i =
|
|
12488
|
+
const i = I.get(e), n = r.skipFragments ?? /* @__PURE__ */ new Set(), s = r.reentrant ?? !1, a = r.reflectToAttribute ?? !0, o = r.kind ?? "supply", c = r.sequence ?? S.nextOperationSequence(), u = {
|
|
12456
12489
|
sequence: c,
|
|
12457
12490
|
kind: o,
|
|
12458
12491
|
...r.editedPaths === void 0 ? {} : { editedPaths: r.editedPaths }
|
|
12459
12492
|
}, d = o === "supply";
|
|
12460
12493
|
d && i.markSupplyApplied(c);
|
|
12461
|
-
const
|
|
12494
|
+
const p = S.currentSequence(), y = i.getRawBindingData();
|
|
12462
12495
|
d && (r.clearUserEdits ?? !0) && f.clearUserEditMarks(i, c);
|
|
12463
12496
|
const E = a ? f.resolveByPathAuthority(i, y, t, u) : t;
|
|
12464
|
-
i.setBindingData(E), a && (
|
|
12497
|
+
i.setBindingData(E), a && (H.bindChange(e, y, E, "manual"), Fe.mirror(i));
|
|
12465
12498
|
const A = () => {
|
|
12466
12499
|
i.markBindingWorkStart();
|
|
12467
|
-
const
|
|
12468
|
-
let
|
|
12500
|
+
const D = i.getRawBindingData() ?? E;
|
|
12501
|
+
let x = a ? i.setAttribute(
|
|
12469
12502
|
`${l.prefix}bind`,
|
|
12470
|
-
JSON.stringify(f.withoutReservedBindingKeys(
|
|
12503
|
+
JSON.stringify(f.withoutReservedBindingKeys(D))
|
|
12471
12504
|
) : Promise.resolve();
|
|
12472
|
-
return e.tagName === "FORM" && (
|
|
12473
|
-
if (i.wasResetAfter(
|
|
12505
|
+
return e.tagName === "FORM" && (x = x.then(() => {
|
|
12506
|
+
if (i.wasResetAfter(p))
|
|
12474
12507
|
return;
|
|
12475
|
-
const
|
|
12476
|
-
return
|
|
12508
|
+
const B = i.getRawBindingData() ?? E;
|
|
12509
|
+
return N.syncValues(
|
|
12477
12510
|
i,
|
|
12478
|
-
|
|
12511
|
+
N.resolveSyncValues(i, B),
|
|
12479
12512
|
!1,
|
|
12480
12513
|
u
|
|
12481
12514
|
);
|
|
12482
|
-
})),
|
|
12483
|
-
() =>
|
|
12484
|
-
),
|
|
12485
|
-
() => S.retryUnappliedValueWrites(e,
|
|
12486
|
-
),
|
|
12515
|
+
})), x = x.then(
|
|
12516
|
+
() => N.syncAncestorArgForms(i, p, u, y)
|
|
12517
|
+
), x = x.then(() => f.evaluateAll(i, n)), x = x.then(
|
|
12518
|
+
() => S.retryUnappliedValueWrites(e, p)
|
|
12519
|
+
), x = x.then(
|
|
12487
12520
|
() => f.reevaluateReactiveSpecialAttributes(i, n)
|
|
12488
|
-
),
|
|
12521
|
+
), x.then(
|
|
12489
12522
|
() => i.markBindingWorkEnd(),
|
|
12490
|
-
(
|
|
12491
|
-
throw i.markBindingWorkEnd(),
|
|
12523
|
+
(B) => {
|
|
12524
|
+
throw i.markBindingWorkEnd(), B;
|
|
12492
12525
|
}
|
|
12493
12526
|
);
|
|
12494
12527
|
};
|
|
@@ -12549,7 +12582,7 @@ const f = class f {
|
|
|
12549
12582
|
*/
|
|
12550
12583
|
static mergePathAuthority(e, t, r, i, n) {
|
|
12551
12584
|
if (f.isPlainRecord(t) && f.isPlainRecord(r)) {
|
|
12552
|
-
const u = t, d = r,
|
|
12585
|
+
const u = t, d = r, p = {};
|
|
12553
12586
|
let y = Object.keys(u).some(
|
|
12554
12587
|
(A) => !Object.prototype.hasOwnProperty.call(d, A)
|
|
12555
12588
|
);
|
|
@@ -12558,20 +12591,20 @@ const f = class f {
|
|
|
12558
12591
|
...Object.keys(d)
|
|
12559
12592
|
]);
|
|
12560
12593
|
for (const A of E) {
|
|
12561
|
-
const
|
|
12594
|
+
const D = n === "" ? A : `${n}.${A}`, x = f.mergePathAuthority(
|
|
12562
12595
|
e,
|
|
12563
12596
|
Object.prototype.hasOwnProperty.call(u, A) ? u[A] : f.ABSENT_PATH,
|
|
12564
12597
|
Object.prototype.hasOwnProperty.call(d, A) ? d[A] : f.ABSENT_PATH,
|
|
12565
12598
|
i,
|
|
12566
|
-
|
|
12599
|
+
D
|
|
12567
12600
|
);
|
|
12568
|
-
|
|
12601
|
+
x !== f.ABSENT_PATH && (p[A] = x), x !== (Object.prototype.hasOwnProperty.call(d, A) ? d[A] : f.ABSENT_PATH) && (y = !0);
|
|
12569
12602
|
}
|
|
12570
|
-
return y ?
|
|
12603
|
+
return y ? p : d;
|
|
12571
12604
|
}
|
|
12572
12605
|
const s = f.resolveArrayPairing(e, t, r, n);
|
|
12573
12606
|
if (s !== null) {
|
|
12574
|
-
const u = t, d = r,
|
|
12607
|
+
const u = t, d = r, p = d.map(
|
|
12575
12608
|
(y, E) => f.mergePathAuthority(
|
|
12576
12609
|
e,
|
|
12577
12610
|
u[E],
|
|
@@ -12580,7 +12613,7 @@ const f = class f {
|
|
|
12580
12613
|
`${n}[${s[E]}]`
|
|
12581
12614
|
)
|
|
12582
12615
|
);
|
|
12583
|
-
return
|
|
12616
|
+
return p.some((y, E) => y !== d[E]) ? p : d;
|
|
12584
12617
|
}
|
|
12585
12618
|
if (f.isSameBindingValue(t, r))
|
|
12586
12619
|
return r;
|
|
@@ -12734,7 +12767,7 @@ const f = class f {
|
|
|
12734
12767
|
* `resolved: true` のときは解決済みスコープ(常にオブジェクト)。
|
|
12735
12768
|
*/
|
|
12736
12769
|
static getBindingData(e, t = {}) {
|
|
12737
|
-
const r =
|
|
12770
|
+
const r = I.get(e);
|
|
12738
12771
|
return r instanceof S ? t.resolved ? r.getBindingData() : r.getRawBindingData() : null;
|
|
12739
12772
|
}
|
|
12740
12773
|
/**
|
|
@@ -12767,20 +12800,20 @@ const f = class f {
|
|
|
12767
12800
|
* @return 解決済みスコープと各キーの由来情報
|
|
12768
12801
|
*/
|
|
12769
12802
|
static collectScope(e) {
|
|
12770
|
-
const t =
|
|
12803
|
+
const t = I.get(e);
|
|
12771
12804
|
if (!t)
|
|
12772
12805
|
return { resolved: {}, sources: {} };
|
|
12773
12806
|
const r = t.getBindingData(), i = {}, n = (c) => {
|
|
12774
12807
|
const u = c.getTarget(), d = f.resolveElementId(u);
|
|
12775
12808
|
return d !== "" ? `#${d}` : u.tagName.toLowerCase();
|
|
12776
|
-
}, s = (c, u, d,
|
|
12809
|
+
}, s = (c, u, d, p) => {
|
|
12777
12810
|
if (c)
|
|
12778
12811
|
for (const y of Object.keys(c))
|
|
12779
12812
|
y in i || (i[y] = {
|
|
12780
12813
|
value: c[y],
|
|
12781
12814
|
source: n(u),
|
|
12782
12815
|
kind: d,
|
|
12783
|
-
depth:
|
|
12816
|
+
depth: p
|
|
12784
12817
|
});
|
|
12785
12818
|
};
|
|
12786
12819
|
let a = t, o = 0;
|
|
@@ -12816,10 +12849,10 @@ const f = class f {
|
|
|
12816
12849
|
* @returns 追加したノードの走査(評価)の Promise。走査しない場合は解決済みの Promise
|
|
12817
12850
|
*/
|
|
12818
12851
|
static addNode(e, t) {
|
|
12819
|
-
const r =
|
|
12852
|
+
const r = I.get(e);
|
|
12820
12853
|
if (r.isSkipMutationNode(t))
|
|
12821
12854
|
return Promise.resolve();
|
|
12822
|
-
const i =
|
|
12855
|
+
const i = I.get(t.nextSibling), n = I.get(t);
|
|
12823
12856
|
if (n) {
|
|
12824
12857
|
if (n.getParent() === r)
|
|
12825
12858
|
return Promise.resolve();
|
|
@@ -12836,7 +12869,7 @@ const f = class f {
|
|
|
12836
12869
|
* @param node 削除するノード
|
|
12837
12870
|
*/
|
|
12838
12871
|
static removeNode(e) {
|
|
12839
|
-
const t =
|
|
12872
|
+
const t = I.get(e);
|
|
12840
12873
|
if (t) {
|
|
12841
12874
|
const r = t.getParent();
|
|
12842
12875
|
if (r && r.isSkipMutationNode(e))
|
|
@@ -12851,7 +12884,7 @@ const f = class f {
|
|
|
12851
12884
|
* @param text 新しいテキスト
|
|
12852
12885
|
*/
|
|
12853
12886
|
static changeText(e, t) {
|
|
12854
|
-
const r =
|
|
12887
|
+
const r = I.get(e);
|
|
12855
12888
|
r && r.setContent(t);
|
|
12856
12889
|
}
|
|
12857
12890
|
/**
|
|
@@ -12863,27 +12896,27 @@ const f = class f {
|
|
|
12863
12896
|
* @returns Promise (DOM操作が完了したときに解決される)
|
|
12864
12897
|
*/
|
|
12865
12898
|
static changeValue(e, t) {
|
|
12866
|
-
const r =
|
|
12899
|
+
const r = I.get(e);
|
|
12867
12900
|
if (r.getValue() === t)
|
|
12868
12901
|
return Promise.resolve();
|
|
12869
12902
|
const i = [];
|
|
12870
12903
|
i.push(r.setValue(t));
|
|
12871
12904
|
const n = f.getFormFragment(r);
|
|
12872
12905
|
if (n) {
|
|
12873
|
-
const s =
|
|
12906
|
+
const s = N.getValues(n), a = n.getAttribute(`${l.prefix}form-arg`), o = n.getRawBindingData();
|
|
12874
12907
|
let c;
|
|
12875
12908
|
if (a) {
|
|
12876
12909
|
c = { ...o ?? {} };
|
|
12877
|
-
const u = String(a), d =
|
|
12878
|
-
c[u] =
|
|
12910
|
+
const u = String(a), d = N.resolveAncestorArgOwner(n, u);
|
|
12911
|
+
c[u] = N.mergeCollectedValues(
|
|
12879
12912
|
(d ? d.value : c[u]) ?? null,
|
|
12880
12913
|
s
|
|
12881
12914
|
);
|
|
12882
12915
|
} else
|
|
12883
|
-
c =
|
|
12916
|
+
c = N.mergeCollectedValues(
|
|
12884
12917
|
o,
|
|
12885
12918
|
s,
|
|
12886
|
-
|
|
12919
|
+
N.ancestorBaseResolver(n)
|
|
12887
12920
|
);
|
|
12888
12921
|
i.push(
|
|
12889
12922
|
// 値の設定に伴うコミットなので、値の供給ではない更新として扱う(権威を
|
|
@@ -12940,14 +12973,14 @@ const f = class f {
|
|
|
12940
12973
|
e.setDeriveInputSignature(E);
|
|
12941
12974
|
})));
|
|
12942
12975
|
}
|
|
12943
|
-
let
|
|
12976
|
+
let p = !1, y = 0;
|
|
12944
12977
|
return n && (r = r.then(() => {
|
|
12945
12978
|
const E = e.isVisible();
|
|
12946
12979
|
return y = S.currentSequence(), f.evaluateIf(e).then(() => {
|
|
12947
|
-
|
|
12980
|
+
p = !E && e.isVisible();
|
|
12948
12981
|
});
|
|
12949
12982
|
})), s ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => f.evaluateEachFixedChildren(e)).then(() => f.evaluateEach(e)).then(() => {
|
|
12950
|
-
if (
|
|
12983
|
+
if (p)
|
|
12951
12984
|
return f.applyEnhancersOnShow(e, y);
|
|
12952
12985
|
})) : n ? (e.getDeriveSubtreeSignature() !== null && e.setDeriveSubtreeSignature(null), r.then(() => {
|
|
12953
12986
|
})) : (i && (r = r.then(() => {
|
|
@@ -13155,7 +13188,7 @@ const f = class f {
|
|
|
13155
13188
|
if (f.isHiddenIfCondition(r))
|
|
13156
13189
|
W.isEnabled() && e.isVisible() && f.logFalsyIfDiagnostics(e), t.push(
|
|
13157
13190
|
e.hide().then(() => {
|
|
13158
|
-
|
|
13191
|
+
H.hide(e.getTarget());
|
|
13159
13192
|
})
|
|
13160
13193
|
);
|
|
13161
13194
|
else {
|
|
@@ -13173,7 +13206,7 @@ const f = class f {
|
|
|
13173
13206
|
} else o instanceof se && s.push(f.evaluateText(o));
|
|
13174
13207
|
}), t.push(
|
|
13175
13208
|
e.show().then(() => {
|
|
13176
|
-
|
|
13209
|
+
H.show(e.getTarget()), i || (f.triggerLoadOnShow(e), re.refreshSubtree(e.getTarget(), !1));
|
|
13177
13210
|
})
|
|
13178
13211
|
), t.push(
|
|
13179
13212
|
Promise.all(s).then(() => {
|
|
@@ -13411,10 +13444,10 @@ ${r}
|
|
|
13411
13444
|
(c) => !c.hasAttribute(`${l.prefix}each-before`) && !c.hasAttribute(`${l.prefix}each-after`)
|
|
13412
13445
|
).forEach((c) => {
|
|
13413
13446
|
if (!s) {
|
|
13414
|
-
const d =
|
|
13447
|
+
const d = I.get(c);
|
|
13415
13448
|
d instanceof S && (r = d.clone(), f.markFreshInitializationSkippable(r), e.setTemplate(r), s = !0);
|
|
13416
13449
|
}
|
|
13417
|
-
const u =
|
|
13450
|
+
const u = I.get(c);
|
|
13418
13451
|
u instanceof S && e.getChildren().includes(u) && (e.removeChild(u), u.setMounted(!1)), c.parentNode && c.parentNode.removeChild(c);
|
|
13419
13452
|
});
|
|
13420
13453
|
}
|
|
@@ -13655,7 +13688,7 @@ ${r}
|
|
|
13655
13688
|
const e = `${l.prefix}url-param`, r = Array.from(
|
|
13656
13689
|
document.querySelectorAll(`[${e}]`)
|
|
13657
13690
|
).map((i) => {
|
|
13658
|
-
const n =
|
|
13691
|
+
const n = I.peek(i);
|
|
13659
13692
|
return n instanceof S ? f.setAttribute(
|
|
13660
13693
|
i,
|
|
13661
13694
|
e,
|
|
@@ -13871,52 +13904,52 @@ ${r}
|
|
|
13871
13904
|
let i = e.getAttribute(`${l.prefix}each-index`);
|
|
13872
13905
|
i && (i = String(i));
|
|
13873
13906
|
const n = e.getAttribute(`${l.prefix}each-key`), s = e.getAttribute(`${l.prefix}each-arg`), a = t.map(
|
|
13874
|
-
(
|
|
13907
|
+
(F, j) => f.createListKey(F, n ? String(n) : null, j)
|
|
13875
13908
|
), o = new Set(a), c = /* @__PURE__ */ new Map();
|
|
13876
|
-
a.forEach((
|
|
13877
|
-
c.set(
|
|
13909
|
+
a.forEach((F) => {
|
|
13910
|
+
c.set(F, (c.get(F) ?? 0) + 1);
|
|
13878
13911
|
}), n && o.size !== a.length && f.warnDuplicateEachKey(String(n));
|
|
13879
13912
|
const u = [];
|
|
13880
|
-
let d = e.getChildren().filter((
|
|
13881
|
-
(
|
|
13913
|
+
let d = e.getChildren().filter((F) => F instanceof S).filter(
|
|
13914
|
+
(F) => !F.hasAttribute(`${l.prefix}each-before`) && !F.hasAttribute(`${l.prefix}each-after`)
|
|
13882
13915
|
);
|
|
13883
|
-
const
|
|
13884
|
-
d = d.filter((
|
|
13885
|
-
const X = String(
|
|
13916
|
+
const p = d.map((F) => F.getListKey()), y = /* @__PURE__ */ new Set();
|
|
13917
|
+
d = d.filter((F, j) => {
|
|
13918
|
+
const X = String(F.getListKey()), _ = c.get(X) ?? 0;
|
|
13886
13919
|
if (_ === 0) {
|
|
13887
|
-
y.add(
|
|
13888
|
-
const P =
|
|
13889
|
-
return P !== null &&
|
|
13920
|
+
y.add(F);
|
|
13921
|
+
const P = F.getListKey();
|
|
13922
|
+
return P !== null && H.rowRemove(F.getTarget(), P, j), u.push(F.remove()), !1;
|
|
13890
13923
|
}
|
|
13891
13924
|
return c.set(X, _ - 1), !0;
|
|
13892
13925
|
});
|
|
13893
|
-
const E = d.map((
|
|
13894
|
-
d.forEach((
|
|
13895
|
-
const j =
|
|
13926
|
+
const E = d.map((F) => F.getListKey()), A = /* @__PURE__ */ new Map();
|
|
13927
|
+
d.forEach((F) => {
|
|
13928
|
+
const j = F.getListKey();
|
|
13896
13929
|
if (j === null)
|
|
13897
13930
|
return;
|
|
13898
13931
|
const X = A.get(j);
|
|
13899
|
-
X ? X.push(
|
|
13932
|
+
X ? X.push(F) : A.set(j, [F]);
|
|
13900
13933
|
});
|
|
13901
|
-
const
|
|
13902
|
-
(
|
|
13934
|
+
const D = e.getChildElementFragments().filter((F) => !y.has(F)), x = D.filter(
|
|
13935
|
+
(F) => F.hasAttribute(`${l.prefix}each-before`)
|
|
13903
13936
|
).length;
|
|
13904
|
-
let
|
|
13905
|
-
return a.forEach((
|
|
13937
|
+
let B = Promise.resolve();
|
|
13938
|
+
return a.forEach((F, j) => {
|
|
13906
13939
|
const X = t[j], _ = j;
|
|
13907
13940
|
let P;
|
|
13908
|
-
const ae = A.get(
|
|
13941
|
+
const ae = A.get(F)?.shift();
|
|
13909
13942
|
if (ae) {
|
|
13910
13943
|
P = ae;
|
|
13911
|
-
const G =
|
|
13912
|
-
|
|
13944
|
+
const G = x + j;
|
|
13945
|
+
B = B.then(
|
|
13913
13946
|
() => f.updateRowFragment(
|
|
13914
13947
|
P,
|
|
13915
13948
|
X,
|
|
13916
13949
|
i,
|
|
13917
13950
|
_,
|
|
13918
13951
|
s ? String(s) : null,
|
|
13919
|
-
|
|
13952
|
+
F
|
|
13920
13953
|
).then(
|
|
13921
13954
|
(T) => (
|
|
13922
13955
|
// 再利用行も新しい並び順の位置へ移動する。移動しないと、配列を並べ替え
|
|
@@ -13925,13 +13958,13 @@ ${r}
|
|
|
13925
13958
|
f.repositionEachRow(
|
|
13926
13959
|
e,
|
|
13927
13960
|
P,
|
|
13928
|
-
|
|
13961
|
+
D,
|
|
13929
13962
|
G
|
|
13930
13963
|
).then((L) => {
|
|
13931
|
-
if (L !== null &&
|
|
13964
|
+
if (L !== null && H.rowMove(
|
|
13932
13965
|
P.getTarget(),
|
|
13933
|
-
|
|
13934
|
-
L -
|
|
13966
|
+
F,
|
|
13967
|
+
L - x,
|
|
13935
13968
|
j
|
|
13936
13969
|
), !(!T && f.isRowLocalEachTemplate(e)))
|
|
13937
13970
|
return f.evaluateAll(P).then(
|
|
@@ -13943,40 +13976,40 @@ ${r}
|
|
|
13943
13976
|
);
|
|
13944
13977
|
} else {
|
|
13945
13978
|
P = r.clone();
|
|
13946
|
-
const G =
|
|
13947
|
-
|
|
13979
|
+
const G = x + j;
|
|
13980
|
+
B = B.then(
|
|
13948
13981
|
() => f.updateRowFragment(
|
|
13949
13982
|
P,
|
|
13950
13983
|
X,
|
|
13951
13984
|
i,
|
|
13952
13985
|
_,
|
|
13953
13986
|
s ? String(s) : null,
|
|
13954
|
-
|
|
13987
|
+
F
|
|
13955
13988
|
).then(() => {
|
|
13956
|
-
const T =
|
|
13989
|
+
const T = D[G] ?? null;
|
|
13957
13990
|
return e.insertBefore(P, T).then(() => {
|
|
13958
|
-
|
|
13991
|
+
D.splice(G, 0, P);
|
|
13959
13992
|
}).then(() => f.initializeFreshEachRow(P)).then(() => f.applyRowFormValues(e, P, X)).then(() => {
|
|
13960
|
-
|
|
13993
|
+
H.rowAdd(P.getTarget(), F, _, X);
|
|
13961
13994
|
});
|
|
13962
13995
|
})
|
|
13963
13996
|
);
|
|
13964
13997
|
}
|
|
13965
|
-
}), Promise.all(u).then(() =>
|
|
13966
|
-
const
|
|
13998
|
+
}), Promise.all(u).then(() => B).then(() => {
|
|
13999
|
+
const F = a.filter(
|
|
13967
14000
|
(G) => G !== null
|
|
13968
14001
|
), j = E.filter(
|
|
13969
14002
|
(G) => G !== null
|
|
13970
|
-
), X = new Set(j), _ =
|
|
14003
|
+
), X = new Set(j), _ = F.filter((G) => !X.has(G)), ae = p.filter(
|
|
13971
14004
|
(G) => G !== null
|
|
13972
14005
|
).filter(
|
|
13973
14006
|
(G) => !o.has(G)
|
|
13974
14007
|
);
|
|
13975
|
-
|
|
14008
|
+
H.eachUpdate(
|
|
13976
14009
|
e.getTarget(),
|
|
13977
14010
|
_,
|
|
13978
14011
|
ae,
|
|
13979
|
-
|
|
14012
|
+
F
|
|
13980
14013
|
);
|
|
13981
14014
|
});
|
|
13982
14015
|
}
|
|
@@ -14079,7 +14112,7 @@ ${r}
|
|
|
14079
14112
|
* @returns 反映完了の Promise
|
|
14080
14113
|
*/
|
|
14081
14114
|
static applyRowFormValues(e, t, r) {
|
|
14082
|
-
return !e.hasAttribute(`${l.prefix}form-list`) || !
|
|
14115
|
+
return !e.hasAttribute(`${l.prefix}form-list`) || !N.isCollectedListFromEachSource(e) || typeof r != "object" || r === null || Array.isArray(r) ? Promise.resolve() : N.syncRowValues(t, r);
|
|
14083
14116
|
}
|
|
14084
14117
|
/**
|
|
14085
14118
|
* リスト比較用のキーを生成します。
|
|
@@ -14267,7 +14300,7 @@ f.ATTRIBUTE_ALIAS_SUFFIX = "attr-", f.PRIORITY_ATTRIBUTE_SUFFIXES = [
|
|
|
14267
14300
|
"enhance",
|
|
14268
14301
|
"enhance-new"
|
|
14269
14302
|
]), f.ROW_LOCAL_ROW_OPERATIONS = /* @__PURE__ */ new Set(["row-add", "row-remove", "row-prev", "row-next"]), f.REACTIVE_FETCH_STATES = /* @__PURE__ */ new WeakMap(), f.REACTIVE_IMPORT_STATES = /* @__PURE__ */ new WeakMap(), f.DERIVE_SUBTREE_PROFILES = /* @__PURE__ */ new WeakMap(), f.EACH_UPDATE_STATES = /* @__PURE__ */ new WeakMap(), f.EACH_RENDERED_CHANGE_FIRED = /* @__PURE__ */ new WeakSet(), f.EACH_RENDERED_CHANGE_WARNED = /* @__PURE__ */ new WeakSet(), f.WARNED_DUPLICATE_EACH_KEYS = /* @__PURE__ */ new Set(), f.ABSENT_PATH = Symbol("absent");
|
|
14270
|
-
let
|
|
14303
|
+
let M = f;
|
|
14271
14304
|
const Re = class Re {
|
|
14272
14305
|
/**
|
|
14273
14306
|
* コンストラクタ。
|
|
@@ -14276,7 +14309,7 @@ const Re = class Re {
|
|
|
14276
14309
|
*/
|
|
14277
14310
|
constructor(e = document) {
|
|
14278
14311
|
this.customEventHandlers = /* @__PURE__ */ new Map(), this.builtinListenersAdded = !1, this.deferred = !1, this.deferredProcedures = [], this.onClick = (t) => this.delegate(t, "click"), this.onReset = (t) => {
|
|
14279
|
-
if (t.defaultPrevented ||
|
|
14312
|
+
if (t.defaultPrevented || N.isResettingInternally())
|
|
14280
14313
|
return;
|
|
14281
14314
|
const r = t.target;
|
|
14282
14315
|
r instanceof HTMLElement && setTimeout(() => re.refreshSubtree(r), 0);
|
|
@@ -14289,7 +14322,7 @@ const Re = class Re {
|
|
|
14289
14322
|
}, this.onPopstate = (t) => {
|
|
14290
14323
|
const r = t.state;
|
|
14291
14324
|
if (!r || r[Re.HISTORY_STATE_KEY] !== !0) {
|
|
14292
|
-
|
|
14325
|
+
M.refreshUrlParams();
|
|
14293
14326
|
return;
|
|
14294
14327
|
}
|
|
14295
14328
|
location.reload();
|
|
@@ -14301,7 +14334,7 @@ const Re = class Re {
|
|
|
14301
14334
|
* @returns 戻り値はない。
|
|
14302
14335
|
*/
|
|
14303
14336
|
runWindowLoadProcedure() {
|
|
14304
|
-
const e = document.documentElement, t =
|
|
14337
|
+
const e = document.documentElement, t = I.get(e);
|
|
14305
14338
|
t && new oe(t, "load").run();
|
|
14306
14339
|
}
|
|
14307
14340
|
/**
|
|
@@ -14425,7 +14458,7 @@ const Re = class Re {
|
|
|
14425
14458
|
this.root.querySelectorAll(`[${this.onAttributeName}]`).forEach((i) => {
|
|
14426
14459
|
if (i.getAttribute(this.onAttributeName) !== e)
|
|
14427
14460
|
return;
|
|
14428
|
-
const n =
|
|
14461
|
+
const n = I.get(i);
|
|
14429
14462
|
n instanceof S && new oe(n, "on", t).run().catch((s) => {
|
|
14430
14463
|
m.error("[Haori]", "Procedure execution error:", s);
|
|
14431
14464
|
});
|
|
@@ -14489,7 +14522,7 @@ const Re = class Re {
|
|
|
14489
14522
|
* @returns 戻り値はない。
|
|
14490
14523
|
*/
|
|
14491
14524
|
runProcedureFor(e, t, r) {
|
|
14492
|
-
const i =
|
|
14525
|
+
const i = I.get(e);
|
|
14493
14526
|
if (!i)
|
|
14494
14527
|
return;
|
|
14495
14528
|
(t === "change" || t === "input") && this.syncUserEdit(e, t === "change");
|
|
@@ -14549,7 +14582,7 @@ const Re = class Re {
|
|
|
14549
14582
|
* @returns 戻り値はない。
|
|
14550
14583
|
*/
|
|
14551
14584
|
markUserEditOnly(e) {
|
|
14552
|
-
const t =
|
|
14585
|
+
const t = I.get(e);
|
|
14553
14586
|
t instanceof S && t.markUserEdit();
|
|
14554
14587
|
}
|
|
14555
14588
|
/**
|
|
@@ -14565,13 +14598,13 @@ const Re = class Re {
|
|
|
14565
14598
|
* @returns 戻り値はない。
|
|
14566
14599
|
*/
|
|
14567
14600
|
syncUserEdit(e, t) {
|
|
14568
|
-
const r =
|
|
14601
|
+
const r = I.get(e);
|
|
14569
14602
|
if (r instanceof S && (r.syncValue(), t ? r.markUserEditOnChange() : r.markUserEdit(), e instanceof HTMLInputElement && e.type === "radio" && e.name)) {
|
|
14570
14603
|
const i = document.getElementsByName(e.name);
|
|
14571
14604
|
for (const n of Array.from(i)) {
|
|
14572
14605
|
if (n === e || !(n instanceof HTMLInputElement) || n.type !== "radio" || n.form !== e.form)
|
|
14573
14606
|
continue;
|
|
14574
|
-
const s =
|
|
14607
|
+
const s = I.get(n);
|
|
14575
14608
|
s instanceof S && (s.syncValue(), s.markUserEdit());
|
|
14576
14609
|
}
|
|
14577
14610
|
}
|
|
@@ -14626,7 +14659,7 @@ Re.HISTORY_STATE_KEY = "__haoriHistoryState__", Re.BUILTIN_EVENT_NAMES = /* @__P
|
|
|
14626
14659
|
"load"
|
|
14627
14660
|
]);
|
|
14628
14661
|
let Ve = Re;
|
|
14629
|
-
const
|
|
14662
|
+
const q = class q {
|
|
14630
14663
|
/**
|
|
14631
14664
|
* ノードが現在の Window に属する HTMLElement かどうかを判定します。
|
|
14632
14665
|
*
|
|
@@ -14648,8 +14681,8 @@ const V = class V {
|
|
|
14648
14681
|
* @returns 戻り値はありません。
|
|
14649
14682
|
*/
|
|
14650
14683
|
static syncTree(e) {
|
|
14651
|
-
(e instanceof Element || e instanceof DocumentFragment) && (
|
|
14652
|
-
|
|
14684
|
+
(e instanceof Element || e instanceof DocumentFragment) && (q.isHtmlElement(e) && q.syncElement(e), e.querySelectorAll("*").forEach((t) => {
|
|
14685
|
+
q.syncElement(t);
|
|
14653
14686
|
}));
|
|
14654
14687
|
}
|
|
14655
14688
|
/**
|
|
@@ -14664,29 +14697,29 @@ const V = class V {
|
|
|
14664
14697
|
* @returns 戻り値はありません。
|
|
14665
14698
|
*/
|
|
14666
14699
|
static syncElement(e) {
|
|
14667
|
-
const t =
|
|
14668
|
-
if (!r || !
|
|
14669
|
-
t && (t.observer.disconnect(),
|
|
14700
|
+
const t = q.registrations.get(e), r = I.get(e);
|
|
14701
|
+
if (!r || !q.shouldObserve(r)) {
|
|
14702
|
+
t && (t.observer.disconnect(), q.registrations.delete(e));
|
|
14670
14703
|
return;
|
|
14671
14704
|
}
|
|
14672
14705
|
if (typeof IntersectionObserver > "u")
|
|
14673
14706
|
return;
|
|
14674
|
-
const i =
|
|
14707
|
+
const i = q.resolveRoot(r), n = q.resolveRootMargin(r), s = q.resolveThreshold(r), a = r.hasAttribute(`${l.prefix}intersect-once`);
|
|
14675
14708
|
if (t && t.root === i && t.rootMargin === n && t.threshold === s && t.once === a) {
|
|
14676
|
-
t.fragment = r,
|
|
14709
|
+
t.fragment = r, q.runPendingIntersect(e, t);
|
|
14677
14710
|
return;
|
|
14678
14711
|
}
|
|
14679
|
-
t && (t.observer.disconnect(),
|
|
14712
|
+
t && (t.observer.disconnect(), q.registrations.delete(e));
|
|
14680
14713
|
const o = new IntersectionObserver(
|
|
14681
14714
|
(c) => {
|
|
14682
|
-
const u =
|
|
14715
|
+
const u = q.registrations.get(e);
|
|
14683
14716
|
u && c.forEach((d) => {
|
|
14684
14717
|
if (u.intersecting = d.isIntersecting, !!d.isIntersecting) {
|
|
14685
|
-
if (u.running ||
|
|
14718
|
+
if (u.running || q.isDisabled(u.fragment)) {
|
|
14686
14719
|
u.pending = !0;
|
|
14687
14720
|
return;
|
|
14688
14721
|
}
|
|
14689
|
-
|
|
14722
|
+
q.runProcedure(e, u);
|
|
14690
14723
|
}
|
|
14691
14724
|
});
|
|
14692
14725
|
},
|
|
@@ -14696,7 +14729,7 @@ const V = class V {
|
|
|
14696
14729
|
threshold: s
|
|
14697
14730
|
}
|
|
14698
14731
|
);
|
|
14699
|
-
o.observe(e),
|
|
14732
|
+
o.observe(e), q.registrations.set(e, {
|
|
14700
14733
|
fragment: r,
|
|
14701
14734
|
observer: o,
|
|
14702
14735
|
once: a,
|
|
@@ -14730,13 +14763,13 @@ const V = class V {
|
|
|
14730
14763
|
}).catch((i) => {
|
|
14731
14764
|
m.error("[Haori]", "Intersect procedure execution error:", i);
|
|
14732
14765
|
}).finally(() => {
|
|
14733
|
-
const i =
|
|
14766
|
+
const i = q.registrations.get(e);
|
|
14734
14767
|
if (i) {
|
|
14735
14768
|
if (i.running = !1, r && i.once) {
|
|
14736
|
-
i.observer.disconnect(),
|
|
14769
|
+
i.observer.disconnect(), q.registrations.delete(e);
|
|
14737
14770
|
return;
|
|
14738
14771
|
}
|
|
14739
|
-
|
|
14772
|
+
q.runPendingIntersect(e, i);
|
|
14740
14773
|
}
|
|
14741
14774
|
});
|
|
14742
14775
|
}
|
|
@@ -14750,7 +14783,7 @@ const V = class V {
|
|
|
14750
14783
|
* @returns 戻り値はありません。
|
|
14751
14784
|
*/
|
|
14752
14785
|
static runPendingIntersect(e, t) {
|
|
14753
|
-
!t.pending || !t.intersecting || t.running ||
|
|
14786
|
+
!t.pending || !t.intersecting || t.running || q.isDisabled(t.fragment) || q.runProcedure(e, t);
|
|
14754
14787
|
}
|
|
14755
14788
|
/**
|
|
14756
14789
|
* 部分木の中の監視をすべて解除します。
|
|
@@ -14761,13 +14794,13 @@ const V = class V {
|
|
|
14761
14794
|
* @returns 戻り値はありません。
|
|
14762
14795
|
*/
|
|
14763
14796
|
static cleanupTree(e) {
|
|
14764
|
-
if (
|
|
14765
|
-
const t =
|
|
14766
|
-
t && (t.observer.disconnect(),
|
|
14797
|
+
if (q.isHtmlElement(e)) {
|
|
14798
|
+
const t = q.registrations.get(e);
|
|
14799
|
+
t && (t.observer.disconnect(), q.registrations.delete(e));
|
|
14767
14800
|
}
|
|
14768
14801
|
(e instanceof Element || e instanceof DocumentFragment) && e.querySelectorAll("*").forEach((t) => {
|
|
14769
|
-
const r =
|
|
14770
|
-
r && (r.observer.disconnect(),
|
|
14802
|
+
const r = q.registrations.get(t);
|
|
14803
|
+
r && (r.observer.disconnect(), q.registrations.delete(t));
|
|
14771
14804
|
});
|
|
14772
14805
|
}
|
|
14773
14806
|
/**
|
|
@@ -14776,16 +14809,16 @@ const V = class V {
|
|
|
14776
14809
|
* @returns 戻り値はありません。
|
|
14777
14810
|
*/
|
|
14778
14811
|
static disconnectAll() {
|
|
14779
|
-
|
|
14812
|
+
q.registrations.forEach((e) => {
|
|
14780
14813
|
e.observer.disconnect();
|
|
14781
|
-
}),
|
|
14814
|
+
}), q.registrations.clear();
|
|
14782
14815
|
}
|
|
14783
14816
|
static shouldObserve(e) {
|
|
14784
14817
|
return e.getAttributeNames().some((t) => {
|
|
14785
14818
|
if (!t.startsWith(`${l.prefix}intersect-`))
|
|
14786
14819
|
return !1;
|
|
14787
14820
|
const r = t.slice(`${l.prefix}intersect-`.length);
|
|
14788
|
-
return !
|
|
14821
|
+
return !q.CONFIG_KEYS.has(r);
|
|
14789
14822
|
});
|
|
14790
14823
|
}
|
|
14791
14824
|
static resolveRoot(e) {
|
|
@@ -14796,7 +14829,7 @@ const V = class V {
|
|
|
14796
14829
|
if (typeof r != "string" || r.trim() === "")
|
|
14797
14830
|
return null;
|
|
14798
14831
|
const i = J.query(r, t, document);
|
|
14799
|
-
return
|
|
14832
|
+
return q.isHtmlElement(i) ? i : (m.error("[Haori]", `Intersect root element not found: ${r}`), null);
|
|
14800
14833
|
}
|
|
14801
14834
|
static resolveRootMargin(e) {
|
|
14802
14835
|
const t = `${l.prefix}intersect-root-margin`, r = e.getAttribute(t);
|
|
@@ -14816,14 +14849,14 @@ const V = class V {
|
|
|
14816
14849
|
return i !== "" && i !== "false" && i !== "0";
|
|
14817
14850
|
}
|
|
14818
14851
|
};
|
|
14819
|
-
|
|
14852
|
+
q.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
14820
14853
|
"root",
|
|
14821
14854
|
"root-margin",
|
|
14822
14855
|
"threshold",
|
|
14823
14856
|
"disabled",
|
|
14824
14857
|
"once"
|
|
14825
|
-
]),
|
|
14826
|
-
let ve =
|
|
14858
|
+
]), q.registrations = /* @__PURE__ */ new Map();
|
|
14859
|
+
let ve = q;
|
|
14827
14860
|
const v = class v {
|
|
14828
14861
|
/**
|
|
14829
14862
|
* 指定ノードとその子孫を走査し、`data-poll-*` の監視状態を同期します。
|
|
@@ -14849,7 +14882,7 @@ const v = class v {
|
|
|
14849
14882
|
const t = v.registrations.get(e);
|
|
14850
14883
|
if (!t && !v.hasPollAttribute(e))
|
|
14851
14884
|
return;
|
|
14852
|
-
const r =
|
|
14885
|
+
const r = I.get(e);
|
|
14853
14886
|
if (!(r instanceof S) || !v.shouldObserve(r)) {
|
|
14854
14887
|
t && v.teardown(e, t);
|
|
14855
14888
|
return;
|
|
@@ -15058,7 +15091,7 @@ const v = class v {
|
|
|
15058
15091
|
*/
|
|
15059
15092
|
static async handleTimeout(e) {
|
|
15060
15093
|
const t = v.registrations.get(e);
|
|
15061
|
-
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected &&
|
|
15094
|
+
!t || t.stopped || (t.timeoutTimerId = null, t.timedOut = !0, e.isConnected && H.pollTimeout(
|
|
15062
15095
|
e,
|
|
15063
15096
|
t.count,
|
|
15064
15097
|
v.elapsed(t)
|
|
@@ -15078,7 +15111,7 @@ const v = class v {
|
|
|
15078
15111
|
v.registrations.delete(e);
|
|
15079
15112
|
return;
|
|
15080
15113
|
}
|
|
15081
|
-
await v.injectState(t), e.isConnected &&
|
|
15114
|
+
await v.injectState(t), e.isConnected && H.pollStop(
|
|
15082
15115
|
e,
|
|
15083
15116
|
r,
|
|
15084
15117
|
t.count,
|
|
@@ -15164,7 +15197,7 @@ const v = class v {
|
|
|
15164
15197
|
...i.getRawBindingData() ?? {},
|
|
15165
15198
|
_poll: r
|
|
15166
15199
|
};
|
|
15167
|
-
return
|
|
15200
|
+
return M.setBindingData(n, s, {
|
|
15168
15201
|
reflectToAttribute: !1,
|
|
15169
15202
|
// 状態変数の注入は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
15170
15203
|
// 解除しない)。
|
|
@@ -15202,7 +15235,7 @@ const v = class v {
|
|
|
15202
15235
|
return n.forEach((a) => {
|
|
15203
15236
|
if (!a.isConnected)
|
|
15204
15237
|
return;
|
|
15205
|
-
const o =
|
|
15238
|
+
const o = I.get(a);
|
|
15206
15239
|
o instanceof S && s.push(o);
|
|
15207
15240
|
}), s;
|
|
15208
15241
|
}
|
|
@@ -15351,7 +15384,7 @@ v.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
15351
15384
|
"state"
|
|
15352
15385
|
]), v.DEFAULT_INTERVAL_MS = 5e3, v.MIN_INTERVAL_MS = 100, v.registrations = /* @__PURE__ */ new Map(), v.visibilityListener = null;
|
|
15353
15386
|
let we = v;
|
|
15354
|
-
const Kt = "0.
|
|
15387
|
+
const Kt = "0.56.0";
|
|
15355
15388
|
function zt(b) {
|
|
15356
15389
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => b()) : Promise.resolve().then(b);
|
|
15357
15390
|
}
|
|
@@ -15385,7 +15418,7 @@ const O = class O {
|
|
|
15385
15418
|
* @param element 対象要素
|
|
15386
15419
|
*/
|
|
15387
15420
|
static syncElement(e) {
|
|
15388
|
-
const t = O.registrations.get(e), r =
|
|
15421
|
+
const t = O.registrations.get(e), r = I.get(e);
|
|
15389
15422
|
if (!(r instanceof S) || !O.shouldObserve(r)) {
|
|
15390
15423
|
t && (t.observer.disconnect(), O.registrations.delete(e));
|
|
15391
15424
|
return;
|
|
@@ -15412,9 +15445,9 @@ const O = class O {
|
|
|
15412
15445
|
if (!u)
|
|
15413
15446
|
return;
|
|
15414
15447
|
let d = !1;
|
|
15415
|
-
c.forEach((
|
|
15416
|
-
const y =
|
|
15417
|
-
u.observedRows.has(y) && (
|
|
15448
|
+
c.forEach((p) => {
|
|
15449
|
+
const y = p.target;
|
|
15450
|
+
u.observedRows.has(y) && (p.isIntersecting ? u.visibleRows.has(y) || (u.visibleRows.add(y), d = !0) : u.visibleRows.delete(y) && (d = !0));
|
|
15418
15451
|
}), d && O.scheduleCompute(u);
|
|
15419
15452
|
},
|
|
15420
15453
|
{
|
|
@@ -15601,7 +15634,7 @@ const O = class O {
|
|
|
15601
15634
|
};
|
|
15602
15635
|
n[e.varName] = { ...t };
|
|
15603
15636
|
const s = e.fragment.getTarget(), a = i === s ? /* @__PURE__ */ new Set() : /* @__PURE__ */ new Set([e.fragment]);
|
|
15604
|
-
|
|
15637
|
+
M.setBindingData(i, n, {
|
|
15605
15638
|
skipFragments: a,
|
|
15606
15639
|
reflectToAttribute: !1,
|
|
15607
15640
|
// 可視範囲の公開は値の供給ではない(権威を持たず、ユーザー編集の印も
|
|
@@ -15632,31 +15665,31 @@ const O = class O {
|
|
|
15632
15665
|
};
|
|
15633
15666
|
O.THRESHOLD = 0, O.DEFAULT_ROOT_MARGIN = "0px", O.registrations = /* @__PURE__ */ new Map();
|
|
15634
15667
|
let be = O;
|
|
15635
|
-
const
|
|
15668
|
+
const U = class U {
|
|
15636
15669
|
/**
|
|
15637
15670
|
* 既存の MutationObserver をすべて停止します。
|
|
15638
15671
|
*/
|
|
15639
15672
|
static disconnectMutationObservers() {
|
|
15640
|
-
|
|
15673
|
+
U._mutationObservers.forEach((e) => {
|
|
15641
15674
|
e.disconnect();
|
|
15642
|
-
}),
|
|
15675
|
+
}), U._mutationObservers.length = 0;
|
|
15643
15676
|
}
|
|
15644
15677
|
/**
|
|
15645
15678
|
* 初期化メソッド。
|
|
15646
15679
|
* ドキュメントのheadとbodyを監視対象として設定します。
|
|
15647
15680
|
*/
|
|
15648
15681
|
static async init() {
|
|
15649
|
-
if (
|
|
15682
|
+
if (U._initialized)
|
|
15650
15683
|
return;
|
|
15651
|
-
|
|
15652
|
-
|
|
15684
|
+
U._initialized = !0, U.disconnectMutationObservers(), S.setPendingMutationFlusher(() => {
|
|
15685
|
+
U.flushPendingMutations();
|
|
15653
15686
|
});
|
|
15654
15687
|
const e = new Ve();
|
|
15655
|
-
|
|
15688
|
+
U._dispatcher = e, e.startDeferred(), U._initialIntakes = [];
|
|
15656
15689
|
try {
|
|
15657
15690
|
const t = await Promise.allSettled([
|
|
15658
|
-
|
|
15659
|
-
|
|
15691
|
+
M.scan(document.head),
|
|
15692
|
+
M.scan(document.body)
|
|
15660
15693
|
]), [r, i] = t;
|
|
15661
15694
|
r.status !== "fulfilled" && m.error(
|
|
15662
15695
|
"[Haori]",
|
|
@@ -15666,11 +15699,11 @@ const H = class H {
|
|
|
15666
15699
|
"[Haori]",
|
|
15667
15700
|
"Failed to build body fragment:",
|
|
15668
15701
|
i.reason
|
|
15669
|
-
), await
|
|
15702
|
+
), await U.waitInitialIntakes(), await z.wait(), document.body.setAttribute("data-haori-ready", ""), U.observe(document.head), U.observe(document.body), ve.syncTree(document.body), we.syncTree(document.body), be.syncTree(document.body);
|
|
15670
15703
|
} finally {
|
|
15671
|
-
|
|
15704
|
+
U._initialIntakes = null, e.release();
|
|
15672
15705
|
}
|
|
15673
|
-
|
|
15706
|
+
H.ready(Kt);
|
|
15674
15707
|
}
|
|
15675
15708
|
/**
|
|
15676
15709
|
* 稼働中の EventDispatcher を返します。
|
|
@@ -15679,7 +15712,7 @@ const H = class H {
|
|
|
15679
15712
|
* @returns 稼働中の EventDispatcher。未初期化の場合は null。
|
|
15680
15713
|
*/
|
|
15681
15714
|
static getDispatcher() {
|
|
15682
|
-
return
|
|
15715
|
+
return U._dispatcher;
|
|
15683
15716
|
}
|
|
15684
15717
|
/**
|
|
15685
15718
|
* 初期化の途中で取り込んだ DOM 変更の処理を、すべて待ちます。
|
|
@@ -15692,7 +15725,7 @@ const H = class H {
|
|
|
15692
15725
|
* @returns 待機完了の Promise
|
|
15693
15726
|
*/
|
|
15694
15727
|
static async waitInitialIntakes() {
|
|
15695
|
-
const e =
|
|
15728
|
+
const e = U._initialIntakes;
|
|
15696
15729
|
for (; e !== null && e.length > 0; )
|
|
15697
15730
|
await Promise.allSettled(e.splice(0));
|
|
15698
15731
|
}
|
|
@@ -15712,7 +15745,7 @@ const H = class H {
|
|
|
15712
15745
|
* @returns 戻り値はありません。
|
|
15713
15746
|
*/
|
|
15714
15747
|
static captureMutations(e) {
|
|
15715
|
-
if (
|
|
15748
|
+
if (U._mutationObservers.length > 0) {
|
|
15716
15749
|
e();
|
|
15717
15750
|
return;
|
|
15718
15751
|
}
|
|
@@ -15727,8 +15760,8 @@ const H = class H {
|
|
|
15727
15760
|
try {
|
|
15728
15761
|
e();
|
|
15729
15762
|
} finally {
|
|
15730
|
-
const r = t.takeRecords().map((i) =>
|
|
15731
|
-
t.disconnect(),
|
|
15763
|
+
const r = t.takeRecords().map((i) => U.toCapturedRecord(i));
|
|
15764
|
+
t.disconnect(), U.processMutations(r);
|
|
15732
15765
|
}
|
|
15733
15766
|
}
|
|
15734
15767
|
/**
|
|
@@ -15753,7 +15786,7 @@ const H = class H {
|
|
|
15753
15786
|
type: e.type,
|
|
15754
15787
|
target: e.target,
|
|
15755
15788
|
addedNodes: Array.from(e.addedNodes).filter(
|
|
15756
|
-
(t) => !
|
|
15789
|
+
(t) => !U.hasKnownDescendant(t)
|
|
15757
15790
|
),
|
|
15758
15791
|
removedNodes: []
|
|
15759
15792
|
};
|
|
@@ -15817,14 +15850,14 @@ const H = class H {
|
|
|
15817
15850
|
*/
|
|
15818
15851
|
static observe(e) {
|
|
15819
15852
|
const t = new MutationObserver((r) => {
|
|
15820
|
-
|
|
15853
|
+
U.processMutations(r);
|
|
15821
15854
|
});
|
|
15822
15855
|
t.observe(e, {
|
|
15823
15856
|
childList: !0,
|
|
15824
15857
|
subtree: !0,
|
|
15825
15858
|
attributes: !0,
|
|
15826
15859
|
characterData: !0
|
|
15827
|
-
}),
|
|
15860
|
+
}), U._mutationObservers.push(t);
|
|
15828
15861
|
}
|
|
15829
15862
|
/**
|
|
15830
15863
|
* 保留中の DOM 変更を同期的に引き取って処理へ載せます。
|
|
@@ -15847,15 +15880,15 @@ const H = class H {
|
|
|
15847
15880
|
* @returns 戻り値はありません。
|
|
15848
15881
|
*/
|
|
15849
15882
|
static flushPendingMutations() {
|
|
15850
|
-
for (const e of
|
|
15883
|
+
for (const e of U._mutationObservers) {
|
|
15851
15884
|
const t = e.takeRecords();
|
|
15852
15885
|
if (t.length === 0)
|
|
15853
15886
|
continue;
|
|
15854
|
-
const r = t.filter(
|
|
15855
|
-
(n) => !
|
|
15887
|
+
const r = t.filter(U.isBindAttributeRecord), i = t.filter(
|
|
15888
|
+
(n) => !U.isBindAttributeRecord(n)
|
|
15856
15889
|
);
|
|
15857
|
-
r.length > 0 &&
|
|
15858
|
-
|
|
15890
|
+
r.length > 0 && U.processMutations(r, S.nextSequence()), i.length > 0 && Promise.resolve().then(() => {
|
|
15891
|
+
U.processMutations(i);
|
|
15859
15892
|
});
|
|
15860
15893
|
}
|
|
15861
15894
|
}
|
|
@@ -15879,7 +15912,7 @@ const H = class H {
|
|
|
15879
15912
|
static processMutations(e, t) {
|
|
15880
15913
|
for (const r of e)
|
|
15881
15914
|
try {
|
|
15882
|
-
if (
|
|
15915
|
+
if (U.isExternallyManaged(r.target))
|
|
15883
15916
|
continue;
|
|
15884
15917
|
switch (r.type) {
|
|
15885
15918
|
case "attributes": {
|
|
@@ -15890,31 +15923,31 @@ const H = class H {
|
|
|
15890
15923
|
r.attributeName === "style" && S.reassertHiddenDisplay(i);
|
|
15891
15924
|
break;
|
|
15892
15925
|
}
|
|
15893
|
-
if (r.attributeName &&
|
|
15926
|
+
if (r.attributeName && M.isAliasedAttributeReflection(i, r.attributeName))
|
|
15894
15927
|
break;
|
|
15895
|
-
const n =
|
|
15928
|
+
const n = M.setAttribute(
|
|
15896
15929
|
i,
|
|
15897
15930
|
r.attributeName,
|
|
15898
15931
|
i.getAttribute(r.attributeName),
|
|
15899
15932
|
!0,
|
|
15900
15933
|
t
|
|
15901
15934
|
);
|
|
15902
|
-
|
|
15935
|
+
U._initialIntakes?.push(n), ve.syncElement(i), we.syncElement(i), be.syncElement(i);
|
|
15903
15936
|
break;
|
|
15904
15937
|
}
|
|
15905
15938
|
case "childList": {
|
|
15906
15939
|
Array.from(r.removedNodes).forEach((i) => {
|
|
15907
|
-
|
|
15940
|
+
U.isStaleExternalRemoval(r, i) || (ve.cleanupTree(i), we.cleanupTree(i), be.cleanupTree(i), M.removeNode(i));
|
|
15908
15941
|
}), Array.from(r.addedNodes).forEach((i) => {
|
|
15909
15942
|
if (!(i.parentElement instanceof Element))
|
|
15910
15943
|
return;
|
|
15911
|
-
const n =
|
|
15912
|
-
|
|
15944
|
+
const n = M.addNode(i.parentElement, i);
|
|
15945
|
+
U._initialIntakes?.push(n), ve.syncTree(i), we.syncTree(i), be.syncTree(i);
|
|
15913
15946
|
}), r.target instanceof Element && be.syncElement(r.target);
|
|
15914
15947
|
break;
|
|
15915
15948
|
}
|
|
15916
15949
|
case "characterData": {
|
|
15917
|
-
r.target instanceof Text || r.target instanceof Comment ?
|
|
15950
|
+
r.target instanceof Text || r.target instanceof Comment ? M.changeText(r.target, r.target.textContent) : m.warn(
|
|
15918
15951
|
"[Haori]",
|
|
15919
15952
|
"Unsupported character data type:",
|
|
15920
15953
|
r.target
|
|
@@ -15930,17 +15963,17 @@ const H = class H {
|
|
|
15930
15963
|
}
|
|
15931
15964
|
}
|
|
15932
15965
|
};
|
|
15933
|
-
|
|
15934
|
-
let Ne =
|
|
15966
|
+
U._initialized = !1, U._mutationObservers = [], U._dispatcher = null, U._initialIntakes = null;
|
|
15967
|
+
let Ne = U;
|
|
15935
15968
|
re.setMutationCapture((b) => Ne.captureMutations(b));
|
|
15936
15969
|
document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", Ne.init) : Ne.init();
|
|
15937
15970
|
const Gt = () => Te.waitForRenders(), Yt = Te.enhancers;
|
|
15938
15971
|
export {
|
|
15939
|
-
|
|
15972
|
+
M as Core,
|
|
15940
15973
|
re as Enhance,
|
|
15941
15974
|
l as Env,
|
|
15942
|
-
|
|
15943
|
-
|
|
15975
|
+
N as Form,
|
|
15976
|
+
I as Fragment,
|
|
15944
15977
|
Te as Haori,
|
|
15945
15978
|
m as Log,
|
|
15946
15979
|
z as Queue,
|