@tanstack/table-core 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.
- package/build/lib/columnHelper.js +1 -0
- package/build/lib/columnHelper.js.map +1 -1
- package/build/lib/features/ColumnSizing.d.ts +8 -1
- package/build/lib/features/ColumnSizing.js +3 -1
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/features/Filters.js +0 -1
- package/build/lib/features/Filters.js.map +1 -1
- package/build/lib/features/RowSelection.d.ts +2 -2
- package/build/lib/features/RowSelection.js +0 -1
- package/build/lib/features/RowSelection.js.map +1 -1
- package/build/lib/index.esm.js +4 -15
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +4 -15
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/sortingFns.js +0 -10
- package/build/lib/sortingFns.js.map +1 -1
- package/build/lib/utils/getGroupedRowModel.js +0 -2
- package/build/lib/utils/getGroupedRowModel.js.map +1 -1
- package/build/umd/index.development.js +4 -15
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/features/ColumnSizing.ts +12 -2
- package/src/features/RowSelection.ts +2 -2
- package/src/sortingFns.ts +0 -10
package/build/lib/index.mjs
CHANGED
|
@@ -543,6 +543,7 @@ const ColumnSizing = {
|
|
|
543
543
|
getDefaultOptions: table => {
|
|
544
544
|
return {
|
|
545
545
|
columnResizeMode: 'onEnd',
|
|
546
|
+
columnResizeDirection: 'ltr',
|
|
546
547
|
onColumnSizingChange: makeStateUpdater('columnSizing', table),
|
|
547
548
|
onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', table)
|
|
548
549
|
};
|
|
@@ -624,7 +625,8 @@ const ColumnSizing = {
|
|
|
624
625
|
}
|
|
625
626
|
table.setColumnSizingInfo(old => {
|
|
626
627
|
var _old$startOffset, _old$startSize;
|
|
627
|
-
const
|
|
628
|
+
const deltaDirection = table.options.columnResizeDirection === 'rtl' ? -1 : 1;
|
|
629
|
+
const deltaOffset = (clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0)) * deltaDirection;
|
|
628
630
|
const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
|
|
629
631
|
old.columnSizingStart.forEach(_ref3 => {
|
|
630
632
|
let [columnId, headerSize] = _ref3;
|
|
@@ -1134,7 +1136,6 @@ const Filters = {
|
|
|
1134
1136
|
// () => [column.getFacetedRowModel()],
|
|
1135
1137
|
// facetedRowModel => getRowModelMinMaxValues(facetedRowModel, column.id),
|
|
1136
1138
|
},
|
|
1137
|
-
|
|
1138
1139
|
createRow: (row, table) => {
|
|
1139
1140
|
row.columnFilters = {};
|
|
1140
1141
|
row.columnFiltersMeta = {};
|
|
@@ -1928,7 +1929,6 @@ const RowSelection = {
|
|
|
1928
1929
|
// isInclusiveSelectEvent: (e: unknown) => !!e.shiftKey,
|
|
1929
1930
|
};
|
|
1930
1931
|
},
|
|
1931
|
-
|
|
1932
1932
|
createTable: table => {
|
|
1933
1933
|
table.setRowSelection = updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater);
|
|
1934
1934
|
table.resetRowSelection = defaultState => {
|
|
@@ -2337,9 +2337,6 @@ function compareBasic(a, b) {
|
|
|
2337
2337
|
return a === b ? 0 : a > b ? 1 : -1;
|
|
2338
2338
|
}
|
|
2339
2339
|
function toString(a) {
|
|
2340
|
-
if (typeof a === 'boolean') {
|
|
2341
|
-
return String(a);
|
|
2342
|
-
}
|
|
2343
2340
|
if (typeof a === 'number') {
|
|
2344
2341
|
if (isNaN(a) || a === Infinity || a === -Infinity) {
|
|
2345
2342
|
return '';
|
|
@@ -2356,13 +2353,6 @@ function toString(a) {
|
|
|
2356
2353
|
// It handles numbers, mixed alphanumeric combinations, and even
|
|
2357
2354
|
// null, undefined, and Infinity
|
|
2358
2355
|
function compareAlphanumeric(aStr, bStr) {
|
|
2359
|
-
// Check if the string contains only a number
|
|
2360
|
-
const aFloat = parseFloat(aStr);
|
|
2361
|
-
const bFloat = parseFloat(bStr);
|
|
2362
|
-
if (!isNaN(aFloat) && !isNaN(bFloat)) {
|
|
2363
|
-
return compareBasic(aFloat, bFloat);
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
2356
|
// Split on number groups, but keep the delimiter
|
|
2367
2357
|
// Then remove falsey split values
|
|
2368
2358
|
const a = aStr.split(reSplitAlphaNumeric).filter(Boolean);
|
|
@@ -3071,6 +3061,7 @@ const createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
|
3071
3061
|
// helper.accessor('nested.bar', {
|
|
3072
3062
|
// cell: info => info.getValue(),
|
|
3073
3063
|
// })
|
|
3064
|
+
|
|
3074
3065
|
function createColumnHelper() {
|
|
3075
3066
|
return {
|
|
3076
3067
|
accessor: (accessor, column) => {
|
|
@@ -3615,7 +3606,6 @@ function getGroupedRowModel() {
|
|
|
3615
3606
|
// nonGroupedRowsById[subRow.id] = subRow;
|
|
3616
3607
|
// }
|
|
3617
3608
|
});
|
|
3618
|
-
|
|
3619
3609
|
return row;
|
|
3620
3610
|
});
|
|
3621
3611
|
return aggregatedGroupedRows;
|
|
@@ -3632,7 +3622,6 @@ function getGroupedRowModel() {
|
|
|
3632
3622
|
// nonGroupedRowsById[subRow.id] = subRow;
|
|
3633
3623
|
// }
|
|
3634
3624
|
});
|
|
3635
|
-
|
|
3636
3625
|
return {
|
|
3637
3626
|
rows: groupedRows,
|
|
3638
3627
|
flatRows: groupedFlatRows,
|