UNPKG

quantumai-design-system

Version:

퀀텀에이아이의 디자인 시스템

41 lines (40 loc) 1.79 kB
var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import { jsx as _jsx } from "@emotion/react/jsx-runtime"; import { forwardRef } from 'react'; import InputNumber from './InputNumber'; import InputValidation from './InputValidation'; import InputBasic from './InputBasic'; var SwitchInput = forwardRef(function (_a, ref) { var value = _a.value, id = _a.id, type = _a.type, onIsValue = _a.onIsValue, onValue = _a.onValue, props = __rest(_a, ["value", "id", "type", "onIsValue", "onValue"]); var sharedProps = { value: value, id: id, type: type, onIsValue: onIsValue, onValue: onValue }; switch (type) { case 'number': return _jsx(InputNumber, __assign({ ref: ref }, sharedProps, props)); case 'validation': return _jsx(InputValidation, __assign({ ref: ref }, sharedProps, props)); default: return _jsx(InputBasic, __assign({ ref: ref }, sharedProps, props)); } }); export default SwitchInput;