@middag-io/react 0.50.0 → 0.50.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"DenseTableBlock.d.ts","sourceRoot":"","sources":["../../../src/base/blocks/DenseTableBlock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4C,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAYpF,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,CAAC,mBAAmB,CAAC,GAAG,YAAY,CA4XxF"}
1
+ {"version":3,"file":"DenseTableBlock.d.ts","sourceRoot":"","sources":["../../../src/base/blocks/DenseTableBlock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4C,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AAYpF,OAAO,KAAK,EAAsB,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,UAAU,CAAC,mBAAmB,CAAC,GAAG,YAAY,CAkYxF"}
@@ -23820,7 +23820,9 @@ function Tq({ block: e }) {
23820
23820
  t[`filter[${e}]`] = "";
23821
23821
  }), Object.entries(e.filters).forEach(([e, n]) => {
23822
23822
  t[`filter[${e}]`] = Array.isArray(n) ? n.join(",") : n;
23823
- })), ei.get(window.location.pathname, t, {
23823
+ }));
23824
+ let r = window.location.pathname + window.location.search;
23825
+ ei.get(r, t, {
23824
23826
  preserveState: !0,
23825
23827
  preserveScroll: !0,
23826
23828
  only: [c]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middag-io/react",
3
- "version": "0.50.0",
3
+ "version": "0.50.1",
4
4
  "type": "module",
5
5
  "description": "MIDDAG shared React UI library for Moodle, WordPress and other Inertia hosts",
6
6
  "license": "Apache-2.0",
@@ -134,7 +134,13 @@ export function DenseTableBlock({ block }: BlockProps<DenseTableBlockData>): Rea
134
134
  });
135
135
  }
136
136
 
137
- router.get(window.location.pathname, queryParams as Record<string, string>, {
137
+ // Inertia builds the request URL from the href plus these params, with
138
+ // the params winning on matching keys. Keep the page's own query string
139
+ // in the href so params the table does not govern (tabs, collection,
140
+ // groups, ...) survive a sort/search/filter/page change; the table's
141
+ // values still override any stale copy of them in the current URL.
142
+ const href = window.location.pathname + window.location.search;
143
+ router.get(href, queryParams as Record<string, string>, {
138
144
  preserveState: true,
139
145
  preserveScroll: true,
140
146
  only: [reloadKey],