react-luminus-components 2.0.5-beta.r19-26 → 2.0.6
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 +48 -37
- package/dist/FormDisabledProvider--0DdMCBK.cjs +1 -0
- package/dist/{FormDisabledProvider-BlRae2l2.js → FormDisabledProvider-CQ3lr_vU.js} +1 -1
- package/dist/ShortcutLinksContext-CzUA0Bw_.cjs +285 -0
- package/dist/{nivo-bar-BHzU38wt.js → ShortcutLinksContext-DGg3i3jj.js} +20917 -20917
- package/dist/components/NotifCenter/Actions/NotificationActions.d.ts +7 -3
- package/dist/components/NotifCenter/Actions/components/index.d.ts +2 -0
- package/dist/components/NotifCenter/Actions/components/modals/NotificationActionAddModal.d.ts +11 -0
- package/dist/components/NotifCenter/Actions/components/modals/NotificationTemplateAddModal.d.ts +13 -0
- package/dist/components/NotifCenter/Actions/components/modals/NotificationTemplateEditModal.d.ts +6 -4
- package/dist/components/NotifCenter/NotifStyles/NotifStyles.d.ts +10 -0
- package/dist/components/NotifCenter/NotifStyles/hooks/useNotifStyleFormSchema.d.ts +20 -0
- package/dist/components/NotifCenter/NotifStyles/hooks/useNotifStyleTableColumns.d.ts +7 -0
- package/dist/components/NotifCenter/index.d.ts +1 -0
- package/dist/components/UserSettings/LanguageSettingsUS/LanguageSettingsUS.d.ts +2 -0
- package/dist/components/UserSettings/index.d.ts +1 -0
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +13 -13
- 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 +108 -107
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +59 -59
- package/dist/main.cjs.js +15 -15
- package/dist/main.d.ts +1 -0
- package/dist/main.es.js +11304 -10804
- package/dist/models/index.d.ts +3 -0
- package/dist/models/texts/NotifCentrumTexts.d.ts +15 -0
- package/dist/models/texts/UserSettingsTexts.d.ts +1 -0
- package/dist/models/types/notifCenter/NotifStyleModel.d.ts +6 -0
- package/dist/models/types/notifCenter/NotifTemplateCreateModel.d.ts +11 -0
- package/dist/models/types/notifCenter/NotifTemplateEditModel.d.ts +6 -0
- package/dist/models/types/notifCenter/NotificationAttachmentModel.d.ts +4 -0
- package/dist/models/types/notifCenter/NotificationModel.d.ts +2 -1
- package/dist/models/types/notifCenter/NotificationTemplate.d.ts +3 -1
- package/dist/queryStorage-C8e71gxx.js +30 -0
- package/dist/queryStorage-Dk70bkj7.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/useIsFormDirty-CLUo8jl7.cjs +1 -0
- package/dist/useIsFormDirty-ebfGUdgb.js +117 -0
- package/dist/{useLocalStorageState-B2v6hClT.js → useLocalStorageState-9W8xZxsD.js} +20 -20
- package/dist/useLocalStorageState-nJ8QPdoa.cjs +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +76 -101
- package/dist/variables.scss +165 -165
- package/package.json +127 -127
- package/dist/FormDisabledProvider-CiGUtSf7.cjs +0 -1
- package/dist/nivo-bar-C1VYGnTR.cjs +0 -285
- package/dist/useIsFormDirty-BhBtGgzZ.cjs +0 -1
- package/dist/useIsFormDirty-GgEve4W-.js +0 -123
- package/dist/useLocalStorageState-AB4BFfn5.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const w=require("./ShortcutLinksContext-CzUA0Bw_.cjs"),F=require("react-router");require("react/jsx-runtime");const q=require("react");require("@azure/msal-browser");require("@azure/msal-react");require("react-dom");const I=require("react-hook-form");require("react-flexmonster");const b=require("./queryStorage-Dk70bkj7.cjs"),x=()=>{const r=w.compilerRuntimeExports.c(6),[t,o]=F.useSearchParams();let e;r[0]!==t||r[1]!==o?(e=(n,u)=>{t.get(n)!==u&&o(l=>(u===null&&l.delete(n),l.get(n)===u||l.set(n,u??""),l),{replace:!0})},r[0]=t,r[1]=o,r[2]=e):e=r[2];const i=e;let s;return r[3]!==t||r[4]!==i?(s={searchParams:t,setSearch:i},r[3]=t,r[4]=i,r[5]=s):s=r[5],s},N="\0",Q=r=>t=>(window.addEventListener(`queryStorage_${r}`,t),()=>window.removeEventListener(`queryStorage_${r}`,t)),_=(r,t,o)=>{const e=r;if(e===N)return null;const i=e?Number(e):t;let s=Number.isNaN(i)?typeof t:"number";switch(s==="object"&&t instanceof Date&&(s="date"),o??s){case"number":return i;case"string":return e??t;case"boolean":return e==="true";case"object":return e?JSON.parse(e):t;case"date":return e?new Date(e):t;default:throw console.error(o,s),new Error(`useSearchQueryState is not implemented for type ${typeof(o??s)}.`)}},L=(r,t,o)=>{const e=w.compilerRuntimeExports.c(22),[i]=q.useState(t);let s;e[0]!==o?(s=c=>{if(typeof c=="object"){if(o&&o==="date"||!o&&c instanceof Date){if(!(c instanceof Date))throw new Error("Tried to setQueryState of type Date to non-date.");return c.toISOString()}return JSON.stringify(c)}return c.toString()},e[0]=o,e[1]=s):s=e[1];const n=s;let u;e[2]!==n||e[3]!==t?(u=n(t),e[2]=n,e[3]=t,e[4]=u):u=e[4];const l=u;let f;e[5]!==t?(f=JSON.stringify(t),e[5]=t,e[6]=f):f=e[6];const y=q.useRef(f),d=q.useRef(t);let S;e[7]!==r||e[8]!==i||e[9]!==o?(S=()=>{const c=b.queryStorage.getItem(r);return c!==y.current&&(y.current=c,d.current=_(c,i,o)),d.current},e[7]=r,e[8]=i,e[9]=o,e[10]=S):S=e[10];const g=S;let h;e[11]!==r?(h=Q(r),e[11]=r,e[12]=h):h=e[12];const R=h,E=q.useSyncExternalStore(R,g);let a;e[13]!==l||e[14]!==g||e[15]!==n||e[16]!==t||e[17]!==r?(a=c=>{const $=typeof c=="function"?c(g()):c,D=n($);if(t===$||D===l){b.queryStorage.removeItem(r),window.dispatchEvent(new Event(`queryStorage_${r}`));return}if($===null){b.queryStorage.setItem(r,N),window.dispatchEvent(new Event(`queryStorage_${r}`));return}b.queryStorage.setItem(r,D),window.dispatchEvent(new Event(`queryStorage_${r}`))},e[13]=l,e[14]=g,e[15]=n,e[16]=t,e[17]=r,e[18]=a):a=e[18];const P=a;let m;return e[19]!==P||e[20]!==E?(m=[E,P],e[19]=P,e[20]=E,e[21]=m):m=e[21],m},T=r=>{const t=w.compilerRuntimeExports.c(5),o=Math.floor(Math.random()*900)+100;let e;t[0]!==r?(e=btoa(r.toString()??""),t[0]=r,t[1]=e):e=t[1];const i=e,s=`employeePhotos?personalNumber=${o}${i}&small=false`,n=`employeePhotos?personalNumber=${o}${i}&small=true`;let u;return t[2]!==s||t[3]!==n?(u={photoPath:s,photoPathSm:n},t[2]=s,t[3]=n,t[4]=u):u=t[4],u},j=({control:r}={})=>{"use no memo";const{dirtyFields:t}=I.useFormState({control:r});return Object.keys(t).length>0};exports.useEmployeePhotoPath=T;exports.useIsFormDirty=j;exports.useSearchQuery=x;exports.useSearchQueryState=L;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { c as P } from "./ShortcutLinksContext-DGg3i3jj.js";
|
|
2
|
+
import { useSearchParams as I } from "react-router";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import { useState as _, useRef as p, useSyncExternalStore as F } from "react";
|
|
5
|
+
import "@azure/msal-browser";
|
|
6
|
+
import "@azure/msal-react";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import { useFormState as T } from "react-hook-form";
|
|
9
|
+
import "react-flexmonster";
|
|
10
|
+
import { q as b } from "./queryStorage-C8e71gxx.js";
|
|
11
|
+
const A = () => {
|
|
12
|
+
const o = P.c(6), [e, r] = I();
|
|
13
|
+
let t;
|
|
14
|
+
o[0] !== e || o[1] !== r ? (t = (n, c) => {
|
|
15
|
+
e.get(n) !== c && r((f) => (c === null && f.delete(n), f.get(n) === c || f.set(n, c ?? ""), f), {
|
|
16
|
+
replace: !0
|
|
17
|
+
});
|
|
18
|
+
}, o[0] = e, o[1] = r, o[2] = t) : t = o[2];
|
|
19
|
+
const i = t;
|
|
20
|
+
let s;
|
|
21
|
+
return o[3] !== e || o[4] !== i ? (s = {
|
|
22
|
+
searchParams: e,
|
|
23
|
+
setSearch: i
|
|
24
|
+
}, o[3] = e, o[4] = i, o[5] = s) : s = o[5], s;
|
|
25
|
+
}, q = "\0", j = (o) => (e) => (window.addEventListener(`queryStorage_${o}`, e), () => window.removeEventListener(`queryStorage_${o}`, e)), x = (o, e, r) => {
|
|
26
|
+
const t = o;
|
|
27
|
+
if (t === q)
|
|
28
|
+
return null;
|
|
29
|
+
const i = t ? Number(t) : e;
|
|
30
|
+
let s = Number.isNaN(i) ? typeof e : "number";
|
|
31
|
+
switch (s === "object" && e instanceof Date && (s = "date"), r ?? s) {
|
|
32
|
+
case "number":
|
|
33
|
+
return i;
|
|
34
|
+
case "string":
|
|
35
|
+
return t ?? e;
|
|
36
|
+
case "boolean":
|
|
37
|
+
return t === "true";
|
|
38
|
+
case "object":
|
|
39
|
+
return t ? JSON.parse(t) : e;
|
|
40
|
+
case "date":
|
|
41
|
+
return t ? new Date(t) : e;
|
|
42
|
+
default:
|
|
43
|
+
throw console.error(r, s), new Error(`useSearchQueryState is not implemented for type ${typeof (r ?? s)}.`);
|
|
44
|
+
}
|
|
45
|
+
}, B = (o, e, r) => {
|
|
46
|
+
const t = P.c(22), [i] = _(e);
|
|
47
|
+
let s;
|
|
48
|
+
t[0] !== r ? (s = (u) => {
|
|
49
|
+
if (typeof u == "object") {
|
|
50
|
+
if (r && r === "date" || !r && u instanceof Date) {
|
|
51
|
+
if (!(u instanceof Date))
|
|
52
|
+
throw new Error("Tried to setQueryState of type Date to non-date.");
|
|
53
|
+
return u.toISOString();
|
|
54
|
+
}
|
|
55
|
+
return JSON.stringify(u);
|
|
56
|
+
}
|
|
57
|
+
return u.toString();
|
|
58
|
+
}, t[0] = r, t[1] = s) : s = t[1];
|
|
59
|
+
const n = s;
|
|
60
|
+
let c;
|
|
61
|
+
t[2] !== n || t[3] !== e ? (c = n(e), t[2] = n, t[3] = e, t[4] = c) : c = t[4];
|
|
62
|
+
const f = c;
|
|
63
|
+
let l;
|
|
64
|
+
t[5] !== e ? (l = JSON.stringify(e), t[5] = e, t[6] = l) : l = t[6];
|
|
65
|
+
const d = p(l), N = p(e);
|
|
66
|
+
let m;
|
|
67
|
+
t[7] !== o || t[8] !== i || t[9] !== r ? (m = () => {
|
|
68
|
+
const u = b.getItem(o);
|
|
69
|
+
return u !== d.current && (d.current = u, N.current = x(u, i, r)), N.current;
|
|
70
|
+
}, t[7] = o, t[8] = i, t[9] = r, t[10] = m) : m = t[10];
|
|
71
|
+
const g = m;
|
|
72
|
+
let h;
|
|
73
|
+
t[11] !== o ? (h = j(o), t[11] = o, t[12] = h) : h = t[12];
|
|
74
|
+
const $ = F(h, g);
|
|
75
|
+
let S;
|
|
76
|
+
t[13] !== f || t[14] !== g || t[15] !== n || t[16] !== e || t[17] !== o ? (S = (u) => {
|
|
77
|
+
const E = typeof u == "function" ? u(g()) : u, D = n(E);
|
|
78
|
+
if (e === E || D === f) {
|
|
79
|
+
b.removeItem(o), window.dispatchEvent(new Event(`queryStorage_${o}`));
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (E === null) {
|
|
83
|
+
b.setItem(o, q), window.dispatchEvent(new Event(`queryStorage_${o}`));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
b.setItem(o, D), window.dispatchEvent(new Event(`queryStorage_${o}`));
|
|
87
|
+
}, t[13] = f, t[14] = g, t[15] = n, t[16] = e, t[17] = o, t[18] = S) : S = t[18];
|
|
88
|
+
const w = S;
|
|
89
|
+
let a;
|
|
90
|
+
return t[19] !== w || t[20] !== $ ? (a = [$, w], t[19] = w, t[20] = $, t[21] = a) : a = t[21], a;
|
|
91
|
+
}, H = (o) => {
|
|
92
|
+
const e = P.c(5), r = Math.floor(Math.random() * 900) + 100;
|
|
93
|
+
let t;
|
|
94
|
+
e[0] !== o ? (t = btoa(o.toString() ?? ""), e[0] = o, e[1] = t) : t = e[1];
|
|
95
|
+
const i = t, s = `employeePhotos?personalNumber=${r}${i}&small=false`, n = `employeePhotos?personalNumber=${r}${i}&small=true`;
|
|
96
|
+
let c;
|
|
97
|
+
return e[2] !== s || e[3] !== n ? (c = {
|
|
98
|
+
photoPath: s,
|
|
99
|
+
photoPathSm: n
|
|
100
|
+
}, e[2] = s, e[3] = n, e[4] = c) : c = e[4], c;
|
|
101
|
+
}, W = ({
|
|
102
|
+
control: o
|
|
103
|
+
} = {}) => {
|
|
104
|
+
"use no memo";
|
|
105
|
+
const {
|
|
106
|
+
dirtyFields: e
|
|
107
|
+
} = T({
|
|
108
|
+
control: o
|
|
109
|
+
});
|
|
110
|
+
return Object.keys(e).length > 0;
|
|
111
|
+
};
|
|
112
|
+
export {
|
|
113
|
+
B as a,
|
|
114
|
+
H as b,
|
|
115
|
+
W as c,
|
|
116
|
+
A as u
|
|
117
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { az as E, aZ as F, au as G, c as J } from "./ShortcutLinksContext-DGg3i3jj.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import { useState as C, useContext as N, useRef as O, useCallback as L, useEffect as R } from "react";
|
|
4
4
|
import "react-router";
|
|
@@ -13,18 +13,18 @@ const p = {
|
|
|
13
13
|
enabled: !0,
|
|
14
14
|
nullStateBeforeLoad: !0,
|
|
15
15
|
nullStateOnFail: !1
|
|
16
|
-
},
|
|
16
|
+
}, P = (e, {
|
|
17
17
|
loadOnInit: l = p.loadOnInit,
|
|
18
18
|
enabled: t = p.enabled,
|
|
19
|
-
silent:
|
|
19
|
+
silent: o = p.silent,
|
|
20
20
|
nullStateBeforeLoad: i = p.nullStateBeforeLoad,
|
|
21
|
-
nullStateOnFail:
|
|
21
|
+
nullStateOnFail: a = p.nullStateOnFail,
|
|
22
22
|
customApiUrl: m,
|
|
23
23
|
customBearerToken: d,
|
|
24
24
|
dataTransformer: s
|
|
25
25
|
} = p) => {
|
|
26
26
|
const n = E({
|
|
27
|
-
silent:
|
|
27
|
+
silent: o,
|
|
28
28
|
customToken: d,
|
|
29
29
|
differentBaseUrl: m
|
|
30
30
|
}), [g, c] = C(0), {
|
|
@@ -35,7 +35,7 @@ const p = {
|
|
|
35
35
|
} = G(), [w, S] = C(null), h = O(l ?? !1), f = L(async (D, A) => {
|
|
36
36
|
if (!b() || t === !1)
|
|
37
37
|
return null;
|
|
38
|
-
c((r) => r + 1), !
|
|
38
|
+
c((r) => r + 1), !o && u(`loadData-${e}-${A}`), i && S(null);
|
|
39
39
|
let $;
|
|
40
40
|
try {
|
|
41
41
|
const r = await n.get(e, {
|
|
@@ -43,12 +43,12 @@ const p = {
|
|
|
43
43
|
}), I = s ? s(r.data) : r.data;
|
|
44
44
|
S(I), $ = I;
|
|
45
45
|
} catch (r) {
|
|
46
|
-
throw
|
|
46
|
+
throw a && S(null), r;
|
|
47
47
|
} finally {
|
|
48
|
-
h.current = !1, c((r) => r - 1), !
|
|
48
|
+
h.current = !1, c((r) => r - 1), !o && x(`loadData-${e}-${A}`);
|
|
49
49
|
}
|
|
50
50
|
return $;
|
|
51
|
-
}, [b, t,
|
|
51
|
+
}, [b, t, o, u, e, i, n, s, a, x]), U = L(async () => {
|
|
52
52
|
f();
|
|
53
53
|
}, [f]), B = L(async () => f(), [f]);
|
|
54
54
|
return R(() => {
|
|
@@ -69,27 +69,27 @@ const p = {
|
|
|
69
69
|
isLoading: h.current || g > 0,
|
|
70
70
|
reloadDataWithReturn: B
|
|
71
71
|
};
|
|
72
|
-
},
|
|
72
|
+
}, Q = (e, l) => {
|
|
73
73
|
const t = J.c(12);
|
|
74
|
-
let
|
|
75
|
-
t[0] !== l || t[1] !== e ? (
|
|
74
|
+
let o;
|
|
75
|
+
t[0] !== l || t[1] !== e ? (o = () => {
|
|
76
76
|
const u = localStorage.getItem(e);
|
|
77
77
|
return u != null && u !== "undefined" ? JSON.parse(u) : l;
|
|
78
|
-
}, t[0] = l, t[1] = e, t[2] =
|
|
79
|
-
const i =
|
|
78
|
+
}, t[0] = l, t[1] = e, t[2] = o) : o = t[2];
|
|
79
|
+
const i = o, [a, m] = C(i);
|
|
80
80
|
let d, s;
|
|
81
|
-
t[3] !== e || t[4] !==
|
|
82
|
-
localStorage.setItem(e, JSON.stringify(
|
|
83
|
-
}, s = [e,
|
|
81
|
+
t[3] !== e || t[4] !== a ? (d = () => {
|
|
82
|
+
localStorage.setItem(e, JSON.stringify(a));
|
|
83
|
+
}, s = [e, a], t[3] = e, t[4] = a, t[5] = d, t[6] = s) : (d = t[5], s = t[6]), R(d, s);
|
|
84
84
|
let n;
|
|
85
85
|
t[7] !== i ? (n = () => {
|
|
86
86
|
m(i);
|
|
87
87
|
}, t[7] = i, t[8] = n) : n = t[8];
|
|
88
88
|
const g = n;
|
|
89
89
|
let c;
|
|
90
|
-
return t[9] !== g || t[10] !==
|
|
90
|
+
return t[9] !== g || t[10] !== a ? (c = [a, m, g], t[9] = g, t[10] = a, t[11] = c) : c = t[11], c;
|
|
91
91
|
};
|
|
92
92
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
Q as a,
|
|
94
|
+
P as u
|
|
95
95
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const q=require("./ShortcutLinksContext-CzUA0Bw_.cjs");require("react/jsx-runtime");const a=require("react");require("react-router");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-react");require("@azure/msal-browser");const S={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},w=(e,{loadOnInit:u=S.loadOnInit,enabled:t=S.enabled,silent:o=S.silent,nullStateBeforeLoad:c=S.nullStateBeforeLoad,nullStateOnFail:s=S.nullStateOnFail,customApiUrl:C,customBearerToken:f,dataTransformer:r}=S)=>{const n=q.useAxios({silent:o,customToken:f,differentBaseUrl:C}),[p,i]=a.useState(0),{startLoading:d,stopLoading:b}=a.useContext(q.LoadingContext),m=a.useRef(0),{isAuthenticated:x}=q.useAuth(),[I,L]=a.useState(null),h=a.useRef(u??!1),g=a.useCallback(async(D,A)=>{if(!x()||t===!1)return null;i(l=>l+1),!o&&d(`loadData-${e}-${A}`),c&&L(null);let R;try{const l=await n.get(e,{signal:D}),$=r?r(l.data):l.data;L($),R=$}catch(l){throw s&&L(null),l}finally{h.current=!1,i(l=>l-1),!o&&b(`loadData-${e}-${A}`)}return R},[x,t,o,d,e,c,n,r,s,b]),O=a.useCallback(async()=>{g()},[g]),v=a.useCallback(async()=>g(),[g]);return a.useEffect(()=>{if(u===!1)return;if(n.interceptorsUsed===!1){console.error("useGetApiData: could not load data because interceptors are not used");return}const D=new AbortController;return g(D.signal,++m.current),()=>{D.abort()}},[g,u,n.interceptorsUsed]),{data:I,setData:L,reloadData:O,isLoading:h.current||p>0,reloadDataWithReturn:v}},E=(e,u)=>{const t=q.compilerRuntimeExports.c(12);let o;t[0]!==u||t[1]!==e?(o=()=>{const d=localStorage.getItem(e);return d!=null&&d!=="undefined"?JSON.parse(d):u},t[0]=u,t[1]=e,t[2]=o):o=t[2];const c=o,[s,C]=a.useState(c);let f,r;t[3]!==e||t[4]!==s?(f=()=>{localStorage.setItem(e,JSON.stringify(s))},r=[e,s],t[3]=e,t[4]=s,t[5]=f,t[6]=r):(f=t[5],r=t[6]),a.useEffect(f,r);let n;t[7]!==c?(n=()=>{C(c)},t[7]=c,t[8]=n):n=t[8];const p=n;let i;return t[9]!==p||t[10]!==s?(i=[s,C,p],t[9]=p,t[10]=s,t[11]=i):i=t[11],i};exports.useGetApiData=w;exports.useLocalStorageState=E;
|
package/dist/utils.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 e=require("./ShortcutLinksContext-CzUA0Bw_.cjs"),l=require("react/jsx-runtime");require("react");require("@azure/msal-browser");require("@azure/msal-react");require("react-router");require("react-dom");require("react-hook-form");require("react-flexmonster");const u=require("./localStorageUtils-CkZslzIU.cjs"),S=require("./queryStorage-Dk70bkj7.cjs"),d=t=>{var r,i;return l.jsx(e.SimpleTooltip,{text:((r=t.getValue())==null?void 0:r.toString())??"",placement:"bottom",children:l.jsx("div",{className:"w-100 text-truncate",children:((i=t.getValue())==null?void 0:i.toString())??""})})},h=t=>{var r;return l.jsx(l.Fragment,{children:(r=t.getValue())==null?void 0:r.toLocaleString("cs-CZ")})},p=t=>{var s;const r=((s=t.getValue())==null?void 0:s.toString())??"",i=e.format(new Date(r),"dd.MM.yyyy");return l.jsx(l.Fragment,{children:r?i:""})},y=(t,r)=>{let i=!1,s=t;t[0]==="#"&&(s=t.slice(1),i=!0);let o=parseInt(s.substring(0,2),16),a=parseInt(s.substring(2,4),16),n=parseInt(s.substring(4,6),16);o+=r,a+=r,n+=r,o>255?o=255:o<0&&(o=0),a>255?a=255:a<0&&(a=0),n>255?n=255:n<0&&(n=0);const c=o.toString(16).length===1?"0"+o.toString(16):o.toString(16),g=a.toString(16).length===1?"0"+a.toString(16):a.toString(16),f=n.toString(16).length===1?"0"+n.toString(16):n.toString(16);return(i?"#":"")+c+g+f},b=t=>{const r=t.slice(3),i=[];for(let o=0;o<r.length;o+=2)i.push(r.slice(o,o+2));return`#${i.reverse().join("")}`},O=t=>typeof t.directoryName=="string"&&typeof t.directoryPath=="string"&&typeof t.directoryTranslationKey=="string"&&Array.isArray(t.files),F=async t=>{let r={status:"pending"};try{r={status:"success",data:(await t).data}}catch(i){r={status:"error",error:i}}return r},m=t=>{var r,i,s;return{rowPinning:{top:[],bottom:[]},columnOrder:t.columnsOrder??[],columnVisibility:Object.fromEntries((t.hiddenColumns??[]).map(o=>[o,!1])),pageIndex:0,pageSize:t.defaultPageSize??50,columnSorting:t.defaultSort?[t.defaultSort]:[],columnFilters:t.defaultFilters??[],columnPinning:t.fixedColumns?{left:t.fixedColumns.left?[t.fixedColumns.left]:[],right:t.fixedColumns.right?[t.fixedColumns.right]:[]}:{left:[],right:[]},size:t.isDense?"sm":"md",mobileDisplayGroup:((r=t.onMobile)==null?void 0:r.defaultDisplayGroup)??"",mobileFilter:{globalFilter:""},mobileShowColumnNames:((i=t.onMobile)==null?void 0:i.showColumnNames)??!1,columnSizing:Object.fromEntries(((s=t.columnWidths)==null?void 0:s.map(o=>[o.column,o.width]))??[]),grouping:[],expanding:{},isFullScreen:!1}},D=(t,r)=>{const i=new URLSearchParams;return Object.keys(t).forEach(s=>{i.append(`BnfTable-${r||"Universal"}.${s}`,JSON.stringify(t[s]))}),i.toString()},x=(t,r)=>{const i=localStorage.getItem("BnfTable-SettingsMigration");if(i){const s=JSON.parse(i);if(s.done&&s.version>=r)return}console.log("Migrating BnfTable settings to Tanstack Table format..."),t.forEach(s=>{const o=localStorage.getItem(s);if(!o)return;const a=JSON.parse(o);if(!a||Object.keys(a).length<1)return;const n=m(a);Object.keys(n).forEach(c=>{localStorage.setItem(`BnfTable-${s}.${c}`,JSON.stringify(n[c]))})}),localStorage.setItem("BnfTable-SettingsMigration",JSON.stringify({done:!0,version:r}))},T=["edit","delete","info","warning","check","check-simple","add","cancel","cancel-simple","danger","chevron-left","chevron-right","chevron-up","chevron-down","chevron-double-left","chevron-double-right","folder","folder-filled","file-download","file-upload","star-outline","save","link","pending","resizer-horizontal","qr-code","phone","mail","mail-envelope","dashboard","user","role","close","search","plus","minus","menu","arrow-right"];exports.atobUtf8=e.atobUtf8;exports.buildEmployeeNameString=e.buildEmployeeNameString;exports.buildOrgUnitString=e.buildOrgUnitString;exports.buildVehicleNameString=e.buildVehicleNameString;exports.capitalizeFirstLetter=e.capitalizeFirstLetter;exports.compareDate=e.compareDate;exports.compareDateTime=e.compareDateTime;exports.extractErrorsFromBlobResponse=e.extractErrorsFromBlobResponse;exports.extractErrorsFromResponse=e.extractErrorsFromResponse;exports.extractFilename=e.extractFilename;exports.extractPermissionsFromResponse=e.extractPermissionsFromResponse;exports.fixNameIdNulls=e.fixNameIdNulls;exports.formatDate=e.formatDate;exports.formatDateTime=e.formatDateTime;exports.formatFileSize=e.formatFileSize;exports.getDateString=e.getDateString;exports.getDaysDifference=e.getDaysDifference;exports.getFirstDayOfMonth=e.getFirstDayOfMonth;exports.getFirstDayOfOffsetMonth=e.getFirstDayOfOffsetMonth;exports.getFirstDayOfYear=e.getFirstDayOfYear;exports.getLastDayOfMonth=e.getLastDayOfMonth;exports.getLastDayOfOffsetMonth=e.getLastDayOfOffsetMonth;exports.getLastDayOfYear=e.getLastDayOfYear;exports.hasOnlyNullValues=e.hasOnlyNullValues;exports.hookFormSetServerErrors=e.hookFormSetServerErrors;exports.isExtensionOpenable=e.isExtensionOpenable;exports.isFileOpenable=e.isFileOpenable;exports.isISODate=e.isISODate;exports.isPrimitive=e.isPrimitive;exports.isValidDate=e.isValidDate;exports.joinStrings=e.joinStrings;exports.msToStartOfNextDay=e.msToStartOfNextDay;exports.replaceNullValuesOnlyObjectsWithNulls=e.replaceNullValuesOnlyObjectsWithNulls;exports.saveFile=e.saveFile;exports.saveFileFromResponse=e.saveFileFromResponse;exports.shortenText=e.shortenText;exports.stringContains=e.stringContains;exports.stringSearchWithin=e.stringSearchWithin;exports.stringStartsWith=e.stringStartsWith;exports.trimIsoDate=e.trimIsoDate;exports.truncateText=e.truncateText;exports.urlfyArray=e.urlfyArray;exports.dumpLocalStorage=u.dumpLocalStorage;exports.generateApiPath=u.generateApiPath;exports.hookFormSetNull=u.hookFormSetNull;exports.hookFormSetNulls=u.hookFormSetNulls;exports.limitNumber=u.limitNumber;exports.restoreLocalStorage=u.restoreLocalStorage;exports.queryStorage=S.queryStorage;exports.CommonLuminusIconsArray=T;exports.adjustBrightness=y;exports.buildTableSearchQuery=D;exports.configToTanstackTableState=m;exports.dateValueFormat=p;exports.isFileStructureDirectory=O;exports.migrateBnfTableSettings=x;exports.numFormat=h;exports.responsePromiseWrapper=F;exports.valueTooltip=d;exports.vclToHex=b;
|
package/dist/utils.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ci as
|
|
3
|
-
import { jsx as
|
|
1
|
+
import { ar as g, X as f } from "./ShortcutLinksContext-DGg3i3jj.js";
|
|
2
|
+
import { ci as L, cg as j, ch as z, cf as R, ce as $, bZ as W, b_ as A, bV as G, b0 as J, c5 as U, bW as q, br as Y, b6 as K, cd as X, ck as Z, c4 as H, b$ as Q, aL as _, c1 as ee, aM as te, c0 as re, c2 as se, c3 as ae, c9 as oe, bp as ne, c7 as ie, c6 as le, bX as ce, c8 as me, bY as ue, a9 as ge, bP as fe, ca as de, aU as pe, a$ as he, cm as Se, cb as be, a3 as ye, cc as Oe, aK as Fe, cj as xe, cl as De } from "./ShortcutLinksContext-DGg3i3jj.js";
|
|
3
|
+
import { jsx as l, Fragment as c } from "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@azure/msal-browser";
|
|
6
6
|
import "@azure/msal-react";
|
|
@@ -8,30 +8,31 @@ import "react-router";
|
|
|
8
8
|
import "react-dom";
|
|
9
9
|
import "react-hook-form";
|
|
10
10
|
import "react-flexmonster";
|
|
11
|
-
import { d as
|
|
11
|
+
import { d as Ne, g as ve, h as Ce, a as we, l as Me, r as Ie } from "./localStorageUtils-CZ4HDRzi.js";
|
|
12
|
+
import { q as Be } from "./queryStorage-C8e71gxx.js";
|
|
12
13
|
const T = (e) => {
|
|
13
14
|
var t, r;
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
+
return /* @__PURE__ */ l(g, { text: ((t = e.getValue()) == null ? void 0 : t.toString()) ?? "", placement: "bottom", children: /* @__PURE__ */ l("div", { className: "w-100 text-truncate", children: ((r = e.getValue()) == null ? void 0 : r.toString()) ?? "" }) });
|
|
15
16
|
}, N = (e) => {
|
|
16
17
|
var t;
|
|
17
|
-
return /* @__PURE__ */ c
|
|
18
|
-
},
|
|
18
|
+
return /* @__PURE__ */ l(c, { children: (t = e.getValue()) == null ? void 0 : t.toLocaleString("cs-CZ") });
|
|
19
|
+
}, v = (e) => {
|
|
19
20
|
var a;
|
|
20
21
|
const t = ((a = e.getValue()) == null ? void 0 : a.toString()) ?? "", r = f(new Date(t), "dd.MM.yyyy");
|
|
21
|
-
return /* @__PURE__ */ c
|
|
22
|
-
},
|
|
22
|
+
return /* @__PURE__ */ l(c, { children: t ? r : "" });
|
|
23
|
+
}, C = (e, t) => {
|
|
23
24
|
let r = !1, a = e;
|
|
24
25
|
e[0] === "#" && (a = e.slice(1), r = !0);
|
|
25
26
|
let s = parseInt(a.substring(0, 2), 16), o = parseInt(a.substring(2, 4), 16), n = parseInt(a.substring(4, 6), 16);
|
|
26
27
|
s += t, o += t, n += t, s > 255 ? s = 255 : s < 0 && (s = 0), o > 255 ? o = 255 : o < 0 && (o = 0), n > 255 ? n = 255 : n < 0 && (n = 0);
|
|
27
|
-
const
|
|
28
|
-
return (r ? "#" : "") +
|
|
29
|
-
},
|
|
28
|
+
const i = s.toString(16).length === 1 ? "0" + s.toString(16) : s.toString(16), m = o.toString(16).length === 1 ? "0" + o.toString(16) : o.toString(16), u = n.toString(16).length === 1 ? "0" + n.toString(16) : n.toString(16);
|
|
29
|
+
return (r ? "#" : "") + i + m + u;
|
|
30
|
+
}, w = (e) => {
|
|
30
31
|
const t = e.slice(3), r = [];
|
|
31
32
|
for (let s = 0; s < t.length; s += 2)
|
|
32
33
|
r.push(t.slice(s, s + 2));
|
|
33
34
|
return `#${r.reverse().join("")}`;
|
|
34
|
-
},
|
|
35
|
+
}, M = (e) => typeof e.directoryName == "string" && typeof e.directoryPath == "string" && typeof e.directoryTranslationKey == "string" && Array.isArray(e.files), I = async (e) => {
|
|
35
36
|
let t = {
|
|
36
37
|
status: "pending"
|
|
37
38
|
};
|
|
@@ -47,7 +48,7 @@ const T = (e) => {
|
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
return t;
|
|
50
|
-
},
|
|
51
|
+
}, d = (e) => {
|
|
51
52
|
var t, r, a;
|
|
52
53
|
return {
|
|
53
54
|
rowPinning: {
|
|
@@ -78,12 +79,12 @@ const T = (e) => {
|
|
|
78
79
|
expanding: {},
|
|
79
80
|
isFullScreen: !1
|
|
80
81
|
};
|
|
81
|
-
},
|
|
82
|
+
}, P = (e, t) => {
|
|
82
83
|
const r = new URLSearchParams();
|
|
83
84
|
return Object.keys(e).forEach((a) => {
|
|
84
85
|
r.append(`BnfTable-${t || "Universal"}.${a}`, JSON.stringify(e[a]));
|
|
85
86
|
}), r.toString();
|
|
86
|
-
},
|
|
87
|
+
}, B = (e, t) => {
|
|
87
88
|
const r = localStorage.getItem("BnfTable-SettingsMigration");
|
|
88
89
|
if (r) {
|
|
89
90
|
const a = JSON.parse(r);
|
|
@@ -95,100 +96,74 @@ const T = (e) => {
|
|
|
95
96
|
if (!s) return;
|
|
96
97
|
const o = JSON.parse(s);
|
|
97
98
|
if (!o || Object.keys(o).length < 1) return;
|
|
98
|
-
const n =
|
|
99
|
-
Object.keys(n).forEach((
|
|
100
|
-
localStorage.setItem(`BnfTable-${a}.${
|
|
99
|
+
const n = d(o);
|
|
100
|
+
Object.keys(n).forEach((i) => {
|
|
101
|
+
localStorage.setItem(`BnfTable-${a}.${i}`, JSON.stringify(n[i]));
|
|
101
102
|
});
|
|
102
103
|
}), localStorage.setItem("BnfTable-SettingsMigration", JSON.stringify({
|
|
103
104
|
done: !0,
|
|
104
105
|
version: t
|
|
105
106
|
}));
|
|
106
|
-
},
|
|
107
|
-
const t = window.location.pathname + (e.toString() ? `?${e.toString()}` : "") + window.location.hash;
|
|
108
|
-
window.history.replaceState(null, "", t);
|
|
109
|
-
}, V = {
|
|
110
|
-
get length() {
|
|
111
|
-
return Array.from(i().keys()).length;
|
|
112
|
-
},
|
|
113
|
-
key(e) {
|
|
114
|
-
const t = i();
|
|
115
|
-
return Array.from(t.keys())[e] ?? null;
|
|
116
|
-
},
|
|
117
|
-
getItem(e) {
|
|
118
|
-
const r = i().get(e);
|
|
119
|
-
return r ?? null;
|
|
120
|
-
},
|
|
121
|
-
setItem(e, t) {
|
|
122
|
-
const r = i();
|
|
123
|
-
r.set(e, t), m(r);
|
|
124
|
-
},
|
|
125
|
-
removeItem(e) {
|
|
126
|
-
const t = i();
|
|
127
|
-
t.delete(e), m(t);
|
|
128
|
-
},
|
|
129
|
-
clear() {
|
|
130
|
-
m(new URLSearchParams());
|
|
131
|
-
}
|
|
132
|
-
}, E = ["edit", "delete", "info", "warning", "check", "check-simple", "add", "cancel", "cancel-simple", "danger", "chevron-left", "chevron-right", "chevron-up", "chevron-down", "chevron-double-left", "chevron-double-right", "folder", "folder-filled", "file-download", "file-upload", "star-outline", "save", "link", "pending", "resizer-horizontal", "qr-code", "phone", "mail", "mail-envelope", "dashboard", "user", "role", "close", "search", "plus", "minus", "menu", "arrow-right"];
|
|
107
|
+
}, V = ["edit", "delete", "info", "warning", "check", "check-simple", "add", "cancel", "cancel-simple", "danger", "chevron-left", "chevron-right", "chevron-up", "chevron-down", "chevron-double-left", "chevron-double-right", "folder", "folder-filled", "file-download", "file-upload", "star-outline", "save", "link", "pending", "resizer-horizontal", "qr-code", "phone", "mail", "mail-envelope", "dashboard", "user", "role", "close", "search", "plus", "minus", "menu", "arrow-right"];
|
|
133
108
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
109
|
+
V as CommonLuminusIconsArray,
|
|
110
|
+
C as adjustBrightness,
|
|
111
|
+
L as atobUtf8,
|
|
112
|
+
j as buildEmployeeNameString,
|
|
113
|
+
z as buildOrgUnitString,
|
|
114
|
+
P as buildTableSearchQuery,
|
|
115
|
+
R as buildVehicleNameString,
|
|
116
|
+
$ as capitalizeFirstLetter,
|
|
117
|
+
W as compareDate,
|
|
118
|
+
A as compareDateTime,
|
|
119
|
+
d as configToTanstackTableState,
|
|
120
|
+
v as dateValueFormat,
|
|
121
|
+
Ne as dumpLocalStorage,
|
|
122
|
+
G as extractErrorsFromBlobResponse,
|
|
123
|
+
J as extractErrorsFromResponse,
|
|
124
|
+
U as extractFilename,
|
|
150
125
|
q as extractPermissionsFromResponse,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
126
|
+
Y as fixNameIdNulls,
|
|
127
|
+
K as formatDate,
|
|
128
|
+
X as formatDateTime,
|
|
129
|
+
Z as formatFileSize,
|
|
130
|
+
ve as generateApiPath,
|
|
131
|
+
H as getDateString,
|
|
132
|
+
Q as getDaysDifference,
|
|
133
|
+
_ as getFirstDayOfMonth,
|
|
134
|
+
ee as getFirstDayOfOffsetMonth,
|
|
135
|
+
te as getFirstDayOfYear,
|
|
136
|
+
re as getLastDayOfMonth,
|
|
137
|
+
se as getLastDayOfOffsetMonth,
|
|
138
|
+
ae as getLastDayOfYear,
|
|
139
|
+
oe as hasOnlyNullValues,
|
|
165
140
|
Ce as hookFormSetNull,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
141
|
+
we as hookFormSetNulls,
|
|
142
|
+
ne as hookFormSetServerErrors,
|
|
143
|
+
ie as isExtensionOpenable,
|
|
144
|
+
le as isFileOpenable,
|
|
145
|
+
M as isFileStructureDirectory,
|
|
146
|
+
ce as isISODate,
|
|
147
|
+
me as isPrimitive,
|
|
148
|
+
ue as isValidDate,
|
|
149
|
+
ge as joinStrings,
|
|
175
150
|
Me as limitNumber,
|
|
176
|
-
|
|
177
|
-
|
|
151
|
+
B as migrateBnfTableSettings,
|
|
152
|
+
fe as msToStartOfNextDay,
|
|
178
153
|
N as numFormat,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
154
|
+
Be as queryStorage,
|
|
155
|
+
de as replaceNullValuesOnlyObjectsWithNulls,
|
|
156
|
+
I as responsePromiseWrapper,
|
|
157
|
+
Ie as restoreLocalStorage,
|
|
158
|
+
pe as saveFile,
|
|
159
|
+
he as saveFileFromResponse,
|
|
160
|
+
Se as shortenText,
|
|
161
|
+
be as stringContains,
|
|
162
|
+
ye as stringSearchWithin,
|
|
163
|
+
Oe as stringStartsWith,
|
|
164
|
+
Fe as trimIsoDate,
|
|
165
|
+
xe as truncateText,
|
|
166
|
+
De as urlfyArray,
|
|
192
167
|
T as valueTooltip,
|
|
193
|
-
|
|
168
|
+
w as vclToHex
|
|
194
169
|
};
|