/** * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates * SPDX-License-Identifier: MIT */ import React from 'react'; import { I18n } from '@flowgram.ai/editor'; import { Button, IconButton } from '@douyinfe/semi-ui'; import { IconDelete, IconPlus } from '@douyinfe/semi-icons'; import { IFlowConstantRefValue, IFlowValue } from '@/shared'; import { useObjectList } from '@/hooks'; import { InjectDynamicValueInput } from '@/components/dynamic-value-input'; import { BlurInput } from '@/components/blur-input'; import { PropsType } from './types'; import './styles.css'; export function InputsValues({ value, onChange, style, readonly, constantProps, schema, hasError, }: PropsType) { const { list, updateKey, updateValue, remove, add } = useObjectList({ value, onChange, sortIndexKey: 'extra.index', }); return (
{list.map((item) => (
updateKey(item.id, v)} placeholder={I18n.t('Input Key')} /> updateValue(item.id, v)} schema={schema} hasError={hasError} constantProps={{ ...constantProps, strategies: [...(constantProps?.strategies || [])], }} /> } size="small" onClick={() => remove(item.id)} />
))}
); }