@tanstack/table-core 8.0.13 → 8.0.14

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 +67 -67
  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 +2 -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 +567 -670
  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 +284 -360
  60. package/build/umd/index.development.js +567 -671
  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 +97 -108
  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,48 @@ 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();
2187
+ } = table.getState();
2225
2188
  return isRowSelected(row, rowSelection) === true;
2226
2189
  },
2227
2190
  getIsSomeSelected: () => {
2228
2191
  const {
2229
2192
  rowSelection
2230
- } = instance.getState();
2193
+ } = table.getState();
2231
2194
  return isRowSelected(row, rowSelection) === 'some';
2232
2195
  },
2233
2196
  getCanSelect: () => {
2234
- var _instance$options$ena;
2197
+ var _table$options$enable;
2235
2198
 
2236
- if (typeof instance.options.enableRowSelection === 'function') {
2237
- return instance.options.enableRowSelection(row);
2199
+ if (typeof table.options.enableRowSelection === 'function') {
2200
+ return table.options.enableRowSelection(row);
2238
2201
  }
2239
2202
 
2240
- return (_instance$options$ena = instance.options.enableRowSelection) != null ? _instance$options$ena : true;
2203
+ return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
2241
2204
  },
2242
2205
  getCanSelectSubRows: () => {
2243
- var _instance$options$ena2;
2206
+ var _table$options$enable2;
2244
2207
 
2245
- if (typeof instance.options.enableSubRowSelection === 'function') {
2246
- return instance.options.enableSubRowSelection(row);
2208
+ if (typeof table.options.enableSubRowSelection === 'function') {
2209
+ return table.options.enableSubRowSelection(row);
2247
2210
  }
2248
2211
 
2249
- return (_instance$options$ena2 = instance.options.enableSubRowSelection) != null ? _instance$options$ena2 : true;
2212
+ return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
2250
2213
  },
2251
2214
  getCanMultiSelect: () => {
2252
- var _instance$options$ena3;
2215
+ var _table$options$enable3;
2253
2216
 
2254
- if (typeof instance.options.enableMultiRowSelection === 'function') {
2255
- return instance.options.enableMultiRowSelection(row);
2217
+ if (typeof table.options.enableMultiRowSelection === 'function') {
2218
+ return table.options.enableMultiRowSelection(row);
2256
2219
  }
2257
2220
 
2258
- return (_instance$options$ena3 = instance.options.enableMultiRowSelection) != null ? _instance$options$ena3 : true;
2221
+ return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
2259
2222
  },
2260
2223
  getToggleSelectedHandler: () => {
2261
2224
  const canSelect = row.getCanSelect();
@@ -2270,13 +2233,13 @@ const RowSelection = {
2270
2233
  }
2271
2234
  };
2272
2235
 
2273
- const mutateRowIsSelected = (selectedRowIds, id, value, instance) => {
2236
+ const mutateRowIsSelected = (selectedRowIds, id, value, table) => {
2274
2237
  var _row$subRows;
2275
2238
 
2276
- const row = instance.getRow(id);
2239
+ const row = table.getRow(id);
2277
2240
  row.getIsGrouped(); // if ( // TODO: enforce grouping row selection rules
2278
2241
  // !isGrouped ||
2279
- // (isGrouped && instance.options.enableGroupingRowSelection)
2242
+ // (isGrouped && table.options.enableGroupingRowSelection)
2280
2243
  // ) {
2281
2244
 
2282
2245
  if (value) {
@@ -2287,12 +2250,12 @@ const mutateRowIsSelected = (selectedRowIds, id, value, instance) => {
2287
2250
 
2288
2251
 
2289
2252
  if ((_row$subRows = row.subRows) != null && _row$subRows.length && row.getCanSelectSubRows()) {
2290
- row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, instance));
2253
+ row.subRows.forEach(row => mutateRowIsSelected(selectedRowIds, row.id, value, table));
2291
2254
  }
2292
2255
  };
2293
2256
 
2294
- function selectRowsFn(instance, rowModel) {
2295
- const rowSelection = instance.getState().rowSelection;
2257
+ function selectRowsFn(table, rowModel) {
2258
+ const rowSelection = table.getState().rowSelection;
2296
2259
  const newSelectedFlatRows = [];
2297
2260
  const newSelectedRowsById = {}; // Filters top level and nested rows
2298
2261
 
@@ -2326,7 +2289,7 @@ function selectRowsFn(instance, rowModel) {
2326
2289
  rowsById: newSelectedRowsById
2327
2290
  };
2328
2291
  }
2329
- function isRowSelected(row, selection, instance) {
2292
+ function isRowSelected(row, selection, table) {
2330
2293
  if (selection[row.id]) {
2331
2294
  return true;
2332
2295
  }
@@ -2472,18 +2435,18 @@ const Sorting = {
2472
2435
  sortingFn: 'auto'
2473
2436
  };
2474
2437
  },
2475
- getDefaultOptions: instance => {
2438
+ getDefaultOptions: table => {
2476
2439
  return {
2477
- onSortingChange: makeStateUpdater('sorting', instance),
2440
+ onSortingChange: makeStateUpdater('sorting', table),
2478
2441
  isMultiSortEvent: e => {
2479
2442
  return e.shiftKey;
2480
2443
  }
2481
2444
  };
2482
2445
  },
2483
- createColumn: (column, instance) => {
2446
+ createColumn: (column, table) => {
2484
2447
  return {
2485
2448
  getAutoSortingFn: () => {
2486
- const firstRows = instance.getFilteredRowModel().flatRows.slice(10);
2449
+ const firstRows = table.getFilteredRowModel().flatRows.slice(10);
2487
2450
  let isString = false;
2488
2451
 
2489
2452
  for (const row of firstRows) {
@@ -2509,7 +2472,7 @@ const Sorting = {
2509
2472
  return sortingFns.basic;
2510
2473
  },
2511
2474
  getAutoSortDir: () => {
2512
- const firstRow = instance.getFilteredRowModel().flatRows[0];
2475
+ const firstRow = table.getFilteredRowModel().flatRows[0];
2513
2476
  const value = firstRow == null ? void 0 : firstRow.getValue(column.id);
2514
2477
 
2515
2478
  if (typeof value === 'string') {
@@ -2519,29 +2482,25 @@ const Sorting = {
2519
2482
  return 'desc';
2520
2483
  },
2521
2484
  getSortingFn: () => {
2522
- var _ref;
2523
-
2524
- const userSortingFn = instance.options.sortingFns;
2525
-
2526
2485
  if (!column) {
2527
2486
  throw new Error();
2528
2487
  }
2529
2488
 
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];
2489
+ return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : sortingFns[column.columnDef.sortingFn];
2531
2490
  },
2532
2491
  toggleSorting: (desc, multi) => {
2533
2492
  // if (column.columns.length) {
2534
2493
  // column.columns.forEach((c, i) => {
2535
2494
  // if (c.id) {
2536
- // instance.toggleColumnSorting(c.id, undefined, multi || !!i)
2495
+ // table.toggleColumnSorting(c.id, undefined, multi || !!i)
2537
2496
  // }
2538
2497
  // })
2539
2498
  // return
2540
2499
  // }
2541
- // this needs to be outside of instance.setSorting to be in sync with rerender
2500
+ // this needs to be outside of table.setSorting to be in sync with rerender
2542
2501
  const nextSortingOrder = column.getNextSortingOrder();
2543
- instance.setSorting(old => {
2544
- var _instance$options$ena, _instance$options$ena2;
2502
+ table.setSorting(old => {
2503
+ var _table$options$enable, _table$options$enable2;
2545
2504
 
2546
2505
  // Find any existing sorting for this column
2547
2506
  const existingSorting = old == null ? void 0 : old.find(d => d.id === column.id);
@@ -2570,9 +2529,9 @@ const Sorting = {
2570
2529
 
2571
2530
 
2572
2531
  if (sortAction === 'toggle' && ( // Must be toggling
2573
- (_instance$options$ena = instance.options.enableSortingRemoval) != null ? _instance$options$ena : true) && // If enableSortRemove, enable in general
2532
+ (_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && // If enableSortRemove, enable in general
2574
2533
  !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
2534
+ multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) && // If multi, don't allow if enableMultiRemove
2576
2535
  !nextSortingOrder // Finally, detect if it should indeed be removed
2577
2536
  ) {
2578
2537
  sortAction = 'remove';
@@ -2584,14 +2543,14 @@ const Sorting = {
2584
2543
  desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
2585
2544
  }];
2586
2545
  } else if (sortAction === 'add' && old != null && old.length) {
2587
- var _instance$options$max;
2546
+ var _table$options$maxMul;
2588
2547
 
2589
2548
  newSorting = [...old, {
2590
2549
  id: column.id,
2591
2550
  desc: hasDescDefined ? desc : nextSortingOrder === 'desc'
2592
2551
  }]; // Take latest n columns
2593
2552
 
2594
- newSorting.splice(0, newSorting.length - ((_instance$options$max = instance.options.maxMultiSortColCount) != null ? _instance$options$max : Number.MAX_SAFE_INTEGER));
2553
+ newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
2595
2554
  } else if (sortAction === 'toggle' && old != null && old.length) {
2596
2555
  // This flips (or sets) the
2597
2556
  newSorting = old.map(d => {
@@ -2611,9 +2570,9 @@ const Sorting = {
2611
2570
  });
2612
2571
  },
2613
2572
  getNextSortingOrder: () => {
2614
- var _ref2, _column$columnDef$sor;
2573
+ var _ref, _column$columnDef$sor;
2615
2574
 
2616
- const sortDescFirst = (_ref2 = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : instance.options.sortDescFirst) != null ? _ref2 : column.getAutoSortDir() === 'desc';
2575
+ const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
2617
2576
  const firstSortDirection = sortDescFirst ? 'desc' : 'asc';
2618
2577
  const isSorted = column.getIsSorted();
2619
2578
 
@@ -2628,59 +2587,59 @@ const Sorting = {
2628
2587
  }
2629
2588
  },
2630
2589
  getCanSort: () => {
2631
- var _column$columnDef$ena, _instance$options$ena3;
2590
+ var _column$columnDef$ena, _table$options$enable3;
2632
2591
 
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;
2592
+ 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
2593
  },
2635
2594
  getCanMultiSort: () => {
2636
- var _ref3, _column$columnDef$ena2;
2595
+ var _ref2, _column$columnDef$ena2;
2637
2596
 
2638
- return (_ref3 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : instance.options.enableMultiSort) != null ? _ref3 : !!column.accessorFn;
2597
+ return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
2639
2598
  },
2640
2599
  getIsSorted: () => {
2641
- var _instance$getState$so;
2600
+ var _table$getState$sorti;
2642
2601
 
2643
- const columnSort = (_instance$getState$so = instance.getState().sorting) == null ? void 0 : _instance$getState$so.find(d => d.id === column.id);
2602
+ const columnSort = (_table$getState$sorti = table.getState().sorting) == null ? void 0 : _table$getState$sorti.find(d => d.id === column.id);
2644
2603
  return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
2645
2604
  },
2646
2605
  getSortIndex: () => {
2647
- var _instance$getState$so2, _instance$getState$so3;
2606
+ var _table$getState$sorti2, _table$getState$sorti3;
2648
2607
 
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;
2608
+ 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
2609
  },
2651
2610
  clearSorting: () => {
2652
2611
  //clear sorting for just 1 column
2653
- instance.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
2612
+ table.setSorting(old => old != null && old.length ? old.filter(d => d.id !== column.id) : []);
2654
2613
  },
2655
2614
  getToggleSortingHandler: () => {
2656
2615
  const canSort = column.getCanSort();
2657
2616
  return e => {
2658
2617
  if (!canSort) return;
2659
2618
  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);
2619
+ column.toggleSorting == null ? void 0 : column.toggleSorting(undefined, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
2661
2620
  };
2662
2621
  }
2663
2622
  };
2664
2623
  },
2665
- createInstance: instance => {
2624
+ createTable: table => {
2666
2625
  return {
2667
- setSorting: updater => instance.options.onSortingChange == null ? void 0 : instance.options.onSortingChange(updater),
2626
+ setSorting: updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater),
2668
2627
  resetSorting: defaultState => {
2669
- var _instance$initialStat, _instance$initialStat2;
2628
+ var _table$initialState$s, _table$initialState;
2670
2629
 
2671
- instance.setSorting(defaultState ? [] : (_instance$initialStat = (_instance$initialStat2 = instance.initialState) == null ? void 0 : _instance$initialStat2.sorting) != null ? _instance$initialStat : []);
2630
+ table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
2672
2631
  },
2673
- getPreSortedRowModel: () => instance.getGroupedRowModel(),
2632
+ getPreSortedRowModel: () => table.getGroupedRowModel(),
2674
2633
  getSortedRowModel: () => {
2675
- if (!instance._getSortedRowModel && instance.options.getSortedRowModel) {
2676
- instance._getSortedRowModel = instance.options.getSortedRowModel(instance);
2634
+ if (!table._getSortedRowModel && table.options.getSortedRowModel) {
2635
+ table._getSortedRowModel = table.options.getSortedRowModel(table);
2677
2636
  }
2678
2637
 
2679
- if (instance.options.manualSorting || !instance._getSortedRowModel) {
2680
- return instance.getPreSortedRowModel();
2638
+ if (table.options.manualSorting || !table._getSortedRowModel) {
2639
+ return table.getPreSortedRowModel();
2681
2640
  }
2682
2641
 
2683
- return instance._getSortedRowModel();
2642
+ return table._getSortedRowModel();
2684
2643
  }
2685
2644
  };
2686
2645
  }
@@ -2694,29 +2653,29 @@ const Visibility = {
2694
2653
  ...state
2695
2654
  };
2696
2655
  },
2697
- getDefaultOptions: instance => {
2656
+ getDefaultOptions: table => {
2698
2657
  return {
2699
- onColumnVisibilityChange: makeStateUpdater('columnVisibility', instance)
2658
+ onColumnVisibilityChange: makeStateUpdater('columnVisibility', table)
2700
2659
  };
2701
2660
  },
2702
- createColumn: (column, instance) => {
2661
+ createColumn: (column, table) => {
2703
2662
  return {
2704
2663
  toggleVisibility: value => {
2705
2664
  if (column.getCanHide()) {
2706
- instance.setColumnVisibility(old => ({ ...old,
2665
+ table.setColumnVisibility(old => ({ ...old,
2707
2666
  [column.id]: value != null ? value : !column.getIsVisible()
2708
2667
  }));
2709
2668
  }
2710
2669
  },
2711
2670
  getIsVisible: () => {
2712
- var _instance$getState$co, _instance$getState$co2;
2671
+ var _table$getState$colum, _table$getState$colum2;
2713
2672
 
2714
- return (_instance$getState$co = (_instance$getState$co2 = instance.getState().columnVisibility) == null ? void 0 : _instance$getState$co2[column.id]) != null ? _instance$getState$co : true;
2673
+ return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
2715
2674
  },
2716
2675
  getCanHide: () => {
2717
- var _column$columnDef$ena, _instance$options$ena;
2676
+ var _column$columnDef$ena, _table$options$enable;
2718
2677
 
2719
- return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_instance$options$ena = instance.options.enableHiding) != null ? _instance$options$ena : true);
2678
+ return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
2720
2679
  },
2721
2680
  getToggleVisibilityHandler: () => {
2722
2681
  return e => {
@@ -2725,69 +2684,69 @@ const Visibility = {
2725
2684
  }
2726
2685
  };
2727
2686
  },
2728
- createRow: (row, instance) => {
2687
+ createRow: (row, table) => {
2729
2688
  return {
2730
- _getAllVisibleCells: memo(() => [row.getAllCells(), instance.getState().columnVisibility], cells => {
2689
+ _getAllVisibleCells: memo(() => [row.getAllCells(), table.getState().columnVisibility], cells => {
2731
2690
  return cells.filter(cell => cell.column.getIsVisible());
2732
2691
  }, {
2733
2692
  key: process.env.NODE_ENV === 'production' && 'row._getAllVisibleCells',
2734
2693
  debug: () => {
2735
- var _instance$options$deb;
2694
+ var _table$options$debugA;
2736
2695
 
2737
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
2696
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
2738
2697
  }
2739
2698
  }),
2740
2699
  getVisibleCells: memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
2741
2700
  key: process.env.NODE_ENV === 'development' && 'row.getVisibleCells',
2742
2701
  debug: () => {
2743
- var _instance$options$deb2;
2702
+ var _table$options$debugA2;
2744
2703
 
2745
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
2704
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
2746
2705
  }
2747
2706
  })
2748
2707
  };
2749
2708
  },
2750
- createInstance: instance => {
2709
+ createTable: table => {
2751
2710
  const makeVisibleColumnsMethod = (key, getColumns) => {
2752
2711
  return memo(() => [getColumns(), getColumns().filter(d => d.getIsVisible()).map(d => d.id).join('_')], columns => {
2753
2712
  return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
2754
2713
  }, {
2755
2714
  key,
2756
2715
  debug: () => {
2757
- var _instance$options$deb3;
2716
+ var _table$options$debugA3;
2758
2717
 
2759
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugColumns;
2718
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2760
2719
  }
2761
2720
  });
2762
2721
  };
2763
2722
 
2764
2723
  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),
2724
+ getVisibleFlatColumns: makeVisibleColumnsMethod('getVisibleFlatColumns', () => table.getAllFlatColumns()),
2725
+ getVisibleLeafColumns: makeVisibleColumnsMethod('getVisibleLeafColumns', () => table.getAllLeafColumns()),
2726
+ getLeftVisibleLeafColumns: makeVisibleColumnsMethod('getLeftVisibleLeafColumns', () => table.getLeftLeafColumns()),
2727
+ getRightVisibleLeafColumns: makeVisibleColumnsMethod('getRightVisibleLeafColumns', () => table.getRightLeafColumns()),
2728
+ getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns()),
2729
+ setColumnVisibility: updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater),
2771
2730
  resetColumnVisibility: defaultState => {
2772
- var _instance$initialStat;
2731
+ var _table$initialState$c;
2773
2732
 
2774
- instance.setColumnVisibility(defaultState ? {} : (_instance$initialStat = instance.initialState.columnVisibility) != null ? _instance$initialStat : {});
2733
+ table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
2775
2734
  },
2776
2735
  toggleAllColumnsVisible: value => {
2777
2736
  var _value;
2778
2737
 
2779
- value = (_value = value) != null ? _value : !instance.getIsAllColumnsVisible();
2780
- instance.setColumnVisibility(instance.getAllLeafColumns().reduce((obj, column) => ({ ...obj,
2738
+ value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
2739
+ table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({ ...obj,
2781
2740
  [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
2782
2741
  }), {}));
2783
2742
  },
2784
- getIsAllColumnsVisible: () => !instance.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible())),
2785
- getIsSomeColumnsVisible: () => instance.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible()),
2743
+ getIsAllColumnsVisible: () => !table.getAllLeafColumns().some(column => !(column.getIsVisible != null && column.getIsVisible())),
2744
+ getIsSomeColumnsVisible: () => table.getAllLeafColumns().some(column => column.getIsVisible == null ? void 0 : column.getIsVisible()),
2786
2745
  getToggleAllColumnsVisibilityHandler: () => {
2787
2746
  return e => {
2788
2747
  var _target;
2789
2748
 
2790
- instance.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
2749
+ table.toggleAllColumnsVisible((_target = e.target) == null ? void 0 : _target.checked);
2791
2750
  };
2792
2751
  }
2793
2752
  };
@@ -2796,24 +2755,24 @@ const Visibility = {
2796
2755
 
2797
2756
  const features = [Headers, Visibility, Ordering, Pinning, Filters, Sorting, Grouping, Expanding, Pagination, RowSelection, ColumnSizing]; //
2798
2757
 
2799
- function createTableInstance(options) {
2758
+ function createTable(options) {
2800
2759
  var _options$initialState;
2801
2760
 
2802
2761
  if (options.debugAll || options.debugTable) {
2803
2762
  console.info('Creating Table Instance...');
2804
2763
  }
2805
2764
 
2806
- let instance = {
2765
+ let table = {
2807
2766
  _features: features
2808
2767
  };
2809
2768
 
2810
- const defaultOptions = instance._features.reduce((obj, feature) => {
2811
- return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(instance));
2769
+ const defaultOptions = table._features.reduce((obj, feature) => {
2770
+ return Object.assign(obj, feature.getDefaultOptions == null ? void 0 : feature.getDefaultOptions(table));
2812
2771
  }, {});
2813
2772
 
2814
2773
  const mergeOptions = options => {
2815
- if (instance.options.mergeOptions) {
2816
- return instance.options.mergeOptions(defaultOptions, options);
2774
+ if (table.options.mergeOptions) {
2775
+ return table.options.mergeOptions(defaultOptions, options);
2817
2776
  }
2818
2777
 
2819
2778
  return { ...defaultOptions,
@@ -2826,7 +2785,7 @@ function createTableInstance(options) {
2826
2785
  ...((_options$initialState = options.initialState) != null ? _options$initialState : {})
2827
2786
  };
2828
2787
 
2829
- instance._features.forEach(feature => {
2788
+ table._features.forEach(feature => {
2830
2789
  var _feature$getInitialSt;
2831
2790
 
2832
2791
  initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
@@ -2859,48 +2818,37 @@ function createTableInstance(options) {
2859
2818
  }
2860
2819
  },
2861
2820
  reset: () => {
2862
- instance.setState(instance.initialState);
2821
+ table.setState(table.initialState);
2863
2822
  },
2864
2823
  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;
2824
+ const newOptions = functionalUpdate(updater, table.options);
2825
+ table.options = mergeOptions(newOptions);
2878
2826
  },
2879
2827
  getState: () => {
2880
- return instance.options.state;
2828
+ return table.options.state;
2881
2829
  },
2882
2830
  setState: updater => {
2883
- instance.options.onStateChange == null ? void 0 : instance.options.onStateChange(updater);
2831
+ table.options.onStateChange == null ? void 0 : table.options.onStateChange(updater);
2884
2832
  },
2885
2833
  _getRowId: (row, index, parent) => {
2886
- var _instance$options$get;
2834
+ var _table$options$getRow;
2887
2835
 
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);
2836
+ 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
2837
  },
2890
2838
  getCoreRowModel: () => {
2891
- if (!instance._getCoreRowModel) {
2892
- instance._getCoreRowModel = instance.options.getCoreRowModel(instance);
2839
+ if (!table._getCoreRowModel) {
2840
+ table._getCoreRowModel = table.options.getCoreRowModel(table);
2893
2841
  }
2894
2842
 
2895
- return instance._getCoreRowModel();
2843
+ return table._getCoreRowModel();
2896
2844
  },
2897
2845
  // The final calls start at the bottom of the model,
2898
2846
  // expanded rows, which then work their way up
2899
2847
  getRowModel: () => {
2900
- return instance.getPaginationRowModel();
2848
+ return table.getPaginationRowModel();
2901
2849
  },
2902
2850
  getRow: id => {
2903
- const row = instance.getRowModel().rowsById[id];
2851
+ const row = table.getRowModel().rowsById[id];
2904
2852
 
2905
2853
  if (!row) {
2906
2854
  if (process.env.NODE_ENV !== 'production') {
@@ -2912,7 +2860,7 @@ function createTableInstance(options) {
2912
2860
 
2913
2861
  return row;
2914
2862
  },
2915
- _getDefaultColumnDef: memo(() => [instance.options.defaultColumn], defaultColumn => {
2863
+ _getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {
2916
2864
  var _defaultColumn;
2917
2865
 
2918
2866
  defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
@@ -2920,32 +2868,32 @@ function createTableInstance(options) {
2920
2868
  header: props => props.header.column.id,
2921
2869
  footer: props => props.header.column.id,
2922
2870
  cell: props => {
2923
- var _props$getValue$toStr, _props$getValue;
2871
+ var _toString, _props$renderValue;
2924
2872
 
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;
2873
+ return (_toString = (_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _toString : null;
2926
2874
  },
2927
- ...instance._features.reduce((obj, feature) => {
2875
+ ...table._features.reduce((obj, feature) => {
2928
2876
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
2929
2877
  }, {}),
2930
2878
  ...defaultColumn
2931
2879
  };
2932
2880
  }, {
2933
2881
  debug: () => {
2934
- var _instance$options$deb;
2882
+ var _table$options$debugA;
2935
2883
 
2936
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugColumns;
2884
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
2937
2885
  },
2938
2886
  key: process.env.NODE_ENV === 'development' && 'getDefaultColumnDef'
2939
2887
  }),
2940
- _getColumnDefs: () => instance.options.columns,
2941
- getAllColumns: memo(() => [instance._getColumnDefs()], columnDefs => {
2888
+ _getColumnDefs: () => table.options.columns,
2889
+ getAllColumns: memo(() => [table._getColumnDefs()], columnDefs => {
2942
2890
  const recurseColumns = function (columnDefs, parent, depth) {
2943
2891
  if (depth === void 0) {
2944
2892
  depth = 0;
2945
2893
  }
2946
2894
 
2947
2895
  return columnDefs.map(columnDef => {
2948
- const column = createColumn(instance, columnDef, depth, parent);
2896
+ const column = createColumn(table, columnDef, depth, parent);
2949
2897
  column.columns = columnDef.columns ? recurseColumns(columnDef.columns, column, depth + 1) : [];
2950
2898
  return column;
2951
2899
  });
@@ -2955,24 +2903,24 @@ function createTableInstance(options) {
2955
2903
  }, {
2956
2904
  key: process.env.NODE_ENV === 'development' && 'getAllColumns',
2957
2905
  debug: () => {
2958
- var _instance$options$deb2;
2906
+ var _table$options$debugA2;
2959
2907
 
2960
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugColumns;
2908
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
2961
2909
  }
2962
2910
  }),
2963
- getAllFlatColumns: memo(() => [instance.getAllColumns()], allColumns => {
2911
+ getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {
2964
2912
  return allColumns.flatMap(column => {
2965
2913
  return column.getFlatColumns();
2966
2914
  });
2967
2915
  }, {
2968
2916
  key: process.env.NODE_ENV === 'development' && 'getAllFlatColumns',
2969
2917
  debug: () => {
2970
- var _instance$options$deb3;
2918
+ var _table$options$debugA3;
2971
2919
 
2972
- return (_instance$options$deb3 = instance.options.debugAll) != null ? _instance$options$deb3 : instance.options.debugColumns;
2920
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2973
2921
  }
2974
2922
  }),
2975
- _getAllFlatColumnsById: memo(() => [instance.getAllFlatColumns()], flatColumns => {
2923
+ _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {
2976
2924
  return flatColumns.reduce((acc, column) => {
2977
2925
  acc[column.id] = column;
2978
2926
  return acc;
@@ -2980,24 +2928,24 @@ function createTableInstance(options) {
2980
2928
  }, {
2981
2929
  key: process.env.NODE_ENV === 'development' && 'getAllFlatColumnsById',
2982
2930
  debug: () => {
2983
- var _instance$options$deb4;
2931
+ var _table$options$debugA4;
2984
2932
 
2985
- return (_instance$options$deb4 = instance.options.debugAll) != null ? _instance$options$deb4 : instance.options.debugColumns;
2933
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
2986
2934
  }
2987
2935
  }),
2988
- getAllLeafColumns: memo(() => [instance.getAllColumns(), instance._getOrderColumnsFn()], (allColumns, orderColumns) => {
2936
+ getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
2989
2937
  let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
2990
2938
  return orderColumns(leafColumns);
2991
2939
  }, {
2992
2940
  key: process.env.NODE_ENV === 'development' && 'getAllLeafColumns',
2993
2941
  debug: () => {
2994
- var _instance$options$deb5;
2942
+ var _table$options$debugA5;
2995
2943
 
2996
- return (_instance$options$deb5 = instance.options.debugAll) != null ? _instance$options$deb5 : instance.options.debugColumns;
2944
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
2997
2945
  }
2998
2946
  }),
2999
2947
  getColumn: columnId => {
3000
- const column = instance._getAllFlatColumnsById()[columnId];
2948
+ const column = table._getAllFlatColumnsById()[columnId];
3001
2949
 
3002
2950
  if (!column) {
3003
2951
  if (process.env.NODE_ENV !== 'production') {
@@ -3010,76 +2958,20 @@ function createTableInstance(options) {
3010
2958
  return column;
3011
2959
  }
3012
2960
  };
3013
- Object.assign(instance, coreInstance);
2961
+ Object.assign(table, coreInstance);
3014
2962
 
3015
- instance._features.forEach(feature => {
3016
- return Object.assign(instance, feature.createInstance == null ? void 0 : feature.createInstance(instance));
2963
+ table._features.forEach(feature => {
2964
+ return Object.assign(table, feature.createTable == null ? void 0 : feature.createTable(table));
3017
2965
  });
3018
2966
 
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
2967
  return table;
3076
2968
  }
3077
2969
 
3078
- function createCell(instance, row, column, columnId) {
2970
+ function createCell(table, row, column, columnId) {
3079
2971
  const getRenderValue = () => {
3080
2972
  var _cell$getValue;
3081
2973
 
3082
- return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : instance.options.renderFallbackValue;
2974
+ return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
3083
2975
  };
3084
2976
 
3085
2977
  const cell = {
@@ -3087,25 +2979,25 @@ function createCell(instance, row, column, columnId) {
3087
2979
  row,
3088
2980
  column,
3089
2981
  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
- }
2982
+ renderValue: getRenderValue,
2983
+ getContext: () => ({
2984
+ table,
2985
+ column,
2986
+ row,
2987
+ cell: cell,
2988
+ getValue: cell.getValue,
2989
+ renderValue: cell.renderValue
2990
+ })
3099
2991
  };
3100
2992
 
3101
- instance._features.forEach(feature => {
3102
- Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, instance));
2993
+ table._features.forEach(feature => {
2994
+ Object.assign(cell, feature.createCell == null ? void 0 : feature.createCell(cell, column, row, table));
3103
2995
  }, {});
3104
2996
 
3105
2997
  return cell;
3106
2998
  }
3107
2999
 
3108
- const createRow = (instance, id, original, rowIndex, depth, subRows) => {
3000
+ const createRow = (table, id, original, rowIndex, depth, subRows) => {
3109
3001
  let row = {
3110
3002
  id,
3111
3003
  index: rowIndex,
@@ -3117,7 +3009,7 @@ const createRow = (instance, id, original, rowIndex, depth, subRows) => {
3117
3009
  return row._valuesCache[columnId];
3118
3010
  }
3119
3011
 
3120
- const column = instance.getColumn(columnId);
3012
+ const column = table.getColumn(columnId);
3121
3013
 
3122
3014
  if (!column.accessorFn) {
3123
3015
  return undefined;
@@ -3126,18 +3018,23 @@ const createRow = (instance, id, original, rowIndex, depth, subRows) => {
3126
3018
  row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
3127
3019
  return row._valuesCache[columnId];
3128
3020
  },
3021
+ renderValue: columnId => {
3022
+ var _row$getValue;
3023
+
3024
+ return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
3025
+ },
3129
3026
  subRows: subRows != null ? subRows : [],
3130
3027
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
3131
- getAllCells: memo(() => [instance.getAllLeafColumns()], leafColumns => {
3028
+ getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {
3132
3029
  return leafColumns.map(column => {
3133
- return createCell(instance, row, column, column.id);
3030
+ return createCell(table, row, column, column.id);
3134
3031
  });
3135
3032
  }, {
3136
3033
  key: process.env.NODE_ENV === 'development' && 'row.getAllCells',
3137
3034
  debug: () => {
3138
- var _instance$options$deb;
3035
+ var _table$options$debugA;
3139
3036
 
3140
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugRows;
3037
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
3141
3038
  }
3142
3039
  }),
3143
3040
  _getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {
@@ -3148,23 +3045,23 @@ const createRow = (instance, id, original, rowIndex, depth, subRows) => {
3148
3045
  }, {
3149
3046
  key: process.env.NODE_ENV === 'production' && 'row.getAllCellsByColumnId',
3150
3047
  debug: () => {
3151
- var _instance$options$deb2;
3048
+ var _table$options$debugA2;
3152
3049
 
3153
- return (_instance$options$deb2 = instance.options.debugAll) != null ? _instance$options$deb2 : instance.options.debugRows;
3050
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
3154
3051
  }
3155
3052
  })
3156
3053
  };
3157
3054
 
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));
3055
+ for (let i = 0; i < table._features.length; i++) {
3056
+ const feature = table._features[i];
3057
+ Object.assign(row, feature == null ? void 0 : feature.createRow == null ? void 0 : feature.createRow(row, table));
3161
3058
  }
3162
3059
 
3163
3060
  return row;
3164
3061
  };
3165
3062
 
3166
3063
  function getCoreRowModel() {
3167
- return instance => memo(() => [instance.options.data], data => {
3064
+ return table => memo(() => [table.options.data], data => {
3168
3065
  const rowModel = {
3169
3066
  rows: [],
3170
3067
  flatRows: [],
@@ -3186,18 +3083,18 @@ function getCoreRowModel() {
3186
3083
  // }
3187
3084
  // }
3188
3085
  // 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
3086
+ const row = createRow(table, table._getRowId(originalRows[i], i, parent), originalRows[i], i, depth); // Keep track of every row in a flat array
3190
3087
 
3191
3088
  rowModel.flatRows.push(row); // Also keep track of every row by its ID
3192
3089
 
3193
- rowModel.rowsById[row.id] = row; // Push instance row into parent
3090
+ rowModel.rowsById[row.id] = row; // Push table row into parent
3194
3091
 
3195
3092
  rows.push(row); // Get the original subrows
3196
3093
 
3197
- if (instance.options.getSubRows) {
3094
+ if (table.options.getSubRows) {
3198
3095
  var _row$originalSubRows;
3199
3096
 
3200
- row.originalSubRows = instance.options.getSubRows(originalRows[i], i); // Then recursively access them
3097
+ row.originalSubRows = table.options.getSubRows(originalRows[i], i); // Then recursively access them
3201
3098
 
3202
3099
  if ((_row$originalSubRows = row.originalSubRows) != null && _row$originalSubRows.length) {
3203
3100
  row.subRows = accessRows(row.originalSubRows, depth + 1, row);
@@ -3213,24 +3110,24 @@ function getCoreRowModel() {
3213
3110
  }, {
3214
3111
  key: process.env.NODE_ENV === 'development' && 'getRowModel',
3215
3112
  debug: () => {
3216
- var _instance$options$deb;
3113
+ var _table$options$debugA;
3217
3114
 
3218
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3115
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3219
3116
  },
3220
3117
  onChange: () => {
3221
- instance._autoResetPageIndex();
3118
+ table._autoResetPageIndex();
3222
3119
  }
3223
3120
  });
3224
3121
  }
3225
3122
 
3226
- function filterRows(rows, filterRowImpl, instance) {
3227
- if (instance.options.filterFromLeafRows) {
3228
- return filterRowModelFromLeafs(rows, filterRowImpl, instance);
3123
+ function filterRows(rows, filterRowImpl, table) {
3124
+ if (table.options.filterFromLeafRows) {
3125
+ return filterRowModelFromLeafs(rows, filterRowImpl, table);
3229
3126
  }
3230
3127
 
3231
- return filterRowModelFromRoot(rows, filterRowImpl, instance);
3128
+ return filterRowModelFromRoot(rows, filterRowImpl, table);
3232
3129
  }
3233
- function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
3130
+ function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
3234
3131
  const newFilteredFlatRows = [];
3235
3132
  const newFilteredRowsById = {};
3236
3133
 
@@ -3244,7 +3141,7 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
3244
3141
  let row = rowsToFilter[i];
3245
3142
 
3246
3143
  if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
3247
- const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3144
+ const newRow = createRow(table, row.id, row.original, row.index, row.depth);
3248
3145
  newRow.columnFilters = row.columnFilters;
3249
3146
  newRow.subRows = recurseFilterRows(row.subRows);
3250
3147
 
@@ -3271,7 +3168,7 @@ function filterRowModelFromLeafs(rowsToFilter, filterRow, instance) {
3271
3168
  rowsById: newFilteredRowsById
3272
3169
  };
3273
3170
  }
3274
- function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
3171
+ function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
3275
3172
  const newFilteredFlatRows = [];
3276
3173
  const newFilteredRowsById = {}; // Filters top level and nested rows
3277
3174
 
@@ -3288,7 +3185,7 @@ function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
3288
3185
  var _row$subRows2;
3289
3186
 
3290
3187
  if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
3291
- const newRow = createRow(instance, row.id, row.original, row.index, row.depth);
3188
+ const newRow = createRow(table, row.id, row.original, row.index, row.depth);
3292
3189
  newRow.subRows = recurseFilterRows(row.subRows);
3293
3190
  row = newRow;
3294
3191
  }
@@ -3310,7 +3207,7 @@ function filterRowModelFromRoot(rowsToFilter, filterRow, instance) {
3310
3207
  }
3311
3208
 
3312
3209
  function getFilteredRowModel() {
3313
- return instance => memo(() => [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
3210
+ return table => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter], (rowModel, columnFilters, globalFilter) => {
3314
3211
  if (!rowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
3315
3212
  for (let i = 0; i < rowModel.flatRows.length; i++) {
3316
3213
  rowModel.flatRows[i].columnFilters = {};
@@ -3325,7 +3222,7 @@ function getFilteredRowModel() {
3325
3222
  (columnFilters != null ? columnFilters : []).forEach(d => {
3326
3223
  var _filterFn$resolveFilt;
3327
3224
 
3328
- const column = instance.getColumn(d.id);
3225
+ const column = table.getColumn(d.id);
3329
3226
 
3330
3227
  if (!column) {
3331
3228
  if (process.env.NODE_ENV !== 'production') {
@@ -3350,8 +3247,8 @@ function getFilteredRowModel() {
3350
3247
  });
3351
3248
  });
3352
3249
  const filterableIds = columnFilters.map(d => d.id);
3353
- const globalFilterFn = instance.getGlobalFilterFn();
3354
- const globallyFilterableColumns = instance.getAllLeafColumns().filter(column => column.getCanGlobalFilter());
3250
+ const globalFilterFn = table.getGlobalFilterFn();
3251
+ const globallyFilterableColumns = table.getAllLeafColumns().filter(column => column.getCanGlobalFilter());
3355
3252
 
3356
3253
  if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
3357
3254
  filterableIds.push('__global__');
@@ -3415,22 +3312,22 @@ function getFilteredRowModel() {
3415
3312
  }; // Filter final rows using all of the active filters
3416
3313
 
3417
3314
 
3418
- return filterRows(rowModel.rows, filterRowsImpl, instance);
3315
+ return filterRows(rowModel.rows, filterRowsImpl, table);
3419
3316
  }, {
3420
3317
  key: process.env.NODE_ENV === 'development' && 'getFilteredRowModel',
3421
3318
  debug: () => {
3422
- var _instance$options$deb;
3319
+ var _table$options$debugA;
3423
3320
 
3424
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3321
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3425
3322
  },
3426
3323
  onChange: () => {
3427
- instance._autoResetPageIndex();
3324
+ table._autoResetPageIndex();
3428
3325
  }
3429
3326
  });
3430
3327
  }
3431
3328
 
3432
3329
  function getFacetedRowModel() {
3433
- return (instance, columnId) => memo(() => [instance.getPreFilteredRowModel(), instance.getState().columnFilters, instance.getState().globalFilter, instance.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {
3330
+ return (table, columnId) => memo(() => [table.getPreFilteredRowModel(), table.getState().columnFilters, table.getState().globalFilter, table.getFilteredRowModel()], (preRowModel, columnFilters, globalFilter) => {
3434
3331
  if (!preRowModel.rows.length || !(columnFilters != null && columnFilters.length) && !globalFilter) {
3435
3332
  return preRowModel;
3436
3333
  }
@@ -3448,20 +3345,20 @@ function getFacetedRowModel() {
3448
3345
  return true;
3449
3346
  };
3450
3347
 
3451
- return filterRows(preRowModel.rows, filterRowsImpl, instance);
3348
+ return filterRows(preRowModel.rows, filterRowsImpl, table);
3452
3349
  }, {
3453
3350
  key: process.env.NODE_ENV === 'development' && 'getFacetedRowModel_' + columnId,
3454
3351
  debug: () => {
3455
- var _instance$options$deb;
3352
+ var _table$options$debugA;
3456
3353
 
3457
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3354
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3458
3355
  },
3459
3356
  onChange: () => {}
3460
3357
  });
3461
3358
  }
3462
3359
 
3463
3360
  function getFacetedUniqueValues() {
3464
- return (instance, columnId) => memo(() => [instance.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3361
+ return (table, columnId) => memo(() => [table.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3465
3362
  let facetedUniqueValues = new Map();
3466
3363
 
3467
3364
  for (let i = 0; i < facetedRowModel.flatRows.length; i++) {
@@ -3482,16 +3379,16 @@ function getFacetedUniqueValues() {
3482
3379
  }, {
3483
3380
  key: process.env.NODE_ENV === 'development' && 'getFacetedUniqueValues_' + columnId,
3484
3381
  debug: () => {
3485
- var _instance$options$deb;
3382
+ var _table$options$debugA;
3486
3383
 
3487
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3384
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3488
3385
  },
3489
3386
  onChange: () => {}
3490
3387
  });
3491
3388
  }
3492
3389
 
3493
3390
  function getFacetedMinMaxValues() {
3494
- return (instance, columnId) => memo(() => [instance.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3391
+ return (table, columnId) => memo(() => [table.getColumn(columnId).getFacetedRowModel()], facetedRowModel => {
3495
3392
  var _facetedRowModel$flat;
3496
3393
 
3497
3394
  const firstValue = (_facetedRowModel$flat = facetedRowModel.flatRows[0]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
@@ -3518,27 +3415,27 @@ function getFacetedMinMaxValues() {
3518
3415
  }, {
3519
3416
  key: process.env.NODE_ENV === 'development' && 'getFacetedMinMaxValues_' + columnId,
3520
3417
  debug: () => {
3521
- var _instance$options$deb;
3418
+ var _table$options$debugA;
3522
3419
 
3523
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3420
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3524
3421
  },
3525
3422
  onChange: () => {}
3526
3423
  });
3527
3424
  }
3528
3425
 
3529
3426
  function getSortedRowModel() {
3530
- return instance => memo(() => [instance.getState().sorting, instance.getPreSortedRowModel()], (sorting, rowModel) => {
3427
+ return table => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
3531
3428
  if (!rowModel.rows.length || !(sorting != null && sorting.length)) {
3532
3429
  return rowModel;
3533
3430
  }
3534
3431
 
3535
- const sortingState = instance.getState().sorting;
3432
+ const sortingState = table.getState().sorting;
3536
3433
  const sortedFlatRows = []; // Filter out sortings that correspond to non existing columns
3537
3434
 
3538
- const availableSorting = sortingState.filter(sort => instance.getColumn(sort.id).getCanSort());
3435
+ const availableSorting = sortingState.filter(sort => table.getColumn(sort.id).getCanSort());
3539
3436
  const columnInfoById = {};
3540
3437
  availableSorting.forEach(sortEntry => {
3541
- const column = instance.getColumn(sortEntry.id);
3438
+ const column = table.getColumn(sortEntry.id);
3542
3439
  columnInfoById[sortEntry.id] = {
3543
3440
  sortUndefined: column.columnDef.sortUndefined,
3544
3441
  invertSorting: column.columnDef.invertSorting,
@@ -3608,24 +3505,24 @@ function getSortedRowModel() {
3608
3505
  }, {
3609
3506
  key: process.env.NODE_ENV === 'development' && 'getSortedRowModel',
3610
3507
  debug: () => {
3611
- var _instance$options$deb;
3508
+ var _table$options$debugA;
3612
3509
 
3613
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3510
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3614
3511
  },
3615
3512
  onChange: () => {
3616
- instance._autoResetPageIndex();
3513
+ table._autoResetPageIndex();
3617
3514
  }
3618
3515
  });
3619
3516
  }
3620
3517
 
3621
3518
  function getGroupedRowModel() {
3622
- return instance => memo(() => [instance.getState().grouping, instance.getPreGroupedRowModel()], (grouping, rowModel) => {
3519
+ return table => memo(() => [table.getState().grouping, table.getPreGroupedRowModel()], (grouping, rowModel) => {
3623
3520
  if (!rowModel.rows.length || !grouping.length) {
3624
3521
  return rowModel;
3625
3522
  } // Filter the grouping list down to columns that exist
3626
3523
 
3627
3524
 
3628
- const existingGrouping = grouping.filter(columnId => instance.getColumn(columnId));
3525
+ const existingGrouping = grouping.filter(columnId => table.getColumn(columnId));
3629
3526
  const groupedFlatRows = [];
3630
3527
  const groupedRowsById = {}; // const onlyGroupedFlatRows: Row[] = [];
3631
3528
  // const onlyGroupedRowsById: Record<RowId, Row> = {};
@@ -3655,7 +3552,7 @@ function getGroupedRowModel() {
3655
3552
  const subRows = groupUpRecursively(groupedRows, depth + 1, id); // Flatten the leaf rows of the rows in this group
3656
3553
 
3657
3554
  const leafRows = depth ? flattenBy(groupedRows, row => row.subRows) : groupedRows;
3658
- const row = createRow(instance, id, undefined, index, depth);
3555
+ const row = createRow(table, id, undefined, index, depth);
3659
3556
  Object.assign(row, {
3660
3557
  groupingColumnId: columnId,
3661
3558
  groupingValue,
@@ -3682,7 +3579,7 @@ function getGroupedRowModel() {
3682
3579
  } // Aggregate the values
3683
3580
 
3684
3581
 
3685
- const column = instance.getColumn(columnId);
3582
+ const column = table.getColumn(columnId);
3686
3583
  const aggregateFn = column.getAggregationFn();
3687
3584
 
3688
3585
  if (aggregateFn) {
@@ -3725,15 +3622,15 @@ function getGroupedRowModel() {
3725
3622
  }, {
3726
3623
  key: process.env.NODE_ENV === 'development' && 'getGroupedRowModel',
3727
3624
  debug: () => {
3728
- var _instance$options$deb;
3625
+ var _table$options$debugA;
3729
3626
 
3730
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3627
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3731
3628
  },
3732
3629
  onChange: () => {
3733
- instance._queue(() => {
3734
- instance._autoResetExpanded();
3630
+ table._queue(() => {
3631
+ table._autoResetExpanded();
3735
3632
 
3736
- instance._autoResetPageIndex();
3633
+ table._autoResetPageIndex();
3737
3634
  });
3738
3635
  }
3739
3636
  });
@@ -3756,7 +3653,7 @@ function groupBy(rows, columnId) {
3756
3653
  }
3757
3654
 
3758
3655
  function getExpandedRowModel() {
3759
- return instance => memo(() => [instance.getState().expanded, instance.getPreExpandedRowModel(), instance.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3656
+ return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3760
3657
  if (!rowModel.rows.length || // Do not expand if rows are not included in pagination
3761
3658
  !paginateExpandedRows || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3762
3659
  return rowModel;
@@ -3766,13 +3663,13 @@ function getExpandedRowModel() {
3766
3663
  }, {
3767
3664
  key: process.env.NODE_ENV === 'development' && 'getExpandedRowModel',
3768
3665
  debug: () => {
3769
- var _instance$options$deb;
3666
+ var _table$options$debugA;
3770
3667
 
3771
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3668
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3772
3669
  }
3773
3670
  });
3774
3671
  }
3775
- function expandRows(rowModel, instance) {
3672
+ function expandRows(rowModel, table) {
3776
3673
  const expandedRows = [];
3777
3674
 
3778
3675
  const handleRow = row => {
@@ -3794,7 +3691,7 @@ function expandRows(rowModel, instance) {
3794
3691
  }
3795
3692
 
3796
3693
  function getPaginationRowModel(opts) {
3797
- return instance => memo(() => [instance.getState().pagination, instance.getPrePaginationRowModel()], (pagination, rowModel) => {
3694
+ return table => memo(() => [table.getState().pagination, table.getPrePaginationRowModel()], (pagination, rowModel) => {
3798
3695
  if (!rowModel.rows.length) {
3799
3696
  return rowModel;
3800
3697
  }
@@ -3813,7 +3710,7 @@ function getPaginationRowModel(opts) {
3813
3710
  rows = rows.slice(pageStart, pageEnd);
3814
3711
  let paginatedRowModel;
3815
3712
 
3816
- if (!instance.options.paginateExpandedRows) {
3713
+ if (!table.options.paginateExpandedRows) {
3817
3714
  paginatedRowModel = expandRows({
3818
3715
  rows,
3819
3716
  flatRows,
@@ -3842,12 +3739,12 @@ function getPaginationRowModel(opts) {
3842
3739
  }, {
3843
3740
  key: process.env.NODE_ENV === 'development' && 'getPaginationRowModel',
3844
3741
  debug: () => {
3845
- var _instance$options$deb;
3742
+ var _table$options$debugA;
3846
3743
 
3847
- return (_instance$options$deb = instance.options.debugAll) != null ? _instance$options$deb : instance.options.debugTable;
3744
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3848
3745
  }
3849
3746
  });
3850
3747
  }
3851
3748
 
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 };
3749
+ 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, makeStateUpdater, memo, noop, orderColumns, passiveEventSupported, reSplitAlphaNumeric, selectRowsFn, shouldAutoRemoveFilter, sortingFns };
3853
3750
  //# sourceMappingURL=index.js.map