haori-bootstrap 0.4.0 → 0.5.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 +36 -7
- package/README.md +37 -8
- package/dist/collapse_persist.d.ts +1 -1
- package/dist/haori-bootstrap.iife.js +2 -2
- package/dist/haori-bootstrap.iife.js.map +1 -1
- package/dist/haori-bootstrap.js +345 -345
- 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,114 +1,114 @@
|
|
|
1
|
-
function
|
|
1
|
+
function Z(e) {
|
|
2
2
|
return typeof e == "function";
|
|
3
3
|
}
|
|
4
|
+
function ee(e) {
|
|
5
|
+
return Z(e?.Modal) ? e?.Modal : void 0;
|
|
6
|
+
}
|
|
4
7
|
function te(e) {
|
|
5
|
-
return
|
|
8
|
+
return Z(e?.Toast) ? e?.Toast : void 0;
|
|
6
9
|
}
|
|
7
|
-
function
|
|
8
|
-
return ee(e
|
|
10
|
+
function L(e) {
|
|
11
|
+
return !!ee(e);
|
|
9
12
|
}
|
|
10
|
-
function
|
|
13
|
+
function Ae(e) {
|
|
11
14
|
return !!te(e);
|
|
12
15
|
}
|
|
13
|
-
function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
function
|
|
17
|
-
const n = te(o);
|
|
18
|
-
if (n)
|
|
19
|
-
return typeof n.getOrCreateInstance == "function" ? n.getOrCreateInstance(e, t) : new n(e, t);
|
|
16
|
+
function B(e, t, n) {
|
|
17
|
+
const o = ee(n);
|
|
18
|
+
if (o)
|
|
19
|
+
return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, t) : new o(e, t);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
return typeof
|
|
21
|
+
function ge(e, t, n) {
|
|
22
|
+
const o = te(n);
|
|
23
|
+
if (o)
|
|
24
|
+
return typeof o.getOrCreateInstance == "function" ? o.getOrCreateInstance(e, t) : new o(e, t);
|
|
25
25
|
}
|
|
26
|
-
const
|
|
27
|
-
let
|
|
28
|
-
function
|
|
26
|
+
const Ce = "data-haori-dialog", we = "data-haori-confirm", Se = "data-haori-dialog-title", ne = "data-haori-dialog-ok", oe = "data-haori-confirm-ok", re = "data-haori-confirm-cancel";
|
|
27
|
+
let ye = 0;
|
|
28
|
+
function ie() {
|
|
29
29
|
return {
|
|
30
30
|
backdrop: "static",
|
|
31
31
|
keyboard: !1
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function se(e, t) {
|
|
35
35
|
if (t.dialogContainerSelector) {
|
|
36
|
-
const
|
|
36
|
+
const n = e.querySelector(
|
|
37
37
|
t.dialogContainerSelector
|
|
38
38
|
);
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
39
|
+
if (n)
|
|
40
|
+
return n;
|
|
41
41
|
}
|
|
42
42
|
return e.body;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ae(e, t, n, o) {
|
|
45
45
|
const r = e.createElement("div");
|
|
46
|
-
r.className = "modal fade", r.tabIndex = -1, r.setAttribute(
|
|
47
|
-
const
|
|
48
|
-
|
|
46
|
+
r.className = "modal fade", r.tabIndex = -1, r.setAttribute(n ? we : Ce, "true"), r.setAttribute("aria-hidden", "true");
|
|
47
|
+
const i = e.createElement("div");
|
|
48
|
+
i.className = "modal-dialog modal-dialog-centered";
|
|
49
49
|
const c = e.createElement("div");
|
|
50
|
-
if (c.className = "modal-content",
|
|
51
|
-
const
|
|
52
|
-
|
|
50
|
+
if (c.className = "modal-content", o) {
|
|
51
|
+
const d = `haori-dialog-title-${++ye}`, h = e.createElement("div");
|
|
52
|
+
h.className = "modal-header";
|
|
53
53
|
const C = e.createElement("h5");
|
|
54
|
-
C.className = "modal-title", C.id =
|
|
54
|
+
C.className = "modal-title", C.id = d, C.setAttribute(Se, "true"), C.textContent = o, h.appendChild(C), c.appendChild(h), r.setAttribute("aria-labelledby", d);
|
|
55
55
|
}
|
|
56
56
|
const a = e.createElement("div");
|
|
57
57
|
a.className = "modal-body";
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const u = e.createElement("p");
|
|
59
|
+
u.className = "mb-0", u.style.whiteSpace = "pre-line", u.textContent = t, a.appendChild(u);
|
|
60
60
|
const l = e.createElement("div");
|
|
61
|
-
if (l.className = "modal-footer",
|
|
62
|
-
const
|
|
63
|
-
|
|
61
|
+
if (l.className = "modal-footer", n) {
|
|
62
|
+
const d = e.createElement("button");
|
|
63
|
+
d.type = "button", d.className = "btn btn-secondary", d.setAttribute(re, "true"), d.textContent = "Cancel", l.appendChild(d);
|
|
64
64
|
}
|
|
65
65
|
const m = e.createElement("button");
|
|
66
|
-
return m.type = "button", m.className = "btn btn-primary", m.setAttribute(
|
|
67
|
-
}
|
|
68
|
-
function
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const r =
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
return m.type = "button", m.className = "btn btn-primary", m.setAttribute(n ? oe : ne, "true"), m.textContent = "OK", l.appendChild(m), c.append(a, l), i.appendChild(c), r.appendChild(i), r;
|
|
67
|
+
}
|
|
68
|
+
function Ie(e, t) {
|
|
69
|
+
const n = globalThis.document, o = ae(n, e, !1, t.dialogTitle);
|
|
70
|
+
se(n, t).appendChild(o);
|
|
71
|
+
const r = B(
|
|
72
|
+
o,
|
|
73
|
+
ie(),
|
|
74
74
|
t.bootstrap
|
|
75
75
|
);
|
|
76
|
-
return r ? new Promise((
|
|
76
|
+
return r ? new Promise((i, c) => {
|
|
77
77
|
const a = () => {
|
|
78
|
-
|
|
79
|
-
},
|
|
78
|
+
o.removeEventListener("hidden.bs.modal", u), o.remove(), r.dispose?.(), i();
|
|
79
|
+
}, u = () => {
|
|
80
80
|
a();
|
|
81
81
|
};
|
|
82
|
-
|
|
82
|
+
o.querySelector(`[${ne}]`)?.addEventListener(
|
|
83
83
|
"click",
|
|
84
84
|
() => {
|
|
85
85
|
r.hide();
|
|
86
86
|
},
|
|
87
87
|
{ once: !0 }
|
|
88
|
-
),
|
|
88
|
+
), o.addEventListener("hidden.bs.modal", u, { once: !0 });
|
|
89
89
|
try {
|
|
90
90
|
r.show();
|
|
91
91
|
} catch (m) {
|
|
92
|
-
|
|
92
|
+
o.removeEventListener("hidden.bs.modal", u), o.remove(), r.dispose?.(), c(m);
|
|
93
93
|
}
|
|
94
|
-
}) : (
|
|
95
|
-
}
|
|
96
|
-
function
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
const r =
|
|
100
|
-
|
|
101
|
-
|
|
94
|
+
}) : (o.remove(), Promise.reject(new Error("Bootstrap Modal is unavailable.")));
|
|
95
|
+
}
|
|
96
|
+
function Le(e, t) {
|
|
97
|
+
const n = globalThis.document, o = ae(n, e, !0, t.dialogTitle);
|
|
98
|
+
se(n, t).appendChild(o);
|
|
99
|
+
const r = B(
|
|
100
|
+
o,
|
|
101
|
+
ie(),
|
|
102
102
|
t.bootstrap
|
|
103
103
|
);
|
|
104
|
-
return r ? new Promise((
|
|
104
|
+
return r ? new Promise((i, c) => {
|
|
105
105
|
let a = !1;
|
|
106
|
-
const
|
|
107
|
-
|
|
106
|
+
const u = () => {
|
|
107
|
+
o.removeEventListener("hidden.bs.modal", l), o.remove(), r.dispose?.(), i(a);
|
|
108
108
|
}, l = () => {
|
|
109
|
-
|
|
110
|
-
}, m =
|
|
111
|
-
`[${
|
|
109
|
+
u();
|
|
110
|
+
}, m = o.querySelector(`[${oe}]`), d = o.querySelector(
|
|
111
|
+
`[${re}]`
|
|
112
112
|
);
|
|
113
113
|
m?.addEventListener(
|
|
114
114
|
"click",
|
|
@@ -116,107 +116,107 @@ function Se(e, t) {
|
|
|
116
116
|
a = !0, r.hide();
|
|
117
117
|
},
|
|
118
118
|
{ once: !0 }
|
|
119
|
-
),
|
|
119
|
+
), d?.addEventListener(
|
|
120
120
|
"click",
|
|
121
121
|
() => {
|
|
122
122
|
a = !1, r.hide();
|
|
123
123
|
},
|
|
124
124
|
{ once: !0 }
|
|
125
|
-
),
|
|
125
|
+
), o.addEventListener("hidden.bs.modal", l, { once: !0 });
|
|
126
126
|
try {
|
|
127
127
|
r.show();
|
|
128
|
-
} catch (
|
|
129
|
-
|
|
128
|
+
} catch (h) {
|
|
129
|
+
o.removeEventListener("hidden.bs.modal", l), o.remove(), r.dispose?.(), c(h);
|
|
130
130
|
}
|
|
131
|
-
}) : (
|
|
131
|
+
}) : (o.remove(), Promise.reject(new Error("Bootstrap Modal is unavailable.")));
|
|
132
132
|
}
|
|
133
|
-
const T = "data-haori-
|
|
134
|
-
function
|
|
133
|
+
const T = "data-haori-owned", b = "data-haori-message-container", g = "data-haori-invalid-target", w = "data-haori-valid-target";
|
|
134
|
+
function S(e) {
|
|
135
135
|
return e instanceof HTMLInputElement && (e.type === "checkbox" || e.type === "radio");
|
|
136
136
|
}
|
|
137
137
|
function v(e) {
|
|
138
138
|
return e instanceof HTMLInputElement && e.type === "radio";
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function y(e) {
|
|
141
141
|
return e instanceof HTMLInputElement || e instanceof HTMLSelectElement || e instanceof HTMLTextAreaElement;
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function _(e) {
|
|
144
144
|
return Array.from(e.children).find(
|
|
145
145
|
(t) => t instanceof HTMLElement && t.getAttribute(b) === "true"
|
|
146
146
|
);
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
const
|
|
150
|
-
return
|
|
148
|
+
function ce(e, t) {
|
|
149
|
+
const n = e.createElement("div");
|
|
150
|
+
return n.setAttribute(T, "true"), n.textContent = t, n;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return
|
|
152
|
+
function le(e) {
|
|
153
|
+
return _(e);
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function I(e) {
|
|
156
156
|
if (e.name) {
|
|
157
|
-
const t = e.form ?? e.ownerDocument,
|
|
158
|
-
t.querySelectorAll(`input[type="radio"][name="${
|
|
157
|
+
const t = e.form ?? e.ownerDocument, n = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e.name) : e.name.replace(/(["\\])/g, "\\$1"), o = Array.from(
|
|
158
|
+
t.querySelectorAll(`input[type="radio"][name="${n}"]`)
|
|
159
159
|
);
|
|
160
|
-
if (
|
|
161
|
-
return
|
|
160
|
+
if (o.length > 0)
|
|
161
|
+
return o;
|
|
162
162
|
}
|
|
163
163
|
return [e];
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
const [t, ...
|
|
165
|
+
function Me(e) {
|
|
166
|
+
const [t, ...n] = e;
|
|
167
167
|
if (!t)
|
|
168
168
|
return;
|
|
169
|
-
let
|
|
170
|
-
for (;
|
|
171
|
-
if (
|
|
172
|
-
return
|
|
173
|
-
|
|
169
|
+
let o = t;
|
|
170
|
+
for (; o; ) {
|
|
171
|
+
if (n.every((r) => o?.contains(r)))
|
|
172
|
+
return o;
|
|
173
|
+
o = o.parentElement;
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
function
|
|
177
|
-
const
|
|
178
|
-
if (
|
|
179
|
-
const
|
|
180
|
-
if (
|
|
181
|
-
return
|
|
176
|
+
function O(e) {
|
|
177
|
+
const n = I(e).map((o) => o.closest(".form-check")).filter((o) => o instanceof HTMLElement);
|
|
178
|
+
if (n.length > 1) {
|
|
179
|
+
const o = Me(n);
|
|
180
|
+
if (o && !n.includes(o))
|
|
181
|
+
return o;
|
|
182
182
|
}
|
|
183
|
-
return
|
|
183
|
+
return x(e);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function x(e) {
|
|
186
186
|
const t = e.closest(".form-check");
|
|
187
187
|
return t instanceof HTMLElement ? t : void 0;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function de(e) {
|
|
190
190
|
const t = e.nextElementSibling;
|
|
191
191
|
if (t instanceof HTMLElement && t.getAttribute(b) === "true")
|
|
192
192
|
return t;
|
|
193
|
-
const
|
|
194
|
-
return
|
|
193
|
+
const n = document.createElement("div");
|
|
194
|
+
return n.className = "invalid-feedback d-block", n.setAttribute(T, "true"), n.setAttribute(b, "true"), e.insertAdjacentElement("afterend", n), n;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
197
|
-
const t = v(e) ?
|
|
196
|
+
function Ne(e) {
|
|
197
|
+
const t = v(e) ? O(e) : x(e);
|
|
198
198
|
if (!t)
|
|
199
|
-
return
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
return
|
|
203
|
-
const
|
|
204
|
-
return
|
|
199
|
+
return de(e);
|
|
200
|
+
const n = _(t);
|
|
201
|
+
if (n)
|
|
202
|
+
return n;
|
|
203
|
+
const o = document.createElement("div");
|
|
204
|
+
return o.className = "invalid-feedback d-block", o.setAttribute(T, "true"), o.setAttribute(b, "true"), t.appendChild(o), o;
|
|
205
205
|
}
|
|
206
|
-
function
|
|
207
|
-
const t =
|
|
206
|
+
function ke(e) {
|
|
207
|
+
const t = le(e);
|
|
208
208
|
if (t)
|
|
209
209
|
return t;
|
|
210
|
-
const
|
|
211
|
-
return
|
|
210
|
+
const n = document.createElement("div");
|
|
211
|
+
return n.className = "alert alert-danger", n.setAttribute("role", "alert"), n.setAttribute(T, "true"), n.setAttribute(b, "true"), e.insertAdjacentElement("afterbegin", n), n;
|
|
212
212
|
}
|
|
213
|
-
function
|
|
213
|
+
function p(e) {
|
|
214
214
|
e.getAttribute(g) === "true" && (e.classList.remove("is-invalid"), e.removeAttribute(g));
|
|
215
215
|
}
|
|
216
216
|
function E(e) {
|
|
217
|
-
e.getAttribute(
|
|
217
|
+
e.getAttribute(w) === "true" && (e.classList.remove("is-valid"), e.removeAttribute(w));
|
|
218
218
|
}
|
|
219
|
-
function
|
|
219
|
+
function z(e) {
|
|
220
220
|
switch (e) {
|
|
221
221
|
case "success":
|
|
222
222
|
return "alert alert-success";
|
|
@@ -228,64 +228,64 @@ function W(e) {
|
|
|
228
228
|
return "alert alert-danger";
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function N(e) {
|
|
232
232
|
return e === "success" ? "valid-feedback d-block" : "invalid-feedback d-block";
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
(v(e) ?
|
|
236
|
-
|
|
234
|
+
function ue(e) {
|
|
235
|
+
(v(e) ? I(e) : [e]).forEach((n) => {
|
|
236
|
+
n.classList.add("is-invalid"), n.setAttribute(g, "true");
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
(v(e) ?
|
|
241
|
-
|
|
239
|
+
function He(e) {
|
|
240
|
+
(v(e) ? I(e) : [e]).forEach((n) => {
|
|
241
|
+
p(n);
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
function
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
247
|
-
return
|
|
248
|
-
const
|
|
249
|
-
return
|
|
244
|
+
function fe(e, t) {
|
|
245
|
+
const n = e.nextElementSibling;
|
|
246
|
+
if (n instanceof HTMLElement && n.getAttribute(b) === "true")
|
|
247
|
+
return n.className = N(t), n;
|
|
248
|
+
const o = document.createElement("div");
|
|
249
|
+
return o.className = N(t), o.setAttribute(T, "true"), o.setAttribute(b, "true"), e.insertAdjacentElement("afterend", o), o;
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
const
|
|
253
|
-
if (!
|
|
254
|
-
return
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
return
|
|
251
|
+
function Re(e, t) {
|
|
252
|
+
const n = v(e) ? O(e) : x(e);
|
|
253
|
+
if (!n)
|
|
254
|
+
return fe(e, t);
|
|
255
|
+
const o = _(n);
|
|
256
|
+
if (o)
|
|
257
|
+
return o.className = N(t), o;
|
|
258
258
|
const r = document.createElement("div");
|
|
259
|
-
return r.className =
|
|
259
|
+
return r.className = N(t), r.setAttribute(T, "true"), r.setAttribute(b, "true"), n.appendChild(r), r;
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
const
|
|
263
|
-
if (
|
|
264
|
-
return
|
|
265
|
-
const
|
|
266
|
-
return
|
|
267
|
-
}
|
|
268
|
-
function
|
|
269
|
-
return (
|
|
270
|
-
}
|
|
271
|
-
function
|
|
272
|
-
if ((
|
|
273
|
-
const r = v(e) ?
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}) : !
|
|
277
|
-
E(
|
|
261
|
+
function Be(e, t) {
|
|
262
|
+
const n = le(e);
|
|
263
|
+
if (n)
|
|
264
|
+
return n.className = z(t), n;
|
|
265
|
+
const o = document.createElement("div");
|
|
266
|
+
return o.className = z(t), o.setAttribute("role", "alert"), o.setAttribute(T, "true"), o.setAttribute(b, "true"), e.insertAdjacentElement("afterbegin", o), o;
|
|
267
|
+
}
|
|
268
|
+
function _e(e, t) {
|
|
269
|
+
return (S(e) ? Ne(e) : y(e) ? de(e) : ke(e)).appendChild(ce(document, t)), S(e) ? ue(e) : y(e) && (e.classList.add("is-invalid"), e.setAttribute(g, "true")), Promise.resolve();
|
|
270
|
+
}
|
|
271
|
+
function xe(e, t, n) {
|
|
272
|
+
if ((S(e) ? Re(e, n) : y(e) ? fe(e, n) : Be(e, n)).appendChild(ce(document, t)), S(e)) {
|
|
273
|
+
const r = v(e) ? I(e) : [e];
|
|
274
|
+
n === "success" ? r.forEach((i) => {
|
|
275
|
+
p(i), i.classList.add("is-valid"), i.setAttribute(w, "true");
|
|
276
|
+
}) : !n || n === "error" ? (r.forEach((i) => E(i)), ue(e)) : r.forEach((i) => {
|
|
277
|
+
E(i), p(i);
|
|
278
278
|
});
|
|
279
|
-
} else
|
|
279
|
+
} else y(e) && (n === "success" ? (p(e), e.classList.add("is-valid"), e.setAttribute(w, "true")) : !n || n === "error" ? (E(e), e.classList.add("is-invalid"), e.setAttribute(g, "true")) : (E(e), p(e)));
|
|
280
280
|
return Promise.resolve();
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
if (
|
|
284
|
-
const r = v(e) ?
|
|
285
|
-
(r ?
|
|
286
|
-
} else if (
|
|
282
|
+
function De(e) {
|
|
283
|
+
if (S(e)) {
|
|
284
|
+
const r = v(e) ? O(e) : x(e);
|
|
285
|
+
(r ? _(r) : void 0)?.remove(), He(e), (v(e) ? I(e) : [e]).forEach((a) => E(a));
|
|
286
|
+
} else if (y(e)) {
|
|
287
287
|
const r = e.nextElementSibling;
|
|
288
|
-
r instanceof HTMLElement && r.getAttribute(b) === "true" && r.remove(),
|
|
288
|
+
r instanceof HTMLElement && r.getAttribute(b) === "true" && r.remove(), p(e), E(e);
|
|
289
289
|
}
|
|
290
290
|
return e.querySelectorAll(
|
|
291
291
|
`[${b}="true"]`
|
|
@@ -294,27 +294,27 @@ function Re(e) {
|
|
|
294
294
|
}), e.querySelectorAll(
|
|
295
295
|
`[${g}="true"]`
|
|
296
296
|
).forEach((r) => {
|
|
297
|
-
|
|
297
|
+
p(r);
|
|
298
298
|
}), e.querySelectorAll(
|
|
299
|
-
`[${
|
|
299
|
+
`[${w}="true"]`
|
|
300
300
|
).forEach((r) => {
|
|
301
301
|
E(r);
|
|
302
302
|
}), Promise.resolve();
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function me(e) {
|
|
305
305
|
e.classList.contains("modal") || e.classList.add("modal"), e.tabIndex < 0 && (e.tabIndex = -1), e.hasAttribute("aria-hidden") || e.setAttribute("aria-hidden", "true");
|
|
306
306
|
}
|
|
307
|
-
function xe(e, t) {
|
|
308
|
-
de(e);
|
|
309
|
-
const o = x(e, void 0, t.bootstrap);
|
|
310
|
-
return o ? (o.show(), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
|
|
311
|
-
}
|
|
312
307
|
function Pe(e, t) {
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
return
|
|
308
|
+
me(e);
|
|
309
|
+
const n = B(e, void 0, t.bootstrap);
|
|
310
|
+
return n ? (n.show(), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
|
|
311
|
+
}
|
|
312
|
+
function $e(e, t) {
|
|
313
|
+
me(e);
|
|
314
|
+
const n = B(e, void 0, t.bootstrap);
|
|
315
|
+
return n ? (n.hide(), Promise.resolve()) : Promise.reject(new Error("Bootstrap Modal is unavailable."));
|
|
316
316
|
}
|
|
317
|
-
const
|
|
317
|
+
const W = "data-haori-toast-container", Oe = "data-haori-toast", Ue = "data-haori-toast-level", qe = "data-haori-toast-accent", Fe = "data-haori-toast-dismiss", G = {
|
|
318
318
|
"top-start": "top-0 start-0",
|
|
319
319
|
"top-center": "top-0 start-50 translate-middle-x",
|
|
320
320
|
"top-end": "top-0 end-0",
|
|
@@ -322,118 +322,118 @@ const G = "data-haori-bootstrap-toast-container", De = "data-haori-bootstrap-toa
|
|
|
322
322
|
"bottom-center": "bottom-0 start-50 translate-middle-x",
|
|
323
323
|
"bottom-end": "bottom-0 end-0"
|
|
324
324
|
};
|
|
325
|
-
function
|
|
325
|
+
function ze(e) {
|
|
326
326
|
switch (e) {
|
|
327
327
|
case "success":
|
|
328
|
-
return { accentClassName: "bg-success" };
|
|
328
|
+
return { accentClassName: "bg-success", level: "success" };
|
|
329
329
|
case "warning":
|
|
330
|
-
return { accentClassName: "bg-warning" };
|
|
330
|
+
return { accentClassName: "bg-warning", level: "warning" };
|
|
331
331
|
case "error":
|
|
332
|
-
return { accentClassName: "bg-danger" };
|
|
332
|
+
return { accentClassName: "bg-danger", level: "error" };
|
|
333
333
|
default:
|
|
334
|
-
return { accentClassName: "bg-info" };
|
|
334
|
+
return { accentClassName: "bg-info", level: "info" };
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function We(e, t) {
|
|
338
338
|
if (t.toastContainerSelector) {
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
341
|
-
return
|
|
339
|
+
const n = e.querySelector(t.toastContainerSelector);
|
|
340
|
+
if (n)
|
|
341
|
+
return n;
|
|
342
342
|
}
|
|
343
343
|
return e.body;
|
|
344
344
|
}
|
|
345
|
-
function
|
|
346
|
-
const
|
|
347
|
-
`[${
|
|
345
|
+
function Ge(e, t) {
|
|
346
|
+
const n = We(e, t), o = G[t.toastPosition ?? "bottom-end"], r = n.querySelector(
|
|
347
|
+
`[${W}="true"]`
|
|
348
348
|
);
|
|
349
349
|
if (r) {
|
|
350
|
-
const c = Object.values(
|
|
351
|
-
return r.classList.remove(...c), r.classList.add(...
|
|
350
|
+
const c = Object.values(G).flatMap((a) => a.split(" "));
|
|
351
|
+
return r.classList.remove(...c), r.classList.add(...o.split(" ")), r;
|
|
352
352
|
}
|
|
353
|
-
const
|
|
354
|
-
return
|
|
353
|
+
const i = e.createElement("div");
|
|
354
|
+
return i.className = `toast-container position-fixed ${o} p-3`, i.setAttribute(W, "true"), n.appendChild(i), i;
|
|
355
355
|
}
|
|
356
|
-
function
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
const c =
|
|
356
|
+
function Ve(e, t, n) {
|
|
357
|
+
const o = globalThis.document, r = ze(t), i = o.createElement("div");
|
|
358
|
+
i.className = "toast border bg-body text-body shadow-sm", i.setAttribute("role", "status"), i.setAttribute("aria-live", "polite"), i.setAttribute("aria-atomic", "true"), i.setAttribute(Oe, "true"), i.setAttribute(Ue, r.level);
|
|
359
|
+
const c = o.createElement("div");
|
|
360
360
|
c.className = "d-flex align-items-stretch";
|
|
361
|
-
const a =
|
|
362
|
-
a.className = `flex-shrink-0 rounded-start ${r.accentClassName}`, a.style.width = "0.375rem", a.setAttribute(
|
|
363
|
-
const
|
|
364
|
-
|
|
365
|
-
const l =
|
|
366
|
-
l.type = "button", l.className = "btn-close me-2 m-auto flex-shrink-0", l.setAttribute("aria-label", "Close"), l.setAttribute(
|
|
367
|
-
const m =
|
|
368
|
-
if (!
|
|
369
|
-
return
|
|
361
|
+
const a = o.createElement("div");
|
|
362
|
+
a.className = `flex-shrink-0 rounded-start ${r.accentClassName}`, a.style.width = "0.375rem", a.setAttribute(qe, "true");
|
|
363
|
+
const u = o.createElement("div");
|
|
364
|
+
u.className = "toast-body", u.style.whiteSpace = "pre-line", u.textContent = e;
|
|
365
|
+
const l = o.createElement("button");
|
|
366
|
+
l.type = "button", l.className = "btn-close me-2 m-auto flex-shrink-0", l.setAttribute("aria-label", "Close"), l.setAttribute(Fe, "true"), c.appendChild(a), c.appendChild(u), c.appendChild(l), i.appendChild(c), Ge(o, n).appendChild(i);
|
|
367
|
+
const m = n.toastDelay !== void 0 ? { delay: n.toastDelay } : void 0, d = ge(i, m, n.bootstrap);
|
|
368
|
+
if (!d)
|
|
369
|
+
return i.remove(), Promise.reject(new Error("Bootstrap Toast is unavailable."));
|
|
370
370
|
l.addEventListener("click", () => {
|
|
371
|
-
|
|
372
|
-
}),
|
|
371
|
+
d.hide?.();
|
|
372
|
+
}), i.addEventListener(
|
|
373
373
|
"hidden.bs.toast",
|
|
374
374
|
() => {
|
|
375
|
-
|
|
375
|
+
i.remove(), d.dispose?.();
|
|
376
376
|
},
|
|
377
377
|
{ once: !0 }
|
|
378
378
|
);
|
|
379
379
|
try {
|
|
380
|
-
return
|
|
381
|
-
} catch (
|
|
382
|
-
return
|
|
380
|
+
return d.show(), Promise.resolve();
|
|
381
|
+
} catch (h) {
|
|
382
|
+
return i.remove(), d.dispose?.(), Promise.reject(h);
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
|
-
const
|
|
385
|
+
const Ke = {
|
|
386
386
|
options: {
|
|
387
387
|
fallbackToNative: !0
|
|
388
388
|
}
|
|
389
389
|
};
|
|
390
|
-
let f =
|
|
390
|
+
let f = Ke;
|
|
391
391
|
function A(e) {
|
|
392
392
|
return e.replace(/\\n/g, `
|
|
393
393
|
`);
|
|
394
394
|
}
|
|
395
|
-
function
|
|
395
|
+
function be() {
|
|
396
396
|
return globalThis.window;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function U(e) {
|
|
399
399
|
return Promise.resolve(e).then(() => {
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function D(e) {
|
|
403
403
|
const t = f.originalHaori?.[e];
|
|
404
404
|
return typeof t == "function" ? t : void 0;
|
|
405
405
|
}
|
|
406
|
-
function
|
|
406
|
+
function P(e) {
|
|
407
407
|
console.warn(`[haori-bootstrap] ${e} skipped because Bootstrap support is unavailable.`);
|
|
408
408
|
}
|
|
409
|
-
function
|
|
410
|
-
const t = A(e),
|
|
411
|
-
if (
|
|
412
|
-
return
|
|
413
|
-
const
|
|
414
|
-
return f.options.fallbackToNative && typeof
|
|
409
|
+
function V(e) {
|
|
410
|
+
const t = A(e), n = D("dialog");
|
|
411
|
+
if (n)
|
|
412
|
+
return U(n(t));
|
|
413
|
+
const o = be();
|
|
414
|
+
return f.options.fallbackToNative && typeof o?.alert == "function" ? (o.alert(t), Promise.resolve()) : (P("dialog"), Promise.resolve());
|
|
415
415
|
}
|
|
416
416
|
function K(e) {
|
|
417
|
-
const t = A(e),
|
|
418
|
-
if (
|
|
419
|
-
return Promise.resolve(
|
|
417
|
+
const t = A(e), n = D("confirm");
|
|
418
|
+
if (n)
|
|
419
|
+
return Promise.resolve(n(t)).then(
|
|
420
420
|
(r) => !!r
|
|
421
421
|
);
|
|
422
|
-
const
|
|
423
|
-
return f.options.fallbackToNative && typeof
|
|
422
|
+
const o = be();
|
|
423
|
+
return f.options.fallbackToNative && typeof o?.confirm == "function" ? Promise.resolve(o.confirm(t)) : (P("confirm"), Promise.resolve(!1));
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
const
|
|
427
|
-
return
|
|
425
|
+
function j(e, t) {
|
|
426
|
+
const n = A(e), o = D("toast");
|
|
427
|
+
return o ? U(o(n, t)) : (P("toast"), Promise.resolve());
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
const
|
|
431
|
-
return
|
|
429
|
+
function M(e, t) {
|
|
430
|
+
const n = D(e);
|
|
431
|
+
return n ? U(n(t)) : (P(e), Promise.resolve());
|
|
432
432
|
}
|
|
433
|
-
function
|
|
433
|
+
function je(e) {
|
|
434
434
|
f = e;
|
|
435
435
|
}
|
|
436
|
-
class
|
|
436
|
+
class Je {
|
|
437
437
|
/**
|
|
438
438
|
* 情報表示ダイアログを表示する。
|
|
439
439
|
*
|
|
@@ -441,8 +441,8 @@ class Ge {
|
|
|
441
441
|
* @return 完了時に解決される Promise。
|
|
442
442
|
*/
|
|
443
443
|
static dialog(t) {
|
|
444
|
-
const
|
|
445
|
-
return
|
|
444
|
+
const n = A(t);
|
|
445
|
+
return L(f.options.bootstrap) ? Ie(n, f.options).catch(() => V(n)) : V(n);
|
|
446
446
|
}
|
|
447
447
|
/**
|
|
448
448
|
* 確認ダイアログを表示する。
|
|
@@ -451,8 +451,8 @@ class Ge {
|
|
|
451
451
|
* @return OK のみ true を返す Promise。
|
|
452
452
|
*/
|
|
453
453
|
static confirm(t) {
|
|
454
|
-
const
|
|
455
|
-
return
|
|
454
|
+
const n = A(t);
|
|
455
|
+
return L(f.options.bootstrap) ? Le(n, f.options).catch(() => K(n)) : K(n);
|
|
456
456
|
}
|
|
457
457
|
/**
|
|
458
458
|
* トースト通知を表示する。
|
|
@@ -461,11 +461,11 @@ class Ge {
|
|
|
461
461
|
* @param level 通知レベル。
|
|
462
462
|
* @return 完了時に解決される Promise。
|
|
463
463
|
*/
|
|
464
|
-
static toast(t,
|
|
465
|
-
const
|
|
466
|
-
return
|
|
467
|
-
() =>
|
|
468
|
-
) :
|
|
464
|
+
static toast(t, n) {
|
|
465
|
+
const o = A(t);
|
|
466
|
+
return Ae(f.options.bootstrap) ? Ve(o, n, f.options).catch(
|
|
467
|
+
() => j(o, n)
|
|
468
|
+
) : j(o, n);
|
|
469
469
|
}
|
|
470
470
|
/**
|
|
471
471
|
* 任意のダイアログ要素を開く。
|
|
@@ -474,9 +474,9 @@ class Ge {
|
|
|
474
474
|
* @return 完了時に解決される Promise。
|
|
475
475
|
*/
|
|
476
476
|
static openDialog(t) {
|
|
477
|
-
return
|
|
478
|
-
() =>
|
|
479
|
-
) :
|
|
477
|
+
return L(f.options.bootstrap) ? Pe(t, f.options).catch(
|
|
478
|
+
() => M("openDialog", t)
|
|
479
|
+
) : M("openDialog", t);
|
|
480
480
|
}
|
|
481
481
|
/**
|
|
482
482
|
* 任意のダイアログ要素を閉じる。
|
|
@@ -485,9 +485,9 @@ class Ge {
|
|
|
485
485
|
* @return 完了時に解決される Promise。
|
|
486
486
|
*/
|
|
487
487
|
static closeDialog(t) {
|
|
488
|
-
return
|
|
489
|
-
() =>
|
|
490
|
-
) :
|
|
488
|
+
return L(f.options.bootstrap) ? $e(t, f.options).catch(
|
|
489
|
+
() => M("closeDialog", t)
|
|
490
|
+
) : M("closeDialog", t);
|
|
491
491
|
}
|
|
492
492
|
/**
|
|
493
493
|
* 管理対象のエラーメッセージを追加する。
|
|
@@ -496,8 +496,8 @@ class Ge {
|
|
|
496
496
|
* @param message 表示するメッセージ。
|
|
497
497
|
* @return 完了時に解決される Promise。
|
|
498
498
|
*/
|
|
499
|
-
static addErrorMessage(t,
|
|
500
|
-
return
|
|
499
|
+
static addErrorMessage(t, n) {
|
|
500
|
+
return _e(t, n);
|
|
501
501
|
}
|
|
502
502
|
/**
|
|
503
503
|
* 管理対象のメッセージをレベル付きで追加する。
|
|
@@ -507,8 +507,8 @@ class Ge {
|
|
|
507
507
|
* @param level メッセージレベル (error / success / warning / info)。省略時は error。
|
|
508
508
|
* @return 完了時に解決される Promise。
|
|
509
509
|
*/
|
|
510
|
-
static addMessage(t,
|
|
511
|
-
return
|
|
510
|
+
static addMessage(t, n, o) {
|
|
511
|
+
return xe(t, n, o);
|
|
512
512
|
}
|
|
513
513
|
/**
|
|
514
514
|
* 管理対象のメッセージを削除する。
|
|
@@ -517,77 +517,77 @@ class Ge {
|
|
|
517
517
|
* @return 完了時に解決される Promise。
|
|
518
518
|
*/
|
|
519
519
|
static clearMessages(t) {
|
|
520
|
-
return
|
|
520
|
+
return De(t);
|
|
521
521
|
}
|
|
522
522
|
}
|
|
523
|
-
const
|
|
524
|
-
let
|
|
525
|
-
function
|
|
526
|
-
return
|
|
523
|
+
const Xe = "haori-bootstrap:collapse:", k = "data-haori-persist";
|
|
524
|
+
let H = !1, R, $;
|
|
525
|
+
function he(e) {
|
|
526
|
+
return Xe + e;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Qe(e) {
|
|
529
529
|
try {
|
|
530
|
-
const t = window.sessionStorage.getItem(
|
|
530
|
+
const t = window.sessionStorage.getItem(he(e));
|
|
531
531
|
return t === "shown" || t === "hidden" ? t : void 0;
|
|
532
532
|
} catch {
|
|
533
533
|
return;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function Ye(e, t) {
|
|
537
537
|
try {
|
|
538
|
-
window.sessionStorage.setItem(
|
|
538
|
+
window.sessionStorage.setItem(he(e), t);
|
|
539
539
|
} catch {
|
|
540
540
|
}
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
542
|
+
function J(e, t) {
|
|
543
|
+
const n = e.id, o = [`[data-bs-toggle="collapse"][data-bs-target="#${n}"]`];
|
|
544
|
+
if (n && o.push(`[data-bs-toggle="collapse"][href="#${n}"]`), !n)
|
|
545
545
|
return;
|
|
546
|
-
e.ownerDocument.querySelectorAll(
|
|
547
|
-
|
|
546
|
+
e.ownerDocument.querySelectorAll(o.join(",")).forEach((i) => {
|
|
547
|
+
i.setAttribute("aria-expanded", t ? "true" : "false"), i.classList.toggle("collapsed", !t);
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
|
-
function
|
|
551
|
-
const t = e.getAttribute(
|
|
550
|
+
function X(e) {
|
|
551
|
+
const t = e.getAttribute(k);
|
|
552
552
|
if (!t)
|
|
553
553
|
return;
|
|
554
|
-
const
|
|
555
|
-
if (!
|
|
554
|
+
const n = Qe(t);
|
|
555
|
+
if (!n)
|
|
556
556
|
return;
|
|
557
|
-
const
|
|
558
|
-
|
|
557
|
+
const o = e.classList.contains("show");
|
|
558
|
+
n === "shown" && !o ? (e.classList.add("show"), J(e, !0)) : n === "hidden" && o && (e.classList.remove("show"), J(e, !1));
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
e instanceof HTMLElement && e.hasAttribute(
|
|
560
|
+
function Q(e) {
|
|
561
|
+
e instanceof HTMLElement && e.hasAttribute(k) && X(e), e.querySelectorAll(`[${k}]`).forEach(X);
|
|
562
562
|
}
|
|
563
|
-
function
|
|
564
|
-
const
|
|
565
|
-
if (!(
|
|
563
|
+
function pe(e, t) {
|
|
564
|
+
const n = e.target;
|
|
565
|
+
if (!(n instanceof HTMLElement))
|
|
566
566
|
return;
|
|
567
|
-
const
|
|
568
|
-
|
|
567
|
+
const o = n.getAttribute(k);
|
|
568
|
+
o && Ye(o, t);
|
|
569
569
|
}
|
|
570
|
-
const
|
|
571
|
-
function
|
|
572
|
-
if (
|
|
570
|
+
const Ee = (e) => pe(e, "shown"), ve = (e) => pe(e, "hidden");
|
|
571
|
+
function Ze(e = document) {
|
|
572
|
+
if (H)
|
|
573
573
|
return;
|
|
574
|
-
|
|
574
|
+
H = !0, $ = e, e.addEventListener("shown.bs.collapse", Ee), e.addEventListener("hidden.bs.collapse", ve);
|
|
575
575
|
const t = () => {
|
|
576
|
-
|
|
577
|
-
for (const
|
|
578
|
-
|
|
579
|
-
r instanceof HTMLElement &&
|
|
576
|
+
Q(e), R = new MutationObserver((n) => {
|
|
577
|
+
for (const o of n)
|
|
578
|
+
o.addedNodes.forEach((r) => {
|
|
579
|
+
r instanceof HTMLElement && Q(r);
|
|
580
580
|
});
|
|
581
581
|
}), e.body && R.observe(e.body, { childList: !0, subtree: !0 });
|
|
582
582
|
};
|
|
583
583
|
e.body ? t() : e.addEventListener("DOMContentLoaded", t, { once: !0 });
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
|
|
585
|
+
function et(e = $ ?? document) {
|
|
586
|
+
H && (H = !1, e.removeEventListener("shown.bs.collapse", Ee), e.removeEventListener("hidden.bs.collapse", ve), R?.disconnect(), R = void 0, $ = void 0);
|
|
587
587
|
}
|
|
588
|
-
const
|
|
588
|
+
const q = {
|
|
589
589
|
fallbackToNative: !0
|
|
590
|
-
},
|
|
590
|
+
}, Y = /* @__PURE__ */ new Set([
|
|
591
591
|
"dialog",
|
|
592
592
|
"confirm",
|
|
593
593
|
"toast",
|
|
@@ -597,98 +597,98 @@ const F = {
|
|
|
597
597
|
"addMessage",
|
|
598
598
|
"clearMessages"
|
|
599
599
|
]);
|
|
600
|
-
function
|
|
601
|
-
const t =
|
|
600
|
+
function tt(e) {
|
|
601
|
+
const t = Je;
|
|
602
602
|
return new Proxy(e, {
|
|
603
|
-
get(
|
|
604
|
-
return typeof
|
|
603
|
+
get(n, o, r) {
|
|
604
|
+
return typeof o == "string" && Y.has(o) ? t[o] : Reflect.get(n, o, r);
|
|
605
605
|
},
|
|
606
|
-
has(
|
|
607
|
-
return typeof
|
|
606
|
+
has(n, o) {
|
|
607
|
+
return typeof o == "string" && Y.has(o) ? !0 : Reflect.has(n, o);
|
|
608
608
|
}
|
|
609
609
|
});
|
|
610
610
|
}
|
|
611
|
-
const
|
|
611
|
+
const s = {
|
|
612
612
|
installed: !1,
|
|
613
|
-
options:
|
|
613
|
+
options: q
|
|
614
614
|
};
|
|
615
|
-
function
|
|
615
|
+
function F() {
|
|
616
616
|
return globalThis.window;
|
|
617
617
|
}
|
|
618
|
-
function
|
|
618
|
+
function nt(e, t) {
|
|
619
619
|
return {
|
|
620
620
|
bootstrap: e.bootstrap ?? t?.bootstrap,
|
|
621
|
-
fallbackToNative: e.fallbackToNative ??
|
|
622
|
-
runtime: e.runtime ??
|
|
623
|
-
toastContainerSelector: e.toastContainerSelector ??
|
|
624
|
-
dialogContainerSelector: e.dialogContainerSelector ??
|
|
625
|
-
dialogTitle: e.dialogTitle ??
|
|
626
|
-
toastPosition: e.toastPosition ??
|
|
627
|
-
toastDelay: e.toastDelay ??
|
|
621
|
+
fallbackToNative: e.fallbackToNative ?? q.fallbackToNative,
|
|
622
|
+
runtime: e.runtime ?? s.options.runtime ?? t?.Haori?.runtime,
|
|
623
|
+
toastContainerSelector: e.toastContainerSelector ?? s.options.toastContainerSelector,
|
|
624
|
+
dialogContainerSelector: e.dialogContainerSelector ?? s.options.dialogContainerSelector,
|
|
625
|
+
dialogTitle: e.dialogTitle ?? s.options.dialogTitle,
|
|
626
|
+
toastPosition: e.toastPosition ?? s.options.toastPosition,
|
|
627
|
+
toastDelay: e.toastDelay ?? s.options.toastDelay
|
|
628
628
|
};
|
|
629
629
|
}
|
|
630
|
-
function
|
|
630
|
+
function ot(e = F()) {
|
|
631
631
|
return !!(e?.Haori && e.bootstrap);
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
const t =
|
|
633
|
+
function rt(e = {}) {
|
|
634
|
+
const t = F();
|
|
635
635
|
if (!t?.Haori)
|
|
636
636
|
throw new Error("window.Haori is required before calling install().");
|
|
637
|
-
if (
|
|
638
|
-
const
|
|
639
|
-
typeof
|
|
637
|
+
if (s.originalHaori || (s.originalHaori = t.Haori, s.originalRuntime = t.Haori.runtime), s.options = nt(e, t), s.options.runtime) {
|
|
638
|
+
const n = s.originalHaori ?? t.Haori;
|
|
639
|
+
typeof n.setRuntime == "function" ? n.setRuntime(s.options.runtime) : console.warn(
|
|
640
640
|
"[haori-bootstrap] Haori.setRuntime が利用できません。runtime 設定は無視されます。"
|
|
641
641
|
);
|
|
642
642
|
}
|
|
643
|
-
|
|
644
|
-
originalHaori:
|
|
645
|
-
options:
|
|
646
|
-
}), t.Haori =
|
|
647
|
-
}
|
|
648
|
-
function
|
|
649
|
-
const e =
|
|
650
|
-
if (!e || !
|
|
643
|
+
je({
|
|
644
|
+
originalHaori: s.originalHaori,
|
|
645
|
+
options: s.options
|
|
646
|
+
}), t.Haori = tt(s.originalHaori), Ze(), s.installed = !0;
|
|
647
|
+
}
|
|
648
|
+
function lt() {
|
|
649
|
+
const e = F();
|
|
650
|
+
if (!e || !s.originalHaori)
|
|
651
651
|
return;
|
|
652
|
-
const t =
|
|
653
|
-
typeof t.setRuntime == "function" ? t.setRuntime(
|
|
652
|
+
const t = s.originalHaori;
|
|
653
|
+
typeof t.setRuntime == "function" ? t.setRuntime(s.originalRuntime) : t.runtime = s.originalRuntime, e.Haori = s.originalHaori, et(), s.installed = !1, s.originalHaori = void 0, s.originalRuntime = void 0, s.options = q;
|
|
654
654
|
}
|
|
655
|
-
function
|
|
656
|
-
return
|
|
655
|
+
function dt() {
|
|
656
|
+
return s.installed;
|
|
657
657
|
}
|
|
658
|
-
const
|
|
659
|
-
function
|
|
658
|
+
const Te = "__haoriJsBootstrapAutoEnabled__";
|
|
659
|
+
function it() {
|
|
660
660
|
return globalThis.window;
|
|
661
661
|
}
|
|
662
|
-
function
|
|
663
|
-
return !!e[
|
|
662
|
+
function st(e) {
|
|
663
|
+
return !!e[Te];
|
|
664
664
|
}
|
|
665
|
-
function
|
|
666
|
-
e[
|
|
665
|
+
function at(e) {
|
|
666
|
+
e[Te] = !0;
|
|
667
667
|
}
|
|
668
|
-
function
|
|
669
|
-
const e =
|
|
670
|
-
if (!(!e ||
|
|
671
|
-
if (!
|
|
668
|
+
function ct() {
|
|
669
|
+
const e = it();
|
|
670
|
+
if (!(!e || st(e))) {
|
|
671
|
+
if (!ot(e)) {
|
|
672
672
|
console.warn(
|
|
673
673
|
"[haori-bootstrap] Auto-enable skipped because window.Haori or window.bootstrap is missing."
|
|
674
674
|
);
|
|
675
675
|
return;
|
|
676
676
|
}
|
|
677
677
|
try {
|
|
678
|
-
|
|
678
|
+
rt({ bootstrap: e.bootstrap }), at(e);
|
|
679
679
|
} catch (t) {
|
|
680
680
|
console.warn("[haori-bootstrap] Auto-enable failed.", t);
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
|
|
685
|
-
const
|
|
684
|
+
ct();
|
|
685
|
+
const ut = "0.5.0";
|
|
686
686
|
export {
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
687
|
+
Je as BootstrapHaori,
|
|
688
|
+
ot as hasAutoEnablePrerequisites,
|
|
689
|
+
rt as install,
|
|
690
|
+
dt as isInstalled,
|
|
691
|
+
lt as uninstall,
|
|
692
|
+
ut as version
|
|
693
693
|
};
|
|
694
694
|
//# sourceMappingURL=haori-bootstrap.js.map
|