UNPKG

@difizen/ai-flow

Version:

Scalable, out-of-the-box, agent-oriented flow

57 lines 2 kB
import { Input } from 'antd'; import { memo } from 'react'; import { CascaderInNode } from "../AIBasic/CascaderInNode/index"; import { SelectInNode } from "../AIBasic/SelectInNode/index"; import React from 'react'; import { jsx as _jsx } from "react/jsx-runtime"; import { jsxs as _jsxs } from "react/jsx-runtime"; export var ReferenceSelectRaw = function ReferenceSelectRaw(props) { var value = props.value, _onChange = props.onChange, refOptions = props.refOptions; return /*#__PURE__*/_jsxs("div", { className: "flex gap-2 w-[100%]", children: [/*#__PURE__*/_jsx(SelectInNode, { value: (value === null || value === void 0 ? void 0 : value.type) || 'reference', style: { width: '30%' }, onChange: function onChange(val) { return _onChange === null || _onChange === void 0 ? void 0 : _onChange({ type: val }); }, options: [{ label: '引用', value: 'reference' }, { label: '值', value: 'value' }] }), (value === null || value === void 0 ? void 0 : value.type) === 'value' ? /*#__PURE__*/_jsx(Input, { style: { width: '70%' }, value: value === null || value === void 0 ? void 0 : value.content, onChange: function onChange(e) { return _onChange === null || _onChange === void 0 ? void 0 : _onChange({ type: value.type, content: e.target.value }); } }) : /*#__PURE__*/_jsx(CascaderInNode, { style: { width: '70%' }, value: (value === null || value === void 0 ? void 0 : value.content) || [], onChange: function onChange(val) { return _onChange === null || _onChange === void 0 ? void 0 : _onChange({ type: (value === null || value === void 0 ? void 0 : value.type) || 'reference', content: val }); }, options: refOptions })] }); }; export var ReferenceSelect = /*#__PURE__*/memo(ReferenceSelectRaw);