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/main.es.js
CHANGED
|
@@ -11,7 +11,7 @@ import ol from "react-dom";
|
|
|
11
11
|
import { useFormContext as fn, useFormState as mn, useController as pn, useWatch as Pn, FormProvider as gl, useForm as vl } from "react-hook-form";
|
|
12
12
|
import { Pivot as hs } from "react-flexmonster";
|
|
13
13
|
import { l as $n, g as Ml, d as gs, r as vs, h as el } from "./localStorageUtils-CZ4HDRzi.js";
|
|
14
|
-
import { u as ys, a as bs, b as an, c as Ss } from "./useIsFormDirty-
|
|
14
|
+
import { u as ys, a as bs, b as an, c as Ss } from "./useIsFormDirty-BdF5E9qQ.js";
|
|
15
15
|
import { u as lt, a as Rn } from "./useLocalStorageState-B2v6hClT.js";
|
|
16
16
|
const gh = (n) => {
|
|
17
17
|
const e = V.c(6), {
|
|
@@ -3044,7 +3044,8 @@ n.label === "", Pi = (n, e) => n.hierarchy && n.hierarchy.uniqueName === e, Ri =
|
|
|
3044
3044
|
},
|
|
3045
3045
|
showFieldListSearch: !0,
|
|
3046
3046
|
datePattern: "dd.MM.yyyy",
|
|
3047
|
-
dateTimePattern: "dd.MM.yyyy HH:mm:ss"
|
|
3047
|
+
dateTimePattern: "dd.MM.yyyy HH:mm:ss",
|
|
3048
|
+
timePattern: "HH:mm:ss"
|
|
3048
3049
|
}, a && (w.slice = {
|
|
3049
3050
|
...e == null ? void 0 : e.slice,
|
|
3050
3051
|
rows: [...((T = (E = e == null ? void 0 : e.slice) == null ? void 0 : E.rows) == null ? void 0 : T.filter((I) => {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const a = () => new URLSearchParams(window.location.search), n = (e) => {
|
|
2
|
+
const t = window.location.pathname + (e.toString() ? `?${e.toString()}` : "") + window.location.hash;
|
|
3
|
+
window.history.replaceState(null, "", t);
|
|
4
|
+
}, o = {
|
|
5
|
+
get length() {
|
|
6
|
+
return Array.from(a().keys()).length;
|
|
7
|
+
},
|
|
8
|
+
key(e) {
|
|
9
|
+
const t = a();
|
|
10
|
+
return Array.from(t.keys())[e] ?? null;
|
|
11
|
+
},
|
|
12
|
+
getItem(e) {
|
|
13
|
+
const r = a().get(e);
|
|
14
|
+
return r ?? null;
|
|
15
|
+
},
|
|
16
|
+
setItem(e, t) {
|
|
17
|
+
const r = a();
|
|
18
|
+
r.set(e, t), n(r);
|
|
19
|
+
},
|
|
20
|
+
removeItem(e) {
|
|
21
|
+
const t = a();
|
|
22
|
+
t.delete(e), n(t);
|
|
23
|
+
},
|
|
24
|
+
clear() {
|
|
25
|
+
n(new URLSearchParams());
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
o as q
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=()=>new URLSearchParams(window.location.search),n=e=>{const t=window.location.pathname+(e.toString()?`?${e.toString()}`:"")+window.location.hash;window.history.replaceState(null,"",t)},s={get length(){return Array.from(a().keys()).length},key(e){const t=a();return Array.from(t.keys())[e]??null},getItem(e){const r=a().get(e);return r??null},setItem(e,t){const r=a();r.set(e,t),n(r)},removeItem(e){const t=a();t.delete(e),n(t)},clear(){n(new URLSearchParams)}};exports.queryStorage=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const w=require("./nivo-bar-C1VYGnTR.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"),Q=()=>{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",_=r=>t=>(window.addEventListener(`queryStorage_${r}`,t),()=>window.removeEventListener(`queryStorage_${r}`,t)),x=(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)}.`)}},T=(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=x(c,i,o)),d.current},e[7]=r,e[8]=i,e[9]=o,e[10]=S):S=e[10];const g=S;let a;e[11]!==r?(a=_(r),e[11]=r,e[12]=a):a=e[12];const R=a,E=q.useSyncExternalStore(R,g);let h;e[13]!==l||e[14]!==g||e[15]!==n||e[16]!==t||e[17]!==r?(h=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]=h):h=e[18];const P=h;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},j=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},L=({control:r}={})=>{"use no memo";const{dirtyFields:t}=I.useFormState({control:r});return Object.keys(t).length>0};exports.useEmployeePhotoPath=j;exports.useIsFormDirty=L;exports.useSearchQuery=Q;exports.useSearchQueryState=T;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { c as P } from "./nivo-bar-BHzU38wt.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
|
+
A as a,
|
|
114
|
+
B as b,
|
|
115
|
+
H as c,
|
|
116
|
+
W as u
|
|
117
|
+
};
|
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("./nivo-bar-C1VYGnTR.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()},T=(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}))},x=["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=x;exports.adjustBrightness=y;exports.buildTableSearchQuery=D;exports.configToTanstackTableState=m;exports.dateValueFormat=p;exports.isFileStructureDirectory=O;exports.migrateBnfTableSettings=T;exports.numFormat=h;exports.responsePromiseWrapper=F;exports.valueTooltip=d;exports.vclToHex=b;
|
package/dist/utils.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { aF as
|
|
2
|
-
import { ci as
|
|
3
|
-
import { jsx as
|
|
1
|
+
import { aF as g, X as f } from "./nivo-bar-BHzU38wt.js";
|
|
2
|
+
import { ci as L, cg as j, ch as z, cf as R, ce as W, bZ as $, b_ as A, bV as G, bp as J, c5 as U, bW as q, bD as X, aX as Y, cd as Z, ck as H, c4 as K, b$ as Q, bh as _, c1 as ee, bi as te, c0 as re, c2 as se, c3 as ae, c9 as oe, bB as ne, c7 as ie, c6 as le, bX as ce, c8 as me, bY as ue, a0 as ge, bP as fe, ca as de, bk as pe, bo as he, cm as Se, cb as be, ak as ye, cc as Oe, bg as Fe, cj as xe, cl as De } from "./nivo-bar-BHzU38wt.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 ke } from "./localStorageUtils-CZ4HDRzi.js";
|
|
12
|
+
import { q as Ie } 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), k = 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: {
|
|
@@ -83,7 +84,7 @@ const T = (e) => {
|
|
|
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
|
+
}, I = (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
|
+
}, P = ["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
|
-
|
|
109
|
+
P as CommonLuminusIconsArray,
|
|
110
|
+
C as adjustBrightness,
|
|
111
|
+
L as atobUtf8,
|
|
112
|
+
j as buildEmployeeNameString,
|
|
113
|
+
z as buildOrgUnitString,
|
|
139
114
|
B as buildTableSearchQuery,
|
|
140
|
-
|
|
115
|
+
R as buildVehicleNameString,
|
|
141
116
|
W as capitalizeFirstLetter,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
117
|
+
$ 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
|
+
X as fixNameIdNulls,
|
|
127
|
+
Y as formatDate,
|
|
128
|
+
Z as formatDateTime,
|
|
129
|
+
H as formatFileSize,
|
|
130
|
+
ve as generateApiPath,
|
|
131
|
+
K 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
|
+
I 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
|
+
Ie as queryStorage,
|
|
155
|
+
de as replaceNullValuesOnlyObjectsWithNulls,
|
|
156
|
+
k as responsePromiseWrapper,
|
|
157
|
+
ke 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
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const N=require("./nivo-bar-C1VYGnTR.cjs"),F=require("react-router"),Q=require("react-hook-form"),y=()=>{const o=N.compilerRuntimeExports.c(6),[e,s]=F.useSearchParams();let t;o[0]!==e||o[1]!==s?(t=(i,n)=>{e.get(i)!==n&&s(l=>(n===null&&l.delete(i),l.get(i)===n||l.set(i,n??""),l),{replace:!0})},o[0]=e,o[1]=s,o[2]=t):t=o[2];const u=t;let c;return o[3]!==e||o[4]!==u?(c={searchParams:e,setSearch:u},o[3]=e,o[4]=u,o[5]=c):c=o[5],c},k="\0",p=(o,e,s)=>{const t=N.compilerRuntimeExports.c(24),{searchParams:u,setSearch:c}=y();let i;t[0]!==s?(i=r=>{if(typeof r=="object"){if(s&&s==="date"||!s&&r instanceof Date){if(!(r instanceof Date))throw new Error("Tried to setQueryState of type Date to non-date.");return r.toISOString()}return JSON.stringify(r)}return r.toString()},t[0]=s,t[1]=i):i=t[1];const n=i;let l;t[2]!==e||t[3]!==n?(l=n(e),t[2]=e,t[3]=n,t[4]=l):l=t[4];const P=l;let g;t[5]!==o||t[6]!==u?(g=u.get(o),t[5]=o,t[6]=u,t[7]=g):g=t[7];const E=g;let b;t:{const r=E;if(r===k){b=null;break t}const f=r?Number(r):e;let m=Number.isNaN(f)?typeof e:"number";switch(m==="object"&&e instanceof Date&&(m="date"),s??m){case"number":{b=f;break t}case"string":{b=r??e;break t}case"boolean":{b=r==="true";break t}case"object":{let h;t[8]!==e||t[9]!==r?(h=r?JSON.parse(r):e,t[8]=e,t[9]=r,t[10]=h):h=t[10],b=h;break t}case"date":{let h;t[11]!==e||t[12]!==r?(h=r?new Date(r):e,t[11]=e,t[12]=r,t[13]=h):h=t[13],b=h;break t}default:throw console.error(s,m),new Error(`useSearchQueryState is not implemented for type ${typeof(s??m)}.`)}}const a=b;let S;t[14]!==e||t[15]!==P||t[16]!==n||t[17]!==o||t[18]!==c||t[19]!==a?(S=r=>{let f;typeof r=="function"?f=r(a):f=r;const m=n(f);if(e===f||m===P){c(o,null);return}if(f===null){c(o,k);return}c(o,m)},t[14]=e,t[15]=P,t[16]=n,t[17]=o,t[18]=c,t[19]=a,t[20]=S):S=t[20];const D=S;let $;return t[21]!==D||t[22]!==a?($=[a,D],t[21]=D,t[22]=a,t[23]=$):$=t[23],$},R=o=>{const e=N.compilerRuntimeExports.c(5),s=Math.floor(Math.random()*900)+100;let t;e[0]!==o?(t=btoa(o.toString()??""),e[0]=o,e[1]=t):t=e[1];const u=t,c=`employeePhotos?personalNumber=${s}${u}&small=false`,i=`employeePhotos?personalNumber=${s}${u}&small=true`;let n;return e[2]!==c||e[3]!==i?(n={photoPath:c,photoPathSm:i},e[2]=c,e[3]=i,e[4]=n):n=e[4],n},j=({control:o}={})=>{"use no memo";const{dirtyFields:e}=Q.useFormState({control:o});return Object.keys(e).length>0};exports.useEmployeePhotoPath=R;exports.useIsFormDirty=j;exports.useSearchQuery=y;exports.useSearchQueryState=p;
|
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { c as D } from "./nivo-bar-BHzU38wt.js";
|
|
2
|
-
import { useSearchParams as j } from "react-router";
|
|
3
|
-
import { useFormState as p } from "react-hook-form";
|
|
4
|
-
const y = () => {
|
|
5
|
-
const o = D.c(6), [e, r] = j();
|
|
6
|
-
let t;
|
|
7
|
-
o[0] !== e || o[1] !== r ? (t = (i, n) => {
|
|
8
|
-
e.get(i) !== n && r((f) => (n === null && f.delete(i), f.get(i) === n || f.set(i, n ?? ""), f), {
|
|
9
|
-
replace: !0
|
|
10
|
-
});
|
|
11
|
-
}, o[0] = e, o[1] = r, o[2] = t) : t = o[2];
|
|
12
|
-
const l = t;
|
|
13
|
-
let c;
|
|
14
|
-
return o[3] !== e || o[4] !== l ? (c = {
|
|
15
|
-
searchParams: e,
|
|
16
|
-
setSearch: l
|
|
17
|
-
}, o[3] = e, o[4] = l, o[5] = c) : c = o[5], c;
|
|
18
|
-
}, k = "\0", x = (o, e, r) => {
|
|
19
|
-
const t = D.c(24), {
|
|
20
|
-
searchParams: l,
|
|
21
|
-
setSearch: c
|
|
22
|
-
} = y();
|
|
23
|
-
let i;
|
|
24
|
-
t[0] !== r ? (i = (s) => {
|
|
25
|
-
if (typeof s == "object") {
|
|
26
|
-
if (r && r === "date" || !r && s instanceof Date) {
|
|
27
|
-
if (!(s instanceof Date))
|
|
28
|
-
throw new Error("Tried to setQueryState of type Date to non-date.");
|
|
29
|
-
return s.toISOString();
|
|
30
|
-
}
|
|
31
|
-
return JSON.stringify(s);
|
|
32
|
-
}
|
|
33
|
-
return s.toString();
|
|
34
|
-
}, t[0] = r, t[1] = i) : i = t[1];
|
|
35
|
-
const n = i;
|
|
36
|
-
let f;
|
|
37
|
-
t[2] !== e || t[3] !== n ? (f = n(e), t[2] = e, t[3] = n, t[4] = f) : f = t[4];
|
|
38
|
-
const g = f;
|
|
39
|
-
let P;
|
|
40
|
-
t[5] !== o || t[6] !== l ? (P = l.get(o), t[5] = o, t[6] = l, t[7] = P) : P = t[7];
|
|
41
|
-
const F = P;
|
|
42
|
-
let b;
|
|
43
|
-
t: {
|
|
44
|
-
const s = F;
|
|
45
|
-
if (s === k) {
|
|
46
|
-
b = null;
|
|
47
|
-
break t;
|
|
48
|
-
}
|
|
49
|
-
const u = s ? Number(s) : e;
|
|
50
|
-
let m = Number.isNaN(u) ? typeof e : "number";
|
|
51
|
-
switch (m === "object" && e instanceof Date && (m = "date"), r ?? m) {
|
|
52
|
-
case "number": {
|
|
53
|
-
b = u;
|
|
54
|
-
break t;
|
|
55
|
-
}
|
|
56
|
-
case "string": {
|
|
57
|
-
b = s ?? e;
|
|
58
|
-
break t;
|
|
59
|
-
}
|
|
60
|
-
case "boolean": {
|
|
61
|
-
b = s === "true";
|
|
62
|
-
break t;
|
|
63
|
-
}
|
|
64
|
-
case "object": {
|
|
65
|
-
let h;
|
|
66
|
-
t[8] !== e || t[9] !== s ? (h = s ? JSON.parse(s) : e, t[8] = e, t[9] = s, t[10] = h) : h = t[10], b = h;
|
|
67
|
-
break t;
|
|
68
|
-
}
|
|
69
|
-
case "date": {
|
|
70
|
-
let h;
|
|
71
|
-
t[11] !== e || t[12] !== s ? (h = s ? new Date(s) : e, t[11] = e, t[12] = s, t[13] = h) : h = t[13], b = h;
|
|
72
|
-
break t;
|
|
73
|
-
}
|
|
74
|
-
default:
|
|
75
|
-
throw console.error(r, m), new Error(`useSearchQueryState is not implemented for type ${typeof (r ?? m)}.`);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const a = b;
|
|
79
|
-
let S;
|
|
80
|
-
t[14] !== e || t[15] !== g || t[16] !== n || t[17] !== o || t[18] !== c || t[19] !== a ? (S = (s) => {
|
|
81
|
-
let u;
|
|
82
|
-
typeof s == "function" ? u = s(a) : u = s;
|
|
83
|
-
const m = n(u);
|
|
84
|
-
if (e === u || m === g) {
|
|
85
|
-
c(o, null);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (u === null) {
|
|
89
|
-
c(o, k);
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
c(o, m);
|
|
93
|
-
}, t[14] = e, t[15] = g, t[16] = n, t[17] = o, t[18] = c, t[19] = a, t[20] = S) : S = t[20];
|
|
94
|
-
const N = S;
|
|
95
|
-
let $;
|
|
96
|
-
return t[21] !== N || t[22] !== a ? ($ = [a, N], t[21] = N, t[22] = a, t[23] = $) : $ = t[23], $;
|
|
97
|
-
}, C = (o) => {
|
|
98
|
-
const e = D.c(5), r = Math.floor(Math.random() * 900) + 100;
|
|
99
|
-
let t;
|
|
100
|
-
e[0] !== o ? (t = btoa(o.toString() ?? ""), e[0] = o, e[1] = t) : t = e[1];
|
|
101
|
-
const l = t, c = `employeePhotos?personalNumber=${r}${l}&small=false`, i = `employeePhotos?personalNumber=${r}${l}&small=true`;
|
|
102
|
-
let n;
|
|
103
|
-
return e[2] !== c || e[3] !== i ? (n = {
|
|
104
|
-
photoPath: c,
|
|
105
|
-
photoPathSm: i
|
|
106
|
-
}, e[2] = c, e[3] = i, e[4] = n) : n = e[4], n;
|
|
107
|
-
}, J = ({
|
|
108
|
-
control: o
|
|
109
|
-
} = {}) => {
|
|
110
|
-
"use no memo";
|
|
111
|
-
const {
|
|
112
|
-
dirtyFields: e
|
|
113
|
-
} = p({
|
|
114
|
-
control: o
|
|
115
|
-
});
|
|
116
|
-
return Object.keys(e).length > 0;
|
|
117
|
-
};
|
|
118
|
-
export {
|
|
119
|
-
y as a,
|
|
120
|
-
x as b,
|
|
121
|
-
C as c,
|
|
122
|
-
J as u
|
|
123
|
-
};
|