@tanstack/table-core 9.0.0-beta.1 → 9.0.0-beta.2

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.
Files changed (39) hide show
  1. package/dist/core/table/constructTable.cjs.map +1 -1
  2. package/dist/core/table/constructTable.js.map +1 -1
  3. package/dist/index.d.cts +12 -12
  4. package/dist/index.d.ts +12 -12
  5. package/dist/types/Cell.d.cts +7 -4
  6. package/dist/types/Cell.d.ts +7 -4
  7. package/dist/types/Column.d.cts +16 -4
  8. package/dist/types/Column.d.ts +16 -4
  9. package/dist/types/ColumnDef.d.cts +13 -3
  10. package/dist/types/ColumnDef.d.ts +13 -3
  11. package/dist/types/Header.d.cts +8 -4
  12. package/dist/types/Header.d.ts +8 -4
  13. package/dist/types/Row.d.cts +13 -4
  14. package/dist/types/Row.d.ts +13 -4
  15. package/dist/types/RowModel.d.cts +21 -5
  16. package/dist/types/RowModel.d.ts +21 -5
  17. package/dist/types/RowModelFns.d.cts +9 -4
  18. package/dist/types/RowModelFns.d.ts +9 -4
  19. package/dist/types/Table.d.cts +20 -4
  20. package/dist/types/Table.d.ts +20 -4
  21. package/dist/types/TableFeatures.d.cts +3 -1
  22. package/dist/types/TableFeatures.d.ts +3 -1
  23. package/dist/types/TableOptions.d.cts +20 -4
  24. package/dist/types/TableOptions.d.ts +20 -4
  25. package/dist/types/TableState.d.cts +18 -4
  26. package/dist/types/TableState.d.ts +18 -4
  27. package/package.json +1 -1
  28. package/src/core/table/constructTable.ts +1 -1
  29. package/src/types/Cell.ts +11 -15
  30. package/src/types/Column.ts +23 -42
  31. package/src/types/ColumnDef.ts +23 -34
  32. package/src/types/Header.ts +12 -18
  33. package/src/types/Row.ts +20 -26
  34. package/src/types/RowModel.ts +36 -53
  35. package/src/types/RowModelFns.ts +16 -20
  36. package/src/types/Table.ts +27 -53
  37. package/src/types/TableFeatures.ts +12 -0
  38. package/src/types/TableOptions.ts +36 -64
  39. package/src/types/TableState.ts +25 -52
