willba-component-library 0.1.30 → 0.1.31
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 +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.tsx +1 -0
- package/src/components/FilterBar/components/guests/GuestCount/GuestCount.tsx +5 -1
- package/src/components/FilterBar/hooks/useFilterBar.tsx +2 -9
package/lib/index.js
CHANGED
|
@@ -8003,6 +8003,10 @@ styleInject(css_248z$6);
|
|
|
8003
8003
|
|
|
8004
8004
|
function GuestCount(_a) {
|
|
8005
8005
|
var label = _a.label, sortOrder = _a.sortOrder, id = _a.id, updateGuestsCount = _a.updateGuestsCount, count = _a.count, minVal = _a.minVal;
|
|
8006
|
+
React__default.useEffect(function () {
|
|
8007
|
+
if (minVal)
|
|
8008
|
+
updateGuestsCount("guests-".concat(id), minVal);
|
|
8009
|
+
}, []);
|
|
8006
8010
|
var handleDecrement = function () {
|
|
8007
8011
|
if (count > minVal) {
|
|
8008
8012
|
updateGuestsCount("guests-".concat(id), count - 1);
|
|
@@ -8144,7 +8148,6 @@ function useFilterBar(_a) {
|
|
|
8144
8148
|
var currentSearchParams = new URLSearchParams(window.location.search);
|
|
8145
8149
|
var updatedParams = new URLSearchParams();
|
|
8146
8150
|
try {
|
|
8147
|
-
// Copy existing parameters to updatedParams
|
|
8148
8151
|
for (var _d = __values(currentSearchParams.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
8149
8152
|
var _f = __read(_e.value, 2), key = _f[0], value = _f[1];
|
|
8150
8153
|
updatedParams.append(key, value);
|
|
@@ -8158,15 +8161,12 @@ function useFilterBar(_a) {
|
|
|
8158
8161
|
finally { if (e_1) throw e_1.error; }
|
|
8159
8162
|
}
|
|
8160
8163
|
try {
|
|
8161
|
-
// Update parameters based on newParams
|
|
8162
8164
|
for (var _g = __values(Object.entries(newParams)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
8163
8165
|
var _j = __read(_h.value, 2), key = _j[0], value = _j[1];
|
|
8164
8166
|
if (value) {
|
|
8165
|
-
console.log(value);
|
|
8166
8167
|
updatedParams.set(key, value.toString());
|
|
8167
8168
|
}
|
|
8168
8169
|
else {
|
|
8169
|
-
// Remove parameter if value is falsy
|
|
8170
8170
|
updatedParams.delete(key);
|
|
8171
8171
|
}
|
|
8172
8172
|
}
|
|
@@ -8178,10 +8178,9 @@ function useFilterBar(_a) {
|
|
|
8178
8178
|
}
|
|
8179
8179
|
finally { if (e_2) throw e_2.error; }
|
|
8180
8180
|
}
|
|
8181
|
-
console.log(updatedParams.toString());
|
|
8182
8181
|
var baseUrl = window.location.origin + window.location.pathname;
|
|
8183
|
-
// Construct the updated URL with the modified query parameters
|
|
8184
8182
|
var updatedUrl = "".concat(baseUrl, "?").concat(updatedParams.toString());
|
|
8183
|
+
handleSelectedFilter(false);
|
|
8185
8184
|
return (window.location.href = updatedUrl);
|
|
8186
8185
|
}
|
|
8187
8186
|
else {
|
|
@@ -8201,6 +8200,7 @@ function useFilterBar(_a) {
|
|
|
8201
8200
|
}
|
|
8202
8201
|
finally { if (e_3) throw e_3.error; }
|
|
8203
8202
|
}
|
|
8203
|
+
handleSelectedFilter(false);
|
|
8204
8204
|
return (window.location.href = "".concat(redirectUrl, "/").concat(selectedPath).concat(querySearchParams ? "?".concat(querySearchParams.toString()) : ''));
|
|
8205
8205
|
}
|
|
8206
8206
|
};
|