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 CHANGED
@@ -7983,6 +7983,10 @@ styleInject(css_248z$6);
7983
7983
 
7984
7984
  function GuestCount(_a) {
7985
7985
  var label = _a.label, sortOrder = _a.sortOrder, id = _a.id, updateGuestsCount = _a.updateGuestsCount, count = _a.count, minVal = _a.minVal;
7986
+ useEffect(function () {
7987
+ if (minVal)
7988
+ updateGuestsCount("guests-".concat(id), minVal);
7989
+ }, []);
7986
7990
  var handleDecrement = function () {
7987
7991
  if (count > minVal) {
7988
7992
  updateGuestsCount("guests-".concat(id), count - 1);
@@ -8124,7 +8128,6 @@ function useFilterBar(_a) {
8124
8128
  var currentSearchParams = new URLSearchParams(window.location.search);
8125
8129
  var updatedParams = new URLSearchParams();
8126
8130
  try {
8127
- // Copy existing parameters to updatedParams
8128
8131
  for (var _d = __values(currentSearchParams.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {
8129
8132
  var _f = __read(_e.value, 2), key = _f[0], value = _f[1];
8130
8133
  updatedParams.append(key, value);
@@ -8138,15 +8141,12 @@ function useFilterBar(_a) {
8138
8141
  finally { if (e_1) throw e_1.error; }
8139
8142
  }
8140
8143
  try {
8141
- // Update parameters based on newParams
8142
8144
  for (var _g = __values(Object.entries(newParams)), _h = _g.next(); !_h.done; _h = _g.next()) {
8143
8145
  var _j = __read(_h.value, 2), key = _j[0], value = _j[1];
8144
8146
  if (value) {
8145
- console.log(value);
8146
8147
  updatedParams.set(key, value.toString());
8147
8148
  }
8148
8149
  else {
8149
- // Remove parameter if value is falsy
8150
8150
  updatedParams.delete(key);
8151
8151
  }
8152
8152
  }
@@ -8158,10 +8158,9 @@ function useFilterBar(_a) {
8158
8158
  }
8159
8159
  finally { if (e_2) throw e_2.error; }
8160
8160
  }
8161
- console.log(updatedParams.toString());
8162
8161
  var baseUrl = window.location.origin + window.location.pathname;
8163
- // Construct the updated URL with the modified query parameters
8164
8162
  var updatedUrl = "".concat(baseUrl, "?").concat(updatedParams.toString());
8163
+ handleSelectedFilter(false);
8165
8164
  return (window.location.href = updatedUrl);
8166
8165
  }
8167
8166
  else {
@@ -8181,6 +8180,7 @@ function useFilterBar(_a) {
8181
8180
  }
8182
8181
  finally { if (e_3) throw e_3.error; }
8183
8182
  }
8183
+ handleSelectedFilter(false);
8184
8184
  return (window.location.href = "".concat(redirectUrl, "/").concat(selectedPath).concat(querySearchParams ? "?".concat(querySearchParams.toString()) : ''));
8185
8185
  }
8186
8186
  };