siam-ui-utils 2.0.26 → 2.0.28
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/package.json +8 -7
- package/src/App.css +5 -0
- package/src/App.jsx +3 -7
- package/src/archivos-adjuntos/dropzone-uploader-dni-digital/index.jsx +8 -8
- package/src/archivos-adjuntos/index.jsx +4 -5
- package/src/assets/css/sass/_gogo.style.scss +9012 -0
- package/src/assets/css/sass/_mixins.scss +118 -0
- package/src/assets/css/sass/_plugins.scss +1 -0
- package/src/assets/css/sass/ampf_style.scss +182 -0
- package/src/assets/css/sass/main.scss +11 -0
- package/src/assets/css/sass/plugins/react-table.scss +311 -0
- package/src/assets/css/sass/themes/gogo.light.redruby.scss +40 -0
- package/src/index.css +2 -2
- package/src/index.js +0 -1
- package/src/main.jsx +1 -1
- package/src/tomar-foto/index.jsx +65 -62
- package/vite.config.ts +5 -0
- package/src/react-notifications/Notification.jsx +0 -89
- package/src/react-notifications/NotificationContainer.jsx +0 -53
- package/src/react-notifications/NotificationManager.js +0 -135
- package/src/react-notifications/Notifications.jsx +0 -66
- package/src/react-notifications/index.js +0 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "siam-ui-utils",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.28",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"ampf-react",
|
|
6
6
|
"ampf-utils",
|
|
@@ -42,19 +42,17 @@
|
|
|
42
42
|
"vite-plugin-commonjs": "^0.10.3"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
+
"@eslint/js": "^9.9.0",
|
|
45
46
|
"@testing-library/dom": "^10.4.0",
|
|
46
47
|
"@testing-library/jest-dom": "^6.4.8",
|
|
47
48
|
"@testing-library/react": "^16.0.0",
|
|
48
|
-
"@types/react-router-dom": "^5.3.3",
|
|
49
|
-
"@typescript-eslint/parser": "^8.2.0",
|
|
50
|
-
"copyfiles": "^2.4.1",
|
|
51
|
-
"@eslint/js": "^9.9.0",
|
|
52
49
|
"@types/react": "^18.3.3",
|
|
53
50
|
"@types/react-dom": "^18.3.0",
|
|
51
|
+
"@types/react-router-dom": "^5.3.3",
|
|
52
|
+
"@typescript-eslint/parser": "^8.2.0",
|
|
54
53
|
"@vitejs/plugin-react": "^4.3.1",
|
|
54
|
+
"copyfiles": "^2.4.1",
|
|
55
55
|
"eslint": "^9.9.0",
|
|
56
|
-
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
57
|
-
"eslint-plugin-react-refresh": "^0.4.9",
|
|
58
56
|
"eslint-config-airbnb": "^19.0.4",
|
|
59
57
|
"eslint-config-prettier": "^8.8.0",
|
|
60
58
|
"eslint-config-react-app": "^7.0.1",
|
|
@@ -62,6 +60,9 @@
|
|
|
62
60
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
63
61
|
"eslint-plugin-prettier": "^4.2.1",
|
|
64
62
|
"eslint-plugin-react": "^7.33.0",
|
|
63
|
+
"eslint-plugin-react-hooks": "^5.1.0-rc.0",
|
|
64
|
+
"eslint-plugin-react-refresh": "^0.4.9",
|
|
65
|
+
"sass-embedded": "^1.79.4",
|
|
65
66
|
"vite": "^5.3.4",
|
|
66
67
|
"vite-plugin-eslint": "^1.8.1",
|
|
67
68
|
"vitest": "^2.0.5"
|
package/src/App.css
CHANGED
package/src/App.jsx
CHANGED
|
@@ -5,12 +5,7 @@ import {
|
|
|
5
5
|
AccordionHeader,
|
|
6
6
|
AccordionItem,
|
|
7
7
|
} from 'reactstrap';
|
|
8
|
-
import {
|
|
9
|
-
TomarFoto,
|
|
10
|
-
DropzoneUploader,
|
|
11
|
-
DropzoneUploaderDniDigital,
|
|
12
|
-
NotificationContainer,
|
|
13
|
-
} from './';
|
|
8
|
+
import { TomarFoto, DropzoneUploader, DropzoneUploaderDniDigital } from './';
|
|
14
9
|
import './index.css';
|
|
15
10
|
import './App.css';
|
|
16
11
|
import './assets/css/vendor/bootstrap.min.css';
|
|
@@ -27,7 +22,6 @@ const App = () => {
|
|
|
27
22
|
|
|
28
23
|
return (
|
|
29
24
|
<div>
|
|
30
|
-
<NotificationContainer />
|
|
31
25
|
<Accordion open={open} toggle={toggle}>
|
|
32
26
|
<AccordionItem>
|
|
33
27
|
<AccordionHeader targetId="1">Tomar Foto</AccordionHeader>
|
|
@@ -54,6 +48,7 @@ const App = () => {
|
|
|
54
48
|
maxFiles={7}
|
|
55
49
|
nameFileLabel="Subir archivos"
|
|
56
50
|
capture="environment"
|
|
51
|
+
onFilesSelectedSelfie
|
|
57
52
|
/>
|
|
58
53
|
</AccordionBody>
|
|
59
54
|
</AccordionItem>
|
|
@@ -68,6 +63,7 @@ const App = () => {
|
|
|
68
63
|
onChangeFiles={() => {
|
|
69
64
|
console.log('onChange');
|
|
70
65
|
}}
|
|
66
|
+
classNames="custom-dropzone-uploader-dni-digital"
|
|
71
67
|
/>
|
|
72
68
|
</AccordionBody>
|
|
73
69
|
</AccordionItem>
|
|
@@ -4,7 +4,6 @@ import { Button } from 'reactstrap';
|
|
|
4
4
|
import { getDroppedOrSelectedFiles } from 'html5-file-selector';
|
|
5
5
|
import Dropzone from 'react-dropzone-uploader';
|
|
6
6
|
import 'react-dropzone-uploader/dist/styles.css';
|
|
7
|
-
import { NotificationManager } from '../../react-notifications';
|
|
8
7
|
import { pdfImage, IconButtonSvg } from '../../iconos';
|
|
9
8
|
import '../dropzone-uploader.css';
|
|
10
9
|
|
|
@@ -14,7 +13,11 @@ export const DropzoneUploaderDniDigital = ({
|
|
|
14
13
|
onChangeFiles,
|
|
15
14
|
totalFiles,
|
|
16
15
|
label = 'Cargar Dni',
|
|
16
|
+
maxFiles = 2,
|
|
17
17
|
maxSize = 2,
|
|
18
|
+
onMaxFileSizeError = () => {
|
|
19
|
+
alert('El archivo supera el tamaño máximo');
|
|
20
|
+
},
|
|
18
21
|
}) => {
|
|
19
22
|
const [files, setFiles] = useState([]);
|
|
20
23
|
|
|
@@ -45,12 +48,8 @@ export const DropzoneUploaderDniDigital = ({
|
|
|
45
48
|
|
|
46
49
|
const CustomPreview = ({ fileWithMeta }) => {
|
|
47
50
|
const { meta, remove } = fileWithMeta;
|
|
48
|
-
console.log('meta.size :>> ', meta.size);
|
|
49
51
|
if (meta.size / (1024 * 1024) > maxSize) {
|
|
50
|
-
|
|
51
|
-
'El archivo supera el tamaño máximo',
|
|
52
|
-
'Advertencia',
|
|
53
|
-
);
|
|
52
|
+
onMaxFileSizeError();
|
|
54
53
|
remove();
|
|
55
54
|
}
|
|
56
55
|
return (
|
|
@@ -104,7 +103,8 @@ export const DropzoneUploaderDniDigital = ({
|
|
|
104
103
|
};
|
|
105
104
|
|
|
106
105
|
const Input = ({ accept, onFiles, getFilesFromEvent }) => {
|
|
107
|
-
const text =
|
|
106
|
+
const text =
|
|
107
|
+
totalFiles > 0 ? `${maxFiles - totalFiles} archivos más` : `${label}`;
|
|
108
108
|
return (
|
|
109
109
|
<>
|
|
110
110
|
<Button
|
|
@@ -136,7 +136,7 @@ export const DropzoneUploaderDniDigital = ({
|
|
|
136
136
|
<div className={classNames}>
|
|
137
137
|
<Dropzone
|
|
138
138
|
disableUpload={false}
|
|
139
|
-
maxFiles={totalFiles <
|
|
139
|
+
maxFiles={totalFiles < maxFiles ? maxFiles : 0}
|
|
140
140
|
maxSize={maxSize} // en megas
|
|
141
141
|
InputComponent={Input}
|
|
142
142
|
PreviewComponent={CustomPreview}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
3
|
import { getDroppedOrSelectedFiles } from 'html5-file-selector';
|
|
4
4
|
import Dropzone from 'react-dropzone-uploader';
|
|
5
|
-
import { NotificationManager } from 'react-notifications';
|
|
6
5
|
import 'react-dropzone-uploader/dist/styles.css';
|
|
7
6
|
import { IconButtonSvg, pdfImage } from '../iconos';
|
|
8
7
|
import './dropzone-uploader.css';
|
|
@@ -18,6 +17,9 @@ export const DropzoneUploader = ({
|
|
|
18
17
|
nameFileLabel = 'Subir archivos',
|
|
19
18
|
classNames = '',
|
|
20
19
|
maxFileSize = maxSize,
|
|
20
|
+
onMaxFileSizeError = () => {
|
|
21
|
+
alert('El archivo supera el tamaño máximo');
|
|
22
|
+
},
|
|
21
23
|
}) => {
|
|
22
24
|
const [files, setFiles] = useState([]);
|
|
23
25
|
const [totalFilesDU, setTotalFilesDU] = useState(totalFiles);
|
|
@@ -49,10 +51,7 @@ export const DropzoneUploader = ({
|
|
|
49
51
|
const CustomPreview = ({ fileWithMeta }) => {
|
|
50
52
|
const { meta, remove } = fileWithMeta;
|
|
51
53
|
if (meta.size / (1024 * 1024) > maxFileSize) {
|
|
52
|
-
|
|
53
|
-
'El archivo supera el tamaño máximo',
|
|
54
|
-
'Advertencia',
|
|
55
|
-
);
|
|
54
|
+
onMaxFileSizeError();
|
|
56
55
|
remove();
|
|
57
56
|
}
|
|
58
57
|
return (
|