44
44
45
45
<div v-if =" errorField" class =" absolute inset-y-0 right-0 pr-3 flex items-center pointer-events-none" >
46
46
<svg class =" h-5 w-5 text-red-500" xmlns =" http://www.w3.org/2000/svg" viewBox =" 0 0 20 20" fill =" currentColor" aria-hidden =" true" >
47
- <path fill-rule =" evenodd" d =" M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule =" evenodd" />
47
+ <path fill-rule =" evenodd" d =" M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z" clip-rule =" evenodd" />
48
48
</svg >
49
49
</div >
50
50
</div >
@@ -65,6 +65,7 @@ import type { ApiState } from "@/types"
65
65
import type { TagInputProps , TagInputEmits } from ' @/components/types'
66
66
import { $1 , errorResponse , humanize , map , omit , toPascalCase , trimEnd } from " @servicestack/client"
67
67
import { computed , inject , ref } from " vue"
68
+ import { filterClass } from " ./css" ;
68
69
69
70
const props = withDefaults (defineProps <TagInputProps >(), {
70
71
modelValue : () => [],
@@ -104,10 +105,10 @@ const useLabel = computed(() => props.label ?? humanize(toPascalCase(props.id)))
104
105
let ctx: ApiState | undefined = inject (' ApiState' , undefined )
105
106
const errorField = computed (() => errorResponse .call ({ responseStatus: props .status ?? ctx ?.error .value }, props .id ))
106
107
107
- const cls = computed (() => [' w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none' , errorField .value
108
+ const cls = computed (() => filterClass ( [' w-full cursor-text flex flex-wrap sm:text-sm rounded-md dark:text-white dark:bg-gray-900 border focus-within:border-transparent focus-within:ring-1 focus-within:outline-none' , errorField .value
108
109
? ' pr-10 border-red-300 text-red-900 placeholder-red-300 focus-within:outline-none focus-within:ring-red-500 focus-within:border-red-500'
109
110
: ' shadow-sm border-gray-300 dark:border-gray-600 focus-within:ring-indigo-500 focus-within:border-indigo-500'
110
- , props .inputClass ])
111
+ , props .inputClass ], ' TagInput ' , props . filterClass ) )
111
112
112
113
const removeTag = (tag : string ) => updateValue (modelArray .value .filter (x => x != tag ))
113
114
0 commit comments