diff --git a/docs/components/fileInput/examples/FileInpDefault.vue b/docs/components/fileInput/examples/FileInpDefault.vue index 75c0471..38d661e 100644 --- a/docs/components/fileInput/examples/FileInpDefault.vue +++ b/docs/components/fileInput/examples/FileInpDefault.vue @@ -8,6 +8,5 @@ import FileInput from '../../../../src/components/FileInput/FileInput.vue' import { ref } from 'vue' -const file = ref() - +const file = ref(null) diff --git a/docs/components/fileInput/examples/FileInpDropZone.vue b/docs/components/fileInput/examples/FileInpDropZone.vue index ca08d6d..4b1c8d6 100644 --- a/docs/components/fileInput/examples/FileInpDropZone.vue +++ b/docs/components/fileInput/examples/FileInpDropZone.vue @@ -1,8 +1,6 @@ - - SVG, PNG, JPG or GIF (MAX. 800x400px) - + SVG, PNG, JPG or GIF (MAX. 800x400px) @@ -10,5 +8,5 @@ import FileInput from '../../../../src/components/FileInput/FileInput.vue' import { ref } from 'vue' -const file = ref('') +const file = ref(null) diff --git a/docs/components/fileInput/examples/FileInpHelper.vue b/docs/components/fileInput/examples/FileInpHelper.vue index 8a013f8..05ce29f 100644 --- a/docs/components/fileInput/examples/FileInpHelper.vue +++ b/docs/components/fileInput/examples/FileInpHelper.vue @@ -1,7 +1,7 @@ - SVG, PNG, JPG or GIF (MAX. 800x400px). + SVG, PNG, JPG or GIF (MAX. 800x400px). @@ -10,5 +10,5 @@ import FileInput from '../../../../src/components/FileInput/FileInput.vue' import { ref } from 'vue' -const file = ref('') +const file = ref(null) diff --git a/docs/components/fileInput/examples/FileInpSize.vue b/docs/components/fileInput/examples/FileInpSize.vue index beaf07c..b0fe5c1 100644 --- a/docs/components/fileInput/examples/FileInpSize.vue +++ b/docs/components/fileInput/examples/FileInpSize.vue @@ -1,12 +1,13 @@ - - - - + + + + diff --git a/docs/components/fileInput/examples/MultipleFile.vue b/docs/components/fileInput/examples/MultipleFile.vue index 69dd4c4..d50ac3a 100644 --- a/docs/components/fileInput/examples/MultipleFile.vue +++ b/docs/components/fileInput/examples/MultipleFile.vue @@ -1,19 +1,17 @@ - - - - - {{ file.name }} - + + + + + {{ file.name }} - - - - \ No newline at end of file + + + + diff --git a/src/components/FileInput/FileInput.vue b/src/components/FileInput/FileInput.vue index 7266037..9945653 100644 --- a/src/components/FileInput/FileInput.vue +++ b/src/components/FileInput/FileInput.vue @@ -3,26 +3,30 @@ {{ label }} - + - + - - + + - Click to upload or - drag and drop + + Click to upload + or drag and drop - File: {{ model.name }} + File: {{ dropZoneText }} @@ -33,21 +37,35 @@ diff --git a/src/components/FileInput/composables/useFileInputClasses.ts b/src/components/FileInput/composables/useFileInputClasses.ts index 387cdd7..1c1bf59 100644 --- a/src/components/FileInput/composables/useFileInputClasses.ts +++ b/src/components/FileInput/composables/useFileInputClasses.ts @@ -1,20 +1,22 @@ import { simplifyTailwindClasses } from '@/utils/simplifyTailwindClasses' import { computed } from 'vue' -const fileInpDefaultClasses = 'block w-full text-sm text-gray-900 border-[1px] border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400' +const fileInpDefaultClasses = + 'block w-full text-sm text-gray-900 border-[1px] border-gray-300 rounded-lg cursor-pointer bg-gray-50 dark:text-gray-400 focus:outline-none dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400' const fileInpLabelClasses = 'block mb-2 text-sm font-medium text-gray-900 dark:text-white' -const fileInpDropzoneClasses = 'flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600' +const fileInpDropzoneClasses = + 'flex flex-col items-center justify-center w-full h-64 border-2 border-gray-300 border-dashed rounded-lg cursor-pointer bg-gray-50 dark:hover:bg-bray-800 dark:bg-gray-700 hover:bg-gray-100 dark:border-gray-600 dark:hover:border-gray-500 dark:hover:bg-gray-600' const fileDropzoneWrapClasses = 'flex flex-col items-center justify-center pt-5 pb-6' const fileDropzoneDefaultTextClasses = '!-mb-2 text-sm text-gray-500 dark:text-gray-400' export function useFileInputClasses(size: string) { - const fileInpClasses = computed(() => { - return simplifyTailwindClasses(fileInpDefaultClasses, 'text-' + size) - }) + const fileInpClasses = computed(() => { + return simplifyTailwindClasses(fileInpDefaultClasses, 'text-' + size) + }) - const labelClasses = computed(() => { - return fileInpLabelClasses - }) + const labelClasses = computed(() => { + return fileInpLabelClasses + }) const dropzoneLabelClasses = computed(() => { return fileInpDropzoneClasses @@ -28,11 +30,11 @@ export function useFileInputClasses(size: string) { return fileDropzoneDefaultTextClasses }) - return { - fileInpClasses, - labelClasses, + return { + fileInpClasses, + labelClasses, dropzoneLabelClasses, dropzoneWrapClasses, dropzoneTextClasses, - } + } }
- SVG, PNG, JPG or GIF (MAX. 800x400px) -
SVG, PNG, JPG or GIF (MAX. 800x400px)
SVG, PNG, JPG or GIF (MAX. 800x400px).
Click to upload or - drag and drop +
+ Click to upload + or drag and drop
File: {{ model.name }}
File: {{ dropZoneText }}