@tanstack/table-core 8.11.8 → 8.13.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/core/cell.js +1 -4
- package/build/lib/core/cell.js.map +1 -1
- package/build/lib/core/column.js +2 -14
- package/build/lib/core/column.js.map +1 -1
- package/build/lib/core/headers.js +17 -112
- package/build/lib/core/headers.js.map +1 -1
- package/build/lib/core/row.js +2 -14
- package/build/lib/core/row.js.map +1 -1
- package/build/lib/core/table.d.ts +6 -0
- package/build/lib/core/table.js +5 -35
- package/build/lib/core/table.js.map +1 -1
- package/build/lib/features/ColumnSizing.d.ts +6 -2
- package/build/lib/features/ColumnSizing.js +3 -9
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/features/Ordering.d.ts +21 -0
- package/build/lib/features/Ordering.js +15 -4
- package/build/lib/features/Ordering.js.map +1 -1
- package/build/lib/features/Pagination.d.ts +26 -4
- package/build/lib/features/Pagination.js +13 -8
- package/build/lib/features/Pagination.js.map +1 -1
- package/build/lib/features/Pinning.js +10 -58
- package/build/lib/features/Pinning.js.map +1 -1
- package/build/lib/features/RowSelection.js +3 -21
- package/build/lib/features/RowSelection.js.map +1 -1
- package/build/lib/features/Visibility.d.ts +8 -1
- package/build/lib/features/Visibility.js +7 -21
- package/build/lib/features/Visibility.js.map +1 -1
- package/build/lib/index.esm.js +102 -384
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +2 -0
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +102 -384
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/types.d.ts +2 -2
- package/build/lib/utils/filterRowsUtils.d.ts +0 -2
- package/build/lib/utils/filterRowsUtils.js +0 -2
- package/build/lib/utils/filterRowsUtils.js.map +1 -1
- package/build/lib/utils/getCoreRowModel.js +1 -10
- package/build/lib/utils/getCoreRowModel.js.map +1 -1
- package/build/lib/utils/getExpandedRowModel.js +1 -7
- package/build/lib/utils/getExpandedRowModel.js.map +1 -1
- package/build/lib/utils/getFacetedMinMaxValues.js +1 -8
- package/build/lib/utils/getFacetedMinMaxValues.js.map +1 -1
- package/build/lib/utils/getFacetedRowModel.js +1 -8
- package/build/lib/utils/getFacetedRowModel.js.map +1 -1
- package/build/lib/utils/getFacetedUniqueValues.js +1 -8
- package/build/lib/utils/getFacetedUniqueValues.js.map +1 -1
- package/build/lib/utils/getFilteredRowModel.js +1 -10
- package/build/lib/utils/getFilteredRowModel.js.map +1 -1
- package/build/lib/utils/getGroupedRowModel.js +6 -13
- package/build/lib/utils/getGroupedRowModel.js.map +1 -1
- package/build/lib/utils/getPaginationRowModel.js +1 -7
- package/build/lib/utils/getPaginationRowModel.js.map +1 -1
- package/build/lib/utils/getSortedRowModel.js +1 -10
- package/build/lib/utils/getSortedRowModel.js.map +1 -1
- package/build/lib/utils.d.ts +8 -3
- package/build/lib/utils.js +13 -2
- package/build/lib/utils.js.map +1 -1
- package/build/umd/index.development.js +103 -383
- 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/core/cell.ts +2 -5
- package/src/core/column.ts +3 -9
- package/src/core/headers.ts +19 -65
- package/src/core/row.ts +3 -10
- package/src/core/table.ts +12 -21
- package/src/features/ColumnSizing.ts +33 -20
- package/src/features/Ordering.ts +74 -35
- package/src/features/Pagination.ts +49 -13
- package/src/features/Pinning.ts +35 -61
- package/src/features/RowSelection.ts +4 -16
- package/src/features/Visibility.ts +23 -13
- package/src/types.ts +3 -1
- package/src/utils/filterRowsUtils.ts +2 -2
- package/src/utils/getCoreRowModel.ts +4 -8
- package/src/utils/getExpandedRowModel.ts +2 -5
- package/src/utils/getFacetedMinMaxValues.ts +2 -8
- package/src/utils/getFacetedRowModel.ts +2 -8
- package/src/utils/getFacetedUniqueValues.ts +6 -8
- package/src/utils/getFilteredRowModel.ts +4 -8
- package/src/utils/getGroupedRowModel.ts +7 -11
- package/src/utils/getPaginationRowModel.ts +2 -5
- package/src/utils/getSortedRowModel.ts +4 -8
- package/src/utils.ts +25 -6
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
var utils = require('../utils.js');
|
|
14
14
|
var Grouping = require('./Grouping.js');
|
|
15
|
+
var Visibility = require('./Visibility.js');
|
|
15
16
|
|
|
16
17
|
//
|
|
17
18
|
|
|
@@ -27,6 +28,19 @@ const Ordering = {
|
|
|
27
28
|
onColumnOrderChange: utils.makeStateUpdater('columnOrder', table)
|
|
28
29
|
};
|
|
29
30
|
},
|
|
31
|
+
createColumn: (column, table) => {
|
|
32
|
+
column.getIndex = utils.memo(position => [Visibility._getVisibleLeafColumns(table, position)], columns => columns.findIndex(d => d.id === column.id), utils.getMemoOptions(table.options, 'debugColumns', 'getIndex'));
|
|
33
|
+
column.getIsFirstColumn = position => {
|
|
34
|
+
var _columns$;
|
|
35
|
+
const columns = Visibility._getVisibleLeafColumns(table, position);
|
|
36
|
+
return ((_columns$ = columns[0]) == null ? void 0 : _columns$.id) === column.id;
|
|
37
|
+
};
|
|
38
|
+
column.getIsLastColumn = position => {
|
|
39
|
+
var _columns;
|
|
40
|
+
const columns = Visibility._getVisibleLeafColumns(table, position);
|
|
41
|
+
return ((_columns = columns[columns.length - 1]) == null ? void 0 : _columns.id) === column.id;
|
|
42
|
+
};
|
|
43
|
+
},
|
|
30
44
|
createTable: table => {
|
|
31
45
|
table.setColumnOrder = updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater);
|
|
32
46
|
table.resetColumnOrder = defaultState => {
|
|
@@ -62,10 +76,7 @@ const Ordering = {
|
|
|
62
76
|
orderedColumns = [...orderedColumns, ...columnsCopy];
|
|
63
77
|
}
|
|
64
78
|
return Grouping.orderColumns(orderedColumns, grouping, groupedColumnMode);
|
|
65
|
-
},
|
|
66
|
-
key: process.env.NODE_ENV === 'development' && 'getOrderColumnsFn'
|
|
67
|
-
// debug: () => table.options.debugAll ?? table.options.debugTable,
|
|
68
|
-
});
|
|
79
|
+
}, utils.getMemoOptions(table.options, 'debugTable', '_getOrderColumnsFn'));
|
|
69
80
|
}
|
|
70
81
|
};
|
|
71
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ordering.js","sources":["../../../src/features/Ordering.ts"],"sourcesContent":["import { makeStateUpdater, memo } from '../utils'\n\nimport { Table, OnChangeFn, Updater, Column, RowData } from '../types'\n\nimport { orderColumns } from './Grouping'\nimport { TableFeature } from '../core/table'\n\nexport interface ColumnOrderTableState {\n columnOrder: ColumnOrderState\n}\n\nexport type ColumnOrderState = string[]\n\nexport interface ColumnOrderOptions {\n /**\n * If provided, this function will be called with an `updaterFn` when `state.columnOrder` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#oncolumnorderchange)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n onColumnOrderChange?: OnChangeFn<ColumnOrderState>\n}\n\nexport interface ColumnOrderDefaultOptions {\n onColumnOrderChange: OnChangeFn<ColumnOrderState>\n}\n\nexport interface ColumnOrderInstance<TData extends RowData> {\n _getOrderColumnsFn: () => (\n columns: Column<TData, unknown>[]\n ) => Column<TData, unknown>[]\n /**\n * Resets the **columnOrder** state to `initialState.columnOrder`, or `true` can be passed to force a default blank state reset to `[]`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#resetcolumnorder)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n resetColumnOrder: (defaultState?: boolean) => void\n /**\n * Sets or updates the `state.columnOrder` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#setcolumnorder)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n setColumnOrder: (updater: Updater<ColumnOrderState>) => void\n}\n\n//\n\nexport const Ordering: TableFeature = {\n getInitialState: (state): ColumnOrderTableState => {\n return {\n columnOrder: [],\n ...state,\n }\n },\n\n getDefaultOptions: <TData extends RowData>(\n table: Table<TData>\n ): ColumnOrderDefaultOptions => {\n return {\n onColumnOrderChange: makeStateUpdater('columnOrder', table),\n }\n },\n\n createTable: <TData extends RowData>(table: Table<TData>): void => {\n table.setColumnOrder = updater =>\n table.options.onColumnOrderChange?.(updater)\n table.resetColumnOrder = defaultState => {\n table.setColumnOrder(\n defaultState ? [] : table.initialState.columnOrder ?? []\n )\n }\n table._getOrderColumnsFn = memo(\n () => [\n table.getState().columnOrder,\n table.getState().grouping,\n table.options.groupedColumnMode,\n ],\n (columnOrder, grouping, groupedColumnMode)
|
|
1
|
+
{"version":3,"file":"Ordering.js","sources":["../../../src/features/Ordering.ts"],"sourcesContent":["import { getMemoOptions, makeStateUpdater, memo } from '../utils'\n\nimport { Table, OnChangeFn, Updater, Column, RowData } from '../types'\n\nimport { orderColumns } from './Grouping'\nimport { TableFeature } from '../core/table'\nimport { ColumnPinningPosition, _getVisibleLeafColumns } from '..'\n\nexport interface ColumnOrderTableState {\n columnOrder: ColumnOrderState\n}\n\nexport type ColumnOrderState = string[]\n\nexport interface ColumnOrderOptions {\n /**\n * If provided, this function will be called with an `updaterFn` when `state.columnOrder` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#oncolumnorderchange)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n onColumnOrderChange?: OnChangeFn<ColumnOrderState>\n}\n\nexport interface ColumnOrderColumn {\n /**\n * Returns the index of the column in the order of the visible columns. Optionally pass a `position` parameter to get the index of the column in a sub-section of the table\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#getindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n getIndex: (position?: ColumnPinningPosition | 'center') => number\n /**\n * Returns `true` if the column is the first column in the order of the visible columns. Optionally pass a `position` parameter to check if the column is the first in a sub-section of the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#getisfirstcolumn)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n getIsFirstColumn: (position?: ColumnPinningPosition | 'center') => boolean\n /**\n * Returns `true` if the column is the last column in the order of the visible columns. Optionally pass a `position` parameter to check if the column is the last in a sub-section of the table.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#getislastcolumn)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n getIsLastColumn: (position?: ColumnPinningPosition | 'center') => boolean\n}\n\nexport interface ColumnOrderDefaultOptions {\n onColumnOrderChange: OnChangeFn<ColumnOrderState>\n}\n\nexport interface ColumnOrderInstance<TData extends RowData> {\n _getOrderColumnsFn: () => (\n columns: Column<TData, unknown>[]\n ) => Column<TData, unknown>[]\n /**\n * Resets the **columnOrder** state to `initialState.columnOrder`, or `true` can be passed to force a default blank state reset to `[]`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#resetcolumnorder)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n resetColumnOrder: (defaultState?: boolean) => void\n /**\n * Sets or updates the `state.columnOrder` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#setcolumnorder)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering)\n */\n setColumnOrder: (updater: Updater<ColumnOrderState>) => void\n}\n\n//\n\nexport const Ordering: TableFeature = {\n getInitialState: (state): ColumnOrderTableState => {\n return {\n columnOrder: [],\n ...state,\n }\n },\n\n getDefaultOptions: <TData extends RowData>(\n table: Table<TData>\n ): ColumnOrderDefaultOptions => {\n return {\n onColumnOrderChange: makeStateUpdater('columnOrder', table),\n }\n },\n\n createColumn: <TData extends RowData>(\n column: Column<TData, unknown>,\n table: Table<TData>\n ): void => {\n column.getIndex = memo(\n position => [_getVisibleLeafColumns(table, position)],\n columns => columns.findIndex(d => d.id === column.id),\n getMemoOptions(table.options, 'debugColumns', 'getIndex')\n )\n column.getIsFirstColumn = position => {\n const columns = _getVisibleLeafColumns(table, position)\n return columns[0]?.id === column.id\n }\n column.getIsLastColumn = position => {\n const columns = _getVisibleLeafColumns(table, position)\n return columns[columns.length - 1]?.id === column.id\n }\n },\n\n createTable: <TData extends RowData>(table: Table<TData>): void => {\n table.setColumnOrder = updater =>\n table.options.onColumnOrderChange?.(updater)\n table.resetColumnOrder = defaultState => {\n table.setColumnOrder(\n defaultState ? [] : table.initialState.columnOrder ?? []\n )\n }\n table._getOrderColumnsFn = memo(\n () => [\n table.getState().columnOrder,\n table.getState().grouping,\n table.options.groupedColumnMode,\n ],\n (columnOrder, grouping, groupedColumnMode) =>\n (columns: Column<TData, unknown>[]) => {\n // Sort grouped columns to the start of the column list\n // before the headers are built\n let orderedColumns: Column<TData, unknown>[] = []\n\n // If there is no order, return the normal columns\n if (!columnOrder?.length) {\n orderedColumns = columns\n } else {\n const columnOrderCopy = [...columnOrder]\n\n // If there is an order, make a copy of the columns\n const columnsCopy = [...columns]\n\n // And make a new ordered array of the columns\n\n // Loop over the columns and place them in order into the new array\n while (columnsCopy.length && columnOrderCopy.length) {\n const targetColumnId = columnOrderCopy.shift()\n const foundIndex = columnsCopy.findIndex(\n d => d.id === targetColumnId\n )\n if (foundIndex > -1) {\n orderedColumns.push(columnsCopy.splice(foundIndex, 1)[0]!)\n }\n }\n\n // If there are any columns left, add them to the end\n orderedColumns = [...orderedColumns, ...columnsCopy]\n }\n\n return orderColumns(orderedColumns, grouping, groupedColumnMode)\n },\n getMemoOptions(table.options, 'debugTable', '_getOrderColumnsFn')\n )\n },\n}\n"],"names":["Ordering","getInitialState","state","columnOrder","getDefaultOptions","table","onColumnOrderChange","makeStateUpdater","createColumn","column","getIndex","memo","position","_getVisibleLeafColumns","columns","findIndex","d","id","getMemoOptions","options","getIsFirstColumn","_columns$","getIsLastColumn","_columns","length","createTable","setColumnOrder","updater","resetColumnOrder","defaultState","_table$initialState$c","initialState","_getOrderColumnsFn","getState","grouping","groupedColumnMode","orderedColumns","columnOrderCopy","columnsCopy","targetColumnId","shift","foundIndex","push","splice","orderColumns"],"mappings":";;;;;;;;;;;;;;;;AAkEA;;AAEO,MAAMA,QAAsB,GAAG;EACpCC,eAAe,EAAGC,KAAK,IAA4B;IACjD,OAAO;AACLC,MAAAA,WAAW,EAAE,EAAE;MACf,GAAGD,KAAAA;KACJ,CAAA;GACF;EAEDE,iBAAiB,EACfC,KAAmB,IACW;IAC9B,OAAO;AACLC,MAAAA,mBAAmB,EAAEC,sBAAgB,CAAC,aAAa,EAAEF,KAAK,CAAA;KAC3D,CAAA;GACF;AAEDG,EAAAA,YAAY,EAAEA,CACZC,MAA8B,EAC9BJ,KAAmB,KACV;AACTI,IAAAA,MAAM,CAACC,QAAQ,GAAGC,UAAI,CACpBC,QAAQ,IAAI,CAACC,iCAAsB,CAACR,KAAK,EAAEO,QAAQ,CAAC,CAAC,EACrDE,OAAO,IAAIA,OAAO,CAACC,SAAS,CAACC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKR,MAAM,CAACQ,EAAE,CAAC,EACrDC,oBAAc,CAACb,KAAK,CAACc,OAAO,EAAE,cAAc,EAAE,UAAU,CAC1D,CAAC,CAAA;AACDV,IAAAA,MAAM,CAACW,gBAAgB,GAAGR,QAAQ,IAAI;AAAA,MAAA,IAAAS,SAAA,CAAA;AACpC,MAAA,MAAMP,OAAO,GAAGD,iCAAsB,CAACR,KAAK,EAAEO,QAAQ,CAAC,CAAA;AACvD,MAAA,OAAO,CAAAS,CAAAA,SAAA,GAAAP,OAAO,CAAC,CAAC,CAAC,KAAVO,IAAAA,GAAAA,KAAAA,CAAAA,GAAAA,SAAA,CAAYJ,EAAE,MAAKR,MAAM,CAACQ,EAAE,CAAA;KACpC,CAAA;AACDR,IAAAA,MAAM,CAACa,eAAe,GAAGV,QAAQ,IAAI;AAAA,MAAA,IAAAW,QAAA,CAAA;AACnC,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G,CAAC,GAAGlC,WAAW,CAAC,CAAA;;AAExC;AACA,QAAA,MAAMmC,WAAW,GAAG,CAAC,GAAGxB,OAAO,CAAC,CAAA;;AAEhC;;AAEA;AACA,QAAA,OAAOwB,WAAW,CAACd,MAAM,IAAIa,eAAe,CAACb,MAAM,EAAE;AACnD,UAAA,MAAMe,cAAc,GAAGF,eAAe,CAACG,KAAK,EAAE,CAAA;AAC9C,UAAA,MAAMC,UAAU,GAAGH,WAAW,CAACvB,SAAS,CACtCC,CAAC,IAAIA,CAAC,CAACC,EAAE,KAAKsB,cAChB,CAAC,CAAA;AACD,UAAA,IAAIE,UAAU,GAAG,CAAC,CAAC,EAAE;AACnBL,YAAAA,cAAc,CAACM,IAAI,CAACJ,WAAW,CAACK,MAAM,CAACF,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,CAAA;AAC5D,WAAA;AACF,SAAA;;AAEA;AACAL,QAAAA,cAAc,GAAG,CAAC,GAAGA,cAAc,EAAE,GAAGE,WAAW,CAAC,CAAA;AACtD,OAAA;AAEA,MAAA,OAAOM,qBAAY,CAACR,cAAc,EAAEF,QAAQ,EAAEC,iBAAiB,CAAC,CAAA;KACjE,EACHjB,oBAAc,CAACb,KAAK,CAACc,OAAO,EAAE,YAAY,EAAE,oBAAoB,CAClE,CAAC,CAAA;AACH,GAAA;AACF;;;;"}
|
|
@@ -38,11 +38,17 @@ export interface PaginationOptions {
|
|
|
38
38
|
*/
|
|
39
39
|
onPaginationChange?: OnChangeFn<PaginationState>;
|
|
40
40
|
/**
|
|
41
|
-
* When manually controlling pagination, you
|
|
41
|
+
* When manually controlling pagination, you can supply a total `pageCount` value to the table if you know it (Or supply a `rowCount` and `pageCount` will be calculated). If you do not know how many pages there are, you can set this to `-1`.
|
|
42
42
|
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#pagecount)
|
|
43
43
|
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
44
44
|
*/
|
|
45
45
|
pageCount?: number;
|
|
46
|
+
/**
|
|
47
|
+
* When manually controlling pagination, you can supply a total `rowCount` value to the table if you know it. The `pageCount` can be calculated from this value and the `pageSize`.
|
|
48
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#rowcount)
|
|
49
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
50
|
+
*/
|
|
51
|
+
rowCount?: number;
|
|
46
52
|
}
|
|
47
53
|
export interface PaginationDefaultOptions {
|
|
48
54
|
onPaginationChange: OnChangeFn<PaginationState>;
|
|
@@ -68,6 +74,12 @@ export interface PaginationInstance<TData extends RowData> {
|
|
|
68
74
|
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
69
75
|
*/
|
|
70
76
|
getPageCount: () => number;
|
|
77
|
+
/**
|
|
78
|
+
* Returns the row count. If manually paginating or controlling the pagination state, this will come directly from the `options.rowCount` table option, otherwise it will be calculated from the table data.
|
|
79
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getrowcount)
|
|
80
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
81
|
+
*/
|
|
82
|
+
getRowCount: () => number;
|
|
71
83
|
/**
|
|
72
84
|
* Returns an array of page options (zero-index-based) for the current page size.
|
|
73
85
|
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpageoptions)
|
|
@@ -98,6 +110,18 @@ export interface PaginationInstance<TData extends RowData> {
|
|
|
98
110
|
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
99
111
|
*/
|
|
100
112
|
previousPage: () => void;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the page index to `0`.
|
|
115
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#firstpage)
|
|
116
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
117
|
+
*/
|
|
118
|
+
firstPage: () => void;
|
|
119
|
+
/**
|
|
120
|
+
* Sets the page index to the last page.
|
|
121
|
+
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#lastpage)
|
|
122
|
+
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
123
|
+
*/
|
|
124
|
+
lastPage: () => void;
|
|
101
125
|
/**
|
|
102
126
|
* Resets the page index to its initial state. If `defaultState` is `true`, the page index will be reset to `0` regardless of initial state.
|
|
103
127
|
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpageindex)
|
|
@@ -117,9 +141,7 @@ export interface PaginationInstance<TData extends RowData> {
|
|
|
117
141
|
*/
|
|
118
142
|
resetPagination: (defaultState?: boolean) => void;
|
|
119
143
|
/**
|
|
120
|
-
*
|
|
121
|
-
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagecount)
|
|
122
|
-
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)
|
|
144
|
+
* @deprecated The page count no longer exists in the pagination state. Just pass as a table option instead.
|
|
123
145
|
*/
|
|
124
146
|
setPageCount: (updater: Updater<number>) => void;
|
|
125
147
|
/**
|
|
@@ -97,6 +97,7 @@ const Pagination = {
|
|
|
97
97
|
};
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
+
//deprecated
|
|
100
101
|
table.setPageCount = updater => table.setPagination(old => {
|
|
101
102
|
var _table$options$pageCo;
|
|
102
103
|
let newPageCount = utils.functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
|
|
@@ -114,13 +115,7 @@ const Pagination = {
|
|
|
114
115
|
pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);
|
|
115
116
|
}
|
|
116
117
|
return pageOptions;
|
|
117
|
-
},
|
|
118
|
-
key: process.env.NODE_ENV === 'development' && 'getPageOptions',
|
|
119
|
-
debug: () => {
|
|
120
|
-
var _table$options$debugA;
|
|
121
|
-
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
|
|
122
|
-
}
|
|
123
|
-
});
|
|
118
|
+
}, utils.getMemoOptions(table.options, 'debugTable', 'getPageOptions'));
|
|
124
119
|
table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0;
|
|
125
120
|
table.getCanNextPage = () => {
|
|
126
121
|
const {
|
|
@@ -143,6 +138,12 @@ const Pagination = {
|
|
|
143
138
|
return old + 1;
|
|
144
139
|
});
|
|
145
140
|
};
|
|
141
|
+
table.firstPage = () => {
|
|
142
|
+
return table.setPageIndex(0);
|
|
143
|
+
};
|
|
144
|
+
table.lastPage = () => {
|
|
145
|
+
return table.setPageIndex(table.getPageCount() - 1);
|
|
146
|
+
};
|
|
146
147
|
table.getPrePaginationRowModel = () => table.getExpandedRowModel();
|
|
147
148
|
table.getPaginationRowModel = () => {
|
|
148
149
|
if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
|
|
@@ -155,7 +156,11 @@ const Pagination = {
|
|
|
155
156
|
};
|
|
156
157
|
table.getPageCount = () => {
|
|
157
158
|
var _table$options$pageCo2;
|
|
158
|
-
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.
|
|
159
|
+
return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);
|
|
160
|
+
};
|
|
161
|
+
table.getRowCount = () => {
|
|
162
|
+
var _table$options$rowCou;
|
|
163
|
+
return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;
|
|
159
164
|
};
|
|
160
165
|
}
|
|
161
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Pagination.js","sources":["../../../src/features/Pagination.ts"],"sourcesContent":["import { TableFeature } from '../core/table'\nimport { OnChangeFn, Table, RowModel, Updater, RowData } from '../types'\nimport { functionalUpdate, makeStateUpdater, memo } from '../utils'\n\nexport interface PaginationState {\n pageIndex: number\n pageSize: number\n}\n\nexport interface PaginationTableState {\n pagination: PaginationState\n}\n\nexport interface PaginationInitialTableState {\n pagination?: Partial<PaginationState>\n}\n\nexport interface PaginationOptions {\n /**\n * If set to `true`, pagination will be reset to the first page when page-altering state changes eg. `data` is updated, filters change, grouping changes, etc.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#autoresetpageindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n autoResetPageIndex?: boolean\n /**\n * Returns the row model after pagination has taken place, but no further.\n *\n * Pagination columns are automatically reordered by default to the start of the columns list. If you would rather remove them or leave them as-is, set the appropriate mode here.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPaginationRowModel?: (table: Table<any>) => () => RowModel<any>\n /**\n * Enables manual pagination. If this option is set to `true`, the table will not automatically paginate rows using `getPaginationRowModel()` and instead will expect you to manually paginate the rows before passing them to the table. This is useful if you are doing server-side pagination and aggregation.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#manualpagination)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n manualPagination?: boolean\n /**\n * If this function is provided, it will be called when the pagination state changes and you will be expected to manage the state yourself. You can pass the managed state back to the table via the `tableOptions.state.pagination` option.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#onpaginationchange)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n onPaginationChange?: OnChangeFn<PaginationState>\n /**\n * When manually controlling pagination, you should supply a total `pageCount` value to the table if you know it. If you do not know how many pages there are, you can set this to `-1`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#pagecount)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n pageCount?: number\n}\n\nexport interface PaginationDefaultOptions {\n onPaginationChange: OnChangeFn<PaginationState>\n}\n\nexport interface PaginationInstance<TData extends RowData> {\n _autoResetPageIndex: () => void\n _getPaginationRowModel?: () => RowModel<TData>\n /**\n * Returns whether the table can go to the next page.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcannextpage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getCanNextPage: () => boolean\n /**\n * Returns whether the table can go to the previous page.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcanpreviouspage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getCanPreviousPage: () => boolean\n /**\n * Returns the page count. If manually paginating or controlling the pagination state, this will come directly from the `options.pageCount` table option, otherwise it will be calculated from the table data using the total row count and current page size.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpagecount)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPageCount: () => number\n /**\n * Returns an array of page options (zero-index-based) for the current page size.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpageoptions)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPageOptions: () => number[]\n /**\n * Returns the row model for the table after pagination has been applied.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPaginationRowModel: () => RowModel<TData>\n /**\n * Returns the row model for the table before any pagination has been applied.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getprepaginationrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPrePaginationRowModel: () => RowModel<TData>\n /**\n * Increments the page index by one, if possible.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#nextpage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n nextPage: () => void\n /**\n * Decrements the page index by one, if possible.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#previouspage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n previousPage: () => void\n /**\n * Resets the page index to its initial state. If `defaultState` is `true`, the page index will be reset to `0` regardless of initial state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpageindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n resetPageIndex: (defaultState?: boolean) => void\n /**\n * Resets the page size to its initial state. If `defaultState` is `true`, the page size will be reset to `10` regardless of initial state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagesize)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n resetPageSize: (defaultState?: boolean) => void\n /**\n * Resets the **pagination** state to `initialState.pagination`, or `true` can be passed to force a default blank state reset to `[]`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagination)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n resetPagination: (defaultState?: boolean) => void\n /**\n * Updates the page count using the provided function or value.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagecount)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n setPageCount: (updater: Updater<number>) => void\n /**\n * Updates the page index using the provided function or value in the `state.pagination.pageIndex` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpageindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n setPageIndex: (updater: Updater<number>) => void\n /**\n * Updates the page size using the provided function or value in the `state.pagination.pageSize` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagesize)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n setPageSize: (updater: Updater<number>) => void\n /**\n * Sets or updates the `state.pagination` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagination)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n setPagination: (updater: Updater<PaginationState>) => void\n}\n\n//\n\nconst defaultPageIndex = 0\nconst defaultPageSize = 10\n\nconst getDefaultPaginationState = (): PaginationState => ({\n pageIndex: defaultPageIndex,\n pageSize: defaultPageSize,\n})\n\nexport const Pagination: TableFeature = {\n getInitialState: (state): PaginationTableState => {\n return {\n ...state,\n pagination: {\n ...getDefaultPaginationState(),\n ...state?.pagination,\n },\n }\n },\n\n getDefaultOptions: <TData extends RowData>(\n table: Table<TData>\n ): PaginationDefaultOptions => {\n return {\n onPaginationChange: makeStateUpdater('pagination', table),\n }\n },\n\n createTable: <TData extends RowData>(table: Table<TData>): void => {\n let registered = false\n let queued = false\n\n table._autoResetPageIndex = () => {\n if (!registered) {\n table._queue(() => {\n registered = true\n })\n return\n }\n\n if (\n table.options.autoResetAll ??\n table.options.autoResetPageIndex ??\n !table.options.manualPagination\n ) {\n if (queued) return\n queued = true\n table._queue(() => {\n table.resetPageIndex()\n queued = false\n })\n }\n }\n table.setPagination = updater => {\n const safeUpdater: Updater<PaginationState> = old => {\n let newState = functionalUpdate(updater, old)\n\n return newState\n }\n\n return table.options.onPaginationChange?.(safeUpdater)\n }\n table.resetPagination = defaultState => {\n table.setPagination(\n defaultState\n ? getDefaultPaginationState()\n : table.initialState.pagination ?? getDefaultPaginationState()\n )\n }\n table.setPageIndex = updater => {\n table.setPagination(old => {\n let pageIndex = functionalUpdate(updater, old.pageIndex)\n\n const maxPageIndex =\n typeof table.options.pageCount === 'undefined' ||\n table.options.pageCount === -1\n ? Number.MAX_SAFE_INTEGER\n : table.options.pageCount - 1\n\n pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex))\n\n return {\n ...old,\n pageIndex,\n }\n })\n }\n table.resetPageIndex = defaultState => {\n table.setPageIndex(\n defaultState\n ? defaultPageIndex\n : table.initialState?.pagination?.pageIndex ?? defaultPageIndex\n )\n }\n table.resetPageSize = defaultState => {\n table.setPageSize(\n defaultState\n ? defaultPageSize\n : table.initialState?.pagination?.pageSize ?? defaultPageSize\n )\n }\n table.setPageSize = updater => {\n table.setPagination(old => {\n const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize))\n const topRowIndex = old.pageSize * old.pageIndex!\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...old,\n pageIndex,\n pageSize,\n }\n })\n }\n table.setPageCount = updater =>\n table.setPagination(old => {\n let newPageCount = functionalUpdate(\n updater,\n table.options.pageCount ?? -1\n )\n\n if (typeof newPageCount === 'number') {\n newPageCount = Math.max(-1, newPageCount)\n }\n\n return {\n ...old,\n pageCount: newPageCount,\n }\n })\n\n table.getPageOptions = memo(\n () => [table.getPageCount()],\n pageCount => {\n let pageOptions: number[] = []\n if (pageCount && pageCount > 0) {\n pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i)\n }\n return pageOptions\n },\n {\n key: process.env.NODE_ENV === 'development' && 'getPageOptions',\n debug: () => table.options.debugAll ?? table.options.debugTable,\n }\n )\n\n table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0\n\n table.getCanNextPage = () => {\n const { pageIndex } = table.getState().pagination\n\n const pageCount = table.getPageCount()\n\n if (pageCount === -1) {\n return true\n }\n\n if (pageCount === 0) {\n return false\n }\n\n return pageIndex < pageCount - 1\n }\n\n table.previousPage = () => {\n return table.setPageIndex(old => old - 1)\n }\n\n table.nextPage = () => {\n return table.setPageIndex(old => {\n return old + 1\n })\n }\n\n table.getPrePaginationRowModel = () => table.getExpandedRowModel()\n table.getPaginationRowModel = () => {\n if (\n !table._getPaginationRowModel &&\n table.options.getPaginationRowModel\n ) {\n table._getPaginationRowModel =\n table.options.getPaginationRowModel(table)\n }\n\n if (table.options.manualPagination || !table._getPaginationRowModel) {\n return table.getPrePaginationRowModel()\n }\n\n return table._getPaginationRowModel()\n }\n\n table.getPageCount = () => {\n return (\n table.options.pageCount ??\n Math.ceil(\n table.getPrePaginationRowModel().rows.length /\n table.getState().pagination.pageSize\n )\n )\n }\n },\n}\n"],"names":["defaultPageIndex","defaultPageSize","getDefaultPaginationState","pageIndex","pageSize","Pagination","getInitialState","state","pagination","getDefaultOptions","table","onPaginationChange","makeStateUpdater","createTable","registered","queued","_autoResetPageIndex","_ref","_table$options$autoRe","_queue","options","autoResetAll","autoResetPageIndex","manualPagination","resetPageIndex","setPagination","updater","safeUpdater","old","newState","functionalUpdate","resetPagination","defaultState","_table$initialState$p","initialState","setPageIndex","maxPageIndex","pageCount","Number","MAX_SAFE_INTEGER","Math","max","min","_table$initialState$p2","_table$initialState","resetPageSize","_table$initialState$p3","_table$initialState2","setPageSize","topRowIndex","floor","setPageCount","_table$options$pageCo","newPageCount","getPageOptions","memo","getPageCount","pageOptions","Array","fill","map","_","i","key","process","env","NODE_ENV","debug","_table$options$debugA","debugAll","debugTable","getCanPreviousPage","getState","getCanNextPage","previousPage","nextPage","getPrePaginationRowModel","getExpandedRowModel","getPaginationRowModel","_getPaginationRowModel","_table$options$pageCo2","ceil","rows","length"],"mappings":";;;;;;;;;;;;;;AAuJA;;AAEA,MAAMA,gBAAgB,GAAG,CAAC,CAAA;AAC1B,MAAMC,eAAe,GAAG,EAAE,CAAA;AAE1B,MAAMC,yBAAyB,GAAGA,OAAwB;AACxDC,EAAAA,SAAS,EAAEH,gBAAgB;AAC3BI,EAAAA,QAAQ,EAAEH,eAAAA;AACZ,CAAC,CAAC,CAAA;AAEK,MAAMI,UAAwB,GAAG;EACtCC,eAAe,EAAGC,KAAK,IAA2B;IAChD,OAAO;AACL,MAAA,GAAGA,KAAK;AACRC,MAAAA,UAAU,EAAE;QACV,GAAGN,yBAAyB,EAAE;AAC9B,QAAA,IAAGK,KAAK,IAAA,IAAA,GAAA,KAAA,CAAA,GAALA,KAAK,CAAEC,UAAU;AACtB,OAAA;KACD,CAAA;GACF;EAEDC,iBAAiB,EACfC,KAAmB,IACU;IAC7B,OAAO;AACLC,MAAAA,kBAAkB,EAAEC,sBAAgB,CAAC,YAAY,EAAEF,KAAK,CAAA;KACzD,CAAA;GACF;EAEDG,WAAW,EAA0BH,KAAmB,IAAW;IACjE,IAAII,UAAU,GAAG,KAAK,CAAA;IACtB,IAAIC,MAAM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AE,CAAA;KACtC,CAAA;IAEDrE,KAAK,CAAC8C,YAAY,GAAG,MAAM;AAAA,MAAA,IAAAwB,sBAAA,CAAA;AACzB,MAAA,OAAA,CAAAA,sBAAA,GACEtE,KAAK,CAACU,OAAO,CAACiB,SAAS,KAAA2C,IAAAA,GAAAA,sBAAA,GACvBxC,IAAI,CAACyC,IAAI,CACPvE,KAAK,CAACkE,wBAAwB,EAAE,CAACM,IAAI,CAACC,MAAM,GAC1CzE,KAAK,CAAC8D,QAAQ,EAAE,CAAChE,UAAU,CAACJ,QAChC,CAAC,CAAA;KAEJ,CAAA;AACH,GAAA;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"Pagination.js","sources":["../../../src/features/Pagination.ts"],"sourcesContent":["import { TableFeature } from '../core/table'\nimport { OnChangeFn, Table, RowModel, Updater, RowData } from '../types'\nimport {\n functionalUpdate,\n getMemoOptions,\n makeStateUpdater,\n memo,\n} from '../utils'\n\nexport interface PaginationState {\n pageIndex: number\n pageSize: number\n}\n\nexport interface PaginationTableState {\n pagination: PaginationState\n}\n\nexport interface PaginationInitialTableState {\n pagination?: Partial<PaginationState>\n}\n\nexport interface PaginationOptions {\n /**\n * If set to `true`, pagination will be reset to the first page when page-altering state changes eg. `data` is updated, filters change, grouping changes, etc.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#autoresetpageindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n autoResetPageIndex?: boolean\n /**\n * Returns the row model after pagination has taken place, but no further.\n *\n * Pagination columns are automatically reordered by default to the start of the columns list. If you would rather remove them or leave them as-is, set the appropriate mode here.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPaginationRowModel?: (table: Table<any>) => () => RowModel<any>\n /**\n * Enables manual pagination. If this option is set to `true`, the table will not automatically paginate rows using `getPaginationRowModel()` and instead will expect you to manually paginate the rows before passing them to the table. This is useful if you are doing server-side pagination and aggregation.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#manualpagination)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n manualPagination?: boolean\n /**\n * If this function is provided, it will be called when the pagination state changes and you will be expected to manage the state yourself. You can pass the managed state back to the table via the `tableOptions.state.pagination` option.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#onpaginationchange)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n onPaginationChange?: OnChangeFn<PaginationState>\n /**\n * When manually controlling pagination, you can supply a total `pageCount` value to the table if you know it (Or supply a `rowCount` and `pageCount` will be calculated). If you do not know how many pages there are, you can set this to `-1`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#pagecount)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n pageCount?: number\n /**\n * When manually controlling pagination, you can supply a total `rowCount` value to the table if you know it. The `pageCount` can be calculated from this value and the `pageSize`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#rowcount)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n rowCount?: number\n}\n\nexport interface PaginationDefaultOptions {\n onPaginationChange: OnChangeFn<PaginationState>\n}\n\nexport interface PaginationInstance<TData extends RowData> {\n _autoResetPageIndex: () => void\n _getPaginationRowModel?: () => RowModel<TData>\n /**\n * Returns whether the table can go to the next page.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcannextpage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getCanNextPage: () => boolean\n /**\n * Returns whether the table can go to the previous page.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcanpreviouspage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getCanPreviousPage: () => boolean\n /**\n * Returns the page count. If manually paginating or controlling the pagination state, this will come directly from the `options.pageCount` table option, otherwise it will be calculated from the table data using the total row count and current page size.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpagecount)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPageCount: () => number\n /**\n * Returns the row count. If manually paginating or controlling the pagination state, this will come directly from the `options.rowCount` table option, otherwise it will be calculated from the table data.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getrowcount)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getRowCount: () => number\n /**\n * Returns an array of page options (zero-index-based) for the current page size.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpageoptions)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPageOptions: () => number[]\n /**\n * Returns the row model for the table after pagination has been applied.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPaginationRowModel: () => RowModel<TData>\n /**\n * Returns the row model for the table before any pagination has been applied.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getprepaginationrowmodel)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n getPrePaginationRowModel: () => RowModel<TData>\n /**\n * Increments the page index by one, if possible.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#nextpage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n nextPage: () => void\n /**\n * Decrements the page index by one, if possible.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#previouspage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n previousPage: () => void\n /**\n * Sets the page index to `0`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#firstpage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n firstPage: () => void\n /**\n * Sets the page index to the last page.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#lastpage)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n lastPage: () => void\n /**\n * Resets the page index to its initial state. If `defaultState` is `true`, the page index will be reset to `0` regardless of initial state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpageindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n resetPageIndex: (defaultState?: boolean) => void\n /**\n * Resets the page size to its initial state. If `defaultState` is `true`, the page size will be reset to `10` regardless of initial state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagesize)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n resetPageSize: (defaultState?: boolean) => void\n /**\n * Resets the **pagination** state to `initialState.pagination`, or `true` can be passed to force a default blank state reset to `[]`.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagination)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n resetPagination: (defaultState?: boolean) => void\n /**\n * @deprecated The page count no longer exists in the pagination state. Just pass as a table option instead.\n */\n setPageCount: (updater: Updater<number>) => void\n /**\n * Updates the page index using the provided function or value in the `state.pagination.pageIndex` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpageindex)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n setPageIndex: (updater: Updater<number>) => void\n /**\n * Updates the page size using the provided function or value in the `state.pagination.pageSize` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagesize)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n setPageSize: (updater: Updater<number>) => void\n /**\n * Sets or updates the `state.pagination` state.\n * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagination)\n * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination)\n */\n setPagination: (updater: Updater<PaginationState>) => void\n}\n\n//\n\nconst defaultPageIndex = 0\nconst defaultPageSize = 10\n\nconst getDefaultPaginationState = (): PaginationState => ({\n pageIndex: defaultPageIndex,\n pageSize: defaultPageSize,\n})\n\nexport const Pagination: TableFeature = {\n getInitialState: (state): PaginationTableState => {\n return {\n ...state,\n pagination: {\n ...getDefaultPaginationState(),\n ...state?.pagination,\n },\n }\n },\n\n getDefaultOptions: <TData extends RowData>(\n table: Table<TData>\n ): PaginationDefaultOptions => {\n return {\n onPaginationChange: makeStateUpdater('pagination', table),\n }\n },\n\n createTable: <TData extends RowData>(table: Table<TData>): void => {\n let registered = false\n let queued = false\n\n table._autoResetPageIndex = () => {\n if (!registered) {\n table._queue(() => {\n registered = true\n })\n return\n }\n\n if (\n table.options.autoResetAll ??\n table.options.autoResetPageIndex ??\n !table.options.manualPagination\n ) {\n if (queued) return\n queued = true\n table._queue(() => {\n table.resetPageIndex()\n queued = false\n })\n }\n }\n table.setPagination = updater => {\n const safeUpdater: Updater<PaginationState> = old => {\n let newState = functionalUpdate(updater, old)\n\n return newState\n }\n\n return table.options.onPaginationChange?.(safeUpdater)\n }\n table.resetPagination = defaultState => {\n table.setPagination(\n defaultState\n ? getDefaultPaginationState()\n : table.initialState.pagination ?? getDefaultPaginationState()\n )\n }\n table.setPageIndex = updater => {\n table.setPagination(old => {\n let pageIndex = functionalUpdate(updater, old.pageIndex)\n\n const maxPageIndex =\n typeof table.options.pageCount === 'undefined' ||\n table.options.pageCount === -1\n ? Number.MAX_SAFE_INTEGER\n : table.options.pageCount - 1\n\n pageIndex = Math.max(0, Math.min(pageIndex, maxPageIndex))\n\n return {\n ...old,\n pageIndex,\n }\n })\n }\n table.resetPageIndex = defaultState => {\n table.setPageIndex(\n defaultState\n ? defaultPageIndex\n : table.initialState?.pagination?.pageIndex ?? defaultPageIndex\n )\n }\n table.resetPageSize = defaultState => {\n table.setPageSize(\n defaultState\n ? defaultPageSize\n : table.initialState?.pagination?.pageSize ?? defaultPageSize\n )\n }\n table.setPageSize = updater => {\n table.setPagination(old => {\n const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize))\n const topRowIndex = old.pageSize * old.pageIndex!\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...old,\n pageIndex,\n pageSize,\n }\n })\n }\n //deprecated\n table.setPageCount = updater =>\n table.setPagination(old => {\n let newPageCount = functionalUpdate(\n updater,\n table.options.pageCount ?? -1\n )\n\n if (typeof newPageCount === 'number') {\n newPageCount = Math.max(-1, newPageCount)\n }\n\n return {\n ...old,\n pageCount: newPageCount,\n }\n })\n\n table.getPageOptions = memo(\n () => [table.getPageCount()],\n pageCount => {\n let pageOptions: number[] = []\n if (pageCount && pageCount > 0) {\n pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i)\n }\n return pageOptions\n },\n getMemoOptions(table.options, 'debugTable', 'getPageOptions')\n )\n\n table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0\n\n table.getCanNextPage = () => {\n const { pageIndex } = table.getState().pagination\n\n const pageCount = table.getPageCount()\n\n if (pageCount === -1) {\n return true\n }\n\n if (pageCount === 0) {\n return false\n }\n\n return pageIndex < pageCount - 1\n }\n\n table.previousPage = () => {\n return table.setPageIndex(old => old - 1)\n }\n\n table.nextPage = () => {\n return table.setPageIndex(old => {\n return old + 1\n })\n }\n\n table.firstPage = () => {\n return table.setPageIndex(0)\n }\n\n table.lastPage = () => {\n return table.setPageIndex(table.getPageCount() - 1)\n }\n\n table.getPrePaginationRowModel = () => table.getExpandedRowModel()\n table.getPaginationRowModel = () => {\n if (\n !table._getPaginationRowModel &&\n table.options.getPaginationRowModel\n ) {\n table._getPaginationRowModel =\n table.options.getPaginationRowModel(table)\n }\n\n if (table.options.manualPagination || !table._getPaginationRowModel) {\n return table.getPrePaginationRowModel()\n }\n\n return table._getPaginationRowModel()\n }\n\n table.getPageCount = () => {\n return (\n table.options.pageCount ??\n Math.ceil(table.getRowCount() / table.getState().pagination.pageSize)\n )\n }\n\n table.getRowCount = () => {\n return (\n table.options.rowCount ?? table.getPrePaginationRowModel().rows.length\n )\n }\n },\n}\n"],"names":["defaultPageIndex","defaultPageSize","getDefaultPaginationState","pageIndex","pageSize","Pagination","getInitialState","state","pagination","getDefaultOptions","table","onPaginationChange","makeStateUpdater","createTable","registered","queued","_autoResetPageIndex","_ref","_table$options$autoRe","_queue","options","autoResetAll","autoResetPageIndex","manualPagination","resetPageIndex","setPagination","updater","safeUpdater","old","newState","functionalUpdate","resetPagination","defaultState","_table$initialState$p","initialState","setPageIndex","maxPageIndex","pageCount","Number","MAX_SAFE_INTEGER","Math","max","min","_table$initialState$p2","_table$initialState","resetPageSize","_table$initialState$p3","_table$initialState2","setPageSize","topRowIndex","floor","setPageCount","_table$options$pageCo","newPageCount","getPageOptions","memo","getPageCount","pageOptions","Array","fill","map","_","i","getMemoOptions","getCanPreviousPage","getState","getCanNextPage","previousPage","nextPage","firstPage","lastPage","getPrePaginationRowModel","getExpandedRowModel","getPaginationRowModel","_getPaginationRowModel","_table$options$pageCo2","ceil","getRowCount","_table$options$rowCou","rowCount","rows","length"],"mappings":";;;;;;;;;;;;;;AAkLA;;AAEA,MAAMA,gBAAgB,GAAG,CAAC,CAAA;AAC1B,MAAMC,eAAe,GAAG,EAAE,CAAA;AAE1B,MAAMC,yBAAyB,GAAGA,OAAwB;AACxDC,EAAAA,SAAS,EAAEH,gBAAgB;AAC3BI,EAAAA,QAAQ,EAAEH,eAAAA;AACZ,CAAC,CAAC,CAAA;AAEK,MAAMI,UAAwB,GAAG;EACtCC,eAAe,EAAGC,KAAK,IAA2B;IAChD,OAAO;AACL,MAAA,GAAGA,KAAK;AACRC,MAAAA,UAAU,EAAE;QACV,GAAGN,yBAAyB,EAAE;AAC9B,QAAA,IAAGK,KAAK,IAAA,IAAA,GAAA,KAAA,CAAA,GAALA,KAAK,CAAEC,UAAU;AACtB,OAAA;KACD,CAAA;GACF;EAEDC,iBAAiB,EACfC,KAAmB,IACU;IAC7B,OAAO;AACLC,MAAAA,kBAAkB,EAAEC,sBAAgB,CAAC,YAAY,EAAEF,KAAK,CAAA;KACzD,CAAA;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nE,QAAA,OAAOhE,KAAK,CAAC6D,wBAAwB,EAAE,CAAA;AACzC,OAAA;AAEA,MAAA,OAAO7D,KAAK,CAACgE,sBAAsB,EAAE,CAAA;KACtC,CAAA;IAEDhE,KAAK,CAAC8C,YAAY,GAAG,MAAM;AAAA,MAAA,IAAAmB,sBAAA,CAAA;AACzB,MAAA,OAAA,CAAAA,sBAAA,GACEjE,KAAK,CAACU,OAAO,CAACiB,SAAS,KAAA,IAAA,GAAAsC,sBAAA,GACvBnC,IAAI,CAACoC,IAAI,CAAClE,KAAK,CAACmE,WAAW,EAAE,GAAGnE,KAAK,CAACuD,QAAQ,EAAE,CAACzD,UAAU,CAACJ,QAAQ,CAAC,CAAA;KAExE,CAAA;IAEDM,KAAK,CAACmE,WAAW,GAAG,MAAM;AAAA,MAAA,IAAAC,qBAAA,CAAA;AACxB,MAAA,OAAA,CAAAA,qBAAA,GACEpE,KAAK,CAACU,OAAO,CAAC2D,QAAQ,KAAAD,IAAAA,GAAAA,qBAAA,GAAIpE,KAAK,CAAC6D,wBAAwB,EAAE,CAACS,IAAI,CAACC,MAAM,CAAA;KAEzE,CAAA;AACH,GAAA;AACF;;;;"}
|
|
@@ -157,39 +157,21 @@ const Pinning = {
|
|
|
157
157
|
row.getCenterVisibleCells = utils.memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
|
|
158
158
|
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
159
159
|
return allCells.filter(d => !leftAndRight.includes(d.column.id));
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
debug: () => {
|
|
163
|
-
var _table$options$debugA;
|
|
164
|
-
return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
row.getLeftVisibleCells = utils.memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
|
|
160
|
+
}, utils.getMemoOptions(table.options, 'debugRows', 'getCenterVisibleCells'));
|
|
161
|
+
row.getLeftVisibleCells = utils.memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {
|
|
168
162
|
const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
169
163
|
...d,
|
|
170
164
|
position: 'left'
|
|
171
165
|
}));
|
|
172
166
|
return cells;
|
|
173
|
-
},
|
|
174
|
-
key: process.env.NODE_ENV === 'development' && 'row.getLeftVisibleCells',
|
|
175
|
-
debug: () => {
|
|
176
|
-
var _table$options$debugA2;
|
|
177
|
-
return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
167
|
+
}, utils.getMemoOptions(table.options, 'debugRows', 'getLeftVisibleCells'));
|
|
180
168
|
row.getRightVisibleCells = utils.memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
|
|
181
169
|
const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
|
|
182
170
|
...d,
|
|
183
171
|
position: 'right'
|
|
184
172
|
}));
|
|
185
173
|
return cells;
|
|
186
|
-
},
|
|
187
|
-
key: process.env.NODE_ENV === 'development' && 'row.getRightVisibleCells',
|
|
188
|
-
debug: () => {
|
|
189
|
-
var _table$options$debugA3;
|
|
190
|
-
return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
|
|
191
|
-
}
|
|
192
|
-
});
|
|
174
|
+
}, utils.getMemoOptions(table.options, 'debugRows', 'getRightVisibleCells'));
|
|
193
175
|
},
|
|
194
176
|
createTable: table => {
|
|
195
177
|
table.setColumnPinning = updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater);
|
|
@@ -208,32 +190,14 @@ const Pinning = {
|
|
|
208
190
|
};
|
|
209
191
|
table.getLeftLeafColumns = utils.memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
|
|
210
192
|
return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
211
|
-
},
|
|
212
|
-
key: process.env.NODE_ENV === 'development' && 'getLeftLeafColumns',
|
|
213
|
-
debug: () => {
|
|
214
|
-
var _table$options$debugA4;
|
|
215
|
-
return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
|
|
216
|
-
}
|
|
217
|
-
});
|
|
193
|
+
}, utils.getMemoOptions(table.options, 'debugColumns', 'getLeftLeafColumns'));
|
|
218
194
|
table.getRightLeafColumns = utils.memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
|
|
219
195
|
return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
|
|
220
|
-
},
|
|
221
|
-
key: process.env.NODE_ENV === 'development' && 'getRightLeafColumns',
|
|
222
|
-
debug: () => {
|
|
223
|
-
var _table$options$debugA5;
|
|
224
|
-
return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
|
|
225
|
-
}
|
|
226
|
-
});
|
|
196
|
+
}, utils.getMemoOptions(table.options, 'debugColumns', 'getRightLeafColumns'));
|
|
227
197
|
table.getCenterLeafColumns = utils.memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
|
|
228
198
|
const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
|
|
229
199
|
return allColumns.filter(d => !leftAndRight.includes(d.id));
|
|
230
|
-
},
|
|
231
|
-
key: process.env.NODE_ENV === 'development' && 'getCenterLeafColumns',
|
|
232
|
-
debug: () => {
|
|
233
|
-
var _table$options$debugA6;
|
|
234
|
-
return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
|
|
235
|
-
}
|
|
236
|
-
});
|
|
200
|
+
}, utils.getMemoOptions(table.options, 'debugColumns', 'getCenterLeafColumns'));
|
|
237
201
|
table.setRowPinning = updater => table.options.onRowPinningChange == null ? void 0 : table.options.onRowPinningChange(updater);
|
|
238
202
|
table.resetRowPinning = defaultState => {
|
|
239
203
|
var _table$initialState$r, _table$initialState2;
|
|
@@ -248,7 +212,7 @@ const Pinning = {
|
|
|
248
212
|
}
|
|
249
213
|
return Boolean((_pinningState$positio2 = pinningState[position]) == null ? void 0 : _pinningState$positio2.length);
|
|
250
214
|
};
|
|
251
|
-
table._getPinnedRows =
|
|
215
|
+
table._getPinnedRows = utils.memo(position => [table.getRowModel().rows, table.getState().rowPinning[position], position], (visibleRows, pinnedRowIds, position) => {
|
|
252
216
|
var _table$options$keepPi;
|
|
253
217
|
const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
|
|
254
218
|
//get all rows that are pinned even if they would not be otherwise visible
|
|
@@ -263,25 +227,13 @@ const Pinning = {
|
|
|
263
227
|
...d,
|
|
264
228
|
position
|
|
265
229
|
}));
|
|
266
|
-
},
|
|
267
|
-
key: process.env.NODE_ENV === 'development' && `row.get${position === 'top' ? 'Top' : 'Bottom'}Rows`,
|
|
268
|
-
debug: () => {
|
|
269
|
-
var _table$options$debugA7;
|
|
270
|
-
return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugRows;
|
|
271
|
-
}
|
|
272
|
-
})();
|
|
230
|
+
}, utils.getMemoOptions(table.options, 'debugRows', '_getPinnedRows'));
|
|
273
231
|
table.getTopRows = () => table._getPinnedRows('top');
|
|
274
232
|
table.getBottomRows = () => table._getPinnedRows('bottom');
|
|
275
233
|
table.getCenterRows = utils.memo(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
|
|
276
234
|
const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
|
|
277
235
|
return allRows.filter(d => !topAndBottom.has(d.id));
|
|
278
|
-
},
|
|
279
|
-
key: process.env.NODE_ENV === 'development' && 'row.getCenterRows',
|
|
280
|
-
debug: () => {
|
|
281
|
-
var _table$options$debugA8;
|
|
282
|
-
return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugRows;
|
|
283
|
-
}
|
|
284
|
-
});
|
|
236
|
+
}, utils.getMemoOptions(table.options, 'debugRows', 'getCenterRows'));
|
|
285
237
|
}
|
|
286
238
|
};
|
|
287
239
|
|