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

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 (278) hide show
  1. package/dist/core/cells/coreCellsFeature.cjs +11 -20
  2. package/dist/core/cells/coreCellsFeature.cjs.map +1 -1
  3. package/dist/core/cells/coreCellsFeature.d.cts +4 -12
  4. package/dist/core/cells/coreCellsFeature.d.ts +4 -12
  5. package/dist/core/cells/coreCellsFeature.js +12 -20
  6. package/dist/core/cells/coreCellsFeature.js.map +1 -1
  7. package/dist/core/columns/coreColumnsFeature.cjs +59 -68
  8. package/dist/core/columns/coreColumnsFeature.cjs.map +1 -1
  9. package/dist/core/columns/coreColumnsFeature.d.cts +4 -12
  10. package/dist/core/columns/coreColumnsFeature.d.ts +4 -12
  11. package/dist/core/columns/coreColumnsFeature.js +60 -68
  12. package/dist/core/columns/coreColumnsFeature.js.map +1 -1
  13. package/dist/core/headers/buildHeaderGroups.cjs.map +1 -1
  14. package/dist/core/headers/buildHeaderGroups.js.map +1 -1
  15. package/dist/core/headers/coreHeadersFeature.cjs +44 -53
  16. package/dist/core/headers/coreHeadersFeature.cjs.map +1 -1
  17. package/dist/core/headers/coreHeadersFeature.d.cts +4 -12
  18. package/dist/core/headers/coreHeadersFeature.d.ts +4 -12
  19. package/dist/core/headers/coreHeadersFeature.js +45 -53
  20. package/dist/core/headers/coreHeadersFeature.js.map +1 -1
  21. package/dist/core/headers/coreHeadersFeature.utils.cjs.map +1 -1
  22. package/dist/core/headers/coreHeadersFeature.utils.js.map +1 -1
  23. package/dist/core/row-models/coreRowModelsFeature.cjs +17 -26
  24. package/dist/core/row-models/coreRowModelsFeature.cjs.map +1 -1
  25. package/dist/core/row-models/coreRowModelsFeature.d.cts +4 -12
  26. package/dist/core/row-models/coreRowModelsFeature.d.ts +4 -12
  27. package/dist/core/row-models/coreRowModelsFeature.js +18 -26
  28. package/dist/core/row-models/coreRowModelsFeature.js.map +1 -1
  29. package/dist/core/row-models/coreRowModelsFeature.types.d.cts +3 -5
  30. package/dist/core/row-models/coreRowModelsFeature.types.d.ts +3 -5
  31. package/dist/core/row-models/createCoreRowModel.cjs.map +1 -1
  32. package/dist/core/row-models/createCoreRowModel.js.map +1 -1
  33. package/dist/core/rows/coreRowsFeature.cjs +27 -36
  34. package/dist/core/rows/coreRowsFeature.cjs.map +1 -1
  35. package/dist/core/rows/coreRowsFeature.d.cts +4 -12
  36. package/dist/core/rows/coreRowsFeature.d.ts +4 -12
  37. package/dist/core/rows/coreRowsFeature.js +28 -36
  38. package/dist/core/rows/coreRowsFeature.js.map +1 -1
  39. package/dist/core/table/constructTable.cjs +2 -2
  40. package/dist/core/table/constructTable.cjs.map +1 -1
  41. package/dist/core/table/constructTable.js +2 -2
  42. package/dist/core/table/constructTable.js.map +1 -1
  43. package/dist/core/table/coreTablesFeature.cjs +7 -16
  44. package/dist/core/table/coreTablesFeature.cjs.map +1 -1
  45. package/dist/core/table/coreTablesFeature.d.cts +4 -12
  46. package/dist/core/table/coreTablesFeature.d.ts +4 -12
  47. package/dist/core/table/coreTablesFeature.js +8 -16
  48. package/dist/core/table/coreTablesFeature.js.map +1 -1
  49. package/dist/core/table/coreTablesFeature.utils.cjs.map +1 -1
  50. package/dist/core/table/coreTablesFeature.utils.js.map +1 -1
  51. package/dist/features/column-faceting/columnFacetingFeature.cjs +49 -61
  52. package/dist/features/column-faceting/columnFacetingFeature.cjs.map +1 -1
  53. package/dist/features/column-faceting/columnFacetingFeature.d.cts +4 -15
  54. package/dist/features/column-faceting/columnFacetingFeature.d.ts +4 -15
  55. package/dist/features/column-faceting/columnFacetingFeature.js +50 -61
  56. package/dist/features/column-faceting/columnFacetingFeature.js.map +1 -1
  57. package/dist/features/column-faceting/createFacetedMinMaxValues.cjs.map +1 -1
  58. package/dist/features/column-faceting/createFacetedMinMaxValues.js.map +1 -1
  59. package/dist/features/column-faceting/createFacetedRowModel.cjs.map +1 -1
  60. package/dist/features/column-faceting/createFacetedRowModel.js.map +1 -1
  61. package/dist/features/column-faceting/createFacetedUniqueValues.cjs.map +1 -1
  62. package/dist/features/column-faceting/createFacetedUniqueValues.js.map +1 -1
  63. package/dist/features/column-filtering/columnFilteringFeature.cjs +40 -53
  64. package/dist/features/column-filtering/columnFilteringFeature.cjs.map +1 -1
  65. package/dist/features/column-filtering/columnFilteringFeature.d.cts +4 -16
  66. package/dist/features/column-filtering/columnFilteringFeature.d.ts +4 -16
  67. package/dist/features/column-filtering/columnFilteringFeature.js +41 -53
  68. package/dist/features/column-filtering/columnFilteringFeature.js.map +1 -1
  69. package/dist/features/column-filtering/columnFilteringFeature.types.d.cts +3 -3
  70. package/dist/features/column-filtering/columnFilteringFeature.types.d.ts +3 -3
  71. package/dist/features/column-filtering/columnFilteringFeature.utils.cjs.map +1 -1
  72. package/dist/features/column-filtering/columnFilteringFeature.utils.d.cts +1 -1
  73. package/dist/features/column-filtering/columnFilteringFeature.utils.d.ts +1 -1
  74. package/dist/features/column-filtering/columnFilteringFeature.utils.js.map +1 -1
  75. package/dist/features/column-filtering/createFilteredRowModel.cjs.map +1 -1
  76. package/dist/features/column-filtering/createFilteredRowModel.d.cts +1 -1
  77. package/dist/features/column-filtering/createFilteredRowModel.d.ts +1 -1
  78. package/dist/features/column-filtering/createFilteredRowModel.js.map +1 -1
  79. package/dist/features/column-grouping/columnGroupingFeature.cjs +57 -69
  80. package/dist/features/column-grouping/columnGroupingFeature.cjs.map +1 -1
  81. package/dist/features/column-grouping/columnGroupingFeature.d.cts +4 -15
  82. package/dist/features/column-grouping/columnGroupingFeature.d.ts +4 -15
  83. package/dist/features/column-grouping/columnGroupingFeature.js +58 -69
  84. package/dist/features/column-grouping/columnGroupingFeature.js.map +1 -1
  85. package/dist/features/column-grouping/createGroupedRowModel.cjs.map +1 -1
  86. package/dist/features/column-grouping/createGroupedRowModel.js.map +1 -1
  87. package/dist/features/column-ordering/columnOrderingFeature.cjs +47 -59
  88. package/dist/features/column-ordering/columnOrderingFeature.cjs.map +1 -1
  89. package/dist/features/column-ordering/columnOrderingFeature.d.cts +4 -15
  90. package/dist/features/column-ordering/columnOrderingFeature.d.ts +4 -15
  91. package/dist/features/column-ordering/columnOrderingFeature.js +48 -59
  92. package/dist/features/column-ordering/columnOrderingFeature.js.map +1 -1
  93. package/dist/features/column-pinning/columnPinningFeature.cjs +209 -221
  94. package/dist/features/column-pinning/columnPinningFeature.cjs.map +1 -1
  95. package/dist/features/column-pinning/columnPinningFeature.d.cts +4 -15
  96. package/dist/features/column-pinning/columnPinningFeature.d.ts +4 -15
  97. package/dist/features/column-pinning/columnPinningFeature.js +210 -221
  98. package/dist/features/column-pinning/columnPinningFeature.js.map +1 -1
  99. package/dist/features/column-pinning/columnPinningFeature.utils.cjs.map +1 -1
  100. package/dist/features/column-pinning/columnPinningFeature.utils.d.cts +12 -12
  101. package/dist/features/column-pinning/columnPinningFeature.utils.d.ts +12 -12
  102. package/dist/features/column-pinning/columnPinningFeature.utils.js.map +1 -1
  103. package/dist/features/column-resizing/columnResizingFeature.cjs +31 -43
  104. package/dist/features/column-resizing/columnResizingFeature.cjs.map +1 -1
  105. package/dist/features/column-resizing/columnResizingFeature.d.cts +4 -15
  106. package/dist/features/column-resizing/columnResizingFeature.d.ts +4 -15
  107. package/dist/features/column-resizing/columnResizingFeature.js +32 -43
  108. package/dist/features/column-resizing/columnResizingFeature.js.map +1 -1
  109. package/dist/features/column-sizing/columnSizingFeature.cjs +112 -125
  110. package/dist/features/column-sizing/columnSizingFeature.cjs.map +1 -1
  111. package/dist/features/column-sizing/columnSizingFeature.d.cts +4 -16
  112. package/dist/features/column-sizing/columnSizingFeature.d.ts +4 -16
  113. package/dist/features/column-sizing/columnSizingFeature.js +113 -125
  114. package/dist/features/column-sizing/columnSizingFeature.js.map +1 -1
  115. package/dist/features/column-sizing/columnSizingFeature.utils.d.cts +3 -3
  116. package/dist/features/column-sizing/columnSizingFeature.utils.d.ts +3 -3
  117. package/dist/features/column-visibility/columnVisibilityFeature.cjs +83 -95
  118. package/dist/features/column-visibility/columnVisibilityFeature.cjs.map +1 -1
  119. package/dist/features/column-visibility/columnVisibilityFeature.d.cts +4 -15
  120. package/dist/features/column-visibility/columnVisibilityFeature.d.ts +4 -15
  121. package/dist/features/column-visibility/columnVisibilityFeature.js +84 -95
  122. package/dist/features/column-visibility/columnVisibilityFeature.js.map +1 -1
  123. package/dist/features/global-filtering/globalFilteringFeature.cjs +31 -43
  124. package/dist/features/global-filtering/globalFilteringFeature.cjs.map +1 -1
  125. package/dist/features/global-filtering/globalFilteringFeature.d.cts +4 -15
  126. package/dist/features/global-filtering/globalFilteringFeature.d.ts +4 -15
  127. package/dist/features/global-filtering/globalFilteringFeature.js +32 -43
  128. package/dist/features/global-filtering/globalFilteringFeature.js.map +1 -1
  129. package/dist/features/global-filtering/globalFilteringFeature.utils.cjs.map +1 -1
  130. package/dist/features/global-filtering/globalFilteringFeature.utils.d.cts +4 -2
  131. package/dist/features/global-filtering/globalFilteringFeature.utils.d.ts +4 -2
  132. package/dist/features/global-filtering/globalFilteringFeature.utils.js.map +1 -1
  133. package/dist/features/row-expanding/createExpandedRowModel.cjs.map +1 -1
  134. package/dist/features/row-expanding/createExpandedRowModel.js.map +1 -1
  135. package/dist/features/row-expanding/rowExpandingFeature.cjs +37 -49
  136. package/dist/features/row-expanding/rowExpandingFeature.cjs.map +1 -1
  137. package/dist/features/row-expanding/rowExpandingFeature.d.cts +4 -15
  138. package/dist/features/row-expanding/rowExpandingFeature.d.ts +4 -15
  139. package/dist/features/row-expanding/rowExpandingFeature.js +38 -49
  140. package/dist/features/row-expanding/rowExpandingFeature.js.map +1 -1
  141. package/dist/features/row-pagination/createPaginatedRowModel.cjs.map +1 -1
  142. package/dist/features/row-pagination/createPaginatedRowModel.js.map +1 -1
  143. package/dist/features/row-pagination/rowPaginationFeature.cjs +35 -47
  144. package/dist/features/row-pagination/rowPaginationFeature.cjs.map +1 -1
  145. package/dist/features/row-pagination/rowPaginationFeature.d.cts +4 -15
  146. package/dist/features/row-pagination/rowPaginationFeature.d.ts +4 -15
  147. package/dist/features/row-pagination/rowPaginationFeature.js +36 -47
  148. package/dist/features/row-pagination/rowPaginationFeature.js.map +1 -1
  149. package/dist/features/row-pinning/rowPinningFeature.cjs +55 -67
  150. package/dist/features/row-pinning/rowPinningFeature.cjs.map +1 -1
  151. package/dist/features/row-pinning/rowPinningFeature.d.cts +4 -15
  152. package/dist/features/row-pinning/rowPinningFeature.d.ts +4 -15
  153. package/dist/features/row-pinning/rowPinningFeature.js +56 -67
  154. package/dist/features/row-pinning/rowPinningFeature.js.map +1 -1
  155. package/dist/features/row-selection/rowSelectionFeature.cjs +65 -77
  156. package/dist/features/row-selection/rowSelectionFeature.cjs.map +1 -1
  157. package/dist/features/row-selection/rowSelectionFeature.d.cts +4 -15
  158. package/dist/features/row-selection/rowSelectionFeature.d.ts +4 -15
  159. package/dist/features/row-selection/rowSelectionFeature.js +66 -77
  160. package/dist/features/row-selection/rowSelectionFeature.js.map +1 -1
  161. package/dist/features/row-sorting/createSortedRowModel.cjs.map +1 -1
  162. package/dist/features/row-sorting/createSortedRowModel.js.map +1 -1
  163. package/dist/features/row-sorting/rowSortingFeature.cjs +45 -57
  164. package/dist/features/row-sorting/rowSortingFeature.cjs.map +1 -1
  165. package/dist/features/row-sorting/rowSortingFeature.d.cts +4 -15
  166. package/dist/features/row-sorting/rowSortingFeature.d.ts +4 -15
  167. package/dist/features/row-sorting/rowSortingFeature.js +46 -57
  168. package/dist/features/row-sorting/rowSortingFeature.js.map +1 -1
  169. package/dist/features/row-sorting/rowSortingFeature.utils.cjs +8 -5
  170. package/dist/features/row-sorting/rowSortingFeature.utils.cjs.map +1 -1
  171. package/dist/features/row-sorting/rowSortingFeature.utils.js +8 -5
  172. package/dist/features/row-sorting/rowSortingFeature.utils.js.map +1 -1
  173. package/dist/fns/aggregationFns.cjs +18 -18
  174. package/dist/fns/aggregationFns.cjs.map +1 -1
  175. package/dist/fns/aggregationFns.d.cts +21 -19
  176. package/dist/fns/aggregationFns.d.ts +21 -19
  177. package/dist/fns/aggregationFns.js +18 -18
  178. package/dist/fns/aggregationFns.js.map +1 -1
  179. package/dist/fns/filterFns.cjs +51 -65
  180. package/dist/fns/filterFns.cjs.map +1 -1
  181. package/dist/fns/filterFns.d.cts +82 -28
  182. package/dist/fns/filterFns.d.ts +82 -28
  183. package/dist/fns/filterFns.js +51 -65
  184. package/dist/fns/filterFns.js.map +1 -1
  185. package/dist/fns/sortFns.cjs +18 -6
  186. package/dist/fns/sortFns.cjs.map +1 -1
  187. package/dist/fns/sortFns.d.cts +15 -13
  188. package/dist/fns/sortFns.d.ts +15 -13
  189. package/dist/fns/sortFns.js +18 -6
  190. package/dist/fns/sortFns.js.map +1 -1
  191. package/dist/index.cjs +0 -20
  192. package/dist/index.d.cts +34 -34
  193. package/dist/index.d.ts +34 -34
  194. package/dist/index.js +21 -21
  195. package/dist/types/Cell.d.cts +3 -8
  196. package/dist/types/Cell.d.ts +3 -8
  197. package/dist/types/Column.d.cts +3 -8
  198. package/dist/types/Column.d.ts +3 -8
  199. package/dist/types/ColumnDef.d.cts +3 -8
  200. package/dist/types/ColumnDef.d.ts +3 -8
  201. package/dist/types/Header.d.cts +3 -8
  202. package/dist/types/Header.d.ts +3 -8
  203. package/dist/types/HeaderGroup.d.cts +3 -8
  204. package/dist/types/HeaderGroup.d.ts +3 -8
  205. package/dist/types/Row.d.cts +3 -8
  206. package/dist/types/Row.d.ts +3 -8
  207. package/dist/types/RowModel.d.cts +4 -10
  208. package/dist/types/RowModel.d.ts +4 -10
  209. package/dist/types/RowModelFns.d.cts +3 -8
  210. package/dist/types/RowModelFns.d.ts +3 -8
  211. package/dist/types/Table.d.cts +3 -8
  212. package/dist/types/Table.d.ts +3 -8
  213. package/dist/types/TableFeatures.d.cts +13 -39
  214. package/dist/types/TableFeatures.d.ts +13 -39
  215. package/dist/types/TableOptions.d.cts +3 -4
  216. package/dist/types/TableOptions.d.ts +3 -4
  217. package/dist/types/TableState.d.cts +5 -10
  218. package/dist/types/TableState.d.ts +5 -10
  219. package/dist/utils.cjs.map +1 -1
  220. package/dist/utils.d.cts +1 -1
  221. package/dist/utils.d.ts +1 -1
  222. package/dist/utils.js.map +1 -1
  223. package/package.json +1 -1
  224. package/src/core/cells/coreCellsFeature.ts +17 -39
  225. package/src/core/columns/coreColumnsFeature.ts +56 -83
  226. package/src/core/headers/buildHeaderGroups.ts +1 -1
  227. package/src/core/headers/coreHeadersFeature.ts +42 -64
  228. package/src/core/headers/coreHeadersFeature.utils.ts +1 -1
  229. package/src/core/row-models/coreRowModelsFeature.ts +43 -64
  230. package/src/core/row-models/coreRowModelsFeature.types.ts +2 -6
  231. package/src/core/row-models/createCoreRowModel.ts +1 -1
  232. package/src/core/rows/coreRowsFeature.ts +45 -72
  233. package/src/core/table/constructTable.ts +10 -7
  234. package/src/core/table/coreTablesFeature.ts +13 -35
  235. package/src/core/table/coreTablesFeature.utils.ts +1 -1
  236. package/src/features/column-faceting/columnFacetingFeature.ts +71 -102
  237. package/src/features/column-faceting/createFacetedMinMaxValues.ts +1 -1
  238. package/src/features/column-faceting/createFacetedRowModel.ts +1 -1
  239. package/src/features/column-faceting/createFacetedUniqueValues.ts +1 -1
  240. package/src/features/column-filtering/columnFilteringFeature.ts +60 -103
  241. package/src/features/column-filtering/columnFilteringFeature.types.ts +3 -3
  242. package/src/features/column-filtering/columnFilteringFeature.utils.ts +4 -4
  243. package/src/features/column-filtering/createFilteredRowModel.ts +2 -2
  244. package/src/features/column-grouping/columnGroupingFeature.ts +82 -126
  245. package/src/features/column-grouping/createGroupedRowModel.ts +1 -1
  246. package/src/features/column-ordering/columnOrderingFeature.ts +52 -84
  247. package/src/features/column-pinning/columnPinningFeature.ts +268 -304
  248. package/src/features/column-pinning/columnPinningFeature.utils.ts +5 -5
  249. package/src/features/column-resizing/columnResizingFeature.ts +44 -78
  250. package/src/features/column-sizing/columnSizingFeature.ts +115 -152
  251. package/src/features/column-visibility/columnVisibilityFeature.ts +92 -129
  252. package/src/features/global-filtering/globalFilteringFeature.ts +45 -79
  253. package/src/features/global-filtering/globalFilteringFeature.utils.ts +4 -2
  254. package/src/features/row-expanding/createExpandedRowModel.ts +1 -1
  255. package/src/features/row-expanding/rowExpandingFeature.ts +65 -101
  256. package/src/features/row-pagination/createPaginatedRowModel.ts +1 -1
  257. package/src/features/row-pagination/rowPaginationFeature.ts +69 -103
  258. package/src/features/row-pinning/rowPinningFeature.ts +72 -104
  259. package/src/features/row-selection/rowSelectionFeature.ts +103 -135
  260. package/src/features/row-sorting/createSortedRowModel.ts +1 -1
  261. package/src/features/row-sorting/rowSortingFeature.ts +73 -114
  262. package/src/features/row-sorting/rowSortingFeature.utils.ts +8 -6
  263. package/src/fns/aggregationFns.ts +26 -42
  264. package/src/fns/filterFns.ts +231 -264
  265. package/src/fns/sortFns.ts +51 -29
  266. package/src/types/Cell.ts +3 -19
  267. package/src/types/Column.ts +2 -18
  268. package/src/types/ColumnDef.ts +2 -18
  269. package/src/types/Header.ts +2 -18
  270. package/src/types/HeaderGroup.ts +2 -13
  271. package/src/types/Row.ts +2 -17
  272. package/src/types/RowModel.ts +3 -25
  273. package/src/types/RowModelFns.ts +2 -17
  274. package/src/types/Table.ts +2 -17
  275. package/src/types/TableFeatures.ts +51 -112
  276. package/src/types/TableOptions.ts +1 -12
  277. package/src/types/TableState.ts +4 -30
  278. package/src/utils.ts +5 -4
