new mixed input

This commit is contained in:
JzoNg
2025-06-16 11:10:18 +08:00
parent f6eb37f488
commit 0e550e45c7
7 changed files with 44 additions and 297 deletions

View File

@ -7,7 +7,7 @@ import {
} from '@remixicon/react'
import Tooltip from '@/app/components/base/tooltip'
import Switch from '@/app/components/base/switch'
import MixedInput from '@/app/components/workflow/nodes/_base/components/input-support-select-var'
import MixedVariableTextInput from '@/app/components/workflow/nodes/tool/components/mixed-variable-text-input'
import Input from '@/app/components/base/input'
import FormInputTypeSwitch from '@/app/components/workflow/nodes/_base/components/form-input-type-switch'
import FormInputBoolean from '@/app/components/workflow/nodes/_base/components/form-input-boolean'
@ -60,18 +60,6 @@ const ReasoningConfigForm: React.FC<Props> = ({
return VarKindType.mixed
}
const [inputsIsFocus, setInputsIsFocus] = useState<Record<string, boolean>>({})
const handleInputFocus = useCallback((variable: string) => {
return (value: boolean) => {
setInputsIsFocus((prev) => {
return {
...prev,
[variable]: value,
}
})
}
}, [])
const handleAutomatic = (key: string, val: any, type: FormTypeEnum) => {
onChange({
...value,
@ -259,15 +247,11 @@ const ReasoningConfigForm: React.FC<Props> = ({
<FormInputTypeSwitch value={varInput?.type || VarKindType.constant} onChange={handleTypeChange(variable, defaultValue)}/>
)}
{isString && (
<MixedInput
className={cn(inputsIsFocus[variable] ? 'border-gray-300 bg-gray-50 shadow-xs' : 'border-gray-100 bg-gray-100', 'grow rounded-lg border px-3 py-[6px]')}
<MixedVariableTextInput
value={varInput?.value as string || ''}
onChange={handleValueChange(variable, type)}
nodesOutputVars={nodeOutputVars}
availableNodes={availableNodes}
onFocusChange={handleInputFocus(variable)}
placeholder={t('workflow.nodes.http.insertVarPlaceholder')!}
placeholderClassName='!leading-[21px]'
/>
)}
{isNumber && isConstant && (