@tanstack/table-core 8.0.12 → 8.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/build/cjs/core/cell.js +13 -13
  2. package/build/cjs/core/cell.js.map +1 -1
  3. package/build/cjs/core/column.js +20 -21
  4. package/build/cjs/core/column.js.map +1 -1
  5. package/build/cjs/core/headers.js +63 -68
  6. package/build/cjs/core/headers.js.map +1 -1
  7. package/build/cjs/core/row.js +16 -11
  8. package/build/cjs/core/row.js.map +1 -1
  9. package/build/cjs/core/{instance.js → table.js} +46 -57
  10. package/build/cjs/core/table.js.map +1 -0
  11. package/build/cjs/features/ColumnSizing.js +36 -36
  12. package/build/cjs/features/ColumnSizing.js.map +1 -1
  13. package/build/cjs/features/Expanding.js +34 -34
  14. package/build/cjs/features/Expanding.js.map +1 -1
  15. package/build/cjs/features/Filters.js +46 -52
  16. package/build/cjs/features/Filters.js.map +1 -1
  17. package/build/cjs/features/Grouping.js +24 -49
  18. package/build/cjs/features/Grouping.js.map +1 -1
  19. package/build/cjs/features/Ordering.js +8 -8
  20. package/build/cjs/features/Ordering.js.map +1 -1
  21. package/build/cjs/features/Pagination.js +37 -37
  22. package/build/cjs/features/Pagination.js.map +1 -1
  23. package/build/cjs/features/Pinning.js +33 -33
  24. package/build/cjs/features/Pinning.js.map +1 -1
  25. package/build/cjs/features/RowSelection.js +86 -74
  26. package/build/cjs/features/RowSelection.js.map +1 -1
  27. package/build/cjs/features/Sorting.js +36 -40
  28. package/build/cjs/features/Sorting.js.map +1 -1
  29. package/build/cjs/features/Visibility.js +30 -30
  30. package/build/cjs/features/Visibility.js.map +1 -1
  31. package/build/cjs/index.js +3 -4
  32. package/build/cjs/index.js.map +1 -1
  33. package/build/cjs/utils/filterRowsUtils.js +8 -8
  34. package/build/cjs/utils/filterRowsUtils.js.map +1 -1
  35. package/build/cjs/utils/getCoreRowModel.js +8 -8
  36. package/build/cjs/utils/getCoreRowModel.js.map +1 -1
  37. package/build/cjs/utils/getExpandedRowModel.js +4 -4
  38. package/build/cjs/utils/getExpandedRowModel.js.map +1 -1
  39. package/build/cjs/utils/getFacetedMinMaxValues.js +3 -3
  40. package/build/cjs/utils/getFacetedMinMaxValues.js.map +1 -1
  41. package/build/cjs/utils/getFacetedRowModel.js +4 -4
  42. package/build/cjs/utils/getFacetedRowModel.js.map +1 -1
  43. package/build/cjs/utils/getFacetedUniqueValues.js +3 -3
  44. package/build/cjs/utils/getFacetedUniqueValues.js.map +1 -1
  45. package/build/cjs/utils/getFilteredRowModel.js +8 -8
  46. package/build/cjs/utils/getFilteredRowModel.js.map +1 -1
  47. package/build/cjs/utils/getGroupedRowModel.js +9 -9
  48. package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
  49. package/build/cjs/utils/getPaginationRowModel.js +4 -4
  50. package/build/cjs/utils/getPaginationRowModel.js.map +1 -1
  51. package/build/cjs/utils/getSortedRowModel.js +7 -7
  52. package/build/cjs/utils/getSortedRowModel.js.map +1 -1
  53. package/build/cjs/utils.js +2 -2
  54. package/build/cjs/utils.js.map +1 -1
  55. package/build/esm/index.js +585 -677
  56. package/build/esm/index.js.map +1 -1
  57. package/build/stats-html.html +1 -1
  58. package/build/stats-react.json +352 -377
  59. package/build/types/index.d.ts +761 -29
  60. package/build/umd/index.development.js +586 -678
  61. package/build/umd/index.development.js.map +1 -1
  62. package/build/umd/index.production.js +1 -1
  63. package/build/umd/index.production.js.map +1 -1
  64. package/package.json +1 -1
  65. package/src/core/cell.ts +34 -28
  66. package/src/core/column.ts +83 -72
  67. package/src/core/headers.ts +118 -149
  68. package/src/core/row.ts +31 -25
  69. package/src/core/{instance.ts → table.ts} +85 -116
  70. package/src/features/ColumnSizing.ts +45 -47
  71. package/src/features/Expanding.ts +53 -59
  72. package/src/features/Filters.ts +112 -132
  73. package/src/features/Grouping.ts +63 -112
  74. package/src/features/Ordering.ts +19 -21
  75. package/src/features/Pagination.ts +54 -55
  76. package/src/features/Pinning.ts +49 -61
  77. package/src/features/RowSelection.ts +115 -114
  78. package/src/features/Sorting.ts +57 -72
  79. package/src/features/Visibility.ts +48 -48
  80. package/src/index.ts +1 -2
  81. package/src/types.ts +64 -69
  82. package/src/utils/filterRowsUtils.ts +33 -28
  83. package/src/utils/getCoreRowModel.ts +22 -22
  84. package/src/utils/getExpandedRowModel.ts +15 -15
  85. package/src/utils/getFacetedMinMaxValues.ts +6 -6
  86. package/src/utils/getFacetedRowModel.ts +12 -12
  87. package/src/utils/getFacetedUniqueValues.ts +6 -6
  88. package/src/utils/getFilteredRowModel.ts +17 -17
  89. package/src/utils/getGroupedRowModel.ts +18 -21
  90. package/src/utils/getPaginationRowModel.ts +10 -13
  91. package/src/utils/getSortedRowModel.ts +14 -14
  92. package/src/utils.ts +8 -2
  93. package/build/cjs/core/instance.js.map +0 -1
  94. package/build/cjs/createTable.js +0 -72
  95. package/build/cjs/createTable.js.map +0 -1
  96. package/build/types/aggregationFns.d.ts +0 -13
  97. package/build/types/core/cell.d.ts +0 -9
  98. package/build/types/core/column.d.ts +0 -40
  99. package/build/types/core/headers.d.ts +0 -46
  100. package/build/types/core/instance.d.ts +0 -58
  101. package/build/types/core/row.d.ts +0 -15
  102. package/build/types/createTable.d.ts +0 -63
  103. package/build/types/features/ColumnSizing.d.ts +0 -63
  104. package/build/types/features/Expanding.d.ts +0 -39
  105. package/build/types/features/Filters.d.ts +0 -90
  106. package/build/types/features/Grouping.d.ts +0 -68
  107. package/build/types/features/Ordering.d.ts +0 -18
  108. package/build/types/features/Pagination.d.ts +0 -42
  109. package/build/types/features/Pinning.d.ts +0 -40
  110. package/build/types/features/RowSelection.d.ts +0 -40
  111. package/build/types/features/Sorting.d.ts +0 -63
  112. package/build/types/features/Visibility.d.ts +0 -40
  113. package/build/types/filterFns.d.ts +0 -13
  114. package/build/types/sortingFns.d.ts +0 -11
  115. package/build/types/types.d.ts +0 -53
  116. package/build/types/utils/filterRowsUtils.d.ts +0 -4
  117. package/build/types/utils/getCoreRowModel.d.ts +0 -2
  118. package/build/types/utils/getExpandedRowModel.d.ts +0 -7
  119. package/build/types/utils/getFacetedMinMaxValues.d.ts +0 -2
  120. package/build/types/utils/getFacetedRowModel.d.ts +0 -2
  121. package/build/types/utils/getFacetedUniqueValues.d.ts +0 -2
  122. package/build/types/utils/getFilteredRowModel.d.ts +0 -2
  123. package/build/types/utils/getGroupedRowModel.d.ts +0 -2
  124. package/build/types/utils/getPaginationRowModel.d.ts +0 -4
  125. package/build/types/utils/getSortedRowModel.d.ts +0 -2
  126. package/build/types/utils.d.ts +0 -19
  127. package/src/createTable.ts +0 -188
@@ -19,9 +19,9 @@
19
19
  }
20
20
  function noop() {//
21
21
  }
