react-luminus-components 2.0.4-table → 2.0.5-beta.r19-2
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/README.md +349 -349
- package/dist/.vite/manifest.json +52 -46
- package/dist/FormDisabledProvider-C8heDps-.js +51 -0
- package/dist/FormDisabledProvider-D0qy0L0K.cjs +1 -0
- package/dist/components/Buttons/ContextButton/FileUploadContextButton.d.ts +6 -3
- package/dist/components/Documents/components/DocumentsModals/components/CreateFolderModal/hooks/useDocCreateFolderForm.d.ts +4 -1
- package/dist/components/Documents/components/DocumentsModals/components/EditFileModal/hooks/useEditFileForm.d.ts +6 -1
- package/dist/components/Documents/hooks/useDocumentsReducer.d.ts +1 -1
- package/dist/components/Dropdown/comps/SimpleToggle/SimpleToggle.d.ts +6 -3
- package/dist/components/Dropdown/comps/UserAvatarToggle/UserAvatarToggle.d.ts +3 -1
- package/dist/components/Flexmonster/Flexmonster.d.ts +1 -1
- package/dist/components/Flexmonster/hooks/useReportVersionApi.d.ts +1 -1
- package/dist/components/Flexmonster/utils/flexMonsterUtils.d.ts +1 -1
- package/dist/components/HookForm/MiniDetailWrapper/MiniDetailWrapper.d.ts +1 -1
- package/dist/components/HookForm/TextInput/HookFormTextInput.d.ts +4 -17
- package/dist/components/InputContainers/FloatingLabelInput/FloatingLabelInput.d.ts +7 -38
- package/dist/components/InputContainers/NoInputContainer/NoInputContainer.d.ts +8 -38
- package/dist/components/InputContainers/RowLabelInput/RowLabelInput.d.ts +8 -38
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +3 -3
- package/dist/components/NotifCenter/Actions/components/HistoryTable/NotificationHistoryTable.d.ts +1 -1
- package/dist/components/ResponsiveContextDropdown/components/ResponsiveContextDropdownItem/ResponsiveContextDropdownItem.d.ts +1 -1
- package/dist/components/ResponsiveContextDropdown/hooks/useReponsiveContextDropdownHelpers.d.ts +2 -2
- package/dist/components/ResponsiveContextDropdown/utils/responsiveContextDropdownUtils.d.ts +1 -1
- package/dist/components/Tooltip/HtmlTooltip/HtmlTooltip.d.ts +2 -2
- package/dist/components/Tooltip/SimpleTooltip/SimpleTooltip.d.ts +1 -1
- package/dist/components/common/AuthTemplate/AuthTemplate.d.ts +1 -1
- package/dist/components/common/ColumnResizer/ColumnResizer.d.ts +1 -1
- package/dist/components/common/DisabledRowLabelLink/DisabledRowLabelLink.d.ts +1 -1
- package/dist/components/common/ErrorBoundary/ErrorBoundary.d.ts +7 -3
- package/dist/components/common/FromToDatePicker/components/FromToDatePickerDropdownToggle/FromToDatePickerDropdownToggle.d.ts +3 -1
- package/dist/components/common/HomeDashboard/comps/HomeDashboardWidget/HomeDashboardWidget.d.ts +15 -0
- package/dist/components/common/LineChart/comps/LineChartTooltip/LineChartTooltip.d.ts +2 -2
- package/dist/components/common/PermissionsSubstitute/Detail/hooks/useSubstDetailForm.d.ts +8 -1
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/PhotoPreviews.d.ts +15 -0
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/PhotoPreview/PhotoPreview.d.ts +14 -0
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/PhotoPreview/comps/PreviewShadow/PreviewShadow.d.ts +5 -0
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/PhotoPreview/comps/index.d.ts +1 -0
- package/dist/components/common/PhotoLightbox/comps/PhotoPreviews/comps/index.d.ts +1 -0
- package/dist/components/common/PhotoLightbox/comps/index.d.ts +1 -0
- package/dist/components/common/QrCode/QrCode.d.ts +1 -1
- package/dist/components/common/RouteLink/RouteLink.d.ts +1 -1
- package/dist/components/common/SimplePicker/SimplePicker.d.ts +1 -1
- package/dist/components/common/index.d.ts +0 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +542 -941
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useAxios/useAxios.d.ts +5 -2
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +1 -1
- package/dist/hooks/useGetApiDataBound/useGetApiDataBound.d.ts +3 -0
- package/dist/hooks/useGetDataBound/useGetDataBound.d.ts +4 -2
- package/dist/hooks/useIsFormDirty/useIsFormDirty.d.ts +7 -0
- package/dist/hooks/useScrollSave/useScrollSave.d.ts +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +206 -136
- package/dist/layout/SideMenu/SideMenu.d.ts +3 -1
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +282 -141
- package/dist/{localStorageUtils-DdeuyghB.js → localStorageUtils-CZ4HDRzi.js} +18 -8
- package/dist/localStorageUtils-CkZslzIU.cjs +1 -0
- package/dist/main.cjs.js +22 -184
- package/dist/main.es.js +11317 -11418
- package/dist/models/bntTable/IBnfTableDefColumn.d.ts +40 -0
- package/dist/models/prop-types/InputContainerProps.d.ts +4 -12
- package/dist/models/prop-types/InputProps/DropdownPickerProps.d.ts +1 -1
- package/dist/models/prop-types/InputProps/InputBaseProps.d.ts +4 -2
- package/dist/models/prop-types/InputProps/NumericInputProps.d.ts +1 -1
- package/dist/models/prop-types/InputProps/TextInputProps.d.ts +1 -1
- package/dist/models/ui/notifications/NotificationHistoryTableModel.d.ts +6 -0
- package/dist/nivo-bar-BcQddlHb.js +41895 -0
- package/dist/nivo-bar-GEZlEbHd.cjs +326 -0
- package/dist/style.css +1 -1
- package/dist/useIsFormDirty-B125NdWZ.js +123 -0
- package/dist/useIsFormDirty-DORaJxqb.cjs +1 -0
- package/dist/useLocalStorageState-CMX4R5vm.js +95 -0
- package/dist/useLocalStorageState-DjAdoFfQ.cjs +1 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/route/apiPathUtils.d.ts +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +133 -159
- package/dist/variables.scss +165 -165
- package/package.json +128 -123
- package/dist/FormDisabledProvider-1MOB6N34.cjs +0 -1
- package/dist/FormDisabledProvider-CHZ2m_zJ.js +0 -40
- package/dist/ShortcutLinksContext-DEirK-v9.js +0 -39884
- package/dist/ShortcutLinksContext-DLi4B8z5.cjs +0 -334
- package/dist/components/NotifCenter/Actions/types/NotificationHistoryTableModel.d.ts +0 -5
- package/dist/components/common/StrictModeDroppable/StrictModeDroppable.d.ts +0 -5
- package/dist/localStorageUtils-89Gfn6XS.cjs +0 -1
- package/dist/useLocalStorageState-B-CRodSS.cjs +0 -1
- package/dist/useLocalStorageState-BPYqQMTu.js +0 -78
- package/dist/useRenderDraggableInPortal-D0OLp7Qb.js +0 -78
- package/dist/useRenderDraggableInPortal-QPCaw-E_.cjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=require("react-router-dom"),s=(r,t,o)=>{let e=r;return t!==void 0&&(e=Math.max(e,t)),o!==void 0&&(e=Math.min(e,o)),e};function u(r,t){r.setValue(t,null)}function S(r,t){t.forEach(o=>{u(r,o)})}const l=(r,t,o=!0)=>Object.keys(r).reduce((e,n)=>{const c=r[n];return o&&c==null||(e[n]=t(c,n)),e},{}),a=(r,t)=>{const o=t!=null&&t.query?new URLSearchParams(l(t.query,e=>(e==null?void 0:e.toString())??"")):null;return`${i.generatePath(r,t!=null&&t.path?l(t.path,e=>(e==null?void 0:e.toString())??null):void 0)}${o&&o.size>0?`?${o.toString()}`:""}`},g=[{key:"msal",mode:"includes"},{key:"token",mode:"exact"},{key:"user",mode:"exact"},{key:"user-delegation",mode:"exact"}],h=(r=!0)=>{const t={};for(let o=0;o<localStorage.length;o++){const e=localStorage.key(o);if(e&&!(r&&g.some(({key:n,mode:c})=>c==="includes"?e.includes(n):e===n)))try{t[e]=JSON.parse(localStorage.getItem(e))}catch{t[e]=localStorage.getItem(e)}}return t},f=r=>{try{const t=JSON.parse(r);if(typeof t!="object"||t===null)return!1;Object.entries(t).forEach(([o,e])=>{localStorage.setItem(o,JSON.stringify(e))})}catch{return!1}return localStorage.removeItem("BnfTable-SettingsMigration"),!0};exports.dumpLocalStorage=h;exports.generateApiPath=a;exports.hookFormSetNull=u;exports.hookFormSetNulls=S;exports.limitNumber=s;exports.restoreLocalStorage=f;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const S=require("./ShortcutLinksContext-DLi4B8z5.cjs"),t=require("react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const r={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},m=(e,{loadOnInit:u=r.loadOnInit,enabled:n=r.enabled,silent:a=r.silent,nullStateBeforeLoad:c=r.nullStateBeforeLoad,nullStateOnFail:i=r.nullStateOnFail,customApiUrl:o,customBearerToken:I,dataTransformer:g}=r)=>{const C=S.useAxios({silent:a,customToken:I,differentBaseUrl:o}),[O,L]=t.useState(!1),{startLoading:b,stopLoading:D}=t.useContext(S.LoadingContext),R=t.useRef(0),{isAuthenticated:q}=S.useAuth(),p=t.useCallback(s=>{b(s),L(()=>!0)},[b]),x=t.useCallback(s=>{D(s),L(()=>!1)},[D]),[$,d]=t.useState(null),l=t.useCallback(async(s,h)=>{if(!q()||n===!1)return null;!a&&p(`loadData-${e}-${h}`),c&&d(null);let k;try{const f=await C.get(e,{signal:s}),A=g?g(f.data):f.data;d(A),k=A}catch(f){throw i&&d(null),f}finally{!a&&x(`loadData-${e}-${h}`)}return k},[q,n,a,p,e,c,C,g,i,x]),w=t.useCallback(async()=>{l()},[l]),y=t.useCallback(async()=>l(),[l]);return t.useEffect(()=>{if(u===!1)return;const s=new AbortController;return l(s.signal,++R.current),()=>{s.abort()}},[l,u]),{data:$,setData:d,reloadData:w,isLoading:O,reloadDataWithReturn:y}},v=(e,u)=>{const n=t.useCallback(()=>{const o=localStorage.getItem(e);return o!=null&&o!=="undefined"?JSON.parse(o):u},[u,e]),[a,c]=t.useState(n);t.useEffect(()=>{localStorage.setItem(e,JSON.stringify(a))},[e,a]);const i=t.useCallback(()=>{c(n)},[n]);return[a,c,i]};exports.useGetApiData=m;exports.useLocalStorageState=v;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { aw as J, aX as N, ar as E } from "./ShortcutLinksContext-DEirK-v9.js";
|
|
2
|
-
import { useState as p, useContext as F, useRef as G, useCallback as e, useEffect as O } from "react";
|
|
3
|
-
import "react-router-dom";
|
|
4
|
-
import "react-dom";
|
|
5
|
-
import "react-hook-form";
|
|
6
|
-
import "react-flexmonster";
|
|
7
|
-
import "@azure/msal-browser";
|
|
8
|
-
import "@azure/msal-react";
|
|
9
|
-
const l = {
|
|
10
|
-
loadOnInit: !0,
|
|
11
|
-
silent: !1,
|
|
12
|
-
enabled: !0,
|
|
13
|
-
nullStateBeforeLoad: !0,
|
|
14
|
-
nullStateOnFail: !1
|
|
15
|
-
}, M = (t, { loadOnInit: i = l.loadOnInit, enabled: n = l.enabled, silent: a = l.silent, nullStateBeforeLoad: c = l.nullStateBeforeLoad, nullStateOnFail: u = l.nullStateOnFail, customApiUrl: s, customBearerToken: w, dataTransformer: g } = l) => {
|
|
16
|
-
const m = J({
|
|
17
|
-
silent: a,
|
|
18
|
-
customToken: w,
|
|
19
|
-
differentBaseUrl: s
|
|
20
|
-
}), [$, S] = p(!1), { startLoading: L, stopLoading: D } = F(N), y = G(0), { isAuthenticated: x } = E(), C = e((o) => {
|
|
21
|
-
L(o), S(() => !0);
|
|
22
|
-
}, [L]), I = e((o) => {
|
|
23
|
-
D(o), S(() => !1);
|
|
24
|
-
}, [D]), [R, d] = p(null), r = e(async (o, b) => {
|
|
25
|
-
if (!x() || n === !1)
|
|
26
|
-
return null;
|
|
27
|
-
!a && C(`loadData-${t}-${b}`), c && d(null);
|
|
28
|
-
let h;
|
|
29
|
-
try {
|
|
30
|
-
const f = await m.get(t, {
|
|
31
|
-
signal: o
|
|
32
|
-
}), A = g ? g(f.data) : f.data;
|
|
33
|
-
d(A), h = A;
|
|
34
|
-
} catch (f) {
|
|
35
|
-
throw u && d(null), f;
|
|
36
|
-
} finally {
|
|
37
|
-
!a && I(`loadData-${t}-${b}`);
|
|
38
|
-
}
|
|
39
|
-
return h;
|
|
40
|
-
}, [
|
|
41
|
-
x,
|
|
42
|
-
n,
|
|
43
|
-
a,
|
|
44
|
-
C,
|
|
45
|
-
t,
|
|
46
|
-
c,
|
|
47
|
-
m,
|
|
48
|
-
g,
|
|
49
|
-
u,
|
|
50
|
-
I
|
|
51
|
-
]), v = e(async () => {
|
|
52
|
-
r();
|
|
53
|
-
}, [r]), B = e(async () => r(), [r]);
|
|
54
|
-
return O(() => {
|
|
55
|
-
if (i === !1)
|
|
56
|
-
return;
|
|
57
|
-
const o = new AbortController();
|
|
58
|
-
return r(o.signal, ++y.current), () => {
|
|
59
|
-
o.abort();
|
|
60
|
-
};
|
|
61
|
-
}, [r, i]), { data: R, setData: d, reloadData: v, isLoading: $, reloadDataWithReturn: B };
|
|
62
|
-
}, P = (t, i) => {
|
|
63
|
-
const n = e(() => {
|
|
64
|
-
const s = localStorage.getItem(t);
|
|
65
|
-
return s != null && s !== "undefined" ? JSON.parse(s) : i;
|
|
66
|
-
}, [i, t]), [a, c] = p(n);
|
|
67
|
-
O(() => {
|
|
68
|
-
localStorage.setItem(t, JSON.stringify(a));
|
|
69
|
-
}, [t, a]);
|
|
70
|
-
const u = e(() => {
|
|
71
|
-
c(n);
|
|
72
|
-
}, [n]);
|
|
73
|
-
return [a, c, u];
|
|
74
|
-
};
|
|
75
|
-
export {
|
|
76
|
-
P as a,
|
|
77
|
-
M as u
|
|
78
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { useCallback as f, useMemo as a, useRef as P, useEffect as S } from "react";
|
|
2
|
-
import { useSearchParams as p } from "react-router-dom";
|
|
3
|
-
import { createPortal as y } from "react-dom";
|
|
4
|
-
const N = () => {
|
|
5
|
-
const [o, t] = p(), r = f((s, n) => {
|
|
6
|
-
o.get(s) !== n && t((c) => (n === null && c.delete(s), c.get(s) === n || c.set(s, n ?? ""), c), { replace: !0 });
|
|
7
|
-
}, [t, o]);
|
|
8
|
-
return {
|
|
9
|
-
searchParams: o,
|
|
10
|
-
setSearch: r
|
|
11
|
-
};
|
|
12
|
-
}, b = "\0", C = (o, t, r) => {
|
|
13
|
-
const { searchParams: s, setSearch: n } = N(), c = f((e) => {
|
|
14
|
-
if (typeof e == "object") {
|
|
15
|
-
if (r && r === "date" || !r && e instanceof Date) {
|
|
16
|
-
if (!(e instanceof Date))
|
|
17
|
-
throw new Error("Tried to setQueryState of type Date to non-date.");
|
|
18
|
-
return e.toISOString();
|
|
19
|
-
}
|
|
20
|
-
return JSON.stringify(e);
|
|
21
|
-
}
|
|
22
|
-
return e.toString();
|
|
23
|
-
}, [r]), l = a(() => c(t), [t, c]), m = a(() => s.get(o), [o, s]), h = a(() => {
|
|
24
|
-
const e = m;
|
|
25
|
-
if (e === b)
|
|
26
|
-
return null;
|
|
27
|
-
const u = e ? Number(e) : t;
|
|
28
|
-
let i = Number.isNaN(u) ? typeof t : "number";
|
|
29
|
-
switch (i === "object" && t instanceof Date && (i = "date"), r ?? i) {
|
|
30
|
-
case "number":
|
|
31
|
-
return u;
|
|
32
|
-
case "string":
|
|
33
|
-
return e ?? t;
|
|
34
|
-
case "boolean":
|
|
35
|
-
return e === "true";
|
|
36
|
-
case "object":
|
|
37
|
-
return e ? JSON.parse(e) : t;
|
|
38
|
-
case "date":
|
|
39
|
-
return e ? new Date(e) : t;
|
|
40
|
-
default:
|
|
41
|
-
throw console.error(r, i), new Error(`useSearchQueryState is not implemented for type ${typeof (r ?? i)}.`);
|
|
42
|
-
}
|
|
43
|
-
}, [t, m, r]), g = f((e) => {
|
|
44
|
-
let u;
|
|
45
|
-
typeof e == "function" ? u = e(h) : u = e;
|
|
46
|
-
const i = c(u);
|
|
47
|
-
if (t === u || i === l) {
|
|
48
|
-
n(o, null);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (u === null) {
|
|
52
|
-
n(o, b);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
n(o, i);
|
|
56
|
-
}, [t, l, c, o, n, h]);
|
|
57
|
-
return [h, g];
|
|
58
|
-
}, Q = (o) => {
|
|
59
|
-
const t = a(() => Math.floor(Math.random() * 900) + 100, []), r = a(() => btoa(o.toString() ?? ""), [o]), s = a(() => `employeePhotos?personalNumber=${t}${r}&small=false`, [t, r]), n = a(() => `employeePhotos?personalNumber=${t}${r}&small=true`, [t, r]);
|
|
60
|
-
return { photoPath: s, photoPathSm: n };
|
|
61
|
-
}, T = () => {
|
|
62
|
-
const o = P({}).current;
|
|
63
|
-
return S(() => {
|
|
64
|
-
const t = document.createElement("div");
|
|
65
|
-
return t.style.position = "absolute", t.style.pointerEvents = "none", t.style.top = "0", t.style.width = "100%", t.style.height = "100%", o.elt = t, document.body.appendChild(t), () => {
|
|
66
|
-
document.body.removeChild(t);
|
|
67
|
-
};
|
|
68
|
-
}, [o]), (t) => (r, ...s) => {
|
|
69
|
-
const n = t(r, ...s);
|
|
70
|
-
return r.draggableProps.style.position === "fixed" ? y(n, o.elt) : n;
|
|
71
|
-
};
|
|
72
|
-
};
|
|
73
|
-
export {
|
|
74
|
-
N as a,
|
|
75
|
-
C as b,
|
|
76
|
-
Q as c,
|
|
77
|
-
T as u
|
|
78
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const n=require("react"),P=require("react-router-dom"),S=require("react-dom"),b=()=>{const[o,e]=P.useSearchParams(),r=n.useCallback((u,s)=>{o.get(u)!==s&&e(c=>(s===null&&c.delete(u),c.get(u)===s||c.set(u,s??""),c),{replace:!0})},[e,o]);return{searchParams:o,setSearch:r}},f="\0",y=(o,e,r)=>{const{searchParams:u,setSearch:s}=b(),c=n.useCallback(t=>{if(typeof t=="object"){if(r&&r==="date"||!r&&t instanceof Date){if(!(t instanceof Date))throw new Error("Tried to setQueryState of type Date to non-date.");return t.toISOString()}return JSON.stringify(t)}return t.toString()},[r]),l=n.useMemo(()=>c(e),[e,c]),m=n.useMemo(()=>u.get(o),[o,u]),h=n.useMemo(()=>{const t=m;if(t===f)return null;const a=t?Number(t):e;let i=Number.isNaN(a)?typeof e:"number";switch(i==="object"&&e instanceof Date&&(i="date"),r??i){case"number":return a;case"string":return t??e;case"boolean":return t==="true";case"object":return t?JSON.parse(t):e;case"date":return t?new Date(t):e;default:throw console.error(r,i),new Error(`useSearchQueryState is not implemented for type ${typeof(r??i)}.`)}},[e,m,r]),g=n.useCallback(t=>{let a;typeof t=="function"?a=t(h):a=t;const i=c(a);if(e===a||i===l){s(o,null);return}if(a===null){s(o,f);return}s(o,i)},[e,l,c,o,s,h]);return[h,g]},M=o=>{const e=n.useMemo(()=>Math.floor(Math.random()*900)+100,[]),r=n.useMemo(()=>btoa(o.toString()??""),[o]),u=n.useMemo(()=>`employeePhotos?personalNumber=${e}${r}&small=false`,[e,r]),s=n.useMemo(()=>`employeePhotos?personalNumber=${e}${r}&small=true`,[e,r]);return{photoPath:u,photoPathSm:s}},D=()=>{const o=n.useRef({}).current;return n.useEffect(()=>{const e=document.createElement("div");return e.style.position="absolute",e.style.pointerEvents="none",e.style.top="0",e.style.width="100%",e.style.height="100%",o.elt=e,document.body.appendChild(e),()=>{document.body.removeChild(e)}},[o]),e=>(r,...u)=>{const s=e(r,...u);return r.draggableProps.style.position==="fixed"?S.createPortal(s,o.elt):s}};exports.useEmployeePhotoPath=M;exports.useRenderDraggableInPortal=D;exports.useSearchQuery=b;exports.useSearchQueryState=y;
|