@firestitch/filter 13.0.4 → 13.0.6

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.
@@ -1121,7 +1121,12 @@ class ChipsItem extends BaseItem {
1121
1121
  return !!this.value;
1122
1122
  }
1123
1123
  get queryObject() {
1124
- const value = this.value;
1124
+ if (!this.value) {
1125
+ return {};
1126
+ }
1127
+ const value = this.value
1128
+ .map((item) => item.value)
1129
+ .join(',');
1125
1130
  const name = this.name;
1126
1131
  return {
1127
1132
  [name]: value,
@@ -1928,9 +1933,13 @@ class QueryParamsController {
1928
1933
  _replaceState(data) {
1929
1934
  const url = new URL(window.location.href);
1930
1935
  Object.keys(data)
1931
- .filter((name) => data[name] !== undefined && data[name] !== null)
1932
1936
  .forEach((name) => {
1933
- url.searchParams.set(name, data[name]);
1937
+ if (data[name] === undefined || data[name] === null) {
1938
+ url.searchParams.delete(name);
1939
+ }
1940
+ else {
1941
+ url.searchParams.set(name, data[name]);
1942
+ }
1934
1943
  });
1935
1944
  history.replaceState({}, null, url.pathname + url.search);
1936
1945
  }