mig-schema-table 3.0.103 → 3.0.105

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.
@@ -49,7 +49,7 @@ function getIsColumnSortable(isTableSortable, propSchema, propConfig) {
49
49
  (propConfig === null || propConfig === void 0 ? void 0 : propConfig.isSortable) !== false &&
50
50
  (propSchema || (propConfig === null || propConfig === void 0 ? void 0 : propConfig.renderData) || (propConfig === null || propConfig === void 0 ? void 0 : propConfig.sort)));
51
51
  }
52
- function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, customElement, data, defaultColumnFilters = {}, defaultSortAsc = false, defaultSortColumn, disabledCheckedIndexes, enableAutoFocus = true, enableRowCounter = true, getRowClassName, getRowSelected, isColumnFilterable = true, isExportable = true, isResizable = true, isSearchable = true, isSortable = true, maxHeight, onCheckedIndexesChange, onRowClick, onRowDoubleClick, onSearchEnter, rowHeight = 36, schema, searchPlaceholder, style, translate = defaultTranslate, useFilterStateHash, width, }) {
52
+ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, customElement, data, defaultColumnFilters, defaultSortAsc = false, defaultSortColumn, disabledCheckedIndexes, enableAutoFocus = true, enableRowCounter = true, getRowClassName, getRowSelected, isColumnFilterable = true, isExportable = true, isResizable = true, isSearchable = true, isSortable = true, maxHeight, onCheckedIndexesChange, onRowClick, onRowDoubleClick, onSearchEnter, rowHeight = 36, schema, searchPlaceholder, style, translate = defaultTranslate, useFilterStateHash, width, }) {
53
53
  const [sortColumn, setSortColumn] = React.useState(defaultSortColumn);
54
54
  const [sortAsc, setSortAsc] = React.useState(defaultSortAsc);
55
55
  const [thMenuConfig, setThMenuConfig] = React.useState();
@@ -58,7 +58,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
58
58
  const [columnWidths, setColumnWidths] = React.useState();
59
59
  const [locationHash, setLocationHash] = React.useState(useFilterStateHash ? parseLocationHash(window.location.hash) : null);
60
60
  const [searchQuery, setSearchQuery] = React.useState((locationHash === null || locationHash === void 0 ? void 0 : locationHash.searchQuery) || "");
61
- const [columnFilterMap, setColumnFilterMap] = React.useState((locationHash === null || locationHash === void 0 ? void 0 : locationHash.columnFilterMap) || defaultColumnFilters);
61
+ const [columnFilterMap, setColumnFilterMap] = React.useState((locationHash === null || locationHash === void 0 ? void 0 : locationHash.columnFilterMap) || defaultColumnFilters || {});
62
62
  const [isDirty, setIsDirty] = React.useState(false);
63
63
  React.useEffect(() => {
64
64
  if (isDataFunction) {
@@ -543,7 +543,7 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
543
543
  if (!useFilterStateHash) {
544
544
  return;
545
545
  }
546
- setColumnFilterMap((locationHash === null || locationHash === void 0 ? void 0 : locationHash.columnFilterMap) || defaultColumnFilters);
546
+ setColumnFilterMap((locationHash === null || locationHash === void 0 ? void 0 : locationHash.columnFilterMap) || defaultColumnFilters || {});
547
547
  setSearchQuery((locationHash === null || locationHash === void 0 ? void 0 : locationHash.searchQuery) || "");
548
548
  }, [locationHash, useFilterStateHash, defaultColumnFilters]);
549
549
  const onSchemaColumnFilterChange = React.useCallback((newColumnFilterValue, persistState) => {
@@ -572,7 +572,10 @@ function SchemaTable({ Heading = VariableSizeList, checkedIndexes, config, custo
572
572
  ]);
573
573
  const onClearFiltersButtonClick = React.useCallback(() => {
574
574
  if (useFilterStateHash) {
575
- window.location.hash = "";
575
+ window.location.hash = serializeLocationHash({
576
+ columnFilterMap: {},
577
+ searchQuery: "",
578
+ });
576
579
  return;
577
580
  }
578
581
  setColumnFilterMap({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mig-schema-table",
3
- "version": "3.0.103",
3
+ "version": "3.0.105",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist/"