willba-component-library 0.1.58 → 0.1.60
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/index.esm.js +9 -8
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +9 -8
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +9 -8
- 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 +7 -2
- package/src/components/FilterBar/hooks/useFilterBar.tsx +0 -4
- package/src/components/FilterBar/utils/parseGuests.tsx +1 -1
- package/src/locales/fi/filterBar.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -3916,7 +3916,7 @@ var parseGuests = function (_a) {
|
|
|
3916
3916
|
}, { total: 0, html: [] });
|
|
3917
3917
|
var htmlString = parsedData.html.length > 1 ? parsedData.html.join(' + ') : '';
|
|
3918
3918
|
return ((parsedData.total || htmlString) &&
|
|
3919
|
-
": ".concat(parsedData.total, " ").concat(htmlString ? "
|
|
3919
|
+
": ".concat(parsedData.total, " ").concat(htmlString ? " ( ".concat(htmlString, " )") : ''));
|
|
3920
3920
|
};
|
|
3921
3921
|
|
|
3922
3922
|
var FilterSections;
|
|
@@ -3978,9 +3978,6 @@ var useFilterBar = function (_a) {
|
|
|
3978
3978
|
: Pages.EVENTS;
|
|
3979
3979
|
setSelectedPath(currentPath);
|
|
3980
3980
|
}, []);
|
|
3981
|
-
useEffect(function () {
|
|
3982
|
-
handleResetFilters();
|
|
3983
|
-
}, [selectedPath]);
|
|
3984
3981
|
var updateGuestsCount = function (id, newCount) {
|
|
3985
3982
|
setAgeCategoryCounts(function (prevCounts) {
|
|
3986
3983
|
var _a;
|
|
@@ -6455,7 +6452,7 @@ var guests = {
|
|
|
6455
6452
|
title: "Ketkä ovat tulossa?",
|
|
6456
6453
|
adultsLabel: "Aikuiset",
|
|
6457
6454
|
kidsLabel: "lapset",
|
|
6458
|
-
guestsLabel: "
|
|
6455
|
+
guestsLabel: "Vieraita"
|
|
6459
6456
|
};
|
|
6460
6457
|
var categories = {
|
|
6461
6458
|
label: "Kategoriat",
|
|
@@ -10728,7 +10725,7 @@ function FilterBar(_a) {
|
|
|
10728
10725
|
currentViewApply: currentViewApply,
|
|
10729
10726
|
ageCategories: ageCategories,
|
|
10730
10727
|
onSubmit: onSubmit,
|
|
10731
|
-
}), selectedFilter = _d.selectedFilter, ageCategoryCounts = _d.ageCategoryCounts, categories = _d.categories, calendarRange = _d.calendarRange, selectedPath = _d.selectedPath, setCalendarRange = _d.setCalendarRange, setCategories = _d.setCategories, handleSelectedFilter = _d.handleSelectedFilter, handleSubmit = _d.handleSubmit, updateGuestsCount = _d.updateGuestsCount, setSelectedPath = _d.setSelectedPath;
|
|
10728
|
+
}), selectedFilter = _d.selectedFilter, ageCategoryCounts = _d.ageCategoryCounts, categories = _d.categories, calendarRange = _d.calendarRange, selectedPath = _d.selectedPath, setCalendarRange = _d.setCalendarRange, setCategories = _d.setCategories, handleSelectedFilter = _d.handleSelectedFilter, handleSubmit = _d.handleSubmit, updateGuestsCount = _d.updateGuestsCount, setSelectedPath = _d.setSelectedPath, handleResetFilters = _d.handleResetFilters;
|
|
10732
10729
|
// Default selected tab when tabs are hidden
|
|
10733
10730
|
useEffect(function () {
|
|
10734
10731
|
if (currentViewApply === ViewApply.ROOMS) {
|
|
@@ -10752,8 +10749,12 @@ function FilterBar(_a) {
|
|
|
10752
10749
|
var parsedGuests = parseGuests({ ageCategoryCounts: ageCategoryCounts, ageCategories: ageCategories });
|
|
10753
10750
|
return (React__default__default.createElement("div", { className: "will-root ".concat(fullWidth ? 'is-full-width' : ''), style: themePalette },
|
|
10754
10751
|
!currentViewApply && (React__default__default.createElement("div", { className: "will-filter-bar-tabs", ref: !currentViewApply ? targetFilterBarRef : null },
|
|
10755
|
-
React__default__default.createElement(TabButton, { label: t('tabs.events'), onClick: function () {
|
|
10756
|
-
|
|
10752
|
+
React__default__default.createElement(TabButton, { label: t('tabs.events'), onClick: function () {
|
|
10753
|
+
setSelectedPath(Pages.EVENTS), handleResetFilters();
|
|
10754
|
+
}, active: selectedPath === Pages.EVENTS }),
|
|
10755
|
+
React__default__default.createElement(TabButton, { label: t('tabs.rooms'), onClick: function () {
|
|
10756
|
+
setSelectedPath(Pages.ROOMS), handleResetFilters();
|
|
10757
|
+
}, active: selectedPath === Pages.ROOMS }))),
|
|
10757
10758
|
React__default__default.createElement("div", { className: "will-filter-bar-header", ref: currentViewApply ? targetFilterBarRef : null },
|
|
10758
10759
|
React__default__default.createElement(SelectButton, { label: t('calendar.label'), description: parsedDates
|
|
10759
10760
|
? parsedDates
|