willba-component-library 0.1.77 → 0.1.79
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 +16 -65
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +16 -65
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +16 -65
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.tsx +1 -1
- package/src/components/FilterBar/hooks/useFilterBar.tsx +11 -46
package/lib/index.umd.js
CHANGED
|
@@ -4011,7 +4011,7 @@
|
|
|
4011
4011
|
setSelectedFilter(id);
|
|
4012
4012
|
};
|
|
4013
4013
|
var handleSubmit = function () {
|
|
4014
|
-
var e_1, _a
|
|
4014
|
+
var e_1, _a;
|
|
4015
4015
|
var newParams = {
|
|
4016
4016
|
startDate: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from)
|
|
4017
4017
|
? format(calendarRange.from, 'yyyy-MM-dd')
|
|
@@ -4023,75 +4023,26 @@
|
|
|
4023
4023
|
ageCategories: ageCategories,
|
|
4024
4024
|
}),
|
|
4025
4025
|
};
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
var
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
updatedParams.append(key, value);
|
|
4033
|
-
}
|
|
4034
|
-
}
|
|
4035
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4036
|
-
finally {
|
|
4037
|
-
try {
|
|
4038
|
-
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
4039
|
-
}
|
|
4040
|
-
finally { if (e_1) throw e_1.error; }
|
|
4041
|
-
}
|
|
4042
|
-
try {
|
|
4043
|
-
for (var _g = __values(Object.entries(newParams)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
4044
|
-
var _j = __read(_h.value, 2), key = _j[0], value = _j[1];
|
|
4045
|
-
if (value) {
|
|
4046
|
-
updatedParams.set(key, value.toString());
|
|
4047
|
-
}
|
|
4048
|
-
else {
|
|
4049
|
-
updatedParams.delete(key);
|
|
4050
|
-
}
|
|
4051
|
-
}
|
|
4052
|
-
}
|
|
4053
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4054
|
-
finally {
|
|
4055
|
-
try {
|
|
4056
|
-
if (_h && !_h.done && (_b = _g.return)) _b.call(_g);
|
|
4026
|
+
var querySearchParams = new URLSearchParams();
|
|
4027
|
+
try {
|
|
4028
|
+
for (var _b = __values(Object.entries(newParams)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
4029
|
+
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
4030
|
+
if (value) {
|
|
4031
|
+
querySearchParams.append(key, value.toString());
|
|
4057
4032
|
}
|
|
4058
|
-
finally { if (e_2) throw e_2.error; }
|
|
4059
4033
|
}
|
|
4060
|
-
var baseUrl = window.location.origin + window.location.pathname;
|
|
4061
|
-
var updatedUrl = "".concat(baseUrl, "?").concat(updatedParams.toString());
|
|
4062
|
-
handleSelectedFilter(false);
|
|
4063
|
-
if (onSubmit && selectedPath === Pages.ROOMS) {
|
|
4064
|
-
var updatedParamsObject_1 = {};
|
|
4065
|
-
updatedParams.forEach(function (value, key) {
|
|
4066
|
-
if (value)
|
|
4067
|
-
updatedParamsObject_1[key] = value;
|
|
4068
|
-
});
|
|
4069
|
-
return onSubmit(updatedParamsObject_1);
|
|
4070
|
-
}
|
|
4071
|
-
return (window.location.href = updatedUrl);
|
|
4072
4034
|
}
|
|
4073
|
-
|
|
4074
|
-
|
|
4035
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4036
|
+
finally {
|
|
4075
4037
|
try {
|
|
4076
|
-
|
|
4077
|
-
var _m = __read(_l.value, 2), key = _m[0], value = _m[1];
|
|
4078
|
-
if (value) {
|
|
4079
|
-
querySearchParams.append(key, value.toString());
|
|
4080
|
-
}
|
|
4081
|
-
}
|
|
4082
|
-
}
|
|
4083
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
4084
|
-
finally {
|
|
4085
|
-
try {
|
|
4086
|
-
if (_l && !_l.done && (_c = _k.return)) _c.call(_k);
|
|
4087
|
-
}
|
|
4088
|
-
finally { if (e_3) throw e_3.error; }
|
|
4038
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4089
4039
|
}
|
|
4090
|
-
|
|
4091
|
-
return onSubmit && selectedPath === Pages.ROOMS
|
|
4092
|
-
? onSubmit(newParams)
|
|
4093
|
-
: (window.location.href = "".concat(redirectUrl, "/").concat(selectedPath).concat(querySearchParams ? "?".concat(querySearchParams.toString()) : ''));
|
|
4040
|
+
finally { if (e_1) throw e_1.error; }
|
|
4094
4041
|
}
|
|
4042
|
+
handleSelectedFilter(false);
|
|
4043
|
+
return onSubmit && selectedPath === Pages.ROOMS
|
|
4044
|
+
? onSubmit(newParams)
|
|
4045
|
+
: (window.location.href = "".concat(redirectUrl, "/").concat(selectedPath).concat(querySearchParams ? "?".concat(querySearchParams.toString()) : ''));
|
|
4095
4046
|
};
|
|
4096
4047
|
var handleResetFilters = function () {
|
|
4097
4048
|
setAgeCategoryCounts({});
|
|
@@ -11179,7 +11130,7 @@
|
|
|
11179
11130
|
React__default.createElement(Divider, null),
|
|
11180
11131
|
React__default.createElement(SelectButton, { label: t('guests.label'), description: parsedGuests.content, onClick: function () { return handleSelectedFilter(FilterSections.GUESTS); }, active: !!parsedGuests.data.total }))),
|
|
11181
11132
|
React__default.createElement(SubmitButton, { onClick: handleSubmit })),
|
|
11182
|
-
selectedFilter && (React__default.createElement("div", { className: "will-filter-bar-container ".concat(mode || 'dark'), style: tabs
|
|
11133
|
+
selectedFilter && (React__default.createElement("div", { className: "will-filter-bar-container ".concat(mode || 'dark'), style: (!tabs || tabs.length < 2) && !isMobile ? { top: 66 } : {} },
|
|
11183
11134
|
React__default.createElement(CloseButton, { handleClose: function () { return handleSelectedFilter(false); } }),
|
|
11184
11135
|
selectedFilter === FilterSections.CALENDAR && (React__default.createElement(Calendar, { calendarRange: calendarRange, setCalendarRange: setCalendarRange, ref: filtersRef, calendarOffset: calendarOffset, selectedPath: selectedPath, locale: language })),
|
|
11185
11136
|
selectedFilter === FilterSections.GUESTS && (React__default.createElement(Guests, { updateGuestsCount: updateGuestsCount, ageCategories: ageCategories, ageCategoryCounts: ageCategoryCounts, ref: filtersRef })),
|