lawgic-dev-kit 0.15.6 → 0.15.8
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/_virtual/index2.js +3 -2
- package/dist/_virtual/index3.js +3 -3
- package/dist/_virtual/index4.js +5 -3
- package/dist/_virtual/index5.js +2 -5
- package/dist/components/atoms/UploadContainer/UploadContainer.js +62 -63
- package/dist/lawgic-dev-kit.umd.js +38 -38
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/package.json +1 -1
- package/dist/src/components/atoms/UploadContainer/UploadContainer.types.d.ts +0 -35
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { getDefaultExportFromCjs as o } from "./_commonjsHelpers.js";
|
|
2
|
+
import { __require as r } from "../node_modules/toposort/index.js";
|
|
3
|
+
var t = r();
|
|
4
|
+
const s = /* @__PURE__ */ o(t);
|
|
3
5
|
export {
|
|
4
|
-
|
|
6
|
+
s as default
|
|
5
7
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as t } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { translateBytes as
|
|
2
|
+
import { useState as h, useRef as P } from "react";
|
|
3
|
+
import { translateBytes as F } from "../../../utils/files.js";
|
|
4
4
|
import "../../../_virtual/lodash.js";
|
|
5
5
|
import "../../../node_modules/@fortawesome/react-fontawesome/index.es.js";
|
|
6
|
-
import { useTheme as
|
|
6
|
+
import { useTheme as L } from "../../../hooks/useTheme.js";
|
|
7
7
|
import "react-hook-form";
|
|
8
8
|
import "../../../constants/countries.js";
|
|
9
9
|
import "../ImageProfileInput/ImageProfileInput.validators.js";
|
|
@@ -12,12 +12,12 @@ import "fuse.js";
|
|
|
12
12
|
import I from "../LoadingProgress/LoadingProgress.js";
|
|
13
13
|
import "../../molecules/InformationContainer/InformationContainer.js";
|
|
14
14
|
const V = ({
|
|
15
|
-
title:
|
|
16
|
-
subtitle:
|
|
17
|
-
buttonTitle:
|
|
18
|
-
onUpload:
|
|
15
|
+
title: j = "drag_and_drop_your_files_here",
|
|
16
|
+
subtitle: f = null,
|
|
17
|
+
buttonTitle: v = "choose_files",
|
|
18
|
+
onUpload: b = () => {
|
|
19
19
|
},
|
|
20
|
-
acceptedExtensions:
|
|
20
|
+
acceptedExtensions: o = [
|
|
21
21
|
"pdf",
|
|
22
22
|
"png",
|
|
23
23
|
"jpg",
|
|
@@ -28,83 +28,78 @@ const V = ({
|
|
|
28
28
|
"xls",
|
|
29
29
|
"xlsx"
|
|
30
30
|
],
|
|
31
|
-
maxSize:
|
|
31
|
+
maxSize: n = 1024,
|
|
32
32
|
// en KB
|
|
33
|
-
loading:
|
|
34
|
-
loadingDuration:
|
|
35
|
-
className:
|
|
33
|
+
loading: y = !1,
|
|
34
|
+
loadingDuration: N = 1e4,
|
|
35
|
+
className: p = ""
|
|
36
36
|
}) => {
|
|
37
|
-
const { t:
|
|
37
|
+
const { t: s } = L(), [u, a] = h(!1), [m, i] = h(""), c = P(null), D = o.map((e) => `.${e}`).join(","), x = (e) => {
|
|
38
38
|
const r = [];
|
|
39
|
-
let
|
|
40
|
-
Array.from(e).forEach((
|
|
41
|
-
var
|
|
42
|
-
const B = ((
|
|
43
|
-
if (!
|
|
39
|
+
let d = !1;
|
|
40
|
+
Array.from(e).forEach((l) => {
|
|
41
|
+
var g;
|
|
42
|
+
const B = ((g = l.name.split(".").pop()) == null ? void 0 : g.toLowerCase()) || "";
|
|
43
|
+
if (!o.includes(B)) {
|
|
44
44
|
i(
|
|
45
|
-
`El archivo ${
|
|
46
|
-
),
|
|
45
|
+
`El archivo ${l.name} tiene una extensión no permitida.`
|
|
46
|
+
), d = !0;
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
if (
|
|
49
|
+
if (l.size > n * 1024) {
|
|
50
50
|
i(
|
|
51
|
-
`El archivo ${
|
|
52
|
-
),
|
|
51
|
+
`El archivo ${l.name} excede el tamaño máximo de ${n}KB.`
|
|
52
|
+
), d = !0;
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
r.push(
|
|
56
|
-
}), !
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
},
|
|
55
|
+
r.push(l);
|
|
56
|
+
}), !d && r.length > 0 && (i(""), b(r));
|
|
57
|
+
}, w = () => {
|
|
58
|
+
c.current && c.current.click();
|
|
59
|
+
}, E = (e) => {
|
|
60
60
|
const r = e.target.files;
|
|
61
61
|
r && r.length > 0 && x(r), e.target.value = "";
|
|
62
|
-
},
|
|
63
|
-
e.preventDefault(), e.stopPropagation(),
|
|
64
|
-
},
|
|
65
|
-
e.preventDefault(), e.stopPropagation(),
|
|
66
|
-
},
|
|
67
|
-
e.preventDefault(), e.stopPropagation(),
|
|
68
|
-
},
|
|
69
|
-
e.preventDefault(), e.stopPropagation(),
|
|
62
|
+
}, C = (e) => {
|
|
63
|
+
e.preventDefault(), e.stopPropagation(), a(!0);
|
|
64
|
+
}, _ = (e) => {
|
|
65
|
+
e.preventDefault(), e.stopPropagation(), a(!1);
|
|
66
|
+
}, $ = (e) => {
|
|
67
|
+
e.preventDefault(), e.stopPropagation(), u || a(!0);
|
|
68
|
+
}, k = (e) => {
|
|
69
|
+
e.preventDefault(), e.stopPropagation(), a(!1);
|
|
70
70
|
const r = e.dataTransfer.files;
|
|
71
71
|
r.length > 0 && x(r);
|
|
72
72
|
};
|
|
73
|
-
return
|
|
73
|
+
return y ? /* @__PURE__ */ t.jsx("div", { className: `w-full mx-auto font-sans h-full ${p} flex flex-col grow`, children: /* @__PURE__ */ t.jsx("div", { className: "bg-blue-50 p-16 rounded-2xl h-full flex flex-col grow", children: /* @__PURE__ */ t.jsxs(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
|
-
className: "flex items-center justify-center gap-16 border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center transition-all duration-300 border-blue-100 select-none",
|
|
77
|
-
onDragEnter: h,
|
|
78
|
-
onDragLeave: v,
|
|
79
|
-
onDragOver: j,
|
|
80
|
-
onDrop: b,
|
|
81
|
-
onClick: g,
|
|
76
|
+
className: "h-full grow flex items-center justify-center gap-16 border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center transition-all duration-300 border-blue-100 select-none",
|
|
82
77
|
children: [
|
|
83
78
|
/* @__PURE__ */ t.jsx(
|
|
84
79
|
I,
|
|
85
80
|
{
|
|
86
81
|
size: 75,
|
|
87
|
-
duration:
|
|
82
|
+
duration: N,
|
|
88
83
|
strokeWidth: 6,
|
|
89
84
|
color: "#4570EB"
|
|
90
85
|
}
|
|
91
86
|
),
|
|
92
87
|
/* @__PURE__ */ t.jsxs("h4", { className: "text-body-s text-gray-400", children: [
|
|
93
|
-
|
|
88
|
+
s("loading"),
|
|
94
89
|
"..."
|
|
95
90
|
] })
|
|
96
91
|
]
|
|
97
92
|
}
|
|
98
|
-
) }) }) : /* @__PURE__ */ t.jsxs("div", { className: `w-full mx-auto font-sans h-full ${
|
|
99
|
-
/* @__PURE__ */ t.jsx("div", { className: "bg-blue-50 p-16 rounded-2xl", children: /* @__PURE__ */ t.jsxs(
|
|
93
|
+
) }) }) : /* @__PURE__ */ t.jsxs("div", { className: `w-full mx-auto font-sans h-full flex flex-col ${p}`, children: [
|
|
94
|
+
/* @__PURE__ */ t.jsx("div", { className: "bg-blue-50 p-16 rounded-2xl h-full grow", children: /* @__PURE__ */ t.jsxs(
|
|
100
95
|
"div",
|
|
101
96
|
{
|
|
102
|
-
className: `flex flex-col border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center cursor-pointer transition-all duration-300 ${
|
|
103
|
-
onDragEnter:
|
|
104
|
-
onDragLeave:
|
|
105
|
-
onDragOver:
|
|
106
|
-
onDrop:
|
|
107
|
-
onClick:
|
|
97
|
+
className: `flex flex-col border-[1.4px] border-dashed rounded-2xl pt-28 p-32 text-center cursor-pointer transition-all duration-300 ${u ? "border-blue-400 bg-blue-100/50" : "border-blue-100 hover:border-blue-400"}`,
|
|
98
|
+
onDragEnter: C,
|
|
99
|
+
onDragLeave: _,
|
|
100
|
+
onDragOver: $,
|
|
101
|
+
onDrop: k,
|
|
102
|
+
onClick: w,
|
|
108
103
|
children: [
|
|
109
104
|
/* @__PURE__ */ t.jsx("div", { className: "flex justify-center translate-y-4", children: /* @__PURE__ */ t.jsx(
|
|
110
105
|
"img",
|
|
@@ -115,30 +110,34 @@ const V = ({
|
|
|
115
110
|
}
|
|
116
111
|
) }),
|
|
117
112
|
/* @__PURE__ */ t.jsxs("div", { className: "flex flex-col items-center", children: [
|
|
118
|
-
/* @__PURE__ */ t.jsx("h3", { className: "font-600 text-xl text-dark", children:
|
|
119
|
-
|
|
120
|
-
/* @__PURE__ */ t.jsx(T, { color: "blue", children:
|
|
113
|
+
/* @__PURE__ */ t.jsx("h3", { className: "font-600 text-xl text-dark", children: s(j) }),
|
|
114
|
+
f && /* @__PURE__ */ t.jsx("p", { className: "font-400 text-lg text-gray-500", children: s(f) }),
|
|
115
|
+
/* @__PURE__ */ t.jsx(T, { color: "blue", children: s(v) }),
|
|
121
116
|
/* @__PURE__ */ t.jsx(
|
|
122
117
|
"input",
|
|
123
118
|
{
|
|
124
119
|
type: "file",
|
|
125
|
-
ref:
|
|
120
|
+
ref: c,
|
|
126
121
|
className: "hidden",
|
|
127
122
|
multiple: !0,
|
|
128
|
-
accept:
|
|
129
|
-
onChange:
|
|
123
|
+
accept: D,
|
|
124
|
+
onChange: E
|
|
130
125
|
}
|
|
131
126
|
)
|
|
132
127
|
] })
|
|
133
128
|
]
|
|
134
129
|
}
|
|
135
130
|
) }),
|
|
136
|
-
|
|
131
|
+
m && /* @__PURE__ */ t.jsx("div", { className: "mt-3 text-sm text-red-500", children: m }),
|
|
137
132
|
/* @__PURE__ */ t.jsx("div", { className: "mt-10 w-full flex justify-center", children: /* @__PURE__ */ t.jsxs("span", { className: "text-gray-500 font-400 text-base", children: [
|
|
138
|
-
|
|
139
|
-
"
|
|
133
|
+
o.join(", ").toUpperCase(),
|
|
134
|
+
" ",
|
|
135
|
+
s("formats"),
|
|
136
|
+
". ",
|
|
137
|
+
s("maximum_size"),
|
|
138
|
+
":",
|
|
140
139
|
" ",
|
|
141
|
-
|
|
140
|
+
F(n, "mb")
|
|
142
141
|
] }) })
|
|
143
142
|
] });
|
|
144
143
|
};
|