@finema/core 2.14.0 → 2.14.1
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/FlexDeck/Base.vue +1 -1
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/EmptyState.vue +1 -1
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/FailedState.vue +1 -1
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/useUploadState.js +8 -11
- package/dist/runtime/components/Image.vue +1 -1
- package/dist/runtime/components/Table/Base.vue +1 -1
- package/dist/runtime/components/Table/index.vue +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -32,8 +32,8 @@ export const useUploadState = (props, emits, onChange, setErrors, value, accepte
|
|
|
32
32
|
};
|
|
33
33
|
const upload = useUploadLoader(request);
|
|
34
34
|
const validateFile = (file) => {
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
if (props.accept && fileAllocate.acceptFile.value) {
|
|
36
|
+
const acceptedTypes = fileAllocate.acceptFile.value;
|
|
37
37
|
const acceptedTypesList = acceptedTypes.split(",").map((type) => type.trim());
|
|
38
38
|
const fileExtension = file.name.toLowerCase().split(".").pop();
|
|
39
39
|
const isValidFileType = acceptedTypesList.some((acceptedType) => {
|
|
@@ -113,6 +113,11 @@ export const useUploadState = (props, emits, onChange, setErrors, value, accepte
|
|
|
113
113
|
processFile(file);
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
+
fileDialog.onChange((files) => {
|
|
117
|
+
if (files?.length) {
|
|
118
|
+
processFile(files[0]);
|
|
119
|
+
}
|
|
120
|
+
});
|
|
116
121
|
const handleOpenFile = () => {
|
|
117
122
|
if (wrapperProps.value.disabled || wrapperProps.value.readonly) return;
|
|
118
123
|
fileDialog.open();
|
|
@@ -136,14 +141,6 @@ export const useUploadState = (props, emits, onChange, setErrors, value, accepte
|
|
|
136
141
|
value: value.value
|
|
137
142
|
});
|
|
138
143
|
};
|
|
139
|
-
watch(
|
|
140
|
-
() => fileDialog.files.value,
|
|
141
|
-
(files) => {
|
|
142
|
-
if (files?.length) {
|
|
143
|
-
processFile(files[0]);
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
144
|
watch(
|
|
148
145
|
() => upload.status.value.isSuccess,
|
|
149
146
|
(isSuccess2) => {
|
|
@@ -163,7 +160,7 @@ export const useUploadState = (props, emits, onChange, setErrors, value, accepte
|
|
|
163
160
|
() => upload.status.value.isError,
|
|
164
161
|
(isError2) => {
|
|
165
162
|
if (isError2) {
|
|
166
|
-
setErrors(StringHelper.getError(upload.status.value.errorData));
|
|
163
|
+
setErrors("\u0E1E\u0E1A\u0E02\u0E49\u0E2D\u0E1C\u0E34\u0E14\u0E1E\u0E25\u0E32\u0E14: " + StringHelper.getError(upload.status.value.errorData));
|
|
167
164
|
}
|
|
168
165
|
}
|
|
169
166
|
);
|