st: fix: 불필요 주석 삭제

This commit is contained in:
2026-03-30 16:27:37 +09:00
parent a73265eac6
commit 42632d96ad
2 changed files with 5 additions and 93 deletions
+4
View File
@@ -105,3 +105,7 @@
}
}
}
.tabs-content {
margin-top: 0.6rem !important;
}
+1 -93
View File
@@ -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<string, "asc" | "desc" | "none">,
// 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 (
<div className="flex flex-col gap-[0.6rem] mx-[0.6rem]">
<Tabs value={activeTab} onValueChange={setActiveTab} className="w-full" variant="default">
<TabsList className="mb-4">
<TabsList>
{columnInfo.map((info) => {
const tabKey = info.tabKey;
const tabLabel = info.tabLabel || tabKey;