@ssplib/react-components 0.0.277 → 0.0.278
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import { DropzoneOptions } from 'react-dropzone';
|
|
3
|
+
export default function DropFileUpload({ name, tipoArquivo, title, required, multiple, apiURL, sizeLimit, xs, sm, md, route, tstToken, dropZoneOptions, }: {
|
|
3
4
|
name: string;
|
|
4
5
|
tipoArquivo: string;
|
|
5
6
|
title: string;
|
|
@@ -9,6 +10,7 @@ export default function DropFileUpload({ name, tipoArquivo, title, required, mul
|
|
|
9
10
|
required?: boolean;
|
|
10
11
|
multiple?: boolean;
|
|
11
12
|
sizeLimit?: number;
|
|
13
|
+
dropZoneOptions?: DropzoneOptions;
|
|
12
14
|
xs?: number;
|
|
13
15
|
sm?: number;
|
|
14
16
|
md?: number;
|
|
@@ -58,10 +58,8 @@ function LinearProgressWithLabel(props) {
|
|
|
58
58
|
react_1.default.createElement(material_1.Box, { sx: { minWidth: 3 } },
|
|
59
59
|
react_1.default.createElement(material_1.Typography, { variant: 'body2', color: 'text.secondary' }, `${Math.round(props.value)}%`))));
|
|
60
60
|
}
|
|
61
|
-
function DropFileUpload({ name, tipoArquivo, title, required = false, multiple = false, apiURL, sizeLimit = 4, xs = 12, sm, md, route = '', tstToken = '', }) {
|
|
62
|
-
const { getRootProps, getInputProps } = (0, react_dropzone_1.useDropzone)({
|
|
63
|
-
multiple,
|
|
64
|
-
onDrop: (dropFiles) => {
|
|
61
|
+
function DropFileUpload({ name, tipoArquivo, title, required = false, multiple = false, apiURL, sizeLimit = 4, xs = 12, sm, md, route = '', tstToken = '', dropZoneOptions, }) {
|
|
62
|
+
const { getRootProps, getInputProps } = (0, react_dropzone_1.useDropzone)(Object.assign({ multiple, useFsAccessApi: true, onDrop: (dropFiles) => {
|
|
65
63
|
const fileList = [];
|
|
66
64
|
setProgress(-1);
|
|
67
65
|
dropFiles
|
|
@@ -119,8 +117,7 @@ function DropFileUpload({ name, tipoArquivo, title, required = false, multiple =
|
|
|
119
117
|
removeFile(id);
|
|
120
118
|
});
|
|
121
119
|
});
|
|
122
|
-
},
|
|
123
|
-
});
|
|
120
|
+
} }, (dropZoneOptions || {})));
|
|
124
121
|
const context = (0, react_1.useContext)(form_1.FormContext);
|
|
125
122
|
const { user } = (0, react_1.useContext)(auth_1.AuthContext);
|
|
126
123
|
const theme = (0, material_1.useTheme)();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ssplib/react-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.278",
|
|
4
4
|
"description": "SSP React Components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": "Pedro Henrique <sr.hudrick@gmail.com>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"keycloak-js": "^25.0.1",
|
|
22
22
|
"react-toastify": "^10.0.4",
|
|
23
23
|
"axios": "^1.6.7",
|
|
24
|
-
"react-dropzone": "^14.
|
|
24
|
+
"react-dropzone": "^14.3.8",
|
|
25
25
|
"leaflet": "^1.9.4",
|
|
26
26
|
"leaflet-defaulticon-compatibility": "^0.1.2",
|
|
27
27
|
"react-leaflet": "^4.2.1"
|