From 7825529e5f1c97e98438c2684ec2dacab7d6740f Mon Sep 17 00:00:00 2001 From: J-michalek Date: Sat, 26 Jul 2025 15:28:43 +0200 Subject: [PATCH 1/3] fix(FileUpload): add aria-label to remove file button --- src/runtime/components/FileUpload.vue | 5 ++++- src/runtime/locale/ar.ts | 3 +++ src/runtime/locale/az.ts | 3 +++ src/runtime/locale/bg.ts | 3 +++ src/runtime/locale/bn.ts | 3 +++ src/runtime/locale/ca.ts | 3 +++ src/runtime/locale/ckb.ts | 3 +++ src/runtime/locale/cs.ts | 3 +++ src/runtime/locale/da.ts | 3 +++ src/runtime/locale/de.ts | 3 +++ src/runtime/locale/el.ts | 3 +++ src/runtime/locale/en.ts | 3 +++ src/runtime/locale/es.ts | 3 +++ src/runtime/locale/et.ts | 3 +++ src/runtime/locale/fa_ir.ts | 3 +++ src/runtime/locale/fi.ts | 3 +++ src/runtime/locale/fr.ts | 3 +++ src/runtime/locale/he.ts | 3 +++ src/runtime/locale/hi.ts | 3 +++ src/runtime/locale/hu.ts | 3 +++ src/runtime/locale/hy.ts | 3 +++ src/runtime/locale/id.ts | 3 +++ src/runtime/locale/it.ts | 3 +++ src/runtime/locale/ja.ts | 3 +++ src/runtime/locale/kk.ts | 3 +++ src/runtime/locale/km.ts | 3 +++ src/runtime/locale/ko.ts | 3 +++ src/runtime/locale/ky.ts | 3 +++ src/runtime/locale/lb.ts | 3 +++ src/runtime/locale/lt.ts | 3 +++ src/runtime/locale/mn.ts | 3 +++ src/runtime/locale/ms.ts | 3 +++ src/runtime/locale/nb_no.ts | 3 +++ src/runtime/locale/nl.ts | 3 +++ src/runtime/locale/pl.ts | 3 +++ src/runtime/locale/pt.ts | 3 +++ src/runtime/locale/pt_br.ts | 3 +++ src/runtime/locale/ro.ts | 3 +++ src/runtime/locale/ru.ts | 3 +++ src/runtime/locale/sk.ts | 3 +++ src/runtime/locale/sl.ts | 3 +++ src/runtime/locale/sv.ts | 3 +++ src/runtime/locale/th.ts | 3 +++ src/runtime/locale/tj.ts | 3 +++ src/runtime/locale/tr.ts | 3 +++ src/runtime/locale/ug_cn.ts | 3 +++ src/runtime/locale/uk.ts | 3 +++ src/runtime/locale/ur.ts | 3 +++ src/runtime/locale/uz.ts | 3 +++ src/runtime/locale/vi.ts | 3 +++ src/runtime/locale/zh_cn.ts | 3 +++ src/runtime/locale/zh_tw.ts | 3 +++ src/runtime/types/locale.ts | 3 +++ 53 files changed, 160 insertions(+), 1 deletion(-) diff --git a/src/runtime/components/FileUpload.vue b/src/runtime/components/FileUpload.vue index 992b5bbffc..f03e42c450 100644 --- a/src/runtime/components/FileUpload.vue +++ b/src/runtime/components/FileUpload.vue @@ -127,7 +127,7 @@ export interface FileUploadSlots { import { computed, watch } from 'vue' import { Primitive } from 'reka-ui' import { createReusableTemplate } from '@vueuse/core' -import { useAppConfig } from '#imports' +import { useAppConfig, useLocale } from '#imports' import { useFormField } from '../composables/useFormField' import { useFileUpload } from '../composables/useFileUpload' import { tv } from '../utils/tv' @@ -153,6 +153,8 @@ const modelValue = defineModel<(M extends true ? File[] : File) | null>() const appConfig = useAppConfig() as FileUpload['AppConfig'] +const { t } = useLocale() + const [DefineFilesTemplate, ReuseFilesTemplate] = createReusableTemplate() const { isDragging, open, inputRef, dropzoneRef } = useFileUpload({ @@ -298,6 +300,7 @@ defineExpose({ }), ...typeof fileDelete === 'object' ? fileDelete : undefined }" + :aria-label="t('fileUpload.removeFile', { filename: (file as File).name })" :trailing-icon="fileDeleteIcon || appConfig.ui.icons.close" :class="ui.fileTrailingButton({ class: props.ui?.fileTrailingButton })" @click.stop.prevent="removeFile(index)" diff --git a/src/runtime/locale/ar.ts b/src/runtime/locale/ar.ts index 8739521c1f..a9bffe77f1 100644 --- a/src/runtime/locale/ar.ts +++ b/src/runtime/locale/ar.ts @@ -54,6 +54,9 @@ export default defineLocale({ }, table: { noData: 'لا توجد بيانات' + }, + fileUpload: { + removeFile: 'إزالة {filename}' } } }) diff --git a/src/runtime/locale/az.ts b/src/runtime/locale/az.ts index 64d16d9388..e894fe2d0d 100644 --- a/src/runtime/locale/az.ts +++ b/src/runtime/locale/az.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Məlumat yoxdur' + }, + fileUpload: { + removeFile: '{filename} sil' } } }) diff --git a/src/runtime/locale/bg.ts b/src/runtime/locale/bg.ts index 7c7caafb90..4495e2928c 100644 --- a/src/runtime/locale/bg.ts +++ b/src/runtime/locale/bg.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Няма данни' + }, + fileUpload: { + removeFile: 'Премахни {filename}' } } }) diff --git a/src/runtime/locale/bn.ts b/src/runtime/locale/bn.ts index 1a88ca2361..7da61cdf38 100644 --- a/src/runtime/locale/bn.ts +++ b/src/runtime/locale/bn.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'কোন তথ্য নেই' + }, + fileUpload: { + removeFile: '{filename} সরান' } } }) diff --git a/src/runtime/locale/ca.ts b/src/runtime/locale/ca.ts index 2353756183..ae58431bcf 100644 --- a/src/runtime/locale/ca.ts +++ b/src/runtime/locale/ca.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Sense dades' + }, + fileUpload: { + removeFile: 'Eliminar {filename}' } } }) diff --git a/src/runtime/locale/ckb.ts b/src/runtime/locale/ckb.ts index 3b92732d59..77b9b27060 100644 --- a/src/runtime/locale/ckb.ts +++ b/src/runtime/locale/ckb.ts @@ -54,6 +54,9 @@ export default defineLocale({ }, table: { noData: 'هیچ داتایەک نییە' + }, + fileUpload: { + removeFile: '{filename} بسڕەوە' } } }) diff --git a/src/runtime/locale/cs.ts b/src/runtime/locale/cs.ts index 87752a1768..011cac8c6a 100644 --- a/src/runtime/locale/cs.ts +++ b/src/runtime/locale/cs.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Žádná data' + }, + fileUpload: { + removeFile: 'Odebrat {filename}' } } }) diff --git a/src/runtime/locale/da.ts b/src/runtime/locale/da.ts index 79c0db2fb2..cfbeed683a 100644 --- a/src/runtime/locale/da.ts +++ b/src/runtime/locale/da.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Ingen data' + }, + fileUpload: { + removeFile: 'Fjern {filename}' } } }) diff --git a/src/runtime/locale/de.ts b/src/runtime/locale/de.ts index 397de37592..680785399b 100644 --- a/src/runtime/locale/de.ts +++ b/src/runtime/locale/de.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Keine Daten' + }, + fileUpload: { + removeFile: '{filename} entfernen' } } }) diff --git a/src/runtime/locale/el.ts b/src/runtime/locale/el.ts index 39d8a6c460..d4810e7e43 100644 --- a/src/runtime/locale/el.ts +++ b/src/runtime/locale/el.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Δεν υπάρχουν δεδομένα' + }, + fileUpload: { + removeFile: 'Αφαίρεση {filename}' } } }) diff --git a/src/runtime/locale/en.ts b/src/runtime/locale/en.ts index 2734b46863..928ee9e15e 100644 --- a/src/runtime/locale/en.ts +++ b/src/runtime/locale/en.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'No data' + }, + fileUpload: { + removeFile: 'Remove {filename}' } } }) diff --git a/src/runtime/locale/es.ts b/src/runtime/locale/es.ts index a2bbc60f4f..6b6e4883f0 100644 --- a/src/runtime/locale/es.ts +++ b/src/runtime/locale/es.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Sin datos' + }, + fileUpload: { + removeFile: 'Eliminar {filename}' } } }) diff --git a/src/runtime/locale/et.ts b/src/runtime/locale/et.ts index d1237587e1..958bb7b6d4 100644 --- a/src/runtime/locale/et.ts +++ b/src/runtime/locale/et.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Pole andmeid' + }, + fileUpload: { + removeFile: 'Eemalda {filename}' } } }) diff --git a/src/runtime/locale/fa_ir.ts b/src/runtime/locale/fa_ir.ts index 84a4f9a45d..48f8cd0030 100644 --- a/src/runtime/locale/fa_ir.ts +++ b/src/runtime/locale/fa_ir.ts @@ -54,6 +54,9 @@ export default defineLocale({ }, table: { noData: 'داده‌ای موجود نیست' + }, + fileUpload: { + removeFile: 'حذف {filename}' } } }) diff --git a/src/runtime/locale/fi.ts b/src/runtime/locale/fi.ts index de370ebc2b..62374a9fcd 100644 --- a/src/runtime/locale/fi.ts +++ b/src/runtime/locale/fi.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Ei tietoja' + }, + fileUpload: { + removeFile: 'Poista {filename}' } } }) diff --git a/src/runtime/locale/fr.ts b/src/runtime/locale/fr.ts index 3b69821dd4..4a9a217348 100644 --- a/src/runtime/locale/fr.ts +++ b/src/runtime/locale/fr.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Aucune donnée' + }, + fileUpload: { + removeFile: 'Supprimer {filename}' } } }) diff --git a/src/runtime/locale/he.ts b/src/runtime/locale/he.ts index 36f743a612..53a4928431 100644 --- a/src/runtime/locale/he.ts +++ b/src/runtime/locale/he.ts @@ -52,6 +52,9 @@ export default defineLocale({ }, table: { noData: 'אין נתונים להצגה' + }, + fileUpload: { + removeFile: 'הסר {filename}' } } }) diff --git a/src/runtime/locale/hi.ts b/src/runtime/locale/hi.ts index ec69400d0a..10f68073ce 100644 --- a/src/runtime/locale/hi.ts +++ b/src/runtime/locale/hi.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'कोई डेटा नहीं' + }, + fileUpload: { + removeFile: '{filename} हटाएं' } } }) diff --git a/src/runtime/locale/hu.ts b/src/runtime/locale/hu.ts index 4152dc3fe6..fcd7658030 100644 --- a/src/runtime/locale/hu.ts +++ b/src/runtime/locale/hu.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Nincs adat' + }, + fileUpload: { + removeFile: '{filename} eltávolítása' } } }) diff --git a/src/runtime/locale/hy.ts b/src/runtime/locale/hy.ts index d296d54350..d74215eabc 100644 --- a/src/runtime/locale/hy.ts +++ b/src/runtime/locale/hy.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Տվյալներ չկան' + }, + fileUpload: { + removeFile: 'Ջնջել {filename}' } } }) diff --git a/src/runtime/locale/id.ts b/src/runtime/locale/id.ts index 401b9681ea..e0d01bbb5f 100644 --- a/src/runtime/locale/id.ts +++ b/src/runtime/locale/id.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Tidak ada data' + }, + fileUpload: { + removeFile: 'Hapus {filename}' } } }) diff --git a/src/runtime/locale/it.ts b/src/runtime/locale/it.ts index a2bc323ade..4ce211d50c 100644 --- a/src/runtime/locale/it.ts +++ b/src/runtime/locale/it.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Nessun dato' + }, + fileUpload: { + removeFile: 'Rimuovi {filename}' } } }) diff --git a/src/runtime/locale/ja.ts b/src/runtime/locale/ja.ts index 2525f7f692..3874b35ae0 100644 --- a/src/runtime/locale/ja.ts +++ b/src/runtime/locale/ja.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'データがありません' + }, + fileUpload: { + removeFile: '{filename}を削除' } } }) diff --git a/src/runtime/locale/kk.ts b/src/runtime/locale/kk.ts index d2c1ccfdae..b3a738d39a 100644 --- a/src/runtime/locale/kk.ts +++ b/src/runtime/locale/kk.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Деректер жоқ' + }, + fileUpload: { + removeFile: '{filename} жою' } } }) diff --git a/src/runtime/locale/km.ts b/src/runtime/locale/km.ts index 41f7f8fea3..9c7c52c333 100644 --- a/src/runtime/locale/km.ts +++ b/src/runtime/locale/km.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'មិនមានទិន្នន័យ' + }, + fileUpload: { + removeFile: 'លុប {filename}' } } }) diff --git a/src/runtime/locale/ko.ts b/src/runtime/locale/ko.ts index 16e0d3b87e..850db00738 100644 --- a/src/runtime/locale/ko.ts +++ b/src/runtime/locale/ko.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: '데이터가 없습니다.' + }, + fileUpload: { + removeFile: '{filename} 제거' } } }) diff --git a/src/runtime/locale/ky.ts b/src/runtime/locale/ky.ts index 4aa91484cb..fdf5e51ba2 100644 --- a/src/runtime/locale/ky.ts +++ b/src/runtime/locale/ky.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Маалымат жок' + }, + fileUpload: { + removeFile: '{filename} өчүрүү' } } }) diff --git a/src/runtime/locale/lb.ts b/src/runtime/locale/lb.ts index b5eb2c8e60..7ea63fd630 100644 --- a/src/runtime/locale/lb.ts +++ b/src/runtime/locale/lb.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Keng Donnéeën' + }, + fileUpload: { + removeFile: '{filename} ewechhuelen' } } }) diff --git a/src/runtime/locale/lt.ts b/src/runtime/locale/lt.ts index 4c215a3506..07daa2230c 100644 --- a/src/runtime/locale/lt.ts +++ b/src/runtime/locale/lt.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Nėra duomenų' + }, + fileUpload: { + removeFile: 'Pašalinti {filename}' } } }) diff --git a/src/runtime/locale/mn.ts b/src/runtime/locale/mn.ts index 2b02c1ec8b..83e2973ebe 100644 --- a/src/runtime/locale/mn.ts +++ b/src/runtime/locale/mn.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Мэдээлэл байхгүй' + }, + fileUpload: { + removeFile: '{filename} устгах' } } }) diff --git a/src/runtime/locale/ms.ts b/src/runtime/locale/ms.ts index b03bba8d59..ebe362efe9 100644 --- a/src/runtime/locale/ms.ts +++ b/src/runtime/locale/ms.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Tiada data' + }, + fileUpload: { + removeFile: 'Buang {filename}' } } }) diff --git a/src/runtime/locale/nb_no.ts b/src/runtime/locale/nb_no.ts index a34b92e098..4245155125 100644 --- a/src/runtime/locale/nb_no.ts +++ b/src/runtime/locale/nb_no.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Ingen data' + }, + fileUpload: { + removeFile: 'Fjern {filename}' } } }) diff --git a/src/runtime/locale/nl.ts b/src/runtime/locale/nl.ts index 9b815a0b41..629c1e8164 100644 --- a/src/runtime/locale/nl.ts +++ b/src/runtime/locale/nl.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Geen gegevens' + }, + fileUpload: { + removeFile: '{filename} verwijderen' } } }) diff --git a/src/runtime/locale/pl.ts b/src/runtime/locale/pl.ts index 4794b592af..0993bcb7b5 100644 --- a/src/runtime/locale/pl.ts +++ b/src/runtime/locale/pl.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Brak danych' + }, + fileUpload: { + removeFile: 'Usuń {filename}' } } }) diff --git a/src/runtime/locale/pt.ts b/src/runtime/locale/pt.ts index 318fb40a9c..75f8ead786 100644 --- a/src/runtime/locale/pt.ts +++ b/src/runtime/locale/pt.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Sem dados' + }, + fileUpload: { + removeFile: 'Remover {filename}' } } }) diff --git a/src/runtime/locale/pt_br.ts b/src/runtime/locale/pt_br.ts index ab31ad20e8..0dc71644c3 100644 --- a/src/runtime/locale/pt_br.ts +++ b/src/runtime/locale/pt_br.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Nenhum dado' + }, + fileUpload: { + removeFile: 'Remover {filename}' } } }) diff --git a/src/runtime/locale/ro.ts b/src/runtime/locale/ro.ts index 135fc5acbf..9dc95cbb0b 100644 --- a/src/runtime/locale/ro.ts +++ b/src/runtime/locale/ro.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Nu există date' + }, + fileUpload: { + removeFile: 'Elimină {filename}' } } }) diff --git a/src/runtime/locale/ru.ts b/src/runtime/locale/ru.ts index 57b3cb088c..2509db59a5 100644 --- a/src/runtime/locale/ru.ts +++ b/src/runtime/locale/ru.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Нет данных' + }, + fileUpload: { + removeFile: 'Удалить {filename}' } } }) diff --git a/src/runtime/locale/sk.ts b/src/runtime/locale/sk.ts index c781e94a05..59dcfa9810 100644 --- a/src/runtime/locale/sk.ts +++ b/src/runtime/locale/sk.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Žiadne dáta' + }, + fileUpload: { + removeFile: 'Odobrať {filename}' } } }) diff --git a/src/runtime/locale/sl.ts b/src/runtime/locale/sl.ts index 36ca9bf3eb..d8ed55fbd0 100644 --- a/src/runtime/locale/sl.ts +++ b/src/runtime/locale/sl.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Ni podatkov' + }, + fileUpload: { + removeFile: 'Odstrani {filename}' } } }) diff --git a/src/runtime/locale/sv.ts b/src/runtime/locale/sv.ts index e729289dbf..96f409b9a8 100644 --- a/src/runtime/locale/sv.ts +++ b/src/runtime/locale/sv.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Inga data' + }, + fileUpload: { + removeFile: 'Ta bort {filename}' } } }) diff --git a/src/runtime/locale/th.ts b/src/runtime/locale/th.ts index 42d4ee2d7b..65e6ec758d 100644 --- a/src/runtime/locale/th.ts +++ b/src/runtime/locale/th.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'ไม่มีข้อมูล' + }, + fileUpload: { + removeFile: 'ลบ {filename}' } } }) diff --git a/src/runtime/locale/tj.ts b/src/runtime/locale/tj.ts index 580040be42..e87d40db47 100644 --- a/src/runtime/locale/tj.ts +++ b/src/runtime/locale/tj.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Маълумот нест' + }, + fileUpload: { + removeFile: '{filename}-ро хориҷ кунед' } } }) diff --git a/src/runtime/locale/tr.ts b/src/runtime/locale/tr.ts index d5c0943cf2..ec485c68ee 100644 --- a/src/runtime/locale/tr.ts +++ b/src/runtime/locale/tr.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Veri yok' + }, + fileUpload: { + removeFile: '{filename} kaldır' } } }) diff --git a/src/runtime/locale/ug_cn.ts b/src/runtime/locale/ug_cn.ts index 8acb37c25c..97e78ccebc 100644 --- a/src/runtime/locale/ug_cn.ts +++ b/src/runtime/locale/ug_cn.ts @@ -54,6 +54,9 @@ export default defineLocale({ }, table: { noData: 'سانلىق مەلۇمات يوق' + }, + fileUpload: { + removeFile: '{filename} ئۆچۈرۈش' } } }) diff --git a/src/runtime/locale/uk.ts b/src/runtime/locale/uk.ts index 71530b6a72..13d859b572 100644 --- a/src/runtime/locale/uk.ts +++ b/src/runtime/locale/uk.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Немає даних' + }, + fileUpload: { + removeFile: 'Видалити {filename}' } } }) diff --git a/src/runtime/locale/ur.ts b/src/runtime/locale/ur.ts index 9c06b052bb..2e0d18d42c 100644 --- a/src/runtime/locale/ur.ts +++ b/src/runtime/locale/ur.ts @@ -54,6 +54,9 @@ export default defineLocale({ }, table: { noData: 'کوئی ڈیٹا نہیں' + }, + fileUpload: { + removeFile: '{filename} ہٹائیں' } } }) diff --git a/src/runtime/locale/uz.ts b/src/runtime/locale/uz.ts index d13dc3eb1c..b3fadb7cb1 100644 --- a/src/runtime/locale/uz.ts +++ b/src/runtime/locale/uz.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Maʼlumot yoʻq' + }, + fileUpload: { + removeFile: '{filename}ni oʻchirish' } } }) diff --git a/src/runtime/locale/vi.ts b/src/runtime/locale/vi.ts index 62b770b164..a87eb3adff 100644 --- a/src/runtime/locale/vi.ts +++ b/src/runtime/locale/vi.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: 'Không có dữ liệu' + }, + fileUpload: { + removeFile: 'Xóa {filename}' } } }) diff --git a/src/runtime/locale/zh_cn.ts b/src/runtime/locale/zh_cn.ts index a521e1d28f..55d767b388 100644 --- a/src/runtime/locale/zh_cn.ts +++ b/src/runtime/locale/zh_cn.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: '没有数据' + }, + fileUpload: { + removeFile: '删除 {filename}' } } }) diff --git a/src/runtime/locale/zh_tw.ts b/src/runtime/locale/zh_tw.ts index 2ebc83e4ee..a03ec88008 100644 --- a/src/runtime/locale/zh_tw.ts +++ b/src/runtime/locale/zh_tw.ts @@ -53,6 +53,9 @@ export default defineLocale({ }, table: { noData: '沒有資料' + }, + fileUpload: { + removeFile: '移除 {filename}' } } }) diff --git a/src/runtime/types/locale.ts b/src/runtime/types/locale.ts index 9ad8c1dc8b..4d6388e766 100644 --- a/src/runtime/types/locale.ts +++ b/src/runtime/types/locale.ts @@ -48,6 +48,9 @@ export type Messages = { table: { noData: string } + fileUpload: { + removeFile: string + } } export type Direction = 'ltr' | 'rtl' From 1910ba5013b8a2738a666eeb70770ff8a6bdf7fc Mon Sep 17 00:00:00 2001 From: J-michalek Date: Sat, 26 Jul 2025 15:30:06 +0200 Subject: [PATCH 2/3] fix(FileUpload): focus drop zone after file removal This should lead to better a11y as the user's focus will remain in the context of the FileUpload component. --- src/runtime/components/FileUpload.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/runtime/components/FileUpload.vue b/src/runtime/components/FileUpload.vue index f03e42c450..e35ff0c8e7 100644 --- a/src/runtime/components/FileUpload.vue +++ b/src/runtime/components/FileUpload.vue @@ -237,6 +237,8 @@ function removeFile(index?: number) { if (!props.multiple || index === undefined) { onUpdate([], true) + + dropzoneRef.value?.focus() return } @@ -244,6 +246,8 @@ function removeFile(index?: number) { files.splice(index, 1) onUpdate(files, true) + + dropzoneRef.value?.focus() } watch(modelValue, (newValue) => { From 0eacbf0bb713b33e93d8109a4aea275f8d33258e Mon Sep 17 00:00:00 2001 From: J-michalek Date: Sat, 26 Jul 2025 15:35:28 +0200 Subject: [PATCH 3/3] test(FileUpload): update snapshots --- .../__snapshots__/FileUpload-vue.spec.ts.snap | 68 +++++++++---------- .../__snapshots__/FileUpload.spec.ts.snap | 68 +++++++++---------- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/test/components/__snapshots__/FileUpload-vue.spec.ts.snap b/test/components/__snapshots__/FileUpload-vue.spec.ts.snap index 63ea306a39..ec943d78ad 100644 --- a/test/components/__snapshots__/FileUpload-vue.spec.ts.snap +++ b/test/components/__snapshots__/FileUpload-vue.spec.ts.snap @@ -26,7 +26,7 @@ exports[`FileUpload > renders with actions slot correctly 1`] = `
- @@ -105,7 +105,7 @@ exports[`FileUpload > renders with description slot correctly 1`] = `
- @@ -169,7 +169,7 @@ exports[`FileUpload > renders with file-leading slot correctly 1`] = `
-
File leading slot
@@ -189,7 +189,7 @@ exports[`FileUpload > renders with file-name slot correctly 1`] = `
- @@ -210,7 +210,7 @@ exports[`FileUpload > renders with file-size slot correctly 1`] = `
- @@ -249,7 +249,7 @@ exports[`FileUpload > renders with fileDelete correctly 1`] = `
- @@ -270,7 +270,7 @@ exports[`FileUpload > renders with fileDeleteIcon correctly 1`] = `
- @@ -291,7 +291,7 @@ exports[`FileUpload > renders with fileIcon correctly 1`] = `
- @@ -326,7 +326,7 @@ exports[`FileUpload > renders with files-bottom slot correctly 1`] = `
- @@ -346,7 +346,7 @@ exports[`FileUpload > renders with files-top slot correctly 1`] = `
Files top slot
- @@ -409,7 +409,7 @@ exports[`FileUpload > renders with label slot correctly 1`] = `
- @@ -430,7 +430,7 @@ exports[`FileUpload > renders with layout grid correctly 1`] = `
- @@ -444,7 +444,7 @@ exports[`FileUpload > renders with layout grid multiple correctly 1`] = `
- @@ -468,7 +468,7 @@ exports[`FileUpload > renders with layout list correctly 1`] = `
-
file.txt0B
@@ -489,7 +489,7 @@ exports[`FileUpload > renders with layout list multiple correctly 1`] = `
-
file.txt0B
@@ -510,7 +510,7 @@ exports[`FileUpload > renders with leading slot correctly 1`] = `
- @@ -531,7 +531,7 @@ exports[`FileUpload > renders with modelValue correctly 1`] = `
- @@ -545,7 +545,7 @@ exports[`FileUpload > renders with multiple correctly 1`] = `
- @@ -590,7 +590,7 @@ exports[`FileUpload > renders with position inside correctly 1`] = `
- @@ -607,7 +607,7 @@ exports[`FileUpload > renders with position inside multiple correctly 1`] = `
- @@ -631,7 +631,7 @@ exports[`FileUpload > renders with position outside correctly 1`] = `
- @@ -645,7 +645,7 @@ exports[`FileUpload > renders with position outside multiple correctly 1`] = `
- @@ -697,7 +697,7 @@ exports[`FileUpload > renders with size lg correctly 1`] = `
- @@ -715,7 +715,7 @@ exports[`FileUpload > renders with size lg variant button correctly 1`] = `
- @@ -736,7 +736,7 @@ exports[`FileUpload > renders with size md correctly 1`] = `
- @@ -754,7 +754,7 @@ exports[`FileUpload > renders with size md variant button correctly 1`] = `
- @@ -775,7 +775,7 @@ exports[`FileUpload > renders with size sm correctly 1`] = `
- @@ -793,7 +793,7 @@ exports[`FileUpload > renders with size sm variant button correctly 1`] = `
- @@ -814,7 +814,7 @@ exports[`FileUpload > renders with size xl correctly 1`] = `
- @@ -832,7 +832,7 @@ exports[`FileUpload > renders with size xl variant button correctly 1`] = `
- @@ -853,7 +853,7 @@ exports[`FileUpload > renders with size xs correctly 1`] = `
- @@ -871,7 +871,7 @@ exports[`FileUpload > renders with size xs variant button correctly 1`] = `
- @@ -906,7 +906,7 @@ exports[`FileUpload > renders with variant area correctly 1`] = `
- @@ -924,7 +924,7 @@ exports[`FileUpload > renders with variant button correctly 1`] = `
- diff --git a/test/components/__snapshots__/FileUpload.spec.ts.snap b/test/components/__snapshots__/FileUpload.spec.ts.snap index 00cba7098b..2034ad2636 100644 --- a/test/components/__snapshots__/FileUpload.spec.ts.snap +++ b/test/components/__snapshots__/FileUpload.spec.ts.snap @@ -26,7 +26,7 @@ exports[`FileUpload > renders with actions slot correctly 1`] = `
- @@ -105,7 +105,7 @@ exports[`FileUpload > renders with description slot correctly 1`] = `
- @@ -169,7 +169,7 @@ exports[`FileUpload > renders with file-leading slot correctly 1`] = `
-
File leading slot
@@ -189,7 +189,7 @@ exports[`FileUpload > renders with file-name slot correctly 1`] = `
- @@ -210,7 +210,7 @@ exports[`FileUpload > renders with file-size slot correctly 1`] = `
- @@ -249,7 +249,7 @@ exports[`FileUpload > renders with fileDelete correctly 1`] = `
- @@ -270,7 +270,7 @@ exports[`FileUpload > renders with fileDeleteIcon correctly 1`] = `
- @@ -291,7 +291,7 @@ exports[`FileUpload > renders with fileIcon correctly 1`] = `
- @@ -326,7 +326,7 @@ exports[`FileUpload > renders with files-bottom slot correctly 1`] = `
- @@ -346,7 +346,7 @@ exports[`FileUpload > renders with files-top slot correctly 1`] = `
Files top slot
- @@ -409,7 +409,7 @@ exports[`FileUpload > renders with label slot correctly 1`] = `
- @@ -430,7 +430,7 @@ exports[`FileUpload > renders with layout grid correctly 1`] = `
- @@ -444,7 +444,7 @@ exports[`FileUpload > renders with layout grid multiple correctly 1`] = `
- @@ -468,7 +468,7 @@ exports[`FileUpload > renders with layout list correctly 1`] = `
-
file.txt0B
@@ -489,7 +489,7 @@ exports[`FileUpload > renders with layout list multiple correctly 1`] = `
-
file.txt0B
@@ -510,7 +510,7 @@ exports[`FileUpload > renders with leading slot correctly 1`] = `
- @@ -531,7 +531,7 @@ exports[`FileUpload > renders with modelValue correctly 1`] = `
- @@ -545,7 +545,7 @@ exports[`FileUpload > renders with multiple correctly 1`] = `
- @@ -590,7 +590,7 @@ exports[`FileUpload > renders with position inside correctly 1`] = `
- @@ -607,7 +607,7 @@ exports[`FileUpload > renders with position inside multiple correctly 1`] = `
- @@ -631,7 +631,7 @@ exports[`FileUpload > renders with position outside correctly 1`] = `
- @@ -645,7 +645,7 @@ exports[`FileUpload > renders with position outside multiple correctly 1`] = `
- @@ -697,7 +697,7 @@ exports[`FileUpload > renders with size lg correctly 1`] = `
- @@ -715,7 +715,7 @@ exports[`FileUpload > renders with size lg variant button correctly 1`] = `
- @@ -736,7 +736,7 @@ exports[`FileUpload > renders with size md correctly 1`] = `
- @@ -754,7 +754,7 @@ exports[`FileUpload > renders with size md variant button correctly 1`] = `
- @@ -775,7 +775,7 @@ exports[`FileUpload > renders with size sm correctly 1`] = `
- @@ -793,7 +793,7 @@ exports[`FileUpload > renders with size sm variant button correctly 1`] = `
- @@ -814,7 +814,7 @@ exports[`FileUpload > renders with size xl correctly 1`] = `
- @@ -832,7 +832,7 @@ exports[`FileUpload > renders with size xl variant button correctly 1`] = `
- @@ -853,7 +853,7 @@ exports[`FileUpload > renders with size xs correctly 1`] = `
- @@ -871,7 +871,7 @@ exports[`FileUpload > renders with size xs variant button correctly 1`] = `
- @@ -906,7 +906,7 @@ exports[`FileUpload > renders with variant area correctly 1`] = `
- @@ -924,7 +924,7 @@ exports[`FileUpload > renders with variant button correctly 1`] = `
-