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