@tanstack/table-core 8.0.13 → 8.1.1

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