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}
))}