Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private getStyledRegionGroups() {
// show 3 styled regions as samples
return !this.state.showCustomRegions
? []
: ([
{
className: "tbl-styled-region-success",
regions: [Regions.cell(0, 0, 3, 3)],
},
{
className: "tbl-styled-region-warning",
regions: [Regions.cell(2, 1, 8, 1)],
},
{
className: "tbl-styled-region-danger",
regions: [Regions.cell(5, 3, 7, 7)],
},
] as IStyledRegionGroup[]);
}
}
private getStyledRegionGroups() {
// show 3 styled regions as samples
return !this.state.showCustomRegions
? []
: ([
{
className: "tbl-styled-region-success",
regions: [Regions.cell(0, 0, 3, 3)],
},
{
className: "tbl-styled-region-warning",
regions: [Regions.cell(2, 1, 8, 1)],
},
{
className: "tbl-styled-region-danger",
regions: [Regions.cell(5, 3, 7, 7)],
},
] as IStyledRegionGroup[]);
}
}
private getStyledRegionGroups() {
// show 3 styled regions as samples
return !this.state.showCustomRegions
? []
: ([
{
className: "tbl-styled-region-success",
regions: [Regions.cell(0, 0, 3, 3)],
},
{
className: "tbl-styled-region-warning",
regions: [Regions.cell(2, 1, 8, 1)],
},
{
className: "tbl-styled-region-danger",
regions: [Regions.cell(5, 3, 7, 7)],
},
] as IStyledRegionGroup[]);
}
}
private handleScrollToButtonClick = () => {
const { scrollToRowIndex, scrollToColumnIndex, scrollToRegionType } = this.state;
let region: IRegion;
switch (scrollToRegionType) {
case RegionCardinality.CELLS:
region = Regions.cell(scrollToRowIndex, scrollToColumnIndex);
break;
case RegionCardinality.FULL_ROWS:
region = Regions.row(scrollToRowIndex);
break;
case RegionCardinality.FULL_COLUMNS:
region = Regions.column(scrollToColumnIndex);
break;
case RegionCardinality.FULL_TABLE:
region = Regions.table();
break;
default:
return;
}
this.tableInstance.scrollToRegion(region);
};
);
ReactDOM.render(
getTableComponent(
3,
7,
{
columnHeaderCellRenderer: (columnIndex: number) => {
return ;
},
},
{
styledRegionGroups: [
{
className: "my-group",
regions: [Regions.cell(0, 0), Regions.row(2), Regions.cell(1, 2, 5, 2)],
},
],
},
),
document.getElementById("table-5"),
);
ReactDOM.render(
getTableComponent(
10,
70,
{
columnHeaderCellRenderer: (columnIndex: number) => {
const alpha = Utils.toBase26Alpha(columnIndex);
return (