@finema/core 1.4.74 → 1.4.76
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 +63 -63
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Alert.vue +48 -48
- package/dist/runtime/components/Avatar.vue +27 -27
- package/dist/runtime/components/Badge.vue +53 -53
- package/dist/runtime/components/Breadcrumb.vue +44 -44
- package/dist/runtime/components/Button/Group.vue +37 -37
- package/dist/runtime/components/Button/index.vue +76 -76
- package/dist/runtime/components/Card.vue +38 -38
- package/dist/runtime/components/Core.vue +13 -13
- package/dist/runtime/components/Dialog/index.vue +108 -108
- package/dist/runtime/components/Dropdown/index.vue +70 -70
- package/dist/runtime/components/Form/FieldWrapper.vue +23 -23
- package/dist/runtime/components/Form/Fields.vue +153 -153
- package/dist/runtime/components/Form/InputCheckbox/index.vue +21 -21
- package/dist/runtime/components/Form/InputDateTime/index.vue +60 -60
- package/dist/runtime/components/Form/InputRadio/index.vue +27 -27
- package/dist/runtime/components/Form/InputSelect/index.vue +36 -36
- package/dist/runtime/components/Form/InputStatic/index.vue +16 -16
- package/dist/runtime/components/Form/InputText/index.vue +54 -54
- package/dist/runtime/components/Form/InputTextarea/index.vue +25 -25
- package/dist/runtime/components/Form/InputToggle/index.vue +14 -14
- package/dist/runtime/components/Form/InputUploadDropzone/index.vue +158 -158
- package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +242 -242
- package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +101 -102
- package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +165 -166
- package/dist/runtime/components/Form/index.vue +6 -6
- package/dist/runtime/components/Icon.vue +23 -23
- package/dist/runtime/components/Image.vue +36 -36
- package/dist/runtime/components/Loader.vue +14 -14
- package/dist/runtime/components/Modal/index.vue +146 -146
- package/dist/runtime/components/SimplePagination.vue +96 -96
- package/dist/runtime/components/Slideover/index.vue +110 -110
- package/dist/runtime/components/Table/Base.vue +139 -139
- package/dist/runtime/components/Table/ColumnDate.vue +16 -16
- package/dist/runtime/components/Table/ColumnDateTime.vue +18 -18
- package/dist/runtime/components/Table/ColumnImage.vue +15 -15
- package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
- package/dist/runtime/components/Table/ColumnText.vue +25 -25
- package/dist/runtime/components/Table/Simple.vue +64 -64
- package/dist/runtime/components/Table/index.vue +60 -60
- package/dist/runtime/components/Tabs/index.vue +64 -64
- package/dist/runtime/helpers/apiPageHelper.mjs +2 -2
- package/dist/runtime/ui.css +32 -32
- package/package.json +88 -88
|
@@ -1,102 +1,101 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<div :class="[ui.base]">
|
|
4
|
-
<input
|
|
5
|
-
ref="fileInput"
|
|
6
|
-
type="file"
|
|
7
|
-
class="hidden"
|
|
8
|
-
:name="name"
|
|
9
|
-
:accept="acceptFile"
|
|
10
|
-
:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
uploadFileInputClassicAuto
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<div :class="[ui.base]">
|
|
4
|
+
<input
|
|
5
|
+
ref="fileInput"
|
|
6
|
+
type="file"
|
|
7
|
+
class="hidden"
|
|
8
|
+
:name="name"
|
|
9
|
+
:accept="acceptFile"
|
|
10
|
+
:disabled="isDisabled"
|
|
11
|
+
@change="handleChange"
|
|
12
|
+
/>
|
|
13
|
+
<div :class="[ui.wrapper]">
|
|
14
|
+
<div :class="[ui.selectFileBox]">
|
|
15
|
+
<Button size="2xs" @click="handleOpenFile">{{ selectFileLabel || 'Choose File' }}</Button>
|
|
16
|
+
<p :class="ui.placeholder">
|
|
17
|
+
{{ value?.name ?? placeholder ?? 'No file chosen' }}
|
|
18
|
+
</p>
|
|
19
|
+
<Badge v-if="value" size="xs" variant="outline">
|
|
20
|
+
{{ isSelectedFileUseMb ? `${selectedFileSizeMb} MB` : `${selectedFileSizeKb} KB` }}
|
|
21
|
+
</Badge>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</FieldWrapper>
|
|
26
|
+
</template>
|
|
27
|
+
<script lang="ts" setup>
|
|
28
|
+
import { useFieldHOC } from '#core/composables/useForm'
|
|
29
|
+
import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
|
|
30
|
+
import { type IUploadFileClassicFieldProps } from '#core/components/Form/InputUploadFileClassic/types'
|
|
31
|
+
import { useUiConfig } from '#core/composables/useConfig'
|
|
32
|
+
import { uploadFileInputClassicAuto } from '#core/ui.config'
|
|
33
|
+
import { computed, ref, toRef, useUI } from '#imports'
|
|
34
|
+
import i18next from 'i18next'
|
|
35
|
+
|
|
36
|
+
const config = useUiConfig<typeof uploadFileInputClassicAuto>(
|
|
37
|
+
uploadFileInputClassicAuto,
|
|
38
|
+
'uploadFileInputClassicAuto'
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
const emits = defineEmits(['change'])
|
|
42
|
+
const props = withDefaults(defineProps<IUploadFileClassicFieldProps>(), {})
|
|
43
|
+
|
|
44
|
+
const { value, wrapperProps, setErrors } = useFieldHOC<File | undefined>(props)
|
|
45
|
+
const selectedFileSizeKb = computed(() => ((value.value?.size || 0) / 1000).toFixed(2))
|
|
46
|
+
const selectedFileSizeMb = computed(() => ((value.value?.size || 0) / 1000 / 1000).toFixed(2))
|
|
47
|
+
|
|
48
|
+
const isSelectedFileUseMb = computed(() => (value.value?.size || 0) / 1000 > 1024)
|
|
49
|
+
const isAcceptFileUseMb = computed(() => acceptFileSizeKb.value && acceptFileSizeKb.value > 1024)
|
|
50
|
+
const acceptFileSizeMb = computed(() => ((acceptFileSizeKb.value || 0) / 1024).toFixed(2))
|
|
51
|
+
const acceptFileSizeKb = computed(() => props.maxSize)
|
|
52
|
+
const acceptFile = computed(() =>
|
|
53
|
+
typeof props.accept === 'string' ? props.accept : props.accept?.join(',')
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
const fileInput = ref<HTMLInputElement>()
|
|
57
|
+
|
|
58
|
+
const handleOpenFile = () => {
|
|
59
|
+
fileInput.value?.click()
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const { ui } = useUI('uploadFileInputClassicAuto', toRef(props, 'ui'), config)
|
|
63
|
+
|
|
64
|
+
const checkMaxSize = (file: File): boolean => {
|
|
65
|
+
if (acceptFileSizeKb.value) {
|
|
66
|
+
return file.size / 1000 <= acceptFileSizeKb.value
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return true
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const handleCheckFileCondition = (file: File | undefined): boolean => {
|
|
73
|
+
if (!file) return false
|
|
74
|
+
|
|
75
|
+
const maxSize = checkMaxSize(file)
|
|
76
|
+
|
|
77
|
+
if (!maxSize) {
|
|
78
|
+
if (isAcceptFileUseMb.value) {
|
|
79
|
+
setErrors(i18next.t('custom:invalid_file_size_mb', { size: acceptFileSizeMb.value }))
|
|
80
|
+
} else {
|
|
81
|
+
setErrors(i18next.t('custom:invalid_file_size_kb', { size: acceptFileSizeKb.value }))
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return false
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
setErrors('')
|
|
88
|
+
|
|
89
|
+
return true
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const handleChange = (e: Event) => {
|
|
93
|
+
const file = (e.target as HTMLInputElement).files?.[0]
|
|
94
|
+
const result = handleCheckFileCondition(file)
|
|
95
|
+
|
|
96
|
+
if (result && file) {
|
|
97
|
+
value.value = file
|
|
98
|
+
emits('change', file)
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
</script>
|
|
@@ -1,166 +1,165 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
-
<div :class="[ui.base]">
|
|
4
|
-
<input
|
|
5
|
-
ref="fileInput"
|
|
6
|
-
type="file"
|
|
7
|
-
class="hidden"
|
|
8
|
-
:name="name"
|
|
9
|
-
:accept="acceptFile"
|
|
10
|
-
:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
import {
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
uploadFileInputClassicAuto
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
() =>
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
() =>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<FieldWrapper v-bind="wrapperProps">
|
|
3
|
+
<div :class="[ui.base]">
|
|
4
|
+
<input
|
|
5
|
+
ref="fileInput"
|
|
6
|
+
type="file"
|
|
7
|
+
class="hidden"
|
|
8
|
+
:name="name"
|
|
9
|
+
:accept="acceptFile"
|
|
10
|
+
:disabled="isDisabled"
|
|
11
|
+
@change="handleChange"
|
|
12
|
+
/>
|
|
13
|
+
<div :class="[ui.wrapper]">
|
|
14
|
+
<div :class="[ui.selectFileBox]">
|
|
15
|
+
<Button size="2xs" @click="handleOpenFile">{{ selectFileLabel || 'Choose File' }}</Button>
|
|
16
|
+
<p :class="ui.placeholder">
|
|
17
|
+
{{ selectedFile?.name ?? placeholder ?? 'No file chosen' }}
|
|
18
|
+
</p>
|
|
19
|
+
<Badge v-if="selectedFile" size="xs" variant="outline">
|
|
20
|
+
{{ isSelectedFileUseMb ? `${selectedFileSizeMb} MB` : `${selectedFileSizeKb} KB` }}
|
|
21
|
+
</Badge>
|
|
22
|
+
</div>
|
|
23
|
+
<div v-if="selectedFile">
|
|
24
|
+
<Icon
|
|
25
|
+
v-if="upload.status.value.isSuccess"
|
|
26
|
+
name="heroicons:check-circle-20-solid"
|
|
27
|
+
class="text-success"
|
|
28
|
+
/>
|
|
29
|
+
<Icon
|
|
30
|
+
v-if="upload.status.value.isError"
|
|
31
|
+
name="heroicons:x-circle-20-solid"
|
|
32
|
+
class="text-danger"
|
|
33
|
+
/>
|
|
34
|
+
<Icon
|
|
35
|
+
v-if="upload.status.value.isLoading"
|
|
36
|
+
name="i-svg-spinners:180-ring-with-bg"
|
|
37
|
+
class="text-primary"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
<img v-if="imagePreviewURL && value" :src="imagePreviewURL" alt="" :class="ui.previewURL" />
|
|
43
|
+
</FieldWrapper>
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script lang="tsx" setup>
|
|
47
|
+
import { computed, ref, StringHelper, toRef, useUI, useUiConfig, useWatchTrue } from '#imports'
|
|
48
|
+
import { type IUploadFileProps } from './types'
|
|
49
|
+
import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
|
|
50
|
+
import { useFieldHOC } from '#core/composables/useForm'
|
|
51
|
+
import { type IUploadRequest, useUploadLoader } from '#core/composables/useUpload'
|
|
52
|
+
import { uploadFileInputClassicAuto } from '#core/ui.config'
|
|
53
|
+
import i18next from 'i18next'
|
|
54
|
+
|
|
55
|
+
const config = useUiConfig<typeof uploadFileInputClassicAuto>(
|
|
56
|
+
uploadFileInputClassicAuto,
|
|
57
|
+
'uploadFileInputClassicAuto'
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
const emits = defineEmits(['success'])
|
|
61
|
+
const props = withDefaults(defineProps<IUploadFileProps>(), {})
|
|
62
|
+
|
|
63
|
+
const { wrapperProps, setErrors, value } = useFieldHOC<string>(props)
|
|
64
|
+
|
|
65
|
+
const request: IUploadRequest = {
|
|
66
|
+
pathURL: props.uploadPathURL,
|
|
67
|
+
requestOptions: props.requestOptions,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const upload = useUploadLoader(request)
|
|
71
|
+
|
|
72
|
+
const fileInput = ref<HTMLInputElement>()
|
|
73
|
+
const selectedFile = ref<File | undefined>()
|
|
74
|
+
const percent = ref<number>(0)
|
|
75
|
+
|
|
76
|
+
const selectedFileSizeKb = computed(() => ((selectedFile.value?.size || 0) / 1000).toFixed(2))
|
|
77
|
+
const selectedFileSizeMb = computed(() =>
|
|
78
|
+
((selectedFile.value?.size || 0) / 1000 / 1000).toFixed(2)
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
const isSelectedFileUseMb = computed(() => (selectedFile.value?.size || 0) / 1000 > 1024)
|
|
82
|
+
|
|
83
|
+
const acceptFileSizeKb = computed(() => props.maxSize)
|
|
84
|
+
const acceptFileSizeMb = computed(() => ((acceptFileSizeKb.value || 0) / 1024).toFixed(2))
|
|
85
|
+
const isAcceptFileUseMb = computed(() => acceptFileSizeKb.value && acceptFileSizeKb.value > 1024)
|
|
86
|
+
const acceptFile = computed(() =>
|
|
87
|
+
typeof props.accept === 'string' ? props.accept : props.accept?.join(',')
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
const { ui } = useUI('uploadFileInputClassicAuto', toRef(props, 'ui'), config)
|
|
91
|
+
|
|
92
|
+
const handleOpenFile = () => {
|
|
93
|
+
fileInput.value?.click()
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const handleChange = (e: Event) => {
|
|
97
|
+
const file = (e.target as HTMLInputElement).files?.[0]
|
|
98
|
+
const result = handleCheckFileCondition(file)
|
|
99
|
+
|
|
100
|
+
if (result && file) {
|
|
101
|
+
selectedFile.value = file
|
|
102
|
+
const formData = new FormData()
|
|
103
|
+
|
|
104
|
+
formData.append(props.bodyKey || 'file', file)
|
|
105
|
+
upload.run(formData, { data: { onUploadProgress, onDownloadProgress } })
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const handleCheckFileCondition = (file: File | undefined): boolean => {
|
|
110
|
+
if (!file) return false
|
|
111
|
+
|
|
112
|
+
const maxSize = checkMaxSize(file)
|
|
113
|
+
|
|
114
|
+
if (!maxSize) {
|
|
115
|
+
if (isAcceptFileUseMb.value) {
|
|
116
|
+
setErrors(i18next.t('custom:invalid_file_size_mb', { size: acceptFileSizeMb.value }))
|
|
117
|
+
} else {
|
|
118
|
+
setErrors(i18next.t('custom:invalid_file_size_kb', { size: acceptFileSizeKb.value }))
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return false
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
setErrors('')
|
|
125
|
+
|
|
126
|
+
return true
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const checkMaxSize = (file: File): boolean => {
|
|
130
|
+
if (acceptFileSizeKb.value) {
|
|
131
|
+
return file.size / 1000 <= acceptFileSizeKb.value
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return true
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const onUploadProgress = (progressEvent: ProgressEvent) => {
|
|
138
|
+
percent.value = (Math.floor((progressEvent.loaded * 100) / progressEvent.total) || 0) * 0.8
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const onDownloadProgress = (progressEvent: ProgressEvent) => {
|
|
142
|
+
if (progressEvent.total === 0) {
|
|
143
|
+
percent.value = 100
|
|
144
|
+
|
|
145
|
+
return
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
percent.value = (Math.floor((progressEvent.loaded * 100) / progressEvent.total) || 0) * 0.2 + 80
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
useWatchTrue(
|
|
152
|
+
() => upload.status.value.isSuccess,
|
|
153
|
+
() => {
|
|
154
|
+
value.value = upload.data.value[props.responseKey || 'url']
|
|
155
|
+
emits('success', upload.data.value)
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
useWatchTrue(
|
|
160
|
+
() => upload.status.value.isError,
|
|
161
|
+
() => {
|
|
162
|
+
setErrors(StringHelper.getError(upload.status.value.errorData))
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
</script>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form class="form">
|
|
3
|
-
<slot />
|
|
4
|
-
</form>
|
|
5
|
-
</template>
|
|
6
|
-
<script lang="ts" setup></script>
|
|
1
|
+
<template>
|
|
2
|
+
<form class="form">
|
|
3
|
+
<slot />
|
|
4
|
+
</form>
|
|
5
|
+
</template>
|
|
6
|
+
<script lang="ts" setup></script>
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<UIcon :name="name" :dynamic="dynamicValue" />
|
|
3
|
-
</template>
|
|
4
|
-
|
|
5
|
-
<script lang="ts" setup>
|
|
6
|
-
import { computed, useUiConfig } from '#imports'
|
|
7
|
-
import { icon } from '#core/ui.config'
|
|
8
|
-
|
|
9
|
-
const props = defineProps({
|
|
10
|
-
name: {
|
|
11
|
-
type: String,
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
dynamic: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: false,
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
const config = useUiConfig<typeof icon>(icon, 'icon')
|
|
21
|
-
|
|
22
|
-
const dynamicValue = computed(() => props.dynamic || config.dynamic)
|
|
23
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<UIcon :name="name" :dynamic="dynamicValue" />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts" setup>
|
|
6
|
+
import { computed, useUiConfig } from '#imports'
|
|
7
|
+
import { icon } from '#core/ui.config'
|
|
8
|
+
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
dynamic: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const config = useUiConfig<typeof icon>(icon, 'icon')
|
|
21
|
+
|
|
22
|
+
const dynamicValue = computed(() => props.dynamic || config.dynamic)
|
|
23
|
+
</script>
|