@@ -1,7 +1,6 @@
1
1
  import type { RowData } from '../types/type-utils'
2
2
  import type { TableFeatures } from '../types/TableFeatures'
3
3
  import type { Row } from '../types/Row'
4
- import type { SortFn } from '../features/row-sorting/rowSortingFeature.types'
5
4
 
6
5
  /**
7
6
  * Regular expression used to split mixed text and numeric chunks.
@@ -16,12 +15,12 @@ export const reSplitAlphaNumeric = /([0-9]+)/gm
16
15
  *
17
16
  * This comparator returns ascending-order results; descending order is applied by the sorting row model.
18
17
  */
19
- export const sortFn_alphanumeric: SortFn<any, any> = <
18
+ export const sortFn_alphanumeric = <
20
19
  TFeatures extends TableFeatures,
21
20
  TData extends RowData,
22
21
  >(
23
- rowA: Row<any, any>,
24
- rowB: Row<any, any>,
22
+ rowA: Row<TFeatures, TData>,
23
+ rowB: Row<TFeatures, TData>,
25
24
  columnId: string,
26
25
  ) => {
27
26
  return compareAlphanumeric(
@@ -35,12 +34,12 @@ export const sortFn_alphanumeric: SortFn<any, any> = <
35
34
  *
36
35
  * This comparator returns ascending-order results; descending order is applied by the sorting row model.
37
36
  */
38
- export const sortFn_alphanumericCaseSensitive: SortFn<any, any> = <
37
+ export const sortFn_alphanumericCaseSensitive = <
39
38
  TFeatures extends TableFeatures,
40
39
  TData extends RowData,
41
40
  >(
42
- rowA: Row<any, any>,
43
- rowB: Row<any, any>,
41
+ rowA: Row<TFeatures, TData>,
42
+ rowB: Row<TFeatures, TData>,
44
43
  columnId: string,
45
44
  ) => {
46
45
  return compareAlphanumeric(
@@ -56,12 +55,12 @@ export const sortFn_alphanumericCaseSensitive: SortFn<any, any> = <
56
55
  *
57
56
  * This comparator returns ascending-order results; descending order is applied by the sorting row model.
58
57
  */
59
- export const sortFn_text: SortFn<any, any> = <
58
+ export const sortFn_text = <
60
59
  TFeatures extends TableFeatures,
61
60
  TData extends RowData,
62
61
  >(
63
- rowA: Row<any, any>,
64
- rowB: Row<any, any>,
62
+ rowA: Row<TFeatures, TData>,
63
+ rowB: Row<TFeatures, TData>,
65
64
  columnId: string,
66
65
  ) => {
67
66
  return compareBasic(
@@ -77,12 +76,12 @@ export const sortFn_text: SortFn<any, any> = <
77
76
  *
78
77
  * This comparator returns ascending-order results; descending order is applied by the sorting row model.
79
78
  */
80
- export const sortFn_textCaseSensitive: SortFn<any, any> = <
79
+ export const sortFn_textCaseSensitive = <
81
80
  TFeatures extends TableFeatures,
82
81
  TData extends RowData,
83
82
  >(
84
- rowA: Row<any, any>,
85
- rowB: Row<any, any>,
83
+ rowA: Row<TFeatures, TData>,
84
+ rowB: Row<TFeatures, TData>,
86
85
  columnId: string,
87
86
  ) => {
88
87
  return compareBasic(
@@ -96,12 +95,12 @@ export const sortFn_textCaseSensitive: SortFn<any, any> = <
96
95
  *
97
96
  * This comparator returns ascending-order results; descending order is applied by the sorting row model.
98
97
  */
99
- export const sortFn_datetime: SortFn<any, any> = <
98
+ export const sortFn_datetime = <
100
99
  TFeatures extends TableFeatures,
101
100
  TData extends RowData,
102
101
  >(
103
- rowA: Row<any, any>,
104
- rowB: Row<any, any>,
102
+ rowA: Row<TFeatures, TData>,
103
+ rowB: Row<TFeatures, TData>,
105
104
  columnId: string,
106
105
  ) => {
107
106
  const a: number | string = rowA.getValue(columnId)
@@ -118,12 +117,12 @@ export const sortFn_datetime: SortFn<any, any> = <
118
117
  *
119
118
  * This comparator returns ascending-order results; descending order is applied by the sorting row model.
120
119
  */
121
- export const sortFn_basic: SortFn<any, any> = <
120
+ export const sortFn_basic = <
122
121
  TFeatures extends TableFeatures,
123
122
  TData extends RowData,
124
123
  >(
125
- rowA: Row<any, any>,
126
- rowB: Row<any, any>,
124
+ rowA: Row<TFeatures, TData>,
125
+ rowB: Row<TFeatures, TData>,
127
126
  columnId: string,
128
127
  ) => {
129
128
  return compareBasic(rowA.getValue(columnId), rowB.getValue(columnId))
@@ -152,10 +151,8 @@ function toString(a: any) {
152
151
  // It handles numbers, mixed alphanumeric combinations, and even
153
152
  // null, undefined, and Infinity
154
153
  function compareAlphanumeric(aStr: string, bStr: string) {
155
- // Split on number groups, but keep the delimiter
156
- // Then remove falsey split values
157
- const a = aStr.split(reSplitAlphaNumeric).filter(Boolean)
158
- const b = bStr.split(reSplitAlphaNumeric).filter(Boolean)
154
+ const a = aStr.split(reSplitAlphaNumeric)
155
+ const b = bStr.split(reSplitAlphaNumeric)
159
156
 
160
157
  let ai = 0
161
158
  let bi = 0
@@ -163,16 +160,29 @@ function compareAlphanumeric(aStr: string, bStr: string) {
163
160
  const bLen = b.length
164
161
 
165
162
  while (ai < aLen && bi < bLen) {
163
+ // Skip the empty boundary chunks that .filter(Boolean) used to remove
164
+ if (!a[ai]) {
165
+ ai++
166
+ continue
167
+ }
168
+ if (!b[bi]) {
169
+ bi++
170
+ continue
171
+ }
172
+
166
173
  const aa = a[ai++]!
167
174
  const bb = b[bi++]!
168
175
 
176
+ // Chunks are either all-digit (parseInt always succeeds) or digit-free
177
+ // (parseInt is always NaN), so NaN-ness fully classifies each chunk
169
178
  const an = parseInt(aa, 10)
170
179
  const bn = parseInt(bb, 10)
171
180
 
172
- const combo = [an, bn].sort()
181
+ const aIsNaN = isNaN(an)
182
+ const bIsNaN = isNaN(bn)
173
183
 
174
184
  // Both are string
175
- if (isNaN(combo[0]!)) {
185
+ if (aIsNaN && bIsNaN) {
176
186
  if (aa > bb) {
177
187
  return 1
178
188
  }
@@ -182,9 +192,9 @@ function compareAlphanumeric(aStr: string, bStr: string) {
182
192
  continue
183
193
  }
184
194
 
185
- // One is a string, one is a number
186
- if (isNaN(combo[1]!)) {
187
- return isNaN(an) ? -1 : 1
195
+ // One is a string, one is a number — the string chunk sorts first
196
+ if (aIsNaN || bIsNaN) {
197
+ return aIsNaN ? -1 : 1
188
198
  }
189
199
 
190
200
  // Both are numbers
@@ -196,7 +206,19 @@ function compareAlphanumeric(aStr: string, bStr: string) {
196
206
  }
197
207
  }
198
208
 
199
- return aLen - ai - (bLen - bi)
209
+ // One side is exhausted compare the counts of remaining non-empty chunks
210
+ let remaining = 0
211
+ for (; ai < aLen; ai++) {
212
+ if (a[ai]) {
213
+ remaining++
214
+ }
215
+ }
216
+ for (; bi < bLen; bi++) {
217
+ if (b[bi]) {
218
+ remaining--
219
+ }
220
+ }
221
+ return remaining
200
222
  }
201
223
 
202
224
  // Exports
package/src/types/Cell.ts CHANGED
@@ -1,22 +1,8 @@
1
1
  import type { Cell_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
2
2
  import type { CellData, RowData } from './type-utils'
3
- import type {
4
- ExtractFeatureMapTypes,
5
- ExtractFeatureTypes,
6
- TableFeatures,
7
- } from './TableFeatures'
3
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
8
4
  import type { Cell_Cell } from '../core/cells/coreCellsFeature.types'
9
5
 
10
- /**
11
- * Use this interface as a target for declaration merging to add your own plugin properties.
12
- * Note: This will affect the types of all tables in your project.
13
- */
14
- export interface Cell_Plugins<
15
- TFeatures extends TableFeatures,
16
- TData extends RowData,
17
- TValue extends CellData = CellData,
18
- > {}
19
-
20
6
  export interface Cell_Core<
21
7
  TFeatures extends TableFeatures,
22
8
  TData extends RowData,
@@ -31,7 +17,5 @@ export type Cell<
31
17
  TFeatures extends TableFeatures,
32
18
  TData extends RowData,
33
19
  TValue extends CellData = CellData,
34
- > = Cell_Cell<TFeatures, TData, TValue> &
35
- ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap> &
36
- ExtractFeatureTypes<'Cell', TFeatures> &
37
- Cell_Plugins<TFeatures, TData, TValue>
20
+ > = Cell_Core<TFeatures, TData, TValue> &
21
+ ExtractFeatureMapTypes<TFeatures, Cell_FeatureMap>
@@ -10,23 +10,9 @@ import type { Column_ColumnSizing } from '../features/column-sizing/columnSizing
10
10
  import type { Column_ColumnVisibility } from '../features/column-visibility/columnVisibilityFeature.types'
11
11
  import type { ColumnDefBase_All } from './ColumnDef'
12
12
  import type { RowData } from './type-utils'
13
- import type {
14
- ExtractFeatureMapTypes,
15
- ExtractFeatureTypes,
16
- TableFeatures,
17
- } from './TableFeatures'
13
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
18
14
  import type { Column_Column } from '../core/columns/coreColumnsFeature.types'
19
15
 
20
- /**
21
- * Use this interface as a target for declaration merging to add your own plugin properties.
22
- * Note: This will affect the types of all tables in your project.
23
- */
24
- export interface Column_Plugins<
25
- TFeatures extends TableFeatures,
26
- TData extends RowData,
27
- TValue = unknown,
28
- > {}
29
-
30
16
  export interface Column_Core<
31
17
  TFeatures extends TableFeatures,
32
18
  TData extends RowData,
@@ -54,9 +40,7 @@ export type Column<
54
40
  TData extends RowData,
55
41
  TValue = unknown,
56
42
  > = Column_Core<TFeatures, TData, TValue> &
57
- ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>> &
58
- ExtractFeatureTypes<'Column', TFeatures> &
59
- Column_Plugins<TFeatures, TData, TValue>
43
+ ExtractFeatureMapTypes<TFeatures, Column_FeatureMap<TFeatures, TData>>
60
44
 
61
45
  export type Column_Internal<
62
46
  TFeatures extends TableFeatures,
@@ -1,9 +1,5 @@
1
1
  import type { CellData, RowData, UnionToIntersection } from './type-utils'
2
- import type {
3
- ExtractFeatureMapTypes,
4
- ExtractFeatureTypes,
5
- TableFeatures,
6
- } from './TableFeatures'
2
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
7
3
  import type { CellContext } from '../core/cells/coreCellsFeature.types'
8
4
  import type { HeaderContext } from '../core/headers/coreHeadersFeature.types'
9
5
  import type { ColumnDef_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
@@ -15,16 +11,6 @@ import type { ColumnDef_ColumnVisibility } from '../features/column-visibility/c
15
11
  import type { ColumnDef_GlobalFiltering } from '../features/global-filtering/globalFilteringFeature.types'
16
12
  import type { ColumnDef_RowSorting } from '../features/row-sorting/rowSortingFeature.types'
17
13
 
18
- /**
19
- * Use this interface as a target for declaration merging to add your own plugin properties.
20
- * Note: This will affect the types of all tables in your project.
21
- */
22
- export interface ColumnDef_Plugins<
23
- TFeatures extends TableFeatures,
24
- TData extends RowData,
25
- TValue extends CellData = CellData,
26
- > {}
27
-
28
14
  export interface ColumnMeta<
29
15
  TFeatures extends TableFeatures,
30
16
  TData extends RowData,
@@ -137,9 +123,7 @@ export type ColumnDefBase<
137
123
  ExtractFeatureMapTypes<
138
124
  TFeatures,
139
125
  ColumnDef_FeatureMap<TFeatures, TData, TValue>
140
- > &
141
- ExtractFeatureTypes<'ColumnDef', TFeatures> &
142
- ColumnDef_Plugins<TFeatures, TData, TValue>
126
+ >
143
127
 
144
128
  export type ColumnDefBase_All<
145
129
  TFeatures extends TableFeatures,
@@ -1,23 +1,9 @@
1
1
  import type { Header_ColumnSizing } from '../features/column-sizing/columnSizingFeature.types'
2
2
  import type { CellData, RowData } from './type-utils'
3
- import type {
4
- ExtractFeatureMapTypes,
5
- ExtractFeatureTypes,
6
- TableFeatures,
7
- } from './TableFeatures'
3
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
8
4
  import type { Header_Header } from '../core/headers/coreHeadersFeature.types'
9
5
  import type { Header_ColumnResizing } from '../features/column-resizing/columnResizingFeature.types'
10
6
 
11
- /**
12
- * Use this interface as a target for declaration merging to add your own plugin properties.
13
- * Note: This will affect the types of all tables in your project.
14
- */
15
- export interface Header_Plugins<
16
- TFeatures extends TableFeatures,
17
- TData extends RowData,
18
- TValue extends CellData = CellData,
19
- > {}
20
-
21
7
  export interface Header_Core<
22
8
  TFeatures extends TableFeatures,
23
9
  TData extends RowData,
@@ -34,6 +20,4 @@ export type Header<
34
20
  TData extends RowData,
35
21
  TValue extends CellData = CellData,
36
22
  > = Header_Core<TFeatures, TData, TValue> &
37
- ExtractFeatureMapTypes<TFeatures, Header_FeatureMap> &
38
- ExtractFeatureTypes<'Header', TFeatures> &
39
- Header_Plugins<TFeatures, TData, TValue>
23
+ ExtractFeatureMapTypes<TFeatures, Header_FeatureMap>
@@ -1,16 +1,7 @@
1
1
  import type { HeaderGroup_Header } from '../core/headers/coreHeadersFeature.types'
2
- import type { ExtractFeatureTypes, TableFeatures } from './TableFeatures'
2
+ import type { TableFeatures } from './TableFeatures'
3
3
  import type { RowData } from './type-utils'
4
4
 
5
- /**
6
- * Use this interface as a target for declaration merging to add your own plugin properties.
7
- * Note: This will affect the types of all tables in your project.
8
- */
9
- export interface HeaderGroup_Plugins<
10
- TFeatures extends TableFeatures,
11
- TData extends RowData,
12
- > {}
13
-
14
5
  export interface HeaderGroup_Core<
15
6
  TFeatures extends TableFeatures,
16
7
  TData extends RowData,
@@ -19,6 +10,4 @@ export interface HeaderGroup_Core<
19
10
  export type HeaderGroup<
20
11
  TFeatures extends TableFeatures,
21
12
  TData extends RowData,
22
- > = HeaderGroup_Core<TFeatures, TData> &
23
- ExtractFeatureTypes<'HeaderGroup', TFeatures> &
24
- HeaderGroup_Plugins<TFeatures, TData>
13
+ > = HeaderGroup_Core<TFeatures, TData>
package/src/types/Row.ts CHANGED
@@ -6,22 +6,9 @@ import type { RowData } from './type-utils'
6
6
  import type { Row_RowExpanding } from '../features/row-expanding/rowExpandingFeature.types'
7
7
  import type { Row_RowPinning } from '../features/row-pinning/rowPinningFeature.types'
8
8
  import type { Row_RowSelection } from '../features/row-selection/rowSelectionFeature.types'
9
- import type {
10
- ExtractFeatureMapTypes,
11
- ExtractFeatureTypes,
12
- TableFeatures,
13
- } from './TableFeatures'
9
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
14
10
  import type { Row_Row } from '../core/rows/coreRowsFeature.types'
15
11
 
16
- /**
17
- * Use this interface as a target for declaration merging to add your own plugin properties.
18
- * Note: This will affect the types of all tables in your project.
19
- */
20
- export interface Row_Plugins<
21
- TFeatures extends TableFeatures,
22
- TData extends RowData,
23
- > {}
24
-
25
12
  export interface Row_Core<
26
13
  TFeatures extends TableFeatures,
27
14
  TData extends RowData,
@@ -44,6 +31,4 @@ export type Row<
44
31
  TFeatures extends TableFeatures,
45
32
  TData extends RowData,
46
33
  > = Row_Core<TFeatures, TData> &
47
- ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>> &
48
- ExtractFeatureTypes<'Row', TFeatures> &
49
- Row_Plugins<TFeatures, TData>
34
+ ExtractFeatureMapTypes<TFeatures, Row_FeatureMap<TFeatures, TData>>
@@ -28,20 +28,7 @@ import type {
28
28
  CreateRowModel_Sorted,
29
29
  } from '../features/row-sorting/rowSortingFeature.types'
30
30
  import type { RowData } from './type-utils'
31
- import type {
32
- ExtractFeatureMapTypes,
33
- ExtractFeatureTypes,
34
- TableFeatures,
35
- } from './TableFeatures'
36
-
37
- /**
38
- * Use this interface as a target for declaration merging to add your own plugin properties.
39
- * Note: This will affect the types of all tables in your project.
40
- */
41
- export interface CreateRowModels_Plugins<
42
- TFeatures extends TableFeatures,
43
- TData extends RowData,
44
- > {}
31
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
45
32
 
46
33
  export interface CreateRowModels_FeatureMap<
47
34
  TFeatures extends TableFeatures,
@@ -62,9 +49,7 @@ export type CreateRowModels<
62
49
  ExtractFeatureMapTypes<
63
50
  TFeatures,
64
51
  CreateRowModels_FeatureMap<TFeatures, TData>
65
- > &
66
- ExtractFeatureTypes<'CreateRowModels', TFeatures> &
67
- CreateRowModels_Plugins<TFeatures, TData>
52
+ >
68
53
 
69
54
  export type CreateRowModels_All<
70
55
  TFeatures extends TableFeatures,
@@ -77,11 +62,6 @@ export type CreateRowModels_All<
77
62
  CreateRowModel_Paginated<TFeatures, TData> &
78
63
  CreateRowModel_Sorted<TFeatures, TData>
79
64
 
80
- export interface CachedRowModels_Plugins<
81
- TFeatures extends TableFeatures,
82
- TData extends RowData,
83
- > {}
84
-
85
65
  export interface CachedRowModels_FeatureMap<
86
66
  TFeatures extends TableFeatures,
87
67
  TData extends RowData,
@@ -102,9 +82,7 @@ export type CachedRowModels<
102
82
  } & ExtractFeatureMapTypes<
103
83
  TFeatures,
104
84
  CachedRowModels_FeatureMap<TFeatures, TData>
105
- > &
106
- ExtractFeatureTypes<'CachedRowModel', TFeatures> &
107
- CachedRowModels_Plugins<TFeatures, TData>
85
+ >
108
86
 
109
87
  export type CachedRowModel_All<
110
88
  TFeatures extends TableFeatures,
@@ -2,20 +2,7 @@ import type { RowModelFns_RowSorting } from '../features/row-sorting/rowSortingF
2
2
  import type { RowModelFns_ColumnGrouping } from '../features/column-grouping/columnGroupingFeature.types'
3
3
  import type { RowData } from './type-utils'
4
4
  import type { RowModelFns_ColumnFiltering } from '../features/column-filtering/columnFilteringFeature.types'
5
- import type {
6
- ExtractFeatureMapTypes,
7
- ExtractFeatureTypes,
8
- TableFeatures,
9
- } from './TableFeatures'
10
-
11
- /**
12
- * Use this interface as a target for declaration merging to add your own plugin properties.
13
- * Note: This will affect the types of all tables in your project.
14
- */
15
- export interface RowModelFns_Plugins<
16
- TFeatures extends TableFeatures,
17
- TData extends RowData,
18
- > {}
5
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
19
6
 
20
7
  export interface RowModelFns_Core {}
21
8
 
@@ -32,9 +19,7 @@ export type RowModelFns<
32
19
  TFeatures extends TableFeatures,
33
20
  TData extends RowData,
34
21
  > = Partial<
35
- ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>> &
36
- ExtractFeatureTypes<'RowModelFns', TFeatures> &
37
- RowModelFns_Plugins<TFeatures, TData>
22
+ ExtractFeatureMapTypes<TFeatures, RowModelFns_FeatureMap<TFeatures, TData>>
38
23
  >
39
24
 
40
25
  export type RowModelFns_All<
@@ -18,11 +18,7 @@ import type { CachedRowModel_All, CreateRowModels_All } from './RowModel'
18
18
  import type { RowModelFns_All } from './RowModelFns'
19
19
  import type { TableState_All } from './TableState'
20
20
  import type { RowData } from './type-utils'
21
- import type {
22
- ExtractFeatureMapTypes,
23
- ExtractFeatureTypes,
24
- TableFeatures,
25
- } from './TableFeatures'
21
+ import type { ExtractFeatureMapTypes, TableFeatures } from './TableFeatures'
26
22
  import type { Table_Columns } from '../core/columns/coreColumnsFeature.types'
27
23
  import type { Table_Headers } from '../core/headers/coreHeadersFeature.types'
28
24
  import type { Table_Rows } from '../core/rows/coreRowsFeature.types'
@@ -34,15 +30,6 @@ import type {
34
30
  } from '../core/table/coreTablesFeature.types'
35
31
  import type { TableOptions_All } from './TableOptions'
36
32
 
37
- /**
38
- * Use this interface as a target for declaration merging to add your own plugin properties.
39
- * Note: This will affect the types of all tables in your project.
40
- */
41
- export interface Table_Plugins<
42
- TFeatures extends TableFeatures,
43
- TData extends RowData,
44
- > {}
45
-
46
33
  /**
47
34
  * The core table object that only includes the core table functionality such as column, header, row, and table APIS.
48
35
  * No features are included.
@@ -83,9 +70,7 @@ export type Table<
83
70
  TFeatures extends TableFeatures,
84
71
  TData extends RowData,
85
72
  > = Table_Core<TFeatures, TData> &
86
- ExtractFeatureMapTypes<TFeatures, Table_FeatureMap<TFeatures, TData>> &
87
- ExtractFeatureTypes<'Table', TFeatures> &
88
- Table_Plugins<TFeatures, TData>
73
+ ExtractFeatureMapTypes<TFeatures, Table_FeatureMap<TFeatures, TData>>
89
74
 
90
75
  export type Table_Internal<
91
76
  TFeatures extends TableFeatures,