react-luminus-components 2.0.3-beta.r19-14 → 2.0.3-beta.r19-16
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 +42 -36
- package/dist/FormDisabledProvider-DXNc2136.js +51 -0
- package/dist/FormDisabledProvider-vg-vA0WK.cjs +1 -0
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +5 -3
- package/dist/components/NotifCenter/Actions/types/NotificationKindFullModel.d.ts +5 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +535 -288
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +194 -125
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +277 -131
- package/dist/{localStorageUtils-B7BmbR_u.js → localStorageUtils-CZ4HDRzi.js} +17 -7
- package/dist/main.cjs.js +13 -13
- package/dist/main.es.js +10386 -5526
- package/dist/nivo-bar-BZDK_ha3.js +41897 -0
- package/dist/nivo-bar-D02kyst9.cjs +326 -0
- package/dist/useEmployeePhotoPath-TFR1dZzz.cjs +1 -0
- package/dist/useEmployeePhotoPath-_slBRHnm.js +111 -0
- package/dist/useLocalStorageState-B0hJPCtQ.cjs +1 -0
- package/dist/useLocalStorageState-DcSLbUf2.js +96 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +41 -69
- package/package.json +2 -1
- package/dist/FormDisabledProvider-B62seaHO.cjs +0 -1
- package/dist/FormDisabledProvider-qklvful2.js +0 -40
- package/dist/nivo-bar-C5h-CRYO.cjs +0 -306
- package/dist/nivo-bar-FuUHRilH.js +0 -40076
- package/dist/useEmployeePhotoPath-DdMmh1qU.js +0 -65
- package/dist/useEmployeePhotoPath-Q0EhpWOh.cjs +0 -1
- package/dist/useLocalStorageState-BWVTT0cO.js +0 -80
- package/dist/useLocalStorageState-iaJubQoG.cjs +0 -1
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 a=require("./nivo-bar-D02kyst9.cjs"),V=require("./useLocalStorageState-B0hJPCtQ.cjs"),Q=require("@tanstack/react-query"),F=require("./useEmployeePhotoPath-TFR1dZzz.cjs"),h=require("react");require("react/jsx-runtime");require("react-router");const U=require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");function _(t,n){const e=a.compilerRuntimeExports.c(12),s=n==null?void 0:n.customBaseUrl,o=n==null?void 0:n.customToken;let d;e[0]!==s||e[1]!==o?(d={silent:!0,differentBaseUrl:s,customToken:o},e[0]=s,e[1]=o,e[2]=d):d=e[2];const r=a.useAxios(d),{isAuthenticated:u}=a.useAuth();let i;e[3]!==u||e[4]!==t?(i=[t,u],e[3]=u,e[4]=t,e[5]=i):i=e[5];let l;e[6]!==r||e[7]!==t?(l=()=>r.get(t).then(H),e[6]=r,e[7]=t,e[8]=l):l=e[8];let p;e[9]!==i||e[10]!==l?(p={queryKey:i,queryFn:l},e[9]=i,e[10]=l,e[11]=p):p=e[11];const{data:f}=Q.useSuspenseQuery(p);return f}function H(t){return t.data}const J=t=>n=>(window.addEventListener(`storage_${t}`,n),()=>window.removeEventListener(`storage_${t}`,n)),W=(t,n,e)=>{const s=a.compilerRuntimeExports.c(14),o=e===void 0?localStorage:e,[d]=h.useState(n);let r;s[0]!==n?(r=JSON.stringify(n),s[0]=n,s[1]=r):r=s[1];const u=h.useRef(r),i=h.useRef(n);let l;s[2]!==t||s[3]!==d||s[4]!==o?(l=()=>{const S=o.getItem(t);return S!==u.current&&(u.current=S,i.current=u.current?JSON.parse(u.current):d),i.current},s[2]=t,s[3]=d,s[4]=o,s[5]=l):l=s[5];const p=l;let f;s[6]!==t?(f=J(t),s[6]=t,s[7]=f):f=s[7];const E=f,g=h.useSyncExternalStore(E,p);let c;s[8]!==t||s[9]!==o?(c=S=>{o.setItem(t,JSON.stringify(S)),window.dispatchEvent(new Event(`storage_${t}`))},s[8]=t,s[9]=o,s[10]=c):c=s[10];const m=c;let y;return s[11]!==m||s[12]!==g?(y=[g,m],s[11]=m,s[12]=g,s[13]=y):y=s[13],y},z=(t,n,e)=>{let s="pending",o;const d=t.then(r=>{s="success",o=r},r=>{const u=r==null?void 0:r.response;(u==null?void 0:u.status)===404&&e?(s="error-404",o=r):(s="error",o=r)});return()=>{switch(s){case"pending":throw d;case"success":return o;case"error":if(o.code==="ERR_CANCELED")return null;throw o;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},D={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},M=(t,n)=>{const e=a.compilerRuntimeExports.c(26),{loadOnInit:s,enabled:o,silent:d,nullStateBeforeLoad:r,nullStateOnFail:u,customApiUrl:i,customBearerToken:l,dataTransformer:p,errorBoundaryOn404:f}=n===void 0?D:n,E=s===void 0?D.loadOnInit:s,g=o===void 0?D.enabled:o,c=d===void 0?D.silent:d,m=r===void 0?D.nullStateBeforeLoad:r,y=u===void 0?D.nullStateOnFail:u;let w;e[0]!==f?(w=f?[404]:void 0,e[0]=f,e[1]=w):w=e[1];let S;e[2]!==i||e[3]!==l||e[4]!==c||e[5]!==w?(S={silent:c,customToken:l,differentBaseUrl:i,noToastOnStatus:w},e[2]=i,e[3]=l,e[4]=c,e[5]=w,e[6]=S):S=e[6];const O=a.useAxios(S),{startLoading:P,stopLoading:v}=h.useContext(a.LoadingContext),C=h.useRef(0),{isAuthenticated:A}=a.useAuth(),[$,R]=h.useState(null);let I;e[7]!==O||e[8]!==p||e[9]!==g||e[10]!==f||e[11]!==A||e[12]!==m||e[13]!==y||e[14]!==c||e[15]!==P||e[16]!==v||e[17]!==t?(I=async(x,N)=>{if(!A()||g===!1)return;!c&&P(`loadData-${t}-${N}`),m&&R(null);const G=O.get(t,{signal:x}).then(K=>p?p(K.data):K.data).finally(()=>!c&&v(`loadData-${t}-${N}`));R(z(G,y??!1,f??!1))},e[7]=O,e[8]=p,e[9]=g,e[10]=f,e[11]=A,e[12]=m,e[13]=y,e[14]=c,e[15]=P,e[16]=v,e[17]=t,e[18]=I):I=e[18];const q=I;let b,T;e[19]!==q||e[20]!==E?(T=()=>{if(E===!1)return;const x=new AbortController;return q(x.signal,C.current=C.current+1),()=>{x.abort()}},b=[q,E],e[19]=q,e[20]=E,e[21]=b,e[22]=T):(b=e[21],T=e[22]),h.useEffect(T,b);let B;return e[23]!==$||e[24]!==q?(B={data:$,setData:R,reloadData:q},e[23]=$,e[24]=q,e[25]=B):B=e[25],B},Z=()=>{const t=h.useRef({}).current;return h.useEffect(()=>{const n=document.createElement("div");return n.style.position="absolute",n.style.pointerEvents="none",n.style.top="0",n.style.width="100%",n.style.height="100%",t.elt=n,document.body.appendChild(n),()=>{document.body.removeChild(n)}},[t]),n=>(e,...s)=>{const o=n(e,...s);return e.draggableProps.style.position==="fixed"?U.createPortal(o,t.elt):o}},L={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},j=(t,n)=>{const e=a.compilerRuntimeExports.c(18),{storageKey:s,requiredHeight:o,retryInterval:d}=n===void 0?L:n,r=s===void 0?L.storageKey:s,u=o===void 0?L.requiredHeight:o,i=d===void 0?L.retryInterval:d,[l,p]=h.useState(!1),f=h.useRef(null);let E;e[0]!==r?(E=()=>{const v=localStorage.getItem(r);return localStorage.removeItem(r),v===null?null:Number(v)},e[0]=r,e[1]=E):E=e[1];const g=E;let c;e[2]!==r?(c=v=>{localStorage.setItem(r,v)},e[2]=r,e[3]=c):c=e[3];const m=c;let y,w;e[4]!==l||e[5]!==u||e[6]!==g||e[7]!==i||e[8]!==t?(y=()=>{const v=window.setInterval(()=>{if(!l&&t.current!==null&&t.current.getBoundingClientRect().height>u){p(!0);const C=g();C!==null&&t.current.scrollTo({top:C}),window.clearInterval(v)}},i);return()=>{window.clearTimeout(v)}},w=[l,u,g,i,t],e[4]=l,e[5]=u,e[6]=g,e[7]=i,e[8]=t,e[9]=y,e[10]=w):(y=e[9],w=e[10]),h.useEffect(y,w);let S,O;e[11]!==m||e[12]!==t?(S=()=>{var C;const v=new AbortController;return(C=t.current)==null||C.addEventListener("scrollend",()=>{var A;f.current=((A=t.current)==null?void 0:A.scrollTop)??0,m((f.current??0).toString())},{signal:v.signal}),()=>v.abort()},O=[m,t],e[11]=m,e[12]=t,e[13]=S,e[14]=O):(S=e[13],O=e[14]),h.useEffect(S,O);let P;return e[15]!==g||e[16]!==m?(P={saveValue:m,retrieveValue:g},e[15]=g,e[16]=m,e[17]=P):P=e[17],P};exports.cancelToken=a.cancelToken;exports.useAuth=a.useAuth;exports.useAxios=a.useAxios;exports.useClickOutside=a.useClickOutside;exports.useClipboard=a.useClipboard;exports.useConfirm=a.useConfirm;exports.useFormControlType=a.useFormControlType;exports.useKeyPress=a.useKeyPress;exports.useNotifications=a.useNotifications;exports.usePermissions=a.usePermissions;exports.usePrompt=a.usePrompt;exports.useWindowSize=a.useWindowSize;exports.useZodSchemaTypes=a.useZodSchemaTypes;exports.useGetApiData=V.useGetApiData;exports.useLocalStorageState=V.useLocalStorageState;exports.useEmployeePhotoPath=F.useEmployeePhotoPath;exports.useSearchQuery=F.useSearchQuery;exports.useSearchQueryState=F.useSearchQueryState;exports.useGetApiDataBound=M;exports.useGetDataBound=_;exports.usePersistentState=W;exports.useRenderDraggableInPortal=Z;exports.useScrollSave=j;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,164 +1,233 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { u as
|
|
4
|
-
import { useSuspenseQuery as
|
|
5
|
-
import { b as
|
|
6
|
-
import { useState as
|
|
1
|
+
import { c as q, ao as _, bd as G, aq as J } from "./nivo-bar-BZDK_ha3.js";
|
|
2
|
+
import { bS as vt, aR as St, bU as pt, an as ht, bT as wt, b7 as bt, ar as yt, bw as It, am as Ot, aG as Ct, aU as Et } from "./nivo-bar-BZDK_ha3.js";
|
|
3
|
+
import { u as Tt, a as xt } from "./useLocalStorageState-DcSLbUf2.js";
|
|
4
|
+
import { useSuspenseQuery as Q } from "@tanstack/react-query";
|
|
5
|
+
import { b as Lt, u as $t, a as At } from "./useEmployeePhotoPath-_slBRHnm.js";
|
|
6
|
+
import { useState as U, useRef as D, useSyncExternalStore as W, useContext as z, useEffect as P } from "react";
|
|
7
7
|
import "react/jsx-runtime";
|
|
8
8
|
import "react-router";
|
|
9
|
-
import { createPortal as
|
|
9
|
+
import { createPortal as R } from "react-dom";
|
|
10
10
|
import "react-hook-form";
|
|
11
11
|
import "react-flexmonster";
|
|
12
12
|
import "@azure/msal-browser";
|
|
13
13
|
import "@azure/msal-react";
|
|
14
|
-
function
|
|
15
|
-
const
|
|
14
|
+
function ut(e, s) {
|
|
15
|
+
const t = q.c(12), n = s == null ? void 0 : s.customBaseUrl, o = s == null ? void 0 : s.customToken;
|
|
16
|
+
let c;
|
|
17
|
+
t[0] !== n || t[1] !== o ? (c = {
|
|
16
18
|
silent: !0,
|
|
17
|
-
differentBaseUrl:
|
|
18
|
-
customToken:
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
|
|
19
|
+
differentBaseUrl: n,
|
|
20
|
+
customToken: o
|
|
21
|
+
}, t[0] = n, t[1] = o, t[2] = c) : c = t[2];
|
|
22
|
+
const r = _(c), {
|
|
23
|
+
isAuthenticated: a
|
|
24
|
+
} = G();
|
|
25
|
+
let u;
|
|
26
|
+
t[3] !== a || t[4] !== e ? (u = [e, a], t[3] = a, t[4] = e, t[5] = u) : u = t[5];
|
|
27
|
+
let l;
|
|
28
|
+
t[6] !== r || t[7] !== e ? (l = () => r.get(e).then(Z), t[6] = r, t[7] = e, t[8] = l) : l = t[8];
|
|
29
|
+
let S;
|
|
30
|
+
t[9] !== u || t[10] !== l ? (S = {
|
|
31
|
+
queryKey: u,
|
|
32
|
+
queryFn: l
|
|
33
|
+
}, t[9] = u, t[10] = l, t[11] = S) : S = t[11];
|
|
34
|
+
const {
|
|
35
|
+
data: d
|
|
36
|
+
} = Q(S);
|
|
37
|
+
return d;
|
|
38
|
+
}
|
|
39
|
+
function Z(e) {
|
|
40
|
+
return e.data;
|
|
24
41
|
}
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
const j = (e) => (s) => (window.addEventListener(`storage_${e}`, s), () => window.removeEventListener(`storage_${e}`, s)), it = (e, s, t) => {
|
|
43
|
+
const n = q.c(14), o = t === void 0 ? localStorage : t, [c] = U(s);
|
|
44
|
+
let r;
|
|
45
|
+
n[0] !== s ? (r = JSON.stringify(s), n[0] = s, n[1] = r) : r = n[1];
|
|
46
|
+
const a = D(r), u = D(s);
|
|
47
|
+
let l;
|
|
48
|
+
n[2] !== e || n[3] !== c || n[4] !== o ? (l = () => {
|
|
49
|
+
const g = o.getItem(e);
|
|
50
|
+
return g !== a.current && (a.current = g, u.current = a.current ? JSON.parse(a.current) : c), u.current;
|
|
51
|
+
}, n[2] = e, n[3] = c, n[4] = o, n[5] = l) : l = n[5];
|
|
52
|
+
const S = l;
|
|
53
|
+
let d;
|
|
54
|
+
n[6] !== e ? (d = j(e), n[6] = e, n[7] = d) : d = n[7];
|
|
55
|
+
const f = W(d, S);
|
|
56
|
+
let i;
|
|
57
|
+
n[8] !== e || n[9] !== o ? (i = (g) => {
|
|
58
|
+
o.setItem(e, JSON.stringify(g)), window.dispatchEvent(new Event(`storage_${e}`));
|
|
59
|
+
}, n[8] = e, n[9] = o, n[10] = i) : i = n[10];
|
|
60
|
+
const m = i;
|
|
61
|
+
let p;
|
|
62
|
+
return n[11] !== m || n[12] !== f ? (p = [f, m], n[11] = m, n[12] = f, n[13] = p) : p = n[13], p;
|
|
63
|
+
}, M = (e, s, t) => {
|
|
64
|
+
let n = "pending", o;
|
|
65
|
+
const c = e.then((r) => {
|
|
66
|
+
n = "success", o = r;
|
|
67
|
+
}, (r) => {
|
|
68
|
+
const a = r == null ? void 0 : r.response;
|
|
69
|
+
(a == null ? void 0 : a.status) === 404 && t ? (n = "error-404", o = r) : (n = "error", o = r);
|
|
40
70
|
});
|
|
41
71
|
return () => {
|
|
42
|
-
switch (
|
|
72
|
+
switch (n) {
|
|
43
73
|
case "pending":
|
|
44
|
-
throw
|
|
74
|
+
throw c;
|
|
45
75
|
case "success":
|
|
46
|
-
return
|
|
76
|
+
return o;
|
|
47
77
|
case "error":
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
throw n;
|
|
78
|
+
if (o.code === "ERR_CANCELED") return null;
|
|
79
|
+
throw o;
|
|
51
80
|
case "error-404":
|
|
52
81
|
throw new Error("404");
|
|
53
82
|
default:
|
|
54
83
|
throw new Error("Unknown status");
|
|
55
84
|
}
|
|
56
85
|
};
|
|
57
|
-
},
|
|
86
|
+
}, E = {
|
|
58
87
|
loadOnInit: !0,
|
|
59
88
|
silent: !1,
|
|
60
89
|
enabled: !0,
|
|
61
90
|
nullStateBeforeLoad: !0,
|
|
62
91
|
nullStateOnFail: !1
|
|
63
|
-
},
|
|
64
|
-
const
|
|
65
|
-
|
|
92
|
+
}, ct = (e, s) => {
|
|
93
|
+
const t = q.c(26), {
|
|
94
|
+
loadOnInit: n,
|
|
95
|
+
enabled: o,
|
|
96
|
+
silent: c,
|
|
97
|
+
nullStateBeforeLoad: r,
|
|
98
|
+
nullStateOnFail: a,
|
|
99
|
+
customApiUrl: u,
|
|
100
|
+
customBearerToken: l,
|
|
101
|
+
dataTransformer: S,
|
|
102
|
+
errorBoundaryOn404: d
|
|
103
|
+
} = s === void 0 ? E : s, w = n === void 0 ? E.loadOnInit : n, f = o === void 0 ? E.enabled : o, i = c === void 0 ? E.silent : c, m = r === void 0 ? E.nullStateBeforeLoad : r, p = a === void 0 ? E.nullStateOnFail : a;
|
|
104
|
+
let h;
|
|
105
|
+
t[0] !== d ? (h = d ? [404] : void 0, t[0] = d, t[1] = h) : h = t[1];
|
|
106
|
+
let g;
|
|
107
|
+
t[2] !== u || t[3] !== l || t[4] !== i || t[5] !== h ? (g = {
|
|
108
|
+
silent: i,
|
|
66
109
|
customToken: l,
|
|
67
|
-
differentBaseUrl:
|
|
68
|
-
noToastOnStatus:
|
|
69
|
-
}
|
|
70
|
-
|
|
110
|
+
differentBaseUrl: u,
|
|
111
|
+
noToastOnStatus: h
|
|
112
|
+
}, t[2] = u, t[3] = l, t[4] = i, t[5] = h, t[6] = g) : g = t[6];
|
|
113
|
+
const b = _(g), {
|
|
114
|
+
startLoading: y,
|
|
115
|
+
stopLoading: v
|
|
116
|
+
} = z(J), I = D(0), {
|
|
117
|
+
isAuthenticated: C
|
|
118
|
+
} = G(), [F, N] = U(null);
|
|
119
|
+
let T;
|
|
120
|
+
t[7] !== b || t[8] !== S || t[9] !== f || t[10] !== d || t[11] !== C || t[12] !== m || t[13] !== p || t[14] !== i || t[15] !== y || t[16] !== v || t[17] !== e ? (T = async ($, V) => {
|
|
121
|
+
if (!C() || f === !1)
|
|
71
122
|
return;
|
|
72
|
-
!
|
|
73
|
-
const
|
|
74
|
-
signal:
|
|
75
|
-
}).then((
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
e,
|
|
83
|
-
n,
|
|
84
|
-
d,
|
|
85
|
-
c,
|
|
86
|
-
C,
|
|
87
|
-
u,
|
|
88
|
-
a
|
|
89
|
-
]);
|
|
90
|
-
return h(() => {
|
|
91
|
-
if (t === !1)
|
|
123
|
+
!i && y(`loadData-${e}-${V}`), m && N(null);
|
|
124
|
+
const H = b.get(e, {
|
|
125
|
+
signal: $
|
|
126
|
+
}).then((K) => S ? S(K.data) : K.data).finally(() => !i && v(`loadData-${e}-${V}`));
|
|
127
|
+
N(M(H, p ?? !1, d ?? !1));
|
|
128
|
+
}, t[7] = b, t[8] = S, t[9] = f, t[10] = d, t[11] = C, t[12] = m, t[13] = p, t[14] = i, t[15] = y, t[16] = v, t[17] = e, t[18] = T) : T = t[18];
|
|
129
|
+
const O = T;
|
|
130
|
+
let x, B;
|
|
131
|
+
t[19] !== O || t[20] !== w ? (B = () => {
|
|
132
|
+
if (w === !1)
|
|
92
133
|
return;
|
|
93
|
-
const
|
|
94
|
-
return
|
|
95
|
-
|
|
134
|
+
const $ = new AbortController();
|
|
135
|
+
return O($.signal, I.current = I.current + 1), () => {
|
|
136
|
+
$.abort();
|
|
96
137
|
};
|
|
97
|
-
}, [w, t]
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
138
|
+
}, x = [O, w], t[19] = O, t[20] = w, t[21] = x, t[22] = B) : (x = t[21], B = t[22]), P(B, x);
|
|
139
|
+
let L;
|
|
140
|
+
return t[23] !== F || t[24] !== O ? (L = {
|
|
141
|
+
data: F,
|
|
142
|
+
setData: N,
|
|
143
|
+
reloadData: O
|
|
144
|
+
}, t[23] = F, t[24] = O, t[25] = L) : L = t[25], L;
|
|
145
|
+
}, dt = () => {
|
|
146
|
+
const e = D({}).current;
|
|
147
|
+
return P(() => {
|
|
148
|
+
const s = document.createElement("div");
|
|
149
|
+
return s.style.position = "absolute", s.style.pointerEvents = "none", s.style.top = "0", s.style.width = "100%", s.style.height = "100%", e.elt = s, document.body.appendChild(s), () => {
|
|
150
|
+
document.body.removeChild(s);
|
|
104
151
|
};
|
|
105
|
-
}, [e]), (
|
|
106
|
-
const
|
|
107
|
-
return
|
|
152
|
+
}, [e]), (s) => (t, ...n) => {
|
|
153
|
+
const o = s(t, ...n);
|
|
154
|
+
return t.draggableProps.style.position === "fixed" ? R(o, e.elt) : o;
|
|
108
155
|
};
|
|
109
|
-
},
|
|
156
|
+
}, A = {
|
|
110
157
|
storageKey: "--tmp-scroll-save--",
|
|
111
158
|
requiredHeight: 100,
|
|
112
159
|
retryInterval: 50
|
|
113
|
-
},
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
160
|
+
}, ft = (e, s) => {
|
|
161
|
+
const t = q.c(18), {
|
|
162
|
+
storageKey: n,
|
|
163
|
+
requiredHeight: o,
|
|
164
|
+
retryInterval: c
|
|
165
|
+
} = s === void 0 ? A : s, r = n === void 0 ? A.storageKey : n, a = o === void 0 ? A.requiredHeight : o, u = c === void 0 ? A.retryInterval : c, [l, S] = U(!1), d = D(null);
|
|
166
|
+
let w;
|
|
167
|
+
t[0] !== r ? (w = () => {
|
|
168
|
+
const v = localStorage.getItem(r);
|
|
169
|
+
return localStorage.removeItem(r), v === null ? null : Number(v);
|
|
170
|
+
}, t[0] = r, t[1] = w) : w = t[1];
|
|
171
|
+
const f = w;
|
|
172
|
+
let i;
|
|
173
|
+
t[2] !== r ? (i = (v) => {
|
|
174
|
+
localStorage.setItem(r, v);
|
|
175
|
+
}, t[2] = r, t[3] = i) : i = t[3];
|
|
176
|
+
const m = i;
|
|
177
|
+
let p, h;
|
|
178
|
+
t[4] !== l || t[5] !== a || t[6] !== f || t[7] !== u || t[8] !== e ? (p = () => {
|
|
179
|
+
const v = window.setInterval(() => {
|
|
180
|
+
if (!l && e.current !== null && e.current.getBoundingClientRect().height > a) {
|
|
181
|
+
S(!0);
|
|
182
|
+
const I = f();
|
|
183
|
+
I !== null && e.current.scrollTo({
|
|
184
|
+
top: I
|
|
185
|
+
}), window.clearInterval(v);
|
|
126
186
|
}
|
|
127
|
-
},
|
|
187
|
+
}, u);
|
|
128
188
|
return () => {
|
|
129
|
-
window.clearTimeout(
|
|
189
|
+
window.clearTimeout(v);
|
|
130
190
|
};
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
191
|
+
}, h = [l, a, f, u, e], t[4] = l, t[5] = a, t[6] = f, t[7] = u, t[8] = e, t[9] = p, t[10] = h) : (p = t[9], h = t[10]), P(p, h);
|
|
192
|
+
let g, b;
|
|
193
|
+
t[11] !== m || t[12] !== e ? (g = () => {
|
|
194
|
+
var I;
|
|
195
|
+
const v = new AbortController();
|
|
196
|
+
return (I = e.current) == null || I.addEventListener("scrollend", () => {
|
|
197
|
+
var C;
|
|
198
|
+
d.current = ((C = e.current) == null ? void 0 : C.scrollTop) ?? 0, m((d.current ?? 0).toString());
|
|
199
|
+
}, {
|
|
200
|
+
signal: v.signal
|
|
201
|
+
}), () => v.abort();
|
|
202
|
+
}, b = [m, e], t[11] = m, t[12] = e, t[13] = g, t[14] = b) : (g = t[13], b = t[14]), P(g, b);
|
|
203
|
+
let y;
|
|
204
|
+
return t[15] !== f || t[16] !== m ? (y = {
|
|
205
|
+
saveValue: m,
|
|
206
|
+
retrieveValue: f
|
|
207
|
+
}, t[15] = f, t[16] = m, t[17] = y) : y = t[17], y;
|
|
139
208
|
};
|
|
140
209
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
210
|
+
vt as cancelToken,
|
|
211
|
+
G as useAuth,
|
|
212
|
+
_ as useAxios,
|
|
213
|
+
St as useClickOutside,
|
|
214
|
+
pt as useClipboard,
|
|
215
|
+
ht as useConfirm,
|
|
216
|
+
Lt as useEmployeePhotoPath,
|
|
217
|
+
wt as useFormControlType,
|
|
218
|
+
Tt as useGetApiData,
|
|
219
|
+
ct as useGetApiDataBound,
|
|
220
|
+
ut as useGetDataBound,
|
|
221
|
+
bt as useKeyPress,
|
|
222
|
+
xt as useLocalStorageState,
|
|
223
|
+
yt as useNotifications,
|
|
224
|
+
It as usePermissions,
|
|
225
|
+
it as usePersistentState,
|
|
226
|
+
Ot as usePrompt,
|
|
227
|
+
dt as useRenderDraggableInPortal,
|
|
228
|
+
ft as useScrollSave,
|
|
229
|
+
$t as useSearchQuery,
|
|
230
|
+
At as useSearchQueryState,
|
|
231
|
+
Ct as useWindowSize,
|
|
232
|
+
Et as useZodSchemaTypes
|
|
164
233
|
};
|
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 t=require("react/jsx-runtime"),l=require("./nivo-bar-D02kyst9.cjs"),F=require("react"),ee=require("react-router");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");require("@tanstack/react-query");require("react-dom");const ie="_side-menu-item_o72rm_1",oe="_disabled_o72rm_6",ae="_hidden_o72rm_10",re="_nav-button_o72rm_13",ce="_child_o72rm_21",de="_text_o72rm_26",me="_icon_o72rm_36",ue="_collapse-icon_o72rm_42",pe="_collapsed_o72rm_52",he="_collapse-icon-mini_o72rm_55",_e="_expanded_o72rm_86",fe="_children-container_o72rm_92",xe="_visible_o72rm_100",be="_children_o72rm_92",ve="_mobile_o72rm_112",d={sideMenuItem:ie,disabled:oe,hidden:ae,navButton:re,child:ce,text:de,icon:me,collapseIcon:ue,collapsed:pe,collapseIconMini:he,expanded:_e,childrenContainer:fe,visible:xe,children:be,mobile:ve},Ne=o=>{const e=l.compilerRuntimeExports.c(6),{item:u,menuExpanded:f,useTooltips:v,children:y}=o;if(u.tooltip&&!f&&v){let M;e[0]===Symbol.for("react.memo_cache_sentinel")?(M={show:1e3,hide:0},e[0]=M):M=e[0];let s;e[1]!==y?(s=t.jsx("div",{children:y}),e[1]=y,e[2]=s):s=e[2];let r;return e[3]!==u.tooltip||e[4]!==s?(r=t.jsx(l.SimpleTooltip,{text:u.tooltip,placement:"top",delay:M,children:s}),e[3]=u.tooltip,e[4]=s,e[5]=r):r=e[5],r}return y},te=({item:o,menuExpanded:e,collapsed:u,onCollapse:f,currentPath:v,useHover:y,useTooltips:M,isMobile:s,disableMode:r})=>{var m,N,p,b;const[x,n]=F.useState(!1),[h]=v.split("?"),g=o.linkTo===h||((m=o.children)==null?void 0:m.some(i=>i.linkTo===h)),c=F.useRef(null);return l.useClickOutside([c],()=>u&&f()),t.jsxs("li",{ref:c,className:l.classNames("luminus-side-menu-item",d.sideMenuItem,{[d.mobile]:s},{[d.expanded]:e},{active:x||g},{open:u&&o.children},{[r==="disable"?d.disabled:d.hidden]:o.disabled||o.notPermitted||((N=o.children)==null?void 0:N.every(i=>i.notPermitted||i.disabled))},{[r==="disable"?"disabled":"hidden"]:o.disabled||o.notPermitted||((p=o.children)==null?void 0:p.every(i=>i.notPermitted||i.disabled))}),onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),children:[t.jsx(Ne,{item:o,menuExpanded:e,useTooltips:M,children:o.children?t.jsx(t.Fragment,{children:t.jsxs("button",{type:"button",className:l.classNames("nav-link",d.navButton),onClick:()=>{f()},children:[t.jsx("div",{className:l.classNames("icon",d.icon),children:o.icon}),!y&&!e&&t.jsx("div",{className:l.classNames("collapse-icon-mini rounded",d.collapseIconMini,{[d.collapsed]:u}),children:t.jsx(l.MdOutlineKeyboardArrowRight,{})}),e&&t.jsx("div",{className:l.classNames("text",d.text,"text-nowrap"),children:o.title}),e&&t.jsx("div",{className:l.classNames("collapse-icon",d.collapseIcon,{[d.collapsed]:u}),children:t.jsx(l.MdOutlineKeyboardArrowRight,{})})]})}):t.jsxs(ee.Link,{to:o.disabled||o.notPermitted?"/":o.linkTo??"/",className:l.classNames("nav-link",d.navButton),children:[t.jsx("div",{className:l.classNames("icon",d.icon),children:o.icon}),e&&t.jsx("div",{className:l.classNames("text",d.text,"text-nowrap"),children:o.title})]})}),t.jsx("div",{className:l.classNames("children-container",d.childrenContainer,{[d.visible]:u}),children:t.jsx("div",{className:l.classNames("shadow rounded children",d.children),children:(b=o.children)==null?void 0:b.map(i=>t.jsx(ee.Link,{to:i.disabled||i.notPermitted?"/":i.linkTo??"/",className:l.classNames("nav-link child rounded",d.navButton,d.child,{[r==="disable"?d.disabled:d.hidden]:i.disabled||i.notPermitted},{[r==="disable"?"disabled":"hidden"]:i.disabled||i.notPermitted}),onClick:f,children:t.jsx("div",{className:l.classNames("text",d.text,"text-nowrap"),children:i.title})},i.linkTo))})})]})},je="_side-menu_12rky_1",ye="_sidebar-header_12rky_15",Me="_side-menu-content_12rky_22",ge="_no-top-margin_12rky_28",ke="_expand_12rky_34",Ie="_only-logo_12rky_38",Ce="_mobile_12rky_41",Pe="_divider_12rky_56",P={sideMenu:je,sidebarHeader:ye,sideMenuContent:Me,noTopMargin:ge,expand:ke,onlyLogo:Ie,mobile:Ce,divider:Pe},Be=14,Se=o=>{const e=l.compilerRuntimeExports.c(100),{headerItem:u,searchItem:f,shortcutsItem:v,mainItems:y,secondaryItems:M,expanded:s,setExpanded:r,currentPath:x,useHover:n,useTooltips:h,disableMode:g}=o,c=g===void 0?"disable":g,[m,N]=F.useState(-1),{checkUserHasPermissions:p}=l.usePermissions();let b;if(e[0]!==p||e[1]!==y){let a;e[3]!==p?(a=_=>{var k;return{..._,notPermitted:!p(_.permissions??[],"any"),children:(k=_.children)==null?void 0:k.map(D=>({...D,notPermitted:!p(D.permissions??[],"any"),disabled:_.disabled||D.disabled}))}},e[3]=p,e[4]=a):a=e[4],b=y.map(a),e[0]=p,e[1]=y,e[2]=b}else b=e[2];const i=b;let C;if(e[5]!==p||e[6]!==M){let a;e[8]!==p?(a=_=>{var k;return{..._,notPermitted:!p(_.permissions??[],"any"),children:(k=_.children)==null?void 0:k.map(D=>({...D,notPermitted:!p(D.permissions??[],"any")}))}},e[8]=p,e[9]=a):a=e[9],C=M.map(a),e[5]=p,e[6]=M,e[7]=C}else C=e[7];const B=C;let z;e[10]!==m?(z=a=>{N(a===m?-1:a)},e[10]=m,e[11]=z):z=e[11];const I=z;let G,U;e[12]!==s?(G=()=>{s||N(-1)},U=[s],e[12]=s,e[13]=G,e[14]=U):(G=e[13],U=e[14]),F.useEffect(G,U);const se=F.useRef(null);let W;e[15]===Symbol.for("react.memo_cache_sentinel")?(W=[se],e[15]=W):W=e[15];let J;e[16]!==r?(J=()=>r(!1),e[16]=r,e[17]=J):J=e[17],l.useClickOutside(W,J);let Q;e[18]!==c||e[19]!==i||e[20]!==B?(Q=[...i,...B].filter(a=>{var _;return c==="hide"?!a.disabled&&!a.notPermitted&&(((_=a.children)==null?void 0:_.filter(Te))??[]).length>0:!0}),e[18]=c,e[19]=i,e[20]=B,e[21]=Q):Q=e[21];const le=Q,{isMobile:j}=l.useWindowSize();let S;e[22]!==s||e[23]!==j?(S=l.classNames("luminus-side-menu shadow",P.sideMenu,{[P.mobile]:j},{[P.expand]:s},{expand:s}),e[22]=s,e[23]=j,e[24]=S):S=e[24];let T,R;e[25]!==r||e[26]!==n?(T=()=>n&&r(!0),R=()=>n&&r(!1),e[25]=r,e[26]=n,e[27]=T,e[28]=R):(T=e[27],R=e[28]);let w;e[29]!==n?(w=l.classNames("sidebar-header",P.sidebarHeader,{[P.onlyLogo]:n}),e[29]=n,e[30]=w):w=e[30];const Y=n?void 0:"button";let q;e[31]!==s||e[32]!==r||e[33]!==n?(q=n?void 0:()=>r(!s),e[31]=s,e[32]=r,e[33]=n,e[34]=q):q=e[34];let O;e[35]!==s||e[36]!==u||e[37]!==n?(O=n?u:s?t.jsxs(t.Fragment,{children:[t.jsx(l.MdOutlineKeyboardDoubleArrowLeft,{}),u]}):t.jsx(l.MdOutlineMenu,{}),e[35]=s,e[36]=u,e[37]=n,e[38]=O):O=e[38];let L;e[39]!==w||e[40]!==Y||e[41]!==q||e[42]!==O?(L=t.jsx("div",{className:w,role:Y,onClick:q,children:O}),e[39]=w,e[40]=Y,e[41]=q,e[42]=O,e[43]=L):L=e[43];let H;e[44]!==s||e[45]!==f||e[46]!==v?(H=s&&(f||v)?t.jsxs("div",{className:"mb-3 d-flex flex-column gap-3",children:[v&&s?v:null,f&&s?f:null]}):null,e[44]=s,e[45]=f,e[46]=v,e[47]=H):H=e[47];const Z=le.length>Be;let E;e[48]!==Z?(E=l.classNames(P.sideMenuContent,{[P.noTopMargin]:Z}),e[48]=Z,e[49]=E):E=e[49];let $;if(e[50]!==m||e[51]!==x||e[52]!==c||e[53]!==s||e[54]!==j||e[55]!==i||e[56]!==I||e[57]!==n||e[58]!==h){let a;e[60]!==m||e[61]!==x||e[62]!==c||e[63]!==s||e[64]!==j||e[65]!==I||e[66]!==n||e[67]!==h?(a=(_,k)=>t.jsx(te,{item:_,menuExpanded:s,collapsed:k===m,onCollapse:()=>I(k),currentPath:x,useHover:n,useTooltips:h,isMobile:j,disableMode:c},_.title),e[60]=m,e[61]=x,e[62]=c,e[63]=s,e[64]=j,e[65]=I,e[66]=n,e[67]=h,e[68]=a):a=e[68],$=i.map(a),e[50]=m,e[51]=x,e[52]=c,e[53]=s,e[54]=j,e[55]=i,e[56]=I,e[57]=n,e[58]=h,e[59]=$}else $=e[59];let V;e[69]===Symbol.for("react.memo_cache_sentinel")?(V=t.jsx("hr",{className:l.classNames("divider",P.divider)}),e[69]=V):V=e[69];let A;if(e[70]!==m||e[71]!==x||e[72]!==c||e[73]!==s||e[74]!==j||e[75]!==I||e[76]!==B||e[77]!==n||e[78]!==h){let a;e[80]!==m||e[81]!==x||e[82]!==c||e[83]!==s||e[84]!==j||e[85]!==I||e[86]!==n||e[87]!==h?(a=(_,k)=>t.jsx(te,{item:_,menuExpanded:s,collapsed:k===m,onCollapse:()=>I(k),currentPath:x,useHover:n,useTooltips:h,isMobile:j,disableMode:c},_.title),e[80]=m,e[81]=x,e[82]=c,e[83]=s,e[84]=j,e[85]=I,e[86]=n,e[87]=h,e[88]=a):a=e[88],A=B.map(a),e[70]=m,e[71]=x,e[72]=c,e[73]=s,e[74]=j,e[75]=I,e[76]=B,e[77]=n,e[78]=h,e[79]=A}else A=e[79];let K;e[89]!==E||e[90]!==$||e[91]!==A?(K=t.jsxs("ul",{className:E,children:[$,V,A]}),e[89]=E,e[90]=$,e[91]=A,e[92]=K):K=e[92];let X;return e[93]!==S||e[94]!==T||e[95]!==R||e[96]!==L||e[97]!==H||e[98]!==K?(X=t.jsxs("section",{ref:se,className:S,onMouseEnter:T,onMouseLeave:R,children:[L,H,K]}),e[93]=S,e[94]=T,e[95]=R,e[96]=L,e[97]=H,e[98]=K,e[99]=X):X=e[99],X};function Te(o){return!o.disabled&&!o.notPermitted}const Re="_top-bar_lnmq0_1",we="_top-bar-brand_lnmq0_12",ne={topBar:Re,topBarBrand:we},qe=o=>{const e=l.compilerRuntimeExports.c(21),{appName:u,leftOffset:f,leftContent:v,centerContent:y,rightContent:M}=o;let s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=l.classNames("luminus-top-bar shadow",ne.topBar),e[0]=s):s=e[0];const r=f?`calc(100% - ${f}px)`:void 0,x=f?`${f}px`:void 0;let n;e[1]!==r||e[2]!==x?(n={width:r,left:x},e[1]=r,e[2]=x,e[3]=n):n=e[3];let h;e[4]===Symbol.for("react.memo_cache_sentinel")?(h=l.classNames("luminus-top-bar-brand",ne.topBarBrand),e[4]=h):h=e[4];let g;e[5]!==u?(g=t.jsx(ee.Link,{to:"/",className:h,children:u}),e[5]=u,e[6]=g):g=e[6];let c;e[7]!==v||e[8]!==g?(c=t.jsxs("div",{className:"col-4 d-flex gap-3 align-items-center",children:[g,v]}),e[7]=v,e[8]=g,e[9]=c):c=e[9];const m=y??null;let N;e[10]!==m?(N=t.jsx("div",{className:"col-4 d-flex align-items-center",children:m}),e[10]=m,e[11]=N):N=e[11];const p=M??null;let b;e[12]!==p?(b=t.jsx("div",{className:"col-4 d-flex justify-content-end align-items-center",children:p}),e[12]=p,e[13]=b):b=e[13];let i;e[14]!==b||e[15]!==c||e[16]!==N?(i=t.jsxs("div",{className:"w-100 row g-0",children:[c,N,b]}),e[14]=b,e[15]=c,e[16]=N,e[17]=i):i=e[17];let C;return e[18]!==i||e[19]!==n?(C=t.jsx("nav",{className:s,style:n,children:i}),e[18]=i,e[19]=n,e[20]=C):C=e[20],C};exports.PageContainer=l.PageContainer;exports.SideContentBar=l.SideContentBar;exports.SideMenu=Se;exports.TopBar=qe;
|