2025-12-19 15:44:38 +09:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-28 17:36:19 +09:00
|
|
|
* V2 컴포넌트 레지스트리 등록
|
2026-01-29 14:45:04 +09:00
|
|
|
*
|
2026-01-28 17:36:19 +09:00
|
|
|
* 9개의 V2 컴포넌트를 ComponentRegistry에 등록합니다.
|
2025-12-19 15:44:38 +09:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { ComponentRegistry } from "@/lib/registry/ComponentRegistry";
|
|
|
|
|
import { ComponentDefinition, ComponentCategory } from "@/types/component";
|
|
|
|
|
import { WebType } from "@/types/screen";
|
|
|
|
|
|
|
|
|
|
// 실제 컴포넌트 import
|
2026-01-28 17:36:19 +09:00
|
|
|
import { V2Input } from "./V2Input";
|
|
|
|
|
import { V2Select } from "./V2Select";
|
|
|
|
|
import { V2Date } from "./V2Date";
|
|
|
|
|
import { V2List } from "./V2List";
|
|
|
|
|
import { V2Layout } from "./V2Layout";
|
|
|
|
|
import { V2Group } from "./V2Group";
|
|
|
|
|
import { V2Media } from "./V2Media";
|
|
|
|
|
import { V2Biz } from "./V2Biz";
|
|
|
|
|
import { V2Hierarchy } from "./V2Hierarchy";
|
2026-01-28 17:58:18 +09:00
|
|
|
import { V2Repeater } from "./V2Repeater";
|
2025-12-19 15:44:38 +09:00
|
|
|
|
|
|
|
|
// 설정 패널 import
|
2026-01-28 17:36:19 +09:00
|
|
|
import { V2InputConfigPanel } from "./config-panels/V2InputConfigPanel";
|
|
|
|
|
import { V2SelectConfigPanel } from "./config-panels/V2SelectConfigPanel";
|
|
|
|
|
import { V2DateConfigPanel } from "./config-panels/V2DateConfigPanel";
|
|
|
|
|
import { V2ListConfigPanel } from "./config-panels/V2ListConfigPanel";
|
|
|
|
|
import { V2LayoutConfigPanel } from "./config-panels/V2LayoutConfigPanel";
|
|
|
|
|
import { V2GroupConfigPanel } from "./config-panels/V2GroupConfigPanel";
|
|
|
|
|
import { V2MediaConfigPanel } from "./config-panels/V2MediaConfigPanel";
|
|
|
|
|
import { V2BizConfigPanel } from "./config-panels/V2BizConfigPanel";
|
|
|
|
|
import { V2HierarchyConfigPanel } from "./config-panels/V2HierarchyConfigPanel";
|
2026-01-28 17:58:18 +09:00
|
|
|
import { V2RepeaterConfigPanel } from "./config-panels/V2RepeaterConfigPanel";
|
2025-12-19 15:44:38 +09:00
|
|
|
|
2026-01-28 17:36:19 +09:00
|
|
|
// V2 컴포넌트 정의
|
|
|
|
|
const v2ComponentDefinitions: ComponentDefinition[] = [
|
2025-12-19 15:44:38 +09:00
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-input",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 입력",
|
|
|
|
|
description: "텍스트, 숫자, 비밀번호, 슬라이더, 컬러 등 다양한 입력 타입을 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "text" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Input as any,
|
|
|
|
|
tags: ["input", "text", "number", "password", "slider", "color", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 200, height: 40 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2InputConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
inputType: "text",
|
|
|
|
|
format: "none",
|
|
|
|
|
placeholder: "",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-select",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 선택",
|
|
|
|
|
description: "드롭다운, 라디오, 체크박스, 태그, 토글 등 다양한 선택 방식을 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "select" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Select as any,
|
|
|
|
|
tags: ["select", "dropdown", "radio", "checkbox", "toggle", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 200, height: 40 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2SelectConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
mode: "dropdown",
|
|
|
|
|
source: "static",
|
|
|
|
|
options: [],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-date",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 날짜",
|
|
|
|
|
description: "날짜, 시간, 날짜시간, 날짜 범위 등을 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "date" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Date as any,
|
|
|
|
|
tags: ["date", "time", "datetime", "datepicker", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 200, height: 40 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2DateConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
dateType: "date",
|
|
|
|
|
format: "YYYY-MM-DD",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-list",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 목록",
|
|
|
|
|
description: "테이블, 카드, 칸반, 리스트 등 다양한 데이터 표시 방식을 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "list" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2List as any,
|
|
|
|
|
tags: ["list", "table", "card", "kanban", "data", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 600, height: 400 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2ListConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
viewMode: "table",
|
|
|
|
|
source: "static",
|
|
|
|
|
columns: [],
|
|
|
|
|
pagination: true,
|
|
|
|
|
sortable: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-layout",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 레이아웃",
|
|
|
|
|
description: "그리드, 분할 패널, 플렉스 등 다양한 레이아웃 구조를 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "container" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Layout as any,
|
|
|
|
|
tags: ["layout", "grid", "split", "flex", "container", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 400, height: 300 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2LayoutConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
layoutType: "grid",
|
|
|
|
|
columns: 2,
|
|
|
|
|
gap: "16",
|
|
|
|
|
use12Column: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-group",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 그룹",
|
|
|
|
|
description: "탭, 아코디언, 섹션, 모달 등 그룹 요소를 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "group" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Group as any,
|
|
|
|
|
tags: ["group", "tabs", "accordion", "section", "modal", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 400, height: 300 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2GroupConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
groupType: "section",
|
|
|
|
|
title: "",
|
|
|
|
|
collapsible: false,
|
|
|
|
|
defaultOpen: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-media",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 미디어",
|
|
|
|
|
description: "이미지, 비디오, 오디오, 파일 업로드 등을 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "file" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Media as any,
|
|
|
|
|
tags: ["media", "image", "video", "audio", "file", "upload", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 300, height: 200 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2MediaConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
mediaType: "image",
|
|
|
|
|
multiple: false,
|
|
|
|
|
preview: true,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-biz",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 비즈니스",
|
|
|
|
|
description: "플로우, 랙, 채번규칙 등 비즈니스 기능을 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "custom" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Biz as any,
|
|
|
|
|
tags: ["business", "flow", "rack", "numbering", "category", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 500, height: 400 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2BizConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
bizType: "flow",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
2026-01-28 17:36:19 +09:00
|
|
|
id: "v2-hierarchy",
|
2025-12-19 15:44:38 +09:00
|
|
|
name: "통합 계층",
|
|
|
|
|
description: "트리, 조직도, BOM, 연쇄 선택박스 등 계층 구조를 지원하는 통합 컴포넌트",
|
2026-01-28 17:36:19 +09:00
|
|
|
category: ComponentCategory.V2,
|
2025-12-19 15:44:38 +09:00
|
|
|
webType: "tree" as WebType,
|
2026-01-28 17:36:19 +09:00
|
|
|
component: V2Hierarchy as any,
|
|
|
|
|
tags: ["hierarchy", "tree", "org-chart", "bom", "cascading", "v2"],
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultSize: { width: 400, height: 400 },
|
2026-01-28 17:36:19 +09:00
|
|
|
configPanel: V2HierarchyConfigPanel as any,
|
2025-12-19 15:44:38 +09:00
|
|
|
defaultConfig: {
|
|
|
|
|
hierarchyType: "tree",
|
|
|
|
|
viewMode: "tree",
|
|
|
|
|
dataSource: "static",
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-01-28 17:58:18 +09:00
|
|
|
{
|
|
|
|
|
id: "v2-repeater",
|
|
|
|
|
name: "통합 반복",
|
|
|
|
|
description: "인라인 테이블, 모달, 버튼 등 다양한 반복 데이터 관리를 지원하는 통합 컴포넌트",
|
|
|
|
|
category: ComponentCategory.V2,
|
|
|
|
|
webType: "entity" as WebType,
|
|
|
|
|
component: V2Repeater as any,
|
|
|
|
|
tags: ["repeater", "table", "modal", "button", "data", "v2"],
|
|
|
|
|
defaultSize: { width: 600, height: 300 },
|
|
|
|
|
configPanel: V2RepeaterConfigPanel as any,
|
|
|
|
|
defaultConfig: {
|
|
|
|
|
renderMode: "inline",
|
|
|
|
|
dataSource: {
|
|
|
|
|
tableName: "",
|
|
|
|
|
foreignKey: "",
|
|
|
|
|
referenceKey: "",
|
|
|
|
|
},
|
|
|
|
|
columns: [],
|
|
|
|
|
features: {
|
|
|
|
|
showAddButton: true,
|
|
|
|
|
showDeleteButton: true,
|
|
|
|
|
inlineEdit: false,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2025-12-19 15:44:38 +09:00
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
2026-01-28 17:36:19 +09:00
|
|
|
* V2 컴포넌트들을 ComponentRegistry에 등록
|
2025-12-19 15:44:38 +09:00
|
|
|
*/
|
2026-01-28 17:36:19 +09:00
|
|
|
export function registerV2Components(): void {
|
|
|
|
|
for (const definition of v2ComponentDefinitions) {
|
2025-12-19 15:44:38 +09:00
|
|
|
try {
|
|
|
|
|
// 이미 등록되어 있으면 스킵
|
|
|
|
|
if (ComponentRegistry.getComponent(definition.id)) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
ComponentRegistry.registerComponent(definition);
|
|
|
|
|
} catch (error) {
|
2026-01-28 17:36:19 +09:00
|
|
|
console.error(`❌ V2 컴포넌트 등록 실패: ${definition.id}`, error);
|
2025-12-19 15:44:38 +09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-28 17:36:19 +09:00
|
|
|
export default registerV2Components;
|