@@ -1,4 +1,4 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.cjs";
1
+ import { RowData } from "./type-utils.cjs";
2
2
  import { Row_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
3
3
  import { Row_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.cjs";
4
4
  import { Row_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.cjs";
@@ -6,7 +6,7 @@ import { Row_RowExpanding } from "../features/row-expanding/rowExpandingFeature.
6
6
  import { Row_RowPinning } from "../features/row-pinning/rowPinningFeature.types.cjs";
7
7
  import { Row_RowSelection } from "../features/row-selection/rowSelectionFeature.types.cjs";
8
8
  import { Row_Row } from "../core/rows/coreRowsFeature.types.cjs";
9
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
9
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
10
10
  import { Row_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
11
11
 
12
12
  //#region src/types/Row.d.ts
@@ -16,7 +16,16 @@ import { Row_ColumnGrouping } from "../features/column-grouping/columnGroupingFe
16
16
  */
17
17
  interface Row_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
18
18
  interface Row_Core<TFeatures extends TableFeatures, TData extends RowData> extends Row_Row<TFeatures, TData> {}
19
- type Row<TFeatures extends TableFeatures, TData extends RowData> = Row_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? Row_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? Row_ColumnGrouping : never) | ('columnPinningFeature' extends keyof TFeatures ? Row_ColumnPinning<TFeatures, TData> : never) | ('columnVisibilityFeature' extends keyof TFeatures ? Row_ColumnVisibility<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? Row_RowExpanding : never) | ('rowPinningFeature' extends keyof TFeatures ? Row_RowPinning : never) | ('rowSelectionFeature' extends keyof TFeatures ? Row_RowSelection : never)> & ExtractFeatureTypes<'Row', TFeatures> & Row_Plugins<TFeatures, TData>;
19
+ interface Row_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
20
+ columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>;
21
+ columnGroupingFeature: Row_ColumnGrouping;
22
+ columnPinningFeature: Row_ColumnPinning<TFeatures, TData>;
23
+ columnVisibilityFeature: Row_ColumnVisibility<TFeatures, TData>;
24
+ rowExpandingFeature: Row_RowExpanding;
25
+ rowPinningFeature: Row_RowPinning;
26
+ rowSelectionFeature: Row_RowSelection;
27
+ }
28
+ type Row<TFeatures extends TableFeatures, TData extends RowData> = Row_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'Row', TFeatures> & Row_Plugins<TFeatures, TData>;
20
29
  //#endregion
21
- export { Row, Row_Core, Row_Plugins };
30
+ export { Row, Row_Core, Row_FeatureMap, Row_Plugins };
22
31
  //# sourceMappingURL=Row.d.cts.map
@@ -1,4 +1,4 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.js";
1
+ import { RowData } from "./type-utils.js";
2
2
  import { Row_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
3
3
  import { Row_ColumnPinning } from "../features/column-pinning/columnPinningFeature.types.js";
4
4
  import { Row_ColumnVisibility } from "../features/column-visibility/columnVisibilityFeature.types.js";
@@ -6,7 +6,7 @@ import { Row_RowExpanding } from "../features/row-expanding/rowExpandingFeature.
6
6
  import { Row_RowPinning } from "../features/row-pinning/rowPinningFeature.types.js";
7
7
  import { Row_RowSelection } from "../features/row-selection/rowSelectionFeature.types.js";
8
8
  import { Row_Row } from "../core/rows/coreRowsFeature.types.js";
9
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
9
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
10
10
  import { Row_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
11
11
 
12
12
  //#region src/types/Row.d.ts
@@ -16,7 +16,16 @@ import { Row_ColumnGrouping } from "../features/column-grouping/columnGroupingFe
16
16
  */
17
17
  interface Row_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
18
18
  interface Row_Core<TFeatures extends TableFeatures, TData extends RowData> extends Row_Row<TFeatures, TData> {}
19
- type Row<TFeatures extends TableFeatures, TData extends RowData> = Row_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? Row_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? Row_ColumnGrouping : never) | ('columnPinningFeature' extends keyof TFeatures ? Row_ColumnPinning<TFeatures, TData> : never) | ('columnVisibilityFeature' extends keyof TFeatures ? Row_ColumnVisibility<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? Row_RowExpanding : never) | ('rowPinningFeature' extends keyof TFeatures ? Row_RowPinning : never) | ('rowSelectionFeature' extends keyof TFeatures ? Row_RowSelection : never)> & ExtractFeatureTypes<'Row', TFeatures> & Row_Plugins<TFeatures, TData>;
19
+ interface Row_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
20
+ columnFilteringFeature: Row_ColumnFiltering<TFeatures, TData>;
21
+ columnGroupingFeature: Row_ColumnGrouping;
22
+ columnPinningFeature: Row_ColumnPinning<TFeatures, TData>;
23
+ columnVisibilityFeature: Row_ColumnVisibility<TFeatures, TData>;
24
+ rowExpandingFeature: Row_RowExpanding;
25
+ rowPinningFeature: Row_RowPinning;
26
+ rowSelectionFeature: Row_RowSelection;
27
+ }
28
+ type Row<TFeatures extends TableFeatures, TData extends RowData> = Row_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'Row', TFeatures> & Row_Plugins<TFeatures, TData>;
20
29
  //#endregion
21
- export { Row, Row_Core, Row_Plugins };
30
+ export { Row, Row_Core, Row_FeatureMap, Row_Plugins };
22
31
  //# sourceMappingURL=Row.d.ts.map
@@ -1,9 +1,9 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.cjs";
1
+ import { RowData } from "./type-utils.cjs";
2
2
  import { CachedRowModel_Sorted, CreateRowModel_Sorted } from "../features/row-sorting/rowSortingFeature.types.cjs";
3
3
  import { CachedRowModel_Filtered, CreateRowModel_Filtered } from "../features/column-filtering/columnFilteringFeature.types.cjs";
4
4
  import { CachedRowModel_Expanded, CreateRowModel_Expanded } from "../features/row-expanding/rowExpandingFeature.types.cjs";
5
5
  import { CachedRowModel_Paginated, CreateRowModel_Paginated } from "../features/row-pagination/rowPaginationFeature.types.cjs";
6
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
6
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
7
7
  import { CachedRowModel_Faceted, CreateRowModel_Faceted } from "../features/column-faceting/columnFacetingFeature.types.cjs";
8
8
  import { CachedRowModel_Core, CreateRowModel_Core, RowModel } from "../core/row-models/coreRowModelsFeature.types.cjs";
9
9
  import { CachedRowModel_Grouped, CreateRowModel_Grouped } from "../features/column-grouping/columnGroupingFeature.types.cjs";
@@ -14,13 +14,29 @@ import { CachedRowModel_Grouped, CreateRowModel_Grouped } from "../features/colu
14
14
  * Note: This will affect the types of all tables in your project.
15
15
  */
16
16
  interface CreateRowModels_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
17
- type CreateRowModels<TFeatures extends TableFeatures, TData extends RowData> = CreateRowModel_Core<TFeatures, TData> & UnionToIntersection<('columnFacetingFeature' extends keyof TFeatures ? CreateRowModel_Faceted<TFeatures, TData> : never) | ('columnFilteringFeature' extends keyof TFeatures ? CreateRowModel_Filtered<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? CreateRowModel_Expanded<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? CreateRowModel_Grouped<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? CreateRowModel_Paginated<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? CreateRowModel_Sorted<TFeatures, TData> : never)> & ExtractFeatureTypes<'CreateRowModels', TFeatures> & CreateRowModels_Plugins<TFeatures, TData>;
17
+ interface CreateRowModels_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
18
+ columnFacetingFeature: CreateRowModel_Faceted<TFeatures, TData>;
19
+ columnFilteringFeature: CreateRowModel_Filtered<TFeatures, TData>;
20
+ rowExpandingFeature: CreateRowModel_Expanded<TFeatures, TData>;
21
+ columnGroupingFeature: CreateRowModel_Grouped<TFeatures, TData>;
22
+ rowPaginationFeature: CreateRowModel_Paginated<TFeatures, TData>;
23
+ rowSortingFeature: CreateRowModel_Sorted<TFeatures, TData>;
24
+ }
25
+ type CreateRowModels<TFeatures extends TableFeatures, TData extends RowData> = CreateRowModel_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, CreateRowModels_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'CreateRowModels', TFeatures> & CreateRowModels_Plugins<TFeatures, TData>;
18
26
  type CreateRowModels_All<TFeatures extends TableFeatures, TData extends RowData> = CreateRowModel_Core<TFeatures, TData> & CreateRowModel_Expanded<TFeatures, TData> & CreateRowModel_Faceted<TFeatures, TData> & CreateRowModel_Filtered<TFeatures, TData> & CreateRowModel_Grouped<TFeatures, TData> & CreateRowModel_Paginated<TFeatures, TData> & CreateRowModel_Sorted<TFeatures, TData>;
19
27
  interface CachedRowModels_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
28
+ interface CachedRowModels_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
29
+ columnFacetingFeature: CachedRowModel_Faceted<TFeatures, TData>;
30
+ columnFilteringFeature: CachedRowModel_Filtered<TFeatures, TData>;
31
+ rowExpandingFeature: CachedRowModel_Expanded<TFeatures, TData>;
32
+ columnGroupingFeature: CachedRowModel_Grouped<TFeatures, TData>;
33
+ rowPaginationFeature: CachedRowModel_Paginated<TFeatures, TData>;
34
+ rowSortingFeature: CachedRowModel_Sorted<TFeatures, TData>;
35
+ }
20
36
  type CachedRowModels<TFeatures extends TableFeatures, TData extends RowData> = {
21
37
  CachedRowModel_Core: () => RowModel<TFeatures, TData>;
22
- } & UnionToIntersection<('columnFacetingFeature' extends keyof TFeatures ? CachedRowModel_Faceted<TFeatures, TData> : never) | ('columnFilteringFeature' extends keyof TFeatures ? CachedRowModel_Filtered<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? CachedRowModel_Expanded<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? CachedRowModel_Grouped<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? CachedRowModel_Paginated<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? CachedRowModel_Sorted<TFeatures, TData> : never)> & ExtractFeatureTypes<'CachedRowModel', TFeatures> & CachedRowModels_Plugins<TFeatures, TData>;
38
+ } & ExtractFeatureMapTypes<TFeatures, CachedRowModels_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'CachedRowModel', TFeatures> & CachedRowModels_Plugins<TFeatures, TData>;
23
39
  type CachedRowModel_All<TFeatures extends TableFeatures, TData extends RowData = any> = Partial<CachedRowModel_Core<TFeatures, TData> & CachedRowModel_Expanded<TFeatures, TData> & CachedRowModel_Faceted<TFeatures, TData> & CachedRowModel_Filtered<TFeatures, TData> & CachedRowModel_Grouped<TFeatures, TData> & CachedRowModel_Paginated<TFeatures, TData> & CachedRowModel_Sorted<TFeatures, TData>>;
24
40
  //#endregion
25
- export { CachedRowModel_All, CachedRowModels, CachedRowModels_Plugins, CreateRowModels, CreateRowModels_All, CreateRowModels_Plugins };
41
+ export { CachedRowModel_All, CachedRowModels, CachedRowModels_FeatureMap, CachedRowModels_Plugins, CreateRowModels, CreateRowModels_All, CreateRowModels_FeatureMap, CreateRowModels_Plugins };
26
42
  //# sourceMappingURL=RowModel.d.cts.map
@@ -1,9 +1,9 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.js";
1
+ import { RowData } from "./type-utils.js";
2
2
  import { CachedRowModel_Sorted, CreateRowModel_Sorted } from "../features/row-sorting/rowSortingFeature.types.js";
3
3
  import { CachedRowModel_Filtered, CreateRowModel_Filtered } from "../features/column-filtering/columnFilteringFeature.types.js";
