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