@finema/core 1.4.49 → 1.4.51

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 (59) hide show
  1. package/README.md +63 -63
  2. package/dist/module.d.mts +5 -4
  3. package/dist/module.d.ts +5 -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 -145
  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 -37
  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 +149 -170
  27. package/dist/runtime/components/Form/InputUploadDropzoneAuto/index.vue +238 -0
  28. package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.d.ts +19 -0
  29. package/dist/runtime/components/Form/InputUploadDropzoneAuto/types.mjs +0 -0
  30. package/dist/runtime/components/Form/InputUploadFileClassic/index.vue +36 -36
  31. package/dist/runtime/components/Form/InputUploadFileClassicAuto/index.vue +165 -165
  32. package/dist/runtime/components/Form/index.vue +6 -6
  33. package/dist/runtime/components/Form/types.d.ts +4 -2
  34. package/dist/runtime/components/Form/types.mjs +1 -0
  35. package/dist/runtime/components/Icon.vue +23 -23
  36. package/dist/runtime/components/Image.vue +36 -36
  37. package/dist/runtime/components/Loader.vue +14 -14
  38. package/dist/runtime/components/Modal/index.vue +146 -146
  39. package/dist/runtime/components/SimplePagination.vue +96 -96
  40. package/dist/runtime/components/Slideover/index.vue +110 -110
  41. package/dist/runtime/components/Table/Base.vue +133 -132
  42. package/dist/runtime/components/Table/ColumnDate.vue +16 -16
  43. package/dist/runtime/components/Table/ColumnDateTime.vue +18 -18
  44. package/dist/runtime/components/Table/ColumnImage.vue +13 -13
  45. package/dist/runtime/components/Table/ColumnNumber.vue +14 -14
  46. package/dist/runtime/components/Table/Simple.vue +57 -57
  47. package/dist/runtime/components/Table/index.vue +59 -52
  48. package/dist/runtime/components/Tabs/index.vue +65 -65
  49. package/dist/runtime/core.config.d.ts +1 -0
  50. package/dist/runtime/core.config.mjs +2 -1
  51. package/dist/runtime/helpers/componentHelper.d.ts +3 -0
  52. package/dist/runtime/helpers/componentHelper.mjs +16 -0
  53. package/dist/runtime/types/utils.d.ts +29 -29
  54. package/dist/runtime/ui.config/uploadFileDropzone.d.ts +4 -1
  55. package/dist/runtime/ui.config/uploadFileDropzone.mjs +7 -4
  56. package/dist/runtime/ui.css +32 -32
  57. package/dist/runtime/utils/StringHelper.d.ts +1 -1
  58. package/dist/runtime/utils/StringHelper.mjs +2 -2
  59. package/package.json +11 -11
