siam-ui-utils 2.2.26 → 2.2.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/dist/CustomBootstrap.js +9 -0
- package/dist/CustomBootstrap.js.map +1 -0
- package/dist/CustomSelectInput.js +12 -0
- package/dist/CustomSelectInput.js.map +1 -0
- package/dist/IntlMessages.js +10 -0
- package/dist/IntlMessages.js.map +1 -0
- package/dist/assets/img/copiar.png.js +5 -0
- package/dist/assets/img/copiar.png.js.map +1 -0
- package/dist/assets/img/take-photo.png.js +5 -0
- package/dist/assets/img/take-photo.png.js.map +1 -0
- package/dist/bridges/with-router-bridge.js +14 -0
- package/dist/bridges/with-router-bridge.js.map +1 -0
- package/dist/constants.js +9 -0
- package/dist/constants.js.map +1 -0
- package/dist/copy-link/index.js +60 -0
- package/dist/copy-link/index.js.map +1 -0
- package/dist/custom-input/CustomInputCheckbox.js +36 -0
- package/dist/custom-input/CustomInputCheckbox.js.map +1 -0
- package/dist/custom-input/CustomInputRadio.js +43 -0
- package/dist/custom-input/CustomInputRadio.js.map +1 -0
- package/dist/dropzone/Dropzone.js +513 -0
- package/dist/dropzone/Dropzone.js.map +1 -0
- package/{src/dropzone/Input.tsx → dist/dropzone/Input.js} +77 -76
- package/dist/dropzone/Input.js.map +1 -0
- package/{src/dropzone/Layout.tsx → dist/dropzone/Layout.js} +50 -57
- package/dist/dropzone/Layout.js.map +1 -0
- package/dist/dropzone/Preview.js +117 -0
- package/dist/dropzone/Preview.js.map +1 -0
- package/dist/dropzone/SubmitButton.js +34 -0
- package/dist/dropzone/SubmitButton.js.map +1 -0
- package/dist/dropzone/assets/cancel.svg.js +5 -0
- package/dist/dropzone/assets/cancel.svg.js.map +1 -0
- package/dist/dropzone/assets/remove.svg.js +5 -0
- package/dist/dropzone/assets/remove.svg.js.map +1 -0
- package/dist/dropzone/assets/restart.svg.js +5 -0
- package/dist/dropzone/assets/restart.svg.js.map +1 -0
- package/dist/dropzone/utils.js +85 -0
- package/dist/dropzone/utils.js.map +1 -0
- package/dist/dropzone-uploader/dropzone-uploader-dni-digital/index.js +150 -0
- package/dist/dropzone-uploader/dropzone-uploader-dni-digital/index.js.map +1 -0
- package/dist/dropzone-uploader/index.js +136 -0
- package/dist/dropzone-uploader/index.js.map +1 -0
- package/dist/iconos/constants-svg.js +41 -0
- package/dist/iconos/constants-svg.js.map +1 -0
- package/dist/iconos/icon-button-svg.js +50 -0
- package/dist/iconos/icon-button-svg.js.map +1 -0
- package/dist/iconos/styled-icon.js +26 -0
- package/dist/iconos/styled-icon.js.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/select/constants.js +8 -0
- package/dist/select/constants.js.map +1 -0
- package/dist/select/index.js +90 -0
- package/dist/select/index.js.map +1 -0
- package/dist/timer/index.js +60 -0
- package/dist/timer/index.js.map +1 -0
- package/dist/tomar-foto/index.js +77 -0
- package/dist/tomar-foto/index.js.map +1 -0
- package/dist/view-layout/button-editor.js +14 -0
- package/dist/view-layout/button-editor.js.map +1 -0
- package/dist/view-layout/constants.js +11 -0
- package/dist/view-layout/constants.js.map +1 -0
- package/dist/view-layout/editor-layer.js +28 -0
- package/dist/view-layout/editor-layer.js.map +1 -0
- package/dist/view-layout/index.js +53 -0
- package/dist/view-layout/index.js.map +1 -0
- package/dist/view-layout/slot-wrapper.js +39 -0
- package/dist/view-layout/slot-wrapper.js.map +1 -0
- package/dist/where-by-room/index.js +20 -0
- package/dist/where-by-room/index.js.map +1 -0
- package/dist/where-by-room/room.js +78 -0
- package/dist/where-by-room/room.js.map +1 -0
- package/package.json +65 -17
- package/dist/index.cjs.js +0 -262
- package/dist/index.es.js +0 -43503
- package/dist/siam-ui-utils.css +0 -1
- package/eslint.config.mjs +0 -45
- package/index.html +0 -17
- package/src/App.css +0 -47
- package/src/App.jsx +0 -66
- package/src/CustomBootstrap.jsx +0 -10
- package/src/CustomSelectInput.jsx +0 -8
- package/src/IntlMessages.jsx +0 -7
- package/src/assets/css/sass/_gogo.style.scss +0 -8967
- package/src/assets/css/sass/_mixins.scss +0 -125
- package/src/assets/css/sass/_plugins.scss +0 -1
- package/src/assets/css/sass/ampf_style.scss +0 -185
- package/src/assets/css/sass/main.scss +0 -11
- package/src/assets/css/sass/plugins/react-table.scss +0 -314
- package/src/assets/css/sass/themes/gogo.light.redruby.scss +0 -41
- package/src/assets/css/sass/themes/variables.scss +0 -86
- package/src/assets/css/vendor/bootstrap.min.css +0 -6
- package/src/assets/css/vendor/bootstrap.rtl.only.min.css +0 -1428
- package/src/assets/img/copiar.png +0 -0
- package/src/assets/img/take-photo.png +0 -0
- package/src/constants.js +0 -7
- package/src/copy-link/index.jsx +0 -58
- package/src/copy-link/styles.scss +0 -39
- package/src/custom-input/CustomInputCheckbox.jsx +0 -33
- package/src/custom-input/CustomInputRadio.jsx +0 -37
- package/src/custom-input/index.css +0 -168
- package/src/custom-input/index.js +0 -2
- package/src/dropzone/Dropzone.tsx +0 -816
- package/src/dropzone/Preview.tsx +0 -139
- package/src/dropzone/SubmitButton.tsx +0 -47
- package/src/dropzone/assets/cancel.svg +0 -1
- package/src/dropzone/assets/remove.svg +0 -1
- package/src/dropzone/assets/restart.svg +0 -1
- package/src/dropzone/styles.css +0 -140
- package/src/dropzone/utils.ts +0 -113
- package/src/dropzone-uploader/dropzone-uploader-dni-digital/index.jsx +0 -151
- package/src/dropzone-uploader/dropzone-uploader.css +0 -66
- package/src/dropzone-uploader/index.jsx +0 -138
- package/src/iconos/constants-svg.js +0 -659
- package/src/iconos/icon-button-svg.jsx +0 -50
- package/src/iconos/index.js +0 -2
- package/src/iconos/styled-icon.jsx +0 -25
- package/src/index.css +0 -74
- package/src/index.js +0 -12
- package/src/main.jsx +0 -7
- package/src/select/constants.js +0 -4
- package/src/select/index.tsx +0 -147
- package/src/test-resources.jsx +0 -145
- package/src/timer/index.jsx +0 -62
- package/src/timer/styles.scss +0 -54
- package/src/tomar-foto/index.jsx +0 -69
- package/src/view-layout/button-editor.jsx +0 -18
- package/src/view-layout/constants.js +0 -7
- package/src/view-layout/editor-layer.jsx +0 -27
- package/src/view-layout/index.tsx +0 -62
- package/src/view-layout/item-slot.tsx +0 -20
- package/src/view-layout/slot-wrapper.tsx +0 -44
- package/src/view-layout/styles.scss +0 -143
- package/src/where-by-room/constants.js +0 -2
- package/src/where-by-room/index.jsx +0 -17
- package/src/where-by-room/room.jsx +0 -79
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -32
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import PropTypes from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
const Input = (props) => {
|
|
4
|
+
const {
|
|
5
|
+
className,
|
|
6
|
+
labelClassName,
|
|
7
|
+
labelWithFilesClassName,
|
|
8
|
+
style,
|
|
9
|
+
labelStyle,
|
|
10
|
+
labelWithFilesStyle,
|
|
11
|
+
getFilesFromEvent,
|
|
12
|
+
accept,
|
|
13
|
+
multiple,
|
|
14
|
+
disabled,
|
|
15
|
+
content,
|
|
16
|
+
withFilesContent,
|
|
17
|
+
onFiles,
|
|
18
|
+
files
|
|
19
|
+
} = props;
|
|
20
|
+
return /* @__PURE__ */ jsxs(
|
|
21
|
+
"label",
|
|
22
|
+
{
|
|
23
|
+
className: files.length > 0 ? labelWithFilesClassName : labelClassName,
|
|
24
|
+
style: files.length > 0 ? labelWithFilesStyle : labelStyle,
|
|
25
|
+
children: [
|
|
26
|
+
files.length > 0 ? withFilesContent : content,
|
|
27
|
+
/* @__PURE__ */ jsx(
|
|
28
|
+
"input",
|
|
29
|
+
{
|
|
30
|
+
className,
|
|
31
|
+
style,
|
|
32
|
+
type: "file",
|
|
33
|
+
accept,
|
|
34
|
+
multiple,
|
|
35
|
+
disabled,
|
|
36
|
+
onChange: async (e) => {
|
|
37
|
+
const target = e.target;
|
|
38
|
+
const chosenFiles = await getFilesFromEvent(e);
|
|
39
|
+
onFiles(chosenFiles);
|
|
40
|
+
target.value = null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
Input.propTypes = {
|
|
49
|
+
className: PropTypes.string,
|
|
50
|
+
labelClassName: PropTypes.string,
|
|
51
|
+
labelWithFilesClassName: PropTypes.string,
|
|
52
|
+
style: PropTypes.object,
|
|
53
|
+
labelStyle: PropTypes.object,
|
|
54
|
+
labelWithFilesStyle: PropTypes.object,
|
|
55
|
+
getFilesFromEvent: PropTypes.func.isRequired,
|
|
56
|
+
accept: PropTypes.string.isRequired,
|
|
57
|
+
multiple: PropTypes.bool.isRequired,
|
|
58
|
+
disabled: PropTypes.bool.isRequired,
|
|
59
|
+
content: PropTypes.node,
|
|
60
|
+
withFilesContent: PropTypes.node,
|
|
61
|
+
onFiles: PropTypes.func.isRequired,
|
|
62
|
+
files: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
63
|
+
extra: PropTypes.shape({
|
|
64
|
+
active: PropTypes.bool.isRequired,
|
|
65
|
+
reject: PropTypes.bool.isRequired,
|
|
66
|
+
dragged: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
67
|
+
accept: PropTypes.string.isRequired,
|
|
68
|
+
multiple: PropTypes.bool.isRequired,
|
|
69
|
+
minSizeBytes: PropTypes.number.isRequired,
|
|
70
|
+
maxSizeBytes: PropTypes.number.isRequired,
|
|
71
|
+
maxFiles: PropTypes.number.isRequired
|
|
72
|
+
}).isRequired
|
|
73
|
+
};
|
|
74
|
+
export {
|
|
75
|
+
Input as default
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=Input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.js","sources":["../../src/dropzone/Input.tsx"],"sourcesContent":["import React from 'react'\r\nimport PropTypes from 'prop-types'\r\n\r\nimport { IInputProps } from './Dropzone'\r\n\r\nconst Input = (props: IInputProps) => {\r\n const {\r\n className,\r\n labelClassName,\r\n labelWithFilesClassName,\r\n style,\r\n labelStyle,\r\n labelWithFilesStyle,\r\n getFilesFromEvent,\r\n accept,\r\n multiple,\r\n disabled,\r\n content,\r\n withFilesContent,\r\n onFiles,\r\n files,\r\n } = props\r\n\r\n return (\r\n <label\r\n className={files.length > 0 ? labelWithFilesClassName : labelClassName}\r\n style={files.length > 0 ? labelWithFilesStyle : labelStyle}\r\n >\r\n {files.length > 0 ? withFilesContent : content}\r\n <input\r\n className={className}\r\n style={style}\r\n type=\"file\"\r\n accept={accept}\r\n multiple={multiple}\r\n disabled={disabled}\r\n onChange={async e => {\r\n const target = e.target\r\n const chosenFiles = await getFilesFromEvent(e)\r\n onFiles(chosenFiles)\r\n //@ts-ignore\r\n target.value = null\r\n }}\r\n />\r\n </label>\r\n )\r\n}\r\n\r\nInput.propTypes = {\r\n className: PropTypes.string,\r\n labelClassName: PropTypes.string,\r\n labelWithFilesClassName: PropTypes.string,\r\n style: PropTypes.object,\r\n labelStyle: PropTypes.object,\r\n labelWithFilesStyle: PropTypes.object,\r\n getFilesFromEvent: PropTypes.func.isRequired,\r\n accept: PropTypes.string.isRequired,\r\n multiple: PropTypes.bool.isRequired,\r\n disabled: PropTypes.bool.isRequired,\r\n content: PropTypes.node,\r\n withFilesContent: PropTypes.node,\r\n onFiles: PropTypes.func.isRequired,\r\n files: PropTypes.arrayOf(PropTypes.any).isRequired,\r\n extra: PropTypes.shape({\r\n active: PropTypes.bool.isRequired,\r\n reject: PropTypes.bool.isRequired,\r\n dragged: PropTypes.arrayOf(PropTypes.any).isRequired,\r\n accept: PropTypes.string.isRequired,\r\n multiple: PropTypes.bool.isRequired,\r\n minSizeBytes: PropTypes.number.isRequired,\r\n maxSizeBytes: PropTypes.number.isRequired,\r\n maxFiles: PropTypes.number.isRequired,\r\n }).isRequired,\r\n}\r\n\r\nexport default Input\r\n"],"names":[],"mappings":";;AAKA,MAAM,QAAQ,CAAC,UAAuB;AACpC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,IACE;AAEJ,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,MAAM,SAAS,IAAI,0BAA0B;AAAA,MACxD,OAAO,MAAM,SAAS,IAAI,sBAAsB;AAAA,MAE/C,UAAA;AAAA,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-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
onCancelFile: PropTypes.func.isRequired,
|
|
52
|
-
onRemoveFile: PropTypes.func.isRequired,
|
|
53
|
-
onRestartFile: PropTypes.func.isRequired,
|
|
54
|
-
}).isRequired,
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export default Layout
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
const Layout = (props) => {
|
|
4
|
+
const {
|
|
5
|
+
input,
|
|
6
|
+
previews,
|
|
7
|
+
submitButton,
|
|
8
|
+
dropzoneProps,
|
|
9
|
+
files,
|
|
10
|
+
extra: { maxFiles }
|
|
11
|
+
} = props;
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { ...dropzoneProps, children: [
|
|
13
|
+
previews,
|
|
14
|
+
files.length < maxFiles && input,
|
|
15
|
+
files.length > 0 && submitButton
|
|
16
|
+
] });
|
|
17
|
+
};
|
|
18
|
+
Layout.propTypes = {
|
|
19
|
+
input: PropTypes.node,
|
|
20
|
+
previews: PropTypes.arrayOf(PropTypes.node),
|
|
21
|
+
submitButton: PropTypes.node,
|
|
22
|
+
dropzoneProps: PropTypes.shape({
|
|
23
|
+
ref: PropTypes.any.isRequired,
|
|
24
|
+
className: PropTypes.string.isRequired,
|
|
25
|
+
style: PropTypes.object,
|
|
26
|
+
onDragEnter: PropTypes.func.isRequired,
|
|
27
|
+
onDragOver: PropTypes.func.isRequired,
|
|
28
|
+
onDragLeave: PropTypes.func.isRequired,
|
|
29
|
+
onDrop: PropTypes.func.isRequired
|
|
30
|
+
}).isRequired,
|
|
31
|
+
files: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
32
|
+
extra: PropTypes.shape({
|
|
33
|
+
active: PropTypes.bool.isRequired,
|
|
34
|
+
reject: PropTypes.bool.isRequired,
|
|
35
|
+
dragged: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
36
|
+
accept: PropTypes.string.isRequired,
|
|
37
|
+
multiple: PropTypes.bool.isRequired,
|
|
38
|
+
minSizeBytes: PropTypes.number.isRequired,
|
|
39
|
+
maxSizeBytes: PropTypes.number.isRequired,
|
|
40
|
+
maxFiles: PropTypes.number.isRequired,
|
|
41
|
+
onFiles: PropTypes.func.isRequired,
|
|
42
|
+
onCancelFile: PropTypes.func.isRequired,
|
|
43
|
+
onRemoveFile: PropTypes.func.isRequired,
|
|
44
|
+
onRestartFile: PropTypes.func.isRequired
|
|
45
|
+
}).isRequired
|
|
46
|
+
};
|
|
47
|
+
export {
|
|
48
|
+
Layout as default
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=Layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout.js","sources":["../../src/dropzone/Layout.tsx"],"sourcesContent":["import React from 'react'\r\nimport PropTypes from 'prop-types'\r\n\r\nimport { ILayoutProps } from './Dropzone'\r\n\r\nconst Layout = (props: ILayoutProps) => {\r\n const {\r\n input,\r\n previews,\r\n submitButton,\r\n dropzoneProps,\r\n files,\r\n extra: { maxFiles },\r\n } = props\r\n\r\n return (\r\n <div {...dropzoneProps}>\r\n {previews}\r\n\r\n {files.length < maxFiles && input}\r\n\r\n {files.length > 0 && submitButton}\r\n </div>\r\n )\r\n}\r\n\r\nLayout.propTypes = {\r\n input: PropTypes.node,\r\n previews: PropTypes.arrayOf(PropTypes.node),\r\n submitButton: PropTypes.node,\r\n dropzoneProps: PropTypes.shape({\r\n ref: PropTypes.any.isRequired,\r\n className: PropTypes.string.isRequired,\r\n style: PropTypes.object,\r\n onDragEnter: PropTypes.func.isRequired,\r\n onDragOver: PropTypes.func.isRequired,\r\n onDragLeave: PropTypes.func.isRequired,\r\n onDrop: PropTypes.func.isRequired,\r\n }).isRequired,\r\n files: PropTypes.arrayOf(PropTypes.any).isRequired,\r\n extra: PropTypes.shape({\r\n active: PropTypes.bool.isRequired,\r\n reject: PropTypes.bool.isRequired,\r\n dragged: PropTypes.arrayOf(PropTypes.any).isRequired,\r\n accept: PropTypes.string.isRequired,\r\n multiple: PropTypes.bool.isRequired,\r\n minSizeBytes: PropTypes.number.isRequired,\r\n maxSizeBytes: PropTypes.number.isRequired,\r\n maxFiles: PropTypes.number.isRequired,\r\n onFiles: PropTypes.func.isRequired,\r\n onCancelFile: PropTypes.func.isRequired,\r\n onRemoveFile: PropTypes.func.isRequired,\r\n onRestartFile: PropTypes.func.isRequired,\r\n }).isRequired,\r\n}\r\n\r\nexport default Layout\r\n"],"names":[],"mappings":";;AAKA,MAAM,SAAS,CAAC,UAAwB;AACtC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO,EAAE,SAAA;AAAA,EAAS,IAChB;AAEJ,SACE,qBAAC,OAAA,EAAK,GAAG,eACN,UAAA;AAAA,IAAA;AAAA,IAEA,MAAM,SAAS,YAAY;AAAA,IAE3B,MAAM,SAAS,KAAK;AAAA,EAAA,GACvB;AAEJ;AAEA,OAAO,YAAY;AAAA,EACjB,OAAO,UAAU;AAAA,EACjB,UAAU,UAAU,QAAQ,UAAU,IAAI;AAAA,EAC1C,cAAc,UAAU;AAAA,EACxB,eAAe,UAAU,MAAM;AAAA,IAC7B,KAAK,UAAU,IAAI;AAAA,IACnB,WAAW,UAAU,OAAO;AAAA,IAC5B,OAAO,UAAU;AAAA,IACjB,aAAa,UAAU,KAAK;AAAA,IAC5B,YAAY,UAAU,KAAK;AAAA,IAC3B,aAAa,UAAU,KAAK;AAAA,IAC5B,QAAQ,UAAU,KAAK;AAAA,EAAA,CACxB,EAAE;AAAA,EACH,OAAO,UAAU,QAAQ,UAAU,GAAG,EAAE;AAAA,EACxC,OAAO,UAAU,MAAM;AAAA,IACrB,QAAQ,UAAU,KAAK;AAAA,IACvB,QAAQ,UAAU,KAAK;AAAA,IACvB,SAAS,UAAU,QAAQ,UAAU,GAAG,EAAE;AAAA,IAC1C,QAAQ,UAAU,OAAO;AAAA,IACzB,UAAU,UAAU,KAAK;AAAA,IACzB,cAAc,UAAU,OAAO;AAAA,IAC/B,cAAc,UAAU,OAAO;AAAA,IAC/B,UAAU,UAAU,OAAO;AAAA,IAC3B,SAAS,UAAU,KAAK;AAAA,IACxB,cAAc,UAAU,KAAK;AAAA,IAC7B,cAAc,UAAU,KAAK;AAAA,IAC7B,eAAe,UAAU,KAAK;AAAA,EAAA,CAC/B,EAAE;AACL;"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { formatBytes, formatDuration } from "./utils.js";
|
|
5
|
+
import cancelImg from "./assets/cancel.svg.js";
|
|
6
|
+
import removeImg from "./assets/remove.svg.js";
|
|
7
|
+
import restartImg from "./assets/restart.svg.js";
|
|
8
|
+
const iconByFn = {
|
|
9
|
+
cancel: { backgroundImage: `url(${cancelImg})` },
|
|
10
|
+
remove: { backgroundImage: `url(${removeImg})` },
|
|
11
|
+
restart: { backgroundImage: `url(${restartImg})` }
|
|
12
|
+
};
|
|
13
|
+
class Preview extends React.PureComponent {
|
|
14
|
+
render() {
|
|
15
|
+
const {
|
|
16
|
+
className,
|
|
17
|
+
imageClassName,
|
|
18
|
+
style,
|
|
19
|
+
imageStyle,
|
|
20
|
+
fileWithMeta: { cancel, remove, restart },
|
|
21
|
+
meta: { name = "", percent = 0, size = 0, previewUrl, status, duration, validationError },
|
|
22
|
+
isUpload,
|
|
23
|
+
canCancel,
|
|
24
|
+
canRemove,
|
|
25
|
+
canRestart,
|
|
26
|
+
extra: { minSizeBytes }
|
|
27
|
+
} = this.props;
|
|
28
|
+
let title = `${name || "?"}, ${formatBytes(size)}`;
|
|
29
|
+
if (duration) title = `${title}, ${formatDuration(duration)}`;
|
|
30
|
+
if (status === "error_file_size" || status === "error_validation") {
|
|
31
|
+
return /* @__PURE__ */ jsxs("div", { className, style, children: [
|
|
32
|
+
/* @__PURE__ */ jsx("span", { className: "dzu-previewFileNameError", children: title }),
|
|
33
|
+
status === "error_file_size" && /* @__PURE__ */ jsx("span", { children: size < minSizeBytes ? "File too small" : "File too big" }),
|
|
34
|
+
status === "error_validation" && /* @__PURE__ */ jsx("span", { children: String(validationError) }),
|
|
35
|
+
canRemove && /* @__PURE__ */ jsx("span", { className: "dzu-previewButton", style: iconByFn.remove, onClick: remove })
|
|
36
|
+
] });
|
|
37
|
+
}
|
|
38
|
+
if (status === "error_upload_params" || status === "exception_upload" || status === "error_upload") {
|
|
39
|
+
title = `${title} (upload failed)`;
|
|
40
|
+
}
|
|
41
|
+
if (status === "aborted") title = `${title} (cancelled)`;
|
|
42
|
+
return /* @__PURE__ */ jsxs("div", { className, style, children: [
|
|
43
|
+
previewUrl && /* @__PURE__ */ jsx("img", { className: imageClassName, style: imageStyle, src: previewUrl, alt: title, title }),
|
|
44
|
+
!previewUrl && /* @__PURE__ */ jsx("span", { className: "dzu-previewFileName", children: title }),
|
|
45
|
+
/* @__PURE__ */ jsxs("div", { className: "dzu-previewStatusContainer", children: [
|
|
46
|
+
isUpload && /* @__PURE__ */ jsx("progress", { max: 100, value: status === "done" || status === "headers_received" ? 100 : percent }),
|
|
47
|
+
status === "uploading" && canCancel && /* @__PURE__ */ jsx("span", { className: "dzu-previewButton", style: iconByFn.cancel, onClick: cancel }),
|
|
48
|
+
status !== "preparing" && status !== "getting_upload_params" && status !== "uploading" && canRemove && /* @__PURE__ */ jsx("span", { className: "dzu-previewButton", style: iconByFn.remove, onClick: remove }),
|
|
49
|
+
["error_upload_params", "exception_upload", "error_upload", "aborted", "ready"].includes(status) && canRestart && /* @__PURE__ */ jsx("span", { className: "dzu-previewButton", style: iconByFn.restart, onClick: restart })
|
|
50
|
+
] })
|
|
51
|
+
] });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
Preview.propTypes = {
|
|
55
|
+
className: PropTypes.string,
|
|
56
|
+
imageClassName: PropTypes.string,
|
|
57
|
+
style: PropTypes.object,
|
|
58
|
+
imageStyle: PropTypes.object,
|
|
59
|
+
fileWithMeta: PropTypes.shape({
|
|
60
|
+
file: PropTypes.any.isRequired,
|
|
61
|
+
meta: PropTypes.object.isRequired,
|
|
62
|
+
cancel: PropTypes.func.isRequired,
|
|
63
|
+
restart: PropTypes.func.isRequired,
|
|
64
|
+
remove: PropTypes.func.isRequired,
|
|
65
|
+
xhr: PropTypes.any
|
|
66
|
+
}).isRequired,
|
|
67
|
+
// copy of fileWithMeta.meta, won't be mutated
|
|
68
|
+
meta: PropTypes.shape({
|
|
69
|
+
status: PropTypes.oneOf([
|
|
70
|
+
"preparing",
|
|
71
|
+
"error_file_size",
|
|
72
|
+
"error_validation",
|
|
73
|
+
"ready",
|
|
74
|
+
"getting_upload_params",
|
|
75
|
+
"error_upload_params",
|
|
76
|
+
"uploading",
|
|
77
|
+
"exception_upload",
|
|
78
|
+
"aborted",
|
|
79
|
+
"error_upload",
|
|
80
|
+
"headers_received",
|
|
81
|
+
"done"
|
|
82
|
+
]).isRequired,
|
|
83
|
+
type: PropTypes.string.isRequired,
|
|
84
|
+
name: PropTypes.string,
|
|
85
|
+
uploadedDate: PropTypes.string.isRequired,
|
|
86
|
+
percent: PropTypes.number,
|
|
87
|
+
size: PropTypes.number,
|
|
88
|
+
lastModifiedDate: PropTypes.string,
|
|
89
|
+
previewUrl: PropTypes.string,
|
|
90
|
+
duration: PropTypes.number,
|
|
91
|
+
width: PropTypes.number,
|
|
92
|
+
height: PropTypes.number,
|
|
93
|
+
videoWidth: PropTypes.number,
|
|
94
|
+
videoHeight: PropTypes.number,
|
|
95
|
+
validationError: PropTypes.any
|
|
96
|
+
}).isRequired,
|
|
97
|
+
isUpload: PropTypes.bool.isRequired,
|
|
98
|
+
canCancel: PropTypes.bool.isRequired,
|
|
99
|
+
canRemove: PropTypes.bool.isRequired,
|
|
100
|
+
canRestart: PropTypes.bool.isRequired,
|
|
101
|
+
files: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
102
|
+
// eslint-disable-line react/no-unused-prop-types
|
|
103
|
+
extra: PropTypes.shape({
|
|
104
|
+
active: PropTypes.bool.isRequired,
|
|
105
|
+
reject: PropTypes.bool.isRequired,
|
|
106
|
+
dragged: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
107
|
+
accept: PropTypes.string.isRequired,
|
|
108
|
+
multiple: PropTypes.bool.isRequired,
|
|
109
|
+
minSizeBytes: PropTypes.number.isRequired,
|
|
110
|
+
maxSizeBytes: PropTypes.number.isRequired,
|
|
111
|
+
maxFiles: PropTypes.number.isRequired
|
|
112
|
+
}).isRequired
|
|
113
|
+
};
|
|
114
|
+
export {
|
|
115
|
+
Preview as default
|
|
116
|
+
};
|
|
117
|
+
//# sourceMappingURL=Preview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Preview.js","sources":["../../src/dropzone/Preview.tsx"],"sourcesContent":["import React from 'react'\r\nimport PropTypes from 'prop-types'\r\n\r\nimport { formatBytes, formatDuration } from './utils'\r\nimport { IPreviewProps } from './Dropzone'\r\n//@ts-ignore\r\nimport cancelImg from './assets/cancel.svg'\r\n//@ts-ignore\r\nimport removeImg from './assets/remove.svg'\r\n//@ts-ignore\r\nimport restartImg from './assets/restart.svg'\r\n\r\nconst iconByFn = {\r\n cancel: { backgroundImage: `url(${cancelImg})` },\r\n remove: { backgroundImage: `url(${removeImg})` },\r\n restart: { backgroundImage: `url(${restartImg})` },\r\n}\r\n\r\nclass Preview extends React.PureComponent<IPreviewProps> {\r\n render() {\r\n const {\r\n className,\r\n imageClassName,\r\n style,\r\n imageStyle,\r\n fileWithMeta: { cancel, remove, restart },\r\n meta: { name = '', percent = 0, size = 0, previewUrl, status, duration, validationError },\r\n isUpload,\r\n canCancel,\r\n canRemove,\r\n canRestart,\r\n extra: { minSizeBytes },\r\n } = this.props\r\n\r\n let title = `${name || '?'}, ${formatBytes(size)}`\r\n if (duration) title = `${title}, ${formatDuration(duration)}`\r\n\r\n if (status === 'error_file_size' || status === 'error_validation') {\r\n return (\r\n <div className={className} style={style}>\r\n <span className=\"dzu-previewFileNameError\">{title}</span>\r\n {status === 'error_file_size' && <span>{size < minSizeBytes ? 'File too small' : 'File too big'}</span>}\r\n {status === 'error_validation' && <span>{String(validationError)}</span>}\r\n {canRemove && <span className=\"dzu-previewButton\" style={iconByFn.remove} onClick={remove} />}\r\n </div>\r\n )\r\n }\r\n\r\n if (status === 'error_upload_params' || status === 'exception_upload' || status === 'error_upload') {\r\n title = `${title} (upload failed)`\r\n }\r\n if (status === 'aborted') title = `${title} (cancelled)`\r\n\r\n return (\r\n <div className={className} style={style}>\r\n {previewUrl && <img className={imageClassName} style={imageStyle} src={previewUrl} alt={title} title={title} />}\r\n {!previewUrl && <span className=\"dzu-previewFileName\">{title}</span>}\r\n\r\n <div className=\"dzu-previewStatusContainer\">\r\n {isUpload && (\r\n <progress max={100} value={status === 'done' || status === 'headers_received' ? 100 : percent} />\r\n )}\r\n\r\n {status === 'uploading' && canCancel && (\r\n <span className=\"dzu-previewButton\" style={iconByFn.cancel} onClick={cancel} />\r\n )}\r\n {status !== 'preparing' && status !== 'getting_upload_params' && status !== 'uploading' && canRemove && (\r\n <span className=\"dzu-previewButton\" style={iconByFn.remove} onClick={remove} />\r\n )}\r\n {['error_upload_params', 'exception_upload', 'error_upload', 'aborted', 'ready'].includes(status) &&\r\n canRestart && <span className=\"dzu-previewButton\" style={iconByFn.restart} onClick={restart} />}\r\n </div>\r\n </div>\r\n )\r\n }\r\n}\r\n\r\n// @ts-ignore\r\nPreview.propTypes = {\r\n className: PropTypes.string,\r\n imageClassName: PropTypes.string,\r\n style: PropTypes.object,\r\n imageStyle: PropTypes.object,\r\n fileWithMeta: PropTypes.shape({\r\n file: PropTypes.any.isRequired,\r\n meta: PropTypes.object.isRequired,\r\n cancel: PropTypes.func.isRequired,\r\n restart: PropTypes.func.isRequired,\r\n remove: PropTypes.func.isRequired,\r\n xhr: PropTypes.any,\r\n }).isRequired,\r\n // copy of fileWithMeta.meta, won't be mutated\r\n meta: PropTypes.shape({\r\n status: PropTypes.oneOf([\r\n 'preparing',\r\n 'error_file_size',\r\n 'error_validation',\r\n 'ready',\r\n 'getting_upload_params',\r\n 'error_upload_params',\r\n 'uploading',\r\n 'exception_upload',\r\n 'aborted',\r\n 'error_upload',\r\n 'headers_received',\r\n 'done',\r\n ]).isRequired,\r\n type: PropTypes.string.isRequired,\r\n name: PropTypes.string,\r\n uploadedDate: PropTypes.string.isRequired,\r\n percent: PropTypes.number,\r\n size: PropTypes.number,\r\n lastModifiedDate: PropTypes.string,\r\n previewUrl: PropTypes.string,\r\n duration: PropTypes.number,\r\n width: PropTypes.number,\r\n height: PropTypes.number,\r\n videoWidth: PropTypes.number,\r\n videoHeight: PropTypes.number,\r\n validationError: PropTypes.any,\r\n }).isRequired,\r\n isUpload: PropTypes.bool.isRequired,\r\n canCancel: PropTypes.bool.isRequired,\r\n canRemove: PropTypes.bool.isRequired,\r\n canRestart: PropTypes.bool.isRequired,\r\n files: PropTypes.arrayOf(PropTypes.any).isRequired, // eslint-disable-line react/no-unused-prop-types\r\n extra: PropTypes.shape({\r\n active: PropTypes.bool.isRequired,\r\n reject: PropTypes.bool.isRequired,\r\n dragged: PropTypes.arrayOf(PropTypes.any).isRequired,\r\n accept: PropTypes.string.isRequired,\r\n multiple: PropTypes.bool.isRequired,\r\n minSizeBytes: PropTypes.number.isRequired,\r\n maxSizeBytes: PropTypes.number.isRequired,\r\n maxFiles: PropTypes.number.isRequired,\r\n }).isRequired,\r\n}\r\n\r\nexport default Preview\r\n"],"names":[],"mappings":";;;;;;;AAYA,MAAM,WAAW;AAAA,EACf,QAAQ,EAAE,iBAAiB,OAAO,SAAS,IAAA;AAAA,EAC3C,QAAQ,EAAE,iBAAiB,OAAO,SAAS,IAAA;AAAA,EAC3C,SAAS,EAAE,iBAAiB,OAAO,UAAU,IAAA;AAC/C;AAEA,MAAM,gBAAgB,MAAM,cAA6B;AAAA,EACvD,SAAS;AACP,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,cAAc,EAAE,QAAQ,QAAQ,QAAA;AAAA,MAChC,MAAM,EAAE,OAAO,IAAI,UAAU,GAAG,OAAO,GAAG,YAAY,QAAQ,UAAU,gBAAA;AAAA,MACxE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,OAAO,EAAE,aAAA;AAAA,IAAa,IACpB,KAAK;AAET,QAAI,QAAQ,GAAG,QAAQ,GAAG,KAAK,YAAY,IAAI,CAAC;AAChD,QAAI,SAAU,SAAQ,GAAG,KAAK,KAAK,eAAe,QAAQ,CAAC;AAE3D,QAAI,WAAW,qBAAqB,WAAW,oBAAoB;AACjE,aACE,qBAAC,OAAA,EAAI,WAAsB,OACzB,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,WAAU,4BAA4B,UAAA,OAAM;AAAA,QACjD,WAAW,qBAAqB,oBAAC,UAAM,UAAA,OAAO,eAAe,mBAAmB,gBAAe;AAAA,QAC/F,WAAW,sBAAsB,oBAAC,QAAA,EAAM,UAAA,OAAO,eAAe,GAAE;AAAA,QAChE,iCAAc,QAAA,EAAK,WA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}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
const SubmitButton = (props) => {
|
|
4
|
+
const { className, buttonClassName, style, buttonStyle, disabled, content, onSubmit, files } = props;
|
|
5
|
+
const _disabled = files.some((f) => ["preparing", "getting_upload_params", "uploading"].includes(f.meta.status)) || !files.some((f) => ["headers_received", "done"].includes(f.meta.status));
|
|
6
|
+
const handleSubmit = () => {
|
|
7
|
+
onSubmit(files.filter((f) => ["headers_received", "done"].includes(f.meta.status)));
|
|
8
|
+
};
|
|
9
|
+
return /* @__PURE__ */ jsx("div", { className, style, children: /* @__PURE__ */ jsx("button", { className: buttonClassName, style: buttonStyle, onClick: handleSubmit, disabled: disabled || _disabled, children: content }) });
|
|
10
|
+
};
|
|
11
|
+
SubmitButton.propTypes = {
|
|
12
|
+
className: PropTypes.string,
|
|
13
|
+
buttonClassName: PropTypes.string,
|
|
14
|
+
style: PropTypes.object,
|
|
15
|
+
buttonStyle: PropTypes.object,
|
|
16
|
+
disabled: PropTypes.bool.isRequired,
|
|
17
|
+
content: PropTypes.node,
|
|
18
|
+
onSubmit: PropTypes.func.isRequired,
|
|
19
|
+
files: PropTypes.arrayOf(PropTypes.object).isRequired,
|
|
20
|
+
extra: PropTypes.shape({
|
|
21
|
+
active: PropTypes.bool.isRequired,
|
|
22
|
+
reject: PropTypes.bool.isRequired,
|
|
23
|
+
dragged: PropTypes.arrayOf(PropTypes.any).isRequired,
|
|
24
|
+
accept: PropTypes.string.isRequired,
|
|
25
|
+
multiple: PropTypes.bool.isRequired,
|
|
26
|
+
minSizeBytes: PropTypes.number.isRequired,
|
|
27
|
+
maxSizeBytes: PropTypes.number.isRequired,
|
|
28
|
+
maxFiles: PropTypes.number.isRequired
|
|
29
|
+
}).isRequired
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
SubmitButton as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=SubmitButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","sources":["../../src/dropzone/SubmitButton.tsx"],"sourcesContent":["import React from 'react'\r\nimport PropTypes from 'prop-types'\r\n\r\nimport { ISubmitButtonProps } from './Dropzone'\r\n\r\nconst SubmitButton = (props: ISubmitButtonProps) => {\r\n const { className, buttonClassName, style, buttonStyle, disabled, content, onSubmit, files } = props\r\n\r\n const _disabled =\r\n files.some(f => ['preparing', 'getting_upload_params', 'uploading'].includes(f.meta.status)) ||\r\n !files.some(f => ['headers_received', 'done'].includes(f.meta.status))\r\n\r\n const handleSubmit = () => {\r\n onSubmit(files.filter(f => ['headers_received', 'done'].includes(f.meta.status)))\r\n }\r\n\r\n return (\r\n <div className={className} style={style}>\r\n <button className={buttonClassName} style={buttonStyle} onClick={handleSubmit} disabled={disabled || _disabled}>\r\n {content}\r\n </button>\r\n </div>\r\n )\r\n}\r\n\r\nSubmitButton.propTypes = {\r\n className: PropTypes.string,\r\n buttonClassName: PropTypes.string,\r\n style: PropTypes.object,\r\n buttonStyle: PropTypes.object,\r\n disabled: PropTypes.bool.isRequired,\r\n content: PropTypes.node,\r\n onSubmit: PropTypes.func.isRequired,\r\n files: PropTypes.arrayOf(PropTypes.object).isRequired,\r\n extra: PropTypes.shape({\r\n active: PropTypes.bool.isRequired,\r\n reject: PropTypes.bool.isRequired,\r\n dragged: PropTypes.arrayOf(PropTypes.any).isRequired,\r\n accept: PropTypes.string.isRequired,\r\n multiple: PropTypes.bool.isRequired,\r\n minSizeBytes: PropTypes.number.isRequired,\r\n maxSizeBytes: PropTypes.number.isRequired,\r\n maxFiles: PropTypes.number.isRequired,\r\n }).isRequired,\r\n}\r\n\r\nexport default SubmitButton\r\n"],"names":[],"mappings":";;AAKA,MAAM,eAAe,CAAC,UAA8B;AAClD,QAAM,EAAE,WAAW,iBAAiB,OAAO,aAAa,UAAU,SAAS,UAAU,MAAA,IAAU;AAE/F,QAAM,YAC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%201,0%20C1.6,0%202,0.4%202,1%20L2,13%20C2,13.6%201.6,14%201,14%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M7,14%20C6.4,14%206,13.6%206,13%20L6,1%20C6,0.4%206.4,0%207,0%20C7.6,0%208,0.4%208,1%20L8,13%20C8,13.6%207.6,14%207,14%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
cancelImg as default
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=cancel.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancel.svg.js","sources":["../../../src/dropzone/assets/cancel.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20viewBox='0%200%208%2014'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%23333333'%3e%3cpath%20d='M1,14%20C0.4,14%200,13.6%200,13%20L0,1%20C0,0.4%200.4,0%201,0%20C1.6,0%202,0.4%202,1%20L2,13%20C2,13.6%201.6,14%201,14%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M7,14%20C6.4,14%206,13.6%206,13%20L6,1%20C6,0.4%206.4,0%207,0%20C7.6,0%208,0.4%208,1%20L8,13%20C8,13.6%207.6,14%207,14%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/svg%3e\""],"names":[],"mappings":"AAAA,MAAA,YAAe;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const removeImg = "data:image/svg+xml,%3csvg%20viewBox='0%200%2014%2014'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='translate(-5.0,%200.0)'%20fill='%23333333'%3e%3cg%20transform='translate(4.0,%200.0)'%3e%3cpolygon%20points='7.719%204.964%2012.692%200.017%2014.389%201.715%209.412%206.666%2014.354%2011.634%2012.657%2013.331%206.017%206.657%207.715%204.960'%3e%3c/polygon%3e%3cpolygon%20points='7.612%204.964%207.616%204.960%209.313%206.657%202.674%2013.331%200.977%2011.634%205.919%206.666%200.942%201.715%202.639%200.017'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
removeImg as default
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=remove.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove.svg.js","sources":["../../../src/dropzone/assets/remove.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20viewBox='0%200%2014%2014'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20transform='translate(-5.0,%200.0)'%20fill='%23333333'%3e%3cg%20transform='translate(4.0,%200.0)'%3e%3cpolygon%20points='7.719%204.964%2012.692%200.017%2014.389%201.715%209.412%206.666%2014.354%2011.634%2012.657%2013.331%206.017%206.657%207.715%204.960'%3e%3c/polygon%3e%3cpolygon%20points='7.612%204.964%207.616%204.960%209.313%206.657%202.674%2013.331%200.977%2011.634%205.919%206.666%200.942%201.715%202.639%200.017'%3e%3c/polygon%3e%3c/g%3e%3c/g%3e%3c/svg%3e\""],"names":[],"mappings":"AAAA,MAAA,YAAe;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const restartImg = "data:image/svg+xml,%3csvg%20viewBox='0%200%2011%2015'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20d='M0.5,14.9%20C0.2,14.7%200,14.4%200,14%20L0,2%20C0,1.6%200.2,1.3%200.5,1.1%20C0.8,0.9%201.2,0.9%201.5,1.1%20L10.5,7.1%20C10.8,7.3%2010.9,7.6%2010.9,7.9%20C10.9,8.2%2010.7,8.5%2010.5,8.7%20L1.5,14.7%20C1.4,14.9%200.8,15.1%200.5,14.9%20Z%20M2,3.9%20L2,12.2%20L8.2,8.1%20L2,3.9%20Z'%3e%3c/path%3e%3c/g%3e%3c/svg%3e";
|
|
2
|
+
export {
|
|
3
|
+
restartImg as default
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=restart.svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restart.svg.js","sources":["../../../src/dropzone/assets/restart.svg"],"sourcesContent":["export default \"data:image/svg+xml,%3csvg%20viewBox='0%200%2011%2015'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%3e%3cpath%20d='M0.5,14.9%20C0.2,14.7%200,14.4%200,14%20L0,2%20C0,1.6%200.2,1.3%200.5,1.1%20C0.8,0.9%201.2,0.9%201.5,1.1%20L10.5,7.1%20C10.8,7.3%2010.9,7.6%2010.9,7.9%20C10.9,8.2%2010.7,8.5%2010.5,8.7%20L1.5,14.7%20C1.4,14.9%200.8,15.1%200.5,14.9%20Z%20M2,3.9%20L2,12.2%20L8.2,8.1%20L2,3.9%20Z'%3e%3c/path%3e%3c/g%3e%3c/svg%3e\""],"names":[],"mappings":"AAAA,MAAA,aAAe;"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
const formatBytes = (b) => {
|
|
2
|
+
const units = ["bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
3
|
+
let l = 0;
|
|
4
|
+
let n = b;
|
|
5
|
+
while (n >= 1024) {
|
|
6
|
+
n /= 1024;
|
|
7
|
+
l += 1;
|
|
8
|
+
}
|
|
9
|
+
return `${n.toFixed(n >= 10 || l < 1 ? 0 : 1)}${units[l]}`;
|
|
10
|
+
};
|
|
11
|
+
const formatDuration = (seconds) => {
|
|
12
|
+
const date = /* @__PURE__ */ new Date(0);
|
|
13
|
+
date.setSeconds(seconds);
|
|
14
|
+
const dateString = date.toISOString().slice(11, 19);
|
|
15
|
+
if (seconds < 3600) return dateString.slice(3);
|
|
16
|
+
return dateString;
|
|
17
|
+
};
|
|
18
|
+
const accepts = (file, accept) => {
|
|
19
|
+
if (!accept || accept === "*") return true;
|
|
20
|
+
const mimeType = file.type || "";
|
|
21
|
+
const baseMimeType = mimeType.replace(/\/.*$/, "");
|
|
22
|
+
return accept.split(",").map((t) => t.trim()).some((type) => {
|
|
23
|
+
if (type.charAt(0) === ".") {
|
|
24
|
+
return file.name === void 0 || file.name.toLowerCase().endsWith(type.toLowerCase());
|
|
25
|
+
} else if (type.endsWith("/*")) {
|
|
26
|
+
return baseMimeType === type.replace(/\/.*$/, "");
|
|
27
|
+
}
|
|
28
|
+
return mimeType === type;
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
const resolveValue = (value, ...args) => {
|
|
32
|
+
if (typeof value === "function") return value(...args);
|
|
33
|
+
return value;
|
|
34
|
+
};
|
|
35
|
+
const defaultClassNames = {
|
|
36
|
+
dropzone: "dzu-dropzone",
|
|
37
|
+
dropzoneActive: "dzu-dropzoneActive",
|
|
38
|
+
dropzoneReject: "dzu-dropzoneActive",
|
|
39
|
+
dropzoneDisabled: "dzu-dropzoneDisabled",
|
|
40
|
+
input: "dzu-input",
|
|
41
|
+
inputLabel: "dzu-inputLabel",
|
|
42
|
+
inputLabelWithFiles: "dzu-inputLabelWithFiles",
|
|
43
|
+
preview: "dzu-previewContainer",
|
|
44
|
+
previewImage: "dzu-previewImage",
|
|
45
|
+
submitButtonContainer: "dzu-submitButtonContainer",
|
|
46
|
+
submitButton: "dzu-submitButton"
|
|
47
|
+
};
|
|
48
|
+
const mergeStyles = (classNames, styles, addClassNames, ...args) => {
|
|
49
|
+
const resolvedClassNames = { ...defaultClassNames };
|
|
50
|
+
const resolvedStyles = { ...styles };
|
|
51
|
+
for (const [key, value] of Object.entries(classNames)) {
|
|
52
|
+
resolvedClassNames[key] = resolveValue(value, ...args);
|
|
53
|
+
}
|
|
54
|
+
for (const [key, value] of Object.entries(addClassNames)) {
|
|
55
|
+
resolvedClassNames[key] = `${resolvedClassNames[key]} ${resolveValue(value, ...args)}`;
|
|
56
|
+
}
|
|
57
|
+
for (const [key, value] of Object.entries(styles)) {
|
|
58
|
+
resolvedStyles[key] = resolveValue(value, ...args);
|
|
59
|
+
}
|
|
60
|
+
return { classNames: resolvedClassNames, styles: resolvedStyles };
|
|
61
|
+
};
|
|
62
|
+
const getFilesFromEvent = (event) => {
|
|
63
|
+
let items = null;
|
|
64
|
+
if ("dataTransfer" in event) {
|
|
65
|
+
const dt = event.dataTransfer;
|
|
66
|
+
if ("files" in dt && dt.files.length) {
|
|
67
|
+
items = dt.files;
|
|
68
|
+
} else if (dt.items && dt.items.length) {
|
|
69
|
+
items = dt.items;
|
|
70
|
+
}
|
|
71
|
+
} else if (event.target && event.target.files) {
|
|
72
|
+
items = event.target.files;
|
|
73
|
+
}
|
|
74
|
+
return Array.prototype.slice.call(items);
|
|
75
|
+
};
|
|
76
|
+
export {
|
|
77
|
+
accepts,
|
|
78
|
+
defaultClassNames,
|
|
79
|
+
formatBytes,
|
|
80
|
+
formatDuration,
|
|
81
|
+
getFilesFromEvent,
|
|
82
|
+
mergeStyles,
|
|
83
|
+
resolveValue
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../src/dropzone/utils.ts"],"sourcesContent":["import React from 'react'\r\nimport { IStyleCustomization } from './Dropzone'\r\n\r\nexport const formatBytes = (b: number) => {\r\n const units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']\r\n let l = 0\r\n let n = b\r\n\r\n while (n >= 1024) {\r\n n /= 1024\r\n l += 1\r\n }\r\n\r\n return `${n.toFixed(n >= 10 || l < 1 ? 0 : 1)}${units[l]}`\r\n}\r\n\r\nexport const formatDuration = (seconds: number) => {\r\n const date = new Date(0)\r\n date.setSeconds(seconds)\r\n const dateString = date.toISOString().slice(11, 19)\r\n if (seconds < 3600) return dateString.slice(3)\r\n return dateString\r\n}\r\n\r\n// adapted from: https://github.com/okonet/attr-accept/blob/master/src/index.js\r\n// returns true if file.name is empty and accept string is something like \".csv\",\r\n// because file comes from dataTransferItem for drag events, and\r\n// dataTransferItem.name is always empty\r\nexport const accepts = (file: File, accept: string) => {\r\n if (!accept || accept === '*') return true\r\n\r\n const mimeType = file.type || ''\r\n const baseMimeType = mimeType.replace(/\\/.*$/, '')\r\n\r\n return accept\r\n .split(',')\r\n .map(t => t.trim())\r\n .some(type => {\r\n if (type.charAt(0) === '.') {\r\n return file.name === undefined || file.name.toLowerCase().endsWith(type.toLowerCase())\r\n } else if (type.endsWith('/*')) {\r\n // this is something like an image/* mime type\r\n return baseMimeType === type.replace(/\\/.*$/, '')\r\n }\r\n return mimeType === type\r\n })\r\n}\r\n\r\ntype ResolveFn<T> = (...args: any[]) => T\r\n\r\nexport const resolveValue = <T = any>(value: ResolveFn<T> | T, ...args: any[]) => {\r\n if (typeof value === 'function') return (value as ResolveFn<T>)(...args)\r\n return value\r\n}\r\n\r\nexport const defaultClassNames = {\r\n dropzone: 'dzu-dropzone',\r\n dropzoneActive: 'dzu-dropzoneActive',\r\n dropzoneReject: 'dzu-dropzoneActive',\r\n dropzoneDisabled: 'dzu-dropzoneDisabled',\r\n input: 'dzu-input',\r\n inputLabel: 'dzu-inputLabel',\r\n inputLabelWithFiles: 'dzu-inputLabelWithFiles',\r\n preview: 'dzu-previewContainer',\r\n previewImage: 'dzu-previewImage',\r\n submitButtonContainer: 'dzu-submitButtonContainer',\r\n submitButton: 'dzu-submitButton',\r\n}\r\n\r\nexport const mergeStyles = (\r\n classNames: IStyleCustomization<string>,\r\n styles: IStyleCustomization<React.CSSProperties>,\r\n addClassNames: IStyleCustomization<string>,\r\n ...args: any[]\r\n) => {\r\n const resolvedClassNames: { [property: string]: string } = { ...defaultClassNames }\r\n const resolvedStyles = { ...styles } as { [property: string]: string }\r\n\r\n for (const [key, value] of Object.entries(classNames)) {\r\n resolvedClassNames[key] = resolveValue(value, ...args)\r\n }\r\n\r\n for (const [key, value] of Object.entries(addClassNames)) {\r\n resolvedClassNames[key] = `${resolvedClassNames[key]} ${resolveValue(value, ...args)}`\r\n }\r\n\r\n for (const [key, value] of Object.entries(styles)) {\r\n resolvedStyles[key] = resolveValue(value, ...args)\r\n }\r\n\r\n return { classNames: resolvedClassNames, styles: resolvedStyles as IStyleCustomization<React.CSSProperties> }\r\n}\r\n\r\nexport const getFilesFromEvent = (\r\n event: React.DragEvent<HTMLElement> | React.ChangeEvent<HTMLInputElement>,\r\n): Array<File | DataTransferItem> => {\r\n let items = null\r\n\r\n if ('dataTransfer' in event) {\r\n const dt = event.dataTransfer\r\n\r\n // NOTE: Only the 'drop' event has access to DataTransfer.files, otherwise it will always be empty\r\n if ('files' in dt && dt.files.length) {\r\n items = dt.files\r\n } else if (dt.items && dt.items.length) {\r\n items = dt.items\r\n }\r\n } else if (event.target && event.target.files) {\r\n items = event.target.files\r\n }\r\n\r\n return Array.prototype.slice.call(items)\r\n}\r\n"],"names":[],"mappings":"AAGO,MAAM,cAAc,CAAC,MAAc;AACxC,QAAM,QAAQ,CAAC,SAAS,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,MAAM,IAAI;AACtE,MAAI,IAAI;AACR,MAAI,IAAI;AAER,SAAO,KAAK,MAAM;AAChB,SAAK;AACL,SAAK;AAAA,EACP;AAEA,SAAO,GAAG,EAAE,QAAQ,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC;AAC1D;AAEO,MAAM,iBAAiB,CAAC,YAAoB;AACjD,QAAM,OAAO,oBAAI,KAAK,CAAC;AACvB,OAAK,WAAW,OAAO;AACvB,QAAM,aAAa,KAAK,YAAA,EAAc,MAAM,IAAI,EAAE;AAClD,MAAI,UAAU,KAAM,QAAO,WAAW,MAAM,CAAC;AAC7C,SAAO;AACT;AAMO,MAAM,UAAU,CAAC,MAAY,WAAmB;AACrD,MAAI,CAAC,UAAU,WAAW,IAAK,QAAO;AAEtC,QAAM,WAAW,KAAK,QAAQ;AAC9B,QAAM,eAAe,SAAS,QAAQ,SAAS,EAAE;AAEjD,SAAO,OACJ,MAAM,GAAG,EACT,IAAI,CAAA,MAAK,EAAE,KAAA,CAAM,EACjB,KAAK,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