react-luminus-components 2.0.3-beta.r19-18 → 2.0.4-table
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 -349
- package/dist/.vite/manifest.json +46 -52
- package/dist/FormDisabledProvider-1MOB6N34.cjs +1 -0
- package/dist/FormDisabledProvider-CHZ2m_zJ.js +40 -0
- package/dist/ShortcutLinksContext-DEirK-v9.js +39884 -0
- package/dist/ShortcutLinksContext-DLi4B8z5.cjs +334 -0
- package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +3 -6
- package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/hooks/useDocCreateFolderForm.d.ts +1 -4
- package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/hooks/useEditFileForm.d.ts +1 -6
- package/dist/components/Documents/hooks/useDocumentsReducer.d.ts +1 -1
- package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +3 -6
- package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +1 -3
- package/dist/components/Flexmonster/Flexmonster.d.ts +1 -1
- package/dist/components/Flexmonster/hooks/useReportVersionApi.d.ts +1 -1
- package/dist/components/Flexmonster/utils/flexMonsterUtils.d.ts +1 -1
- package/dist/components/HookForm/MiniDetailWrapper/MiniDetailWrapper.d.ts +1 -1
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +17 -4
- package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +38 -7
- package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +38 -8
- package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +38 -8
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +3 -3
- package/dist/components/NotifCenter/Actions/components/HistoryTable/NotificationHistoryTable.d.ts +1 -1
- package/dist/components/NotifCenter/Actions/types/NotificationHistoryTableModel.d.ts +5 -0
- package/dist/components/ResponsiveContextDropdown/components/ResponsiveContextDropdownItem/ResponsiveContextDropdownItem.d.ts +1 -1
- package/dist/components/ResponsiveContextDropdown/hooks/useReponsiveContextDropdownHelpers.d.ts +2 -2
- package/dist/components/ResponsiveContextDropdown/utils/responsiveContextDropdownUtils.d.ts +1 -1
- package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +2 -2
- package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +1 -1
- package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +1 -1
- package/dist/components/common/ColumnResizer/ColumnResizer.d.ts +1 -1
- package/dist/components/common/DisabledRowLabelLink/DisabledRowLabelLink.d.ts +1 -1
- package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +3 -7
- package/dist/components/common/FromToDatePicker/components/FromToDatePickerDropdownToggle/FromToDatePickerDropdownToggle.d.ts +1 -3
- package/dist/components/common/LineChart/comps/LineChartTooltip/LineChartTooltip.d.ts +2 -2
- package/dist/components/common/PermissionsSubstitute/Detail/hooks/useSubstDetailForm.d.ts +1 -8
- package/dist/components/common/QrCode/QrCode.d.ts +1 -1
- package/dist/components/common/RouteLink/RouteLink.d.ts +1 -1
- package/dist/components/common/SimplePicker/SimplePicker.d.ts +1 -1
- package/dist/components/common/StrictModeDroppable/StrictModeDroppable.d.ts +5 -0
- package/dist/components/common/index.d.ts +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +941 -542
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useAxios/useAxios.d.ts +2 -5
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/hooks/useGetApiDataBound/useGetApiDataBound.d.ts +0 -3
- package/dist/hooks/useGetDataBound/useGetDataBound.d.ts +2 -4
- package/dist/hooks/useScrollSave/useScrollSave.d.ts +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +136 -206
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +142 -278
- package/dist/localStorageUtils-89Gfn6XS.cjs +1 -0
- package/dist/{localStorageUtils-CZ4HDRzi.js → localStorageUtils-DdeuyghB.js} +8 -18
- package/dist/main.cjs.js +183 -21
- package/dist/main.es.js +11492 -11359
- package/dist/models/prop-types/InputContainerProps.d.ts +12 -4
- package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +1 -1
- package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +2 -4
- package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +1 -1
- package/dist/models/prop-types/InputProps/TextInputProps.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/useLocalStorageState-B-CRodSS.cjs +1 -0
- package/dist/useLocalStorageState-BPYqQMTu.js +78 -0
- package/dist/useRenderDraggableInPortal-D0OLp7Qb.js +78 -0
- package/dist/useRenderDraggableInPortal-QPCaw-E_.cjs +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/route/apiPathUtils.d.ts +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +159 -133
- package/dist/variables.scss +165 -165
- package/package.json +123 -128
- package/dist/FormDisabledProvider-Bi6oyt5U.js +0 -51
- package/dist/FormDisabledProvider-D5KzXgMJ.cjs +0 -1
- package/dist/components/common/HomeDashboard/comps/HomeDashboardWidget/HomeDashboardWidget.d.ts +0 -15
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/PhotoPreviews.d.ts +0 -15
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/PhotoPreview/PhotoPreview.d.ts +0 -14
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/PhotoPreview/comps/PreviewShadow/PreviewShadow.d.ts +0 -5
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/PhotoPreview/comps/index.d.ts +0 -1
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/index.d.ts +0 -1
- package/dist/components/common/PhotoLightbox/comps/index.d.ts +0 -1
- package/dist/hooks/useIsFormDirty/useIsFormDirty.d.ts +0 -7
- package/dist/localStorageUtils-CkZslzIU.cjs +0 -1
- package/dist/models/bntTable/IBnfTableDefColumn.d.ts +0 -40
- package/dist/models/ui/notifications/NotificationHistoryTableModel.d.ts +0 -6
- package/dist/nivo-bar-BQGSJTnK.js +0 -41890
- package/dist/nivo-bar-DcaMZ1K9.cjs +0 -326
- package/dist/useIsFormDirty-BQU8CwxF.cjs +0 -1
- package/dist/useIsFormDirty-uSOXZ5g6.js +0 -123
- package/dist/useLocalStorageState-Ccq9rFKj.js +0 -95
- package/dist/useLocalStorageState-aCjv2MC6.cjs +0 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -20,4 +20,3 @@ export { default as useGetApiDataBound } from './useGetApiDataBound/useGetApiDat
|
|
|
20
20
|
export { default as useWindowSize } from './useWindowSize/useWindowSize';
|
|
21
21
|
export { default as useRenderDraggableInPortal } from './useRenderDraggableInPortal/useRenderDraggableInPortal';
|
|
22
22
|
export { default as useScrollSave } from './useScrollSave/useScrollSave';
|
|
23
|
-
export { default as useIsFormDirty } from './useIsFormDirty/useIsFormDirty';
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CancelTokenStatic } from 'axios';
|
|
2
2
|
|
|
3
3
|
export declare const cancelToken: CancelTokenStatic;
|
|
4
|
-
type AxiosInstanceExtended = AxiosInstance & {
|
|
5
|
-
interceptorsUsed: boolean;
|
|
6
|
-
};
|
|
7
4
|
type Config = {
|
|
8
5
|
authenticated?: boolean;
|
|
9
6
|
differentBaseUrl?: string;
|
|
@@ -12,5 +9,5 @@ type Config = {
|
|
|
12
9
|
ignoreDelegation?: boolean;
|
|
13
10
|
noToastOnStatus?: number[];
|
|
14
11
|
};
|
|
15
|
-
export declare const useAxios: (useAxiosConfig?: Config) =>
|
|
12
|
+
export declare const useAxios: (useAxiosConfig?: Config) => import('axios').AxiosInstance;
|
|
16
13
|
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { UseGetApiDataOptions } from '../../models/index';
|
|
2
2
|
import { GenericAbortSignal } from 'axios';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated Use useGetDataBound instead for simple data fetching within Suspense boundary or useGetApiData for more complex data fetching
|
|
6
|
-
*/
|
|
7
4
|
declare const useGetApiDataBound: <T>(uri: string, { loadOnInit, enabled, silent, nullStateBeforeLoad, nullStateOnFail, customApiUrl, customBearerToken, dataTransformer, errorBoundaryOn404, }?: UseGetApiDataOptions<T>) => {
|
|
8
5
|
data: T | null;
|
|
9
6
|
setData: import('react').Dispatch<import('react').SetStateAction<T | null>>;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
customToken?: string;
|
|
4
|
-
};
|
|
1
|
+
import { default as UseGetDataBoundOptions } from '../../models/types/UseGetDataBoundOptions';
|
|
2
|
+
|
|
5
3
|
declare function useGetDataBound<T>(url: string, options?: UseGetDataBoundOptions): T | null;
|
|
6
4
|
export default useGetDataBound;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as UseScrollSaveOptions } from '../../models/types/UseScrollSaveOptions';
|
|
2
2
|
import { RefObject } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const useScrollSave: (scrollableRef: RefObject<HTMLDivElement
|
|
4
|
+
declare const useScrollSave: (scrollableRef: RefObject<HTMLDivElement>, { storageKey, requiredHeight, retryInterval, }?: UseScrollSaveOptions) => {
|
|
5
5
|
saveValue: (newItem: string) => void;
|
|
6
6
|
retrieveValue: () => number | null;
|
|
7
7
|
};
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./ShortcutLinksContext-DLi4B8z5.cjs"),A=require("./useLocalStorageState-B-CRodSS.cjs"),r=require("react"),w=require("./useRenderDraggableInPortal-QPCaw-E_.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const q=e=>{let t="pending",n;const u=e.then(s=>{t="success",n=s},s=>{t="error",n=s});return()=>{switch(t){case"pending":throw u;case"success":return n;case"error":throw n;default:throw new Error("Unknown status")}}};function L(e,t){const n=o.useAxios({silent:!0,differentBaseUrl:t==null?void 0:t.customBaseUrl,customToken:t==null?void 0:t.customToken}),[u,s]=r.useState(null);return r.useEffect(()=>{(async()=>{const c=n.get(e).then(l=>l.data);s(q(c))})()},[n,e]),u}const x=e=>t=>(window.addEventListener(`storage_${e}`,t),()=>window.removeEventListener(`storage_${e}`,t)),O=(e,t,n=localStorage)=>{const[u]=r.useState(t),s=r.useRef(JSON.stringify(t)),i=r.useRef(t),c=r.useCallback(()=>{const S=n.getItem(e);return S!==s.current&&(s.current=S,i.current=s.current?JSON.parse(s.current):u),i.current},[e,n,u]),l=r.useMemo(()=>x(e),[e]),d=r.useSyncExternalStore(l,c),a=r.useCallback(S=>{n.setItem(e,JSON.stringify(S)),window.dispatchEvent(new Event(`storage_${e}`))},[e,n]);return r.useMemo(()=>[d,a],[d,a])},y=(e,t,n)=>{let u="pending",s;const i=e.then(c=>{u="success",s=c},c=>{const l=c==null?void 0:c.response;(l==null?void 0:l.status)===404&&n?(u="error-404",s=c):(u="error",s=c)});return()=>{switch(u){case"pending":throw i;case"success":return s;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},f={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},V=(e,{loadOnInit:t=f.loadOnInit,enabled:n=f.enabled,silent:u=f.silent,nullStateBeforeLoad:s=f.nullStateBeforeLoad,nullStateOnFail:i=f.nullStateOnFail,customApiUrl:c,customBearerToken:l,dataTransformer:d,errorBoundaryOn404:a}=f)=>{const g=o.useAxios({silent:u,customToken:l,differentBaseUrl:c,noToastOnStatus:a?[404]:void 0}),{startLoading:S,stopLoading:C}=r.useContext(o.LoadingContext),E=r.useRef(0),{isAuthenticated:D}=o.useAuth(),[I,p]=r.useState(null),v=r.useCallback(async(m,b)=>{if(!D()||n===!1)return;!u&&S(`loadData-${e}-${b}`),s&&p(null);const T=g.get(e,{signal:m}).then(P=>d?d(P.data):P.data).finally(()=>!u&&C(`loadData-${e}-${b}`));p(y(T,i??!1,a??!1))},[D,n,u,S,e,s,g,d,C,i,a]);return r.useEffect(()=>{if(t===!1)return;const m=new AbortController;return v(m.signal,++E.current),()=>{m.abort()}},[v,t]),{data:I,setData:p,reloadData:v}},h={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},$=(e,{storageKey:t=h.storageKey,requiredHeight:n=h.requiredHeight,retryInterval:u=h.retryInterval}=h)=>{const[s,i]=r.useState(!1),c=r.useRef(null),l=r.useCallback(()=>{const a=localStorage.getItem(t);return localStorage.removeItem(t),a===null?null:Number(a)},[t]),d=r.useCallback(a=>{localStorage.setItem(t,a)},[t]);return r.useEffect(()=>{const a=window.setInterval(()=>{if(!s&&e.current!==null&&e.current.getBoundingClientRect().height>n){i(!0);const g=l();g!==null&&e.current.scrollTo({top:g}),window.clearInterval(a)}},u);return()=>{window.clearTimeout(a)}},[s,n,l,u,e]),r.useEffect(()=>{var g;const a=new AbortController;return(g=e.current)==null||g.addEventListener("scrollend",()=>{var S;c.current=((S=e.current)==null?void 0:S.scrollTop)??0,d((c.current??0).toString())},{signal:a.signal}),()=>a.abort()},[d,e]),{saveValue:d,retrieveValue:l}};exports.cancelToken=o.cancelToken;exports.useAuth=o.useAuth;exports.useAxios=o.useAxios;exports.useClickOutside=o.useClickOutside;exports.useClipboard=o.useClipboard;exports.useConfirm=o.useConfirm;exports.useFormControlType=o.useFormControlType;exports.useKeyPress=o.useKeyPress;exports.useNotifications=o.useNotifications;exports.usePermissions=o.usePermissions;exports.usePrompt=o.usePrompt;exports.useWindowSize=o.useWindowSize;exports.useZodSchemaTypes=o.useZodSchemaTypes;exports.useGetApiData=A.useGetApiData;exports.useLocalStorageState=A.useLocalStorageState;exports.useEmployeePhotoPath=w.useEmployeePhotoPath;exports.useRenderDraggableInPortal=w.useRenderDraggableInPortal;exports.useSearchQuery=w.useSearchQuery;exports.useSearchQueryState=w.useSearchQueryState;exports.useGetApiDataBound=V;exports.useGetDataBound=L;exports.usePersistentState=O;exports.useScrollSave=$;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,241 +1,171 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { u as
|
|
4
|
-
import { useRef as
|
|
5
|
-
import { c as
|
|
6
|
-
import "react
|
|
7
|
-
import "react-
|
|
8
|
-
import { createPortal as z } from "react-dom";
|
|
1
|
+
import { aw as O, aX as L, ar as T } from "./ShortcutLinksContext-DEirK-v9.js";
|
|
2
|
+
import { bO as k, bw as K, bQ as tt, aR as et, bP as st, af as rt, aY as nt, ba as at, bo as ot, a2 as ut, bh as ct } from "./ShortcutLinksContext-DEirK-v9.js";
|
|
3
|
+
import { u as it, a as dt } from "./useLocalStorageState-BPYqQMTu.js";
|
|
4
|
+
import { useState as h, useEffect as p, useRef as S, useCallback as f, useMemo as E, useSyncExternalStore as A, useContext as N } from "react";
|
|
5
|
+
import { c as ft, u as gt, a as wt, b as pt } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
|
|
6
|
+
import "react-router-dom";
|
|
7
|
+
import "react-dom";
|
|
9
8
|
import "react-hook-form";
|
|
10
9
|
import "react-flexmonster";
|
|
11
10
|
import "@azure/msal-browser";
|
|
12
11
|
import "@azure/msal-react";
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const B = (t) => {
|
|
13
|
+
let e = "pending", r;
|
|
14
|
+
const n = t.then((s) => {
|
|
15
|
+
e = "success", r = s;
|
|
16
|
+
}, (s) => {
|
|
17
|
+
e = "error", r = s;
|
|
19
18
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (o.status === "error")
|
|
46
|
-
throw o.error;
|
|
47
|
-
return o.data;
|
|
19
|
+
return () => {
|
|
20
|
+
switch (e) {
|
|
21
|
+
case "pending":
|
|
22
|
+
throw n;
|
|
23
|
+
case "success":
|
|
24
|
+
return r;
|
|
25
|
+
case "error":
|
|
26
|
+
throw r;
|
|
27
|
+
default:
|
|
28
|
+
throw new Error("Unknown status");
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
function H(t, e) {
|
|
33
|
+
const r = O({
|
|
34
|
+
silent: !0,
|
|
35
|
+
differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
|
|
36
|
+
customToken: e == null ? void 0 : e.customToken
|
|
37
|
+
}), [n, s] = h(null);
|
|
38
|
+
return p(() => {
|
|
39
|
+
(async () => {
|
|
40
|
+
const o = r.get(t).then((u) => u.data);
|
|
41
|
+
s(B(o));
|
|
42
|
+
})();
|
|
43
|
+
}, [r, t]), n;
|
|
48
44
|
}
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
s[8] !== e || s[9] !== o ? (a = (m) => {
|
|
65
|
-
o.setItem(e, JSON.stringify(m)), window.dispatchEvent(new Event(`storage_${e}`));
|
|
66
|
-
}, s[8] = e, s[9] = o, s[10] = a) : a = s[10];
|
|
67
|
-
const i = a;
|
|
68
|
-
let p;
|
|
69
|
-
return s[11] !== i || s[12] !== u ? (p = [u, i], s[11] = i, s[12] = u, s[13] = p) : p = s[13], p;
|
|
70
|
-
}, Z = (e, n, t) => {
|
|
71
|
-
let s = "pending", o;
|
|
72
|
-
const c = e.then((r) => {
|
|
73
|
-
s = "success", o = r;
|
|
74
|
-
}, (r) => {
|
|
75
|
-
const l = r == null ? void 0 : r.response;
|
|
76
|
-
(l == null ? void 0 : l.status) === 404 && t ? (s = "error-404", o = r) : (s = "error", o = r);
|
|
45
|
+
const U = (t) => (e) => (window.addEventListener(`storage_${t}`, e), () => window.removeEventListener(`storage_${t}`, e)), M = (t, e, r = localStorage) => {
|
|
46
|
+
const [n] = h(e), s = S(JSON.stringify(e)), c = S(e), o = f(() => {
|
|
47
|
+
const i = r.getItem(t);
|
|
48
|
+
return i !== s.current && (s.current = i, c.current = s.current ? JSON.parse(s.current) : n), c.current;
|
|
49
|
+
}, [t, r, n]), u = E(() => U(t), [t]), l = A(u, o), a = f((i) => {
|
|
50
|
+
r.setItem(t, JSON.stringify(i)), window.dispatchEvent(new Event(`storage_${t}`));
|
|
51
|
+
}, [t, r]);
|
|
52
|
+
return E(() => [l, a], [l, a]);
|
|
53
|
+
}, F = (t, e, r) => {
|
|
54
|
+
let n = "pending", s;
|
|
55
|
+
const c = t.then((o) => {
|
|
56
|
+
n = "success", s = o;
|
|
57
|
+
}, (o) => {
|
|
58
|
+
const u = o == null ? void 0 : o.response;
|
|
59
|
+
(u == null ? void 0 : u.status) === 404 && r ? (n = "error-404", s = o) : (n = "error", s = o);
|
|
77
60
|
});
|
|
78
61
|
return () => {
|
|
79
|
-
switch (
|
|
62
|
+
switch (n) {
|
|
80
63
|
case "pending":
|
|
81
64
|
throw c;
|
|
82
65
|
case "success":
|
|
83
|
-
return
|
|
66
|
+
return s;
|
|
84
67
|
case "error":
|
|
85
|
-
|
|
86
|
-
throw o;
|
|
68
|
+
return null;
|
|
87
69
|
case "error-404":
|
|
88
70
|
throw new Error("404");
|
|
89
71
|
default:
|
|
90
72
|
throw new Error("Unknown status");
|
|
91
73
|
}
|
|
92
74
|
};
|
|
93
|
-
},
|
|
75
|
+
}, m = {
|
|
94
76
|
loadOnInit: !0,
|
|
95
77
|
silent: !1,
|
|
96
78
|
enabled: !0,
|
|
97
79
|
nullStateBeforeLoad: !0,
|
|
98
80
|
nullStateOnFail: !1
|
|
99
|
-
},
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
customBearerToken: g,
|
|
108
|
-
dataTransformer: w,
|
|
109
|
-
errorBoundaryOn404: d
|
|
110
|
-
} = n === void 0 ? E : n, S = s === void 0 ? E.loadOnInit : s, u = o === void 0 ? E.enabled : o, a = c === void 0 ? E.silent : c, i = r === void 0 ? E.nullStateBeforeLoad : r, p = l === void 0 ? E.nullStateOnFail : l;
|
|
111
|
-
let v;
|
|
112
|
-
t[0] !== d ? (v = d ? [404] : void 0, t[0] = d, t[1] = v) : v = t[1];
|
|
113
|
-
let m;
|
|
114
|
-
t[2] !== h || t[3] !== g || t[4] !== a || t[5] !== v ? (m = {
|
|
115
|
-
silent: a,
|
|
116
|
-
customToken: g,
|
|
117
|
-
differentBaseUrl: h,
|
|
118
|
-
noToastOnStatus: v
|
|
119
|
-
}, t[2] = h, t[3] = g, t[4] = a, t[5] = v, t[6] = m) : m = t[6];
|
|
120
|
-
const b = G(m), {
|
|
121
|
-
startLoading: y,
|
|
122
|
-
stopLoading: f
|
|
123
|
-
} = W(J), I = D(0), {
|
|
124
|
-
isAuthenticated: C
|
|
125
|
-
} = Q(), [F, N] = _(null);
|
|
126
|
-
let x;
|
|
127
|
-
t[7] !== b || t[8] !== w || t[9] !== u || t[10] !== d || t[11] !== C || t[12] !== i || t[13] !== p || t[14] !== a || t[15] !== y || t[16] !== f || t[17] !== e ? (x = async (P, q) => {
|
|
128
|
-
if (!C() || u === !1)
|
|
81
|
+
}, X = (t, { loadOnInit: e = m.loadOnInit, enabled: r = m.enabled, silent: n = m.silent, nullStateBeforeLoad: s = m.nullStateBeforeLoad, nullStateOnFail: c = m.nullStateOnFail, customApiUrl: o, customBearerToken: u, dataTransformer: l, errorBoundaryOn404: a } = m) => {
|
|
82
|
+
const d = O({
|
|
83
|
+
silent: n,
|
|
84
|
+
customToken: u,
|
|
85
|
+
differentBaseUrl: o,
|
|
86
|
+
noToastOnStatus: a ? [404] : void 0
|
|
87
|
+
}), { startLoading: i, stopLoading: D } = N(L), P = S(0), { isAuthenticated: C } = T(), [V, v] = h(null), b = f(async (g, I) => {
|
|
88
|
+
if (!C() || r === !1)
|
|
129
89
|
return;
|
|
130
|
-
!
|
|
131
|
-
const
|
|
132
|
-
signal:
|
|
133
|
-
}).then((
|
|
134
|
-
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
90
|
+
!n && i(`loadData-${t}-${I}`), s && v(null);
|
|
91
|
+
const $ = d.get(t, {
|
|
92
|
+
signal: g
|
|
93
|
+
}).then((x) => l ? l(x.data) : x.data).finally(() => !n && D(`loadData-${t}-${I}`));
|
|
94
|
+
v(F($, c ?? !1, a ?? !1));
|
|
95
|
+
}, [
|
|
96
|
+
C,
|
|
97
|
+
r,
|
|
98
|
+
n,
|
|
99
|
+
i,
|
|
100
|
+
t,
|
|
101
|
+
s,
|
|
102
|
+
d,
|
|
103
|
+
l,
|
|
104
|
+
D,
|
|
105
|
+
c,
|
|
106
|
+
a
|
|
107
|
+
]);
|
|
108
|
+
return p(() => {
|
|
109
|
+
if (e === !1)
|
|
140
110
|
return;
|
|
141
|
-
const
|
|
142
|
-
return
|
|
143
|
-
|
|
144
|
-
};
|
|
145
|
-
}, B = [T, S], t[19] = T, t[20] = S, t[21] = B, t[22] = L) : (B = t[21], L = t[22]), U(L, B);
|
|
146
|
-
let $;
|
|
147
|
-
return t[23] !== F || t[24] !== T ? ($ = {
|
|
148
|
-
data: F,
|
|
149
|
-
setData: N,
|
|
150
|
-
reloadData: T
|
|
151
|
-
}, t[23] = F, t[24] = T, t[25] = $) : $ = t[25], $;
|
|
152
|
-
}, it = () => {
|
|
153
|
-
const e = D({}).current;
|
|
154
|
-
return U(() => {
|
|
155
|
-
const n = document.createElement("div");
|
|
156
|
-
return n.style.position = "absolute", n.style.pointerEvents = "none", n.style.top = "0", n.style.width = "100%", n.style.height = "100%", e.elt = n, document.body.appendChild(n), () => {
|
|
157
|
-
document.body.removeChild(n);
|
|
111
|
+
const g = new AbortController();
|
|
112
|
+
return b(g.signal, ++P.current), () => {
|
|
113
|
+
g.abort();
|
|
158
114
|
};
|
|
159
|
-
}, [e]),
|
|
160
|
-
|
|
161
|
-
return t.draggableProps.style.position === "fixed" ? z(o, e.elt) : o;
|
|
162
|
-
};
|
|
163
|
-
}, A = {
|
|
115
|
+
}, [b, e]), { data: V, setData: v, reloadData: b };
|
|
116
|
+
}, w = {
|
|
164
117
|
storageKey: "--tmp-scroll-save--",
|
|
165
118
|
requiredHeight: 100,
|
|
166
119
|
retryInterval: 50
|
|
167
|
-
},
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
t[2] !== r ? (a = (f) => {
|
|
181
|
-
localStorage.setItem(r, f);
|
|
182
|
-
}, t[2] = r, t[3] = a) : a = t[3];
|
|
183
|
-
const i = a;
|
|
184
|
-
let p, v;
|
|
185
|
-
t[4] !== g || t[5] !== l || t[6] !== u || t[7] !== h || t[8] !== e ? (p = () => {
|
|
186
|
-
const f = window.setInterval(() => {
|
|
187
|
-
if (!g && e.current !== null && e.current.getBoundingClientRect().height > l) {
|
|
188
|
-
w(!0);
|
|
189
|
-
const I = u();
|
|
190
|
-
I !== null && e.current.scrollTo({
|
|
191
|
-
top: I
|
|
192
|
-
}), window.clearInterval(f);
|
|
120
|
+
}, Y = (t, { storageKey: e = w.storageKey, requiredHeight: r = w.requiredHeight, retryInterval: n = w.retryInterval } = w) => {
|
|
121
|
+
const [s, c] = h(!1), o = S(null), u = f(() => {
|
|
122
|
+
const a = localStorage.getItem(e);
|
|
123
|
+
return localStorage.removeItem(e), a === null ? null : Number(a);
|
|
124
|
+
}, [e]), l = f((a) => {
|
|
125
|
+
localStorage.setItem(e, a);
|
|
126
|
+
}, [e]);
|
|
127
|
+
return p(() => {
|
|
128
|
+
const a = window.setInterval(() => {
|
|
129
|
+
if (!s && t.current !== null && t.current.getBoundingClientRect().height > r) {
|
|
130
|
+
c(!0);
|
|
131
|
+
const d = u();
|
|
132
|
+
d !== null && t.current.scrollTo({ top: d }), window.clearInterval(a);
|
|
193
133
|
}
|
|
194
|
-
},
|
|
134
|
+
}, n);
|
|
195
135
|
return () => {
|
|
196
|
-
window.clearTimeout(
|
|
136
|
+
window.clearTimeout(a);
|
|
197
137
|
};
|
|
198
|
-
},
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}, {
|
|
207
|
-
signal: f.signal
|
|
208
|
-
}), () => f.abort();
|
|
209
|
-
}, b = [i, e], t[11] = i, t[12] = e, t[13] = m, t[14] = b) : (m = t[13], b = t[14]), U(m, b);
|
|
210
|
-
let y;
|
|
211
|
-
return t[15] !== u || t[16] !== i ? (y = {
|
|
212
|
-
saveValue: i,
|
|
213
|
-
retrieveValue: u
|
|
214
|
-
}, t[15] = u, t[16] = i, t[17] = y) : y = t[17], y;
|
|
138
|
+
}, [s, r, u, n, t]), p(() => {
|
|
139
|
+
var d;
|
|
140
|
+
const a = new AbortController();
|
|
141
|
+
return (d = t.current) == null || d.addEventListener("scrollend", () => {
|
|
142
|
+
var i;
|
|
143
|
+
o.current = ((i = t.current) == null ? void 0 : i.scrollTop) ?? 0, l((o.current ?? 0).toString());
|
|
144
|
+
}, { signal: a.signal }), () => a.abort();
|
|
145
|
+
}, [l, t]), { saveValue: l, retrieveValue: u };
|
|
215
146
|
};
|
|
216
147
|
export {
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
Ot as useZodSchemaTypes
|
|
148
|
+
k as cancelToken,
|
|
149
|
+
T as useAuth,
|
|
150
|
+
O as useAxios,
|
|
151
|
+
K as useClickOutside,
|
|
152
|
+
tt as useClipboard,
|
|
153
|
+
et as useConfirm,
|
|
154
|
+
ft as useEmployeePhotoPath,
|
|
155
|
+
st as useFormControlType,
|
|
156
|
+
it as useGetApiData,
|
|
157
|
+
X as useGetApiDataBound,
|
|
158
|
+
H as useGetDataBound,
|
|
159
|
+
rt as useKeyPress,
|
|
160
|
+
dt as useLocalStorageState,
|
|
161
|
+
nt as useNotifications,
|
|
162
|
+
at as usePermissions,
|
|
163
|
+
M as usePersistentState,
|
|
164
|
+
ot as usePrompt,
|
|
165
|
+
gt as useRenderDraggableInPortal,
|
|
166
|
+
Y as useScrollSave,
|
|
167
|
+
wt as useSearchQuery,
|
|
168
|
+
pt as useSearchQueryState,
|
|
169
|
+
ut as useWindowSize,
|
|
170
|
+
ct as useZodSchemaTypes
|
|
241
171
|
};
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-DLi4B8z5.cjs"),_=require("react"),C=require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");const f="_side-menu-item_o72rm_1",w="_disabled_o72rm_6",T="_hidden_o72rm_10",q="_nav-button_o72rm_13",I="_child_o72rm_21",S="_text_o72rm_26",L="_icon_o72rm_36",O="_collapse-icon_o72rm_42",A="_collapsed_o72rm_52",$="_collapse-icon-mini_o72rm_55",D="_expanded_o72rm_86",K="_children-container_o72rm_92",F="_visible_o72rm_100",z="_children_o72rm_92",G="_mobile_o72rm_112",n={"side-menu-item":"_side-menu-item_o72rm_1",sideMenuItem:f,disabled:w,hidden:T,"nav-button":"_nav-button_o72rm_13",navButton:q,child:I,text:S,icon:L,"collapse-icon":"_collapse-icon_o72rm_42",collapseIcon:O,collapsed:A,"collapse-icon-mini":"_collapse-icon-mini_o72rm_55",collapseIconMini:$,expanded:D,"children-container":"_children-container_o72rm_92",childrenContainer:K,visible:F,children:z,mobile:G},H=({item:s,menuExpanded:i,useTooltips:l,children:d})=>s.tooltip&&!i&&l?e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:s.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:d})}):d,P=({item:s,menuExpanded:i,collapsed:l,onCollapse:d,currentPath:j,useHover:a,useTooltips:b,isMobile:k,disableMode:c})=>{var R,N,E,y;const[g,p]=_.useState(!1),[h]=j.split("?"),v=s.linkTo===h||((R=s.children)==null?void 0:R.some(o=>o.linkTo===h)),m=_.useRef(null);return e.useClickOutside([m],()=>l&&d()),e.jsxRuntimeExports.jsxs("li",{ref:m,className:e.classNames("luminus-side-menu-item",n.sideMenuItem,{[n.mobile]:k},{[n.expanded]:i},{active:g||v},{open:l&&s.children},{[c==="disable"?n.disabled:n.hidden]:s.disabled||s.notPermitted||((N=s.children)==null?void 0:N.every(o=>o.notPermitted||o.disabled))},{[c==="disable"?"disabled":"hidden"]:s.disabled||s.notPermitted||((E=s.children)==null?void 0:E.every(o=>o.notPermitted||o.disabled))}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[e.jsxRuntimeExports.jsx(H,{item:s,menuExpanded:i,useTooltips:b,children:s.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",n.navButton),onClick:()=>{d()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),!a&&!i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",n.collapseIconMini,{[n.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:s.title}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",n.collapseIcon,{[n.collapsed]:l}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(C.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link",n.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",n.icon),children:s.icon}),i&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:s.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",n.childrenContainer,{[n.visible]:l}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",n.children),children:(y=s.children)==null?void 0:y.map(o=>e.jsxRuntimeExports.jsx(C.Link,{to:o.disabled||o.notPermitted?"/":o.linkTo??"/",className:e.classNames("nav-link child rounded",n.navButton,n.child,{[c==="disable"?n.disabled:n.hidden]:o.disabled||o.notPermitted},{[c==="disable"?"disabled":"hidden"]:o.disabled||o.notPermitted}),onClick:d,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",n.text,"text-nowrap"),children:o.title})},o.linkTo))})})]})},U="_side-menu_12rky_1",W="_sidebar-header_12rky_15",J="_side-menu-content_12rky_22",Q="_no-top-margin_12rky_28",V="_expand_12rky_34",X="_only-logo_12rky_38",Y="_mobile_12rky_41",Z="_divider_12rky_56",x={"side-menu":"_side-menu_12rky_1",sideMenu:U,"sidebar-header":"_sidebar-header_12rky_15",sidebarHeader:W,"side-menu-content":"_side-menu-content_12rky_22",sideMenuContent:J,"no-top-margin":"_no-top-margin_12rky_28",noTopMargin:Q,expand:V,"only-logo":"_only-logo_12rky_38",onlyLogo:X,mobile:Y,divider:Z},ee=14,se=({headerItem:s,searchItem:i,shortcutsItem:l,mainItems:d,secondaryItems:j,expanded:a,setExpanded:b,currentPath:k,useHover:c,useTooltips:g,disableMode:p="disable"})=>{const[h,v]=_.useState(-1),{checkUserHasPermissions:m}=e.usePermissions(),R=_.useMemo(()=>d.map(t=>{var r;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(r=t.children)==null?void 0:r.map(u=>({...u,notPermitted:!m(u.permissions??[],"any"),disabled:t.disabled||u.disabled}))}}),[d,m]),N=_.useMemo(()=>j.map(t=>{var r;return{...t,notPermitted:!m(t.permissions??[],"any"),children:(r=t.children)==null?void 0:r.map(u=>({...u,notPermitted:!m(u.permissions??[],"any")}))}}),[j,m]),E=t=>{v(t===h?-1:t)};_.useEffect(()=>{a||v(-1)},[a]);const y=_.useRef(null);e.useClickOutside([y],()=>b(!1));const o=_.useMemo(()=>[...R,...N].filter(t=>{var r;return p==="hide"?!t.disabled&&!t.notPermitted&&(((r=t.children)==null?void 0:r.filter(u=>!u.disabled&&!u.notPermitted))??[]).length>0:!0}),[R,N,p]),{isMobile:M}=e.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:y,className:e.classNames("luminus-side-menu shadow",x.sideMenu,{[x.mobile]:M},{[x.expand]:a},{expand:a}),onMouseEnter:()=>c&&b(!0),onMouseLeave:()=>c&&b(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",x.sidebarHeader,{[x.onlyLogo]:c}),role:c?void 0:"button",onClick:c?void 0:()=>b(!a),children:c?s:a?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),s]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),a&&(i||l)?e.jsxRuntimeExports.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[l&&a?l:null,i&&a?i:null]}):null,e.jsxRuntimeExports.jsxs("ul",{className:e.classNames(x.sideMenuContent,{[x.noTopMargin]:o.length>ee}),children:[R.map((t,r)=>e.jsxRuntimeExports.jsx(P,{item:t,menuExpanded:a,collapsed:r===h,onCollapse:()=>E(r),currentPath:k,useHover:c,useTooltips:g,isMobile:M,disableMode:p},t.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",x.divider)}),N.map((t,r)=>e.jsxRuntimeExports.jsx(P,{item:t,menuExpanded:a,collapsed:r===h,onCollapse:()=>E(r),currentPath:k,useHover:c,useTooltips:g,isMobile:M,disableMode:p},t.title))]})]})},ne="_top-bar_lnmq0_1",te="_top-bar-brand_lnmq0_12",B={"top-bar":"_top-bar_lnmq0_1",topBar:ne,"top-bar-brand":"_top-bar-brand_lnmq0_12",topBarBrand:te},oe=({appName:s,leftOffset:i,leftContent:l,centerContent:d,rightContent:j})=>e.jsxRuntimeExports.jsx("nav",{className:e.classNames("luminus-top-bar shadow",B.topBar),style:{width:i?`calc(100% - ${i}px)`:void 0,left:i?`${i}px`:void 0},children:e.jsxRuntimeExports.jsxs("div",{className:"w-100 row g-0",children:[e.jsxRuntimeExports.jsxs("div",{className:"col-4 d-flex gap-3 align-items-center",children:[e.jsxRuntimeExports.jsx(C.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",B.topBarBrand),children:s}),l]}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex align-items-center",children:d??null}),e.jsxRuntimeExports.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:j??null})]})});exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.SideMenu=se;exports.TopBar=oe;
|