@rxflow/base
Version:
BaseFlow - 核心 Flow 组件库
27 lines • 1.07 kB
JavaScript
import { Handle } from '@xyflow/react';
import { Position } from '@xyflow/system';
import { useNodeInitialize } from "../..";
import { jsx as _jsx } from "react/jsx-runtime";
import { Fragment as _Fragment } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
export function DefaultNode(_ref) {
var id = _ref.id,
data = _ref.data,
isConnectable = _ref.isConnectable,
_ref$targetPosition = _ref.targetPosition,
targetPosition = _ref$targetPosition === void 0 ? Position.Top : _ref$targetPosition,
_ref$sourcePosition = _ref.sourcePosition,
sourcePosition = _ref$sourcePosition === void 0 ? Position.Bottom : _ref$sourcePosition;
useNodeInitialize(id);
return /*#__PURE__*/_jsxs(_Fragment, {
children: [/*#__PURE__*/_jsx(Handle, {
type: "target",
position: targetPosition,
isConnectable: isConnectable
}), data === null || data === void 0 ? void 0 : data.label, /*#__PURE__*/_jsx(Handle, {
type: "source",
position: sourcePosition,
isConnectable: isConnectable
})]
});
}