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.umd.js
CHANGED
|
@@ -8146,6 +8146,7 @@
|
|
|
8146
8146
|
var currentSearchParams = new URLSearchParams(window.location.search);
|
|
8147
8147
|
var updatedParams = new URLSearchParams();
|
|
8148
8148
|
try {
|
|
8149
|
+
// Copy existing parameters to updatedParams
|
|
8149
8150
|
for (var _d = __values(currentSearchParams.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
8150
8151
|
var _f = __read(_e.value, 2), key = _f[0], value = _f[1];
|
|
8151
8152
|
updatedParams.append(key, value);
|
|
@@ -8159,12 +8160,15 @@
|
|
|
8159
8160
|
finally { if (e_1) throw e_1.error; }
|
|
8160
8161
|
}
|
|
8161
8162
|
try {
|
|
8163
|
+
// 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) {
|
|
8167
|
+
console.log(value);
|
|
8165
8168
|
updatedParams.set(key, value.toString());
|
|
8166
8169
|
}
|
|
8167
8170
|
else {
|
|
8171
|
+
// Remove parameter if value is falsy
|
|
8168
8172
|
updatedParams.delete(key);
|
|
8169
8173
|
}
|
|
8170
8174
|
}
|
|
@@ -8176,12 +8180,10 @@
|
|
|
8176
8180
|
}
|
|
8177
8181
|
finally { if (e_2) throw e_2.error; }
|
|
8178
8182
|
}
|
|
8179
|
-
console.log(
|
|
8180
|
-
// Get the current URL without the query string
|
|
8183
|
+
console.log(updatedParams.toString());
|
|
8181
8184
|
var baseUrl = window.location.origin + window.location.pathname;
|
|
8182
8185
|
// Construct the updated URL with the modified query parameters
|
|
8183
8186
|
var updatedUrl = "".concat(baseUrl, "?").concat(updatedParams.toString());
|
|
8184
|
-
// Replace the current URL with the updated URL in the browser's history
|
|
8185
8187
|
return (window.location.href = updatedUrl);
|
|
8186
8188
|
}
|
|
8187
8189
|
else {
|