Skip to content

Commit 963b69c

Browse files
committed
combine faceting features, improve debugging options
1 parent 10334bf commit 963b69c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+281
-267
lines changed

examples/react/filters/src/main.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ function App() {
116116
},
117117
onColumnFiltersChange: setColumnFilters,
118118
debugTable: true,
119-
debugHeaders: true,
120-
debugColumns: false,
119+
debugColumns: true,
121120
})
122121

123122
return (

packages/table-core/src/core/cells/coreCellsFeature.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export const coreCellsFeature: TableFeature<{
1010
// Cell: Cell_Cell<TableFeatures, RowData, CellData>
1111
// TableOptions: TableOptions_Cell
1212
}> = {
13+
feature: 'coreCellsFeature',
14+
1315
constructCellAPIs: (cell) => {
14-
assignAPIs(cell, [
16+
assignAPIs('coreCellsFeature', cell, [
1517
{
1618
fn: () => cell_getValue(cell),
1719
fnName: 'cell_getValue',

packages/table-core/src/core/cells/coreCellsFeature.types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ export interface Cell_Cell<
7373
}
7474

7575
export interface TableOptions_Cell {
76-
/**
77-
* Set this option to `true` to output cell debugging information to the console.
78-
* [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugcells]
79-
* [Guide](https://tanstack.com/table/v8/docs/guide/tables)
80-
*/
81-
debugCells?: boolean
8276
/**
8377
* Value used when the desired value is not found in the data.
8478
* [API Docs](https://tanstack.com/table/v8/docs/api/core/table#renderfallbackvalue)

packages/table-core/src/core/columns/coreColumnsFeature.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ export const coreColumnsFeature: TableFeature<{
1616
// Table: Table_Columns<TableFeatures, RowData>
1717
// TableOptions: TableOptions_Columns<TableFeatures, RowData>
1818
}> = {
19+
feature: 'coreColumnsFeature',
20+
1921
constructColumnAPIs: (column) => {
2022
const { _table: table } = column
21-
assignAPIs(column, [
23+
assignAPIs('coreColumnsFeature', column, [
2224
{
2325
fn: () => column_getFlatColumns(column),
2426
fnName: 'column_getFlatColumns',
@@ -38,7 +40,7 @@ export const coreColumnsFeature: TableFeature<{
3840
},
3941

4042
constructTableAPIs: (table) => {
41-
assignAPIs(table, [
43+
assignAPIs('coreColumnsFeature', table, [
4244
{
4345
fn: () => table_getDefaultColumnDef(table),
4446
fnName: 'table_getDefaultColumnDef',

packages/table-core/src/core/columns/coreColumnsFeature.types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,6 @@ export interface TableOptions_Columns<
8484
* [Guide](https://tanstack.com/table/v8/docs/guide/tables)
8585
*/
8686
columns: Array<ColumnDef<TFeatures, TData, TValue>>
87-
/**
88-
* Set this option to `true` to output column debugging information to the console.
89-
* [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugcolumns)
90-
* [Guide](https://tanstack.com/table/v8/docs/guide/tables)
91-
*/
92-
debugColumns?: boolean
9387
/**
9488
* Default column options to use for all column defs supplied to the table.
9589
* [API Docs](https://tanstack.com/table/v8/docs/api/core/table#defaultcolumn)

packages/table-core/src/core/headers/coreHeadersFeature.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ import type { TableFeature } from '../../types/TableFeatures'
1818
export const coreHeadersFeature: TableFeature<{
1919
// Header: Header_Header<TableFeatures, RowData, CellData>
2020
// Table: Table_Headers<TableFeatures, RowData>
21-
// TableOptions: TableOptions_Headers
2221
}> = {
22+
feature: 'coreHeadersFeature',
23+
2324
constructHeaderAPIs: (header) => {
24-
assignAPIs(header, [
25+
assignAPIs('coreHeadersFeature', header, [
2526
{
2627
fn: () => header_getLeafHeaders(header),
2728
fnName: 'header_getLeafHeaders',
@@ -36,7 +37,7 @@ export const coreHeadersFeature: TableFeature<{
3637
},
3738

3839
constructTableAPIs: (table) => {
39-
assignAPIs(table, [
40+
assignAPIs('coreHeadersFeature', table, [
4041
{
4142
fn: () => table_getHeaderGroups(table),
4243
fnName: 'table_getHeaderGroups',

packages/table-core/src/core/headers/coreHeadersFeature.types.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,6 @@ import type { Header } from '../../types/Header'
55
import type { HeaderGroup } from '../../types/HeaderGroup'
66
import type { Column } from '../../types/Column'
77

8-
export interface TableOptions_Headers {
9-
/**
10-
* Set this option to `true` to output header debugging information to the console.
11-
* [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugheaders)
12-
* [Guide](https://tanstack.com/table/v8/docs/guide/tables)
13-
*/
14-
debugHeaders?: boolean
15-
}
16-
178
export interface Table_Headers<
189
TFeatures extends TableFeatures,
1910
TData extends RowData,

packages/table-core/src/core/row-models/coreRowModelsFeature.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ import type { TableFeature, TableFeatures } from '../../types/TableFeatures'
2020
export const coreRowModelsFeature: TableFeature<{
2121
Table: Table_RowModels<TableFeatures, RowData>
2222
}> = {
23+
feature: 'coreRowModelsFeature',
24+
2325
constructTableAPIs: (table) => {
24-
assignAPIs(table, [
26+
assignAPIs('coreRowModelsFeature', table, [
2527
{
2628
fn: () => table_getCoreRowModel(table),
2729
fnName: 'table_getCoreRowModel',

packages/table-core/src/core/row-models/createCoreRowModel.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { constructRow } from '../rows/constructRow'
2-
import { isDev, tableMemo } from '../../utils'
2+
import { tableMemo } from '../../utils'
33
import { table_autoResetPageIndex } from '../../features/row-pagination/rowPaginationFeature.utils'
44
import type { Table_Internal } from '../../types/Table'
55
import type { RowModel } from './coreRowModelsFeature.types'
@@ -15,11 +15,12 @@ export function createCoreRowModel<
1515
) => () => RowModel<TFeatures, TData> {
1616
return (table: Table_Internal<TFeatures, TData>) =>
1717
tableMemo({
18-
debug: isDev && (table.options.debugAll ?? table.options.debugTable),
18+
feature: 'coreRowModelsFeature',
19+
fn: (data) => _createCoreRowModel(table, data),
1920
fnName: 'table.getCoreRowModel',
2021
memoDeps: () => [table.options.data],
21-
fn: (data) => _createCoreRowModel(table, data),
2222
onAfterUpdate: () => table_autoResetPageIndex(table),
23+
table,
2324
})
2425
}
2526

packages/table-core/src/core/rows/coreRowsFeature.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ export const coreRowsFeature: TableFeature<{
1919
// TableOptions: TableOptions_Rows<TableFeatures, RowData>
2020
// Table: Table_Rows<TableFeatures, RowData>
2121
}> = {
22+
feature: 'coreRowsFeature',
2223
constructRowAPIs: (row) => {
23-
assignAPIs(row, [
24+
assignAPIs('coreRowsFeature', row, [
2425
{
2526
fn: () => row_getAllCellsByColumnId(row),
2627
fnName: 'row_getAllCellsByColumnId',
@@ -59,7 +60,7 @@ export const coreRowsFeature: TableFeature<{
5960
},
6061

6162
constructTableAPIs: (table) => {
62-
assignAPIs(table, [
63+
assignAPIs('coreRowsFeature', table, [
6364
{
6465
fn: (row, index, parent) => table_getRowId(row, table, index, parent),
6566
fnName: 'table_getRowId',

0 commit comments

Comments
 (0)