From dd867efd0ae6d957af6cea54782129f4473c2d4a Mon Sep 17 00:00:00 2001 From: DDD1542 Date: Thu, 5 Feb 2026 14:07:18 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20ScreenModal=20=EB=B0=8F=20V2Select=20?= =?UTF-8?q?=EC=BB=B4=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ScreenModal에서 모달 크기 계산 로직을 개선하여, 콘텐츠가 화면 높이를 초과할 때만 스크롤이 필요하도록 수정하였습니다. - V2Select 및 관련 컴포넌트에서 height 및 style props를 추가하여, 사용자 정의 스타일을 보다 효과적으로 적용할 수 있도록 하였습니다. - DropdownSelect에서 height 스타일을 직접 전달하여, 다양한 높이 설정을 지원하도록 개선하였습니다. - CategorySelectComponent에서 라벨 표시 및 높이 계산 로직을 추가하여, 사용자 경험을 향상시켰습니다. --- frontend/components/common/ScreenModal.tsx | 20 ++- frontend/components/ui/select.tsx | 9 +- frontend/components/v2/V2Date.tsx | 16 +- frontend/components/v2/V2Input.tsx | 2 +- frontend/components/v2/V2List.tsx | 4 +- frontend/components/v2/V2Select.tsx | 46 ++++-- .../lib/registry/DynamicComponentRenderer.tsx | 26 +++- .../CategorySelectComponent.tsx | 143 ++++++++++++++---- .../components/v2-select/V2SelectRenderer.tsx | 25 ++- .../registry/components/v2-select/index.ts | 5 +- 10 files changed, 230 insertions(+), 66 deletions(-) diff --git a/frontend/components/common/ScreenModal.tsx b/frontend/components/common/ScreenModal.tsx index 2f6ae80f..746c85f1 100644 --- a/frontend/components/common/ScreenModal.tsx +++ b/frontend/components/common/ScreenModal.tsx @@ -531,26 +531,34 @@ export const ScreenModal: React.FC = ({ className }) => { return { className: "w-fit min-w-[400px] max-w-4xl max-h-[90vh] overflow-hidden p-0", style: undefined, // undefined로 변경 - defaultWidth/defaultHeight 사용 + needsScroll: false, }; } // 화면관리에서 설정한 크기 = 컨텐츠 영역 크기 - // 실제 모달 크기 = 컨텐츠 + 헤더 + 연속등록 체크박스 - // 🔧 여백 최소화: 디자이너와 일치하도록 조정 + // 실제 모달 크기 = 컨텐츠 + 헤더 + 연속등록 체크박스 + gap + 패딩 + // 🔧 DialogContent의 gap-4 (16px × 2) + 컨텐츠 pt-6 (24px) 포함 const headerHeight = 48; // DialogHeader (타이틀 + border-b + py-3) const footerHeight = 44; // 연속 등록 모드 체크박스 영역 + const dialogGap = 32; // gap-4 × 2 (header-content, content-footer 사이) + const contentTopPadding = 24; // pt-6 (컨텐츠 영역 상단 패딩) const horizontalPadding = 16; // 좌우 패딩 최소화 - const totalHeight = screenDimensions.height + headerHeight + footerHeight; + const totalHeight = screenDimensions.height + headerHeight + footerHeight + dialogGap + contentTopPadding; + const maxAvailableHeight = window.innerHeight * 0.95; + + // 콘텐츠가 화면 높이를 초과할 때만 스크롤 필요 + const needsScroll = totalHeight > maxAvailableHeight; return { className: "overflow-hidden p-0", style: { width: `${Math.min(screenDimensions.width + horizontalPadding, window.innerWidth * 0.98)}px`, - height: `${Math.min(totalHeight, window.innerHeight * 0.95)}px`, + // 🔧 height 대신 max-height만 설정 - 콘텐츠가 작으면 자동으로 줄어듦 + maxHeight: `${maxAvailableHeight}px`, maxWidth: "98vw", - maxHeight: "95vh", }, + needsScroll, }; }; @@ -634,7 +642,7 @@ export const ScreenModal: React.FC = ({ className }) => {
{loading ? (
diff --git a/frontend/components/ui/select.tsx b/frontend/components/ui/select.tsx index 81e90fd3..64fef9c4 100644 --- a/frontend/components/ui/select.tsx +++ b/frontend/components/ui/select.tsx @@ -22,18 +22,25 @@ function SelectTrigger({ className, size = "xs", children, + style, ...props }: React.ComponentProps & { size?: "xs" | "sm" | "default"; }) { + // className에 h-full/h-[ 또는 style.height가 있으면 data-size 높이를 무시 + const hasCustomHeight = className?.includes("h-full") || className?.includes("h-[") || !!style?.height; + return ( {children} diff --git a/frontend/components/v2/V2Date.tsx b/frontend/components/v2/V2Date.tsx index 7e930840..91a4cf5d 100644 --- a/frontend/components/v2/V2Date.tsx +++ b/frontend/components/v2/V2Date.tsx @@ -222,14 +222,14 @@ const RangeDatePicker = forwardRef< ); return ( -
+
{/* 시작 날짜 */}