react-luminus-components 1.3.31 → 1.3.33
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/README.md +349 -355
- package/dist/.vite/manifest.json +64 -64
- package/dist/FromToDatePickerDropdownToggle-BcOIaLyQ.cjs +253 -0
- package/dist/{FromToDatePickerDropdownToggle-a6zb7EV7.js → FromToDatePickerDropdownToggle-CGnDN_zs.js} +2949 -3196
- package/dist/PrimaryButton-B6qFyVVD.js +680 -0
- package/dist/PrimaryButton-Dow_5lBe.cjs +1 -0
- package/dist/SimpleTooltip-B0I1MS-L.js +5 -0
- package/dist/{SimpleTooltip-ngcscCjg.cjs → SimpleTooltip-CpLiAgNs.cjs} +1 -1
- package/dist/components/Buttons/ContextButton/ContextButton.d.ts +0 -1
- package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +0 -1
- package/dist/components/Buttons/IconButton/IconButton.d.ts +0 -1
- package/dist/components/Buttons/PrimaryButton/PrimaryButton.d.ts +0 -1
- package/dist/components/Dropdown/Dropdown.d.ts +0 -1
- package/dist/components/Dropdown/comps/DropdownItem/DropdownItem.d.ts +0 -1
- package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +0 -1
- package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +0 -1
- package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +3 -3
- package/dist/components/Form/CheckInput/CheckInput.d.ts +0 -1
- package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +0 -1
- package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +0 -1
- package/dist/components/Form/SelectInput/SelectInput.d.ts +0 -1
- package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +0 -1
- package/dist/components/Form/TextInput/TextInput.d.ts +0 -1
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +0 -1
- package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +0 -1
- package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +0 -1
- package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +0 -1
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +0 -1
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +0 -1
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +0 -1
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +0 -1
- package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +20 -21
- package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +0 -1
- package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +20 -21
- package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +20 -21
- package/dist/components/Layout/MessageBoard/components/MessageList/MessageList.d.ts +0 -1
- package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageFilters/MessageFilters.d.ts +0 -1
- package/dist/components/Layout/MessageBoard/components/MessageList/comps/MessageItem/MessageItem.d.ts +0 -1
- package/dist/components/NewTabs/Tab/Tab.d.ts +5 -5
- package/dist/components/NewTabs/TabPanel/TabPanel.d.ts +0 -1
- package/dist/components/NewTabs/Tabs/Tabs.d.ts +7 -7
- package/dist/components/Tabs/Tabs.d.ts +0 -1
- package/dist/components/Tabs/comps/Tab/Tab.d.ts +0 -1
- package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +0 -1
- package/dist/components/common/Alert/Alert.d.ts +0 -1
- package/dist/components/common/AlertItem/AlertItem.d.ts +0 -1
- package/dist/components/common/AppSearch/AppSearch.d.ts +0 -1
- package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +0 -1
- package/dist/components/common/Backdrop/Backdrop.d.ts +0 -1
- package/dist/components/common/Badge/Badge.d.ts +0 -1
- package/dist/components/common/Card/Card.d.ts +0 -1
- package/dist/components/common/Collapse/Collapse.d.ts +0 -1
- package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +0 -1
- package/dist/components/common/FloatingActionContainer/FloatingActionContainer.d.ts +0 -1
- package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +0 -1
- package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +0 -1
- package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +0 -1
- package/dist/components/common/ImgApi/ImgApi.d.ts +0 -1
- package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +0 -1
- package/dist/components/common/ImgDirect/ImgDirect.d.ts +0 -1
- package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +0 -1
- package/dist/components/common/Loading/Loading.d.ts +0 -1
- package/dist/components/common/MonthPicker/MonthPicker.d.ts +0 -1
- package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +0 -1
- package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +0 -1
- package/dist/components/common/PromptDialog/PromptDialog.d.ts +0 -1
- package/dist/components/common/Timeline/Timeline.d.ts +0 -1
- package/dist/components/common/Typography/Typography.d.ts +0 -1
- package/dist/components/common/VersionInfo/VersionInfo.d.ts +0 -1
- package/dist/components/common/YearPicker/YearPicker.d.ts +0 -1
- package/dist/contexts/auth/AuthContext.d.ts +0 -1
- package/dist/contexts/auth/AuthProvider.d.ts +0 -1
- package/dist/contexts/confirm/ConfirmContext.d.ts +0 -1
- package/dist/contexts/confirm/ConfirmProvider.d.ts +0 -1
- package/dist/contexts/delegation/DelegationProvider.d.ts +0 -1
- package/dist/contexts/loading/LoadingContext.d.ts +0 -1
- package/dist/contexts/loading/LoadingProvider.d.ts +0 -1
- package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +1 -15
- package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +2 -16
- package/dist/contexts/prompt/PromptContext.d.ts +0 -1
- package/dist/contexts/user/UserContext.d.ts +0 -1
- package/dist/contexts/user/UserProvider.d.ts +0 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.d.ts +10 -27
- package/dist/contexts.es.js +184 -337
- package/dist/{dateUtils-D5PdELhi.js → dateUtils-Bc53BdYm.js} +11 -21
- package/dist/{dateUtils-CIDS0n5B.cjs → dateUtils-Y_XPaYyg.cjs} +1 -1
- package/dist/hooks/useFormControlType/useFormControlType.d.ts +1 -1
- package/dist/hooks/useGetApiData/useGetApiData.d.ts +0 -1
- package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +0 -1
- package/dist/hooks/useNotifications/useNotifications.d.ts +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.d.ts +3 -5
- package/dist/hooks.es.js +46 -44
- package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +0 -1
- package/dist/layout/MainContainer/MainContainer.d.ts +0 -1
- package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +0 -1
- package/dist/layout/SideMenu/SideMenu.d.ts +0 -1
- package/dist/layout/TopBar/TopBar.d.ts +0 -1
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.d.ts +0 -2
- package/dist/layout.es.js +95 -96
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +2062 -2455
- package/dist/models/prop-types/InputContainerProps.d.ts +0 -1
- package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +0 -1
- package/dist/models/prop-types/InputProps/TextInputProps.d.ts +0 -1
- package/dist/models/texts/ComponentsContextTexts.d.ts +18 -0
- package/dist/models/types/MenuItemType.d.ts +0 -1
- package/dist/models/types/PhotoAction.d.ts +0 -1
- package/dist/models/types/TimelineStep.d.ts +0 -1
- package/dist/{searchUtils-CEjMiULh.js → searchUtils-kismAHZM.js} +1 -1
- package/dist/{searchUtils-9_EWs2V9.cjs → searchUtils-qxu0IgEU.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useFormControlType-oJGqgThz.js → useFormControlType-BAFqxupC.js} +3 -3
- package/dist/useLocalStorageState-BxKcArKF.cjs +1 -0
- package/dist/useLocalStorageState-HYmARj_B.js +76 -0
- package/dist/usePermissions-Dl5tlwwt.js +17 -0
- package/dist/usePermissions-yx-0zHae.cjs +1 -0
- package/dist/utils/bnfValueFormat/bnfValueFormat.d.ts +0 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.d.ts +0 -2
- package/dist/utils.es.js +55 -53
- package/dist/variables.scss +171 -171
- package/package.json +106 -106
- package/dist/FromToDatePickerDropdownToggle-EhHpHC9A.cjs +0 -253
- package/dist/PrimaryButton-BbKMePCv.js +0 -718
- package/dist/PrimaryButton-ugYzKlak.cjs +0 -1
- package/dist/SimpleTooltip-Boktzm98.js +0 -5
- package/dist/useLocalStorageState-CT8xepqa.cjs +0 -1
- package/dist/useLocalStorageState-DkeM8Y6R.js +0 -74
- package/dist/usePermissions-BkVAe1PL.cjs +0 -1
- package/dist/usePermissions-Dh1Sgbd7.js +0 -15
package/dist/contexts.es.js
CHANGED
|
@@ -1,402 +1,249 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
1
|
+
import { j as n, al as R, U as L, am as U, an as z, ao as F, a5 as B, a9 as G, ap as O, aa as q, ac as S, ab as H, aq as V } from "./FromToDatePickerDropdownToggle-CGnDN_zs.js";
|
|
2
|
+
import { useState as h, useCallback as d, useMemo as g, useContext as j, useEffect as C, useRef as M } from "react";
|
|
3
|
+
import { EventType as b } from "@azure/msal-browser";
|
|
4
|
+
import { MsalProvider as J } from "@azure/msal-react";
|
|
3
5
|
import "zod";
|
|
4
|
-
import "react-hook-form";
|
|
5
6
|
import "react-router-dom";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
import "react-hook-form";
|
|
8
|
+
import { u as K, a as Q, b as $, c as W } from "./useLocalStorageState-HYmARj_B.js";
|
|
9
|
+
import { f as v, b as X, P as I, L as Y } from "./PrimaryButton-B6qFyVVD.js";
|
|
10
|
+
import { m as Z } from "./dateUtils-Bc53BdYm.js";
|
|
11
|
+
const ee = ({ children: e }) => {
|
|
12
|
+
const [r, a] = h(!1), [o, t] = h(""), s = d((u) => {
|
|
13
|
+
a(!0), t(u);
|
|
14
|
+
}, []), i = d(() => {
|
|
15
|
+
a(!1);
|
|
16
|
+
}, []), l = g(() => ({ show: r, text: o, showConfirm: s, hideConfirm: i }), [r, o, s, i]);
|
|
17
|
+
return /* @__PURE__ */ n.jsxs(R.Provider, { value: l, children: [
|
|
18
|
+
/* @__PURE__ */ n.jsx(ne, {}),
|
|
17
19
|
e
|
|
18
20
|
] });
|
|
19
|
-
},
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
}, [
|
|
23
|
-
|
|
24
|
-
}, [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
const
|
|
29
|
-
value:
|
|
30
|
-
onChange: (
|
|
21
|
+
}, te = () => {
|
|
22
|
+
const { texts: { confirm: e } } = j(L), { isShown: r, text: a, onFinish: o } = K(), { options: t } = j(U), [s, i] = h(t.defaultValue ?? ""), l = d(() => {
|
|
23
|
+
o(null);
|
|
24
|
+
}, [o]), u = d((m) => {
|
|
25
|
+
m.preventDefault(), !(t.required && !s) && o(s);
|
|
26
|
+
}, [o, t.required, s]);
|
|
27
|
+
C(() => {
|
|
28
|
+
r === !0 && i(t.defaultValue ?? "");
|
|
29
|
+
}, [r, t.defaultValue]);
|
|
30
|
+
const x = g(() => ({
|
|
31
|
+
value: s,
|
|
32
|
+
onChange: (m) => i(m.currentTarget.value),
|
|
31
33
|
className: "w-100",
|
|
32
34
|
autoFocus: !0,
|
|
33
35
|
tabIndex: 0
|
|
34
|
-
}), [
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
}), [s]);
|
|
37
|
+
return /* @__PURE__ */ n.jsxs(v, { show: r, size: "sm", centered: !0, onHide: l, children: [
|
|
38
|
+
/* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: a }) }),
|
|
39
|
+
/* @__PURE__ */ n.jsxs("form", { onSubmit: u, children: [
|
|
40
|
+
/* @__PURE__ */ n.jsxs(v.Body, { children: [
|
|
41
|
+
t.input === "textarea" ? /* @__PURE__ */ n.jsx("textarea", { ...x, rows: 5 }) : void 0,
|
|
42
|
+
t.input === "input" ? /* @__PURE__ */ n.jsx(X, { ...x, type: t.type }) : void 0
|
|
41
43
|
] }),
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
44
|
-
/* @__PURE__ */
|
|
44
|
+
/* @__PURE__ */ n.jsxs(v.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
45
|
+
/* @__PURE__ */ n.jsx(I, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: e.cancel }),
|
|
46
|
+
/* @__PURE__ */ n.jsx(I, { color: "primary", disabled: t.required && !s, type: "submit", className: "flex-grow-1", children: e.confirm })
|
|
45
47
|
] })
|
|
46
48
|
] })
|
|
47
49
|
] });
|
|
48
|
-
},
|
|
49
|
-
const [
|
|
50
|
-
}),
|
|
51
|
-
|
|
52
|
-
}, []),
|
|
53
|
-
|
|
54
|
-
}, []),
|
|
55
|
-
isShown:
|
|
56
|
-
text:
|
|
57
|
-
showPrompt:
|
|
58
|
-
hidePrompt:
|
|
50
|
+
}, se = ({ children: e }) => {
|
|
51
|
+
const [r, a] = h(!1), [o, t] = h(""), [s, i] = h({ input: "textarea", type: "text" }), l = M(() => {
|
|
52
|
+
}), u = d((N) => {
|
|
53
|
+
t(N), a(!0);
|
|
54
|
+
}, []), x = d(() => {
|
|
55
|
+
a(!1);
|
|
56
|
+
}, []), m = g(() => ({
|
|
57
|
+
isShown: r,
|
|
58
|
+
text: o,
|
|
59
|
+
showPrompt: u,
|
|
60
|
+
hidePrompt: x,
|
|
59
61
|
resolveRef: l,
|
|
60
|
-
options:
|
|
61
|
-
setOptions:
|
|
62
|
-
}), [
|
|
63
|
-
return /* @__PURE__ */
|
|
62
|
+
options: s,
|
|
63
|
+
setOptions: i
|
|
64
|
+
}), [r, o, u, x, s]);
|
|
65
|
+
return /* @__PURE__ */ n.jsxs(U.Provider, { value: m, children: [
|
|
64
66
|
e,
|
|
65
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ n.jsx(te, {})
|
|
66
68
|
] });
|
|
67
|
-
},
|
|
68
|
-
const
|
|
69
|
-
axiosOptions:
|
|
69
|
+
}, fe = ({ cookieDomain: e, axiosOptions: r, language: a, texts: o, ProjectIconComponent: t, localizationContext: s, children: i }) => {
|
|
70
|
+
const l = g(() => ({
|
|
71
|
+
axiosOptions: r,
|
|
70
72
|
cookieDomain: e,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
appSearchTexts: u,
|
|
80
|
-
customSelectTexts: R,
|
|
81
|
-
errorBoundaryTexts: A,
|
|
82
|
-
widgetTexts: L,
|
|
83
|
-
texts: I,
|
|
84
|
-
ProjectIconComponent: _,
|
|
85
|
-
localizationContext: p
|
|
86
|
-
}), [
|
|
87
|
-
o,
|
|
88
|
-
e,
|
|
89
|
-
t,
|
|
90
|
-
n,
|
|
91
|
-
s,
|
|
92
|
-
r,
|
|
93
|
-
c,
|
|
94
|
-
l,
|
|
95
|
-
i,
|
|
96
|
-
g,
|
|
97
|
-
u,
|
|
98
|
-
R,
|
|
99
|
-
A,
|
|
100
|
-
L,
|
|
101
|
-
_,
|
|
102
|
-
p,
|
|
103
|
-
I
|
|
104
|
-
]);
|
|
105
|
-
return /* @__PURE__ */ a.jsx(j.Provider, { value: N, children: /* @__PURE__ */ a.jsx(le, { children: /* @__PURE__ */ a.jsxs(ue, { children: [
|
|
106
|
-
/* @__PURE__ */ a.jsx($, {}),
|
|
107
|
-
P
|
|
73
|
+
language: a,
|
|
74
|
+
texts: o,
|
|
75
|
+
ProjectIconComponent: t,
|
|
76
|
+
localizationContext: s
|
|
77
|
+
}), [r, e, a, t, s, o]);
|
|
78
|
+
return /* @__PURE__ */ n.jsx(L.Provider, { value: l, children: /* @__PURE__ */ n.jsx(ee, { children: /* @__PURE__ */ n.jsxs(se, { children: [
|
|
79
|
+
/* @__PURE__ */ n.jsx(z, {}),
|
|
80
|
+
i
|
|
108
81
|
] }) }) });
|
|
109
|
-
},
|
|
110
|
-
const [
|
|
111
|
-
|
|
112
|
-
}, [
|
|
113
|
-
|
|
114
|
-
}, [
|
|
115
|
-
return /* @__PURE__ */
|
|
116
|
-
|
|
82
|
+
}, he = ({ children: e }) => {
|
|
83
|
+
const [r, a] = h(!1), [o] = h(/* @__PURE__ */ new Set()), t = d((l) => {
|
|
84
|
+
o.add(l), a(!0);
|
|
85
|
+
}, [o]), s = d((l) => {
|
|
86
|
+
o.delete(l), o.size === 0 && a(!1);
|
|
87
|
+
}, [o]), i = g(() => ({ isLoading: r, startLoading: t, stopLoading: s }), [r, t, s]);
|
|
88
|
+
return /* @__PURE__ */ n.jsxs(F.Provider, { value: i, children: [
|
|
89
|
+
r && /* @__PURE__ */ n.jsx(Y, {}),
|
|
117
90
|
e
|
|
118
91
|
] });
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
* Gets interaction status from event message
|
|
124
|
-
* @param message
|
|
125
|
-
* @param currentStatus
|
|
126
|
-
*/
|
|
127
|
-
static getInteractionStatusFromEvent(o, t) {
|
|
128
|
-
switch (o.eventType) {
|
|
129
|
-
case f.LOGIN_START:
|
|
130
|
-
return d.Login;
|
|
131
|
-
case f.SSO_SILENT_START:
|
|
132
|
-
return d.SsoSilent;
|
|
133
|
-
case f.ACQUIRE_TOKEN_START:
|
|
134
|
-
if (o.interactionType === O.Redirect || o.interactionType === O.Popup)
|
|
135
|
-
return d.AcquireToken;
|
|
136
|
-
break;
|
|
137
|
-
case f.HANDLE_REDIRECT_START:
|
|
138
|
-
return d.HandleRedirect;
|
|
139
|
-
case f.LOGOUT_START:
|
|
140
|
-
return d.Logout;
|
|
141
|
-
case f.SSO_SILENT_SUCCESS:
|
|
142
|
-
case f.SSO_SILENT_FAILURE:
|
|
143
|
-
if (t && t !== d.SsoSilent)
|
|
144
|
-
break;
|
|
145
|
-
return d.None;
|
|
146
|
-
case f.LOGOUT_END:
|
|
147
|
-
if (t && t !== d.Logout)
|
|
148
|
-
break;
|
|
149
|
-
return d.None;
|
|
150
|
-
case f.HANDLE_REDIRECT_END:
|
|
151
|
-
if (t && t !== d.HandleRedirect)
|
|
152
|
-
break;
|
|
153
|
-
return d.None;
|
|
154
|
-
case f.LOGIN_SUCCESS:
|
|
155
|
-
case f.LOGIN_FAILURE:
|
|
156
|
-
case f.ACQUIRE_TOKEN_SUCCESS:
|
|
157
|
-
case f.ACQUIRE_TOKEN_FAILURE:
|
|
158
|
-
case f.RESTORE_FROM_BFCACHE:
|
|
159
|
-
if (o.interactionType === O.Redirect || o.interactionType === O.Popup) {
|
|
160
|
-
if (t && t !== d.Login && t !== d.AcquireToken)
|
|
161
|
-
break;
|
|
162
|
-
return d.None;
|
|
163
|
-
}
|
|
164
|
-
break;
|
|
165
|
-
}
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
170
|
-
const fe = "@azure/msal-react", G = "2.0.16";
|
|
171
|
-
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
172
|
-
const b = {
|
|
173
|
-
UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
|
|
174
|
-
EVENT: "EVENT"
|
|
175
|
-
}, me = (e, o) => {
|
|
176
|
-
const { type: t, payload: n } = o;
|
|
177
|
-
let s = e.inProgress;
|
|
178
|
-
switch (t) {
|
|
179
|
-
case b.UNBLOCK_INPROGRESS:
|
|
180
|
-
e.inProgress === d.Startup && (s = d.None, n.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
|
|
181
|
-
break;
|
|
182
|
-
case b.EVENT:
|
|
183
|
-
const c = n.message, l = de.getInteractionStatusFromEvent(c, e.inProgress);
|
|
184
|
-
l && (n.logger.info(`MsalProvider - ${c.eventType} results in setting inProgress from ${e.inProgress} to ${l}`), s = l);
|
|
185
|
-
break;
|
|
186
|
-
default:
|
|
187
|
-
throw new Error(`Unknown action type: ${t}`);
|
|
188
|
-
}
|
|
189
|
-
const r = n.instance.getAllAccounts();
|
|
190
|
-
return s !== e.inProgress && !D(r, e.accounts) ? {
|
|
191
|
-
...e,
|
|
192
|
-
inProgress: s,
|
|
193
|
-
accounts: r
|
|
194
|
-
} : s !== e.inProgress ? {
|
|
195
|
-
...e,
|
|
196
|
-
inProgress: s
|
|
197
|
-
} : D(r, e.accounts) ? e : {
|
|
198
|
-
...e,
|
|
199
|
-
accounts: r
|
|
200
|
-
};
|
|
201
|
-
};
|
|
202
|
-
function ge({ instance: e, children: o }) {
|
|
203
|
-
v(() => {
|
|
204
|
-
e.initializeWrapperLibrary(V.React, G);
|
|
205
|
-
}, [e]);
|
|
206
|
-
const t = C(() => e.getLogger().clone(fe, G), [e]), [n, s] = ee(me, void 0, () => ({
|
|
207
|
-
inProgress: d.Startup,
|
|
208
|
-
accounts: e.getAllAccounts()
|
|
209
|
-
}));
|
|
210
|
-
v(() => {
|
|
211
|
-
const c = e.addEventCallback((l) => {
|
|
212
|
-
s({
|
|
213
|
-
payload: {
|
|
214
|
-
instance: e,
|
|
215
|
-
logger: t,
|
|
216
|
-
message: l
|
|
217
|
-
},
|
|
218
|
-
type: b.EVENT
|
|
219
|
-
});
|
|
220
|
-
});
|
|
221
|
-
return t.verbose(`MsalProvider - Registered event callback with id: ${c}`), e.initialize().then(() => {
|
|
222
|
-
e.handleRedirectPromise().catch(() => {
|
|
223
|
-
}).finally(() => {
|
|
224
|
-
s({
|
|
225
|
-
payload: {
|
|
226
|
-
instance: e,
|
|
227
|
-
logger: t
|
|
228
|
-
},
|
|
229
|
-
type: b.UNBLOCK_INPROGRESS
|
|
230
|
-
});
|
|
231
|
-
});
|
|
232
|
-
}).catch(() => {
|
|
233
|
-
}), () => {
|
|
234
|
-
c && (t.verbose(`MsalProvider - Removing event callback ${c}`), e.removeEventCallback(c));
|
|
235
|
-
};
|
|
236
|
-
}, [e, t]);
|
|
237
|
-
const r = {
|
|
238
|
-
instance: e,
|
|
239
|
-
inProgress: n.inProgress,
|
|
240
|
-
accounts: n.accounts,
|
|
241
|
-
logger: t
|
|
242
|
-
};
|
|
243
|
-
return Z.createElement(Q.Provider, { value: r }, o);
|
|
244
|
-
}
|
|
245
|
-
const ye = ({ children: e }) => {
|
|
246
|
-
const o = J(), { msalInstance: t } = y(F), { delegation: n, setDelegation: s, setAvailableDelegations: r, refreshAvailableDelegations: c } = y(z), { getToken: l } = W(), [i, g] = h(null), u = E(async () => {
|
|
247
|
-
const m = await l();
|
|
248
|
-
m && g(m);
|
|
92
|
+
}, ve = ({ children: e }) => {
|
|
93
|
+
const r = B(), { msalInstance: a } = j(G), { delegation: o, setDelegation: t, setAvailableDelegations: s, refreshAvailableDelegations: i } = j(O), { getToken: l } = q(), [u, x] = h(null), m = d(async () => {
|
|
94
|
+
const c = await l();
|
|
95
|
+
c && x(c);
|
|
249
96
|
}, [l]);
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}, [
|
|
253
|
-
const
|
|
254
|
-
const
|
|
255
|
-
return
|
|
256
|
-
}, [])(), [
|
|
257
|
-
state:
|
|
258
|
-
user:
|
|
259
|
-
}),
|
|
260
|
-
let
|
|
261
|
-
return await
|
|
262
|
-
|
|
97
|
+
C(() => {
|
|
98
|
+
m();
|
|
99
|
+
}, [m]);
|
|
100
|
+
const D = d(() => {
|
|
101
|
+
const c = localStorage.getItem("user") ?? null;
|
|
102
|
+
return c ? JSON.parse(c ?? "") : null;
|
|
103
|
+
}, [])(), [P, y] = h({
|
|
104
|
+
state: D ? S.LOGGED_IN : S.LOGGING_IN,
|
|
105
|
+
user: D
|
|
106
|
+
}), k = d(async (c) => {
|
|
107
|
+
let f = null;
|
|
108
|
+
return await r.get("/user/detail", c ? { headers: { Authorization: `Bearer ${c}` } } : void 0).then((T) => {
|
|
109
|
+
f = T.data;
|
|
263
110
|
}).catch(() => {
|
|
264
|
-
|
|
265
|
-
}),
|
|
266
|
-
}, [
|
|
267
|
-
localStorage.removeItem("user"),
|
|
268
|
-
state:
|
|
111
|
+
f = null;
|
|
112
|
+
}), f;
|
|
113
|
+
}, [r]), A = d(() => {
|
|
114
|
+
localStorage.removeItem("user"), y({
|
|
115
|
+
state: S.LOGGED_OUT,
|
|
269
116
|
user: null
|
|
270
|
-
}),
|
|
271
|
-
}, [
|
|
272
|
-
|
|
273
|
-
state:
|
|
117
|
+
}), t(null), s(null);
|
|
118
|
+
}, [s, t]), w = d(async (c) => {
|
|
119
|
+
y({
|
|
120
|
+
state: S.LOGGING_IN,
|
|
274
121
|
user: null
|
|
275
122
|
});
|
|
276
|
-
const
|
|
277
|
-
return
|
|
278
|
-
state:
|
|
279
|
-
user:
|
|
280
|
-
}), localStorage.setItem("user", JSON.stringify(
|
|
281
|
-
state:
|
|
123
|
+
const f = await k(c);
|
|
124
|
+
return f ? (y({
|
|
125
|
+
state: S.LOGGED_IN,
|
|
126
|
+
user: f
|
|
127
|
+
}), localStorage.setItem("user", JSON.stringify(f)), await i(), !0) : (y({
|
|
128
|
+
state: S.LOGIN_FAILED,
|
|
282
129
|
user: null
|
|
283
130
|
}), !1);
|
|
284
|
-
}, [
|
|
285
|
-
|
|
286
|
-
}, [
|
|
287
|
-
|
|
288
|
-
if (
|
|
289
|
-
const
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
|
|
131
|
+
}, [k, i]), p = d(() => {
|
|
132
|
+
A();
|
|
133
|
+
}, [A]);
|
|
134
|
+
C(() => {
|
|
135
|
+
if (a) {
|
|
136
|
+
const c = a.addEventCallback((f) => {
|
|
137
|
+
if (f.eventType === b.LOGIN_SUCCESS && f.payload) {
|
|
138
|
+
const T = f.payload;
|
|
139
|
+
x(T.accessToken);
|
|
293
140
|
}
|
|
294
141
|
});
|
|
295
142
|
return () => {
|
|
296
|
-
|
|
143
|
+
c && a.removeEventCallback(c);
|
|
297
144
|
};
|
|
298
145
|
}
|
|
299
146
|
return () => {
|
|
300
147
|
};
|
|
301
|
-
}, [
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
148
|
+
}, [a, w, p]);
|
|
149
|
+
const E = d(async (c) => {
|
|
150
|
+
c && await w(c).catch(() => {
|
|
151
|
+
p(), t(null);
|
|
305
152
|
});
|
|
306
|
-
}, [
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
}, [
|
|
310
|
-
const
|
|
311
|
-
user:
|
|
312
|
-
userLoginState:
|
|
313
|
-
loginUser:
|
|
314
|
-
logoutUser:
|
|
315
|
-
}), [
|
|
316
|
-
return /* @__PURE__ */
|
|
317
|
-
},
|
|
318
|
-
const { cookieDomain:
|
|
153
|
+
}, [w, p, t]);
|
|
154
|
+
C(() => {
|
|
155
|
+
E(u);
|
|
156
|
+
}, [u, o == null ? void 0 : o.id, E]);
|
|
157
|
+
const _ = g(() => ({
|
|
158
|
+
user: P.user,
|
|
159
|
+
userLoginState: P,
|
|
160
|
+
loginUser: w,
|
|
161
|
+
logoutUser: p
|
|
162
|
+
}), [P, w, p]);
|
|
163
|
+
return /* @__PURE__ */ n.jsx(H.Provider, { value: _, children: e });
|
|
164
|
+
}, ge = ({ ...e }) => {
|
|
165
|
+
const { cookieDomain: r } = j(L), [, a] = V(["Authorization"]), o = g(() => ({
|
|
319
166
|
useMsal: e.useMsal ?? !1,
|
|
320
167
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
321
168
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
322
169
|
}), [e]);
|
|
323
|
-
return
|
|
170
|
+
return C(() => {
|
|
324
171
|
if (e.useMsal) {
|
|
325
|
-
const
|
|
326
|
-
if (
|
|
327
|
-
const
|
|
172
|
+
const t = e.msalInstance.addEventCallback((s) => {
|
|
173
|
+
if (s.eventType === b.LOGIN_SUCCESS || s.eventType === b.ACQUIRE_TOKEN_SUCCESS && s.payload) {
|
|
174
|
+
const i = s.payload, l = i.account;
|
|
328
175
|
e.msalInstance.setActiveAccount(l);
|
|
329
|
-
const
|
|
330
|
-
|
|
176
|
+
const u = i.accessToken, x = i.expiresOn;
|
|
177
|
+
a("Authorization", u, {
|
|
331
178
|
path: "/",
|
|
332
179
|
secure: !0,
|
|
333
180
|
sameSite: "none",
|
|
334
|
-
domain:
|
|
335
|
-
expires:
|
|
181
|
+
domain: r,
|
|
182
|
+
expires: x ?? void 0
|
|
336
183
|
});
|
|
337
184
|
}
|
|
338
|
-
|
|
185
|
+
s.error && console.error("AuthProvider MSAL Error", s);
|
|
339
186
|
});
|
|
340
187
|
return () => {
|
|
341
|
-
|
|
188
|
+
t && e.msalInstance.removeEventCallback(t);
|
|
342
189
|
};
|
|
343
190
|
}
|
|
344
191
|
return () => {
|
|
345
192
|
};
|
|
346
|
-
}, [e,
|
|
347
|
-
},
|
|
348
|
-
const [
|
|
193
|
+
}, [e, a, r]), /* @__PURE__ */ n.jsx(G.Provider, { value: o, children: e.useMsal ? /* @__PURE__ */ n.jsx(J, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
194
|
+
}, Ce = ({ children: e, relativeEndpoint: r }) => {
|
|
195
|
+
const [a, o, t] = Q("user-delegation", null), { data: s, setData: i, reloadData: l } = $(r, {
|
|
349
196
|
nullStateBeforeLoad: !1,
|
|
350
197
|
nullStateOnFail: !0
|
|
351
|
-
}),
|
|
352
|
-
|
|
353
|
-
const
|
|
354
|
-
l(),
|
|
198
|
+
}), u = M(null);
|
|
199
|
+
C(() => {
|
|
200
|
+
const m = () => {
|
|
201
|
+
l(), u.current = window.setTimeout(m, Z() + 5e3);
|
|
355
202
|
};
|
|
356
|
-
return
|
|
357
|
-
|
|
203
|
+
return m(), () => {
|
|
204
|
+
u.current !== null && window.clearTimeout(u.current);
|
|
358
205
|
};
|
|
359
|
-
}, [l]),
|
|
360
|
-
const
|
|
361
|
-
|
|
206
|
+
}, [l]), C(() => {
|
|
207
|
+
const m = () => {
|
|
208
|
+
t();
|
|
362
209
|
};
|
|
363
|
-
return window.addEventListener("focus",
|
|
364
|
-
window.removeEventListener("focus",
|
|
210
|
+
return window.addEventListener("focus", m), () => {
|
|
211
|
+
window.removeEventListener("focus", m);
|
|
365
212
|
};
|
|
366
|
-
}, [
|
|
367
|
-
const
|
|
368
|
-
delegation:
|
|
369
|
-
setDelegation:
|
|
370
|
-
availableDelegations:
|
|
371
|
-
setAvailableDelegations:
|
|
213
|
+
}, [t, l]);
|
|
214
|
+
const x = g(() => ({
|
|
215
|
+
delegation: a,
|
|
216
|
+
setDelegation: o,
|
|
217
|
+
availableDelegations: s,
|
|
218
|
+
setAvailableDelegations: i,
|
|
372
219
|
refreshAvailableDelegations: l
|
|
373
220
|
}), [
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
221
|
+
a,
|
|
222
|
+
o,
|
|
223
|
+
s,
|
|
224
|
+
i,
|
|
378
225
|
l
|
|
379
226
|
]);
|
|
380
|
-
return /* @__PURE__ */
|
|
381
|
-
},
|
|
382
|
-
const {
|
|
383
|
-
return /* @__PURE__ */
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
/* @__PURE__ */
|
|
387
|
-
/* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ n.jsx(O.Provider, { value: x, children: e });
|
|
228
|
+
}, ne = () => {
|
|
229
|
+
const { texts: { confirm: e } } = j(L), { onConfirm: r, onCancel: a, text: o, show: t } = W();
|
|
230
|
+
return /* @__PURE__ */ n.jsxs(v, { show: t, size: "sm", centered: !0, onHide: a, children: [
|
|
231
|
+
/* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: o }) }),
|
|
232
|
+
/* @__PURE__ */ n.jsx(v.Body, { children: /* @__PURE__ */ n.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
233
|
+
/* @__PURE__ */ n.jsx(I, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: a, children: e.no }),
|
|
234
|
+
/* @__PURE__ */ n.jsx(I, { type: "button", color: "primary", onClick: r, className: "w-100 ml", children: e.yes })
|
|
388
235
|
] }) })
|
|
389
236
|
] });
|
|
390
237
|
};
|
|
391
238
|
export {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
239
|
+
G as AuthContext,
|
|
240
|
+
ge as AuthProvider,
|
|
241
|
+
O as DelegationContext,
|
|
242
|
+
Ce as DelegationProvider,
|
|
243
|
+
F as LoadingContext,
|
|
244
|
+
he as LoadingProvider,
|
|
245
|
+
L as LuminusComponentsContext,
|
|
246
|
+
fe as LuminusComponentsProvider,
|
|
247
|
+
H as UserContext,
|
|
248
|
+
ve as UserProvider
|
|
402
249
|
};
|