File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 import { Languages } from " lucide-vue-next" ;
33 import { SelectTrigger , SelectValue } from " @/components/ui/select/index.js" ;
44 import { __ } from " @/utils/i18n" ;
5+
6+ defineProps <{
7+ errorCount? : number ,
8+ }>();
59 </script >
610
711<template >
8- <SelectTrigger class =" w-auto h-8" :aria-label =" $attrs['aria-label'] ?? __('sharp::action_bar.locale_selector.label')" >
12+ <SelectTrigger class =" w-auto gap-0 h-8" :aria-label =" $attrs['aria-label'] ?? __('sharp::action_bar.locale_selector.label')" >
913 <Languages class =" size-3 mr-2.5 opacity-50" />
1014 <SelectValue class =" uppercase text-xs" placeholder =" -" />
15+ <template v-if =" errorCount " >
16+ <div class =" ml-1.5 -mr-0.5 grid place-content-center text-[.625rem]/2.5 px-1 h-3.5 min-w-3.5 bg-destructive rounded-full text-destructive-foreground font-semibold" >
17+ {{ errorCount }}
18+ </div >
19+ </template >
1120 </SelectTrigger >
1221</template >
Original file line number Diff line number Diff line change @@ -18,14 +18,17 @@ const form = useParentForm();
1818 class =" ml-auto w-auto border-transparent hover:border-input aria-expanded:border-input"
1919 :class =" { '-my-2': isFieldLayout }"
2020 :aria-label =" __('sharp::form.field_locale_selector.aria_label', { field_label:field.label })"
21+ :error-count =" form.fieldLocalesContainingError(fieldErrorKey).length"
2122 />
2223 <SelectContent @close-auto-focus =" emit('close-auto-focus', $event)" >
2324 <template v-for =" formLocale in form .locales " :key =" formLocale " >
2425 <SelectItem :value =" formLocale" >
2526 <div class =" flex items-center" >
26- <span class =" uppercase text-xs" >{{ formLocale }}</span >
27- <template v-if =" form .fieldLocalesContainingError (fieldErrorKey ).includes (formLocale )" >
28- <svg class =" ml-1 size-2 fill-destructive" viewBox =" 0 0 8 8" aria-hidden =" true" >
27+ <span class =" uppercase text-xs" >
28+ {{ formLocale }}
29+ </span >
30+ <template v-if =" form .fieldHasError (field , fieldErrorKey , formLocale )" >
31+ <svg class =" ml-1 size-1.5 fill-destructive" viewBox =" 0 0 8 8" aria-hidden =" true" >
2932 <circle cx =" 4" cy =" 4" r =" 3" />
3033 </svg >
3134 </template >
Original file line number Diff line number Diff line change 412412 {{ formLocale }}
413413 </div >
414414 <template v-if =" form .fieldHasError (field , fieldErrorKey , formLocale )" >
415- <svg class =" absolute top-1/2 right-2.5 -translate-y-1/2 translate-x-1/2 size-1.5 fill-destructive opacity-75 group-data-[state=active]/tab:opacity-100 " viewBox =" 0 0 8 8" aria-hidden =" true" >
415+ <svg class =" absolute top-1/2 right-2.5 -translate-y-1/2 translate-x-1/2 size-2 fill-destructive" viewBox =" 0 0 8 8" aria-hidden =" true" >
416416 <circle cx =" 4" cy =" 4" r =" 3" />
417417 </svg >
418418 </template >
You can’t perform that action at this time.
0 commit comments