@gridkitjs/core 0.0.0-dev-20261112201151 → 0.0.0-dev-20261118081957

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.
@@ -259,10 +259,16 @@ function partitionByValue(rows, column, direction) {
259
259
  });
260
260
  return groups;
261
261
  }
262
+ function withGroupPosition(rows, depth) {
263
+ return rows.map((row, index) => ({
264
+ ...row,
265
+ groupPosition: { level: depth, position: index + 1, setSize: rows.length }
266
+ }));
267
+ }
262
268
  function buildLevel(rows, levels, parentPath, expansion, byId, out) {
263
269
  const level = levels[0];
264
270
  if (level === void 0) {
265
- out.push(...rows);
271
+ out.push(...withGroupPosition(rows, parentPath.length));
266
272
  return;
267
273
  }
268
274
  const column = byId.get(level.columnId);
@@ -272,7 +278,7 @@ function buildLevel(rows, levels, parentPath, expansion, byId, out) {
272
278
  }
273
279
  const rest = levels.slice(1);
274
280
  const groups = partitionByValue(rows, column, level.direction ?? "asc");
275
- for (const group of groups) {
281
+ for (const [index, group] of groups.entries()) {
276
282
  const path = [...parentPath, group.value];
277
283
  const groupId = groupRowId(path);
278
284
  const expanded = isGroupExpanded(expansion, groupId);
@@ -285,6 +291,8 @@ function buildLevel(rows, levels, parentPath, expansion, byId, out) {
285
291
  path,
286
292
  expanded,
287
293
  count: group.rows.length,
294
+ position: index + 1,
295
+ setSize: groups.length,
288
296
  // Both set by `groupRows` once it has the whole flattened array.
289
297
  rowIndex: -1,
290
298
  datasetIndex: -1,
@@ -3418,4 +3426,4 @@ export {
3418
3426
  clampFocus,
3419
3427
  nextFocusForKey
3420
3428
  };
3421
- //# sourceMappingURL=chunk-QGKPKQIO.js.map
3429
+ //# sourceMappingURL=chunk-DHSWUNSZ.js.map