react-luminus-components 2.1.9 → 2.1.11
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/hooks/index.d.ts +1 -0
- package/dist/hooks/useGetDataBound/useGetDataBoundExtended.d.ts +9 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +217 -175
- package/dist/main.cjs.js +10 -10
- package/dist/main.es.js +5145 -5146
- package/dist/models/texts/ApprovalTexts.d.ts +0 -1
- package/dist/models/texts/SubstitutionsTexts.d.ts +1 -0
- package/package.json +1 -1
package/dist/hooks/index.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export { default as usePersistentState } from './usePersistentState/usePersisten
|
|
|
17
17
|
export { default as useEmployeePhotoPath } from './useEmployeePhotoPath/useEmployeePhotoPath';
|
|
18
18
|
export { default as useClipboard } from './useClipboard/useClipboard';
|
|
19
19
|
export { default as useGetApiDataBound } from './useGetApiDataBound/useGetApiDataBound';
|
|
20
|
+
export { default as useGetDataBoundExtended } from './useGetDataBound/useGetDataBoundExtended';
|
|
20
21
|
export { default as useWindowSize } from './useWindowSize/useWindowSize';
|
|
21
22
|
export { default as useRenderDraggableInPortal } from './useRenderDraggableInPortal/useRenderDraggableInPortal';
|
|
22
23
|
export { default as useScrollSave } from './useScrollSave/useScrollSave';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type UseGetDataBoundExtendedOptions = {
|
|
2
|
+
customBaseUrl?: string;
|
|
3
|
+
customToken?: string;
|
|
4
|
+
};
|
|
5
|
+
declare function useGetDataBoundExtended<T>(url: string, options?: UseGetDataBoundExtendedOptions): {
|
|
6
|
+
data: T;
|
|
7
|
+
reloadData: () => void;
|
|
8
|
+
};
|
|
9
|
+
export default useGetDataBoundExtended;
|
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 h=require("./DelegationContext-B1WXROG2.cjs"),x=require("./useIsFormDirty-76y8Dca-.cjs"),U=require("./useWindowSize-CLoDaEYh.cjs"),l=require("react"),K=require("./index-jmbq5h95.cjs"),Q=require("react-dom"),W=require("./useIsBrowserOnline-CREGrf2l.cjs"),B=new Map;function _(t,n){const e=h.useAxios({silent:!0,differentBaseUrl:n==null?void 0:n.customBaseUrl,customToken:n==null?void 0:n.customToken}),s=l.useRef(null);if(!B.has(t)){const u=e.get(t).then(o=>(B.set(t,{status:"success",data:o.data}),s.current=setTimeout(()=>{B.delete(t),s.current=null},1e4),o.data)).catch(o=>{throw B.set(t,{status:"error",error:o}),s.current=setTimeout(()=>{B.delete(t),s.current=null},1e3),o});throw B.set(t,{status:"pending",promise:u}),u}const r=B.get(t);if(r.status==="pending")throw r.promise;if(r.status==="error")throw r.error;return r.data}const z=t=>n=>(window.addEventListener(`storage_${t}`,n),()=>window.removeEventListener(`storage_${t}`,n)),J=(t,n,e)=>{const s=K.compilerRuntimeExports.c(15),r=e===void 0?localStorage:e,[u]=l.useState(n);let o;s[0]!==n?(o=JSON.stringify(n),s[0]=n,s[1]=o):o=s[1];const a=l.useRef(o),p=l.useRef(n);let S;s[2]!==t||s[3]!==u||s[4]!==r?(S=()=>{const i=r.getItem(t);return i!==a.current&&(a.current=i,p.current=a.current?JSON.parse(a.current):u),p.current},s[2]=t,s[3]=u,s[4]=r,s[5]=S):S=s[5];const y=S;let m;s[6]!==t?(m=z(t),s[6]=t,s[7]=m):m=s[7];const T=m,d=l.useSyncExternalStore(T,y);let c;s[8]!==y||s[9]!==t||s[10]!==r?(c=i=>{const D=typeof i=="function"?i(y()):i;r.setItem(t,JSON.stringify(D)),window.dispatchEvent(new Event(`storage_${t}`))},s[8]=y,s[9]=t,s[10]=r,s[11]=c):c=s[11];const f=c;let w;return s[12]!==f||s[13]!==d?(w=[d,f],s[12]=f,s[13]=d,s[14]=w):w=s[14],w},k=(t,n,e)=>{let s="pending",r;const u=t.then(o=>{s="success",r=o},o=>{const a=o==null?void 0:o.response;(a==null?void 0:a.status)===404&&e?(s="error-404",r=o):(s="error",r=o)});return()=>{switch(s){case"pending":throw u;case"success":return r;case"error":if(r.code==="ERR_CANCELED")return null;throw r;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},P={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},Z=(t,n)=>{const e=K.compilerRuntimeExports.c(26),{loadOnInit:s,enabled:r,silent:u,nullStateBeforeLoad:o,nullStateOnFail:a,customApiUrl:p,customBearerToken:S,dataTransformer:y,errorBoundaryOn404:m}=n===void 0?P:n,T=s===void 0?P.loadOnInit:s,d=r===void 0?P.enabled:r,c=u===void 0?P.silent:u,f=o===void 0?P.nullStateBeforeLoad:o,w=a===void 0?P.nullStateOnFail:a;let v;e[0]!==m?(v=m?[404]:void 0,e[0]=m,e[1]=v):v=e[1];let i;e[2]!==p||e[3]!==S||e[4]!==c||e[5]!==v?(i={silent:c,customToken:S,differentBaseUrl:p,noToastOnStatus:v},e[2]=p,e[3]=S,e[4]=c,e[5]=v,e[6]=i):i=e[6];const D=h.useAxios(i),{startLoading:I,stopLoading:g}=l.useContext(h.LoadingContext),E=l.useRef(0),{isAuthenticated:b}=h.useAuth(),[G,N]=l.useState(null);let A;e[7]!==D||e[8]!==y||e[9]!==d||e[10]!==m||e[11]!==b||e[12]!==f||e[13]!==w||e[14]!==c||e[15]!==I||e[16]!==g||e[17]!==t?(A=async(R,V)=>{if(!b()||d===!1)return;!c&&I(`loadData-${t}-${V}`),f&&N(null);const M=D.get(t,{signal:R}).then(H=>y?y(H.data):H.data).finally(()=>!c&&g(`loadData-${t}-${V}`));N(k(M,w??!1,m??!1))},e[7]=D,e[8]=y,e[9]=d,e[10]=m,e[11]=b,e[12]=f,e[13]=w,e[14]=c,e[15]=I,e[16]=g,e[17]=t,e[18]=A):A=e[18];const C=A;let L,$;e[19]!==C||e[20]!==T?($=()=>{if(T===!1)return;const R=new AbortController;return C(R.signal,E.current=E.current+1),()=>{R.abort()}},L=[C,T],e[19]=C,e[20]=T,e[21]=L,e[22]=$):(L=e[21],$=e[22]),l.useEffect($,L);let q;return e[23]!==G||e[24]!==C?(q={data:G,setData:N,reloadData:C},e[23]=G,e[24]=C,e[25]=q):q=e[25],q},O=new Map;function j(t,n){const e=h.useAxios({silent:!0,differentBaseUrl:n==null?void 0:n.customBaseUrl,customToken:n==null?void 0:n.customToken}),s=l.useRef(null),r=l.useCallback(()=>e.get(t).then(a=>(O.set(t,{status:"success",data:a.data}),s.current=window.setTimeout(()=>{O.delete(t),s.current=null},1e3*10),a.data)).catch(a=>{throw O.set(t,{status:"error",error:a}),s.current=window.setTimeout(()=>{O.delete(t),s.current=null},1e3*1),a}),[e,t]);if(!O.has(t)){const a=r();throw O.set(t,{status:"pending",promise:a}),a}const u=O.get(t);if(u.status==="pending")throw u.promise;if(u.status==="error")throw u.error;const o=l.useCallback(()=>{l.startTransition(()=>{O.delete(t),s.current!==null&&(window.clearTimeout(s.current),s.current=null),r()})},[r,t]);return{data:u.data,reloadData:o}}const X=()=>{const t=l.useRef({}).current;return l.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 r=n(e,...s);return e.draggableProps.style.position==="fixed"?Q.createPortal(r,t.elt):r}},F={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},Y=(t,n)=>{const e=K.compilerRuntimeExports.c(18),{storageKey:s,requiredHeight:r,retryInterval:u}=n===void 0?F:n,o=s===void 0?F.storageKey:s,a=r===void 0?F.requiredHeight:r,p=u===void 0?F.retryInterval:u,[S,y]=l.useState(!1),m=l.useRef(null);let T;e[0]!==o?(T=()=>{const g=localStorage.getItem(o);return localStorage.removeItem(o),g===null?null:Number(g)},e[0]=o,e[1]=T):T=e[1];const d=T;let c;e[2]!==o?(c=g=>{localStorage.setItem(o,g)},e[2]=o,e[3]=c):c=e[3];const f=c;let w,v;e[4]!==S||e[5]!==a||e[6]!==d||e[7]!==p||e[8]!==t?(w=()=>{const g=window.setInterval(()=>{if(!S&&t.current!==null&&t.current.getBoundingClientRect().height>a){y(!0);const E=d();E!==null&&t.current.scrollTo({top:E}),window.clearInterval(g)}},p);return()=>{window.clearTimeout(g)}},v=[S,a,d,p,t],e[4]=S,e[5]=a,e[6]=d,e[7]=p,e[8]=t,e[9]=w,e[10]=v):(w=e[9],v=e[10]),l.useEffect(w,v);let i,D;e[11]!==f||e[12]!==t?(i=()=>{var E;const g=new AbortController;return(E=t.current)==null||E.addEventListener("scrollend",()=>{var b;m.current=((b=t.current)==null?void 0:b.scrollTop)??0,f((m.current??0).toString())},{signal:g.signal}),()=>g.abort()},D=[f,t],e[11]=f,e[12]=t,e[13]=i,e[14]=D):(i=e[13],D=e[14]),l.useEffect(i,D);let I;return e[15]!==d||e[16]!==f?(I={saveValue:f,retrieveValue:d},e[15]=d,e[16]=f,e[17]=I):I=e[17],I};exports.cancelToken=h.cancelToken;exports.useAuth=h.useAuth;exports.useAxios=h.useAxios;exports.useConfirm=h.useConfirm;exports.useGetApiData=h.useGetApiData;exports.useKeyPress=h.useKeyPress;exports.useLocalStorageState=h.useLocalStorageState;exports.useNotifications=h.useNotifications;exports.usePrompt=h.usePrompt;exports.useClipboard=x.useClipboard;exports.useEmployeePhotoPath=x.useEmployeePhotoPath;exports.useFormControlType=x.useFormControlType;exports.useIsFormDirty=x.useIsFormDirty;exports.useSearchQuery=x.useSearchQuery;exports.useSearchQueryState=x.useSearchQueryState;exports.useZodSchemaTypes=x.useZodSchemaTypes;exports.useClickOutside=U.useClickOutside;exports.usePermissions=U.usePermissions;exports.useWindowSize=U.useWindowSize;exports.useIsBrowserOnline=W.useIsBrowserOnline;exports.useGetApiDataBound=Z;exports.useGetDataBound=_;exports.useGetDataBoundExtended=j;exports.usePersistentState=J;exports.useRenderDraggableInPortal=X;exports.useScrollSave=Y;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
import { u as
|
|
2
|
-
import { l as
|
|
3
|
-
import { c as
|
|
4
|
-
import { b as
|
|
5
|
-
import { useRef as
|
|
6
|
-
import { c as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import { u as
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
const t =
|
|
1
|
+
import { u as V, L as Q, i as W } from "./DelegationContext-CCnk58PI.js";
|
|
2
|
+
import { l as ft, d as mt, b as gt, h as ht, g as wt, e as vt, c as St } from "./DelegationContext-CCnk58PI.js";
|
|
3
|
+
import { c as Tt, f as yt, u as It, a as bt, d as Ot, e as Dt, b as Bt } from "./useIsFormDirty-Ba5uhPH7.js";
|
|
4
|
+
import { b as Et, a as xt, u as Lt } from "./useWindowSize-7W91GsJQ.js";
|
|
5
|
+
import { useRef as B, useState as q, useSyncExternalStore as z, useContext as Z, useEffect as N, useCallback as J, startTransition as j } from "react";
|
|
6
|
+
import { c as G } from "./index-4IYT9u10.js";
|
|
7
|
+
import { createPortal as R } from "react-dom";
|
|
8
|
+
import { u as Pt } from "./useIsBrowserOnline-RAirIO4c.js";
|
|
9
|
+
const D = /* @__PURE__ */ new Map();
|
|
10
|
+
function rt(e, n) {
|
|
11
|
+
const t = V({
|
|
12
12
|
silent: !0,
|
|
13
13
|
differentBaseUrl: n == null ? void 0 : n.customBaseUrl,
|
|
14
14
|
customToken: n == null ? void 0 : n.customToken
|
|
15
|
-
}),
|
|
16
|
-
if (!
|
|
17
|
-
const
|
|
15
|
+
}), s = B(null);
|
|
16
|
+
if (!D.has(e)) {
|
|
17
|
+
const u = t.get(e).then((a) => (D.set(e, {
|
|
18
18
|
status: "success",
|
|
19
|
-
data:
|
|
20
|
-
}),
|
|
21
|
-
|
|
22
|
-
}, 1e4),
|
|
23
|
-
throw
|
|
19
|
+
data: a.data
|
|
20
|
+
}), s.current = setTimeout(() => {
|
|
21
|
+
D.delete(e), s.current = null;
|
|
22
|
+
}, 1e4), a.data)).catch((a) => {
|
|
23
|
+
throw D.set(e, {
|
|
24
24
|
status: "error",
|
|
25
|
-
error:
|
|
26
|
-
}),
|
|
27
|
-
|
|
28
|
-
}, 1e3),
|
|
25
|
+
error: a
|
|
26
|
+
}), s.current = setTimeout(() => {
|
|
27
|
+
D.delete(e), s.current = null;
|
|
28
|
+
}, 1e3), a;
|
|
29
29
|
});
|
|
30
|
-
throw
|
|
30
|
+
throw D.set(e, {
|
|
31
31
|
status: "pending",
|
|
32
|
-
promise:
|
|
33
|
-
}),
|
|
32
|
+
promise: u
|
|
33
|
+
}), u;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
if (
|
|
37
|
-
throw
|
|
38
|
-
if (
|
|
39
|
-
throw
|
|
40
|
-
return
|
|
35
|
+
const r = D.get(e);
|
|
36
|
+
if (r.status === "pending")
|
|
37
|
+
throw r.promise;
|
|
38
|
+
if (r.status === "error")
|
|
39
|
+
throw r.error;
|
|
40
|
+
return r.data;
|
|
41
41
|
}
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
const
|
|
42
|
+
const X = (e) => (n) => (window.addEventListener(`storage_${e}`, n), () => window.removeEventListener(`storage_${e}`, n)), at = (e, n, t) => {
|
|
43
|
+
const s = G.c(15), r = t === void 0 ? localStorage : t, [u] = q(n);
|
|
44
|
+
let a;
|
|
45
|
+
s[0] !== n ? (a = JSON.stringify(n), s[0] = n, s[1] = a) : a = s[1];
|
|
46
|
+
const o = B(a), v = B(n);
|
|
47
47
|
let g;
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
},
|
|
52
|
-
const
|
|
48
|
+
s[2] !== e || s[3] !== u || s[4] !== r ? (g = () => {
|
|
49
|
+
const c = r.getItem(e);
|
|
50
|
+
return c !== o.current && (o.current = c, v.current = o.current ? JSON.parse(o.current) : u), v.current;
|
|
51
|
+
}, s[2] = e, s[3] = u, s[4] = r, s[5] = g) : g = s[5];
|
|
52
|
+
const S = g;
|
|
53
53
|
let f;
|
|
54
|
-
|
|
55
|
-
const i =
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
},
|
|
61
|
-
const
|
|
62
|
-
let
|
|
63
|
-
return
|
|
64
|
-
},
|
|
65
|
-
let
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
}, (
|
|
69
|
-
const
|
|
70
|
-
(
|
|
54
|
+
s[6] !== e ? (f = X(e), s[6] = e, s[7] = f) : f = s[7];
|
|
55
|
+
const i = z(f, S);
|
|
56
|
+
let l;
|
|
57
|
+
s[8] !== S || s[9] !== e || s[10] !== r ? (l = (c) => {
|
|
58
|
+
const T = typeof c == "function" ? c(S()) : c;
|
|
59
|
+
r.setItem(e, JSON.stringify(T)), window.dispatchEvent(new Event(`storage_${e}`));
|
|
60
|
+
}, s[8] = S, s[9] = e, s[10] = r, s[11] = l) : l = s[11];
|
|
61
|
+
const d = l;
|
|
62
|
+
let h;
|
|
63
|
+
return s[12] !== d || s[13] !== i ? (h = [i, d], s[12] = d, s[13] = i, s[14] = h) : h = s[14], h;
|
|
64
|
+
}, Y = (e, n, t) => {
|
|
65
|
+
let s = "pending", r;
|
|
66
|
+
const u = e.then((a) => {
|
|
67
|
+
s = "success", r = a;
|
|
68
|
+
}, (a) => {
|
|
69
|
+
const o = a == null ? void 0 : a.response;
|
|
70
|
+
(o == null ? void 0 : o.status) === 404 && t ? (s = "error-404", r = a) : (s = "error", r = a);
|
|
71
71
|
});
|
|
72
72
|
return () => {
|
|
73
|
-
switch (
|
|
73
|
+
switch (s) {
|
|
74
74
|
case "pending":
|
|
75
|
-
throw
|
|
75
|
+
throw u;
|
|
76
76
|
case "success":
|
|
77
|
-
return
|
|
77
|
+
return r;
|
|
78
78
|
case "error":
|
|
79
|
-
if (
|
|
80
|
-
throw
|
|
79
|
+
if (r.code === "ERR_CANCELED") return null;
|
|
80
|
+
throw r;
|
|
81
81
|
case "error-404":
|
|
82
82
|
throw new Error("404");
|
|
83
83
|
default:
|
|
@@ -90,147 +90,189 @@ const Z = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => windo
|
|
|
90
90
|
enabled: !0,
|
|
91
91
|
nullStateBeforeLoad: !0,
|
|
92
92
|
nullStateOnFail: !1
|
|
93
|
-
},
|
|
94
|
-
const t =
|
|
95
|
-
loadOnInit:
|
|
96
|
-
enabled:
|
|
97
|
-
silent:
|
|
98
|
-
nullStateBeforeLoad:
|
|
99
|
-
nullStateOnFail:
|
|
100
|
-
customApiUrl:
|
|
93
|
+
}, ot = (e, n) => {
|
|
94
|
+
const t = G.c(26), {
|
|
95
|
+
loadOnInit: s,
|
|
96
|
+
enabled: r,
|
|
97
|
+
silent: u,
|
|
98
|
+
nullStateBeforeLoad: a,
|
|
99
|
+
nullStateOnFail: o,
|
|
100
|
+
customApiUrl: v,
|
|
101
101
|
customBearerToken: g,
|
|
102
|
-
dataTransformer:
|
|
102
|
+
dataTransformer: S,
|
|
103
103
|
errorBoundaryOn404: f
|
|
104
|
-
} = n === void 0 ? E : n,
|
|
105
|
-
let
|
|
106
|
-
t[0] !== f ? (
|
|
107
|
-
let
|
|
108
|
-
t[2] !==
|
|
109
|
-
silent:
|
|
104
|
+
} = n === void 0 ? E : n, p = s === void 0 ? E.loadOnInit : s, i = r === void 0 ? E.enabled : r, l = u === void 0 ? E.silent : u, d = a === void 0 ? E.nullStateBeforeLoad : a, h = o === void 0 ? E.nullStateOnFail : o;
|
|
105
|
+
let w;
|
|
106
|
+
t[0] !== f ? (w = f ? [404] : void 0, t[0] = f, t[1] = w) : w = t[1];
|
|
107
|
+
let c;
|
|
108
|
+
t[2] !== v || t[3] !== g || t[4] !== l || t[5] !== w ? (c = {
|
|
109
|
+
silent: l,
|
|
110
110
|
customToken: g,
|
|
111
|
-
differentBaseUrl:
|
|
112
|
-
noToastOnStatus:
|
|
113
|
-
}, t[2] =
|
|
114
|
-
const
|
|
115
|
-
startLoading:
|
|
111
|
+
differentBaseUrl: v,
|
|
112
|
+
noToastOnStatus: w
|
|
113
|
+
}, t[2] = v, t[3] = g, t[4] = l, t[5] = w, t[6] = c) : c = t[6];
|
|
114
|
+
const T = V(c), {
|
|
115
|
+
startLoading: y,
|
|
116
116
|
stopLoading: m
|
|
117
|
-
} =
|
|
117
|
+
} = Z(Q), I = B(0), {
|
|
118
118
|
isAuthenticated: C
|
|
119
|
-
} =
|
|
119
|
+
} = W(), [U, K] = q(null);
|
|
120
120
|
let x;
|
|
121
|
-
t[7] !==
|
|
121
|
+
t[7] !== T || t[8] !== S || t[9] !== i || t[10] !== f || t[11] !== C || t[12] !== d || t[13] !== h || t[14] !== l || t[15] !== y || t[16] !== m || t[17] !== e ? (x = async (A, H) => {
|
|
122
122
|
if (!C() || i === !1)
|
|
123
123
|
return;
|
|
124
|
-
!
|
|
125
|
-
const
|
|
126
|
-
signal:
|
|
127
|
-
}).then((
|
|
128
|
-
K(
|
|
129
|
-
}, t[7] =
|
|
130
|
-
const
|
|
131
|
-
let
|
|
132
|
-
t[19] !==
|
|
133
|
-
if (
|
|
124
|
+
!l && y(`loadData-${e}-${H}`), d && K(null);
|
|
125
|
+
const M = T.get(e, {
|
|
126
|
+
signal: A
|
|
127
|
+
}).then((_) => S ? S(_.data) : _.data).finally(() => !l && m(`loadData-${e}-${H}`));
|
|
128
|
+
K(Y(M, h ?? !1, f ?? !1));
|
|
129
|
+
}, t[7] = T, t[8] = S, t[9] = i, t[10] = f, t[11] = C, t[12] = d, t[13] = h, t[14] = l, t[15] = y, t[16] = m, t[17] = e, t[18] = x) : x = t[18];
|
|
130
|
+
const O = x;
|
|
131
|
+
let L, $;
|
|
132
|
+
t[19] !== O || t[20] !== p ? ($ = () => {
|
|
133
|
+
if (p === !1)
|
|
134
134
|
return;
|
|
135
|
-
const
|
|
136
|
-
return
|
|
137
|
-
|
|
135
|
+
const A = new AbortController();
|
|
136
|
+
return O(A.signal, I.current = I.current + 1), () => {
|
|
137
|
+
A.abort();
|
|
138
138
|
};
|
|
139
|
-
},
|
|
140
|
-
let
|
|
141
|
-
return t[23] !==
|
|
142
|
-
data:
|
|
139
|
+
}, L = [O, p], t[19] = O, t[20] = p, t[21] = L, t[22] = $) : (L = t[21], $ = t[22]), N($, L);
|
|
140
|
+
let P;
|
|
141
|
+
return t[23] !== U || t[24] !== O ? (P = {
|
|
142
|
+
data: U,
|
|
143
143
|
setData: K,
|
|
144
|
-
reloadData:
|
|
145
|
-
}, t[23] =
|
|
146
|
-
},
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
reloadData: O
|
|
145
|
+
}, t[23] = U, t[24] = O, t[25] = P) : P = t[25], P;
|
|
146
|
+
}, b = /* @__PURE__ */ new Map();
|
|
147
|
+
function ut(e, n) {
|
|
148
|
+
const t = V({
|
|
149
|
+
silent: !0,
|
|
150
|
+
differentBaseUrl: n == null ? void 0 : n.customBaseUrl,
|
|
151
|
+
customToken: n == null ? void 0 : n.customToken
|
|
152
|
+
}), s = B(null), r = J(() => t.get(e).then((o) => (b.set(e, {
|
|
153
|
+
status: "success",
|
|
154
|
+
data: o.data
|
|
155
|
+
}), s.current = window.setTimeout(() => {
|
|
156
|
+
b.delete(e), s.current = null;
|
|
157
|
+
}, 1e3 * 10), o.data)).catch((o) => {
|
|
158
|
+
throw b.set(e, {
|
|
159
|
+
status: "error",
|
|
160
|
+
error: o
|
|
161
|
+
}), s.current = window.setTimeout(() => {
|
|
162
|
+
b.delete(e), s.current = null;
|
|
163
|
+
}, 1e3 * 1), o;
|
|
164
|
+
}), [t, e]);
|
|
165
|
+
if (!b.has(e)) {
|
|
166
|
+
const o = r();
|
|
167
|
+
throw b.set(e, {
|
|
168
|
+
status: "pending",
|
|
169
|
+
promise: o
|
|
170
|
+
}), o;
|
|
171
|
+
}
|
|
172
|
+
const u = b.get(e);
|
|
173
|
+
if (u.status === "pending")
|
|
174
|
+
throw u.promise;
|
|
175
|
+
if (u.status === "error")
|
|
176
|
+
throw u.error;
|
|
177
|
+
const a = J(() => {
|
|
178
|
+
j(() => {
|
|
179
|
+
b.delete(e), s.current !== null && (window.clearTimeout(s.current), s.current = null), r();
|
|
180
|
+
});
|
|
181
|
+
}, [r, e]);
|
|
182
|
+
return {
|
|
183
|
+
data: u.data,
|
|
184
|
+
reloadData: a
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const lt = () => {
|
|
188
|
+
const e = B({}).current;
|
|
189
|
+
return N(() => {
|
|
149
190
|
const n = document.createElement("div");
|
|
150
|
-
return n.style.position = "absolute", n.style.pointerEvents = "none", n.style.top = "0", n.style.width = "100%", n.style.height = "100%",
|
|
191
|
+
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), () => {
|
|
151
192
|
document.body.removeChild(n);
|
|
152
193
|
};
|
|
153
|
-
}, [
|
|
154
|
-
const
|
|
155
|
-
return t.draggableProps.style.position === "fixed" ?
|
|
194
|
+
}, [e]), (n) => (t, ...s) => {
|
|
195
|
+
const r = n(t, ...s);
|
|
196
|
+
return t.draggableProps.style.position === "fixed" ? R(r, e.elt) : r;
|
|
156
197
|
};
|
|
157
|
-
},
|
|
198
|
+
}, F = {
|
|
158
199
|
storageKey: "--tmp-scroll-save--",
|
|
159
200
|
requiredHeight: 100,
|
|
160
201
|
retryInterval: 50
|
|
161
|
-
},
|
|
162
|
-
const t =
|
|
163
|
-
storageKey:
|
|
164
|
-
requiredHeight:
|
|
165
|
-
retryInterval:
|
|
166
|
-
} = n === void 0 ?
|
|
167
|
-
let
|
|
168
|
-
t[0] !==
|
|
169
|
-
const m = localStorage.getItem(
|
|
170
|
-
return localStorage.removeItem(
|
|
171
|
-
}, t[0] =
|
|
172
|
-
const i =
|
|
173
|
-
let
|
|
174
|
-
t[2] !==
|
|
175
|
-
localStorage.setItem(
|
|
176
|
-
}, t[2] =
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
t[4] !== g || t[5] !==
|
|
202
|
+
}, ct = (e, n) => {
|
|
203
|
+
const t = G.c(18), {
|
|
204
|
+
storageKey: s,
|
|
205
|
+
requiredHeight: r,
|
|
206
|
+
retryInterval: u
|
|
207
|
+
} = n === void 0 ? F : n, a = s === void 0 ? F.storageKey : s, o = r === void 0 ? F.requiredHeight : r, v = u === void 0 ? F.retryInterval : u, [g, S] = q(!1), f = B(null);
|
|
208
|
+
let p;
|
|
209
|
+
t[0] !== a ? (p = () => {
|
|
210
|
+
const m = localStorage.getItem(a);
|
|
211
|
+
return localStorage.removeItem(a), m === null ? null : Number(m);
|
|
212
|
+
}, t[0] = a, t[1] = p) : p = t[1];
|
|
213
|
+
const i = p;
|
|
214
|
+
let l;
|
|
215
|
+
t[2] !== a ? (l = (m) => {
|
|
216
|
+
localStorage.setItem(a, m);
|
|
217
|
+
}, t[2] = a, t[3] = l) : l = t[3];
|
|
218
|
+
const d = l;
|
|
219
|
+
let h, w;
|
|
220
|
+
t[4] !== g || t[5] !== o || t[6] !== i || t[7] !== v || t[8] !== e ? (h = () => {
|
|
180
221
|
const m = window.setInterval(() => {
|
|
181
|
-
if (!g &&
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
top:
|
|
222
|
+
if (!g && e.current !== null && e.current.getBoundingClientRect().height > o) {
|
|
223
|
+
S(!0);
|
|
224
|
+
const I = i();
|
|
225
|
+
I !== null && e.current.scrollTo({
|
|
226
|
+
top: I
|
|
186
227
|
}), window.clearInterval(m);
|
|
187
228
|
}
|
|
188
|
-
},
|
|
229
|
+
}, v);
|
|
189
230
|
return () => {
|
|
190
231
|
window.clearTimeout(m);
|
|
191
232
|
};
|
|
192
|
-
},
|
|
193
|
-
let
|
|
194
|
-
t[11] !==
|
|
195
|
-
var
|
|
233
|
+
}, w = [g, o, i, v, e], t[4] = g, t[5] = o, t[6] = i, t[7] = v, t[8] = e, t[9] = h, t[10] = w) : (h = t[9], w = t[10]), N(h, w);
|
|
234
|
+
let c, T;
|
|
235
|
+
t[11] !== d || t[12] !== e ? (c = () => {
|
|
236
|
+
var I;
|
|
196
237
|
const m = new AbortController();
|
|
197
|
-
return (
|
|
238
|
+
return (I = e.current) == null || I.addEventListener("scrollend", () => {
|
|
198
239
|
var C;
|
|
199
|
-
f.current = ((C =
|
|
240
|
+
f.current = ((C = e.current) == null ? void 0 : C.scrollTop) ?? 0, d((f.current ?? 0).toString());
|
|
200
241
|
}, {
|
|
201
242
|
signal: m.signal
|
|
202
243
|
}), () => m.abort();
|
|
203
|
-
},
|
|
204
|
-
let
|
|
205
|
-
return t[15] !== i || t[16] !==
|
|
206
|
-
saveValue:
|
|
244
|
+
}, T = [d, e], t[11] = d, t[12] = e, t[13] = c, t[14] = T) : (c = t[13], T = t[14]), N(c, T);
|
|
245
|
+
let y;
|
|
246
|
+
return t[15] !== i || t[16] !== d ? (y = {
|
|
247
|
+
saveValue: d,
|
|
207
248
|
retrieveValue: i
|
|
208
|
-
}, t[15] = i, t[16] =
|
|
249
|
+
}, t[15] = i, t[16] = d, t[17] = y) : y = t[17], y;
|
|
209
250
|
};
|
|
210
251
|
export {
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
252
|
+
ft as cancelToken,
|
|
253
|
+
W as useAuth,
|
|
254
|
+
V as useAxios,
|
|
255
|
+
Et as useClickOutside,
|
|
256
|
+
Tt as useClipboard,
|
|
257
|
+
mt as useConfirm,
|
|
258
|
+
yt as useEmployeePhotoPath,
|
|
259
|
+
It as useFormControlType,
|
|
260
|
+
gt as useGetApiData,
|
|
261
|
+
ot as useGetApiDataBound,
|
|
262
|
+
rt as useGetDataBound,
|
|
263
|
+
ut as useGetDataBoundExtended,
|
|
264
|
+
Pt as useIsBrowserOnline,
|
|
265
|
+
bt as useIsFormDirty,
|
|
266
|
+
ht as useKeyPress,
|
|
267
|
+
wt as useLocalStorageState,
|
|
268
|
+
vt as useNotifications,
|
|
269
|
+
xt as usePermissions,
|
|
270
|
+
at as usePersistentState,
|
|
271
|
+
St as usePrompt,
|
|
272
|
+
lt as useRenderDraggableInPortal,
|
|
273
|
+
ct as useScrollSave,
|
|
274
|
+
Ot as useSearchQuery,
|
|
275
|
+
Dt as useSearchQueryState,
|
|
276
|
+
Lt as useWindowSize,
|
|
277
|
+
Bt as useZodSchemaTypes
|
|
236
278
|
};
|