@tecsinapse/cortex-react 1.15.0-beta.2 → 1.15.0-beta.3
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.
|
@@ -21,8 +21,7 @@ const Modal = ({
|
|
|
21
21
|
className: "flex flex-col bg-secondary-xlight rounded-mili min-w-[70vw] max-w-[95vh] max-h-[95vh] overflow-auto",
|
|
22
22
|
children: [
|
|
23
23
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-full items-center justify-between mb-deca", children: [
|
|
24
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
25
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-deca font-semibold", children: title }),
|
|
24
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-deca font-semibold ml-tera flex-1 text-center", children: title }),
|
|
26
25
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27
26
|
"button",
|
|
28
27
|
{
|
|
@@ -20,8 +20,17 @@ const useFileUpload = ({
|
|
|
20
20
|
const [isManagerOpen, setIsManagerOpen] = React.useState(false);
|
|
21
21
|
const onOpen = React.useCallback(() => setIsOpen(true), []);
|
|
22
22
|
const onClose = React.useCallback(() => setIsOpen(false), []);
|
|
23
|
+
const handleRemoveFile = React.useCallback((index) => {
|
|
24
|
+
setFiles((prevFiles) => prevFiles.filter((_, i) => i !== index));
|
|
25
|
+
}, []);
|
|
26
|
+
const handleClearFiles = React.useCallback(() => {
|
|
27
|
+
setFiles([]);
|
|
28
|
+
}, []);
|
|
23
29
|
const openManager = React.useCallback(() => setIsManagerOpen(true), []);
|
|
24
|
-
const closeManager = React.useCallback(() =>
|
|
30
|
+
const closeManager = React.useCallback(() => {
|
|
31
|
+
handleClearFiles();
|
|
32
|
+
setIsManagerOpen(false);
|
|
33
|
+
}, []);
|
|
25
34
|
const updateFiles = React.useCallback(
|
|
26
35
|
(prevFiles, newFiles) => {
|
|
27
36
|
const current = /* @__PURE__ */ new Map();
|
|
@@ -89,12 +98,6 @@ const useFileUpload = ({
|
|
|
89
98
|
maxSize,
|
|
90
99
|
onDropRejected: onFileRejected
|
|
91
100
|
});
|
|
92
|
-
const handleRemoveFile = React.useCallback((index) => {
|
|
93
|
-
setFiles((prevFiles) => prevFiles.filter((_, i) => i !== index));
|
|
94
|
-
}, []);
|
|
95
|
-
const handleClearFiles = React.useCallback(() => {
|
|
96
|
-
setFiles([]);
|
|
97
|
-
}, []);
|
|
98
101
|
const isFileLimitReached = !allowMultiple && files.length > 0;
|
|
99
102
|
return {
|
|
100
103
|
onOpen,
|
|
@@ -19,8 +19,7 @@ const Modal = ({
|
|
|
19
19
|
className: "flex flex-col bg-secondary-xlight rounded-mili min-w-[70vw] max-w-[95vh] max-h-[95vh] overflow-auto",
|
|
20
20
|
children: [
|
|
21
21
|
/* @__PURE__ */ jsxs("div", { className: "flex w-full items-center justify-between mb-deca", children: [
|
|
22
|
-
/* @__PURE__ */ jsx("
|
|
23
|
-
/* @__PURE__ */ jsx("h2", { className: "text-deca font-semibold", children: title }),
|
|
22
|
+
/* @__PURE__ */ jsx("h2", { className: "text-deca font-semibold ml-tera flex-1 text-center", children: title }),
|
|
24
23
|
/* @__PURE__ */ jsx(
|
|
25
24
|
"button",
|
|
26
25
|
{
|
|
@@ -18,8 +18,17 @@ const useFileUpload = ({
|
|
|
18
18
|
const [isManagerOpen, setIsManagerOpen] = useState(false);
|
|
19
19
|
const onOpen = useCallback(() => setIsOpen(true), []);
|
|
20
20
|
const onClose = useCallback(() => setIsOpen(false), []);
|
|
21
|
+
const handleRemoveFile = useCallback((index) => {
|
|
22
|
+
setFiles((prevFiles) => prevFiles.filter((_, i) => i !== index));
|
|
23
|
+
}, []);
|
|
24
|
+
const handleClearFiles = useCallback(() => {
|
|
25
|
+
setFiles([]);
|
|
26
|
+
}, []);
|
|
21
27
|
const openManager = useCallback(() => setIsManagerOpen(true), []);
|
|
22
|
-
const closeManager = useCallback(() =>
|
|
28
|
+
const closeManager = useCallback(() => {
|
|
29
|
+
handleClearFiles();
|
|
30
|
+
setIsManagerOpen(false);
|
|
31
|
+
}, []);
|
|
23
32
|
const updateFiles = useCallback(
|
|
24
33
|
(prevFiles, newFiles) => {
|
|
25
34
|
const current = /* @__PURE__ */ new Map();
|
|
@@ -87,12 +96,6 @@ const useFileUpload = ({
|
|
|
87
96
|
maxSize,
|
|
88
97
|
onDropRejected: onFileRejected
|
|
89
98
|
});
|
|
90
|
-
const handleRemoveFile = useCallback((index) => {
|
|
91
|
-
setFiles((prevFiles) => prevFiles.filter((_, i) => i !== index));
|
|
92
|
-
}, []);
|
|
93
|
-
const handleClearFiles = useCallback(() => {
|
|
94
|
-
setFiles([]);
|
|
95
|
-
}, []);
|
|
96
99
|
const isFileLimitReached = !allowMultiple && files.length > 0;
|
|
97
100
|
return {
|
|
98
101
|
onOpen,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tecsinapse/cortex-react",
|
|
3
|
-
"version": "1.15.0-beta.
|
|
3
|
+
"version": "1.15.0-beta.3",
|
|
4
4
|
"description": "React components based in @tecsinapse/cortex-core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@floating-ui/react": "^0.26.18",
|
|
22
22
|
"@internationalized/date": "3.7.0",
|
|
23
|
-
"@tecsinapse/cortex-core": "1.2.0-beta.
|
|
23
|
+
"@tecsinapse/cortex-core": "1.2.0-beta.1",
|
|
24
24
|
"clsx": "2.1.1",
|
|
25
25
|
"currency.js": "2.0.4",
|
|
26
26
|
"embla-carousel-autoplay": "^8.0.0",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"react-icons": ">=5.2.0",
|
|
49
49
|
"tailwind": ">=3.3.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "f64f44e66fdbe0bffe1b80120a372473c86ffd69"
|
|
52
52
|
}
|