react-luminus-components 1.2.28 → 1.2.31
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 +53 -53
- package/dist/EventType-D1zXMD8A.js +63 -0
- package/dist/EventType-DO8vvA6X.cjs +1 -0
- package/dist/{SimpleTooltip-BRhpcft2.cjs → SimpleTooltip-CjMfPKvQ.cjs} +1 -1
- package/dist/{SimpleTooltip-QvdXlxmf.js → SimpleTooltip-cMiObSvf.js} +1 -1
- package/dist/{Typography-ViYwSz0j.js → Typography-B12JkmMC.js} +1 -1
- package/dist/{Typography-tgs5dV12.cjs → Typography-Plu1Wa0_.cjs} +1 -1
- package/dist/{UserAvatarToggle-C3Sj7vJ2.js → UserAvatarToggle-BWDRIIXE.js} +2450 -2036
- package/dist/UserAvatarToggle-DEb7Klk7.cjs +253 -0
- package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +6 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/contexts/auth/AuthContext.d.ts +10 -0
- package/dist/contexts/auth/AuthProvider.d.ts +16 -0
- package/dist/contexts/index.d.ts +2 -0
- package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +2 -1
- package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +3 -2
- package/dist/contexts/user/UserContext.d.ts +1 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +651 -475
- package/dist/hooks/useAuth/hooks/useDevAuth.d.ts +7 -0
- package/dist/hooks/useAuth/hooks/useMsalAuth.d.ts +8 -0
- package/dist/hooks/useAuth/useAuth.d.ts +2 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +4 -4
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +32 -32
- package/dist/main.cjs.js +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.es.js +2170 -1788
- package/dist/{useConfirm-BSs-RcsS.js → useConfirm-CKDkB8lL.js} +1 -1
- package/dist/{useConfirm-D1nPczaK.cjs → useConfirm-QOAtP0re.cjs} +1 -1
- package/dist/{usePermissions-BoFHWnT4.js → usePermissions-Cg_BMKPX.js} +1 -1
- package/dist/{usePermissions-COxTbL_u.cjs → usePermissions-zYTcBjf7.cjs} +1 -1
- package/package.json +3 -1
- package/dist/DataKey-BehuC6mV.js +0 -33
- package/dist/DataKey-CD61sktc.cjs +0 -1
- package/dist/UserAvatarToggle-BKpAJdnv.cjs +0 -253
package/dist/contexts.es.js
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import * as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { a as
|
|
5
|
-
import { T as
|
|
6
|
-
import { d as
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
...
|
|
1
|
+
import { j as a, c as N, e as xe, f as Se, o as He, s as J, g as Ke, h as lt, i as ct, k as M, l as je, m as Le, n as $e, p as dt, r as _e, q as ut, t as K, v as ft, w as ht, x as mt, y as Be, F as Ge, z as gt, A as pt, L as ue, P as ze, C as Et, I as vt, B as yt, D as le, E, W as Ct, G as Tt, H as Pe, b as Rt, J as Ve, U as xt, K as Nt } from "./UserAvatarToggle-BWDRIIXE.js";
|
|
2
|
+
import * as R from "react";
|
|
3
|
+
import bt, { forwardRef as wt, useState as C, useRef as O, useImperativeHandle as St, useEffect as b, useCallback as y, useContext as H, useMemo as w, useReducer as kt } from "react";
|
|
4
|
+
import { a as Mt, u as Ot } from "./useConfirm-CKDkB8lL.js";
|
|
5
|
+
import { T as At } from "./Typography-B12JkmMC.js";
|
|
6
|
+
import { d as It, u as jt, q as D, L as Lt, E as v } from "./EventType-D1zXMD8A.js";
|
|
7
|
+
import _t from "react-dom";
|
|
8
|
+
const Bt = (e) => /* @__PURE__ */ R.forwardRef((t, n) => /* @__PURE__ */ a.jsx("div", {
|
|
9
|
+
...t,
|
|
10
10
|
ref: n,
|
|
11
|
-
className:
|
|
12
|
-
})),
|
|
11
|
+
className: N(t.className, e)
|
|
12
|
+
})), Pt = {
|
|
13
13
|
/** An accessible label indicating the relevant information about the Close Button. */
|
|
14
|
-
"aria-label":
|
|
14
|
+
"aria-label": xe.string,
|
|
15
15
|
/** A callback fired after the Close Button is clicked. */
|
|
16
|
-
onClick:
|
|
16
|
+
onClick: xe.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
|
-
},
|
|
24
|
-
className:
|
|
25
|
-
variant:
|
|
22
|
+
variant: xe.oneOf(["white"])
|
|
23
|
+
}, ke = /* @__PURE__ */ R.forwardRef(({
|
|
24
|
+
className: e,
|
|
25
|
+
variant: t,
|
|
26
26
|
"aria-label": n = "Close",
|
|
27
27
|
...o
|
|
28
|
-
}, s) => /* @__PURE__ */
|
|
28
|
+
}, s) => /* @__PURE__ */ a.jsx("button", {
|
|
29
29
|
ref: s,
|
|
30
30
|
type: "button",
|
|
31
|
-
className:
|
|
31
|
+
className: N("btn-close", t && `btn-close-${t}`, e),
|
|
32
32
|
"aria-label": n,
|
|
33
33
|
...o
|
|
34
34
|
}));
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
var
|
|
38
|
-
function
|
|
39
|
-
if ((!
|
|
40
|
-
var
|
|
41
|
-
|
|
35
|
+
ke.displayName = "CloseButton";
|
|
36
|
+
ke.propTypes = Pt;
|
|
37
|
+
var ce;
|
|
38
|
+
function Ue(e) {
|
|
39
|
+
if ((!ce && ce !== 0 || e) && Se) {
|
|
40
|
+
var t = document.createElement("div");
|
|
41
|
+
t.style.position = "absolute", t.style.top = "-9999px", t.style.width = "50px", t.style.height = "50px", t.style.overflow = "scroll", document.body.appendChild(t), ce = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return ce;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
45
|
+
function Ne(e) {
|
|
46
|
+
e === void 0 && (e = He());
|
|
47
47
|
try {
|
|
48
|
-
var
|
|
49
|
-
return !
|
|
48
|
+
var t = e.activeElement;
|
|
49
|
+
return !t || !t.nodeName ? null : t;
|
|
50
50
|
} catch {
|
|
51
|
-
return
|
|
51
|
+
return e.body;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
const
|
|
56
|
-
return Math.abs(
|
|
54
|
+
function Ut(e = document) {
|
|
55
|
+
const t = e.defaultView;
|
|
56
|
+
return Math.abs(t.innerWidth - e.documentElement.clientWidth);
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
class
|
|
58
|
+
const Fe = It("modal-open");
|
|
59
|
+
class Me {
|
|
60
60
|
constructor({
|
|
61
|
-
ownerDocument:
|
|
61
|
+
ownerDocument: t,
|
|
62
62
|
handleContainerOverflow: n = !0,
|
|
63
63
|
isRTL: o = !1
|
|
64
64
|
} = {}) {
|
|
65
|
-
this.handleContainerOverflow = n, this.isRTL = o, this.modals = [], this.ownerDocument =
|
|
65
|
+
this.handleContainerOverflow = n, this.isRTL = o, this.modals = [], this.ownerDocument = t;
|
|
66
66
|
}
|
|
67
67
|
getScrollbarWidth() {
|
|
68
|
-
return
|
|
68
|
+
return Ut(this.ownerDocument);
|
|
69
69
|
}
|
|
70
70
|
getElement() {
|
|
71
71
|
return (this.ownerDocument || document).body;
|
|
72
72
|
}
|
|
73
|
-
setModalAttributes(
|
|
73
|
+
setModalAttributes(t) {
|
|
74
74
|
}
|
|
75
|
-
removeModalAttributes(
|
|
75
|
+
removeModalAttributes(t) {
|
|
76
76
|
}
|
|
77
|
-
setContainerStyle(
|
|
77
|
+
setContainerStyle(t) {
|
|
78
78
|
const n = {
|
|
79
79
|
overflow: "hidden"
|
|
80
80
|
}, o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.getElement();
|
|
81
|
-
|
|
81
|
+
t.style = {
|
|
82
82
|
overflow: s.style.overflow,
|
|
83
83
|
[o]: s.style[o]
|
|
84
|
-
},
|
|
84
|
+
}, t.scrollBarWidth && (n[o] = `${parseInt(J(s, o) || "0", 10) + t.scrollBarWidth}px`), s.setAttribute(Fe, ""), J(s, n);
|
|
85
85
|
}
|
|
86
86
|
reset() {
|
|
87
|
-
[...this.modals].forEach((
|
|
87
|
+
[...this.modals].forEach((t) => this.remove(t));
|
|
88
88
|
}
|
|
89
|
-
removeContainerStyle(
|
|
89
|
+
removeContainerStyle(t) {
|
|
90
90
|
const n = this.getElement();
|
|
91
|
-
n.removeAttribute(
|
|
91
|
+
n.removeAttribute(Fe), Object.assign(n.style, t.style);
|
|
92
92
|
}
|
|
93
|
-
add(
|
|
94
|
-
let n = this.modals.indexOf(
|
|
95
|
-
return n !== -1 || (n = this.modals.length, this.modals.push(
|
|
93
|
+
add(t) {
|
|
94
|
+
let n = this.modals.indexOf(t);
|
|
95
|
+
return n !== -1 || (n = this.modals.length, this.modals.push(t), this.setModalAttributes(t), n !== 0) || (this.state = {
|
|
96
96
|
scrollBarWidth: this.getScrollbarWidth(),
|
|
97
97
|
style: {}
|
|
98
98
|
}, this.handleContainerOverflow && this.setContainerStyle(this.state)), n;
|
|
99
99
|
}
|
|
100
|
-
remove(
|
|
101
|
-
const n = this.modals.indexOf(
|
|
102
|
-
n !== -1 && (this.modals.splice(n, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(
|
|
100
|
+
remove(t) {
|
|
101
|
+
const n = this.modals.indexOf(t);
|
|
102
|
+
n !== -1 && (this.modals.splice(n, 1), !this.modals.length && this.handleContainerOverflow && this.removeContainerStyle(this.state), this.removeModalAttributes(t));
|
|
103
103
|
}
|
|
104
|
-
isTopModal(
|
|
105
|
-
return !!this.modals.length && this.modals[this.modals.length - 1] ===
|
|
104
|
+
isTopModal(t) {
|
|
105
|
+
return !!this.modals.length && this.modals[this.modals.length - 1] === t;
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
const
|
|
109
|
-
function
|
|
110
|
-
if (
|
|
108
|
+
const Ft = ["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 Dt(e, t) {
|
|
110
|
+
if (e == null)
|
|
111
111
|
return {};
|
|
112
|
-
var n = {}, o = Object.keys(
|
|
113
|
-
for (
|
|
114
|
-
s = o[
|
|
112
|
+
var n = {}, o = Object.keys(e), s, r;
|
|
113
|
+
for (r = 0; r < o.length; r++)
|
|
114
|
+
s = o[r], !(t.indexOf(s) >= 0) && (n[s] = e[s]);
|
|
115
115
|
return n;
|
|
116
116
|
}
|
|
117
|
-
let
|
|
118
|
-
function
|
|
119
|
-
return
|
|
120
|
-
ownerDocument:
|
|
121
|
-
})),
|
|
117
|
+
let be;
|
|
118
|
+
function Wt(e) {
|
|
119
|
+
return be || (be = new Me({
|
|
120
|
+
ownerDocument: e == null ? void 0 : e.document
|
|
121
|
+
})), be;
|
|
122
122
|
}
|
|
123
|
-
function
|
|
124
|
-
const
|
|
123
|
+
function Ht(e) {
|
|
124
|
+
const t = Ke(), n = e || Wt(t), o = O({
|
|
125
125
|
dialog: null,
|
|
126
126
|
backdrop: null
|
|
127
127
|
});
|
|
@@ -129,584 +129,760 @@ function Ot(t) {
|
|
|
129
129
|
add: () => n.add(o.current),
|
|
130
130
|
remove: () => n.remove(o.current),
|
|
131
131
|
isTopModal: () => n.isTopModal(o.current),
|
|
132
|
-
setDialogRef:
|
|
132
|
+
setDialogRef: y((s) => {
|
|
133
133
|
o.current.dialog = s;
|
|
134
134
|
}, []),
|
|
135
|
-
setBackdropRef:
|
|
135
|
+
setBackdropRef: y((s) => {
|
|
136
136
|
o.current.backdrop = s;
|
|
137
137
|
}, [])
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
|
-
const
|
|
140
|
+
const qe = /* @__PURE__ */ wt((e, t) => {
|
|
141
141
|
let {
|
|
142
142
|
show: n = !1,
|
|
143
143
|
role: o = "dialog",
|
|
144
144
|
className: s,
|
|
145
|
-
style:
|
|
146
|
-
children:
|
|
147
|
-
backdrop:
|
|
148
|
-
keyboard:
|
|
145
|
+
style: r,
|
|
146
|
+
children: l,
|
|
147
|
+
backdrop: i = !0,
|
|
148
|
+
keyboard: d = !0,
|
|
149
149
|
onBackdropClick: h,
|
|
150
|
-
onEscapeKeyDown:
|
|
151
|
-
transition:
|
|
152
|
-
runTransition:
|
|
153
|
-
backdropTransition:
|
|
154
|
-
runBackdropTransition:
|
|
155
|
-
autoFocus:
|
|
156
|
-
enforceFocus:
|
|
157
|
-
restoreFocus:
|
|
158
|
-
restoreFocusOptions:
|
|
159
|
-
renderDialog:
|
|
160
|
-
renderBackdrop:
|
|
161
|
-
manager:
|
|
162
|
-
container:
|
|
163
|
-
onShow:
|
|
164
|
-
onHide:
|
|
150
|
+
onEscapeKeyDown: g,
|
|
151
|
+
transition: f,
|
|
152
|
+
runTransition: m,
|
|
153
|
+
backdropTransition: T,
|
|
154
|
+
runBackdropTransition: fe,
|
|
155
|
+
autoFocus: X = !0,
|
|
156
|
+
enforceFocus: he = !0,
|
|
157
|
+
restoreFocus: j = !0,
|
|
158
|
+
restoreFocusOptions: me,
|
|
159
|
+
renderDialog: Y,
|
|
160
|
+
renderBackdrop: ge = (u) => /* @__PURE__ */ a.jsx("div", Object.assign({}, u)),
|
|
161
|
+
manager: pe,
|
|
162
|
+
container: Ee,
|
|
163
|
+
onShow: Z,
|
|
164
|
+
onHide: $ = () => {
|
|
165
165
|
},
|
|
166
|
-
onExit:
|
|
167
|
-
onExited:
|
|
168
|
-
onExiting:
|
|
169
|
-
onEnter:
|
|
170
|
-
onEntering:
|
|
171
|
-
onEntered:
|
|
172
|
-
} =
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
166
|
+
onExit: ve,
|
|
167
|
+
onExited: G,
|
|
168
|
+
onExiting: ee,
|
|
169
|
+
onEnter: te,
|
|
170
|
+
onEntering: ne,
|
|
171
|
+
onEntered: oe
|
|
172
|
+
} = e, ye = Dt(e, Ft);
|
|
173
|
+
const S = Ke(), L = lt(Ee), p = Ht(pe), Ce = ct(), se = jt(n), [A, _] = C(!n), x = O(null);
|
|
174
|
+
St(t, () => p, [p]), Se && !se && n && (x.current = Ne(S == null ? void 0 : S.document)), n && A && _(!1);
|
|
175
|
+
const k = M(() => {
|
|
176
|
+
if (p.add(), B.current = je(document, "keydown", Re), V.current = je(
|
|
177
177
|
document,
|
|
178
178
|
"focus",
|
|
179
179
|
// the timeout is necessary b/c this will run before the new modal is mounted
|
|
180
180
|
// and so steals focus from it
|
|
181
|
-
() => setTimeout(
|
|
181
|
+
() => setTimeout(Te),
|
|
182
182
|
!0
|
|
183
|
-
),
|
|
184
|
-
var
|
|
185
|
-
const
|
|
186
|
-
|
|
183
|
+
), Z && Z(), X) {
|
|
184
|
+
var u, ie;
|
|
185
|
+
const Q = Ne((u = (ie = p.dialog) == null ? void 0 : ie.ownerDocument) != null ? u : S == null ? void 0 : S.document);
|
|
186
|
+
p.dialog && Q && !Le(p.dialog, Q) && (x.current = Q, p.dialog.focus());
|
|
187
187
|
}
|
|
188
|
-
}),
|
|
189
|
-
if (
|
|
190
|
-
var
|
|
191
|
-
(
|
|
188
|
+
}), z = M(() => {
|
|
189
|
+
if (p.remove(), B.current == null || B.current(), V.current == null || V.current(), j) {
|
|
190
|
+
var u;
|
|
191
|
+
(u = x.current) == null || u.focus == null || u.focus(me), x.current = null;
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
|
-
|
|
195
|
-
!n || !
|
|
194
|
+
b(() => {
|
|
195
|
+
!n || !L || k();
|
|
196
196
|
}, [
|
|
197
197
|
n,
|
|
198
|
-
|
|
198
|
+
L,
|
|
199
199
|
/* should never change: */
|
|
200
|
-
|
|
201
|
-
]),
|
|
202
|
-
|
|
203
|
-
}, [
|
|
204
|
-
|
|
200
|
+
k
|
|
201
|
+
]), b(() => {
|
|
202
|
+
A && z();
|
|
203
|
+
}, [A, z]), $e(() => {
|
|
204
|
+
z();
|
|
205
205
|
});
|
|
206
|
-
const
|
|
207
|
-
if (!
|
|
206
|
+
const Te = M(() => {
|
|
207
|
+
if (!he || !Ce() || !p.isTopModal())
|
|
208
208
|
return;
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
}),
|
|
212
|
-
|
|
213
|
-
}),
|
|
214
|
-
|
|
215
|
-
}),
|
|
216
|
-
|
|
209
|
+
const u = Ne(S == null ? void 0 : S.document);
|
|
210
|
+
p.dialog && u && !Le(p.dialog, u) && p.dialog.focus();
|
|
211
|
+
}), re = M((u) => {
|
|
212
|
+
u.target === u.currentTarget && (h == null || h(u), i === !0 && $());
|
|
213
|
+
}), Re = M((u) => {
|
|
214
|
+
d && dt(u) && p.isTopModal() && (g == null || g(u), u.defaultPrevented || $());
|
|
215
|
+
}), V = O(), B = O(), ae = (...u) => {
|
|
216
|
+
_(!0), G == null || G(...u);
|
|
217
217
|
};
|
|
218
|
-
if (!
|
|
218
|
+
if (!L)
|
|
219
219
|
return null;
|
|
220
|
-
const
|
|
220
|
+
const P = Object.assign({
|
|
221
221
|
role: o,
|
|
222
|
-
ref:
|
|
222
|
+
ref: p.setDialogRef,
|
|
223
223
|
// apparently only works on the dialog role element
|
|
224
224
|
"aria-modal": o === "dialog" ? !0 : void 0
|
|
225
|
-
},
|
|
226
|
-
style:
|
|
225
|
+
}, ye, {
|
|
226
|
+
style: r,
|
|
227
227
|
className: s,
|
|
228
228
|
tabIndex: -1
|
|
229
229
|
});
|
|
230
|
-
let
|
|
231
|
-
children: /* @__PURE__ */
|
|
230
|
+
let q = Y ? Y(P) : /* @__PURE__ */ a.jsx("div", Object.assign({}, P, {
|
|
231
|
+
children: /* @__PURE__ */ R.cloneElement(l, {
|
|
232
232
|
role: "document"
|
|
233
233
|
})
|
|
234
234
|
}));
|
|
235
|
-
|
|
235
|
+
q = _e(f, m, {
|
|
236
236
|
unmountOnExit: !0,
|
|
237
237
|
mountOnEnter: !0,
|
|
238
238
|
appear: !0,
|
|
239
239
|
in: !!n,
|
|
240
|
-
onExit:
|
|
241
|
-
onExiting:
|
|
242
|
-
onExited:
|
|
243
|
-
onEnter:
|
|
244
|
-
onEntering:
|
|
245
|
-
onEntered:
|
|
246
|
-
children:
|
|
240
|
+
onExit: ve,
|
|
241
|
+
onExiting: ee,
|
|
242
|
+
onExited: ae,
|
|
243
|
+
onEnter: te,
|
|
244
|
+
onEntering: ne,
|
|
245
|
+
onEntered: oe,
|
|
246
|
+
children: q
|
|
247
247
|
});
|
|
248
|
-
let
|
|
249
|
-
return
|
|
250
|
-
ref:
|
|
251
|
-
onClick:
|
|
252
|
-
}),
|
|
248
|
+
let U = null;
|
|
249
|
+
return i && (U = ge({
|
|
250
|
+
ref: p.setBackdropRef,
|
|
251
|
+
onClick: re
|
|
252
|
+
}), U = _e(T, fe, {
|
|
253
253
|
in: !!n,
|
|
254
254
|
appear: !0,
|
|
255
255
|
mountOnEnter: !0,
|
|
256
256
|
unmountOnExit: !0,
|
|
257
|
-
children:
|
|
258
|
-
})), /* @__PURE__ */
|
|
259
|
-
children: /* @__PURE__ */
|
|
260
|
-
children: [
|
|
261
|
-
}),
|
|
257
|
+
children: U
|
|
258
|
+
})), /* @__PURE__ */ a.jsx(a.Fragment, {
|
|
259
|
+
children: /* @__PURE__ */ _t.createPortal(/* @__PURE__ */ a.jsxs(a.Fragment, {
|
|
260
|
+
children: [U, q]
|
|
261
|
+
}), L)
|
|
262
262
|
});
|
|
263
263
|
});
|
|
264
|
-
|
|
265
|
-
const
|
|
266
|
-
Manager:
|
|
264
|
+
qe.displayName = "Modal";
|
|
265
|
+
const Kt = Object.assign(qe, {
|
|
266
|
+
Manager: Me
|
|
267
267
|
});
|
|
268
|
-
function
|
|
269
|
-
|
|
268
|
+
function $t(e, t) {
|
|
269
|
+
e.classList ? e.classList.add(t) : ut(e, t) || (typeof e.className == "string" ? e.className = e.className + " " + t : e.setAttribute("class", (e.className && e.className.baseVal || "") + " " + t));
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
return
|
|
271
|
+
function De(e, t) {
|
|
272
|
+
return e.replace(new RegExp("(^|\\s)" + t + "(?:\\s|$)", "g"), "$1").replace(/\s+/g, " ").replace(/^\s*|\s*$/g, "");
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
|
|
274
|
+
function Gt(e, t) {
|
|
275
|
+
e.classList ? e.classList.remove(t) : typeof e.className == "string" ? e.className = De(e.className, t) : e.setAttribute("class", De(e.className && e.className.baseVal || "", t));
|
|
276
276
|
}
|
|
277
277
|
const W = {
|
|
278
278
|
FIXED_CONTENT: ".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",
|
|
279
279
|
STICKY_CONTENT: ".sticky-top",
|
|
280
280
|
NAVBAR_TOGGLER: ".navbar-toggler"
|
|
281
281
|
};
|
|
282
|
-
class
|
|
283
|
-
adjustAndStore(
|
|
284
|
-
const s = n.style[
|
|
285
|
-
n.dataset[
|
|
286
|
-
[
|
|
282
|
+
class zt extends Me {
|
|
283
|
+
adjustAndStore(t, n, o) {
|
|
284
|
+
const s = n.style[t];
|
|
285
|
+
n.dataset[t] = s, J(n, {
|
|
286
|
+
[t]: `${parseFloat(J(n, t)) + o}px`
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
|
-
restore(
|
|
290
|
-
const o = n.dataset[
|
|
291
|
-
o !== void 0 && (delete n.dataset[
|
|
292
|
-
[
|
|
289
|
+
restore(t, n) {
|
|
290
|
+
const o = n.dataset[t];
|
|
291
|
+
o !== void 0 && (delete n.dataset[t], J(n, {
|
|
292
|
+
[t]: o
|
|
293
293
|
}));
|
|
294
294
|
}
|
|
295
|
-
setContainerStyle(
|
|
296
|
-
super.setContainerStyle(
|
|
295
|
+
setContainerStyle(t) {
|
|
296
|
+
super.setContainerStyle(t);
|
|
297
297
|
const n = this.getElement();
|
|
298
|
-
if (
|
|
298
|
+
if ($t(n, "modal-open"), !t.scrollBarWidth)
|
|
299
299
|
return;
|
|
300
300
|
const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
301
|
-
D(n, W.FIXED_CONTENT).forEach((
|
|
301
|
+
D(n, W.FIXED_CONTENT).forEach((r) => this.adjustAndStore(o, r, t.scrollBarWidth)), D(n, W.STICKY_CONTENT).forEach((r) => this.adjustAndStore(s, r, -t.scrollBarWidth)), D(n, W.NAVBAR_TOGGLER).forEach((r) => this.adjustAndStore(s, r, t.scrollBarWidth));
|
|
302
302
|
}
|
|
303
|
-
removeContainerStyle(
|
|
304
|
-
super.removeContainerStyle(
|
|
303
|
+
removeContainerStyle(t) {
|
|
304
|
+
super.removeContainerStyle(t);
|
|
305
305
|
const n = this.getElement();
|
|
306
|
-
|
|
306
|
+
Gt(n, "modal-open");
|
|
307
307
|
const o = this.isRTL ? "paddingLeft" : "paddingRight", s = this.isRTL ? "marginLeft" : "marginRight";
|
|
308
|
-
D(n, W.FIXED_CONTENT).forEach((
|
|
308
|
+
D(n, W.FIXED_CONTENT).forEach((r) => this.restore(o, r)), D(n, W.STICKY_CONTENT).forEach((r) => this.restore(s, r)), D(n, W.NAVBAR_TOGGLER).forEach((r) => this.restore(s, r));
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
let
|
|
312
|
-
function
|
|
313
|
-
return
|
|
311
|
+
let we;
|
|
312
|
+
function Vt(e) {
|
|
313
|
+
return we || (we = new zt(e)), we;
|
|
314
314
|
}
|
|
315
|
-
const
|
|
316
|
-
className:
|
|
317
|
-
bsPrefix:
|
|
315
|
+
const Qe = /* @__PURE__ */ R.forwardRef(({
|
|
316
|
+
className: e,
|
|
317
|
+
bsPrefix: t,
|
|
318
318
|
as: n = "div",
|
|
319
319
|
...o
|
|
320
|
-
}, s) => (
|
|
320
|
+
}, s) => (t = K(t, "modal-body"), /* @__PURE__ */ a.jsx(n, {
|
|
321
321
|
ref: s,
|
|
322
|
-
className:
|
|
322
|
+
className: N(e, t),
|
|
323
323
|
...o
|
|
324
324
|
})));
|
|
325
|
-
|
|
326
|
-
const
|
|
325
|
+
Qe.displayName = "ModalBody";
|
|
326
|
+
const Je = /* @__PURE__ */ R.createContext({
|
|
327
327
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
328
328
|
onHide() {
|
|
329
329
|
}
|
|
330
|
-
}),
|
|
331
|
-
bsPrefix:
|
|
332
|
-
className:
|
|
330
|
+
}), Oe = /* @__PURE__ */ R.forwardRef(({
|
|
331
|
+
bsPrefix: e,
|
|
332
|
+
className: t,
|
|
333
333
|
contentClassName: n,
|
|
334
334
|
centered: o,
|
|
335
335
|
size: s,
|
|
336
|
-
fullscreen:
|
|
337
|
-
children:
|
|
338
|
-
scrollable:
|
|
339
|
-
...
|
|
336
|
+
fullscreen: r,
|
|
337
|
+
children: l,
|
|
338
|
+
scrollable: i,
|
|
339
|
+
...d
|
|
340
340
|
}, h) => {
|
|
341
|
-
|
|
342
|
-
const
|
|
343
|
-
return /* @__PURE__ */
|
|
344
|
-
...
|
|
341
|
+
e = K(e, "modal");
|
|
342
|
+
const g = `${e}-dialog`, f = typeof r == "string" ? `${e}-fullscreen-${r}` : `${e}-fullscreen`;
|
|
343
|
+
return /* @__PURE__ */ a.jsx("div", {
|
|
344
|
+
...d,
|
|
345
345
|
ref: h,
|
|
346
|
-
className:
|
|
347
|
-
children: /* @__PURE__ */
|
|
348
|
-
className:
|
|
349
|
-
children:
|
|
346
|
+
className: N(g, t, s && `${e}-${s}`, o && `${g}-centered`, i && `${g}-scrollable`, r && f),
|
|
347
|
+
children: /* @__PURE__ */ a.jsx("div", {
|
|
348
|
+
className: N(`${e}-content`, n),
|
|
349
|
+
children: l
|
|
350
350
|
})
|
|
351
351
|
});
|
|
352
352
|
});
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
className:
|
|
356
|
-
bsPrefix:
|
|
353
|
+
Oe.displayName = "ModalDialog";
|
|
354
|
+
const Xe = /* @__PURE__ */ R.forwardRef(({
|
|
355
|
+
className: e,
|
|
356
|
+
bsPrefix: t,
|
|
357
357
|
as: n = "div",
|
|
358
358
|
...o
|
|
359
|
-
}, s) => (
|
|
359
|
+
}, s) => (t = K(t, "modal-footer"), /* @__PURE__ */ a.jsx(n, {
|
|
360
360
|
ref: s,
|
|
361
|
-
className:
|
|
361
|
+
className: N(e, t),
|
|
362
362
|
...o
|
|
363
363
|
})));
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
closeLabel:
|
|
367
|
-
closeVariant:
|
|
364
|
+
Xe.displayName = "ModalFooter";
|
|
365
|
+
const qt = /* @__PURE__ */ R.forwardRef(({
|
|
366
|
+
closeLabel: e = "Close",
|
|
367
|
+
closeVariant: t,
|
|
368
368
|
closeButton: n = !1,
|
|
369
369
|
onHide: o,
|
|
370
370
|
children: s,
|
|
371
|
-
...
|
|
372
|
-
},
|
|
373
|
-
const
|
|
374
|
-
|
|
371
|
+
...r
|
|
372
|
+
}, l) => {
|
|
373
|
+
const i = H(Je), d = M(() => {
|
|
374
|
+
i == null || i.onHide(), o == null || o();
|
|
375
375
|
});
|
|
376
|
-
return /* @__PURE__ */
|
|
377
|
-
ref:
|
|
378
|
-
...
|
|
379
|
-
children: [s, n && /* @__PURE__ */
|
|
380
|
-
"aria-label":
|
|
381
|
-
variant:
|
|
382
|
-
onClick:
|
|
376
|
+
return /* @__PURE__ */ a.jsxs("div", {
|
|
377
|
+
ref: l,
|
|
378
|
+
...r,
|
|
379
|
+
children: [s, n && /* @__PURE__ */ a.jsx(ke, {
|
|
380
|
+
"aria-label": e,
|
|
381
|
+
variant: t,
|
|
382
|
+
onClick: d
|
|
383
383
|
})]
|
|
384
384
|
});
|
|
385
|
-
}),
|
|
386
|
-
bsPrefix:
|
|
387
|
-
className:
|
|
385
|
+
}), Ye = /* @__PURE__ */ R.forwardRef(({
|
|
386
|
+
bsPrefix: e,
|
|
387
|
+
className: t,
|
|
388
388
|
closeLabel: n = "Close",
|
|
389
389
|
closeButton: o = !1,
|
|
390
390
|
...s
|
|
391
|
-
},
|
|
392
|
-
ref:
|
|
391
|
+
}, r) => (e = K(e, "modal-header"), /* @__PURE__ */ a.jsx(qt, {
|
|
392
|
+
ref: r,
|
|
393
393
|
...s,
|
|
394
|
-
className:
|
|
394
|
+
className: N(t, e),
|
|
395
395
|
closeLabel: n,
|
|
396
396
|
closeButton: o
|
|
397
397
|
})));
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
className:
|
|
401
|
-
bsPrefix:
|
|
402
|
-
as: n =
|
|
398
|
+
Ye.displayName = "ModalHeader";
|
|
399
|
+
const Qt = Bt("h4"), Ze = /* @__PURE__ */ R.forwardRef(({
|
|
400
|
+
className: e,
|
|
401
|
+
bsPrefix: t,
|
|
402
|
+
as: n = Qt,
|
|
403
403
|
...o
|
|
404
|
-
}, s) => (
|
|
404
|
+
}, s) => (t = K(t, "modal-title"), /* @__PURE__ */ a.jsx(n, {
|
|
405
405
|
ref: s,
|
|
406
|
-
className:
|
|
406
|
+
className: N(e, t),
|
|
407
407
|
...o
|
|
408
408
|
})));
|
|
409
|
-
|
|
410
|
-
function
|
|
411
|
-
return /* @__PURE__ */
|
|
412
|
-
...
|
|
409
|
+
Ze.displayName = "ModalTitle";
|
|
410
|
+
function Jt(e) {
|
|
411
|
+
return /* @__PURE__ */ a.jsx(Ge, {
|
|
412
|
+
...e,
|
|
413
413
|
timeout: null
|
|
414
414
|
});
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
return /* @__PURE__ */
|
|
418
|
-
...
|
|
416
|
+
function Xt(e) {
|
|
417
|
+
return /* @__PURE__ */ a.jsx(Ge, {
|
|
418
|
+
...e,
|
|
419
419
|
timeout: null
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
|
-
const
|
|
423
|
-
bsPrefix:
|
|
424
|
-
className:
|
|
422
|
+
const et = /* @__PURE__ */ R.forwardRef(({
|
|
423
|
+
bsPrefix: e,
|
|
424
|
+
className: t,
|
|
425
425
|
style: n,
|
|
426
426
|
dialogClassName: o,
|
|
427
427
|
contentClassName: s,
|
|
428
|
-
children:
|
|
429
|
-
dialogAs:
|
|
430
|
-
"data-bs-theme":
|
|
431
|
-
"aria-labelledby":
|
|
428
|
+
children: r,
|
|
429
|
+
dialogAs: l = Oe,
|
|
430
|
+
"data-bs-theme": i,
|
|
431
|
+
"aria-labelledby": d,
|
|
432
432
|
"aria-describedby": h,
|
|
433
|
-
"aria-label":
|
|
433
|
+
"aria-label": g,
|
|
434
434
|
/* BaseModal props */
|
|
435
|
-
show:
|
|
436
|
-
animation:
|
|
437
|
-
backdrop:
|
|
438
|
-
keyboard:
|
|
439
|
-
onEscapeKeyDown:
|
|
440
|
-
onShow:
|
|
441
|
-
onHide:
|
|
442
|
-
container:
|
|
443
|
-
autoFocus:
|
|
444
|
-
enforceFocus:
|
|
445
|
-
restoreFocus:
|
|
446
|
-
restoreFocusOptions:
|
|
447
|
-
onEntered:
|
|
448
|
-
onExit:
|
|
449
|
-
onExiting:
|
|
450
|
-
onEnter:
|
|
451
|
-
onEntering:
|
|
452
|
-
onExited:
|
|
453
|
-
backdropClassName:
|
|
454
|
-
manager:
|
|
455
|
-
...
|
|
456
|
-
},
|
|
457
|
-
const [
|
|
458
|
-
|
|
459
|
-
const
|
|
460
|
-
onHide:
|
|
461
|
-
}), [
|
|
462
|
-
function
|
|
463
|
-
return
|
|
464
|
-
isRTL:
|
|
435
|
+
show: f = !1,
|
|
436
|
+
animation: m = !0,
|
|
437
|
+
backdrop: T = !0,
|
|
438
|
+
keyboard: fe = !0,
|
|
439
|
+
onEscapeKeyDown: X,
|
|
440
|
+
onShow: he,
|
|
441
|
+
onHide: j,
|
|
442
|
+
container: me,
|
|
443
|
+
autoFocus: Y = !0,
|
|
444
|
+
enforceFocus: ge = !0,
|
|
445
|
+
restoreFocus: pe = !0,
|
|
446
|
+
restoreFocusOptions: Ee,
|
|
447
|
+
onEntered: Z,
|
|
448
|
+
onExit: $,
|
|
449
|
+
onExiting: ve,
|
|
450
|
+
onEnter: G,
|
|
451
|
+
onEntering: ee,
|
|
452
|
+
onExited: te,
|
|
453
|
+
backdropClassName: ne,
|
|
454
|
+
manager: oe,
|
|
455
|
+
...ye
|
|
456
|
+
}, S) => {
|
|
457
|
+
const [L, p] = C({}), [Ce, se] = C(!1), A = O(!1), _ = O(!1), x = O(null), [k, z] = ft(), Te = ht(S, z), re = M(j), Re = mt();
|
|
458
|
+
e = K(e, "modal");
|
|
459
|
+
const V = w(() => ({
|
|
460
|
+
onHide: re
|
|
461
|
+
}), [re]);
|
|
462
|
+
function B() {
|
|
463
|
+
return oe || Vt({
|
|
464
|
+
isRTL: Re
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
|
-
function
|
|
468
|
-
if (!
|
|
467
|
+
function ae(c) {
|
|
468
|
+
if (!Se)
|
|
469
469
|
return;
|
|
470
|
-
const F =
|
|
471
|
-
|
|
472
|
-
paddingRight: F && !
|
|
473
|
-
paddingLeft: !F &&
|
|
470
|
+
const F = B().getScrollbarWidth() > 0, Ie = c.scrollHeight > He(c).documentElement.clientHeight;
|
|
471
|
+
p({
|
|
472
|
+
paddingRight: F && !Ie ? Ue() : void 0,
|
|
473
|
+
paddingLeft: !F && Ie ? Ue() : void 0
|
|
474
474
|
});
|
|
475
475
|
}
|
|
476
|
-
const
|
|
477
|
-
|
|
476
|
+
const P = M(() => {
|
|
477
|
+
k && ae(k.dialog);
|
|
478
478
|
});
|
|
479
|
-
|
|
480
|
-
Be(window, "resize",
|
|
479
|
+
$e(() => {
|
|
480
|
+
Be(window, "resize", P), x.current == null || x.current();
|
|
481
481
|
});
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
-
},
|
|
487
|
-
|
|
488
|
-
|
|
482
|
+
const q = () => {
|
|
483
|
+
A.current = !0;
|
|
484
|
+
}, U = (c) => {
|
|
485
|
+
A.current && k && c.target === k.dialog && (_.current = !0), A.current = !1;
|
|
486
|
+
}, u = () => {
|
|
487
|
+
se(!0), x.current = pt(k.dialog, () => {
|
|
488
|
+
se(!1);
|
|
489
489
|
});
|
|
490
|
-
},
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
if (
|
|
494
|
-
|
|
490
|
+
}, ie = (c) => {
|
|
491
|
+
c.target === c.currentTarget && u();
|
|
492
|
+
}, Q = (c) => {
|
|
493
|
+
if (T === "static") {
|
|
494
|
+
ie(c);
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
|
-
if (
|
|
498
|
-
|
|
497
|
+
if (_.current || c.target !== c.currentTarget) {
|
|
498
|
+
_.current = !1;
|
|
499
499
|
return;
|
|
500
500
|
}
|
|
501
|
-
|
|
502
|
-
},
|
|
503
|
-
|
|
504
|
-
},
|
|
505
|
-
|
|
506
|
-
},
|
|
507
|
-
x.current == null || x.current(),
|
|
508
|
-
},
|
|
509
|
-
|
|
510
|
-
},
|
|
511
|
-
|
|
512
|
-
},
|
|
513
|
-
...
|
|
514
|
-
className:
|
|
515
|
-
}), [
|
|
501
|
+
j == null || j();
|
|
502
|
+
}, tt = (c) => {
|
|
503
|
+
fe ? X == null || X(c) : (c.preventDefault(), T === "static" && u());
|
|
504
|
+
}, nt = (c, F) => {
|
|
505
|
+
c && ae(c), G == null || G(c, F);
|
|
506
|
+
}, ot = (c) => {
|
|
507
|
+
x.current == null || x.current(), $ == null || $(c);
|
|
508
|
+
}, st = (c, F) => {
|
|
509
|
+
ee == null || ee(c, F), gt(window, "resize", P);
|
|
510
|
+
}, rt = (c) => {
|
|
511
|
+
c && (c.style.display = ""), te == null || te(c), Be(window, "resize", P);
|
|
512
|
+
}, at = y((c) => /* @__PURE__ */ a.jsx("div", {
|
|
513
|
+
...c,
|
|
514
|
+
className: N(`${e}-backdrop`, ne, !m && "show")
|
|
515
|
+
}), [m, ne, e]), Ae = {
|
|
516
516
|
...n,
|
|
517
|
-
...
|
|
517
|
+
...L
|
|
518
518
|
};
|
|
519
|
-
|
|
520
|
-
const
|
|
519
|
+
Ae.display = "block";
|
|
520
|
+
const it = (c) => /* @__PURE__ */ a.jsx("div", {
|
|
521
521
|
role: "dialog",
|
|
522
|
-
...
|
|
523
|
-
style:
|
|
524
|
-
className:
|
|
525
|
-
onClick:
|
|
526
|
-
onMouseUp:
|
|
527
|
-
"data-bs-theme":
|
|
528
|
-
"aria-label":
|
|
529
|
-
"aria-labelledby":
|
|
522
|
+
...c,
|
|
523
|
+
style: Ae,
|
|
524
|
+
className: N(t, e, Ce && `${e}-static`, !m && "show"),
|
|
525
|
+
onClick: T ? Q : void 0,
|
|
526
|
+
onMouseUp: U,
|
|
527
|
+
"data-bs-theme": i,
|
|
528
|
+
"aria-label": g,
|
|
529
|
+
"aria-labelledby": d,
|
|
530
530
|
"aria-describedby": h,
|
|
531
|
-
children: /* @__PURE__ */
|
|
532
|
-
...
|
|
533
|
-
onMouseDown:
|
|
531
|
+
children: /* @__PURE__ */ a.jsx(l, {
|
|
532
|
+
...ye,
|
|
533
|
+
onMouseDown: q,
|
|
534
534
|
className: o,
|
|
535
535
|
contentClassName: s,
|
|
536
|
-
children:
|
|
536
|
+
children: r
|
|
537
537
|
})
|
|
538
538
|
});
|
|
539
|
-
return /* @__PURE__ */
|
|
540
|
-
value:
|
|
541
|
-
children: /* @__PURE__ */
|
|
542
|
-
show:
|
|
543
|
-
ref:
|
|
544
|
-
backdrop:
|
|
545
|
-
container:
|
|
539
|
+
return /* @__PURE__ */ a.jsx(Je.Provider, {
|
|
540
|
+
value: V,
|
|
541
|
+
children: /* @__PURE__ */ a.jsx(Kt, {
|
|
542
|
+
show: f,
|
|
543
|
+
ref: Te,
|
|
544
|
+
backdrop: T,
|
|
545
|
+
container: me,
|
|
546
546
|
keyboard: !0,
|
|
547
|
-
autoFocus:
|
|
548
|
-
enforceFocus:
|
|
549
|
-
restoreFocus:
|
|
550
|
-
restoreFocusOptions:
|
|
551
|
-
onEscapeKeyDown:
|
|
552
|
-
onShow:
|
|
553
|
-
onHide:
|
|
554
|
-
onEnter:
|
|
555
|
-
onEntering:
|
|
556
|
-
onEntered:
|
|
557
|
-
onExit:
|
|
558
|
-
onExiting:
|
|
559
|
-
onExited:
|
|
560
|
-
manager:
|
|
561
|
-
transition:
|
|
562
|
-
backdropTransition:
|
|
563
|
-
renderBackdrop:
|
|
564
|
-
renderDialog:
|
|
547
|
+
autoFocus: Y,
|
|
548
|
+
enforceFocus: ge,
|
|
549
|
+
restoreFocus: pe,
|
|
550
|
+
restoreFocusOptions: Ee,
|
|
551
|
+
onEscapeKeyDown: tt,
|
|
552
|
+
onShow: he,
|
|
553
|
+
onHide: j,
|
|
554
|
+
onEnter: nt,
|
|
555
|
+
onEntering: st,
|
|
556
|
+
onEntered: Z,
|
|
557
|
+
onExit: ot,
|
|
558
|
+
onExiting: ve,
|
|
559
|
+
onExited: rt,
|
|
560
|
+
manager: B(),
|
|
561
|
+
transition: m ? Jt : void 0,
|
|
562
|
+
backdropTransition: m ? Xt : void 0,
|
|
563
|
+
renderBackdrop: at,
|
|
564
|
+
renderDialog: it
|
|
565
565
|
})
|
|
566
566
|
});
|
|
567
567
|
});
|
|
568
|
-
|
|
569
|
-
const
|
|
570
|
-
Body:
|
|
571
|
-
Header:
|
|
572
|
-
Title:
|
|
573
|
-
Footer:
|
|
574
|
-
Dialog:
|
|
568
|
+
et.displayName = "Modal";
|
|
569
|
+
const I = Object.assign(et, {
|
|
570
|
+
Body: Qe,
|
|
571
|
+
Header: Ye,
|
|
572
|
+
Title: Ze,
|
|
573
|
+
Footer: Xe,
|
|
574
|
+
Dialog: Oe,
|
|
575
575
|
TRANSITION_DURATION: 300,
|
|
576
576
|
BACKDROP_TRANSITION_DURATION: 150
|
|
577
|
-
}),
|
|
578
|
-
const { confirmTexts:
|
|
577
|
+
}), Yt = () => {
|
|
578
|
+
const { confirmTexts: e } = H(ue), { isShown: t, text: n, onFinish: o } = Mt(), { options: s } = H(ze), [r, l] = C(s.defaultValue ?? ""), i = y(() => {
|
|
579
579
|
o(null);
|
|
580
|
-
}, [o]),
|
|
581
|
-
o(
|
|
582
|
-
}, [o,
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}, [
|
|
586
|
-
const h =
|
|
587
|
-
value:
|
|
588
|
-
onChange: (
|
|
580
|
+
}, [o]), d = y(() => {
|
|
581
|
+
o(r);
|
|
582
|
+
}, [o, r]);
|
|
583
|
+
b(() => {
|
|
584
|
+
t === !0 && l(s.defaultValue ?? "");
|
|
585
|
+
}, [t, s.defaultValue]);
|
|
586
|
+
const h = w(() => ({
|
|
587
|
+
value: r,
|
|
588
|
+
onChange: (g) => l(g.currentTarget.value),
|
|
589
589
|
className: "w-100",
|
|
590
590
|
autoFocus: !0,
|
|
591
591
|
tabIndex: 0
|
|
592
|
-
}), [
|
|
593
|
-
return /* @__PURE__ */
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
596
|
-
s.input === "textarea" ? /* @__PURE__ */
|
|
597
|
-
s.input === "input" ? /* @__PURE__ */
|
|
592
|
+
}), [r]);
|
|
593
|
+
return /* @__PURE__ */ a.jsxs(I, { show: t, size: "sm", centered: !0, onHide: i, children: [
|
|
594
|
+
/* @__PURE__ */ a.jsx(I.Header, { children: /* @__PURE__ */ a.jsx(I.Title, { children: n }) }),
|
|
595
|
+
/* @__PURE__ */ a.jsxs(I.Body, { children: [
|
|
596
|
+
s.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...h, rows: 5 }) : void 0,
|
|
597
|
+
s.input === "input" ? /* @__PURE__ */ a.jsx("input", { ...h, type: s.type }) : void 0
|
|
598
598
|
] }),
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
599
|
+
/* @__PURE__ */ a.jsxs(I.Footer, { children: [
|
|
600
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary", onClick: i, children: e.cancel }),
|
|
601
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary ml", onClick: d, disabled: s.required && !r, children: e.confirm })
|
|
602
602
|
] })
|
|
603
603
|
] });
|
|
604
|
-
},
|
|
605
|
-
const [
|
|
606
|
-
}),
|
|
607
|
-
s(
|
|
608
|
-
}, []), h =
|
|
604
|
+
}, Zt = ({ children: e }) => {
|
|
605
|
+
const [t, n] = C(!1), [o, s] = C(""), [r, l] = C({ input: "textarea", type: "text" }), i = O(() => {
|
|
606
|
+
}), d = y((f) => {
|
|
607
|
+
s(f), n(!0);
|
|
608
|
+
}, []), h = y(() => {
|
|
609
609
|
n(!1);
|
|
610
|
-
}, []),
|
|
611
|
-
isShown:
|
|
610
|
+
}, []), g = w(() => ({
|
|
611
|
+
isShown: t,
|
|
612
612
|
text: o,
|
|
613
|
-
showPrompt:
|
|
613
|
+
showPrompt: d,
|
|
614
614
|
hidePrompt: h,
|
|
615
|
-
resolveRef:
|
|
616
|
-
options:
|
|
617
|
-
setOptions:
|
|
618
|
-
}), [
|
|
619
|
-
return /* @__PURE__ */
|
|
620
|
-
|
|
621
|
-
/* @__PURE__ */
|
|
615
|
+
resolveRef: i,
|
|
616
|
+
options: r,
|
|
617
|
+
setOptions: l
|
|
618
|
+
}), [t, o, d, h, r]);
|
|
619
|
+
return /* @__PURE__ */ a.jsxs(ze.Provider, { value: g, children: [
|
|
620
|
+
e,
|
|
621
|
+
/* @__PURE__ */ a.jsx(Yt, {})
|
|
622
622
|
] });
|
|
623
|
-
},
|
|
624
|
-
const [
|
|
625
|
-
n(!0), s(
|
|
626
|
-
}, []),
|
|
623
|
+
}, en = ({ children: e }) => {
|
|
624
|
+
const [t, n] = C(!1), [o, s] = C(""), r = y((d) => {
|
|
625
|
+
n(!0), s(d);
|
|
626
|
+
}, []), l = y(() => {
|
|
627
627
|
n(!1);
|
|
628
|
-
}, []),
|
|
629
|
-
return /* @__PURE__ */
|
|
630
|
-
/* @__PURE__ */
|
|
631
|
-
|
|
628
|
+
}, []), i = w(() => ({ show: t, text: o, showConfirm: r, hideConfirm: l }), [t, o, r, l]);
|
|
629
|
+
return /* @__PURE__ */ a.jsxs(Et.Provider, { value: i, children: [
|
|
630
|
+
/* @__PURE__ */ a.jsx(rn, {}),
|
|
631
|
+
e
|
|
632
632
|
] });
|
|
633
|
-
},
|
|
634
|
-
const
|
|
635
|
-
axiosInstance:
|
|
636
|
-
cookieDomain:
|
|
633
|
+
}, hn = ({ cookieDomain: e, axiosInstance: t, LinkComponent: n, NavigateComponent: o, language: s, axiosTexts: r, confirmTexts: l, formValidationTexts: i, homeDashboardTexts: d, formSubmitTexts: h, appSearchTexts: g, customSelectTexts: f, children: m }) => {
|
|
634
|
+
const T = w(() => ({
|
|
635
|
+
axiosInstance: t,
|
|
636
|
+
cookieDomain: e,
|
|
637
637
|
LinkComponent: n,
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
638
|
+
NavigateComponent: o,
|
|
639
|
+
language: s,
|
|
640
|
+
axiosTexts: r,
|
|
641
|
+
confirmTexts: l,
|
|
642
|
+
formValidationTexts: i,
|
|
643
|
+
homeDashboardTexts: d,
|
|
644
|
+
formSubmitTexts: h,
|
|
645
|
+
appSearchTexts: g,
|
|
646
|
+
customSelectTexts: f
|
|
646
647
|
}), [
|
|
647
|
-
e,
|
|
648
648
|
t,
|
|
649
|
+
e,
|
|
649
650
|
n,
|
|
650
651
|
o,
|
|
651
652
|
s,
|
|
652
|
-
|
|
653
|
-
u,
|
|
653
|
+
r,
|
|
654
654
|
l,
|
|
655
|
-
|
|
655
|
+
i,
|
|
656
|
+
d,
|
|
656
657
|
h,
|
|
657
|
-
|
|
658
|
+
g,
|
|
659
|
+
f
|
|
658
660
|
]);
|
|
659
|
-
return /* @__PURE__ */
|
|
660
|
-
/* @__PURE__ */
|
|
661
|
-
|
|
661
|
+
return /* @__PURE__ */ a.jsx(ue.Provider, { value: T, children: /* @__PURE__ */ a.jsx(en, { children: /* @__PURE__ */ a.jsxs(Zt, { children: [
|
|
662
|
+
/* @__PURE__ */ a.jsx(vt, {}),
|
|
663
|
+
m
|
|
662
664
|
] }) }) });
|
|
663
|
-
},
|
|
664
|
-
const [
|
|
665
|
-
o.add(
|
|
666
|
-
}, [o]),
|
|
667
|
-
o.delete(
|
|
668
|
-
}, [o]),
|
|
669
|
-
return /* @__PURE__ */
|
|
670
|
-
|
|
671
|
-
|
|
665
|
+
}, mn = ({ children: e }) => {
|
|
666
|
+
const [t, n] = C(!1), [o] = C(/* @__PURE__ */ new Set()), s = y((i) => {
|
|
667
|
+
o.add(i), n(!0);
|
|
668
|
+
}, [o]), r = y((i) => {
|
|
669
|
+
o.delete(i), o.size === 0 && n(!1);
|
|
670
|
+
}, [o]), l = w(() => ({ isLoading: t, startLoading: s, stopLoading: r }), [t, s, r]);
|
|
671
|
+
return /* @__PURE__ */ a.jsxs(yt.Provider, { value: l, children: [
|
|
672
|
+
t && /* @__PURE__ */ a.jsx(Lt, {}),
|
|
673
|
+
e
|
|
672
674
|
] });
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
675
|
+
};
|
|
676
|
+
/*! @azure/msal-browser v3.14.0 2024-05-07 */
|
|
677
|
+
class tn {
|
|
678
|
+
/**
|
|
679
|
+
* Gets interaction status from event message
|
|
680
|
+
* @param message
|
|
681
|
+
* @param currentStatus
|
|
682
|
+
*/
|
|
683
|
+
static getInteractionStatusFromEvent(t, n) {
|
|
684
|
+
switch (t.eventType) {
|
|
685
|
+
case v.LOGIN_START:
|
|
686
|
+
return E.Login;
|
|
687
|
+
case v.SSO_SILENT_START:
|
|
688
|
+
return E.SsoSilent;
|
|
689
|
+
case v.ACQUIRE_TOKEN_START:
|
|
690
|
+
if (t.interactionType === le.Redirect || t.interactionType === le.Popup)
|
|
691
|
+
return E.AcquireToken;
|
|
692
|
+
break;
|
|
693
|
+
case v.HANDLE_REDIRECT_START:
|
|
694
|
+
return E.HandleRedirect;
|
|
695
|
+
case v.LOGOUT_START:
|
|
696
|
+
return E.Logout;
|
|
697
|
+
case v.SSO_SILENT_SUCCESS:
|
|
698
|
+
case v.SSO_SILENT_FAILURE:
|
|
699
|
+
if (n && n !== E.SsoSilent)
|
|
700
|
+
break;
|
|
701
|
+
return E.None;
|
|
702
|
+
case v.LOGOUT_END:
|
|
703
|
+
if (n && n !== E.Logout)
|
|
704
|
+
break;
|
|
705
|
+
return E.None;
|
|
706
|
+
case v.HANDLE_REDIRECT_END:
|
|
707
|
+
if (n && n !== E.HandleRedirect)
|
|
708
|
+
break;
|
|
709
|
+
return E.None;
|
|
710
|
+
case v.LOGIN_SUCCESS:
|
|
711
|
+
case v.LOGIN_FAILURE:
|
|
712
|
+
case v.ACQUIRE_TOKEN_SUCCESS:
|
|
713
|
+
case v.ACQUIRE_TOKEN_FAILURE:
|
|
714
|
+
case v.RESTORE_FROM_BFCACHE:
|
|
715
|
+
if (t.interactionType === le.Redirect || t.interactionType === le.Popup) {
|
|
716
|
+
if (n && n !== E.Login && n !== E.AcquireToken)
|
|
717
|
+
break;
|
|
718
|
+
return E.None;
|
|
719
|
+
}
|
|
720
|
+
break;
|
|
721
|
+
}
|
|
722
|
+
return null;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
726
|
+
const nn = "@azure/msal-react", We = "2.0.16";
|
|
727
|
+
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
728
|
+
const de = {
|
|
729
|
+
UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
|
|
730
|
+
EVENT: "EVENT"
|
|
731
|
+
}, on = (e, t) => {
|
|
732
|
+
const { type: n, payload: o } = t;
|
|
733
|
+
let s = e.inProgress;
|
|
734
|
+
switch (n) {
|
|
735
|
+
case de.UNBLOCK_INPROGRESS:
|
|
736
|
+
e.inProgress === E.Startup && (s = E.None, o.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
|
|
737
|
+
break;
|
|
738
|
+
case de.EVENT:
|
|
739
|
+
const l = o.message, i = tn.getInteractionStatusFromEvent(l, e.inProgress);
|
|
740
|
+
i && (o.logger.info(`MsalProvider - ${l.eventType} results in setting inProgress from ${e.inProgress} to ${i}`), s = i);
|
|
741
|
+
break;
|
|
742
|
+
default:
|
|
743
|
+
throw new Error(`Unknown action type: ${n}`);
|
|
744
|
+
}
|
|
745
|
+
const r = o.instance.getAllAccounts();
|
|
746
|
+
return s !== e.inProgress && !Pe(r, e.accounts) ? {
|
|
747
|
+
...e,
|
|
748
|
+
inProgress: s,
|
|
749
|
+
accounts: r
|
|
750
|
+
} : s !== e.inProgress ? {
|
|
751
|
+
...e,
|
|
752
|
+
inProgress: s
|
|
753
|
+
} : Pe(r, e.accounts) ? e : {
|
|
754
|
+
...e,
|
|
755
|
+
accounts: r
|
|
756
|
+
};
|
|
757
|
+
};
|
|
758
|
+
function sn({ instance: e, children: t }) {
|
|
759
|
+
b(() => {
|
|
760
|
+
e.initializeWrapperLibrary(Ct.React, We);
|
|
761
|
+
}, [e]);
|
|
762
|
+
const n = w(() => e.getLogger().clone(nn, We), [e]), [o, s] = kt(on, void 0, () => ({
|
|
763
|
+
inProgress: E.Startup,
|
|
764
|
+
accounts: e.getAllAccounts()
|
|
765
|
+
}));
|
|
766
|
+
b(() => {
|
|
767
|
+
const l = e.addEventCallback((i) => {
|
|
768
|
+
s({
|
|
769
|
+
payload: {
|
|
770
|
+
instance: e,
|
|
771
|
+
logger: n,
|
|
772
|
+
message: i
|
|
773
|
+
},
|
|
774
|
+
type: de.EVENT
|
|
775
|
+
});
|
|
776
|
+
});
|
|
777
|
+
return n.verbose(`MsalProvider - Registered event callback with id: ${l}`), e.initialize().then(() => {
|
|
778
|
+
e.handleRedirectPromise().catch(() => {
|
|
779
|
+
}).finally(() => {
|
|
780
|
+
s({
|
|
781
|
+
payload: {
|
|
782
|
+
instance: e,
|
|
783
|
+
logger: n
|
|
784
|
+
},
|
|
785
|
+
type: de.UNBLOCK_INPROGRESS
|
|
786
|
+
});
|
|
787
|
+
});
|
|
681
788
|
}).catch(() => {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
789
|
+
}), () => {
|
|
790
|
+
l && (n.verbose(`MsalProvider - Removing event callback ${l}`), e.removeEventCallback(l));
|
|
791
|
+
};
|
|
792
|
+
}, [e, n]);
|
|
793
|
+
const r = {
|
|
794
|
+
instance: e,
|
|
795
|
+
inProgress: o.inProgress,
|
|
796
|
+
accounts: o.accounts,
|
|
797
|
+
logger: n
|
|
798
|
+
};
|
|
799
|
+
return bt.createElement(Tt.Provider, { value: r }, t);
|
|
800
|
+
}
|
|
801
|
+
const gn = ({ children: e }) => {
|
|
802
|
+
const t = Rt(), { msalInstance: n } = H(Ve), o = y(() => {
|
|
803
|
+
const f = localStorage.getItem("user") ?? null;
|
|
804
|
+
return f ? JSON.parse(f) : null;
|
|
805
|
+
}, []), [s, r] = C(o()), l = y(async (f) => {
|
|
806
|
+
let m = null;
|
|
807
|
+
return await t.get("/user/detail", f ? { headers: { Authorization: `Bearer ${f}` } } : void 0).then((T) => {
|
|
808
|
+
m = T.data;
|
|
809
|
+
}).catch(() => {
|
|
810
|
+
m = null;
|
|
811
|
+
}), localStorage.setItem("user", JSON.stringify(m)), m;
|
|
812
|
+
}, [t]), i = y(() => {
|
|
685
813
|
localStorage.removeItem("user");
|
|
686
|
-
}, []),
|
|
687
|
-
const
|
|
688
|
-
return
|
|
689
|
-
}, [
|
|
690
|
-
|
|
691
|
-
}, [
|
|
692
|
-
return
|
|
693
|
-
|
|
694
|
-
}, [
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
814
|
+
}, []), d = y(async (f) => {
|
|
815
|
+
const m = await l(f);
|
|
816
|
+
return m ? (r(m), !0) : !1;
|
|
817
|
+
}, [l]), h = y(() => {
|
|
818
|
+
i(), r(null);
|
|
819
|
+
}, [i]), g = w(() => ({ user: s, loginUser: d, logoutUser: h }), [s, d, h]);
|
|
820
|
+
return b(() => {
|
|
821
|
+
r(o());
|
|
822
|
+
}, [o]), b(() => {
|
|
823
|
+
if (n) {
|
|
824
|
+
const f = n.addEventCallback((m) => {
|
|
825
|
+
if (m.eventType === v.ACQUIRE_TOKEN_SUCCESS && m.payload) {
|
|
826
|
+
const T = m.payload;
|
|
827
|
+
d(T.accessToken).catch(() => h());
|
|
828
|
+
}
|
|
829
|
+
});
|
|
830
|
+
return () => {
|
|
831
|
+
f && n.removeEventCallback(f);
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
return () => {
|
|
835
|
+
};
|
|
836
|
+
}, [n, d, h]), /* @__PURE__ */ a.jsx(xt.Provider, { value: g, children: e });
|
|
837
|
+
}, pn = ({ ...e }) => {
|
|
838
|
+
const { cookieDomain: t } = H(ue), [, n] = Nt(["Authorization"]), [o, s] = C(null), r = w(() => ({
|
|
839
|
+
useMsal: e.useMsal ?? !1,
|
|
840
|
+
storedToken: (o == null ? void 0 : o.token) ?? null,
|
|
841
|
+
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
842
|
+
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
843
|
+
}), [e, o]);
|
|
844
|
+
return b(() => {
|
|
845
|
+
if (e.useMsal) {
|
|
846
|
+
const l = e.msalInstance.addEventCallback((i) => {
|
|
847
|
+
if (i.eventType === v.LOGIN_SUCCESS || i.eventType === v.ACQUIRE_TOKEN_SUCCESS && i.payload) {
|
|
848
|
+
const d = i.payload, h = d.account;
|
|
849
|
+
e.msalInstance.setActiveAccount(h);
|
|
850
|
+
const g = d.accessToken, f = d.expiresOn;
|
|
851
|
+
s({ token: g, expiresOn: f });
|
|
852
|
+
}
|
|
853
|
+
});
|
|
854
|
+
return () => {
|
|
855
|
+
l && e.msalInstance.removeEventCallback(l);
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
return () => {
|
|
859
|
+
};
|
|
860
|
+
}, [e]), b(() => {
|
|
861
|
+
o && n("Authorization", o.token, {
|
|
862
|
+
path: "/",
|
|
863
|
+
secure: !0,
|
|
864
|
+
sameSite: "none",
|
|
865
|
+
domain: t,
|
|
866
|
+
expires: o.expiresOn ?? void 0
|
|
867
|
+
});
|
|
868
|
+
}, [o, t, n]), /* @__PURE__ */ a.jsx(Ve.Provider, { value: r, children: e.useMsal ? /* @__PURE__ */ a.jsx(sn, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
869
|
+
}, rn = () => {
|
|
870
|
+
const { confirmTexts: e } = H(ue), { onConfirm: t, onCancel: n, text: o, show: s } = Ot();
|
|
871
|
+
return /* @__PURE__ */ a.jsx(I, { show: s, size: "sm", centered: !0, onHide: n, children: /* @__PURE__ */ a.jsxs(I.Body, { children: [
|
|
872
|
+
/* @__PURE__ */ a.jsx("div", { className: "mb-5 text-center", children: /* @__PURE__ */ a.jsx(At, { variant: "h6", children: o }) }),
|
|
873
|
+
/* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
874
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-secondary w-100", onClick: n, children: e.no }),
|
|
875
|
+
/* @__PURE__ */ a.jsx("button", { type: "button", className: "btn btn-primary w-100 ml", onClick: t, children: e.yes })
|
|
702
876
|
] })
|
|
703
877
|
] }) });
|
|
704
878
|
};
|
|
705
879
|
export {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
880
|
+
Ve as AuthContext,
|
|
881
|
+
pn as AuthProvider,
|
|
882
|
+
yt as LoadingContext,
|
|
883
|
+
mn as LoadingProvider,
|
|
884
|
+
ue as LuminusComponentsContext,
|
|
885
|
+
hn as LuminusComponentsProvider,
|
|
886
|
+
xt as UserContext,
|
|
887
|
+
gn as UserProvider
|
|
712
888
|
};
|