2020-10-06 09:01:51 +00:00
|
|
|
import React, { lazy, Suspense } from "react";
|
2019-09-13 10:45:49 +00:00
|
|
|
import BaseWidget, { WidgetProps, WidgetState } from "./BaseWidget";
|
2020-10-06 09:01:51 +00:00
|
|
|
import { RenderModes, WidgetType } from "constants/WidgetConstants";
|
2020-02-18 10:41:52 +00:00
|
|
|
import { EventType } from "constants/ActionConstants";
|
2020-07-20 06:04:05 +00:00
|
|
|
import {
|
2020-08-10 11:16:13 +00:00
|
|
|
compare,
|
2020-10-06 09:01:51 +00:00
|
|
|
ConditionFunctions,
|
2020-07-20 06:04:05 +00:00
|
|
|
getAllTableColumnKeys,
|
|
|
|
|
renderActions,
|
2020-10-06 09:01:51 +00:00
|
|
|
renderCell,
|
2020-07-20 06:04:05 +00:00
|
|
|
reorderColumns,
|
2020-08-10 11:16:13 +00:00
|
|
|
sortTableFunction,
|
2020-07-20 06:04:05 +00:00
|
|
|
} from "components/designSystems/appsmith/TableUtilities";
|
2019-11-25 05:07:27 +00:00
|
|
|
import { VALIDATION_TYPES } from "constants/WidgetValidation";
|
2020-03-16 07:59:07 +00:00
|
|
|
import {
|
|
|
|
|
BASE_WIDGET_VALIDATION,
|
2020-10-06 09:01:51 +00:00
|
|
|
WidgetPropertyValidationType,
|
2020-03-16 07:59:07 +00:00
|
|
|
} from "utils/ValidationFactory";
|
2020-01-23 07:53:36 +00:00
|
|
|
import { ColumnAction } from "components/propertyControls/ColumnActionSelectorControl";
|
2020-02-18 10:41:52 +00:00
|
|
|
import { TriggerPropertiesMap } from "utils/WidgetFactory";
|
2020-04-16 08:32:58 +00:00
|
|
|
import Skeleton from "components/utils/Skeleton";
|
2020-07-20 06:04:05 +00:00
|
|
|
import moment from "moment";
|
2020-10-06 09:01:51 +00:00
|
|
|
import { isNumber, isString, isUndefined } from "lodash";
|
2020-08-28 17:23:07 +00:00
|
|
|
import * as Sentry from "@sentry/react";
|
2020-09-15 06:59:58 +00:00
|
|
|
import { retryPromise } from "utils/AppsmithUtils";
|
2020-10-06 09:01:51 +00:00
|
|
|
import withMeta, { WithMeta } from "./MetaHOC";
|
2020-09-08 13:04:51 +00:00
|
|
|
|
2020-08-10 11:16:13 +00:00
|
|
|
const ReactTableComponent = lazy(() =>
|
2020-09-15 06:59:58 +00:00
|
|
|
retryPromise(() =>
|
|
|
|
|
import("components/designSystems/appsmith/ReactTableComponent"),
|
|
|
|
|
),
|
2020-08-10 11:16:13 +00:00
|
|
|
);
|
2019-10-31 10:10:57 +00:00
|
|
|
|
2020-08-10 11:16:13 +00:00
|
|
|
export type TableSizes = {
|
|
|
|
|
COLUMN_HEADER_HEIGHT: number;
|
|
|
|
|
TABLE_HEADER_HEIGHT: number;
|
|
|
|
|
ROW_HEIGHT: number;
|
2020-08-13 16:41:08 +00:00
|
|
|
ROW_FONT_SIZE: number;
|
2020-08-10 11:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export enum CompactModeTypes {
|
|
|
|
|
SHORT = "SHORT",
|
|
|
|
|
DEFAULT = "DEFAULT",
|
2020-08-13 16:41:08 +00:00
|
|
|
TALL = "TALL",
|
2020-08-10 11:16:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const TABLE_SIZES: { [key: string]: TableSizes } = {
|
|
|
|
|
[CompactModeTypes.DEFAULT]: {
|
2020-08-13 16:41:08 +00:00
|
|
|
COLUMN_HEADER_HEIGHT: 38,
|
2020-08-28 09:55:20 +00:00
|
|
|
TABLE_HEADER_HEIGHT: 42,
|
2020-08-13 16:41:08 +00:00
|
|
|
ROW_HEIGHT: 40,
|
2020-08-28 09:55:20 +00:00
|
|
|
ROW_FONT_SIZE: 14,
|
2020-08-10 11:16:13 +00:00
|
|
|
},
|
|
|
|
|
[CompactModeTypes.SHORT]: {
|
2020-08-13 16:41:08 +00:00
|
|
|
COLUMN_HEADER_HEIGHT: 38,
|
2020-08-28 09:55:20 +00:00
|
|
|
TABLE_HEADER_HEIGHT: 42,
|
2020-08-13 16:41:08 +00:00
|
|
|
ROW_HEIGHT: 20,
|
2020-08-28 09:55:20 +00:00
|
|
|
ROW_FONT_SIZE: 12,
|
2020-08-13 16:41:08 +00:00
|
|
|
},
|
|
|
|
|
[CompactModeTypes.TALL]: {
|
|
|
|
|
COLUMN_HEADER_HEIGHT: 38,
|
2020-08-28 09:55:20 +00:00
|
|
|
TABLE_HEADER_HEIGHT: 42,
|
2020-08-13 16:41:08 +00:00
|
|
|
ROW_HEIGHT: 60,
|
2020-08-28 09:55:20 +00:00
|
|
|
ROW_FONT_SIZE: 18,
|
2020-08-10 11:16:13 +00:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export enum ColumnTypes {
|
|
|
|
|
CURRENCY = "currency",
|
|
|
|
|
TIME = "time",
|
|
|
|
|
DATE = "date",
|
|
|
|
|
VIDEO = "video",
|
|
|
|
|
IMAGE = "image",
|
|
|
|
|
TEXT = "text",
|
|
|
|
|
NUMBER = "number",
|
2020-08-10 06:45:31 +00:00
|
|
|
}
|
|
|
|
|
|
2020-08-10 11:16:13 +00:00
|
|
|
export enum OperatorTypes {
|
|
|
|
|
OR = "OR",
|
|
|
|
|
AND = "AND",
|
|
|
|
|
}
|
2019-09-13 10:45:49 +00:00
|
|
|
class TableWidget extends BaseWidget<TableWidgetProps, WidgetState> {
|
2019-11-19 12:44:58 +00:00
|
|
|
static getPropertyValidationMap(): WidgetPropertyValidationType {
|
|
|
|
|
return {
|
2020-03-16 07:59:07 +00:00
|
|
|
...BASE_WIDGET_VALIDATION,
|
2019-11-19 12:44:58 +00:00
|
|
|
tableData: VALIDATION_TYPES.TABLE_DATA,
|
2019-11-22 13:12:39 +00:00
|
|
|
nextPageKey: VALIDATION_TYPES.TEXT,
|
|
|
|
|
prevPageKey: VALIDATION_TYPES.TEXT,
|
|
|
|
|
label: VALIDATION_TYPES.TEXT,
|
2020-07-24 13:58:28 +00:00
|
|
|
searchText: VALIDATION_TYPES.TEXT,
|
2020-08-07 18:09:54 +00:00
|
|
|
defaultSearchText: VALIDATION_TYPES.TEXT,
|
2020-01-17 09:28:26 +00:00
|
|
|
};
|
|
|
|
|
}
|
2019-11-19 12:44:58 +00:00
|
|
|
|
2020-04-17 16:15:09 +00:00
|
|
|
static getMetaPropertiesMap(): Record<string, any> {
|
|
|
|
|
return {
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: undefined,
|
|
|
|
|
selectedRowIndex: -1,
|
2020-09-09 07:12:15 +00:00
|
|
|
selectedRowIndices: [],
|
2020-08-07 18:09:54 +00:00
|
|
|
searchText: undefined,
|
2020-08-21 16:43:02 +00:00
|
|
|
selectedRow: {},
|
2020-09-08 13:04:51 +00:00
|
|
|
selectedRows: [],
|
2020-07-29 06:15:06 +00:00
|
|
|
// The following meta property is used for rendering the table.
|
2020-08-17 07:31:17 +00:00
|
|
|
filteredTableData: undefined,
|
2020-04-17 16:15:09 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-07 18:09:54 +00:00
|
|
|
static getDefaultPropertiesMap(): Record<string, string> {
|
|
|
|
|
return {
|
|
|
|
|
searchText: "defaultSearchText",
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 10:41:52 +00:00
|
|
|
static getTriggerPropertyMap(): TriggerPropertiesMap {
|
|
|
|
|
return {
|
|
|
|
|
onRowSelected: true,
|
|
|
|
|
onPageChange: true,
|
2020-07-24 10:32:31 +00:00
|
|
|
onSearchTextChanged: true,
|
2020-09-15 16:54:15 +00:00
|
|
|
columnActions: true,
|
2020-02-18 10:41:52 +00:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-20 06:04:05 +00:00
|
|
|
getTableColumns = (tableData: object[]) => {
|
|
|
|
|
let columns: ReactTableColumnProps[] = [];
|
|
|
|
|
const hiddenColumns: ReactTableColumnProps[] = [];
|
|
|
|
|
const {
|
|
|
|
|
columnNameMap,
|
|
|
|
|
columnSizeMap,
|
|
|
|
|
columnTypeMap,
|
|
|
|
|
columnActions,
|
|
|
|
|
} = this.props;
|
|
|
|
|
if (tableData.length) {
|
|
|
|
|
const columnKeys: string[] = getAllTableColumnKeys(tableData);
|
2020-08-10 06:45:31 +00:00
|
|
|
const sortedColumn = this.props.sortedColumn;
|
2020-07-20 06:04:05 +00:00
|
|
|
for (let index = 0; index < columnKeys.length; index++) {
|
|
|
|
|
const i = columnKeys[index];
|
|
|
|
|
const columnName: string =
|
|
|
|
|
columnNameMap && columnNameMap[i] ? columnNameMap[i] : i;
|
2020-09-11 10:40:15 +00:00
|
|
|
const columnType: {
|
|
|
|
|
type: string;
|
|
|
|
|
format?: string;
|
|
|
|
|
inputFormat?: string;
|
|
|
|
|
} =
|
2020-07-20 06:04:05 +00:00
|
|
|
columnTypeMap && columnTypeMap[i]
|
|
|
|
|
? columnTypeMap[i]
|
|
|
|
|
: { type: ColumnTypes.TEXT };
|
|
|
|
|
const columnSize: number =
|
|
|
|
|
columnSizeMap && columnSizeMap[i] ? columnSizeMap[i] : 150;
|
|
|
|
|
const isHidden =
|
|
|
|
|
!!this.props.hiddenColumns && this.props.hiddenColumns.includes(i);
|
|
|
|
|
const columnData = {
|
|
|
|
|
Header: columnName,
|
|
|
|
|
accessor: i,
|
|
|
|
|
width: columnSize,
|
|
|
|
|
minWidth: 60,
|
|
|
|
|
draggable: true,
|
|
|
|
|
isHidden: false,
|
2020-08-10 06:45:31 +00:00
|
|
|
isAscOrder:
|
|
|
|
|
sortedColumn && sortedColumn.column === i
|
|
|
|
|
? sortedColumn.asc
|
|
|
|
|
: undefined,
|
2020-07-20 06:04:05 +00:00
|
|
|
metaProperties: {
|
|
|
|
|
isHidden: isHidden,
|
|
|
|
|
type: columnType.type,
|
|
|
|
|
format: columnType.format,
|
2020-09-11 10:40:15 +00:00
|
|
|
inputFormat: columnType.inputFormat,
|
2020-07-20 06:04:05 +00:00
|
|
|
},
|
|
|
|
|
Cell: (props: any) => {
|
|
|
|
|
return renderCell(props.cell.value, columnType.type, isHidden);
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
if (isHidden) {
|
|
|
|
|
columnData.isHidden = true;
|
|
|
|
|
hiddenColumns.push(columnData);
|
|
|
|
|
} else {
|
|
|
|
|
columns.push(columnData);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
columns = reorderColumns(columns, this.props.columnOrder || []);
|
|
|
|
|
if (columnActions?.length) {
|
|
|
|
|
columns.push({
|
|
|
|
|
Header:
|
|
|
|
|
columnNameMap && columnNameMap["actions"]
|
|
|
|
|
? columnNameMap["actions"]
|
|
|
|
|
: "Actions",
|
|
|
|
|
accessor: "actions",
|
|
|
|
|
width: 150,
|
|
|
|
|
minWidth: 60,
|
|
|
|
|
draggable: true,
|
2020-07-28 14:26:27 +00:00
|
|
|
Cell: (props: any) => {
|
2020-07-20 06:04:05 +00:00
|
|
|
return renderActions({
|
2020-07-28 14:26:27 +00:00
|
|
|
isSelected: props.row.isSelected,
|
2020-07-20 06:04:05 +00:00
|
|
|
columnActions: columnActions,
|
|
|
|
|
onCommandClick: this.onCommandClick,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
hiddenColumns.length &&
|
|
|
|
|
this.props.renderMode === RenderModes.CANVAS
|
|
|
|
|
) {
|
|
|
|
|
columns = columns.concat(hiddenColumns);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return columns;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
transformData = (tableData: object[], columns: ReactTableColumnProps[]) => {
|
|
|
|
|
const updatedTableData = [];
|
2020-08-17 07:31:17 +00:00
|
|
|
for (let row = 0; row < tableData.length; row++) {
|
|
|
|
|
const data: { [key: string]: any } = tableData[row];
|
2020-07-20 06:04:05 +00:00
|
|
|
const tableRow: { [key: string]: any } = {};
|
|
|
|
|
for (let colIndex = 0; colIndex < columns.length; colIndex++) {
|
|
|
|
|
const column = columns[colIndex];
|
|
|
|
|
const { accessor } = column;
|
2020-09-11 10:40:15 +00:00
|
|
|
let value = data[accessor];
|
2020-07-20 06:04:05 +00:00
|
|
|
if (column.metaProperties) {
|
|
|
|
|
const type = column.metaProperties.type;
|
|
|
|
|
const format = column.metaProperties.format;
|
|
|
|
|
switch (type) {
|
|
|
|
|
case ColumnTypes.CURRENCY:
|
|
|
|
|
if (!isNaN(value)) {
|
|
|
|
|
tableRow[accessor] = `${format}${value ? value : ""}`;
|
|
|
|
|
} else {
|
|
|
|
|
tableRow[accessor] = "Invalid Value";
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ColumnTypes.DATE:
|
|
|
|
|
let isValidDate = true;
|
2020-09-11 10:40:15 +00:00
|
|
|
let outputFormat = column.metaProperties.format;
|
|
|
|
|
let inputFormat;
|
|
|
|
|
try {
|
|
|
|
|
const type = column.metaProperties.inputFormat;
|
|
|
|
|
if (type !== "EPOCH" && type !== "Milliseconds") {
|
|
|
|
|
inputFormat = type;
|
|
|
|
|
moment(value, inputFormat);
|
|
|
|
|
} else if (!isNumber(value)) {
|
2020-07-20 06:04:05 +00:00
|
|
|
isValidDate = false;
|
|
|
|
|
}
|
2020-09-11 10:40:15 +00:00
|
|
|
} catch (e) {
|
|
|
|
|
isValidDate = false;
|
2020-07-20 06:04:05 +00:00
|
|
|
}
|
|
|
|
|
if (isValidDate) {
|
2020-09-11 10:40:15 +00:00
|
|
|
if (outputFormat === "SAME_AS_INPUT") {
|
|
|
|
|
outputFormat = inputFormat;
|
|
|
|
|
}
|
|
|
|
|
if (column.metaProperties.inputFormat === "Milliseconds") {
|
|
|
|
|
value = 1000 * Number(value);
|
|
|
|
|
}
|
|
|
|
|
tableRow[accessor] = moment(value, inputFormat).format(
|
|
|
|
|
outputFormat,
|
|
|
|
|
);
|
2020-08-10 10:01:36 +00:00
|
|
|
} else if (value) {
|
2020-07-20 06:04:05 +00:00
|
|
|
tableRow[accessor] = "Invalid Value";
|
2020-08-10 10:01:36 +00:00
|
|
|
} else {
|
|
|
|
|
tableRow[accessor] = "";
|
2020-07-20 06:04:05 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ColumnTypes.TIME:
|
|
|
|
|
let isValidTime = true;
|
|
|
|
|
if (isNaN(value)) {
|
|
|
|
|
const time = Date.parse(value);
|
|
|
|
|
if (isNaN(time)) {
|
|
|
|
|
isValidTime = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isValidTime) {
|
|
|
|
|
tableRow[accessor] = moment(value).format("HH:mm");
|
2020-08-10 10:01:36 +00:00
|
|
|
} else if (value) {
|
2020-07-20 06:04:05 +00:00
|
|
|
tableRow[accessor] = "Invalid Value";
|
2020-08-10 10:01:36 +00:00
|
|
|
} else {
|
|
|
|
|
tableRow[accessor] = "";
|
2020-07-20 06:04:05 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2020-09-11 10:40:15 +00:00
|
|
|
const data =
|
|
|
|
|
isString(value) || isNumber(value)
|
|
|
|
|
? value
|
|
|
|
|
: isUndefined(value)
|
|
|
|
|
? ""
|
|
|
|
|
: JSON.stringify(value);
|
|
|
|
|
tableRow[accessor] = data;
|
2020-07-20 06:04:05 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
updatedTableData.push(tableRow);
|
|
|
|
|
}
|
|
|
|
|
return updatedTableData;
|
|
|
|
|
};
|
|
|
|
|
|
2020-08-18 11:30:26 +00:00
|
|
|
filterTableData = () => {
|
|
|
|
|
const { searchText, sortedColumn, filters, tableData } = this.props;
|
|
|
|
|
const columns = this.getTableColumns(tableData);
|
|
|
|
|
if (!tableData || !tableData.length) {
|
|
|
|
|
return [];
|
|
|
|
|
}
|
2020-10-06 09:01:51 +00:00
|
|
|
let sortedTableData: any[];
|
2020-08-18 11:30:26 +00:00
|
|
|
const searchKey = searchText ? searchText.toUpperCase() : "";
|
|
|
|
|
if (sortedColumn) {
|
|
|
|
|
const sortColumn = sortedColumn.column;
|
|
|
|
|
const sortOrder = sortedColumn.asc;
|
|
|
|
|
sortedTableData = sortTableFunction(
|
|
|
|
|
tableData,
|
|
|
|
|
columns,
|
|
|
|
|
sortColumn,
|
|
|
|
|
sortOrder,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
sortedTableData = [...tableData];
|
|
|
|
|
}
|
2020-10-06 09:01:51 +00:00
|
|
|
return sortedTableData.filter((item: { [key: string]: any }) => {
|
|
|
|
|
const searchFound = searchKey
|
|
|
|
|
? Object.values(item)
|
|
|
|
|
.join(", ")
|
|
|
|
|
.toUpperCase()
|
|
|
|
|
.includes(searchKey)
|
|
|
|
|
: true;
|
|
|
|
|
if (!searchFound) return false;
|
|
|
|
|
if (!filters || filters.length === 0) return true;
|
|
|
|
|
const filterOperator: Operator =
|
|
|
|
|
filters.length >= 2 ? filters[1].operator : OperatorTypes.OR;
|
|
|
|
|
let filter = filterOperator === OperatorTypes.AND;
|
|
|
|
|
for (let i = 0; i < filters.length; i++) {
|
|
|
|
|
const filterValue = compare(
|
|
|
|
|
item[filters[i].column],
|
|
|
|
|
filters[i].value,
|
|
|
|
|
filters[i].condition,
|
|
|
|
|
);
|
|
|
|
|
if (filterOperator === OperatorTypes.AND) {
|
|
|
|
|
filter = filter && filterValue;
|
|
|
|
|
} else {
|
|
|
|
|
filter = filter || filterValue;
|
2020-08-18 11:30:26 +00:00
|
|
|
}
|
2020-10-06 09:01:51 +00:00
|
|
|
}
|
|
|
|
|
return filter;
|
|
|
|
|
});
|
2020-08-10 11:16:13 +00:00
|
|
|
};
|
|
|
|
|
|
2020-09-08 13:04:51 +00:00
|
|
|
getSelectedRow = (filteredTableData: object[], selectedRowIndex?: number) => {
|
2020-08-20 06:39:16 +00:00
|
|
|
if (selectedRowIndex === undefined || selectedRowIndex === -1) {
|
|
|
|
|
const columnKeys: string[] = getAllTableColumnKeys(this.props.tableData);
|
|
|
|
|
const selectedRow: { [key: string]: any } = {};
|
|
|
|
|
for (let i = 0; i < columnKeys.length; i++) {
|
|
|
|
|
selectedRow[columnKeys[i]] = undefined;
|
|
|
|
|
}
|
|
|
|
|
return selectedRow;
|
|
|
|
|
}
|
|
|
|
|
return filteredTableData[selectedRowIndex];
|
|
|
|
|
};
|
|
|
|
|
|
2020-08-18 11:30:26 +00:00
|
|
|
componentDidMount() {
|
2020-08-20 06:39:16 +00:00
|
|
|
const filteredTableData = this.filterTableData();
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("filteredTableData", filteredTableData);
|
2020-09-08 13:04:51 +00:00
|
|
|
const { selectedRowIndex } = this.props;
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-08-20 06:39:16 +00:00
|
|
|
"selectedRow",
|
2020-09-08 13:04:51 +00:00
|
|
|
this.getSelectedRow(filteredTableData, selectedRowIndex),
|
2020-08-20 06:39:16 +00:00
|
|
|
);
|
2020-08-18 11:30:26 +00:00
|
|
|
}
|
|
|
|
|
componentDidUpdate(prevProps: TableWidgetProps) {
|
2020-09-11 11:37:33 +00:00
|
|
|
const tableDataUpdated =
|
2020-08-18 11:30:26 +00:00
|
|
|
JSON.stringify(this.props.tableData) !==
|
2020-09-11 11:37:33 +00:00
|
|
|
JSON.stringify(prevProps.tableData);
|
|
|
|
|
if (
|
|
|
|
|
tableDataUpdated ||
|
2020-08-18 11:30:26 +00:00
|
|
|
JSON.stringify(this.props.filters) !==
|
|
|
|
|
JSON.stringify(prevProps.filters) ||
|
|
|
|
|
this.props.searchText !== prevProps.searchText ||
|
|
|
|
|
JSON.stringify(this.props.sortedColumn) !==
|
2020-08-26 05:41:18 +00:00
|
|
|
JSON.stringify(prevProps.sortedColumn) ||
|
|
|
|
|
!this.props.filteredTableData
|
2020-08-18 11:30:26 +00:00
|
|
|
) {
|
2020-08-20 06:39:16 +00:00
|
|
|
const filteredTableData = this.filterTableData();
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
|
|
|
|
"filteredTableData",
|
|
|
|
|
filteredTableData,
|
|
|
|
|
);
|
2020-09-08 13:04:51 +00:00
|
|
|
if (!this.props.multiRowSelection) {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-08 13:04:51 +00:00
|
|
|
"selectedRow",
|
|
|
|
|
this.getSelectedRow(filteredTableData),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-08 13:04:51 +00:00
|
|
|
"selectedRows",
|
|
|
|
|
filteredTableData.filter((item: object, i: number) => {
|
2020-09-09 07:12:15 +00:00
|
|
|
return this.props.selectedRowIndices.includes(i);
|
2020-09-08 13:04:51 +00:00
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-09-11 11:37:33 +00:00
|
|
|
if (tableDataUpdated) {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("selectedRowIndices", []);
|
|
|
|
|
this.props.updateWidgetMetaProperty("selectedRows", []);
|
|
|
|
|
this.props.updateWidgetMetaProperty("selectedRowIndex", -1);
|
2020-09-11 11:37:33 +00:00
|
|
|
}
|
2020-09-08 13:04:51 +00:00
|
|
|
if (this.props.multiRowSelection !== prevProps.multiRowSelection) {
|
|
|
|
|
if (this.props.multiRowSelection) {
|
2020-09-09 07:12:15 +00:00
|
|
|
const selectedRowIndices = this.props.selectedRowIndex
|
2020-09-08 13:04:51 +00:00
|
|
|
? [this.props.selectedRowIndex]
|
|
|
|
|
: [];
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-09 07:12:15 +00:00
|
|
|
"selectedRowIndices",
|
|
|
|
|
selectedRowIndices,
|
2020-09-08 13:04:51 +00:00
|
|
|
);
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("selectedRowIndex", -1);
|
2020-09-08 13:04:51 +00:00
|
|
|
const filteredTableData = this.filterTableData();
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-08 13:04:51 +00:00
|
|
|
"selectedRows",
|
|
|
|
|
filteredTableData.filter((item: object, i: number) => {
|
2020-09-09 07:12:15 +00:00
|
|
|
return selectedRowIndices.includes(i);
|
2020-09-08 13:04:51 +00:00
|
|
|
}),
|
|
|
|
|
);
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-08 13:04:51 +00:00
|
|
|
"selectedRow",
|
|
|
|
|
this.getSelectedRow(filteredTableData),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
const filteredTableData = this.filterTableData();
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("selectedRowIndices", []);
|
|
|
|
|
this.props.updateWidgetMetaProperty("selectedRows", []);
|
|
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-08 13:04:51 +00:00
|
|
|
"selectedRow",
|
|
|
|
|
this.getSelectedRow(filteredTableData),
|
|
|
|
|
);
|
|
|
|
|
}
|
2020-08-18 11:30:26 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-08 13:04:51 +00:00
|
|
|
getSelectedRowIndexes = (selectedRowIndexes: string) => {
|
|
|
|
|
return selectedRowIndexes
|
|
|
|
|
? selectedRowIndexes.split(",").map(i => Number(i))
|
|
|
|
|
: [];
|
|
|
|
|
};
|
|
|
|
|
|
2019-09-12 08:11:25 +00:00
|
|
|
getPageView() {
|
2020-09-08 13:04:51 +00:00
|
|
|
const {
|
|
|
|
|
tableData,
|
|
|
|
|
hiddenColumns,
|
|
|
|
|
filteredTableData,
|
2020-09-09 07:12:15 +00:00
|
|
|
selectedRowIndices,
|
2020-09-08 13:04:51 +00:00
|
|
|
} = this.props;
|
2020-07-20 06:04:05 +00:00
|
|
|
const tableColumns = this.getTableColumns(tableData);
|
2020-08-18 11:30:26 +00:00
|
|
|
|
2020-08-17 07:31:17 +00:00
|
|
|
const transformedData = this.transformData(
|
|
|
|
|
filteredTableData || [],
|
|
|
|
|
tableColumns,
|
|
|
|
|
);
|
2020-02-07 11:34:57 +00:00
|
|
|
const serverSidePaginationEnabled = (this.props
|
|
|
|
|
.serverSidePaginationEnabled &&
|
|
|
|
|
this.props.serverSidePaginationEnabled) as boolean;
|
2020-02-07 02:32:52 +00:00
|
|
|
let pageNo = this.props.pageNo;
|
|
|
|
|
|
|
|
|
|
if (pageNo === undefined) {
|
|
|
|
|
pageNo = 1;
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("pageNo", pageNo);
|
2020-02-07 02:32:52 +00:00
|
|
|
}
|
2020-03-27 09:02:11 +00:00
|
|
|
const { componentWidth, componentHeight } = this.getComponentDimensions();
|
2020-08-10 10:01:36 +00:00
|
|
|
const tableSizes =
|
|
|
|
|
TABLE_SIZES[this.props.compactMode || CompactModeTypes.DEFAULT];
|
|
|
|
|
let pageSize = Math.floor(
|
2020-07-16 10:39:07 +00:00
|
|
|
(componentHeight -
|
2020-08-10 10:01:36 +00:00
|
|
|
tableSizes.TABLE_HEADER_HEIGHT -
|
|
|
|
|
tableSizes.COLUMN_HEADER_HEIGHT) /
|
|
|
|
|
tableSizes.ROW_HEIGHT,
|
2020-07-16 10:39:07 +00:00
|
|
|
);
|
2020-08-10 10:01:36 +00:00
|
|
|
if (
|
|
|
|
|
componentHeight -
|
|
|
|
|
(tableSizes.TABLE_HEADER_HEIGHT +
|
|
|
|
|
tableSizes.COLUMN_HEADER_HEIGHT +
|
|
|
|
|
tableSizes.ROW_HEIGHT * pageSize) >
|
2020-08-13 16:41:08 +00:00
|
|
|
0
|
2020-08-10 10:01:36 +00:00
|
|
|
)
|
|
|
|
|
pageSize += 1;
|
2020-04-29 05:13:02 +00:00
|
|
|
|
|
|
|
|
if (pageSize !== this.props.pageSize) {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("pageSize", pageSize);
|
2020-04-29 05:13:02 +00:00
|
|
|
}
|
2020-06-03 10:50:10 +00:00
|
|
|
return (
|
|
|
|
|
<Suspense fallback={<Skeleton />}>
|
2020-07-02 06:26:01 +00:00
|
|
|
<ReactTableComponent
|
|
|
|
|
height={componentHeight}
|
|
|
|
|
width={componentWidth}
|
2020-07-20 06:04:05 +00:00
|
|
|
tableData={transformedData}
|
|
|
|
|
columns={tableColumns}
|
2020-07-02 06:26:01 +00:00
|
|
|
isLoading={this.props.isLoading}
|
|
|
|
|
widgetId={this.props.widgetId}
|
2020-07-20 06:04:05 +00:00
|
|
|
widgetName={this.props.widgetName}
|
2020-07-24 13:58:28 +00:00
|
|
|
searchKey={this.props.searchText}
|
2020-08-20 09:30:19 +00:00
|
|
|
editMode={this.props.renderMode === RenderModes.CANVAS}
|
2020-07-02 06:26:01 +00:00
|
|
|
hiddenColumns={hiddenColumns}
|
|
|
|
|
columnActions={this.props.columnActions}
|
|
|
|
|
columnNameMap={this.props.columnNameMap}
|
|
|
|
|
columnTypeMap={this.props.columnTypeMap}
|
|
|
|
|
columnOrder={this.props.columnOrder}
|
|
|
|
|
pageSize={pageSize}
|
|
|
|
|
onCommandClick={this.onCommandClick}
|
|
|
|
|
selectedRowIndex={
|
|
|
|
|
this.props.selectedRowIndex === undefined
|
|
|
|
|
? -1
|
|
|
|
|
: this.props.selectedRowIndex
|
|
|
|
|
}
|
2020-09-08 13:04:51 +00:00
|
|
|
multiRowSelection={this.props.multiRowSelection}
|
2020-09-09 07:12:15 +00:00
|
|
|
selectedRowIndices={selectedRowIndices}
|
2020-07-02 06:26:01 +00:00
|
|
|
serverSidePaginationEnabled={serverSidePaginationEnabled}
|
|
|
|
|
onRowClick={this.handleRowClick}
|
|
|
|
|
pageNo={pageNo}
|
|
|
|
|
nextPageClick={this.handleNextPageClick}
|
|
|
|
|
prevPageClick={this.handlePrevPageClick}
|
|
|
|
|
updatePageNo={(pageNo: number) => {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("pageNo", pageNo);
|
2020-07-02 06:26:01 +00:00
|
|
|
}}
|
|
|
|
|
updateHiddenColumns={(hiddenColumns?: string[]) => {
|
|
|
|
|
super.updateWidgetProperty("hiddenColumns", hiddenColumns);
|
|
|
|
|
}}
|
|
|
|
|
updateColumnType={(columnTypeMap: {
|
|
|
|
|
[key: string]: { type: string; format: string };
|
|
|
|
|
}) => {
|
|
|
|
|
super.updateWidgetProperty("columnTypeMap", columnTypeMap);
|
|
|
|
|
}}
|
|
|
|
|
updateColumnName={(columnNameMap: { [key: string]: string }) => {
|
|
|
|
|
super.updateWidgetProperty("columnNameMap", columnNameMap);
|
|
|
|
|
}}
|
|
|
|
|
handleResizeColumn={(columnSizeMap: { [key: string]: number }) => {
|
|
|
|
|
super.updateWidgetProperty("columnSizeMap", columnSizeMap);
|
|
|
|
|
}}
|
|
|
|
|
handleReorderColumn={(columnOrder: string[]) => {
|
|
|
|
|
super.updateWidgetProperty("columnOrder", columnOrder);
|
|
|
|
|
}}
|
|
|
|
|
columnSizeMap={this.props.columnSizeMap}
|
|
|
|
|
disableDrag={(disable: boolean) => {
|
|
|
|
|
this.disableDrag(disable);
|
|
|
|
|
}}
|
2020-07-03 08:26:04 +00:00
|
|
|
searchTableData={this.handleSearchTable}
|
2020-08-10 11:16:13 +00:00
|
|
|
filters={this.props.filters}
|
|
|
|
|
applyFilter={(filters: ReactTableFilter[]) => {
|
2020-08-17 07:31:17 +00:00
|
|
|
this.resetSelectedRowIndex();
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("filters", filters);
|
2020-08-10 11:16:13 +00:00
|
|
|
}}
|
2020-08-13 16:41:08 +00:00
|
|
|
compactMode={this.props.compactMode || CompactModeTypes.DEFAULT}
|
2020-08-10 10:01:36 +00:00
|
|
|
updateCompactMode={(compactMode: CompactMode) => {
|
2020-08-17 07:33:37 +00:00
|
|
|
if (this.props.renderMode === RenderModes.CANVAS) {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("compactMode", compactMode);
|
2020-08-17 07:33:37 +00:00
|
|
|
} else {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("compactMode", compactMode);
|
2020-08-17 07:33:37 +00:00
|
|
|
}
|
2020-08-10 10:01:36 +00:00
|
|
|
}}
|
2020-08-20 06:38:16 +00:00
|
|
|
sortTableColumn={this.handleColumnSorting}
|
2020-07-02 06:26:01 +00:00
|
|
|
/>
|
2020-06-03 10:50:10 +00:00
|
|
|
</Suspense>
|
|
|
|
|
);
|
2019-09-12 08:11:25 +00:00
|
|
|
}
|
2019-12-30 10:02:23 +00:00
|
|
|
|
2020-08-20 06:38:16 +00:00
|
|
|
handleColumnSorting = (column: string, asc: boolean) => {
|
|
|
|
|
this.resetSelectedRowIndex();
|
|
|
|
|
if (column === "") {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("sortedColumn", undefined);
|
2020-08-20 06:38:16 +00:00
|
|
|
} else {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("sortedColumn", {
|
2020-08-20 06:38:16 +00:00
|
|
|
column: column,
|
|
|
|
|
asc: asc,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-07-03 08:26:04 +00:00
|
|
|
handleSearchTable = (searchKey: any) => {
|
2020-08-18 11:30:26 +00:00
|
|
|
const { onSearchTextChanged } = this.props;
|
2020-07-24 10:32:31 +00:00
|
|
|
this.resetSelectedRowIndex();
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("pageNo", 1);
|
|
|
|
|
this.props.updateWidgetMetaProperty("searchText", searchKey);
|
2020-07-24 10:32:31 +00:00
|
|
|
if (onSearchTextChanged) {
|
2020-07-03 08:26:04 +00:00
|
|
|
super.executeAction({
|
2020-07-24 10:32:31 +00:00
|
|
|
dynamicString: onSearchTextChanged,
|
2020-07-03 08:26:04 +00:00
|
|
|
event: {
|
|
|
|
|
type: EventType.ON_SEARCH,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-03-30 08:16:43 +00:00
|
|
|
updateHiddenColumns = (hiddenColumns?: string[]) => {
|
2020-06-03 10:50:10 +00:00
|
|
|
super.updateWidgetProperty("hiddenColumns", hiddenColumns);
|
2020-03-30 08:16:43 +00:00
|
|
|
};
|
|
|
|
|
|
2020-07-14 07:55:46 +00:00
|
|
|
onCommandClick = (action: string, onComplete: () => void) => {
|
2020-02-18 10:41:52 +00:00
|
|
|
super.executeAction({
|
|
|
|
|
dynamicString: action,
|
|
|
|
|
event: {
|
|
|
|
|
type: EventType.ON_CLICK,
|
2020-07-14 07:55:46 +00:00
|
|
|
callback: onComplete,
|
2020-02-18 10:41:52 +00:00
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handleRowClick = (rowData: object, index: number) => {
|
2020-09-09 07:12:15 +00:00
|
|
|
const { onRowSelected, selectedRowIndices } = this.props;
|
2020-09-08 13:04:51 +00:00
|
|
|
if (this.props.multiRowSelection) {
|
2020-09-09 07:12:15 +00:00
|
|
|
if (selectedRowIndices.includes(index)) {
|
|
|
|
|
const rowIndex = selectedRowIndices.indexOf(index);
|
|
|
|
|
selectedRowIndices.splice(rowIndex, 1);
|
2020-09-08 13:04:51 +00:00
|
|
|
} else {
|
2020-09-09 07:12:15 +00:00
|
|
|
selectedRowIndices.push(index);
|
2020-09-08 13:04:51 +00:00
|
|
|
}
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty(
|
|
|
|
|
"selectedRowIndices",
|
|
|
|
|
selectedRowIndices,
|
|
|
|
|
);
|
|
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-08 13:04:51 +00:00
|
|
|
"selectedRows",
|
|
|
|
|
this.props.filteredTableData.filter((item: object, i: number) => {
|
2020-09-09 07:12:15 +00:00
|
|
|
return selectedRowIndices.includes(i);
|
2020-09-08 13:04:51 +00:00
|
|
|
}),
|
|
|
|
|
);
|
|
|
|
|
} else {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("selectedRowIndex", index);
|
|
|
|
|
this.props.updateWidgetMetaProperty(
|
2020-09-08 13:04:51 +00:00
|
|
|
"selectedRow",
|
|
|
|
|
this.props.filteredTableData[index],
|
|
|
|
|
);
|
|
|
|
|
}
|
2020-02-18 10:41:52 +00:00
|
|
|
if (onRowSelected) {
|
|
|
|
|
super.executeAction({
|
|
|
|
|
dynamicString: onRowSelected,
|
|
|
|
|
event: {
|
|
|
|
|
type: EventType.ON_ROW_SELECTED,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
handleNextPageClick = () => {
|
|
|
|
|
let pageNo = this.props.pageNo || 1;
|
|
|
|
|
pageNo = pageNo + 1;
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("pageNo", pageNo);
|
2020-02-18 10:41:52 +00:00
|
|
|
if (this.props.onPageChange) {
|
2020-02-27 03:05:14 +00:00
|
|
|
this.resetSelectedRowIndex();
|
2020-02-18 10:41:52 +00:00
|
|
|
super.executeAction({
|
|
|
|
|
dynamicString: this.props.onPageChange,
|
|
|
|
|
event: {
|
|
|
|
|
type: EventType.ON_NEXT_PAGE,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-02-27 03:05:14 +00:00
|
|
|
resetSelectedRowIndex = () => {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("selectedRowIndex", -1);
|
|
|
|
|
this.props.updateWidgetMetaProperty("selectedRowIndices", []);
|
2020-02-27 03:05:14 +00:00
|
|
|
};
|
|
|
|
|
|
2020-02-18 10:41:52 +00:00
|
|
|
handlePrevPageClick = () => {
|
|
|
|
|
let pageNo = this.props.pageNo || 1;
|
|
|
|
|
pageNo = pageNo - 1;
|
|
|
|
|
if (pageNo >= 1) {
|
2020-10-06 09:01:51 +00:00
|
|
|
this.props.updateWidgetMetaProperty("pageNo", pageNo);
|
2020-02-18 10:41:52 +00:00
|
|
|
if (this.props.onPageChange) {
|
2020-02-27 03:05:14 +00:00
|
|
|
this.resetSelectedRowIndex();
|
2020-02-18 10:41:52 +00:00
|
|
|
super.executeAction({
|
|
|
|
|
dynamicString: this.props.onPageChange,
|
|
|
|
|
event: {
|
|
|
|
|
type: EventType.ON_PREV_PAGE,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-23 07:53:36 +00:00
|
|
|
};
|
2019-11-14 11:05:45 +00:00
|
|
|
|
2019-09-12 08:11:25 +00:00
|
|
|
getWidgetType(): WidgetType {
|
|
|
|
|
return "TABLE_WIDGET";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-10 11:16:13 +00:00
|
|
|
export type CompactMode = keyof typeof CompactModeTypes;
|
|
|
|
|
export type Condition = keyof typeof ConditionFunctions | "";
|
|
|
|
|
export type Operator = keyof typeof OperatorTypes;
|
|
|
|
|
export interface ReactTableFilter {
|
|
|
|
|
column: string;
|
|
|
|
|
operator: Operator;
|
|
|
|
|
condition: Condition;
|
|
|
|
|
value: any;
|
|
|
|
|
}
|
|
|
|
|
export interface TableColumnMetaProps {
|
|
|
|
|
isHidden: boolean;
|
|
|
|
|
format?: string;
|
|
|
|
|
type: string;
|
2020-09-11 10:40:15 +00:00
|
|
|
inputFormat?: string;
|
2020-08-10 11:16:13 +00:00
|
|
|
}
|
|
|
|
|
export interface ReactTableColumnProps {
|
|
|
|
|
Header: string;
|
|
|
|
|
accessor: string;
|
|
|
|
|
width: number;
|
|
|
|
|
minWidth: number;
|
|
|
|
|
draggable: boolean;
|
|
|
|
|
isHidden?: boolean;
|
|
|
|
|
isAscOrder?: boolean;
|
|
|
|
|
metaProperties?: TableColumnMetaProps;
|
|
|
|
|
Cell: (props: any) => JSX.Element;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-06 09:01:51 +00:00
|
|
|
export interface TableWidgetProps extends WidgetProps, WithMeta {
|
2019-09-19 11:29:24 +00:00
|
|
|
nextPageKey?: string;
|
|
|
|
|
prevPageKey?: string;
|
2019-09-13 10:45:49 +00:00
|
|
|
label: string;
|
2020-07-24 13:58:28 +00:00
|
|
|
searchText: string;
|
2020-08-07 18:09:54 +00:00
|
|
|
defaultSearchText: string;
|
2019-11-22 13:12:39 +00:00
|
|
|
tableData: object[];
|
2020-02-18 10:41:52 +00:00
|
|
|
onPageChange?: string;
|
2020-04-29 05:13:02 +00:00
|
|
|
pageSize: number;
|
2020-02-18 10:41:52 +00:00
|
|
|
onRowSelected?: string;
|
2020-07-24 10:32:31 +00:00
|
|
|
onSearchTextChanged: string;
|
2020-01-17 09:28:26 +00:00
|
|
|
selectedRowIndex?: number;
|
2020-09-09 07:12:15 +00:00
|
|
|
selectedRowIndices: number[];
|
2020-01-23 07:53:36 +00:00
|
|
|
columnActions?: ColumnAction[];
|
2020-02-07 11:34:57 +00:00
|
|
|
serverSidePaginationEnabled?: boolean;
|
2020-09-08 13:04:51 +00:00
|
|
|
multiRowSelection?: boolean;
|
2020-03-30 08:16:43 +00:00
|
|
|
hiddenColumns?: string[];
|
2020-06-03 10:50:10 +00:00
|
|
|
columnOrder?: string[];
|
|
|
|
|
columnNameMap?: { [key: string]: string };
|
2020-09-11 10:40:15 +00:00
|
|
|
columnTypeMap?: {
|
|
|
|
|
[key: string]: { type: string; format: string; inputFormat?: string };
|
|
|
|
|
};
|
2020-06-03 10:50:10 +00:00
|
|
|
columnSizeMap?: { [key: string]: number };
|
2020-08-10 11:16:13 +00:00
|
|
|
filters?: ReactTableFilter[];
|
2020-08-10 10:01:36 +00:00
|
|
|
compactMode?: CompactMode;
|
2020-08-10 06:45:31 +00:00
|
|
|
sortedColumn?: {
|
|
|
|
|
column: string;
|
|
|
|
|
asc: boolean;
|
|
|
|
|
};
|
2019-09-12 08:11:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default TableWidget;
|
2020-10-06 09:01:51 +00:00
|
|
|
export const ProfiledTableWidget = Sentry.withProfiler(withMeta(TableWidget));
|