react-luminus-components 2.0.5-beta.r19-26 → 2.0.5
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 +20 -9
- package/dist/hooks/useLocalStorageState/useLocalStorageState.d.ts +3 -0
- package/dist/hooks/usePersistentState/usePersistentState.d.ts +15 -1
- package/dist/hooks/useSearchQueryState/useSearchQueryState.d.ts +5 -4
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +93 -92
- package/dist/main.cjs.js +2 -2
- package/dist/main.es.js +3 -2
- package/dist/queryStorage-C8e71gxx.js +30 -0
- package/dist/queryStorage-Dk70bkj7.cjs +1 -0
- package/dist/useIsFormDirty-BMSfF308.cjs +1 -0
- package/dist/useIsFormDirty-BdF5E9qQ.js +117 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +73 -98
- package/package.json +1 -1
- package/dist/useIsFormDirty-BhBtGgzZ.cjs +0 -1
- package/dist/useIsFormDirty-GgEve4W-.js +0 -123
package/dist/.vite/manifest.json
CHANGED
|
@@ -29,18 +29,28 @@
|
|
|
29
29
|
"file": "nivo-bar-C1VYGnTR.cjs",
|
|
30
30
|
"name": "nivo-bar"
|
|
31
31
|
},
|
|
32
|
-
"
|
|
33
|
-
"file": "
|
|
32
|
+
"_queryStorage-C8e71gxx.js": {
|
|
33
|
+
"file": "queryStorage-C8e71gxx.js",
|
|
34
|
+
"name": "queryStorage"
|
|
35
|
+
},
|
|
36
|
+
"_queryStorage-Dk70bkj7.cjs": {
|
|
37
|
+
"file": "queryStorage-Dk70bkj7.cjs",
|
|
38
|
+
"name": "queryStorage"
|
|
39
|
+
},
|
|
40
|
+
"_useIsFormDirty-BMSfF308.cjs": {
|
|
41
|
+
"file": "useIsFormDirty-BMSfF308.cjs",
|
|
34
42
|
"name": "useIsFormDirty",
|
|
35
43
|
"imports": [
|
|
36
|
-
"_nivo-bar-C1VYGnTR.cjs"
|
|
44
|
+
"_nivo-bar-C1VYGnTR.cjs",
|
|
45
|
+
"_queryStorage-Dk70bkj7.cjs"
|
|
37
46
|
]
|
|
38
47
|
},
|
|
39
|
-
"_useIsFormDirty-
|
|
40
|
-
"file": "useIsFormDirty-
|
|
48
|
+
"_useIsFormDirty-BdF5E9qQ.js": {
|
|
49
|
+
"file": "useIsFormDirty-BdF5E9qQ.js",
|
|
41
50
|
"name": "useIsFormDirty",
|
|
42
51
|
"imports": [
|
|
43
|
-
"_nivo-bar-BHzU38wt.js"
|
|
52
|
+
"_nivo-bar-BHzU38wt.js",
|
|
53
|
+
"_queryStorage-C8e71gxx.js"
|
|
44
54
|
]
|
|
45
55
|
},
|
|
46
56
|
"_useLocalStorageState-AB4BFfn5.cjs": {
|
|
@@ -76,7 +86,7 @@
|
|
|
76
86
|
"imports": [
|
|
77
87
|
"_nivo-bar-C1VYGnTR.cjs",
|
|
78
88
|
"_useLocalStorageState-AB4BFfn5.cjs",
|
|
79
|
-
"_useIsFormDirty-
|
|
89
|
+
"_useIsFormDirty-BMSfF308.cjs"
|
|
80
90
|
]
|
|
81
91
|
},
|
|
82
92
|
"src/layout/index.ts": {
|
|
@@ -97,7 +107,7 @@
|
|
|
97
107
|
"_nivo-bar-C1VYGnTR.cjs",
|
|
98
108
|
"_FormDisabledProvider-CiGUtSf7.cjs",
|
|
99
109
|
"_localStorageUtils-CkZslzIU.cjs",
|
|
100
|
-
"_useIsFormDirty-
|
|
110
|
+
"_useIsFormDirty-BMSfF308.cjs",
|
|
101
111
|
"_useLocalStorageState-AB4BFfn5.cjs"
|
|
102
112
|
]
|
|
103
113
|
},
|
|
@@ -108,7 +118,8 @@
|
|
|
108
118
|
"isEntry": true,
|
|
109
119
|
"imports": [
|
|
110
120
|
"_nivo-bar-C1VYGnTR.cjs",
|
|
111
|
-
"_localStorageUtils-CkZslzIU.cjs"
|
|
121
|
+
"_localStorageUtils-CkZslzIU.cjs",
|
|
122
|
+
"_queryStorage-Dk70bkj7.cjs"
|
|
112
123
|
]
|
|
113
124
|
},
|
|
114
125
|
"style.css": {
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated use usePersistentState(key, initState, localStorage) instead
|
|
3
|
+
*/
|
|
1
4
|
declare const useLocalStorageState: <T>(key: string, initialValue: T) => readonly [T, import('react').Dispatch<import('react').SetStateAction<T>>, () => void];
|
|
2
5
|
export default useLocalStorageState;
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* usePersistentState is a custom React hook for synchronizing state with a persistent storage (e.g., localStorage).
|
|
3
|
+
* It provides a stateful value and a setter function, similar to useState, but persists the value under a given key.
|
|
4
|
+
* Changes to the value from other tabs or windows are synchronized using a custom event system.
|
|
5
|
+
*
|
|
6
|
+
* @template T The type of the stored value.
|
|
7
|
+
* @param {string} key - The key under which the value is stored in the provided storage.
|
|
8
|
+
* @param {T} initialValue - The initial value to use if storage does not have a value.
|
|
9
|
+
* @param {Storage} [storage=localStorage] - The Storage object to use (defaults to localStorage).
|
|
10
|
+
* @returns {[T, (newValue: React.SetStateAction<T>) => void]} - Returns a tuple with the current value and a setter.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const [count, setCount] = usePersistentState<number>('counter', 0, queryStorage);
|
|
14
|
+
*/
|
|
15
|
+
declare const usePersistentState: <T>(key: string, initialValue: T, storage?: Storage) => readonly [T, (newValue: React.SetStateAction<T>) => void];
|
|
2
16
|
export default usePersistentState;
|
|
@@ -4,14 +4,15 @@ import { SetStateAction } from 'react';
|
|
|
4
4
|
type SupportedTypes = number | string | boolean | null | object | Date;
|
|
5
5
|
type SupportedTypesLiterals = ToLiteral<SupportedTypes> | 'date';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* It might not always return correct state for Union of different types or numbers in string (for example '50' returns as 50) can be overwritten by setting typeOverride which is also required for Date.
|
|
7
|
+
* @deprecated use usePersistentState(key, initState, queryStorage) instead
|
|
8
|
+
* @ It might not always return correct state for Union of different types or numbers in string (for example '50' returns as 50) can be overwritten by setting typeOverride which is also required for Date.
|
|
9
|
+
* @bug Setting two states at once results in unexpected behaviour. For that case use react-router-dom setSearchParams of useSearchParams.
|
|
9
10
|
* @template T type to apply to returned state and parameter of setState
|
|
10
11
|
* @param paramKey key by which the value gets saved in query param
|
|
11
|
-
* @param
|
|
12
|
+
* @param initState value of state if query param is absent or invalid
|
|
12
13
|
* @param typeOverride Brute forces state to always be this type.
|
|
13
14
|
* @returns [T extends SupportedTypes, (newState: T) => void]
|
|
14
15
|
* @todo fix a bug when you call setState on 2 different queryStates at once - it doesn't set up values properly; seems to be problem with setSearch - it doesn't get updated and second setState is called stale; #USQSdup
|
|
15
16
|
*/
|
|
16
|
-
declare const useSearchQueryState: <T extends SupportedTypes>(paramKey: string,
|
|
17
|
+
declare const useSearchQueryState: <T extends SupportedTypes>(paramKey: string, initState: T, typeOverride?: SupportedTypesLiterals) => readonly [T, (newValue: SetStateAction<T> | T) => void];
|
|
17
18
|
export default useSearchQueryState;
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./nivo-bar-C1VYGnTR.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./nivo-bar-C1VYGnTR.cjs"),U=require("./useLocalStorageState-AB4BFfn5.cjs"),f=require("react"),F=require("./useIsFormDirty-BMSfF308.cjs");require("react/jsx-runtime");require("react-router");const H=require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-react");require("@azure/msal-browser");const C=new Map;function Q(s,r){const e=a.useAxios({silent:!0,differentBaseUrl:r==null?void 0:r.customBaseUrl,customToken:r==null?void 0:r.customToken}),t=f.useRef(null);if(!C.has(s)){if(!e.interceptorsUsed)return null;const m=e.get(s).then(n=>(C.set(s,{status:"success",data:n.data}),t.current=setTimeout(()=>{C.delete(s),t.current=null},1e3*10),n.data)).catch(n=>{throw C.set(s,{status:"error",error:n}),t.current=setTimeout(()=>{C.delete(s),t.current=null},1e3*1),n});throw C.set(s,{status:"pending",promise:m}),m}const o=C.get(s);if(o.status==="pending")throw o.promise;if(o.status==="error")throw o.error;return o.data}const _=s=>r=>(window.addEventListener(`storage_${s}`,r),()=>window.removeEventListener(`storage_${s}`,r)),J=(s,r,e)=>{const t=a.compilerRuntimeExports.c(15),o=e===void 0?localStorage:e,[m]=f.useState(r);let n;t[0]!==r?(n=JSON.stringify(r),t[0]=r,t[1]=n):n=t[1];const l=f.useRef(n),w=f.useRef(r);let h;t[2]!==s||t[3]!==m||t[4]!==o?(h=()=>{const i=o.getItem(s);return i!==l.current&&(l.current=i,w.current=l.current?JSON.parse(l.current):m),w.current},t[2]=s,t[3]=m,t[4]=o,t[5]=h):h=t[5];const y=h;let g;t[6]!==s?(g=_(s),t[6]=s,t[7]=g):g=t[7];const D=g,c=f.useSyncExternalStore(D,y);let u;t[8]!==y||t[9]!==s||t[10]!==o?(u=i=>{const E=typeof i=="function"?i(y()):i;o.setItem(s,JSON.stringify(E)),window.dispatchEvent(new Event(`storage_${s}`))},t[8]=y,t[9]=s,t[10]=o,t[11]=u):u=t[11];const d=u;let v;return t[12]!==d||t[13]!==c?(v=[c,d],t[12]=d,t[13]=c,t[14]=v):v=t[14],v},M=(s,r,e)=>{let t="pending",o;const m=s.then(n=>{t="success",o=n},n=>{const l=n==null?void 0:n.response;(l==null?void 0:l.status)===404&&e?(t="error-404",o=n):(t="error",o=n)});return()=>{switch(t){case"pending":throw m;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")}}},b={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},W=(s,r)=>{const e=a.compilerRuntimeExports.c(26),{loadOnInit:t,enabled:o,silent:m,nullStateBeforeLoad:n,nullStateOnFail:l,customApiUrl:w,customBearerToken:h,dataTransformer:y,errorBoundaryOn404:g}=r===void 0?b:r,D=t===void 0?b.loadOnInit:t,c=o===void 0?b.enabled:o,u=m===void 0?b.silent:m,d=n===void 0?b.nullStateBeforeLoad:n,v=l===void 0?b.nullStateOnFail:l;let p;e[0]!==g?(p=g?[404]:void 0,e[0]=g,e[1]=p):p=e[1];let i;e[2]!==w||e[3]!==h||e[4]!==u||e[5]!==p?(i={silent:u,customToken:h,differentBaseUrl:w,noToastOnStatus:p},e[2]=w,e[3]=h,e[4]=u,e[5]=p,e[6]=i):i=e[6];const E=a.useAxios(i),{startLoading:I,stopLoading:S}=f.useContext(a.LoadingContext),O=f.useRef(0),{isAuthenticated:P}=a.useAuth(),[R,N]=f.useState(null);let A;e[7]!==E||e[8]!==y||e[9]!==c||e[10]!==g||e[11]!==P||e[12]!==d||e[13]!==v||e[14]!==u||e[15]!==I||e[16]!==S||e[17]!==s?(A=async(x,G)=>{if(!P()||c===!1)return;!u&&I(`loadData-${s}-${G}`),d&&N(null);const V=E.get(s,{signal:x}).then(K=>y?y(K.data):K.data).finally(()=>!u&&S(`loadData-${s}-${G}`));N(M(V,v??!1,g??!1))},e[7]=E,e[8]=y,e[9]=c,e[10]=g,e[11]=P,e[12]=d,e[13]=v,e[14]=u,e[15]=I,e[16]=S,e[17]=s,e[18]=A):A=e[18];const T=A;let q,B;e[19]!==T||e[20]!==D?(B=()=>{if(D===!1)return;const x=new AbortController;return T(x.signal,O.current=O.current+1),()=>{x.abort()}},q=[T,D],e[19]=T,e[20]=D,e[21]=q,e[22]=B):(q=e[21],B=e[22]),f.useEffect(B,q);let L;return e[23]!==R||e[24]!==T?(L={data:R,setData:N,reloadData:T},e[23]=R,e[24]=T,e[25]=L):L=e[25],L},z=()=>{const s=f.useRef({}).current;return f.useEffect(()=>{const r=document.createElement("div");return r.style.position="absolute",r.style.pointerEvents="none",r.style.top="0",r.style.width="100%",r.style.height="100%",s.elt=r,document.body.appendChild(r),()=>{document.body.removeChild(r)}},[s]),r=>(e,...t)=>{const o=r(e,...t);return e.draggableProps.style.position==="fixed"?H.createPortal(o,s.elt):o}},$={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},Z=(s,r)=>{const e=a.compilerRuntimeExports.c(18),{storageKey:t,requiredHeight:o,retryInterval:m}=r===void 0?$:r,n=t===void 0?$.storageKey:t,l=o===void 0?$.requiredHeight:o,w=m===void 0?$.retryInterval:m,[h,y]=f.useState(!1),g=f.useRef(null);let D;e[0]!==n?(D=()=>{const S=localStorage.getItem(n);return localStorage.removeItem(n),S===null?null:Number(S)},e[0]=n,e[1]=D):D=e[1];const c=D;let u;e[2]!==n?(u=S=>{localStorage.setItem(n,S)},e[2]=n,e[3]=u):u=e[3];const d=u;let v,p;e[4]!==h||e[5]!==l||e[6]!==c||e[7]!==w||e[8]!==s?(v=()=>{const S=window.setInterval(()=>{if(!h&&s.current!==null&&s.current.getBoundingClientRect().height>l){y(!0);const O=c();O!==null&&s.current.scrollTo({top:O}),window.clearInterval(S)}},w);return()=>{window.clearTimeout(S)}},p=[h,l,c,w,s],e[4]=h,e[5]=l,e[6]=c,e[7]=w,e[8]=s,e[9]=v,e[10]=p):(v=e[9],p=e[10]),f.useEffect(v,p);let i,E;e[11]!==d||e[12]!==s?(i=()=>{var O;const S=new AbortController;return(O=s.current)==null||O.addEventListener("scrollend",()=>{var P;g.current=((P=s.current)==null?void 0:P.scrollTop)??0,d((g.current??0).toString())},{signal:S.signal}),()=>S.abort()},E=[d,s],e[11]=d,e[12]=s,e[13]=i,e[14]=E):(i=e[13],E=e[14]),f.useEffect(i,E);let I;return e[15]!==c||e[16]!==d?(I={saveValue:d,retrieveValue:c},e[15]=c,e[16]=d,e[17]=I):I=e[17],I};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=U.useGetApiData;exports.useLocalStorageState=U.useLocalStorageState;exports.useEmployeePhotoPath=F.useEmployeePhotoPath;exports.useIsFormDirty=F.useIsFormDirty;exports.useSearchQuery=F.useSearchQuery;exports.useSearchQueryState=F.useSearchQueryState;exports.useGetApiDataBound=W;exports.useGetDataBound=Q;exports.usePersistentState=J;exports.useRenderDraggableInPortal=z;exports.useScrollSave=Z;
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ao as H, c as
|
|
1
|
+
import { ao as H, c as q, aq as J, bd as Q } from "./nivo-bar-BHzU38wt.js";
|
|
2
2
|
import { bS as mt, aR as gt, bU as pt, an as vt, bT as St, b7 as ht, ar as wt, bv as bt, am as yt, aG as It, aU as Ot } from "./nivo-bar-BHzU38wt.js";
|
|
3
3
|
import { u as Ct, a as Et } from "./useLocalStorageState-B2v6hClT.js";
|
|
4
|
-
import { useRef as D, useState as
|
|
5
|
-
import { c as xt, u as Bt, a as Lt, b as $t } from "./useIsFormDirty-
|
|
4
|
+
import { useRef as D, useState as K, useSyncExternalStore as W, useContext as z, useEffect as U } from "react";
|
|
5
|
+
import { c as xt, u as Bt, a as Lt, b as $t } from "./useIsFormDirty-BdF5E9qQ.js";
|
|
6
6
|
import "react/jsx-runtime";
|
|
7
7
|
import "react-router";
|
|
8
8
|
import { createPortal as M } from "react-dom";
|
|
@@ -11,73 +11,74 @@ import "react-flexmonster";
|
|
|
11
11
|
import "@azure/msal-react";
|
|
12
12
|
import "@azure/msal-browser";
|
|
13
13
|
const T = /* @__PURE__ */ new Map();
|
|
14
|
-
function at(
|
|
14
|
+
function at(s, n) {
|
|
15
15
|
const t = H({
|
|
16
16
|
silent: !0,
|
|
17
17
|
differentBaseUrl: n == null ? void 0 : n.customBaseUrl,
|
|
18
18
|
customToken: n == null ? void 0 : n.customToken
|
|
19
|
-
}),
|
|
20
|
-
if (!T.has(
|
|
19
|
+
}), e = D(null);
|
|
20
|
+
if (!T.has(s)) {
|
|
21
21
|
if (!t.interceptorsUsed)
|
|
22
22
|
return null;
|
|
23
|
-
const
|
|
23
|
+
const d = t.get(s).then((r) => (T.set(s, {
|
|
24
24
|
status: "success",
|
|
25
25
|
data: r.data
|
|
26
|
-
}),
|
|
27
|
-
T.delete(
|
|
26
|
+
}), e.current = setTimeout(() => {
|
|
27
|
+
T.delete(s), e.current = null;
|
|
28
28
|
}, 1e3 * 10), r.data)).catch((r) => {
|
|
29
|
-
throw T.set(
|
|
29
|
+
throw T.set(s, {
|
|
30
30
|
status: "error",
|
|
31
31
|
error: r
|
|
32
|
-
}),
|
|
33
|
-
T.delete(
|
|
32
|
+
}), e.current = setTimeout(() => {
|
|
33
|
+
T.delete(s), e.current = null;
|
|
34
34
|
}, 1e3 * 1), r;
|
|
35
35
|
});
|
|
36
|
-
throw T.set(
|
|
36
|
+
throw T.set(s, {
|
|
37
37
|
status: "pending",
|
|
38
|
-
promise:
|
|
39
|
-
}),
|
|
38
|
+
promise: d
|
|
39
|
+
}), d;
|
|
40
40
|
}
|
|
41
|
-
const o = T.get(
|
|
41
|
+
const o = T.get(s);
|
|
42
42
|
if (o.status === "pending")
|
|
43
43
|
throw o.promise;
|
|
44
44
|
if (o.status === "error")
|
|
45
45
|
throw o.error;
|
|
46
46
|
return o.data;
|
|
47
47
|
}
|
|
48
|
-
const R = (
|
|
49
|
-
const
|
|
48
|
+
const R = (s) => (n) => (window.addEventListener(`storage_${s}`, n), () => window.removeEventListener(`storage_${s}`, n)), lt = (s, n, t) => {
|
|
49
|
+
const e = q.c(15), o = t === void 0 ? localStorage : t, [d] = K(n);
|
|
50
50
|
let r;
|
|
51
|
-
|
|
51
|
+
e[0] !== n ? (r = JSON.stringify(n), e[0] = n, e[1] = r) : r = e[1];
|
|
52
52
|
const l = D(r), S = D(n);
|
|
53
53
|
let g;
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
return
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
const
|
|
54
|
+
e[2] !== s || e[3] !== d || e[4] !== o ? (g = () => {
|
|
55
|
+
const u = o.getItem(s);
|
|
56
|
+
return u !== l.current && (l.current = u, S.current = l.current ? JSON.parse(l.current) : d), S.current;
|
|
57
|
+
}, e[2] = s, e[3] = d, e[4] = o, e[5] = g) : g = e[5];
|
|
58
|
+
const h = g;
|
|
59
|
+
let f;
|
|
60
|
+
e[6] !== s ? (f = R(s), e[6] = s, e[7] = f) : f = e[7];
|
|
61
|
+
const i = W(f, h);
|
|
62
62
|
let a;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
e[8] !== h || e[9] !== s || e[10] !== o ? (a = (u) => {
|
|
64
|
+
const b = typeof u == "function" ? u(h()) : u;
|
|
65
|
+
o.setItem(s, JSON.stringify(b)), window.dispatchEvent(new Event(`storage_${s}`));
|
|
66
|
+
}, e[8] = h, e[9] = s, e[10] = o, e[11] = a) : a = e[11];
|
|
67
|
+
const c = a;
|
|
67
68
|
let p;
|
|
68
|
-
return
|
|
69
|
-
}, Z = (
|
|
70
|
-
let
|
|
71
|
-
const
|
|
72
|
-
|
|
69
|
+
return e[12] !== c || e[13] !== i ? (p = [i, c], e[12] = c, e[13] = i, e[14] = p) : p = e[14], p;
|
|
70
|
+
}, Z = (s, n, t) => {
|
|
71
|
+
let e = "pending", o;
|
|
72
|
+
const d = s.then((r) => {
|
|
73
|
+
e = "success", o = r;
|
|
73
74
|
}, (r) => {
|
|
74
75
|
const l = r == null ? void 0 : r.response;
|
|
75
|
-
(l == null ? void 0 : l.status) === 404 && t ? (
|
|
76
|
+
(l == null ? void 0 : l.status) === 404 && t ? (e = "error-404", o = r) : (e = "error", o = r);
|
|
76
77
|
});
|
|
77
78
|
return () => {
|
|
78
|
-
switch (
|
|
79
|
+
switch (e) {
|
|
79
80
|
case "pending":
|
|
80
|
-
throw
|
|
81
|
+
throw d;
|
|
81
82
|
case "success":
|
|
82
83
|
return o;
|
|
83
84
|
case "error":
|
|
@@ -95,53 +96,53 @@ const R = (e) => (n) => (window.addEventListener(`storage_${e}`, n), () => windo
|
|
|
95
96
|
enabled: !0,
|
|
96
97
|
nullStateBeforeLoad: !0,
|
|
97
98
|
nullStateOnFail: !1
|
|
98
|
-
}, ut = (
|
|
99
|
-
const t =
|
|
100
|
-
loadOnInit:
|
|
99
|
+
}, ut = (s, n) => {
|
|
100
|
+
const t = q.c(26), {
|
|
101
|
+
loadOnInit: e,
|
|
101
102
|
enabled: o,
|
|
102
|
-
silent:
|
|
103
|
+
silent: d,
|
|
103
104
|
nullStateBeforeLoad: r,
|
|
104
105
|
nullStateOnFail: l,
|
|
105
106
|
customApiUrl: S,
|
|
106
107
|
customBearerToken: g,
|
|
107
|
-
dataTransformer:
|
|
108
|
-
errorBoundaryOn404:
|
|
109
|
-
} = n === void 0 ? E : n,
|
|
108
|
+
dataTransformer: h,
|
|
109
|
+
errorBoundaryOn404: f
|
|
110
|
+
} = n === void 0 ? E : n, w = e === void 0 ? E.loadOnInit : e, i = o === void 0 ? E.enabled : o, a = d === void 0 ? E.silent : d, c = r === void 0 ? E.nullStateBeforeLoad : r, p = l === void 0 ? E.nullStateOnFail : l;
|
|
110
111
|
let v;
|
|
111
|
-
t[0] !==
|
|
112
|
-
let
|
|
113
|
-
t[2] !== S || t[3] !== g || t[4] !== a || t[5] !== v ? (
|
|
112
|
+
t[0] !== f ? (v = f ? [404] : void 0, t[0] = f, t[1] = v) : v = t[1];
|
|
113
|
+
let u;
|
|
114
|
+
t[2] !== S || t[3] !== g || t[4] !== a || t[5] !== v ? (u = {
|
|
114
115
|
silent: a,
|
|
115
116
|
customToken: g,
|
|
116
117
|
differentBaseUrl: S,
|
|
117
118
|
noToastOnStatus: v
|
|
118
|
-
}, t[2] = S, t[3] = g, t[4] = a, t[5] = v, t[6] =
|
|
119
|
-
const b = H(
|
|
119
|
+
}, t[2] = S, t[3] = g, t[4] = a, t[5] = v, t[6] = u) : u = t[6];
|
|
120
|
+
const b = H(u), {
|
|
120
121
|
startLoading: y,
|
|
121
122
|
stopLoading: m
|
|
122
123
|
} = z(J), I = D(0), {
|
|
123
124
|
isAuthenticated: C
|
|
124
|
-
} = Q(), [F, N] =
|
|
125
|
+
} = Q(), [F, N] = K(null);
|
|
125
126
|
let x;
|
|
126
|
-
t[7] !== b || t[8] !==
|
|
127
|
-
if (!C() ||
|
|
127
|
+
t[7] !== b || t[8] !== h || t[9] !== i || t[10] !== f || t[11] !== C || t[12] !== c || t[13] !== p || t[14] !== a || t[15] !== y || t[16] !== m || t[17] !== s ? (x = async (P, V) => {
|
|
128
|
+
if (!C() || i === !1)
|
|
128
129
|
return;
|
|
129
|
-
!a && y(`loadData-${
|
|
130
|
-
const _ = b.get(
|
|
130
|
+
!a && y(`loadData-${s}-${V}`), c && N(null);
|
|
131
|
+
const _ = b.get(s, {
|
|
131
132
|
signal: P
|
|
132
|
-
}).then((G) =>
|
|
133
|
-
N(Z(_, p ?? !1,
|
|
134
|
-
}, t[7] = b, t[8] =
|
|
133
|
+
}).then((G) => h ? h(G.data) : G.data).finally(() => !a && m(`loadData-${s}-${V}`));
|
|
134
|
+
N(Z(_, p ?? !1, f ?? !1));
|
|
135
|
+
}, t[7] = b, t[8] = h, t[9] = i, t[10] = f, t[11] = C, t[12] = c, t[13] = p, t[14] = a, t[15] = y, t[16] = m, t[17] = s, t[18] = x) : x = t[18];
|
|
135
136
|
const O = x;
|
|
136
137
|
let B, L;
|
|
137
|
-
t[19] !== O || t[20] !==
|
|
138
|
-
if (
|
|
138
|
+
t[19] !== O || t[20] !== w ? (L = () => {
|
|
139
|
+
if (w === !1)
|
|
139
140
|
return;
|
|
140
141
|
const P = new AbortController();
|
|
141
142
|
return O(P.signal, I.current = I.current + 1), () => {
|
|
142
143
|
P.abort();
|
|
143
144
|
};
|
|
144
|
-
}, B = [O,
|
|
145
|
+
}, B = [O, w], t[19] = O, t[20] = w, t[21] = B, t[22] = L) : (B = t[21], L = t[22]), U(L, B);
|
|
145
146
|
let $;
|
|
146
147
|
return t[23] !== F || t[24] !== O ? ($ = {
|
|
147
148
|
data: F,
|
|
@@ -149,44 +150,44 @@ const R = (e) => (n) => (window.addEventListener(`storage_${e}`, n), () => windo
|
|
|
149
150
|
reloadData: O
|
|
150
151
|
}, t[23] = F, t[24] = O, t[25] = $) : $ = t[25], $;
|
|
151
152
|
}, it = () => {
|
|
152
|
-
const
|
|
153
|
+
const s = D({}).current;
|
|
153
154
|
return U(() => {
|
|
154
155
|
const n = document.createElement("div");
|
|
155
|
-
return n.style.position = "absolute", n.style.pointerEvents = "none", n.style.top = "0", n.style.width = "100%", n.style.height = "100%",
|
|
156
|
+
return n.style.position = "absolute", n.style.pointerEvents = "none", n.style.top = "0", n.style.width = "100%", n.style.height = "100%", s.elt = n, document.body.appendChild(n), () => {
|
|
156
157
|
document.body.removeChild(n);
|
|
157
158
|
};
|
|
158
|
-
}, [
|
|
159
|
-
const o = n(t, ...
|
|
160
|
-
return t.draggableProps.style.position === "fixed" ? M(o,
|
|
159
|
+
}, [s]), (n) => (t, ...e) => {
|
|
160
|
+
const o = n(t, ...e);
|
|
161
|
+
return t.draggableProps.style.position === "fixed" ? M(o, s.elt) : o;
|
|
161
162
|
};
|
|
162
163
|
}, A = {
|
|
163
164
|
storageKey: "--tmp-scroll-save--",
|
|
164
165
|
requiredHeight: 100,
|
|
165
166
|
retryInterval: 50
|
|
166
|
-
}, ct = (
|
|
167
|
-
const t =
|
|
168
|
-
storageKey:
|
|
167
|
+
}, ct = (s, n) => {
|
|
168
|
+
const t = q.c(18), {
|
|
169
|
+
storageKey: e,
|
|
169
170
|
requiredHeight: o,
|
|
170
|
-
retryInterval:
|
|
171
|
-
} = n === void 0 ? A : n, r =
|
|
172
|
-
let
|
|
173
|
-
t[0] !== r ? (
|
|
171
|
+
retryInterval: d
|
|
172
|
+
} = n === void 0 ? A : n, r = e === void 0 ? A.storageKey : e, l = o === void 0 ? A.requiredHeight : o, S = d === void 0 ? A.retryInterval : d, [g, h] = K(!1), f = D(null);
|
|
173
|
+
let w;
|
|
174
|
+
t[0] !== r ? (w = () => {
|
|
174
175
|
const m = localStorage.getItem(r);
|
|
175
176
|
return localStorage.removeItem(r), m === null ? null : Number(m);
|
|
176
|
-
}, t[0] = r, t[1] =
|
|
177
|
-
const
|
|
177
|
+
}, t[0] = r, t[1] = w) : w = t[1];
|
|
178
|
+
const i = w;
|
|
178
179
|
let a;
|
|
179
180
|
t[2] !== r ? (a = (m) => {
|
|
180
181
|
localStorage.setItem(r, m);
|
|
181
182
|
}, t[2] = r, t[3] = a) : a = t[3];
|
|
182
|
-
const
|
|
183
|
+
const c = a;
|
|
183
184
|
let p, v;
|
|
184
|
-
t[4] !== g || t[5] !== l || t[6] !==
|
|
185
|
+
t[4] !== g || t[5] !== l || t[6] !== i || t[7] !== S || t[8] !== s ? (p = () => {
|
|
185
186
|
const m = window.setInterval(() => {
|
|
186
|
-
if (!g &&
|
|
187
|
-
|
|
188
|
-
const I =
|
|
189
|
-
I !== null &&
|
|
187
|
+
if (!g && s.current !== null && s.current.getBoundingClientRect().height > l) {
|
|
188
|
+
h(!0);
|
|
189
|
+
const I = i();
|
|
190
|
+
I !== null && s.current.scrollTo({
|
|
190
191
|
top: I
|
|
191
192
|
}), window.clearInterval(m);
|
|
192
193
|
}
|
|
@@ -194,23 +195,23 @@ const R = (e) => (n) => (window.addEventListener(`storage_${e}`, n), () => windo
|
|
|
194
195
|
return () => {
|
|
195
196
|
window.clearTimeout(m);
|
|
196
197
|
};
|
|
197
|
-
}, v = [g, l,
|
|
198
|
-
let
|
|
199
|
-
t[11] !==
|
|
198
|
+
}, v = [g, l, i, S, s], t[4] = g, t[5] = l, t[6] = i, t[7] = S, t[8] = s, t[9] = p, t[10] = v) : (p = t[9], v = t[10]), U(p, v);
|
|
199
|
+
let u, b;
|
|
200
|
+
t[11] !== c || t[12] !== s ? (u = () => {
|
|
200
201
|
var I;
|
|
201
202
|
const m = new AbortController();
|
|
202
|
-
return (I =
|
|
203
|
+
return (I = s.current) == null || I.addEventListener("scrollend", () => {
|
|
203
204
|
var C;
|
|
204
|
-
|
|
205
|
+
f.current = ((C = s.current) == null ? void 0 : C.scrollTop) ?? 0, c((f.current ?? 0).toString());
|
|
205
206
|
}, {
|
|
206
207
|
signal: m.signal
|
|
207
208
|
}), () => m.abort();
|
|
208
|
-
}, b = [
|
|
209
|
+
}, b = [c, s], t[11] = c, t[12] = s, t[13] = u, t[14] = b) : (u = t[13], b = t[14]), U(u, b);
|
|
209
210
|
let y;
|
|
210
|
-
return t[15] !==
|
|
211
|
-
saveValue:
|
|
212
|
-
retrieveValue:
|
|
213
|
-
}, t[15] =
|
|
211
|
+
return t[15] !== i || t[16] !== c ? (y = {
|
|
212
|
+
saveValue: c,
|
|
213
|
+
retrieveValue: i
|
|
214
|
+
}, t[15] = i, t[16] = c, t[17] = y) : y = t[17], y;
|
|
214
215
|
};
|
|
215
216
|
export {
|
|
216
217
|
mt as cancelToken,
|