react-luminus-components 1.3.39 → 1.3.41
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 +8 -8
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +1 -1
- package/dist/{dateUtils-5HWb1Xp3.js → dateUtils-DrwxA2JS.js} +72 -71
- package/dist/{dateUtils-Nmx8eNt3.cjs → dateUtils-inGq3OTd.cjs} +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/useSearchQuery/useSearchQuery.d.ts +5 -0
- package/dist/hooks/useSearchQueryState/useSearchQueryState.d.ts +15 -0
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +569 -538
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +1 -1
- package/dist/models/types/ToLiteral.d.ts +5 -0
- package/dist/utils/text/string.d.ts +1 -0
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +92 -76
- package/package.json +1 -1
package/dist/main.es.js
CHANGED
|
@@ -7,7 +7,7 @@ import { InteractionType as Ls } from "@azure/msal-browser";
|
|
|
7
7
|
import { MsalAuthenticationTemplate as As } from "@azure/msal-react";
|
|
8
8
|
import { Link as ke, Navigate as Re } from "react-router-dom";
|
|
9
9
|
import { useFormContext as pe, Controller as $n } from "react-hook-form";
|
|
10
|
-
import { s as Tt, g as Rt, d as Le, f as Ee, p as Hs, t as ge, a as Ps, b as Ws } from "./dateUtils-
|
|
10
|
+
import { s as Tt, g as Rt, d as Le, f as Ee, p as Hs, t as ge, a as Ps, b as Ws } from "./dateUtils-DrwxA2JS.js";
|
|
11
11
|
import { S as Vs } from "./SimpleTooltip-niijtN07.js";
|
|
12
12
|
import { u as kn, a as Cn, b as Dn } from "./useFormControlType-oJGqgThz.js";
|
|
13
13
|
import He from "react-dom";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* changes for example type string | number to type "string" | "number"
|
|
3
|
+
*/
|
|
4
|
+
type ToLiteral<T> = T extends number ? 'number' : T extends string ? 'string' : T extends boolean ? 'boolean' : T extends null ? 'null' : T extends undefined ? 'undefined' : T extends symbol ? 'symbol' : T extends bigint ? 'bigint' : T extends Function ? 'function' : 'object';
|
|
5
|
+
export default ToLiteral;
|
|
@@ -15,3 +15,4 @@ export declare function capitalizeFirstLetter(str: string): string;
|
|
|
15
15
|
export declare const buildVehicleNameString: (spz: string | undefined | null, name: string | undefined | null) => string;
|
|
16
16
|
export declare const buildEmployeeNameString: (id: number | undefined | null, name: string | undefined | null) => string;
|
|
17
17
|
export declare const buildOrgUnitString: (number: number | string | undefined, name: string | undefined) => string;
|
|
18
|
+
export declare const atobUtf8: (str: string) => string;
|
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 a=require("./FromToDatePickerDropdownToggle-BCwF6VkO.cjs"),i=require("./dateUtils-inGq3OTd.cjs"),u=require("./searchUtils-CfdzpUt_.cjs");require("react");require("@azure/msal-browser");require("@azure/msal-react");require("react-router-dom");require("react-hook-form");const S=require("./SimpleTooltip-C0dAO5Mm.cjs");function g(t,e){t.setValue(e,null)}function y(t,e){e.forEach(o=>{g(t,o)})}const D=(t,e)=>{let o=!1,n=t;t[0]==="#"&&(n=t.slice(1),o=!0);let r=parseInt(n.substring(0,2),16),l=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);r+=e,l+=e,s+=e,r>255?r=255:r<0&&(r=0),l>255?l=255:l<0&&(l=0),s>255?s=255:s<0&&(s=0);const c=r.toString(16).length===1?"0"+r.toString(16):r.toString(16),m=l.toString(16).length===1?"0"+l.toString(16):l.toString(16),f=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return(o?"#":"")+c+m+f},x=t=>{const e=t.slice(3),o=[];for(let r=0;r<e.length;r+=2)o.push(e.slice(r,r+2));return`#${o.reverse().join("")}`},F=({cell:{value:t}})=>a.jsxRuntimeExports.jsx(S.SimpleTooltip,{text:t,placement:"bottom",children:a.jsxRuntimeExports.jsx("div",{className:"w-100 text-truncate",children:t})}),O=({cell:{value:t}})=>a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:t==null?void 0:t.toLocaleString("cs-CZ")}),p=({cell:{value:t}})=>{const e=i.format(new Date(t),"dd.MM.yyyy");return a.jsxRuntimeExports.jsx(a.jsxRuntimeExports.Fragment,{children:t?e:""})};function d(t){const e=/filename\*?=(?:UTF-8''|")(.*?)(?:''|")?(?:;|$)/i,o=t.match(e);if(o&&o[1]){let n=o[1];const r=/=\?([^?]+)\?([BbQq])\?([^?]+)\?=/,l=n.match(r);if(l){const s=l[2].toUpperCase(),c=l[3];try{return s==="B"?n=i.atobUtf8(c):s==="Q"&&(n=c.replace(/_/g," ").replace(/=([A-Fa-f0-9]{2})/g,(m,f)=>String.fromCharCode(parseInt(f,16)))),decodeURIComponent(n)}catch(m){return console.error("Error decoding MIME encoded filename:",m),n}}try{return decodeURIComponent(n)}catch(s){return console.error("Error decoding filename:",s),n}}return null}function h(t,e,o){const n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.setAttribute("download",e),r.setAttribute("style","display: none"),o&&r.setAttribute("target","_blank"),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}function b(t,e){let o=(e==null?void 0:e.forcedName)??(e==null?void 0:e.fallbackName)??"file";if((e==null?void 0:e.forcedName)===void 0&&typeof t.headers.get=="function"){const n=t.headers.get("Content-disposition");n&&n.length>0&&(o=d(t.headers.get("Content-disposition"))??o)}h(t.data,o,e==null?void 0:e.tryToOpen)}exports.extractErrorsFromResponse=a.extractErrorsFromResponse;exports.extractPermissionsFromResponse=a.extractPermissionsFromResponse;exports.fixNameIdNulls=a.fixNameIdNulls;exports.formatFileSize=a.formatFileSize;exports.hasOnlyNullValues=a.hasOnlyNullValues;exports.hookFormSetServerErrors=a.hookFormSetServerErrors;exports.isPrimitive=a.isPrimitive;exports.joinStrings=a.joinStrings;exports.replaceNullValuesOnlyObjectsWithNulls=a.replaceNullValuesOnlyObjectsWithNulls;exports.shortenText=a.shortenText;exports.truncateText=a.truncateText;exports.urlfyArray=a.urlfyArray;exports.atobUtf8=i.atobUtf8;exports.buildEmployeeNameString=i.buildEmployeeNameString;exports.buildOrgUnitString=i.buildOrgUnitString;exports.buildVehicleNameString=i.buildVehicleNameString;exports.capitalizeFirstLetter=i.capitalizeFirstLetter;exports.compareDate=i.compareDate;exports.compareDateTime=i.compareDateTime;exports.formatDate=i.formatDate;exports.formatDateTime=i.formatDateTime;exports.getDateString=i.getDateString;exports.getDaysDifference=i.getDaysDifference;exports.getFirstDayOfMonth=i.getFirstDayOfMonth;exports.getFirstDayOfOffsetMonth=i.getFirstDayOfOffsetMonth;exports.getFirstDayOfYear=i.getFirstDayOfYear;exports.getLastDayOfMonth=i.getLastDayOfMonth;exports.getLastDayOfOffsetMonth=i.getLastDayOfOffsetMonth;exports.getLastDayOfYear=i.getLastDayOfYear;exports.isISODate=i.isISODate;exports.isValidDate=i.isValidDate;exports.msToStartOfNextDay=i.msToStartOfNextDay;exports.trimIsoDate=i.trimIsoDate;exports.stringContains=u.stringContains;exports.stringSearchWithin=u.stringSearchWithin;exports.stringStartsWith=u.stringStartsWith;exports.adjustBrightness=D;exports.dateValueFormat=p;exports.extractFilename=d;exports.hookFormSetNull=g;exports.hookFormSetNulls=y;exports.numFormat=O;exports.saveFile=h;exports.saveFileFromResponse=b;exports.valueTooltip=F;exports.vclToHex=x;
|
package/dist/utils.es.js
CHANGED
|
@@ -1,100 +1,116 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { aG as
|
|
3
|
-
import { f } from "./dateUtils-
|
|
4
|
-
import {
|
|
5
|
-
import { a as
|
|
1
|
+
import { j as i } from "./FromToDatePickerDropdownToggle-CzfOe1nC.js";
|
|
2
|
+
import { aG as k, aI as v, aK as B, aD as V, aL as w, aH as A, aJ as P, aO as G, aM as z, aQ as Q, aN as W, aP as q } from "./FromToDatePickerDropdownToggle-CzfOe1nC.js";
|
|
3
|
+
import { f, c as d } from "./dateUtils-DrwxA2JS.js";
|
|
4
|
+
import { l as Y, n as _, k as $, j as J, q as K, r as Z, e as X, h as ee, z as te, u as re, a as ae, w as se, b as ne, v as oe, x as ie, y as le, i as ce, o as me, m as fe, t as de } from "./dateUtils-DrwxA2JS.js";
|
|
5
|
+
import { a as ue, s as he, b as Se } from "./searchUtils-Dc5EhzQd.js";
|
|
6
6
|
import "react";
|
|
7
7
|
import "@azure/msal-browser";
|
|
8
8
|
import "@azure/msal-react";
|
|
9
9
|
import "react-router-dom";
|
|
10
10
|
import "react-hook-form";
|
|
11
|
-
import { S as
|
|
12
|
-
function
|
|
11
|
+
import { S as g } from "./SimpleTooltip-niijtN07.js";
|
|
12
|
+
function u(t, e) {
|
|
13
13
|
t.setValue(e, null);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
e.forEach((
|
|
17
|
-
|
|
15
|
+
function C(t, e) {
|
|
16
|
+
e.forEach((s) => {
|
|
17
|
+
u(t, s);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
t[0] === "#" && (
|
|
23
|
-
let r = parseInt(
|
|
24
|
-
r += e,
|
|
25
|
-
const l = r.toString(16).length === 1 ? "0" + r.toString(16) : r.toString(16), c =
|
|
26
|
-
return (
|
|
27
|
-
},
|
|
28
|
-
const e = t.slice(3),
|
|
20
|
+
const R = (t, e) => {
|
|
21
|
+
let s = !1, a = t;
|
|
22
|
+
t[0] === "#" && (a = t.slice(1), s = !0);
|
|
23
|
+
let r = parseInt(a.substring(0, 2), 16), o = parseInt(a.substring(2, 4), 16), n = parseInt(a.substring(4, 6), 16);
|
|
24
|
+
r += e, o += e, n += e, r > 255 ? r = 255 : r < 0 && (r = 0), o > 255 ? o = 255 : o < 0 && (o = 0), n > 255 ? n = 255 : n < 0 && (n = 0);
|
|
25
|
+
const l = r.toString(16).length === 1 ? "0" + r.toString(16) : r.toString(16), c = o.toString(16).length === 1 ? "0" + o.toString(16) : o.toString(16), m = n.toString(16).length === 1 ? "0" + n.toString(16) : n.toString(16);
|
|
26
|
+
return (s ? "#" : "") + l + c + m;
|
|
27
|
+
}, j = (t) => {
|
|
28
|
+
const e = t.slice(3), s = [];
|
|
29
29
|
for (let r = 0; r < e.length; r += 2)
|
|
30
|
-
|
|
31
|
-
return `#${
|
|
32
|
-
},
|
|
30
|
+
s.push(e.slice(r, r + 2));
|
|
31
|
+
return `#${s.reverse().join("")}`;
|
|
32
|
+
}, I = ({ cell: { value: t } }) => /* @__PURE__ */ i.jsx(g, { text: t, placement: "bottom", children: /* @__PURE__ */ i.jsx("div", { className: "w-100 text-truncate", children: t }) }), T = ({ cell: { value: t } }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: t == null ? void 0 : t.toLocaleString("cs-CZ") }), E = ({ cell: { value: t } }) => {
|
|
33
33
|
const e = f(new Date(t), "dd.MM.yyyy");
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ i.jsx(i.Fragment, { children: t ? e : "" });
|
|
35
35
|
};
|
|
36
|
-
function
|
|
37
|
-
const e = /filename\*?=(?:UTF-8''|")(.*?)(?:''|")?(?:;|$)/i,
|
|
38
|
-
if (
|
|
36
|
+
function h(t) {
|
|
37
|
+
const e = /filename\*?=(?:UTF-8''|")(.*?)(?:''|")?(?:;|$)/i, s = t.match(e);
|
|
38
|
+
if (s && s[1]) {
|
|
39
|
+
let a = s[1];
|
|
40
|
+
const r = /=\?([^?]+)\?([BbQq])\?([^?]+)\?=/, o = a.match(r);
|
|
41
|
+
if (o) {
|
|
42
|
+
const n = o[2].toUpperCase(), l = o[3];
|
|
43
|
+
try {
|
|
44
|
+
return n === "B" ? a = d(l) : n === "Q" && (a = l.replace(/_/g, " ").replace(/=([A-Fa-f0-9]{2})/g, (c, m) => String.fromCharCode(parseInt(m, 16)))), decodeURIComponent(a);
|
|
45
|
+
} catch (c) {
|
|
46
|
+
return console.error("Error decoding MIME encoded filename:", c), a;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
39
49
|
try {
|
|
40
|
-
return decodeURIComponent(a
|
|
41
|
-
} catch (
|
|
42
|
-
return console.error("Error decoding filename:",
|
|
50
|
+
return decodeURIComponent(a);
|
|
51
|
+
} catch (n) {
|
|
52
|
+
return console.error("Error decoding filename:", n), a;
|
|
43
53
|
}
|
|
54
|
+
}
|
|
44
55
|
return null;
|
|
45
56
|
}
|
|
46
|
-
function
|
|
47
|
-
const
|
|
48
|
-
r.href =
|
|
57
|
+
function S(t, e, s) {
|
|
58
|
+
const a = URL.createObjectURL(t), r = document.createElement("a");
|
|
59
|
+
r.href = a, r.setAttribute("download", e), r.setAttribute("style", "display: none"), s && r.setAttribute("target", "_blank"), document.body.appendChild(r), r.click(), document.body.removeChild(r), URL.revokeObjectURL(a);
|
|
49
60
|
}
|
|
50
|
-
function
|
|
51
|
-
let
|
|
52
|
-
(e == null ? void 0 : e.forcedName) === void 0 && typeof t.headers.get == "function"
|
|
61
|
+
function L(t, e) {
|
|
62
|
+
let s = (e == null ? void 0 : e.forcedName) ?? (e == null ? void 0 : e.fallbackName) ?? "file";
|
|
63
|
+
if ((e == null ? void 0 : e.forcedName) === void 0 && typeof t.headers.get == "function") {
|
|
64
|
+
const a = t.headers.get("Content-disposition");
|
|
65
|
+
a && a.length > 0 && (s = h(t.headers.get("Content-disposition")) ?? s);
|
|
66
|
+
}
|
|
67
|
+
S(t.data, s, e == null ? void 0 : e.tryToOpen);
|
|
53
68
|
}
|
|
54
69
|
export {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
R as adjustBrightness,
|
|
71
|
+
d as atobUtf8,
|
|
72
|
+
Y as buildEmployeeNameString,
|
|
73
|
+
_ as buildOrgUnitString,
|
|
74
|
+
$ as buildVehicleNameString,
|
|
75
|
+
J as capitalizeFirstLetter,
|
|
76
|
+
K as compareDate,
|
|
61
77
|
Z as compareDateTime,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
78
|
+
E as dateValueFormat,
|
|
79
|
+
k as extractErrorsFromResponse,
|
|
80
|
+
h as extractFilename,
|
|
81
|
+
v as extractPermissionsFromResponse,
|
|
82
|
+
B as fixNameIdNulls,
|
|
83
|
+
X as formatDate,
|
|
84
|
+
ee as formatDateTime,
|
|
69
85
|
V as formatFileSize,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
86
|
+
te as getDateString,
|
|
87
|
+
re as getDaysDifference,
|
|
88
|
+
ae as getFirstDayOfMonth,
|
|
89
|
+
se as getFirstDayOfOffsetMonth,
|
|
90
|
+
ne as getFirstDayOfYear,
|
|
91
|
+
oe as getLastDayOfMonth,
|
|
76
92
|
ie as getLastDayOfOffsetMonth,
|
|
77
|
-
|
|
93
|
+
le as getLastDayOfYear,
|
|
78
94
|
w as hasOnlyNullValues,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
95
|
+
u as hookFormSetNull,
|
|
96
|
+
C as hookFormSetNulls,
|
|
97
|
+
A as hookFormSetServerErrors,
|
|
98
|
+
ce as isISODate,
|
|
99
|
+
P as isPrimitive,
|
|
100
|
+
me as isValidDate,
|
|
101
|
+
G as joinStrings,
|
|
102
|
+
fe as msToStartOfNextDay,
|
|
103
|
+
T as numFormat,
|
|
104
|
+
z as replaceNullValuesOnlyObjectsWithNulls,
|
|
105
|
+
S as saveFile,
|
|
106
|
+
L as saveFileFromResponse,
|
|
107
|
+
Q as shortenText,
|
|
108
|
+
ue as stringContains,
|
|
109
|
+
he as stringSearchWithin,
|
|
110
|
+
Se as stringStartsWith,
|
|
111
|
+
de as trimIsoDate,
|
|
112
|
+
W as truncateText,
|
|
113
|
+
q as urlfyArray,
|
|
114
|
+
I as valueTooltip,
|
|
115
|
+
j as vclToHex
|
|
100
116
|
};
|