react-luminus-components 1.3.225 → 1.3.226

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.
Files changed (38) hide show
  1. package/dist/.vite/manifest.json +51 -74
  2. package/dist/{Loading-Cbtkg0c9.js → Loading-C1axYZDI.js} +1 -1
  3. package/dist/{Loading-Bv65yWpV.cjs → Loading-ldurBCf0.cjs} +1 -1
  4. package/dist/components/Documents/components/DocumentsMobile/DocumentsMobile.d.ts +2 -0
  5. package/dist/components/Documents/components/DocumentsMobile/comps/DocumentsMobileItem/DocumentsMobileItem.d.ts +7 -0
  6. package/dist/components/Documents/components/DocumentsMobile/comps/index.d.ts +1 -0
  7. package/dist/components/Documents/utils/documentsUtils.d.ts +1 -0
  8. package/dist/contexts.cjs.js +1 -1
  9. package/dist/contexts.es.js +66 -66
  10. package/dist/hooks.cjs.js +1 -1
  11. package/dist/hooks.es.js +54 -55
  12. package/dist/layout.cjs.js +1 -1
  13. package/dist/layout.es.js +37 -38
  14. package/dist/main.cjs.js +52 -52
  15. package/dist/main.es.js +4256 -4777
  16. package/dist/models/texts/DocumentsTexts.d.ts +3 -0
  17. package/dist/{nivo-bar.es-C-IDqcMg.js → nivo-bar.es-DJ9CZTr8.js} +9254 -8673
  18. package/dist/nivo-bar.es-bZrvOx-V.cjs +279 -0
  19. package/dist/numberUtils-BY7ziQF8.cjs +1 -0
  20. package/dist/numberUtils-Bwf8nio8.js +7 -0
  21. package/dist/style.css +1 -1
  22. package/dist/{useGetApiData-Cyny2rj4.js → useGetApiData-B6l1jJVd.js} +5 -5
  23. package/dist/{useGetApiData-BQ9P7kC8.cjs → useGetApiData-XcyHeE-W.cjs} +1 -1
  24. package/dist/{usePermissions-CDAW5R44.cjs → usePermissions-BejhAAEt.cjs} +1 -1
  25. package/dist/usePermissions-BrCHy7zQ.js +21 -0
  26. package/dist/useRenderDraggableInPortal-D0OLp7Qb.js +78 -0
  27. package/dist/useRenderDraggableInPortal-QPCaw-E_.cjs +1 -0
  28. package/dist/utils.cjs.js +1 -1
  29. package/dist/utils.es.js +26 -26
  30. package/package.json +1 -1
  31. package/dist/nivo-bar.es-BXN_qG9T.cjs +0 -279
  32. package/dist/searchUtils-CBAvWWCQ.js +0 -14
  33. package/dist/searchUtils-D0GHdkU6.cjs +0 -1
  34. package/dist/useClickOutside-BmlXg38T.js +0 -14
  35. package/dist/useClickOutside-D0505nsm.cjs +0 -1
  36. package/dist/usePermissions-CIgm7FL-.js +0 -21
  37. package/dist/useRenderDraggableInPortal-0XfgSOcM.cjs +0 -1
  38. package/dist/useRenderDraggableInPortal-B5LatuVt.js +0 -99
