willba-component-library 0.1.29 → 0.1.30
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
|
@@ -8124,6 +8124,7 @@ function useFilterBar(_a) {
|
|
|
8124
8124
|
var currentSearchParams = new URLSearchParams(window.location.search);
|
|
8125
8125
|
var updatedParams = new URLSearchParams();
|
|
8126
8126
|
try {
|
|
8127
|
+
// Copy existing parameters to updatedParams
|
|
8127
8128
|
for (var _d = __values(currentSearchParams.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
8128
8129
|
var _f = __read(_e.value, 2), key = _f[0], value = _f[1];
|
|
8129
8130
|
updatedParams.append(key, value);
|
|
@@ -8137,12 +8138,15 @@ function useFilterBar(_a) {
|
|
|
8137
8138
|
finally { if (e_1) throw e_1.error; }
|
|
8138
8139
|
}
|
|
8139
8140
|
try {
|
|
8141
|
+
// Update parameters based on newParams
|
|
8140
8142
|
for (var _g = __values(Object.entries(newParams)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
8141
8143
|
var _j = __read(_h.value, 2), key = _j[0], value = _j[1];
|
|
8142
8144
|
if (value) {
|
|
8145
|
+
console.log(value);
|
|
8143
8146
|
updatedParams.set(key, value.toString());
|
|
8144
8147
|
}
|
|
8145
8148
|
else {
|
|
8149
|
+
// Remove parameter if value is falsy
|
|
8146
8150
|
updatedParams.delete(key);
|
|
8147
8151
|
}
|
|
8148
8152
|
}
|
|
@@ -8154,12 +8158,10 @@ function useFilterBar(_a) {
|
|
|
8154
8158
|
}
|
|
8155
8159
|
finally { if (e_2) throw e_2.error; }
|
|
8156
8160
|
}
|
|
8157
|
-
console.log(
|
|
8158
|
-
// Get the current URL without the query string
|
|
8161
|
+
console.log(updatedParams.toString());
|
|
8159
8162
|
var baseUrl = window.location.origin + window.location.pathname;
|
|
8160
8163
|
// Construct the updated URL with the modified query parameters
|
|
8161
8164
|
var updatedUrl = "".concat(baseUrl, "?").concat(updatedParams.toString());
|
|
8162
|
-
// Replace the current URL with the updated URL in the browser's history
|
|
8163
8165
|
return (window.location.href = updatedUrl);
|
|
8164
8166
|
}
|
|
8165
8167
|
else {
|