form field

This commit is contained in:
JzoNg 2025-08-12 14:17:08 +08:00
parent bdf1e9ed3b
commit ebbed8f863
2 changed files with 8 additions and 0 deletions

View File

@ -3,6 +3,7 @@ import { Markdown } from '@/app/components/base/markdown'
import Select from '@/app/components/base/select'
import Textarea from '@/app/components/base/textarea'
import Input from '@/app/components/base/input'
import FormInputBoolean from '@/app/components/workflow/nodes/_base/components/form-input-boolean'
import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader'
import { getProcessedFiles } from '@/app/components/base/file-uploader/utils'
import { DEFAULT_VALUE_MAX_LEN } from '@/config'
@ -73,6 +74,12 @@ const ContentItem = ({ content, formInputFields, inputs, onInputChange }: Props)
onChange={(e) => { onInputChange(fieldName, e.target.value) }}
/>
)}
{formInputField.type === 'checkbox' && (
<FormInputBoolean
value={inputs[fieldName] as boolean}
onChange={value => onInputChange(fieldName, value)}
/>
)}
{formInputField.type === 'file' && (
<FileUploaderInAttachmentWrapper
onChange={(files) => { onInputChange(fieldName, getProcessedFiles(files)[0]) }}

View File

@ -187,6 +187,7 @@ export enum InputVarType {
singleFile = 'file',
multiFiles = 'file-list',
loop = 'loop', // loop input
checkbox = 'checkbox',
}
export type InputVar = {