react-luminus-components 1.3.23 → 1.3.25
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 -50
- package/dist/{PrimaryButton-DJLMLJJ7.js → PrimaryButton-Bewa28m7.js} +1 -1
- package/dist/{PrimaryButton-Cx3E5x2b.cjs → PrimaryButton-DXGul-f9.cjs} +1 -1
- package/dist/{SimpleTooltip-CIPtCvs1.js → SimpleTooltip-B7H1sJLN.js} +1 -1
- package/dist/{SimpleTooltip-Dtb0OmTb.cjs → SimpleTooltip-Cssc2MLs.cjs} +1 -1
- package/dist/{UserAvatarToggle-CsTHq7yG.js → UserAvatarToggle-C1CRXpP2.js} +5 -0
- package/dist/{UserAvatarToggle-DJWp7_0z.cjs → UserAvatarToggle-DYIBvTYX.cjs} +1 -1
- package/dist/contexts/delegation/DelegationContext.d.ts +19 -3
- package/dist/contexts/delegation/DelegationProvider.d.ts +2 -1
- package/dist/contexts/index.d.ts +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +220 -191
- package/dist/{dateUtils-7nL2BXlo.js → dateUtils-C7tHbjab.js} +28 -23
- package/dist/{dateUtils-DUA3CKds.cjs → dateUtils-b-AkAh2Y.cjs} +1 -1
- package/dist/hooks/useGetApiData/useGetApiData.d.ts +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +516 -543
- 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 +4 -4
- package/dist/models/types/UseGetApiDataOptions.d.ts +1 -0
- package/dist/useLocalStorageState-CxsNjf78.cjs +1 -0
- package/dist/useLocalStorageState-DblJQuM7.js +73 -0
- package/dist/{usePermissions-DUTyAK35.cjs → usePermissions-BEKIk6u3.cjs} +1 -1
- package/dist/{usePermissions-B1eRrluF.js → usePermissions-avh3rydq.js} +1 -1
- package/dist/utils/date/dateUtils.d.ts +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +16 -15
- package/package.json +1 -1
- package/dist/useLocalStorageState-Cg6ipags.js +0 -40
- package/dist/useLocalStorageState-CkEIA-gx.cjs +0 -1
package/dist/contexts.es.js
CHANGED
|
@@ -1,69 +1,70 @@
|
|
|
1
|
-
import { j as a, am as
|
|
2
|
-
import
|
|
1
|
+
import { j as a, am as H, Q as b, an as M, ao as q, ap as V, L as O, K as d, aq as $, ar as Q, as as D, ab as J, ae as F, at as z, af as W, ah as N, ag as X, au as Y } from "./UserAvatarToggle-C1CRXpP2.js";
|
|
2
|
+
import Z, { useState as h, useCallback as E, useMemo as C, useContext as L, useEffect as v, useRef as K, useReducer as ee } from "react";
|
|
3
3
|
import "./latinize-BQrinury.js";
|
|
4
4
|
import "react-hook-form";
|
|
5
|
-
import { u as
|
|
6
|
-
import { M as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
import { u as te, a as ne, b as se, c as oe } from "./useLocalStorageState-DblJQuM7.js";
|
|
6
|
+
import { M as S, b as re, P as _, L as ae, E as f } from "./PrimaryButton-Bewa28m7.js";
|
|
7
|
+
import { m as ce } from "./dateUtils-C7tHbjab.js";
|
|
8
|
+
const le = ({ children: e }) => {
|
|
9
|
+
const [r, t] = h(!1), [s, n] = h(""), o = E((i) => {
|
|
10
|
+
t(!0), n(i);
|
|
11
|
+
}, []), c = E(() => {
|
|
11
12
|
t(!1);
|
|
12
|
-
}, []),
|
|
13
|
-
return /* @__PURE__ */ a.jsxs(
|
|
14
|
-
/* @__PURE__ */ a.jsx(
|
|
13
|
+
}, []), l = C(() => ({ show: r, text: s, showConfirm: o, hideConfirm: c }), [r, s, o, c]);
|
|
14
|
+
return /* @__PURE__ */ a.jsxs(H.Provider, { value: l, children: [
|
|
15
|
+
/* @__PURE__ */ a.jsx(Ee, {}),
|
|
15
16
|
e
|
|
16
17
|
] });
|
|
17
|
-
},
|
|
18
|
-
const { confirmTexts: e } =
|
|
18
|
+
}, ie = () => {
|
|
19
|
+
const { confirmTexts: e } = L(b), { isShown: r, text: t, onFinish: s } = te(), { options: n } = L(M), [o, c] = h(n.defaultValue ?? ""), l = E(() => {
|
|
19
20
|
s(null);
|
|
20
|
-
}, [s]),
|
|
21
|
-
|
|
21
|
+
}, [s]), i = E((u) => {
|
|
22
|
+
u.preventDefault(), !(n.required && !o) && s(o);
|
|
22
23
|
}, [s, n.required, o]);
|
|
23
|
-
|
|
24
|
+
v(() => {
|
|
24
25
|
r === !0 && c(n.defaultValue ?? "");
|
|
25
26
|
}, [r, n.defaultValue]);
|
|
26
|
-
const g =
|
|
27
|
+
const g = C(() => ({
|
|
27
28
|
value: o,
|
|
28
|
-
onChange: (
|
|
29
|
+
onChange: (u) => c(u.currentTarget.value),
|
|
29
30
|
className: "w-100",
|
|
30
31
|
autoFocus: !0,
|
|
31
32
|
tabIndex: 0
|
|
32
33
|
}), [o]);
|
|
33
|
-
return /* @__PURE__ */ a.jsxs(
|
|
34
|
-
/* @__PURE__ */ a.jsx(
|
|
35
|
-
/* @__PURE__ */ a.jsxs("form", { onSubmit:
|
|
36
|
-
/* @__PURE__ */ a.jsxs(
|
|
34
|
+
return /* @__PURE__ */ a.jsxs(S, { show: r, size: "sm", centered: !0, onHide: l, children: [
|
|
35
|
+
/* @__PURE__ */ a.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(S.Title, { children: t }) }),
|
|
36
|
+
/* @__PURE__ */ a.jsxs("form", { onSubmit: i, children: [
|
|
37
|
+
/* @__PURE__ */ a.jsxs(S.Body, { children: [
|
|
37
38
|
n.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...g, rows: 5 }) : void 0,
|
|
38
|
-
n.input === "input" ? /* @__PURE__ */ a.jsx(
|
|
39
|
+
n.input === "input" ? /* @__PURE__ */ a.jsx(re, { ...g, type: n.type }) : void 0
|
|
39
40
|
] }),
|
|
40
|
-
/* @__PURE__ */ a.jsxs(
|
|
41
|
-
/* @__PURE__ */ a.jsx(
|
|
42
|
-
/* @__PURE__ */ a.jsx(
|
|
41
|
+
/* @__PURE__ */ a.jsxs(S.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
42
|
+
/* @__PURE__ */ a.jsx(_, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: e.cancel }),
|
|
43
|
+
/* @__PURE__ */ a.jsx(_, { color: "primary", disabled: n.required && !o, type: "submit", className: "flex-grow-1", children: e.confirm })
|
|
43
44
|
] })
|
|
44
45
|
] })
|
|
45
46
|
] });
|
|
46
|
-
},
|
|
47
|
-
const [r, t] = h(!1), [s, n] = h(""), [o, c] = h({ input: "textarea", type: "text" }),
|
|
48
|
-
}),
|
|
49
|
-
n(
|
|
50
|
-
}, []), g =
|
|
47
|
+
}, ue = ({ children: e }) => {
|
|
48
|
+
const [r, t] = h(!1), [s, n] = h(""), [o, c] = h({ input: "textarea", type: "text" }), l = K(() => {
|
|
49
|
+
}), i = E((T) => {
|
|
50
|
+
n(T), t(!0);
|
|
51
|
+
}, []), g = E(() => {
|
|
51
52
|
t(!1);
|
|
52
|
-
}, []),
|
|
53
|
+
}, []), u = C(() => ({
|
|
53
54
|
isShown: r,
|
|
54
55
|
text: s,
|
|
55
|
-
showPrompt:
|
|
56
|
+
showPrompt: i,
|
|
56
57
|
hidePrompt: g,
|
|
57
|
-
resolveRef:
|
|
58
|
+
resolveRef: l,
|
|
58
59
|
options: o,
|
|
59
60
|
setOptions: c
|
|
60
|
-
}), [r, s,
|
|
61
|
-
return /* @__PURE__ */ a.jsxs(
|
|
61
|
+
}), [r, s, i, g, o]);
|
|
62
|
+
return /* @__PURE__ */ a.jsxs(M.Provider, { value: u, children: [
|
|
62
63
|
e,
|
|
63
|
-
/* @__PURE__ */ a.jsx(
|
|
64
|
+
/* @__PURE__ */ a.jsx(ie, {})
|
|
64
65
|
] });
|
|
65
|
-
},
|
|
66
|
-
const
|
|
66
|
+
}, Ne = ({ cookieDomain: e, axiosOptions: r, LinkComponent: t, NavigateComponent: s, language: n, axiosTexts: o, confirmTexts: c, formValidationTexts: l, homeDashboardTexts: i, formSubmitTexts: g, appSearchTexts: u, customSelectTexts: T, errorBoundaryTexts: y, widgetTexts: I, children: P }) => {
|
|
67
|
+
const p = C(() => ({
|
|
67
68
|
axiosOptions: r,
|
|
68
69
|
cookieDomain: e,
|
|
69
70
|
LinkComponent: t,
|
|
@@ -71,13 +72,13 @@ const se = ({ children: e }) => {
|
|
|
71
72
|
language: n,
|
|
72
73
|
axiosTexts: o,
|
|
73
74
|
confirmTexts: c,
|
|
74
|
-
formValidationTexts:
|
|
75
|
-
homeDashboardTexts:
|
|
75
|
+
formValidationTexts: l,
|
|
76
|
+
homeDashboardTexts: i,
|
|
76
77
|
formSubmitTexts: g,
|
|
77
|
-
appSearchTexts:
|
|
78
|
-
customSelectTexts:
|
|
79
|
-
errorBoundaryTexts:
|
|
80
|
-
widgetTexts:
|
|
78
|
+
appSearchTexts: u,
|
|
79
|
+
customSelectTexts: T,
|
|
80
|
+
errorBoundaryTexts: y,
|
|
81
|
+
widgetTexts: I
|
|
81
82
|
}), [
|
|
82
83
|
r,
|
|
83
84
|
e,
|
|
@@ -86,31 +87,31 @@ const se = ({ children: e }) => {
|
|
|
86
87
|
n,
|
|
87
88
|
o,
|
|
88
89
|
c,
|
|
90
|
+
l,
|
|
89
91
|
i,
|
|
90
|
-
d,
|
|
91
92
|
g,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
u,
|
|
94
|
+
T,
|
|
95
|
+
y,
|
|
96
|
+
I
|
|
96
97
|
]);
|
|
97
|
-
return /* @__PURE__ */ a.jsx(
|
|
98
|
-
/* @__PURE__ */ a.jsx(
|
|
99
|
-
|
|
98
|
+
return /* @__PURE__ */ a.jsx(b.Provider, { value: p, children: /* @__PURE__ */ a.jsx(le, { children: /* @__PURE__ */ a.jsxs(ue, { children: [
|
|
99
|
+
/* @__PURE__ */ a.jsx(q, {}),
|
|
100
|
+
P
|
|
100
101
|
] }) }) });
|
|
101
|
-
},
|
|
102
|
-
const [r, t] = h(!1), [s] = h(/* @__PURE__ */ new Set()), n =
|
|
103
|
-
s.add(
|
|
104
|
-
}, [s]), o =
|
|
105
|
-
s.delete(
|
|
106
|
-
}, [s]), c =
|
|
107
|
-
return /* @__PURE__ */ a.jsxs(
|
|
108
|
-
r && /* @__PURE__ */ a.jsx(
|
|
102
|
+
}, Le = ({ children: e }) => {
|
|
103
|
+
const [r, t] = h(!1), [s] = h(/* @__PURE__ */ new Set()), n = E((l) => {
|
|
104
|
+
s.add(l), t(!0);
|
|
105
|
+
}, [s]), o = E((l) => {
|
|
106
|
+
s.delete(l), s.size === 0 && t(!1);
|
|
107
|
+
}, [s]), c = C(() => ({ isLoading: r, startLoading: n, stopLoading: o }), [r, n, o]);
|
|
108
|
+
return /* @__PURE__ */ a.jsxs(V.Provider, { value: c, children: [
|
|
109
|
+
r && /* @__PURE__ */ a.jsx(ae, {}),
|
|
109
110
|
e
|
|
110
111
|
] });
|
|
111
112
|
};
|
|
112
113
|
/*! @azure/msal-browser v3.14.0 2024-05-07 */
|
|
113
|
-
class
|
|
114
|
+
class de {
|
|
114
115
|
/**
|
|
115
116
|
* Gets interaction status from event message
|
|
116
117
|
* @param message
|
|
@@ -118,40 +119,40 @@ class ae {
|
|
|
118
119
|
*/
|
|
119
120
|
static getInteractionStatusFromEvent(r, t) {
|
|
120
121
|
switch (r.eventType) {
|
|
121
|
-
case
|
|
122
|
-
return
|
|
123
|
-
case
|
|
124
|
-
return
|
|
125
|
-
case
|
|
126
|
-
if (r.interactionType ===
|
|
127
|
-
return
|
|
122
|
+
case f.LOGIN_START:
|
|
123
|
+
return d.Login;
|
|
124
|
+
case f.SSO_SILENT_START:
|
|
125
|
+
return d.SsoSilent;
|
|
126
|
+
case f.ACQUIRE_TOKEN_START:
|
|
127
|
+
if (r.interactionType === O.Redirect || r.interactionType === O.Popup)
|
|
128
|
+
return d.AcquireToken;
|
|
128
129
|
break;
|
|
129
|
-
case
|
|
130
|
-
return
|
|
131
|
-
case
|
|
132
|
-
return
|
|
133
|
-
case
|
|
134
|
-
case
|
|
135
|
-
if (t && t !==
|
|
130
|
+
case f.HANDLE_REDIRECT_START:
|
|
131
|
+
return d.HandleRedirect;
|
|
132
|
+
case f.LOGOUT_START:
|
|
133
|
+
return d.Logout;
|
|
134
|
+
case f.SSO_SILENT_SUCCESS:
|
|
135
|
+
case f.SSO_SILENT_FAILURE:
|
|
136
|
+
if (t && t !== d.SsoSilent)
|
|
136
137
|
break;
|
|
137
|
-
return
|
|
138
|
-
case
|
|
139
|
-
if (t && t !==
|
|
138
|
+
return d.None;
|
|
139
|
+
case f.LOGOUT_END:
|
|
140
|
+
if (t && t !== d.Logout)
|
|
140
141
|
break;
|
|
141
|
-
return
|
|
142
|
-
case
|
|
143
|
-
if (t && t !==
|
|
142
|
+
return d.None;
|
|
143
|
+
case f.HANDLE_REDIRECT_END:
|
|
144
|
+
if (t && t !== d.HandleRedirect)
|
|
144
145
|
break;
|
|
145
|
-
return
|
|
146
|
-
case
|
|
147
|
-
case
|
|
148
|
-
case
|
|
149
|
-
case
|
|
150
|
-
case
|
|
151
|
-
if (r.interactionType ===
|
|
152
|
-
if (t && t !==
|
|
146
|
+
return d.None;
|
|
147
|
+
case f.LOGIN_SUCCESS:
|
|
148
|
+
case f.LOGIN_FAILURE:
|
|
149
|
+
case f.ACQUIRE_TOKEN_SUCCESS:
|
|
150
|
+
case f.ACQUIRE_TOKEN_FAILURE:
|
|
151
|
+
case f.RESTORE_FROM_BFCACHE:
|
|
152
|
+
if (r.interactionType === O.Redirect || r.interactionType === O.Popup) {
|
|
153
|
+
if (t && t !== d.Login && t !== d.AcquireToken)
|
|
153
154
|
break;
|
|
154
|
-
return
|
|
155
|
+
return d.None;
|
|
155
156
|
}
|
|
156
157
|
break;
|
|
157
158
|
}
|
|
@@ -159,55 +160,55 @@ class ae {
|
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
162
|
-
const
|
|
163
|
+
const fe = "@azure/msal-react", G = "2.0.16";
|
|
163
164
|
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
164
|
-
const
|
|
165
|
+
const w = {
|
|
165
166
|
UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
|
|
166
167
|
EVENT: "EVENT"
|
|
167
|
-
},
|
|
168
|
+
}, me = (e, r) => {
|
|
168
169
|
const { type: t, payload: s } = r;
|
|
169
170
|
let n = e.inProgress;
|
|
170
171
|
switch (t) {
|
|
171
|
-
case
|
|
172
|
-
e.inProgress ===
|
|
172
|
+
case w.UNBLOCK_INPROGRESS:
|
|
173
|
+
e.inProgress === d.Startup && (n = d.None, s.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
|
|
173
174
|
break;
|
|
174
|
-
case
|
|
175
|
-
const c = s.message,
|
|
176
|
-
|
|
175
|
+
case w.EVENT:
|
|
176
|
+
const c = s.message, l = de.getInteractionStatusFromEvent(c, e.inProgress);
|
|
177
|
+
l && (s.logger.info(`MsalProvider - ${c.eventType} results in setting inProgress from ${e.inProgress} to ${l}`), n = l);
|
|
177
178
|
break;
|
|
178
179
|
default:
|
|
179
180
|
throw new Error(`Unknown action type: ${t}`);
|
|
180
181
|
}
|
|
181
182
|
const o = s.instance.getAllAccounts();
|
|
182
|
-
return n !== e.inProgress && !
|
|
183
|
+
return n !== e.inProgress && !D(o, e.accounts) ? {
|
|
183
184
|
...e,
|
|
184
185
|
inProgress: n,
|
|
185
186
|
accounts: o
|
|
186
187
|
} : n !== e.inProgress ? {
|
|
187
188
|
...e,
|
|
188
189
|
inProgress: n
|
|
189
|
-
} :
|
|
190
|
+
} : D(o, e.accounts) ? e : {
|
|
190
191
|
...e,
|
|
191
192
|
accounts: o
|
|
192
193
|
};
|
|
193
194
|
};
|
|
194
|
-
function
|
|
195
|
-
|
|
196
|
-
e.initializeWrapperLibrary(
|
|
195
|
+
function ge({ instance: e, children: r }) {
|
|
196
|
+
v(() => {
|
|
197
|
+
e.initializeWrapperLibrary($.React, G);
|
|
197
198
|
}, [e]);
|
|
198
|
-
const t =
|
|
199
|
-
inProgress:
|
|
199
|
+
const t = C(() => e.getLogger().clone(fe, G), [e]), [s, n] = ee(me, void 0, () => ({
|
|
200
|
+
inProgress: d.Startup,
|
|
200
201
|
accounts: e.getAllAccounts()
|
|
201
202
|
}));
|
|
202
|
-
|
|
203
|
-
const c = e.addEventCallback((
|
|
203
|
+
v(() => {
|
|
204
|
+
const c = e.addEventCallback((l) => {
|
|
204
205
|
n({
|
|
205
206
|
payload: {
|
|
206
207
|
instance: e,
|
|
207
208
|
logger: t,
|
|
208
|
-
message:
|
|
209
|
+
message: l
|
|
209
210
|
},
|
|
210
|
-
type:
|
|
211
|
+
type: w.EVENT
|
|
211
212
|
});
|
|
212
213
|
});
|
|
213
214
|
return t.verbose(`MsalProvider - Registered event callback with id: ${c}`), e.initialize().then(() => {
|
|
@@ -218,7 +219,7 @@ function le({ instance: e, children: r }) {
|
|
|
218
219
|
instance: e,
|
|
219
220
|
logger: t
|
|
220
221
|
},
|
|
221
|
-
type:
|
|
222
|
+
type: w.UNBLOCK_INPROGRESS
|
|
222
223
|
});
|
|
223
224
|
});
|
|
224
225
|
}).catch(() => {
|
|
@@ -232,61 +233,56 @@ function le({ instance: e, children: r }) {
|
|
|
232
233
|
accounts: s.accounts,
|
|
233
234
|
logger: t
|
|
234
235
|
};
|
|
235
|
-
return
|
|
236
|
+
return Z.createElement(Q.Provider, { value: o }, r);
|
|
236
237
|
}
|
|
237
|
-
const
|
|
238
|
-
const r =
|
|
239
|
-
const m = await
|
|
240
|
-
m &&
|
|
241
|
-
}, [
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}, [
|
|
245
|
-
const
|
|
238
|
+
const Te = ({ children: e }) => {
|
|
239
|
+
const r = J(), { msalInstance: t } = L(F), { delegation: s, setDelegation: n, setAvailableDelegations: o, refreshAvailableDelegations: c } = L(z), { getToken: l } = W(), [i, g] = h(null), u = E(async () => {
|
|
240
|
+
const m = await l();
|
|
241
|
+
m && g(m);
|
|
242
|
+
}, [l]);
|
|
243
|
+
v(() => {
|
|
244
|
+
u();
|
|
245
|
+
}, [u]);
|
|
246
|
+
const y = E(() => {
|
|
246
247
|
const m = localStorage.getItem("user") ?? null;
|
|
247
248
|
return m ? JSON.parse(m ?? "") : null;
|
|
248
|
-
}, [])(), [I,
|
|
249
|
-
state:
|
|
250
|
-
user:
|
|
251
|
-
}),
|
|
249
|
+
}, [])(), [I, P] = h({
|
|
250
|
+
state: y ? N.LOGGED_IN : N.LOGGING_IN,
|
|
251
|
+
user: y
|
|
252
|
+
}), p = E(async (m) => {
|
|
252
253
|
let x = null;
|
|
253
|
-
return await r.get("/user/detail", m ? { headers: { Authorization: `Bearer ${m}` } } : void 0).then((
|
|
254
|
-
x =
|
|
254
|
+
return await r.get("/user/detail", m ? { headers: { Authorization: `Bearer ${m}` } } : void 0).then((j) => {
|
|
255
|
+
x = j.data;
|
|
255
256
|
}).catch(() => {
|
|
256
257
|
x = null;
|
|
257
258
|
}), x;
|
|
258
|
-
}, [r]),
|
|
259
|
-
localStorage.removeItem("user"),
|
|
260
|
-
state:
|
|
259
|
+
}, [r]), k = E(() => {
|
|
260
|
+
localStorage.removeItem("user"), P({
|
|
261
|
+
state: N.LOGGED_OUT,
|
|
261
262
|
user: null
|
|
262
|
-
});
|
|
263
|
-
}, []),
|
|
264
|
-
|
|
265
|
-
state:
|
|
263
|
+
}), n(null), o(null);
|
|
264
|
+
}, [o, n]), R = E(async (m) => {
|
|
265
|
+
P({
|
|
266
|
+
state: N.LOGGING_IN,
|
|
266
267
|
user: null
|
|
267
268
|
});
|
|
268
|
-
const x = await
|
|
269
|
-
return x ? (
|
|
270
|
-
state:
|
|
269
|
+
const x = await p(m);
|
|
270
|
+
return x ? (P({
|
|
271
|
+
state: N.LOGGED_IN,
|
|
271
272
|
user: x
|
|
272
|
-
}), localStorage.setItem("user", JSON.stringify(x)), !0) : (
|
|
273
|
-
state:
|
|
273
|
+
}), localStorage.setItem("user", JSON.stringify(x)), await c(), !0) : (P({
|
|
274
|
+
state: N.LOGIN_FAILED,
|
|
274
275
|
user: null
|
|
275
276
|
}), !1);
|
|
276
|
-
}, [
|
|
277
|
-
|
|
278
|
-
}, [
|
|
279
|
-
|
|
280
|
-
userLoginState: I,
|
|
281
|
-
loginUser: N,
|
|
282
|
-
logoutUser: T
|
|
283
|
-
}), [I, N, T]);
|
|
284
|
-
return P(() => {
|
|
277
|
+
}, [p, c]), A = E(() => {
|
|
278
|
+
k();
|
|
279
|
+
}, [k]);
|
|
280
|
+
v(() => {
|
|
285
281
|
if (t) {
|
|
286
282
|
const m = t.addEventCallback((x) => {
|
|
287
|
-
if (x.eventType ===
|
|
288
|
-
const
|
|
289
|
-
|
|
283
|
+
if (x.eventType === f.LOGIN_SUCCESS && x.payload) {
|
|
284
|
+
const j = x.payload;
|
|
285
|
+
g(j.accessToken);
|
|
290
286
|
}
|
|
291
287
|
});
|
|
292
288
|
return () => {
|
|
@@ -295,25 +291,36 @@ const Se = ({ children: e }) => {
|
|
|
295
291
|
}
|
|
296
292
|
return () => {
|
|
297
293
|
};
|
|
298
|
-
}, [t,
|
|
299
|
-
|
|
300
|
-
|
|
294
|
+
}, [t, R, A]);
|
|
295
|
+
const U = E(async (m) => {
|
|
296
|
+
m && await R(m).catch(() => {
|
|
297
|
+
A(), n(null);
|
|
301
298
|
});
|
|
302
|
-
}, [
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
}, [R, A, n]);
|
|
300
|
+
v(() => {
|
|
301
|
+
U(i);
|
|
302
|
+
}, [i, s == null ? void 0 : s.id, U]);
|
|
303
|
+
const B = C(() => ({
|
|
304
|
+
user: I.user,
|
|
305
|
+
userLoginState: I,
|
|
306
|
+
loginUser: R,
|
|
307
|
+
logoutUser: A
|
|
308
|
+
}), [I, R, A]);
|
|
309
|
+
return /* @__PURE__ */ a.jsx(X.Provider, { value: B, children: e });
|
|
310
|
+
}, ye = ({ ...e }) => {
|
|
311
|
+
const { cookieDomain: r } = L(b), [, t] = Y(["Authorization"]), s = C(() => ({
|
|
305
312
|
useMsal: e.useMsal ?? !1,
|
|
306
313
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
307
314
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
308
315
|
}), [e]);
|
|
309
|
-
return
|
|
316
|
+
return v(() => {
|
|
310
317
|
if (e.useMsal) {
|
|
311
318
|
const n = e.msalInstance.addEventCallback((o) => {
|
|
312
|
-
if (o.eventType ===
|
|
313
|
-
const c = o.payload,
|
|
314
|
-
e.msalInstance.setActiveAccount(
|
|
315
|
-
const
|
|
316
|
-
t("Authorization",
|
|
319
|
+
if (o.eventType === f.LOGIN_SUCCESS || o.eventType === f.ACQUIRE_TOKEN_SUCCESS && o.payload) {
|
|
320
|
+
const c = o.payload, l = c.account;
|
|
321
|
+
e.msalInstance.setActiveAccount(l);
|
|
322
|
+
const i = c.accessToken, g = c.expiresOn;
|
|
323
|
+
t("Authorization", i, {
|
|
317
324
|
path: "/",
|
|
318
325
|
secure: !0,
|
|
319
326
|
sameSite: "none",
|
|
@@ -329,38 +336,60 @@ const Se = ({ children: e }) => {
|
|
|
329
336
|
}
|
|
330
337
|
return () => {
|
|
331
338
|
};
|
|
332
|
-
}, [e, t, r]), /* @__PURE__ */ a.jsx(
|
|
333
|
-
},
|
|
334
|
-
const [
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
339
|
+
}, [e, t, r]), /* @__PURE__ */ a.jsx(F.Provider, { value: s, children: e.useMsal ? /* @__PURE__ */ a.jsx(ge, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
340
|
+
}, Re = ({ children: e, relativeEndpoint: r }) => {
|
|
341
|
+
const [t, s, n] = ne("user-delegation", null), { data: o, setData: c, reloadData: l } = se(r, {
|
|
342
|
+
nullStateBeforeLoad: !1,
|
|
343
|
+
nullStateOnFail: !0
|
|
344
|
+
}), i = K(null);
|
|
345
|
+
v(() => {
|
|
346
|
+
const u = () => {
|
|
347
|
+
l(), i.current = window.setTimeout(u, ce() + 5e3);
|
|
348
|
+
};
|
|
349
|
+
return u(), () => {
|
|
350
|
+
i.current !== null && window.clearTimeout(i.current);
|
|
351
|
+
};
|
|
352
|
+
}, [l]), v(() => {
|
|
353
|
+
const u = () => {
|
|
354
|
+
n();
|
|
338
355
|
};
|
|
339
|
-
return window.addEventListener("focus",
|
|
340
|
-
window.removeEventListener("focus",
|
|
356
|
+
return window.addEventListener("focus", u), () => {
|
|
357
|
+
window.removeEventListener("focus", u);
|
|
341
358
|
};
|
|
342
|
-
}, [
|
|
343
|
-
const
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
359
|
+
}, [n, l]);
|
|
360
|
+
const g = C(() => ({
|
|
361
|
+
delegation: t,
|
|
362
|
+
setDelegation: s,
|
|
363
|
+
availableDelegations: o,
|
|
364
|
+
setAvailableDelegations: c,
|
|
365
|
+
refreshAvailableDelegations: l
|
|
366
|
+
}), [
|
|
367
|
+
t,
|
|
368
|
+
s,
|
|
369
|
+
o,
|
|
370
|
+
c,
|
|
371
|
+
l
|
|
372
|
+
]);
|
|
373
|
+
return /* @__PURE__ */ a.jsx(z.Provider, { value: g, children: e });
|
|
374
|
+
}, Ee = () => {
|
|
375
|
+
const { confirmTexts: e } = L(b), { onConfirm: r, onCancel: t, text: s, show: n } = oe();
|
|
376
|
+
return /* @__PURE__ */ a.jsxs(S, { show: n, size: "sm", centered: !0, onHide: t, children: [
|
|
377
|
+
/* @__PURE__ */ a.jsx(S.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(S.Title, { children: s }) }),
|
|
378
|
+
/* @__PURE__ */ a.jsx(S.Body, { children: /* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
379
|
+
/* @__PURE__ */ a.jsx(_, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: t, children: e.no }),
|
|
380
|
+
/* @__PURE__ */ a.jsx(_, { type: "button", color: "primary", onClick: r, className: "w-100 ml", children: e.yes })
|
|
352
381
|
] }) })
|
|
353
382
|
] });
|
|
354
383
|
};
|
|
355
384
|
export {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
385
|
+
F as AuthContext,
|
|
386
|
+
ye as AuthProvider,
|
|
387
|
+
z as DelegationContext,
|
|
388
|
+
Re as DelegationProvider,
|
|
389
|
+
V as LoadingContext,
|
|
390
|
+
Le as LoadingProvider,
|
|
391
|
+
b as LuminusComponentsContext,
|
|
392
|
+
Ne as LuminusComponentsProvider,
|
|
393
|
+
X as UserContext,
|
|
394
|
+
Te as UserProvider
|
|
366
395
|
};
|