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