mig-schema-table 3.0.90 → 3.0.92
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.
|
@@ -3,7 +3,7 @@ import { oas31 } from "openapi3-ts";
|
|
|
3
3
|
import { TColumnFilterValue } from "../../index";
|
|
4
4
|
export interface IFilterMenuComponentProps {
|
|
5
5
|
columnFilterValue: TColumnFilterValue;
|
|
6
|
-
onChange: (newValue: TColumnFilterValue | undefined, persistState
|
|
6
|
+
onChange: (newValue: TColumnFilterValue | undefined, persistState?: boolean) => void;
|
|
7
7
|
onInputKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
8
8
|
propIsRequired: boolean;
|
|
9
9
|
propName: string;
|
|
@@ -11,7 +11,7 @@ export interface IThMenuConfig {
|
|
|
11
11
|
type TThMenuProps = IThMenuConfig & {
|
|
12
12
|
isSortable: boolean;
|
|
13
13
|
isFilterable: boolean;
|
|
14
|
-
onChange: (newValue: TColumnFilterValue | undefined, persistState
|
|
14
|
+
onChange: (newValue: TColumnFilterValue | undefined, persistState?: boolean) => void;
|
|
15
15
|
onClose: (e: MouseEvent | React.MouseEvent) => void;
|
|
16
16
|
onInputKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
17
17
|
propIsRequired: boolean;
|
|
@@ -515,7 +515,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
|
|
|
515
515
|
if (isDataFunction) {
|
|
516
516
|
setIsDirty(true);
|
|
517
517
|
}
|
|
518
|
-
if (useFilterStateHash && persistState) {
|
|
518
|
+
if (useFilterStateHash && persistState !== false) {
|
|
519
519
|
window.location.hash = serializeLocationHash(Object.assign(Object.assign({}, locationHash), { columnFilterMap: Object.assign(Object.assign({}, columnFilterMap), { [thMenuConfig.propName]: newColumnFilterValue }) }));
|
|
520
520
|
return;
|
|
521
521
|
}
|
|
@@ -551,15 +551,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
|
|
|
551
551
|
// prevent hash change for undefined vs empty string compare
|
|
552
552
|
(searchQuery || locationHash.searchQuery) &&
|
|
553
553
|
searchQuery !== locationHash.searchQuery) {
|
|
554
|
-
|
|
555
|
-
// use setTimeout() so any button clickhandler is still executed before the hash is changed
|
|
556
|
-
setTimeout(() => {
|
|
557
|
-
// Did we not move away? Apply search info to location.hash
|
|
558
|
-
if (currentLocationHref === window.location.href) {
|
|
559
|
-
window.location.hash = serializeLocationHash(Object.assign(Object.assign({}, locationHash), { searchQuery }));
|
|
560
|
-
}
|
|
561
|
-
// 1 is not enough?!
|
|
562
|
-
}, 400);
|
|
554
|
+
window.location.hash = serializeLocationHash(Object.assign(Object.assign({}, locationHash), { searchQuery }));
|
|
563
555
|
}
|
|
564
556
|
}, [locationHash, searchQuery, useFilterStateHash]);
|
|
565
557
|
const onExportDataClick = React.useCallback((e) => {
|