diff --git a/apps/st/src/components/css/DataGrid.css b/apps/st/src/components/css/DataGrid.css index 18058bbc7..68ab82f50 100644 --- a/apps/st/src/components/css/DataGrid.css +++ b/apps/st/src/components/css/DataGrid.css @@ -105,3 +105,7 @@ } } } + +.tabs-content { + margin-top: 0.6rem !important; +} \ No newline at end of file diff --git a/apps/st/src/components/module/TabDataGrid.tsx b/apps/st/src/components/module/TabDataGrid.tsx index 48be25e5b..8611ef4dd 100644 --- a/apps/st/src/components/module/TabDataGrid.tsx +++ b/apps/st/src/components/module/TabDataGrid.tsx @@ -56,98 +56,6 @@ function toNum(v: unknown): number { return parseFloat(String(v).replace(/,/g, "")) || NaN; } -/** 헤더에 정렬 화살표 표시 (CSS 방식) */ -// function updateHeaderSortIndicator( -// gridView: { -// columnByIndex?: (i: number) => { fieldName?: string; name?: string } | undefined; -// columnByName?: (name: string) => { fieldName?: string; name?: string } | undefined; -// getColumn?: (i: number) => { fieldName?: string; name?: string } | undefined; -// getElement?: () => HTMLElement | null; -// container?: HTMLElement; -// }, -// columns: { fieldName?: string; name: string }[], -// sortDir: Record, -// gridElement?: HTMLElement | null -// ) { -// try { -// // 그리드 DOM 요소 찾기 -// let gridEl: HTMLElement | null = null; -// if (gridElement) { -// gridEl = gridElement; -// } else if (gridView.getElement) { -// gridEl = gridView.getElement(); -// } else if (gridView.container) { -// gridEl = gridView.container; -// } else { -// // 폴백: 모든 그리드 중에서 찾기 -// const allGrids = document.querySelectorAll('.rg-grid, [data-grid-id]'); -// if (allGrids.length > 0) { -// // 활성 탭의 그리드를 찾기 위해 TabsContent 내부의 그리드 찾기 -// const activeTabContent = document.querySelector('[data-state="active"]')?.closest('[role="tabpanel"]'); -// if (activeTabContent) { -// gridEl = activeTabContent.querySelector('.rg-grid, [data-grid-id]') as HTMLElement; -// } -// if (!gridEl && allGrids.length === 1) { -// gridEl = allGrids[0] as HTMLElement; -// } -// } -// } - -// if (!gridEl) return; - -// columns.forEach((col) => { -// if (!col.fieldName && !col.name) return; - -// const fieldName = col.fieldName || col.name; -// const direction = sortDir[fieldName] || sortDir[col.name] || "none"; -// if (direction === "none") return; - -// // 헤더 셀 찾기 (fieldName 또는 name으로) -// const headerCells = gridEl.querySelectorAll('.rg-header-cell, [class*="header"], .rg-header'); -// let targetCell: HTMLElement | null = null; - -// headerCells.forEach((cell) => { -// const el = cell as HTMLElement; -// const text = el.textContent?.trim(); -// const colName = col.name; -// const colFieldName = col.fieldName; -// // 헤더 텍스트와 컬럼 이름이 일치하는지 확인 -// if (text && ( -// text === colName || -// text === colFieldName || -// text.includes(colName) || -// (colFieldName && text.includes(colFieldName)) -// )) { -// targetCell = el; -// } -// }); - -// if (!targetCell) return; - -// const headerCell = targetCell as HTMLElement; - -// // 기존 화살표 제거 -// const existingIndicator = headerCell.querySelector(".rg-sort-indicator") as HTMLElement | null; -// if (existingIndicator) { -// existingIndicator.remove(); -// } - -// // 화살표 추가 -// const indicator = document.createElement("span"); -// indicator.className = "rg-sort-indicator"; -// indicator.textContent = direction === "asc" ? "▲" : "▼"; -// indicator.style.marginLeft = "4px"; -// indicator.style.fontSize = "10px"; -// indicator.style.color = "#666"; -// indicator.style.display = "inline-block"; -// indicator.style.verticalAlign = "middle"; -// headerCell.appendChild(indicator); -// }); -// } catch (e) { -// console.warn("updateHeaderSortIndicator error:", e); -// } -// } - /** onSorting: mergeCells: true인 컬럼이 있으면 그룹 내 순서 유지 정렬, 없으면 RealGrid 기본 정렬 */ function createOnSortingHandler( columns: { fieldName?: string; name: string; mergeCells?: boolean; sortdisable?: boolean; valueType?: ValueType }[], @@ -811,7 +719,7 @@ const TabDataGrid = ({ columnInfo, isExcelImport = true, isExcelExport = true, r return (
- + {columnInfo.map((info) => { const tabKey = info.tabKey; const tabLabel = info.tabLabel || tabKey;