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