@uxf/ui 10.0.0-beta.39 → 10.0.0-beta.40
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.
|
@@ -28,9 +28,12 @@ const react_1 = __importStar(require("react"));
|
|
|
28
28
|
exports._FileInputBase = (0, react_1.forwardRef)((props, ref) => {
|
|
29
29
|
const onChange = async (e) => {
|
|
30
30
|
if (e.target.files) {
|
|
31
|
-
await props.onUploadFile(e.target.files[0]);
|
|
31
|
+
const res = await props.onUploadFile(e.target.files[0]);
|
|
32
|
+
props.onChange(res, e);
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
props.onChange(null, e);
|
|
32
36
|
}
|
|
33
|
-
props.onChange(null, e);
|
|
34
37
|
};
|
|
35
38
|
return (react_1.default.createElement("input", { accept: props.accept, "aria-invalid": props.isInvalid, "aria-describedby": props["aria-describedby"], className: props.className, disabled: props.isDisabled, form: props.form, id: props.id, name: props.name, onBlur: props.onBlur, onChange: onChange, onFocus: props.onFocus, readOnly: props.isReadOnly, ref: ref, required: props.isRequired, tabIndex: props.isDisabled ? -1 : undefined, type: "file" }));
|
|
36
39
|
});
|
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ function getRandomUuid() {
|
|
|
13
13
|
function uploadFile(file, uploadOptions) {
|
|
14
14
|
// axios.put("/api/upload", file, { signal: uploadOptions?.abortController?.signal, onUploadProgress: uploadOptions?.onUploadProgress });
|
|
15
15
|
return new Promise((resolve) => {
|
|
16
|
-
const time = file.size /
|
|
16
|
+
const time = file.size / 100;
|
|
17
17
|
const interval = time / 10;
|
|
18
18
|
let loaded = 0;
|
|
19
19
|
const intervalTimer = window.setInterval(() => {
|