react-luminus-components 1.3.32 → 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-DDOxJCc2.js → FromToDatePickerDropdownToggle-CGnDN_zs.js} +2771 -2625
- package/dist/{PrimaryButton-B64e5vBv.js → PrimaryButton-B6qFyVVD.js} +135 -145
- package/dist/PrimaryButton-Dow_5lBe.cjs +1 -0
- package/dist/{SimpleTooltip-BgRjtr0d.js → SimpleTooltip-B0I1MS-L.js} +1 -1
- package/dist/{SimpleTooltip-DIqIPx0H.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/TabPanel/TabPanel.d.ts +0 -1
- package/dist/components/NewTabs/Tabs/Tabs.d.ts +0 -1
- 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 +129 -158
- package/dist/{dateUtils-C8trxO28.js → dateUtils-Bc53BdYm.js} +11 -21
- package/dist/{dateUtils-ChS-y8JY.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 +2 -4
- package/dist/hooks.es.js +23 -23
- 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 +92 -95
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +1637 -1659
- 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-C38WM_G8.js → searchUtils-kismAHZM.js} +1 -1
- package/dist/{searchUtils-BdYnxcy0.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-asgEpnUg.cjs → useLocalStorageState-BxKcArKF.cjs} +1 -1
- package/dist/{useLocalStorageState-CFe9QRz0.js → useLocalStorageState-HYmARj_B.js} +3 -3
- package/dist/{usePermissions-55of2QBH.js → usePermissions-Dl5tlwwt.js} +5 -5
- package/dist/{usePermissions-Ce0AAKj1.cjs → usePermissions-yx-0zHae.cjs} +1 -1
- 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 +7 -7
- package/dist/variables.scss +171 -171
- package/package.json +106 -106
- package/dist/FromToDatePickerDropdownToggle-BPfviPUU.cjs +0 -253
- package/dist/PrimaryButton-BnrFH2PB.cjs +0 -1
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommonLuminusIcons, ILocalizationContext } from '@models/index';
|
|
2
2
|
import ComponentsContextTexts from '@models/texts/ComponentsContextTexts';
|
|
3
|
-
import ErrorBoundaryTexts from '@models/texts/ErrorBoundaryTexts';
|
|
4
|
-
import WidgetTexts from '@models/texts/WidgetTexts';
|
|
5
3
|
import { CreateAxiosDefaults } from 'axios';
|
|
6
4
|
import { Context, ReactNode } from 'react';
|
|
7
5
|
import { IconBaseProps } from 'react-icons';
|
|
8
|
-
import { LinkProps, NavigateProps } from 'react-router-dom';
|
|
9
6
|
export type IconComponentType = (props: {
|
|
10
7
|
icon: CommonLuminusIcons;
|
|
11
8
|
className?: string;
|
|
@@ -14,19 +11,8 @@ export type IconComponentType = (props: {
|
|
|
14
11
|
export interface ILuminusComponentsContext {
|
|
15
12
|
cookieDomain: string;
|
|
16
13
|
axiosOptions: CreateAxiosDefaults;
|
|
17
|
-
LinkComponent: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
18
|
-
NavigateComponent: (props: NavigateProps) => null;
|
|
19
14
|
localizationContext: Context<ILocalizationContext>;
|
|
20
15
|
language: string;
|
|
21
|
-
axiosTexts: AxiosTexts;
|
|
22
|
-
confirmTexts: ConfirmTexts;
|
|
23
|
-
formValidationTexts: FormValidationTexts;
|
|
24
|
-
homeDashboardTexts: HomeDashboardTexts;
|
|
25
|
-
formSubmitTexts: FormSubmitTexts;
|
|
26
|
-
appSearchTexts: AppSearchTexts;
|
|
27
|
-
customSelectTexts: CustomSelectTexts;
|
|
28
|
-
errorBoundaryTexts: ErrorBoundaryTexts;
|
|
29
|
-
widgetTexts: WidgetTexts;
|
|
30
16
|
texts: ComponentsContextTexts;
|
|
31
17
|
ProjectIconComponent: IconComponentType;
|
|
32
18
|
}
|
|
@@ -1,30 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ILocalizationContext } from '@models/index';
|
|
2
2
|
import ComponentsContextTexts from '@models/texts/ComponentsContextTexts';
|
|
3
|
-
import ErrorBoundaryTexts from '@models/texts/ErrorBoundaryTexts';
|
|
4
|
-
import WidgetTexts from '@models/texts/WidgetTexts';
|
|
5
3
|
import { CreateAxiosDefaults } from 'axios';
|
|
6
4
|
import { Context } from 'react';
|
|
7
|
-
import { LinkProps, NavigateProps } from 'react-router-dom';
|
|
8
5
|
import { IconComponentType } from './LuminusComponentsContext';
|
|
9
6
|
type Props = {
|
|
10
7
|
cookieDomain: string;
|
|
11
8
|
axiosOptions: CreateAxiosDefaults;
|
|
12
|
-
LinkComponent: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
13
|
-
NavigateComponent: (props: NavigateProps) => null;
|
|
14
9
|
language: string;
|
|
15
|
-
axiosTexts: AxiosTexts;
|
|
16
|
-
confirmTexts: ConfirmTexts;
|
|
17
|
-
formValidationTexts: FormValidationTexts;
|
|
18
|
-
homeDashboardTexts: HomeDashboardTexts;
|
|
19
|
-
formSubmitTexts: FormSubmitTexts;
|
|
20
|
-
appSearchTexts: AppSearchTexts;
|
|
21
|
-
customSelectTexts: CustomSelectTexts;
|
|
22
10
|
children: React.ReactNode;
|
|
23
|
-
errorBoundaryTexts: ErrorBoundaryTexts;
|
|
24
|
-
widgetTexts: WidgetTexts;
|
|
25
11
|
texts: ComponentsContextTexts;
|
|
26
12
|
ProjectIconComponent: IconComponentType;
|
|
27
13
|
localizationContext: Context<ILocalizationContext>;
|
|
28
14
|
};
|
|
29
|
-
declare const LuminusComponentsProvider: ({ cookieDomain, axiosOptions,
|
|
15
|
+
declare const LuminusComponentsProvider: ({ cookieDomain, axiosOptions, language, texts, ProjectIconComponent, localizationContext, children, }: Props) => import("react").JSX.Element;
|
|
30
16
|
export default LuminusComponentsProvider;
|
package/dist/contexts.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FromToDatePickerDropdownToggle-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./FromToDatePickerDropdownToggle-BcOIaLyQ.cjs"),t=require("react"),S=require("@azure/msal-browser"),w=require("@azure/msal-react");require("zod");require("react-router-dom");require("react-hook-form");const p=require("./useLocalStorageState-BxKcArKF.cjs"),d=require("./PrimaryButton-Dow_5lBe.cjs"),I=require("./dateUtils-Y_XPaYyg.cjs"),T=({children:s})=>{const[u,a]=t.useState(!1),[r,n]=t.useState(""),o=t.useCallback(x=>{a(!0),n(x)},[]),l=t.useCallback(()=>{a(!1)},[]),i=t.useMemo(()=>({show:u,text:r,showConfirm:o,hideConfirm:l}),[u,r,o,l]);return e.jsxRuntimeExports.jsxs(e.ConfirmContext.Provider,{value:i,children:[e.jsxRuntimeExports.jsx(q,{}),s]})},D=()=>{const{texts:{confirm:s}}=t.useContext(e.LuminusComponentsContext),{isShown:u,text:a,onFinish:r}=p.usePrompt(),{options:n}=t.useContext(e.PromptContext),[o,l]=t.useState(n.defaultValue??""),i=t.useCallback(()=>{r(null)},[r]),x=t.useCallback(m=>{m.preventDefault(),!(n.required&&!o)&&r(o)},[r,n.required,o]);t.useEffect(()=>{u===!0&&l(n.defaultValue??"")},[u,n.defaultValue]);const C=t.useMemo(()=>({value:o,onChange:m=>l(m.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[o]);return e.jsxRuntimeExports.jsxs(d.Modal,{show:u,size:"sm",centered:!0,onHide:i,children:[e.jsxRuntimeExports.jsx(d.Modal.Header,{className:"justify-content-center",children:e.jsxRuntimeExports.jsx(d.Modal.Title,{children:a})}),e.jsxRuntimeExports.jsxs("form",{onSubmit:x,children:[e.jsxRuntimeExports.jsxs(d.Modal.Body,{children:[n.input==="textarea"?e.jsxRuntimeExports.jsx("textarea",{...C,rows:5}):void 0,n.input==="input"?e.jsxRuntimeExports.jsx(d.FormControl,{...C,type:n.type}):void 0]}),e.jsxRuntimeExports.jsxs(d.Modal.Footer,{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx(d.PrimaryButton,{variant:"outlined",color:"secondary",onClick:i,className:"flex-grow-1",children:s.cancel}),e.jsxRuntimeExports.jsx(d.PrimaryButton,{color:"primary",disabled:n.required&&!o,type:"submit",className:"flex-grow-1",children:s.confirm})]})]})]})},M=({children:s})=>{const[u,a]=t.useState(!1),[r,n]=t.useState(""),[o,l]=t.useState({input:"textarea",type:"text"}),i=t.useRef(()=>{}),x=t.useCallback(L=>{n(L),a(!0)},[]),C=t.useCallback(()=>{a(!1)},[]),m=t.useMemo(()=>({isShown:u,text:r,showPrompt:x,hidePrompt:C,resolveRef:i,options:o,setOptions:l}),[u,r,x,C,o]);return e.jsxRuntimeExports.jsxs(e.PromptContext.Provider,{value:m,children:[s,e.jsxRuntimeExports.jsx(D,{})]})},A=({cookieDomain:s,axiosOptions:u,language:a,texts:r,ProjectIconComponent:n,localizationContext:o,children:l})=>{const i=t.useMemo(()=>({axiosOptions:u,cookieDomain:s,language:a,texts:r,ProjectIconComponent:n,localizationContext:o}),[u,s,a,n,o,r]);return e.jsxRuntimeExports.jsx(e.LuminusComponentsContext.Provider,{value:i,children:e.jsxRuntimeExports.jsx(T,{children:e.jsxRuntimeExports.jsxs(M,{children:[e.jsxRuntimeExports.jsx(e.Ie,{}),l]})})})},N=({children:s})=>{const[u,a]=t.useState(!1),[r]=t.useState(new Set),n=t.useCallback(i=>{r.add(i),a(!0)},[r]),o=t.useCallback(i=>{r.delete(i),r.size===0&&a(!1)},[r]),l=t.useMemo(()=>({isLoading:u,startLoading:n,stopLoading:o}),[u,n,o]);return e.jsxRuntimeExports.jsxs(e.LoadingContext.Provider,{value:l,children:[u&&e.jsxRuntimeExports.jsx(d.Loading,{}),s]})},U=({children:s})=>{const u=e.useAxios(),{msalInstance:a}=t.useContext(e.AuthContext),{delegation:r,setDelegation:n,setAvailableDelegations:o,refreshAvailableDelegations:l}=t.useContext(e.DelegationContext),{getToken:i}=e.useAuth(),[x,C]=t.useState(null),m=t.useCallback(async()=>{const c=await i();c&&C(c)},[i]);t.useEffect(()=>{m()},[m]);const R=t.useCallback(()=>{const c=localStorage.getItem("user")??null;return c?JSON.parse(c??""):null},[])(),[E,h]=t.useState({state:R?e.LoginState.LOGGED_IN:e.LoginState.LOGGING_IN,user:R}),y=t.useCallback(async c=>{let f=null;return await u.get("/user/detail",c?{headers:{Authorization:`Bearer ${c}`}}:void 0).then(v=>{f=v.data}).catch(()=>{f=null}),f},[u]),b=t.useCallback(()=>{localStorage.removeItem("user"),h({state:e.LoginState.LOGGED_OUT,user:null}),n(null),o(null)},[o,n]),j=t.useCallback(async c=>{h({state:e.LoginState.LOGGING_IN,user:null});const f=await y(c);return f?(h({state:e.LoginState.LOGGED_IN,user:f}),localStorage.setItem("user",JSON.stringify(f)),await l(),!0):(h({state:e.LoginState.LOGIN_FAILED,user:null}),!1)},[y,l]),g=t.useCallback(()=>{b()},[b]);t.useEffect(()=>{if(a){const c=a.addEventCallback(f=>{if(f.eventType===S.EventType.LOGIN_SUCCESS&&f.payload){const v=f.payload;C(v.accessToken)}});return()=>{c&&a.removeEventCallback(c)}}return()=>{}},[a,j,g]);const P=t.useCallback(async c=>{c&&await j(c).catch(()=>{g(),n(null)})},[j,g,n]);t.useEffect(()=>{P(x)},[x,r==null?void 0:r.id,P]);const k=t.useMemo(()=>({user:E.user,userLoginState:E,loginUser:j,logoutUser:g}),[E,j,g]);return e.jsxRuntimeExports.jsx(e.UserContext.Provider,{value:k,children:s})},O=({...s})=>{const{cookieDomain:u}=t.useContext(e.LuminusComponentsContext),[,a]=e.useCookies(["Authorization"]),r=t.useMemo(()=>({useMsal:s.useMsal??!1,msalInstance:s.useMsal?s.msalInstance??null:null,msalScopes:s.useMsal?s.msalScopes??[]:[]}),[s]);return t.useEffect(()=>{if(s.useMsal){const n=s.msalInstance.addEventCallback(o=>{if(o.eventType===S.EventType.LOGIN_SUCCESS||o.eventType===S.EventType.ACQUIRE_TOKEN_SUCCESS&&o.payload){const l=o.payload,i=l.account;s.msalInstance.setActiveAccount(i);const x=l.accessToken,C=l.expiresOn;a("Authorization",x,{path:"/",secure:!0,sameSite:"none",domain:u,expires:C??void 0})}o.error&&console.error("AuthProvider MSAL Error",o)});return()=>{n&&s.msalInstance.removeEventCallback(n)}}return()=>{}},[s,a,u]),e.jsxRuntimeExports.jsx(e.AuthContext.Provider,{value:r,children:s.useMsal?e.jsxRuntimeExports.jsx(w.MsalProvider,{instance:s.msalInstance,children:s.children}):s.children})},G=({children:s,relativeEndpoint:u})=>{const[a,r,n]=p.useLocalStorageState("user-delegation",null),{data:o,setData:l,reloadData:i}=p.useGetApiData(u,{nullStateBeforeLoad:!1,nullStateOnFail:!0}),x=t.useRef(null);t.useEffect(()=>{const m=()=>{i(),x.current=window.setTimeout(m,I.msToStartOfNextDay()+5e3)};return m(),()=>{x.current!==null&&window.clearTimeout(x.current)}},[i]),t.useEffect(()=>{const m=()=>{n()};return window.addEventListener("focus",m),()=>{window.removeEventListener("focus",m)}},[n,i]);const C=t.useMemo(()=>({delegation:a,setDelegation:r,availableDelegations:o,setAvailableDelegations:l,refreshAvailableDelegations:i}),[a,r,o,l,i]);return e.jsxRuntimeExports.jsx(e.DelegationContext.Provider,{value:C,children:s})},q=()=>{const{texts:{confirm:s}}=t.useContext(e.LuminusComponentsContext),{onConfirm:u,onCancel:a,text:r,show:n}=p.useConfirm();return e.jsxRuntimeExports.jsxs(d.Modal,{show:n,size:"sm",centered:!0,onHide:a,children:[e.jsxRuntimeExports.jsx(d.Modal.Header,{className:"justify-content-center",children:e.jsxRuntimeExports.jsx(d.Modal.Title,{children:r})}),e.jsxRuntimeExports.jsx(d.Modal.Body,{children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx(d.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:a,children:s.no}),e.jsxRuntimeExports.jsx(d.PrimaryButton,{type:"button",color:"primary",onClick:u,className:"w-100 ml",children:s.yes})]})})]})};exports.AuthContext=e.AuthContext;exports.DelegationContext=e.DelegationContext;exports.LoadingContext=e.LoadingContext;exports.LuminusComponentsContext=e.LuminusComponentsContext;exports.UserContext=e.UserContext;exports.AuthProvider=O;exports.DelegationProvider=G;exports.LoadingProvider=N;exports.LuminusComponentsProvider=A;exports.UserProvider=U;
|
package/dist/contexts.d.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
|
|
3
1
|
import { Context } from 'react';
|
|
4
2
|
import { CreateAxiosDefaults } from 'axios';
|
|
5
3
|
import { Dispatch } from 'react';
|
|
6
4
|
import { GenericAbortSignal } from 'axios';
|
|
7
5
|
import { IconBaseProps } from 'react-icons';
|
|
8
6
|
import { JSX as JSX_2 } from 'react';
|
|
9
|
-
import { LinkProps } from 'react-router-dom';
|
|
10
7
|
import { Locale } from 'date-fns';
|
|
11
|
-
import { NavigateProps } from 'react-router-dom';
|
|
12
8
|
import { PublicClientApplication } from '@azure/msal-browser';
|
|
13
9
|
import { ReactNode } from 'react';
|
|
14
10
|
import { SetStateAction } from 'react';
|
|
@@ -37,6 +33,15 @@ declare type BaseProps = {
|
|
|
37
33
|
declare type CommonLuminusIcons = 'edit' | 'delete' | 'info' | 'warning' | 'check' | 'danger' | 'chevron-left' | 'chevron-right';
|
|
38
34
|
|
|
39
35
|
declare type ComponentsContextTexts = {
|
|
36
|
+
axios: AxiosTexts;
|
|
37
|
+
confirm: ConfirmTexts;
|
|
38
|
+
formValidation: FormValidationTexts;
|
|
39
|
+
homeDashboard: HomeDashboardTexts;
|
|
40
|
+
formSubmit: FormSubmitTexts;
|
|
41
|
+
appSearch: AppSearchTexts;
|
|
42
|
+
customSelect: CustomSelectTexts;
|
|
43
|
+
errorBoundary: ErrorBoundaryTexts;
|
|
44
|
+
widget: WidgetTexts;
|
|
40
45
|
messageBoard: MessageBoardTexts;
|
|
41
46
|
date: DateTexts;
|
|
42
47
|
};
|
|
@@ -126,19 +131,8 @@ declare interface ILocalizationContext {
|
|
|
126
131
|
export declare interface ILuminusComponentsContext {
|
|
127
132
|
cookieDomain: string;
|
|
128
133
|
axiosOptions: CreateAxiosDefaults;
|
|
129
|
-
LinkComponent: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
130
|
-
NavigateComponent: (props: NavigateProps) => null;
|
|
131
134
|
localizationContext: Context<ILocalizationContext>;
|
|
132
135
|
language: string;
|
|
133
|
-
axiosTexts: AxiosTexts;
|
|
134
|
-
confirmTexts: ConfirmTexts;
|
|
135
|
-
formValidationTexts: FormValidationTexts;
|
|
136
|
-
homeDashboardTexts: HomeDashboardTexts;
|
|
137
|
-
formSubmitTexts: FormSubmitTexts;
|
|
138
|
-
appSearchTexts: AppSearchTexts;
|
|
139
|
-
customSelectTexts: CustomSelectTexts;
|
|
140
|
-
errorBoundaryTexts: ErrorBoundaryTexts;
|
|
141
|
-
widgetTexts: WidgetTexts;
|
|
142
136
|
texts: ComponentsContextTexts;
|
|
143
137
|
ProjectIconComponent: IconComponentType;
|
|
144
138
|
}
|
|
@@ -163,7 +157,7 @@ declare enum LoginState {
|
|
|
163
157
|
|
|
164
158
|
export declare const LuminusComponentsContext: Context<ILuminusComponentsContext>;
|
|
165
159
|
|
|
166
|
-
export declare const LuminusComponentsProvider: ({ cookieDomain, axiosOptions,
|
|
160
|
+
export declare const LuminusComponentsProvider: ({ cookieDomain, axiosOptions, language, texts, ProjectIconComponent, localizationContext, children, }: Props) => JSX_2.Element;
|
|
167
161
|
|
|
168
162
|
declare type MessageBoardTexts = {
|
|
169
163
|
noMessages: string;
|
|
@@ -187,19 +181,8 @@ declare type NameIdStringModel = {
|
|
|
187
181
|
declare type Props = {
|
|
188
182
|
cookieDomain: string;
|
|
189
183
|
axiosOptions: CreateAxiosDefaults;
|
|
190
|
-
LinkComponent: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
191
|
-
NavigateComponent: (props: NavigateProps) => null;
|
|
192
184
|
language: string;
|
|
193
|
-
axiosTexts: AxiosTexts;
|
|
194
|
-
confirmTexts: ConfirmTexts;
|
|
195
|
-
formValidationTexts: FormValidationTexts;
|
|
196
|
-
homeDashboardTexts: HomeDashboardTexts;
|
|
197
|
-
formSubmitTexts: FormSubmitTexts;
|
|
198
|
-
appSearchTexts: AppSearchTexts;
|
|
199
|
-
customSelectTexts: CustomSelectTexts;
|
|
200
185
|
children: React.ReactNode;
|
|
201
|
-
errorBoundaryTexts: ErrorBoundaryTexts;
|
|
202
|
-
widgetTexts: WidgetTexts;
|
|
203
186
|
texts: ComponentsContextTexts;
|
|
204
187
|
ProjectIconComponent: IconComponentType;
|
|
205
188
|
localizationContext: Context<ILocalizationContext>;
|
package/dist/contexts.es.js
CHANGED
|
@@ -1,214 +1,185 @@
|
|
|
1
|
-
import { j as n, al as R, U as
|
|
2
|
-
import { useState as h, useCallback as
|
|
3
|
-
import { EventType as
|
|
4
|
-
import { MsalProvider as
|
|
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";
|
|
5
5
|
import "zod";
|
|
6
|
-
import "react-hook-form";
|
|
7
6
|
import "react-router-dom";
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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
11
|
const ee = ({ children: e }) => {
|
|
12
|
-
const [r, a] = h(!1), [o, t] = h(""), s =
|
|
13
|
-
a(!0), t(
|
|
14
|
-
}, []),
|
|
12
|
+
const [r, a] = h(!1), [o, t] = h(""), s = d((u) => {
|
|
13
|
+
a(!0), t(u);
|
|
14
|
+
}, []), i = d(() => {
|
|
15
15
|
a(!1);
|
|
16
|
-
}, []), l = g(() => ({ show: r, text: o, showConfirm: s, hideConfirm:
|
|
16
|
+
}, []), l = g(() => ({ show: r, text: o, showConfirm: s, hideConfirm: i }), [r, o, s, i]);
|
|
17
17
|
return /* @__PURE__ */ n.jsxs(R.Provider, { value: l, children: [
|
|
18
18
|
/* @__PURE__ */ n.jsx(ne, {}),
|
|
19
19
|
e
|
|
20
20
|
] });
|
|
21
21
|
}, te = () => {
|
|
22
|
-
const {
|
|
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
23
|
o(null);
|
|
24
|
-
}, [o]),
|
|
25
|
-
|
|
24
|
+
}, [o]), u = d((m) => {
|
|
25
|
+
m.preventDefault(), !(t.required && !s) && o(s);
|
|
26
26
|
}, [o, t.required, s]);
|
|
27
|
-
|
|
28
|
-
r === !0 &&
|
|
27
|
+
C(() => {
|
|
28
|
+
r === !0 && i(t.defaultValue ?? "");
|
|
29
29
|
}, [r, t.defaultValue]);
|
|
30
|
-
const
|
|
30
|
+
const x = g(() => ({
|
|
31
31
|
value: s,
|
|
32
|
-
onChange: (
|
|
32
|
+
onChange: (m) => i(m.currentTarget.value),
|
|
33
33
|
className: "w-100",
|
|
34
34
|
autoFocus: !0,
|
|
35
35
|
tabIndex: 0
|
|
36
36
|
}), [s]);
|
|
37
37
|
return /* @__PURE__ */ n.jsxs(v, { show: r, size: "sm", centered: !0, onHide: l, children: [
|
|
38
38
|
/* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: a }) }),
|
|
39
|
-
/* @__PURE__ */ n.jsxs("form", { onSubmit:
|
|
39
|
+
/* @__PURE__ */ n.jsxs("form", { onSubmit: u, children: [
|
|
40
40
|
/* @__PURE__ */ n.jsxs(v.Body, { children: [
|
|
41
|
-
t.input === "textarea" ? /* @__PURE__ */ n.jsx("textarea", { ...
|
|
42
|
-
t.input === "input" ? /* @__PURE__ */ n.jsx(X, { ...
|
|
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
|
|
43
43
|
] }),
|
|
44
44
|
/* @__PURE__ */ n.jsxs(v.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
45
|
-
/* @__PURE__ */ n.jsx(
|
|
46
|
-
/* @__PURE__ */ n.jsx(
|
|
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 })
|
|
47
47
|
] })
|
|
48
48
|
] })
|
|
49
49
|
] });
|
|
50
50
|
}, se = ({ children: e }) => {
|
|
51
|
-
const [r, a] = h(!1), [o, t] = h(""), [s,
|
|
52
|
-
}),
|
|
53
|
-
t(
|
|
54
|
-
}, []),
|
|
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
55
|
a(!1);
|
|
56
|
-
}, []),
|
|
56
|
+
}, []), m = g(() => ({
|
|
57
57
|
isShown: r,
|
|
58
58
|
text: o,
|
|
59
|
-
showPrompt:
|
|
60
|
-
hidePrompt:
|
|
59
|
+
showPrompt: u,
|
|
60
|
+
hidePrompt: x,
|
|
61
61
|
resolveRef: l,
|
|
62
62
|
options: s,
|
|
63
|
-
setOptions:
|
|
64
|
-
}), [r, o,
|
|
65
|
-
return /* @__PURE__ */ n.jsxs(
|
|
63
|
+
setOptions: i
|
|
64
|
+
}), [r, o, u, x, s]);
|
|
65
|
+
return /* @__PURE__ */ n.jsxs(U.Provider, { value: m, children: [
|
|
66
66
|
e,
|
|
67
67
|
/* @__PURE__ */ n.jsx(te, {})
|
|
68
68
|
] });
|
|
69
|
-
},
|
|
70
|
-
const
|
|
69
|
+
}, fe = ({ cookieDomain: e, axiosOptions: r, language: a, texts: o, ProjectIconComponent: t, localizationContext: s, children: i }) => {
|
|
70
|
+
const l = g(() => ({
|
|
71
71
|
axiosOptions: r,
|
|
72
72
|
cookieDomain: e,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
homeDashboardTexts: i,
|
|
80
|
-
formSubmitTexts: m,
|
|
81
|
-
appSearchTexts: u,
|
|
82
|
-
customSelectTexts: L,
|
|
83
|
-
errorBoundaryTexts: P,
|
|
84
|
-
widgetTexts: y,
|
|
85
|
-
texts: C,
|
|
86
|
-
ProjectIconComponent: N,
|
|
87
|
-
localizationContext: D
|
|
88
|
-
}), [
|
|
89
|
-
r,
|
|
90
|
-
e,
|
|
91
|
-
a,
|
|
92
|
-
o,
|
|
93
|
-
t,
|
|
94
|
-
s,
|
|
95
|
-
c,
|
|
96
|
-
l,
|
|
97
|
-
i,
|
|
98
|
-
m,
|
|
99
|
-
u,
|
|
100
|
-
L,
|
|
101
|
-
P,
|
|
102
|
-
y,
|
|
103
|
-
N,
|
|
104
|
-
D,
|
|
105
|
-
C
|
|
106
|
-
]);
|
|
107
|
-
return /* @__PURE__ */ n.jsx(A.Provider, { value: S, children: /* @__PURE__ */ n.jsx(ee, { children: /* @__PURE__ */ n.jsxs(se, { children: [
|
|
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: [
|
|
108
79
|
/* @__PURE__ */ n.jsx(z, {}),
|
|
109
|
-
|
|
80
|
+
i
|
|
110
81
|
] }) }) });
|
|
111
82
|
}, he = ({ children: e }) => {
|
|
112
|
-
const [r, a] = h(!1), [o] = h(/* @__PURE__ */ new Set()), t =
|
|
83
|
+
const [r, a] = h(!1), [o] = h(/* @__PURE__ */ new Set()), t = d((l) => {
|
|
113
84
|
o.add(l), a(!0);
|
|
114
|
-
}, [o]), s =
|
|
85
|
+
}, [o]), s = d((l) => {
|
|
115
86
|
o.delete(l), o.size === 0 && a(!1);
|
|
116
|
-
}, [o]),
|
|
117
|
-
return /* @__PURE__ */ n.jsxs(F.Provider, { value:
|
|
87
|
+
}, [o]), i = g(() => ({ isLoading: r, startLoading: t, stopLoading: s }), [r, t, s]);
|
|
88
|
+
return /* @__PURE__ */ n.jsxs(F.Provider, { value: i, children: [
|
|
118
89
|
r && /* @__PURE__ */ n.jsx(Y, {}),
|
|
119
90
|
e
|
|
120
91
|
] });
|
|
121
92
|
}, ve = ({ children: e }) => {
|
|
122
|
-
const r =
|
|
123
|
-
const
|
|
124
|
-
|
|
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);
|
|
125
96
|
}, [l]);
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}, [
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
return
|
|
132
|
-
}, [])(), [
|
|
133
|
-
state:
|
|
134
|
-
user:
|
|
135
|
-
}),
|
|
136
|
-
let
|
|
137
|
-
return await r.get("/user/detail",
|
|
138
|
-
|
|
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;
|
|
139
110
|
}).catch(() => {
|
|
140
|
-
|
|
141
|
-
}),
|
|
142
|
-
}, [r]),
|
|
143
|
-
localStorage.removeItem("user"),
|
|
144
|
-
state:
|
|
111
|
+
f = null;
|
|
112
|
+
}), f;
|
|
113
|
+
}, [r]), A = d(() => {
|
|
114
|
+
localStorage.removeItem("user"), y({
|
|
115
|
+
state: S.LOGGED_OUT,
|
|
145
116
|
user: null
|
|
146
117
|
}), t(null), s(null);
|
|
147
|
-
}, [s, t]),
|
|
148
|
-
|
|
149
|
-
state:
|
|
118
|
+
}, [s, t]), w = d(async (c) => {
|
|
119
|
+
y({
|
|
120
|
+
state: S.LOGGING_IN,
|
|
150
121
|
user: null
|
|
151
122
|
});
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
state:
|
|
155
|
-
user:
|
|
156
|
-
}), localStorage.setItem("user", JSON.stringify(
|
|
157
|
-
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,
|
|
158
129
|
user: null
|
|
159
130
|
}), !1);
|
|
160
|
-
}, [
|
|
161
|
-
|
|
162
|
-
}, [
|
|
163
|
-
|
|
131
|
+
}, [k, i]), p = d(() => {
|
|
132
|
+
A();
|
|
133
|
+
}, [A]);
|
|
134
|
+
C(() => {
|
|
164
135
|
if (a) {
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
const
|
|
168
|
-
|
|
136
|
+
const c = a.addEventCallback((f) => {
|
|
137
|
+
if (f.eventType === b.LOGIN_SUCCESS && f.payload) {
|
|
138
|
+
const T = f.payload;
|
|
139
|
+
x(T.accessToken);
|
|
169
140
|
}
|
|
170
141
|
});
|
|
171
142
|
return () => {
|
|
172
|
-
|
|
143
|
+
c && a.removeEventCallback(c);
|
|
173
144
|
};
|
|
174
145
|
}
|
|
175
146
|
return () => {
|
|
176
147
|
};
|
|
177
|
-
}, [a,
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
|
|
148
|
+
}, [a, w, p]);
|
|
149
|
+
const E = d(async (c) => {
|
|
150
|
+
c && await w(c).catch(() => {
|
|
151
|
+
p(), t(null);
|
|
181
152
|
});
|
|
182
|
-
}, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}, [
|
|
153
|
+
}, [w, p, t]);
|
|
154
|
+
C(() => {
|
|
155
|
+
E(u);
|
|
156
|
+
}, [u, o == null ? void 0 : o.id, E]);
|
|
186
157
|
const _ = g(() => ({
|
|
187
|
-
user:
|
|
188
|
-
userLoginState:
|
|
189
|
-
loginUser:
|
|
190
|
-
logoutUser:
|
|
191
|
-
}), [
|
|
158
|
+
user: P.user,
|
|
159
|
+
userLoginState: P,
|
|
160
|
+
loginUser: w,
|
|
161
|
+
logoutUser: p
|
|
162
|
+
}), [P, w, p]);
|
|
192
163
|
return /* @__PURE__ */ n.jsx(H.Provider, { value: _, children: e });
|
|
193
164
|
}, ge = ({ ...e }) => {
|
|
194
|
-
const { cookieDomain: r } =
|
|
165
|
+
const { cookieDomain: r } = j(L), [, a] = V(["Authorization"]), o = g(() => ({
|
|
195
166
|
useMsal: e.useMsal ?? !1,
|
|
196
167
|
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
197
168
|
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
198
169
|
}), [e]);
|
|
199
|
-
return
|
|
170
|
+
return C(() => {
|
|
200
171
|
if (e.useMsal) {
|
|
201
172
|
const t = e.msalInstance.addEventCallback((s) => {
|
|
202
|
-
if (s.eventType ===
|
|
203
|
-
const
|
|
173
|
+
if (s.eventType === b.LOGIN_SUCCESS || s.eventType === b.ACQUIRE_TOKEN_SUCCESS && s.payload) {
|
|
174
|
+
const i = s.payload, l = i.account;
|
|
204
175
|
e.msalInstance.setActiveAccount(l);
|
|
205
|
-
const
|
|
206
|
-
a("Authorization",
|
|
176
|
+
const u = i.accessToken, x = i.expiresOn;
|
|
177
|
+
a("Authorization", u, {
|
|
207
178
|
path: "/",
|
|
208
179
|
secure: !0,
|
|
209
180
|
sameSite: "none",
|
|
210
181
|
domain: r,
|
|
211
|
-
expires:
|
|
182
|
+
expires: x ?? void 0
|
|
212
183
|
});
|
|
213
184
|
}
|
|
214
185
|
s.error && console.error("AuthProvider MSAL Error", s);
|
|
@@ -219,60 +190,60 @@ const ee = ({ children: e }) => {
|
|
|
219
190
|
}
|
|
220
191
|
return () => {
|
|
221
192
|
};
|
|
222
|
-
}, [e, a, r]), /* @__PURE__ */ n.jsx(
|
|
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 });
|
|
223
194
|
}, Ce = ({ children: e, relativeEndpoint: r }) => {
|
|
224
|
-
const [a, o, t] = Q("user-delegation", null), { data: s, setData:
|
|
195
|
+
const [a, o, t] = Q("user-delegation", null), { data: s, setData: i, reloadData: l } = $(r, {
|
|
225
196
|
nullStateBeforeLoad: !1,
|
|
226
197
|
nullStateOnFail: !0
|
|
227
|
-
}),
|
|
228
|
-
|
|
229
|
-
const
|
|
230
|
-
l(),
|
|
198
|
+
}), u = M(null);
|
|
199
|
+
C(() => {
|
|
200
|
+
const m = () => {
|
|
201
|
+
l(), u.current = window.setTimeout(m, Z() + 5e3);
|
|
231
202
|
};
|
|
232
|
-
return
|
|
233
|
-
|
|
203
|
+
return m(), () => {
|
|
204
|
+
u.current !== null && window.clearTimeout(u.current);
|
|
234
205
|
};
|
|
235
|
-
}, [l]),
|
|
236
|
-
const
|
|
206
|
+
}, [l]), C(() => {
|
|
207
|
+
const m = () => {
|
|
237
208
|
t();
|
|
238
209
|
};
|
|
239
|
-
return window.addEventListener("focus",
|
|
240
|
-
window.removeEventListener("focus",
|
|
210
|
+
return window.addEventListener("focus", m), () => {
|
|
211
|
+
window.removeEventListener("focus", m);
|
|
241
212
|
};
|
|
242
213
|
}, [t, l]);
|
|
243
|
-
const
|
|
214
|
+
const x = g(() => ({
|
|
244
215
|
delegation: a,
|
|
245
216
|
setDelegation: o,
|
|
246
217
|
availableDelegations: s,
|
|
247
|
-
setAvailableDelegations:
|
|
218
|
+
setAvailableDelegations: i,
|
|
248
219
|
refreshAvailableDelegations: l
|
|
249
220
|
}), [
|
|
250
221
|
a,
|
|
251
222
|
o,
|
|
252
223
|
s,
|
|
253
|
-
|
|
224
|
+
i,
|
|
254
225
|
l
|
|
255
226
|
]);
|
|
256
|
-
return /* @__PURE__ */ n.jsx(
|
|
227
|
+
return /* @__PURE__ */ n.jsx(O.Provider, { value: x, children: e });
|
|
257
228
|
}, ne = () => {
|
|
258
|
-
const {
|
|
229
|
+
const { texts: { confirm: e } } = j(L), { onConfirm: r, onCancel: a, text: o, show: t } = W();
|
|
259
230
|
return /* @__PURE__ */ n.jsxs(v, { show: t, size: "sm", centered: !0, onHide: a, children: [
|
|
260
231
|
/* @__PURE__ */ n.jsx(v.Header, { className: "justify-content-center", children: /* @__PURE__ */ n.jsx(v.Title, { children: o }) }),
|
|
261
232
|
/* @__PURE__ */ n.jsx(v.Body, { children: /* @__PURE__ */ n.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
262
|
-
/* @__PURE__ */ n.jsx(
|
|
263
|
-
/* @__PURE__ */ n.jsx(
|
|
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 })
|
|
264
235
|
] }) })
|
|
265
236
|
] });
|
|
266
237
|
};
|
|
267
238
|
export {
|
|
268
|
-
|
|
239
|
+
G as AuthContext,
|
|
269
240
|
ge as AuthProvider,
|
|
270
|
-
|
|
241
|
+
O as DelegationContext,
|
|
271
242
|
Ce as DelegationProvider,
|
|
272
243
|
F as LoadingContext,
|
|
273
244
|
he as LoadingProvider,
|
|
274
|
-
|
|
275
|
-
|
|
245
|
+
L as LuminusComponentsContext,
|
|
246
|
+
fe as LuminusComponentsProvider,
|
|
276
247
|
H as UserContext,
|
|
277
248
|
ve as UserProvider
|
|
278
249
|
};
|