22
- function makeStateUpdater(key, instance) {
22
+ function makeStateUpdater(key, table) {
23
23
  return updater => {
24
- instance.setState(old => {
24
+ table.setState(old => {
25
25
  return { ...old,
26
26
  [key]: functionalUpdate(updater, old[key])
27
27
  };
@@ -91,36 +91,35 @@
91
91
  };
92
92
  }
93
93
 
94
- function createColumn(instance, columnDef, depth, parent) {
95
- var _ref, _columnDef$id;
94
+ function createColumn(table, columnDef, depth, parent) {
95
+ var _ref, _resolvedColumnDef$id;
96
96
 
97
- const defaultColumn = instance._getDefaultColumnDef();
97
+ const defaultColumn = table._getDefaultColumnDef();
98
98
 
99
- columnDef = { ...defaultColumn,
99
+ const resolvedColumnDef = { ...defaultColumn,
100
100
  ...columnDef
101
101
  };
102
- let id = (_ref = (_columnDef$id = columnDef.id) != null ? _columnDef$id : columnDef.accessorKey) != null ? _ref : typeof columnDef.header === 'string' ? columnDef.header : undefined;
102
+ let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : resolvedColumnDef.accessorKey) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
103
103
  let accessorFn;
104
104
 
105
- if (columnDef.accessorFn) {
106
- accessorFn = columnDef.accessorFn;
107
- } else if (columnDef.accessorKey) {
108
- accessorFn = originalRow => originalRow[columnDef.accessorKey];
105
+ if (resolvedColumnDef.accessorFn) {
106
+ accessorFn = resolvedColumnDef.accessorFn;
107
+ } else if (resolvedColumnDef.accessorKey) {
108
+ accessorFn = originalRow => originalRow[resolvedColumnDef.accessorKey];
109
109
  }
110
110
 
111
111
  if (!id) {
112
112
  {
113
- throw new Error(columnDef.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header");
113
+ throw new Error(resolvedColumnDef.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header");
114
114
  }
115
115
  }
116
116
 
117
117
  let column = {
118
- id: "" + id,
118
+ id: "" + String(id),
119
119
  accessorFn,
120
120
  parent: parent,
121
121
  depth,
122
- columnDef,
123
- columnDefType: columnDef.columnDefType,
122
+ columnDef: resolvedColumnDef,
124
123
  columns: [],
125
124
  getFlatColumns: memo(() => [true], () => {
126
125
  var _column$columns;
@@ -129,12 +128,12 @@
129
128
  }, {
130
129
  key: "development" === 'production' ,
131
130
  debug: () => {
132
- var _instance$options$deb;
131
+ var _table$options$debugA;
133
132
 
134
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
133
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
135
134
  }
136
135
  }),
137
- getLeafColumns: memo(() => [instance._getOrderColumnsFn()], orderColumns => {
136
+ getLeafColumns: memo(() => [table._getOrderColumnsFn()], orderColumns => {
138
137
  var _column$columns2;
139
138
 
140
139
  if ((_column$columns2 = column.columns) != null && _column$columns2.length) {
@@ -146,21 +145,21 @@
146
145
  }, {
147
146
  key: "development" === 'production' ,
148
147
  debug: () => {
149
- var _instance$options$deb2;
148
+ var _table$options$debugA2;
150
149
 
151
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugColumns;
150
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
152
151
  }
153
152
  })
154
153
  };
155
- column = instance._features.reduce((obj, feature) => {
156
- return Object.assign(obj, feature.createColumn == null ? void 0 : feature.createColumn(column, instance));
157
- }, column); // Yes, we have to convert instance to uknown, because we know more than the compiler here.
154
+ column = table._features.reduce((obj, feature) => {
155
+ return Object.assign(obj, feature.createColumn == null ? void 0 : feature.createColumn(column, table));
156
+ }, column); // Yes, we have to convert table to uknown, because we know more than the compiler here.
158
157
 
159
158
  return column;
160
159
  }
161
160
 
162
161
  //
163
- function createHeader(instance, column, options) {
162
+ function createHeader(table, column, options) {
164
163
  var _options$id;
165
164
 
166
165
  const id = (_options$id = options.id) != null ? _options$id : column.id;
@@ -189,174 +188,169 @@
189
188
  recurseHeader(header);
190
189
  return leafHeaders;
191
190
  },
192
- renderHeader: () => column.columnDef.header ? instance._render(column.columnDef.header, {
193
- instance,
191
+ getContext: () => ({
192
+ table,
194
193
  header: header,
195
194
  column
196
- }) : null,
197
- renderFooter: () => column.columnDef.footer ? instance._render(column.columnDef.footer, {
198
- instance,
199
- header: header,
200
- column
201
- }) : null
195
+ })
202
196
  };
203
197
 
204
- instance._features.forEach(feature => {
205
- Object.assign(header, feature.createHeader == null ? void 0 : feature.createHeader(header, instance));
198
+ table._features.forEach(feature => {
199
+ Object.assign(header, feature.createHeader == null ? void 0 : feature.createHeader(header, table));
206
200
  });
207
201
 
208
202
  return header;
209
203
  }
210
204
 
211
205
  const Headers = {
212
- createInstance: instance => {
206
+ createTable: table => {
213
207
  return {
214
208
  // Header Groups
215
- getHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.left, instance.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
209
+ getHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
216
210
  var _left$map$filter, _right$map$filter;
217
211
 
218
212
  const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
219
213
  const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
220
214
  const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
221
- const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], instance);
215
+ const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
222
216
  return headerGroups;
223
217
  }, {
224
218
  key: 'getHeaderGroups',
225
219
  debug: () => {
226
- var _instance$options$deb;
220
+ var _table$options$debugA;
227
221
 
228
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugHeaders;
222
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
229
223
  }
230
224
  }),
231
- getCenterHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.left, instance.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
225
+ getCenterHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
232
226
  leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
233
- return buildHeaderGroups(allColumns, leafColumns, instance, 'center');
227
+ return buildHeaderGroups(allColumns, leafColumns, table, 'center');
234
228
  }, {
235
229
  key: 'getCenterHeaderGroups',
236
230
  debug: () => {
237
- var _instance$options$deb2;
231
+ var _table$options$debugA2;
238
232
 
239
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugHeaders;
233
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
240
234
  }
241
235
  }),
242
- getLeftHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.left], (allColumns, leafColumns, left) => {
236
+ getLeftHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
243
237
  var _left$map$filter2;
244
238
 
245
239
  const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
246
- return buildHeaderGroups(allColumns, orderedLeafColumns, instance, 'left');
240
+ return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
247
241
  }, {
248
242
  key: 'getLeftHeaderGroups',
249
243
  debug: () => {
250
- var _instance$options$deb3;
244
+ var _table$options$debugA3;
251
245
 
252
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugHeaders;
246
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
253
247
  }
254
248
  }),
255
- getRightHeaderGroups: memo(() => [instance.getAllColumns(), instance.getVisibleLeafColumns(), instance.getState().columnPinning.right], (allColumns, leafColumns, right) => {
249
+ getRightHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
256
250
  var _right$map$filter2;
257
251
 
258
252
  const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
259
- return buildHeaderGroups(allColumns, orderedLeafColumns, instance, 'right');
253
+ return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
260
254
  }, {
261
255
  key: 'getRightHeaderGroups',
262
256
  debug: () => {
263
- var _instance$options$deb4;
257
+ var _table$options$debugA4;
264
258
 
265
- return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugHeaders;
259
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
266
260
  }
267
261
  }),
268
262
  // Footer Groups
269
- getFooterGroups: memo(() => [instance.getHeaderGroups()], headerGroups => {
263
+ getFooterGroups: memo(() => [table.getHeaderGroups()], headerGroups => {
270
264
  return [...headerGroups].reverse();
271
265
  }, {
272
266
  key: 'getFooterGroups',
273
267
  debug: () => {
274
- var _instance$options$deb5;
268
+ var _table$options$debugA5;
275
269
 
276
- return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugHeaders;
270
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
277
271
  }
278
272
  }),
279
- getLeftFooterGroups: memo(() => [instance.getLeftHeaderGroups()], headerGroups => {
273
+ getLeftFooterGroups: memo(() => [table.getLeftHeaderGroups()], headerGroups => {
280
274
  return [...headerGroups].reverse();
281
275
  }, {
282
276
  key: 'getLeftFooterGroups',
283
277
  debug: () => {
284
- var _instance$options$deb6;
278
+ var _table$options$debugA6;
285
279
 
286
- return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugHeaders;
280
+ return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
287
281
  }
288
282
  }),
289
- getCenterFooterGroups: memo(() => [instance.getCenterHeaderGroups()], headerGroups => {
283
+ getCenterFooterGroups: memo(() => [table.getCenterHeaderGroups()], headerGroups => {
290
284
  return [...headerGroups].reverse();
291
285
  }, {
292
286
  key: 'getCenterFooterGroups',
293
287
  debug: () => {
294
- var _instance$options$deb7;
288
+ var _table$options$debugA7;
295
289
 
296
- return (_instance$options$deb7 = instance.options.debugAll) != null ? _instance$options$deb7 : instance.options.debugHeaders;
290
+ return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
297
291
  }
298
292
  }),
299
- getRightFooterGroups: memo(() => [instance.getRightHeaderGroups()], headerGroups => {
293
+ getRightFooterGroups: memo(() => [table.getRightHeaderGroups()], headerGroups => {
300
294
  return [...headerGroups].reverse();
301
295
  }, {
302
296
  key: 'getRightFooterGroups',
303
297
  debug: () => {
304
- var _instance$options$deb8;
298
+ var _table$options$debugA8;
305
299
 
306
- return (_instance$options$deb8 = instance.options.debugAll) != null ? _instance$options$deb8 : instance.options.debugHeaders;
300
+ return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
307
301
  }
308
302
  }),
309
303
  // Flat Headers
310
- getFlatHeaders: memo(() => [instance.getHeaderGroups()], headerGroups => {
304
+ getFlatHeaders: memo(() => [table.getHeaderGroups()], headerGroups => {
311
305
  return headerGroups.map(headerGroup => {
312
306
  return headerGroup.headers;
313
307
  }).flat();
314
308
  }, {
315
309
  key: 'getFlatHeaders',
316
310
  debug: () => {
317
- var _instance$options$deb9;
311
+ var _table$options$debugA9;
318
312
 
319
- return (_instance$options$deb9 = instance.options.debugAll) != null ? _instance$options$deb9 : instance.options.debugHeaders;
313
+ return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
320
314
  }
321
315
  }),
322
- getLeftFlatHeaders: memo(() => [instance.getLeftHeaderGroups()], left => {
316
+ getLeftFlatHeaders: memo(() => [table.getLeftHeaderGroups()], left => {
323
317
  return left.map(headerGroup => {
324
318
  return headerGroup.headers;
325
319
  }).flat();
326
320
  }, {
327
321
  key: 'getLeftFlatHeaders',
328
322
  debug: () => {
329
- var _instance$options$deb10;
323
+ var _table$options$debugA10;
330
324
 
331
- return (_instance$options$deb10 = instance.options.debugAll) != null ? _instance$options$deb10 : instance.options.debugHeaders;
325
+ return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
332
326
  }
333
327
  }),
334
- getCenterFlatHeaders: memo(() => [instance.getCenterHeaderGroups()], left => {
328
+ getCenterFlatHeaders: memo(() => [table.getCenterHeaderGroups()], left => {
335
329
  return left.map(headerGroup => {
336
330
  return headerGroup.headers;
337
331
  }).flat();
338
332
  }, {
339
333
  key: 'getCenterFlatHeaders',
340
334
  debug: () => {
341
- var _instance$options$deb11;
335
+ var _table$options$debugA11;
342
336
 
343
- return (_instance$options$deb11 = instance.options.debugAll) != null ? _instance$options$deb11 : instance.options.debugHeaders;
337
+ return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
344
338
  }
345
339
  }),
346
- getRightFlatHeaders: memo(() => [instance.getRightHeaderGroups()], left => {
340
+ getRightFlatHeaders: memo(() => [table.getRightHeaderGroups()], left => {
347
341
  return left.map(headerGroup => {
348
342
  return headerGroup.headers;
349
343
  }).flat();
350
344
  }, {
351
345
  key: 'getRightFlatHeaders',
352
346
  debug: () => {
353
- var _instance$options$deb12;
347
+ var _table$options$debugA12;
354
348
 
355
- return (_instance$options$deb12 = instance.options.debugAll) != null ? _instance$options$deb12 : instance.options.debugHeaders;
349
+ return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
356
350
  }
357
351
  }),
358
352
  // Leaf Headers
359
- getCenterLeafHeaders: memo(() => [instance.getCenterFlatHeaders()], flatHeaders => {
353
+ getCenterLeafHeaders: memo(() => [table.getCenterFlatHeaders()], flatHeaders => {
360
354
  return flatHeaders.filter(header => {
361
355
  var _header$subHeaders;
362
356
 
@@ -365,12 +359,12 @@
365
359
  }, {
366
360
  key: 'getCenterLeafHeaders',
367
361
  debug: () => {
368
- var _instance$options$deb13;
362
+ var _table$options$debugA13;
369
363
 
370
- return (_instance$options$deb13 = instance.options.debugAll) != null ? _instance$options$deb13 : instance.options.debugHeaders;
364
+ return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
371
365
  }
372
366
  }),
373
- getLeftLeafHeaders: memo(() => [instance.getLeftFlatHeaders()], flatHeaders => {
367
+ getLeftLeafHeaders: memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
374
368
  return flatHeaders.filter(header => {
375
369
  var _header$subHeaders2;
376
370
 
@@ -379,12 +373,12 @@
379
373
  }, {
380
374
  key: 'getLeftLeafHeaders',
381
375
  debug: () => {
382
- var _instance$options$deb14;
376
+ var _table$options$debugA14;
383
377
 
384
- return (_instance$options$deb14 = instance.options.debugAll) != null ? _instance$options$deb14 : instance.options.debugHeaders;
378
+ return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
385
379
  }
386
380
  }),
387
- getRightLeafHeaders: memo(() => [instance.getRightFlatHeaders()], flatHeaders => {
381
+ getRightLeafHeaders: memo(() => [table.getRightFlatHeaders()], flatHeaders => {
388
382
  return flatHeaders.filter(header => {
389
383
  var _header$subHeaders3;
390
384
 
@@ -393,12 +387,12 @@
393
387
  }, {
394
388
  key: 'getRightLeafHeaders',
395
389
  debug: () => {
396
- var _instance$options$deb15;
390
+ var _table$options$debugA15;
397
391
 
398
- return (_instance$options$deb15 = instance.options.debugAll) != null ? _instance$options$deb15 : instance.options.debugHeaders;
392
+ return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
399
393
  }
400
394
  }),
401
- getLeafHeaders: memo(() => [instance.getLeftHeaderGroups(), instance.getCenterHeaderGroups(), instance.getRightHeaderGroups()], (left, center, right) => {
395
+ getLeafHeaders: memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
402
396
  var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
403
397
 
404
398
  return [...((_left$0$headers = (_left$ = left[0]) == null ? void 0 : _left$.headers) != null ? _left$0$headers : []), ...((_center$0$headers = (_center$ = center[0]) == null ? void 0 : _center$.headers) != null ? _center$0$headers : []), ...((_right$0$headers = (_right$ = right[0]) == null ? void 0 : _right$.headers) != null ? _right$0$headers : [])].map(header => {
@@ -407,15 +401,15 @@
407
401
  }, {
408
402
  key: 'getLeafHeaders',
409
403
  debug: () => {
410
- var _instance$options$deb16;
404
+ var _table$options$debugA16;
411
405
 
412
- return (_instance$options$deb16 = instance.options.debugAll) != null ? _instance$options$deb16 : instance.options.debugHeaders;
406
+ return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
413
407
  }
414
408
  })
415
409
  };
416
410
  }
417
411
  };
418
- function buildHeaderGroups(allColumns, columnsToGroup, instance, headerFamily) {
412
+ function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
419
413
  var _headerGroups$0$heade, _headerGroups$;
420
414
 
421
415
  // Find the max depth of the columns:
@@ -469,12 +463,12 @@
469
463
  isPlaceholder = true;
470
464
  }
471
465
 
472
- if ((latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) {
466
+ if (latestPendingParentHeader && (latestPendingParentHeader == null ? void 0 : latestPendingParentHeader.column) === column) {
473
467
  // This column is repeated. Add it as a sub header to the next batch
474
468
  latestPendingParentHeader.subHeaders.push(headerToGroup);
475
469
  } else {
476
470
  // This is a new header. Let's create it
477
- const header = createHeader(instance, column, {
471
+ const header = createHeader(table, column, {
478
472
  id: [headerFamily, depth, column.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join('_'),
479
473
  isPlaceholder,
480
474
  placeholderId: isPlaceholder ? "" + pendingParentHeaders.filter(d => d.column === column).length : undefined,
@@ -498,7 +492,7 @@
498
492
  }
499
493
  };
500
494
 
501
- const bottomHeaders = columnsToGroup.map((column, index) => createHeader(instance, column, {
495
+ const bottomHeaders = columnsToGroup.map((column, index) => createHeader(table, column, {
502
496
  depth: maxDepth,
503
497
  index
504
498
  }));
@@ -570,23 +564,23 @@
570
564
  ...state
571
565
  };
572
566
  },
573
- getDefaultOptions: instance => {
567
+ getDefaultOptions: table => {
574
568
  return {
575
569
  columnResizeMode: 'onEnd',
576
- onColumnSizingChange: makeStateUpdater('columnSizing', instance),
577
- onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', instance)
570
+ onColumnSizingChange: makeStateUpdater('columnSizing', table),
571
+ onColumnSizingInfoChange: makeStateUpdater('columnSizingInfo', table)
578
572
  };
579
573
  },
580
- createColumn: (column, instance) => {
574
+ createColumn: (column, table) => {
581
575
  return {
582
576
  getSize: () => {
583
577
  var _column$columnDef$min, _ref, _column$columnDef$max;
584
578
 
585
- const columnSize = instance.getState().columnSizing[column.id];
579
+ const columnSize = table.getState().columnSizing[column.id];
586
580
  return Math.min(Math.max((_column$columnDef$min = column.columnDef.minSize) != null ? _column$columnDef$min : defaultColumnSizing.minSize, (_ref = columnSize != null ? columnSize : column.columnDef.size) != null ? _ref : defaultColumnSizing.size), (_column$columnDef$max = column.columnDef.maxSize) != null ? _column$columnDef$max : defaultColumnSizing.maxSize);
587
581
  },
588
582
  getStart: position => {
589
- const columns = !position ? instance.getVisibleLeafColumns() : position === 'left' ? instance.getLeftVisibleLeafColumns() : instance.getRightVisibleLeafColumns();
583
+ const columns = !position ? table.getVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
590
584
  const index = columns.findIndex(d => d.id === column.id);
591
585
 
592
586
  if (index > 0) {
@@ -597,7 +591,7 @@
597
591
  return 0;
598
592
  },
599
593
  resetSize: () => {
600
- instance.setColumnSizing(_ref2 => {
594
+ table.setColumnSizing(_ref2 => {
601
595
  let {
602
596
  [column.id]: _,
603
597
  ...rest
@@ -606,16 +600,16 @@
606
600
  });
607
601
  },
608
602
  getCanResize: () => {
609
- var _column$columnDef$ena, _instance$options$ena;
603
+ var _column$columnDef$ena, _table$options$enable;
610
604
 
611
- return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableColumnResizing) != null ? _instance$options$ena : true);
605
+ return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
612
606
  },
613
607
  getIsResizing: () => {
614
- return instance.getState().columnSizingInfo.isResizingColumn === column.id;
608
+ return table.getState().columnSizingInfo.isResizingColumn === column.id;
615
609
  }
616
610
  };
617
611
  },
618
- createHeader: (header, instance) => {
612
+ createHeader: (header, table) => {
619
613
  return {
620
614
  getSize: () => {
621
615
  let sum = 0;
@@ -642,7 +636,7 @@
642
636
  return 0;
643
637
  },
644
638
  getResizeHandler: () => {
645
- const column = instance.getColumn(header.column.id);
639
+ const column = table.getColumn(header.column.id);
646
640
  const canResize = column.getCanResize();
647
641
  return e => {
648
642
  if (!canResize) {
@@ -667,7 +661,7 @@
667
661
  }
668
662
 
669
663
  let newColumnSizing = {};
670
- instance.setColumnSizingInfo(old => {
664
+ table.setColumnSizingInfo(old => {
671
665
  var _old$startOffset, _old$startSize;
672
666
 
673
667
  const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
@@ -682,8 +676,8 @@
682
676
  };
683
677
  });
684
678
 
685
- if (instance.options.columnResizeMode === 'onChange' || eventType === 'end') {
686
- instance.setColumnSizing(old => ({ ...old,
679
+ if (table.options.columnResizeMode === 'onChange' || eventType === 'end') {
680
+ table.setColumnSizing(old => ({ ...old,
687
681
  ...newColumnSizing
688
682
  }));
689
683
  }
@@ -693,7 +687,7 @@
693
687
 
694
688
  const onEnd = clientXPos => {
695
689
  updateOffset('end', clientXPos);
696
- instance.setColumnSizingInfo(old => ({ ...old,
690
+ table.setColumnSizingInfo(old => ({ ...old,
697
691
  isResizingColumn: false,
698
692
  startOffset: null,
699
693
  startSize: null,
@@ -720,7 +714,7 @@
720
714
  document.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
721
715
  }
722
716
 
723
- instance.setColumnSizingInfo(old => ({ ...old,
717
+ table.setColumnSizingInfo(old => ({ ...old,
724
718
  startOffset: clientX,
725
719
  startSize,
726
720
  deltaOffset: 0,
@@ -732,47 +726,47 @@
732
726
  }
733
727
  };
734
728
  },
735
- createInstance: instance => {
729
+ createTable: table => {
736
730
  return {
737
- setColumnSizing: updater => instance.options.onColumnSizingChange == null ? void 0 : instance.options.onColumnSizingChange(updater),
738
- setColumnSizingInfo: updater => instance.options.onColumnSizingInfoChange == null ? void 0 : instance.options.onColumnSizingInfoChange(updater),
731
+ setColumnSizing: updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater),
732
+ setColumnSizingInfo: updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater),
739
733
  resetColumnSizing: defaultState => {
740
- var _instance$initialStat;
734
+ var _table$initialState$c;
741
735
 
742
- instance.setColumnSizing(defaultState ? {} : (_instance$initialStat = instance.initialState.columnSizing) != null ? _instance$initialStat : {});
736
+ table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
743
737
  },
744
738
  resetHeaderSizeInfo: defaultState => {
745
- var _instance$initialStat2;
739
+ var _table$initialState$c2;
746
740
 
747
- instance.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_instance$initialStat2 = instance.initialState.columnSizingInfo) != null ? _instance$initialStat2 : getDefaultColumnSizingInfoState());
741
+ table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
748
742
  },
749
743
  getTotalSize: () => {
750
- var _instance$getHeaderGr, _instance$getHeaderGr2;
744
+ var _table$getHeaderGroup, _table$getHeaderGroup2;
751
745
 
752
- return (_instance$getHeaderGr = (_instance$getHeaderGr2 = instance.getHeaderGroups()[0]) == null ? void 0 : _instance$getHeaderGr2.headers.reduce((sum, header) => {
746
+ return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
753
747
  return sum + header.getSize();
754
- }, 0)) != null ? _instance$getHeaderGr : 0;
748
+ }, 0)) != null ? _table$getHeaderGroup : 0;
755
749
  },
756
750
  getLeftTotalSize: () => {
757
- var _instance$getLeftHead, _instance$getLeftHead2;
751
+ var _table$getLeftHeaderG, _table$getLeftHeaderG2;
758
752
 
759
- return (_instance$getLeftHead = (_instance$getLeftHead2 = instance.getLeftHeaderGroups()[0]) == null ? void 0 : _instance$getLeftHead2.headers.reduce((sum, header) => {
753
+ return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
760
754
  return sum + header.getSize();
761
- }, 0)) != null ? _instance$getLeftHead : 0;
755
+ }, 0)) != null ? _table$getLeftHeaderG : 0;
762
756
  },
763
757
  getCenterTotalSize: () => {
764
- var _instance$getCenterHe, _instance$getCenterHe2;
758
+ var _table$getCenterHeade, _table$getCenterHeade2;
765
759
 
766
- return (_instance$getCenterHe = (_instance$getCenterHe2 = instance.getCenterHeaderGroups()[0]) == null ? void 0 : _instance$getCenterHe2.headers.reduce((sum, header) => {
760
+ return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
767
761
  return sum + header.getSize();
768
- }, 0)) != null ? _instance$getCenterHe : 0;
762
+ }, 0)) != null ? _table$getCenterHeade : 0;
769
763
  },
770
764
  getRightTotalSize: () => {
771
- var _instance$getRightHea, _instance$getRightHea2;
765
+ var _table$getRightHeader, _table$getRightHeader2;
772
766
 
773
- return (_instance$getRightHea = (_instance$getRightHea2 = instance.getRightHeaderGroups()[0]) == null ? void 0 : _instance$getRightHea2.headers.reduce((sum, header) => {
767
+ return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
774
768
  return sum + header.getSize();
775
- }, 0)) != null ? _instance$getRightHea : 0;
769
+ }, 0)) != null ? _table$getRightHeader : 0;
776
770
  }
777
771
  };
778
772
  }
@@ -815,65 +809,65 @@
815
809
  ...state
816
810
  };
817
811
  },
818
- getDefaultOptions: instance => {
812
+ getDefaultOptions: table => {
819
813
  return {
820
- onExpandedChange: makeStateUpdater('expanded', instance),
814
+ onExpandedChange: makeStateUpdater('expanded', table),
821
815
  paginateExpandedRows: true
822
816
  };
823
817
  },
824
- createInstance: instance => {
818
+ createTable: table => {
825
819
  let registered = false;
826
820
  let queued = false;
827
821
  return {
828
822
  _autoResetExpanded: () => {
829
- var _ref, _instance$options$aut;
823
+ var _ref, _table$options$autoRe;
830
824
 
831
825
  if (!registered) {
832
- instance._queue(() => {
826
+ table._queue(() => {
833
827
  registered = true;
834
828
  });
835
829
 
836
830
  return;
837
831
  }
838
832
 
839
- if ((_ref = (_instance$options$aut = instance.options.autoResetAll) != null ? _instance$options$aut : instance.options.autoResetExpanded) != null ? _ref : !instance.options.manualExpanding) {
833
+ if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
840
834
  if (queued) return;
841
835
  queued = true;
842
836
 
843
- instance._queue(() => {
844
- instance.resetExpanded();
837
+ table._queue(() => {
838
+ table.resetExpanded();
845
839
  queued = false;
846
840
  });
847
841
  }
848
842
  },
849
- setExpanded: updater => instance.options.onExpandedChange == null ? void 0 : instance.options.onExpandedChange(updater),
843
+ setExpanded: updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater),
850
844
  toggleAllRowsExpanded: expanded => {
851
- if (expanded != null ? expanded : !instance.getIsAllRowsExpanded()) {
852
- instance.setExpanded(true);
845
+ if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
846
+ table.setExpanded(true);
853
847
  } else {
854
- instance.setExpanded({});
848
+ table.setExpanded({});
855
849
  }
856
850
  },
857
851
  resetExpanded: defaultState => {
858
- var _instance$initialStat, _instance$initialStat2;
852
+ var _table$initialState$e, _table$initialState;
859
853
 
860
- instance.setExpanded(defaultState ? {} : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.expanded) != null ? _instance$initialStat : {});
854
+ table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
861
855
  },
862
856
  getCanSomeRowsExpand: () => {
863
- return instance.getRowModel().flatRows.some(row => row.getCanExpand());
857
+ return table.getRowModel().flatRows.some(row => row.getCanExpand());
864
858
  },
865
859
  getToggleAllRowsExpandedHandler: () => {
866
860
  return e => {
867
861
  e.persist == null ? void 0 : e.persist();
868
- instance.toggleAllRowsExpanded();
862
+ table.toggleAllRowsExpanded();
869
863
  };
870
864
  },
871
865
  getIsSomeRowsExpanded: () => {
872
- const expanded = instance.getState().expanded;
866
+ const expanded = table.getState().expanded;
873
867
  return expanded === true || Object.values(expanded).some(Boolean);
874
868
  },
875
869
  getIsAllRowsExpanded: () => {
876
- const expanded = instance.getState().expanded; // If expanded is true, save some cycles and return true
870
+ const expanded = table.getState().expanded; // If expanded is true, save some cycles and return true
877
871
 
878
872
  if (typeof expanded === 'boolean') {
879
873
  return expanded === true;
@@ -884,7 +878,7 @@
884
878
  } // If any row is not expanded, return false
885
879
 
886
880
 
887
- if (instance.getRowModel().flatRows.some(row => row.getIsExpanded())) {
881
+ if (table.getRowModel().flatRows.some(row => row.getIsExpanded())) {
888
882
  return false;
889
883
  } // They must all be expanded :shrug:
890
884
 
@@ -893,38 +887,38 @@
893
887
  },
894
888
  getExpandedDepth: () => {
895
889
  let maxDepth = 0;
896
- const rowIds = instance.getState().expanded === true ? Object.keys(instance.getRowModel().rowsById) : Object.keys(instance.getState().expanded);
890
+ const rowIds = table.getState().expanded === true ? Object.keys(table.getRowModel().rowsById) : Object.keys(table.getState().expanded);
897
891
  rowIds.forEach(id => {
898
892
  const splitId = id.split('.');
899
893
  maxDepth = Math.max(maxDepth, splitId.length);
900
894
  });
901
895
  return maxDepth;
902
896
  },
903
- getPreExpandedRowModel: () => instance.getSortedRowModel(),
897
+ getPreExpandedRowModel: () => table.getSortedRowModel(),
904
898
  getExpandedRowModel: () => {
905
- if (!instance._getExpandedRowModel && instance.options.getExpandedRowModel) {
906
- instance._getExpandedRowModel = instance.options.getExpandedRowModel(instance);
899
+ if (!table._getExpandedRowModel && table.options.getExpandedRowModel) {
900
+ table._getExpandedRowModel = table.options.getExpandedRowModel(table);
907
901
  }
908
902
 
909
- if (instance.options.manualExpanding || !instance._getExpandedRowModel) {
910
- return instance.getPreExpandedRowModel();
903
+ if (table.options.manualExpanding || !table._getExpandedRowModel) {
904
+ return table.getPreExpandedRowModel();
911
905
  }
912
906
 
913
- return instance._getExpandedRowModel();
907
+ return table._getExpandedRowModel();
914
908
  }
915
909
  };
916
910
  },
917
- createRow: (row, instance) => {
911
+ createRow: (row, table) => {
918
912
  return {
919
913
  toggleExpanded: expanded => {
920
- instance.setExpanded(old => {
914
+ table.setExpanded(old => {
921
915
  var _expanded;
922
916
 
923
917
  const exists = old === true ? true : !!(old != null && old[row.id]);
924
918
  let oldExpanded = {};
925
919
 
926
920
  if (old === true) {
927
- Object.keys(instance.getRowModel().rowsById).forEach(rowId => {
921
+ Object.keys(table.getRowModel().rowsById).forEach(rowId => {
928
922
  oldExpanded[rowId] = true;
929
923
  });
930
924
  } else {
@@ -951,15 +945,15 @@
951
945
  });
952
946
  },
953
947
  getIsExpanded: () => {
954
- var _instance$options$get;
948
+ var _table$options$getIsR;
955
949
 
956
- const expanded = instance.getState().expanded;
957
- return !!((_instance$options$get = instance.options.getIsRowExpanded == null ? void 0 : instance.options.getIsRowExpanded(row)) != null ? _instance$options$get : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
950
+ const expanded = table.getState().expanded;
951
+ return !!((_table$options$getIsR = table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) != null ? _table$options$getIsR : expanded === true || (expanded == null ? void 0 : expanded[row.id]));
958
952
  },
959
953
  getCanExpand: () => {
960
- var _instance$options$get2, _instance$options$ena, _row$subRows;
954
+ var _table$options$getRow, _table$options$enable, _row$subRows;
961
955
 
962
- return ((_instance$options$get2 = instance.options.getRowCanExpand == null ? void 0 : instance.options.getRowCanExpand(row)) != null ? _instance$options$get2 : true) && ((_instance$options$ena = instance.options.enableExpanding) != null ? _instance$options$ena : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
956
+ return ((_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : true) && ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
963
957
  },
964
958
  getToggleExpandedHandler: () => {
965
959
  const canExpand = row.getCanExpand();
@@ -1095,24 +1089,24 @@
1095
1089
  ...state
1096
1090
  };
1097
1091
  },
1098
- getDefaultOptions: instance => {
1092
+ getDefaultOptions: table => {
1099
1093
  return {
1100
- onColumnFiltersChange: makeStateUpdater('columnFilters', instance),
1101
- onGlobalFilterChange: makeStateUpdater('globalFilter', instance),
1094
+ onColumnFiltersChange: makeStateUpdater('columnFilters', table),
1095
+ onGlobalFilterChange: makeStateUpdater('globalFilter', table),
1102
1096
  filterFromLeafRows: false,
1103
1097
  globalFilterFn: 'auto',
1104
1098
  getColumnCanGlobalFilter: column => {
1105
- var _instance$getCoreRowM, _instance$getCoreRowM2;
1099
+ var _table$getCoreRowMode, _table$getCoreRowMode2;
1106
1100
 
1107
- const value = (_instance$getCoreRowM = instance.getCoreRowModel().flatRows[0]) == null ? void 0 : (_instance$getCoreRowM2 = _instance$getCoreRowM._getAllCellsByColumnId()[column.id]) == null ? void 0 : _instance$getCoreRowM2.getValue();
1101
+ const value = (_table$getCoreRowMode = table.getCoreRowModel().flatRows[0]) == null ? void 0 : (_table$getCoreRowMode2 = _table$getCoreRowMode._getAllCellsByColumnId()[column.id]) == null ? void 0 : _table$getCoreRowMode2.getValue();
1108
1102
  return typeof value === 'string';
1109
1103
  }
1110
1104
  };
1111
1105
  },
1112
- createColumn: (column, instance) => {
1106
+ createColumn: (column, table) => {
1113
1107
  return {
1114
1108
  getAutoFilterFn: () => {
1115
- const firstRow = instance.getCoreRowModel().flatRows[0];
1109
+ const firstRow = table.getCoreRowModel().flatRows[0];
1116
1110
  const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
1117
1111
 
1118
1112
  if (typeof value === 'string') {
@@ -1138,34 +1132,31 @@
1138
1132
  return filterFns.weakEquals;
1139
1133
  },
1140
1134
  getFilterFn: () => {
1141
- var _ref;
1142
-
1143
- const userFilterFns = instance.options.filterFns;
1144
- return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : (_ref = userFilterFns == null ? void 0 : userFilterFns[column.columnDef.filterFn]) != null ? _ref : filterFns[column.columnDef.filterFn];
1135
+ return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : filterFns[column.columnDef.filterFn];
1145
1136
  },
1146
1137
  getCanFilter: () => {
1147
- var _column$columnDef$ena, _instance$options$ena, _instance$options$ena2;
1138
+ var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
1148
1139
 
1149
- return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableColumnFilters) != null ? _instance$options$ena : true) && ((_instance$options$ena2 = instance.options.enableFilters) != null ? _instance$options$ena2 : true) && !!column.accessorFn;
1140
+ return ((_column$columnDef$ena = column.columnDef.enableColumnFilter) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnFilters) != null ? _table$options$enable : true) && ((_table$options$enable2 = table.options.enableFilters) != null ? _table$options$enable2 : true) && !!column.accessorFn;
1150
1141
  },
1151
1142
  getCanGlobalFilter: () => {
1152
- var _column$columnDef$ena2, _instance$options$ena3, _instance$options$ena4, _instance$options$get;
1143
+ var _column$columnDef$ena2, _table$options$enable3, _table$options$enable4, _table$options$getCol;
1153
1144
 
1154
- return ((_column$columnDef$ena2 = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_instance$options$ena3 = instance.options.enableGlobalFilter) != null ? _instance$options$ena3 : true) && ((_instance$options$ena4 = instance.options.enableFilters) != null ? _instance$options$ena4 : true) && ((_instance$options$get = instance.options.getColumnCanGlobalFilter == null ? void 0 : instance.options.getColumnCanGlobalFilter(column)) != null ? _instance$options$get : true) && !!column.accessorFn;
1145
+ return ((_column$columnDef$ena2 = column.columnDef.enableGlobalFilter) != null ? _column$columnDef$ena2 : true) && ((_table$options$enable3 = table.options.enableGlobalFilter) != null ? _table$options$enable3 : true) && ((_table$options$enable4 = table.options.enableFilters) != null ? _table$options$enable4 : true) && ((_table$options$getCol = table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column)) != null ? _table$options$getCol : true) && !!column.accessorFn;
1155
1146
  },
1156
1147
  getIsFiltered: () => column.getFilterIndex() > -1,
1157
1148
  getFilterValue: () => {
1158
- var _instance$getState$co, _instance$getState$co2;
1149
+ var _table$getState$colum, _table$getState$colum2;
1159
1150
 
1160
- return (_instance$getState$co = instance.getState().columnFilters) == null ? void 0 : (_instance$getState$co2 = _instance$getState$co.find(d => d.id === column.id)) == null ? void 0 : _instance$getState$co2.value;
1151
+ return (_table$getState$colum = table.getState().columnFilters) == null ? void 0 : (_table$getState$colum2 = _table$getState$colum.find(d => d.id === column.id)) == null ? void 0 : _table$getState$colum2.value;
1161
1152
  },
1162
1153
  getFilterIndex: () => {
1163
- var _instance$getState$co3, _instance$getState$co4;
1154
+ var _table$getState$colum3, _table$getState$colum4;
1164
1155
 
1165
- return (_instance$getState$co3 = (_instance$getState$co4 = instance.getState().columnFilters) == null ? void 0 : _instance$getState$co4.findIndex(d => d.id === column.id)) != null ? _instance$getState$co3 : -1;
1156
+ return (_table$getState$colum3 = (_table$getState$colum4 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum4.findIndex(d => d.id === column.id)) != null ? _table$getState$colum3 : -1;
1166
1157
  },
1167
1158
  setFilterValue: value => {
1168
- instance.setColumnFilters(old => {
1159
+ table.setColumnFilters(old => {
1169
1160
  const filterFn = column.getFilterFn();
1170
1161
  const previousfilter = old == null ? void 0 : old.find(d => d.id === column.id);
1171
1162
  const newFilter = functionalUpdate(value, previousfilter ? previousfilter.value : undefined); //
@@ -1200,15 +1191,15 @@
1200
1191
  return [newFilterObj];
1201
1192
  });
1202
1193
  },
1203
- _getFacetedRowModel: instance.options.getFacetedRowModel && instance.options.getFacetedRowModel(instance, column.id),
1194
+ _getFacetedRowModel: table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, column.id),
1204
1195
  getFacetedRowModel: () => {
1205
1196
  if (!column._getFacetedRowModel) {
1206
- return instance.getPreFilteredRowModel();
1197
+ return table.getPreFilteredRowModel();
1207
1198
  }
1208
1199
 
1209
1200
  return column._getFacetedRowModel();
1210
1201
  },
1211
- _getFacetedUniqueValues: instance.options.getFacetedUniqueValues && instance.options.getFacetedUniqueValues(instance, column.id),
1202
+ _getFacetedUniqueValues: table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, column.id),
1212
1203
  getFacetedUniqueValues: () => {
1213
1204
  if (!column._getFacetedUniqueValues) {
1214
1205
  return new Map();
@@ -1216,7 +1207,7 @@
1216
1207
 
1217
1208
  return column._getFacetedUniqueValues();
1218
1209
  },
1219
- _getFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, column.id),
1210
+ _getFacetedMinMaxValues: table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, column.id),
1220
1211
  getFacetedMinMaxValues: () => {
1221
1212
  if (!column._getFacetedMinMaxValues) {
1222
1213
  return undefined;
@@ -1228,28 +1219,25 @@
1228
1219
 
1229
1220
  };
1230
1221
  },
1231
- createRow: (row, instance) => {
1222
+ createRow: (row, table) => {
1232
1223
  return {
1233
1224
  columnFilters: {},
1234
1225
  columnFiltersMeta: {}
1235
1226
  };
1236
1227
  },
1237
- createInstance: instance => {
1228
+ createTable: table => {
1238
1229
  return {
1239
1230
  getGlobalAutoFilterFn: () => {
1240
1231
  return filterFns.includesString;
1241
1232
  },
1242
1233
  getGlobalFilterFn: () => {
1243
- var _ref2;
1244
-
1245
1234
  const {
1246
- filterFns: userFilterFns,
1247
1235
  globalFilterFn: globalFilterFn
1248
- } = instance.options;
1249
- return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? instance.getGlobalAutoFilterFn() : (_ref2 = userFilterFns == null ? void 0 : userFilterFns[globalFilterFn]) != null ? _ref2 : filterFns[globalFilterFn];
1236
+ } = table.options;
1237
+ return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : filterFns[globalFilterFn];
1250
1238
  },
1251
1239
  setColumnFilters: updater => {
1252
- const leafColumns = instance.getAllLeafColumns();
1240
+ const leafColumns = table.getAllLeafColumns();
1253
1241
 
1254
1242
  const updateFn = old => {
1255
1243
  var _functionalUpdate;
@@ -1269,51 +1257,51 @@
1269
1257
  });
1270
1258
  };
1271
1259
 
1272
- instance.options.onColumnFiltersChange == null ? void 0 : instance.options.onColumnFiltersChange(updateFn);
1260
+ table.options.onColumnFiltersChange == null ? void 0 : table.options.onColumnFiltersChange(updateFn);
1273
1261
  },
1274
1262
  setGlobalFilter: updater => {
1275
- instance.options.onGlobalFilterChange == null ? void 0 : instance.options.onGlobalFilterChange(updater);
1263
+ table.options.onGlobalFilterChange == null ? void 0 : table.options.onGlobalFilterChange(updater);
1276
1264
  },
1277
1265
  resetGlobalFilter: defaultState => {
1278
- instance.setGlobalFilter(defaultState ? undefined : instance.initialState.globalFilter);
1266
+ table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
1279
1267
  },
1280
1268
  resetColumnFilters: defaultState => {
1281
- var _instance$initialStat, _instance$initialStat2;
1269
+ var _table$initialState$c, _table$initialState;
1282
1270
 
1283
- instance.setColumnFilters(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnFilters) != null ? _instance$initialStat : []);
1271
+ table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
1284
1272
  },
1285
- getPreFilteredRowModel: () => instance.getCoreRowModel(),
1286
- _getFilteredRowModel: instance.options.getFilteredRowModel && instance.options.getFilteredRowModel(instance),
1273
+ getPreFilteredRowModel: () => table.getCoreRowModel(),
1274
+ _getFilteredRowModel: table.options.getFilteredRowModel && table.options.getFilteredRowModel(table),
1287
1275
  getFilteredRowModel: () => {
1288
- if (instance.options.manualFiltering || !instance._getFilteredRowModel) {
1289
- return instance.getPreFilteredRowModel();
1276
+ if (table.options.manualFiltering || !table._getFilteredRowModel) {
1277
+ return table.getPreFilteredRowModel();
1290
1278
  }
1291
1279
 
1292
- return instance._getFilteredRowModel();
1280
+ return table._getFilteredRowModel();
1293
1281
  },
1294
- _getGlobalFacetedRowModel: instance.options.getFacetedRowModel && instance.options.getFacetedRowModel(instance, '__global__'),
1282
+ _getGlobalFacetedRowModel: table.options.getFacetedRowModel && table.options.getFacetedRowModel(table, '__global__'),
1295
1283
  getGlobalFacetedRowModel: () => {
1296
- if (instance.options.manualFiltering || !instance._getGlobalFacetedRowModel) {
1297
- return instance.getPreFilteredRowModel();
1284
+ if (table.options.manualFiltering || !table._getGlobalFacetedRowModel) {
1285
+ return table.getPreFilteredRowModel();
1298
1286
  }
1299
1287
 
1300
- return instance._getGlobalFacetedRowModel();
1288
+ return table._getGlobalFacetedRowModel();
1301
1289
  },
1302
- _getGlobalFacetedUniqueValues: instance.options.getFacetedUniqueValues && instance.options.getFacetedUniqueValues(instance, '__global__'),
1290
+ _getGlobalFacetedUniqueValues: table.options.getFacetedUniqueValues && table.options.getFacetedUniqueValues(table, '__global__'),
1303
1291
  getGlobalFacetedUniqueValues: () => {
1304
- if (!instance._getGlobalFacetedUniqueValues) {
1292
+ if (!table._getGlobalFacetedUniqueValues) {
1305
1293
  return new Map();
1306
1294
  }
1307
1295
 
1308
- return instance._getGlobalFacetedUniqueValues();
1296
+ return table._getGlobalFacetedUniqueValues();
1309
1297
  },
1310
- _getGlobalFacetedMinMaxValues: instance.options.getFacetedMinMaxValues && instance.options.getFacetedMinMaxValues(instance, '__global__'),
1298
+ _getGlobalFacetedMinMaxValues: table.options.getFacetedMinMaxValues && table.options.getFacetedMinMaxValues(table, '__global__'),
1311
1299
  getGlobalFacetedMinMaxValues: () => {
1312
- if (!instance._getGlobalFacetedMinMaxValues) {
1300
+ if (!table._getGlobalFacetedMinMaxValues) {
1313
1301
  return;
1314
1302
  }
1315
1303
 
1316
- return instance._getGlobalFacetedMinMaxValues();
1304
+ return table._getGlobalFacetedMinMaxValues();
1317
1305
  }
1318
1306
  };
1319
1307
  }
@@ -1434,9 +1422,9 @@
1434
1422
  getDefaultColumnDef: () => {
1435
1423
  return {
1436
1424
  aggregatedCell: props => {
1437
- var _props$getValue$toStr, _props$getValue;
1425
+ var _toString, _props$getValue;
1438
1426
 
1439
- return (_props$getValue$toStr = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _props$getValue$toStr : null;
1427
+ return (_toString = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
1440
1428
  },
1441
1429
  aggregationFn: 'auto'
1442
1430
  };
@@ -1447,16 +1435,16 @@
1447
1435
  ...state
1448
1436
  };
1449
1437
  },
1450
- getDefaultOptions: instance => {
1438
+ getDefaultOptions: table => {
1451
1439
  return {
1452
- onGroupingChange: makeStateUpdater('grouping', instance),
1440
+ onGroupingChange: makeStateUpdater('grouping', table),
1453
1441
  groupedColumnMode: 'reorder'
1454
1442
  };
1455
1443
  },
1456
- createColumn: (column, instance) => {
1444
+ createColumn: (column, table) => {
1457
1445
  return {
1458
1446
  toggleGrouping: () => {
1459
- instance.setGrouping(old => {
1447
+ table.setGrouping(old => {
1460
1448
  // Find any existing grouping for this column
1461
1449
  if (old != null && old.includes(column.id)) {
1462
1450
  return old.filter(d => d !== column.id);
@@ -1468,17 +1456,17 @@
1468
1456
  getCanGroup: () => {
1469
1457
  var _ref, _ref2, _ref3, _column$columnDef$ena;
1470
1458
 
1471
- return (_ref = (_ref2 = (_ref3 = (_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref3 : instance.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
1459
+ return (_ref = (_ref2 = (_ref3 = (_column$columnDef$ena = column.columnDef.enableGrouping) != null ? _column$columnDef$ena : true) != null ? _ref3 : table.options.enableGrouping) != null ? _ref2 : true) != null ? _ref : !!column.accessorFn;
1472
1460
  },
1473
1461
  getIsGrouped: () => {
1474
- var _instance$getState$gr;
1462
+ var _table$getState$group;
1475
1463
 
1476
- return (_instance$getState$gr = instance.getState().grouping) == null ? void 0 : _instance$getState$gr.includes(column.id);
1464
+ return (_table$getState$group = table.getState().grouping) == null ? void 0 : _table$getState$group.includes(column.id);
1477
1465
  },
1478
1466
  getGroupedIndex: () => {
1479
- var _instance$getState$gr2;
1467
+ var _table$getState$group2;
1480
1468
 
1481
- return (_instance$getState$gr2 = instance.getState().grouping) == null ? void 0 : _instance$getState$gr2.indexOf(column.id);
1469
+ return (_table$getState$group2 = table.getState().grouping) == null ? void 0 : _table$getState$group2.indexOf(column.id);
1482
1470
  },
1483
1471
  getToggleGroupingHandler: () => {
1484
1472
  const canGroup = column.getCanGroup();
@@ -1488,7 +1476,7 @@
1488
1476
  };
1489
1477
  },
1490
1478
  getAutoAggregationFn: () => {
1491
- const firstRow = instance.getCoreRowModel().flatRows[0];
1479
+ const firstRow = table.getCoreRowModel().flatRows[0];
1492
1480
  const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
1493
1481
 
1494
1482
  if (typeof value === 'number') {
@@ -1500,37 +1488,33 @@
1500
1488
  }
1501
1489
  },
1502
1490
  getAggregationFn: () => {
1503
- var _ref4;
1504
-
1505
- const userAggregationFns = instance.options.aggregationFns;
1506
-
1507
1491
  if (!column) {
1508
1492
  throw new Error();
1509
1493
  }
1510
1494
 
1511
- return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_ref4 = userAggregationFns == null ? void 0 : userAggregationFns[column.columnDef.aggregationFn]) != null ? _ref4 : aggregationFns[column.columnDef.aggregationFn];
1495
+ return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : aggregationFns[column.columnDef.aggregationFn];
1512
1496
  }
1513
1497
  };
1514
1498
  },
1515
- createInstance: instance => {
1499
+ createTable: table => {
1516
1500
  return {
1517
- setGrouping: updater => instance.options.onGroupingChange == null ? void 0 : instance.options.onGroupingChange(updater),
1501
+ setGrouping: updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater),
1518
1502
  resetGrouping: defaultState => {
1519
- var _instance$initialStat, _instance$initialStat2;
1503
+ var _table$initialState$g, _table$initialState;
1520
1504
 
1521
- instance.setGrouping(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.grouping) != null ? _instance$initialStat : []);
1505
+ table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
1522
1506
  },
1523
- getPreGroupedRowModel: () => instance.getFilteredRowModel(),
1507
+ getPreGroupedRowModel: () => table.getFilteredRowModel(),
1524
1508
  getGroupedRowModel: () => {
1525
- if (!instance._getGroupedRowModel && instance.options.getGroupedRowModel) {
1526
- instance._getGroupedRowModel = instance.options.getGroupedRowModel(instance);
1509
+ if (!table._getGroupedRowModel && table.options.getGroupedRowModel) {
1510
+ table._getGroupedRowModel = table.options.getGroupedRowModel(table);
1527
1511
  }
1528
1512
 
1529
- if (instance.options.manualGrouping || !instance._getGroupedRowModel) {
1530
- return instance.getPreGroupedRowModel();
1513
+ if (table.options.manualGrouping || !table._getGroupedRowModel) {
1514
+ return table.getPreGroupedRowModel();
1531
1515
  }
1532
1516
 
1533
- return instance._getGroupedRowModel();
1517
+ return table._getGroupedRowModel();
1534
1518
  }
1535
1519
  };
1536
1520
  },
@@ -1540,12 +1524,7 @@
1540
1524
  _groupingValuesCache: {}
1541
1525
  };
1542
1526
  },
1543
- createCell: (cell, column, row, instance) => {
1544
- const getRenderValue = () => {
1545
- var _cell$getValue;
1546
-
1547
- return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
1548
- };
1527
+ createCell: (cell, column, row, table) => {
1549
1528
 
1550
1529
  return {
1551
1530
  getIsGrouped: () => column.getIsGrouped() && column.id === row.groupingColumnId,
@@ -1554,22 +1533,6 @@
1554
1533
  var _row$subRows;
1555
1534
 
1556
1535
  return !cell.getIsGrouped() && !cell.getIsPlaceholder() && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
1557
- },
1558
- renderAggregatedCell: () => {
1559
- {
1560
- if (!column.columnDef.aggregatedCell) {
1561
- console.warn('A columnDef.aggregatedCell template is recommended for displaying aggregated values.');
1562
- }
1563
- }
1564
-
1565
- const template = column.columnDef.aggregatedCell || column.columnDef.cell;
1566
- return template ? instance._render(template, {
1567
- instance,
1568
- column,
1569
- row,
1570
- cell,
1571
- getValue: getRenderValue
1572
- }) : null;
1573
1536
  }
1574
1537
  };
1575
1538
  }
@@ -1597,20 +1560,20 @@
1597
1560
  ...state
1598
1561
  };
1599
1562
  },
1600
- getDefaultOptions: instance => {
1563
+ getDefaultOptions: table => {
1601
1564
  return {
1602
- onColumnOrderChange: makeStateUpdater('columnOrder', instance)
1565
+ onColumnOrderChange: makeStateUpdater('columnOrder', table)
1603
1566
  };
1604
1567
  },
1605
- createInstance: instance => {
1568
+ createTable: table => {
1606
1569
  return {
1607
- setColumnOrder: updater => instance.options.onColumnOrderChange == null ? void 0 : instance.options.onColumnOrderChange(updater),
1570
+ setColumnOrder: updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater),
1608
1571
  resetColumnOrder: defaultState => {
1609
- var _instance$initialStat;
1572
+ var _table$initialState$c;
1610
1573
 
1611
- instance.setColumnOrder(defaultState ? [] : (_instance$initialStat = instance.initialState.columnOrder) != null ? _instance$initialStat : []);
1574
+ table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
1612
1575
  },
1613
- _getOrderColumnsFn: memo(() => [instance.getState().columnOrder, instance.getState().grouping, instance.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
1576
+ _getOrderColumnsFn: memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
1614
1577
  // Sort grouped columns to the start of the column list
1615
1578
  // before the headers are built
1616
1579
  let orderedColumns = []; // If there is no order, return the normal columns
@@ -1638,7 +1601,7 @@
1638
1601
 
1639
1602
  return orderColumns(orderedColumns, grouping, groupedColumnMode);
1640
1603
  }, {
1641
- key: 'getOrderColumnsFn' // debug: () => instance.options.debugAll ?? instance.options.debugTable,
1604
+ key: 'getOrderColumnsFn' // debug: () => table.options.debugAll ?? table.options.debugTable,
1642
1605
 
1643
1606
  })
1644
1607
  };
@@ -1662,32 +1625,32 @@
1662
1625
  }
1663
1626
  };
1664
1627
  },
1665
- getDefaultOptions: instance => {
1628
+ getDefaultOptions: table => {
1666
1629
  return {
1667
- onPaginationChange: makeStateUpdater('pagination', instance)
1630
+ onPaginationChange: makeStateUpdater('pagination', table)
1668
1631
  };
1669
1632
  },
1670
- createInstance: instance => {
1633
+ createTable: table => {
1671
1634
  let registered = false;
1672
1635
  let queued = false;
1673
1636
  return {
1674
1637
  _autoResetPageIndex: () => {
1675
- var _ref, _instance$options$aut;
1638
+ var _ref, _table$options$autoRe;
1676
1639
 
1677
1640
  if (!registered) {
1678
- instance._queue(() => {
1641
+ table._queue(() => {
1679
1642
  registered = true;
1680
1643
  });
1681
1644
 
1682
1645
  return;
1683
1646
  }
1684
1647
 
1685
- if ((_ref = (_instance$options$aut = instance.options.autoResetAll) != null ? _instance$options$aut : instance.options.autoResetPageIndex) != null ? _ref : !instance.options.manualPagination) {
1648
+ if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
1686
1649
  if (queued) return;
1687
1650
  queued = true;
1688
1651
 
1689
- instance._queue(() => {
1690
- instance.resetPageIndex();
1652
+ table._queue(() => {
1653
+ table.resetPageIndex();
1691
1654
  queued = false;
1692
1655
  });
1693
1656
  }
@@ -1698,17 +1661,17 @@
1698
1661
  return newState;
1699
1662
  };
1700
1663
 
1701
- return instance.options.onPaginationChange == null ? void 0 : instance.options.onPaginationChange(safeUpdater);
1664
+ return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
1702
1665
  },
1703
1666
  resetPagination: defaultState => {
1704
- var _instance$initialStat;
1667
+ var _table$initialState$p;
1705
1668
 
1706
- instance.setPagination(defaultState ? getDefaultPaginationState() : (_instance$initialStat = instance.initialState.pagination) != null ? _instance$initialStat : getDefaultPaginationState());
1669
+ table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
1707
1670
  },
1708
1671
  setPageIndex: updater => {
1709
- instance.setPagination(old => {
1672
+ table.setPagination(old => {
1710
1673
  let pageIndex = functionalUpdate(updater, old.pageIndex);
1711
- const maxPageIndex = typeof instance.options.pageCount === 'undefined' || instance.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : instance.options.pageCount - 1;
1674
+ const maxPageIndex = typeof table.options.pageCount === 'undefined' || table.options.pageCount === -1 ? Number.MAX_SAFE_INTEGER : table.options.pageCount - 1;
1712
1675
  pageIndex = Math.min(Math.max(0, pageIndex), maxPageIndex);
1713
1676
  return { ...old,
1714
1677
  pageIndex
@@ -1716,17 +1679,17 @@
1716
1679
  });
1717
1680
  },
1718
1681
  resetPageIndex: defaultState => {
1719
- var _instance$initialStat2, _instance$initialStat3, _instance$initialStat4;
1682
+ var _table$initialState$p2, _table$initialState, _table$initialState$p3;
1720
1683
 
1721
- instance.setPageIndex(defaultState ? defaultPageIndex : (_instance$initialStat2 = (_instance$initialStat3 = instance.initialState) == null ? void 0 : (_instance$initialStat4 = _instance$initialStat3.pagination) == null ? void 0 : _instance$initialStat4.pageIndex) != null ? _instance$initialStat2 : defaultPageIndex);
1684
+ table.setPageIndex(defaultState ? defaultPageIndex : (_table$initialState$p2 = (_table$initialState = table.initialState) == null ? void 0 : (_table$initialState$p3 = _table$initialState.pagination) == null ? void 0 : _table$initialState$p3.pageIndex) != null ? _table$initialState$p2 : defaultPageIndex);
1722
1685
  },
1723
1686
  resetPageSize: defaultState => {
1724
- var _instance$initialStat5, _instance$initialStat6, _instance$initialStat7;
1687
+ var _table$initialState$p4, _table$initialState2, _table$initialState2$;
1725
1688
 
1726
- instance.setPageSize(defaultState ? defaultPageSize : (_instance$initialStat5 = (_instance$initialStat6 = instance.initialState) == null ? void 0 : (_instance$initialStat7 = _instance$initialStat6.pagination) == null ? void 0 : _instance$initialStat7.pageSize) != null ? _instance$initialStat5 : defaultPageSize);
1689
+ table.setPageSize(defaultState ? defaultPageSize : (_table$initialState$p4 = (_table$initialState2 = table.initialState) == null ? void 0 : (_table$initialState2$ = _table$initialState2.pagination) == null ? void 0 : _table$initialState2$.pageSize) != null ? _table$initialState$p4 : defaultPageSize);
1727
1690
  },
1728
1691
  setPageSize: updater => {
1729
- instance.setPagination(old => {
1692
+ table.setPagination(old => {
1730
1693
  const pageSize = Math.max(1, functionalUpdate(updater, old.pageSize));
1731
1694
  const topRowIndex = old.pageSize * old.pageIndex;
1732
1695
  const pageIndex = Math.floor(topRowIndex / pageSize);
@@ -1736,10 +1699,10 @@
1736
1699
  };
1737
1700
  });
1738
1701
  },
1739
- setPageCount: updater => instance.setPagination(old => {
1740
- var _instance$options$pag;
1702
+ setPageCount: updater => table.setPagination(old => {
1703
+ var _table$options$pageCo;
1741
1704
 
1742
- let newPageCount = functionalUpdate(updater, (_instance$options$pag = instance.options.pageCount) != null ? _instance$options$pag : -1);
1705
+ let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
1743
1706
 
1744
1707
  if (typeof newPageCount === 'number') {
1745
1708
  newPageCount = Math.max(-1, newPageCount);
@@ -1749,7 +1712,7 @@
1749
1712
  pageCount: newPageCount
1750
1713
  };
1751
1714
  }),
1752
- getPageOptions: memo(() => [instance.getPageCount()], pageCount => {
1715
+ getPageOptions: memo(() => [table.getPageCount()], pageCount => {
1753
1716
  let pageOptions = [];
1754
1717
 
1755
1718
  if (pageCount && pageCount > 0) {
@@ -1760,17 +1723,17 @@
1760
1723
  }, {
1761
1724
  key: 'getPageOptions',
1762
1725
  debug: () => {
1763
- var _instance$options$deb;
1726
+ var _table$options$debugA;
1764
1727
 
1765
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
1728
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
1766
1729
  }
1767
1730
  }),
1768
- getCanPreviousPage: () => instance.getState().pagination.pageIndex > 0,
1731
+ getCanPreviousPage: () => table.getState().pagination.pageIndex > 0,
1769
1732
  getCanNextPage: () => {
1770
1733
  const {
1771
1734
  pageIndex
1772
- } = instance.getState().pagination;
1773
- const pageCount = instance.getPageCount();
1735
+ } = table.getState().pagination;
1736
+ const pageCount = table.getPageCount();
1774
1737
 
1775
1738
  if (pageCount === -1) {
1776
1739
  return true;
@@ -1783,29 +1746,29 @@
1783
1746
  return pageIndex < pageCount - 1;
1784
1747
  },
1785
1748
  previousPage: () => {
1786
- return instance.setPageIndex(old => old - 1);
1749
+ return table.setPageIndex(old => old - 1);
1787
1750
  },
1788
1751
  nextPage: () => {
1789
- return instance.setPageIndex(old => {
1752
+ return table.setPageIndex(old => {
1790
1753
  return old + 1;
1791
1754
  });
1792
1755
  },
1793
- getPrePaginationRowModel: () => instance.getExpandedRowModel(),
1756
+ getPrePaginationRowModel: () => table.getExpandedRowModel(),
1794
1757
  getPaginationRowModel: () => {
1795
- if (!instance._getPaginationRowModel && instance.options.getPaginationRowModel) {
1796
- instance._getPaginationRowModel = instance.options.getPaginationRowModel(instance);
1758
+ if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
1759
+ table._getPaginationRowModel = table.options.getPaginationRowModel(table);
1797
1760
  }
1798
1761
 
1799
- if (instance.options.manualPagination || !instance._getPaginationRowModel) {
1800
- return instance.getPrePaginationRowModel();
1762
+ if (table.options.manualPagination || !table._getPaginationRowModel) {
1763
+ return table.getPrePaginationRowModel();
1801
1764
  }
1802
1765
 
1803
- return instance._getPaginationRowModel();
1766
+ return table._getPaginationRowModel();
1804
1767
  },
1805
1768
  getPageCount: () => {
1806
- var _instance$options$pag2;
1769
+ var _table$options$pageCo2;
1807
1770
 
1808
- return (_instance$options$pag2 = instance.options.pageCount) != null ? _instance$options$pag2 : Math.ceil(instance.getPrePaginationRowModel().rows.length / instance.getState().pagination.pageSize);
1771
+ return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
1809
1772
  }
1810
1773
  };
1811
1774
  }
@@ -1824,16 +1787,16 @@
1824
1787
  ...state
1825
1788
  };
1826
1789
  },
1827
- getDefaultOptions: instance => {
1790
+ getDefaultOptions: table => {
1828
1791
  return {
1829
- onColumnPinningChange: makeStateUpdater('columnPinning', instance)
1792
+ onColumnPinningChange: makeStateUpdater('columnPinning', table)
1830
1793
  };
1831
1794
  },
1832
- createColumn: (column, instance) => {
1795
+ createColumn: (column, table) => {
1833
1796
  return {
1834
1797
  pin: position => {
1835
1798
  const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);
1836
- instance.setColumnPinning(old => {
1799
+ table.setColumnPinning(old => {
1837
1800
  var _old$left3, _old$right3;
1838
1801
 
1839
1802
  if (position === 'right') {
@@ -1863,9 +1826,9 @@
1863
1826
  getCanPin: () => {
1864
1827
  const leafColumns = column.getLeafColumns();
1865
1828
  return leafColumns.some(d => {
1866
- var _d$columnDef$enablePi, _instance$options$ena;
1829
+ var _d$columnDef$enablePi, _table$options$enable;
1867
1830
 
1868
- return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_instance$options$ena = instance.options.enablePinning) != null ? _instance$options$ena : true);
1831
+ return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_table$options$enable = table.options.enablePinning) != null ? _table$options$enable : true);
1869
1832
  });
1870
1833
  },
1871
1834
  getIsPinned: () => {
@@ -1873,33 +1836,33 @@
1873
1836
  const {
1874
1837
  left,
1875
1838
  right
1876
- } = instance.getState().columnPinning;
1839
+ } = table.getState().columnPinning;
1877
1840
  const isLeft = leafColumnIds.some(d => left == null ? void 0 : left.includes(d));
1878
1841
  const isRight = leafColumnIds.some(d => right == null ? void 0 : right.includes(d));
1879
1842
  return isLeft ? 'left' : isRight ? 'right' : false;
1880
1843
  },
1881
1844
  getPinnedIndex: () => {
1882
- var _instance$getState$co, _instance$getState$co2, _instance$getState$co3;
1845
+ var _table$getState$colum, _table$getState$colum2, _table$getState$colum3;
1883
1846
 
1884
1847
  const position = column.getIsPinned();
1885
- return position ? (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnPinning) == null ? void 0 : (_instance$getState$co3 = _instance$getState$co2[position]) == null ? void 0 : _instance$getState$co3.indexOf(column.id)) != null ? _instance$getState$co : -1 : 0;
1848
+ return position ? (_table$getState$colum = (_table$getState$colum2 = table.getState().columnPinning) == null ? void 0 : (_table$getState$colum3 = _table$getState$colum2[position]) == null ? void 0 : _table$getState$colum3.indexOf(column.id)) != null ? _table$getState$colum : -1 : 0;
1886
1849
  }
1887
1850
  };
1888
1851
  },
1889
- createRow: (row, instance) => {
1852
+ createRow: (row, table) => {
1890
1853
  return {
1891
- getCenterVisibleCells: memo(() => [row._getAllVisibleCells(), instance.getState().columnPinning.left, instance.getState().columnPinning.right], (allCells, left, right) => {
1854
+ getCenterVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
1892
1855
  const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1893
1856
  return allCells.filter(d => !leftAndRight.includes(d.column.id));
1894
1857
  }, {
1895
1858
  key: "development" === 'production' ,
1896
1859
  debug: () => {
1897
- var _instance$options$deb;
1860
+ var _table$options$debugA;
1898
1861
 
1899
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
1862
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
1900
1863
  }
1901
1864
  }),
1902
- getLeftVisibleCells: memo(() => [row._getAllVisibleCells(), instance.getState().columnPinning.left,,], (allCells, left) => {
1865
+ getLeftVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
1903
1866
  const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d,
1904
1867
  position: 'left'
1905
1868
  }));
@@ -1907,12 +1870,12 @@
1907
1870
  }, {
1908
1871
  key: "development" === 'production' ,
1909
1872
  debug: () => {
1910
- var _instance$options$deb2;
1873
+ var _table$options$debugA2;
1911
1874
 
1912
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
1875
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
1913
1876
  }
1914
1877
  }),
1915
- getRightVisibleCells: memo(() => [row._getAllVisibleCells(), instance.getState().columnPinning.right], (allCells, right) => {
1878
+ getRightVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
1916
1879
  const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d,
1917
1880
  position: 'left'
1918
1881
  }));
@@ -1920,25 +1883,25 @@
1920
1883
  }, {
1921
1884
  key: "development" === 'production' ,
1922
1885
  debug: () => {
1923
- var _instance$options$deb3;
1886
+ var _table$options$debugA3;
1924
1887
 
1925
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugRows;
1888
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
1926
1889
  }
1927
1890
  })
1928
1891
  };
1929
1892
  },
1930
- createInstance: instance => {
1893
+ createTable: table => {
1931
1894
  return {
1932
- setColumnPinning: updater => instance.options.onColumnPinningChange == null ? void 0 : instance.options.onColumnPinningChange(updater),
1895
+ setColumnPinning: updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater),
1933
1896
  resetColumnPinning: defaultState => {
1934
- var _instance$initialStat, _instance$initialStat2;
1897
+ var _table$initialState$c, _table$initialState;
1935
1898
 
1936
- return instance.setColumnPinning(defaultState ? getDefaultPinningState() : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.columnPinning) != null ? _instance$initialStat : getDefaultPinningState());
1899
+ return table.setColumnPinning(defaultState ? getDefaultPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultPinningState());
1937
1900
  },
1938
1901
  getIsSomeColumnsPinned: position => {
1939
1902
  var _pinningState$positio;
1940
1903
 
1941
- const pinningState = instance.getState().columnPinning;
1904
+ const pinningState = table.getState().columnPinning;
1942
1905
 
1943
1906
  if (!position) {
1944
1907
  var _pinningState$left, _pinningState$right;
@@ -1948,35 +1911,35 @@
1948
1911
 
1949
1912
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
1950
1913
  },
1951
- getLeftLeafColumns: memo(() => [instance.getAllLeafColumns(), instance.getState().columnPinning.left], (allColumns, left) => {
1914
+ getLeftLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
1952
1915
  return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1953
1916
  }, {
1954
1917
  key: 'getLeftLeafColumns',
1955
1918
  debug: () => {
1956
- var _instance$options$deb4;
1919
+ var _table$options$debugA4;
1957
1920
 
1958
- return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugColumns;
1921
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
1959
1922
  }
1960
1923
  }),
1961
- getRightLeafColumns: memo(() => [instance.getAllLeafColumns(), instance.getState().columnPinning.right], (allColumns, right) => {
1924
+ getRightLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
1962
1925
  return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1963
1926
  }, {
1964
1927
  key: 'getRightLeafColumns',
1965
1928
  debug: () => {
1966
- var _instance$options$deb5;
1929
+ var _table$options$debugA5;
1967
1930
 
1968
- return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugColumns;
1931
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
1969
1932
  }
1970
1933
  }),
1971
- getCenterLeafColumns: memo(() => [instance.getAllLeafColumns(), instance.getState().columnPinning.left, instance.getState().columnPinning.right], (allColumns, left, right) => {
1934
+ getCenterLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
1972
1935
  const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1973
1936
  return allColumns.filter(d => !leftAndRight.includes(d.id));
1974
1937
  }, {
1975
1938
  key: 'getCenterLeafColumns',
1976
1939
  debug: () => {
1977
- var _instance$options$deb6;
1940
+ var _table$options$debugA6;
1978
1941
 
1979
- return (_instance$options$deb6 = instance.options.debugAll) != null ? _instance$options$deb6 : instance.options.debugColumns;
1942
+ return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
1980
1943
  }
1981
1944
  })
1982
1945
  };
@@ -1991,9 +1954,9 @@
1991
1954
  ...state
1992
1955
  };
1993
1956
  },
1994
- getDefaultOptions: instance => {
1957
+ getDefaultOptions: table => {
1995
1958
  return {
1996
- onRowSelectionChange: makeStateUpdater('rowSelection', instance),
1959
+ onRowSelectionChange: makeStateUpdater('rowSelection', table),
1997
1960
  enableRowSelection: true,
1998
1961
  enableMultiRowSelection: true,
1999
1962
  enableSubRowSelection: true // enableGroupingRowSelection: false,
@@ -2002,20 +1965,20 @@
2002
1965
 
2003
1966
  };
2004
1967
  },
2005
- createInstance: instance => {
1968
+ createTable: table => {
2006
1969
  return {
2007
- setRowSelection: updater => instance.options.onRowSelectionChange == null ? void 0 : instance.options.onRowSelectionChange(updater),
1970
+ setRowSelection: updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater),
2008
1971
  resetRowSelection: defaultState => {
2009
- var _instance$initialStat;
1972
+ var _table$initialState$r;
2010
1973
 
2011
- return instance.setRowSelection(defaultState ? {} : (_instance$initialStat = instance.initialState.rowSelection) != null ? _instance$initialStat : {});
1974
+ return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
2012
1975
  },
2013
1976
  toggleAllRowsSelected: value => {
2014
- instance.setRowSelection(old => {
2015
- value = typeof value !== 'undefined' ? value : !instance.getIsAllRowsSelected();
1977
+ table.setRowSelection(old => {
1978
+ value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
2016
1979
  const rowSelection = { ...old
2017
1980
  };
2018
- const preGroupedFlatRows = instance.getPreGroupedRowModel().flatRows; // We don't use `mutateRowIsSelected` here for performance reasons.
1981
+ const preGroupedFlatRows = table.getPreGroupedRowModel().flatRows; // We don't use `mutateRowIsSelected` here for performance reasons.
2019
1982
  // All of the rows are flat already, so it wouldn't be worth it
2020
1983
 
2021
1984
  if (value) {
@@ -2031,12 +1994,12 @@
2031
1994
  return rowSelection;
2032
1995
  });
2033
1996
  },
2034
- toggleAllPageRowsSelected: value => instance.setRowSelection(old => {
2035
- const resolvedValue = typeof value !== 'undefined' ? value : !instance.getIsAllPageRowsSelected();
1997
+ toggleAllPageRowsSelected: value => table.setRowSelection(old => {
1998
+ const resolvedValue = typeof value !== 'undefined' ? value : !table.getIsAllPageRowsSelected();
2036
1999
  const rowSelection = { ...old
2037
2000
  };
2038
- instance.getRowModel().rows.forEach(row => {
2039
- mutateRowIsSelected(rowSelection, row.id, resolvedValue, instance);
2001
+ table.getRowModel().rows.forEach(row => {
2002
+ mutateRowIsSelected(rowSelection, row.id, resolvedValue, table);
2040
2003
  });
2041
2004
  return rowSelection;
2042
2005
  }),
@@ -2045,7 +2008,7 @@
2045
2008
  // rows,
2046
2009
  // rowsById,
2047
2010
  // options: { selectGroupingRows, selectSubRows },
2048
- // } = instance
2011
+ // } = table
2049
2012
  // const findSelectedRow = (rows: Row[]) => {
2050
2013
  // let found
2051
2014
  // rows.find(d => {
@@ -2073,7 +2036,7 @@
2073
2036
  // selectSubRows: selectSubRows!,
2074
2037
  // })
2075
2038
  // }
2076
- // instance.rows.forEach(row => {
2039
+ // table.rows.forEach(row => {
2077
2040
  // const isFirstRow = row.id === firstRow.id
2078
2041
  // const isLastRow = row.id === lastRow.id
2079
2042
  // if (isFirstRow || isLastRow) {
@@ -2088,10 +2051,10 @@
2088
2051
  // addRow(row)
2089
2052
  // }
2090
2053
  // })
2091
- // instance.setRowSelection(selectedRowIds)
2054
+ // table.setRowSelection(selectedRowIds)
2092
2055
  // },
2093
- getPreSelectedRowModel: () => instance.getCoreRowModel(),
2094
- getSelectedRowModel: memo(() => [instance.getState().rowSelection, instance.getCoreRowModel()], (rowSelection, rowModel) => {
2056
+ getPreSelectedRowModel: () => table.getCoreRowModel(),
2057
+ getSelectedRowModel: memo(() => [table.getState().rowSelection, table.getCoreRowModel()], (rowSelection, rowModel) => {
2095
2058
  if (!Object.keys(rowSelection).length) {
2096
2059
  return {
2097
2060
  rows: [],
@@ -2100,16 +2063,16 @@
2100
2063
  };
2101
2064
  }
2102
2065
 
2103
- return selectRowsFn(instance, rowModel);
2066
+ return selectRowsFn(table, rowModel);
2104
2067
  }, {
2105
2068
  key: 'getSelectedRowModel',
2106
2069
  debug: () => {
2107
- var _instance$options$deb;
2070
+ var _table$options$debugA;
2108
2071
 
2109
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
2072
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
2110
2073
  }
2111
2074
  }),
2112
- getFilteredSelectedRowModel: memo(() => [instance.getState().rowSelection, instance.getFilteredRowModel()], (rowSelection, rowModel) => {
2075
+ getFilteredSelectedRowModel: memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
2113
2076
  if (!Object.keys(rowSelection).length) {
2114
2077
  return {
2115
2078
  rows: [],
@@ -2118,16 +2081,16 @@
2118
2081
  };
2119
2082
  }
2120
2083
 
2121
- return selectRowsFn(instance, rowModel);
2084
+ return selectRowsFn(table, rowModel);
2122
2085
  }, {
2123
2086
  key: "development" === 'production' ,
2124
2087
  debug: () => {
2125
- var _instance$options$deb2;
2088
+ var _table$options$debugA2;
2126
2089
 
2127
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugTable;
2090
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
2128
2091
  }
2129
2092
  }),
2130
- getGroupedSelectedRowModel: memo(() => [instance.getState().rowSelection, instance.getSortedRowModel()], (rowSelection, rowModel) => {
2093
+ getGroupedSelectedRowModel: memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
2131
2094
  if (!Object.keys(rowSelection).length) {
2132
2095
  return {
2133
2096
  rows: [],
@@ -2136,31 +2099,31 @@
2136
2099
  };
2137
2100
  }
2138
2101
 
2139
- return selectRowsFn(instance, rowModel);
2102
+ return selectRowsFn(table, rowModel);
2140
2103
  }, {
2141
2104
  key: "development" === 'production' ,
2142
2105
  debug: () => {
2143
- var _instance$options$deb3;
2106
+ var _table$options$debugA3;
2144
2107
 
2145
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugTable;
2108
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
2146
2109
  }
2147
2110
  }),
2148
2111
  ///
2149
2112
  // getGroupingRowCanSelect: rowId => {
2150
- // const row = instance.getRow(rowId)
2113
+ // const row = table.getRow(rowId)
2151
2114
  // if (!row) {
2152
2115
  // throw new Error()
2153
2116
  // }
2154
- // if (typeof instance.options.enableGroupingRowSelection === 'function') {
2155
- // return instance.options.enableGroupingRowSelection(row)
2117
+ // if (typeof table.options.enableGroupingRowSelection === 'function') {
2118
+ // return table.options.enableGroupingRowSelection(row)
2156
2119
  // }
2157
- // return instance.options.enableGroupingRowSelection ?? false
2120
+ // return table.options.enableGroupingRowSelection ?? false
2158
2121
  // },
2159
2122
  getIsAllRowsSelected: () => {
2160
- const preFilteredFlatRows = instance.getPreFilteredRowModel().flatRows;
2123
+ const preFilteredFlatRows = table.getPreFilteredRowModel().flatRows;
2161
2124
  const {
2162
2125
  rowSelection
2163
- } = instance.getState();
2126
+ } = table.getState();
2164
2127
  let isAllRowsSelected = Boolean(preFilteredFlatRows.length && Object.keys(rowSelection).length);
2165
2128
 
2166
2129
  if (isAllRowsSelected) {
@@ -2172,10 +2135,10 @@
2172
2135
  return isAllRowsSelected;
2173
2136
  },
2174
2137
  getIsAllPageRowsSelected: () => {
2175
- const paginationFlatRows = instance.getPaginationRowModel().flatRows;
2138
+ const paginationFlatRows = table.getPaginationRowModel().flatRows;
2176
2139
  const {
2177
2140
  rowSelection
2178
- } = instance.getState();
2141
+ } = table.getState();
2179
2142
  let isAllPageRowsSelected = !!paginationFlatRows.length;
2180
2143
 
2181
2144
  if (isAllPageRowsSelected && paginationFlatRows.some(row => !rowSelection[row.id])) {
@@ -2185,31 +2148,31 @@
2185
2148
  return isAllPageRowsSelected;
2186
2149
  },
2187
2150
  getIsSomeRowsSelected: () => {
2188
- var _instance$getState$ro;
2151
+ var _table$getState$rowSe;
2189
2152
 
2190
- return !instance.getIsAllRowsSelected() && !!Object.keys((_instance$getState$ro = instance.getState().rowSelection) != null ? _instance$getState$ro : {}).length;
2153
+ return !table.getIsAllRowsSelected() && !!Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
2191
2154
  },
2192
2155
  getIsSomePageRowsSelected: () => {
2193
- const paginationFlatRows = instance.getPaginationRowModel().flatRows;
2194
- return instance.getIsAllPageRowsSelected() ? false : paginationFlatRows.some(d => d.getIsSelected() || d.getIsSomeSelected());
2156
+ const paginationFlatRows = table.getPaginationRowModel().flatRows;
2157
+ return table.getIsAllPageRowsSelected() ? false : paginationFlatRows.some(d => d.getIsSelected() || d.getIsSomeSelected());
2195
2158
  },
2196
2159
  getToggleAllRowsSelectedHandler: () => {
2197
2160
  return e => {
2198
- instance.toggleAllRowsSelected(e.target.checked);
2161
+ table.toggleAllRowsSelected(e.target.checked);
2199
2162
  };
2200
2163
  },
2201
2164
  getToggleAllPageRowsSelectedHandler: () => {
2202
2165
  return e => {
2203
- instance.toggleAllPageRowsSelected(e.target.checked);
2166
+ table.toggleAllPageRowsSelected(e.target.checked);
2204
2167
  };
2205
2168
  }
2206
2169
  };
2207
2170
  },
2208
- createRow: (row, instance) => {
2171
+ createRow: (row, table) => {
2209
2172
  return {
2210
2173
  toggleSelected: value => {
2211
2174
  const isSelected = row.getIsSelected();
2212
- instance.setRowSelection(old => {
2175
+ table.setRowSelection(old => {
2213
2176
  value = typeof value !== 'undefined' ? value : !isSelected;
2214
2177
 
2215
2178
  if (isSelected === value) {
@@ -2218,48 +2181,54 @@
2218
2181
 
2219
2182
  const selectedRowIds = { ...old
2220
2183
  };
2221
- mutateRowIsSelected(selectedRowIds, row.id, value, instance);
2184
+ mutateRowIsSelected(selectedRowIds, row.id, value, table);
2222
2185
  return selectedRowIds;
2223
2186
  });
2224
2187
  },
2225
2188
  getIsSelected: () => {
2226
2189
  const {
2227
2190
  rowSelection
2228
- } = instance.getState();
2229
- return isRowSelected(row, rowSelection) === true;
2191
+ } = table.getState();
2192
+ return isRowSelected(row, rowSelection);
2230
2193
  },
2231
2194
  getIsSomeSelected: () => {
2232
2195
  const {
2233
2196
  rowSelection
2234
- } = instance.getState();
2235
- return isRowSelected(row, rowSelection) === 'some';
2197
+ } = table.getState();
2198
+ return isSubRowSelected(row, rowSelection) === 'some';
2199
+ },
2200
+ getIsAllSubRowsSelected: () => {
2201
+ const {
2202
+ rowSelection
2203
+ } = table.getState();
2204
+ return isSubRowSelected(row, rowSelection) === 'all';
2236
2205
  },
2237
2206
  getCanSelect: () => {
2238
- var _instance$options$ena;
2207
+ var _table$options$enable;
2239
2208
 
2240
- if (typeof instance.options.enableRowSelection === 'function') {
2241
- return instance.options.enableRowSelection(row);
2209
+ if (typeof table.options.enableRowSelection === 'function') {
2210
+ return table.options.enableRowSelection(row);
2242
2211
  }
2243
2212
 
2244
- return (_instance$options$ena = instance.options.enableRowSelection) != null ? _instance$options$ena : true;
2213
+ return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
2245
2214
  },
2246
2215
  getCanSelectSubRows: () => {
2247
- var _instance$options$ena2;
2216
+ var _table$options$enable2;
2248
2217
 
2249
- if (typeof instance.options.enableSubRowSelection === 'function') {
2250
- return instance.options.enableSubRowSelection(row);
2218
+ if (typeof table.options.enableSubRowSelection === 'function') {
2219
+ return table.options.enableSubRowSelection(row);
2251
2220
  }
2252
2221
 
2253
- return (_instance$options$ena2 = instance.options.enableSubRowSelection) != null ? _instance$options$ena2 : true;
2222
+ return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
2254
2223
  },
2255
2224
  getCanMultiSelect: () => {
2256
- var _instance$options$ena3;
2225
+ var _table$options$enable3;
2257
2226
 
2258
- if (typeof instance.options.enableMultiRowSelection === 'function') {
2259
- return instance.options.enableMultiRowSelection(row);
2227
+ if (typeof table.options.enableMultiRowSelection === 'function') {
2228
+ return table.options.enableMultiRowSelection(row);
2260
2229
  }
2261
2230
 
2262
- return (_instance$options$ena3 = instance.options.enableMultiRowSelection) != null ? _instance$options$ena3 : true;
2231
+ return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
2263
2232
  },
2264
2233
  getToggleSelectedHandler: () => {
2265
2234
  const canSelect = row.getCanSelect();
@@ -2274,16 +2243,20 @@
2274
2243
  }
2275
2244
  };
2276
2245
 
2277
- const mutateRowIsSelected = (selectedRowIds, id, value, instance) => {
2246
+ const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2278
2247
  var _row$subRows;
2279
2248
 
2280
- const row = instance.getRow(id);
2249
+ const row = table.getRow(id);
2281
2250
  row.getIsGrouped(); // if ( // TODO: enforce grouping row selection rules
2282
2251
  // !isGrouped ||
2283
- // (isGrouped && instance.options.enableGroupingRowSelection)
2252
+ // (isGrouped && table.options.enableGroupingRowSelection)
2284
2253
  // ) {
2285
2254
 
2286
2255
  if (value) {
2256
+ if (!row.getCanMultiSelect()) {
2257
+ Object.keys(selectedRowIds).forEach(key => delete selectedRowIds[key]);
2258
+ }
2259
+
2287
2260
  selectedRowIds[id] = true;
2288
2261
  } else {
2289
2262
  delete selectedRowIds[id];
@@ -2291,12 +2264,12 @@
2291
2264
 
2292
2265
 
2293
2266
  if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
2294
- row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, instance));
2267
+ row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, table));
2295
2268
  }
2296
2269
  };
2297
2270
 
2298
- function selectRowsFn(instance, rowModel) {
2299
- const rowSelection = instance.getState().rowSelection;
2271
+ function selectRowsFn(table, rowModel) {
2272
+ const rowSelection = table.getState().rowSelection;
2300
2273
  const newSelectedFlatRows = [];
2301
2274
  const newSelectedRowsById = {}; // Filters top level and nested rows
2302
2275
 
@@ -2305,7 +2278,7 @@
2305
2278
  return rows.map(row => {
2306
2279
  var _row$subRows2;
2307
2280
 
2308
- const isSelected = isRowSelected(row, rowSelection) === true;
2281
+ const isSelected = isRowSelected(row, rowSelection);
2309
2282
 
2310
2283
  if (isSelected) {
2311
2284
  newSelectedFlatRows.push(row);
@@ -2330,11 +2303,12 @@
2330
2303
  rowsById: newSelectedRowsById
2331
2304
  };
2332
2305
  }
2333
- function isRowSelected(row, selection, instance) {
2334
- if (selection[row.id]) {
2335
- return true;
2336
- }
2306
+ function isRowSelected(row, selection) {
2307
+ var _selection$row$id;
2337
2308
 
2309
+ return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
2310
+ }
2311
+ function isSubRowSelected(row, selection, table) {
2338
2312
  if (row.subRows && row.subRows.length) {
2339
2313
  let allChildrenSelected = true;
2340
2314
  let someSelected = false;
@@ -2350,7 +2324,7 @@
2350
2324
  allChildrenSelected = false;
2351
2325
  }
2352
2326
  });
2353
- return allChildrenSelected ? true : someSelected ? 'some' : false;
2327
+ return allChildrenSelected ? 'all' : someSelected ? 'some' : false;
2354
2328
  }
2355
2329
 
2356
2330
  return false;
@@ -2476,18 +2450,18 @@
2476
2450
  sortingFn: 'auto'
2477
2451
  };
2478
2452
  },
2479
- getDefaultOptions: instance => {
2453
+ getDefaultOptions: table => {
2480
2454
  return {
2481
- onSortingChange: makeStateUpdater('sorting', instance),
2455
+ onSortingChange: makeStateUpdater('sorting', table),
2482
2456
  isMultiSortEvent: e => {
2483
2457
  return e.shiftKey;
2484
2458
  }
2485
2459
  };
2486
2460
  },
2487
- createColumn: (column, instance) => {
2461
+ createColumn: (column, table) => {
2488
2462
  return {
2489
2463
  getAutoSortingFn: () => {
2490
- const firstRows = instance.getFilteredRowModel().flatRows.slice(10);
2464
+ const firstRows = table.getFilteredRowModel().flatRows.slice(10);
2491
2465
  let isString = false;
2492
2466
 
2493
2467
  for (const row of firstRows) {
@@ -2513,7 +2487,7 @@
2513
2487
  return sortingFns.basic;
2514
2488
  },
2515
2489
  getAutoSortDir: () => {
2516
- const firstRow = instance.getFilteredRowModel().flatRows[0];
2490
+ const firstRow = table.getFilteredRowModel().flatRows[0];
2517
2491
  const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
2518
2492
 
2519
2493
  if (typeof value === 'string') {
@@ -2523,29 +2497,25 @@
2523
2497
  return 'desc';
2524
2498
  },
2525
2499
  getSortingFn: () => {
2526
- var _ref;
2527
-
2528
- const userSortingFn = instance.options.sortingFns;
2529
-
2530
2500
  if (!column) {
2531
2501
  throw new Error();
2532
2502
  }
2533
2503
 
2534
- return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_ref = userSortingFn == null ? void 0 : userSortingFn[column.columnDef.sortingFn]) != null ? _ref : sortingFns[column.columnDef.sortingFn];
2504
+ return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : sortingFns[column.columnDef.sortingFn];
2535
2505
  },
2536
2506
  toggleSorting: (desc, multi) => {
2537
2507
  // if (column.columns.length) {
2538
2508
  // column.columns.forEach((c, i) => {
2539
2509
  // if (c.id) {
2540
- // instance.toggleColumnSorting(c.id, undefined, multi || !!i)
2510
+ // table.toggleColumnSorting(c.id, undefined, multi || !!i)
2541
2511
  // }
2542
2512
  // })
2543
2513
  // return
2544
2514
  // }
2545
- // this needs to be outside of instance.setSorting to be in sync with rerender
2515
+ // this needs to be outside of table.setSorting to be in sync with rerender
2546
2516
  const nextSortingOrder = column.getNextSortingOrder();
2547
- instance.setSorting(old => {
2548
- var _instance$options$ena, _instance$options$ena2;
2517
+ table.setSorting(old => {
2518
+ var _table$options$enable, _table$options$enable2;
2549
2519
 
2550
2520
  // Find any existing sorting for this column
2551
2521
  const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
@@ -2574,9 +2544,9 @@
2574
2544
 
2575
2545
 
2576
2546
  if (sortAction === 'toggle' && ( // Must be toggling
2577
- (_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
2547
+ (_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && // If enableSortRemove, enable in general
2578
2548
  !hasDescDefined && ( // Must not be setting desc
2579
- multi ? (_instance$options$ena2 = instance.options.enableMultiRemove) != null ? _instance$options$ena2 : true : true) && // If multi, don't allow if enableMultiRemove
2549
+ multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) && // If multi, don't allow if enableMultiRemove
2580
2550
  !nextSortingOrder // Finally, detect if it should indeed be removed
2581
2551
  ) {
2582
2552
  sortAction = 'remove';
@@ -2588,14 +2558,14 @@
2588
2558
  desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
2589
2559
  }];
2590
2560
  } else if (sortAction === 'add' && old != null && old.length) {
2591
- var _instance$options$max;
2561
+ var _table$options$maxMul;
2592
2562
 
2593
2563
  newSorting = [...old, {
2594
2564
  id: column.id,
2595
2565
  desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
2596
2566
  }]; // Take latest n columns
2597
2567
 
2598
- newSorting.splice(0, newSorting.length - ((_instance$options$max = instance.options.maxMultiSortColCount) != null ? _instance$options$max : Number.MAX_SAFE_INTEGER));
2568
+ newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
2599
2569
  } else if (sortAction === 'toggle' && old != null && old.length) {
2600
2570
  // This flips (or sets) the
2601
2571
  newSorting = old.map(d => {
@@ -2615,9 +2585,9 @@
2615
2585
  });
2616
2586
  },
2617
2587
  getNextSortingOrder: () => {
2618
- var _ref2, _column$columnDef$sor;
2588
+ var _ref, _column$columnDef$sor;
2619
2589
 
2620
- const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc';
2590
+ const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
2621
2591
  const firstSortDirection = sortDescFirst ? 'desc' : 'asc';
2622
2592
  const isSorted = column.getIsSorted();
2623
2593
 
@@ -2632,59 +2602,59 @@
2632
2602
  }
2633
2603
  },
2634
2604
  getCanSort: () => {
2635
- var _column$columnDef$ena, _instance$options$ena3;
2605
+ var _column$columnDef$ena, _table$options$enable3;
2636
2606
 
2637
- return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_instance$options$ena3 = instance.options.enableSorting) != null ? _instance$options$ena3 : true) && !!column.accessorFn;
2607
+ return ((_column$columnDef$ena = column.columnDef.enableSorting) != null ? _column$columnDef$ena : true) && ((_table$options$enable3 = table.options.enableSorting) != null ? _table$options$enable3 : true) && !!column.accessorFn;
2638
2608
  },
2639
2609
  getCanMultiSort: () => {
2640
- var _ref3, _column$columnDef$ena2;
2610
+ var _ref2, _column$columnDef$ena2;
2641
2611
 
2642
- return (_ref3 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : instance.options.enableMultiSort) != null ? _ref3 : !!column.accessorFn;
2612
+ return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
2643
2613
  },
2644
2614
  getIsSorted: () => {
2645
- var _instance$getState$so;
2615
+ var _table$getState$sorti;
2646
2616
 
2647
- const columnSort = (_instance$getState$so = instance.getState().sorting) == null ? void 0 : _instance$getState$so.find(d => d.id === column.id);
2617
+ const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find(d => d.id === column.id);
2648
2618
  return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
2649
2619
  },
2650
2620
  getSortIndex: () => {
2651
- var _instance$getState$so2, _instance$getState$so3;
2621
+ var _table$getState$sorti2, _table$getState$sorti3;
2652
2622
 
2653
- return (_instance$getState$so2 = (_instance$getState$so3 = instance.getState().sorting) == null ? void 0 : _instance$getState$so3.findIndex(d => d.id === column.id)) != null ? _instance$getState$so2 : -1;
2623
+ return (_table$getState$sorti2 = (_table$getState$sorti3 = table.getState().sorting) == null ? void 0 : _table$getState$sorti3.findIndex(d => d.id === column.id)) != null ? _table$getState$sorti2 : -1;
2654
2624
  },
2655
2625
  clearSorting: () => {
2656
2626
  //clear sorting for just 1 column
2657
- instance.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
2627
+ table.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
2658
2628
  },
2659
2629
  getToggleSortingHandler: () => {
2660
2630
  const canSort = column.getCanSort();
2661
2631
  return e => {
2662
2632
  if (!canSort) return;
2663
2633
  e.persist == null ? void 0 : e.persist();
2664
- column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? instance.options.isMultiSortEvent == null ? void 0 : instance.options.isMultiSortEvent(e) : false);
2634
+ column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
2665
2635
  };
2666
2636
  }
2667
2637
  };
2668
2638
  },
2669
- createInstance: instance => {
2639
+ createTable: table => {
2670
2640
  return {
2671
- setSorting: updater => instance.options.onSortingChange == null ? void 0 : instance.options.onSortingChange(updater),
2641
+ setSorting: updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater),
2672
2642
  resetSorting: defaultState => {
2673
- var _instance$initialStat, _instance$initialStat2;
2643
+ var _table$initialState$s, _table$initialState;
2674
2644
 
2675
- instance.setSorting(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.sorting) != null ? _instance$initialStat : []);
2645
+ table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
2676
2646
  },
2677
- getPreSortedRowModel: () => instance.getGroupedRowModel(),
2647
+ getPreSortedRowModel: () => table.getGroupedRowModel(),
2678
2648
  getSortedRowModel: () => {
2679
- if (!instance._getSortedRowModel && instance.options.getSortedRowModel) {
2680
- instance._getSortedRowModel = instance.options.getSortedRowModel(instance);
2649
+ if (!table._getSortedRowModel && table.options.getSortedRowModel) {
2650
+ table._getSortedRowModel = table.options.getSortedRowModel(table);
2681
2651
  }
2682
2652
 
2683
- if (instance.options.manualSorting || !instance._getSortedRowModel) {
2684
- return instance.getPreSortedRowModel();
2653
+ if (table.options.manualSorting || !table._getSortedRowModel) {
2654
+ return table.getPreSortedRowModel();
2685
2655
  }
2686
2656
 
2687
- return instance._getSortedRowModel();
2657
+ return table._getSortedRowModel();
2688
2658
  }
2689
2659
  };
2690
2660
  }
@@ -2698,29 +2668,29 @@
2698
2668
  ...state
2699
2669
  };
2700
2670
  },
2701
- getDefaultOptions: instance => {
2671
+ getDefaultOptions: table => {
2702
2672
  return {
2703
- onColumnVisibilityChange: makeStateUpdater('columnVisibility', instance)
2673
+ onColumnVisibilityChange: makeStateUpdater('columnVisibility', table)
2704
2674
  };
2705
2675
  },
2706
- createColumn: (column, instance) => {
2676
+ createColumn: (column, table) => {
2707
2677
  return {
2708
2678
  toggleVisibility: value => {
2709
2679
  if (column.getCanHide()) {
2710
- instance.setColumnVisibility(old => ({ ...old,
2680
+ table.setColumnVisibility(old => ({ ...old,
2711
2681
  [column.id]: value != null ? value : !column.getIsVisible()
2712
2682
  }));
2713
2683
  }
2714
2684
  },
2715
2685
  getIsVisible: () => {
2716
- var _instance$getState$co, _instance$getState$co2;
2686
+ var _table$getState$colum, _table$getState$colum2;
2717
2687
 
2718
- return (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnVisibility) == null ? void 0 : _instance$getState$co2[column.id]) != null ? _instance$getState$co : true;
2688
+ return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
2719
2689
  },
2720
2690
  getCanHide: () => {
2721
- var _column$columnDef$ena, _instance$options$ena;
2691
+ var _column$columnDef$ena, _table$options$enable;
2722
2692
 
2723
- return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : true);
2693
+ return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
2724
2694
  },
2725
2695
  getToggleVisibilityHandler: () => {
2726
2696
  return e => {
@@ -2729,69 +2699,69 @@
2729
2699
  }
2730
2700
  };
2731
2701
  },
2732
- createRow: (row, instance) => {
2702
+ createRow: (row, table) => {
2733
2703
  return {
2734
- _getAllVisibleCells: memo(() => [row.getAllCells(), instance.getState().columnVisibility], cells => {
2704
+ _getAllVisibleCells: memo(() => [row.getAllCells(), table.getState().columnVisibility], cells => {
2735
2705
  return cells.filter(cell => cell.column.getIsVisible());
2736
2706
  }, {
2737
2707
  key: "development" === 'production' ,
2738
2708
  debug: () => {
2739
- var _instance$options$deb;
2709
+ var _table$options$debugA;
2740
2710
 
2741
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
2711
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
2742
2712
  }
2743
2713
  }),
2744
2714
  getVisibleCells: memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
2745
2715
  key: 'row.getVisibleCells',
2746
2716
  debug: () => {
2747
- var _instance$options$deb2;
2717
+ var _table$options$debugA2;
2748
2718
 
2749
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
2719
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
2750
2720
  }
2751
2721
  })
2752
2722
  };
2753
2723
  },
2754
- createInstance: instance => {
2724
+ createTable: table => {
2755
2725
  const makeVisibleColumnsMethod = (key, getColumns) => {
2756
2726
  return memo(() => [getColumns(), getColumns().filter(d => d.getIsVisible()).map(d => d.id).join('_')], columns => {
2757
2727
  return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
2758
2728
  }, {
2759
2729
  key,
2760
2730
  debug: () => {
2761
- var _instance$options$deb3;
2731
+ var _table$options$debugA3;
2762
2732
 
2763
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugColumns;
2733
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2764
2734
  }
2765
2735
  });
2766
2736
  };
2767
2737
 
2768
2738
  return {
2769
- getVisibleFlatColumns: makeVisibleColumnsMethod('getVisibleFlatColumns', () => instance.getAllFlatColumns()),
2770
- getVisibleLeafColumns: makeVisibleColumnsMethod('getVisibleLeafColumns', () => instance.getAllLeafColumns()),
2771
- getLeftVisibleLeafColumns: makeVisibleColumnsMethod('getLeftVisibleLeafColumns', () => instance.getLeftLeafColumns()),
2772
- getRightVisibleLeafColumns: makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => instance.getRightLeafColumns()),
2773
- getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => instance.getCenterLeafColumns()),
2774
- setColumnVisibility: updater => instance.options.onColumnVisibilityChange == null ? void 0 : instance.options.onColumnVisibilityChange(updater),
2739
+ getVisibleFlatColumns: makeVisibleColumnsMethod('getVisibleFlatColumns', () => table.getAllFlatColumns()),
2740
+ getVisibleLeafColumns: makeVisibleColumnsMethod('getVisibleLeafColumns', () => table.getAllLeafColumns()),
2741
+ getLeftVisibleLeafColumns: makeVisibleColumnsMethod('getLeftVisibleLeafColumns', () => table.getLeftLeafColumns()),
2742
+ getRightVisibleLeafColumns: makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => table.getRightLeafColumns()),
2743
+ getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns()),
2744
+ setColumnVisibility: updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater),
2775
2745
  resetColumnVisibility: defaultState => {
2776
- var _instance$initialStat;
2746
+ var _table$initialState$c;
2777
2747
 
2778
- instance.setColumnVisibility(defaultState ? {} : (_instance$initialStat = instance.initialState.columnVisibility) != null ? _instance$initialStat : {});
2748
+ table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
2779
2749
  },
2780
2750
  toggleAllColumnsVisible: value => {
2781
2751
  var _value;
2782
2752
 
2783
- value = (_value = value) != null ? _value : !instance.getIsAllColumnsVisible();
2784
- instance.setColumnVisibility(instance.getAllLeafColumns().reduce((obj, column) => ({ ...obj,
2753
+ value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
2754
+ table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({ ...obj,
2785
2755
  [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
2786
2756
  }), {}));
2787
2757
  },
2788
- getIsAllColumnsVisible: () => !instance.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible())),
2789
- getIsSomeColumnsVisible: () => instance.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible()),
2758
+ getIsAllColumnsVisible: () => !table.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible())),
2759
+ getIsSomeColumnsVisible: () => table.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible()),
2790
2760
  getToggleAllColumnsVisibilityHandler: () => {
2791
2761
  return e => {
2792
2762
  var _target;
2793
2763
 
2794
- instance.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
2764
+ table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
2795
2765
  };
2796
2766
  }
2797
2767
  };
@@ -2800,24 +2770,24 @@
2800
2770
 
2801
2771
  const features = [Headers, Visibility, Ordering, Pinning, Filters, Sorting, Grouping, Expanding, Pagination, RowSelection, ColumnSizing]; //
2802
2772
 
2803
- function createTableInstance(options) {
2773
+ function createTable(options) {
2804
2774
  var _options$initialState;
2805
2775
 
2806
2776
  if (options.debugAll || options.debugTable) {
2807
2777
  console.info('Creating Table Instance...');
2808
2778
  }
2809
2779
 
2810
- let instance = {
2780
+ let table = {
2811
2781
  _features: features
2812
2782
  };
2813
2783
 
2814
- const defaultOptions = instance._features.reduce((obj, feature) => {
2815
- return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(instance));
2784
+ const defaultOptions = table._features.reduce((obj, feature) => {
2785
+ return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table));
2816
2786
  }, {});
2817
2787
 
2818
2788
  const mergeOptions = options => {
2819
- if (instance.options.mergeOptions) {
2820
- return instance.options.mergeOptions(defaultOptions, options);
2789
+ if (table.options.mergeOptions) {
2790
+ return table.options.mergeOptions(defaultOptions, options);
2821
2791
  }
2822
2792
 
2823
2793
  return { ...defaultOptions,
@@ -2830,7 +2800,7 @@
2830
2800
  ...((_options$initialState = options.initialState) != null ? _options$initialState : {})
2831
2801
  };
2832
2802
 
2833
- instance._features.forEach(feature => {
2803
+ table._features.forEach(feature => {
2834
2804
  var _feature$getInitialSt;
2835
2805
 
2836
2806
  initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
@@ -2863,48 +2833,37 @@
2863
2833
  }
2864
2834
  },
2865
2835
  reset: () => {
2866
- instance.setState(instance.initialState);
2836
+ table.setState(table.initialState);
2867
2837
  },
2868
2838
  setOptions: updater => {
2869
- const newOptions = functionalUpdate(updater, instance.options);
2870
- instance.options = mergeOptions(newOptions);
2871
- },
2872
- _render: (template, props) => {
2873
- if (typeof instance.options.render === 'function') {
2874
- return instance.options.render(template, props);
2875
- }
2876
-
2877
- if (typeof template === 'function') {
2878
- return template(props);
2879
- }
2880
-
2881
- return template;
2839
+ const newOptions = functionalUpdate(updater, table.options);
2840
+ table.options = mergeOptions(newOptions);
2882
2841
  },
2883
2842
  getState: () => {
2884
- return instance.options.state;
2843
+ return table.options.state;
2885
2844
  },
2886
2845
  setState: updater => {
2887
- instance.options.onStateChange == null ? void 0 : instance.options.onStateChange(updater);
2846
+ table.options.onStateChange == null ? void 0 : table.options.onStateChange(updater);
2888
2847
  },
2889
2848
  _getRowId: (row, index, parent) => {
2890
- var _instance$options$get;
2849
+ var _table$options$getRow;
2891
2850
 
2892
- return (_instance$options$get = instance.options.getRowId == null ? void 0 : instance.options.getRowId(row, index, parent)) != null ? _instance$options$get : "" + (parent ? [parent.id, index].join('.') : index);
2851
+ return (_table$options$getRow = table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) != null ? _table$options$getRow : "" + (parent ? [parent.id, index].join('.') : index);
2893
2852
  },
2894
2853
  getCoreRowModel: () => {
2895
- if (!instance._getCoreRowModel) {
2896
- instance._getCoreRowModel = instance.options.getCoreRowModel(instance);
2854
+ if (!table._getCoreRowModel) {
2855
+ table._getCoreRowModel = table.options.getCoreRowModel(table);
2897
2856
  }
2898
2857
 
2899
- return instance._getCoreRowModel();
2858
+ return table._getCoreRowModel();
2900
2859
  },
2901
2860
  // The final calls start at the bottom of the model,
2902
2861
  // expanded rows, which then work their way up
2903
2862
  getRowModel: () => {
2904
- return instance.getPaginationRowModel();
2863
+ return table.getPaginationRowModel();
2905
2864
  },
2906
2865
  getRow: id => {
2907
- const row = instance.getRowModel().rowsById[id];
2866
+ const row = table.getRowModel().rowsById[id];
2908
2867
 
2909
2868
  if (!row) {
2910
2869
  {
@@ -2914,7 +2873,7 @@
2914
2873
 
2915
2874
  return row;
2916
2875
  },
2917
- _getDefaultColumnDef: memo(() => [instance.options.defaultColumn], defaultColumn => {
2876
+ _getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {
2918
2877
  var _defaultColumn;
2919
2878
 
2920
2879
  defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
@@ -2922,32 +2881,32 @@
2922
2881
  header: props => props.header.column.id,
2923
2882
  footer: props => props.header.column.id,
2924
2883
  cell: props => {
2925
- var _props$getValue$toStr, _props$getValue;
2884
+ var _toString, _props$renderValue;
2926
2885
 
2927
- return (_props$getValue$toStr = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _props$getValue$toStr : null;
2886
+ return (_toString = (_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _toString : null;
2928
2887
  },
2929
- ...instance._features.reduce((obj, feature) => {
2888
+ ...table._features.reduce((obj, feature) => {
2930
2889
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
2931
2890
  }, {}),
2932
2891
  ...defaultColumn
2933
2892
  };
2934
2893
  }, {
2935
2894
  debug: () => {
2936
- var _instance$options$deb;
2895
+ var _table$options$debugA;
2937
2896
 
2938
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
2897
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
2939
2898
  },
2940
2899
  key: 'getDefaultColumnDef'
2941
2900
  }),
2942
- _getColumnDefs: () => instance.options.columns,
2943
- getAllColumns: memo(() => [instance._getColumnDefs()], columnDefs => {
2901
+ _getColumnDefs: () => table.options.columns,
2902
+ getAllColumns: memo(() => [table._getColumnDefs()], columnDefs => {
2944
2903
  const recurseColumns = function (columnDefs, parent, depth) {
2945
2904
  if (depth === void 0) {
2946
2905
  depth = 0;
2947
2906
  }
2948
2907
 
2949
2908
  return columnDefs.map(columnDef => {
2950
- const column = createColumn(instance, columnDef, depth, parent);
2909
+ const column = createColumn(table, columnDef, depth, parent);
2951
2910
  column.columns = columnDef.columns ? recurseColumns(columnDef.columns, column, depth + 1) : [];
2952
2911
  return column;
2953
2912
  });
@@ -2957,24 +2916,24 @@
2957
2916
  }, {
2958
2917
  key: 'getAllColumns',
2959
2918
  debug: () => {
2960
- var _instance$options$deb2;
2919
+ var _table$options$debugA2;
2961
2920
 
2962
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugColumns;
2921
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
2963
2922
  }
2964
2923
  }),
2965
- getAllFlatColumns: memo(() => [instance.getAllColumns()], allColumns => {
2924
+ getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {
2966
2925
  return allColumns.flatMap(column => {
2967
2926
  return column.getFlatColumns();
2968
2927
  });
2969
2928
  }, {
2970
2929
  key: 'getAllFlatColumns',
2971
2930
  debug: () => {
2972
- var _instance$options$deb3;
2931
+ var _table$options$debugA3;
2973
2932
 
2974
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugColumns;
2933
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2975
2934
  }
2976
2935
  }),
2977
- _getAllFlatColumnsById: memo(() => [instance.getAllFlatColumns()], flatColumns => {
2936
+ _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {
2978
2937
  return flatColumns.reduce((acc, column) => {
2979
2938
  acc[column.id] = column;
2980
2939
  return acc;
@@ -2982,24 +2941,24 @@
2982
2941
  }, {
2983
2942
  key: 'getAllFlatColumnsById',
2984
2943
  debug: () => {
2985
- var _instance$options$deb4;
2944
+ var _table$options$debugA4;
2986
2945
 
2987
- return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugColumns;
2946
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
2988
2947
  }
2989
2948
  }),
2990
- getAllLeafColumns: memo(() => [instance.getAllColumns(), instance._getOrderColumnsFn()], (allColumns, orderColumns) => {
2949
+ getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
2991
2950
  let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
2992
2951
  return orderColumns(leafColumns);
2993
2952
  }, {
2994
2953
  key: 'getAllLeafColumns',
2995
2954
  debug: () => {
2996
- var _instance$options$deb5;
2955
+ var _table$options$debugA5;
2997
2956
 
2998
- return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugColumns;
2957
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
2999
2958
  }
3000
2959
  }),
3001
2960
  getColumn: columnId => {
3002
- const column = instance._getAllFlatColumnsById()[columnId];
2961
+ const column = table._getAllFlatColumnsById()[columnId];
3003
2962
 
3004
2963
  if (!column) {
3005
2964
  {
@@ -3012,76 +2971,20 @@
3012
2971
  return column;
3013
2972
  }
3014
2973
  };
3015
- Object.assign(instance, coreInstance);
2974
+ Object.assign(table, coreInstance);
3016
2975
 
3017
- instance._features.forEach(feature => {
3018
- return Object.assign(instance, feature.createInstance == null ? void 0 : feature.createInstance(instance));
2976
+ table._features.forEach(feature => {
2977
+ return Object.assign(table, feature.createTable == null ? void 0 : feature.createTable(table));
3019
2978
  });
3020
2979
 
3021
- return instance;
3022
- }
3023
-
3024
- //
3025
- function createTableFactory(opts) {
3026
- return () => createTable(undefined, undefined, opts);
3027
- } // A lot of returns in here are `as any` for a reason. Unless you
3028
- // can find a better way to do this, then don't worry about them
3029
-
3030
- function createTable(_, __, options) {
3031
- const table = {
3032
- generics: undefined,
3033
- options: options != null ? options : {
3034
- render: (() => {
3035
- throw new Error('');
3036
- })()
3037
- },
3038
- // setGenerics: () => table as any,
3039
- setRowType: () => table,
3040
- setTableMetaType: () => table,
3041
- setColumnMetaType: () => table,
3042
- setFilterMetaType: () => table,
3043
- setOptions: newOptions => createTable(_, __, { ...options,
3044
- ...newOptions
3045
- }),
3046
- createDisplayColumn: column => ({ ...column,
3047
- columnDefType: 'display'
3048
- }),
3049
- createGroup: column => ({ ...column,
3050
- columnDefType: 'group'
3051
- }),
3052
- createDataColumn: (accessor, column) => {
3053
- column = { ...column,
3054
- columnDefType: 'data',
3055
- id: column.id
3056
- };
3057
-
3058
- if (typeof accessor === 'string') {
3059
- var _column$id;
3060
-
3061
- return { ...column,
3062
- id: (_column$id = column.id) != null ? _column$id : accessor,
3063
- accessorKey: accessor
3064
- };
3065
- }
3066
-
3067
- if (typeof accessor === 'function') {
3068
- return { ...column,
3069
- accessorFn: accessor
3070
- };
3071
- }
3072
-
3073
- throw new Error('Invalid accessor');
3074
- },
3075
- createOptions: options => options
3076
- };
3077
2980
  return table;
3078
2981
  }
3079
2982
 
3080
- function createCell(instance, row, column, columnId) {
2983
+ function createCell(table, row, column, columnId) {
3081
2984
  const getRenderValue = () => {
3082
2985
  var _cell$getValue;
3083
2986
 
3084
- return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
2987
+ return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
3085
2988
  };
3086
2989
 
3087
2990
  const cell = {
@@ -3089,25 +2992,25 @@
3089
2992
  row,
3090
2993
  column,
3091
2994
  getValue: () => row.getValue(columnId),
3092
- renderCell: () => {
3093
- return column.columnDef.cell ? instance._render(column.columnDef.cell, {
3094
- instance,
3095
- column,
3096
- row,
3097
- cell: cell,
3098
- getValue: getRenderValue
3099
- }) : null;
3100
- }
2995
+ renderValue: getRenderValue,
2996
+ getContext: () => ({
2997
+ table,
2998
+ column,
2999
+ row,
3000
+ cell: cell,
3001
+ getValue: cell.getValue,
3002
+ renderValue: cell.renderValue
3003
+ })
3101
3004
  };
3102
3005
 
3103
- instance._features.forEach(feature => {
3104
- Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, instance));
3006
+ table._features.forEach(feature => {
3007
+ Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, table));
3105
3008
  }, {});
3106
3009
 
3107
3010
  return cell;
3108
3011
  }
3109
3012
 
3110
- const createRow = (instance, id, original, rowIndex, depth, subRows) => {
3013
+ const createRow = (table, id, original, rowIndex, depth, subRows) => {
3111
3014
  let row = {
3112
3015
  id,
3113
3016
  index: rowIndex,
@@ -3119,7 +3022,7 @@
3119
3022
  return row._valuesCache[columnId];
3120
3023
  }
3121
3024
 
3122
- const column = instance.getColumn(columnId);
3025
+ const column = table.getColumn(columnId);
3123
3026
 
3124
3027
  if (!column.accessorFn) {
3125
3028
  return undefined;
@@ -3128,18 +3031,23 @@
3128
3031
  row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
3129
3032
  return row._valuesCache[columnId];
3130
3033
  },
3034
+ renderValue: columnId => {
3035
+ var _row$getValue;
3036
+
3037
+ return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
3038
+ },
3131
3039
  subRows: subRows != null ? subRows : [],
3132
3040
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
3133
- getAllCells: memo(() => [instance.getAllLeafColumns()], leafColumns => {
3041
+ getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {
3134
3042
  return leafColumns.map(column => {
3135
- return createCell(instance, row, column, column.id);
3043
+ return createCell(table, row, column, column.id);
3136
3044
  });
3137
3045
  }, {
3138
3046
  key: 'row.getAllCells',
3139
3047
  debug: () => {
3140
- var _instance$options$deb;
3048
+ var _table$options$debugA;
3141
3049
 
3142
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
3050
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
3143
3051
  }
3144
3052
  }),
3145
3053
  _getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {
@@ -3150,23 +3058,23 @@
3150
3058
  }, {
3151
3059
  key: "development" === 'production' ,
3152
3060
  debug: () => {
3153
- var _instance$options$deb2;
3061
+ var _table$options$debugA2;
3154
3062
 
3155
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
3063
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
3156
3064
  }
3157
3065
  })
3158
3066
  };
3159
3067
 
3160
- for (let i = 0; i < instance._features.length; i++) {
3161
- const feature = instance._features[i];
3162
- Object.assign(row, feature == null ? void 0 : feature.createRow == null ? void 0 : feature.createRow(row, instance));
3068
+ for (let i = 0; i < table._features.length; i++) {
3069
+ const feature = table._features[i];
3070
+ Object.assign(row, feature == null ? void 0 : feature.createRow == null ? void 0 : feature.createRow(row, table));
3163
3071
  }
3164
3072
 
3165
3073
  return row;
3166
3074
  };
3167
3075
 
3168
3076
  function getCoreRowModel() {
3169
- return instance => memo(() => [instance.options.data], data => {
3077
+ return table => memo(() => [table.options.data], data => {
3170
3078
  const rowModel = {
3171
3079
  rows: [],
3172
3080
  flatRows: [],
@@ -3188,18 +3096,18 @@
3188
3096
  // }
3189
3097
  // }
3190
3098
  // Make the row
3191
- const row = createRow(instance, instance._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); // Keep track of every row in a flat array
3099
+ const row = createRow(table, table._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); // Keep track of every row in a flat array
3192
3100
 
3193
3101
  rowModel.flatRows.push(row); // Also keep track of every row by its ID
3194
3102
 
3195
- rowModel.rowsById[row.id] = row; // Push instance row into parent
3103
+ rowModel.rowsById[row.id] = row; // Push table row into parent
3196
3104
 
3197
3105
  rows.push(row); // Get the original subrows
3198
3106
 
3199
- if (instance.options.getSubRows) {
3107
+ if (table.options.getSubRows) {
3200
3108
  var _row$originalSubRows;
3201
3109
 
3202
- row.originalSubRows = instance.options.getSubRows(originalRows[i], i); // Then recursively access them
3110
+ row.originalSubRows = table.options.getSubRows(originalRows[i], i); // Then recursively access them
3203
3111
 
3204
3112
  if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
3205
3113
  row.subRows = accessRows(row.originalSubRows, depth + 1, row);
@@ -3215,24 +3123,24 @@
3215
3123
  }, {
3216
3124
  key: 'getRowModel',
3217
3125
  debug: () => {
3218
- var _instance$options$deb;
3126
+ var _table$options$debugA;
3219
3127
 
3220
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3128
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3221
3129
  },
3222
3130
  onChange: () => {
3223
- instance._autoResetPageIndex();
3131
+ table._autoResetPageIndex();
3224
3132
  }
3225
3133
  });
3226
3134
  }
3227
3135
 
3228
- function filterRows(rows, filterRowImpl, instance) {
3229
- if (instance.options.filterFromLeafRows) {
3230
- return filterRowModelFromLeafs(rows, filterRowImpl, instance);
3136
+ function filterRows(rows, filterRowImpl, table) {
3137
+ if (table.options.filterFromLeafRows) {
3138
+ return filterRowModelFromLeafs(rows, filterRowImpl, table);
3231
3139
  }
3232
3140
 
3233
- return filterRowModelFromRoot(rows, filterRowImpl, instance);
3141
+ return filterRowModelFromRoot(rows, filterRowImpl, table);
3234
3142
  }
3235
- function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
3143
+ function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
3236
3144
  const newFilteredFlatRows = [];
3237
3145
  const newFilteredRowsById = {};
3238
3146
 
@@ -3246,7 +3154,7 @@
3246
3154
  let row = rowsToFilter[i];
3247
3155
 
3248
3156
  if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
3249
- const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3157
+ const newRow = createRow(table, row.id, row.original, row.index, row.depth);
3250
3158
  newRow.columnFilters = row.columnFilters;
3251
3159
  newRow.subRows = recurseFilterRows(row.subRows);
3252
3160
 
@@ -3273,7 +3181,7 @@
3273
3181
  rowsById: newFilteredRowsById
3274
3182
  };
3275
3183
  }
3276
- function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
3184
+ function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
3277
3185
  const newFilteredFlatRows = [];
3278
3186
  const newFilteredRowsById = {}; // Filters top level and nested rows
3279
3187
 
@@ -3290,7 +3198,7 @@
3290
3198
  var _row$subRows2;
3291
3199
 
3292
3200
  if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
3293
- const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3201
+ const newRow = createRow(table, row.id, row.original, row.index, row.depth);
3294
3202
  newRow.subRows = recurseFilterRows(row.subRows);
3295
3203
  row = newRow;
3296
3204
  }
@@ -3312,7 +3220,7 @@
3312
3220
  }
3313
3221
 
3314
3222
  function getFilteredRowModel() {
3315
- return instance => memo(() => [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
3223
+ return table => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
3316
3224
  if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
3317
3225
  for (let i = 0; i < rowModel.flatRows.length; i++) {
3318
3226
  rowModel.flatRows[i].columnFilters = {};
@@ -3327,7 +3235,7 @@
3327
3235
  (columnFilters != null ? columnFilters : []).forEach(d => {
3328
3236
  var _filterFn$resolveFilt;
3329
3237
 
3330
- const column = instance.getColumn(d.id);
3238
+ const column = table.getColumn(d.id);
3331
3239
 
3332
3240
  if (!column) {
3333
3241
  {
@@ -3352,8 +3260,8 @@
3352
3260
  });
3353
3261
  });
3354
3262
  const filterableIds = columnFilters.map(d => d.id);
3355
- const globalFilterFn = instance.getGlobalFilterFn();
3356
- const globallyFilterableColumns = instance.getAllLeafColumns().filter(column => column.getCanGlobalFilter());
3263
+ const globalFilterFn = table.getGlobalFilterFn();
3264
+ const globallyFilterableColumns = table.getAllLeafColumns().filter(column => column.getCanGlobalFilter());
3357
3265
 
3358
3266
  if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
3359
3267
  filterableIds.push('__global__');
@@ -3417,22 +3325,22 @@
3417
3325
  }; // Filter final rows using all of the active filters
3418
3326
 
3419
3327
 
3420
- return filterRows(rowModel.rows, filterRowsImpl, instance);
3328
+ return filterRows(rowModel.rows, filterRowsImpl, table);
3421
3329
  }, {
3422
3330
  key: 'getFilteredRowModel',
3423
3331
  debug: () => {
3424
- var _instance$options$deb;
3332
+ var _table$options$debugA;
3425
3333
 
3426
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3334
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3427
3335
  },
3428
3336
  onChange: () => {
3429
- instance._autoResetPageIndex();
3337
+ table._autoResetPageIndex();
3430
3338
  }
3431
3339
  });
3432
3340
  }
3433
3341
 
3434
3342
  function getFacetedRowModel() {
3435
- return (instance, columnId) => memo(() => [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter, instance.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {
3343
+ return (table, columnId) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter, table.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {
3436
3344
  if (!preRowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
3437
3345
  return preRowModel;
3438
3346
  }
@@ -3450,20 +3358,20 @@
3450
3358
  return true;
3451
3359
  };
3452
3360
 
3453
- return filterRows(preRowModel.rows, filterRowsImpl, instance);
3361
+ return filterRows(preRowModel.rows, filterRowsImpl, table);
3454
3362
  }, {
3455
3363
  key: 'getFacetedRowModel_' + columnId,
3456
3364
  debug: () => {
3457
- var _instance$options$deb;
3365
+ var _table$options$debugA;
3458
3366
 
3459
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3367
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3460
3368
  },
3461
3369
  onChange: () => {}
3462
3370
  });
3463
3371
  }
3464
3372
 
3465
3373
  function getFacetedUniqueValues() {
3466
- return (instance, columnId) => memo(() => [instance.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3374
+ return (table, columnId) => memo(() => [table.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3467
3375
  let facetedUniqueValues = new Map();
3468
3376
 
3469
3377
  for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
@@ -3484,16 +3392,16 @@
3484
3392
  }, {
3485
3393
  key: 'getFacetedUniqueValues_' + columnId,
3486
3394
  debug: () => {
3487
- var _instance$options$deb;
3395
+ var _table$options$debugA;
3488
3396
 
3489
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3397
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3490
3398
  },
3491
3399
  onChange: () => {}
3492
3400
  });
3493
3401
  }
3494
3402
 
3495
3403
  function getFacetedMinMaxValues() {
3496
- return (instance, columnId) => memo(() => [instance.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3404
+ return (table, columnId) => memo(() => [table.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3497
3405
  var _facetedRowModel$flat;
3498
3406
 
3499
3407
  const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
@@ -3520,27 +3428,27 @@
3520
3428
  }, {
3521
3429
  key: 'getFacetedMinMaxValues_' + columnId,
3522
3430
  debug: () => {
3523
- var _instance$options$deb;
3431
+ var _table$options$debugA;
3524
3432
 
3525
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3433
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3526
3434
  },
3527
3435
  onChange: () => {}
3528
3436
  });
3529
3437
  }
3530
3438
 
3531
3439
  function getSortedRowModel() {
3532
- return instance => memo(() => [instance.getState().sorting, instance.getPreSortedRowModel()], (sorting, rowModel) => {
3440
+ return table => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
3533
3441
  if (!rowModel.rows.length || !(sorting != null && sorting.length)) {
3534
3442
  return rowModel;
3535
3443
  }
3536
3444
 
3537
- const sortingState = instance.getState().sorting;
3445
+ const sortingState = table.getState().sorting;
3538
3446
  const sortedFlatRows = []; // Filter out sortings that correspond to non existing columns
3539
3447
 
3540
- const availableSorting = sortingState.filter(sort => instance.getColumn(sort.id).getCanSort());
3448
+ const availableSorting = sortingState.filter(sort => table.getColumn(sort.id).getCanSort());
3541
3449
  const columnInfoById = {};
3542
3450
  availableSorting.forEach(sortEntry => {
3543
- const column = instance.getColumn(sortEntry.id);
3451
+ const column = table.getColumn(sortEntry.id);
3544
3452
  columnInfoById[sortEntry.id] = {
3545
3453
  sortUndefined: column.columnDef.sortUndefined,
3546
3454
  invertSorting: column.columnDef.invertSorting,
@@ -3610,24 +3518,24 @@
3610
3518
  }, {
3611
3519
  key: 'getSortedRowModel',
3612
3520
  debug: () => {
3613
- var _instance$options$deb;
3521
+ var _table$options$debugA;
3614
3522
 
3615
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3523
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3616
3524
  },
3617
3525
  onChange: () => {
3618
- instance._autoResetPageIndex();
3526
+ table._autoResetPageIndex();
3619
3527
  }
3620
3528
  });
3621
3529
  }
3622
3530
 
3623
3531
  function getGroupedRowModel() {
3624
- return instance => memo(() => [instance.getState().grouping, instance.getPreGroupedRowModel()], (grouping, rowModel) => {
3532
+ return table => memo(() => [table.getState().grouping, table.getPreGroupedRowModel()], (grouping, rowModel) => {
3625
3533
  if (!rowModel.rows.length || !grouping.length) {
3626
3534
  return rowModel;
3627
3535
  } // Filter the grouping list down to columns that exist
3628
3536
 
3629
3537
 
3630
- const existingGrouping = grouping.filter(columnId => instance.getColumn(columnId));
3538
+ const existingGrouping = grouping.filter(columnId => table.getColumn(columnId));
3631
3539
  const groupedFlatRows = [];
3632
3540
  const groupedRowsById = {}; // const onlyGroupedFlatRows: Row[] = [];
3633
3541
  // const onlyGroupedRowsById: Record<RowId, Row> = {};
@@ -3657,7 +3565,7 @@
3657
3565
  const subRows = groupUpRecursively(groupedRows, depth + 1, id); // Flatten the leaf rows of the rows in this group
3658
3566
 
3659
3567
  const leafRows = depth ? flattenBy(groupedRows, row => row.subRows) : groupedRows;
3660
- const row = createRow(instance, id, undefined, index, depth);
3568
+ const row = createRow(table, id, undefined, index, depth);
3661
3569
  Object.assign(row, {
3662
3570
  groupingColumnId: columnId,
3663
3571
  groupingValue,
@@ -3684,7 +3592,7 @@
3684
3592
  } // Aggregate the values
3685
3593
 
3686
3594
 
3687
- const column = instance.getColumn(columnId);
3595
+ const column = table.getColumn(columnId);
3688
3596
  const aggregateFn = column.getAggregationFn();
3689
3597
 
3690
3598
  if (aggregateFn) {
@@ -3727,15 +3635,15 @@
3727
3635
  }, {
3728
3636
  key: 'getGroupedRowModel',
3729
3637
  debug: () => {
3730
- var _instance$options$deb;
3638
+ var _table$options$debugA;
3731
3639
 
3732
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3640
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3733
3641
  },
3734
3642
  onChange: () => {
3735
- instance._queue(() => {
3736
- instance._autoResetExpanded();
3643
+ table._queue(() => {
3644
+ table._autoResetExpanded();
3737
3645
 
3738
- instance._autoResetPageIndex();
3646
+ table._autoResetPageIndex();
3739
3647
  });
3740
3648
  }
3741
3649
  });
@@ -3758,7 +3666,7 @@
3758
3666
  }
3759
3667
 
3760
3668
  function getExpandedRowModel() {
3761
- return instance => memo(() => [instance.getState().expanded, instance.getPreExpandedRowModel(), instance.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3669
+ return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3762
3670
  if (!rowModel.rows.length || // Do not expand if rows are not included in pagination
3763
3671
  !paginateExpandedRows || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3764
3672
  return rowModel;
@@ -3768,13 +3676,13 @@
3768
3676
  }, {
3769
3677
  key: 'getExpandedRowModel',
3770
3678
  debug: () => {
3771
- var _instance$options$deb;
3679
+ var _table$options$debugA;
3772
3680
 
3773
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3681
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3774
3682
  }
3775
3683
  });
3776
3684
  }
3777
- function expandRows(rowModel, instance) {
3685
+ function expandRows(rowModel, table) {
3778
3686
  const expandedRows = [];
3779
3687
 
3780
3688
  const handleRow = row => {
@@ -3796,7 +3704,7 @@
3796
3704
  }
3797
3705
 
3798
3706
  function getPaginationRowModel(opts) {
3799
- return instance => memo(() => [instance.getState().pagination, instance.getPrePaginationRowModel()], (pagination, rowModel) => {
3707
+ return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel()], (pagination, rowModel) => {
3800
3708
  if (!rowModel.rows.length) {
3801
3709
  return rowModel;
3802
3710
  }
@@ -3815,7 +3723,7 @@
3815
3723
  rows = rows.slice(pageStart, pageEnd);
3816
3724
  let paginatedRowModel;
3817
3725
 
3818
- if (!instance.options.paginateExpandedRows) {
3726
+ if (!table.options.paginateExpandedRows) {
3819
3727
  paginatedRowModel = expandRows({
3820
3728
  rows,
3821
3729
  flatRows,
@@ -3844,9 +3752,9 @@
3844
3752
  }, {
3845
3753
  key: 'getPaginationRowModel',
3846
3754
  debug: () => {
3847
- var _instance$options$deb;
3755
+ var _table$options$debugA;
3848
3756
 
3849
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3757
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3850
3758
  }
3851
3759
  });
3852
3760
  }
@@ -3866,8 +3774,7 @@
3866
3774
  exports.buildHeaderGroups = buildHeaderGroups;
3867
3775
  exports.createColumn = createColumn;
3868
3776
  exports.createRow = createRow;
3869
- exports.createTableFactory = createTableFactory;
3870
- exports.createTableInstance = createTableInstance;
3777
+ exports.createTable = createTable;
3871
3778
  exports.defaultColumnSizing = defaultColumnSizing;
3872
3779
  exports.expandRows = expandRows;
3873
3780
  exports.filterFns = filterFns;
@@ -3884,6 +3791,7 @@
3884
3791
  exports.getSortedRowModel = getSortedRowModel;
3885
3792
  exports.isFunction = isFunction;
3886
3793
  exports.isRowSelected = isRowSelected;
3794
+ exports.isSubRowSelected = isSubRowSelected;
3887
3795
  exports.makeStateUpdater = makeStateUpdater;
3888
3796
  exports.memo = memo;
3889
3797
  exports.noop = noop;