@tanstack/svelte-table 8.10.4 → 8.10.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.
@@ -2352,6 +2352,9 @@
2352
2352
  return a === b ? 0 : a > b ? 1 : -1;
2353
2353
  }
2354
2354
  function toString(a) {
2355
+ if (typeof a === 'boolean') {
2356
+ return String(a);
2357
+ }
2355
2358
  if (typeof a === 'number') {
2356
2359
  if (isNaN(a) || a === Infinity || a === -Infinity) {
2357
2360
  return '';
@@ -2368,6 +2371,13 @@
2368
2371
  // It handles numbers, mixed alphanumeric combinations, and even
2369
2372
  // null, undefined, and Infinity
2370
2373
  function compareAlphanumeric(aStr, bStr) {
2374
+ // Check if the string contains only a number
2375
+ const aFloat = parseFloat(aStr);
2376
+ const bFloat = parseFloat(bStr);
2377
+ if (!isNaN(aFloat) && !isNaN(bFloat)) {
2378
+ return compareBasic(aFloat, bFloat);
2379
+ }
2380
+
2371
2381
  // Split on number groups, but keep the delimiter
2372
2382
  // Then remove falsey split values
2373
2383
  const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);
@@ -2992,7 +3002,7 @@
2992
3002
  },
2993
3003
  subRows: subRows != null ? subRows : [],
2994
3004
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
2995
- getParentRow: () => row.parentId ? table.getRow(row.parentId) : undefined,
3005
+ getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : undefined,
2996
3006
  getParentRows: () => {
2997
3007
  let parentRows = [];
2998
3008
  let currentRow = row;