haori-bootstrap 0.5.63 → 0.5.64
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 +7 -7
- package/README.md +8 -8
- package/dist/haori-bootstrap.iife.js +2 -2
- package/dist/haori-bootstrap.iife.js.map +1 -1
- package/dist/haori-bootstrap.js +263 -257
- package/dist/haori-bootstrap.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/haori-bootstrap.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
function
|
|
1
|
+
function be(e) {
|
|
2
2
|
return typeof e == "function";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function he(e) {
|
|
5
|
+
return be(e?.Modal) ? e?.Modal : void 0;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return
|
|
7
|
+
function Ee(e) {
|
|
8
|
+
return be(e?.Toast) ? e?.Toast : void 0;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return !!
|
|
10
|
+
function k(e) {
|
|
11
|
+
return !!he(e);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return !!
|
|
13
|
+
function Ve(e) {
|
|
14
|
+
return !!Ee(e);
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
const o =
|
|
16
|
+
function O(e, t, n) {
|
|
17
|
+
const o = he(n);
|
|
18
18
|
if (o)
|
|
19
19
|
return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, t) : new o(e, t);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const o =
|
|
21
|
+
function je(e, t, n) {
|
|
22
|
+
const o = Ee(n);
|
|
23
23
|
if (o)
|
|
24
24
|
return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, t) : new o(e, t);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
function
|
|
26
|
+
const Je = "data-haori-dialog", Xe = "data-haori-confirm", Qe = "data-haori-dialog-title", pe = "data-haori-dialog-ok", ve = "data-haori-confirm-ok", ge = "data-haori-confirm-cancel", Ye = "OK", Ze = "Cancel";
|
|
27
|
+
let et = 0;
|
|
28
|
+
function Ae() {
|
|
29
29
|
return {
|
|
30
30
|
backdrop: "static",
|
|
31
31
|
keyboard: !1
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function Te(e, t) {
|
|
35
35
|
if (t.dialogContainerSelector) {
|
|
36
36
|
const n = e.querySelector(
|
|
37
37
|
t.dialogContainerSelector
|
|
@@ -41,17 +41,17 @@ function ve(e, t) {
|
|
|
41
41
|
}
|
|
42
42
|
return e.body;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function we(e, t, n, o) {
|
|
45
45
|
const r = o.dialogTitle, s = e.createElement("div");
|
|
46
|
-
s.className = "modal fade", s.tabIndex = -1, s.setAttribute(n ?
|
|
46
|
+
s.className = "modal fade", s.tabIndex = -1, s.setAttribute(n ? Xe : Je, "true"), s.setAttribute("aria-hidden", "true");
|
|
47
47
|
const a = e.createElement("div");
|
|
48
48
|
a.className = "modal-dialog modal-dialog-centered";
|
|
49
49
|
const l = e.createElement("div");
|
|
50
50
|
if (l.className = "modal-content", r) {
|
|
51
|
-
const m = `haori-dialog-title-${++
|
|
52
|
-
|
|
51
|
+
const m = `haori-dialog-title-${++et}`, C = e.createElement("div");
|
|
52
|
+
C.className = "modal-header";
|
|
53
53
|
const p = e.createElement("h5");
|
|
54
|
-
p.className = "modal-title", p.id = m, p.setAttribute(
|
|
54
|
+
p.className = "modal-title", p.id = m, p.setAttribute(Qe, "true"), p.textContent = r, C.appendChild(p), l.appendChild(C), s.setAttribute("aria-labelledby", m);
|
|
55
55
|
}
|
|
56
56
|
const u = e.createElement("div");
|
|
57
57
|
u.className = "modal-body";
|
|
@@ -60,12 +60,12 @@ function ge(e, t, n, o) {
|
|
|
60
60
|
const f = e.createElement("div");
|
|
61
61
|
if (f.className = "modal-footer", n) {
|
|
62
62
|
const m = e.createElement("button");
|
|
63
|
-
m.type = "button", m.className = "btn btn-secondary", m.setAttribute(
|
|
63
|
+
m.type = "button", m.className = "btn btn-secondary", m.setAttribute(ge, "true"), m.textContent = o.dialogCancelLabel ?? Ze, f.appendChild(m);
|
|
64
64
|
}
|
|
65
65
|
const d = e.createElement("button");
|
|
66
|
-
return d.type = "button", d.className = "btn btn-primary", d.setAttribute(n ?
|
|
66
|
+
return d.type = "button", d.className = "btn btn-primary", d.setAttribute(n ? ve : pe, "true"), d.textContent = o.dialogOkLabel ?? Ye, f.appendChild(d), l.append(u, f), a.appendChild(l), s.appendChild(a), s;
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Ce(e) {
|
|
69
69
|
let t = !1, n = !1;
|
|
70
70
|
return {
|
|
71
71
|
requestClose: (o) => {
|
|
@@ -76,12 +76,12 @@ function Ae(e) {
|
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
const n = globalThis.document, o =
|
|
81
|
-
|
|
82
|
-
const r =
|
|
79
|
+
function tt(e, t) {
|
|
80
|
+
const n = globalThis.document, o = we(n, e, !1, t);
|
|
81
|
+
Te(n, t).appendChild(o);
|
|
82
|
+
const r = O(
|
|
83
83
|
o,
|
|
84
|
-
|
|
84
|
+
Ae(),
|
|
85
85
|
t.bootstrap
|
|
86
86
|
);
|
|
87
87
|
return r ? new Promise((s, a) => {
|
|
@@ -89,8 +89,8 @@ function Ye(e, t) {
|
|
|
89
89
|
o.removeEventListener("shown.bs.modal", f), o.removeEventListener("hidden.bs.modal", u), o.remove(), r.dispose?.(), s();
|
|
90
90
|
}, u = () => {
|
|
91
91
|
l();
|
|
92
|
-
}, c =
|
|
93
|
-
o.querySelector(`[${
|
|
92
|
+
}, c = Ce(r), f = c.handleShown;
|
|
93
|
+
o.querySelector(`[${pe}]`)?.addEventListener("click", () => {
|
|
94
94
|
c.requestClose();
|
|
95
95
|
}), o.addEventListener("shown.bs.modal", f), o.addEventListener("hidden.bs.modal", u, { once: !0 });
|
|
96
96
|
try {
|
|
@@ -100,12 +100,12 @@ function Ye(e, t) {
|
|
|
100
100
|
}
|
|
101
101
|
}) : (o.remove(), Promise.reject(new Error("Bootstrap Modal is unavailable.")));
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
const n = globalThis.document, o =
|
|
105
|
-
|
|
106
|
-
const r =
|
|
103
|
+
function nt(e, t) {
|
|
104
|
+
const n = globalThis.document, o = we(n, e, !0, t);
|
|
105
|
+
Te(n, t).appendChild(o);
|
|
106
|
+
const r = O(
|
|
107
107
|
o,
|
|
108
|
-
|
|
108
|
+
Ae(),
|
|
109
109
|
t.bootstrap
|
|
110
110
|
);
|
|
111
111
|
return r ? new Promise((s, a) => {
|
|
@@ -114,14 +114,14 @@ function Ze(e, t) {
|
|
|
114
114
|
o.removeEventListener("shown.bs.modal", d), o.removeEventListener("hidden.bs.modal", c), o.remove(), r.dispose?.(), s(l);
|
|
115
115
|
}, c = () => {
|
|
116
116
|
u();
|
|
117
|
-
}, f =
|
|
118
|
-
`[${
|
|
117
|
+
}, f = Ce(r), d = f.handleShown, m = o.querySelector(`[${ve}]`), C = o.querySelector(
|
|
118
|
+
`[${ge}]`
|
|
119
119
|
);
|
|
120
120
|
m?.addEventListener("click", () => {
|
|
121
121
|
f.requestClose(() => {
|
|
122
122
|
l = !0;
|
|
123
123
|
});
|
|
124
|
-
}),
|
|
124
|
+
}), C?.addEventListener("click", () => {
|
|
125
125
|
f.requestClose(() => {
|
|
126
126
|
l = !1;
|
|
127
127
|
});
|
|
@@ -133,7 +133,7 @@ function Ze(e, t) {
|
|
|
133
133
|
}
|
|
134
134
|
}) : (o.remove(), Promise.reject(new Error("Bootstrap Modal is unavailable.")));
|
|
135
135
|
}
|
|
136
|
-
const T = "data-haori-owned", h = "data-haori-message-container",
|
|
136
|
+
const T = "data-haori-owned", h = "data-haori-message-container", H = "data-haori-invalid-target", L = "data-haori-valid-target", S = "data-message-level", ot = /* @__PURE__ */ new Set([
|
|
137
137
|
"button",
|
|
138
138
|
"a",
|
|
139
139
|
"area",
|
|
@@ -155,28 +155,28 @@ function A(e) {
|
|
|
155
155
|
function M(e) {
|
|
156
156
|
return e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
return
|
|
158
|
+
function V(e) {
|
|
159
|
+
return ot.has(e.localName);
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Le(e) {
|
|
162
162
|
const t = e.nextElementSibling;
|
|
163
163
|
return t instanceof HTMLElement && t.getAttribute(h) === "true" ? t : void 0;
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function q(e) {
|
|
166
166
|
return Array.from(e.children).find(
|
|
167
167
|
(t) => t instanceof HTMLElement && t.getAttribute(h) === "true"
|
|
168
168
|
);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function Se(e, t) {
|
|
171
171
|
const n = e.createElement("div");
|
|
172
172
|
return n.setAttribute(T, "true"), n.textContent = t, n;
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
return
|
|
174
|
+
function ye(e) {
|
|
175
|
+
return V(e) ? Le(e) : q(e);
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Me(e, t) {
|
|
178
178
|
e.insertAdjacentElement(
|
|
179
|
-
|
|
179
|
+
V(e) ? "afterend" : "afterbegin",
|
|
180
180
|
t
|
|
181
181
|
);
|
|
182
182
|
}
|
|
@@ -190,7 +190,7 @@ function I(e) {
|
|
|
190
190
|
}
|
|
191
191
|
return [e];
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function rt(e) {
|
|
194
194
|
const [t, ...n] = e;
|
|
195
195
|
if (!t)
|
|
196
196
|
return;
|
|
@@ -201,50 +201,53 @@ function tt(e) {
|
|
|
201
201
|
o = o.parentElement;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function j(e) {
|
|
205
205
|
const n = I(e).map((o) => o.closest(".form-check")).filter((o) => o instanceof HTMLElement);
|
|
206
206
|
if (n.length > 1) {
|
|
207
|
-
const o =
|
|
207
|
+
const o = rt(n);
|
|
208
208
|
if (o && !n.includes(o))
|
|
209
209
|
return o;
|
|
210
210
|
}
|
|
211
|
-
return
|
|
211
|
+
return U(e);
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function U(e) {
|
|
214
214
|
const t = e.closest(".form-check");
|
|
215
215
|
return t instanceof HTMLElement ? t : void 0;
|
|
216
216
|
}
|
|
217
|
-
function
|
|
217
|
+
function Ie(e) {
|
|
218
218
|
const t = e.nextElementSibling;
|
|
219
219
|
if (t instanceof HTMLElement && t.getAttribute(h) === "true")
|
|
220
220
|
return t;
|
|
221
221
|
const n = document.createElement("div");
|
|
222
222
|
return n.className = "invalid-feedback d-block", n.setAttribute(T, "true"), n.setAttribute(h, "true"), e.insertAdjacentElement("afterend", n), n;
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const t = A(e) ?
|
|
224
|
+
function st(e) {
|
|
225
|
+
const t = A(e) ? j(e) : U(e);
|
|
226
226
|
if (!t)
|
|
227
|
-
return
|
|
228
|
-
const n =
|
|
227
|
+
return Ie(e);
|
|
228
|
+
const n = q(t);
|
|
229
229
|
if (n)
|
|
230
230
|
return n;
|
|
231
231
|
const o = document.createElement("div");
|
|
232
232
|
return o.className = "invalid-feedback d-block", o.setAttribute(T, "true"), o.setAttribute(h, "true"), t.appendChild(o), o;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
const t =
|
|
234
|
+
function it(e) {
|
|
235
|
+
const t = ye(e);
|
|
236
236
|
if (t)
|
|
237
237
|
return t;
|
|
238
238
|
const n = document.createElement("div");
|
|
239
|
-
return n.className = "alert alert-danger", n.setAttribute("role", "alert"), n.setAttribute(T, "true"), n.setAttribute(h, "true"),
|
|
239
|
+
return n.className = "alert alert-danger", n.setAttribute(S, "error"), n.setAttribute("role", "alert"), n.setAttribute(T, "true"), n.setAttribute(h, "true"), Me(e, n), n;
|
|
240
|
+
}
|
|
241
|
+
function J(e) {
|
|
242
|
+
e.classList.add("is-invalid"), e.setAttribute(H, "true"), e.setAttribute(S, "error");
|
|
240
243
|
}
|
|
241
244
|
function v(e) {
|
|
242
|
-
e.getAttribute(
|
|
245
|
+
e.getAttribute(H) === "true" && (e.classList.remove("is-invalid"), e.removeAttribute(H), e.removeAttribute(S));
|
|
243
246
|
}
|
|
244
247
|
function g(e) {
|
|
245
|
-
e.getAttribute(
|
|
248
|
+
e.getAttribute(L) === "true" && (e.classList.remove("is-valid"), e.removeAttribute(L));
|
|
246
249
|
}
|
|
247
|
-
function
|
|
250
|
+
function ne(e) {
|
|
248
251
|
switch (e) {
|
|
249
252
|
case "success":
|
|
250
253
|
return "alert alert-success";
|
|
@@ -256,82 +259,85 @@ function ee(e) {
|
|
|
256
259
|
return "alert alert-danger";
|
|
257
260
|
}
|
|
258
261
|
}
|
|
259
|
-
function
|
|
262
|
+
function oe(e, t) {
|
|
263
|
+
t === "success" || t === "warning" || t === "info" ? e.removeAttribute(S) : e.setAttribute(S, "error");
|
|
264
|
+
}
|
|
265
|
+
function R(e) {
|
|
260
266
|
return e === "success" ? "valid-feedback d-block" : "invalid-feedback d-block";
|
|
261
267
|
}
|
|
262
|
-
function
|
|
268
|
+
function ke(e) {
|
|
263
269
|
(A(e) ? I(e) : [e]).forEach((n) => {
|
|
264
|
-
|
|
270
|
+
J(n);
|
|
265
271
|
});
|
|
266
272
|
}
|
|
267
|
-
function
|
|
273
|
+
function at(e) {
|
|
268
274
|
(A(e) ? I(e) : [e]).forEach((n) => {
|
|
269
275
|
v(n);
|
|
270
276
|
});
|
|
271
277
|
}
|
|
272
|
-
function
|
|
278
|
+
function Ne(e, t) {
|
|
273
279
|
const n = e.nextElementSibling;
|
|
274
280
|
if (n instanceof HTMLElement && n.getAttribute(h) === "true")
|
|
275
|
-
return n.className =
|
|
281
|
+
return n.className = R(t), n;
|
|
276
282
|
const o = document.createElement("div");
|
|
277
|
-
return o.className =
|
|
283
|
+
return o.className = R(t), o.setAttribute(T, "true"), o.setAttribute(h, "true"), e.insertAdjacentElement("afterend", o), o;
|
|
278
284
|
}
|
|
279
|
-
function
|
|
280
|
-
const n = A(e) ?
|
|
285
|
+
function lt(e, t) {
|
|
286
|
+
const n = A(e) ? j(e) : U(e);
|
|
281
287
|
if (!n)
|
|
282
|
-
return
|
|
283
|
-
const o =
|
|
288
|
+
return Ne(e, t);
|
|
289
|
+
const o = q(n);
|
|
284
290
|
if (o)
|
|
285
|
-
return o.className =
|
|
291
|
+
return o.className = R(t), o;
|
|
286
292
|
const r = document.createElement("div");
|
|
287
|
-
return r.className =
|
|
293
|
+
return r.className = R(t), r.setAttribute(T, "true"), r.setAttribute(h, "true"), n.appendChild(r), r;
|
|
288
294
|
}
|
|
289
|
-
function
|
|
290
|
-
const n =
|
|
295
|
+
function ct(e, t) {
|
|
296
|
+
const n = ye(e);
|
|
291
297
|
if (n)
|
|
292
|
-
return n.className =
|
|
298
|
+
return n.className = ne(t), oe(n, t), n;
|
|
293
299
|
const o = document.createElement("div");
|
|
294
|
-
return o.className =
|
|
300
|
+
return o.className = ne(t), oe(o, t), o.setAttribute("role", "alert"), o.setAttribute(T, "true"), o.setAttribute(h, "true"), Me(e, o), o;
|
|
295
301
|
}
|
|
296
|
-
function
|
|
297
|
-
return (y(e) ?
|
|
302
|
+
function dt(e, t) {
|
|
303
|
+
return (y(e) ? st(e) : M(e) ? Ie(e) : it(e)).appendChild(Se(document, t)), y(e) ? ke(e) : M(e) && J(e), Promise.resolve();
|
|
298
304
|
}
|
|
299
|
-
function
|
|
300
|
-
if ((y(e) ?
|
|
305
|
+
function ut(e, t, n) {
|
|
306
|
+
if ((y(e) ? lt(e, n) : M(e) ? Ne(e, n) : ct(e, n)).appendChild(Se(document, t)), y(e)) {
|
|
301
307
|
const r = A(e) ? I(e) : [e];
|
|
302
308
|
n === "success" ? r.forEach((s) => {
|
|
303
|
-
v(s), s.classList.add("is-valid"), s.setAttribute(
|
|
304
|
-
}) : !n || n === "error" ? (r.forEach((s) => g(s)),
|
|
309
|
+
v(s), s.classList.add("is-valid"), s.setAttribute(L, "true");
|
|
310
|
+
}) : !n || n === "error" ? (r.forEach((s) => g(s)), ke(e)) : r.forEach((s) => {
|
|
305
311
|
g(s), v(s);
|
|
306
312
|
});
|
|
307
|
-
} else M(e) && (n === "success" ? (v(e), e.classList.add("is-valid"), e.setAttribute(
|
|
313
|
+
} else M(e) && (n === "success" ? (v(e), e.classList.add("is-valid"), e.setAttribute(L, "true")) : !n || n === "error" ? (g(e), J(e)) : (g(e), v(e)));
|
|
308
314
|
return Promise.resolve();
|
|
309
315
|
}
|
|
310
|
-
function
|
|
316
|
+
function He(e) {
|
|
311
317
|
if (y(e)) {
|
|
312
|
-
const r = A(e) ?
|
|
313
|
-
(r ?
|
|
318
|
+
const r = A(e) ? j(e) : U(e);
|
|
319
|
+
(r ? q(r) : void 0)?.remove(), at(e), (A(e) ? I(e) : [e]).forEach((l) => g(l));
|
|
314
320
|
} else if (M(e)) {
|
|
315
321
|
const r = e.nextElementSibling;
|
|
316
322
|
r instanceof HTMLElement && r.getAttribute(h) === "true" && r.remove(), v(e), g(e);
|
|
317
|
-
} else
|
|
323
|
+
} else V(e) && Le(e)?.remove();
|
|
318
324
|
return e.querySelectorAll(
|
|
319
325
|
`[${h}="true"]`
|
|
320
326
|
).forEach((r) => {
|
|
321
327
|
r.remove();
|
|
322
328
|
}), e.querySelectorAll(
|
|
323
|
-
`[${
|
|
329
|
+
`[${H}="true"]`
|
|
324
330
|
).forEach((r) => {
|
|
325
331
|
v(r);
|
|
326
332
|
}), e.querySelectorAll(
|
|
327
|
-
`[${
|
|
333
|
+
`[${L}="true"]`
|
|
328
334
|
).forEach((r) => {
|
|
329
335
|
g(r);
|
|
330
336
|
}), Promise.resolve();
|
|
331
337
|
}
|
|
332
|
-
const
|
|
333
|
-
let
|
|
334
|
-
const
|
|
338
|
+
const X = /* @__PURE__ */ new WeakSet(), ft = "data-haori-dismiss-lock", z = /* @__PURE__ */ new WeakSet();
|
|
339
|
+
let D = null, Q = /* @__PURE__ */ new WeakMap(), E = null, Y = !1;
|
|
340
|
+
const mt = [
|
|
335
341
|
"a",
|
|
336
342
|
"button",
|
|
337
343
|
"input",
|
|
@@ -341,39 +347,39 @@ const dt = [
|
|
|
341
347
|
"[tabindex]",
|
|
342
348
|
'[contenteditable="true"]'
|
|
343
349
|
].map((e) => `${e}:not([tabindex^="-"])`).join(",");
|
|
344
|
-
let
|
|
345
|
-
function
|
|
350
|
+
let _ = !1, G;
|
|
351
|
+
function Re(e) {
|
|
346
352
|
return Array.from(e.ownerDocument.querySelectorAll(".modal.show")).filter(
|
|
347
353
|
(t) => t !== e
|
|
348
354
|
);
|
|
349
355
|
}
|
|
350
|
-
function
|
|
351
|
-
return Array.from(e.querySelectorAll(
|
|
356
|
+
function bt(e) {
|
|
357
|
+
return Array.from(e.querySelectorAll(mt)).filter(
|
|
352
358
|
(t) => !t.hasAttribute("disabled") && !t.classList.contains("disabled") && (typeof t.checkVisibility != "function" || t.checkVisibility({ visibilityProperty: !0 }))
|
|
353
359
|
);
|
|
354
360
|
}
|
|
355
|
-
const
|
|
361
|
+
const De = (e) => {
|
|
356
362
|
const t = e.target;
|
|
357
|
-
if (t instanceof HTMLElement && (
|
|
363
|
+
if (t instanceof HTMLElement && (D = t), !E || !(t instanceof Element) || E.contains(t))
|
|
358
364
|
return;
|
|
359
|
-
const n =
|
|
360
|
-
n.length === 0 ? E.focus() :
|
|
361
|
-
},
|
|
362
|
-
e instanceof KeyboardEvent && e.key === "Tab" && (
|
|
363
|
-
},
|
|
365
|
+
const n = bt(E);
|
|
366
|
+
n.length === 0 ? E.focus() : Y ? n[n.length - 1].focus() : n[0].focus();
|
|
367
|
+
}, _e = (e) => {
|
|
368
|
+
e instanceof KeyboardEvent && e.key === "Tab" && (Y = e.shiftKey);
|
|
369
|
+
}, Be = (e) => {
|
|
364
370
|
if (!(e.target instanceof HTMLElement))
|
|
365
371
|
return;
|
|
366
372
|
const t = e.target;
|
|
367
|
-
|
|
368
|
-
},
|
|
373
|
+
X.add(t), E = null, D && Q.set(t, D);
|
|
374
|
+
}, xe = (e) => {
|
|
369
375
|
if (!(e.target instanceof HTMLElement))
|
|
370
376
|
return;
|
|
371
377
|
const t = e.target;
|
|
372
|
-
|
|
373
|
-
},
|
|
378
|
+
X.delete(t), t.getAttribute("data-bs-focus") !== "false" && Re(t).length > 0 && !t.contains(t.ownerDocument.activeElement) && t.focus();
|
|
379
|
+
}, Pe = (e) => {
|
|
374
380
|
if (!(e.target instanceof HTMLElement))
|
|
375
381
|
return;
|
|
376
|
-
const t = e.target, n =
|
|
382
|
+
const t = e.target, n = Q.get(t), o = Re(t);
|
|
377
383
|
if (o.length === 0) {
|
|
378
384
|
E = null;
|
|
379
385
|
return;
|
|
@@ -383,53 +389,53 @@ const ke = (e) => {
|
|
|
383
389
|
E = r.getAttribute("data-bs-focus") === "false" ? null : r;
|
|
384
390
|
const s = t.ownerDocument.activeElement;
|
|
385
391
|
o.some((a) => a.contains(s)) || n && o.some((a) => a.contains(n)) && (n.focus(), t.ownerDocument.activeElement === n) || r.focus();
|
|
386
|
-
},
|
|
392
|
+
}, Oe = (e) => {
|
|
387
393
|
const t = e.target;
|
|
388
|
-
t instanceof HTMLElement && t.hasAttribute(
|
|
394
|
+
t instanceof HTMLElement && t.hasAttribute(ft) && !z.has(t) && e.preventDefault();
|
|
389
395
|
};
|
|
390
|
-
function
|
|
391
|
-
|
|
396
|
+
function re(e, t) {
|
|
397
|
+
z.add(e);
|
|
392
398
|
try {
|
|
393
399
|
t.hide();
|
|
394
400
|
} finally {
|
|
395
|
-
|
|
401
|
+
z.delete(e);
|
|
396
402
|
}
|
|
397
403
|
}
|
|
398
|
-
function
|
|
399
|
-
|
|
404
|
+
function ht(e = document) {
|
|
405
|
+
_ || (_ = !0, G = e, e.addEventListener("focusin", De), e.addEventListener("keydown", _e), e.addEventListener("show.bs.modal", Be), e.addEventListener("shown.bs.modal", xe), e.addEventListener("hide.bs.modal", Oe), e.addEventListener("hidden.bs.modal", Pe));
|
|
400
406
|
}
|
|
401
|
-
function
|
|
402
|
-
|
|
407
|
+
function Et(e = G ?? document) {
|
|
408
|
+
_ && (_ = !1, e.removeEventListener("focusin", De), e.removeEventListener("keydown", _e), e.removeEventListener("show.bs.modal", Be), e.removeEventListener("shown.bs.modal", xe), e.removeEventListener("hide.bs.modal", Oe), e.removeEventListener("hidden.bs.modal", Pe), G = void 0, D = null, Q = /* @__PURE__ */ new WeakMap(), E = null, Y = !1);
|
|
403
409
|
}
|
|
404
|
-
function
|
|
410
|
+
function qe(e) {
|
|
405
411
|
return e.classList.contains("modal") ? e : e.closest(".modal");
|
|
406
412
|
}
|
|
407
|
-
function
|
|
413
|
+
function Ue(e) {
|
|
408
414
|
e.tabIndex < 0 && (e.tabIndex = -1), e.hasAttribute("aria-hidden") || e.setAttribute("aria-hidden", "true");
|
|
409
415
|
}
|
|
410
|
-
function
|
|
411
|
-
const n =
|
|
416
|
+
function pt(e, t) {
|
|
417
|
+
const n = qe(e);
|
|
412
418
|
if (!n)
|
|
413
419
|
return Promise.reject(new Error('No ancestor ".modal" element was found for the target.'));
|
|
414
|
-
|
|
415
|
-
const o =
|
|
420
|
+
Ue(n), He(n);
|
|
421
|
+
const o = O(n, void 0, t.bootstrap);
|
|
416
422
|
return o ? (o.show(), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
|
|
417
423
|
}
|
|
418
|
-
function
|
|
419
|
-
const n =
|
|
424
|
+
function vt(e, t) {
|
|
425
|
+
const n = qe(e);
|
|
420
426
|
if (!n)
|
|
421
427
|
return Promise.reject(new Error('No ancestor ".modal" element was found for the target.'));
|
|
422
|
-
|
|
423
|
-
const o =
|
|
424
|
-
return o ?
|
|
428
|
+
Ue(n);
|
|
429
|
+
const o = O(n, void 0, t.bootstrap);
|
|
430
|
+
return o ? X.has(n) ? (n.addEventListener(
|
|
425
431
|
"shown.bs.modal",
|
|
426
432
|
() => {
|
|
427
|
-
|
|
433
|
+
re(n, o);
|
|
428
434
|
},
|
|
429
435
|
{ once: !0 }
|
|
430
|
-
), Promise.resolve()) : (
|
|
436
|
+
), Promise.resolve()) : (re(n, o), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
|
|
431
437
|
}
|
|
432
|
-
const
|
|
438
|
+
const se = "data-haori-toast-container", gt = "data-haori-toast", At = "data-haori-toast-level", Tt = "data-haori-toast-accent", wt = "data-haori-toast-dismiss", ie = {
|
|
433
439
|
"top-start": "top-0 start-0",
|
|
434
440
|
"top-center": "top-0 start-50 translate-middle-x",
|
|
435
441
|
"top-end": "top-0 end-0",
|
|
@@ -437,7 +443,7 @@ const ne = "data-haori-toast-container", Et = "data-haori-toast", pt = "data-hao
|
|
|
437
443
|
"bottom-center": "bottom-0 start-50 translate-middle-x",
|
|
438
444
|
"bottom-end": "bottom-0 end-0"
|
|
439
445
|
};
|
|
440
|
-
function
|
|
446
|
+
function Ct(e) {
|
|
441
447
|
switch (e) {
|
|
442
448
|
case "success":
|
|
443
449
|
return { accentClassName: "bg-success", level: "success" };
|
|
@@ -449,7 +455,7 @@ function At(e) {
|
|
|
449
455
|
return { accentClassName: "bg-info", level: "info" };
|
|
450
456
|
}
|
|
451
457
|
}
|
|
452
|
-
function
|
|
458
|
+
function Lt(e, t) {
|
|
453
459
|
if (t.toastContainerSelector) {
|
|
454
460
|
const n = e.querySelector(
|
|
455
461
|
t.toastContainerSelector
|
|
@@ -459,29 +465,29 @@ function Tt(e, t) {
|
|
|
459
465
|
}
|
|
460
466
|
return e.body;
|
|
461
467
|
}
|
|
462
|
-
function
|
|
463
|
-
const n =
|
|
464
|
-
`[${
|
|
468
|
+
function St(e, t) {
|
|
469
|
+
const n = Lt(e, t), o = ie[t.toastPosition ?? "bottom-end"], r = n.querySelector(
|
|
470
|
+
`[${se}="true"]`
|
|
465
471
|
);
|
|
466
472
|
if (r) {
|
|
467
|
-
const a = Object.values(
|
|
473
|
+
const a = Object.values(ie).flatMap((l) => l.split(" "));
|
|
468
474
|
return r.classList.remove(...a), r.classList.add(...o.split(" ")), r;
|
|
469
475
|
}
|
|
470
476
|
const s = e.createElement("div");
|
|
471
|
-
return s.className = `toast-container position-fixed ${o} p-3`, s.setAttribute(
|
|
477
|
+
return s.className = `toast-container position-fixed ${o} p-3`, s.setAttribute(se, "true"), n.appendChild(s), s;
|
|
472
478
|
}
|
|
473
|
-
function
|
|
474
|
-
const o = globalThis.document, r =
|
|
475
|
-
s.className = "toast border bg-body text-body shadow-sm", s.setAttribute("role", "status"), s.setAttribute("aria-live", "polite"), s.setAttribute("aria-atomic", "true"), s.setAttribute(
|
|
479
|
+
function yt(e, t, n) {
|
|
480
|
+
const o = globalThis.document, r = Ct(t), s = o.createElement("div");
|
|
481
|
+
s.className = "toast border bg-body text-body shadow-sm", s.setAttribute("role", "status"), s.setAttribute("aria-live", "polite"), s.setAttribute("aria-atomic", "true"), s.setAttribute(gt, "true"), s.setAttribute(At, r.level);
|
|
476
482
|
const a = o.createElement("div");
|
|
477
483
|
a.className = "d-flex align-items-stretch";
|
|
478
484
|
const l = o.createElement("div");
|
|
479
|
-
l.className = `flex-shrink-0 rounded-start ${r.accentClassName}`, l.style.width = "0.375rem", l.setAttribute(
|
|
485
|
+
l.className = `flex-shrink-0 rounded-start ${r.accentClassName}`, l.style.width = "0.375rem", l.setAttribute(Tt, "true");
|
|
480
486
|
const u = o.createElement("div");
|
|
481
487
|
u.className = "toast-body", u.style.whiteSpace = "pre-line", u.textContent = e;
|
|
482
488
|
const c = o.createElement("button");
|
|
483
|
-
c.type = "button", c.className = "btn-close me-2 m-auto flex-shrink-0", c.setAttribute("aria-label", "Close"), c.setAttribute(
|
|
484
|
-
const f = n.toastDelay !== void 0 ? { delay: n.toastDelay } : void 0, d =
|
|
489
|
+
c.type = "button", c.className = "btn-close me-2 m-auto flex-shrink-0", c.setAttribute("aria-label", "Close"), c.setAttribute(wt, "true"), a.appendChild(l), a.appendChild(u), a.appendChild(c), s.appendChild(a), St(o, n).appendChild(s);
|
|
490
|
+
const f = n.toastDelay !== void 0 ? { delay: n.toastDelay } : void 0, d = je(s, f, n.bootstrap);
|
|
485
491
|
if (!d)
|
|
486
492
|
return s.remove(), Promise.reject(new Error("Bootstrap Toast is unavailable."));
|
|
487
493
|
c.addEventListener("click", () => {
|
|
@@ -499,20 +505,20 @@ function Ct(e, t, n) {
|
|
|
499
505
|
return s.remove(), d.dispose?.(), Promise.reject(m);
|
|
500
506
|
}
|
|
501
507
|
}
|
|
502
|
-
const
|
|
508
|
+
const Mt = {
|
|
503
509
|
options: {
|
|
504
510
|
fallbackToNative: !0
|
|
505
511
|
}
|
|
506
512
|
};
|
|
507
|
-
let b =
|
|
513
|
+
let b = Mt;
|
|
508
514
|
function w(e) {
|
|
509
515
|
return e ? String(e).replace(/\\n/g, `
|
|
510
516
|
`) : "";
|
|
511
517
|
}
|
|
512
|
-
function
|
|
518
|
+
function $e() {
|
|
513
519
|
return globalThis.window;
|
|
514
520
|
}
|
|
515
|
-
function
|
|
521
|
+
function Z(e) {
|
|
516
522
|
return Promise.resolve(e).then(() => {
|
|
517
523
|
});
|
|
518
524
|
}
|
|
@@ -523,34 +529,34 @@ function $(e) {
|
|
|
523
529
|
function F(e) {
|
|
524
530
|
console.warn(`[haori-bootstrap] ${e} skipped because Bootstrap support is unavailable.`);
|
|
525
531
|
}
|
|
526
|
-
function
|
|
532
|
+
function ae(e) {
|
|
527
533
|
const t = w(e), n = $("dialog");
|
|
528
534
|
if (n)
|
|
529
|
-
return
|
|
530
|
-
const o =
|
|
535
|
+
return Z(n(t));
|
|
536
|
+
const o = $e();
|
|
531
537
|
return b.options.fallbackToNative && typeof o?.alert == "function" ? (o.alert(t), Promise.resolve()) : (F("dialog"), Promise.resolve());
|
|
532
538
|
}
|
|
533
|
-
function
|
|
539
|
+
function le(e) {
|
|
534
540
|
const t = w(e), n = $("confirm");
|
|
535
541
|
if (n)
|
|
536
542
|
return Promise.resolve(n(t)).then(
|
|
537
543
|
(r) => !!r
|
|
538
544
|
);
|
|
539
|
-
const o =
|
|
545
|
+
const o = $e();
|
|
540
546
|
return b.options.fallbackToNative && typeof o?.confirm == "function" ? Promise.resolve(o.confirm(t)) : (F("confirm"), Promise.resolve(!1));
|
|
541
547
|
}
|
|
542
|
-
function
|
|
548
|
+
function ce(e, t) {
|
|
543
549
|
const n = w(e), o = $("toast");
|
|
544
|
-
return o ?
|
|
550
|
+
return o ? Z(o(n, t)) : (F("toast"), Promise.resolve());
|
|
545
551
|
}
|
|
546
|
-
function
|
|
552
|
+
function N(e, t) {
|
|
547
553
|
const n = $(e);
|
|
548
|
-
return n ?
|
|
554
|
+
return n ? Z(n(t)) : (F(e), Promise.resolve());
|
|
549
555
|
}
|
|
550
|
-
function
|
|
556
|
+
function It(e) {
|
|
551
557
|
b = e;
|
|
552
558
|
}
|
|
553
|
-
class
|
|
559
|
+
class kt {
|
|
554
560
|
/**
|
|
555
561
|
* 情報表示ダイアログを表示する。
|
|
556
562
|
*
|
|
@@ -559,9 +565,9 @@ class yt {
|
|
|
559
565
|
*/
|
|
560
566
|
static dialog(t) {
|
|
561
567
|
const n = w(t);
|
|
562
|
-
return
|
|
563
|
-
() =>
|
|
564
|
-
) :
|
|
568
|
+
return k(b.options.bootstrap) ? tt(n, b.options).catch(
|
|
569
|
+
() => ae(n)
|
|
570
|
+
) : ae(n);
|
|
565
571
|
}
|
|
566
572
|
/**
|
|
567
573
|
* 確認ダイアログを表示する。
|
|
@@ -571,9 +577,9 @@ class yt {
|
|
|
571
577
|
*/
|
|
572
578
|
static confirm(t) {
|
|
573
579
|
const n = w(t);
|
|
574
|
-
return
|
|
575
|
-
() =>
|
|
576
|
-
) :
|
|
580
|
+
return k(b.options.bootstrap) ? nt(n, b.options).catch(
|
|
581
|
+
() => le(n)
|
|
582
|
+
) : le(n);
|
|
577
583
|
}
|
|
578
584
|
/**
|
|
579
585
|
* トースト通知を表示する。
|
|
@@ -584,9 +590,9 @@ class yt {
|
|
|
584
590
|
*/
|
|
585
591
|
static toast(t, n) {
|
|
586
592
|
const o = w(t);
|
|
587
|
-
return
|
|
588
|
-
() =>
|
|
589
|
-
) :
|
|
593
|
+
return Ve(b.options.bootstrap) ? yt(o, n, b.options).catch(
|
|
594
|
+
() => ce(o, n)
|
|
595
|
+
) : ce(o, n);
|
|
590
596
|
}
|
|
591
597
|
/**
|
|
592
598
|
* 任意のダイアログ要素を開く。
|
|
@@ -595,9 +601,9 @@ class yt {
|
|
|
595
601
|
* @return 完了時に解決される Promise。
|
|
596
602
|
*/
|
|
597
603
|
static openDialog(t) {
|
|
598
|
-
return
|
|
599
|
-
() =>
|
|
600
|
-
) :
|
|
604
|
+
return k(b.options.bootstrap) ? pt(t, b.options).catch(
|
|
605
|
+
() => N("openDialog", t)
|
|
606
|
+
) : N("openDialog", t);
|
|
601
607
|
}
|
|
602
608
|
/**
|
|
603
609
|
* 任意のダイアログ要素を閉じる。
|
|
@@ -606,9 +612,9 @@ class yt {
|
|
|
606
612
|
* @return 完了時に解決される Promise。
|
|
607
613
|
*/
|
|
608
614
|
static closeDialog(t) {
|
|
609
|
-
return
|
|
610
|
-
() =>
|
|
611
|
-
) :
|
|
615
|
+
return k(b.options.bootstrap) ? vt(t, b.options).catch(
|
|
616
|
+
() => N("closeDialog", t)
|
|
617
|
+
) : N("closeDialog", t);
|
|
612
618
|
}
|
|
613
619
|
/**
|
|
614
620
|
* 管理対象のエラーメッセージを追加する。
|
|
@@ -618,7 +624,7 @@ class yt {
|
|
|
618
624
|
* @return 完了時に解決される Promise。
|
|
619
625
|
*/
|
|
620
626
|
static addErrorMessage(t, n) {
|
|
621
|
-
return
|
|
627
|
+
return dt(t, n);
|
|
622
628
|
}
|
|
623
629
|
/**
|
|
624
630
|
* 管理対象のメッセージをレベル付きで追加する。
|
|
@@ -629,7 +635,7 @@ class yt {
|
|
|
629
635
|
* @return 完了時に解決される Promise。
|
|
630
636
|
*/
|
|
631
637
|
static addMessage(t, n, o) {
|
|
632
|
-
return
|
|
638
|
+
return ut(t, n, o);
|
|
633
639
|
}
|
|
634
640
|
/**
|
|
635
641
|
* 管理対象のメッセージを削除する。
|
|
@@ -638,29 +644,29 @@ class yt {
|
|
|
638
644
|
* @return 完了時に解決される Promise。
|
|
639
645
|
*/
|
|
640
646
|
static clearMessages(t) {
|
|
641
|
-
return
|
|
647
|
+
return He(t);
|
|
642
648
|
}
|
|
643
649
|
}
|
|
644
|
-
const
|
|
645
|
-
let
|
|
646
|
-
function
|
|
647
|
-
return
|
|
650
|
+
const Nt = "haori-bootstrap:collapse:", B = "data-haori-persist";
|
|
651
|
+
let x = !1, P, K;
|
|
652
|
+
function Fe(e) {
|
|
653
|
+
return Nt + e;
|
|
648
654
|
}
|
|
649
|
-
function
|
|
655
|
+
function Ht(e) {
|
|
650
656
|
try {
|
|
651
|
-
const t = window.sessionStorage.getItem(
|
|
657
|
+
const t = window.sessionStorage.getItem(Fe(e));
|
|
652
658
|
return t === "shown" || t === "hidden" ? t : void 0;
|
|
653
659
|
} catch {
|
|
654
660
|
return;
|
|
655
661
|
}
|
|
656
662
|
}
|
|
657
|
-
function
|
|
663
|
+
function Rt(e, t) {
|
|
658
664
|
try {
|
|
659
|
-
window.sessionStorage.setItem(
|
|
665
|
+
window.sessionStorage.setItem(Fe(e), t);
|
|
660
666
|
} catch {
|
|
661
667
|
}
|
|
662
668
|
}
|
|
663
|
-
function
|
|
669
|
+
function de(e, t) {
|
|
664
670
|
const n = e.id, o = [`[data-bs-toggle="collapse"][data-bs-target="#${n}"]`];
|
|
665
671
|
if (n && o.push(`[data-bs-toggle="collapse"][href="#${n}"]`), !n)
|
|
666
672
|
return;
|
|
@@ -668,45 +674,45 @@ function ae(e, t) {
|
|
|
668
674
|
s.setAttribute("aria-expanded", t ? "true" : "false"), s.classList.toggle("collapsed", !t);
|
|
669
675
|
});
|
|
670
676
|
}
|
|
671
|
-
function
|
|
672
|
-
const t = e.getAttribute(
|
|
677
|
+
function ue(e) {
|
|
678
|
+
const t = e.getAttribute(B);
|
|
673
679
|
if (!t)
|
|
674
680
|
return;
|
|
675
|
-
const n =
|
|
681
|
+
const n = Ht(t);
|
|
676
682
|
if (!n)
|
|
677
683
|
return;
|
|
678
684
|
const o = e.classList.contains("show");
|
|
679
|
-
n === "shown" && !o ? (e.classList.add("show"),
|
|
685
|
+
n === "shown" && !o ? (e.classList.add("show"), de(e, !0)) : n === "hidden" && o && (e.classList.remove("show"), de(e, !1));
|
|
680
686
|
}
|
|
681
|
-
function
|
|
682
|
-
e instanceof HTMLElement && e.hasAttribute(
|
|
687
|
+
function fe(e) {
|
|
688
|
+
e instanceof HTMLElement && e.hasAttribute(B) && ue(e), e.querySelectorAll(`[${B}]`).forEach(ue);
|
|
683
689
|
}
|
|
684
|
-
function
|
|
690
|
+
function We(e, t) {
|
|
685
691
|
const n = e.target;
|
|
686
692
|
if (!(n instanceof HTMLElement))
|
|
687
693
|
return;
|
|
688
|
-
const o = n.getAttribute(
|
|
689
|
-
o &&
|
|
694
|
+
const o = n.getAttribute(B);
|
|
695
|
+
o && Rt(o, t);
|
|
690
696
|
}
|
|
691
|
-
const
|
|
692
|
-
function
|
|
693
|
-
if (
|
|
697
|
+
const ze = (e) => We(e, "shown"), Ge = (e) => We(e, "hidden");
|
|
698
|
+
function Dt(e = document) {
|
|
699
|
+
if (x)
|
|
694
700
|
return;
|
|
695
|
-
|
|
701
|
+
x = !0, K = e, e.addEventListener("shown.bs.collapse", ze), e.addEventListener("hidden.bs.collapse", Ge);
|
|
696
702
|
const t = () => {
|
|
697
|
-
|
|
703
|
+
fe(e), P = new MutationObserver((n) => {
|
|
698
704
|
for (const o of n)
|
|
699
705
|
o.addedNodes.forEach((r) => {
|
|
700
|
-
r instanceof HTMLElement &&
|
|
706
|
+
r instanceof HTMLElement && fe(r);
|
|
701
707
|
});
|
|
702
|
-
}), e.body &&
|
|
708
|
+
}), e.body && P.observe(e.body, { childList: !0, subtree: !0 });
|
|
703
709
|
};
|
|
704
710
|
e.body ? t() : e.addEventListener("DOMContentLoaded", t, { once: !0 });
|
|
705
711
|
}
|
|
706
|
-
function
|
|
707
|
-
|
|
712
|
+
function _t(e = K ?? document) {
|
|
713
|
+
x && (x = !1, e.removeEventListener("shown.bs.collapse", ze), e.removeEventListener("hidden.bs.collapse", Ge), P?.disconnect(), P = void 0, K = void 0);
|
|
708
714
|
}
|
|
709
|
-
const
|
|
715
|
+
const Bt = [
|
|
710
716
|
{
|
|
711
717
|
attribute: "dialog-ok-label",
|
|
712
718
|
apply: (e, t) => {
|
|
@@ -719,23 +725,23 @@ const Rt = [
|
|
|
719
725
|
e.dialogCancelLabel = t;
|
|
720
726
|
}
|
|
721
727
|
}
|
|
722
|
-
],
|
|
723
|
-
function
|
|
728
|
+
], xt = typeof document < "u" && document.currentScript instanceof HTMLScriptElement ? document.currentScript : null;
|
|
729
|
+
function W(e, t) {
|
|
724
730
|
const n = e?.getAttribute(t) ?? null;
|
|
725
731
|
if (!(n === null || n.trim() === ""))
|
|
726
732
|
return n;
|
|
727
733
|
}
|
|
728
|
-
function
|
|
734
|
+
function Pt(e = typeof document > "u" ? null : document, t = xt) {
|
|
729
735
|
const n = {};
|
|
730
|
-
for (const { attribute: o, apply: r } of
|
|
731
|
-
const s =
|
|
736
|
+
for (const { attribute: o, apply: r } of Bt) {
|
|
737
|
+
const s = W(t, `data-${o}`) ?? W(e?.documentElement ?? null, `data-haori-${o}`) ?? W(e?.body ?? null, `data-haori-${o}`);
|
|
732
738
|
s !== void 0 && r(n, s);
|
|
733
739
|
}
|
|
734
740
|
return n;
|
|
735
741
|
}
|
|
736
|
-
const
|
|
742
|
+
const ee = {
|
|
737
743
|
fallbackToNative: !0
|
|
738
|
-
},
|
|
744
|
+
}, me = /* @__PURE__ */ new Set([
|
|
739
745
|
"dialog",
|
|
740
746
|
"confirm",
|
|
741
747
|
"toast",
|
|
@@ -745,29 +751,29 @@ const Y = {
|
|
|
745
751
|
"addMessage",
|
|
746
752
|
"clearMessages"
|
|
747
753
|
]);
|
|
748
|
-
function
|
|
749
|
-
const t =
|
|
754
|
+
function Ot(e) {
|
|
755
|
+
const t = kt;
|
|
750
756
|
return new Proxy(e, {
|
|
751
757
|
get(n, o, r) {
|
|
752
|
-
return typeof o == "string" &&
|
|
758
|
+
return typeof o == "string" && me.has(o) ? t[o] : Reflect.get(n, o, r);
|
|
753
759
|
},
|
|
754
760
|
has(n, o) {
|
|
755
|
-
return typeof o == "string" &&
|
|
761
|
+
return typeof o == "string" && me.has(o) ? !0 : Reflect.has(n, o);
|
|
756
762
|
}
|
|
757
763
|
});
|
|
758
764
|
}
|
|
759
765
|
const i = {
|
|
760
766
|
installed: !1,
|
|
761
|
-
options:
|
|
767
|
+
options: ee
|
|
762
768
|
};
|
|
763
|
-
function
|
|
769
|
+
function te() {
|
|
764
770
|
return globalThis.window;
|
|
765
771
|
}
|
|
766
|
-
function
|
|
767
|
-
const n =
|
|
772
|
+
function qt(e, t) {
|
|
773
|
+
const n = Pt();
|
|
768
774
|
return {
|
|
769
775
|
bootstrap: e.bootstrap ?? t?.bootstrap,
|
|
770
|
-
fallbackToNative: e.fallbackToNative ??
|
|
776
|
+
fallbackToNative: e.fallbackToNative ?? ee.fallbackToNative,
|
|
771
777
|
runtime: e.runtime ?? i.options.runtime ?? t?.Haori?.runtime,
|
|
772
778
|
toastContainerSelector: e.toastContainerSelector ?? i.options.toastContainerSelector,
|
|
773
779
|
dialogContainerSelector: e.dialogContainerSelector ?? i.options.dialogContainerSelector,
|
|
@@ -778,68 +784,68 @@ function xt(e, t) {
|
|
|
778
784
|
toastDelay: e.toastDelay ?? i.options.toastDelay
|
|
779
785
|
};
|
|
780
786
|
}
|
|
781
|
-
function
|
|
787
|
+
function Ut(e = te()) {
|
|
782
788
|
return !!(e?.Haori && e.bootstrap);
|
|
783
789
|
}
|
|
784
|
-
function
|
|
785
|
-
const t =
|
|
790
|
+
function $t(e = {}) {
|
|
791
|
+
const t = te();
|
|
786
792
|
if (!t?.Haori)
|
|
787
793
|
throw new Error("window.Haori is required before calling install().");
|
|
788
|
-
if (i.originalHaori || (i.originalHaori = t.Haori, i.originalRuntime = t.Haori.runtime), i.options =
|
|
794
|
+
if (i.originalHaori || (i.originalHaori = t.Haori, i.originalRuntime = t.Haori.runtime), i.options = qt(e, t), i.options.runtime) {
|
|
789
795
|
const n = i.originalHaori ?? t.Haori;
|
|
790
796
|
typeof n.setRuntime == "function" ? n.setRuntime(i.options.runtime) : console.warn(
|
|
791
797
|
"[haori-bootstrap] Haori.setRuntime が利用できません。runtime 設定は無視されます。"
|
|
792
798
|
);
|
|
793
799
|
}
|
|
794
|
-
|
|
800
|
+
It({
|
|
795
801
|
originalHaori: i.originalHaori,
|
|
796
802
|
options: i.options
|
|
797
|
-
}), t.Haori =
|
|
803
|
+
}), t.Haori = Ot(i.originalHaori), Dt(), ht(), i.installed = !0;
|
|
798
804
|
}
|
|
799
|
-
function
|
|
800
|
-
const e =
|
|
805
|
+
function Kt() {
|
|
806
|
+
const e = te();
|
|
801
807
|
if (!e || !i.originalHaori)
|
|
802
808
|
return;
|
|
803
809
|
const t = i.originalHaori;
|
|
804
|
-
typeof t.setRuntime == "function" ? t.setRuntime(i.originalRuntime) : t.runtime = i.originalRuntime, e.Haori = i.originalHaori,
|
|
810
|
+
typeof t.setRuntime == "function" ? t.setRuntime(i.originalRuntime) : t.runtime = i.originalRuntime, e.Haori = i.originalHaori, _t(), Et(), i.installed = !1, i.originalHaori = void 0, i.originalRuntime = void 0, i.options = ee;
|
|
805
811
|
}
|
|
806
|
-
function
|
|
812
|
+
function Vt() {
|
|
807
813
|
return i.installed;
|
|
808
814
|
}
|
|
809
|
-
const
|
|
810
|
-
function
|
|
815
|
+
const Ke = "__haoriJsBootstrapAutoEnabled__";
|
|
816
|
+
function Ft() {
|
|
811
817
|
return globalThis.window;
|
|
812
818
|
}
|
|
813
|
-
function
|
|
814
|
-
return !!e[
|
|
819
|
+
function Wt(e) {
|
|
820
|
+
return !!e[Ke];
|
|
815
821
|
}
|
|
816
|
-
function
|
|
817
|
-
e[
|
|
822
|
+
function zt(e) {
|
|
823
|
+
e[Ke] = !0;
|
|
818
824
|
}
|
|
819
|
-
function
|
|
820
|
-
const e =
|
|
821
|
-
if (!(!e ||
|
|
822
|
-
if (!
|
|
825
|
+
function Gt() {
|
|
826
|
+
const e = Ft();
|
|
827
|
+
if (!(!e || Wt(e))) {
|
|
828
|
+
if (!Ut(e)) {
|
|
823
829
|
console.warn(
|
|
824
830
|
"[haori-bootstrap] Auto-enable skipped because window.Haori or window.bootstrap is missing."
|
|
825
831
|
);
|
|
826
832
|
return;
|
|
827
833
|
}
|
|
828
834
|
try {
|
|
829
|
-
|
|
835
|
+
$t({ bootstrap: e.bootstrap }), zt(e);
|
|
830
836
|
} catch (t) {
|
|
831
837
|
console.warn("[haori-bootstrap] Auto-enable failed.", t);
|
|
832
838
|
}
|
|
833
839
|
}
|
|
834
840
|
}
|
|
835
|
-
|
|
836
|
-
const
|
|
841
|
+
Gt();
|
|
842
|
+
const jt = "0.5.64";
|
|
837
843
|
export {
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
+
kt as BootstrapHaori,
|
|
845
|
+
Ut as hasAutoEnablePrerequisites,
|
|
846
|
+
$t as install,
|
|
847
|
+
Vt as isInstalled,
|
|
848
|
+
Kt as uninstall,
|
|
849
|
+
jt as version
|
|
844
850
|
};
|
|
845
851
|
//# sourceMappingURL=haori-bootstrap.js.map
|