willba-component-library 0.2.99 → 0.2.100
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.
- package/lib/components/FilterBar/FilterBar.d.ts +1 -1
- package/lib/components/FilterBar/FilterBarTypes.d.ts +1 -1
- package/lib/components/FilterBar/hooks/useFilterBar.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.esm.js +6 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +6 -6
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +6 -6
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.stories.tsx +1 -1
- package/src/components/FilterBar/FilterBar.tsx +2 -2
- package/src/components/FilterBar/FilterBarTypes.ts +1 -1
- package/src/components/FilterBar/hooks/useFilterBar.tsx +5 -5
|
@@ -2,4 +2,4 @@ import React from 'react';
|
|
|
2
2
|
import '../../themes/Default.css';
|
|
3
3
|
import { FilterBarTypes } from './FilterBarTypes';
|
|
4
4
|
import './FilterBar.css';
|
|
5
|
-
export default function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading,
|
|
5
|
+
export default function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locationIds, }: FilterBarTypes): React.JSX.Element;
|
|
@@ -6,9 +6,9 @@ type Props = {
|
|
|
6
6
|
ageCategories?: AgeCategoryType[];
|
|
7
7
|
onSubmit?: ((val: Filters) => void) | null;
|
|
8
8
|
tabs?: Tab[];
|
|
9
|
-
|
|
9
|
+
locationIds?: string[];
|
|
10
10
|
};
|
|
11
|
-
export declare const useFilterBar: ({ redirectUrl, ageCategories, onSubmit, tabs,
|
|
11
|
+
export declare const useFilterBar: ({ redirectUrl, ageCategories, onSubmit, tabs, locationIds, }: Props) => {
|
|
12
12
|
selectedFilter: string | boolean;
|
|
13
13
|
ageCategoryCounts: AgeCategoryCount;
|
|
14
14
|
categories: number;
|
package/lib/index.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ type FilterBarTypes = {
|
|
|
90
90
|
mode?: string;
|
|
91
91
|
tabs?: Tab[];
|
|
92
92
|
outerLoading?: boolean;
|
|
93
|
-
|
|
93
|
+
locationIds?: string[];
|
|
94
94
|
};
|
|
95
95
|
type AgeCategoryType = {
|
|
96
96
|
id: string;
|
|
@@ -113,7 +113,7 @@ type Tab = {
|
|
|
113
113
|
label?: Translations;
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
declare function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading,
|
|
116
|
+
declare function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locationIds, }: FilterBarTypes): React.JSX.Element;
|
|
117
117
|
|
|
118
118
|
interface FilterCalendarTypes extends Partial<CalendarTypes> {
|
|
119
119
|
palette: Palette;
|
package/lib/index.esm.js
CHANGED
|
@@ -11655,7 +11655,7 @@ var Pages;
|
|
|
11655
11655
|
})(Pages || (Pages = {}));
|
|
11656
11656
|
|
|
11657
11657
|
var useFilterBar = function (_a) {
|
|
11658
|
-
var redirectUrl = _a.redirectUrl, ageCategories = _a.ageCategories, onSubmit = _a.onSubmit, tabs = _a.tabs,
|
|
11658
|
+
var redirectUrl = _a.redirectUrl, ageCategories = _a.ageCategories, onSubmit = _a.onSubmit, tabs = _a.tabs, locationIds = _a.locationIds;
|
|
11659
11659
|
var _b = __read(useState(Pages.EVENTS), 2), selectedPath = _b[0], setSelectedPath = _b[1];
|
|
11660
11660
|
var _c = __read(useState(false), 2), selectedFilter = _c[0], setSelectedFilter = _c[1];
|
|
11661
11661
|
var _d = __read(useState(), 2), calendarRange = _d[0], setCalendarRange = _d[1];
|
|
@@ -11748,9 +11748,9 @@ var useFilterBar = function (_a) {
|
|
|
11748
11748
|
}
|
|
11749
11749
|
else {
|
|
11750
11750
|
var params_1 = new URLSearchParams(querySearchParams !== null && querySearchParams !== void 0 ? querySearchParams : undefined);
|
|
11751
|
-
if (
|
|
11752
|
-
|
|
11753
|
-
params_1.append('
|
|
11751
|
+
if (locationIds) {
|
|
11752
|
+
locationIds.forEach(function (id) {
|
|
11753
|
+
params_1.append('locationId', id);
|
|
11754
11754
|
});
|
|
11755
11755
|
}
|
|
11756
11756
|
var paramString = params_1.toString();
|
|
@@ -11921,7 +11921,7 @@ var css_248z$1 = ".will-root {\n z-index: 999;\n width: fit-content;\n min-wi
|
|
|
11921
11921
|
styleInject(css_248z$1);
|
|
11922
11922
|
|
|
11923
11923
|
function FilterBar(_a) {
|
|
11924
|
-
var language = _a.language, _b = _a.ageCategories, ageCategories = _b === void 0 ? AGE_CATEGORIES_FALLBACK : _b, _c = _a.redirectUrl, redirectUrl = _c === void 0 ? REDIRECT_URL_FALLBACK : _c, palette = _a.palette, onSubmit = _a.onSubmit, fullWidth = _a.fullWidth, disableCalendarDates = _a.disableCalendarDates, mode = _a.mode, tabs = _a.tabs, outerLoading = _a.outerLoading,
|
|
11924
|
+
var language = _a.language, _b = _a.ageCategories, ageCategories = _b === void 0 ? AGE_CATEGORIES_FALLBACK : _b, _c = _a.redirectUrl, redirectUrl = _c === void 0 ? REDIRECT_URL_FALLBACK : _c, palette = _a.palette, onSubmit = _a.onSubmit, fullWidth = _a.fullWidth, disableCalendarDates = _a.disableCalendarDates, mode = _a.mode, tabs = _a.tabs, outerLoading = _a.outerLoading, locationIds = _a.locationIds;
|
|
11925
11925
|
var themePalette = useTheme({ palette: palette });
|
|
11926
11926
|
// Translations
|
|
11927
11927
|
useUpdateTranslations({ language: language });
|
|
@@ -11932,7 +11932,7 @@ function FilterBar(_a) {
|
|
|
11932
11932
|
ageCategories: ageCategories,
|
|
11933
11933
|
onSubmit: onSubmit,
|
|
11934
11934
|
tabs: tabs,
|
|
11935
|
-
|
|
11935
|
+
locationIds: locationIds,
|
|
11936
11936
|
}), selectedFilter = _d.selectedFilter, ageCategoryCounts = _d.ageCategoryCounts, categories = _d.categories, calendarRange = _d.calendarRange, selectedPath = _d.selectedPath, innerLoading = _d.innerLoading, setCalendarRange = _d.setCalendarRange, setCategories = _d.setCategories, handleSelectedFilter = _d.handleSelectedFilter, handleSubmit = _d.handleSubmit, updateGuestsCount = _d.updateGuestsCount, setSelectedPath = _d.setSelectedPath, handleResetFilters = _d.handleResetFilters;
|
|
11937
11937
|
// Scroll in to view
|
|
11938
11938
|
var _e = useScrollInToView({ selectedFilter: selectedFilter }), isMobile = _e.isMobile, targetFilterBarRef = _e.targetFilterBarRef;
|