79 lines
1.9 KiB
TypeScript
79 lines
1.9 KiB
TypeScript
/**
|
|
* V2Input 컴포넌트 정의
|
|
*
|
|
* 텍스트, 숫자, 비밀번호 등 다양한 입력 타입을 지원하는 통합 입력 컴포넌트
|
|
*/
|
|
|
|
import { ComponentCategory } from "@/types/component";
|
|
import { createComponentDefinition } from "../../utils/createComponentDefinition";
|
|
import { V2InputConfigPanel } from "@/components/v2/config-panels/V2InputConfigPanel";
|
|
import { V2Input } from "@/components/v2/V2Input";
|
|
|
|
export const V2InputDefinition = createComponentDefinition({
|
|
id: "v2-input",
|
|
name: "V2 입력",
|
|
description: "텍스트, 숫자, 비밀번호 등 다양한 입력 타입 지원",
|
|
category: ComponentCategory.INPUT,
|
|
webType: "text",
|
|
version: "2.0.0",
|
|
component: V2Input,
|
|
|
|
// 기본 속성
|
|
defaultProps: {
|
|
config: {
|
|
inputType: "text",
|
|
placeholder: "",
|
|
required: false,
|
|
readonly: false,
|
|
disabled: false,
|
|
maxLength: undefined,
|
|
minLength: undefined,
|
|
pattern: undefined,
|
|
showCounter: false,
|
|
},
|
|
},
|
|
|
|
// 설정 스키마
|
|
configSchema: {
|
|
inputType: {
|
|
type: "select",
|
|
label: "입력 타입",
|
|
options: [
|
|
{ value: "text", label: "텍스트" },
|
|
{ value: "number", label: "숫자" },
|
|
{ value: "password", label: "비밀번호" },
|
|
{ value: "email", label: "이메일" },
|
|
{ value: "tel", label: "전화번호" },
|
|
{ value: "url", label: "URL" },
|
|
{ value: "textarea", label: "여러 줄 텍스트" },
|
|
],
|
|
},
|
|
placeholder: {
|
|
type: "text",
|
|
label: "플레이스홀더",
|
|
},
|
|
required: {
|
|
type: "boolean",
|
|
label: "필수 입력",
|
|
},
|
|
readonly: {
|
|
type: "boolean",
|
|
label: "읽기 전용",
|
|
},
|
|
},
|
|
|
|
// 이벤트
|
|
events: ["onChange", "onBlur", "onFocus"],
|
|
|
|
// 아이콘
|
|
icon: "TextCursorInput",
|
|
|
|
// 태그
|
|
tags: ["input", "text", "number", "v2"],
|
|
|
|
// 설정 패널
|
|
configPanel: V2InputConfigPanel,
|
|
});
|
|
|
|
export default V2InputDefinition;
|