4
4
  import { CachedRowModel_Expanded, CreateRowModel_Expanded } from "../features/row-expanding/rowExpandingFeature.types.js";
5
5
  import { CachedRowModel_Paginated, CreateRowModel_Paginated } from "../features/row-pagination/rowPaginationFeature.types.js";
6
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
6
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
7
7
  import { CachedRowModel_Faceted, CreateRowModel_Faceted } from "../features/column-faceting/columnFacetingFeature.types.js";
8
8
  import { CachedRowModel_Core, CreateRowModel_Core, RowModel } from "../core/row-models/coreRowModelsFeature.types.js";
9
9
  import { CachedRowModel_Grouped, CreateRowModel_Grouped } from "../features/column-grouping/columnGroupingFeature.types.js";
@@ -14,13 +14,29 @@ import { CachedRowModel_Grouped, CreateRowModel_Grouped } from "../features/colu
14
14
  * Note: This will affect the types of all tables in your project.
15
15
  */
16
16
  interface CreateRowModels_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
17
- type CreateRowModels<TFeatures extends TableFeatures, TData extends RowData> = CreateRowModel_Core<TFeatures, TData> & UnionToIntersection<('columnFacetingFeature' extends keyof TFeatures ? CreateRowModel_Faceted<TFeatures, TData> : never) | ('columnFilteringFeature' extends keyof TFeatures ? CreateRowModel_Filtered<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? CreateRowModel_Expanded<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? CreateRowModel_Grouped<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? CreateRowModel_Paginated<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? CreateRowModel_Sorted<TFeatures, TData> : never)> & ExtractFeatureTypes<'CreateRowModels', TFeatures> & CreateRowModels_Plugins<TFeatures, TData>;
17
+ interface CreateRowModels_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
18
+ columnFacetingFeature: CreateRowModel_Faceted<TFeatures, TData>;
19
+ columnFilteringFeature: CreateRowModel_Filtered<TFeatures, TData>;
20
+ rowExpandingFeature: CreateRowModel_Expanded<TFeatures, TData>;
21
+ columnGroupingFeature: CreateRowModel_Grouped<TFeatures, TData>;
22
+ rowPaginationFeature: CreateRowModel_Paginated<TFeatures, TData>;
23
+ rowSortingFeature: CreateRowModel_Sorted<TFeatures, TData>;
24
+ }
25
+ type CreateRowModels<TFeatures extends TableFeatures, TData extends RowData> = CreateRowModel_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, CreateRowModels_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'CreateRowModels', TFeatures> & CreateRowModels_Plugins<TFeatures, TData>;
18
26
  type CreateRowModels_All<TFeatures extends TableFeatures, TData extends RowData> = CreateRowModel_Core<TFeatures, TData> & CreateRowModel_Expanded<TFeatures, TData> & CreateRowModel_Faceted<TFeatures, TData> & CreateRowModel_Filtered<TFeatures, TData> & CreateRowModel_Grouped<TFeatures, TData> & CreateRowModel_Paginated<TFeatures, TData> & CreateRowModel_Sorted<TFeatures, TData>;
19
27
  interface CachedRowModels_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
28
+ interface CachedRowModels_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
29
+ columnFacetingFeature: CachedRowModel_Faceted<TFeatures, TData>;
30
+ columnFilteringFeature: CachedRowModel_Filtered<TFeatures, TData>;
31
+ rowExpandingFeature: CachedRowModel_Expanded<TFeatures, TData>;
32
+ columnGroupingFeature: CachedRowModel_Grouped<TFeatures, TData>;
33
+ rowPaginationFeature: CachedRowModel_Paginated<TFeatures, TData>;
34
+ rowSortingFeature: CachedRowModel_Sorted<TFeatures, TData>;
35
+ }
20
36
  type CachedRowModels<TFeatures extends TableFeatures, TData extends RowData> = {
21
37
  CachedRowModel_Core: () => RowModel<TFeatures, TData>;
22
- } & UnionToIntersection<('columnFacetingFeature' extends keyof TFeatures ? CachedRowModel_Faceted<TFeatures, TData> : never) | ('columnFilteringFeature' extends keyof TFeatures ? CachedRowModel_Filtered<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? CachedRowModel_Expanded<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? CachedRowModel_Grouped<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? CachedRowModel_Paginated<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? CachedRowModel_Sorted<TFeatures, TData> : never)> & ExtractFeatureTypes<'CachedRowModel', TFeatures> & CachedRowModels_Plugins<TFeatures, TData>;
38
+ } & ExtractFeatureMapTypes<TFeatures, CachedRowModels_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'CachedRowModel', TFeatures> & CachedRowModels_Plugins<TFeatures, TData>;
23
39
  type CachedRowModel_All<TFeatures extends TableFeatures, TData extends RowData = any> = Partial<CachedRowModel_Core<TFeatures, TData> & CachedRowModel_Expanded<TFeatures, TData> & CachedRowModel_Faceted<TFeatures, TData> & CachedRowModel_Filtered<TFeatures, TData> & CachedRowModel_Grouped<TFeatures, TData> & CachedRowModel_Paginated<TFeatures, TData> & CachedRowModel_Sorted<TFeatures, TData>>;
24
40
  //#endregion
25
- export { CachedRowModel_All, CachedRowModels, CachedRowModels_Plugins, CreateRowModels, CreateRowModels_All, CreateRowModels_Plugins };
41
+ export { CachedRowModel_All, CachedRowModels, CachedRowModels_FeatureMap, CachedRowModels_Plugins, CreateRowModels, CreateRowModels_All, CreateRowModels_FeatureMap, CreateRowModels_Plugins };
26
42
  //# sourceMappingURL=RowModel.d.ts.map
