@monolith-forensics/monolith-ui 1.2.3 → 1.2.5
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.
|
@@ -45,9 +45,7 @@ const TableMenu = () => {
|
|
|
45
45
|
runSearch(value);
|
|
46
46
|
}, 350);
|
|
47
47
|
const handleSearch = (e) => {
|
|
48
|
-
var _a, _b;
|
|
49
48
|
debouncedSearch(e.target.value);
|
|
50
|
-
(_b = (_a = tableMenuOptions === null || tableMenuOptions === void 0 ? void 0 : tableMenuOptions.searchOptions) === null || _a === void 0 ? void 0 : _a.onSearch) === null || _b === void 0 ? void 0 : _b.call(_a, e.target.value);
|
|
51
49
|
};
|
|
52
50
|
const handleSelectFilter = (item) => {
|
|
53
51
|
var _a;
|
|
@@ -441,18 +441,25 @@ const TableProvider = (_a) => {
|
|
|
441
441
|
stateStorage === null || stateStorage === void 0 ? void 0 : stateStorage.key,
|
|
442
442
|
]);
|
|
443
443
|
useEffect(() => {
|
|
444
|
+
var _a, _b;
|
|
444
445
|
if (stateStorage === null || stateStorage === void 0 ? void 0 : stateStorage.enabled) {
|
|
445
446
|
if ((stateStorage === null || stateStorage === void 0 ? void 0 : stateStorage.type) === "localStorage") {
|
|
446
447
|
StateStorage.setSortState(stateStorage.key, sortState);
|
|
447
448
|
}
|
|
448
449
|
}
|
|
450
|
+
(_a = props.onSort) === null || _a === void 0 ? void 0 : _a.call(props, {
|
|
451
|
+
column: (_b = columnState.find((col) => col.dataField === (sortState === null || sortState === void 0 ? void 0 : sortState.dataField))) !== null && _b !== void 0 ? _b : {},
|
|
452
|
+
sort: sortState,
|
|
453
|
+
});
|
|
449
454
|
}, [sortState]);
|
|
450
455
|
useEffect(() => {
|
|
456
|
+
var _a, _b, _c;
|
|
451
457
|
if (stateStorage === null || stateStorage === void 0 ? void 0 : stateStorage.enabled) {
|
|
452
458
|
if ((stateStorage === null || stateStorage === void 0 ? void 0 : stateStorage.type) === "localStorage") {
|
|
453
459
|
StateStorage.setSearchState(stateStorage.key, search);
|
|
454
460
|
}
|
|
455
461
|
}
|
|
462
|
+
(_c = (_b = (_a = props.tableMenuOptions) === null || _a === void 0 ? void 0 : _a.searchOptions) === null || _b === void 0 ? void 0 : _b.onSearch) === null || _c === void 0 ? void 0 : _c.call(_b, search);
|
|
456
463
|
}, [search]);
|
|
457
464
|
useEffect(() => {
|
|
458
465
|
if (stateStorage === null || stateStorage === void 0 ? void 0 : stateStorage.enabled) {
|
package/dist/Table/types.d.ts
CHANGED
|
@@ -168,6 +168,10 @@ export interface TableProviderProps {
|
|
|
168
168
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|
|
169
169
|
onColumnReorder?: (e: OnColumnChangeProps) => void;
|
|
170
170
|
onColumnStateChange?: (e: ColumnState[]) => void;
|
|
171
|
+
onSort?: (e: {
|
|
172
|
+
column: ColumnState;
|
|
173
|
+
sort?: SortState | null;
|
|
174
|
+
}) => void;
|
|
171
175
|
onColumnHeaderClick?: (e: {
|
|
172
176
|
column: ColumnState;
|
|
173
177
|
sort?: SortState | null;
|
|
@@ -241,6 +245,10 @@ export interface TableProps {
|
|
|
241
245
|
onActionButtonClick?: (rowData: any) => void;
|
|
242
246
|
onColumnResize?: (e: OnColumnChangeProps) => void;
|
|
243
247
|
onColumnReorder?: (e: OnColumnChangeProps) => void;
|
|
248
|
+
onSort?: (e: {
|
|
249
|
+
column: ColumnState;
|
|
250
|
+
sort?: SortState | null;
|
|
251
|
+
}) => void;
|
|
244
252
|
onColumnStateChange?: (e: ColumnState[]) => void;
|
|
245
253
|
onColumnHeaderClick?: (e: {
|
|
246
254
|
column: ColumnState;
|