@finema/core 1.4.51 → 1.4.52

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 (50) hide show
  1. package/README.md +63 -63
  2. package/dist/module.d.mts +4 -4
  3. package/dist/module.d.ts +4 -4
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +1 -1
  6. package/dist/runtime/components/Alert.vue +49 -49
  7. package/dist/runtime/components/Avatar.vue +27 -27
  8. package/dist/runtime/components/Badge.vue +54 -54
  9. package/dist/runtime/components/Breadcrumb.vue +45 -45
  10. package/dist/runtime/components/Button/Group.vue +37 -37
  11. package/dist/runtime/components/Button/index.vue +77 -77
  12. package/dist/runtime/components/Card.vue +38 -38
  13. package/dist/runtime/components/Core.vue +13 -13
  14. package/dist/runtime/components/Dialog/index.vue +108 -108
  15. package/dist/runtime/components/Dropdown/index.vue +71 -71
  16. package/dist/runtime/components/Form/FieldWrapper.vue +23 -23
  17. package/dist/runtime/components/Form/Fields.vue +153 -153
  18. package/dist/runtime/components/Form/InputCheckbox/index.vue +21 -21
  19. package/dist/runtime/components/Form/InputDateTime/index.vue +51 -51
  20. package/dist/runtime/components/Form/InputRadio/index.vue +27 -27
  21. package/dist/runtime/components/Form/InputSelect/index.vue +36 -36
  22. package/dist/runtime/components/Form/InputStatic/index.vue +16 -16
  23. package/dist/runtime/components/Form/InputText/index.vue +54 -54
  24. package/dist/runtime/components/Form/InputTextarea/index.vue +25 -25
  25. package/dist/runtime/components/Form/InputToggle/index.vue +14 -14
  26. package/dist/runtime/components/Form/InputUploadDropzone/index.vue +157 -149
  27. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +241 -238
  28. package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +36 -36
  29. package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +165 -165
  30. package/dist/runtime/components/Form/index.vue +6 -6
  31. package/dist/runtime/components/Icon.vue +23 -23
  32. package/dist/runtime/components/Image.vue +36 -36
  33. package/dist/runtime/components/Loader.vue +14 -14
  34. package/dist/runtime/components/Modal/index.vue +146 -146
  35. package/dist/runtime/components/SimplePagination.vue +96 -96
  36. package/dist/runtime/components/Slideover/index.vue +110 -110
  37. package/dist/runtime/components/Table/Base.vue +133 -133
  38. package/dist/runtime/components/Table/ColumnDate.vue +16 -16
  39. package/dist/runtime/components/Table/ColumnDateTime.vue +18 -18
  40. package/dist/runtime/components/Table/ColumnImage.vue +13 -13
  41. package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
  42. package/dist/runtime/components/Table/Simple.vue +57 -57
  43. package/dist/runtime/components/Table/index.vue +59 -59
  44. package/dist/runtime/components/Tabs/index.vue +65 -65
  45. package/dist/runtime/helpers/componentHelper.d.ts +1 -0
  46. package/dist/runtime/helpers/componentHelper.mjs +23 -0
  47. package/dist/runtime/types/utils.d.ts +29 -29
  48. package/dist/runtime/ui.css +32 -32
  49. package/dist/runtime/utils/StringHelper.mjs +2 -2
  50. package/package.json +83 -86
