haori 0.41.3 → 0.41.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +6 -6
- package/dist/haori.es.js +201 -150
- package/dist/haori.iife.js +7 -7
- package/dist/index.d.ts +24 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -30,12 +30,12 @@ const ae = class ae {
|
|
|
30
30
|
};
|
|
31
31
|
ae.devMode = !1;
|
|
32
32
|
let j = ae;
|
|
33
|
-
const
|
|
33
|
+
const Ce = "embedded";
|
|
34
34
|
function Ye(g) {
|
|
35
35
|
return g === "embedded" || g === "demo";
|
|
36
36
|
}
|
|
37
37
|
function pt(g) {
|
|
38
|
-
return g === null ? null : Ye(g) ? g :
|
|
38
|
+
return g === null ? null : Ye(g) ? g : Ce;
|
|
39
39
|
}
|
|
40
40
|
const Y = class Y {
|
|
41
41
|
/**
|
|
@@ -73,7 +73,7 @@ const Y = class Y {
|
|
|
73
73
|
* @return 戻り値はありません。
|
|
74
74
|
*/
|
|
75
75
|
static setRuntime(e) {
|
|
76
|
-
Y._runtime = Ye(e) ? e :
|
|
76
|
+
Y._runtime = Ye(e) ? e : Ce;
|
|
77
77
|
}
|
|
78
78
|
/**
|
|
79
79
|
* 実行環境からプレフィックスと開発モードかどうかを自動検出します。
|
|
@@ -116,7 +116,7 @@ const Y = class Y {
|
|
|
116
116
|
return Y._prefix;
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
|
-
Y._prefix = "data-", Y._runtime =
|
|
119
|
+
Y._prefix = "data-", Y._runtime = Ce, Y._strictBind = !1;
|
|
120
120
|
let u = Y;
|
|
121
121
|
typeof document < "u" && (document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", u.detect) : u.detect());
|
|
122
122
|
class m {
|
|
@@ -794,7 +794,7 @@ const He = class He {
|
|
|
794
794
|
};
|
|
795
795
|
He.ASYNC_QUEUE = new Be();
|
|
796
796
|
let W = He;
|
|
797
|
-
const
|
|
797
|
+
const M = class M {
|
|
798
798
|
/**
|
|
799
799
|
* ストレージを、参照が例外になる環境でも安全に読み出します。
|
|
800
800
|
*
|
|
@@ -832,8 +832,8 @@ const C = class C {
|
|
|
832
832
|
e.history,
|
|
833
833
|
// 参照だけで例外になり得るのはこの 2 つのみ(他は同一オリジンの自 window
|
|
834
834
|
// 由来で常に読める)。ホットパスなので、囲むのも必要な箇所だけに絞る。
|
|
835
|
-
|
|
836
|
-
|
|
835
|
+
M.readStorageSafely(() => e.localStorage),
|
|
836
|
+
M.readStorageSafely(() => e.sessionStorage),
|
|
837
837
|
e.fetch,
|
|
838
838
|
e.Function,
|
|
839
839
|
e.setTimeout,
|
|
@@ -2024,9 +2024,9 @@ return (${y});${h}`;
|
|
|
2024
2024
|
return this.forbiddenBindingValueCache.set(e, !1), !1;
|
|
2025
2025
|
}
|
|
2026
2026
|
};
|
|
2027
|
-
|
|
2027
|
+
M.MAX_IDENTIFIER_RECOVERY_COUNT = 8, M.BUILTIN_NAMESPACE = "haori", M.BUILTIN_HELPERS = {
|
|
2028
2028
|
...vt
|
|
2029
|
-
},
|
|
2029
|
+
}, M.BUILTIN_REFERENCE_PATTERN = /(^|[^\w$.])haori(?![\w$])/, M.BUILTIN_DATA_PROPERTY = "data", M.BUILTIN_DATA_REFERENCE_PATTERN = /(^|[^\w$.])haori\s*(\.\s*data(?![\w$])|\[)/, M.IDENTIFIER_NAME_PATTERN = /^[\p{ID_Start}$_][\p{ID_Continue}$\u200C\u200D]*$/u, M.usableBindingKeyCache = /* @__PURE__ */ new Map(), M.loggedUnusableBindingKeys = /* @__PURE__ */ new Set(), M.compileFailedExpressions = /* @__PURE__ */ new Set(), M.forbiddenBindingValueCache = /* @__PURE__ */ new WeakMap(), M.forbiddenBindingValueCacheResetScheduled = !1, M.loggedForbiddenKeySignatures = /* @__PURE__ */ new Set(), M.loggedForbiddenKeyResetScheduled = !1, M.FORBIDDEN_NAMES = [
|
|
2030
2030
|
// グローバルオブジェクト
|
|
2031
2031
|
"window",
|
|
2032
2032
|
"self",
|
|
@@ -2058,7 +2058,7 @@ C.MAX_IDENTIFIER_RECOVERY_COUNT = 8, C.BUILTIN_NAMESPACE = "haori", C.BUILTIN_HE
|
|
|
2058
2058
|
"sessionStorage",
|
|
2059
2059
|
"IndexedDB",
|
|
2060
2060
|
"history"
|
|
2061
|
-
],
|
|
2061
|
+
], M.STRICT_FORBIDDEN_NAMES = ["eval", "arguments"], M.REBINDABLE_FORBIDDEN_NAMES = /* @__PURE__ */ new Set([
|
|
2062
2062
|
"location",
|
|
2063
2063
|
"history",
|
|
2064
2064
|
"document",
|
|
@@ -2066,23 +2066,23 @@ C.MAX_IDENTIFIER_RECOVERY_COUNT = 8, C.BUILTIN_NAMESPACE = "haori", C.BUILTIN_HE
|
|
|
2066
2066
|
"localStorage",
|
|
2067
2067
|
"sessionStorage",
|
|
2068
2068
|
"IndexedDB"
|
|
2069
|
-
]),
|
|
2070
|
-
...
|
|
2071
|
-
(e) => !
|
|
2069
|
+
]), M.FORBIDDEN_BINDING_NAMES = /* @__PURE__ */ new Set([
|
|
2070
|
+
...M.FORBIDDEN_NAMES.filter(
|
|
2071
|
+
(e) => !M.REBINDABLE_FORBIDDEN_NAMES.has(e)
|
|
2072
2072
|
),
|
|
2073
2073
|
"constructor",
|
|
2074
2074
|
"__proto__",
|
|
2075
2075
|
"prototype",
|
|
2076
|
-
...
|
|
2077
|
-
]),
|
|
2076
|
+
...M.STRICT_FORBIDDEN_NAMES
|
|
2077
|
+
]), M.FORBIDDEN_PROPERTY_NAMES = /* @__PURE__ */ new Set([
|
|
2078
2078
|
"constructor",
|
|
2079
2079
|
"__proto__",
|
|
2080
2080
|
"prototype"
|
|
2081
|
-
]),
|
|
2081
|
+
]), M.OBJECT_PROPERTY_MODIFIERS = /* @__PURE__ */ new Set([
|
|
2082
2082
|
"get",
|
|
2083
2083
|
"set",
|
|
2084
2084
|
"async"
|
|
2085
|
-
]),
|
|
2085
|
+
]), M.DISALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
|
|
2086
2086
|
"await",
|
|
2087
2087
|
"break",
|
|
2088
2088
|
"case",
|
|
@@ -2116,7 +2116,7 @@ C.MAX_IDENTIFIER_RECOVERY_COUNT = 8, C.BUILTIN_NAMESPACE = "haori", C.BUILTIN_HE
|
|
|
2116
2116
|
"while",
|
|
2117
2117
|
"with",
|
|
2118
2118
|
"yield"
|
|
2119
|
-
]),
|
|
2119
|
+
]), M.NON_SHADOWABLE_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
2120
2120
|
// リテラル・グローバル定数
|
|
2121
2121
|
"true",
|
|
2122
2122
|
"false",
|
|
@@ -2134,7 +2134,7 @@ C.MAX_IDENTIFIER_RECOVERY_COUNT = 8, C.BUILTIN_NAMESPACE = "haori", C.BUILTIN_HE
|
|
|
2134
2134
|
"public",
|
|
2135
2135
|
"static",
|
|
2136
2136
|
"super"
|
|
2137
|
-
]),
|
|
2137
|
+
]), M.ALLOWED_GLOBAL_IDENTIFIERS = /* @__PURE__ */ new Set([
|
|
2138
2138
|
// 名前空間オブジェクト
|
|
2139
2139
|
"Math",
|
|
2140
2140
|
"JSON",
|
|
@@ -2190,11 +2190,11 @@ C.MAX_IDENTIFIER_RECOVERY_COUNT = 8, C.BUILTIN_NAMESPACE = "haori", C.BUILTIN_HE
|
|
|
2190
2190
|
"encodeURIComponent",
|
|
2191
2191
|
"decodeURI",
|
|
2192
2192
|
"decodeURIComponent"
|
|
2193
|
-
]),
|
|
2193
|
+
]), M.EXPRESSION_CACHE = /* @__PURE__ */ new Map(), M.FREE_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), M.BOUND_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), M.OPTIONAL_CHAIN_CACHE = /* @__PURE__ */ new Map(), M.FORBIDDEN_NAME_PATTERNS = M.FORBIDDEN_NAMES.map((e) => ({
|
|
2194
2194
|
name: e,
|
|
2195
2195
|
pattern: new RegExp(`(^|[^\\w$.])${e}(?![\\w$])`)
|
|
2196
|
-
})),
|
|
2197
|
-
let J =
|
|
2196
|
+
})), M.FORBIDDEN_IDENTIFIER_CACHE = /* @__PURE__ */ new Map(), M.pendingUnresolvedIdentifiers = /* @__PURE__ */ new Set(), M.unresolvedReportScheduled = !1, M.suppliedIdentifiers = /* @__PURE__ */ new Set(), M.pendingScopeMissingIdentifiers = /* @__PURE__ */ new Map(), M.scopeMissingReportScheduled = !1, M.rowScopeIdentifiers = /* @__PURE__ */ new Set(), M.loggedScopeMissingIdentifiers = /* @__PURE__ */ new Set(), M.loggedBlockedIdentifierExpressions = /* @__PURE__ */ new Set();
|
|
2197
|
+
let J = M;
|
|
2198
2198
|
const pe = "data-haori-if-disabled", je = "input, select, textarea, button, fieldset", q = class q {
|
|
2199
2199
|
/**
|
|
2200
2200
|
* 集計状態を初期化します。
|
|
@@ -2554,7 +2554,7 @@ const oe = class oe {
|
|
|
2554
2554
|
};
|
|
2555
2555
|
oe.FRAGMENT_CACHE = /* @__PURE__ */ new WeakMap();
|
|
2556
2556
|
let N = oe;
|
|
2557
|
-
const
|
|
2557
|
+
const C = class C extends N {
|
|
2558
2558
|
/**
|
|
2559
2559
|
* エレメントフラグメントのコンストラクタ。
|
|
2560
2560
|
* アトリビュートや子フラグメントの作成も行います。
|
|
@@ -2588,7 +2588,7 @@ const M = class M extends N {
|
|
|
2588
2588
|
*/
|
|
2589
2589
|
getChildElementFragments() {
|
|
2590
2590
|
return this.children.filter(
|
|
2591
|
-
(e) => e instanceof
|
|
2591
|
+
(e) => e instanceof C
|
|
2592
2592
|
);
|
|
2593
2593
|
}
|
|
2594
2594
|
/**
|
|
@@ -2620,7 +2620,7 @@ const M = class M extends N {
|
|
|
2620
2620
|
* @returns クローンされたフラグメント
|
|
2621
2621
|
*/
|
|
2622
2622
|
clone() {
|
|
2623
|
-
const e = new
|
|
2623
|
+
const e = new C(
|
|
2624
2624
|
this.target.cloneNode(!1)
|
|
2625
2625
|
);
|
|
2626
2626
|
return this.attributeMap.forEach((t, r) => {
|
|
@@ -2635,7 +2635,7 @@ const M = class M extends N {
|
|
|
2635
2635
|
*/
|
|
2636
2636
|
normalizeClonedVisibilityState() {
|
|
2637
2637
|
(this.visible === !1 || this.getTarget().style.display === "none" || this.getTarget().hasAttribute(`${u.prefix}if-false`)) && (this.visible = !0, this.display = null, this.displayPriority = null, this.getTarget().style.removeProperty("display"), this.getTarget().removeAttribute(`${u.prefix}if-false`), this.restoreFormControlsDisabledByIf()), this.children.forEach((e) => {
|
|
2638
|
-
e instanceof
|
|
2638
|
+
e instanceof C && e.normalizeClonedVisibilityState();
|
|
2639
2639
|
});
|
|
2640
2640
|
}
|
|
2641
2641
|
/**
|
|
@@ -2755,19 +2755,19 @@ const M = class M extends N {
|
|
|
2755
2755
|
* @returns 実行中なら true
|
|
2756
2756
|
*/
|
|
2757
2757
|
static isExecutingAnyBindingWork() {
|
|
2758
|
-
return
|
|
2758
|
+
return C.bindingWorkActiveCount > 0;
|
|
2759
2759
|
}
|
|
2760
2760
|
/**
|
|
2761
2761
|
* バインドワークの実行開始を記録します(`Core.setBindingData` の work 開始時に呼ぶ)。
|
|
2762
2762
|
*/
|
|
2763
2763
|
markBindingWorkStart() {
|
|
2764
|
-
this.bindingWorkActive++,
|
|
2764
|
+
this.bindingWorkActive++, C.bindingWorkActiveCount++;
|
|
2765
2765
|
}
|
|
2766
2766
|
/**
|
|
2767
2767
|
* バインドワークの実行終了を記録します(work 完了時に呼ぶ)。
|
|
2768
2768
|
*/
|
|
2769
2769
|
markBindingWorkEnd() {
|
|
2770
|
-
this.bindingWorkActive > 0 && (this.bindingWorkActive--,
|
|
2770
|
+
this.bindingWorkActive > 0 && (this.bindingWorkActive--, C.bindingWorkActiveCount--);
|
|
2771
2771
|
}
|
|
2772
2772
|
/**
|
|
2773
2773
|
* このフラグメントへ供給が適用されたことを記録します。
|
|
@@ -2859,7 +2859,7 @@ const M = class M extends N {
|
|
|
2859
2859
|
*/
|
|
2860
2860
|
clearBindingDataCache() {
|
|
2861
2861
|
this.bindingDataCache = null, this.descendantBindingDataCache = null, this.children.forEach((e) => {
|
|
2862
|
-
e instanceof
|
|
2862
|
+
e instanceof C && e.clearBindingDataCache();
|
|
2863
2863
|
});
|
|
2864
2864
|
}
|
|
2865
2865
|
/**
|
|
@@ -3077,7 +3077,7 @@ const M = class M extends N {
|
|
|
3077
3077
|
this.value = this.normalizeValueForElement(i, e);
|
|
3078
3078
|
const s = this.userEditSequence;
|
|
3079
3079
|
return this.enqueueValueWrite(() => {
|
|
3080
|
-
this.isSupersededByUserEdit(s) || r && !this.canApplyValue(r) || (i.value = n, this.recordValueWriteResult(i.value === n), t && ((i instanceof HTMLInputElement &&
|
|
3080
|
+
this.isSupersededByUserEdit(s) || r && !this.canApplyValue(r) || (i.value = n, this.recordValueWriteResult(i.value === n), t && ((i instanceof HTMLInputElement && C.INPUT_EVENT_TYPES.includes(i.type) || i instanceof HTMLTextAreaElement) && i.dispatchEvent(new Event("input", { bubbles: !0 })), i.dispatchEvent(new Event("change", { bubbles: !0 }))));
|
|
3081
3081
|
});
|
|
3082
3082
|
}
|
|
3083
3083
|
/**
|
|
@@ -3158,10 +3158,10 @@ const M = class M extends N {
|
|
|
3158
3158
|
* @returns 再試行の完了 Promise
|
|
3159
3159
|
*/
|
|
3160
3160
|
static retryUnappliedValueWrites(e, t) {
|
|
3161
|
-
if (
|
|
3161
|
+
if (C.UNAPPLIED_VALUE_WRITES.size === 0)
|
|
3162
3162
|
return Promise.resolve();
|
|
3163
3163
|
const r = [];
|
|
3164
|
-
for (const i of Array.from(
|
|
3164
|
+
for (const i of Array.from(C.UNAPPLIED_VALUE_WRITES)) {
|
|
3165
3165
|
const n = i.getTarget();
|
|
3166
3166
|
if (i.wasResetAfter(t)) {
|
|
3167
3167
|
i.clearUnappliedValueWrite();
|
|
@@ -3203,7 +3203,7 @@ const M = class M extends N {
|
|
|
3203
3203
|
* @returns 戻り値はありません。
|
|
3204
3204
|
*/
|
|
3205
3205
|
clearUnappliedValueWrite() {
|
|
3206
|
-
this.valueWriteUnapplied = !1,
|
|
3206
|
+
this.valueWriteUnapplied = !1, C.UNAPPLIED_VALUE_WRITES.delete(this);
|
|
3207
3207
|
}
|
|
3208
3208
|
/**
|
|
3209
3209
|
* 入力エレメントの値を取得します。
|
|
@@ -3224,7 +3224,7 @@ const M = class M extends N {
|
|
|
3224
3224
|
* @returns 直近に発番した通番(未発番なら 0)
|
|
3225
3225
|
*/
|
|
3226
3226
|
static currentSequence() {
|
|
3227
|
-
return
|
|
3227
|
+
return C.sequenceCounter;
|
|
3228
3228
|
}
|
|
3229
3229
|
/**
|
|
3230
3230
|
* 新しい通番を発番します。
|
|
@@ -3237,7 +3237,7 @@ const M = class M extends N {
|
|
|
3237
3237
|
* @returns 発番した通番
|
|
3238
3238
|
*/
|
|
3239
3239
|
static nextSequence() {
|
|
3240
|
-
return
|
|
3240
|
+
return C.sequenceCounter += 1, C.sequenceCounter;
|
|
3241
3241
|
}
|
|
3242
3242
|
/**
|
|
3243
3243
|
* 保留中の外部 DOM 変更を取り込む処理を登録します。
|
|
@@ -3246,7 +3246,7 @@ const M = class M extends N {
|
|
|
3246
3246
|
* @returns 戻り値はありません。
|
|
3247
3247
|
*/
|
|
3248
3248
|
static setPendingMutationFlusher(e) {
|
|
3249
|
-
|
|
3249
|
+
C.pendingMutationFlusher = e;
|
|
3250
3250
|
}
|
|
3251
3251
|
/**
|
|
3252
3252
|
* 利用者の操作を起点とする通番を発番します。
|
|
@@ -3267,7 +3267,7 @@ const M = class M extends N {
|
|
|
3267
3267
|
* @returns 発番した通番
|
|
3268
3268
|
*/
|
|
3269
3269
|
static nextOperationSequence() {
|
|
3270
|
-
return
|
|
3270
|
+
return C.pendingMutationFlusher && !C.isExecutingAnyBindingWork() && C.pendingMutationFlusher(), C.nextSequence();
|
|
3271
3271
|
}
|
|
3272
3272
|
/**
|
|
3273
3273
|
* この入力欄へ値を適用してよいかを返します。
|
|
@@ -3288,7 +3288,7 @@ const M = class M extends N {
|
|
|
3288
3288
|
* @returns 適用してよい場合は true
|
|
3289
3289
|
*/
|
|
3290
3290
|
canApplyValue(e) {
|
|
3291
|
-
return
|
|
3291
|
+
return C.isApplicable(
|
|
3292
3292
|
{ sequence: this.lastValueSequence, kind: this.lastValueKind },
|
|
3293
3293
|
e
|
|
3294
3294
|
);
|
|
@@ -3311,7 +3311,7 @@ const M = class M extends N {
|
|
|
3311
3311
|
* @returns 適用してよい場合は true
|
|
3312
3312
|
*/
|
|
3313
3313
|
canApplyPath(e, t) {
|
|
3314
|
-
return
|
|
3314
|
+
return C.isApplicable(
|
|
3315
3315
|
this.lastPathApplied.get(e) ?? null,
|
|
3316
3316
|
t
|
|
3317
3317
|
);
|
|
@@ -3360,7 +3360,7 @@ const M = class M extends N {
|
|
|
3360
3360
|
* @returns 発番した編集の通番
|
|
3361
3361
|
*/
|
|
3362
3362
|
markUserEdit() {
|
|
3363
|
-
return this.userEditSequence =
|
|
3363
|
+
return this.userEditSequence = C.nextSequence(), this.markValueApplied({ sequence: this.userEditSequence, kind: "edit" }), this.userEditSequence;
|
|
3364
3364
|
}
|
|
3365
3365
|
/**
|
|
3366
3366
|
* この入力欄を最後にユーザーが編集したときの通し番号を返します。
|
|
@@ -3395,7 +3395,7 @@ const M = class M extends N {
|
|
|
3395
3395
|
* @param upTo この通し番号までの編集を解除対象とする(既定は現在の最新)
|
|
3396
3396
|
* @return 戻り値はありません。
|
|
3397
3397
|
*/
|
|
3398
|
-
clearUserEditMark(e =
|
|
3398
|
+
clearUserEditMark(e = C.currentSequence()) {
|
|
3399
3399
|
e > this.authoritativeValueSequence && (this.authoritativeValueSequence = e), this.lastValueKind === "edit" && this.lastValueSequence <= e && (this.lastValueKind = "supply");
|
|
3400
3400
|
}
|
|
3401
3401
|
/**
|
|
@@ -3416,7 +3416,7 @@ const M = class M extends N {
|
|
|
3416
3416
|
if (!j.isEnabled())
|
|
3417
3417
|
return;
|
|
3418
3418
|
const n = `${e} ${r}`;
|
|
3419
|
-
|
|
3419
|
+
C.loggedUnresolvedAttributes.has(n) || (C.loggedUnresolvedAttributes.add(n), m.warn(
|
|
3420
3420
|
"[Haori]",
|
|
3421
3421
|
`Attribute "${t}" was not applied because the expression has an unresolved reference; the attribute is removed and the synchronized value is emptied: ${e}="${r}"`,
|
|
3422
3422
|
i
|
|
@@ -3438,7 +3438,7 @@ const M = class M extends N {
|
|
|
3438
3438
|
if (!t)
|
|
3439
3439
|
return !1;
|
|
3440
3440
|
const r = N.get(t);
|
|
3441
|
-
return r instanceof
|
|
3441
|
+
return r instanceof C ? r.hasPendingUserEdit() : !1;
|
|
3442
3442
|
}
|
|
3443
3443
|
/**
|
|
3444
3444
|
* 内部の値をクリアします。エレメントのvalue値は変化しません。
|
|
@@ -3484,7 +3484,7 @@ const M = class M extends N {
|
|
|
3484
3484
|
* @returns 同期対象の場合true
|
|
3485
3485
|
*/
|
|
3486
3486
|
static isValuePropertyTarget(e) {
|
|
3487
|
-
return e instanceof HTMLInputElement ?
|
|
3487
|
+
return e instanceof HTMLInputElement ? C.INPUT_EVENT_TYPES.includes(e.type) || e.type === "hidden" : e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement;
|
|
3488
3488
|
}
|
|
3489
3489
|
/**
|
|
3490
3490
|
* 内部の値をDOMの値と同期します。
|
|
@@ -3532,7 +3532,7 @@ const M = class M extends N {
|
|
|
3532
3532
|
*/
|
|
3533
3533
|
recordValueWriteResult(e) {
|
|
3534
3534
|
if (!e && this.value !== null && this.value !== "") {
|
|
3535
|
-
this.valueWriteUnapplied = !0,
|
|
3535
|
+
this.valueWriteUnapplied = !0, C.UNAPPLIED_VALUE_WRITES.add(this);
|
|
3536
3536
|
return;
|
|
3537
3537
|
}
|
|
3538
3538
|
this.clearUnappliedValueWrite();
|
|
@@ -3562,7 +3562,7 @@ const M = class M extends N {
|
|
|
3562
3562
|
* @returns 収集する値
|
|
3563
3563
|
*/
|
|
3564
3564
|
getValueForCollection() {
|
|
3565
|
-
return this.skipChangeValue || this.valueWriteUnapplied ? this.value :
|
|
3565
|
+
return this.skipChangeValue || this.valueWriteUnapplied ? this.value : C.isValuePropertyTarget(this.getTarget()) ? this.readValueFromDom() : this.value;
|
|
3566
3566
|
}
|
|
3567
3567
|
/**
|
|
3568
3568
|
* チェック状態の DOM 反映に合わせて内部値を DOM から同期します。
|
|
@@ -3582,7 +3582,7 @@ const M = class M extends N {
|
|
|
3582
3582
|
if (!t)
|
|
3583
3583
|
return;
|
|
3584
3584
|
const r = N.get(t);
|
|
3585
|
-
r instanceof
|
|
3585
|
+
r instanceof C && r.syncValue();
|
|
3586
3586
|
}
|
|
3587
3587
|
/**
|
|
3588
3588
|
* 指定した属性のいずれかを自身が書き込み中なら、その完了 Promise を返します。
|
|
@@ -3698,8 +3698,8 @@ const M = class M extends N {
|
|
|
3698
3698
|
return e === t ? this.removeAttribute(e) : this.removeAliasedAttribute(e, t);
|
|
3699
3699
|
const o = new we(e, r);
|
|
3700
3700
|
if (n) {
|
|
3701
|
-
const
|
|
3702
|
-
if (
|
|
3701
|
+
const xe = this.attributeMap.get(e);
|
|
3702
|
+
if (xe && (xe.isEvaluate || xe.isForceEvaluation()) && !o.isEvaluate && !o.isForceEvaluation()) {
|
|
3703
3703
|
const Ve = W.enqueue(() => {
|
|
3704
3704
|
}).finally(() => {
|
|
3705
3705
|
this.releaseSelfWritingAttributes(s);
|
|
@@ -3713,24 +3713,24 @@ const M = class M extends N {
|
|
|
3713
3713
|
element: l,
|
|
3714
3714
|
rawName: e,
|
|
3715
3715
|
template: r
|
|
3716
|
-
}), d = o.isEvaluate || o.isRawEvaluate, h = e === t &&
|
|
3717
|
-
P && c.hasUnresolvedReference &&
|
|
3716
|
+
}), d = o.isEvaluate || o.isRawEvaluate, h = e === t && C.BOOLEAN_ATTRIBUTES.has(t.toLowerCase()), y = o.isSingleExpression(), A = ie.joinEvaluateResults(c.results), S = c.results.length === 1 ? c.results[0] : A, P = !o.isForceEvaluation() && (t !== e || h || y ? c.hasUnresolvedReference || S === null || S === void 0 || S === !1 : d && A === "");
|
|
3717
|
+
P && c.hasUnresolvedReference && C.warnUnresolvedAttribute(
|
|
3718
3718
|
e,
|
|
3719
3719
|
t,
|
|
3720
3720
|
r,
|
|
3721
3721
|
l
|
|
3722
3722
|
);
|
|
3723
|
-
const D = o.isForceEvaluation() ? r : y ? S : A, L = i && o.isEvaluate && t === "value" &&
|
|
3724
|
-
if (!
|
|
3723
|
+
const D = o.isForceEvaluation() ? r : y ? S : A, L = i && o.isEvaluate && t === "value" && C.isValuePropertyTarget(l), E = l.getRootNode(), v = L && (l === E.activeElement || this.hasPendingUserEdit()), R = P || D === null || D === !1 ? null : String(D), x = e !== t && l.getAttribute(e) !== r, k = R === null ? l.hasAttribute(t) : l.getAttribute(t) !== R, V = R === null ? "" : R, G = L && !v && l.value !== V, _ = t === "checked" && l instanceof HTMLInputElement && (l.type === "checkbox" || l.type === "radio"), Z = t === "selected" && l instanceof HTMLOptionElement, Ne = E.activeElement, Fe = Ne !== null && (_ && l === Ne || Z && l.closest("select") === Ne) || (_ || Z) && this.hasPendingCheckableUserEdit(Z), be = R !== null, ke = _ && !Fe && l.checked !== be, ye = Z && !Fe && l.selected !== be;
|
|
3724
|
+
if (!x && !k && !G && !ke && !ye)
|
|
3725
3725
|
return L && !v && (this.value = this.normalizeValueForElement(
|
|
3726
3726
|
l,
|
|
3727
3727
|
V
|
|
3728
3728
|
), this.clearUnappliedValueWrite()), (_ || Z) && !Fe && this.syncCheckableValueFromDom(Z), Promise.resolve();
|
|
3729
3729
|
const Ue = W.enqueue(() => {
|
|
3730
|
-
|
|
3730
|
+
x && l.setAttribute(e, r), R === null ? l.removeAttribute(t) : k && (l.setAttribute(t, R), t === `${u.prefix}bind` && this.recordSelfWrittenBind(R)), L && !v && (this.value = this.normalizeValueForElement(
|
|
3731
3731
|
l,
|
|
3732
3732
|
V
|
|
3733
|
-
), G && (l.value = V), this.recordValueWriteResult(l.value === V)),
|
|
3733
|
+
), G && (l.value = V), this.recordValueWriteResult(l.value === V)), ke && (l.checked = be), ye && (l.selected = be), (ke || ye) && this.syncCheckableValueFromDom(ye);
|
|
3734
3734
|
}).finally(() => {
|
|
3735
3735
|
this.releaseSelfWritingAttributes(s);
|
|
3736
3736
|
});
|
|
@@ -3967,7 +3967,7 @@ const M = class M extends N {
|
|
|
3967
3967
|
return Promise.resolve();
|
|
3968
3968
|
this.visible = !1;
|
|
3969
3969
|
const e = this.getTarget();
|
|
3970
|
-
return this.display = e.style.getPropertyValue("display"), this.displayPriority = e.style.getPropertyPriority("display"), e.style.setProperty("display", "none", "important"), e.setAttribute(`${u.prefix}if-false`, ""),
|
|
3970
|
+
return this.display = e.style.getPropertyValue("display"), this.displayPriority = e.style.getPropertyPriority("display"), e.style.setProperty("display", "none", "important"), e.setAttribute(`${u.prefix}if-false`, ""), C.disableFormControlsInBranch(e), Promise.resolve();
|
|
3971
3971
|
}
|
|
3972
3972
|
/**
|
|
3973
3973
|
* 分岐配下のフォームコントロールを順に処理します。
|
|
@@ -4005,7 +4005,7 @@ const M = class M extends N {
|
|
|
4005
4005
|
* @returns 戻り値はありません。
|
|
4006
4006
|
*/
|
|
4007
4007
|
static disableFormControlsInBranch(e) {
|
|
4008
|
-
|
|
4008
|
+
C.forEachFormControlInBranch(e, (t) => {
|
|
4009
4009
|
t.hasAttribute("disabled") || (t.setAttribute(pe, ""), t.setAttribute("disabled", ""));
|
|
4010
4010
|
});
|
|
4011
4011
|
}
|
|
@@ -4019,7 +4019,7 @@ const M = class M extends N {
|
|
|
4019
4019
|
* @returns 戻り値はありません。
|
|
4020
4020
|
*/
|
|
4021
4021
|
restoreFormControlsDisabledByIf() {
|
|
4022
|
-
|
|
4022
|
+
C.forEachFormControlInBranch(this.getTarget(), (e) => {
|
|
4023
4023
|
e.hasAttribute(pe) && (e.removeAttribute(pe), e.removeAttribute("disabled"));
|
|
4024
4024
|
});
|
|
4025
4025
|
}
|
|
@@ -4052,7 +4052,7 @@ const M = class M extends N {
|
|
|
4052
4052
|
return t === null ? null : t.closestByAttribute(e);
|
|
4053
4053
|
}
|
|
4054
4054
|
};
|
|
4055
|
-
|
|
4055
|
+
C.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
4056
4056
|
"allowfullscreen",
|
|
4057
4057
|
"async",
|
|
4058
4058
|
"autofocus",
|
|
@@ -4076,7 +4076,7 @@ M.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
4076
4076
|
"required",
|
|
4077
4077
|
"reversed",
|
|
4078
4078
|
"selected"
|
|
4079
|
-
]),
|
|
4079
|
+
]), C.INPUT_EVENT_TYPES = [
|
|
4080
4080
|
"text",
|
|
4081
4081
|
"password",
|
|
4082
4082
|
"email",
|
|
@@ -4091,8 +4091,8 @@ M.BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
|
4091
4091
|
"month",
|
|
4092
4092
|
"time",
|
|
4093
4093
|
"week"
|
|
4094
|
-
],
|
|
4095
|
-
let T =
|
|
4094
|
+
], C.UNAPPLIED_VALUE_WRITES = /* @__PURE__ */ new Set(), C.sequenceCounter = 0, C.bindingWorkActiveCount = 0, C.pendingMutationFlusher = null, C.loggedUnresolvedAttributes = /* @__PURE__ */ new Set();
|
|
4095
|
+
let T = C;
|
|
4096
4096
|
class Q extends N {
|
|
4097
4097
|
/**
|
|
4098
4098
|
* テキストフラグメントのコンストラクタ。
|
|
@@ -6105,18 +6105,21 @@ const p = class p {
|
|
|
6105
6105
|
p.clearMessages(e),
|
|
6106
6106
|
p.clearEachClones(e)
|
|
6107
6107
|
]), await W.enqueue(() => {
|
|
6108
|
-
const n =
|
|
6109
|
-
|
|
6110
|
-
|
|
6108
|
+
const n = p.collectEditsAfter(
|
|
6109
|
+
e,
|
|
6110
|
+
t
|
|
6111
|
+
), s = e.getTarget();
|
|
6112
|
+
if (s instanceof HTMLFormElement)
|
|
6113
|
+
s.reset();
|
|
6111
6114
|
else {
|
|
6112
|
-
|
|
6113
|
-
const
|
|
6114
|
-
if (
|
|
6115
|
-
const
|
|
6116
|
-
|
|
6115
|
+
s.querySelectorAll("form").forEach((o) => o.reset());
|
|
6116
|
+
const a = s.parentElement;
|
|
6117
|
+
if (a) {
|
|
6118
|
+
const o = s.nextElementSibling, l = document.createElement("form");
|
|
6119
|
+
l.appendChild(s), l.reset(), a.insertBefore(s, o);
|
|
6117
6120
|
}
|
|
6118
6121
|
}
|
|
6119
|
-
p.clearDeclarativeStateFromDom(e);
|
|
6122
|
+
p.clearDeclarativeStateFromDom(e), p.restoreEdits(n);
|
|
6120
6123
|
});
|
|
6121
6124
|
const i = r;
|
|
6122
6125
|
for (const n of i) {
|
|
@@ -6226,6 +6229,54 @@ const p = class p {
|
|
|
6226
6229
|
for (const t of e.getChildElementFragments())
|
|
6227
6230
|
p.clearValues(t);
|
|
6228
6231
|
}
|
|
6232
|
+
/**
|
|
6233
|
+
* 指定した通番より後に編集された入力欄の DOM の状態を控えます。
|
|
6234
|
+
*
|
|
6235
|
+
* ネイティブの `form.reset()` は DOM を直接書き戻すため、入力欄ごとの保護判定
|
|
6236
|
+
* (`ElementFragment` の編集の通番)を経由しません。リセットを要求した後に行われた
|
|
6237
|
+
* 編集を残すために、リセットの直前に控えて直後に戻します
|
|
6238
|
+
* (仕様「反映待ちの間に起きた変化」)。
|
|
6239
|
+
*
|
|
6240
|
+
* @param fragment 対象フラグメント(配下も辿る)
|
|
6241
|
+
* @param operationSequence この通番より後の編集を控える
|
|
6242
|
+
* @param collected 控えの蓄積先(再帰用)
|
|
6243
|
+
* @returns 控えた状態の配列
|
|
6244
|
+
*/
|
|
6245
|
+
static collectEditsAfter(e, t, r = []) {
|
|
6246
|
+
const i = e.getTarget();
|
|
6247
|
+
(i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement || i instanceof HTMLSelectElement) && e.getUserEditSequence() > t && (i instanceof HTMLInputElement && (i.type === "checkbox" || i.type === "radio") ? r.push({ element: i, checked: i.checked }) : i instanceof HTMLSelectElement && i.multiple ? r.push({
|
|
6248
|
+
element: i,
|
|
6249
|
+
selected: Array.from(i.selectedOptions).map(
|
|
6250
|
+
(n) => n.value
|
|
6251
|
+
)
|
|
6252
|
+
}) : r.push({ element: i, value: i.value }));
|
|
6253
|
+
for (const n of e.getChildElementFragments())
|
|
6254
|
+
p.collectEditsAfter(n, t, r);
|
|
6255
|
+
return r;
|
|
6256
|
+
}
|
|
6257
|
+
/**
|
|
6258
|
+
* 控えた入力欄の状態を DOM へ戻します。
|
|
6259
|
+
*
|
|
6260
|
+
* 内部値は戻しません(`Form.reset()` の呼び出し箇所のコメントを参照)。
|
|
6261
|
+
*
|
|
6262
|
+
* @param snapshots `collectEditsAfter()` で控えた状態
|
|
6263
|
+
* @returns 戻り値はありません。
|
|
6264
|
+
*/
|
|
6265
|
+
static restoreEdits(e) {
|
|
6266
|
+
for (const t of e) {
|
|
6267
|
+
const { element: r } = t;
|
|
6268
|
+
if (t.checked !== void 0 && r instanceof HTMLInputElement) {
|
|
6269
|
+
r.checked = t.checked;
|
|
6270
|
+
continue;
|
|
6271
|
+
}
|
|
6272
|
+
if (t.selected !== void 0 && r instanceof HTMLSelectElement) {
|
|
6273
|
+
for (const i of Array.from(r.options))
|
|
6274
|
+
i.selected = t.selected.includes(i.value);
|
|
6275
|
+
continue;
|
|
6276
|
+
}
|
|
6277
|
+
t.value !== void 0 && (r.value = t.value);
|
|
6278
|
+
}
|
|
6279
|
+
}
|
|
6229
6280
|
/**
|
|
6230
6281
|
* `data-form-arg` のキーを祖先が所有するフォームを、そのレコードの内容へ戻します。
|
|
6231
6282
|
*
|
|
@@ -7196,18 +7247,18 @@ const Nt = [
|
|
|
7196
7247
|
"dialog",
|
|
7197
7248
|
"openDialog",
|
|
7198
7249
|
"toast"
|
|
7199
|
-
], Ft = "__haoriHistoryState__",
|
|
7250
|
+
], Ft = "__haoriHistoryState__", Me = "data-haori-click-lock";
|
|
7200
7251
|
function Ae() {
|
|
7201
7252
|
const e = globalThis.window?.Haori;
|
|
7202
7253
|
return Nt.every(
|
|
7203
7254
|
(r) => typeof e?.[r] == "function"
|
|
7204
7255
|
) ? e : he;
|
|
7205
7256
|
}
|
|
7206
|
-
const
|
|
7257
|
+
const kt = /* @__PURE__ */ new Set(["GET", "HEAD", "OPTIONS"]);
|
|
7207
7258
|
function Pe(g) {
|
|
7208
|
-
return
|
|
7259
|
+
return kt.has(g.toUpperCase());
|
|
7209
7260
|
}
|
|
7210
|
-
function
|
|
7261
|
+
function xt(g, e) {
|
|
7211
7262
|
for (const [t, r] of Object.entries(e))
|
|
7212
7263
|
r !== void 0 && (Array.isArray(r) ? r.forEach((i) => {
|
|
7213
7264
|
g.append(t, le(i));
|
|
@@ -7226,9 +7277,9 @@ function le(g) {
|
|
|
7226
7277
|
}
|
|
7227
7278
|
function ft(g, e) {
|
|
7228
7279
|
const t = new URL(g, window.location.href), r = new URLSearchParams(t.search);
|
|
7229
|
-
return
|
|
7280
|
+
return xt(r, e), t.search = r.toString(), t.toString();
|
|
7230
7281
|
}
|
|
7231
|
-
function
|
|
7282
|
+
function Mt(g) {
|
|
7232
7283
|
if (g == null)
|
|
7233
7284
|
return { payload: {}, dropped: !1 };
|
|
7234
7285
|
if (typeof g == "string") {
|
|
@@ -7293,7 +7344,7 @@ function ne(g, e) {
|
|
|
7293
7344
|
}
|
|
7294
7345
|
return e;
|
|
7295
7346
|
}
|
|
7296
|
-
function
|
|
7347
|
+
function Ct(g) {
|
|
7297
7348
|
const e = g?.body;
|
|
7298
7349
|
return e == null ? !1 : typeof e == "string" ? e !== "" : !0;
|
|
7299
7350
|
}
|
|
@@ -7307,7 +7358,7 @@ function Pt(g, e) {
|
|
|
7307
7358
|
effectiveMethod: r,
|
|
7308
7359
|
normalized: !1
|
|
7309
7360
|
};
|
|
7310
|
-
const { payload: i, dropped: n } =
|
|
7361
|
+
const { payload: i, dropped: n } = Mt(
|
|
7311
7362
|
t.body
|
|
7312
7363
|
);
|
|
7313
7364
|
let s = g;
|
|
@@ -7651,8 +7702,8 @@ ${v}
|
|
|
7651
7702
|
R = new Function("event", `"use strict";
|
|
7652
7703
|
${v}
|
|
7653
7704
|
`);
|
|
7654
|
-
} catch (
|
|
7655
|
-
m.error("Haori", `Invalid run script: ${
|
|
7705
|
+
} catch (x) {
|
|
7706
|
+
m.error("Haori", `Invalid run script: ${x}`);
|
|
7656
7707
|
}
|
|
7657
7708
|
}
|
|
7658
7709
|
R && (r.runScript = R);
|
|
@@ -7756,8 +7807,8 @@ ${v}
|
|
|
7756
7807
|
if (E) {
|
|
7757
7808
|
const v = z.queryAll(E, o);
|
|
7758
7809
|
v.length > 0 ? (r.bindFragments = [], v.forEach((R) => {
|
|
7759
|
-
const
|
|
7760
|
-
|
|
7810
|
+
const x = N.get(R);
|
|
7811
|
+
x && r.bindFragments.push(x);
|
|
7761
7812
|
})) : m.error(
|
|
7762
7813
|
"Haori",
|
|
7763
7814
|
`Bind element not found: ${E} (${o})`
|
|
@@ -7794,12 +7845,12 @@ ${v}
|
|
|
7794
7845
|
b.attrName(t, "adjust")
|
|
7795
7846
|
);
|
|
7796
7847
|
if (R) {
|
|
7797
|
-
const
|
|
7848
|
+
const x = z.queryAll(
|
|
7798
7849
|
R,
|
|
7799
7850
|
b.attrName(t, "adjust")
|
|
7800
7851
|
);
|
|
7801
|
-
|
|
7802
|
-
const V = N.get(
|
|
7852
|
+
x.length > 0 ? (r.adjustFragments = [], x.forEach((k) => {
|
|
7853
|
+
const V = N.get(k);
|
|
7803
7854
|
V && r.adjustFragments.push(V);
|
|
7804
7855
|
})) : m.error(
|
|
7805
7856
|
"Haori",
|
|
@@ -7807,10 +7858,10 @@ ${v}
|
|
|
7807
7858
|
);
|
|
7808
7859
|
}
|
|
7809
7860
|
if (e.hasAttribute(b.attrName(t, "adjust-value"))) {
|
|
7810
|
-
const
|
|
7861
|
+
const x = e.getRawAttribute(
|
|
7811
7862
|
b.attrName(t, "adjust-value")
|
|
7812
|
-
),
|
|
7813
|
-
isNaN(
|
|
7863
|
+
), k = Number(x);
|
|
7864
|
+
isNaN(k) || (r.adjustValue = k);
|
|
7814
7865
|
}
|
|
7815
7866
|
}
|
|
7816
7867
|
if (e.hasAttribute(b.attrName(t, "row-add")) && (r.rowAdd = !0), e.hasAttribute(b.attrName(t, "row-remove")) && (r.rowRemove = !0), e.hasAttribute(b.attrName(t, "row-prev")) && (r.rowMovePrev = !0), e.hasAttribute(b.attrName(t, "row-next")) && (r.rowMoveNext = !0), e.hasAttribute(`${u.prefix}${t}-after-run`)) {
|
|
@@ -7825,8 +7876,8 @@ ${v}
|
|
|
7825
7876
|
${R}
|
|
7826
7877
|
`
|
|
7827
7878
|
);
|
|
7828
|
-
} catch (
|
|
7829
|
-
m.error("Haori", `Invalid after script: ${
|
|
7879
|
+
} catch (x) {
|
|
7880
|
+
m.error("Haori", `Invalid after script: ${x}`);
|
|
7830
7881
|
}
|
|
7831
7882
|
}
|
|
7832
7883
|
if (e.hasAttribute(b.attrName(t, "dialog")) && (r.dialogMessage = b.unescapeNewlines(
|
|
@@ -7845,8 +7896,8 @@ ${R}
|
|
|
7845
7896
|
);
|
|
7846
7897
|
const R = e.getRawAttribute(
|
|
7847
7898
|
b.attrName(t, "toast-level")
|
|
7848
|
-
),
|
|
7849
|
-
r.toastLevel =
|
|
7899
|
+
), k = ["info", "warning", "error", "success"].includes(R);
|
|
7900
|
+
r.toastLevel = k ? R : null;
|
|
7850
7901
|
}
|
|
7851
7902
|
if (e.hasAttribute(b.attrName(t, "redirect"))) {
|
|
7852
7903
|
r.redirectUrl = b.readLateAttribute(
|
|
@@ -7882,12 +7933,12 @@ ${R}
|
|
|
7882
7933
|
b.attrName(t, "history-form")
|
|
7883
7934
|
);
|
|
7884
7935
|
if (R) {
|
|
7885
|
-
const
|
|
7936
|
+
const x = z.query(
|
|
7886
7937
|
R,
|
|
7887
7938
|
b.attrName(t, "history-form")
|
|
7888
7939
|
);
|
|
7889
|
-
|
|
7890
|
-
N.get(
|
|
7940
|
+
x !== null ? r.historyFormFragment = F.getFormFragment(
|
|
7941
|
+
N.get(x)
|
|
7891
7942
|
) : m.error(
|
|
7892
7943
|
"Haori",
|
|
7893
7944
|
`Form element not found: ${R} (${b.attrName(t, "history-form")})`
|
|
@@ -7904,18 +7955,18 @@ ${R}
|
|
|
7904
7955
|
"open",
|
|
7905
7956
|
"close"
|
|
7906
7957
|
].forEach((R) => {
|
|
7907
|
-
const
|
|
7908
|
-
if (!e.hasAttribute(
|
|
7958
|
+
const x = b.attrName(t, R);
|
|
7959
|
+
if (!e.hasAttribute(x))
|
|
7909
7960
|
return;
|
|
7910
|
-
const
|
|
7911
|
-
if (
|
|
7912
|
-
z.queryAll(
|
|
7961
|
+
const k = z.read(e, x), V = [];
|
|
7962
|
+
if (k)
|
|
7963
|
+
z.queryAll(k, x).forEach((_) => {
|
|
7913
7964
|
const Z = N.get(_);
|
|
7914
7965
|
Z && V.push(Z);
|
|
7915
|
-
}), V.length === 0 && m.error("Haori", `Element not found: ${
|
|
7966
|
+
}), V.length === 0 && m.error("Haori", `Element not found: ${k} (${x})`);
|
|
7916
7967
|
else if (R === "open" || R === "close") {
|
|
7917
7968
|
const G = e.getTarget().closest("dialog");
|
|
7918
|
-
G ? V.push(N.get(G)) : m.error("Haori", `Ancestor <dialog> not found (${
|
|
7969
|
+
G ? V.push(N.get(G)) : m.error("Haori", `Ancestor <dialog> not found (${x})`);
|
|
7919
7970
|
} else
|
|
7920
7971
|
V.push(e);
|
|
7921
7972
|
if (V.length > 0)
|
|
@@ -7947,10 +7998,10 @@ ${R}
|
|
|
7947
7998
|
if (e.hasAttribute(v)) {
|
|
7948
7999
|
const R = z.read(e, v);
|
|
7949
8000
|
if (R) {
|
|
7950
|
-
const
|
|
7951
|
-
if (
|
|
7952
|
-
const
|
|
7953
|
-
|
|
8001
|
+
const x = z.query(R, v);
|
|
8002
|
+
if (x !== null) {
|
|
8003
|
+
const k = N.get(x);
|
|
8004
|
+
k ? r.copySourceFragment = k : m.error(
|
|
7954
8005
|
"Haori",
|
|
7955
8006
|
`Element is not managed by Haori: ${R} (${v})`
|
|
7956
8007
|
);
|
|
@@ -7985,9 +8036,9 @@ ${R}
|
|
|
7985
8036
|
const D = t ? b.attrName(t, "fetch-state") : b.attrName(null, "state", !0);
|
|
7986
8037
|
if (e.hasAttribute(D)) {
|
|
7987
8038
|
const E = z.read(e, D), v = [];
|
|
7988
|
-
E ? (z.queryAll(E, D).forEach((
|
|
7989
|
-
const
|
|
7990
|
-
|
|
8039
|
+
E ? (z.queryAll(E, D).forEach((x) => {
|
|
8040
|
+
const k = N.get(x);
|
|
8041
|
+
k && v.push(k);
|
|
7991
8042
|
}), v.length === 0 && m.error(
|
|
7992
8043
|
"Haori",
|
|
7993
8044
|
`Element not found: ${E} (${D})`
|
|
@@ -8005,10 +8056,10 @@ ${R}
|
|
|
8005
8056
|
r.storeClearKey = v;
|
|
8006
8057
|
const R = e.getRawAttribute(
|
|
8007
8058
|
`${L}-type`
|
|
8008
|
-
),
|
|
8009
|
-
|
|
8059
|
+
), x = R === null ? "session" : R.trim();
|
|
8060
|
+
x === "local" || x === "session" ? r.storeClearKind = x : (m.warn(
|
|
8010
8061
|
"Haori",
|
|
8011
|
-
`${L}-type は session または local を指定してください(session として扱います): ${
|
|
8062
|
+
`${L}-type は session または local を指定してください(session として扱います): ${x}`
|
|
8012
8063
|
), r.storeClearKind = "session");
|
|
8013
8064
|
}
|
|
8014
8065
|
}
|
|
@@ -8149,7 +8200,7 @@ ${R}
|
|
|
8149
8200
|
}
|
|
8150
8201
|
const l = Object.keys(i).length > 0;
|
|
8151
8202
|
if (n) {
|
|
8152
|
-
const h = (s?.method || "GET").toUpperCase(), A = !a && o && r.transportMode === "query-get" &&
|
|
8203
|
+
const h = (s?.method || "GET").toUpperCase(), A = !a && o && r.transportMode === "query-get" && Ct(s) && !Pe(h) ? r.baseUrl ?? n : n, S = Pt(
|
|
8153
8204
|
A,
|
|
8154
8205
|
s
|
|
8155
8206
|
);
|
|
@@ -8164,7 +8215,7 @@ ${R}
|
|
|
8164
8215
|
payload: l ? i : void 0,
|
|
8165
8216
|
queryString: v
|
|
8166
8217
|
}), this.options.targetFragment && n) {
|
|
8167
|
-
const R = performance.now(),
|
|
8218
|
+
const R = performance.now(), x = {
|
|
8168
8219
|
runtime: u.runtime,
|
|
8169
8220
|
requestedMethod: D,
|
|
8170
8221
|
effectiveMethod: L,
|
|
@@ -8176,21 +8227,21 @@ ${R}
|
|
|
8176
8227
|
n,
|
|
8177
8228
|
P,
|
|
8178
8229
|
l ? i : void 0,
|
|
8179
|
-
|
|
8180
|
-
), await this.injectFetchState("loading"), fetch(n, P).then((
|
|
8181
|
-
|
|
8230
|
+
x
|
|
8231
|
+
), await this.injectFetchState("loading"), fetch(n, P).then((k) => this.handleFetchResult(
|
|
8232
|
+
k,
|
|
8182
8233
|
n || void 0,
|
|
8183
8234
|
R
|
|
8184
|
-
)).catch(async (
|
|
8235
|
+
)).catch(async (k) => {
|
|
8185
8236
|
throw n && H.fetchError(
|
|
8186
8237
|
this.options.targetFragment.getTarget(),
|
|
8187
8238
|
n,
|
|
8188
|
-
|
|
8239
|
+
k
|
|
8189
8240
|
), await this.injectFetchState(
|
|
8190
8241
|
"error",
|
|
8191
8242
|
null,
|
|
8192
|
-
|
|
8193
|
-
),
|
|
8243
|
+
k instanceof Error ? k.message : String(k)
|
|
8244
|
+
), k;
|
|
8194
8245
|
});
|
|
8195
8246
|
}
|
|
8196
8247
|
return fetch(n, P).then((R) => this.handleFetchResult(R, n || void 0));
|
|
@@ -8238,10 +8289,10 @@ ${R}
|
|
|
8238
8289
|
if (this.eventType !== "click" || !this.options.targetFragment)
|
|
8239
8290
|
return null;
|
|
8240
8291
|
const t = this.options.targetFragment.getTarget();
|
|
8241
|
-
if (b.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(
|
|
8292
|
+
if (b.RUNNING_CLICK_TARGETS.has(t) || t.matches(":disabled") || t.hasAttribute("disabled") || t.hasAttribute(Me))
|
|
8242
8293
|
return !1;
|
|
8243
8294
|
const r = t.hasAttribute(`${u.prefix}click-no-disabled`);
|
|
8244
|
-
return b.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(
|
|
8295
|
+
return b.RUNNING_CLICK_TARGETS.add(t), t.setAttribute(Me, ""), r || t.setAttribute("disabled", ""), {
|
|
8245
8296
|
target: t,
|
|
8246
8297
|
appliedDisabledAttribute: !r
|
|
8247
8298
|
};
|
|
@@ -8253,7 +8304,7 @@ ${R}
|
|
|
8253
8304
|
* @returns 戻り値はありません。
|
|
8254
8305
|
*/
|
|
8255
8306
|
releaseExecutionLock(e) {
|
|
8256
|
-
e && (b.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(
|
|
8307
|
+
e && (b.RUNNING_CLICK_TARGETS.delete(e.target), e.target.removeAttribute(Me), e.appliedDisabledAttribute && e.target.removeAttribute("disabled"));
|
|
8257
8308
|
}
|
|
8258
8309
|
/**
|
|
8259
8310
|
* フェッチ後の処理を実行します。
|
|
@@ -11389,13 +11440,13 @@ ${r}
|
|
|
11389
11440
|
);
|
|
11390
11441
|
const h = d.map((E) => E.getListKey()), y = /* @__PURE__ */ new Set();
|
|
11391
11442
|
d = d.filter((E, v) => {
|
|
11392
|
-
const R = String(E.getListKey()),
|
|
11393
|
-
if (
|
|
11443
|
+
const R = String(E.getListKey()), x = l.get(R) ?? 0;
|
|
11444
|
+
if (x === 0) {
|
|
11394
11445
|
y.add(E);
|
|
11395
|
-
const
|
|
11396
|
-
return
|
|
11446
|
+
const k = E.getListKey();
|
|
11447
|
+
return k !== null && H.rowRemove(E.getTarget(), k, v), c.push(E.remove()), !1;
|
|
11397
11448
|
}
|
|
11398
|
-
return l.set(R,
|
|
11449
|
+
return l.set(R, x - 1), !0;
|
|
11399
11450
|
});
|
|
11400
11451
|
const A = d.map((E) => E.getListKey()), S = /* @__PURE__ */ new Map();
|
|
11401
11452
|
d.forEach((E) => {
|
|
@@ -11410,18 +11461,18 @@ ${r}
|
|
|
11410
11461
|
).length;
|
|
11411
11462
|
let L = Promise.resolve();
|
|
11412
11463
|
return a.forEach((E, v) => {
|
|
11413
|
-
const R = t[v],
|
|
11414
|
-
let
|
|
11464
|
+
const R = t[v], x = v;
|
|
11465
|
+
let k;
|
|
11415
11466
|
const V = S.get(E)?.shift();
|
|
11416
11467
|
if (V) {
|
|
11417
|
-
|
|
11468
|
+
k = V;
|
|
11418
11469
|
const G = D + v;
|
|
11419
11470
|
L = L.then(
|
|
11420
11471
|
() => f.updateRowFragment(
|
|
11421
|
-
|
|
11472
|
+
k,
|
|
11422
11473
|
R,
|
|
11423
11474
|
i,
|
|
11424
|
-
|
|
11475
|
+
x,
|
|
11425
11476
|
s ? String(s) : null,
|
|
11426
11477
|
E
|
|
11427
11478
|
).then(
|
|
@@ -11431,40 +11482,40 @@ ${r}
|
|
|
11431
11482
|
// される)で DOM の順序が古いまま残る。
|
|
11432
11483
|
f.repositionEachRow(
|
|
11433
11484
|
e,
|
|
11434
|
-
|
|
11485
|
+
k,
|
|
11435
11486
|
P,
|
|
11436
11487
|
G
|
|
11437
11488
|
).then((Z) => {
|
|
11438
11489
|
if (Z !== null && H.rowMove(
|
|
11439
|
-
|
|
11490
|
+
k.getTarget(),
|
|
11440
11491
|
E,
|
|
11441
11492
|
Z - D,
|
|
11442
11493
|
v
|
|
11443
11494
|
), !!_)
|
|
11444
|
-
return f.clearUserEditMarks(
|
|
11445
|
-
() => f.applyRowFormValues(e,
|
|
11495
|
+
return f.clearUserEditMarks(k), f.evaluateAll(k).then(
|
|
11496
|
+
() => f.applyRowFormValues(e, k, R)
|
|
11446
11497
|
);
|
|
11447
11498
|
})
|
|
11448
11499
|
)
|
|
11449
11500
|
)
|
|
11450
11501
|
);
|
|
11451
11502
|
} else {
|
|
11452
|
-
|
|
11503
|
+
k = r.clone();
|
|
11453
11504
|
const G = D + v;
|
|
11454
11505
|
L = L.then(
|
|
11455
11506
|
() => f.updateRowFragment(
|
|
11456
|
-
|
|
11507
|
+
k,
|
|
11457
11508
|
R,
|
|
11458
11509
|
i,
|
|
11459
|
-
|
|
11510
|
+
x,
|
|
11460
11511
|
s ? String(s) : null,
|
|
11461
11512
|
E
|
|
11462
11513
|
).then(() => {
|
|
11463
11514
|
const _ = P[G] ?? null;
|
|
11464
|
-
return e.insertBefore(
|
|
11465
|
-
P.splice(G, 0,
|
|
11466
|
-
}).then(() => f.initializeFreshEachRow(
|
|
11467
|
-
H.rowAdd(
|
|
11515
|
+
return e.insertBefore(k, _).then(() => {
|
|
11516
|
+
P.splice(G, 0, k);
|
|
11517
|
+
}).then(() => f.initializeFreshEachRow(k)).then(() => f.applyRowFormValues(e, k, R)).then(() => {
|
|
11518
|
+
H.rowAdd(k.getTarget(), E, x, R);
|
|
11468
11519
|
});
|
|
11469
11520
|
})
|
|
11470
11521
|
);
|
|
@@ -11474,14 +11525,14 @@ ${r}
|
|
|
11474
11525
|
(G) => G !== null
|
|
11475
11526
|
), v = A.filter(
|
|
11476
11527
|
(G) => G !== null
|
|
11477
|
-
), R = new Set(v),
|
|
11528
|
+
), R = new Set(v), x = E.filter((G) => !R.has(G)), V = h.filter(
|
|
11478
11529
|
(G) => G !== null
|
|
11479
11530
|
).filter(
|
|
11480
11531
|
(G) => !o.has(G)
|
|
11481
11532
|
);
|
|
11482
11533
|
H.eachUpdate(
|
|
11483
11534
|
e.getTarget(),
|
|
11484
|
-
|
|
11535
|
+
x,
|
|
11485
11536
|
V,
|
|
11486
11537
|
E
|
|
11487
11538
|
);
|
|
@@ -12755,7 +12806,7 @@ w.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
12755
12806
|
"state"
|
|
12756
12807
|
]), w.DEFAULT_INTERVAL_MS = 5e3, w.MIN_INTERVAL_MS = 100, w.registrations = /* @__PURE__ */ new Map(), w.visibilityListener = null;
|
|
12757
12808
|
let ce = w;
|
|
12758
|
-
const Ht = "0.41.
|
|
12809
|
+
const Ht = "0.41.4";
|
|
12759
12810
|
function Ut(g) {
|
|
12760
12811
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => g()) : Promise.resolve().then(g);
|
|
12761
12812
|
}
|