@@ -1,54 +1,54 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <UInput
4
- v-if="type === 'password'"
5
- v-model="value"
6
- :disabled="wrapperProps.isDisabled"
7
- :leading-icon="leadingIcon"
8
- :trailing-icon="trailingIcon"
9
- :name="name"
10
- :placeholder="wrapperProps.placeholder"
11
- :type="isShowPassword ? 'text' : 'password'"
12
- :autofocus="!!autoFocus"
13
- :icon="icon"
14
- :readonly="isReadonly"
15
- :ui="_deepMerge({}, ui, { icon: { trailing: { pointer: '' } } })"
16
- >
17
- <template #trailing>
18
- <UButton
19
- color="gray"
20
- variant="link"
21
- :icon="isShowPassword ? 'i-heroicons-eye' : 'i-heroicons-eye-slash'"
22
- :padded="false"
23
- @click="isShowPassword = !isShowPassword"
24
- />
25
- </template>
26
- </UInput>
27
- <UInput
28
- v-else
29
- v-model="value"
30
- :disabled="wrapperProps.isDisabled"
31
- :leading-icon="leadingIcon"
32
- :trailing-icon="trailingIcon"
33
- :name="name"
34
- :placeholder="wrapperProps.placeholder"
35
- :type="type || 'text'"
36
- :autofocus="!!autoFocus"
37
- :icon="icon"
38
- :readonly="isReadonly"
39
- :ui="ui"
40
- />
41
- </FieldWrapper>
42
- </template>
43
- <script lang="ts" setup>
44
- import { _deepMerge, ref } from '#imports'
45
- import { type ITextFieldProps } from '#core/components/Form/InputText/types'
46
- import { useFieldHOC } from '#core/composables/useForm'
47
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
48
-
49
- const props = withDefaults(defineProps<ITextFieldProps>(), {})
50
-
51
- const { value, wrapperProps } = useFieldHOC<string>(props)
52
-
53
- const isShowPassword = ref(false)
54
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <UInput
4
+ v-if="type === 'password'"
5
+ v-model="value"
6
+ :disabled="wrapperProps.isDisabled"
7
+ :leading-icon="leadingIcon"
8
+ :trailing-icon="trailingIcon"
9
+ :name="name"
10
+ :placeholder="wrapperProps.placeholder"
11
+ :type="isShowPassword ? 'text' : 'password'"
12
+ :autofocus="!!autoFocus"
13
+ :icon="icon"
14
+ :readonly="isReadonly"
15
+ :ui="_deepMerge({}, ui, { icon: { trailing: { pointer: '' } } })"
16
+ >
17
+ <template #trailing>
18
+ <UButton
19
+ color="gray"
20
+ variant="link"
21
+ :icon="isShowPassword ? 'i-heroicons-eye' : 'i-heroicons-eye-slash'"
22
+ :padded="false"
23
+ @click="isShowPassword = !isShowPassword"
24
+ />
25
+ </template>
26
+ </UInput>
27
+ <UInput
28
+ v-else
29
+ v-model="value"
30
+ :disabled="wrapperProps.isDisabled"
31
+ :leading-icon="leadingIcon"
32
+ :trailing-icon="trailingIcon"
33
+ :name="name"
34
+ :placeholder="wrapperProps.placeholder"
35
+ :type="type || 'text'"
36
+ :autofocus="!!autoFocus"
37
+ :icon="icon"
38
+ :readonly="isReadonly"
39
+ :ui="ui"
40
+ />
41
+ </FieldWrapper>
42
+ </template>
43
+ <script lang="ts" setup>
44
+ import { _deepMerge, ref } from '#imports'
45
+ import { type ITextFieldProps } from '#core/components/Form/InputText/types'
46
+ import { useFieldHOC } from '#core/composables/useForm'
47
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
48
+
49
+ const props = withDefaults(defineProps<ITextFieldProps>(), {})
50
+
51
+ const { value, wrapperProps } = useFieldHOC<string>(props)
52
+
53
+ const isShowPassword = ref(false)
54
+ </script>
@@ -1,25 +1,25 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <UTextarea
4
- v-model="value"
5
- :disabled="wrapperProps.isDisabled"
6
- :name="name"
7
- :resize="resize"
8
- :placeholder="wrapperProps.placeholder"
9
- :autofocus="!!autoFocus"
10
- :autoresize="autoresize"
11
- :rows="rows"
12
- :readonly="isReadonly"
13
- :ui="ui"
14
- />
15
- </FieldWrapper>
16
- </template>
17
- <script lang="ts" setup>
18
- import { useFieldHOC } from '#core/composables/useForm'
19
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
20
- import { type ITextareaFieldProps } from '#core/components/Form/InputTextarea/types'
21
-
22
- const props = withDefaults(defineProps<ITextareaFieldProps>(), {})
23
-
24
- const { value, wrapperProps } = useFieldHOC<string>(props)
25
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <UTextarea
4
+ v-model="value"
5
+ :disabled="wrapperProps.isDisabled"
6
+ :name="name"
7
+ :resize="resize"
8
+ :placeholder="wrapperProps.placeholder"
9
+ :autofocus="!!autoFocus"
10
+ :autoresize="autoresize"
11
+ :rows="rows"
12
+ :readonly="isReadonly"
13
+ :ui="ui"
14
+ />
15
+ </FieldWrapper>
16
+ </template>
17
+ <script lang="ts" setup>
18
+ import { useFieldHOC } from '#core/composables/useForm'
19
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
20
+ import { type ITextareaFieldProps } from '#core/components/Form/InputTextarea/types'
21
+
22
+ const props = withDefaults(defineProps<ITextareaFieldProps>(), {})
23
+
24
+ const { value, wrapperProps } = useFieldHOC<string>(props)
25
+ </script>
@@ -1,14 +1,14 @@
1
- <template>
2
- <FieldWrapper v-bind="wrapperProps">
3
- <UToggle v-model="value" :disabled="wrapperProps.isDisabled" :name="name" :ui="ui" />
4
- </FieldWrapper>
5
- </template>
6
-
7
- <script lang="ts" setup>
8
- import { useFieldHOC } from '#core/composables/useForm'
9
- import { type IToggleFieldProps } from '#core/components/Form/InputToggle/types'
10
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
11
-
12
- const props = withDefaults(defineProps<IToggleFieldProps>(), {})
13
- const { value, wrapperProps } = useFieldHOC<boolean>(props)
14
- </script>
1
+ <template>
2
+ <FieldWrapper v-bind="wrapperProps">
3
+ <UToggle v-model="value" :disabled="wrapperProps.isDisabled" :name="name" :ui="ui" />
4
+ </FieldWrapper>
5
+ </template>
6
+
7
+ <script lang="ts" setup>
8
+ import { useFieldHOC } from '#core/composables/useForm'
9
+ import { type IToggleFieldProps } from '#core/components/Form/InputToggle/types'
10
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
11
+
12
+ const props = withDefaults(defineProps<IToggleFieldProps>(), {})
13
+ const { value, wrapperProps } = useFieldHOC<boolean>(props)
14
+ </script>
@@ -1,170 +1,149 @@
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 v-if="isImage(selectedFile)" :class="[ui.preview.image.wrapper]">
31
- <img :src="generateURL(selectedFile)" :class="[ui.preview.image.img]" alt="file" />
32
- </div>
33
- <Icon v-else :name="ui.default.filePreviewIcon" :class="[ui.preview.icon]" />
34
- <div :class="[ui.preview.filename]">
35
- <p>{{ selectedFile.name }}</p>
36
- </div>
37
- <div :class="[ui.preview.fileInfo]">
38
- {{ isSelectedFileUseMb ? `${selectedFileSizeMb} MB` : `${selectedFileSizeKb} KB` }}
39
- </div>
40
- </div>
41
- <div v-if="!selectedFile" :class="[ui.placeholderWrapper]">
42
- <Icon :name="ui.default.uploadIcon" :class="[ui.labelIcon]" />
43
- <div :class="[ui.labelWrapper]">
44
- <p class="text-primary cursor-pointer" @click="handleOpenFile">
45
- {{ selectFileLabel ?? 'คลิกเพื่อเลือกไฟล์' }}
46
- </p>
47
- <p>{{ selectFileSubLabel ?? 'หรือ ลากและวางที่นี่' }}</p>
48
- </div>
49
- <p v-if="placeholder" :class="[ui.placeholder]">{{ placeholder }}</p>
50
- </div>
51
- </div>
52
- </div>
53
- </FieldWrapper>
54
- </template>
55
-
56
- <script lang="ts" setup>
57
- import { useDropZone } from '@vueuse/core'
58
- import { type IUploadDropzoneProps } from './types'
59
- import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
60
- import { useFieldHOC } from '#core/composables/useForm'
61
- import { computed, ref, toRef, useUI, useUiConfig } from '#imports'
62
- import { uploadFileDropzone } from '#core/ui.config'
63
- import i18next from 'i18next'
64
-
65
- const config = useUiConfig<typeof uploadFileDropzone>(uploadFileDropzone, 'uploadFileDropzone')
66
-
67
- const props = withDefaults(defineProps<IUploadDropzoneProps>(), {})
68
- const emit = defineEmits(['change', 'delete'])
69
-
70
- const { wrapperProps, handleChange: onChange, setErrors, value } = useFieldHOC<File>(props)
71
-
72
- const { ui } = useUI('uploadFileDropzone', toRef(props, 'ui'), config)
73
-
74
- const fileInputRef = ref<HTMLInputElement>()
75
- const dropzoneRef = ref<HTMLDivElement>()
76
-
77
- const acceptFile = computed(() =>
78
- typeof props.accept === 'string' ? props.accept : props.accept?.join(',')
79
- )
80
-
81
- const acceptFileSizeKb = computed(() => props.maxSize)
82
- const acceptFileSizeMb = computed(() => ((acceptFileSizeKb.value ?? 0) / 1024).toFixed(2))
83
- const isAcceptFileUseMb = computed(() => acceptFileSizeKb.value && acceptFileSizeKb.value > 1024)
84
-
85
- const selectedFileSizeKb = computed(() => ((value?.value.size || 0) / 1000).toFixed(2))
86
- const selectedFileSizeMb = computed(() => ((value?.value.size || 0) / 1000 / 1000).toFixed(2))
87
- const isSelectedFileUseMb = computed(() => (value?.value.size || 0) / 1000 > 1024)
88
- const selectedFile = computed(() => value?.value)
89
-
90
- const onDrop = (files: File[] | null) => {
91
- if (props.isDisabled || files?.length === 0 || !files) return
92
-
93
- const file = files[0]
94
- const result = handleCheckFileCondition(file)
95
-
96
- if (result) {
97
- onChange(file)
98
- emit('change', file)
99
- }
100
- }
101
-
102
- const { isOverDropZone } = useDropZone(dropzoneRef, {
103
- onDrop,
104
- })
105
-
106
- const handleChange = (e: Event) => {
107
- if (props.isDisabled) return
108
-
109
- const file = (e.target as HTMLInputElement).files?.[0]
110
- const result = handleCheckFileCondition(file)
111
-
112
- if (result) {
113
- onChange(file)
114
- value.value = file
115
- emit('change', file)
116
- }
117
- }
118
-
119
- const handleOpenFile = () => {
120
- fileInputRef.value?.click()
121
- }
122
-
123
- const handleDeleteFile = () => {
124
- fileInputRef.value?.value && (fileInputRef.value.value = '')
125
- onChange(undefined)
126
- emit('delete')
127
- }
128
-
129
- const handleCheckFileCondition = (file: File | undefined): boolean => {
130
- if (!file) return false
131
-
132
- const maxSize = checkMaxSize(file)
133
-
134
- if (!maxSize) {
135
- if (isAcceptFileUseMb.value) {
136
- setErrors(i18next.t('custom:invalid_file_size_mb', { size: acceptFileSizeMb.value }))
137
- } else {
138
- setErrors(i18next.t('custom:invalid_file_size_kb', { size: acceptFileSizeKb.value }))
139
- }
140
-
141
- return false
142
- }
143
-
144
- setErrors('')
145
-
146
- return true
147
- }
148
-
149
- const isImage = (file: File) => {
150
- return file.type.startsWith('image/')
151
- }
152
-
153
- const checkMaxSize = (file: File): boolean => {
154
- if (acceptFileSizeKb.value) {
155
- return file.size / 1000 <= acceptFileSizeKb.value
156
- }
157
-
158
- return true
159
- }
160
-
161
- const generateURL = (file: File) => {
162
- const fileSrc = URL.createObjectURL(file)
163
-
164
- setTimeout(() => {
165
- URL.revokeObjectURL(fileSrc)
166
- }, 1000)
167
-
168
- return fileSrc
169
- }
170
- </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 v-if="isImage(selectedFile)" :class="[ui.preview.image.wrapper]">
31
+ <img :src="generateURL(selectedFile)" :class="[ui.preview.image.img]" alt="file" />
32
+ </div>
33
+ <Icon v-else :name="ui.default.filePreviewIcon" :class="[ui.preview.icon]" />
34
+ <div :class="[ui.preview.filename]">
35
+ <p class="truncate">{{ selectedFile.name }}</p>
36
+ </div>
37
+ <Badge size="xs" variant="outline" class="mt-1">
38
+ {{ isSelectedFileUseMb ? `${selectedFileSizeMb} Mb` : `${selectedFileSizeKb} Kb` }}
39
+ </Badge>
40
+ </div>
41
+ <div v-if="!selectedFile" :class="[ui.placeholderWrapper]">
42
+ <Icon :name="ui.default.uploadIcon" :class="[ui.labelIcon]" />
43
+ <div :class="[ui.labelWrapper]">
44
+ <p class="text-primary cursor-pointer" @click="handleOpenFile">
45
+ {{ selectFileLabel ?? 'คลิกเพื่อเลือกไฟล์' }}
46
+ </p>
47
+ <p>{{ selectFileSubLabel ?? 'หรือ ลากและวางที่นี่' }}</p>
48
+ </div>
49
+ <p v-if="placeholder" :class="[ui.placeholder]">{{ placeholder }}</p>
50
+ </div>
51
+ </div>
52
+ </div>
53
+ </FieldWrapper>
54
+ </template>
55
+
56
+ <script lang="ts" setup>
57
+ import { useDropZone } from '@vueuse/core'
58
+ import { type IUploadDropzoneProps } from './types'
59
+ import { isImage, generateURL, checkMaxSize } from '#core/helpers/componentHelper'
60
+ import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
61
+ import { useFieldHOC } from '#core/composables/useForm'
62
+ import { computed, ref, toRef, useUI, useUiConfig } from '#imports'
63
+ import { uploadFileDropzone } from '#core/ui.config'
64
+ import i18next from 'i18next'
65
+
66
+ const config = useUiConfig<typeof uploadFileDropzone>(uploadFileDropzone, 'uploadFileDropzone')
67
+
68
+ const props = withDefaults(defineProps<IUploadDropzoneProps>(), {})
69
+ const emit = defineEmits(['change', 'delete'])
70
+
71
+ const { wrapperProps, handleChange: onChange, setErrors, value } = useFieldHOC<File>(props)
72
+
73
+ const { ui } = useUI('uploadFileDropzone', toRef(props, 'ui'), config)
74
+
75
+ const fileInputRef = ref<HTMLInputElement>()
76
+ const dropzoneRef = ref<HTMLDivElement>()
77
+
78
+ const acceptFile = computed(() =>
79
+ typeof props.accept === 'string' ? props.accept : props.accept?.join(',')
80
+ )
81
+
82
+ const acceptFileSizeKb = computed(() => props.maxSize)
83
+ const acceptFileSizeMb = computed(() => ((acceptFileSizeKb.value ?? 0) / 1024).toFixed(2))
84
+ const isAcceptFileUseMb = computed(() => acceptFileSizeKb.value && acceptFileSizeKb.value > 1024)
85
+
86
+ const selectedFileSizeKb = computed(() => ((value?.value.size || 0) / 1000).toFixed(2))
87
+ const selectedFileSizeMb = computed(() => ((value?.value.size || 0) / 1000 / 1000).toFixed(2))
88
+ const isSelectedFileUseMb = computed(() => (value?.value.size || 0) / 1000 > 1024)
89
+ const selectedFile = computed(() => value?.value)
90
+
91
+ const onDrop = (files: File[] | null) => {
92
+ if (props.isDisabled || files?.length === 0 || !files) return
93
+
94
+ const file = files[0]
95
+ const result = handleCheckFileCondition(file)
96
+
97
+ if (result) {
98
+ onChange(file)
99
+ emit('change', file)
100
+ }
101
+ }
102
+
103
+ const { isOverDropZone } = useDropZone(dropzoneRef, {
104
+ onDrop,
105
+ })
106
+
107
+ const handleChange = (e: Event) => {
108
+ if (props.isDisabled) return
109
+
110
+ const file = (e.target as HTMLInputElement).files?.[0]
111
+ const result = handleCheckFileCondition(file)
112
+
113
+ if (result && file) {
114
+ onChange(file)
115
+ value.value = file
116
+ emit('change', file)
117
+ }
118
+ }
119
+
120
+ const handleOpenFile = () => {
121
+ fileInputRef.value?.click()
122
+ }
123
+
124
+ const handleDeleteFile = () => {
125
+ fileInputRef.value?.value && (fileInputRef.value.value = '')
126
+ onChange(undefined)
127
+ emit('delete')
128
+ }
129
+
130
+ const handleCheckFileCondition = (file: File | undefined): boolean => {
131
+ if (!file) return false
132
+
133
+ const maxSize = checkMaxSize(file, acceptFileSizeKb.value ?? 0)
134
+
135
+ if (!maxSize) {
136
+ if (isAcceptFileUseMb.value) {
137
+ setErrors(i18next.t('custom:invalid_file_size_mb', { size: acceptFileSizeMb.value }))
138
+ } else {
139
+ setErrors(i18next.t('custom:invalid_file_size_kb', { size: acceptFileSizeKb.value }))
140
+ }
141
+
142
+ return false
143
+ }
144
+
145
+ setErrors('')
146
+
147
+ return true
148
+ }
149
+ </script>