haori 0.46.1 → 0.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +1 -1
- package/README.md +1 -1
- package/dist/haori.cjs.js +4 -5
- package/dist/haori.es.js +33 -7
- package/dist/haori.iife.js +4 -5
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/haori.es.js
CHANGED
|
@@ -8375,6 +8375,28 @@ const b = class b {
|
|
|
8375
8375
|
hasUnresolvedReference: n?.hasUnresolvedReference ?? !1
|
|
8376
8376
|
}), n?.value ?? null;
|
|
8377
8377
|
}
|
|
8378
|
+
/**
|
|
8379
|
+
* 表示メッセージの評価値を文字列へ正規化します。
|
|
8380
|
+
*
|
|
8381
|
+
* `data-{event}-confirm` / `-dialog` / `-toast` の属性値には `{{式}}` を書けるため、
|
|
8382
|
+
* 評価結果は文字列に限りません(`null` / `false` / 数値になり、未解決参照は `null`
|
|
8383
|
+
* になります)。仕様「`data-{event}-confirm`」の「単体プレースホルダの評価結果が
|
|
8384
|
+
* `null` / `undefined` / `false` / 空文字 / `0`、または未解決参照になった場合は、
|
|
8385
|
+
* 確認を出さずに手続きを続けます」に従い、falsy は `null`(表示なし)へ寄せます。
|
|
8386
|
+
*
|
|
8387
|
+
* falsy 以外を文字列へ寄せるのは、同じ節の「それ以外の評価結果は**文字列にして
|
|
8388
|
+
* メッセージにします**」と、仕様「`data-{event}-dialog`」の「それ以外は文字列に
|
|
8389
|
+
* して表示します」のとおりです。数値などを表示なし側へ落とすと、確認したい場面で
|
|
8390
|
+
* 確認が黙って飛びます。表示する側を文字列へ寄せるのは、`haori.dialog()` などの
|
|
8391
|
+
* 差し替え実装が引数を文字列として扱うためです(`haori-bootstrap` は改行の復元で
|
|
8392
|
+
* `String.prototype.replace` を呼ぶため、数値を渡すと例外になります)。
|
|
8393
|
+
*
|
|
8394
|
+
* @param value 属性の評価値
|
|
8395
|
+
* @returns メッセージの文字列。表示しない場合は null
|
|
8396
|
+
*/
|
|
8397
|
+
static normalizeMessage(e) {
|
|
8398
|
+
return e ? String(e) : null;
|
|
8399
|
+
}
|
|
8378
8400
|
/**
|
|
8379
8401
|
* 属性値の `\n` 表記を改行へ復元します。
|
|
8380
8402
|
*
|
|
@@ -8545,8 +8567,11 @@ const b = class b {
|
|
|
8545
8567
|
);
|
|
8546
8568
|
}
|
|
8547
8569
|
if (t) {
|
|
8548
|
-
if (e.hasAttribute(b.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(b.attrName(t, "confirm")) && (r.confirmMessage =
|
|
8549
|
-
|
|
8570
|
+
if (e.hasAttribute(b.attrName(t, "validate")) && (r.valid = !0), e.hasAttribute(b.attrName(t, "confirm")) && (r.confirmMessage = b.unescapeNewlines(
|
|
8571
|
+
b.normalizeMessage(
|
|
8572
|
+
e.getAttribute(b.attrName(t, "confirm"))
|
|
8573
|
+
)
|
|
8574
|
+
)), e.hasAttribute(b.attrName(t, "data")) && (r.dataAttrName = b.attrName(t, "data")), e.hasAttribute(b.attrName(t, "form"))) {
|
|
8550
8575
|
const S = z.read(
|
|
8551
8576
|
e,
|
|
8552
8577
|
b.attrName(t, "form")
|
|
@@ -9263,12 +9288,13 @@ ${k}
|
|
|
9263
9288
|
E instanceof HTMLElement ? s.push(i.closeDialog(E)) : m.error("Haori", "Element is not an HTML element: ", E);
|
|
9264
9289
|
}), await Promise.all(s);
|
|
9265
9290
|
const a = b.unescapeNewlines(
|
|
9266
|
-
|
|
9291
|
+
b.normalizeMessage(
|
|
9292
|
+
this.resolveLateAttribute("dialog", this.options.dialogMessage)
|
|
9293
|
+
)
|
|
9267
9294
|
);
|
|
9268
9295
|
a && await i.dialog(a);
|
|
9269
|
-
const o =
|
|
9270
|
-
"toast",
|
|
9271
|
-
this.options.toastMessage
|
|
9296
|
+
const o = b.normalizeMessage(
|
|
9297
|
+
this.resolveLateAttribute("toast", this.options.toastMessage)
|
|
9272
9298
|
);
|
|
9273
9299
|
o && await i.toast(o, this.options.toastLevel ?? "info"), this.clearStore(), this.pushHistory();
|
|
9274
9300
|
const c = this.resolveLateAttribute(
|
|
@@ -13940,7 +13966,7 @@ w.CONFIG_KEYS = /* @__PURE__ */ new Set([
|
|
|
13940
13966
|
"state"
|
|
13941
13967
|
]), w.DEFAULT_INTERVAL_MS = 5e3, w.MIN_INTERVAL_MS = 100, w.registrations = /* @__PURE__ */ new Map(), w.visibilityListener = null;
|
|
13942
13968
|
let pe = w;
|
|
13943
|
-
const Vt = "0.46.
|
|
13969
|
+
const Vt = "0.46.2";
|
|
13944
13970
|
function qt(y) {
|
|
13945
13971
|
typeof requestAnimationFrame == "function" ? requestAnimationFrame(() => y()) : Promise.resolve().then(y);
|
|
13946
13972
|
}
|