diff --git a/frontend/components/screen/panels/V2PropertiesPanel.tsx b/frontend/components/screen/panels/V2PropertiesPanel.tsx index 1f97230c..cf148e6e 100644 --- a/frontend/components/screen/panels/V2PropertiesPanel.tsx +++ b/frontend/components/screen/panels/V2PropertiesPanel.tsx @@ -183,6 +183,62 @@ export const V2PropertiesPanel: React.FC = ({ selectedComponent.componentConfig?.id || (selectedComponent.type === "component" ? selectedComponent.id : null); // ๐Ÿ†• ๋…๋ฆฝ ์ปดํฌ๋„ŒํŠธ (table-search-widget ๋“ฑ) + // ๐Ÿ†• V2 ์ปดํฌ๋„ŒํŠธ ์ง์ ‘ ๊ฐ์ง€ ๋ฐ ์„ค์ • ํŒจ๋„ ๋ Œ๋”๋ง + if (componentId?.startsWith("v2-")) { + const v2ConfigPanels: Record void }>> = { + "v2-input": require("@/components/v2/config-panels/V2FieldConfigPanel").V2FieldConfigPanel, + "v2-select": require("@/components/v2/config-panels/V2FieldConfigPanel").V2FieldConfigPanel, + "v2-date": require("@/components/v2/config-panels/V2DateConfigPanel").V2DateConfigPanel, + "v2-list": require("@/components/v2/config-panels/V2ListConfigPanel").V2ListConfigPanel, + "v2-layout": require("@/components/v2/config-panels/V2LayoutConfigPanel").V2LayoutConfigPanel, + "v2-group": require("@/components/v2/config-panels/V2GroupConfigPanel").V2GroupConfigPanel, + "v2-media": require("@/components/v2/config-panels/V2MediaConfigPanel").V2MediaConfigPanel, + "v2-biz": require("@/components/v2/config-panels/V2BizConfigPanel").V2BizConfigPanel, + "v2-hierarchy": require("@/components/v2/config-panels/V2HierarchyConfigPanel").V2HierarchyConfigPanel, + "v2-bom-item-editor": require("@/components/v2/config-panels/V2BomItemEditorConfigPanel") + .V2BomItemEditorConfigPanel, + "v2-bom-tree": require("@/components/v2/config-panels/V2BomTreeConfigPanel").V2BomTreeConfigPanel, + }; + + const V2ConfigPanel = v2ConfigPanels[componentId]; + if (V2ConfigPanel) { + const currentConfig = selectedComponent.componentConfig || {}; + const handleV2ConfigChange = (newConfig: any) => { + onUpdateProperty(selectedComponent.id, "componentConfig", { ...currentConfig, ...newConfig }); + }; + + // ์ปฌ๋Ÿผ์˜ inputType ๊ฐ€์ ธ์˜ค๊ธฐ (entity ํƒ€์ž…์ธ์ง€ ํ™•์ธ์šฉ) + const inputType = currentConfig.inputType || currentConfig.webType || (selectedComponent as any).inputType; + + // ํ˜„์žฌ ํ™”๋ฉด์˜ ํ…Œ์ด๋ธ”๋ช… ๊ฐ€์ ธ์˜ค๊ธฐ + const currentTableName = tables?.[0]?.tableName; + + // ์ปดํฌ๋„ŒํŠธ๋ณ„ ์ถ”๊ฐ€ props + const extraProps: Record = {}; + if (componentId === "v2-select") { + extraProps.inputType = inputType; + extraProps.tableName = selectedComponent.tableName || currentTable?.tableName || currentTableName; + extraProps.columnName = selectedComponent.columnName || currentConfig.fieldKey || currentConfig.columnName; + } + if (componentId === "v2-list") { + extraProps.currentTableName = currentTableName; + } + if (componentId === "v2-bom-item-editor" || componentId === "v2-bom-tree") { + extraProps.currentTableName = currentTableName; + extraProps.screenTableName = selectedComponent.tableName || currentTable?.tableName || currentTableName; + } + if (componentId === "v2-input") { + extraProps.allComponents = allComponents; + } + + return ( +
+ +
+ ); + } + } + if (componentId) { const definition = ComponentRegistry.getComponent(componentId); @@ -219,7 +275,9 @@ export const V2PropertiesPanel: React.FC = ({ allTables={allTables} screenTableName={selectedComponent.tableName || currentTable?.tableName || currentTableName} tableName={selectedComponent.tableName || currentTable?.tableName || currentTableName} - columnName={(selectedComponent as any).columnName || currentConfig?.columnName || currentConfig?.fieldName} + columnName={ + (selectedComponent as any).columnName || currentConfig?.columnName || currentConfig?.fieldName + } inputType={(selectedComponent as any).inputType || currentConfig?.inputType} componentType={componentType} tableColumns={currentTable?.columns || []} @@ -334,11 +392,11 @@ export const V2PropertiesPanel: React.FC = ({ return (
{/* DIMENSIONS ์„น์…˜ */} -
-

DIMENSIONS

+
+

DIMENSIONS

- + = ({ />
- + = ({ />
- + = ({ {/* Title (group/area) */} {(selectedComponent.type === "group" || selectedComponent.type === "area") && ( -
-

CONTENT

+
+

CONTENT

- ์ œ๋ชฉ + ์ œ๋ชฉ
= ({
{selectedComponent.type === "area" && (
- ์„ค๋ช… + ์„ค๋ช…
= ({ )} {/* OPTIONS ์„น์…˜ */} -
-

OPTIONS

- {(isInputField || widget.required !== undefined) && (() => { - const colName = widget.columnName || selectedComponent?.columnName; - const colMeta = colName ? currentTable?.columns?.find( - (c: any) => (c.columnName || c.column_name || "").toLowerCase() === colName.toLowerCase() - ) : null; - const isNotNull = colMeta && ((colMeta as any).isNullable === "NO" || (colMeta as any).isNullable === "N" || (colMeta as any).is_nullable === "NO" || (colMeta as any).is_nullable === "N"); - return ( -
- - ํ•„์ˆ˜ - {isNotNull && (NOT NULL)} - - { - if (isNotNull) return; - handleUpdate("required", checked); - handleUpdate("componentConfig.required", checked); - }} - disabled={!!isNotNull} - className="h-4 w-4" - /> -
- ); - })()} +
+

OPTIONS

+ {(isInputField || widget.required !== undefined) && + (() => { + const colName = widget.columnName || selectedComponent?.columnName; + const colMeta = colName + ? currentTable?.columns?.find( + (c: any) => (c.columnName || c.column_name || "").toLowerCase() === colName.toLowerCase(), + ) + : null; + const isNotNull = + colMeta && + ((colMeta as any).isNullable === "NO" || + (colMeta as any).isNullable === "N" || + (colMeta as any).is_nullable === "NO" || + (colMeta as any).is_nullable === "N"); + return ( +
+ + ํ•„์ˆ˜ + {isNotNull && (NOT NULL)} + + { + if (isNotNull) return; + handleUpdate("required", checked); + handleUpdate("componentConfig.required", checked); + }} + disabled={!!isNotNull} + className="h-4 w-4" + /> +
+ ); + })()} {(isInputField || widget.readonly !== undefined) && (
- ์ฝ๊ธฐ์ „์šฉ + ์ฝ๊ธฐ์ „์šฉ { @@ -489,7 +557,7 @@ export const V2PropertiesPanel: React.FC = ({
)}
- ์ˆจ๊น€ + ์ˆจ๊น€ { @@ -505,13 +573,13 @@ export const V2PropertiesPanel: React.FC = ({ {isInputField && ( - LABEL - + LABEL + {/* ๋ผ๋ฒจ ํ…์ŠคํŠธ */}
- ํ…์ŠคํŠธ + ํ…์ŠคํŠธ
= ({ {/* ์œ„์น˜ + ๊ฐ„๊ฒฉ */}
- +
- + { const pos = selectedComponent.style?.labelPosition; @@ -570,7 +639,7 @@ export const V2PropertiesPanel: React.FC = ({ {/* ํฌ๊ธฐ + ์ƒ‰์ƒ */}
- + handleUpdate("style.labelFontSize", e.target.value)} @@ -578,7 +647,7 @@ export const V2PropertiesPanel: React.FC = ({ />
- + handleUpdate("style.labelColor", value)} @@ -589,7 +658,7 @@ export const V2PropertiesPanel: React.FC = ({
{/* ๊ตต๊ธฐ */}
- ๊ตต๊ธฐ + ๊ตต๊ธฐ