From e6bb366ec7c04d7a88b44cb8fc856459bbbd5fa1 Mon Sep 17 00:00:00 2001 From: leeheejin Date: Wed, 21 Jan 2026 16:15:20 +0900 Subject: [PATCH] =?UTF-8?q?=ED=94=BC=EB=B2=97=EC=97=90=20=ED=95=84?= =?UTF-8?q?=ED=84=B0=EB=A7=81=EC=AA=BD=EC=97=90=20=EC=B4=88=EA=B8=B0?= =?UTF-8?q?=ED=99=94=EB=B2=84=ED=8A=BC=20=EB=84=A3=EC=97=88=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pivot-grid/PivotGridComponent.tsx | 4 + .../pivot-grid/components/FieldPanel.tsx | 162 +++++++++++++++++- 2 files changed, 157 insertions(+), 9 deletions(-) diff --git a/frontend/lib/registry/components/pivot-grid/PivotGridComponent.tsx b/frontend/lib/registry/components/pivot-grid/PivotGridComponent.tsx index 4b4465e1..b815ce06 100644 --- a/frontend/lib/registry/components/pivot-grid/PivotGridComponent.tsx +++ b/frontend/lib/registry/components/pivot-grid/PivotGridComponent.tsx @@ -299,6 +299,8 @@ export const PivotGridComponent: React.FC = ({ // ==================== 상태 ==================== const [fields, setFields] = useState(initialFields); + // 초기 필드 설정 저장 (초기화용) + const initialFieldsRef = useRef(initialFields); const [pivotState, setPivotState] = useState({ expandedRowPaths: [], expandedColumnPaths: [], @@ -1129,6 +1131,7 @@ export const PivotGridComponent: React.FC = ({ onFieldsChange={handleFieldsChange} collapsed={!showFieldPanel} onToggleCollapse={() => setShowFieldPanel(!showFieldPanel)} + initialFields={initialFieldsRef.current} /> {/* 안내 메시지 */} @@ -1405,6 +1408,7 @@ export const PivotGridComponent: React.FC = ({ onFieldsChange={handleFieldsChange} collapsed={!showFieldPanel} onToggleCollapse={() => setShowFieldPanel(!showFieldPanel)} + initialFields={initialFieldsRef.current} /> {/* 헤더 툴바 */} diff --git a/frontend/lib/registry/components/pivot-grid/components/FieldPanel.tsx b/frontend/lib/registry/components/pivot-grid/components/FieldPanel.tsx index 967afd08..2ef1227e 100644 --- a/frontend/lib/registry/components/pivot-grid/components/FieldPanel.tsx +++ b/frontend/lib/registry/components/pivot-grid/components/FieldPanel.tsx @@ -37,6 +37,10 @@ import { BarChart3, GripVertical, ChevronDown, + RotateCcw, + FilterX, + LayoutGrid, + Trash2, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { @@ -56,6 +60,8 @@ interface FieldPanelProps { onFieldSettingsChange?: (field: PivotFieldConfig) => void; collapsed?: boolean; onToggleCollapse?: () => void; + /** 초기 필드 설정 (필드 배치 초기화용) */ + initialFields?: PivotFieldConfig[]; } interface FieldChipProps { @@ -123,15 +129,23 @@ const SortableFieldChip: React.FC = ({ transition, }; + // 필터 적용 여부 확인 + const hasFilter = field.filterValues && field.filterValues.length > 0; + const filterCount = field.filterValues?.length || 0; + return (
{/* 드래그 핸들 */} @@ -143,11 +157,24 @@ const SortableFieldChip: React.FC = ({ + {/* 필터 아이콘 (필터 적용 시) */} + {hasFilter && ( + + )} + {/* 필드 라벨 */}
- {/* 접기 버튼 */} - {onToggleCollapse && ( -
+ {/* 하단 버튼 영역 */} +
+ {/* 초기화 드롭다운 */} + + + + + + + + 필터만 초기화 + {filteredFieldCount > 0 && ( + + ({filteredFieldCount}개) + + )} + + + + 필드 배치 초기화 + + + + + 전체 초기화 + + + + + {/* 접기 버튼 */} + {onToggleCollapse && ( -
- )} + )} +
{/* 드래그 오버레이 */}