willba-component-library 0.1.81 → 0.1.82
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 +21 -8
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +21 -8
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +21 -8
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/hooks/useFilterBar.tsx +9 -6
package/lib/index.js
CHANGED
|
@@ -3990,13 +3990,26 @@ var useFilterBar = function (_a) {
|
|
|
3990
3990
|
return;
|
|
3991
3991
|
var defaultTab = (tabs === null || tabs === void 0 ? void 0 : tabs.length) === 1 ? tabs[0] : tabs === null || tabs === void 0 ? void 0 : tabs.find(function (tab) { return tab.default; });
|
|
3992
3992
|
var findMatchingPath = function () {
|
|
3993
|
+
var e_1, _a;
|
|
3993
3994
|
var paths = [Pages.EVENTS, Pages.ROOMS];
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3995
|
+
try {
|
|
3996
|
+
for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {
|
|
3997
|
+
var path = paths_1_1.value;
|
|
3998
|
+
if (window.location.pathname.includes(path)) {
|
|
3999
|
+
return path;
|
|
4000
|
+
}
|
|
4001
|
+
}
|
|
4002
|
+
}
|
|
4003
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
4004
|
+
finally {
|
|
4005
|
+
try {
|
|
4006
|
+
if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);
|
|
4007
|
+
}
|
|
4008
|
+
finally { if (e_1) throw e_1.error; }
|
|
4009
|
+
}
|
|
4010
|
+
return defaultTab ? defaultTab.path : Pages.EVENTS;
|
|
3998
4011
|
};
|
|
3999
|
-
var currentPath = findMatchingPath()
|
|
4012
|
+
var currentPath = findMatchingPath();
|
|
4000
4013
|
setSelectedPath(currentPath);
|
|
4001
4014
|
}, []);
|
|
4002
4015
|
var updateGuestsCount = function (id, newCount) {
|
|
@@ -4009,7 +4022,7 @@ var useFilterBar = function (_a) {
|
|
|
4009
4022
|
setSelectedFilter(id);
|
|
4010
4023
|
};
|
|
4011
4024
|
var handleSubmit = function () {
|
|
4012
|
-
var
|
|
4025
|
+
var e_2, _a;
|
|
4013
4026
|
var newParams = {
|
|
4014
4027
|
startDate: (calendarRange === null || calendarRange === void 0 ? void 0 : calendarRange.from)
|
|
4015
4028
|
? format(calendarRange.from, 'yyyy-MM-dd')
|
|
@@ -4030,12 +4043,12 @@ var useFilterBar = function (_a) {
|
|
|
4030
4043
|
}
|
|
4031
4044
|
}
|
|
4032
4045
|
}
|
|
4033
|
-
catch (
|
|
4046
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4034
4047
|
finally {
|
|
4035
4048
|
try {
|
|
4036
4049
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
4037
4050
|
}
|
|
4038
|
-
finally { if (
|
|
4051
|
+
finally { if (e_2) throw e_2.error; }
|
|
4039
4052
|
}
|
|
4040
4053
|
handleSelectedFilter(false);
|
|
4041
4054
|
return onSubmit && selectedPath === Pages.ROOMS
|