react-luminus-components 1.2.80 → 1.2.82
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 +57 -57
- package/dist/{EventType-BCIiHNVo.cjs → EventType-B2MjpDfc.cjs} +1 -1
- package/dist/{EventType-DiHqEDqn.js → EventType-DY7SjWGF.js} +1 -1
- package/dist/{NoInputContainer-D_sgAiux.js → NoInputContainer-D94YvUXW.js} +628 -627
- package/dist/{NoInputContainer-QV9JLbnE.cjs → NoInputContainer-pmSdlv8f.cjs} +16 -16
- package/dist/{SimpleTooltip-BKmgu79J.cjs → SimpleTooltip-DMEC0-ba.cjs} +1 -1
- package/dist/{SimpleTooltip-CXeUwU65.js → SimpleTooltip-OyME0pwt.js} +1 -1
- package/dist/contexts.cjs.js +1 -1
- package/dist/contexts.es.js +3 -3
- package/dist/{dateUtils-Crak7ii9.js → dateUtils-Clmwz8MD.js} +1 -1
- package/dist/{dateUtils-CWKBTsx7.cjs → dateUtils-DjdXQqjK.cjs} +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.es.js +6 -6
- package/dist/layout.cjs.js +1 -1
- package/dist/layout.es.js +3 -3
- package/dist/main.cjs.js +1 -1
- package/dist/main.es.js +5 -5
- package/dist/models/texts/AxiosTexts.d.ts +1 -0
- package/dist/models/types/ApiErrorResult.d.ts +1 -0
- package/dist/textUtils-BZyf3rh0.js +41 -0
- package/dist/textUtils-DPetpRXS.cjs +1 -0
- package/dist/{useConfirm-ZMFNWP8A.cjs → useConfirm-BKXZtGGa.cjs} +1 -1
- package/dist/{useConfirm-BgDxf_xi.js → useConfirm-cF9njJCE.js} +1 -1
- package/dist/{usePermissions-cOpmP15X.js → usePermissions-SxjfyxfQ.js} +1 -1
- package/dist/{usePermissions-DQNoOuU8.cjs → usePermissions-kWbAumCC.cjs} +1 -1
- package/dist/utils/apiErrorFields/apiErrorFieldsUtils.d.ts +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.es.js +15 -14
- package/package.json +1 -1
- package/dist/textUtils-BbxuIsKq.js +0 -36
- package/dist/textUtils-CHVVh2oi.cjs +0 -1
package/dist/main.es.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as s, c as w, t as re, a as ie, g as cr, T as lr, b as ur, s as jt, E as dr, d as hr, e as mr, f as fr, h as pr, u as V, i as de, k as Qt, F as kt, l as gr, m as wr, n as xr, o as yr, p as br, q as vr, r as _r, v as jr, w as lt, x as ut, y as kr, z as Cr, P as _e, A as he, B as Nr, C as $r, D as dt, S as Ct, G as Pe, H as Ae, I as ht, J as Ir, K as Xt, L as Ie, M as qe, O as Nt, N as Sr, Q as oe, R as Tr, U as Er, V as Jt, W as mt, X as ft, Y as z, Z as Or, _ as Zt, $ as Mr, a0 as en, a1 as Dr, a2 as Pr, a3 as Ar, a4 as Fr, a5 as tn, a6 as ke, a7 as Wr, a8 as Rr, a9 as Lr, aa as qr, ab as Yr, ac as Ze, ad as Ve, ae as nn, af as xe, ag as Br } from "./NoInputContainer-
|
|
2
|
-
import { ai as yl, ah as bl } from "./NoInputContainer-
|
|
1
|
+
import { j as s, c as w, t as re, a as ie, g as cr, T as lr, b as ur, s as jt, E as dr, d as hr, e as mr, f as fr, h as pr, u as V, i as de, k as Qt, F as kt, l as gr, m as wr, n as xr, o as yr, p as br, q as vr, r as _r, v as jr, w as lt, x as ut, y as kr, z as Cr, P as _e, A as he, B as Nr, C as $r, D as dt, S as Ct, G as Pe, H as Ae, I as ht, J as Ir, K as Xt, L as Ie, M as qe, O as Nt, N as Sr, Q as oe, R as Tr, U as Er, V as Jt, W as mt, X as ft, Y as z, Z as Or, _ as Zt, $ as Mr, a0 as en, a1 as Dr, a2 as Pr, a3 as Ar, a4 as Fr, a5 as tn, a6 as ke, a7 as Wr, a8 as Rr, a9 as Lr, aa as qr, ab as Yr, ac as Ze, ad as Ve, ae as nn, af as xe, ag as Br } from "./NoInputContainer-D94YvUXW.js";
|
|
2
|
+
import { ai as yl, ah as bl } from "./NoInputContainer-D94YvUXW.js";
|
|
3
3
|
import * as A from "react";
|
|
4
4
|
import J, { useCallback as O, useMemo as Q, useEffect as D, useRef as Y, useState as P, useReducer as rn, useContext as F, Component as Hr, isValidElement as Gr, Suspense as Vr, createElement as Ur } from "react";
|
|
5
|
-
import { c as le, d as zr, C as Kr, a as on, u as Qr, q as $t, E as Fe, M as We, L as Xr } from "./EventType-
|
|
5
|
+
import { c as le, d as zr, C as Kr, a as on, u as Qr, q as $t, E as Fe, M as We, L as Xr } from "./EventType-DY7SjWGF.js";
|
|
6
6
|
import { useFormContext as me, Controller as sn } from "react-hook-form";
|
|
7
|
-
import { m as Jr, a as an } from "./textUtils-
|
|
7
|
+
import { m as Jr, a as an } from "./textUtils-BZyf3rh0.js";
|
|
8
8
|
import { u as cn, a as ln, b as un } from "./useFormControlType-BAFqxupC.js";
|
|
9
|
-
import { S as _l } from "./SimpleTooltip-
|
|
9
|
+
import { S as _l } from "./SimpleTooltip-OyME0pwt.js";
|
|
10
10
|
const qc = ({ fileLoader: t, fileName: e, children: n }) => {
|
|
11
11
|
const r = O(async () => {
|
|
12
12
|
var l;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const u = 6048e5, c = 864e5, m = 6e4, d = 36e5, n = (r) => r == null ? !0 : !(typeof r == "object" || typeof r == "function"), i = (r) => {
|
|
2
|
+
n(r) || Object.keys(r).forEach((e) => {
|
|
3
|
+
const s = r[e];
|
|
4
|
+
if (n(s))
|
|
5
|
+
return;
|
|
6
|
+
const t = Object.keys(s);
|
|
7
|
+
t.includes("id") && t.length === 1 && s.id === null ? r[e] = null : i(s);
|
|
8
|
+
});
|
|
9
|
+
}, a = (r) => {
|
|
10
|
+
var s;
|
|
11
|
+
const e = (s = r.response) == null ? void 0 : s.data;
|
|
12
|
+
return e && e.errorFields && e.errorFields.length > 0 ? e.errorFields.map((t) => ({
|
|
13
|
+
name: t.name.split(".").map((o) => `${o.charAt(0).toLowerCase()}${o.slice(1)}`).join("."),
|
|
14
|
+
errors: t.errors
|
|
15
|
+
})) : [];
|
|
16
|
+
}, p = (r, e) => {
|
|
17
|
+
a(e).forEach((t) => {
|
|
18
|
+
r.setError(t.name, { message: t.errors, type: "server" }, { shouldFocus: !0 }), n(r.getValues(t.name)) || r.setError(`${t.name}.id`, { message: t.errors, type: "server" }, { shouldFocus: !0 });
|
|
19
|
+
});
|
|
20
|
+
}, f = (r) => {
|
|
21
|
+
var s;
|
|
22
|
+
const e = (s = r.response) == null ? void 0 : s.data;
|
|
23
|
+
return e.permissions && e.permissions.length > 0 ? e.permissions : null;
|
|
24
|
+
}, F = (r) => r.length < 300 ? r : r.substring(0, 300) + "...", h = (r) => r < 1024 ? `${r} bytes` : r >= 1024 && r < 1048576 ? `${(r / 1024).toFixed(1)} KB` : `${(r / 1048576).toFixed(1)} MB`;
|
|
25
|
+
function y(r = " ", ...e) {
|
|
26
|
+
return e.filter((s) => s != null && s.length > 0).join(r);
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
u as a,
|
|
30
|
+
d as b,
|
|
31
|
+
f as c,
|
|
32
|
+
i as d,
|
|
33
|
+
a as e,
|
|
34
|
+
h as f,
|
|
35
|
+
m as g,
|
|
36
|
+
p as h,
|
|
37
|
+
n as i,
|
|
38
|
+
y as j,
|
|
39
|
+
c as m,
|
|
40
|
+
F as t
|
|
41
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=e=>e==null?!0:!(typeof e=="object"||typeof e=="function"),o=e=>{t(e)||Object.keys(e).forEach(r=>{const s=e[r];if(t(s))return;const n=Object.keys(s);n.includes("id")&&n.length===1&&s.id===null?e[r]=null:o(s)})},l=e=>{var s;const r=(s=e.response)==null?void 0:s.data;return r&&r.errorFields&&r.errorFields.length>0?r.errorFields.map(n=>({name:n.name.split(".").map(i=>`${i.charAt(0).toLowerCase()}${i.slice(1)}`).join("."),errors:n.errors})):[]},c=(e,r)=>{l(r).forEach(n=>{e.setError(n.name,{message:n.errors,type:"server"},{shouldFocus:!0}),t(e.getValues(n.name))||e.setError(`${n.name}.id`,{message:n.errors,type:"server"},{shouldFocus:!0})})},u=e=>{var s;const r=(s=e.response)==null?void 0:s.data;return r.permissions&&r.permissions.length>0?r.permissions:null},m=e=>e.length<300?e:e.substring(0,300)+"...",a=e=>e<1024?`${e} bytes`:e>=1024&&e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`;function d(e=" ",...r){return r.filter(s=>s!=null&&s.length>0).join(e)}exports.extractErrorsFromResponse=l;exports.extractPermissionsFromResponse=u;exports.fixNameIdNulls=o;exports.formatFileSize=a;exports.hookFormSetServerErrors=c;exports.isPrimitive=t;exports.joinStrings=d;exports.millisecondsInDay=864e5;exports.millisecondsInHour=36e5;exports.millisecondsInMinute=6e4;exports.millisecondsInWeek=6048e5;exports.truncateText=m;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("react"),f=require("./NoInputContainer-
|
|
1
|
+
"use strict";const r=require("react"),f=require("./NoInputContainer-pmSdlv8f.cjs"),p=()=>{const{isShown:s,text:c,showPrompt:e,hidePrompt:t,resolveRef:n,setOptions:i}=r.useContext(f.PromptContext),a=r.useCallback(o=>{t(),n.current(o)},[t,n]),l=r.useCallback(async(o,u)=>(i(m=>({...m,...u})),e(o),new Promise(m=>{n.current=m})),[n,i,e]);return{isShown:s,text:c,prompt:l,onFinish:a}};let C;const h=()=>{const{show:s,text:c,showConfirm:e,hideConfirm:t}=r.useContext(f.ConfirmContext),n=()=>{t()};return{confirm:async o=>(e(o),new Promise(u=>{C=u})),onConfirm:()=>{n(),C(!0)},onCancel:()=>{n(),C(!1)},show:s,text:c}};exports.useConfirm=h;exports.usePrompt=p;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext as u, useCallback as l } from "react";
|
|
2
|
-
import { al as p, ak as h } from "./NoInputContainer-
|
|
2
|
+
import { al as p, ak as h } from "./NoInputContainer-D94YvUXW.js";
|
|
3
3
|
const P = () => {
|
|
4
4
|
const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = u(p), C = l((n) => {
|
|
5
5
|
r(), o.current(n);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("react"),t=require("./NoInputContainer-
|
|
1
|
+
"use strict";const r=require("react"),t=require("./NoInputContainer-pmSdlv8f.cjs");require("react-hook-form");const o=()=>{const{user:s}=r.useContext(t.UserContext);return{checkUserHasPermissions:r.useCallback(n=>n.every(i=>{var e;return(e=s==null?void 0:s.permissions)==null?void 0:e.includes(i)}),[s])}};exports.usePermissions=o;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ErrorField } from '@models/index';
|
|
2
2
|
export declare const extractErrorsFromResponse: (error: any) => ErrorField[];
|
|
3
3
|
export declare const hookFormSetServerErrors: (formMethods: any, error: any) => void;
|
|
4
|
-
export
|
|
4
|
+
export declare const extractPermissionsFromResponse: (error: any) => string[] | null;
|
package/dist/utils.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./textUtils-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./textUtils-DPetpRXS.cjs"),i=require("./dateUtils-DjdXQqjK.cjs");function t(r,o){r.setValue(o,null)}function l(r,o){o.forEach(s=>{t(r,s)})}exports.extractErrorsFromResponse=e.extractErrorsFromResponse;exports.extractPermissionsFromResponse=e.extractPermissionsFromResponse;exports.fixNameIdNulls=e.fixNameIdNulls;exports.formatFileSize=e.formatFileSize;exports.hookFormSetServerErrors=e.hookFormSetServerErrors;exports.isPrimitive=e.isPrimitive;exports.joinStrings=e.joinStrings;exports.truncateText=e.truncateText;exports.isISODate=i.isISODate;exports.hookFormSetNull=t;exports.hookFormSetNulls=l;
|
package/dist/utils.es.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { e as
|
|
2
|
-
import { i as h } from "./dateUtils-
|
|
3
|
-
function
|
|
1
|
+
import { e as m, c as n, d as l, f, h as u, i as c, j as x, t as S } from "./textUtils-BZyf3rh0.js";
|
|
2
|
+
import { i as h } from "./dateUtils-Clmwz8MD.js";
|
|
3
|
+
function s(o, r) {
|
|
4
4
|
o.setValue(r, null);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function t(o, r) {
|
|
7
7
|
r.forEach((e) => {
|
|
8
|
-
|
|
8
|
+
s(o, e);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
s as
|
|
17
|
-
|
|
12
|
+
m as extractErrorsFromResponse,
|
|
13
|
+
n as extractPermissionsFromResponse,
|
|
14
|
+
l as fixNameIdNulls,
|
|
15
|
+
f as formatFileSize,
|
|
16
|
+
s as hookFormSetNull,
|
|
17
|
+
t as hookFormSetNulls,
|
|
18
|
+
u as hookFormSetServerErrors,
|
|
18
19
|
h as isISODate,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
c as isPrimitive,
|
|
21
|
+
x as joinStrings,
|
|
22
|
+
S as truncateText
|
|
22
23
|
};
|
package/package.json
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const u = 6048e5, c = 864e5, d = 6e4, m = 36e5, n = (r) => r == null ? !0 : !(typeof r == "object" || typeof r == "function"), i = (r) => {
|
|
2
|
-
n(r) || Object.keys(r).forEach((s) => {
|
|
3
|
-
const e = r[s];
|
|
4
|
-
if (n(e))
|
|
5
|
-
return;
|
|
6
|
-
const t = Object.keys(e);
|
|
7
|
-
t.includes("id") && t.length === 1 && e.id === null ? r[s] = null : i(e);
|
|
8
|
-
});
|
|
9
|
-
}, l = (r) => {
|
|
10
|
-
var e;
|
|
11
|
-
const s = (e = r.response) == null ? void 0 : e.data;
|
|
12
|
-
return s && s.errorFields && s.errorFields.length > 0 ? s.errorFields.map((t) => ({
|
|
13
|
-
name: t.name.split(".").map((o) => `${o.charAt(0).toLowerCase()}${o.slice(1)}`).join("."),
|
|
14
|
-
errors: t.errors
|
|
15
|
-
})) : [];
|
|
16
|
-
}, f = (r, s) => {
|
|
17
|
-
l(s).forEach((t) => {
|
|
18
|
-
r.setError(t.name, { message: t.errors, type: "server" }, { shouldFocus: !0 }), n(r.getValues(t.name)) || r.setError(`${t.name}.id`, { message: t.errors, type: "server" }, { shouldFocus: !0 });
|
|
19
|
-
});
|
|
20
|
-
}, p = (r) => r.length < 300 ? r : r.substring(0, 300) + "...", F = (r) => r < 1024 ? `${r} bytes` : r >= 1024 && r < 1048576 ? `${(r / 1024).toFixed(1)} KB` : `${(r / 1048576).toFixed(1)} MB`;
|
|
21
|
-
function y(r = " ", ...s) {
|
|
22
|
-
return s.filter((e) => e != null && e.length > 0).join(r);
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
u as a,
|
|
26
|
-
m as b,
|
|
27
|
-
i as c,
|
|
28
|
-
d,
|
|
29
|
-
l as e,
|
|
30
|
-
F as f,
|
|
31
|
-
f as h,
|
|
32
|
-
n as i,
|
|
33
|
-
y as j,
|
|
34
|
-
c as m,
|
|
35
|
-
p as t
|
|
36
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=e=>e==null?!0:!(typeof e=="object"||typeof e=="function"),o=e=>{t(e)||Object.keys(e).forEach(n=>{const r=e[n];if(t(r))return;const s=Object.keys(r);s.includes("id")&&s.length===1&&r.id===null?e[n]=null:o(r)})},l=e=>{var r;const n=(r=e.response)==null?void 0:r.data;return n&&n.errorFields&&n.errorFields.length>0?n.errorFields.map(s=>({name:s.name.split(".").map(i=>`${i.charAt(0).toLowerCase()}${i.slice(1)}`).join("."),errors:s.errors})):[]},c=(e,n)=>{l(n).forEach(s=>{e.setError(s.name,{message:s.errors,type:"server"},{shouldFocus:!0}),t(e.getValues(s.name))||e.setError(`${s.name}.id`,{message:s.errors,type:"server"},{shouldFocus:!0})})},u=e=>e.length<300?e:e.substring(0,300)+"...",a=e=>e<1024?`${e} bytes`:e>=1024&&e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`;function m(e=" ",...n){return n.filter(r=>r!=null&&r.length>0).join(e)}exports.extractErrorsFromResponse=l;exports.fixNameIdNulls=o;exports.formatFileSize=a;exports.hookFormSetServerErrors=c;exports.isPrimitive=t;exports.joinStrings=m;exports.millisecondsInDay=864e5;exports.millisecondsInHour=36e5;exports.millisecondsInMinute=6e4;exports.millisecondsInWeek=6048e5;exports.truncateText=u;
|