siam-ui-utils 3.0.28 → 3.0.30

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.
Files changed (114) hide show
  1. package/dist/CustomBootstrap.js +9 -9
  2. package/dist/_virtual/_commonjsHelpers.js +7 -7
  3. package/dist/_virtual/events.js +6 -6
  4. package/dist/_virtual/events2.js +5 -5
  5. package/dist/_virtual/index.js +8 -8
  6. package/dist/_virtual/index2.js +5 -5
  7. package/dist/_virtual/react-dropzone.js +8 -8
  8. package/dist/_virtual/react-dropzone2.js +5 -5
  9. package/dist/assets/img/copiar.png.js +5 -5
  10. package/dist/assets/img/take-photo.jpg.js +5 -5
  11. package/dist/constants.js +9 -9
  12. package/dist/copy-link/index.js +60 -60
  13. package/dist/copy-link/styles.css +37 -37
  14. package/dist/custom-input/CustomInputCheckbox.js +36 -36
  15. package/dist/custom-input/CustomInputCurrency.js +85 -85
  16. package/dist/custom-input/CustomInputFile.js +46 -46
  17. package/dist/custom-input/CustomInputRadio.js +67 -67
  18. package/dist/custom-input/constant.js +5 -5
  19. package/dist/custom-input/index.js +12 -14
  20. package/dist/custom-input/index.js.map +1 -1
  21. package/dist/drag-and-dropzone/config.js +59 -59
  22. package/dist/drag-and-dropzone/index.js +39 -39
  23. package/dist/dropzone/Input.js +77 -77
  24. package/dist/dropzone/Layout.js +50 -50
  25. package/dist/dropzone/Preview.js +117 -117
  26. package/dist/dropzone/SubmitButton.js +34 -34
  27. package/dist/dropzone/assets/cancel.svg.js +5 -5
  28. package/dist/dropzone/assets/remove.svg.js +5 -5
  29. package/dist/dropzone/assets/restart.svg.js +5 -5
  30. package/dist/dropzone/index.js +514 -514
  31. package/dist/dropzone/utils.js +93 -93
  32. package/dist/dropzone-uploader/base/index.js +135 -135
  33. package/dist/dropzone-uploader/index.js +7 -7
  34. package/dist/dropzone-uploader/styled/index.js +149 -149
  35. package/dist/iconos/constants-svg.js +666 -666
  36. package/dist/iconos/icon-button-svg.js +50 -50
  37. package/dist/iconos/index.js +24 -24
  38. package/dist/iconos/styled-icon.js +26 -26
  39. package/dist/index.js +4 -4
  40. package/dist/intl-messages/index.js +11 -11
  41. package/dist/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js +8 -8
  42. package/dist/node_modules/@babel/runtime/helpers/esm/extends.js +13 -13
  43. package/dist/node_modules/@babel/runtime/helpers/esm/inheritsLoose.js +8 -8
  44. package/dist/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +13 -13
  45. package/dist/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js +9 -9
  46. package/dist/node_modules/classnames/index.js +62 -62
  47. package/dist/node_modules/dom-helpers/esm/addClass.js +10 -10
  48. package/dist/node_modules/dom-helpers/esm/hasClass.js +8 -8
  49. package/dist/node_modules/dom-helpers/esm/removeClass.js +16 -16
  50. package/dist/node_modules/events/events.js +372 -372
  51. package/dist/node_modules/react-dropzone-component/dist/react-dropzone.js +1023 -1023
  52. package/dist/node_modules/react-multi-select-component/dist/esm/index.js +178 -178
  53. package/dist/node_modules/react-transition-group/esm/CSSTransition.js +275 -275
  54. package/dist/node_modules/react-transition-group/esm/Transition.js +441 -441
  55. package/dist/node_modules/react-transition-group/esm/TransitionGroup.js +146 -146
  56. package/dist/node_modules/react-transition-group/esm/TransitionGroupContext.js +6 -6
  57. package/dist/node_modules/react-transition-group/esm/config.js +7 -7
  58. package/dist/node_modules/react-transition-group/esm/utils/ChildMapping.js +100 -100
  59. package/dist/node_modules/react-transition-group/esm/utils/PropTypes.js +24 -24
  60. package/dist/node_modules/react-transition-group/esm/utils/reflow.js +7 -7
  61. package/dist/react-notifications/Notification.js +73 -73
  62. package/dist/react-notifications/NotificationContainer.js +59 -59
  63. package/dist/react-notifications/NotificationManager.js +174 -174
  64. package/dist/react-notifications/Notifications.js +72 -72
  65. package/dist/react-notifications/constants.js +26 -26
  66. package/dist/react-notifications/index.js +11 -11
  67. package/dist/select/custom-select/constants.js +8 -8
  68. package/dist/select/custom-select/index.js +90 -90
  69. package/dist/select/custom-select-input/index.js +12 -12
  70. package/dist/select/index.js +9 -9
  71. package/dist/select/multi-select/badge-label-multi-select.js +29 -29
  72. package/dist/select/multi-select/index.css +23 -23
  73. package/dist/select/multi-select/index.js +63 -63
  74. package/dist/select/multi-select/styled-component.js +24 -24
  75. package/dist/timer/index.js +60 -60
  76. package/dist/timer/styles.css +58 -58
  77. package/dist/tomar-foto/index.js +62 -62
  78. package/dist/view-layout/button-editor.js +14 -14
  79. package/dist/view-layout/constants.js +11 -11
  80. package/dist/view-layout/editor-layer.js +28 -28
  81. package/dist/view-layout/index.js +53 -53
  82. package/dist/view-layout/slot-wrapper.js +39 -39
  83. package/dist/view-layout/styles.css +126 -126
  84. package/dist/where-by-room/index.js +20 -20
  85. package/dist/where-by-room/room.js +78 -78
  86. package/package.json +1 -1
  87. package/dist/_virtual/browser.js +0 -8
  88. package/dist/_virtual/browser.js.map +0 -1
  89. package/dist/_virtual/warning.js +0 -8
  90. package/dist/_virtual/warning.js.map +0 -1
  91. package/dist/custom-input/customInputMask/children-wrapper.js +0 -12
  92. package/dist/custom-input/customInputMask/children-wrapper.js.map +0 -1
  93. package/dist/custom-input/customInputMask/constants.js +0 -19
  94. package/dist/custom-input/customInputMask/constants.js.map +0 -1
  95. package/dist/custom-input/customInputMask/hooks.js +0 -159
  96. package/dist/custom-input/customInputMask/hooks.js.map +0 -1
  97. package/dist/custom-input/customInputMask/index.js +0 -184
  98. package/dist/custom-input/customInputMask/index.js.map +0 -1
  99. package/dist/custom-input/customInputMask/utils/defer.js +0 -11
  100. package/dist/custom-input/customInputMask/utils/defer.js.map +0 -1
  101. package/dist/custom-input/customInputMask/utils/helpers.js +0 -42
  102. package/dist/custom-input/customInputMask/utils/helpers.js.map +0 -1
  103. package/dist/custom-input/customInputMask/utils/input.js +0 -25
  104. package/dist/custom-input/customInputMask/utils/input.js.map +0 -1
  105. package/dist/custom-input/customInputMask/utils/mask.js +0 -220
  106. package/dist/custom-input/customInputMask/utils/mask.js.map +0 -1
  107. package/dist/custom-input/customInputMask/utils/parse-mask.js +0 -72
  108. package/dist/custom-input/customInputMask/utils/parse-mask.js.map +0 -1
  109. package/dist/custom-input/customInputMask/validate-props.js +0 -35
  110. package/dist/custom-input/customInputMask/validate-props.js.map +0 -1
  111. package/dist/node_modules/invariant/browser.js +0 -39
  112. package/dist/node_modules/invariant/browser.js.map +0 -1
  113. package/dist/node_modules/warning/warning.js +0 -51
  114. package/dist/node_modules/warning/warning.js.map +0 -1
@@ -1,77 +1,77 @@
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
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
@@ -1,50 +1,50 @@
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
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
@@ -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