willba-component-library 0.1.50 → 0.1.52

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.
@@ -10,6 +10,6 @@ export type FilterBarProps = {
10
10
  redirectUrl?: string;
11
11
  palette?: Palette;
12
12
  currentViewApply?: string;
13
- onSubmit?: (val: Filters) => void;
13
+ onSubmit?: ((val: Filters) => void) | null;
14
14
  };
15
15
  export default function FilterBar({ language, ageCategories, redirectUrl, palette, currentViewApply, onSubmit, }: FilterBarProps): React.JSX.Element;
@@ -5,7 +5,7 @@ type Props = {
5
5
  redirectUrl?: string;
6
6
  currentViewApply?: string;
7
7
  ageCategories?: AgeCategoryType[];
8
- onSubmit?: (val: Filters) => void;
8
+ onSubmit?: ((val: Filters) => void) | null;
9
9
  };
10
10
  export declare const useFilterBar: ({ redirectUrl, currentViewApply, ageCategories, onSubmit, }: Props) => {
11
11
  selectedFilter: string | boolean;
package/lib/index.d.ts CHANGED
@@ -49,7 +49,7 @@ type FilterBarProps = {
49
49
  redirectUrl?: string;
50
50
  palette?: Palette;
51
51
  currentViewApply?: string;
52
- onSubmit?: (val: Filters) => void;
52
+ onSubmit?: ((val: Filters) => void) | null;
53
53
  };
54
54
  declare function FilterBar({ language, ageCategories, redirectUrl, palette, currentViewApply, onSubmit, }: FilterBarProps): React.JSX.Element;
55
55
 
package/lib/index.esm.js CHANGED
@@ -4013,7 +4013,7 @@ var useFilterBar = function (_a) {
4013
4013
  var baseUrl = window.location.origin + window.location.pathname;
4014
4014
  var updatedUrl = "".concat(baseUrl, "?").concat(updatedParams.toString());
4015
4015
  handleSelectedFilter(false);
4016
- if (onSubmit && selectedPath === '/rooms') {
4016
+ if (onSubmit) {
4017
4017
  var updatedParamsObject_1 = {};
4018
4018
  updatedParams.forEach(function (value, key) {
4019
4019
  if (value)
@@ -4041,7 +4041,7 @@ var useFilterBar = function (_a) {
4041
4041
  finally { if (e_3) throw e_3.error; }
4042
4042
  }
4043
4043
  handleSelectedFilter(false);
4044
- return onSubmit && selectedPath === '/rooms'
4044
+ return onSubmit
4045
4045
  ? onSubmit(newParams)
4046
4046
  : (window.location.href = "".concat(redirectUrl, "/").concat(selectedPath).concat(querySearchParams ? "?".concat(querySearchParams.toString()) : ''));
4047
4047
  }