V2 컴포넌트 추가 및 기존 컴포넌트 업데이트: getComponentConfigPanel.tsx에서 다양한 V2 컴포넌트를 추가하고, 기존 컴포넌트의 경로를 업데이트하여 관리 효율성을 높였습니다. 이를 통해 새로운 컴포넌트 사용을 지원하고, 기존 컴포넌트와의 호환성을 유지하도록 개선하였습니다.

This commit is contained in:
kjs 2026-01-19 17:28:52 +09:00
parent 0ee36d9b35
commit f0cacb9401
1 changed files with 31 additions and 11 deletions

View File

@ -22,36 +22,49 @@ const CONFIG_PANEL_MAP: Record<string, () => Promise<any>> = {
// ========== 버튼 ==========
"button-primary": () => import("@/components/screen/config-panels/ButtonConfigPanel"),
"v2-button-primary": () => import("@/components/screen/config-panels/ButtonConfigPanel"),
// ========== 표시 컴포넌트 ==========
"text-display": () => import("@/lib/registry/components/text-display/TextDisplayConfigPanel"),
"v2-text-display": () => import("@/lib/registry/components/v2-text-display/TextDisplayConfigPanel"),
"image-display": () => import("@/lib/registry/components/image-display/ImageDisplayConfigPanel"),
"divider-line": () => import("@/lib/registry/components/divider-line/DividerLineConfigPanel"),
"v2-divider-line": () => import("@/lib/registry/components/v2-divider-line/DividerLineConfigPanel"),
"image-widget": () => import("@/lib/registry/components/image-widget/ImageWidgetConfigPanel"),
// ========== 레이아웃/컨테이너 ==========
"accordion-basic": () => import("@/lib/registry/components/accordion-basic/AccordionBasicConfigPanel"),
"card-display": () => import("@/lib/registry/components/card-display/CardDisplayConfigPanel"),
"v2-card-display": () => import("@/lib/registry/components/v2-card-display/CardDisplayConfigPanel"),
"section-card": () => import("@/lib/registry/components/section-card/SectionCardConfigPanel"),
"v2-section-card": () => import("@/lib/registry/components/v2-section-card/SectionCardConfigPanel"),
"section-paper": () => import("@/lib/registry/components/section-paper/SectionPaperConfigPanel"),
"v2-section-paper": () => import("@/lib/registry/components/v2-section-paper/SectionPaperConfigPanel"),
"split-panel-layout": () => import("@/lib/registry/components/split-panel-layout/SplitPanelLayoutConfigPanel"),
"v2-split-panel-layout": () => import("@/lib/registry/components/v2-split-panel-layout/SplitPanelLayoutConfigPanel"),
"split-panel-layout2": () => import("@/lib/registry/components/split-panel-layout2/SplitPanelLayout2ConfigPanel"),
"screen-split-panel": () => import("@/lib/registry/components/screen-split-panel/ScreenSplitPanelConfigPanel"),
"conditional-container": () => import("@/lib/registry/components/conditional-container/ConditionalContainerConfigPanel"),
// ========== 테이블/리스트 ==========
"table-list": () => import("@/lib/registry/components/table-list/TableListConfigPanel"),
"v2-table-list": () => import("@/lib/registry/components/v2-table-list/TableListConfigPanel"),
"pivot-grid": () => import("@/lib/registry/components/pivot-grid/PivotGridConfigPanel"),
"v2-pivot-grid": () => import("@/lib/registry/components/v2-pivot-grid/PivotGridConfigPanel"),
"table-search-widget": () => import("@/lib/registry/components/table-search-widget/TableSearchWidgetConfigPanel"),
"v2-table-search-widget": () => import("@/lib/registry/components/v2-table-search-widget/TableSearchWidgetConfigPanel"),
"tax-invoice-list": () => import("@/lib/registry/components/tax-invoice-list/TaxInvoiceListConfigPanel"),
// ========== 리피터/반복 ==========
"repeat-container": () => import("@/lib/registry/components/repeat-container/RepeatContainerConfigPanel"),
"v2-repeat-container": () => import("@/lib/registry/components/v2-repeat-container/RepeatContainerConfigPanel"),
"repeater-field-group": () => import("@/components/webtypes/config/RepeaterConfigPanel"),
"unified-repeater": () => import("@/components/unified/config-panels/UnifiedRepeaterConfigPanel"),
"v2-unified-repeater": () => import("@/components/unified/config-panels/UnifiedRepeaterConfigPanel"),
"simple-repeater-table": () => import("@/lib/registry/components/simple-repeater-table/SimpleRepeaterTableConfigPanel"),
"modal-repeater-table": () => import("@/lib/registry/components/modal-repeater-table/ModalRepeaterTableConfigPanel"),
"repeat-screen-modal": () => import("@/lib/registry/components/repeat-screen-modal/RepeatScreenModalConfigPanel"),
"v2-repeat-screen-modal": () => import("@/lib/registry/components/v2-repeat-screen-modal/RepeatScreenModalConfigPanel"),
"related-data-buttons": () => import("@/lib/registry/components/related-data-buttons/RelatedDataButtonsConfigPanel"),
// ========== 검색/선택 ==========
@ -61,15 +74,21 @@ const CONFIG_PANEL_MAP: Record<string, () => Promise<any>> = {
"customer-item-mapping": () => import("@/lib/registry/components/customer-item-mapping/CustomerItemMappingConfigPanel"),
"mail-recipient-selector": () => import("@/lib/registry/components/mail-recipient-selector/MailRecipientSelectorConfigPanel"),
"location-swap-selector": () => import("@/lib/registry/components/location-swap-selector/LocationSwapSelectorConfigPanel"),
"v2-location-swap-selector": () => import("@/lib/registry/components/v2-location-swap-selector/LocationSwapSelectorConfigPanel"),
// ========== 특수 컴포넌트 ==========
"flow-widget": () => import("@/components/screen/config-panels/FlowWidgetConfigPanel"),
"tabs-widget": () => import("@/components/screen/config-panels/TabsConfigPanel"),
"v2-tabs-widget": () => import("@/components/screen/config-panels/TabsConfigPanel"),
"tabs": () => import("@/components/screen/config-panels/TabsConfigPanel"),
"v2-tabs": () => import("@/components/screen/config-panels/TabsConfigPanel"),
"map": () => import("@/lib/registry/components/map/MapConfigPanel"),
"rack-structure": () => import("@/lib/registry/components/rack-structure/RackStructureConfigPanel"),
"v2-rack-structure": () => import("@/lib/registry/components/v2-rack-structure/RackStructureConfigPanel"),
"aggregation-widget": () => import("@/lib/registry/components/aggregation-widget/AggregationWidgetConfigPanel"),
"v2-aggregation-widget": () => import("@/lib/registry/components/v2-aggregation-widget/AggregationWidgetConfigPanel"),
"numbering-rule": () => import("@/lib/registry/components/numbering-rule/NumberingRuleConfigPanel"),
"v2-numbering-rule": () => import("@/lib/registry/components/v2-numbering-rule/NumberingRuleConfigPanel"),
"category-manager": () => import("@/lib/registry/components/category-manager/CategoryManagerConfigPanel"),
"universal-form-modal": () => import("@/lib/registry/components/universal-form-modal/UniversalFormModalConfigPanel"),
};
@ -321,6 +340,18 @@ export const DynamicComponentConfigPanel: React.FC<ComponentConfigPanelProps> =
}
}, [componentId, config.sourceTable, config.targetTable]);
// 🆕 allComponents를 screenComponents 형태로 변환 (집계 위젯 등에서 사용)
// Hooks 규칙: 조건부 return 전에 선언해야 함
const screenComponents = React.useMemo(() => {
if (!allComponents) return [];
return allComponents.map((comp: any) => ({
id: comp.id,
componentType: comp.componentType || comp.type,
label: comp.label || comp.name || comp.id,
tableName: comp.componentConfig?.tableName || comp.tableName,
}));
}, [allComponents]);
if (loading) {
return (
<div className="rounded-md border border-dashed border-gray-300 bg-gray-50 p-4 w-full">
@ -490,17 +521,6 @@ export const DynamicComponentConfigPanel: React.FC<ComponentConfigPanelProps> =
);
}
// 🆕 allComponents를 screenComponents 형태로 변환 (집계 위젯 등에서 사용)
const screenComponents = React.useMemo(() => {
if (!allComponents) return [];
return allComponents.map((comp: any) => ({
id: comp.id,
componentType: comp.componentType || comp.type,
label: comp.label || comp.name || comp.id,
tableName: comp.componentConfig?.tableName || comp.tableName,
}));
}, [allComponents]);
return (
<ConfigPanelComponent
config={config}