@tanstack/svelte-table 8.10.6 → 8.11.0

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.
@@ -558,6 +558,7 @@
558
558
  getDefaultOptions: table => {
559
559
  return {
560
560
  columnResizeMode: 'onEnd',
561
+ columnResizeDirection: 'ltr',
561
562
  onColumnSizingChange: makeStateUpdater('columnSizing', table),
562
563
  onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', table)
563
564
  };
@@ -639,7 +640,8 @@
639
640
  }
640
641
  table.setColumnSizingInfo(old => {
641
642
  var _old$startOffset, _old$startSize;
642
- const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
643
+ const deltaDirection = table.options.columnResizeDirection === 'rtl' ? -1 : 1;
644
+ const deltaOffset = (clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0)) * deltaDirection;
643
645
  const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
644
646
  old.columnSizingStart.forEach(_ref3 => {
645
647
  let [columnId, headerSize] = _ref3;
@@ -1149,7 +1151,6 @@
1149
1151
  // () => [column.getFacetedRowModel()],
1150
1152
  // facetedRowModel => getRowModelMinMaxValues(facetedRowModel, column.id),
1151
1153
  },
1152
-
1153
1154
  createRow: (row, table) => {
1154
1155
  row.columnFilters = {};
1155
1156
  row.columnFiltersMeta = {};
@@ -1943,7 +1944,6 @@
1943
1944
  // isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
1944
1945
  };
1945
1946
  },
1946
-
1947
1947
  createTable: table => {
1948
1948
  table.setRowSelection = updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater);
1949
1949
  table.resetRowSelection = defaultState => {
@@ -2352,9 +2352,6 @@
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
- }
2358
2355
  if (typeof a === 'number') {
2359
2356
  if (isNaN(a) || a === Infinity || a === -Infinity) {
2360
2357
  return '';
@@ -2371,13 +2368,6 @@
2371
2368
  // It handles numbers, mixed alphanumeric combinations, and even
2372
2369
  // null, undefined, and Infinity
2373
2370
  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
-
2381
2371
  // Split on number groups, but keep the delimiter
2382
2372
  // Then remove falsey split values
2383
2373
  const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);
@@ -3085,6 +3075,7 @@
3085
3075
  // helper.accessor('nested.bar', {
3086
3076
  // cell: info => info.getValue(),
3087
3077
  // })
3078
+
3088
3079
  function createColumnHelper() {
3089
3080
  return {
3090
3081
  accessor: (accessor, column) => {
@@ -3629,7 +3620,6 @@
3629
3620
  // nonGroupedRowsById[subRow.id] = subRow;
3630
3621
  // }
3631
3622
  });
3632
-
3633
3623
  return row;
3634
3624
  });
3635
3625
  return aggregatedGroupedRows;
@@ -3646,7 +3636,6 @@
3646
3636
  // nonGroupedRowsById[subRow.id] = subRow;
3647
3637
  // }
3648
3638
  });
3649
-
3650
3639
  return {
3651
3640
  rows: groupedRows,
3652
3641
  flatRows: groupedFlatRows,