siam-ui-utils 3.1.0 → 3.1.2
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 -9
- package/dist/_virtual/_commonjsHelpers.js +7 -7
- package/dist/_virtual/events.js +6 -6
- package/dist/_virtual/events2.js +5 -5
- package/dist/_virtual/index.js +8 -8
- package/dist/_virtual/index2.js +5 -5
- package/dist/assets/img/copiar.png.js +5 -5
- package/dist/assets/img/take-photo.jpg.js +5 -5
- package/dist/constants.js +9 -9
- package/dist/copy-link/index.js +60 -60
- package/dist/copy-link/styles.css +37 -37
- package/dist/custom-input/CustomInputCheckbox.js +37 -37
- package/dist/custom-input/CustomInputCurrency.js +84 -84
- package/dist/custom-input/CustomInputFile.js +47 -47
- package/dist/custom-input/CustomInputRadio.js +68 -68
- package/dist/custom-input/constant.js +5 -5
- package/dist/custom-input/index.js +12 -12
- package/dist/drag-and-dropzone/DropzoneComponent.js +83 -83
- package/dist/drag-and-dropzone/config.js +59 -59
- package/dist/drag-and-dropzone/index.js +39 -39
- package/dist/dropzone/Input.js +77 -77
- package/dist/dropzone/Layout.js +50 -50
- package/dist/dropzone/Preview.js +117 -117
- package/dist/dropzone/SubmitButton.js +34 -34
- package/dist/dropzone/assets/cancel.svg.js +5 -5
- package/dist/dropzone/assets/remove.svg.js +5 -5
- package/dist/dropzone/assets/restart.svg.js +5 -5
- package/dist/dropzone/index.js +514 -514
- package/dist/dropzone/utils.js +93 -93
- package/dist/dropzone-uploader/base/index.js +135 -135
- package/dist/dropzone-uploader/index.js +7 -7
- package/dist/dropzone-uploader/styled/index.js +148 -148
- package/dist/iconos/constants-svg.js +666 -666
- package/dist/iconos/icon-button-svg.js +50 -50
- package/dist/iconos/index.js +24 -24
- package/dist/iconos/styled-icon.js +26 -26
- package/dist/index.js +4 -4
- package/dist/intl-messages/index.js +11 -11
- package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -8
- package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -13
- package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -8
- package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +13 -13
- package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -9
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js +77 -0
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Badge.js.map +1 -0
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Button.js +111 -111
- package/dist/node_modules/@neolution-ch/reactstrap/esm/CloseButton.js +106 -106
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Col.js +125 -125
- package/dist/node_modules/@neolution-ch/reactstrap/esm/FormGroup.js +75 -75
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Input.js +225 -225
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Label.js +122 -122
- package/dist/node_modules/@neolution-ch/reactstrap/esm/Row.js +83 -83
- package/dist/node_modules/@neolution-ch/reactstrap/esm/utils.js +68 -68
- package/dist/node_modules/classnames/index.js +62 -62
- package/dist/node_modules/dom-helpers/esm/addClass.js +10 -10
- package/dist/node_modules/dom-helpers/esm/hasClass.js +8 -8
- package/dist/node_modules/dom-helpers/esm/removeClass.js +16 -16
- package/dist/node_modules/dropzone/dist/dropzone.js +1968 -1968
- package/dist/node_modules/events/events.js +372 -372
- package/dist/node_modules/just-extend/index.esm.js +43 -43
- package/dist/node_modules/react-transition-group/esm/CSSTransition.js +275 -275
- package/dist/node_modules/react-transition-group/esm/Transition.js +441 -441
- package/dist/node_modules/react-transition-group/esm/TransitionGroup.js +146 -146
- package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js +6 -6
- package/dist/node_modules/react-transition-group/esm/config.js +7 -7
- package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js +100 -100
- package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js +24 -24
- package/dist/node_modules/react-transition-group/esm/utils/reflow.js +7 -7
- package/dist/react-notifications/Notification.js +73 -73
- package/dist/react-notifications/NotificationContainer.js +59 -59
- package/dist/react-notifications/NotificationManager.js +174 -174
- package/dist/react-notifications/Notifications.js +72 -72
- package/dist/react-notifications/constants.js +26 -26
- package/dist/react-notifications/index.js +11 -11
- package/dist/select/custom-select/constants.js +8 -8
- package/dist/select/custom-select/index.js +89 -89
- package/dist/select/custom-select-input/index.js +12 -12
- package/dist/select/index.js +9 -9
- package/dist/select/multi-select/badge-label-multi-select.js +29 -29
- package/dist/select/multi-select/index.css +36 -36
- package/dist/select/multi-select/index.js +171 -171
- package/dist/select/multi-select/index.js.map +1 -1
- package/dist/select/multi-select/styled-component.js +23 -23
- package/dist/select/multi-select/styled-component.js.map +1 -1
- package/dist/timer/index.js +60 -60
- package/dist/timer/styles.css +58 -58
- package/dist/tomar-foto/index.js +62 -62
- package/dist/view-layout/button-editor.js +14 -14
- package/dist/view-layout/constants.js +11 -11
- package/dist/view-layout/editor-layer.js +28 -28
- package/dist/view-layout/index.js +53 -53
- package/dist/view-layout/slot-wrapper.js +39 -39
- package/dist/view-layout/styles.css +126 -126
- package/dist/where-by-room/index.js +20 -20
- package/dist/where-by-room/room.js +78 -78
- package/package.json +1 -4
package/dist/dropzone/Preview.js
CHANGED
|
@@ -1,117 +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
|
|
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
|
|
@@ -1,34 +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
|
|
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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const cancelImg = "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";
|
|
2
|
-
export {
|
|
3
|
-
cancelImg as default
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=cancel.svg.js.map
|
|
1
|
+
const cancelImg = "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";
|
|
2
|
+
export {
|
|
3
|
+
cancelImg as default
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=cancel.svg.js.map
|
|
@@ -1,5 +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
|
|
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
|
|
@@ -1,5 +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
|
|
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
|