mig-schema-table 3.0.43 → 3.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,7 +7,7 @@ interface ITdProps<T> {
|
|
|
7
7
|
columnIndex: number;
|
|
8
8
|
data: T[];
|
|
9
9
|
getRowClassName?: (rowData: T, dataIndex: number) => string;
|
|
10
|
-
getRowSelected?: (rowData: T) => boolean;
|
|
10
|
+
getRowSelected?: (rowData: T, dataIndex: number) => boolean;
|
|
11
11
|
rowHeight: number;
|
|
12
12
|
rowIndex: number;
|
|
13
13
|
onCheckedIndexesChange?: (dataIndex: number[]) => void;
|
|
@@ -39,7 +39,7 @@ function Td({ checkedIndexes, disabledCheckedIndexes, columnIndex, data, getRowC
|
|
|
39
39
|
key: propName,
|
|
40
40
|
style: Object.assign(Object.assign({}, style), { lineHeight: `${rowHeight}px` }),
|
|
41
41
|
onClick: !(propConfig === null || propConfig === void 0 ? void 0 : propConfig.renderCell) ? onTdClick : undefined,
|
|
42
|
-
className: `schema-table__td schema-table__td--${rowIndex % 2 ? "odd" : "even"}${getRowSelected && getRowSelected(data[row._index])
|
|
42
|
+
className: `schema-table__td schema-table__td--${rowIndex % 2 ? "odd" : "even"}${getRowSelected && getRowSelected(data[row._index], row._index)
|
|
43
43
|
? " schema-table__td--selected"
|
|
44
44
|
: ""} ${getRowClassName ? getRowClassName(data[row._index], row._index) : ""}`,
|
|
45
45
|
title,
|
|
@@ -21,7 +21,7 @@ export interface ISchemaTableProps<T> {
|
|
|
21
21
|
defaultSortAsc?: boolean;
|
|
22
22
|
defaultSortColumn?: keyof T;
|
|
23
23
|
getRowClassName?: (rowData: T, dataIndex: number) => string;
|
|
24
|
-
getRowSelected?: (rowData: T) => boolean;
|
|
24
|
+
getRowSelected?: (rowData: T, dataIndex: number) => boolean;
|
|
25
25
|
maxHeight?: number;
|
|
26
26
|
isSearchable?: boolean;
|
|
27
27
|
isColumnFilterable?: boolean;
|
|
@@ -312,8 +312,11 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, disabledCheck
|
|
|
312
312
|
const disableColumnFilter = React.useCallback((propName) => {
|
|
313
313
|
const newColumnFilterMap = Object.assign({}, columnFilterMap);
|
|
314
314
|
delete newColumnFilterMap[propName];
|
|
315
|
+
if (data instanceof Function) {
|
|
316
|
+
setIsDirty(true);
|
|
317
|
+
}
|
|
315
318
|
setColumnFilterMap(newColumnFilterMap);
|
|
316
|
-
}, [columnFilterMap]);
|
|
319
|
+
}, [columnFilterMap, data]);
|
|
317
320
|
const onSetSortColumn = React.useCallback((x) => {
|
|
318
321
|
if (data instanceof Function) {
|
|
319
322
|
setIsDirty(true);
|