-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathindex.ts
More file actions
26 lines (22 loc) · 828 Bytes
/
index.ts
File metadata and controls
26 lines (22 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import type { CalculatedColumnOrColumnGroup, Maybe } from '../types';
export * from './colSpanUtils';
export * from './domUtils';
export * from './eventUtils';
export * from './keyboardUtils';
export * from './renderMeasuringCells';
export * from './selectedCellUtils';
export * from './styleUtils';
export const { min, max, floor, sign, abs } = Math;
export function assertIsValidKeyGetter<R, K extends React.Key>(
keyGetter: Maybe<(row: NoInfer<R>) => K>
): asserts keyGetter is (row: R) => K {
if (typeof keyGetter !== 'function') {
throw new Error('Please specify the rowKeyGetter prop to use selection');
}
}
export function getHeaderCellRowSpan<R, SR>(
column: CalculatedColumnOrColumnGroup<R, SR>,
rowIdx: number
) {
return column.parent === undefined ? rowIdx : column.level - column.parent.level;
}