@@ -1,238 +1,241 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <div
4
- ref="dropzoneRef"
5
- :class="[
6
- ui.base,
7
- {
8
- [ui.disabled]: isDisabled,
9
- [ui.background.default]: !isOverDropZone && !isDisabled,
10
- [ui.background.dragover]: isOverDropZone && !isDisabled,
11
- },
12
- ]"
13
- >
14
- <Icon
15
- v-if="selectedFile"
16
- :name="ui.default.closeIcon"
17
- :class="[ui.button.delete]"
18
- @click="handleDeleteFile"
19
- />
20
- <input
21
- ref="fileInputRef"
22
- type="file"
23
- class="hidden"
24
- :accept="acceptFile"
25
- :disabled="isDisabled"
26
- @change="handleChange"
27
- />
28
- <div :class="[ui.wrapper]">
29
- <div v-if="selectedFile" :class="[ui.preview.wrapper]">
30
- <div
31
- v-if="isImage(selectedFile) && upload.status.value.isSuccess"
32
- :class="[ui.preview.image.wrapper]"
33
- >
34
- <img
35
- :src="upload.data.value[props.responseKey || 'url']"
36
- :class="[ui.preview.image.img]"
37
- alt="file"
38
- />
39
- </div>
40
- <Icon
41
- v-else-if="!isImage(selectedFile) && upload.status.value.isSuccess"
42
- :name="ui.default.filePreviewIcon"
43
- :class="[ui.preview.icon]"
44
- />
45
- <div :class="[ui.preview.filename]">
46
- <p class="truncate">{{ selectedFile.name }}</p>
47
- </div>
48
- <div class="flex items-center space-x-1">
49
- <Badge size="xs" variant="outline" class="mt-1">
50
- {{ isSelectedFileUseMb ? `${selectedFileSizeMb} Mb` : `${selectedFileSizeKb} Kb` }}
51
- </Badge>
52
- <div>
53
- <Icon
54
- v-if="upload.status.value.isSuccess"
55
- name="heroicons:check-circle-20-solid"
56
- class="text-success"
57
- />
58
- <Icon
59
- v-if="upload.status.value.isError"
60
- name="heroicons:x-circle-20-solid"
61
- class="text-danger"
62
- />
63
- </div>
64
- </div>
65
- </div>
66
- <div v-if="selectedFile" :class="[ui.uploadStatus.wrapper]">
67
- <UProgress :class="[ui.uploadStatus.progressBar]" :value="100" />
68
- </div>
69
- <div v-if="!selectedFile" :class="[ui.placeholderWrapper]">
70
- <Icon :name="ui.default.uploadIcon" :class="[ui.labelIcon]" />
71
- <div :class="[ui.labelWrapper]">
72
- <p class="text-primary cursor-pointer" @click="handleOpenFile">
73
- {{ selectFileLabel ?? 'คลิกเพื่อเลือกไฟล์' }}
74
- </p>
75
- <p>{{ selectFileSubLabel ?? 'หรือ ลากและวางที่นี่' }}</p>
76
- </div>
77
- <p v-if="placeholder" :class="[ui.placeholder]">{{ placeholder }}</p>
78
- </div>
79
- </div>
80
- </div>
81
- </FieldWrapper>
82
- </template>
83
-
84
- <script lang="ts" setup>
85
- import { useDropZone } from '@vueuse/core'
86
- import { type IUploadDropzoneAutoProps } from './types'
87
- import { isImage, checkMaxSize } from '#core/helpers/componentHelper'
88
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
89
- import { useFieldHOC } from '#core/composables/useForm'
90
- import {
91
- type IUploadRequest,
92
- computed,
93
- ref,
94
- toRef,
95
- useUI,
96
- useUiConfig,
97
- useUploadLoader,
98
- useWatchTrue,
99
- StringHelper,
100
- } from '#imports'
101
- import { uploadFileDropzone } from '#core/ui.config'
102
- import i18next from 'i18next'
103
-
104
- const config = useUiConfig<typeof uploadFileDropzone>(uploadFileDropzone, 'uploadFileDropzone')
105
-
106
- const props = withDefaults(defineProps<IUploadDropzoneAutoProps>(), {})
107
- const emits = defineEmits(['change', 'success', 'delete'])
108
-
109
- const { wrapperProps, handleChange: onChange, setErrors, value } = useFieldHOC<File>(props)
110
-
111
- const request: IUploadRequest = {
112
- pathURL: props.uploadPathURL,
113
- requestOptions: props.requestOptions,
114
- }
115
-
116
- const upload = useUploadLoader(request)
117
-
118
- const { ui } = useUI('uploadFileDropzone', toRef(props, 'ui'), config)
119
-
120
- const fileInputRef = ref<HTMLInputElement>()
121
- const dropzoneRef = ref<HTMLDivElement>()
122
-
123
- const selectedFile = ref<File | undefined>()
124
- const percent = ref<number>(0)
125
-
126
- const acceptFile = computed(() =>
127
- typeof props.accept === 'string' ? props.accept : props.accept?.join(',')
128
- )
129
-
130
- const acceptFileSizeKb = computed(() => props.maxSize)
131
- const acceptFileSizeMb = computed(() => ((acceptFileSizeKb.value ?? 0) / 1024).toFixed(2))
132
- const isAcceptFileUseMb = computed(() => acceptFileSizeKb.value && acceptFileSizeKb.value > 1024)
133
-
134
- const selectedFileSizeKb = computed(() => ((selectedFile.value?.size || 0) / 1000).toFixed(2))
135
- const selectedFileSizeMb = computed(() =>
136
- ((selectedFile.value?.size || 0) / 1000 / 1000).toFixed(2)
137
- )
138
-
139
- const isSelectedFileUseMb = computed(() => (selectedFile.value?.size || 0) / 1000 > 1024)
140
-
141
- const onDrop = (files: File[] | null) => {
142
- if (props.isDisabled || files?.length === 0 || !files) return
143
-
144
- const file = files[0]
145
- const result = handleCheckFileCondition(file)
146
-
147
- if (result && file) {
148
- selectedFile.value = file
149
- const formData = new FormData()
150
-
151
- emits('change', file)
152
-
153
- formData.append(props.bodyKey || 'file', file)
154
- upload.run(formData, { data: { onUploadProgress, onDownloadProgress } })
155
- }
156
- }
157
-
158
- const { isOverDropZone } = useDropZone(dropzoneRef, {
159
- onDrop,
160
- })
161
-
162
- const handleChange = (e: Event) => {
163
- if (props.isDisabled) return
164
-
165
- const file = (e.target as HTMLInputElement).files?.[0]
166
- const result = handleCheckFileCondition(file)
167
-
168
- if (result && file) {
169
- selectedFile.value = file
170
- const formData = new FormData()
171
-
172
- emits('change', file)
173
-
174
- formData.append(props.bodyKey || 'file', file)
175
- upload.run(formData, { data: { onUploadProgress, onDownloadProgress } })
176
- }
177
- }
178
-
179
- const handleOpenFile = () => {
180
- fileInputRef.value?.click()
181
- }
182
-
183
- const handleDeleteFile = () => {
184
- fileInputRef.value?.value && (fileInputRef.value.value = '')
185
- selectedFile.value = undefined
186
- onChange(undefined)
187
- emits('delete')
188
- }
189
-
190
- const handleCheckFileCondition = (file: File | undefined): boolean => {
191
- if (!file) return false
192
-
193
- const maxSize = checkMaxSize(file, acceptFileSizeKb.value ?? 0)
194
-
195
- if (!maxSize) {
196
- if (isAcceptFileUseMb.value) {
197
- setErrors(i18next.t('custom:invalid_file_size_mb', { size: acceptFileSizeMb.value }))
198
- } else {
199
- setErrors(i18next.t('custom:invalid_file_size_kb', { size: acceptFileSizeKb.value }))
200
- }
201
-
202
- return false
203
- }
204
-
205
- setErrors('')
206
-
207
- return true
208
- }
209
-
210
- const onUploadProgress = (progressEvent: ProgressEvent) => {
211
- percent.value = (Math.floor((progressEvent.loaded * 100) / progressEvent.total) || 0) * 0.8
212
- }
213
-
214
- const onDownloadProgress = (progressEvent: ProgressEvent) => {
215
- if (progressEvent.total === 0) {
216
- percent.value = 100
217
-
218
- return
219
- }
220
-
221
- percent.value = (Math.floor((progressEvent.loaded * 100) / progressEvent.total) || 0) * 0.2 + 80
222
- }
223
-
224
- useWatchTrue(
225
- () => upload.status.value.isSuccess,
226
- () => {
227
- value.value = upload.data.value[props.responseKey || 'url']
228
- emits('success', upload.data.value)
229
- }
230
- )
231
-
232
- useWatchTrue(
233
- () => upload.status.value.isError,
234
- () => {
235
- setErrors(StringHelper.getError(upload.status.value.errorData))
236
- }
237
- )
238
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <div
4
+ ref="dropzoneRef"
5
+ :class="[
6
+ ui.base,
7
+ {
8
+ [ui.disabled]: isDisabled,
9
+ [ui.background.default]: !isOverDropZone && !isDisabled,
10
+ [ui.background.dragover]: isOverDropZone && !isDisabled,
11
+ },
12
+ ]"
13
+ >
14
+ <Icon
15
+ v-if="selectedFile"
16
+ :name="ui.default.closeIcon"
17
+ :class="[ui.button.delete]"
18
+ @click="handleDeleteFile"
19
+ />
20
+ <input
21
+ ref="fileInputRef"
22
+ type="file"
23
+ class="hidden"
24
+ :accept="acceptFile"
25
+ :disabled="isDisabled"
26
+ @change="handleChange"
27
+ />
28
+ <div :class="[ui.wrapper]">
29
+ <div v-if="selectedFile" :class="[ui.preview.wrapper]">
30
+ <div
31
+ v-if="isImage(selectedFile) && upload.status.value.isLoaded"
32
+ :class="[ui.preview.image.wrapper]"
33
+ >
34
+ <img
35
+ :src="upload.data.value[responseKey || 'url']"
36
+ :class="[ui.preview.image.img]"
37
+ alt="file"
38
+ />
39
+ </div>
40
+ <Icon v-else :name="ui.default.filePreviewIcon" :class="[ui.preview.icon]" />
41
+ <div :class="[ui.preview.filename]">
42
+ <p class="truncate">{{ selectedFile.name }}</p>
43
+ </div>
44
+ <div class="flex items-center space-x-1">
45
+ <Badge size="xs" variant="outline" class="mt-1">
46
+ {{ isSelectedFileUseMb ? `${selectedFileSizeMb} MB` : `${selectedFileSizeKb} KB` }}
47
+ </Badge>
48
+ <div>
49
+ <Icon
50
+ v-if="upload.status.value.isSuccess"
51
+ name="heroicons:check-circle-20-solid"
52
+ class="text-success"
53
+ />
54
+ <Icon
55
+ v-if="upload.status.value.isError"
56
+ name="heroicons:x-circle-20-solid"
57
+ class="text-danger"
58
+ />
59
+ </div>
60
+ </div>
61
+ </div>
62
+ <div v-if="upload.status.value.isLoading" :class="[ui.uploadStatus.wrapper]">
63
+ <UProgress :class="[ui.uploadStatus.progressBar]" :value="100" />
64
+ </div>
65
+ <div v-if="!selectedFile" :class="[ui.placeholderWrapper]">
66
+ <Icon :name="ui.default.uploadIcon" :class="[ui.labelIcon]" />
67
+ <div :class="[ui.labelWrapper]">
68
+ <p class="text-primary cursor-pointer" @click="handleOpenFile">
69
+ {{ selectFileLabel ?? 'คลิกเพื่อเลือกไฟล์' }}
70
+ </p>
71
+ <p>{{ selectFileSubLabel ?? 'หรือ ลากและวางที่นี่' }}</p>
72
+ </div>
73
+ <p v-if="placeholder" :class="[ui.placeholder]">{{ placeholder }}</p>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </FieldWrapper>
78
+ </template>
79
+
80
+ <script lang="ts" setup>
81
+ import { useDropZone } from '@vueuse/core'
82
+ import { type IUploadDropzoneAutoProps } from './types'
83
+ import { isImage, checkMaxSize, checkFileType } from '#core/helpers/componentHelper'
84
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
85
+ import { useFieldHOC } from '#core/composables/useForm'
86
+ import {
87
+ type IUploadRequest,
88
+ computed,
89
+ ref,
90
+ toRef,
91
+ useUI,
92
+ useUiConfig,
93
+ useUploadLoader,
94
+ useWatchTrue,
95
+ StringHelper,
96
+ } from '#imports'
97
+ import { uploadFileDropzone } from '#core/ui.config'
98
+ import i18next from 'i18next'
99
+
100
+ const config = useUiConfig<typeof uploadFileDropzone>(uploadFileDropzone, 'uploadFileDropzone')
101
+
102
+ const props = withDefaults(defineProps<IUploadDropzoneAutoProps>(), {})
103
+ const emits = defineEmits(['change', 'success', 'delete'])
104
+
105
+ const { wrapperProps, handleChange: onChange, setErrors, value } = useFieldHOC<File>(props)
106
+
107
+ const request: IUploadRequest = {
108
+ pathURL: props.uploadPathURL,
109
+ requestOptions: props.requestOptions,
110
+ }
111
+
112
+ const upload = useUploadLoader(request)
113
+
114
+ const { ui } = useUI('uploadFileDropzone', toRef(props, 'ui'), config)
115
+
116
+ const fileInputRef = ref<HTMLInputElement>()
117
+ const dropzoneRef = ref<HTMLDivElement>()
118
+ const selectedFile = ref<File | undefined>()
119
+ const percent = ref<number>(0)
120
+
121
+ const acceptFile = computed(() =>
122
+ typeof props.accept === 'string' ? props.accept : props.accept?.join(',')
123
+ )
124
+
125
+ const acceptFileSizeKb = computed(() => props.maxSize)
126
+ const acceptFileSizeMb = computed(() => ((acceptFileSizeKb.value ?? 0) / 1024).toFixed(2))
127
+ const isAcceptFileUseMb = computed(() => acceptFileSizeKb.value && acceptFileSizeKb.value > 1024)
128
+
129
+ const selectedFileSizeKb = computed(() => ((selectedFile.value?.size || 0) / 1000).toFixed(2))
130
+ const selectedFileSizeMb = computed(() =>
131
+ ((selectedFile.value?.size || 0) / 1000 / 1000).toFixed(2)
132
+ )
133
+
134
+ const isSelectedFileUseMb = computed(() => (selectedFile.value?.size || 0) / 1000 > 1024)
135
+
136
+ const onDrop = (files: File[] | null) => {
137
+ if (props.isDisabled || files?.length === 0 || !files) return
138
+
139
+ const file = files[0]
140
+ const result = handleCheckFileCondition(file)
141
+
142
+ if (result && file) {
143
+ selectedFile.value = file
144
+ const formData = new FormData()
145
+
146
+ emits('change', file)
147
+
148
+ formData.append(props.bodyKey || 'file', file)
149
+ upload.run(formData, { data: { onUploadProgress, onDownloadProgress } })
150
+ }
151
+ }
152
+
153
+ const { isOverDropZone } = useDropZone(dropzoneRef as unknown as HTMLElement, {
154
+ onDrop,
155
+ })
156
+
157
+ const handleChange = (e: Event) => {
158
+ if (props.isDisabled) return
159
+
160
+ const file = (e.target as HTMLInputElement).files?.[0]
161
+ const result = handleCheckFileCondition(file)
162
+
163
+ if (result && file) {
164
+ selectedFile.value = file
165
+ const formData = new FormData()
166
+
167
+ emits('change', file)
168
+
169
+ formData.append(props.bodyKey || 'file', file)
170
+ upload.run(formData, { data: { onUploadProgress, onDownloadProgress } })
171
+ }
172
+ }
173
+
174
+ const handleOpenFile = () => {
175
+ fileInputRef.value?.click()
176
+ }
177
+
178
+ const handleDeleteFile = () => {
179
+ fileInputRef.value?.value && (fileInputRef.value.value = '')
180
+ selectedFile.value = undefined
181
+ onChange(undefined)
182
+ emits('delete')
183
+ }
184
+
185
+ const handleCheckFileCondition = (file: File | undefined): boolean => {
186
+ if (!file) return false
187
+
188
+ const fileType = checkFileType(file, acceptFile.value ?? '')
189
+
190
+ if (!fileType) {
191
+ setErrors(i18next.t('custom:invalid_file_type'))
192
+
193
+ return false
194
+ }
195
+
196
+ const maxSize = checkMaxSize(file, acceptFileSizeKb.value ?? 0)
197
+
198
+ if (!maxSize) {
199
+ if (isAcceptFileUseMb.value) {
200
+ setErrors(i18next.t('custom:invalid_file_size_mb', { size: acceptFileSizeMb.value }))
201
+ } else {
202
+ setErrors(i18next.t('custom:invalid_file_size_kb', { size: acceptFileSizeKb.value }))
203
+ }
204
+
205
+ return false
206
+ }
207
+
208
+ setErrors('')
209
+
210
+ return true
211
+ }
212
+
213
+ const onUploadProgress = (progressEvent: ProgressEvent) => {
214
+ percent.value = (Math.floor((progressEvent.loaded * 100) / progressEvent.total) || 0) * 0.8
215
+ }
216
+
217
+ const onDownloadProgress = (progressEvent: ProgressEvent) => {
218
+ if (progressEvent.total === 0) {
219
+ percent.value = 100
220
+
221
+ return
222
+ }
223
+
224
+ percent.value = (Math.floor((progressEvent.loaded * 100) / progressEvent.total) || 0) * 0.2 + 80
225
+ }
226
+
227
+ useWatchTrue(
228
+ () => upload.status.value.isSuccess,
229
+ () => {
230
+ value.value = upload.data.value[props.responseKey || 'url']
231
+ emits('success', upload.data.value)
232
+ }
233
+ )
234
+
235
+ useWatchTrue(
236
+ () => upload.status.value.isError,
237
+ () => {
238
+ setErrors(StringHelper.getError(upload.status.value.errorData))
239
+ }
240
+ )
241
+ </script>
@@ -1,36 +1,36 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <UInput
4
- type="file"
5
- trailing
6
- :loading-icon="loadingIcon"
7
- :icon="icon"
8
- :leading-icon="leadingIcon"
9
- :trailing-icon="trailingIcon"
10
- :disabled="wrapperProps.isDisabled"
11
- :name="name"
12
- :placeholder="wrapperProps.placeholder"
13
- :autofocus="!!autoFocus"
14
- :readonly="isReadonly"
15
- :accept="accept"
16
- :ui="ui"
17
- @change="handleChange"
18
- />
19
- </FieldWrapper>
20
- </template>
21
- <script lang="ts" setup>
22
- import { useFieldHOC } from '#core/composables/useForm'
23
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
24
- import { type IUploadFileClassicFieldProps } from '#core/components/Form/InputUploadFileClassic/types'
25
-
26
- const props = withDefaults(defineProps<IUploadFileClassicFieldProps>(), {})
27
-
28
- const { value, wrapperProps } = useFieldHOC<File | undefined>(props)
29
-
30
- const emits = defineEmits(['change'])
31
-
32
- const handleChange = (e: Event) => {
33
- value.value = (e.target as HTMLInputElement).files?.[0]
34
- emits('change', e)
35
- }
36
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <UInput
4
+ type="file"
5
+ trailing
6
+ :loading-icon="loadingIcon"
7
+ :icon="icon"
8
+ :leading-icon="leadingIcon"
9
+ :trailing-icon="trailingIcon"
10
+ :disabled="wrapperProps.isDisabled"
11
+ :name="name"
12
+ :placeholder="wrapperProps.placeholder"
13
+ :autofocus="!!autoFocus"
14
+ :readonly="isReadonly"
15
+ :accept="accept"
16
+ :ui="ui"
17
+ @change="handleChange"
18
+ />
19
+ </FieldWrapper>
20
+ </template>
21
+ <script lang="ts" setup>
22
+ import { useFieldHOC } from '#core/composables/useForm'
23
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
24
+ import { type IUploadFileClassicFieldProps } from '#core/components/Form/InputUploadFileClassic/types'
25
+
26
+ const props = withDefaults(defineProps<IUploadFileClassicFieldProps>(), {})
27
+
28
+ const { value, wrapperProps } = useFieldHOC<File | undefined>(props)
29
+
30
+ const emits = defineEmits(['change'])
31
+
32
+ const handleChange = (e: Event) => {
33
+ value.value = (e.target as HTMLInputElement).files?.[0]
34
+ emits('change', e)
35
+ }
36
+ </script>