ngxsmk-datatable
Version:
A powerful, feature-rich Angular datatable component with virtual scrolling, built for Angular 17+
80 lines (79 loc) • 2.75 kB
TypeScript
import * as i0 from "@angular/core";
/**
* Cell merge information
*/
export interface CellMergeInfo {
/** Starting row index */
startRow: number;
/** Ending row index */
endRow: number;
/** Starting column index */
startCol: number;
/** Ending column index */
endCol: number;
/** Row span count */
rowSpan: number;
/** Column span count */
colSpan: number;
/** Is this the master cell (top-left) */
isMaster: boolean;
/** Is this cell part of a merged group but hidden */
isHidden: boolean;
}
/**
* Service for managing cell merging operations
*/
export declare class CellMergeService {
/**
* Calculate cell merges for a dataset
*/
calculateMerges<T = any>(rows: T[], columns: any[], mergeRules: {
[columnId: string]: (current: any, previous: any) => boolean;
}): Map<string, CellMergeInfo>;
/**
* Get merge info for a cell
*/
getCellMergeInfo(rowIndex: number, colIndex: number, merges: Map<string, CellMergeInfo>): CellMergeInfo | null;
/**
* Check if cell should be hidden due to merging
*/
isCellHidden(rowIndex: number, colIndex: number, merges: Map<string, CellMergeInfo>): boolean;
/**
* Get rowspan for a cell
*/
getRowSpan(rowIndex: number, colIndex: number, merges: Map<string, CellMergeInfo>): number;
/**
* Get colspan for a cell
*/
getColSpan(rowIndex: number, colIndex: number, merges: Map<string, CellMergeInfo>): number;
/**
* Create horizontal merge (merge columns in same row)
*/
createHorizontalMerge(rowIndex: number, startColIndex: number, endColIndex: number, merges: Map<string, CellMergeInfo>): void;
/**
* Create vertical merge (merge rows in same column)
*/
createVerticalMerge(colIndex: number, startRowIndex: number, endRowIndex: number, merges: Map<string, CellMergeInfo>): void;
/**
* Create area merge (merge rectangular area)
*/
createAreaMerge(startRowIndex: number, endRowIndex: number, startColIndex: number, endColIndex: number, merges: Map<string, CellMergeInfo>): void;
/**
* Remove merge from a cell
*/
removeMerge(rowIndex: number, colIndex: number, merges: Map<string, CellMergeInfo>): void;
/**
* Clear all merges
*/
clearAllMerges(merges: Map<string, CellMergeInfo>): void;
/**
* Get all master cells
*/
getAllMasterCells(merges: Map<string, CellMergeInfo>): CellMergeInfo[];
/**
* Check if any merges exist
*/
hasMerges(merges: Map<string, CellMergeInfo>): boolean;
static ɵfac: i0.ɵɵFactoryDeclaration<CellMergeService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<CellMergeService>;
}