@@ -1,14 +0,0 @@
1
- import { c5 as o } from "./nivo-bar.es-C-IDqcMg.js";
2
- const f = (e, r, i) => {
3
- let a = e;
4
- return r !== void 0 && (a = Math.max(a, r)), i !== void 0 && (a = Math.min(a, i)), a;
5
- }, t = (e, r) => r ? e ? o(e).toLowerCase().includes(o(r.toLowerCase())) : !1 : !0, l = (e, r) => r ? e ? o(e).toLowerCase().startsWith(o(r.toLowerCase())) : !1 : !0, u = (e, r, i) => {
6
- const a = i != null && i.trimSpaces ? r == null ? void 0 : r.replaceAll(" ", "") : r, n = i != null && i.trimSpaces ? e == null ? void 0 : e.replaceAll(" ", "") : e;
7
- return a ? a.startsWith("*") ? t(n, a.substring(1)) : l(n, a) : !0;
8
- };
9
- export {
10
- t as a,
11
- l as b,
12
- f as l,
13
- u as s
14
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("./nivo-bar.es-BXN_qG9T.cjs"),c=(i,r,t)=>{let e=i;return r!==void 0&&(e=Math.max(e,r)),t!==void 0&&(e=Math.min(e,t)),e},o=(i,r)=>r?i?n.latinize(i).toLowerCase().includes(n.latinize(r.toLowerCase())):!1:!0,l=(i,r)=>r?i?n.latinize(i).toLowerCase().startsWith(n.latinize(r.toLowerCase())):!1:!0,u=(i,r,t)=>{const e=t!=null&&t.trimSpaces?r==null?void 0:r.replaceAll(" ",""):r,a=t!=null&&t.trimSpaces?i==null?void 0:i.replaceAll(" ",""):i;return e?e.startsWith("*")?o(a,e.substring(1)):l(a,e):!0};exports.limitNumber=c;exports.stringContains=o;exports.stringSearchWithin=u;exports.stringStartsWith=l;
@@ -1,14 +0,0 @@
1
- import { useEffect as s } from "react";
2
- const i = (e, t) => {
3
- s(() => {
4
- const n = (o) => {
5
- e.some((u) => u.current && u.current.contains(o.target)) || t();
6
- };
7
- return document.addEventListener("mouseup", n), () => {
8
- document.removeEventListener("mouseup", n);
9
- };
10
- }, [e, t]);
11
- };
12
- export {
13
- i as u
14
- };
@@ -1 +0,0 @@
1
- "use strict";const c=require("react"),i=(e,t)=>{c.useEffect(()=>{const u=n=>{e.some(s=>s.current&&s.current.contains(n.target))||t()};return document.addEventListener("mouseup",u),()=>{document.removeEventListener("mouseup",u)}},[e,t])};exports.useClickOutside=i;
@@ -1,21 +0,0 @@
1
- import { as as i } from "./nivo-bar.es-C-IDqcMg.js";
2
- import { useContext as n, useCallback as m } from "react";
3
- import "react-router-dom";
4
- import "@azure/msal-browser";
5
- import "@azure/msal-react";
6
- import "react-dom";
7
- import "react-hook-form";
8
- import "react-flexmonster";
9
- const C = () => {
10
- const { user: r } = n(i);
11
- return { checkUserHasPermissions: m((e, o = "all") => e.length === 0 ? !0 : o === "any" ? e.some((t) => {
12
- var s;
13
- return (s = r == null ? void 0 : r.permissions) == null ? void 0 : s.includes(t);
14
- }) : e.every((t) => {
15
- var s;
16
- return (s = r == null ? void 0 : r.permissions) == null ? void 0 : s.includes(t);
17
- }), [r]) };
18
- };
19
- export {
20
- C as u
21
- };
@@ -1 +0,0 @@
1
- "use strict";const n=require("react"),p=require("react-router-dom"),b=require("./nivo-bar.es-BXN_qG9T.cjs");require("@azure/msal-browser");require("@azure/msal-react");const y=require("react-dom");require("react-hook-form");require("react-flexmonster");const P=t=>{n.useEffect(()=>(document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}),[t])},d=()=>{const[t,e]=p.useSearchParams(),o=n.useCallback((c,s)=>{t.get(c)!==s&&e(u=>(s===null&&u.delete(c),u.get(c)===s||u.set(c,s??""),u),{replace:!0})},[e,t]);return{searchParams:t,setSearch:o}},f="\0",S=(t,e,o)=>{const{searchParams:c,setSearch:s}=d(),u=n.useCallback(r=>{if(typeof r=="object"){if(o&&o==="date"||!o&&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()},[o]),l=n.useMemo(()=>u(e),[e,u]),m=n.useMemo(()=>c.get(t),[t,c]),h=n.useMemo(()=>{const r=m;if(r===f)return null;const i=r?Number(r):e;let a=Number.isNaN(i)?typeof e:"number";switch(a==="object"&&e instanceof Date&&(a="date"),o??a){case"number":return i;case"string":return r??e;case"boolean":return r==="true";case"object":return r?JSON.parse(r):e;case"date":return r?new Date(r):e;default:throw console.error(o,a),new Error(`useSearchQueryState is not implemented for type ${typeof(o??a)}.`)}},[e,m,o]),g=n.useCallback(r=>{let i;typeof r=="function"?i=r(h):i=r;const a=u(i);if(e===i||a===l){s(t,null);return}if(i===null){s(t,f);return}s(t,a)},[e,l,u,t,s,h]);return[h,g]},C=t=>{const e=n.useMemo(()=>Math.floor(Math.random()*900)+100,[]),o=n.useMemo(()=>btoa(t.toString()??""),[t]),c=n.useMemo(()=>`employeePhotos?personalNumber=${e}${o}&small=false`,[e,o]),s=n.useMemo(()=>`employeePhotos?personalNumber=${e}${o}&small=true`,[e,o]);return{photoPath:c,photoPathSm:s}},E=()=>{const{addNotification:t}=b.useNotifications(),{texts:{clipboard:e}}=n.useContext(b.LuminusComponentsContext);return{copyToClipboard:n.useCallback(async c=>{var s;try{await((s=navigator.clipboard)==null?void 0:s.writeText(c)),t(e.copySuccess(c),"prompt")}catch(u){console.error(u),t(e.copyError,"danger")}},[t,e])}},N=()=>{const t=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%",t.elt=e,document.body.appendChild(e),()=>{document.body.removeChild(e)}},[t]),e=>(o,...c)=>{const s=e(o,...c);return o.draggableProps.style.position==="fixed"?y.createPortal(s,t.elt):s}};exports.useClipboard=E;exports.useEmployeePhotoPath=C;exports.useKeyPress=P;exports.useRenderDraggableInPortal=N;exports.useSearchQuery=d;exports.useSearchQueryState=S;
@@ -1,99 +0,0 @@
1
- import { useEffect as b, useCallback as l, useMemo as a, useContext as g, useRef as y } from "react";
2
- import { useSearchParams as P } from "react-router-dom";
3
- import { au as S, $ as C } from "./nivo-bar.es-C-IDqcMg.js";
4
- import "@azure/msal-browser";
5
- import "@azure/msal-react";
6
- import { createPortal as N } from "react-dom";
7
- import "react-hook-form";
8
- import "react-flexmonster";
9
- const M = (o) => {
10
- b(() => (document.addEventListener("keydown", o), () => {
11
- document.removeEventListener("keydown", o);
12
- }), [o]);
13
- }, E = () => {
14
- const [o, t] = P(), r = l((s, n) => {
15
- o.get(s) !== n && t((c) => (n === null && c.delete(s), c.get(s) === n || c.set(s, n ?? ""), c), { replace: !0 });
16
- }, [t, o]);
17
- return {
18
- searchParams: o,
19
- setSearch: r
20
- };
21
- }, p = "\0", R = (o, t, r) => {
22
- const { searchParams: s, setSearch: n } = E(), c = l((e) => {
23
- if (typeof e == "object") {
24
- if (r && r === "date" || !r && e instanceof Date) {
25
- if (!(e instanceof Date))
26
- throw new Error("Tried to setQueryState of type Date to non-date.");
27
- return e.toISOString();
28
- }
29
- return JSON.stringify(e);
30
- }
31
- return e.toString();
32
- }, [r]), m = a(() => c(t), [t, c]), h = a(() => s.get(o), [o, s]), f = a(() => {
33
- const e = h;
34
- if (e === p)
35
- return null;
36
- const i = e ? Number(e) : t;
37
- let u = Number.isNaN(i) ? typeof t : "number";
38
- switch (u === "object" && t instanceof Date && (u = "date"), r ?? u) {
39
- case "number":
40
- return i;
41
- case "string":
42
- return e ?? t;
43
- case "boolean":
44
- return e === "true";
45
- case "object":
46
- return e ? JSON.parse(e) : t;
47
- case "date":
48
- return e ? new Date(e) : t;
49
- default:
50
- throw console.error(r, u), new Error(`useSearchQueryState is not implemented for type ${typeof (r ?? u)}.`);
51
- }
52
- }, [t, h, r]), d = l((e) => {
53
- let i;
54
- typeof e == "function" ? i = e(f) : i = e;
55
- const u = c(i);
56
- if (t === i || u === m) {
57
- n(o, null);
58
- return;
59
- }
60
- if (i === null) {
61
- n(o, p);
62
- return;
63
- }
64
- n(o, u);
65
- }, [t, m, c, o, n, f]);
66
- return [f, d];
67
- }, I = (o) => {
68
- 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]);
69
- return { photoPath: s, photoPathSm: n };
70
- }, J = () => {
71
- const { addNotification: o } = S(), { texts: { clipboard: t } } = g(C);
72
- return { copyToClipboard: l(async (s) => {
73
- var n;
74
- try {
75
- await ((n = navigator.clipboard) == null ? void 0 : n.writeText(s)), o(t.copySuccess(s), "prompt");
76
- } catch (c) {
77
- console.error(c), o(t.copyError, "danger");
78
- }
79
- }, [o, t]) };
80
- }, G = () => {
81
- const o = y({}).current;
82
- return b(() => {
83
- const t = document.createElement("div");
84
- 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), () => {
85
- document.body.removeChild(t);
86
- };
87
- }, [o]), (t) => (r, ...s) => {
88
- const n = t(r, ...s);
89
- return r.draggableProps.style.position === "fixed" ? N(n, o.elt) : n;
90
- };
91
- };
92
- export {
93
- M as a,
94
- G as b,
95
- E as c,
96
- R as d,
97
- I as e,
98
- J as u
99
- };