Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"Row",
"scrollToRowIndex",
Utils.times(this.state.numRows, rowIndex => rowIndex),
rowIndex => `${rowIndex + 1}`,
this.handleNumberStateChange,
);
const scrollToColumnSelectMenu = this.renderSelectMenu(
"Column",
"scrollToColumnIndex",
Utils.times(this.state.numCols, columnIndex => columnIndex),
columnIndex => this.store.getColumnName(columnIndex),
this.handleNumberStateChange,
);
const ROW_MENU_CARDINALITIES = [RegionCardinality.CELLS, RegionCardinality.FULL_ROWS];
const COLUMN_MENU_CARDINALITIES = [RegionCardinality.CELLS, RegionCardinality.FULL_COLUMNS];
const shouldShowRowSelectMenu = contains(ROW_MENU_CARDINALITIES, scrollToRegionType);
const shouldShowColumnSelectMenu = contains(COLUMN_MENU_CARDINALITIES, scrollToRegionType);
return (
<div>
{scrollToRegionTypeSelectMenu}
<div>
{shouldShowRowSelectMenu ? scrollToRowSelectMenu : undefined}
{shouldShowColumnSelectMenu ? scrollToColumnSelectMenu : undefined}
</div>
<button fill="{true}">
</button></div>
);
}
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;
}