UNPKG

@szzbmy/lowcode-cli

Version:

🐇 lowcode-cli is an efficient cli tool for Rabbitpre plugin component secondary development. ❤️

35 lines (34 loc) 1.45 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.InteractiveGenerator = exports.GENERATOR_TYPE = void 0; const react_1 = __importDefault(require("react")); const confirm_input_1 = require("./confirm-input"); const input_text_1 = require("./input-text"); var GENERATOR_TYPE; (function (GENERATOR_TYPE) { GENERATOR_TYPE[GENERATOR_TYPE["CONFIRM"] = 0] = "CONFIRM"; GENERATOR_TYPE[GENERATOR_TYPE["TEXT_INPUT"] = 1] = "TEXT_INPUT"; GENERATOR_TYPE[GENERATOR_TYPE["SELECT"] = 2] = "SELECT"; })(GENERATOR_TYPE = exports.GENERATOR_TYPE || (exports.GENERATOR_TYPE = {})); /** * @param {GeneratorType} props.type 指定交互类型 * @param {Record<keyof, any>} props.options 对应交互组件参数 */ const InteractiveGenerator = (props) => { let interactive = null; switch (props.type) { case GENERATOR_TYPE.CONFIRM: interactive = (react_1.default.createElement(confirm_input_1.IncComfirnInput, { ...props.options })); break; case GENERATOR_TYPE.TEXT_INPUT: interactive = react_1.default.createElement(input_text_1.IncTextInput, { ...props.options }); break; default: interactive = null; } return interactive; }; exports.InteractiveGenerator = InteractiveGenerator;