Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
type IMutableStateUpdateCallback = (
stateKey: keyof IMutableTableState,
) => (event: React.FormEvent) => void;
const COLUMN_COUNTS = [0, 1, 5, 20, 100, 1000];
const ROW_COUNTS = [0, 1, 5, 20, 100, 1000, 100000];
const FROZEN_COLUMN_COUNTS = [0, 1, 2, 5, 20, 100, 1000];
const FROZEN_ROW_COUNTS = [0, 1, 2, 5, 20, 100, 1000];
const REGION_CARDINALITIES: RegionCardinality[] = [
RegionCardinality.CELLS,
RegionCardinality.FULL_ROWS,
RegionCardinality.FULL_COLUMNS,
RegionCardinality.FULL_TABLE,
];
const RENDER_MODES: RenderMode[] = [RenderMode.BATCH_ON_UPDATE, RenderMode.BATCH, RenderMode.NONE];
const SELECTION_MODES: SelectedRegionTransformPreset[] = [
SelectedRegionTransformPreset.CELL,
SelectedRegionTransformPreset.ROW,
SelectedRegionTransformPreset.COLUMN,
];
const CELL_CONTENTS: CellContent[] = [
CellContent.EMPTY,
CellContent.CELL_NAMES,
CellContent.LONG_TEXT,
CellContent.LARGE_JSON,
];
private getEnabledSelectionModes() {
const selectionModes: RegionCardinality[] = [];
if (this.state.enableFullTableSelection) {
selectionModes.push(RegionCardinality.FULL_TABLE);
}
if (this.state.enableColumnSelection) {
selectionModes.push(RegionCardinality.FULL_COLUMNS);
}
if (this.state.enableRowSelection) {
selectionModes.push(RegionCardinality.FULL_ROWS);
}
if (this.state.enableCellSelection) {
selectionModes.push(RegionCardinality.CELLS);
}
return selectionModes;
}