@@ -1,7 +1,7 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.cjs";
1
+ import { RowData } from "./type-utils.cjs";
2
2
  import { RowModelFns_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
3
3
  import { RowModelFns_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
4
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
4
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
5
5
  import { RowModelFns_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
6
6
 
7
7
  //#region src/types/RowModelFns.d.ts
@@ -11,8 +11,13 @@ import { RowModelFns_ColumnGrouping } from "../features/column-grouping/columnGr
11
11
  */
12
12
  interface RowModelFns_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
13
13
  interface RowModelFns_Core {}
14
- type RowModelFns<TFeatures extends TableFeatures, TData extends RowData> = Partial<UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? RowModelFns_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? RowModelFns_ColumnGrouping<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? RowModelFns_RowSorting<TFeatures, TData> : never)> & ExtractFeatureTypes<'RowModelFns', TFeatures> & RowModelFns_Plugins<TFeatures, TData>>;
14
+ interface RowModelFns_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
15
+ columnFilteringFeature: RowModelFns_ColumnFiltering<TFeatures, TData>;
16
+ columnGroupingFeature: RowModelFns_ColumnGrouping<TFeatures, TData>;
17
+ rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>;
18
+ }
19
+ type RowModelFns<TFeatures extends TableFeatures, TData extends RowData> = Partial<ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'RowModelFns', TFeatures> & RowModelFns_Plugins<TFeatures, TData>>;
15
20
  type RowModelFns_All<TFeatures extends TableFeatures, TData extends RowData> = Partial<RowModelFns_ColumnFiltering<TFeatures, TData> & RowModelFns_ColumnGrouping<TFeatures, TData> & RowModelFns_RowSorting<TFeatures, TData>>;
16
21
  //#endregion
17
- export { RowModelFns, RowModelFns_All, RowModelFns_Core, RowModelFns_Plugins };
22
+ export { RowModelFns, RowModelFns_All, RowModelFns_Core, RowModelFns_FeatureMap, RowModelFns_Plugins };
18
23
  //# sourceMappingURL=RowModelFns.d.cts.map
@@ -1,7 +1,7 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.js";
1
+ import { RowData } from "./type-utils.js";
2
2
  import { RowModelFns_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
3
3
  import { RowModelFns_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
4
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
4
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
5
5
  import { RowModelFns_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
6
6
 
7
7
  //#region src/types/RowModelFns.d.ts
@@ -11,8 +11,13 @@ import { RowModelFns_ColumnGrouping } from "../features/column-grouping/columnGr
11
11
  */
12
12
  interface RowModelFns_Plugins<TFeatures extends TableFeatures, TData extends RowData> {}
13
13
  interface RowModelFns_Core {}
14
- type RowModelFns<TFeatures extends TableFeatures, TData extends RowData> = Partial<UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? RowModelFns_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? RowModelFns_ColumnGrouping<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? RowModelFns_RowSorting<TFeatures, TData> : never)> & ExtractFeatureTypes<'RowModelFns', TFeatures> & RowModelFns_Plugins<TFeatures, TData>>;
14
+ interface RowModelFns_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
15
+ columnFilteringFeature: RowModelFns_ColumnFiltering<TFeatures, TData>;
16
+ columnGroupingFeature: RowModelFns_ColumnGrouping<TFeatures, TData>;
17
+ rowSortingFeature: RowModelFns_RowSorting<TFeatures, TData>;
18
+ }
19
+ type RowModelFns<TFeatures extends TableFeatures, TData extends RowData> = Partial<ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'RowModelFns', TFeatures> & RowModelFns_Plugins<TFeatures, TData>>;
15
20
  type RowModelFns_All<TFeatures extends TableFeatures, TData extends RowData> = Partial<RowModelFns_ColumnFiltering<TFeatures, TData> & RowModelFns_ColumnGrouping<TFeatures, TData> & RowModelFns_RowSorting<TFeatures, TData>>;
16
21
  //#endregion
17
- export { RowModelFns, RowModelFns_All, RowModelFns_Core, RowModelFns_Plugins };
22
+ export { RowModelFns, RowModelFns_All, RowModelFns_Core, RowModelFns_FeatureMap, RowModelFns_Plugins };
18
23
  //# sourceMappingURL=RowModelFns.d.ts.map
@@ -1,4 +1,4 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.cjs";
1
+ import { RowData } from "./type-utils.cjs";
2
2
  import { Table_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
3
3
  import { Table_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
4
4
  import { Table_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.cjs";
@@ -19,7 +19,7 @@ import { CachedRowModel_All, CreateRowModels_All } from "./RowModel.cjs";
19
19
  import { TableState_All } from "./TableState.cjs";
20
20
  import { Atoms_All, BaseAtoms_All, ExternalAtoms_All, Table_Table } from "../core/table/coreTablesFeature.types.cjs";
21
21
  import { TableOptions_All } from "./TableOptions.cjs";
22
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
22
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
23
23
  import { Table_ColumnFaceting } from "../features/column-faceting/columnFacetingFeature.types.cjs";
24
24
  import { Table_RowModels } from "../core/row-models/coreRowModelsFeature.types.cjs";
25
25
  import { Table_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
@@ -36,10 +36,26 @@ interface Table_Plugins<TFeatures extends TableFeatures, TData extends RowData>
36
36
  * No features are included.
37
37
  */
38
38
  type Table_Core<TFeatures extends TableFeatures, TData extends RowData> = Table_Table<TFeatures, TData> & Table_Columns<TFeatures, TData> & Table_Rows<TFeatures, TData> & Table_RowModels<TFeatures, TData> & Table_Headers<TFeatures, TData>;
39
+ interface Table_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
40
+ columnFilteringFeature: Table_ColumnFiltering;
41
+ columnGroupingFeature: Table_ColumnGrouping<TFeatures, TData>;
42
+ columnOrderingFeature: Table_ColumnOrdering<TFeatures, TData>;
43
+ columnPinningFeature: Table_ColumnPinning<TFeatures, TData>;
44
+ columnResizingFeature: Table_ColumnResizing;
45
+ columnSizingFeature: Table_ColumnSizing;
46
+ columnVisibilityFeature: Table_ColumnVisibility<TFeatures, TData>;
47
+ columnFacetingFeature: Table_ColumnFaceting<TFeatures, TData>;
48
+ globalFilteringFeature: Table_GlobalFiltering<TFeatures, TData>;
49
+ rowExpandingFeature: Table_RowExpanding<TFeatures, TData>;
50
+ rowPaginationFeature: Table_RowPagination<TFeatures, TData>;
51
+ rowPinningFeature: Table_RowPinning<TFeatures, TData>;
52
+ rowSelectionFeature: Table_RowSelection<TFeatures, TData>;
53
+ rowSortingFeature: Table_RowSorting<TFeatures, TData>;
54
+ }
39
55
  /**
40
56
  * The table object that includes both the core table functionality and the features that are enabled via the `features` table option.
41
57
  */
42
- type Table<TFeatures extends TableFeatures, TData extends RowData> = Table_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? Table_ColumnFiltering : never) | ('columnGroupingFeature' extends keyof TFeatures ? Table_ColumnGrouping<TFeatures, TData> : never) | ('columnOrderingFeature' extends keyof TFeatures ? Table_ColumnOrdering<TFeatures, TData> : never) | ('columnPinningFeature' extends keyof TFeatures ? Table_ColumnPinning<TFeatures, TData> : never) | ('columnResizingFeature' extends keyof TFeatures ? Table_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? Table_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? Table_ColumnVisibility<TFeatures, TData> : never) | ('columnFacetingFeature' extends keyof TFeatures ? Table_ColumnFaceting<TFeatures, TData> : never) | ('globalFilteringFeature' extends keyof TFeatures ? Table_GlobalFiltering<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? Table_RowExpanding<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? Table_RowPagination<TFeatures, TData> : never) | ('rowPinningFeature' extends keyof TFeatures ? Table_RowPinning<TFeatures, TData> : never) | ('rowSelectionFeature' extends keyof TFeatures ? Table_RowSelection<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? Table_RowSorting<TFeatures, TData> : never)> & ExtractFeatureTypes<'Table', TFeatures> & Table_Plugins<TFeatures, TData>;
58
+ type Table<TFeatures extends TableFeatures, TData extends RowData> = Table_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, Table_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'Table', TFeatures> & Table_Plugins<TFeatures, TData>;
43
59
  type Table_Internal<TFeatures extends TableFeatures, TData extends RowData = any> = Table<TFeatures, TData> & {
44
60
  _rowModels: CachedRowModel_All<TFeatures, TData>;
45
61
  _rowModelFns: RowModelFns_All<TFeatures, TData>;
@@ -55,5 +71,5 @@ type Table_Internal<TFeatures extends TableFeatures, TData extends RowData = any
55
71
  store: ReadonlyStore<TableState_All>;
56
72
  };
57
73
  //#endregion
58
- export { Table, Table_Core, Table_Internal, Table_Plugins };
74
+ export { Table, Table_Core, Table_FeatureMap, Table_Internal, Table_Plugins };
59
75
  //# sourceMappingURL=Table.d.cts.map
@@ -1,4 +1,4 @@
1
- import { RowData, UnionToIntersection } from "./type-utils.js";
1
+ import { RowData } from "./type-utils.js";
2
2
  import { Table_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
3
3
  import { Table_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
4
4
  import { Table_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.js";
@@ -19,7 +19,7 @@ import { CachedRowModel_All, CreateRowModels_All } from "./RowModel.js";
19
19
  import { TableState_All } from "./TableState.js";
20
20
  import { Atoms_All, BaseAtoms_All, ExternalAtoms_All, Table_Table } from "../core/table/coreTablesFeature.types.js";
21
21
  import { TableOptions_All } from "./TableOptions.js";
22
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
22
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
23
23
  import { Table_ColumnFaceting } from "../features/column-faceting/columnFacetingFeature.types.js";
24
24
  import { Table_RowModels } from "../core/row-models/coreRowModelsFeature.types.js";
25
25
  import { Table_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
@@ -36,10 +36,26 @@ interface Table_Plugins<TFeatures extends TableFeatures, TData extends RowData>
36
36
  * No features are included.
37
37
  */
38
38
  type Table_Core<TFeatures extends TableFeatures, TData extends RowData> = Table_Table<TFeatures, TData> & Table_Columns<TFeatures, TData> & Table_Rows<TFeatures, TData> & Table_RowModels<TFeatures, TData> & Table_Headers<TFeatures, TData>;
39
+ interface Table_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
40
+ columnFilteringFeature: Table_ColumnFiltering;
41
+ columnGroupingFeature: Table_ColumnGrouping<TFeatures, TData>;
42
+ columnOrderingFeature: Table_ColumnOrdering<TFeatures, TData>;
43
+ columnPinningFeature: Table_ColumnPinning<TFeatures, TData>;
44
+ columnResizingFeature: Table_ColumnResizing;
45
+ columnSizingFeature: Table_ColumnSizing;
46
+ columnVisibilityFeature: Table_ColumnVisibility<TFeatures, TData>;
47
+ columnFacetingFeature: Table_ColumnFaceting<TFeatures, TData>;
48
+ globalFilteringFeature: Table_GlobalFiltering<TFeatures, TData>;
49
+ rowExpandingFeature: Table_RowExpanding<TFeatures, TData>;
50
+ rowPaginationFeature: Table_RowPagination<TFeatures, TData>;
51
+ rowPinningFeature: Table_RowPinning<TFeatures, TData>;
52
+ rowSelectionFeature: Table_RowSelection<TFeatures, TData>;
53
+ rowSortingFeature: Table_RowSorting<TFeatures, TData>;
54
+ }
39
55
  /**
40
56
  * The table object that includes both the core table functionality and the features that are enabled via the `features` table option.
41
57
  */
42
- type Table<TFeatures extends TableFeatures, TData extends RowData> = Table_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? Table_ColumnFiltering : never) | ('columnGroupingFeature' extends keyof TFeatures ? Table_ColumnGrouping<TFeatures, TData> : never) | ('columnOrderingFeature' extends keyof TFeatures ? Table_ColumnOrdering<TFeatures, TData> : never) | ('columnPinningFeature' extends keyof TFeatures ? Table_ColumnPinning<TFeatures, TData> : never) | ('columnResizingFeature' extends keyof TFeatures ? Table_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? Table_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? Table_ColumnVisibility<TFeatures, TData> : never) | ('columnFacetingFeature' extends keyof TFeatures ? Table_ColumnFaceting<TFeatures, TData> : never) | ('globalFilteringFeature' extends keyof TFeatures ? Table_GlobalFiltering<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? Table_RowExpanding<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? Table_RowPagination<TFeatures, TData> : never) | ('rowPinningFeature' extends keyof TFeatures ? Table_RowPinning<TFeatures, TData> : never) | ('rowSelectionFeature' extends keyof TFeatures ? Table_RowSelection<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? Table_RowSorting<TFeatures, TData> : never)> & ExtractFeatureTypes<'Table', TFeatures> & Table_Plugins<TFeatures, TData>;
58
+ type Table<TFeatures extends TableFeatures, TData extends RowData> = Table_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, Table_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'Table', TFeatures> & Table_Plugins<TFeatures, TData>;
43
59
  type Table_Internal<TFeatures extends TableFeatures, TData extends RowData = any> = Table<TFeatures, TData> & {
44
60
  _rowModels: CachedRowModel_All<TFeatures, TData>;
45
61
  _rowModelFns: RowModelFns_All<TFeatures, TData>;
@@ -55,5 +71,5 @@ type Table_Internal<TFeatures extends TableFeatures, TData extends RowData = any
55
71
  store: ReadonlyStore<TableState_All>;
56
72
  };
57
73
  //#endregion
58
- export { Table, Table_Core, Table_Internal, Table_Plugins };
74
+ export { Table, Table_Core, Table_FeatureMap, Table_Internal, Table_Plugins };
59
75
  //# sourceMappingURL=Table.d.ts.map
@@ -9,6 +9,8 @@ import { Table_Internal } from "./Table.cjs";
9
9
 
10
10
  //#region src/types/TableFeatures.d.ts
11
11
  type ExtractFeatureTypes<TKey extends keyof FeatureConstructors, TFeatures extends TableFeatures> = UnionToIntersection<{ [K in keyof TFeatures]: K extends 'coreReativityFeature' ? never : TFeatures[K] extends TableFeature<infer FeatureConstructorOptions> ? TKey extends keyof FeatureConstructorOptions ? FeatureConstructorOptions[TKey] : never : any }[keyof TFeatures]>;
12
+ type IsAny<T> = 0 extends 1 & T ? true : false;
13
+ type ExtractFeatureMapTypes<TFeatures extends TableFeatures, TFeatureMap extends object> = IsAny<TFeatures> extends true ? UnionToIntersection<TFeatureMap[keyof TFeatureMap]> : UnionToIntersection<TFeatureMap[Extract<keyof TFeatures, keyof TFeatureMap>]>;
12
14
  interface FeatureConstructors {
13
15
  CachedRowModel?: any;
14
16
  Cell?: any;
@@ -73,5 +75,5 @@ interface TableFeature<TConstructors extends FeatureConstructors> {
73
75
  initRowInstanceData?: InitRowInstanceData<TConstructors>;
74
76
  }
75
77
  //#endregion
76
- export { AssignCellPrototype, AssignColumnPrototype, AssignHeaderPrototype, AssignRowPrototype, ConstructTableAPIs, ExtractFeatureTypes, FeatureConstructors, GetDefaultColumnDef, GetDefaultStateSelector, GetDefaultTableOptions, GetInitialState, InitRowInstanceData, Plugins, TableFeature, TableFeatures };
78
+ export { AssignCellPrototype, AssignColumnPrototype, AssignHeaderPrototype, AssignRowPrototype, ConstructTableAPIs, ExtractFeatureMapTypes, ExtractFeatureTypes, FeatureConstructors, GetDefaultColumnDef, GetDefaultStateSelector, GetDefaultTableOptions, GetInitialState, InitRowInstanceData, Plugins, TableFeature, TableFeatures };
77
79
  //# sourceMappingURL=TableFeatures.d.cts.map
@@ -9,6 +9,8 @@ import { Table_Internal } from "./Table.js";
9
9
 
10
10
  //#region src/types/TableFeatures.d.ts
11
11
  type ExtractFeatureTypes<TKey extends keyof FeatureConstructors, TFeatures extends TableFeatures> = UnionToIntersection<{ [K in keyof TFeatures]: K extends 'coreReativityFeature' ? never : TFeatures[K] extends TableFeature<infer FeatureConstructorOptions> ? TKey extends keyof FeatureConstructorOptions ? FeatureConstructorOptions[TKey] : never : any }[keyof TFeatures]>;
12
+ type IsAny<T> = 0 extends 1 & T ? true : false;
13
+ type ExtractFeatureMapTypes<TFeatures extends TableFeatures, TFeatureMap extends object> = IsAny<TFeatures> extends true ? UnionToIntersection<TFeatureMap[keyof TFeatureMap]> : UnionToIntersection<TFeatureMap[Extract<keyof TFeatures, keyof TFeatureMap>]>;
12
14
  interface FeatureConstructors {
13
15
  CachedRowModel?: any;
14
16
  Cell?: any;
@@ -73,5 +75,5 @@ interface TableFeature<TConstructors extends FeatureConstructors> {
73
75
  initRowInstanceData?: InitRowInstanceData<TConstructors>;
74
76
  }
75
77
  //#endregion
76
- export { AssignCellPrototype, AssignColumnPrototype, AssignHeaderPrototype, AssignRowPrototype, ConstructTableAPIs, ExtractFeatureTypes, FeatureConstructors, GetDefaultColumnDef, GetDefaultStateSelector, GetDefaultTableOptions, GetInitialState, InitRowInstanceData, Plugins, TableFeature, TableFeatures };
78
+ export { AssignCellPrototype, AssignColumnPrototype, AssignHeaderPrototype, AssignRowPrototype, ConstructTableAPIs, ExtractFeatureMapTypes, ExtractFeatureTypes, FeatureConstructors, GetDefaultColumnDef, GetDefaultStateSelector, GetDefaultTableOptions, GetInitialState, InitRowInstanceData, Plugins, TableFeature, TableFeatures };
77
79
  //# sourceMappingURL=TableFeatures.d.ts.map
@@ -16,7 +16,7 @@ import { TableOptions_Rows } from "../core/rows/coreRowsFeature.types.cjs";
16
16
  import { TableOptions_Cell } from "../core/cells/coreCellsFeature.types.cjs";
17
17
  import { TableOptions_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.cjs";
18
18
  import { TableOptions_Table } from "../core/table/coreTablesFeature.types.cjs";
19
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
19
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
20
20
  import { TableOptions_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
21
21
 
22
22
  //#region src/types/TableOptions.d.ts
@@ -36,6 +36,22 @@ type DebugOptions<TFeatures extends TableFeatures> = {
36
36
  debugRows?: boolean;
37
37
  debugTable?: boolean;
38
38
  } & DebugKeysFor<CoreFeatures & TFeatures>;
39
+ interface TableOptions_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
40
+ columnFilteringFeature: TableOptions_ColumnFiltering<TFeatures, TData>;
41
+ columnGroupingFeature: TableOptions_ColumnGrouping;
42
+ columnOrderingFeature: TableOptions_ColumnOrdering;
43
+ columnPinningFeature: TableOptions_ColumnPinning;
44
+ columnResizingFeature: TableOptions_ColumnResizing;
45
+ columnSizingFeature: TableOptions_ColumnSizing;
46
+ columnVisibilityFeature: TableOptions_ColumnVisibility;
47
+ globalFilteringFeature: TableOptions_GlobalFiltering<TFeatures, TData>;
48
+ rowExpandingFeature: TableOptions_RowExpanding<TFeatures, TData>;
49
+ rowPaginationFeature: TableOptions_RowPagination;
50
+ rowPinningFeature: TableOptions_RowPinning<TFeatures, TData>;
51
+ rowSelectionFeature: TableOptions_RowSelection<TFeatures, TData>;
52
+ rowSortingFeature: TableOptions_RowSorting;
53
+ }
54
+ type TableOptions_FeatureMap_All<TFeatures extends TableFeatures, TData extends RowData> = UnionToIntersection<TableOptions_FeatureMap<TFeatures, TData>[keyof TableOptions_FeatureMap<TFeatures, TData>]>;
39
55
  /**
40
56
  * Complete table options for a specific feature set.
41
57
  *
@@ -43,12 +59,12 @@ type DebugOptions<TFeatures extends TableFeatures> = {
43
59
  * `TFeatures`, then custom feature/plugin options and debug options are mixed
44
60
  * in.
45
61
  */
46
- type TableOptions<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableOptions_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableOptions_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableOptions_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableOptions_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableOptions_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableOptions_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableOptions_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableOptions_GlobalFiltering<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableOptions_RowExpanding<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableOptions_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableOptions_RowPinning<TFeatures, TData> : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableOptions_RowSelection<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? TableOptions_RowSorting : never)> & ExtractFeatureTypes<'TableOptions', TFeatures> & TableOptions_Plugins<TFeatures, TData> & DebugOptions<TFeatures>;
62
+ type TableOptions<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, TableOptions_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'TableOptions', TFeatures> & TableOptions_Plugins<TFeatures, TData> & DebugOptions<TFeatures>;
47
63
  /**
48
64
  * Internal broad option shape used where feature code may need to read options
49
65
  * from features that are not present in the current generic feature set.
50
66
  */
51
- type TableOptions_All<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & Partial<TableOptions_ColumnFiltering<TFeatures, TData> & TableOptions_ColumnGrouping & TableOptions_ColumnOrdering & TableOptions_ColumnPinning & TableOptions_ColumnResizing & TableOptions_ColumnSizing & TableOptions_ColumnVisibility & TableOptions_GlobalFiltering<TFeatures, TData> & TableOptions_RowExpanding<TFeatures, TData> & TableOptions_RowPagination & TableOptions_RowPinning<TFeatures, TData> & TableOptions_RowSelection<TFeatures, TData> & TableOptions_RowSorting>;
67
+ type TableOptions_All<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & Partial<TableOptions_FeatureMap_All<TFeatures, TData>>;
52
68
  //#endregion
53
- export { DebugOptions, TableOptions, TableOptions_All, TableOptions_Core, TableOptions_Plugins };
69
+ export { DebugOptions, TableOptions, TableOptions_All, TableOptions_Core, TableOptions_FeatureMap, TableOptions_FeatureMap_All, TableOptions_Plugins };
54
70
  //# sourceMappingURL=TableOptions.d.cts.map
@@ -16,7 +16,7 @@ import { TableOptions_Rows } from "../core/rows/coreRowsFeature.types.js";
16
16
  import { TableOptions_Cell } from "../core/cells/coreCellsFeature.types.js";
17
17
  import { TableOptions_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.js";
18
18
  import { TableOptions_Table } from "../core/table/coreTablesFeature.types.js";
19
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
19
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
20
20
  import { TableOptions_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
21
21
 
22
22
  //#region src/types/TableOptions.d.ts
@@ -36,6 +36,22 @@ type DebugOptions<TFeatures extends TableFeatures> = {
36
36
  debugRows?: boolean;
37
37
  debugTable?: boolean;
38
38
  } & DebugKeysFor<CoreFeatures & TFeatures>;
39
+ interface TableOptions_FeatureMap<TFeatures extends TableFeatures, TData extends RowData> {
40
+ columnFilteringFeature: TableOptions_ColumnFiltering<TFeatures, TData>;
41
+ columnGroupingFeature: TableOptions_ColumnGrouping;
42
+ columnOrderingFeature: TableOptions_ColumnOrdering;
43
+ columnPinningFeature: TableOptions_ColumnPinning;
44
+ columnResizingFeature: TableOptions_ColumnResizing;
45
+ columnSizingFeature: TableOptions_ColumnSizing;
46
+ columnVisibilityFeature: TableOptions_ColumnVisibility;
47
+ globalFilteringFeature: TableOptions_GlobalFiltering<TFeatures, TData>;
48
+ rowExpandingFeature: TableOptions_RowExpanding<TFeatures, TData>;
49
+ rowPaginationFeature: TableOptions_RowPagination;
50
+ rowPinningFeature: TableOptions_RowPinning<TFeatures, TData>;
51
+ rowSelectionFeature: TableOptions_RowSelection<TFeatures, TData>;
52
+ rowSortingFeature: TableOptions_RowSorting;
53
+ }
54
+ type TableOptions_FeatureMap_All<TFeatures extends TableFeatures, TData extends RowData> = UnionToIntersection<TableOptions_FeatureMap<TFeatures, TData>[keyof TableOptions_FeatureMap<TFeatures, TData>]>;
39
55
  /**
40
56
  * Complete table options for a specific feature set.
41
57
  *
@@ -43,12 +59,12 @@ type DebugOptions<TFeatures extends TableFeatures> = {
43
59
  * `TFeatures`, then custom feature/plugin options and debug options are mixed
44
60
  * in.
45
61
  */
46
- type TableOptions<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableOptions_ColumnFiltering<TFeatures, TData> : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableOptions_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableOptions_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableOptions_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableOptions_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableOptions_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableOptions_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableOptions_GlobalFiltering<TFeatures, TData> : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableOptions_RowExpanding<TFeatures, TData> : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableOptions_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableOptions_RowPinning<TFeatures, TData> : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableOptions_RowSelection<TFeatures, TData> : never) | ('rowSortingFeature' extends keyof TFeatures ? TableOptions_RowSorting : never)> & ExtractFeatureTypes<'TableOptions', TFeatures> & TableOptions_Plugins<TFeatures, TData> & DebugOptions<TFeatures>;
62
+ type TableOptions<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & ExtractFeatureMapTypes<TFeatures, TableOptions_FeatureMap<TFeatures, TData>> & ExtractFeatureTypes<'TableOptions', TFeatures> & TableOptions_Plugins<TFeatures, TData> & DebugOptions<TFeatures>;
47
63
  /**
48
64
  * Internal broad option shape used where feature code may need to read options
49
65
  * from features that are not present in the current generic feature set.
50
66
  */
51
- type TableOptions_All<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & Partial<TableOptions_ColumnFiltering<TFeatures, TData> & TableOptions_ColumnGrouping & TableOptions_ColumnOrdering & TableOptions_ColumnPinning & TableOptions_ColumnResizing & TableOptions_ColumnSizing & TableOptions_ColumnVisibility & TableOptions_GlobalFiltering<TFeatures, TData> & TableOptions_RowExpanding<TFeatures, TData> & TableOptions_RowPagination & TableOptions_RowPinning<TFeatures, TData> & TableOptions_RowSelection<TFeatures, TData> & TableOptions_RowSorting>;
67
+ type TableOptions_All<TFeatures extends TableFeatures, TData extends RowData> = TableOptions_Core<TFeatures, TData> & Partial<TableOptions_FeatureMap_All<TFeatures, TData>>;
52
68
  //#endregion
53
- export { DebugOptions, TableOptions, TableOptions_All, TableOptions_Core, TableOptions_Plugins };
69
+ export { DebugOptions, TableOptions, TableOptions_All, TableOptions_Core, TableOptions_FeatureMap, TableOptions_FeatureMap_All, TableOptions_Plugins };
54
70
  //# sourceMappingURL=TableOptions.d.ts.map
@@ -1,4 +1,3 @@
1
- import { UnionToIntersection } from "./type-utils.cjs";
2
1
  import { TableState_RowSorting } from "../features/row-sorting/rowSortingFeature.types.cjs";
3
2
  import { TableState_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.cjs";
4
3
  import { TableState_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.cjs";
@@ -11,7 +10,7 @@ import { TableState_RowExpanding } from "../features/row-expanding/rowExpandingF
11
10
  import { TableState_RowPinning } from "../features/row-pinning/rowPinningFeature.types.cjs";
12
11
  import { TableState_RowSelection } from "../features/row-selection/rowSelectionFeature.types.cjs";
13
12
  import { TableState_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.cjs";
14
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
13
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.cjs";
15
14
  import { TableState_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.cjs";
16
15
 
17
16
  //#region src/types/TableState.d.ts
@@ -20,13 +19,28 @@ import { TableState_ColumnGrouping } from "../features/column-grouping/columnGro
20
19
  * Note: This will affect the types of all tables in your project.
21
20
  */
22
21
  interface TableState_Plugins<TFeatures extends TableFeatures> {}
22
+ interface TableState_FeatureMap {
23
+ columnFilteringFeature: TableState_ColumnFiltering;
24
+ columnGroupingFeature: TableState_ColumnGrouping;
25
+ columnOrderingFeature: TableState_ColumnOrdering;
26
+ columnPinningFeature: TableState_ColumnPinning;
27
+ columnResizingFeature: TableState_ColumnResizing;
28
+ columnSizingFeature: TableState_ColumnSizing;
29
+ columnVisibilityFeature: TableState_ColumnVisibility;
30
+ globalFilteringFeature: TableState_GlobalFiltering;
31
+ rowExpandingFeature: TableState_RowExpanding;
32
+ rowPaginationFeature: TableState_RowPagination;
33
+ rowPinningFeature: TableState_RowPinning;
34
+ rowSelectionFeature: TableState_RowSelection;
35
+ rowSortingFeature: TableState_RowSorting;
36
+ }
23
37
  /**
24
38
  * Complete table state for a specific feature set.
25
39
  *
26
40
  * State slices are included only when their feature is present in `TFeatures`,
27
41
  * then custom feature/plugin state is mixed in.
28
42
  */
29
- type TableState<TFeatures extends TableFeatures> = UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableState_ColumnFiltering : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableState_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableState_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableState_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableState_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableState_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableState_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableState_GlobalFiltering : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableState_RowExpanding : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableState_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableState_RowPinning : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableState_RowSelection : never) | ('rowSortingFeature' extends keyof TFeatures ? TableState_RowSorting : never)> & ExtractFeatureTypes<'TableState', TFeatures> & TableState_Plugins<TFeatures>;
43
+ type TableState<TFeatures extends TableFeatures> = ExtractFeatureMapTypes<TFeatures, TableState_FeatureMap> & ExtractFeatureTypes<'TableState', TFeatures> & TableState_Plugins<TFeatures>;
30
44
  /**
31
45
  * Internal broad state shape containing every stock feature state slice.
32
46
  *
@@ -35,5 +49,5 @@ type TableState<TFeatures extends TableFeatures> = UnionToIntersection<('columnF
35
49
  */
36
50
  type TableState_All = Partial<TableState_ColumnFiltering & TableState_ColumnGrouping & TableState_ColumnOrdering & TableState_ColumnPinning & TableState_ColumnResizing & TableState_ColumnSizing & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowPinning & TableState_RowSelection & TableState_RowSorting>;
37
51
  //#endregion
38
- export { TableState, TableState_All, TableState_Plugins };
52
+ export { TableState, TableState_All, TableState_FeatureMap, TableState_Plugins };
39
53
  //# sourceMappingURL=TableState.d.cts.map
@@ -1,4 +1,3 @@
1
- import { UnionToIntersection } from "./type-utils.js";
2
1
  import { TableState_RowSorting } from "../features/row-sorting/rowSortingFeature.types.js";
3
2
  import { TableState_ColumnFiltering } from "../features/column-filtering/columnFilteringFeature.types.js";
4
3
  import { TableState_ColumnSizing } from "../features/column-sizing/columnSizingFeature.types.js";
@@ -11,7 +10,7 @@ import { TableState_RowExpanding } from "../features/row-expanding/rowExpandingF
11
10
  import { TableState_RowPinning } from "../features/row-pinning/rowPinningFeature.types.js";
12
11
  import { TableState_RowSelection } from "../features/row-selection/rowSelectionFeature.types.js";
13
12
  import { TableState_RowPagination } from "../features/row-pagination/rowPaginationFeature.types.js";
14
- import { ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
13
+ import { ExtractFeatureMapTypes, ExtractFeatureTypes, TableFeatures } from "./TableFeatures.js";
15
14
  import { TableState_ColumnGrouping } from "../features/column-grouping/columnGroupingFeature.types.js";
16
15
 
17
16
  //#region src/types/TableState.d.ts
@@ -20,13 +19,28 @@ import { TableState_ColumnGrouping } from "../features/column-grouping/columnGro
20
19
  * Note: This will affect the types of all tables in your project.
21
20
  */
22
21
  interface TableState_Plugins<TFeatures extends TableFeatures> {}
22
+ interface TableState_FeatureMap {
23
+ columnFilteringFeature: TableState_ColumnFiltering;
24
+ columnGroupingFeature: TableState_ColumnGrouping;
25
+ columnOrderingFeature: TableState_ColumnOrdering;
26
+ columnPinningFeature: TableState_ColumnPinning;
27
+ columnResizingFeature: TableState_ColumnResizing;
28
+ columnSizingFeature: TableState_ColumnSizing;
29
+ columnVisibilityFeature: TableState_ColumnVisibility;
30
+ globalFilteringFeature: TableState_GlobalFiltering;
31
+ rowExpandingFeature: TableState_RowExpanding;
32
+ rowPaginationFeature: TableState_RowPagination;
33
+ rowPinningFeature: TableState_RowPinning;
34
+ rowSelectionFeature: TableState_RowSelection;
35
+ rowSortingFeature: TableState_RowSorting;
36
+ }
23
37
  /**
24
38
  * Complete table state for a specific feature set.
25
39
  *
26
40
  * State slices are included only when their feature is present in `TFeatures`,
27
41
  * then custom feature/plugin state is mixed in.
28
42
  */
29
- type TableState<TFeatures extends TableFeatures> = UnionToIntersection<('columnFilteringFeature' extends keyof TFeatures ? TableState_ColumnFiltering : never) | ('columnGroupingFeature' extends keyof TFeatures ? TableState_ColumnGrouping : never) | ('columnOrderingFeature' extends keyof TFeatures ? TableState_ColumnOrdering : never) | ('columnPinningFeature' extends keyof TFeatures ? TableState_ColumnPinning : never) | ('columnResizingFeature' extends keyof TFeatures ? TableState_ColumnResizing : never) | ('columnSizingFeature' extends keyof TFeatures ? TableState_ColumnSizing : never) | ('columnVisibilityFeature' extends keyof TFeatures ? TableState_ColumnVisibility : never) | ('globalFilteringFeature' extends keyof TFeatures ? TableState_GlobalFiltering : never) | ('rowExpandingFeature' extends keyof TFeatures ? TableState_RowExpanding : never) | ('rowPaginationFeature' extends keyof TFeatures ? TableState_RowPagination : never) | ('rowPinningFeature' extends keyof TFeatures ? TableState_RowPinning : never) | ('rowSelectionFeature' extends keyof TFeatures ? TableState_RowSelection : never) | ('rowSortingFeature' extends keyof TFeatures ? TableState_RowSorting : never)> & ExtractFeatureTypes<'TableState', TFeatures> & TableState_Plugins<TFeatures>;
43
+ type TableState<TFeatures extends TableFeatures> = ExtractFeatureMapTypes<TFeatures, TableState_FeatureMap> & ExtractFeatureTypes<'TableState', TFeatures> & TableState_Plugins<TFeatures>;
30
44
  /**
31
45
  * Internal broad state shape containing every stock feature state slice.
32
46
  *
@@ -35,5 +49,5 @@ type TableState<TFeatures extends TableFeatures> = UnionToIntersection<('columnF
35
49
  */
36
50
  type TableState_All = Partial<TableState_ColumnFiltering & TableState_ColumnGrouping & TableState_ColumnOrdering & TableState_ColumnPinning & TableState_ColumnResizing & TableState_ColumnSizing & TableState_ColumnVisibility & TableState_GlobalFiltering & TableState_RowExpanding & TableState_RowPagination & TableState_RowPinning & TableState_RowSelection & TableState_RowSorting>;
37
51
  //#endregion
38
- export { TableState, TableState_All, TableState_Plugins };
52
+ export { TableState, TableState_All, TableState_FeatureMap, TableState_Plugins };
39
53
  //# sourceMappingURL=TableState.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/table-core",
3
- "version": "9.0.0-beta.1",
3
+ "version": "9.0.0-beta.2",
4
4
  "description": "Headless UI for building powerful tables & datagrids for TS/JS.",
5
5
  "author": "Tanner Linsley",
6
6
  "license": "MIT",
@@ -133,7 +133,7 @@ export function constructTable<
133
133
  const snapshot = {} as TableState<TFeatures>
134
134
  for (let i = 0; i < stateKeys.length; i++) {
135
135
  const key = stateKeys[i]!
136
- snapshot[key] = table.atoms[key].get()
136
+ ;(snapshot as Record<string, unknown>)[key] = table.atoms[key].get()
137
137
  }
138
138
  return snapshot
139
139
  },