|
|
|
@ -114,7 +114,7 @@ const Form: FC<FormProps> = ({
|
|
|
|
validated={validatedSuccess}
|
|
|
|
validated={validatedSuccess}
|
|
|
|
placeholder={placeholder?.[language] || placeholder?.en_US}
|
|
|
|
placeholder={placeholder?.[language] || placeholder?.en_US}
|
|
|
|
disabled={disabed}
|
|
|
|
disabled={disabed}
|
|
|
|
type={formSchema.type === FormTypeEnum.textNumber ? 'number' : 'text'}
|
|
|
|
type={formSchema.type === FormTypeEnum.textNumber ? 'number' : formSchema.type === FormTypeEnum.secretInput ? 'password' : 'text'}
|
|
|
|
{...(formSchema.type === FormTypeEnum.textNumber ? { min: (formSchema as CredentialFormSchemaNumberInput).min, max: (formSchema as CredentialFormSchemaNumberInput).max } : {})}
|
|
|
|
{...(formSchema.type === FormTypeEnum.textNumber ? { min: (formSchema as CredentialFormSchemaNumberInput).min, max: (formSchema as CredentialFormSchemaNumberInput).max } : {})}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
{fieldMoreInfo?.(formSchema)}
|
|
|
|
{fieldMoreInfo?.(formSchema)}
|
|
|
|
@ -229,6 +229,7 @@ const Form: FC<FormProps> = ({
|
|
|
|
variable,
|
|
|
|
variable,
|
|
|
|
label,
|
|
|
|
label,
|
|
|
|
show_on,
|
|
|
|
show_on,
|
|
|
|
|
|
|
|
required,
|
|
|
|
} = formSchema as CredentialFormSchemaRadio
|
|
|
|
} = formSchema as CredentialFormSchemaRadio
|
|
|
|
|
|
|
|
|
|
|
|
if (show_on.length && !show_on.every(showOnItem => value[showOnItem.variable] === showOnItem.value))
|
|
|
|
if (show_on.length && !show_on.every(showOnItem => value[showOnItem.variable] === showOnItem.value))
|
|
|
|
@ -239,11 +240,16 @@ const Form: FC<FormProps> = ({
|
|
|
|
<div className='flex items-center justify-between py-2 text-sm text-gray-900'>
|
|
|
|
<div className='flex items-center justify-between py-2 text-sm text-gray-900'>
|
|
|
|
<div className='flex items-center space-x-2'>
|
|
|
|
<div className='flex items-center space-x-2'>
|
|
|
|
<span className={cn(fieldLabelClassName, 'py-2 text-sm text-gray-900')}>{label[language] || label.en_US}</span>
|
|
|
|
<span className={cn(fieldLabelClassName, 'py-2 text-sm text-gray-900')}>{label[language] || label.en_US}</span>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
required && (
|
|
|
|
|
|
|
|
<span className='ml-1 text-red-500'>*</span>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
}
|
|
|
|
{tooltipContent}
|
|
|
|
{tooltipContent}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<Radio.Group
|
|
|
|
<Radio.Group
|
|
|
|
className='flex items-center'
|
|
|
|
className='flex items-center'
|
|
|
|
value={value[variable] ? 1 : 0}
|
|
|
|
value={value[variable] === null ? undefined : (value[variable] ? 1 : 0)}
|
|
|
|
onChange={val => handleFormChange(variable, val === 1)}
|
|
|
|
onChange={val => handleFormChange(variable, val === 1)}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<Radio value={1} className='!mr-1'>True</Radio>
|
|
|
|
<Radio value={1} className='!mr-1'>True</Radio>
|
|
|
|
|