Files
invyone/frontend/components/v2/registerV2Components.ts
T
DDD1542 4a8413000b
Build & Deploy to K8s / build-and-deploy (push) Failing after 11m17s
Consolidate canonical input migration
Remove legacy v2 input/select and file/media runtimes, add canonical option/file loaders, and document Codex handoff.
2026-05-12 18:36:43 +09:00

161 lines
5.4 KiB
TypeScript

"use client";
/**
* V2-era 컴포넌트 레지스트리 등록
*
* 아직 canonical INV 컴포넌트로 완전히 흡수되지 않은 컴포넌트만 등록합니다.
* 입력 계열은 `input` canonical 로 흡수됨 (Phase D.2, 2026-05-12 — 옛 V2 입력/선택은 폐기).
*/
import { ComponentRegistry } from "@/lib/registry/ComponentRegistry";
import { ComponentDefinition, ComponentCategory } from "@/types/component";
import { WebType } from "@/types/screen";
import { V2List } from "./V2List";
import { V2Layout } from "./V2Layout";
import { V2Group } from "./V2Group";
// V2Media — Phase D.5 폐기. canonical input (FilePicker) 으로 흡수.
import { V2Biz } from "./V2Biz";
import { V2Hierarchy } from "./V2Hierarchy";
import { V2Repeater } from "./V2Repeater";
import { V2ListConfigPanel } from "./config-panels/V2ListConfigPanel";
import { V2LayoutConfigPanel } from "./config-panels/V2LayoutConfigPanel";
import { V2GroupConfigPanel } from "./config-panels/V2GroupConfigPanel";
// V2MediaConfigPanel — Phase D.5 폐기.
import { V2BizConfigPanel } from "./config-panels/V2BizConfigPanel";
import { V2HierarchyConfigPanel } from "./config-panels/V2HierarchyConfigPanel";
import { InvRepeaterConfigPanel } from "./config-panels/InvRepeaterConfigPanel";
import { InvDataConfigPanel } from "./config-panels/InvDataConfigPanel";
// V2 컴포넌트 정의
const v2ComponentDefinitions: ComponentDefinition[] = [
{
id: "v2-list",
name: "통합 목록",
description: "테이블, 카드, 칸반, 리스트 등 다양한 데이터 표시 방식을 지원하는 통합 컴포넌트",
category: ComponentCategory.V2,
web_type: "list" as WebType,
component: V2List as any,
tags: ["list", "table", "card", "kanban", "data", "v2"],
default_size: { width: 600, height: 400 },
config_panel: InvDataConfigPanel as any,
default_config: {
viewMode: "table",
source: "static",
columns: [],
pagination: true,
sortable: true,
},
},
{
id: "v2-layout",
name: "통합 레이아웃",
description: "그리드, 분할 패널, 플렉스 등 다양한 레이아웃 구조를 지원하는 통합 컴포넌트",
category: ComponentCategory.V2,
web_type: "container" as WebType,
component: V2Layout as any,
tags: ["layout", "grid", "split", "flex", "container", "v2"],
default_size: { width: 400, height: 300 },
config_panel: V2LayoutConfigPanel as any,
default_config: {
layoutType: "grid",
columns: 2,
gap: "16",
use12Column: true,
},
},
{
id: "v2-group",
name: "통합 그룹",
description: "탭, 아코디언, 섹션, 모달 등 그룹 요소를 지원하는 통합 컴포넌트",
category: ComponentCategory.V2,
web_type: "group" as WebType,
component: V2Group as any,
tags: ["group", "tabs", "accordion", "section", "modal", "v2"],
default_size: { width: 400, height: 300 },
config_panel: V2GroupConfigPanel as any,
default_config: {
groupType: "section",
title: "",
collapsible: false,
defaultOpen: true,
},
},
// v2-media — Phase D.5 폐기. canonical input (FilePicker) 으로 흡수. 등록 제거.
{
id: "v2-biz",
name: "통합 비즈니스",
description: "플로우, 랙, 채번규칙 등 비즈니스 기능을 지원하는 통합 컴포넌트",
category: ComponentCategory.V2,
web_type: "custom" as WebType,
component: V2Biz as any,
tags: ["business", "flow", "rack", "numbering", "category", "v2"],
default_size: { width: 500, height: 400 },
config_panel: V2BizConfigPanel as any,
default_config: {
bizType: "flow",
},
},
{
id: "v2-hierarchy",
name: "통합 계층",
description: "트리, 조직도, BOM, 연쇄 선택박스 등 계층 구조를 지원하는 통합 컴포넌트",
category: ComponentCategory.V2,
web_type: "tree" as WebType,
component: V2Hierarchy as any,
tags: ["hierarchy", "tree", "org-chart", "bom", "cascading", "v2"],
default_size: { width: 400, height: 400 },
config_panel: V2HierarchyConfigPanel as any,
default_config: {
hierarchyType: "tree",
viewMode: "tree",
dataSource: "static",
},
},
{
id: "v2-repeater",
name: "통합 반복",
description: "인라인 테이블, 모달, 버튼 등 다양한 반복 데이터 관리를 지원하는 통합 컴포넌트",
category: ComponentCategory.V2,
web_type: "entity" as WebType,
component: V2Repeater as any,
tags: ["repeater", "table", "modal", "button", "data", "v2"],
default_size: { width: 600, height: 300 },
config_panel: InvDataConfigPanel as any,
default_config: {
renderMode: "inline",
dataSource: {
tableName: "",
foreignKey: "",
referenceKey: "",
},
columns: [],
features: {
showAddButton: true,
showDeleteButton: true,
inlineEdit: false,
},
},
},
];
/**
* V2 컴포넌트들을 ComponentRegistry에 등록
*/
export function registerV2Components(): void {
for (const definition of v2ComponentDefinitions) {
try {
// 이미 등록되어 있으면 스킵
if (ComponentRegistry.getComponent(definition.id)) {
continue;
}
ComponentRegistry.registerComponent(definition);
} catch (error) {
console.error(`❌ V2 컴포넌트 등록 실패: ${definition.id}`, error);
}
}
}
export default registerV2Components;