@shotleybuilder/svelte-gridlite-kit 0.4.1 → 0.4.3

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.
@@ -219,6 +219,8 @@ async function rebuildGroupedQuery() {
219
219
  try {
220
220
  const usePagination = features.pagination !== false;
221
221
  const topGroupConfig = cleanAgg(validGrouping[0]);
222
+ const topColumnNames = [topGroupConfig.column];
223
+ const groupSorting = sorting.filter((s) => topColumnNames.includes(s.column));
222
224
  const summaryQuery = buildGroupSummaryQuery({
223
225
  ...querySource,
224
226
  grouping: [topGroupConfig],
@@ -226,7 +228,7 @@ async function rebuildGroupedQuery() {
226
228
  filterLogic,
227
229
  allowedColumns,
228
230
  globalSearch: globalFilter || void 0,
229
- sorting,
231
+ sorting: groupSorting,
230
232
  page: usePagination ? page : void 0,
231
233
  pageSize: usePagination ? pageSize : void 0
232
234
  });
@@ -294,6 +296,8 @@ async function fetchGroupChildren(group) {
294
296
  }));
295
297
  if (nextDepth < validGrouping.length) {
296
298
  const subGroupConfig = cleanAgg(validGrouping[nextDepth]);
299
+ const subColumnNames = validGrouping.slice(0, nextDepth + 1).map((g) => g.column);
300
+ const groupSorting = sorting.filter((s) => subColumnNames.includes(s.column));
297
301
  const summaryQuery = buildGroupSummaryQuery({
298
302
  ...querySource,
299
303
  grouping: [subGroupConfig],
@@ -310,7 +314,7 @@ async function fetchGroupChildren(group) {
310
314
  filterLogic,
311
315
  allowedColumns,
312
316
  globalSearch: globalFilter || void 0,
313
- sorting
317
+ sorting: groupSorting
314
318
  });
315
319
  const result = await db.query(
316
320
  summaryQuery.sql,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shotleybuilder/svelte-gridlite-kit",
3
- "version": "0.4.1",
3
+ "version": "0.4.3",
4
4
  "description": "A SQL-native data grid component for Svelte and SvelteKit, powered by PGLite",
5
5
  "author": "Sertantai",
6
6
  "license": "MIT",