@finema/core 3.23.2 → 3.25.0
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/README.md +22 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +3 -14
- package/dist/runtime/components/DevToolsWindow/index.vue +24 -26
- package/dist/runtime/components/Dialog/index.vue +11 -10
- package/dist/runtime/components/Empty.d.vue.ts +1 -1
- package/dist/runtime/components/Empty.vue +16 -12
- package/dist/runtime/components/Empty.vue.d.ts +1 -1
- package/dist/runtime/components/FlexDeck/index.vue +85 -92
- package/dist/runtime/components/Form/FieldWrapper.vue +13 -13
- package/dist/runtime/components/Form/Fields.d.vue.ts +1 -1
- package/dist/runtime/components/Form/Fields.vue +17 -11
- package/dist/runtime/components/Form/Fields.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputCheckbox/index.vue +19 -23
- package/dist/runtime/components/Form/InputCheckboxGroup/index.vue +1 -5
- package/dist/runtime/components/Form/InputCurrency/index.vue +56 -57
- package/dist/runtime/components/Form/InputDateTime/date_time_field.types.d.ts +2 -0
- package/dist/runtime/components/Form/InputDateTime/index.vue +70 -80
- package/dist/runtime/components/Form/InputDateTimeRange/index.vue +78 -75
- package/dist/runtime/components/Form/InputMonth/index.vue +7 -10
- package/dist/runtime/components/Form/InputNumber/index.vue +21 -25
- package/dist/runtime/components/Form/InputRadio/index.d.vue.ts +1 -1
- package/dist/runtime/components/Form/InputRadio/index.vue +1 -5
- package/dist/runtime/components/Form/InputRadio/index.vue.d.ts +1 -1
- package/dist/runtime/components/Form/InputRating/index.vue +1 -5
- package/dist/runtime/components/Form/InputSearch/index.vue +2 -8
- package/dist/runtime/components/Form/InputSelect/index.vue +112 -122
- package/dist/runtime/components/Form/InputSelectMultiple/index.vue +121 -133
- package/dist/runtime/components/Form/InputTags/index.vue +55 -59
- package/dist/runtime/components/Form/InputText/index.vue +122 -133
- package/dist/runtime/components/Form/InputTextarea/index.vue +19 -23
- package/dist/runtime/components/Form/InputTime/index.d.vue.ts +1 -0
- package/dist/runtime/components/Form/InputTime/index.vue +66 -63
- package/dist/runtime/components/Form/InputTime/index.vue.d.ts +1 -0
- package/dist/runtime/components/Form/InputTime/types.d.ts +2 -0
- package/dist/runtime/components/Form/InputToggle/index.vue +18 -21
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +46 -49
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputUploadDropzoneAutoMultiple/index.vue +57 -64
- package/dist/runtime/components/Form/InputUploadImageAuto/index.vue +57 -63
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImagePasteExtension.js +7 -6
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadExtension.js +13 -12
- package/dist/runtime/components/Form/InputWYSIWYG/EditorImageUploadNode.vue +21 -19
- package/dist/runtime/components/Form/InputWYSIWYG/EditorLinkPopover.vue +85 -87
- package/dist/runtime/components/Form/InputWYSIWYG/README.md +96 -96
- package/dist/runtime/components/Form/InputWYSIWYG/index.vue +178 -157
- package/dist/runtime/components/Form/fileState/EmptyState.vue +21 -21
- package/dist/runtime/components/Form/fileState/FailedState.vue +34 -36
- package/dist/runtime/components/Form/fileState/LoadingState.vue +24 -24
- package/dist/runtime/components/Form/fileState/MultipleFilesState.vue +74 -78
- package/dist/runtime/components/Form/fileState/PreviewModal.vue +23 -23
- package/dist/runtime/components/Form/fileState/SuccessState.vue +3 -12
- package/dist/runtime/components/Form/fileState/useFileState.js +2 -10
- package/dist/runtime/components/Form/fileState/useUploadImageState.js +1 -3
- package/dist/runtime/components/Form/fileState/useUploadState.js +8 -19
- package/dist/runtime/components/Form/fileState/useUploadStateMultiple.js +25 -30
- package/dist/runtime/components/Form/index.vue +5 -5
- package/dist/runtime/components/Image.vue +22 -28
- package/dist/runtime/components/Loader.d.vue.ts +1 -1
- package/dist/runtime/components/Loader.vue +10 -7
- package/dist/runtime/components/Loader.vue.d.ts +1 -1
- package/dist/runtime/components/Log/LogItem.vue +1 -3
- package/dist/runtime/components/Log/index.vue +1 -3
- package/dist/runtime/components/Table/Base.vue +117 -137
- package/dist/runtime/components/Table/ColumnDate.vue +1 -1
- package/dist/runtime/components/Table/ColumnDateTime.vue +1 -1
- package/dist/runtime/components/Table/ColumnImage.vue +4 -4
- package/dist/runtime/components/Table/ColumnText.vue +10 -10
- package/dist/runtime/components/Table/Pagination.vue +71 -77
- package/dist/runtime/components/Table/Simple.vue +19 -19
- package/dist/runtime/components/Table/index.vue +36 -42
- package/dist/runtime/composables/loaderList.js +1 -3
- package/dist/runtime/composables/loaderPage.js +156 -133
- package/dist/runtime/composables/useConfig.js +1 -1
- package/dist/runtime/composables/useDialog.js +1 -3
- package/dist/runtime/composables/useForm.d.ts +1 -1
- package/dist/runtime/composables/useForm.js +1 -3
- package/dist/runtime/composables/useTable.js +2 -14
- package/dist/runtime/helpers/apiBaseHelper.js +6 -24
- package/dist/runtime/helpers/apiListHelper.js +2 -5
- package/dist/runtime/helpers/apiObjectHelper.js +2 -5
- package/dist/runtime/helpers/apiPageHelper.js +19 -38
- package/dist/runtime/helpers/componentHelper.js +2 -6
- package/dist/runtime/helpers/uploadCore.js +1 -4
- package/dist/runtime/locale/index.js +1 -4
- package/dist/runtime/server/tsconfig.json +3 -3
- package/dist/runtime/styles/main.css +1 -1
- package/package.json +39 -26
|
@@ -1,79 +1,77 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div :class="theme.multipleFilesWrapper()">
|
|
3
|
-
<div
|
|
4
|
-
v-for="(item, index) in fileItems"
|
|
5
|
-
:key="index"
|
|
6
|
-
:class="theme.fileItemWrapper()"
|
|
7
|
-
>
|
|
8
|
-
<!-- Uploading State -->
|
|
9
|
-
<div
|
|
10
|
-
v-if="item.state === UploadState.UPLOADING"
|
|
11
|
-
:class="theme.uploadingItemWrapper()"
|
|
12
|
-
>
|
|
13
|
-
<div :class="theme.uploadingIconWrapper()">
|
|
14
|
-
<Icon
|
|
15
|
-
:name="icons.filePreviewIcon"
|
|
16
|
-
:class="theme.uploadingIconClass()"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
<div :class="theme.uploadingTextWrapper()">
|
|
20
|
-
<h1 class="truncate font-bold">
|
|
21
|
-
{{ item.file.name }}
|
|
22
|
-
</h1>
|
|
23
|
-
<div class="flex items-center gap-2">
|
|
24
|
-
<div :class="theme.progressBarWrapper()">
|
|
25
|
-
<div
|
|
26
|
-
:class="theme.progressBarFill()"
|
|
27
|
-
:style="{ width: `${item.progress}%` }"
|
|
28
|
-
/>
|
|
29
|
-
</div>
|
|
30
|
-
<p class="text-sm text-gray-400">
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
:class="theme.
|
|
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
|
-
</div>
|
|
76
|
-
</div>
|
|
2
|
+
<div :class="theme.multipleFilesWrapper()">
|
|
3
|
+
<div
|
|
4
|
+
v-for="(item, index) in fileItems"
|
|
5
|
+
:key="index"
|
|
6
|
+
:class="theme.fileItemWrapper()"
|
|
7
|
+
>
|
|
8
|
+
<!-- Uploading State -->
|
|
9
|
+
<div
|
|
10
|
+
v-if="item.state === UploadState.UPLOADING"
|
|
11
|
+
:class="theme.uploadingItemWrapper()"
|
|
12
|
+
>
|
|
13
|
+
<div :class="theme.uploadingIconWrapper()">
|
|
14
|
+
<Icon
|
|
15
|
+
:name="icons.filePreviewIcon"
|
|
16
|
+
:class="theme.uploadingIconClass()"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<div :class="theme.uploadingTextWrapper()">
|
|
20
|
+
<h1 class="truncate font-bold">
|
|
21
|
+
{{ item.file.name }}
|
|
22
|
+
</h1>
|
|
23
|
+
<div class="flex items-center gap-2">
|
|
24
|
+
<div :class="theme.progressBarWrapper()">
|
|
25
|
+
<div
|
|
26
|
+
:class="theme.progressBarFill()"
|
|
27
|
+
:style="{ width: `${item.progress}%` }"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
<p class="text-sm text-gray-400">{{ item.progress }}%</p>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<!-- Error State -->
|
|
36
|
+
<div
|
|
37
|
+
v-else-if="item.state === UploadState.ERROR"
|
|
38
|
+
:class="theme.errorItemWrapper()"
|
|
39
|
+
>
|
|
40
|
+
<div :class="theme.errorIconWrapper()">
|
|
41
|
+
<Icon
|
|
42
|
+
:name="icons.errorIcon"
|
|
43
|
+
:class="theme.errorIconClass()"
|
|
44
|
+
/>
|
|
45
|
+
</div>
|
|
46
|
+
<div :class="theme.errorTextWrapper()">
|
|
47
|
+
<h1 class="truncate font-bold">
|
|
48
|
+
{{ item.file.name }}
|
|
49
|
+
</h1>
|
|
50
|
+
<p class="text-sm text-error-500">
|
|
51
|
+
{{ item.error || uploadFailedLabel }}
|
|
52
|
+
</p>
|
|
53
|
+
</div>
|
|
54
|
+
<div :class="theme.errorActionWrapper()">
|
|
55
|
+
<Button
|
|
56
|
+
variant="link"
|
|
57
|
+
:icon="icons.actionRetryIcon"
|
|
58
|
+
:class="theme.actionRetryBtnClass()"
|
|
59
|
+
color="primary"
|
|
60
|
+
@click="$emit('retry', index)"
|
|
61
|
+
>
|
|
62
|
+
{{ retryLabel }}
|
|
63
|
+
</Button>
|
|
64
|
+
<Icon
|
|
65
|
+
v-if="!disabled && !readonly"
|
|
66
|
+
:name="icons.actionDeleteIcon"
|
|
67
|
+
:class="theme.actionIconClass()"
|
|
68
|
+
:title="messages.upload.remove"
|
|
69
|
+
@click="$emit('delete', index)"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
77
75
|
</template>
|
|
78
76
|
|
|
79
77
|
<script setup>
|
|
@@ -90,7 +88,5 @@ defineProps({
|
|
|
90
88
|
retryLabel: { type: String, required: false }
|
|
91
89
|
});
|
|
92
90
|
const icons = useUiIconConfig("uploadFileDropzone");
|
|
93
|
-
const {
|
|
94
|
-
messages
|
|
95
|
-
} = useCoreMessages();
|
|
91
|
+
const { messages } = useCoreMessages();
|
|
96
92
|
</script>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Modal
|
|
3
|
-
:close="{ onClick: () => emits('close', false) }"
|
|
4
|
-
:dismissible="false"
|
|
5
|
-
:title="value?.name"
|
|
2
|
+
<Modal
|
|
3
|
+
:close="{ onClick: () => emits('close', false) }"
|
|
4
|
+
:dismissible="false"
|
|
5
|
+
:title="value?.name"
|
|
6
6
|
:ui="{
|
|
7
7
|
content: 'max-w-3xl'
|
|
8
|
-
}"
|
|
9
|
-
>
|
|
10
|
-
<template #body>
|
|
11
|
-
<div class="flex justify-center">
|
|
12
|
-
<img
|
|
13
|
-
v-if="value && isImageFromPath(value.path)"
|
|
14
|
-
:src="value.url"
|
|
15
|
-
alt="img-preview"
|
|
16
|
-
class="max-h-96 max-w-full rounded-lg"
|
|
17
|
-
/>
|
|
18
|
-
<video
|
|
19
|
-
v-else-if="value && isVideoFromPath(value.path)"
|
|
20
|
-
:src="value.url"
|
|
21
|
-
controls
|
|
22
|
-
class="max-h-96 max-w-full"
|
|
23
|
-
/>
|
|
24
|
-
</div>
|
|
25
|
-
</template>
|
|
26
|
-
</Modal>
|
|
8
|
+
}"
|
|
9
|
+
>
|
|
10
|
+
<template #body>
|
|
11
|
+
<div class="flex justify-center">
|
|
12
|
+
<img
|
|
13
|
+
v-if="value && isImageFromPath(value.path)"
|
|
14
|
+
:src="value.url"
|
|
15
|
+
alt="img-preview"
|
|
16
|
+
class="max-h-96 max-w-full rounded-lg"
|
|
17
|
+
/>
|
|
18
|
+
<video
|
|
19
|
+
v-else-if="value && isVideoFromPath(value.path)"
|
|
20
|
+
:src="value.url"
|
|
21
|
+
controls
|
|
22
|
+
class="max-h-96 max-w-full"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
26
|
+
</Modal>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<script setup>
|
|
@@ -4,9 +4,7 @@
|
|
|
4
4
|
v-if="isImageFromPath(value.path)"
|
|
5
5
|
:class="theme.onPreviewImgWrapper()"
|
|
6
6
|
>
|
|
7
|
-
<div
|
|
8
|
-
class="size-full overflow-hidden"
|
|
9
|
-
>
|
|
7
|
+
<div class="size-full overflow-hidden">
|
|
10
8
|
<img
|
|
11
9
|
:src="value.url"
|
|
12
10
|
:class="theme.onPreviewImgClass()"
|
|
@@ -74,12 +72,7 @@
|
|
|
74
72
|
|
|
75
73
|
<script setup>
|
|
76
74
|
import { useCoreMessages } from "#core/composables/useMessages";
|
|
77
|
-
import {
|
|
78
|
-
isImageFromPath,
|
|
79
|
-
isPDFFromPath,
|
|
80
|
-
isVideoFromPath,
|
|
81
|
-
useFileSize
|
|
82
|
-
} from "#core/helpers/componentHelper";
|
|
75
|
+
import { isImageFromPath, isPDFFromPath, isVideoFromPath, useFileSize } from "#core/helpers/componentHelper";
|
|
83
76
|
import { useUiIconConfig } from "#core/composables/useConfig";
|
|
84
77
|
defineEmits(["preview", "download", "delete"]);
|
|
85
78
|
defineProps({
|
|
@@ -93,7 +86,5 @@ const getFileSizeFromValue = (fileValue) => {
|
|
|
93
86
|
const allocate = useFileSize(fileValue.size || 0);
|
|
94
87
|
return allocate.isSelectedFileUseMb.value ? `${allocate.selectedFileSizeMb.value} MB` : `${allocate.selectedFileSizeKb.value} KB`;
|
|
95
88
|
};
|
|
96
|
-
const {
|
|
97
|
-
messages
|
|
98
|
-
} = useCoreMessages();
|
|
89
|
+
const { messages } = useCoreMessages();
|
|
99
90
|
</script>
|
|
@@ -4,16 +4,8 @@ import { useCoreMessages } from "#core/composables/useMessages";
|
|
|
4
4
|
import { computed, onScopeDispose, ref } from "#imports";
|
|
5
5
|
export { UploadState };
|
|
6
6
|
export const useFileState = (context) => {
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
emits,
|
|
10
|
-
onChange,
|
|
11
|
-
setErrors,
|
|
12
|
-
value
|
|
13
|
-
} = context;
|
|
14
|
-
const {
|
|
15
|
-
messages
|
|
16
|
-
} = useCoreMessages();
|
|
7
|
+
const { props, emits, onChange, setErrors, value } = context;
|
|
8
|
+
const { messages } = useCoreMessages();
|
|
17
9
|
const selectedFile = ref();
|
|
18
10
|
const currentObjectUrl = ref("");
|
|
19
11
|
const currentState = computed(() => value.value ? UploadState.SUCCESS : UploadState.EMPTY);
|
|
@@ -19,9 +19,7 @@ const readImageSize = (file) => new Promise((resolve) => {
|
|
|
19
19
|
image.src = url;
|
|
20
20
|
});
|
|
21
21
|
export const useUploadImageState = (context) => {
|
|
22
|
-
const {
|
|
23
|
-
messages
|
|
24
|
-
} = useCoreMessages();
|
|
22
|
+
const { messages } = useCoreMessages();
|
|
25
23
|
return useUploadState(context, {
|
|
26
24
|
defaultAccept: "image/*",
|
|
27
25
|
validateExtra: async (file) => {
|
|
@@ -8,23 +8,10 @@ import { StringHelper } from "#core/utils/StringHelper";
|
|
|
8
8
|
import { computed, ref } from "#imports";
|
|
9
9
|
export { UploadState };
|
|
10
10
|
export const useUploadState = (context, options = {}) => {
|
|
11
|
-
const {
|
|
12
|
-
|
|
13
|
-
emits,
|
|
14
|
-
onChange,
|
|
15
|
-
setErrors,
|
|
16
|
-
value
|
|
17
|
-
} = context;
|
|
18
|
-
const {
|
|
19
|
-
messages,
|
|
20
|
-
format
|
|
21
|
-
} = useCoreMessages();
|
|
11
|
+
const { props, emits, onChange, setErrors, value } = context;
|
|
12
|
+
const { messages, format } = useCoreMessages();
|
|
22
13
|
const selectedFile = ref();
|
|
23
|
-
const {
|
|
24
|
-
percent,
|
|
25
|
-
onDownloadProgress,
|
|
26
|
-
onUploadProgress
|
|
27
|
-
} = useFileProgress();
|
|
14
|
+
const { percent, onDownloadProgress, onUploadProgress } = useFileProgress();
|
|
28
15
|
const upload = useUploadLoader({
|
|
29
16
|
requestOptions: {
|
|
30
17
|
...props.requestOptions,
|
|
@@ -86,9 +73,11 @@ export const useUploadState = (context, options = {}) => {
|
|
|
86
73
|
useWatchTrue(
|
|
87
74
|
() => upload.status.value.isError,
|
|
88
75
|
() => {
|
|
89
|
-
setErrors(
|
|
90
|
-
|
|
91
|
-
|
|
76
|
+
setErrors(
|
|
77
|
+
format(messages.value.upload.error, {
|
|
78
|
+
message: StringHelper.getError(upload.status.value.errorData, messages.value.common.somethingWentWrong)
|
|
79
|
+
})
|
|
80
|
+
);
|
|
92
81
|
}
|
|
93
82
|
);
|
|
94
83
|
return {
|
|
@@ -7,40 +7,31 @@ import { StringHelper } from "#core/utils/StringHelper";
|
|
|
7
7
|
import { ArrayHelper, computed, ref, watch } from "#imports";
|
|
8
8
|
export { UploadState };
|
|
9
9
|
export const useUploadStateMultiple = (context) => {
|
|
10
|
-
const {
|
|
11
|
-
|
|
12
|
-
emits,
|
|
13
|
-
onChange,
|
|
14
|
-
setErrors,
|
|
15
|
-
value
|
|
16
|
-
} = context;
|
|
17
|
-
const {
|
|
18
|
-
messages,
|
|
19
|
-
format
|
|
20
|
-
} = useCoreMessages();
|
|
10
|
+
const { props, emits, onChange, setErrors, value } = context;
|
|
11
|
+
const { messages, format } = useCoreMessages();
|
|
21
12
|
const fileItems = ref([]);
|
|
22
13
|
let nextId = 0;
|
|
23
14
|
const updateFileItem = (id, updates) => {
|
|
24
|
-
fileItems.value = fileItems.value.map(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
fileItems.value = fileItems.value.map(
|
|
16
|
+
(item) => item.id === id ? {
|
|
17
|
+
...item,
|
|
18
|
+
...updates
|
|
19
|
+
} : item
|
|
20
|
+
);
|
|
28
21
|
};
|
|
29
22
|
const removeFileItem = (id) => {
|
|
30
23
|
fileItems.value = fileItems.value.filter((item) => item.id !== id);
|
|
31
24
|
};
|
|
32
25
|
const isFull = () => !!props.maxFiles && fileItems.value.length >= props.maxFiles;
|
|
33
26
|
const setMaxFilesError = () => {
|
|
34
|
-
setErrors(
|
|
35
|
-
|
|
36
|
-
|
|
27
|
+
setErrors(
|
|
28
|
+
format(messages.value.upload.maxFiles, {
|
|
29
|
+
max: props.maxFiles
|
|
30
|
+
})
|
|
31
|
+
);
|
|
37
32
|
};
|
|
38
33
|
const uploadFile = async (id, file) => {
|
|
39
|
-
const {
|
|
40
|
-
percent,
|
|
41
|
-
onDownloadProgress,
|
|
42
|
-
onUploadProgress
|
|
43
|
-
} = useFileProgress();
|
|
34
|
+
const { percent, onDownloadProgress, onUploadProgress } = useFileProgress();
|
|
44
35
|
const uploadLoader = useUploadLoader({
|
|
45
36
|
requestOptions: {
|
|
46
37
|
...props.requestOptions,
|
|
@@ -49,9 +40,12 @@ export const useUploadStateMultiple = (context) => {
|
|
|
49
40
|
},
|
|
50
41
|
pathURL: props.uploadPathURL
|
|
51
42
|
});
|
|
52
|
-
const stopProgressWatch = watch(
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
const stopProgressWatch = watch(
|
|
44
|
+
percent,
|
|
45
|
+
(progress) => updateFileItem(id, {
|
|
46
|
+
progress
|
|
47
|
+
})
|
|
48
|
+
);
|
|
55
49
|
try {
|
|
56
50
|
await uploadLoader.run({
|
|
57
51
|
data: toUploadFormData(props.bodyKey, file)
|
|
@@ -95,7 +89,10 @@ export const useUploadStateMultiple = (context) => {
|
|
|
95
89
|
}
|
|
96
90
|
];
|
|
97
91
|
await uploadFile(id, file);
|
|
98
|
-
emits(
|
|
92
|
+
emits(
|
|
93
|
+
"change",
|
|
94
|
+
fileItems.value.map((item) => item.file)
|
|
95
|
+
);
|
|
99
96
|
};
|
|
100
97
|
const picker = useFilePicker(context, {
|
|
101
98
|
multiple: true,
|
|
@@ -106,9 +103,7 @@ export const useUploadStateMultiple = (context) => {
|
|
|
106
103
|
}
|
|
107
104
|
});
|
|
108
105
|
const isEmpty = computed(() => fileItems.value.length === 0);
|
|
109
|
-
const hasUploading = computed(
|
|
110
|
-
() => fileItems.value.some((item) => item.state === UploadState.UPLOADING)
|
|
111
|
-
);
|
|
106
|
+
const hasUploading = computed(() => fileItems.value.some((item) => item.state === UploadState.UPLOADING));
|
|
112
107
|
const allSuccess = computed(
|
|
113
108
|
() => fileItems.value.length > 0 && fileItems.value.every((item) => item.state === UploadState.SUCCESS)
|
|
114
109
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form class="form">
|
|
3
|
-
<slot />
|
|
4
|
-
</form>
|
|
5
|
-
</template>
|
|
1
|
+
<template>
|
|
2
|
+
<form class="form">
|
|
3
|
+
<slot />
|
|
4
|
+
</form>
|
|
5
|
+
</template>
|
|
@@ -1,32 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<UseImage v-bind="$props">
|
|
3
|
-
<template #loading>
|
|
4
|
-
<slot name="loading">
|
|
5
|
-
<div
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
/>
|
|
25
|
-
</p>
|
|
26
|
-
</div>
|
|
27
|
-
</slot>
|
|
28
|
-
</template>
|
|
29
|
-
</UseImage>
|
|
2
|
+
<UseImage v-bind="$props">
|
|
3
|
+
<template #loading>
|
|
4
|
+
<slot name="loading">
|
|
5
|
+
<div class="flex h-full w-full items-center justify-center">
|
|
6
|
+
<Loader :loading="true" />
|
|
7
|
+
</div>
|
|
8
|
+
</slot>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<template #error>
|
|
12
|
+
<slot name="error">
|
|
13
|
+
<div class="flex h-full w-full items-center justify-center">
|
|
14
|
+
<p class="text-error-400">
|
|
15
|
+
<Icon
|
|
16
|
+
name="i-heroicons:exclamation-circle-solid"
|
|
17
|
+
class="size-8 text-error-400"
|
|
18
|
+
/>
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
</slot>
|
|
22
|
+
</template>
|
|
23
|
+
</UseImage>
|
|
30
24
|
</template>
|
|
31
25
|
|
|
32
26
|
<script setup>
|
|
@@ -4,16 +4,19 @@
|
|
|
4
4
|
name="loading"
|
|
5
5
|
>
|
|
6
6
|
<div
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})
|
|
7
|
+
:class="
|
|
8
|
+
theme.base({
|
|
9
|
+
class: [ui?.base, props.class]
|
|
10
|
+
})
|
|
11
|
+
"
|
|
11
12
|
>
|
|
12
13
|
<Icon
|
|
13
14
|
:name="icon"
|
|
14
|
-
:class="[
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
:class="[
|
|
16
|
+
theme.icon({
|
|
17
|
+
class: [ui?.icon]
|
|
18
|
+
})
|
|
19
|
+
]"
|
|
17
20
|
/>
|
|
18
21
|
</div>
|
|
19
22
|
</slot>
|