From ad988f29517312e9c5b813e3d9701626b4a0fdd8 Mon Sep 17 00:00:00 2001 From: kjs Date: Mon, 1 Sep 2025 15:42:08 +0900 Subject: [PATCH] =?UTF-8?q?=EC=8B=A4=EC=A0=9C=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=EA=B3=BC=20=EB=8F=99=EC=9D=BC=ED=95=98=EA=B2=8C=20=EB=B3=B4?= =?UTF-8?q?=EC=97=AC=EC=A7=80=EB=8F=84=EB=A1=9D=20=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/screen/RealtimePreview.tsx | 65 ++++++++----------- frontend/components/screen/ScreenDesigner.tsx | 7 +- 2 files changed, 32 insertions(+), 40 deletions(-) diff --git a/frontend/components/screen/RealtimePreview.tsx b/frontend/components/screen/RealtimePreview.tsx index 7cb504cd..50234c37 100644 --- a/frontend/components/screen/RealtimePreview.tsx +++ b/frontend/components/screen/RealtimePreview.tsx @@ -45,7 +45,7 @@ const renderWidget = (component: ComponentData) => { placeholder: placeholder || `입력하세요...`, disabled: readonly, required: required, - className: "w-full", + className: "w-full h-full", }; switch (widgetType) { @@ -210,13 +210,13 @@ export const RealtimePreview: React.FC = ({ return (
= ({ draggable onDragStart={onDragStart} onDragEnd={onDragEnd} + onMouseDown={(e) => { + // 드래그 시작을 위한 마우스 다운 이벤트 + e.stopPropagation(); + }} > {type === "container" && ( -
-
- +
+
+
-
{label}
+
{label}
{tableName}
@@ -238,54 +242,41 @@ export const RealtimePreview: React.FC = ({ )} {type === "group" && ( -
+
{/* 그룹 헤더 */}
onGroupToggle?.(component.id)} + className="pointer-events-auto flex cursor-pointer items-center justify-between rounded-t-lg border-b bg-white px-2 py-1" + onClick={(e) => { + e.stopPropagation(); + onGroupToggle?.(component.id); + }} > -
- - {label || "그룹"} +
+ + {label || "그룹"} ({children.length}개)
{component.collapsible && (component.collapsed ? ( - + ) : ( - + ))}
{/* 그룹 내용 */} {!component.collapsed && ( -
- {children ? children :
그룹이 비어있습니다
} +
+ {children ? children :
그룹이 비어있습니다
}
)}
)} {type === "widget" && ( -
- {/* 위젯 헤더 */} -
- {getWidgetIcon(widgetType)} -
- -
-
- - {/* 위젯 본체 */} -
{renderWidget(component)}
- - {/* 위젯 정보 */} -
- {columnName} ({widgetType}) -
+
+ {/* 위젯 본체 - 실제 웹 위젯처럼 보이도록 */} +
{renderWidget(component)}
)}
diff --git a/frontend/components/screen/ScreenDesigner.tsx b/frontend/components/screen/ScreenDesigner.tsx index c500e0a9..b3aaaf9b 100644 --- a/frontend/components/screen/ScreenDesigner.tsx +++ b/frontend/components/screen/ScreenDesigner.tsx @@ -622,6 +622,7 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD // 기존 컴포넌트 드래그 시작 (재배치) const startComponentDrag = useCallback((component: ComponentData, e: React.DragEvent) => { + e.stopPropagation(); setDragState({ isDragging: true, draggedComponent: component, @@ -844,7 +845,7 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD type: "container", tableName: table.tableName, label: table.tableLabel, - size: { width: 12, height: 120 }, + size: { width: 12, height: 80 }, }, e, ) @@ -890,7 +891,7 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD columnName: column.columnName, widgetType: widgetType as WebType, label: column.columnLabel || column.columnName, - size: { width: 6, height: 60 }, + size: { width: 6, height: 40 }, }, e, ); @@ -1010,7 +1011,7 @@ export default function ScreenDesigner({ selectedScreen, onBackToList }: ScreenD > {children.map((child) => (
-
{child.label || child.columnName || child.id}
+
{child.label || (child as any).columnName || child.id}
{child.type}
))}