|
|
|
@ -11,6 +11,7 @@ |
|
|
|
export let defaultValue |
|
|
|
export let type |
|
|
|
export let disabled = false |
|
|
|
export let validation |
|
|
|
|
|
|
|
// Get contexts |
|
|
|
const formContext = getContext("form") |
|
|
|
@ -21,7 +22,12 @@ |
|
|
|
// Register field with form |
|
|
|
const formApi = formContext?.formApi |
|
|
|
const labelPosition = fieldGroupContext?.labelPosition || "above" |
|
|
|
const formField = formApi?.registerField(field, defaultValue, disabled) |
|
|
|
const formField = formApi?.registerField( |
|
|
|
field, |
|
|
|
defaultValue, |
|
|
|
disabled, |
|
|
|
validation |
|
|
|
) |
|
|
|
|
|
|
|
// Expose field properties to parent component |
|
|
|
fieldState = formField?.fieldState |
|
|
|
|