react-luminus-components 1.3.20 → 1.3.21
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 +355 -355
- package/package.json +105 -105
- package/dist/.vite/manifest.json +0 -187
- package/dist/NoInputContainer-BKPv5rmP.cjs +0 -253
- package/dist/NoInputContainer-C2e1tx-D.js +0 -7008
- package/dist/PrimaryButton-JNkq9258.js +0 -712
- package/dist/PrimaryButton-PjAN0Acn.cjs +0 -1
- package/dist/SimpleTooltip-BCnuzxKk.js +0 -5
- package/dist/SimpleTooltip-BTqqafx1.cjs +0 -1
- package/dist/components/BnfTableValueFormats/UserAvatarValueFormat/UserAvatarValueFormat.d.ts +0 -3
- package/dist/components/BnfTableValueFormats/index.d.ts +0 -1
- package/dist/components/Buttons/ContextButton/ContextButton.d.ts +0 -14
- package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +0 -12
- package/dist/components/Buttons/FloatingSubmit/FloatingFormSubmit.d.ts +0 -8
- package/dist/components/Buttons/IconButton/IconButton.d.ts +0 -13
- package/dist/components/Buttons/PrimaryButton/PrimaryButton.d.ts +0 -14
- package/dist/components/Buttons/index.d.ts +0 -5
- package/dist/components/Dropdown/Dropdown.d.ts +0 -8
- package/dist/components/Dropdown/comps/DropdownDivider/DropdownDivider.d.ts +0 -6
- package/dist/components/Dropdown/comps/DropdownItem/DropdownItem.d.ts +0 -9
- package/dist/components/Dropdown/comps/DropdownItem/FileUploadDropdownItem.d.ts +0 -12
- package/dist/components/Dropdown/comps/DropdownToggle/DropdownToggle.d.ts +0 -7
- package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +0 -10
- package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +0 -8
- package/dist/components/Dropdown/comps/index.d.ts +0 -6
- package/dist/components/Dropdown/index.d.ts +0 -2
- package/dist/components/Form/CheckInput/CheckInput.d.ts +0 -4
- package/dist/components/Form/DropdownPicker/DropdownPicker.d.ts +0 -4
- package/dist/components/Form/NumericStepperInput/NumericStepperInput.d.ts +0 -4
- package/dist/components/Form/SelectInput/SelectInput.d.ts +0 -4
- package/dist/components/Form/TextAreaInput/TextAreaInput.d.ts +0 -4
- package/dist/components/Form/TextInput/TextInput.d.ts +0 -4
- package/dist/components/Form/index.d.ts +0 -6
- package/dist/components/HookForm/CheckInput/HookFormCheckInput.d.ts +0 -4
- package/dist/components/HookForm/CustomSelectInput/CustomSelectInput.d.ts +0 -4
- package/dist/components/HookForm/DropdownPicker/HookFormDropdownPicker.d.ts +0 -4
- package/dist/components/HookForm/FileInput/HookFormFileInput.d.ts +0 -4
- package/dist/components/HookForm/FloatingSubmit/HookFormFloatingSubmit.d.ts +0 -8
- package/dist/components/HookForm/NumericStepperInput/HookFormNumericStepperInput.d.ts +0 -4
- package/dist/components/HookForm/RadioInput/HookFormRadioInput.d.ts +0 -4
- package/dist/components/HookForm/SelectInput/HookFormSelectInput.d.ts +0 -4
- package/dist/components/HookForm/TextAreaInput/HookFormTextAreaInput.d.ts +0 -4
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +0 -4
- package/dist/components/HookForm/index.d.ts +0 -10
- package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +0 -34
- package/dist/components/InputContainers/InputAnchorContainer/InputAnchorContainer.d.ts +0 -9
- package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +0 -34
- package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +0 -34
- package/dist/components/InputContainers/index.d.ts +0 -4
- package/dist/components/NewTabs/Tab/Tab.d.ts +0 -10
- package/dist/components/NewTabs/TabPanel/TabPanel.d.ts +0 -11
- package/dist/components/NewTabs/Tabs/Tabs.d.ts +0 -9
- package/dist/components/NewTabs/index.d.ts +0 -3
- package/dist/components/Tabs/Tabs.d.ts +0 -9
- package/dist/components/Tabs/comps/Tab/Tab.d.ts +0 -7
- package/dist/components/Tabs/comps/index.d.ts +0 -1
- package/dist/components/Tabs/index.d.ts +0 -2
- package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +0 -23
- package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +0 -8
- package/dist/components/Tooltip/index.d.ts +0 -2
- package/dist/components/UserAvatar/AvatarIcon/AvatarIcon.d.ts +0 -8
- package/dist/components/UserAvatar/index.d.ts +0 -1
- package/dist/components/common/Alert/Alert.d.ts +0 -8
- package/dist/components/common/ApiFileDownloadButton/ApiFileDownloadButton.d.ts +0 -8
- package/dist/components/common/AppSearch/AppSearch.d.ts +0 -9
- package/dist/components/common/AppSearch/comps/AutocompleteWindow/AutocompleteWindow.d.ts +0 -12
- package/dist/components/common/AppSearch/comps/TypeSelector/TypeSelector.d.ts +0 -9
- package/dist/components/common/AppSearch/comps/index.d.ts +0 -2
- package/dist/components/common/AppSearch/hooks/useSearchItems.d.ts +0 -6
- package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +0 -7
- package/dist/components/common/Backdrop/Backdrop.d.ts +0 -7
- package/dist/components/common/Badge/Badge.d.ts +0 -9
- package/dist/components/common/Card/Card.d.ts +0 -28
- package/dist/components/common/Collapse/Collapse.d.ts +0 -20
- package/dist/components/common/ConfirmDialog/ConfirmDialog.d.ts +0 -3
- package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +0 -9
- package/dist/components/common/FloatingActionContainer/FloatingActionContainer.d.ts +0 -7
- package/dist/components/common/HomeDashboard/HomeDashboard.d.ts +0 -10
- package/dist/components/common/HomeDashboard/comps/FreeSpaceWidget/FreeSpaceWidget.d.ts +0 -9
- package/dist/components/common/HomeDashboard/comps/WidgetPicker/WidgetPicker.d.ts +0 -11
- package/dist/components/common/HomeDashboard/comps/index.d.ts +0 -1
- package/dist/components/common/HomeDashboard/hooks/useUserDashboard.d.ts +0 -6
- package/dist/components/common/ImgApi/ImgApi.d.ts +0 -4
- package/dist/components/common/ImgApi/hooks/useGetImgData.d.ts +0 -9
- package/dist/components/common/ImgDirect/ImgDirect.d.ts +0 -4
- package/dist/components/common/InvalidFeedback/InvalidFeedback.d.ts +0 -6
- package/dist/components/common/Loading/Loading.d.ts +0 -3
- package/dist/components/common/Loading/LoadingBlock.d.ts +0 -4
- package/dist/components/common/MonthPicker/MonthPicker.d.ts +0 -11
- package/dist/components/common/PhotoLibrary/PhotoLibrary.d.ts +0 -14
- package/dist/components/common/PhotoLightbox/PhotoLightbox.d.ts +0 -18
- package/dist/components/common/PromptDialog/PromptDialog.d.ts +0 -3
- package/dist/components/common/SimplePicker/SimplePicker.d.ts +0 -25
- package/dist/components/common/Timeline/Timeline.d.ts +0 -7
- package/dist/components/common/Typography/Typography.d.ts +0 -9
- package/dist/components/common/VersionInfo/VersionInfo.d.ts +0 -6
- package/dist/components/common/Widget/WidgetCard.d.ts +0 -8
- package/dist/components/common/Widget/WidgetWrapper.d.ts +0 -7
- package/dist/components/common/YearPicker/YearPicker.d.ts +0 -10
- package/dist/components/common/index.d.ts +0 -27
- package/dist/contexts/auth/AuthContext.d.ts +0 -9
- package/dist/contexts/auth/AuthProvider.d.ts +0 -16
- package/dist/contexts/confirm/ConfirmContext.d.ts +0 -9
- package/dist/contexts/confirm/ConfirmProvider.d.ts +0 -6
- package/dist/contexts/delegation/DelegationContext.d.ts +0 -7
- package/dist/contexts/delegation/DelegationProvider.d.ts +0 -6
- package/dist/contexts/index.d.ts +0 -11
- package/dist/contexts/loading/LoadingContext.d.ts +0 -8
- package/dist/contexts/loading/LoadingProvider.d.ts +0 -6
- package/dist/contexts/luminus-components/LuminusComponentsContext.d.ts +0 -24
- package/dist/contexts/luminus-components/LuminusComponentsProvider.d.ts +0 -25
- package/dist/contexts/prompt/PromptContext.d.ts +0 -13
- package/dist/contexts/prompt/PromptProvider.d.ts +0 -6
- package/dist/contexts/user/UserContext.d.ts +0 -11
- package/dist/contexts/user/UserProvider.d.ts +0 -6
- package/dist/contexts.cjs.js +0 -1
- package/dist/contexts.d.ts +0 -1
- package/dist/contexts.es.js +0 -360
- package/dist/dateUtils-7nL2BXlo.js +0 -131
- package/dist/dateUtils-DUA3CKds.cjs +0 -1
- package/dist/hooks/index.d.ts +0 -12
- package/dist/hooks/useAuth/hooks/useDevAuth.d.ts +0 -7
- package/dist/hooks/useAuth/hooks/useMsalAuth.d.ts +0 -8
- package/dist/hooks/useAuth/useAuth.d.ts +0 -8
- package/dist/hooks/useAxios/useAxios.d.ts +0 -10
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +0 -3
- package/dist/hooks/useConfirm/useConfirm.d.ts +0 -8
- package/dist/hooks/useFormControlType/useFormControlType.d.ts +0 -2
- package/dist/hooks/useGetApiData/useGetApiData.d.ts +0 -9
- package/dist/hooks/useGetDataBound/useGetDataBound.d.ts +0 -2
- package/dist/hooks/useKeyPress/useKeyPress.d.ts +0 -2
- package/dist/hooks/useNotifications/useNotifications.d.ts +0 -4
- package/dist/hooks/usePermissions/usePermissions.d.ts +0 -4
- package/dist/hooks/usePrompt/usePrompt.d.ts +0 -8
- package/dist/hooks/useZodSchemaTypes/useZodSchemaTypes.d.ts +0 -74
- package/dist/hooks.cjs.js +0 -1
- package/dist/hooks.d.ts +0 -1
- package/dist/hooks.es.js +0 -2988
- package/dist/latinize-BQrinury.js +0 -950
- package/dist/latinize-DaqzUOla.cjs +0 -1
- package/dist/layout/FullScreenContainer/FullScreenContainer.d.ts +0 -4
- package/dist/layout/MainContainer/MainContainer.d.ts +0 -4
- package/dist/layout/PageTitle/PageTitle.d.ts +0 -6
- package/dist/layout/SideContentBar/SideContentBar.d.ts +0 -7
- package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +0 -11
- package/dist/layout/SideMenu/SideMenu.d.ts +0 -12
- package/dist/layout/TopBar/TopBar.d.ts +0 -9
- package/dist/layout/index.d.ts +0 -5
- package/dist/layout.cjs.js +0 -1
- package/dist/layout.d.ts +0 -1
- package/dist/layout.es.js +0 -132
- package/dist/main.cjs.js +0 -1
- package/dist/main.d.ts +0 -32
- package/dist/main.es.js +0 -4269
- package/dist/models/index.d.ts +0 -65
- package/dist/models/prop-types/ContainerProps.d.ts +0 -10
- package/dist/models/prop-types/DashboardWidgetCommonProps.d.ts +0 -5
- package/dist/models/prop-types/FormInputProps/FormCheckInputProps.d.ts +0 -6
- package/dist/models/prop-types/FormInputProps/FormFileInputProps.d.ts +0 -11
- package/dist/models/prop-types/FormInputProps/FormNumericStepperInputProps.d.ts +0 -8
- package/dist/models/prop-types/FormInputProps/FormRadioInputProps.d.ts +0 -6
- package/dist/models/prop-types/FormInputProps/FormSelectInputProps.d.ts +0 -7
- package/dist/models/prop-types/FormInputProps/FormTextAreaInputProps.d.ts +0 -7
- package/dist/models/prop-types/FormInputProps/FormTextInputProps.d.ts +0 -7
- package/dist/models/prop-types/HookFormInputProps/HookFormCheckInputProps.d.ts +0 -4
- package/dist/models/prop-types/HookFormInputProps/HookFormDropdownPickerProps.d.ts +0 -4
- package/dist/models/prop-types/HookFormInputProps/HookFormFileInputProps.d.ts +0 -4
- package/dist/models/prop-types/HookFormInputProps/HookFormInputBaseProps.d.ts +0 -7
- package/dist/models/prop-types/HookFormInputProps/HookFormInputProps.d.ts +0 -9
- package/dist/models/prop-types/HookFormInputProps/HookFormNumericStepperInputProps.d.ts +0 -4
- package/dist/models/prop-types/HookFormInputProps/HookFormRadioInputProps.d.ts +0 -4
- package/dist/models/prop-types/HookFormInputProps/HookFormSelectInputProps.d.ts +0 -4
- package/dist/models/prop-types/HookFormInputProps/HookFormTextAreaInputProps.d.ts +0 -7
- package/dist/models/prop-types/HookFormInputProps/HookFormTextInputProps.d.ts +0 -4
- package/dist/models/prop-types/ImgProps.d.ts +0 -7
- package/dist/models/prop-types/InputContainerProps.d.ts +0 -26
- package/dist/models/prop-types/InputProps/CheckInputProps.d.ts +0 -5
- package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +0 -24
- package/dist/models/prop-types/InputProps/FileInputProps.d.ts +0 -6
- package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +0 -15
- package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +0 -6
- package/dist/models/prop-types/InputProps/RadioInputProps.d.ts +0 -6
- package/dist/models/prop-types/InputProps/SelectInputProps.d.ts +0 -9
- package/dist/models/prop-types/InputProps/TextAreaInputProps.d.ts +0 -5
- package/dist/models/prop-types/InputProps/TextInputProps.d.ts +0 -10
- package/dist/models/texts/AppSearchTexts.d.ts +0 -5
- package/dist/models/texts/AxiosTexts.d.ts +0 -8
- package/dist/models/texts/ConfirmTexts.d.ts +0 -7
- package/dist/models/texts/CustomSelectTexts.d.ts +0 -5
- package/dist/models/texts/DropdownPickerTexts.d.ts +0 -5
- package/dist/models/texts/ErrorBoundaryTexts.d.ts +0 -5
- package/dist/models/texts/FormSubmitTexts.d.ts +0 -4
- package/dist/models/texts/FormValidationTexts.d.ts +0 -5
- package/dist/models/texts/HomeDashboardTexts.d.ts +0 -6
- package/dist/models/texts/WidgetTexts.d.ts +0 -4
- package/dist/models/types/ApiErrorResult.d.ts +0 -8
- package/dist/models/types/DashboardConfig.d.ts +0 -5
- package/dist/models/types/DashboardWidget.d.ts +0 -9
- package/dist/models/types/DashboardWidgetConfig.d.ts +0 -5
- package/dist/models/types/DropdownPickerOption.d.ts +0 -7
- package/dist/models/types/EmployeeIndexModel.d.ts +0 -14
- package/dist/models/types/ErrorField.d.ts +0 -5
- package/dist/models/types/FormSelectOption.d.ts +0 -5
- package/dist/models/types/HookFormInputProps.d.ts +0 -9
- package/dist/models/types/LoginState.d.ts +0 -7
- package/dist/models/types/MenuItemType.d.ts +0 -11
- package/dist/models/types/MenuItemTypeExtended.d.ts +0 -6
- package/dist/models/types/NameIdIntModel.d.ts +0 -5
- package/dist/models/types/NameIdIntOptionalModel.d.ts +0 -5
- package/dist/models/types/NameIdStringModel.d.ts +0 -5
- package/dist/models/types/NameIdStringOptionalModel.d.ts +0 -5
- package/dist/models/types/PhotoAction.d.ts +0 -9
- package/dist/models/types/PhotoLibraryItemModel.d.ts +0 -7
- package/dist/models/types/PromptOptions.d.ts +0 -7
- package/dist/models/types/SearchResultGroupKeyModel.d.ts +0 -6
- package/dist/models/types/SearchResultGroupModel.d.ts +0 -7
- package/dist/models/types/SearchResultModel.d.ts +0 -8
- package/dist/models/types/SearchType.d.ts +0 -6
- package/dist/models/types/TimelineStep.d.ts +0 -11
- package/dist/models/types/TimelineStepState.d.ts +0 -5
- package/dist/models/types/UseGetApiDataOptions.d.ts +0 -9
- package/dist/models/types/UserLoginState.d.ts +0 -7
- package/dist/models/types/UserModel.d.ts +0 -11
- package/dist/searchUtils-Do20vjZW.cjs +0 -1
- package/dist/searchUtils-Du4JnXdQ.js +0 -7
- package/dist/style.css +0 -1
- package/dist/useConfirm-95WxctJ9.cjs +0 -1
- package/dist/useConfirm-DkHhgyYO.js +0 -27
- package/dist/useFormControlType-BAFqxupC.js +0 -20
- package/dist/useFormControlType-Dqz8sV4J.cjs +0 -1
- package/dist/usePermissions-B2G69gWH.js +0 -14
- package/dist/usePermissions-kfYKLHzs.cjs +0 -1
- package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +0 -4
- package/dist/utils/date/dateUtils.d.ts +0 -1
- package/dist/utils/hookForm/hookFormUtils.d.ts +0 -3
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/object/objectUtils.d.ts +0 -2
- package/dist/utils/search/searchUtils.d.ts +0 -3
- package/dist/utils/text/textUtils.d.ts +0 -3
- package/dist/utils.cjs.js +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.es.js +0 -27
package/dist/contexts.cjs.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./NoInputContainer-BKPv5rmP.cjs"),n=require("react");require("./latinize-DaqzUOla.cjs");require("react-hook-form");const T=require("./useConfirm-95WxctJ9.cjs"),c=require("./PrimaryButton-PjAN0Acn.cjs"),h=({children:t})=>{const[o,s]=n.useState(!1),[a,r]=n.useState(""),i=n.useCallback(d=>{s(!0),r(d)},[]),u=n.useCallback(()=>{s(!1)},[]),l=n.useMemo(()=>({show:o,text:a,showConfirm:i,hideConfirm:u}),[o,a,i,u]);return e.jsxRuntimeExports.jsxs(e.ConfirmContext.Provider,{value:l,children:[e.jsxRuntimeExports.jsx(D,{}),t]})},L=()=>{const{confirmTexts:t}=n.useContext(e.LuminusComponentsContext),{isShown:o,text:s,onFinish:a}=T.usePrompt(),{options:r}=n.useContext(e.PromptContext),[i,u]=n.useState(r.defaultValue??""),l=n.useCallback(()=>{a(null)},[a]),d=n.useCallback(E=>{E.preventDefault(),!(r.required&&!i)&&a(i)},[a,r.required,i]);n.useEffect(()=>{o===!0&&u(r.defaultValue??"")},[o,r.defaultValue]);const m=n.useMemo(()=>({value:i,onChange:E=>u(E.currentTarget.value),className:"w-100",autoFocus:!0,tabIndex:0}),[i]);return e.jsxRuntimeExports.jsxs(c.Modal,{show:o,size:"sm",centered:!0,onHide:l,children:[e.jsxRuntimeExports.jsx(c.Modal.Header,{className:"justify-content-center",children:e.jsxRuntimeExports.jsx(c.Modal.Title,{children:s})}),e.jsxRuntimeExports.jsxs("form",{onSubmit:d,children:[e.jsxRuntimeExports.jsxs(c.Modal.Body,{children:[r.input==="textarea"?e.jsxRuntimeExports.jsx("textarea",{...m,rows:5}):void 0,r.input==="input"?e.jsxRuntimeExports.jsx(c.FormControl,{...m,type:r.type}):void 0]}),e.jsxRuntimeExports.jsxs(c.Modal.Footer,{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx(c.PrimaryButton,{variant:"outlined",color:"secondary",onClick:l,className:"flex-grow-1",children:t.cancel}),e.jsxRuntimeExports.jsx(c.PrimaryButton,{color:"primary",disabled:r.required&&!i,type:"submit",className:"flex-grow-1",children:t.confirm})]})]})]})},N=({children:t})=>{const[o,s]=n.useState(!1),[a,r]=n.useState(""),[i,u]=n.useState({input:"textarea",type:"text"}),l=n.useRef(()=>{}),d=n.useCallback(p=>{r(p),s(!0)},[]),m=n.useCallback(()=>{s(!1)},[]),E=n.useMemo(()=>({isShown:o,text:a,showPrompt:d,hidePrompt:m,resolveRef:l,options:i,setOptions:u}),[o,a,d,m,i]);return e.jsxRuntimeExports.jsxs(e.PromptContext.Provider,{value:E,children:[t,e.jsxRuntimeExports.jsx(L,{})]})},k=({cookieDomain:t,axiosOptions:o,LinkComponent:s,NavigateComponent:a,language:r,axiosTexts:i,confirmTexts:u,formValidationTexts:l,homeDashboardTexts:d,formSubmitTexts:m,appSearchTexts:E,customSelectTexts:p,errorBoundaryTexts:S,widgetTexts:f,children:R})=>{const g=n.useMemo(()=>({axiosOptions:o,cookieDomain:t,LinkComponent:s,NavigateComponent:a,language:r,axiosTexts:i,confirmTexts:u,formValidationTexts:l,homeDashboardTexts:d,formSubmitTexts:m,appSearchTexts:E,customSelectTexts:p,errorBoundaryTexts:S,widgetTexts:f}),[o,t,s,a,r,i,u,l,d,m,E,p,S,f]);return e.jsxRuntimeExports.jsx(e.LuminusComponentsContext.Provider,{value:g,children:e.jsxRuntimeExports.jsx(h,{children:e.jsxRuntimeExports.jsxs(N,{children:[e.jsxRuntimeExports.jsx(e.Ie,{}),R]})})})},A=({children:t})=>{const[o,s]=n.useState(!1),[a]=n.useState(new Set),r=n.useCallback(l=>{a.add(l),s(!0)},[a]),i=n.useCallback(l=>{a.delete(l),a.size===0&&s(!1)},[a]),u=n.useMemo(()=>({isLoading:o,startLoading:r,stopLoading:i}),[o,r,i]);return e.jsxRuntimeExports.jsxs(e.LoadingContext.Provider,{value:u,children:[o&&e.jsxRuntimeExports.jsx(c.Loading,{}),t]})};/*! @azure/msal-browser v3.14.0 2024-05-07 */class b{static getInteractionStatusFromEvent(o,s){switch(o.eventType){case c.EventType.LOGIN_START:return e.InteractionStatus.Login;case c.EventType.SSO_SILENT_START:return e.InteractionStatus.SsoSilent;case c.EventType.ACQUIRE_TOKEN_START:if(o.interactionType===e.InteractionType.Redirect||o.interactionType===e.InteractionType.Popup)return e.InteractionStatus.AcquireToken;break;case c.EventType.HANDLE_REDIRECT_START:return e.InteractionStatus.HandleRedirect;case c.EventType.LOGOUT_START:return e.InteractionStatus.Logout;case c.EventType.SSO_SILENT_SUCCESS:case c.EventType.SSO_SILENT_FAILURE:if(s&&s!==e.InteractionStatus.SsoSilent)break;return e.InteractionStatus.None;case c.EventType.LOGOUT_END:if(s&&s!==e.InteractionStatus.Logout)break;return e.InteractionStatus.None;case c.EventType.HANDLE_REDIRECT_END:if(s&&s!==e.InteractionStatus.HandleRedirect)break;return e.InteractionStatus.None;case c.EventType.LOGIN_SUCCESS:case c.EventType.LOGIN_FAILURE:case c.EventType.ACQUIRE_TOKEN_SUCCESS:case c.EventType.ACQUIRE_TOKEN_FAILURE:case c.EventType.RESTORE_FROM_BFCACHE:if(o.interactionType===e.InteractionType.Redirect||o.interactionType===e.InteractionType.Popup){if(s&&s!==e.InteractionStatus.Login&&s!==e.InteractionStatus.AcquireToken)break;return e.InteractionStatus.None}break}return null}}/*! @azure/msal-react v2.0.16 2024-05-07 */const O="@azure/msal-react",j="2.0.16";/*! @azure/msal-react v2.0.16 2024-05-07 */const v={UNBLOCK_INPROGRESS:"UNBLOCK_INPROGRESS",EVENT:"EVENT"},U=(t,o)=>{const{type:s,payload:a}=o;let r=t.inProgress;switch(s){case v.UNBLOCK_INPROGRESS:t.inProgress===e.InteractionStatus.Startup&&(r=e.InteractionStatus.None,a.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));break;case v.EVENT:const u=a.message,l=b.getInteractionStatusFromEvent(u,t.inProgress);l&&(a.logger.info(`MsalProvider - ${u.eventType} results in setting inProgress from ${t.inProgress} to ${l}`),r=l);break;default:throw new Error(`Unknown action type: ${s}`)}const i=a.instance.getAllAccounts();return r!==t.inProgress&&!e.accountArraysAreEqual(i,t.accounts)?{...t,inProgress:r,accounts:i}:r!==t.inProgress?{...t,inProgress:r}:e.accountArraysAreEqual(i,t.accounts)?t:{...t,accounts:i}};function _({instance:t,children:o}){n.useEffect(()=>{t.initializeWrapperLibrary(e.WrapperSKU.React,j)},[t]);const s=n.useMemo(()=>t.getLogger().clone(O,j),[t]),[a,r]=n.useReducer(U,void 0,()=>({inProgress:e.InteractionStatus.Startup,accounts:t.getAllAccounts()}));n.useEffect(()=>{const u=t.addEventCallback(l=>{r({payload:{instance:t,logger:s,message:l},type:v.EVENT})});return s.verbose(`MsalProvider - Registered event callback with id: ${u}`),t.initialize().then(()=>{t.handleRedirectPromise().catch(()=>{}).finally(()=>{r({payload:{instance:t,logger:s},type:v.UNBLOCK_INPROGRESS})})}).catch(()=>{}),()=>{u&&(s.verbose(`MsalProvider - Removing event callback ${u}`),t.removeEventCallback(u))}},[t,s]);const i={instance:t,inProgress:a.inProgress,accounts:a.accounts,logger:s};return n.createElement(e.MsalContext.Provider,{value:i},o)}const M=({children:t})=>{const o=e.useAxios(),{msalInstance:s}=n.useContext(e.AuthContext),{delegationId:a,setDelegationId:r}=n.useContext(e.DelegationContext),{getToken:i}=e.useAuth(),[u,l]=n.useState(null),d=n.useCallback(async()=>{const x=await i();x&&l(x)},[i]);n.useEffect(()=>{d()},[d]);const E=n.useCallback(()=>{const x=localStorage.getItem("user")??null;return x?JSON.parse(x??""):null},[])(),[p,S]=n.useState({state:E?e.LoginState.LOGGED_IN:e.LoginState.LOGGING_IN,user:E}),f=n.useCallback(async x=>{let C=null;return await o.get("/user/detail",x?{headers:{Authorization:`Bearer ${x}`}}:void 0).then(y=>{C=y.data}).catch(()=>{C=null}),C},[o]),R=n.useCallback(()=>{localStorage.removeItem("user"),S({state:e.LoginState.LOGGED_OUT,user:null})},[]),g=n.useCallback(async x=>{S({state:e.LoginState.LOGGING_IN,user:null});const C=await f(x);return C?(S({state:e.LoginState.LOGGED_IN,user:C}),localStorage.setItem("user",JSON.stringify(C)),!0):(S({state:e.LoginState.LOGIN_FAILED,user:null}),!1)},[f]),I=n.useCallback(()=>{R()},[R]),P=n.useMemo(()=>({user:p.user,userLoginState:p,loginUser:g,logoutUser:I}),[p,g,I]);return n.useEffect(()=>{if(s){const x=s.addEventCallback(C=>{if(C.eventType===c.EventType.LOGIN_SUCCESS&&C.payload){const y=C.payload;l(y.accessToken)}});return()=>{x&&s.removeEventCallback(x)}}return()=>{}},[s,g,I]),n.useEffect(()=>{u&&g(u).catch(()=>{I(),r(null)})},[u,g,I,a,r]),e.jsxRuntimeExports.jsx(e.UserContext.Provider,{value:P,children:t})},w=({...t})=>{const{cookieDomain:o}=n.useContext(e.LuminusComponentsContext),[,s]=e.useCookies(["Authorization"]),a=n.useMemo(()=>({useMsal:t.useMsal??!1,msalInstance:t.useMsal?t.msalInstance??null:null,msalScopes:t.useMsal?t.msalScopes??[]:[]}),[t]);return n.useEffect(()=>{if(t.useMsal){const r=t.msalInstance.addEventCallback(i=>{if(i.eventType===c.EventType.LOGIN_SUCCESS||i.eventType===c.EventType.ACQUIRE_TOKEN_SUCCESS&&i.payload){const u=i.payload,l=u.account;t.msalInstance.setActiveAccount(l);const d=u.accessToken,m=u.expiresOn;s("Authorization",d,{path:"/",secure:!0,sameSite:"none",domain:o,expires:m??void 0})}i.error&&console.error("AuthProvider MSAL Error",i)});return()=>{r&&t.msalInstance.removeEventCallback(r)}}return()=>{}},[t,s,o]),e.jsxRuntimeExports.jsx(e.AuthContext.Provider,{value:a,children:t.useMsal?e.jsxRuntimeExports.jsx(_,{instance:t.msalInstance,children:t.children}):t.children})},G=({children:t})=>{const[o,s]=n.useState(null),a=n.useMemo(()=>({delegationId:o,setDelegationId:s}),[o]);return e.jsxRuntimeExports.jsx(e.DelegationContext.Provider,{value:a,children:t})},D=()=>{const{confirmTexts:t}=n.useContext(e.LuminusComponentsContext),{onConfirm:o,onCancel:s,text:a,show:r}=T.useConfirm();return e.jsxRuntimeExports.jsxs(c.Modal,{show:r,size:"sm",centered:!0,onHide:s,children:[e.jsxRuntimeExports.jsx(c.Modal.Header,{className:"justify-content-center",children:e.jsxRuntimeExports.jsx(c.Modal.Title,{children:a})}),e.jsxRuntimeExports.jsx(c.Modal.Body,{children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 d-flex gap-5",children:[e.jsxRuntimeExports.jsx(c.PrimaryButton,{type:"button",variant:"outlined",color:"secondary",className:"w-100",onClick:s,children:t.no}),e.jsxRuntimeExports.jsx(c.PrimaryButton,{type:"button",color:"primary",onClick:o,className:"w-100 ml",children:t.yes})]})})]})};exports.AuthContext=e.AuthContext;exports.DelegationContext=e.DelegationContext;exports.LoadingContext=e.LoadingContext;exports.LuminusComponentsContext=e.LuminusComponentsContext;exports.UserContext=e.UserContext;exports.AuthProvider=w;exports.DelegationProvider=G;exports.LoadingProvider=A;exports.LuminusComponentsProvider=k;exports.UserProvider=M;
|
package/dist/contexts.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './contexts/index'
|
package/dist/contexts.es.js
DELETED
|
@@ -1,360 +0,0 @@
|
|
|
1
|
-
import { j as a, am as F, Q as j, an as w, ao as z, ap as K, L as A, K as i, aq as H, ar as B, as as U, a4 as q, a8 as G, at as M, a9 as V, ab as y, aa as $, au as Q } from "./NoInputContainer-C2e1tx-D.js";
|
|
2
|
-
import J, { useState as h, useCallback as f, useMemo as C, useContext as L, useEffect as v, useRef as W, useReducer as X } from "react";
|
|
3
|
-
import "./latinize-BQrinury.js";
|
|
4
|
-
import "react-hook-form";
|
|
5
|
-
import { u as Y, a as Z } from "./useConfirm-DkHhgyYO.js";
|
|
6
|
-
import { M as I, b as ee, P as p, L as te, E as u } from "./PrimaryButton-JNkq9258.js";
|
|
7
|
-
const ne = ({ children: e }) => {
|
|
8
|
-
const [n, t] = h(!1), [o, s] = h(""), r = f((d) => {
|
|
9
|
-
t(!0), s(d);
|
|
10
|
-
}, []), c = f(() => {
|
|
11
|
-
t(!1);
|
|
12
|
-
}, []), l = C(() => ({ show: n, text: o, showConfirm: r, hideConfirm: c }), [n, o, r, c]);
|
|
13
|
-
return /* @__PURE__ */ a.jsxs(F.Provider, { value: l, children: [
|
|
14
|
-
/* @__PURE__ */ a.jsx(ie, {}),
|
|
15
|
-
e
|
|
16
|
-
] });
|
|
17
|
-
}, se = () => {
|
|
18
|
-
const { confirmTexts: e } = L(j), { isShown: n, text: t, onFinish: o } = Y(), { options: s } = L(w), [r, c] = h(s.defaultValue ?? ""), l = f(() => {
|
|
19
|
-
o(null);
|
|
20
|
-
}, [o]), d = f((E) => {
|
|
21
|
-
E.preventDefault(), !(s.required && !r) && o(r);
|
|
22
|
-
}, [o, s.required, r]);
|
|
23
|
-
v(() => {
|
|
24
|
-
n === !0 && c(s.defaultValue ?? "");
|
|
25
|
-
}, [n, s.defaultValue]);
|
|
26
|
-
const g = C(() => ({
|
|
27
|
-
value: r,
|
|
28
|
-
onChange: (E) => c(E.currentTarget.value),
|
|
29
|
-
className: "w-100",
|
|
30
|
-
autoFocus: !0,
|
|
31
|
-
tabIndex: 0
|
|
32
|
-
}), [r]);
|
|
33
|
-
return /* @__PURE__ */ a.jsxs(I, { show: n, size: "sm", centered: !0, onHide: l, children: [
|
|
34
|
-
/* @__PURE__ */ a.jsx(I.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(I.Title, { children: t }) }),
|
|
35
|
-
/* @__PURE__ */ a.jsxs("form", { onSubmit: d, children: [
|
|
36
|
-
/* @__PURE__ */ a.jsxs(I.Body, { children: [
|
|
37
|
-
s.input === "textarea" ? /* @__PURE__ */ a.jsx("textarea", { ...g, rows: 5 }) : void 0,
|
|
38
|
-
s.input === "input" ? /* @__PURE__ */ a.jsx(ee, { ...g, type: s.type }) : void 0
|
|
39
|
-
] }),
|
|
40
|
-
/* @__PURE__ */ a.jsxs(I.Footer, { className: "w-100 d-flex gap-5", children: [
|
|
41
|
-
/* @__PURE__ */ a.jsx(p, { variant: "outlined", color: "secondary", onClick: l, className: "flex-grow-1", children: e.cancel }),
|
|
42
|
-
/* @__PURE__ */ a.jsx(p, { color: "primary", disabled: s.required && !r, type: "submit", className: "flex-grow-1", children: e.confirm })
|
|
43
|
-
] })
|
|
44
|
-
] })
|
|
45
|
-
] });
|
|
46
|
-
}, oe = ({ children: e }) => {
|
|
47
|
-
const [n, t] = h(!1), [o, s] = h(""), [r, c] = h({ input: "textarea", type: "text" }), l = W(() => {
|
|
48
|
-
}), d = f((P) => {
|
|
49
|
-
s(P), t(!0);
|
|
50
|
-
}, []), g = f(() => {
|
|
51
|
-
t(!1);
|
|
52
|
-
}, []), E = C(() => ({
|
|
53
|
-
isShown: n,
|
|
54
|
-
text: o,
|
|
55
|
-
showPrompt: d,
|
|
56
|
-
hidePrompt: g,
|
|
57
|
-
resolveRef: l,
|
|
58
|
-
options: r,
|
|
59
|
-
setOptions: c
|
|
60
|
-
}), [n, o, d, g, r]);
|
|
61
|
-
return /* @__PURE__ */ a.jsxs(w.Provider, { value: E, children: [
|
|
62
|
-
e,
|
|
63
|
-
/* @__PURE__ */ a.jsx(se, {})
|
|
64
|
-
] });
|
|
65
|
-
}, xe = ({ cookieDomain: e, axiosOptions: n, LinkComponent: t, NavigateComponent: o, language: s, axiosTexts: r, confirmTexts: c, formValidationTexts: l, homeDashboardTexts: d, formSubmitTexts: g, appSearchTexts: E, customSelectTexts: P, errorBoundaryTexts: S, widgetTexts: R, children: _ }) => {
|
|
66
|
-
const N = C(() => ({
|
|
67
|
-
axiosOptions: n,
|
|
68
|
-
cookieDomain: e,
|
|
69
|
-
LinkComponent: t,
|
|
70
|
-
NavigateComponent: o,
|
|
71
|
-
language: s,
|
|
72
|
-
axiosTexts: r,
|
|
73
|
-
confirmTexts: c,
|
|
74
|
-
formValidationTexts: l,
|
|
75
|
-
homeDashboardTexts: d,
|
|
76
|
-
formSubmitTexts: g,
|
|
77
|
-
appSearchTexts: E,
|
|
78
|
-
customSelectTexts: P,
|
|
79
|
-
errorBoundaryTexts: S,
|
|
80
|
-
widgetTexts: R
|
|
81
|
-
}), [
|
|
82
|
-
n,
|
|
83
|
-
e,
|
|
84
|
-
t,
|
|
85
|
-
o,
|
|
86
|
-
s,
|
|
87
|
-
r,
|
|
88
|
-
c,
|
|
89
|
-
l,
|
|
90
|
-
d,
|
|
91
|
-
g,
|
|
92
|
-
E,
|
|
93
|
-
P,
|
|
94
|
-
S,
|
|
95
|
-
R
|
|
96
|
-
]);
|
|
97
|
-
return /* @__PURE__ */ a.jsx(j.Provider, { value: N, children: /* @__PURE__ */ a.jsx(ne, { children: /* @__PURE__ */ a.jsxs(oe, { children: [
|
|
98
|
-
/* @__PURE__ */ a.jsx(z, {}),
|
|
99
|
-
_
|
|
100
|
-
] }) }) });
|
|
101
|
-
}, he = ({ children: e }) => {
|
|
102
|
-
const [n, t] = h(!1), [o] = h(/* @__PURE__ */ new Set()), s = f((l) => {
|
|
103
|
-
o.add(l), t(!0);
|
|
104
|
-
}, [o]), r = f((l) => {
|
|
105
|
-
o.delete(l), o.size === 0 && t(!1);
|
|
106
|
-
}, [o]), c = C(() => ({ isLoading: n, startLoading: s, stopLoading: r }), [n, s, r]);
|
|
107
|
-
return /* @__PURE__ */ a.jsxs(K.Provider, { value: c, children: [
|
|
108
|
-
n && /* @__PURE__ */ a.jsx(te, {}),
|
|
109
|
-
e
|
|
110
|
-
] });
|
|
111
|
-
};
|
|
112
|
-
/*! @azure/msal-browser v3.14.0 2024-05-07 */
|
|
113
|
-
class re {
|
|
114
|
-
/**
|
|
115
|
-
* Gets interaction status from event message
|
|
116
|
-
* @param message
|
|
117
|
-
* @param currentStatus
|
|
118
|
-
*/
|
|
119
|
-
static getInteractionStatusFromEvent(n, t) {
|
|
120
|
-
switch (n.eventType) {
|
|
121
|
-
case u.LOGIN_START:
|
|
122
|
-
return i.Login;
|
|
123
|
-
case u.SSO_SILENT_START:
|
|
124
|
-
return i.SsoSilent;
|
|
125
|
-
case u.ACQUIRE_TOKEN_START:
|
|
126
|
-
if (n.interactionType === A.Redirect || n.interactionType === A.Popup)
|
|
127
|
-
return i.AcquireToken;
|
|
128
|
-
break;
|
|
129
|
-
case u.HANDLE_REDIRECT_START:
|
|
130
|
-
return i.HandleRedirect;
|
|
131
|
-
case u.LOGOUT_START:
|
|
132
|
-
return i.Logout;
|
|
133
|
-
case u.SSO_SILENT_SUCCESS:
|
|
134
|
-
case u.SSO_SILENT_FAILURE:
|
|
135
|
-
if (t && t !== i.SsoSilent)
|
|
136
|
-
break;
|
|
137
|
-
return i.None;
|
|
138
|
-
case u.LOGOUT_END:
|
|
139
|
-
if (t && t !== i.Logout)
|
|
140
|
-
break;
|
|
141
|
-
return i.None;
|
|
142
|
-
case u.HANDLE_REDIRECT_END:
|
|
143
|
-
if (t && t !== i.HandleRedirect)
|
|
144
|
-
break;
|
|
145
|
-
return i.None;
|
|
146
|
-
case u.LOGIN_SUCCESS:
|
|
147
|
-
case u.LOGIN_FAILURE:
|
|
148
|
-
case u.ACQUIRE_TOKEN_SUCCESS:
|
|
149
|
-
case u.ACQUIRE_TOKEN_FAILURE:
|
|
150
|
-
case u.RESTORE_FROM_BFCACHE:
|
|
151
|
-
if (n.interactionType === A.Redirect || n.interactionType === A.Popup) {
|
|
152
|
-
if (t && t !== i.Login && t !== i.AcquireToken)
|
|
153
|
-
break;
|
|
154
|
-
return i.None;
|
|
155
|
-
}
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
162
|
-
const ae = "@azure/msal-react", b = "2.0.16";
|
|
163
|
-
/*! @azure/msal-react v2.0.16 2024-05-07 */
|
|
164
|
-
const O = {
|
|
165
|
-
UNBLOCK_INPROGRESS: "UNBLOCK_INPROGRESS",
|
|
166
|
-
EVENT: "EVENT"
|
|
167
|
-
}, ce = (e, n) => {
|
|
168
|
-
const { type: t, payload: o } = n;
|
|
169
|
-
let s = e.inProgress;
|
|
170
|
-
switch (t) {
|
|
171
|
-
case O.UNBLOCK_INPROGRESS:
|
|
172
|
-
e.inProgress === i.Startup && (s = i.None, o.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'"));
|
|
173
|
-
break;
|
|
174
|
-
case O.EVENT:
|
|
175
|
-
const c = o.message, l = re.getInteractionStatusFromEvent(c, e.inProgress);
|
|
176
|
-
l && (o.logger.info(`MsalProvider - ${c.eventType} results in setting inProgress from ${e.inProgress} to ${l}`), s = l);
|
|
177
|
-
break;
|
|
178
|
-
default:
|
|
179
|
-
throw new Error(`Unknown action type: ${t}`);
|
|
180
|
-
}
|
|
181
|
-
const r = o.instance.getAllAccounts();
|
|
182
|
-
return s !== e.inProgress && !U(r, e.accounts) ? {
|
|
183
|
-
...e,
|
|
184
|
-
inProgress: s,
|
|
185
|
-
accounts: r
|
|
186
|
-
} : s !== e.inProgress ? {
|
|
187
|
-
...e,
|
|
188
|
-
inProgress: s
|
|
189
|
-
} : U(r, e.accounts) ? e : {
|
|
190
|
-
...e,
|
|
191
|
-
accounts: r
|
|
192
|
-
};
|
|
193
|
-
};
|
|
194
|
-
function le({ instance: e, children: n }) {
|
|
195
|
-
v(() => {
|
|
196
|
-
e.initializeWrapperLibrary(H.React, b);
|
|
197
|
-
}, [e]);
|
|
198
|
-
const t = C(() => e.getLogger().clone(ae, b), [e]), [o, s] = X(ce, void 0, () => ({
|
|
199
|
-
inProgress: i.Startup,
|
|
200
|
-
accounts: e.getAllAccounts()
|
|
201
|
-
}));
|
|
202
|
-
v(() => {
|
|
203
|
-
const c = e.addEventCallback((l) => {
|
|
204
|
-
s({
|
|
205
|
-
payload: {
|
|
206
|
-
instance: e,
|
|
207
|
-
logger: t,
|
|
208
|
-
message: l
|
|
209
|
-
},
|
|
210
|
-
type: O.EVENT
|
|
211
|
-
});
|
|
212
|
-
});
|
|
213
|
-
return t.verbose(`MsalProvider - Registered event callback with id: ${c}`), e.initialize().then(() => {
|
|
214
|
-
e.handleRedirectPromise().catch(() => {
|
|
215
|
-
}).finally(() => {
|
|
216
|
-
s({
|
|
217
|
-
payload: {
|
|
218
|
-
instance: e,
|
|
219
|
-
logger: t
|
|
220
|
-
},
|
|
221
|
-
type: O.UNBLOCK_INPROGRESS
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
}).catch(() => {
|
|
225
|
-
}), () => {
|
|
226
|
-
c && (t.verbose(`MsalProvider - Removing event callback ${c}`), e.removeEventCallback(c));
|
|
227
|
-
};
|
|
228
|
-
}, [e, t]);
|
|
229
|
-
const r = {
|
|
230
|
-
instance: e,
|
|
231
|
-
inProgress: o.inProgress,
|
|
232
|
-
accounts: o.accounts,
|
|
233
|
-
logger: t
|
|
234
|
-
};
|
|
235
|
-
return J.createElement(B.Provider, { value: r }, n);
|
|
236
|
-
}
|
|
237
|
-
const Ie = ({ children: e }) => {
|
|
238
|
-
const n = q(), { msalInstance: t } = L(G), { delegationId: o, setDelegationId: s } = L(M), { getToken: r } = V(), [c, l] = h(null), d = f(async () => {
|
|
239
|
-
const m = await r();
|
|
240
|
-
m && l(m);
|
|
241
|
-
}, [r]);
|
|
242
|
-
v(() => {
|
|
243
|
-
d();
|
|
244
|
-
}, [d]);
|
|
245
|
-
const E = f(() => {
|
|
246
|
-
const m = localStorage.getItem("user") ?? null;
|
|
247
|
-
return m ? JSON.parse(m ?? "") : null;
|
|
248
|
-
}, [])(), [P, S] = h({
|
|
249
|
-
state: E ? y.LOGGED_IN : y.LOGGING_IN,
|
|
250
|
-
user: E
|
|
251
|
-
}), R = f(async (m) => {
|
|
252
|
-
let x = null;
|
|
253
|
-
return await n.get("/user/detail", m ? { headers: { Authorization: `Bearer ${m}` } } : void 0).then((k) => {
|
|
254
|
-
x = k.data;
|
|
255
|
-
}).catch(() => {
|
|
256
|
-
x = null;
|
|
257
|
-
}), x;
|
|
258
|
-
}, [n]), _ = f(() => {
|
|
259
|
-
localStorage.removeItem("user"), S({
|
|
260
|
-
state: y.LOGGED_OUT,
|
|
261
|
-
user: null
|
|
262
|
-
});
|
|
263
|
-
}, []), N = f(async (m) => {
|
|
264
|
-
S({
|
|
265
|
-
state: y.LOGGING_IN,
|
|
266
|
-
user: null
|
|
267
|
-
});
|
|
268
|
-
const x = await R(m);
|
|
269
|
-
return x ? (S({
|
|
270
|
-
state: y.LOGGED_IN,
|
|
271
|
-
user: x
|
|
272
|
-
}), localStorage.setItem("user", JSON.stringify(x)), !0) : (S({
|
|
273
|
-
state: y.LOGIN_FAILED,
|
|
274
|
-
user: null
|
|
275
|
-
}), !1);
|
|
276
|
-
}, [R]), T = f(() => {
|
|
277
|
-
_();
|
|
278
|
-
}, [_]), D = C(() => ({
|
|
279
|
-
user: P.user,
|
|
280
|
-
userLoginState: P,
|
|
281
|
-
loginUser: N,
|
|
282
|
-
logoutUser: T
|
|
283
|
-
}), [P, N, T]);
|
|
284
|
-
return v(() => {
|
|
285
|
-
if (t) {
|
|
286
|
-
const m = t.addEventCallback((x) => {
|
|
287
|
-
if (x.eventType === u.LOGIN_SUCCESS && x.payload) {
|
|
288
|
-
const k = x.payload;
|
|
289
|
-
l(k.accessToken);
|
|
290
|
-
}
|
|
291
|
-
});
|
|
292
|
-
return () => {
|
|
293
|
-
m && t.removeEventCallback(m);
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
return () => {
|
|
297
|
-
};
|
|
298
|
-
}, [t, N, T]), v(() => {
|
|
299
|
-
c && N(c).catch(() => {
|
|
300
|
-
T(), s(null);
|
|
301
|
-
});
|
|
302
|
-
}, [c, N, T, o, s]), /* @__PURE__ */ a.jsx($.Provider, { value: D, children: e });
|
|
303
|
-
}, Ce = ({ ...e }) => {
|
|
304
|
-
const { cookieDomain: n } = L(j), [, t] = Q(["Authorization"]), o = C(() => ({
|
|
305
|
-
useMsal: e.useMsal ?? !1,
|
|
306
|
-
msalInstance: e.useMsal ? e.msalInstance ?? null : null,
|
|
307
|
-
msalScopes: e.useMsal ? e.msalScopes ?? [] : []
|
|
308
|
-
}), [e]);
|
|
309
|
-
return v(() => {
|
|
310
|
-
if (e.useMsal) {
|
|
311
|
-
const s = e.msalInstance.addEventCallback((r) => {
|
|
312
|
-
if (r.eventType === u.LOGIN_SUCCESS || r.eventType === u.ACQUIRE_TOKEN_SUCCESS && r.payload) {
|
|
313
|
-
const c = r.payload, l = c.account;
|
|
314
|
-
e.msalInstance.setActiveAccount(l);
|
|
315
|
-
const d = c.accessToken, g = c.expiresOn;
|
|
316
|
-
t("Authorization", d, {
|
|
317
|
-
path: "/",
|
|
318
|
-
secure: !0,
|
|
319
|
-
sameSite: "none",
|
|
320
|
-
domain: n,
|
|
321
|
-
expires: g ?? void 0
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
r.error && console.error("AuthProvider MSAL Error", r);
|
|
325
|
-
});
|
|
326
|
-
return () => {
|
|
327
|
-
s && e.msalInstance.removeEventCallback(s);
|
|
328
|
-
};
|
|
329
|
-
}
|
|
330
|
-
return () => {
|
|
331
|
-
};
|
|
332
|
-
}, [e, t, n]), /* @__PURE__ */ a.jsx(G.Provider, { value: o, children: e.useMsal ? /* @__PURE__ */ a.jsx(le, { instance: e.msalInstance, children: e.children }) : e.children });
|
|
333
|
-
}, Pe = ({ children: e }) => {
|
|
334
|
-
const [n, t] = h(null), o = C(() => ({
|
|
335
|
-
delegationId: n,
|
|
336
|
-
setDelegationId: t
|
|
337
|
-
}), [n]);
|
|
338
|
-
return /* @__PURE__ */ a.jsx(M.Provider, { value: o, children: e });
|
|
339
|
-
}, ie = () => {
|
|
340
|
-
const { confirmTexts: e } = L(j), { onConfirm: n, onCancel: t, text: o, show: s } = Z();
|
|
341
|
-
return /* @__PURE__ */ a.jsxs(I, { show: s, size: "sm", centered: !0, onHide: t, children: [
|
|
342
|
-
/* @__PURE__ */ a.jsx(I.Header, { className: "justify-content-center", children: /* @__PURE__ */ a.jsx(I.Title, { children: o }) }),
|
|
343
|
-
/* @__PURE__ */ a.jsx(I.Body, { children: /* @__PURE__ */ a.jsxs("div", { className: "w-100 d-flex gap-5", children: [
|
|
344
|
-
/* @__PURE__ */ a.jsx(p, { type: "button", variant: "outlined", color: "secondary", className: "w-100", onClick: t, children: e.no }),
|
|
345
|
-
/* @__PURE__ */ a.jsx(p, { type: "button", color: "primary", onClick: n, className: "w-100 ml", children: e.yes })
|
|
346
|
-
] }) })
|
|
347
|
-
] });
|
|
348
|
-
};
|
|
349
|
-
export {
|
|
350
|
-
G as AuthContext,
|
|
351
|
-
Ce as AuthProvider,
|
|
352
|
-
M as DelegationContext,
|
|
353
|
-
Pe as DelegationProvider,
|
|
354
|
-
K as LoadingContext,
|
|
355
|
-
he as LoadingProvider,
|
|
356
|
-
j as LuminusComponentsContext,
|
|
357
|
-
xe as LuminusComponentsProvider,
|
|
358
|
-
$ as UserContext,
|
|
359
|
-
Ie as UserProvider
|
|
360
|
-
};
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { b as m, g as D } from "./latinize-BQrinury.js";
|
|
2
|
-
function N(t, e) {
|
|
3
|
-
const n = w(t);
|
|
4
|
-
let a;
|
|
5
|
-
if (n.date) {
|
|
6
|
-
const i = h(n.date, 2);
|
|
7
|
-
a = C(i.restDateString, i.year);
|
|
8
|
-
}
|
|
9
|
-
if (!a || isNaN(a.getTime()))
|
|
10
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
11
|
-
const s = a.getTime();
|
|
12
|
-
let o = 0, u;
|
|
13
|
-
if (n.time && (o = I(n.time), isNaN(o)))
|
|
14
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
15
|
-
if (n.timezone) {
|
|
16
|
-
if (u = x(n.timezone), isNaN(u))
|
|
17
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
18
|
-
} else {
|
|
19
|
-
const i = new Date(s + o), c = /* @__PURE__ */ new Date(0);
|
|
20
|
-
return c.setFullYear(
|
|
21
|
-
i.getUTCFullYear(),
|
|
22
|
-
i.getUTCMonth(),
|
|
23
|
-
i.getUTCDate()
|
|
24
|
-
), c.setHours(
|
|
25
|
-
i.getUTCHours(),
|
|
26
|
-
i.getUTCMinutes(),
|
|
27
|
-
i.getUTCSeconds(),
|
|
28
|
-
i.getUTCMilliseconds()
|
|
29
|
-
), c;
|
|
30
|
-
}
|
|
31
|
-
return new Date(s + o + u);
|
|
32
|
-
}
|
|
33
|
-
const f = {
|
|
34
|
-
dateTimeDelimiter: /[T ]/,
|
|
35
|
-
timeZoneDelimiter: /[Z ]/i,
|
|
36
|
-
timezone: /([Z+-].*)$/
|
|
37
|
-
}, g = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/, T = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/, U = /^([+-])(\d{2})(?::?(\d{2}))?$/;
|
|
38
|
-
function w(t) {
|
|
39
|
-
const e = {}, r = t.split(f.dateTimeDelimiter);
|
|
40
|
-
let n;
|
|
41
|
-
if (r.length > 2)
|
|
42
|
-
return e;
|
|
43
|
-
if (/:/.test(r[0]) ? n = r[0] : (e.date = r[0], n = r[1], f.timeZoneDelimiter.test(e.date) && (e.date = t.split(f.timeZoneDelimiter)[0], n = t.substr(
|
|
44
|
-
e.date.length,
|
|
45
|
-
t.length
|
|
46
|
-
))), n) {
|
|
47
|
-
const a = f.timezone.exec(n);
|
|
48
|
-
a ? (e.time = n.replace(a[1], ""), e.timezone = a[1]) : e.time = n;
|
|
49
|
-
}
|
|
50
|
-
return e;
|
|
51
|
-
}
|
|
52
|
-
function h(t, e) {
|
|
53
|
-
const r = new RegExp(
|
|
54
|
-
"^(?:(\\d{4}|[+-]\\d{" + (4 + e) + "})|(\\d{2}|[+-]\\d{" + (2 + e) + "})$)"
|
|
55
|
-
), n = t.match(r);
|
|
56
|
-
if (!n)
|
|
57
|
-
return { year: NaN, restDateString: "" };
|
|
58
|
-
const a = n[1] ? parseInt(n[1]) : null, s = n[2] ? parseInt(n[2]) : null;
|
|
59
|
-
return {
|
|
60
|
-
year: s === null ? a : s * 100,
|
|
61
|
-
restDateString: t.slice((n[1] || n[2]).length)
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function C(t, e) {
|
|
65
|
-
if (e === null)
|
|
66
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
67
|
-
const r = t.match(g);
|
|
68
|
-
if (!r)
|
|
69
|
-
return /* @__PURE__ */ new Date(NaN);
|
|
70
|
-
const n = !!r[4], a = l(r[1]), s = l(r[2]) - 1, o = l(r[3]), u = l(r[4]), i = l(r[5]) - 1;
|
|
71
|
-
if (n)
|
|
72
|
-
return M(e, u, i) ? Y(e, u, i) : /* @__PURE__ */ new Date(NaN);
|
|
73
|
-
{
|
|
74
|
-
const c = /* @__PURE__ */ new Date(0);
|
|
75
|
-
return !z(e, s, o) || !O(e, a) ? /* @__PURE__ */ new Date(NaN) : (c.setUTCFullYear(e, s, Math.max(a, o)), c);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function l(t) {
|
|
79
|
-
return t ? parseInt(t) : 1;
|
|
80
|
-
}
|
|
81
|
-
function I(t) {
|
|
82
|
-
const e = t.match(T);
|
|
83
|
-
if (!e)
|
|
84
|
-
return NaN;
|
|
85
|
-
const r = d(e[1]), n = d(e[2]), a = d(e[3]);
|
|
86
|
-
return S(r, n, a) ? r * m + n * D + a * 1e3 : NaN;
|
|
87
|
-
}
|
|
88
|
-
function d(t) {
|
|
89
|
-
return t && parseFloat(t.replace(",", ".")) || 0;
|
|
90
|
-
}
|
|
91
|
-
function x(t) {
|
|
92
|
-
if (t === "Z")
|
|
93
|
-
return 0;
|
|
94
|
-
const e = t.match(U);
|
|
95
|
-
if (!e)
|
|
96
|
-
return 0;
|
|
97
|
-
const r = e[1] === "+" ? -1 : 1, n = parseInt(e[2]), a = e[3] && parseInt(e[3]) || 0;
|
|
98
|
-
return Z(n, a) ? r * (n * m + a * D) : NaN;
|
|
99
|
-
}
|
|
100
|
-
function Y(t, e, r) {
|
|
101
|
-
const n = /* @__PURE__ */ new Date(0);
|
|
102
|
-
n.setUTCFullYear(t, 0, 4);
|
|
103
|
-
const a = n.getUTCDay() || 7, s = (e - 1) * 7 + r + 1 - a;
|
|
104
|
-
return n.setUTCDate(n.getUTCDate() + s), n;
|
|
105
|
-
}
|
|
106
|
-
const y = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
107
|
-
function p(t) {
|
|
108
|
-
return t % 400 === 0 || t % 4 === 0 && t % 100 !== 0;
|
|
109
|
-
}
|
|
110
|
-
function z(t, e, r) {
|
|
111
|
-
return e >= 0 && e <= 11 && r >= 1 && r <= (y[e] || (p(t) ? 29 : 28));
|
|
112
|
-
}
|
|
113
|
-
function O(t, e) {
|
|
114
|
-
return e >= 1 && e <= (p(t) ? 366 : 365);
|
|
115
|
-
}
|
|
116
|
-
function M(t, e, r) {
|
|
117
|
-
return e >= 1 && e <= 53 && r >= 0 && r <= 6;
|
|
118
|
-
}
|
|
119
|
-
function S(t, e, r) {
|
|
120
|
-
return t === 24 ? e === 0 && r === 0 : r >= 0 && r < 60 && e >= 0 && e < 60 && t >= 0 && t < 25;
|
|
121
|
-
}
|
|
122
|
-
function Z(t, e) {
|
|
123
|
-
return e >= 0 && e <= 59;
|
|
124
|
-
}
|
|
125
|
-
const F = (t) => {
|
|
126
|
-
const e = N(t);
|
|
127
|
-
return !Number.isNaN(e.getTime());
|
|
128
|
-
};
|
|
129
|
-
export {
|
|
130
|
-
F as i
|
|
131
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const d=require("./latinize-DaqzUOla.cjs");function N(t,e){const n=I(t);let i;if(n.date){const s=U(n.date,2);i=w(s.restDateString,s.year)}if(!i||isNaN(i.getTime()))return new Date(NaN);const a=i.getTime();let o=0,u;if(n.time&&(o=h(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(u=C(n.timezone),isNaN(u))return new Date(NaN)}else{const s=new Date(a+o),c=new Date(0);return c.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),c.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),c}return new Date(a+o+u)}const f={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},p=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,g=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,T=/^([+-])(\d{2})(?::?(\d{2}))?$/;function I(t){const e={},r=t.split(f.dateTimeDelimiter);let n;if(r.length>2)return e;if(/:/.test(r[0])?n=r[0]:(e.date=r[0],n=r[1],f.timeZoneDelimiter.test(e.date)&&(e.date=t.split(f.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){const i=f.timezone.exec(n);i?(e.time=n.replace(i[1],""),e.timezone=i[1]):e.time=n}return e}function U(t,e){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(r);if(!n)return{year:NaN,restDateString:""};const i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:t.slice((n[1]||n[2]).length)}}function w(t,e){if(e===null)return new Date(NaN);const r=t.match(p);if(!r)return new Date(NaN);const n=!!r[4],i=l(r[1]),a=l(r[2])-1,o=l(r[3]),u=l(r[4]),s=l(r[5])-1;if(n)return O(e,u,s)?Y(e,u,s):new Date(NaN);{const c=new Date(0);return!y(e,a,o)||!z(e,i)?new Date(NaN):(c.setUTCFullYear(e,a,Math.max(i,o)),c)}}function l(t){return t?parseInt(t):1}function h(t){const e=t.match(g);if(!e)return NaN;const r=m(e[1]),n=m(e[2]),i=m(e[3]);return M(r,n,i)?r*d.millisecondsInHour+n*d.millisecondsInMinute+i*1e3:NaN}function m(t){return t&&parseFloat(t.replace(",","."))||0}function C(t){if(t==="Z")return 0;const e=t.match(T);if(!e)return 0;const r=e[1]==="+"?-1:1,n=parseInt(e[2]),i=e[3]&&parseInt(e[3])||0;return S(n,i)?r*(n*d.millisecondsInHour+i*d.millisecondsInMinute):NaN}function Y(t,e,r){const n=new Date(0);n.setUTCFullYear(t,0,4);const i=n.getUTCDay()||7,a=(e-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}const x=[31,null,31,30,31,30,31,31,30,31,30,31];function D(t){return t%400===0||t%4===0&&t%100!==0}function y(t,e,r){return e>=0&&e<=11&&r>=1&&r<=(x[e]||(D(t)?29:28))}function z(t,e){return e>=1&&e<=(D(t)?366:365)}function O(t,e,r){return e>=1&&e<=53&&r>=0&&r<=6}function M(t,e,r){return t===24?e===0&&r===0:r>=0&&r<60&&e>=0&&e<60&&t>=0&&t<25}function S(t,e){return e>=0&&e<=59}const Z=t=>{const e=N(t);return!Number.isNaN(e.getTime())};exports.isISODate=Z;
|
package/dist/hooks/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { default as useAuth } from './useAuth/useAuth';
|
|
2
|
-
export { default as useNotifications } from './useNotifications/useNotifications';
|
|
3
|
-
export { useAxios, cancelToken } from './useAxios/useAxios';
|
|
4
|
-
export { default as useConfirm } from './useConfirm/useConfirm';
|
|
5
|
-
export { default as usePrompt } from './usePrompt/usePrompt';
|
|
6
|
-
export { default as useZodSchemaTypes } from './useZodSchemaTypes/useZodSchemaTypes';
|
|
7
|
-
export { default as useClickOutside } from './useClickOutside/useClickOutside';
|
|
8
|
-
export { default as usePermissions } from './usePermissions/usePermissions';
|
|
9
|
-
export { default as useKeyPress } from './useKeyPress/useKeyPress';
|
|
10
|
-
export { default as useGetApiData } from './useGetApiData/useGetApiData';
|
|
11
|
-
export { default as useGetDataBound } from './useGetDataBound/useGetDataBound';
|
|
12
|
-
export { default as useFormControlType } from './useFormControlType/useFormControlType';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
declare const useAuth: () => {
|
|
2
|
-
isAuthenticated: () => boolean;
|
|
3
|
-
isAuthenticating: () => boolean;
|
|
4
|
-
getToken: (() => string | null) | (() => Promise<string | null>);
|
|
5
|
-
login: (kid: string, password: string) => Promise<string | null>;
|
|
6
|
-
logout: () => void;
|
|
7
|
-
};
|
|
8
|
-
export default useAuth;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CancelTokenStatic } from 'axios';
|
|
2
|
-
export declare const cancelToken: CancelTokenStatic;
|
|
3
|
-
type Config = {
|
|
4
|
-
authenticated?: boolean;
|
|
5
|
-
differentBaseUrl?: string;
|
|
6
|
-
silent?: boolean;
|
|
7
|
-
customToken?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const useAxios: (useAxiosConfig?: Config) => import("axios").AxiosInstance;
|
|
10
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { UseGetApiDataOptions } from '@models/index';
|
|
3
|
-
import { GenericAbortSignal } from 'axios';
|
|
4
|
-
declare const useGetApiData: <T>(uri: string, { loadOnInit, enabled, silent, nullStateBeforeLoad, customApiUrl, customBearerToken, }?: UseGetApiDataOptions) => {
|
|
5
|
-
data: T | null;
|
|
6
|
-
setData: import("react").Dispatch<import("react").SetStateAction<T | null>>;
|
|
7
|
-
reloadData: (signal?: GenericAbortSignal, loadCallCount?: number) => Promise<void>;
|
|
8
|
-
};
|
|
9
|
-
export default useGetApiData;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import PromptOptions from '@models/types/PromptOptions';
|
|
2
|
-
declare const usePrompt: () => {
|
|
3
|
-
isShown: boolean;
|
|
4
|
-
text: string;
|
|
5
|
-
prompt: (t: string, options?: PromptOptions) => Promise<string | null>;
|
|
6
|
-
onFinish: (userResponse: string | null) => void;
|
|
7
|
-
};
|
|
8
|
-
export default usePrompt;
|