feat(documents) : add type select to DocumentUpload component
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,21 @@
|
||||
@change="onFileChange"
|
||||
>
|
||||
|
||||
<div class="w-full max-w-xs mt-2">
|
||||
<label class="text-xs font-semibold uppercase tracking-wide text-base-content/70">
|
||||
Type de document
|
||||
</label>
|
||||
<select
|
||||
class="select select-bordered select-sm w-full mt-1"
|
||||
:value="documentType"
|
||||
@change="emit('update:documentType', $event.target.value)"
|
||||
>
|
||||
<option v-for="t in DOCUMENT_TYPES" :key="t.value" :value="t.value">
|
||||
{{ t.label }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<ul v-if="selectedFiles.length" class="mt-4 w-full space-y-2 text-left">
|
||||
<li v-for="file in selectedFiles" :key="file.name" class="flex items-center justify-between text-sm">
|
||||
<div class="flex items-center gap-3">
|
||||
@@ -69,6 +84,7 @@
|
||||
<script setup>
|
||||
import { ref, computed, watch, onBeforeUnmount } from 'vue'
|
||||
import { useToast } from '~/composables/useToast'
|
||||
import { DOCUMENT_TYPES } from '~/shared/documentTypes'
|
||||
import { getFileIcon } from '~/utils/fileIcons'
|
||||
import IconLucideCloudUpload from '~icons/lucide/cloud-upload'
|
||||
|
||||
@@ -96,10 +112,14 @@ const props = defineProps({
|
||||
maxFileSizeMb: {
|
||||
type: Number,
|
||||
default: 200
|
||||
},
|
||||
documentType: {
|
||||
type: String,
|
||||
default: 'documentation'
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'files-added'])
|
||||
const emit = defineEmits(['update:modelValue', 'files-added', 'update:documentType'])
|
||||
|
||||
const dragActive = ref(false)
|
||||
const fileInput = ref(null)
|
||||
|
||||
Reference in New Issue
Block a user