|
|
@ -33,6 +33,7 @@ const { |
|
|
description, |
|
|
description, |
|
|
disabled, |
|
|
disabled, |
|
|
disabledOnChangeListener, |
|
|
disabledOnChangeListener, |
|
|
|
|
|
emptyStateValue, |
|
|
fieldName, |
|
|
fieldName, |
|
|
formFieldProps, |
|
|
formFieldProps, |
|
|
label, |
|
|
label, |
|
|
@ -55,7 +56,7 @@ const formApi = formRenderProps.form; |
|
|
|
|
|
|
|
|
const isInValid = computed(() => errors.value?.length > 0); |
|
|
const isInValid = computed(() => errors.value?.length > 0); |
|
|
|
|
|
|
|
|
const fieldComponent = computed(() => { |
|
|
const FieldComponent = computed(() => { |
|
|
const finalComponent = isString(component) |
|
|
const finalComponent = isString(component) |
|
|
? componentMap.value[component] |
|
|
? componentMap.value[component] |
|
|
: component; |
|
|
: component; |
|
|
@ -213,7 +214,7 @@ function fieldBindEvent(slotProps: Record<string, any>) { |
|
|
if (bindEventField) { |
|
|
if (bindEventField) { |
|
|
return { |
|
|
return { |
|
|
[`onUpdate:${bindEventField}`]: handler, |
|
|
[`onUpdate:${bindEventField}`]: handler, |
|
|
[bindEventField]: value, |
|
|
[bindEventField]: value === undefined ? emptyStateValue : value, |
|
|
onChange: disabledOnChangeListener |
|
|
onChange: disabledOnChangeListener |
|
|
? undefined |
|
|
? undefined |
|
|
: (e: Record<string, any>) => { |
|
|
: (e: Record<string, any>) => { |
|
|
@ -300,7 +301,7 @@ function autofocus() { |
|
|
}" |
|
|
}" |
|
|
> |
|
|
> |
|
|
<component |
|
|
<component |
|
|
:is="fieldComponent" |
|
|
:is="FieldComponent" |
|
|
ref="fieldComponentRef" |
|
|
ref="fieldComponentRef" |
|
|
:class="{ |
|
|
:class="{ |
|
|
'border-destructive focus:border-destructive hover:border-destructive/80 focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]': |
|
|
'border-destructive focus:border-destructive hover:border-destructive/80 focus:shadow-[0_0_0_2px_rgba(255,38,5,0.06)]': |
|
|
|