react-luminus-components 1.4.18 → 1.4.20

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.
@@ -1,16 +1,16 @@
1
1
  {
2
- "_FormDisabledProvider-CFVvRfQA.cjs": {
3
- "file": "FormDisabledProvider-CFVvRfQA.cjs",
2
+ "_FormDisabledProvider--NF9w6Lv.js": {
3
+ "file": "FormDisabledProvider--NF9w6Lv.js",
4
4
  "name": "FormDisabledProvider",
5
5
  "imports": [
6
- "_nivo-bar.es-XyEWv2u7.cjs"
6
+ "_nivo-bar.es-CMdSkNQH.js"
7
7
  ]
8
8
  },
9
- "_FormDisabledProvider-Ivy5y4wP.js": {
10
- "file": "FormDisabledProvider-Ivy5y4wP.js",
9
+ "_FormDisabledProvider-CFVvRfQA.cjs": {
10
+ "file": "FormDisabledProvider-CFVvRfQA.cjs",
11
11
  "name": "FormDisabledProvider",
12
12
  "imports": [
13
- "_nivo-bar.es-Cr3RGn0C.js"
13
+ "_nivo-bar.es-XyEWv2u7.cjs"
14
14
  ]
15
15
  },
16
16
  "_apiPathUtils-CkTRKCPh.cjs": {
@@ -21,26 +21,26 @@
21
21
  "file": "apiPathUtils-DiqvB8mF.js",
22
22
  "name": "apiPathUtils"
23
23
  },
24
- "_nivo-bar.es-Cr3RGn0C.js": {
25
- "file": "nivo-bar.es-Cr3RGn0C.js",
24
+ "_nivo-bar.es-CMdSkNQH.js": {
25
+ "file": "nivo-bar.es-CMdSkNQH.js",
26
26
  "name": "nivo-bar.es"
27
27
  },
28
28
  "_nivo-bar.es-XyEWv2u7.cjs": {
29
29
  "file": "nivo-bar.es-XyEWv2u7.cjs",
30
30
  "name": "nivo-bar.es"
31
31
  },
32
- "_useGetApiData-Csr4g-NL.cjs": {
33
- "file": "useGetApiData-Csr4g-NL.cjs",
32
+ "_useGetApiData-A6rMrI30.js": {
33
+ "file": "useGetApiData-A6rMrI30.js",
34
34
  "name": "useGetApiData",
35
35
  "imports": [
36
- "_nivo-bar.es-XyEWv2u7.cjs"
36
+ "_nivo-bar.es-CMdSkNQH.js"
37
37
  ]
38
38
  },
39
- "_useGetApiData-vqVw7uCt.js": {
40
- "file": "useGetApiData-vqVw7uCt.js",
39
+ "_useGetApiData-Csr4g-NL.cjs": {
40
+ "file": "useGetApiData-Csr4g-NL.cjs",
41
41
  "name": "useGetApiData",
42
42
  "imports": [
43
- "_nivo-bar.es-Cr3RGn0C.js"
43
+ "_nivo-bar.es-XyEWv2u7.cjs"
44
44
  ]
45
45
  },
46
46
  "_useLocalStorageState-BFc8Gc8H.cjs": {
@@ -1,4 +1,4 @@
1
- import { j as o, c as n, bJ as e } from "./nivo-bar.es-Cr3RGn0C.js";
1
+ import { j as o, c as n, bJ as e } from "./nivo-bar.es-CMdSkNQH.js";
2
2
  const l = "_loading_obchl_1", a = "_spinner-grow_obchl_10", c = "_second_obchl_14", t = "_third_obchl_17", d = "_loadingBlock_obchl_21", _ = "_sizeLine_obchl_29", p = "_sizeFill_obchl_36", s = {
3
3
  loading: l,
4
4
  "spinner-grow": "_spinner-grow_obchl_10",
@@ -1,4 +1,4 @@
1
1
  import { FormContactInputProp } from '../../../models/index';
2
2
 
3
- declare const ContactInput: ({ value, label, InputContainer, className, withoutLabel, hidden, disabled, contactType, }: FormContactInputProp) => import("react").JSX.Element | null;
3
+ declare const ContactInput: ({ value, label, InputContainer, className, withoutLabel, hidden, disabled, contactType, ...otherProps }: FormContactInputProp) => import("react").JSX.Element | null;
4
4
  export default ContactInput;
@@ -1,4 +1,4 @@
1
1
  import { default as HookFormContactInputProp } from '../../../models/prop-types/HookFormInputProps/HookFormContactInputProps';
2
2
 
3
- declare const HookFormContactInput: ({ label, InputContainer, className, withoutLabel, hidden, disabled, contactType, formField, }: HookFormContactInputProp) => import("react").JSX.Element | null;
3
+ declare const HookFormContactInput: ({ label, InputContainer, className, withoutLabel, hidden, disabled, contactType, formField, ...otherProps }: HookFormContactInputProp) => import("react").JSX.Element | null;
4
4
  export default HookFormContactInput;
@@ -1,8 +1,8 @@
1
1
  var Ee = Object.defineProperty;
2
2
  var Oe = (e, t, r) => t in e ? Ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var S = (e, t, r) => Oe(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { t as F, bB as we, j as f, bC as Ie, P as z, ak as De, bD as de, a1 as A, ag as Pe, Q as q, bE as je, ao as ke, am as Le, b3 as me, bq as pe, b4 as He, b5 as j, an as _e, bF as $e, aB as se, bG as Me, aS as he, bH as oe, bI as Re, al as Ue, aW as Fe, a3 as Ne } from "./nivo-bar.es-Cr3RGn0C.js";
5
- import { bJ as Vt, ad as Wt } from "./nivo-bar.es-Cr3RGn0C.js";
4
+ import { t as F, bB as we, j as f, bC as Ie, P as z, ak as De, bD as de, a1 as A, ag as Pe, Q as q, bE as je, ao as ke, am as Le, b3 as me, bq as pe, b4 as He, b5 as j, an as _e, bF as $e, aB as se, bG as Me, aS as he, bH as oe, bI as Re, al as Ue, aW as Fe, a2 as Ne } from "./nivo-bar.es-CMdSkNQH.js";
5
+ import { bJ as Vt, ad as Wt } from "./nivo-bar.es-CMdSkNQH.js";
6
6
  import O, { useState as x, useCallback as m, useMemo as g, useContext as _, useEffect as P, useRef as ye, Component as te } from "react";
7
7
  import { EventType as J } from "@azure/msal-browser";
8
8
  import { MsalProvider as Ge } from "@azure/msal-react";
@@ -10,9 +10,9 @@ import "react-router-dom";
10
10
  import "react-dom";
11
11
  import "react-hook-form";
12
12
  import "react-flexmonster";
13
- import { L as qe } from "./FormDisabledProvider-Ivy5y4wP.js";
14
- import { F as Jt } from "./FormDisabledProvider-Ivy5y4wP.js";
15
- import { u as ze } from "./useGetApiData-vqVw7uCt.js";
13
+ import { L as qe } from "./FormDisabledProvider--NF9w6Lv.js";
14
+ import { F as Jt } from "./FormDisabledProvider--NF9w6Lv.js";
15
+ import { u as ze } from "./useGetApiData-A6rMrI30.js";
16
16
  import { u as Ke } from "./useLocalStorageState-Bt99kkCr.js";
17
17
  function Be(e) {
18
18
  const t = F(e);
@@ -18,3 +18,4 @@ export { default as useClipboard } from './useClipboard/useClipboard';
18
18
  export { default as useGetApiDataBound } from './useGetApiDataBound/useGetApiDataBound';
19
19
  export { default as useWindowSize } from './useWindowSize/useWindowSize';
20
20
  export { default as useRenderDraggableInPortal } from './useRenderDraggableInPortal/useRenderDraggableInPortal';
21
+ export { default as useScrollSave } from './useScrollSave/useScrollSave';
@@ -0,0 +1,8 @@
1
+ import { default as UseScrollSaveOptions } from '../../models/types/UseScrollSaveOptions';
2
+ import { RefObject } from 'react';
3
+
4
+ declare const useScrollSave: (scrollableRef: RefObject<HTMLDivElement>, { storageKey, requiredHeight, retryInterval, }?: UseScrollSaveOptions) => {
5
+ saveValue: (newItem: string) => void;
6
+ retrieveValue: () => number | null;
7
+ };
8
+ export default useScrollSave;
package/dist/hooks.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-XyEWv2u7.cjs"),k=require("./useGetApiData-Csr4g-NL.cjs"),c=require("react"),T=require("./useLocalStorageState-BFc8Gc8H.cjs"),f=require("./useRenderDraggableInPortal-QPCaw-E_.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const x=r=>{let t="pending",u;const s=r.then(a=>{t="success",u=a},a=>{t="error",u=a});return()=>{switch(t){case"pending":throw s;case"success":return u;case"error":throw u;default:throw new Error("Unknown status")}}};function B(r,t){const u=e.useAxios({silent:!0,differentBaseUrl:t==null?void 0:t.customBaseUrl,customToken:t==null?void 0:t.customToken}),[s,a]=c.useState(null);return c.useEffect(()=>{(async()=>{const n=u.get(r).then(o=>o.data);a(x(n))})()},[u,r]),s}const G=(r,t,u)=>{let s="pending",a;const i=r.then(n=>{s="success",a=n},n=>{const o=n==null?void 0:n.response;(o==null?void 0:o.status)===404&&u?(s="error-404",a=n):(s="error",a=n)});return()=>{switch(s){case"pending":throw i;case"success":return a;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},l={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},L=(r,{loadOnInit:t=l.loadOnInit,enabled:u=l.enabled,silent:s=l.silent,nullStateBeforeLoad:a=l.nullStateBeforeLoad,nullStateOnFail:i=l.nullStateOnFail,customApiUrl:n,customBearerToken:o,dataTransformer:h,errorBoundaryOn404:S}=l)=>{const p=e.useAxios({silent:s,customToken:o,differentBaseUrl:n,noToastOnStatus:S?[404]:void 0}),{startLoading:D,stopLoading:w}=c.useContext(e.LoadingContext),C=c.useRef(0),{isAuthenticated:y}=e.useAuth(),[b,g]=c.useState(null),m=c.useCallback(async(d,A)=>{if(!y()||u===!1)return;!s&&D(`loadData-${r}-${A}`),a&&g(null);const q=p.get(r,{signal:d}).then(P=>h?h(P.data):P.data).finally(()=>!s&&w(`loadData-${r}-${A}`));g(G(q,i??!1,S??!1))},[y,u,s,D,r,a,p,h,w,i,S]);return c.useEffect(()=>{if(t===!1)return;const d=new AbortController;return m(d.signal,++C.current),()=>{d.abort()}},[m,t]),{data:b,setData:g,reloadData:m}};exports.cancelToken=e.cancelToken;exports.useAuth=e.useAuth;exports.useAxios=e.useAxios;exports.useClickOutside=e.useClickOutside;exports.useClipboard=e.useClipboard;exports.useConfirm=e.useConfirm;exports.useFormControlType=e.useFormControlType;exports.useKeyPress=e.useKeyPress;exports.useNotifications=e.useNotifications;exports.usePermissions=e.usePermissions;exports.usePrompt=e.usePrompt;exports.useWindowSize=e.useWindowSize;exports.useZodSchemaTypes=e.useZodSchemaTypes;exports.useGetApiData=k.useGetApiData;exports.useLocalStorageState=T.useLocalStorageState;exports.useEmployeePhotoPath=f.useEmployeePhotoPath;exports.useRenderDraggableInPortal=f.useRenderDraggableInPortal;exports.useSearchQuery=f.useSearchQuery;exports.useSearchQueryState=f.useSearchQueryState;exports.useGetApiDataBound=L;exports.useGetDataBound=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./nivo-bar.es-XyEWv2u7.cjs"),q=require("./useGetApiData-Csr4g-NL.cjs"),l=require("react"),T=require("./useLocalStorageState-BFc8Gc8H.cjs"),p=require("./useRenderDraggableInPortal-QPCaw-E_.cjs");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const I=t=>{let e="pending",n;const r=t.then(a=>{e="success",n=a},a=>{e="error",n=a});return()=>{switch(e){case"pending":throw r;case"success":return n;case"error":throw n;default:throw new Error("Unknown status")}}};function E(t,e){const n=s.useAxios({silent:!0,differentBaseUrl:e==null?void 0:e.customBaseUrl,customToken:e==null?void 0:e.customToken}),[r,a]=l.useState(null);return l.useEffect(()=>{(async()=>{const u=n.get(t).then(c=>c.data);a(I(u))})()},[n,t]),r}const x=(t,e,n)=>{let r="pending",a;const d=t.then(u=>{r="success",a=u},u=>{const c=u==null?void 0:u.response;(c==null?void 0:c.status)===404&&n?(r="error-404",a=u):(r="error",a=u)});return()=>{switch(r){case"pending":throw d;case"success":return a;case"error":return null;case"error-404":throw new Error("404");default:throw new Error("Unknown status")}}},S={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},B=(t,{loadOnInit:e=S.loadOnInit,enabled:n=S.enabled,silent:r=S.silent,nullStateBeforeLoad:a=S.nullStateBeforeLoad,nullStateOnFail:d=S.nullStateOnFail,customApiUrl:u,customBearerToken:c,dataTransformer:f,errorBoundaryOn404:o}=S)=>{const i=s.useAxios({silent:r,customToken:c,differentBaseUrl:u,noToastOnStatus:o?[404]:void 0}),{startLoading:g,stopLoading:v}=l.useContext(s.LoadingContext),b=l.useRef(0),{isAuthenticated:C}=s.useAuth(),[y,w]=l.useState(null),D=l.useCallback(async(m,A)=>{if(!C()||n===!1)return;!r&&g(`loadData-${t}-${A}`),a&&w(null);const k=i.get(t,{signal:m}).then(P=>f?f(P.data):P.data).finally(()=>!r&&v(`loadData-${t}-${A}`));w(x(k,d??!1,o??!1))},[C,n,r,g,t,a,i,f,v,d,o]);return l.useEffect(()=>{if(e===!1)return;const m=new AbortController;return D(m.signal,++b.current),()=>{m.abort()}},[D,e]),{data:y,setData:w,reloadData:D}},h={storageKey:"--tmp-scroll-save--",requiredHeight:100,retryInterval:50},L=(t,{storageKey:e=h.storageKey,requiredHeight:n=h.requiredHeight,retryInterval:r=h.retryInterval}=h)=>{const[a,d]=l.useState(!1),u=l.useRef(null),c=l.useCallback(()=>{const o=localStorage.getItem(e);return localStorage.removeItem(e),o===null?null:Number(o)},[e]),f=l.useCallback(o=>{localStorage.setItem(e,o)},[e]);return l.useEffect(()=>{const o=window.setInterval(()=>{if(!a&&t.current!==null&&t.current.getBoundingClientRect().height>n){d(!0);const i=c();i!==null&&t.current.scrollTo({top:i}),window.clearInterval(o)}},r);return()=>{window.clearTimeout(o)}},[a,n,c,r,t]),l.useEffect(()=>{var i;const o=new AbortController;return(i=t.current)==null||i.addEventListener("scrollend",()=>{var g;u.current=((g=t.current)==null?void 0:g.scrollTop)??0,f((u.current??0).toString())},{signal:o.signal}),()=>o.abort()},[f,t]),{saveValue:f,retrieveValue:c}};exports.cancelToken=s.cancelToken;exports.useAuth=s.useAuth;exports.useAxios=s.useAxios;exports.useClickOutside=s.useClickOutside;exports.useClipboard=s.useClipboard;exports.useConfirm=s.useConfirm;exports.useFormControlType=s.useFormControlType;exports.useKeyPress=s.useKeyPress;exports.useNotifications=s.useNotifications;exports.usePermissions=s.usePermissions;exports.usePrompt=s.usePrompt;exports.useWindowSize=s.useWindowSize;exports.useZodSchemaTypes=s.useZodSchemaTypes;exports.useGetApiData=q.useGetApiData;exports.useLocalStorageState=T.useLocalStorageState;exports.useEmployeePhotoPath=p.useEmployeePhotoPath;exports.useRenderDraggableInPortal=p.useRenderDraggableInPortal;exports.useSearchQuery=p.useSearchQuery;exports.useSearchQueryState=p.useSearchQueryState;exports.useGetApiDataBound=B;exports.useGetDataBound=E;exports.useScrollSave=L;
package/dist/hooks.es.js CHANGED
@@ -1,60 +1,60 @@
1
- import { am as S, ao as L, b4 as P } from "./nivo-bar.es-Cr3RGn0C.js";
2
- import { bK as j, aM as q, bM as H, al as J, bL as V, aW as X, ap as Y, bn as _, ak as ee, aE as te, bp as se } from "./nivo-bar.es-Cr3RGn0C.js";
3
- import { u as ne } from "./useGetApiData-vqVw7uCt.js";
4
- import { useState as x, useEffect as k, useContext as E, useRef as T, useCallback as U } from "react";
5
- import { u as re } from "./useLocalStorageState-Bt99kkCr.js";
6
- import { c as le, u as ce, a as ie, b as fe } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
1
+ import { am as k, ao as P, b4 as E } from "./nivo-bar.es-CMdSkNQH.js";
2
+ import { bK as j, aM as J, bM as K, al as X, bL as Y, aW as _, ap as tt, bn as et, ak as at, aE as st, bp as rt } from "./nivo-bar.es-CMdSkNQH.js";
3
+ import { u as ot } from "./useGetApiData-A6rMrI30.js";
4
+ import { useState as v, useEffect as g, useContext as $, useRef as I, useCallback as S } from "react";
5
+ import { u as lt } from "./useLocalStorageState-Bt99kkCr.js";
6
+ import { c as it, u as dt, a as mt, b as ft } from "./useRenderDraggableInPortal-D0OLp7Qb.js";
7
7
  import "react-router-dom";
8
8
  import "react-dom";
9
9
  import "react-hook-form";
10
10
  import "react-flexmonster";
11
11
  import "@azure/msal-browser";
12
12
  import "@azure/msal-react";
13
- const $ = (n) => {
14
- let e = "pending", a;
15
- const t = n.then((s) => {
16
- e = "success", a = s;
13
+ const y = (e) => {
14
+ let t = "pending", r;
15
+ const a = e.then((s) => {
16
+ t = "success", r = s;
17
17
  }, (s) => {
18
- e = "error", a = s;
18
+ t = "error", r = s;
19
19
  });
20
20
  return () => {
21
- switch (e) {
21
+ switch (t) {
22
22
  case "pending":
23
- throw t;
23
+ throw a;
24
24
  case "success":
25
- return a;
25
+ return r;
26
26
  case "error":
27
- throw a;
27
+ throw r;
28
28
  default:
29
29
  throw new Error("Unknown status");
30
30
  }
31
31
  };
32
32
  };
33
- function Q(n, e) {
34
- const a = S({
33
+ function q(e, t) {
34
+ const r = k({
35
35
  silent: !0,
36
- differentBaseUrl: e == null ? void 0 : e.customBaseUrl,
37
- customToken: e == null ? void 0 : e.customToken
38
- }), [t, s] = x(null);
39
- return k(() => {
36
+ differentBaseUrl: t == null ? void 0 : t.customBaseUrl,
37
+ customToken: t == null ? void 0 : t.customToken
38
+ }), [a, s] = v(null);
39
+ return g(() => {
40
40
  (async () => {
41
- const o = a.get(n).then((r) => r.data);
42
- s($(o));
41
+ const n = r.get(e).then((u) => u.data);
42
+ s(y(n));
43
43
  })();
44
- }, [a, n]), t;
44
+ }, [r, e]), a;
45
45
  }
46
- const B = (n, e, a) => {
47
- let t = "pending", s;
48
- const l = n.then((o) => {
49
- t = "success", s = o;
50
- }, (o) => {
51
- const r = o == null ? void 0 : o.response;
52
- (r == null ? void 0 : r.status) === 404 && a ? (t = "error-404", s = o) : (t = "error", s = o);
46
+ const B = (e, t, r) => {
47
+ let a = "pending", s;
48
+ const c = e.then((n) => {
49
+ a = "success", s = n;
50
+ }, (n) => {
51
+ const u = n == null ? void 0 : n.response;
52
+ (u == null ? void 0 : u.status) === 404 && r ? (a = "error-404", s = n) : (a = "error", s = n);
53
53
  });
54
54
  return () => {
55
- switch (t) {
55
+ switch (a) {
56
56
  case "pending":
57
- throw l;
57
+ throw c;
58
58
  case "success":
59
59
  return s;
60
60
  case "error":
@@ -65,68 +65,99 @@ const B = (n, e, a) => {
65
65
  throw new Error("Unknown status");
66
66
  }
67
67
  };
68
- }, u = {
68
+ }, d = {
69
69
  loadOnInit: !0,
70
70
  silent: !1,
71
71
  enabled: !0,
72
72
  nullStateBeforeLoad: !0,
73
73
  nullStateOnFail: !1
74
- }, z = (n, { loadOnInit: e = u.loadOnInit, enabled: a = u.enabled, silent: t = u.silent, nullStateBeforeLoad: s = u.nullStateBeforeLoad, nullStateOnFail: l = u.nullStateOnFail, customApiUrl: o, customBearerToken: r, dataTransformer: i, errorBoundaryOn404: f } = u) => {
75
- const p = S({
76
- silent: t,
77
- customToken: r,
78
- differentBaseUrl: o,
79
- noToastOnStatus: f ? [404] : void 0
80
- }), { startLoading: h, stopLoading: g } = E(L), C = T(0), { isAuthenticated: w } = P(), [y, d] = x(null), m = U(async (c, b) => {
81
- if (!w() || a === !1)
74
+ }, z = (e, { loadOnInit: t = d.loadOnInit, enabled: r = d.enabled, silent: a = d.silent, nullStateBeforeLoad: s = d.nullStateBeforeLoad, nullStateOnFail: c = d.nullStateOnFail, customApiUrl: n, customBearerToken: u, dataTransformer: i, errorBoundaryOn404: o } = d) => {
75
+ const l = k({
76
+ silent: a,
77
+ customToken: u,
78
+ differentBaseUrl: n,
79
+ noToastOnStatus: o ? [404] : void 0
80
+ }), { startLoading: m, stopLoading: D } = $(P), T = I(0), { isAuthenticated: b } = E(), [A, h] = v(null), w = S(async (f, C) => {
81
+ if (!b() || r === !1)
82
82
  return;
83
- !t && h(`loadData-${n}-${b}`), s && d(null);
84
- const A = p.get(n, {
85
- signal: c
86
- }).then((D) => i ? i(D.data) : D.data).finally(() => !t && g(`loadData-${n}-${b}`));
87
- d(B(A, l ?? !1, f ?? !1));
83
+ !a && m(`loadData-${e}-${C}`), s && h(null);
84
+ const L = l.get(e, {
85
+ signal: f
86
+ }).then((x) => i ? i(x.data) : x.data).finally(() => !a && D(`loadData-${e}-${C}`));
87
+ h(B(L, c ?? !1, o ?? !1));
88
88
  }, [
89
- w,
89
+ b,
90
+ r,
90
91
  a,
91
- t,
92
- h,
93
- n,
92
+ m,
93
+ e,
94
94
  s,
95
- p,
96
- i,
97
- g,
98
95
  l,
99
- f
96
+ i,
97
+ D,
98
+ c,
99
+ o
100
100
  ]);
101
- return k(() => {
102
- if (e === !1)
101
+ return g(() => {
102
+ if (t === !1)
103
103
  return;
104
- const c = new AbortController();
105
- return m(c.signal, ++C.current), () => {
106
- c.abort();
104
+ const f = new AbortController();
105
+ return w(f.signal, ++T.current), () => {
106
+ f.abort();
107
+ };
108
+ }, [w, t]), { data: A, setData: h, reloadData: w };
109
+ }, p = {
110
+ storageKey: "--tmp-scroll-save--",
111
+ requiredHeight: 100,
112
+ retryInterval: 50
113
+ }, H = (e, { storageKey: t = p.storageKey, requiredHeight: r = p.requiredHeight, retryInterval: a = p.retryInterval } = p) => {
114
+ const [s, c] = v(!1), n = I(null), u = S(() => {
115
+ const o = localStorage.getItem(t);
116
+ return localStorage.removeItem(t), o === null ? null : Number(o);
117
+ }, [t]), i = S((o) => {
118
+ localStorage.setItem(t, o);
119
+ }, [t]);
120
+ return g(() => {
121
+ const o = window.setInterval(() => {
122
+ if (!s && e.current !== null && e.current.getBoundingClientRect().height > r) {
123
+ c(!0);
124
+ const l = u();
125
+ l !== null && e.current.scrollTo({ top: l }), window.clearInterval(o);
126
+ }
127
+ }, a);
128
+ return () => {
129
+ window.clearTimeout(o);
107
130
  };
108
- }, [m, e]), { data: y, setData: d, reloadData: m };
131
+ }, [s, r, u, a, e]), g(() => {
132
+ var l;
133
+ const o = new AbortController();
134
+ return (l = e.current) == null || l.addEventListener("scrollend", () => {
135
+ var m;
136
+ n.current = ((m = e.current) == null ? void 0 : m.scrollTop) ?? 0, i((n.current ?? 0).toString());
137
+ }, { signal: o.signal }), () => o.abort();
138
+ }, [i, e]), { saveValue: i, retrieveValue: u };
109
139
  };
110
140
  export {
111
141
  j as cancelToken,
112
- P as useAuth,
113
- S as useAxios,
114
- q as useClickOutside,
115
- H as useClipboard,
116
- J as useConfirm,
117
- le as useEmployeePhotoPath,
118
- V as useFormControlType,
119
- ne as useGetApiData,
142
+ E as useAuth,
143
+ k as useAxios,
144
+ J as useClickOutside,
145
+ K as useClipboard,
146
+ X as useConfirm,
147
+ it as useEmployeePhotoPath,
148
+ Y as useFormControlType,
149
+ ot as useGetApiData,
120
150
  z as useGetApiDataBound,
121
- Q as useGetDataBound,
122
- X as useKeyPress,
123
- re as useLocalStorageState,
124
- Y as useNotifications,
125
- _ as usePermissions,
126
- ee as usePrompt,
127
- ce as useRenderDraggableInPortal,
128
- ie as useSearchQuery,
129
- fe as useSearchQueryState,
130
- te as useWindowSize,
131
- se as useZodSchemaTypes
151
+ q as useGetDataBound,
152
+ _ as useKeyPress,
153
+ lt as useLocalStorageState,
154
+ tt as useNotifications,
155
+ et as usePermissions,
156
+ at as usePrompt,
157
+ dt as useRenderDraggableInPortal,
158
+ H as useScrollSave,
159
+ mt as useSearchQuery,
160
+ ft as useSearchQueryState,
161
+ st as useWindowSize,
162
+ rt as useZodSchemaTypes
132
163
  };
package/dist/layout.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { aM as I, j as e, c as i, Z as q, aC as R, bn as S, aE as $, by as A, bz as z } from "./nivo-bar.es-Cr3RGn0C.js";
2
- import { as as fe, bA as ge } from "./nivo-bar.es-Cr3RGn0C.js";
1
+ import { aM as I, j as e, c as i, Z as q, aC as R, bn as S, aE as $, by as A, bz as z } from "./nivo-bar.es-CMdSkNQH.js";
2
+ import { as as fe, bA as ge } from "./nivo-bar.es-CMdSkNQH.js";
3
3
  import { useState as L, useRef as T, useMemo as k, useEffect as F } from "react";
4
4
  import { Link as C } from "react-router-dom";
5
5
  import "react-hook-form";