react-luminus-components 1.1.20 → 1.1.22
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.md +2 -0
- package/dist/.vite/manifest.json +43 -43
- package/dist/{DataKey-Chc9JWBN.js → DataKey-B7CWQXvv.js} +1 -1
- package/dist/{DataKey-dhQX8cMa.cjs → DataKey-DVMbPWFY.cjs} +1 -1
- package/dist/{SimpleTooltip-CfoOF2bC.cjs → SimpleTooltip-D91sCKFo.cjs} +1 -1
- package/dist/{SimpleTooltip-Cs6KsWMk.js → SimpleTooltip-Dk1A5Tpg.js} +2 -2
- package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +12 -0
- package/dist/components/Buttons/index.d.ts +1 -0
- package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +6 -0
- package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +12 -0
- package/dist/components/Dropdown/comps/index.d.ts +2 -0
- package/dist/components/Dropdown/index.d.ts +1 -1
- package/dist/components/Form/TextInput/TextInput.d.ts +2 -1
- package/dist/components/common/Collapse/Collapse.d.ts +14 -2
- package/dist/components/common/PromptDialog/PromptDialog.d.ts +3 -0
- package/dist/components/common/SimplePicker/SimplePicker.d.ts +2 -1
- package/dist/components/common/Typography/Typography.d.ts +1 -1
- package/dist/contexts/prompt/PromptContext.d.ts +10 -0
- package/dist/contexts/prompt/PromptProvider.d.ts +6 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +405 -368
- package/dist/{hasClass-D2q3Otcv.js → hasClass-DIHyDa4e.js} +237 -233
- package/dist/hasClass-DjB0wTmj.cjs +20 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/usePrompt/usePrompt.d.ts +7 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +6 -5
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +3 -3
- package/dist/main.cjs.js +1 -1
- package/dist/main.d.ts +2 -2
- package/dist/main.es.js +1161 -1119
- package/dist/models/texts/ConfirmTexts.d.ts +2 -0
- package/dist/style.css +1 -1
- package/dist/{useAxios-Ce32mjz9.cjs → useAxios-B4X7zKtj.cjs} +36 -36
- package/dist/{useAxios-D-fCu46c.js → useAxios-CHbKHRpj.js} +195 -181
- package/dist/useConfirm-CrTJszXF.cjs +1 -0
- package/dist/useConfirm-CyietOP-.js +27 -0
- package/package.json +1 -1
- package/dist/hasClass-Dg19NteG.cjs +0 -20
- package/dist/useConfirm-BM62r8mq.cjs +0 -1
- package/dist/useConfirm-CTpbtdnu.js +0 -18
package/dist/contexts.es.js
CHANGED
|
@@ -1,116 +1,50 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { u as yt } from "./
|
|
6
|
-
import {
|
|
1
|
+
import { j as r, d as x, L as Ce, P as tt, C as ot, I as nt, e as st, b as rt, U as at } from "./useAxios-CHbKHRpj.js";
|
|
2
|
+
import * as v from "react";
|
|
3
|
+
import { forwardRef as it, useState as p, useRef as E, useImperativeHandle as lt, useEffect as re, useCallback as m, useContext as be, useMemo as $ } from "react";
|
|
4
|
+
import { a as dt, u as ct } from "./useConfirm-CyietOP-.js";
|
|
5
|
+
import { P as ve, c as Ee, o as Fe, s as G, u as De, a as ut, b as ft, d as b, l as Re, e as ke, f as Ie, i as ht, r as Se, h as mt, g as W, j as gt, k as pt, m as vt, n as Oe, F as $e, p as yt, t as xt, T as wt } from "./hasClass-DIHyDa4e.js";
|
|
6
|
+
import { d as Ct, u as bt, q as D, L as Et } from "./DataKey-B7CWQXvv.js";
|
|
7
7
|
import Mt from "react-dom";
|
|
8
|
-
const
|
|
9
|
-
const [e, o] = M(!1), [n, s] = M(""), r = m((h) => {
|
|
10
|
-
o(!0), s(h);
|
|
11
|
-
}, []), u = m(() => {
|
|
12
|
-
o(!1);
|
|
13
|
-
}, []), d = G(() => ({ show: e, text: n, showConfirm: r, hideConfirm: u }), [e, n, r, u]);
|
|
14
|
-
return /* @__PURE__ */ a.jsxs(tt.Provider, { value: d, children: [
|
|
15
|
-
/* @__PURE__ */ a.jsx(Xt, {}),
|
|
16
|
-
t
|
|
17
|
-
] });
|
|
18
|
-
}, to = ({ axiosInstance: t, LinkComponent: e, language: o, axiosTexts: n, confirmTexts: s, formValidationTexts: r, homeDashboardTexts: u, formSubmitTexts: d, children: h }) => {
|
|
19
|
-
const p = G(() => ({
|
|
20
|
-
axiosInstance: t,
|
|
21
|
-
LinkComponent: e,
|
|
22
|
-
language: o,
|
|
23
|
-
axiosTexts: n,
|
|
24
|
-
confirmTexts: s,
|
|
25
|
-
formValidationTexts: r,
|
|
26
|
-
homeDashboardTexts: u,
|
|
27
|
-
formSubmitTexts: d
|
|
28
|
-
}), [
|
|
29
|
-
t,
|
|
30
|
-
e,
|
|
31
|
-
o,
|
|
32
|
-
n,
|
|
33
|
-
s,
|
|
34
|
-
r,
|
|
35
|
-
u,
|
|
36
|
-
d
|
|
37
|
-
]);
|
|
38
|
-
return /* @__PURE__ */ a.jsx(Ae.Provider, { value: p, children: /* @__PURE__ */ a.jsxs(xt, { children: [
|
|
39
|
-
/* @__PURE__ */ a.jsx(ot, {}),
|
|
40
|
-
h
|
|
41
|
-
] }) });
|
|
42
|
-
}, oo = ({ children: t }) => {
|
|
43
|
-
const [e, o] = M(!1), [n] = M(/* @__PURE__ */ new Set()), s = m((d) => {
|
|
44
|
-
n.add(d), o(!0);
|
|
45
|
-
}, [n]), r = m((d) => {
|
|
46
|
-
n.delete(d), n.size === 0 && o(!1);
|
|
47
|
-
}, [n]), u = G(() => ({ isLoading: e, startLoading: s, stopLoading: r }), [e, s, r]);
|
|
48
|
-
return /* @__PURE__ */ a.jsxs(nt.Provider, { value: u, children: [
|
|
49
|
-
e && /* @__PURE__ */ a.jsx(Ct, {}),
|
|
50
|
-
t
|
|
51
|
-
] });
|
|
52
|
-
}, no = ({ children: t }) => {
|
|
53
|
-
const e = st(), o = m(() => {
|
|
54
|
-
const c = localStorage.getItem("user") ?? null;
|
|
55
|
-
return c ? JSON.parse(c) : null;
|
|
56
|
-
}, []), [n, s] = M(o()), r = m(async () => {
|
|
57
|
-
let c = null;
|
|
58
|
-
return await e.get("/user/detail").then((x) => {
|
|
59
|
-
c = x.data;
|
|
60
|
-
}).catch(() => {
|
|
61
|
-
c = null;
|
|
62
|
-
}), localStorage.setItem("user", JSON.stringify(c)), c;
|
|
63
|
-
}, [e]), u = m(() => {
|
|
64
|
-
localStorage.removeItem("user");
|
|
65
|
-
}, []), d = m(async () => {
|
|
66
|
-
const c = await r();
|
|
67
|
-
return c ? (s(c), !0) : !1;
|
|
68
|
-
}, [r]), h = m(() => {
|
|
69
|
-
u(), s(null);
|
|
70
|
-
}, [u]), p = G(() => ({ user: n, loginUser: d, logoutUser: h }), [n, d, h]);
|
|
71
|
-
return Ce(() => {
|
|
72
|
-
s(o());
|
|
73
|
-
}, [o]), /* @__PURE__ */ a.jsx(rt.Provider, { value: p, children: t });
|
|
74
|
-
}, bt = (t) => /* @__PURE__ */ g.forwardRef((e, o) => /* @__PURE__ */ a.jsx("div", {
|
|
8
|
+
const Tt = (t) => /* @__PURE__ */ v.forwardRef((e, o) => /* @__PURE__ */ r.jsx("div", {
|
|
75
9
|
...e,
|
|
76
10
|
ref: o,
|
|
77
|
-
className:
|
|
78
|
-
})),
|
|
11
|
+
className: x(e.className, t)
|
|
12
|
+
})), jt = {
|
|
79
13
|
/** An accessible label indicating the relevant information about the Close Button. */
|
|
80
|
-
"aria-label":
|
|
14
|
+
"aria-label": ve.string,
|
|
81
15
|
/** A callback fired after the Close Button is clicked. */
|
|
82
|
-
onClick:
|
|
16
|
+
onClick: ve.func,
|
|
83
17
|
/**
|
|
84
18
|
* Render different color variant for the button.
|
|
85
19
|
*
|
|
86
20
|
* Omitting this will render the default dark color.
|
|
87
21
|
*/
|
|
88
|
-
variant:
|
|
89
|
-
},
|
|
22
|
+
variant: ve.oneOf(["white"])
|
|
23
|
+
}, Me = /* @__PURE__ */ v.forwardRef(({
|
|
90
24
|
className: t,
|
|
91
25
|
variant: e,
|
|
92
26
|
"aria-label": o = "Close",
|
|
93
27
|
...n
|
|
94
|
-
}, s) => /* @__PURE__ */
|
|
28
|
+
}, s) => /* @__PURE__ */ r.jsx("button", {
|
|
95
29
|
ref: s,
|
|
96
30
|
type: "button",
|
|
97
|
-
className:
|
|
31
|
+
className: x("btn-close", e && `btn-close-${e}`, t),
|
|
98
32
|
"aria-label": o,
|
|
99
33
|
...n
|
|
100
34
|
}));
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const Nt =
|
|
104
|
-
var
|
|
105
|
-
function
|
|
106
|
-
if ((!
|
|
35
|
+
Me.displayName = "CloseButton";
|
|
36
|
+
Me.propTypes = jt;
|
|
37
|
+
const Nt = Me;
|
|
38
|
+
var se;
|
|
39
|
+
function Be(t) {
|
|
40
|
+
if ((!se && se !== 0 || t) && Ee) {
|
|
107
41
|
var e = document.createElement("div");
|
|
108
|
-
e.style.position = "absolute", e.style.top = "-9999px", e.style.width = "50px", e.style.height = "50px", e.style.overflow = "scroll", document.body.appendChild(e),
|
|
42
|
+
e.style.position = "absolute", e.style.top = "-9999px", e.style.width = "50px", e.style.height = "50px", e.style.overflow = "scroll", document.body.appendChild(e), se = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
|
|
109
43
|
}
|
|
110
|
-
return
|
|
44
|
+
return se;
|
|
111
45
|
}
|
|
112
|
-
function
|
|
113
|
-
t === void 0 && (t =
|
|
46
|
+
function ye(t) {
|
|
47
|
+
t === void 0 && (t = Fe());
|
|
114
48
|
try {
|
|
115
49
|
var e = t.activeElement;
|
|
116
50
|
return !e || !e.nodeName ? null : e;
|
|
@@ -122,8 +56,8 @@ function Rt(t = document) {
|
|
|
122
56
|
const e = t.defaultView;
|
|
123
57
|
return Math.abs(e.innerWidth - t.documentElement.clientWidth);
|
|
124
58
|
}
|
|
125
|
-
const
|
|
126
|
-
class
|
|
59
|
+
const Ae = Ct("modal-open");
|
|
60
|
+
class kt {
|
|
127
61
|
constructor({
|
|
128
62
|
ownerDocument: e,
|
|
129
63
|
handleContainerOverflow: o = !0,
|
|
@@ -148,14 +82,14 @@ class jt {
|
|
|
148
82
|
e.style = {
|
|
149
83
|
overflow: s.style.overflow,
|
|
150
84
|
[n]: s.style[n]
|
|
151
|
-
}, e.scrollBarWidth && (o[n] = `${parseInt(
|
|
85
|
+
}, e.scrollBarWidth && (o[n] = `${parseInt(G(s, n) || "0", 10) + e.scrollBarWidth}px`), s.setAttribute(Ae, ""), G(s, o);
|
|
152
86
|
}
|
|
153
87
|
reset() {
|
|
154
88
|
[...this.modals].forEach((e) => this.remove(e));
|
|
155
89
|
}
|
|
156
90
|
removeContainerStyle(e) {
|
|
157
91
|
const o = this.getElement();
|
|
158
|
-
o.removeAttribute(
|
|
92
|
+
o.removeAttribute(Ae), Object.assign(o.style, e.style);
|
|
159
93
|
}
|
|
160
94
|
add(e) {
|
|
161
95
|
let o = this.modals.indexOf(e);
|
|
@@ -172,23 +106,23 @@ class jt {
|
|
|
172
106
|
return !!this.modals.length && this.modals[this.modals.length - 1] === e;
|
|
173
107
|
}
|
|
174
108
|
}
|
|
175
|
-
const
|
|
109
|
+
const Te = kt, St = ["show", "role", "className", "style", "children", "backdrop", "keyboard", "onBackdropClick", "onEscapeKeyDown", "transition", "runTransition", "backdropTransition", "runBackdropTransition", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "renderDialog", "renderBackdrop", "manager", "container", "onShow", "onHide", "onExit", "onExited", "onExiting", "onEnter", "onEntering", "onEntered"];
|
|
176
110
|
function Ot(t, e) {
|
|
177
111
|
if (t == null)
|
|
178
112
|
return {};
|
|
179
|
-
var o = {}, n = Object.keys(t), s,
|
|
180
|
-
for (
|
|
181
|
-
s = n[
|
|
113
|
+
var o = {}, n = Object.keys(t), s, a;
|
|
114
|
+
for (a = 0; a < n.length; a++)
|
|
115
|
+
s = n[a], !(e.indexOf(s) >= 0) && (o[s] = t[s]);
|
|
182
116
|
return o;
|
|
183
117
|
}
|
|
184
|
-
let
|
|
185
|
-
function
|
|
186
|
-
return
|
|
118
|
+
let xe;
|
|
119
|
+
function Bt(t) {
|
|
120
|
+
return xe || (xe = new Te({
|
|
187
121
|
ownerDocument: t == null ? void 0 : t.document
|
|
188
|
-
})),
|
|
122
|
+
})), xe;
|
|
189
123
|
}
|
|
190
|
-
function
|
|
191
|
-
const e =
|
|
124
|
+
function At(t) {
|
|
125
|
+
const e = De(), o = t || Bt(e), n = E({
|
|
192
126
|
dialog: null,
|
|
193
127
|
backdrop: null
|
|
194
128
|
});
|
|
@@ -204,459 +138,562 @@ function Bt(t) {
|
|
|
204
138
|
}, [])
|
|
205
139
|
});
|
|
206
140
|
}
|
|
207
|
-
const We = /* @__PURE__ */
|
|
141
|
+
const We = /* @__PURE__ */ it((t, e) => {
|
|
208
142
|
let {
|
|
209
143
|
show: o = !1,
|
|
210
144
|
role: n = "dialog",
|
|
211
145
|
className: s,
|
|
212
|
-
style:
|
|
213
|
-
children:
|
|
214
|
-
backdrop:
|
|
215
|
-
keyboard:
|
|
216
|
-
onBackdropClick:
|
|
217
|
-
onEscapeKeyDown:
|
|
218
|
-
transition:
|
|
219
|
-
runTransition:
|
|
146
|
+
style: a,
|
|
147
|
+
children: d,
|
|
148
|
+
backdrop: l = !0,
|
|
149
|
+
keyboard: f = !0,
|
|
150
|
+
onBackdropClick: g,
|
|
151
|
+
onEscapeKeyDown: u,
|
|
152
|
+
transition: M,
|
|
153
|
+
runTransition: T,
|
|
220
154
|
backdropTransition: R,
|
|
221
|
-
runBackdropTransition:
|
|
222
|
-
autoFocus:
|
|
223
|
-
enforceFocus:
|
|
224
|
-
restoreFocus:
|
|
225
|
-
restoreFocusOptions:
|
|
226
|
-
renderDialog:
|
|
227
|
-
renderBackdrop:
|
|
228
|
-
manager:
|
|
229
|
-
container:
|
|
230
|
-
onShow:
|
|
231
|
-
onHide:
|
|
155
|
+
runBackdropTransition: ae,
|
|
156
|
+
autoFocus: V = !0,
|
|
157
|
+
enforceFocus: ie = !0,
|
|
158
|
+
restoreFocus: k = !0,
|
|
159
|
+
restoreFocusOptions: le,
|
|
160
|
+
renderDialog: X,
|
|
161
|
+
renderBackdrop: de = (c) => /* @__PURE__ */ r.jsx("div", Object.assign({}, c)),
|
|
162
|
+
manager: ce,
|
|
163
|
+
container: ue,
|
|
164
|
+
onShow: Y,
|
|
165
|
+
onHide: H = () => {
|
|
232
166
|
},
|
|
233
|
-
onExit:
|
|
234
|
-
onExited:
|
|
235
|
-
onExiting:
|
|
236
|
-
onEnter:
|
|
237
|
-
onEntering:
|
|
238
|
-
onEntered:
|
|
239
|
-
} = t,
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
167
|
+
onExit: fe,
|
|
168
|
+
onExited: U,
|
|
169
|
+
onExiting: q,
|
|
170
|
+
onEnter: J,
|
|
171
|
+
onEntering: Q,
|
|
172
|
+
onEntered: Z
|
|
173
|
+
} = t, he = Ot(t, St);
|
|
174
|
+
const w = De(), S = ut(ue), h = At(ce), me = ft(), ee = bt(o), [j, O] = p(!o), y = E(null);
|
|
175
|
+
lt(e, () => h, [h]), Ee && !ee && o && (y.current = ye(w == null ? void 0 : w.document)), o && j && O(!1);
|
|
176
|
+
const C = b(() => {
|
|
177
|
+
if (h.add(), B.current = Re(document, "keydown", pe), _.current = Re(
|
|
244
178
|
document,
|
|
245
179
|
"focus",
|
|
246
180
|
// the timeout is necessary b/c this will run before the new modal is mounted
|
|
247
181
|
// and so steals focus from it
|
|
248
|
-
() => setTimeout(
|
|
182
|
+
() => setTimeout(ge),
|
|
249
183
|
!0
|
|
250
|
-
),
|
|
251
|
-
var
|
|
252
|
-
const
|
|
253
|
-
|
|
184
|
+
), Y && Y(), V) {
|
|
185
|
+
var c, ne;
|
|
186
|
+
const z = ye((c = (ne = h.dialog) == null ? void 0 : ne.ownerDocument) != null ? c : w == null ? void 0 : w.document);
|
|
187
|
+
h.dialog && z && !ke(h.dialog, z) && (y.current = z, h.dialog.focus());
|
|
254
188
|
}
|
|
255
|
-
}),
|
|
256
|
-
if (
|
|
257
|
-
var
|
|
258
|
-
(
|
|
189
|
+
}), P = b(() => {
|
|
190
|
+
if (h.remove(), B.current == null || B.current(), _.current == null || _.current(), k) {
|
|
191
|
+
var c;
|
|
192
|
+
(c = y.current) == null || c.focus == null || c.focus(le), y.current = null;
|
|
259
193
|
}
|
|
260
194
|
});
|
|
261
|
-
|
|
262
|
-
!o || !
|
|
195
|
+
re(() => {
|
|
196
|
+
!o || !S || C();
|
|
263
197
|
}, [
|
|
264
198
|
o,
|
|
265
|
-
|
|
199
|
+
S,
|
|
266
200
|
/* should never change: */
|
|
267
|
-
|
|
268
|
-
]),
|
|
269
|
-
|
|
270
|
-
}, [
|
|
271
|
-
|
|
201
|
+
C
|
|
202
|
+
]), re(() => {
|
|
203
|
+
j && P();
|
|
204
|
+
}, [j, P]), Ie(() => {
|
|
205
|
+
P();
|
|
272
206
|
});
|
|
273
|
-
const
|
|
274
|
-
if (!
|
|
207
|
+
const ge = b(() => {
|
|
208
|
+
if (!ie || !me() || !h.isTopModal())
|
|
275
209
|
return;
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
-
}),
|
|
279
|
-
|
|
280
|
-
}),
|
|
281
|
-
|
|
282
|
-
}),
|
|
283
|
-
O(!0),
|
|
210
|
+
const c = ye(w == null ? void 0 : w.document);
|
|
211
|
+
h.dialog && c && !ke(h.dialog, c) && h.dialog.focus();
|
|
212
|
+
}), te = b((c) => {
|
|
213
|
+
c.target === c.currentTarget && (g == null || g(c), l === !0 && H());
|
|
214
|
+
}), pe = b((c) => {
|
|
215
|
+
f && ht(c) && h.isTopModal() && (u == null || u(c), c.defaultPrevented || H());
|
|
216
|
+
}), _ = E(), B = E(), oe = (...c) => {
|
|
217
|
+
O(!0), U == null || U(...c);
|
|
284
218
|
};
|
|
285
|
-
if (!
|
|
219
|
+
if (!S)
|
|
286
220
|
return null;
|
|
287
|
-
const
|
|
221
|
+
const A = Object.assign({
|
|
288
222
|
role: n,
|
|
289
|
-
ref:
|
|
223
|
+
ref: h.setDialogRef,
|
|
290
224
|
// apparently only works on the dialog role element
|
|
291
225
|
"aria-modal": n === "dialog" ? !0 : void 0
|
|
292
|
-
},
|
|
293
|
-
style:
|
|
226
|
+
}, he, {
|
|
227
|
+
style: a,
|
|
294
228
|
className: s,
|
|
295
229
|
tabIndex: -1
|
|
296
230
|
});
|
|
297
|
-
let
|
|
298
|
-
children: /* @__PURE__ */
|
|
231
|
+
let K = X ? X(A) : /* @__PURE__ */ r.jsx("div", Object.assign({}, A, {
|
|
232
|
+
children: /* @__PURE__ */ v.cloneElement(d, {
|
|
299
233
|
role: "document"
|
|
300
234
|
})
|
|
301
235
|
}));
|
|
302
|
-
|
|
236
|
+
K = Se(M, T, {
|
|
303
237
|
unmountOnExit: !0,
|
|
304
238
|
mountOnEnter: !0,
|
|
305
239
|
appear: !0,
|
|
306
240
|
in: !!o,
|
|
307
|
-
onExit:
|
|
308
|
-
onExiting:
|
|
309
|
-
onExited:
|
|
310
|
-
onEnter:
|
|
311
|
-
onEntering:
|
|
312
|
-
onEntered:
|
|
313
|
-
children:
|
|
241
|
+
onExit: fe,
|
|
242
|
+
onExiting: q,
|
|
243
|
+
onExited: oe,
|
|
244
|
+
onEnter: J,
|
|
245
|
+
onEntering: Q,
|
|
246
|
+
onEntered: Z,
|
|
247
|
+
children: K
|
|
314
248
|
});
|
|
315
|
-
let
|
|
316
|
-
return
|
|
317
|
-
ref:
|
|
318
|
-
onClick:
|
|
319
|
-
}),
|
|
249
|
+
let L = null;
|
|
250
|
+
return l && (L = de({
|
|
251
|
+
ref: h.setBackdropRef,
|
|
252
|
+
onClick: te
|
|
253
|
+
}), L = Se(R, ae, {
|
|
320
254
|
in: !!o,
|
|
321
255
|
appear: !0,
|
|
322
256
|
mountOnEnter: !0,
|
|
323
257
|
unmountOnExit: !0,
|
|
324
|
-
children:
|
|
325
|
-
})), /* @__PURE__ */
|
|
326
|
-
children: /* @__PURE__ */ Mt.createPortal(/* @__PURE__ */
|
|
327
|
-
children: [
|
|
328
|
-
}),
|
|
258
|
+
children: L
|
|
259
|
+
})), /* @__PURE__ */ r.jsx(r.Fragment, {
|
|
260
|
+
children: /* @__PURE__ */ Mt.createPortal(/* @__PURE__ */ r.jsxs(r.Fragment, {
|
|
261
|
+
children: [L, K]
|
|
262
|
+
}), S)
|
|
329
263
|
});
|
|
330
264
|
});
|
|
331
265
|
We.displayName = "Modal";
|
|
332
|
-
const
|
|
333
|
-
Manager:
|
|
266
|
+
const Lt = Object.assign(We, {
|
|
267
|
+
Manager: Te
|
|
334
268
|
});
|
|
335
|
-
function
|
|
336
|
-
t.classList ? t.classList.add(e) :
|
|
269
|
+
function Ft(t, e) {
|
|
270
|
+
t.classList ? t.classList.add(e) : mt(t, e) || (typeof t.className == "string" ? t.className = t.className + " " + e : t.setAttribute("class", (t.className && t.className.baseVal || "") + " " + e));
|
|
337
271
|
}
|
|
338
|
-
function
|
|
272
|
+
function Le(t, e) {
|
|
339
273
|
return t.replace(new RegExp("(^|\\s)" + e + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
340
274
|
}
|
|
341
275
|
function Dt(t, e) {
|
|
342
|
-
t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className =
|
|
276
|
+
t.classList ? t.classList.remove(e) : typeof t.className == "string" ? t.className = Le(t.className, e) : t.setAttribute("class", Le(t.className && t.className.baseVal || "", e));
|
|
343
277
|
}
|
|
344
|
-
const
|
|
278
|
+
const I = {
|
|
345
279
|
FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
|
|
346
280
|
STICKY_CONTENT: ".sticky-top",
|
|
347
281
|
NAVBAR_TOGGLER: ".navbar-toggler"
|
|
348
282
|
};
|
|
349
|
-
class
|
|
283
|
+
class It extends Te {
|
|
350
284
|
adjustAndStore(e, o, n) {
|
|
351
285
|
const s = o.style[e];
|
|
352
|
-
o.dataset[e] = s,
|
|
353
|
-
[e]: `${parseFloat(
|
|
286
|
+
o.dataset[e] = s, G(o, {
|
|
287
|
+
[e]: `${parseFloat(G(o, e)) + n}px`
|
|
354
288
|
});
|
|
355
289
|
}
|
|
356
290
|
restore(e, o) {
|
|
357
291
|
const n = o.dataset[e];
|
|
358
|
-
n !== void 0 && (delete o.dataset[e],
|
|
292
|
+
n !== void 0 && (delete o.dataset[e], G(o, {
|
|
359
293
|
[e]: n
|
|
360
294
|
}));
|
|
361
295
|
}
|
|
362
296
|
setContainerStyle(e) {
|
|
363
297
|
super.setContainerStyle(e);
|
|
364
298
|
const o = this.getElement();
|
|
365
|
-
if (
|
|
299
|
+
if (Ft(o, "modal-open"), !e.scrollBarWidth)
|
|
366
300
|
return;
|
|
367
301
|
const n = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
368
|
-
D(o,
|
|
302
|
+
D(o, I.FIXED_CONTENT).forEach((a) => this.adjustAndStore(n, a, e.scrollBarWidth)), D(o, I.STICKY_CONTENT).forEach((a) => this.adjustAndStore(s, a, -e.scrollBarWidth)), D(o, I.NAVBAR_TOGGLER).forEach((a) => this.adjustAndStore(s, a, e.scrollBarWidth));
|
|
369
303
|
}
|
|
370
304
|
removeContainerStyle(e) {
|
|
371
305
|
super.removeContainerStyle(e);
|
|
372
306
|
const o = this.getElement();
|
|
373
307
|
Dt(o, "modal-open");
|
|
374
308
|
const n = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
375
|
-
D(o,
|
|
309
|
+
D(o, I.FIXED_CONTENT).forEach((a) => this.restore(n, a)), D(o, I.STICKY_CONTENT).forEach((a) => this.restore(s, a)), D(o, I.NAVBAR_TOGGLER).forEach((a) => this.restore(s, a));
|
|
376
310
|
}
|
|
377
311
|
}
|
|
378
|
-
let
|
|
379
|
-
function
|
|
380
|
-
return
|
|
312
|
+
let we;
|
|
313
|
+
function $t(t) {
|
|
314
|
+
return we || (we = new It(t)), we;
|
|
381
315
|
}
|
|
382
|
-
const
|
|
316
|
+
const He = /* @__PURE__ */ v.forwardRef(({
|
|
383
317
|
className: t,
|
|
384
318
|
bsPrefix: e,
|
|
385
319
|
as: o = "div",
|
|
386
320
|
...n
|
|
387
|
-
}, s) => (e =
|
|
321
|
+
}, s) => (e = W(e, "modal-body"), /* @__PURE__ */ r.jsx(o, {
|
|
388
322
|
ref: s,
|
|
389
|
-
className:
|
|
323
|
+
className: x(t, e),
|
|
390
324
|
...n
|
|
391
325
|
})));
|
|
392
|
-
|
|
393
|
-
const
|
|
326
|
+
He.displayName = "ModalBody";
|
|
327
|
+
const Wt = He, Ht = /* @__PURE__ */ v.createContext({
|
|
394
328
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
395
329
|
onHide() {
|
|
396
330
|
}
|
|
397
|
-
}),
|
|
331
|
+
}), Ue = Ht, Pe = /* @__PURE__ */ v.forwardRef(({
|
|
398
332
|
bsPrefix: t,
|
|
399
333
|
className: e,
|
|
400
334
|
contentClassName: o,
|
|
401
335
|
centered: n,
|
|
402
336
|
size: s,
|
|
403
|
-
fullscreen:
|
|
404
|
-
children:
|
|
405
|
-
scrollable:
|
|
406
|
-
...
|
|
407
|
-
},
|
|
408
|
-
t =
|
|
409
|
-
const
|
|
410
|
-
return /* @__PURE__ */
|
|
411
|
-
...
|
|
412
|
-
ref:
|
|
413
|
-
className:
|
|
414
|
-
children: /* @__PURE__ */
|
|
415
|
-
className:
|
|
416
|
-
children:
|
|
337
|
+
fullscreen: a,
|
|
338
|
+
children: d,
|
|
339
|
+
scrollable: l,
|
|
340
|
+
...f
|
|
341
|
+
}, g) => {
|
|
342
|
+
t = W(t, "modal");
|
|
343
|
+
const u = `${t}-dialog`, M = typeof a == "string" ? `${t}-fullscreen-${a}` : `${t}-fullscreen`;
|
|
344
|
+
return /* @__PURE__ */ r.jsx("div", {
|
|
345
|
+
...f,
|
|
346
|
+
ref: g,
|
|
347
|
+
className: x(u, e, s && `${t}-${s}`, n && `${u}-centered`, l && `${u}-scrollable`, a && M),
|
|
348
|
+
children: /* @__PURE__ */ r.jsx("div", {
|
|
349
|
+
className: x(`${t}-content`, o),
|
|
350
|
+
children: d
|
|
417
351
|
})
|
|
418
352
|
});
|
|
419
353
|
});
|
|
420
|
-
|
|
421
|
-
const
|
|
354
|
+
Pe.displayName = "ModalDialog";
|
|
355
|
+
const _e = Pe, Ke = /* @__PURE__ */ v.forwardRef(({
|
|
422
356
|
className: t,
|
|
423
357
|
bsPrefix: e,
|
|
424
358
|
as: o = "div",
|
|
425
359
|
...n
|
|
426
|
-
}, s) => (e =
|
|
360
|
+
}, s) => (e = W(e, "modal-footer"), /* @__PURE__ */ r.jsx(o, {
|
|
427
361
|
ref: s,
|
|
428
|
-
className:
|
|
362
|
+
className: x(t, e),
|
|
429
363
|
...n
|
|
430
364
|
})));
|
|
431
|
-
|
|
432
|
-
const Ut =
|
|
365
|
+
Ke.displayName = "ModalFooter";
|
|
366
|
+
const Ut = Ke, Pt = /* @__PURE__ */ v.forwardRef(({
|
|
433
367
|
closeLabel: t = "Close",
|
|
434
368
|
closeVariant: e,
|
|
435
369
|
closeButton: o = !1,
|
|
436
370
|
onHide: n,
|
|
437
371
|
children: s,
|
|
438
|
-
...
|
|
439
|
-
},
|
|
440
|
-
const
|
|
441
|
-
|
|
372
|
+
...a
|
|
373
|
+
}, d) => {
|
|
374
|
+
const l = be(Ue), f = b(() => {
|
|
375
|
+
l == null || l.onHide(), n == null || n();
|
|
442
376
|
});
|
|
443
|
-
return /* @__PURE__ */
|
|
444
|
-
ref:
|
|
445
|
-
...
|
|
446
|
-
children: [s, o && /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ r.jsxs("div", {
|
|
378
|
+
ref: d,
|
|
379
|
+
...a,
|
|
380
|
+
children: [s, o && /* @__PURE__ */ r.jsx(Nt, {
|
|
447
381
|
"aria-label": t,
|
|
448
382
|
variant: e,
|
|
449
|
-
onClick:
|
|
383
|
+
onClick: f
|
|
450
384
|
})]
|
|
451
385
|
});
|
|
452
|
-
}), _t =
|
|
386
|
+
}), _t = Pt, ze = /* @__PURE__ */ v.forwardRef(({
|
|
453
387
|
bsPrefix: t,
|
|
454
388
|
className: e,
|
|
455
389
|
closeLabel: o = "Close",
|
|
456
390
|
closeButton: n = !1,
|
|
457
391
|
...s
|
|
458
|
-
},
|
|
459
|
-
ref:
|
|
392
|
+
}, a) => (t = W(t, "modal-header"), /* @__PURE__ */ r.jsx(_t, {
|
|
393
|
+
ref: a,
|
|
460
394
|
...s,
|
|
461
|
-
className:
|
|
395
|
+
className: x(e, t),
|
|
462
396
|
closeLabel: o,
|
|
463
397
|
closeButton: n
|
|
464
398
|
})));
|
|
465
|
-
|
|
466
|
-
const Kt =
|
|
399
|
+
ze.displayName = "ModalHeader";
|
|
400
|
+
const Kt = ze, zt = Tt("h4"), Ge = /* @__PURE__ */ v.forwardRef(({
|
|
467
401
|
className: t,
|
|
468
402
|
bsPrefix: e,
|
|
469
403
|
as: o = zt,
|
|
470
404
|
...n
|
|
471
|
-
}, s) => (e =
|
|
405
|
+
}, s) => (e = W(e, "modal-title"), /* @__PURE__ */ r.jsx(o, {
|
|
472
406
|
ref: s,
|
|
473
|
-
className:
|
|
407
|
+
className: x(t, e),
|
|
474
408
|
...n
|
|
475
409
|
})));
|
|
476
|
-
|
|
477
|
-
const Gt =
|
|
478
|
-
function
|
|
479
|
-
return /* @__PURE__ */
|
|
410
|
+
Ge.displayName = "ModalTitle";
|
|
411
|
+
const Gt = Ge;
|
|
412
|
+
function Vt(t) {
|
|
413
|
+
return /* @__PURE__ */ r.jsx($e, {
|
|
480
414
|
...t,
|
|
481
415
|
timeout: null
|
|
482
416
|
});
|
|
483
417
|
}
|
|
484
|
-
function
|
|
485
|
-
return /* @__PURE__ */
|
|
418
|
+
function Xt(t) {
|
|
419
|
+
return /* @__PURE__ */ r.jsx($e, {
|
|
486
420
|
...t,
|
|
487
421
|
timeout: null
|
|
488
422
|
});
|
|
489
423
|
}
|
|
490
|
-
const Ve = /* @__PURE__ */
|
|
424
|
+
const Ve = /* @__PURE__ */ v.forwardRef(({
|
|
491
425
|
bsPrefix: t,
|
|
492
426
|
className: e,
|
|
493
427
|
style: o,
|
|
494
428
|
dialogClassName: n,
|
|
495
429
|
contentClassName: s,
|
|
496
|
-
children:
|
|
497
|
-
dialogAs:
|
|
498
|
-
"data-bs-theme":
|
|
499
|
-
"aria-labelledby":
|
|
500
|
-
"aria-describedby":
|
|
501
|
-
"aria-label":
|
|
430
|
+
children: a,
|
|
431
|
+
dialogAs: d = _e,
|
|
432
|
+
"data-bs-theme": l,
|
|
433
|
+
"aria-labelledby": f,
|
|
434
|
+
"aria-describedby": g,
|
|
435
|
+
"aria-label": u,
|
|
502
436
|
/* BaseModal props */
|
|
503
|
-
show:
|
|
504
|
-
animation:
|
|
437
|
+
show: M = !1,
|
|
438
|
+
animation: T = !0,
|
|
505
439
|
backdrop: R = !0,
|
|
506
|
-
keyboard:
|
|
507
|
-
onEscapeKeyDown:
|
|
508
|
-
onShow:
|
|
509
|
-
onHide:
|
|
510
|
-
container:
|
|
511
|
-
autoFocus:
|
|
512
|
-
enforceFocus:
|
|
513
|
-
restoreFocus:
|
|
514
|
-
restoreFocusOptions:
|
|
515
|
-
onEntered:
|
|
516
|
-
onExit:
|
|
517
|
-
onExiting:
|
|
518
|
-
onEnter:
|
|
519
|
-
onEntering:
|
|
520
|
-
onExited:
|
|
521
|
-
backdropClassName:
|
|
522
|
-
manager:
|
|
523
|
-
...
|
|
524
|
-
},
|
|
525
|
-
const [
|
|
526
|
-
t =
|
|
527
|
-
const
|
|
528
|
-
onHide:
|
|
529
|
-
}), [
|
|
530
|
-
function
|
|
531
|
-
return
|
|
532
|
-
isRTL:
|
|
440
|
+
keyboard: ae = !0,
|
|
441
|
+
onEscapeKeyDown: V,
|
|
442
|
+
onShow: ie,
|
|
443
|
+
onHide: k,
|
|
444
|
+
container: le,
|
|
445
|
+
autoFocus: X = !0,
|
|
446
|
+
enforceFocus: de = !0,
|
|
447
|
+
restoreFocus: ce = !0,
|
|
448
|
+
restoreFocusOptions: ue,
|
|
449
|
+
onEntered: Y,
|
|
450
|
+
onExit: H,
|
|
451
|
+
onExiting: fe,
|
|
452
|
+
onEnter: U,
|
|
453
|
+
onEntering: q,
|
|
454
|
+
onExited: J,
|
|
455
|
+
backdropClassName: Q,
|
|
456
|
+
manager: Z,
|
|
457
|
+
...he
|
|
458
|
+
}, w) => {
|
|
459
|
+
const [S, h] = p({}), [me, ee] = p(!1), j = E(!1), O = E(!1), y = E(null), [C, P] = gt(), ge = pt(w, P), te = b(k), pe = vt();
|
|
460
|
+
t = W(t, "modal");
|
|
461
|
+
const _ = $(() => ({
|
|
462
|
+
onHide: te
|
|
463
|
+
}), [te]);
|
|
464
|
+
function B() {
|
|
465
|
+
return Z || $t({
|
|
466
|
+
isRTL: pe
|
|
533
467
|
});
|
|
534
468
|
}
|
|
535
|
-
function
|
|
469
|
+
function oe(i) {
|
|
536
470
|
if (!Ee)
|
|
537
471
|
return;
|
|
538
|
-
const
|
|
539
|
-
|
|
540
|
-
paddingRight:
|
|
541
|
-
paddingLeft: !
|
|
472
|
+
const F = B().getScrollbarWidth() > 0, Ne = i.scrollHeight > Fe(i).documentElement.clientHeight;
|
|
473
|
+
h({
|
|
474
|
+
paddingRight: F && !Ne ? Be() : void 0,
|
|
475
|
+
paddingLeft: !F && Ne ? Be() : void 0
|
|
542
476
|
});
|
|
543
477
|
}
|
|
544
|
-
const
|
|
545
|
-
|
|
478
|
+
const A = b(() => {
|
|
479
|
+
C && oe(C.dialog);
|
|
546
480
|
});
|
|
547
481
|
Ie(() => {
|
|
548
|
-
|
|
482
|
+
Oe(window, "resize", A), y.current == null || y.current();
|
|
549
483
|
});
|
|
550
|
-
const
|
|
551
|
-
|
|
552
|
-
},
|
|
553
|
-
|
|
554
|
-
},
|
|
555
|
-
|
|
556
|
-
|
|
484
|
+
const K = () => {
|
|
485
|
+
j.current = !0;
|
|
486
|
+
}, L = (i) => {
|
|
487
|
+
j.current && C && i.target === C.dialog && (O.current = !0), j.current = !1;
|
|
488
|
+
}, c = () => {
|
|
489
|
+
ee(!0), y.current = xt(C.dialog, () => {
|
|
490
|
+
ee(!1);
|
|
557
491
|
});
|
|
558
|
-
},
|
|
559
|
-
i.target === i.currentTarget &&
|
|
560
|
-
},
|
|
492
|
+
}, ne = (i) => {
|
|
493
|
+
i.target === i.currentTarget && c();
|
|
494
|
+
}, z = (i) => {
|
|
561
495
|
if (R === "static") {
|
|
562
|
-
|
|
496
|
+
ne(i);
|
|
563
497
|
return;
|
|
564
498
|
}
|
|
565
499
|
if (O.current || i.target !== i.currentTarget) {
|
|
566
500
|
O.current = !1;
|
|
567
501
|
return;
|
|
568
502
|
}
|
|
569
|
-
|
|
503
|
+
k == null || k();
|
|
570
504
|
}, Xe = (i) => {
|
|
571
|
-
|
|
572
|
-
}, Ye = (i,
|
|
573
|
-
i &&
|
|
505
|
+
ae ? V == null || V(i) : (i.preventDefault(), R === "static" && c());
|
|
506
|
+
}, Ye = (i, F) => {
|
|
507
|
+
i && oe(i), U == null || U(i, F);
|
|
574
508
|
}, qe = (i) => {
|
|
575
|
-
|
|
576
|
-
}, Je = (i,
|
|
577
|
-
|
|
509
|
+
y.current == null || y.current(), H == null || H(i);
|
|
510
|
+
}, Je = (i, F) => {
|
|
511
|
+
q == null || q(i, F), yt(window, "resize", A);
|
|
578
512
|
}, Qe = (i) => {
|
|
579
|
-
i && (i.style.display = ""),
|
|
580
|
-
}, Ze = m((i) => /* @__PURE__ */
|
|
513
|
+
i && (i.style.display = ""), J == null || J(i), Oe(window, "resize", A);
|
|
514
|
+
}, Ze = m((i) => /* @__PURE__ */ r.jsx("div", {
|
|
581
515
|
...i,
|
|
582
|
-
className:
|
|
583
|
-
}), [
|
|
516
|
+
className: x(`${t}-backdrop`, Q, !T && "show")
|
|
517
|
+
}), [T, Q, t]), je = {
|
|
584
518
|
...o,
|
|
585
|
-
...
|
|
519
|
+
...S
|
|
586
520
|
};
|
|
587
|
-
|
|
588
|
-
const et = (i) => /* @__PURE__ */
|
|
521
|
+
je.display = "block";
|
|
522
|
+
const et = (i) => /* @__PURE__ */ r.jsx("div", {
|
|
589
523
|
role: "dialog",
|
|
590
524
|
...i,
|
|
591
|
-
style:
|
|
592
|
-
className:
|
|
593
|
-
onClick: R ?
|
|
594
|
-
onMouseUp:
|
|
595
|
-
"data-bs-theme":
|
|
596
|
-
"aria-label":
|
|
597
|
-
"aria-labelledby":
|
|
598
|
-
"aria-describedby":
|
|
599
|
-
children: /* @__PURE__ */
|
|
600
|
-
...
|
|
601
|
-
onMouseDown:
|
|
525
|
+
style: je,
|
|
526
|
+
className: x(e, t, me && `${t}-static`, !T && "show"),
|
|
527
|
+
onClick: R ? z : void 0,
|
|
528
|
+
onMouseUp: L,
|
|
529
|
+
"data-bs-theme": l,
|
|
530
|
+
"aria-label": u,
|
|
531
|
+
"aria-labelledby": f,
|
|
532
|
+
"aria-describedby": g,
|
|
533
|
+
children: /* @__PURE__ */ r.jsx(d, {
|
|
534
|
+
...he,
|
|
535
|
+
onMouseDown: K,
|
|
602
536
|
className: n,
|
|
603
537
|
contentClassName: s,
|
|
604
|
-
children:
|
|
538
|
+
children: a
|
|
605
539
|
})
|
|
606
540
|
});
|
|
607
|
-
return /* @__PURE__ */
|
|
608
|
-
value:
|
|
609
|
-
children: /* @__PURE__ */
|
|
610
|
-
show:
|
|
611
|
-
ref:
|
|
541
|
+
return /* @__PURE__ */ r.jsx(Ue.Provider, {
|
|
542
|
+
value: _,
|
|
543
|
+
children: /* @__PURE__ */ r.jsx(Lt, {
|
|
544
|
+
show: M,
|
|
545
|
+
ref: ge,
|
|
612
546
|
backdrop: R,
|
|
613
|
-
container:
|
|
547
|
+
container: le,
|
|
614
548
|
keyboard: !0,
|
|
615
|
-
autoFocus:
|
|
616
|
-
enforceFocus:
|
|
617
|
-
restoreFocus:
|
|
618
|
-
restoreFocusOptions:
|
|
549
|
+
autoFocus: X,
|
|
550
|
+
enforceFocus: de,
|
|
551
|
+
restoreFocus: ce,
|
|
552
|
+
restoreFocusOptions: ue,
|
|
619
553
|
onEscapeKeyDown: Xe,
|
|
620
|
-
onShow:
|
|
621
|
-
onHide:
|
|
554
|
+
onShow: ie,
|
|
555
|
+
onHide: k,
|
|
622
556
|
onEnter: Ye,
|
|
623
557
|
onEntering: Je,
|
|
624
|
-
onEntered:
|
|
558
|
+
onEntered: Y,
|
|
625
559
|
onExit: qe,
|
|
626
|
-
onExiting:
|
|
560
|
+
onExiting: fe,
|
|
627
561
|
onExited: Qe,
|
|
628
|
-
manager:
|
|
629
|
-
transition:
|
|
630
|
-
backdropTransition:
|
|
562
|
+
manager: B(),
|
|
563
|
+
transition: T ? Vt : void 0,
|
|
564
|
+
backdropTransition: T ? Xt : void 0,
|
|
631
565
|
renderBackdrop: Ze,
|
|
632
566
|
renderDialog: et
|
|
633
567
|
})
|
|
634
568
|
});
|
|
635
569
|
});
|
|
636
570
|
Ve.displayName = "Modal";
|
|
637
|
-
const
|
|
638
|
-
Body:
|
|
571
|
+
const N = Object.assign(Ve, {
|
|
572
|
+
Body: Wt,
|
|
639
573
|
Header: Kt,
|
|
640
574
|
Title: Gt,
|
|
641
575
|
Footer: Ut,
|
|
642
|
-
Dialog:
|
|
576
|
+
Dialog: _e,
|
|
643
577
|
TRANSITION_DURATION: 300,
|
|
644
578
|
BACKDROP_TRANSITION_DURATION: 150
|
|
645
|
-
}),
|
|
646
|
-
const { confirmTexts: t } =
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
579
|
+
}), Yt = () => {
|
|
580
|
+
const { confirmTexts: t } = be(Ce), { isShown: e, text: o, onFinish: n } = dt(), [s, a] = p(""), d = m(() => {
|
|
581
|
+
n(null);
|
|
582
|
+
}, [n]), l = m(() => {
|
|
583
|
+
n(s);
|
|
584
|
+
}, [n, s]);
|
|
585
|
+
return re(() => {
|
|
586
|
+
e === !0 && a("");
|
|
587
|
+
}, [e]), /* @__PURE__ */ r.jsxs(N, { show: e, size: "sm", centered: !0, onHide: d, children: [
|
|
588
|
+
/* @__PURE__ */ r.jsx(N.Header, { children: /* @__PURE__ */ r.jsx(N.Title, { children: o }) }),
|
|
589
|
+
/* @__PURE__ */ r.jsx(N.Body, { children: /* @__PURE__ */ r.jsx(
|
|
590
|
+
"textarea",
|
|
591
|
+
{
|
|
592
|
+
autoFocus: !0,
|
|
593
|
+
tabIndex: 0,
|
|
594
|
+
value: s,
|
|
595
|
+
onChange: (f) => a(f.currentTarget.value),
|
|
596
|
+
className: "w-100",
|
|
597
|
+
rows: 5
|
|
598
|
+
}
|
|
599
|
+
) }),
|
|
600
|
+
/* @__PURE__ */ r.jsxs(N.Footer, { children: [
|
|
601
|
+
/* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary", onClick: d, children: t.cancel }),
|
|
602
|
+
/* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: l, children: t.confirm })
|
|
603
|
+
] })
|
|
604
|
+
] });
|
|
605
|
+
}, qt = ({ children: t }) => {
|
|
606
|
+
const [e, o] = p(!1), [n, s] = p(""), a = E(() => {
|
|
607
|
+
}), d = m((g) => {
|
|
608
|
+
s(g), o(!0), console.log("showprompt");
|
|
609
|
+
}, []), l = m(() => {
|
|
610
|
+
o(!1);
|
|
611
|
+
}, []), f = $(() => ({ isShown: e, text: n, showPrompt: d, hidePrompt: l, resolveRef: a }), [l, e, d, n, a]);
|
|
612
|
+
return /* @__PURE__ */ r.jsxs(tt.Provider, { value: f, children: [
|
|
613
|
+
t,
|
|
614
|
+
/* @__PURE__ */ r.jsx(Yt, {})
|
|
615
|
+
] });
|
|
616
|
+
}, Jt = ({ children: t }) => {
|
|
617
|
+
const [e, o] = p(!1), [n, s] = p(""), a = m((f) => {
|
|
618
|
+
o(!0), s(f);
|
|
619
|
+
}, []), d = m(() => {
|
|
620
|
+
o(!1);
|
|
621
|
+
}, []), l = $(() => ({ show: e, text: n, showConfirm: a, hideConfirm: d }), [e, n, a, d]);
|
|
622
|
+
return /* @__PURE__ */ r.jsxs(ot.Provider, { value: l, children: [
|
|
623
|
+
/* @__PURE__ */ r.jsx(Qt, {}),
|
|
624
|
+
t
|
|
625
|
+
] });
|
|
626
|
+
}, ro = ({ axiosInstance: t, LinkComponent: e, language: o, axiosTexts: n, confirmTexts: s, formValidationTexts: a, homeDashboardTexts: d, formSubmitTexts: l, children: f }) => {
|
|
627
|
+
const g = $(() => ({
|
|
628
|
+
axiosInstance: t,
|
|
629
|
+
LinkComponent: e,
|
|
630
|
+
language: o,
|
|
631
|
+
axiosTexts: n,
|
|
632
|
+
confirmTexts: s,
|
|
633
|
+
formValidationTexts: a,
|
|
634
|
+
homeDashboardTexts: d,
|
|
635
|
+
formSubmitTexts: l
|
|
636
|
+
}), [
|
|
637
|
+
t,
|
|
638
|
+
e,
|
|
639
|
+
o,
|
|
640
|
+
n,
|
|
641
|
+
s,
|
|
642
|
+
a,
|
|
643
|
+
d,
|
|
644
|
+
l
|
|
645
|
+
]);
|
|
646
|
+
return /* @__PURE__ */ r.jsx(Ce.Provider, { value: g, children: /* @__PURE__ */ r.jsx(Jt, { children: /* @__PURE__ */ r.jsxs(qt, { children: [
|
|
647
|
+
/* @__PURE__ */ r.jsx(nt, {}),
|
|
648
|
+
f
|
|
649
|
+
] }) }) });
|
|
650
|
+
}, ao = ({ children: t }) => {
|
|
651
|
+
const [e, o] = p(!1), [n] = p(/* @__PURE__ */ new Set()), s = m((l) => {
|
|
652
|
+
n.add(l), o(!0);
|
|
653
|
+
}, [n]), a = m((l) => {
|
|
654
|
+
n.delete(l), n.size === 0 && o(!1);
|
|
655
|
+
}, [n]), d = $(() => ({ isLoading: e, startLoading: s, stopLoading: a }), [e, s, a]);
|
|
656
|
+
return /* @__PURE__ */ r.jsxs(st.Provider, { value: d, children: [
|
|
657
|
+
e && /* @__PURE__ */ r.jsx(Et, {}),
|
|
658
|
+
t
|
|
659
|
+
] });
|
|
660
|
+
}, io = ({ children: t }) => {
|
|
661
|
+
const e = rt(), o = m(() => {
|
|
662
|
+
const u = localStorage.getItem("user") ?? null;
|
|
663
|
+
return u ? JSON.parse(u) : null;
|
|
664
|
+
}, []), [n, s] = p(o()), a = m(async () => {
|
|
665
|
+
let u = null;
|
|
666
|
+
return await e.get("/user/detail").then((M) => {
|
|
667
|
+
u = M.data;
|
|
668
|
+
}).catch(() => {
|
|
669
|
+
u = null;
|
|
670
|
+
}), localStorage.setItem("user", JSON.stringify(u)), u;
|
|
671
|
+
}, [e]), d = m(() => {
|
|
672
|
+
localStorage.removeItem("user");
|
|
673
|
+
}, []), l = m(async () => {
|
|
674
|
+
const u = await a();
|
|
675
|
+
return u ? (s(u), !0) : !1;
|
|
676
|
+
}, [a]), f = m(() => {
|
|
677
|
+
d(), s(null);
|
|
678
|
+
}, [d]), g = $(() => ({ user: n, loginUser: l, logoutUser: f }), [n, l, f]);
|
|
679
|
+
return re(() => {
|
|
680
|
+
s(o());
|
|
681
|
+
}, [o]), /* @__PURE__ */ r.jsx(at.Provider, { value: g, children: t });
|
|
682
|
+
}, Qt = () => {
|
|
683
|
+
const { confirmTexts: t } = be(Ce), { onConfirm: e, onCancel: o, text: n, show: s } = ct();
|
|
684
|
+
return /* @__PURE__ */ r.jsx(N, { show: s, size: "sm", centered: !0, onHide: o, children: /* @__PURE__ */ r.jsxs(N.Body, { children: [
|
|
685
|
+
/* @__PURE__ */ r.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ r.jsx(wt, { variant: "h6", children: n }) }),
|
|
686
|
+
/* @__PURE__ */ r.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
687
|
+
/* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: o, children: t.no }),
|
|
688
|
+
/* @__PURE__ */ r.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: e, children: t.yes })
|
|
652
689
|
] })
|
|
653
690
|
] }) });
|
|
654
691
|
};
|
|
655
692
|
export {
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
693
|
+
st as LoadingContext,
|
|
694
|
+
ao as LoadingProvider,
|
|
695
|
+
Ce as LuminusComponentsContext,
|
|
696
|
+
ro as LuminusComponentsProvider,
|
|
697
|
+
at as UserContext,
|
|
698
|
+
io as UserProvider
|
|
662
699
|
};
|