react-luminus-components 1.3.141 → 1.3.143
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +8 -8
- package/dist/components/Flexmonster/Flexmonster.d.ts +3 -2
- package/dist/components/Flexmonster/ReportPage.d.ts +3 -2
- package/dist/components/Flexmonster/types/ui/HyperlinkColumn.d.ts +10 -0
- package/dist/components/common/AppSearch/AppSearch.d.ts +2 -1
- package/dist/components/common/FromToDatePicker/FromToDatePicker.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useWindowSize/useWindowSize.d.ts +6 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +17 -16
- package/dist/layout/SideMenu/MenuItem/MenuItem.d.ts +2 -1
- package/dist/layout/SideMenu/SideMenu.d.ts +2 -1
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +126 -121
- package/dist/main.cjs.js +2 -2
- package/dist/main.es.js +1080 -1069
- package/dist/style.css +1 -1
- package/dist/useWindowSize-DYUZPhVO.cjs +1 -0
- package/dist/useWindowSize-DqS1g_16.js +26 -0
- package/package.json +1 -1
- package/dist/usePermissions-4cIziXbQ.cjs +0 -1
- package/dist/usePermissions-DuCO7NTY.js +0 -20
package/dist/.vite/manifest.json
CHANGED
|
@@ -107,16 +107,16 @@
|
|
|
107
107
|
"file": "useLocalStorageState-Bt99kkCr.js",
|
|
108
108
|
"name": "useLocalStorageState"
|
|
109
109
|
},
|
|
110
|
-
"
|
|
111
|
-
"file": "
|
|
112
|
-
"name": "
|
|
110
|
+
"_useWindowSize-DYUZPhVO.cjs": {
|
|
111
|
+
"file": "useWindowSize-DYUZPhVO.cjs",
|
|
112
|
+
"name": "useWindowSize",
|
|
113
113
|
"imports": [
|
|
114
114
|
"_ResponsiveContextDropdown-BcEZzNox.cjs"
|
|
115
115
|
]
|
|
116
116
|
},
|
|
117
|
-
"
|
|
118
|
-
"file": "
|
|
119
|
-
"name": "
|
|
117
|
+
"_useWindowSize-DqS1g_16.js": {
|
|
118
|
+
"file": "useWindowSize-DqS1g_16.js",
|
|
119
|
+
"name": "useWindowSize",
|
|
120
120
|
"imports": [
|
|
121
121
|
"_ResponsiveContextDropdown-CLWBQLuy.js"
|
|
122
122
|
]
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
"imports": [
|
|
142
142
|
"_ResponsiveContextDropdown-BcEZzNox.cjs",
|
|
143
143
|
"_useClickOutside-D0505nsm.cjs",
|
|
144
|
-
"
|
|
144
|
+
"_useWindowSize-DYUZPhVO.cjs",
|
|
145
145
|
"_useClipboard-DtPZtxpV.cjs",
|
|
146
146
|
"_useGetApiData-DK9Apz0I.cjs",
|
|
147
147
|
"_useLocalStorageState-BFc8Gc8H.cjs"
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"_ResponsiveContextDropdown-BcEZzNox.cjs",
|
|
157
157
|
"_SimpleTooltip-tS3ZQgXE.cjs",
|
|
158
158
|
"_useClickOutside-D0505nsm.cjs",
|
|
159
|
-
"
|
|
159
|
+
"_useWindowSize-DYUZPhVO.cjs",
|
|
160
160
|
"_FullScreenContainer-DkxbkVKa.cjs"
|
|
161
161
|
]
|
|
162
162
|
},
|
|
@@ -2,6 +2,7 @@ import { default as ReportSettings } from './types/ui/ReportSettings';
|
|
|
2
2
|
import { DataSource } from 'flexmonster';
|
|
3
3
|
import { RefObject } from 'react';
|
|
4
4
|
import { Pivot } from 'react-flexmonster';
|
|
5
|
+
import { default as HyperlinkColumn } from './types/ui/HyperlinkColumn';
|
|
5
6
|
|
|
6
7
|
type Props = {
|
|
7
8
|
dataSource: DataSource;
|
|
@@ -10,7 +11,7 @@ type Props = {
|
|
|
10
11
|
enabled?: boolean;
|
|
11
12
|
localization: object;
|
|
12
13
|
licenseKey: string | string[] | undefined;
|
|
13
|
-
|
|
14
|
+
hyperlinkColumn?: HyperlinkColumn;
|
|
14
15
|
};
|
|
15
|
-
declare const Flexmonster: ({ dataSource, settings, pivotRef: pivotRefProp, localization, licenseKey,
|
|
16
|
+
declare const Flexmonster: ({ dataSource, settings, pivotRef: pivotRefProp, localization, licenseKey, hyperlinkColumn, enabled, }: Props) => import("react").JSX.Element;
|
|
16
17
|
export default Flexmonster;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { default as HyperlinkColumn } from './types/ui/HyperlinkColumn';
|
|
2
3
|
|
|
3
4
|
type ReportPageProps<ReportType> = {
|
|
4
5
|
data: object[] | null;
|
|
@@ -11,7 +12,7 @@ type ReportPageProps<ReportType> = {
|
|
|
11
12
|
EmployeePicker: React.ElementType;
|
|
12
13
|
localizationJsonFile: Promise<any>;
|
|
13
14
|
localizationTransformer?: (jsonContent: any) => Record<string, string> | null;
|
|
14
|
-
|
|
15
|
+
hyperlinkColumn?: HyperlinkColumn;
|
|
15
16
|
};
|
|
16
|
-
declare const ReportPage: <ReportType extends string>({ reportType, title, data, filterElements, getReportRoute, localization, licenseKey, EmployeePicker, localizationJsonFile, localizationTransformer,
|
|
17
|
+
declare const ReportPage: <ReportType extends string>({ reportType, title, data, filterElements, getReportRoute, localization, licenseKey, EmployeePicker, localizationJsonFile, localizationTransformer, hyperlinkColumn, }: ReportPageProps<ReportType>) => import("react").JSX.Element;
|
|
17
18
|
export default ReportPage;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export default interface HyperlinkColumn {
|
|
2
|
+
/**
|
|
3
|
+
* Column that gets replaced by the link and also has the id data for use in link.
|
|
4
|
+
*/
|
|
5
|
+
idColumn: string;
|
|
6
|
+
/**
|
|
7
|
+
* Either a string which ':id' part gets replaced by id or function, which gets passed id in parametr and returns url.
|
|
8
|
+
*/
|
|
9
|
+
url: string | ((id: string) => void);
|
|
10
|
+
}
|
|
@@ -5,6 +5,7 @@ type Props = {
|
|
|
5
5
|
navigateFunction: (url: string) => void;
|
|
6
6
|
currentPath: string;
|
|
7
7
|
homePath?: string;
|
|
8
|
+
className?: string;
|
|
8
9
|
};
|
|
9
|
-
declare const AppSearch: ({ searchTypes, navigateFunction, currentPath, homePath }: Props) => import("react").JSX.Element;
|
|
10
|
+
declare const AppSearch: ({ searchTypes, navigateFunction, currentPath, homePath, className, }: Props) => import("react").JSX.Element;
|
|
10
11
|
export default AppSearch;
|
|
@@ -3,7 +3,7 @@ import { default as FromTo } from '../../../models/types/FromTo';
|
|
|
3
3
|
import { Dispatch, SetStateAction } from 'react';
|
|
4
4
|
|
|
5
5
|
type FromToDatePickerProps = {
|
|
6
|
-
fromtoState: [FromTo, Dispatch<SetStateAction<FromTo>>];
|
|
6
|
+
fromtoState: readonly [FromTo, Dispatch<SetStateAction<FromTo>>];
|
|
7
7
|
className?: string;
|
|
8
8
|
size?: InputBaseProps['size'];
|
|
9
9
|
};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -16,3 +16,4 @@ export { default as useSearchQueryState } from './useSearchQueryState/useSearchQ
|
|
|
16
16
|
export { default as useEmployeePhotoPath } from './useEmployeePhotoPath/useEmployeePhotoPath';
|
|
17
17
|
export { default as useClipboard } from './useClipboard/useClipboard';
|
|
18
18
|
export { default as useGetApiDataBound } from './useGetApiDataBound/useGetApiDataBound';
|
|
19
|
+
export { default as useWindowSize } from './useWindowSize/useWindowSize';
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./ResponsiveContextDropdown-BcEZzNox.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./ResponsiveContextDropdown-BcEZzNox.cjs"),x=require("./useClickOutside-D0505nsm.cjs"),q=require("./useWindowSize-DYUZPhVO.cjs"),d=require("./useClipboard-DtPZtxpV.cjs"),T=require("./useGetApiData-DK9Apz0I.cjs"),c=require("react"),G=require("./useLocalStorageState-BFc8Gc8H.cjs");require("react-router-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const L=o=>{let e="pending",a;const t=o.then(s=>{e="success",a=s},s=>{e="error",a=s});return()=>{switch(e){case"pending":throw t;case"success":return a;case"error":throw a;default:throw new Error("Unknown status")}}};function O(o,e){const a=u.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[t,s]=c.useState(null);return c.useEffect(()=>{(async()=>{const r=a.get(o).then(n=>n.data);s(L(r))})()},[a,o]),t}const B=(o,e,a)=>{let t="pending",s;const l=o.then(r=>{t="success",s=r},r=>{const n=r==null?void 0:r.response;(n==null?void 0:n.status)===404&&a?(t="error-404",s=r):(t="error",s=r)});return()=>{switch(t){case"pending":throw l;case"success":return s;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},i={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},E=(o,{loadOnInit:e=i.loadOnInit,enabled:a=i.enabled,silent:t=i.silent,nullStateBeforeLoad:s=i.nullStateBeforeLoad,nullStateOnFail:l=i.nullStateOnFail,customApiUrl:r,customBearerToken:n,dataTransformer:h,errorBoundaryOn404:S}=i)=>{const w=u.useAxios({silent:t,customToken:n,differentBaseUrl:r,noToastOnStatus:S?[404]:void 0}),{startLoading:D,stopLoading:g}=c.useContext(u.LoadingContext),k=c.useRef(0),{isAuthenticated:C}=u.useAuth(),[P,p]=c.useState(null),m=c.useCallback(async(f,y)=>{if(!C()||a===!1)return;!t&&D(`loadData-${o}-${y}`),s&&p(null);const b=w.get(o,{signal:f}).then(A=>h?h(A.data):A.data).finally(()=>!t&&g(`loadData-${o}-${y}`));p(B(b,l??!1,S??!1))},[C,a,t,D,o,s,w,h,g,l,S]);return c.useEffect(()=>{if(e===!1)return;const f=new AbortController;return m(f.signal,++k.current),()=>{f.abort()}},[m,e]),{data:P,setData:p,reloadData:m}};exports.cancelToken=u.cancelToken;exports.useAuth=u.useAuth;exports.useAxios=u.useAxios;exports.useConfirm=u.useConfirm;exports.useFormControlType=u.useFormControlType;exports.useNotifications=u.useNotifications;exports.usePrompt=u.usePrompt;exports.useZodSchemaTypes=u.useZodSchemaTypes;exports.useClickOutside=x.useClickOutside;exports.usePermissions=q.usePermissions;exports.useWindowSize=q.useWindowSize;exports.useClipboard=d.useClipboard;exports.useEmployeePhotoPath=d.useEmployeePhotoPath;exports.useKeyPress=d.useKeyPress;exports.useSearchQuery=d.useSearchQuery;exports.useSearchQueryState=d.useSearchQueryState;exports.useGetApiData=T.useGetApiData;exports.useLocalStorageState=G.useLocalStorageState;exports.useGetApiDataBound=E;exports.useGetDataBound=O;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ar as
|
|
1
|
+
import { ar as x, aQ as L, az as P } from "./ResponsiveContextDropdown-CLWBQLuy.js";
|
|
2
2
|
import { bo as _, aS as j, aF as q, aR as H, a_ as J, bp as M } from "./ResponsiveContextDropdown-CLWBQLuy.js";
|
|
3
3
|
import { u as X } from "./useClickOutside-BmlXg38T.js";
|
|
4
|
-
import { u as tt } from "./
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
4
|
+
import { u as tt, a as et } from "./useWindowSize-DqS1g_16.js";
|
|
5
|
+
import { u as at, d as ot, a as rt, b as nt, c as ut } from "./useClipboard-DPyvA4Ya.js";
|
|
6
|
+
import { u as lt } from "./useGetApiData-Bx0_4gT-.js";
|
|
7
7
|
import { useState as b, useEffect as C, useContext as T, useRef as U, useCallback as $ } from "react";
|
|
8
|
-
import { u as
|
|
8
|
+
import { u as ft } from "./useLocalStorageState-Bt99kkCr.js";
|
|
9
9
|
import "react-router-dom";
|
|
10
10
|
import "react-hook-form";
|
|
11
11
|
import "react-flexmonster";
|
|
@@ -32,7 +32,7 @@ const B = (o) => {
|
|
|
32
32
|
};
|
|
33
33
|
};
|
|
34
34
|
function I(o, t) {
|
|
35
|
-
const a =
|
|
35
|
+
const a = x({
|
|
36
36
|
silent: !0,
|
|
37
37
|
differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
|
|
38
38
|
customToken: t == null ? void 0 : t.customToken
|
|
@@ -73,7 +73,7 @@ const E = (o, t, a) => {
|
|
|
73
73
|
nullStateBeforeLoad: !0,
|
|
74
74
|
nullStateOnFail: !1
|
|
75
75
|
}, K = (o, { loadOnInit: t = u.loadOnInit, enabled: a = u.enabled, silent: e = u.silent, nullStateBeforeLoad: s = u.nullStateBeforeLoad, nullStateOnFail: c = u.nullStateOnFail, customApiUrl: r, customBearerToken: n, dataTransformer: i, errorBoundaryOn404: f } = u) => {
|
|
76
|
-
const p =
|
|
76
|
+
const p = x({
|
|
77
77
|
silent: e,
|
|
78
78
|
customToken: n,
|
|
79
79
|
differentBaseUrl: r,
|
|
@@ -84,7 +84,7 @@ const E = (o, t, a) => {
|
|
|
84
84
|
!e && h(`loadData-${o}-${D}`), s && d(null);
|
|
85
85
|
const A = p.get(o, {
|
|
86
86
|
signal: l
|
|
87
|
-
}).then((
|
|
87
|
+
}).then((S) => i ? i(S.data) : S.data).finally(() => !e && w(`loadData-${o}-${D}`));
|
|
88
88
|
d(E(A, c ?? !1, f ?? !1));
|
|
89
89
|
}, [
|
|
90
90
|
g,
|
|
@@ -111,21 +111,22 @@ const E = (o, t, a) => {
|
|
|
111
111
|
export {
|
|
112
112
|
_ as cancelToken,
|
|
113
113
|
P as useAuth,
|
|
114
|
-
|
|
114
|
+
x as useAxios,
|
|
115
115
|
X as useClickOutside,
|
|
116
|
-
|
|
116
|
+
at as useClipboard,
|
|
117
117
|
j as useConfirm,
|
|
118
|
-
|
|
118
|
+
ot as useEmployeePhotoPath,
|
|
119
119
|
q as useFormControlType,
|
|
120
|
-
|
|
120
|
+
lt as useGetApiData,
|
|
121
121
|
K as useGetApiDataBound,
|
|
122
122
|
I as useGetDataBound,
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
rt as useKeyPress,
|
|
124
|
+
ft as useLocalStorageState,
|
|
125
125
|
H as useNotifications,
|
|
126
126
|
tt as usePermissions,
|
|
127
127
|
J as usePrompt,
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
nt as useSearchQuery,
|
|
129
|
+
ut as useSearchQueryState,
|
|
130
|
+
et as useWindowSize,
|
|
130
131
|
M as useZodSchemaTypes
|
|
131
132
|
};
|
|
@@ -8,6 +8,7 @@ type Props = {
|
|
|
8
8
|
currentPath: string;
|
|
9
9
|
useHover: boolean;
|
|
10
10
|
useTooltips: boolean;
|
|
11
|
+
isMobile: boolean;
|
|
11
12
|
};
|
|
12
|
-
declare const MenuItem: ({ item, menuExpanded, collapsed, onCollapse, currentPath, useHover, useTooltips, }: Props) => import("react").JSX.Element;
|
|
13
|
+
declare const MenuItem: ({ item, menuExpanded, collapsed, onCollapse, currentPath, useHover, useTooltips, isMobile, }: Props) => import("react").JSX.Element;
|
|
13
14
|
export default MenuItem;
|
|
@@ -2,6 +2,7 @@ import { MenuItemType } from '../../models/index';
|
|
|
2
2
|
|
|
3
3
|
type Props = {
|
|
4
4
|
headerItem: React.ReactNode;
|
|
5
|
+
searchItem?: React.ReactNode;
|
|
5
6
|
mainItems: MenuItemType[];
|
|
6
7
|
secondaryItems: MenuItemType[];
|
|
7
8
|
expanded: boolean;
|
|
@@ -10,5 +11,5 @@ type Props = {
|
|
|
10
11
|
useHover: boolean;
|
|
11
12
|
useTooltips: boolean;
|
|
12
13
|
};
|
|
13
|
-
declare const SideMenu: ({ headerItem, mainItems, secondaryItems, expanded, setExpanded, currentPath, useHover, useTooltips, }: Props) => import("react").JSX.Element;
|
|
14
|
+
declare const SideMenu: ({ headerItem, searchItem, mainItems, secondaryItems, expanded, setExpanded, currentPath, useHover, useTooltips, }: Props) => import("react").JSX.Element;
|
|
14
15
|
export default SideMenu;
|
package/dist/layout.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-BcEZzNox.cjs"),d=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ResponsiveContextDropdown-BcEZzNox.cjs"),d=require("react"),g=require("react-router-dom");require("react-hook-form");require("react-flexmonster");const S=require("./SimpleTooltip-tS3ZQgXE.cjs");require("@azure/msal-browser");require("@azure/msal-react");const k=require("./useClickOutside-D0505nsm.cjs"),C=require("./useWindowSize-DYUZPhVO.cjs"),f=require("./FullScreenContainer-DkxbkVKa.cjs"),P="_side-menu-item_1o1uo_1",I="_disabled_1o1uo_6",w="_nav-button_1o1uo_10",z="_child_1o1uo_18",q="_text_1o1uo_23",T="_icon_1o1uo_30",L="_collapse-icon_1o1uo_36",O="_collapsed_1o1uo_46",$="_collapse-icon-mini_1o1uo_49",F="_expanded_1o1uo_80",A="_children-container_1o1uo_86",D="_visible_1o1uo_94",K="_children_1o1uo_86",H="_mobile_1o1uo_106",o={"side-menu-item":"_side-menu-item_1o1uo_1",sideMenuItem:P,disabled:I,"nav-button":"_nav-button_1o1uo_10",navButton:w,child:z,text:q,icon:T,"collapse-icon":"_collapse-icon_1o1uo_36",collapseIcon:L,collapsed:O,"collapse-icon-mini":"_collapse-icon-mini_1o1uo_49",collapseIconMini:$,expanded:F,"children-container":"_children-container_1o1uo_86",childrenContainer:A,visible:D,children:K,mobile:H},U=({item:n,menuExpanded:t,useTooltips:i,children:r})=>n.tooltip&&!t&&i?e.jsxRuntimeExports.jsx(S.SimpleTooltip,{text:n.tooltip,placement:"top",delay:{show:1e3,hide:0},children:e.jsxRuntimeExports.jsx("div",{children:r})}):r,y=({item:n,menuExpanded:t,collapsed:i,onCollapse:r,currentPath:l,useHover:u,useTooltips:x,isMobile:a})=>{var M,v,N,h;const[p,_]=d.useState(!1),[b]=l.split("?"),m=n.linkTo===b||((M=n.children)==null?void 0:M.some(s=>s.linkTo===b)),E=d.useRef(null);return k.useClickOutside([E],()=>i&&r()),e.jsxRuntimeExports.jsxs("li",{ref:E,className:e.classNames("luminus-side-menu-item",o.sideMenuItem,{[o.mobile]:a},{[o.expanded]:t},{active:p||m},{open:i&&n.children},{[o.disabled]:n.disabled||n.notPermitted||((v=n.children)==null?void 0:v.every(s=>s.notPermitted||s.disabled))},{disabled:n.disabled||n.notPermitted||((N=n.children)==null?void 0:N.every(s=>s.notPermitted||s.disabled))}),onMouseEnter:()=>_(!0),onMouseLeave:()=>_(!1),children:[e.jsxRuntimeExports.jsx(U,{item:n,menuExpanded:t,useTooltips:x,children:n.children?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:e.jsxRuntimeExports.jsxs("button",{type:"button",className:e.classNames("nav-link",o.navButton),onClick:()=>{r()},children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),!u&&!t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon-mini rounded",o.collapseIconMini,{[o.collapsed]:i}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("collapse-icon",o.collapseIcon,{[o.collapsed]:i}),children:e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardArrowRight,{})})]})}):e.jsxRuntimeExports.jsxs(g.Link,{to:n.disabled||n.notPermitted?"/":n.linkTo??"/",className:e.classNames("nav-link",o.navButton),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("icon",o.icon),children:n.icon}),t&&e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:n.title})]})}),e.jsxRuntimeExports.jsx("div",{className:e.classNames("children-container",o.childrenContainer,{[o.visible]:i}),children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("shadow rounded children",o.children),children:(h=n.children)==null?void 0:h.map(s=>e.jsxRuntimeExports.jsx(g.Link,{to:s.disabled||s.notPermitted?"/":s.linkTo??"/",className:e.classNames("nav-link child rounded",o.navButton,o.child,{[o.disabled]:s.disabled||s.notPermitted},{disabled:s.disabled||s.notPermitted}),onClick:r,children:e.jsxRuntimeExports.jsx("div",{className:e.classNames("text",o.text,"text-nowrap"),children:s.title})},s.linkTo))})})]})},W="_side-menu_15z3o_1",G="_sidebar-header_15z3o_13",J="_side-menu-content_15z3o_20",Q="_expand_15z3o_24",V="_only-logo_15z3o_28",X="_mobile_15z3o_31",Y="_divider_15z3o_45",j={"side-menu":"_side-menu_15z3o_1",sideMenu:W,"sidebar-header":"_sidebar-header_15z3o_13",sidebarHeader:G,"side-menu-content":"_side-menu-content_15z3o_20",sideMenuContent:J,expand:Q,"only-logo":"_only-logo_15z3o_28",onlyLogo:V,mobile:X,divider:Y},Z=({headerItem:n,searchItem:t,mainItems:i,secondaryItems:r,expanded:l,setExpanded:u,currentPath:x,useHover:a,useTooltips:p})=>{const[_,b]=d.useState(-1),{checkUserHasPermissions:m}=C.usePermissions(),E=d.useMemo(()=>i.map(s=>{var c;return{...s,notPermitted:!m(s.permissions??[],"any"),children:(c=s.children)==null?void 0:c.map(R=>({...R,notPermitted:!m(R.permissions??[],"any"),disabled:s.disabled||R.disabled}))}}),[i,m]),M=d.useMemo(()=>r.map(s=>{var c;return{...s,notPermitted:!m(s.permissions??[],"any"),children:(c=s.children)==null?void 0:c.map(R=>({...R,notPermitted:!m(R.permissions??[],"any")}))}}),[r,m]),v=s=>{b(s===_?-1:s)};d.useEffect(()=>{l||b(-1)},[l]);const N=d.useRef(null);k.useClickOutside([N],()=>u(!1));const{isMobile:h}=C.useWindowSize();return e.jsxRuntimeExports.jsxs("section",{ref:N,className:e.classNames("luminus-side-menu shadow",j.sideMenu,{[j.mobile]:h},{[j.expand]:l},{expand:l}),onMouseEnter:()=>a&&u(!0),onMouseLeave:()=>a&&u(!1),children:[e.jsxRuntimeExports.jsx("div",{className:e.classNames("sidebar-header",j.sidebarHeader,{[j.onlyLogo]:a}),role:a?void 0:"button",onClick:a?void 0:()=>u(!l),children:a?n:l?e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsx(e.MdOutlineKeyboardDoubleArrowLeft,{}),n]}):e.jsxRuntimeExports.jsx(e.MdOutlineMenu,{})}),e.jsxRuntimeExports.jsxs("ul",{className:j.sideMenuContent,children:[t||null,E.map((s,c)=>e.jsxRuntimeExports.jsx(y,{item:s,menuExpanded:l,collapsed:c===_,onCollapse:()=>v(c),currentPath:x,useHover:a,useTooltips:p,isMobile:h},s.title)),e.jsxRuntimeExports.jsx("hr",{className:e.classNames("divider",j.divider)}),M.map((s,c)=>e.jsxRuntimeExports.jsx(y,{item:s,menuExpanded:l,collapsed:c===_,onCollapse:()=>v(c),currentPath:x,useHover:a,useTooltips:p,isMobile:h},s.title))]})]})},ee="_top-bar_1usoa_1",se="_top-bar-brand_1usoa_13",B={"top-bar":"_top-bar_1usoa_1",topBar:ee,"top-bar-brand":"_top-bar-brand_1usoa_13",topBarBrand:se},ne=({appName:n,leftOffset:t,centerContent:i,rightContent:r})=>e.jsxRuntimeExports.jsxs("nav",{className:e.classNames("luminus-top-bar shadow gap-1 gap-lg-3",B.topBar),style:{width:t?`calc(100% - ${t}px)`:void 0,left:t?`${t}px`:void 0},children:[e.jsxRuntimeExports.jsx(g.Link,{to:"/",className:e.classNames("luminus-top-bar-brand",B.topBarBrand),children:n}),i&&e.jsxRuntimeExports.jsx("div",{children:i}),e.jsxRuntimeExports.jsx("div",{className:"d-flex justify-content-end align-items-center",children:r??null})]}),oe=({title:n,children:t,sideContent:i,sideContentWidth:r=250,noPadding:l,className:u,helmet:x})=>{const{addHelmet:a,removeHelmet:p}=d.useContext(e.HelmetContext);return d.useEffect(()=>(x?a(x):typeof n=="string"&&n&&a(n),()=>p()),[x,a,p,n]),e.jsxRuntimeExports.jsxs("div",{className:e.classNames("container-fluid",l?"p-0":"p-3",u),children:[e.jsxRuntimeExports.jsxs("div",{style:{paddingRight:i?`${r}px`:void 0},children:[n?e.jsxRuntimeExports.jsx(e.PageTitle,{title:n}):null,t]}),i&&e.jsxRuntimeExports.jsx(e.SideContentBar,{width:r,children:i})]})};exports.PageContainer=e.PageContainer;exports.SideContentBar=e.SideContentBar;exports.FullScreenContainer=f.FullScreenContainer;exports.MainContainer=oe;exports.SideMenu=Z;exports.TopBar=ne;
|
package/dist/layout.es.js
CHANGED
|
@@ -1,145 +1,150 @@
|
|
|
1
|
-
import { j as e, c as
|
|
2
|
-
import { be as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { Link as
|
|
1
|
+
import { j as e, c as i, ac as B, b9 as L, ba as T, bb as R, bc as $, bd as F } from "./ResponsiveContextDropdown-CLWBQLuy.js";
|
|
2
|
+
import { be as Ce } from "./ResponsiveContextDropdown-CLWBQLuy.js";
|
|
3
|
+
import { useState as k, useRef as w, useMemo as I, useEffect as z, useContext as A } from "react";
|
|
4
|
+
import { Link as y } from "react-router-dom";
|
|
5
5
|
import "react-hook-form";
|
|
6
6
|
import "react-flexmonster";
|
|
7
|
-
import { S as
|
|
7
|
+
import { S as H } from "./SimpleTooltip-_neXI0ly.js";
|
|
8
8
|
import "@azure/msal-browser";
|
|
9
9
|
import "@azure/msal-react";
|
|
10
|
-
import { u as
|
|
11
|
-
import { u as
|
|
12
|
-
import { F as
|
|
13
|
-
const
|
|
14
|
-
"side-menu-item": "_side-menu-
|
|
15
|
-
sideMenuItem:
|
|
16
|
-
disabled:
|
|
17
|
-
"nav-button": "_nav-
|
|
18
|
-
navButton:
|
|
19
|
-
child:
|
|
20
|
-
text:
|
|
21
|
-
icon:
|
|
22
|
-
"collapse-icon": "_collapse-
|
|
23
|
-
collapseIcon:
|
|
24
|
-
collapsed:
|
|
25
|
-
"collapse-icon-mini": "_collapse-icon-
|
|
26
|
-
collapseIconMini:
|
|
27
|
-
expanded:
|
|
28
|
-
"children-container": "_children-
|
|
29
|
-
childrenContainer:
|
|
30
|
-
visible:
|
|
31
|
-
children:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
10
|
+
import { u as S } from "./useClickOutside-BmlXg38T.js";
|
|
11
|
+
import { u as K, a as O } from "./useWindowSize-DqS1g_16.js";
|
|
12
|
+
import { F as ke } from "./FullScreenContainer-CmMf6Wz-.js";
|
|
13
|
+
const D = "_side-menu-item_1o1uo_1", U = "_disabled_1o1uo_6", q = "_nav-button_1o1uo_10", E = "_child_1o1uo_18", G = "_text_1o1uo_23", J = "_icon_1o1uo_30", Q = "_collapse-icon_1o1uo_36", V = "_collapsed_1o1uo_46", W = "_collapse-icon-mini_1o1uo_49", X = "_expanded_1o1uo_80", Y = "_children-container_1o1uo_86", Z = "_visible_1o1uo_94", ee = "_children_1o1uo_86", oe = "_mobile_1o1uo_106", s = {
|
|
14
|
+
"side-menu-item": "_side-menu-item_1o1uo_1",
|
|
15
|
+
sideMenuItem: D,
|
|
16
|
+
disabled: U,
|
|
17
|
+
"nav-button": "_nav-button_1o1uo_10",
|
|
18
|
+
navButton: q,
|
|
19
|
+
child: E,
|
|
20
|
+
text: G,
|
|
21
|
+
icon: J,
|
|
22
|
+
"collapse-icon": "_collapse-icon_1o1uo_36",
|
|
23
|
+
collapseIcon: Q,
|
|
24
|
+
collapsed: V,
|
|
25
|
+
"collapse-icon-mini": "_collapse-icon-mini_1o1uo_49",
|
|
26
|
+
collapseIconMini: W,
|
|
27
|
+
expanded: X,
|
|
28
|
+
"children-container": "_children-container_1o1uo_86",
|
|
29
|
+
childrenContainer: Y,
|
|
30
|
+
visible: Z,
|
|
31
|
+
children: ee,
|
|
32
|
+
mobile: oe
|
|
33
|
+
}, ne = ({ item: n, menuExpanded: t, useTooltips: a, children: l }) => n.tooltip && !t && a ? /* @__PURE__ */ e.jsx(H, { text: n.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ e.jsx("div", { children: l }) }) : l, C = ({ item: n, menuExpanded: t, collapsed: a, onCollapse: l, currentPath: r, useHover: _, useTooltips: u, isMobile: d }) => {
|
|
34
|
+
var g, M, N, v;
|
|
35
|
+
const [p, b] = k(!1), [h] = r.split("?"), m = n.linkTo === h || ((g = n.children) == null ? void 0 : g.some((o) => o.linkTo === h)), f = w(null);
|
|
36
|
+
return S([f], () => a && l()), /* @__PURE__ */ e.jsxs("li", { ref: f, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: d }, {
|
|
37
|
+
[s.expanded]: t
|
|
38
|
+
}, { active: p || m }, { open: a && n.children }, {
|
|
39
|
+
[s.disabled]: n.disabled || n.notPermitted || ((M = n.children) == null ? void 0 : M.every((o) => o.notPermitted || o.disabled))
|
|
39
40
|
}, {
|
|
40
|
-
disabled: n.disabled || n.notPermitted || ((
|
|
41
|
-
}), onMouseEnter: () =>
|
|
42
|
-
/* @__PURE__ */ e.jsx(
|
|
43
|
-
|
|
41
|
+
disabled: n.disabled || n.notPermitted || ((N = n.children) == null ? void 0 : N.every((o) => o.notPermitted || o.disabled))
|
|
42
|
+
}), onMouseEnter: () => b(!0), onMouseLeave: () => b(!1), children: [
|
|
43
|
+
/* @__PURE__ */ e.jsx(ne, { item: n, menuExpanded: t, useTooltips: u, children: n.children ? /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("button", { type: "button", className: i("nav-link", s.navButton), onClick: () => {
|
|
44
|
+
l();
|
|
44
45
|
}, children: [
|
|
45
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
46
|
-
!
|
|
47
|
-
[
|
|
48
|
-
}), children: /* @__PURE__ */ e.jsx(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
[
|
|
52
|
-
}), children: /* @__PURE__ */ e.jsx(
|
|
53
|
-
] }) }) : /* @__PURE__ */ e.jsxs(
|
|
54
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
55
|
-
|
|
46
|
+
/* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
|
|
47
|
+
!_ && !t && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon-mini rounded", s.collapseIconMini, {
|
|
48
|
+
[s.collapsed]: a
|
|
49
|
+
}), children: /* @__PURE__ */ e.jsx(B, {}) }),
|
|
50
|
+
t && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title }),
|
|
51
|
+
t && /* @__PURE__ */ e.jsx("div", { className: i("collapse-icon", s.collapseIcon, {
|
|
52
|
+
[s.collapsed]: a
|
|
53
|
+
}), children: /* @__PURE__ */ e.jsx(B, {}) })
|
|
54
|
+
] }) }) : /* @__PURE__ */ e.jsxs(y, { to: n.disabled || n.notPermitted ? "/" : n.linkTo ?? "/", className: i("nav-link", s.navButton), children: [
|
|
55
|
+
/* @__PURE__ */ e.jsx("div", { className: i("icon", s.icon), children: n.icon }),
|
|
56
|
+
t && /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: n.title })
|
|
56
57
|
] }) }),
|
|
57
|
-
/* @__PURE__ */ e.jsx("div", { className:
|
|
58
|
-
[
|
|
59
|
-
}), children: /* @__PURE__ */ e.jsx("div", { className:
|
|
58
|
+
/* @__PURE__ */ e.jsx("div", { className: i("children-container", s.childrenContainer, {
|
|
59
|
+
[s.visible]: a
|
|
60
|
+
}), children: /* @__PURE__ */ e.jsx("div", { className: i("shadow rounded children", s.children), children: (v = n.children) == null ? void 0 : v.map((o) => /* @__PURE__ */ e.jsx(y, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, { [s.disabled]: o.disabled || o.notPermitted }, { disabled: o.disabled || o.notPermitted }), onClick: l, children: /* @__PURE__ */ e.jsx("div", { className: i("text", s.text, "text-nowrap"), children: o.title }) }, o.linkTo)) }) })
|
|
60
61
|
] });
|
|
61
|
-
},
|
|
62
|
-
"side-menu": "_side-
|
|
63
|
-
sideMenu:
|
|
64
|
-
"sidebar-header": "_sidebar-
|
|
65
|
-
sidebarHeader:
|
|
66
|
-
"side-menu-content": "_side-menu-
|
|
67
|
-
sideMenuContent:
|
|
68
|
-
expand:
|
|
69
|
-
"only-logo": "_only-
|
|
70
|
-
onlyLogo:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
62
|
+
}, se = "_side-menu_15z3o_1", ie = "_sidebar-header_15z3o_13", te = "_side-menu-content_15z3o_20", ae = "_expand_15z3o_24", le = "_only-logo_15z3o_28", de = "_mobile_15z3o_31", re = "_divider_15z3o_45", x = {
|
|
63
|
+
"side-menu": "_side-menu_15z3o_1",
|
|
64
|
+
sideMenu: se,
|
|
65
|
+
"sidebar-header": "_sidebar-header_15z3o_13",
|
|
66
|
+
sidebarHeader: ie,
|
|
67
|
+
"side-menu-content": "_side-menu-content_15z3o_20",
|
|
68
|
+
sideMenuContent: te,
|
|
69
|
+
expand: ae,
|
|
70
|
+
"only-logo": "_only-logo_15z3o_28",
|
|
71
|
+
onlyLogo: le,
|
|
72
|
+
mobile: de,
|
|
73
|
+
divider: re
|
|
74
|
+
}, fe = ({ headerItem: n, searchItem: t, mainItems: a, secondaryItems: l, expanded: r, setExpanded: _, currentPath: u, useHover: d, useTooltips: p }) => {
|
|
75
|
+
const [b, h] = k(-1), { checkUserHasPermissions: m } = K(), f = I(() => a.map((o) => {
|
|
76
|
+
var c;
|
|
75
77
|
return {
|
|
76
|
-
...
|
|
77
|
-
notPermitted: !
|
|
78
|
-
children: (
|
|
79
|
-
...
|
|
80
|
-
notPermitted: !
|
|
81
|
-
disabled:
|
|
78
|
+
...o,
|
|
79
|
+
notPermitted: !m(o.permissions ?? [], "any"),
|
|
80
|
+
children: (c = o.children) == null ? void 0 : c.map((j) => ({
|
|
81
|
+
...j,
|
|
82
|
+
notPermitted: !m(j.permissions ?? [], "any"),
|
|
83
|
+
disabled: o.disabled || j.disabled
|
|
82
84
|
}))
|
|
83
85
|
};
|
|
84
|
-
}), [a,
|
|
85
|
-
var
|
|
86
|
+
}), [a, m]), g = I(() => l.map((o) => {
|
|
87
|
+
var c;
|
|
86
88
|
return {
|
|
87
|
-
...
|
|
88
|
-
notPermitted: !
|
|
89
|
-
children: (
|
|
90
|
-
...
|
|
91
|
-
notPermitted: !
|
|
89
|
+
...o,
|
|
90
|
+
notPermitted: !m(o.permissions ?? [], "any"),
|
|
91
|
+
children: (c = o.children) == null ? void 0 : c.map((j) => ({
|
|
92
|
+
...j,
|
|
93
|
+
notPermitted: !m(j.permissions ?? [], "any")
|
|
92
94
|
}))
|
|
93
95
|
};
|
|
94
|
-
}), [
|
|
95
|
-
|
|
96
|
+
}), [l, m]), M = (o) => {
|
|
97
|
+
h(o === b ? -1 : o);
|
|
96
98
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}, [
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
z(() => {
|
|
100
|
+
r || h(-1);
|
|
101
|
+
}, [r]);
|
|
102
|
+
const N = w(null);
|
|
103
|
+
S([N], () => _(!1));
|
|
104
|
+
const { isMobile: v } = O();
|
|
105
|
+
return /* @__PURE__ */ e.jsxs("section", { ref: N, className: i("luminus-side-menu shadow", x.sideMenu, { [x.mobile]: v }, {
|
|
106
|
+
[x.expand]: r
|
|
107
|
+
}, { expand: r }), onMouseEnter: () => d && _(!0), onMouseLeave: () => d && _(!1), children: [
|
|
108
|
+
/* @__PURE__ */ e.jsx("div", { className: i("sidebar-header", x.sidebarHeader, {
|
|
109
|
+
[x.onlyLogo]: d
|
|
110
|
+
}), role: d ? void 0 : "button", onClick: d ? void 0 : () => _(!r), children: d ? n : r ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
111
|
+
/* @__PURE__ */ e.jsx(L, {}),
|
|
108
112
|
n
|
|
109
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
110
|
-
/* @__PURE__ */ e.jsxs("ul", { className:
|
|
111
|
-
|
|
112
|
-
/* @__PURE__ */ e.jsx(
|
|
113
|
-
|
|
113
|
+
] }) : /* @__PURE__ */ e.jsx(T, {}) }),
|
|
114
|
+
/* @__PURE__ */ e.jsxs("ul", { className: x.sideMenuContent, children: [
|
|
115
|
+
t || null,
|
|
116
|
+
f.map((o, c) => /* @__PURE__ */ e.jsx(C, { item: o, menuExpanded: r, collapsed: c === b, onCollapse: () => M(c), currentPath: u, useHover: d, useTooltips: p, isMobile: v }, o.title)),
|
|
117
|
+
/* @__PURE__ */ e.jsx("hr", { className: i("divider", x.divider) }),
|
|
118
|
+
g.map((o, c) => /* @__PURE__ */ e.jsx(C, { item: o, menuExpanded: r, collapsed: c === b, onCollapse: () => M(c), currentPath: u, useHover: d, useTooltips: p, isMobile: v }, o.title))
|
|
114
119
|
] })
|
|
115
120
|
] });
|
|
116
|
-
},
|
|
117
|
-
"top-bar": "_top-
|
|
118
|
-
topBar:
|
|
119
|
-
"top-bar-brand": "_top-bar-
|
|
120
|
-
topBarBrand:
|
|
121
|
-
},
|
|
122
|
-
width:
|
|
123
|
-
left:
|
|
121
|
+
}, ce = "_top-bar_1usoa_1", _e = "_top-bar-brand_1usoa_13", P = {
|
|
122
|
+
"top-bar": "_top-bar_1usoa_1",
|
|
123
|
+
topBar: ce,
|
|
124
|
+
"top-bar-brand": "_top-bar-brand_1usoa_13",
|
|
125
|
+
topBarBrand: _e
|
|
126
|
+
}, ge = ({ appName: n, leftOffset: t, centerContent: a, rightContent: l }) => /* @__PURE__ */ e.jsxs("nav", { className: i("luminus-top-bar shadow gap-1 gap-lg-3", P.topBar), style: {
|
|
127
|
+
width: t ? `calc(100% - ${t}px)` : void 0,
|
|
128
|
+
left: t ? `${t}px` : void 0
|
|
124
129
|
}, children: [
|
|
125
|
-
/* @__PURE__ */ e.jsx(
|
|
126
|
-
|
|
127
|
-
/* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center
|
|
128
|
-
] }),
|
|
129
|
-
const { addHelmet:
|
|
130
|
-
return
|
|
131
|
-
/* @__PURE__ */ e.jsxs("div", { style: { paddingRight:
|
|
132
|
-
n ? /* @__PURE__ */ e.jsx(
|
|
133
|
-
|
|
130
|
+
/* @__PURE__ */ e.jsx(y, { to: "/", className: i("luminus-top-bar-brand", P.topBarBrand), children: n }),
|
|
131
|
+
a && /* @__PURE__ */ e.jsx("div", { children: a }),
|
|
132
|
+
/* @__PURE__ */ e.jsx("div", { className: "d-flex justify-content-end align-items-center", children: l ?? null })
|
|
133
|
+
] }), ye = ({ title: n, children: t, sideContent: a, sideContentWidth: l = 250, noPadding: r, className: _, helmet: u }) => {
|
|
134
|
+
const { addHelmet: d, removeHelmet: p } = A(R);
|
|
135
|
+
return z(() => (u ? d(u) : typeof n == "string" && n && d(n), () => p()), [u, d, p, n]), /* @__PURE__ */ e.jsxs("div", { className: i("container-fluid", r ? "p-0" : "p-3", _), children: [
|
|
136
|
+
/* @__PURE__ */ e.jsxs("div", { style: { paddingRight: a ? `${l}px` : void 0 }, children: [
|
|
137
|
+
n ? /* @__PURE__ */ e.jsx($, { title: n }) : null,
|
|
138
|
+
t
|
|
134
139
|
] }),
|
|
135
|
-
|
|
140
|
+
a && /* @__PURE__ */ e.jsx(F, { width: l, children: a })
|
|
136
141
|
] });
|
|
137
142
|
};
|
|
138
143
|
export {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
ke as FullScreenContainer,
|
|
145
|
+
ye as MainContainer,
|
|
146
|
+
Ce as PageContainer,
|
|
147
|
+
F as SideContentBar,
|
|
148
|
+
fe as SideMenu,
|
|
149
|
+
ge as TopBar
|
|
145
150
|
};
|