diff --git a/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx b/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx index eea9e3ce..2b46dd81 100644 --- a/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx +++ b/frontend/components/v2/config-panels/V2BomItemEditorConfigPanel.tsx @@ -3,13 +3,12 @@ /** * BOM 하위품목 편집기 설정 패널 * - * V2RepeaterConfigPanel 구조를 기반으로 구현: - * - 기본 탭: 저장 테이블 + 엔티티 선택 + 트리 설정 + 기능 옵션 + * 토스식 단계별 UX: + * - 기본 탭: 저장 테이블 → 트리 구조 → 엔티티 선택 → 기능 옵션(고급) * - 컬럼 탭: 소스 표시 컬럼 + 저장 입력 컬럼 + 선택된 컬럼 상세 */ import React, { useState, useEffect, useMemo, useCallback } from "react"; -import { Label } from "@/components/ui/label"; import { Select, SelectContent, @@ -17,7 +16,7 @@ import { SelectTrigger, SelectValue, } from "@/components/ui/select"; -import { Separator } from "@/components/ui/separator"; +import { Switch } from "@/components/ui/switch"; import { Checkbox } from "@/components/ui/checkbox"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; @@ -102,27 +101,18 @@ interface BomColumnConfig { } interface BomItemEditorConfig { - // 저장 테이블 설정 (리피터 패턴) useCustomTable?: boolean; mainTableName?: string; foreignKeyColumn?: string; foreignKeySourceColumn?: string; - - // 트리 구조 설정 parentKeyColumn?: string; - - // 엔티티 (품목 참조) 설정 dataSource?: { sourceTable?: string; foreignKey?: string; referenceKey?: string; displayColumn?: string; }; - - // 컬럼 설정 columns: BomColumnConfig[]; - - // 기능 옵션 features?: { showAddButton?: boolean; showDeleteButton?: boolean; @@ -472,7 +462,6 @@ export function V2BomItemEditorConfigPanel({ }); }; - // FK 컬럼 제외한 입력 가능 컬럼 const inputableColumns = useMemo(() => { const fkColumn = config.dataSource?.foreignKey; return currentTableColumns.filter( @@ -495,9 +484,12 @@ export function V2BomItemEditorConfigPanel({ {/* ─── 기본 설정 탭 ─── */} - {/* 저장 대상 테이블 (리피터 동일) */} -
- + {/* 저장 대상 테이블 */} +
+
+ + BOM 데이터를 어디에 저장하나요? +
- {/* 테이블 Combobox (리피터 동일) */} + {/* 테이블 Combobox */} + )} + + {col.isSourceDisplay ? ( + + ) : ( + + )} + + updateColumnProp(col.key, "title", e.target.value)} + placeholder="제목" + className="h-6 flex-1 text-xs" + /> + + {!col.isSourceDisplay && ( + + )} + + {!col.isSourceDisplay && ( + + )} + + - )} - - {col.isSourceDisplay ? ( - - ) : ( - - )} - - updateColumnProp(col.key, "title", e.target.value)} - placeholder="제목" - className="h-6 flex-1 text-xs" - /> - - {!col.isSourceDisplay && ( - - )} - - {!col.isSourceDisplay && ( - - updateColumnProp(col.key, "editable", !!checked) - } - title="편집 가능" - /> - )} - - -
- - {/* 확장 상세 */} - {!col.isSourceDisplay && expandedColumn === col.key && ( -
-
- - updateColumnProp(col.key, "width", e.target.value)} - placeholder="auto, 100px, 20%" - className="h-6 text-xs" - /> -
-
- )} + +
- ))} - + + {/* 확장 상세 */} + {!col.isSourceDisplay && expandedColumn === col.key && ( +
+
+

컬럼 너비

+ updateColumnProp(col.key, "width", e.target.value)} + placeholder="auto, 100px, 20%" + className="h-6 text-xs" + /> +
+
+ )} + + ))} - + )}