@tanstack/svelte-table 8.6.0 → 8.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/lib/index.d.ts +7 -0
  2. package/build/lib/index.esm.js +202 -0
  3. package/build/lib/index.esm.js.map +1 -0
  4. package/build/{cjs/svelte-table/src → lib}/index.js +8 -46
  5. package/build/lib/index.js.map +1 -0
  6. package/build/lib/index.mjs +202 -0
  7. package/build/lib/index.mjs.map +1 -0
  8. package/build/lib/placeholder.d.ts +3 -0
  9. package/build/{cjs/svelte-table/src → lib}/placeholder.js +0 -0
  10. package/build/lib/placeholder.js.map +1 -0
  11. package/build/{cjs/svelte-table/src → lib}/placeholder.svelte.js +0 -0
  12. package/build/lib/placeholder.svelte.js.map +1 -0
  13. package/build/lib/render-component.d.ts +27 -0
  14. package/build/{cjs/svelte-table/src → lib}/render-component.js +0 -0
  15. package/build/lib/render-component.js.map +1 -0
  16. package/build/umd/index.development.js +387 -177
  17. package/build/umd/index.development.js.map +1 -1
  18. package/build/umd/index.production.js +1 -1
  19. package/build/umd/index.production.js.map +1 -1
  20. package/package.json +15 -7
  21. package/build/cjs/svelte-table/src/index.js.map +0 -1
  22. package/build/cjs/svelte-table/src/placeholder.js.map +0 -1
  23. package/build/cjs/svelte-table/src/placeholder.svelte.js.map +0 -1
  24. package/build/cjs/svelte-table/src/render-component.js.map +0 -1
  25. package/build/cjs/table-core/build/esm/index.js +0 -3446
  26. package/build/cjs/table-core/build/esm/index.js.map +0 -1
  27. package/build/esm/index.js +0 -3587
  28. package/build/esm/index.js.map +0 -1
  29. package/build/stats-html.html +0 -4044
  30. package/build/stats-react.json +0 -205
  31. package/build/types/index.d.ts +0 -48
@@ -102,13 +102,14 @@
102
102
  }
103
103
 
104
104
  function createColumn(table, columnDef, depth, parent) {
105
+ var _ref, _resolvedColumnDef$id;
105
106
  const defaultColumn = table._getDefaultColumnDef();
106
107
  const resolvedColumnDef = {
107
108
  ...defaultColumn,
108
109
  ...columnDef
109
110
  };
110
111
  const accessorKey = resolvedColumnDef.accessorKey;
111
- let id = resolvedColumnDef.id ?? (accessorKey ? accessorKey.replace('.', '_') : undefined) ?? (typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined);
112
+ let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? accessorKey.replace('.', '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
112
113
  let accessorFn;
113
114
  if (resolvedColumnDef.accessorFn) {
114
115
  accessorFn = resolvedColumnDef.accessorFn;
@@ -146,7 +147,10 @@
146
147
  return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];
147
148
  }, {
148
149
  key: "development" === 'production' ,
149
- debug: () => table.options.debugAll ?? table.options.debugColumns
150
+ debug: () => {
151
+ var _table$options$debugA;
152
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
153
+ }
150
154
  }),
151
155
  getLeafColumns: memo(() => [table._getOrderColumnsFn()], orderColumns => {
152
156
  var _column$columns2;
@@ -157,7 +161,10 @@
157
161
  return [column];
158
162
  }, {
159
163
  key: "development" === 'production' ,
160
- debug: () => table.options.debugAll ?? table.options.debugColumns
164
+ debug: () => {
165
+ var _table$options$debugA2;
166
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
167
+ }
161
168
  })
162
169
  };
163
170
  column = table._features.reduce((obj, feature) => {
@@ -171,7 +178,8 @@
171
178
  //
172
179
 
173
180
  function createHeader(table, column, options) {
174
- const id = options.id ?? column.id;
181
+ var _options$id;
182
+ const id = (_options$id = options.id) != null ? _options$id : column.id;
175
183
  let header = {
176
184
  id,
177
185
  column,
@@ -211,35 +219,50 @@
211
219
  // Header Groups
212
220
 
213
221
  getHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
214
- const leftColumns = (left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
215
- const rightColumns = (right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
222
+ var _left$map$filter, _right$map$filter;
223
+ const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
224
+ 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
225
  const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
217
226
  const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
218
227
  return headerGroups;
219
228
  }, {
220
229
  key: 'getHeaderGroups',
221
- debug: () => table.options.debugAll ?? table.options.debugHeaders
230
+ debug: () => {
231
+ var _table$options$debugA;
232
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
233
+ }
222
234
  }),
223
235
  getCenterHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
224
236
  leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
225
237
  return buildHeaderGroups(allColumns, leafColumns, table, 'center');
226
238
  }, {
227
239
  key: 'getCenterHeaderGroups',
228
- debug: () => table.options.debugAll ?? table.options.debugHeaders
240
+ debug: () => {
241
+ var _table$options$debugA2;
242
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
243
+ }
229
244
  }),
230
245
  getLeftHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
231
- const orderedLeafColumns = (left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
246
+ var _left$map$filter2;
247
+ const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
232
248
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
233
249
  }, {
234
250
  key: 'getLeftHeaderGroups',
235
- debug: () => table.options.debugAll ?? table.options.debugHeaders
251
+ debug: () => {
252
+ var _table$options$debugA3;
253
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
254
+ }
236
255
  }),
237
256
  getRightHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
238
- const orderedLeafColumns = (right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
257
+ var _right$map$filter2;
258
+ const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
239
259
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
240
260
  }, {
241
261
  key: 'getRightHeaderGroups',
242
- debug: () => table.options.debugAll ?? table.options.debugHeaders
262
+ debug: () => {
263
+ var _table$options$debugA4;
264
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
265
+ }
243
266
  }),
244
267
  // Footer Groups
245
268
 
@@ -247,25 +270,37 @@
247
270
  return [...headerGroups].reverse();
248
271
  }, {
249
272
  key: 'getFooterGroups',
250
- debug: () => table.options.debugAll ?? table.options.debugHeaders
273
+ debug: () => {
274
+ var _table$options$debugA5;
275
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
276
+ }
251
277
  }),
252
278
  getLeftFooterGroups: memo(() => [table.getLeftHeaderGroups()], headerGroups => {
253
279
  return [...headerGroups].reverse();
254
280
  }, {
255
281
  key: 'getLeftFooterGroups',
256
- debug: () => table.options.debugAll ?? table.options.debugHeaders
282
+ debug: () => {
283
+ var _table$options$debugA6;
284
+ return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
285
+ }
257
286
  }),
258
287
  getCenterFooterGroups: memo(() => [table.getCenterHeaderGroups()], headerGroups => {
259
288
  return [...headerGroups].reverse();
260
289
  }, {
261
290
  key: 'getCenterFooterGroups',
262
- debug: () => table.options.debugAll ?? table.options.debugHeaders
291
+ debug: () => {
292
+ var _table$options$debugA7;
293
+ return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
294
+ }
263
295
  }),
264
296
  getRightFooterGroups: memo(() => [table.getRightHeaderGroups()], headerGroups => {
265
297
  return [...headerGroups].reverse();
266
298
  }, {
267
299
  key: 'getRightFooterGroups',
268
- debug: () => table.options.debugAll ?? table.options.debugHeaders
300
+ debug: () => {
301
+ var _table$options$debugA8;
302
+ return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
303
+ }
269
304
  }),
270
305
  // Flat Headers
271
306
 
@@ -275,7 +310,10 @@
275
310
  }).flat();
276
311
  }, {
277
312
  key: 'getFlatHeaders',
278
- debug: () => table.options.debugAll ?? table.options.debugHeaders
313
+ debug: () => {
314
+ var _table$options$debugA9;
315
+ return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
316
+ }
279
317
  }),
280
318
  getLeftFlatHeaders: memo(() => [table.getLeftHeaderGroups()], left => {
281
319
  return left.map(headerGroup => {
@@ -283,7 +321,10 @@
283
321
  }).flat();
284
322
  }, {
285
323
  key: 'getLeftFlatHeaders',
286
- debug: () => table.options.debugAll ?? table.options.debugHeaders
324
+ debug: () => {
325
+ var _table$options$debugA10;
326
+ return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
327
+ }
287
328
  }),
288
329
  getCenterFlatHeaders: memo(() => [table.getCenterHeaderGroups()], left => {
289
330
  return left.map(headerGroup => {
@@ -291,7 +332,10 @@
291
332
  }).flat();
292
333
  }, {
293
334
  key: 'getCenterFlatHeaders',
294
- debug: () => table.options.debugAll ?? table.options.debugHeaders
335
+ debug: () => {
336
+ var _table$options$debugA11;
337
+ return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
338
+ }
295
339
  }),
296
340
  getRightFlatHeaders: memo(() => [table.getRightHeaderGroups()], left => {
297
341
  return left.map(headerGroup => {
@@ -299,7 +343,10 @@
299
343
  }).flat();
300
344
  }, {
301
345
  key: 'getRightFlatHeaders',
302
- debug: () => table.options.debugAll ?? table.options.debugHeaders
346
+ debug: () => {
347
+ var _table$options$debugA12;
348
+ return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
349
+ }
303
350
  }),
304
351
  // Leaf Headers
305
352
 
@@ -310,7 +357,10 @@
310
357
  });
311
358
  }, {
312
359
  key: 'getCenterLeafHeaders',
313
- debug: () => table.options.debugAll ?? table.options.debugHeaders
360
+ debug: () => {
361
+ var _table$options$debugA13;
362
+ return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
363
+ }
314
364
  }),
315
365
  getLeftLeafHeaders: memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
316
366
  return flatHeaders.filter(header => {
@@ -319,7 +369,10 @@
319
369
  });
320
370
  }, {
321
371
  key: 'getLeftLeafHeaders',
322
- debug: () => table.options.debugAll ?? table.options.debugHeaders
372
+ debug: () => {
373
+ var _table$options$debugA14;
374
+ return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
375
+ }
323
376
  }),
324
377
  getRightLeafHeaders: memo(() => [table.getRightFlatHeaders()], flatHeaders => {
325
378
  return flatHeaders.filter(header => {
@@ -328,22 +381,28 @@
328
381
  });
329
382
  }, {
330
383
  key: 'getRightLeafHeaders',
331
- debug: () => table.options.debugAll ?? table.options.debugHeaders
384
+ debug: () => {
385
+ var _table$options$debugA15;
386
+ return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
387
+ }
332
388
  }),
333
389
  getLeafHeaders: memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
334
- var _left$, _center$, _right$;
335
- return [...(((_left$ = left[0]) == null ? void 0 : _left$.headers) ?? []), ...(((_center$ = center[0]) == null ? void 0 : _center$.headers) ?? []), ...(((_right$ = right[0]) == null ? void 0 : _right$.headers) ?? [])].map(header => {
390
+ var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
391
+ 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 => {
336
392
  return header.getLeafHeaders();
337
393
  }).flat();
338
394
  }, {
339
395
  key: 'getLeafHeaders',
340
- debug: () => table.options.debugAll ?? table.options.debugHeaders
396
+ debug: () => {
397
+ var _table$options$debugA16;
398
+ return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
399
+ }
341
400
  })
342
401
  };
343
402
  }
344
403
  };
345
404
  function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
346
- var _headerGroups$;
405
+ var _headerGroups$0$heade, _headerGroups$;
347
406
  // Find the max depth of the columns:
348
407
  // build the leaf column row
349
408
  // build each buffer row going up
@@ -459,7 +518,7 @@
459
518
  };
460
519
  });
461
520
  };
462
- recurseHeadersForSpans(((_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) ?? []);
521
+ recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);
463
522
  return headerGroups;
464
523
  }
465
524
 
@@ -499,8 +558,9 @@
499
558
  createColumn: (column, table) => {
500
559
  return {
501
560
  getSize: () => {
561
+ var _column$columnDef$min, _ref, _column$columnDef$max;
502
562
  const columnSize = table.getState().columnSizing[column.id];
503
- return Math.min(Math.max(column.columnDef.minSize ?? defaultColumnSizing.minSize, columnSize ?? column.columnDef.size ?? defaultColumnSizing.size), column.columnDef.maxSize ?? defaultColumnSizing.maxSize);
563
+ 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);
504
564
  },
505
565
  getStart: position => {
506
566
  const columns = !position ? table.getVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
@@ -512,16 +572,17 @@
512
572
  return 0;
513
573
  },
514
574
  resetSize: () => {
515
- table.setColumnSizing(_ref => {
575
+ table.setColumnSizing(_ref2 => {
516
576
  let {
517
577
  [column.id]: _,
518
578
  ...rest
519
- } = _ref;
579
+ } = _ref2;
520
580
  return rest;
521
581
  });
522
582
  },
523
583
  getCanResize: () => {
524
- return (column.columnDef.enableResizing ?? true) && (table.options.enableColumnResizing ?? true);
584
+ var _column$columnDef$ena, _table$options$enable;
585
+ return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
525
586
  },
526
587
  getIsResizing: () => {
527
588
  return table.getState().columnSizingInfo.isResizingColumn === column.id;
@@ -536,7 +597,8 @@
536
597
  if (header.subHeaders.length) {
537
598
  header.subHeaders.forEach(recurse);
538
599
  } else {
539
- sum += header.column.getSize() ?? 0;
600
+ var _header$column$getSiz;
601
+ sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
540
602
  }
541
603
  };
542
604
  recurse(header);
@@ -572,10 +634,11 @@
572
634
  }
573
635
  let newColumnSizing = {};
574
636
  table.setColumnSizingInfo(old => {
575
- const deltaOffset = clientXPos - ((old == null ? void 0 : old.startOffset) ?? 0);
576
- const deltaPercentage = Math.max(deltaOffset / ((old == null ? void 0 : old.startSize) ?? 0), -0.999999);
577
- old.columnSizingStart.forEach(_ref2 => {
578
- let [columnId, headerSize] = _ref2;
637
+ var _old$startOffset, _old$startSize;
638
+ const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
639
+ const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
640
+ old.columnSizingStart.forEach(_ref3 => {
641
+ let [columnId, headerSize] = _ref3;
579
642
  newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
580
643
  });
581
644
  return {
@@ -660,34 +723,36 @@
660
723
  setColumnSizing: updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater),
661
724
  setColumnSizingInfo: updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater),
662
725
  resetColumnSizing: defaultState => {
663
- table.setColumnSizing(defaultState ? {} : table.initialState.columnSizing ?? {});
726
+ var _table$initialState$c;
727
+ table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
664
728
  },
665
729
  resetHeaderSizeInfo: defaultState => {
666
- table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : table.initialState.columnSizingInfo ?? getDefaultColumnSizingInfoState());
730
+ var _table$initialState$c2;
731
+ table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
667
732
  },
668
733
  getTotalSize: () => {
669
- var _table$getHeaderGroup;
670
- return ((_table$getHeaderGroup = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup.headers.reduce((sum, header) => {
734
+ var _table$getHeaderGroup, _table$getHeaderGroup2;
735
+ return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
671
736
  return sum + header.getSize();
672
- }, 0)) ?? 0;
737
+ }, 0)) != null ? _table$getHeaderGroup : 0;
673
738
  },
674
739
  getLeftTotalSize: () => {
675
- var _table$getLeftHeaderG;
676
- return ((_table$getLeftHeaderG = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG.headers.reduce((sum, header) => {
740
+ var _table$getLeftHeaderG, _table$getLeftHeaderG2;
741
+ return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
677
742
  return sum + header.getSize();
678
- }, 0)) ?? 0;
743
+ }, 0)) != null ? _table$getLeftHeaderG : 0;
679
744
  },
680
745
  getCenterTotalSize: () => {
681
- var _table$getCenterHeade;
682
- return ((_table$getCenterHeade = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade.headers.reduce((sum, header) => {
746
+ var _table$getCenterHeade, _table$getCenterHeade2;
747
+ return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
683
748
  return sum + header.getSize();
684
- }, 0)) ?? 0;
749
+ }, 0)) != null ? _table$getCenterHeade : 0;
685
750
  },
686
751
  getRightTotalSize: () => {
687
- var _table$getRightHeader;
688
- return ((_table$getRightHeader = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader.headers.reduce((sum, header) => {
752
+ var _table$getRightHeader, _table$getRightHeader2;
753
+ return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
689
754
  return sum + header.getSize();
690
- }, 0)) ?? 0;
755
+ }, 0)) != null ? _table$getRightHeader : 0;
691
756
  }
692
757
  };
693
758
  }
@@ -736,13 +801,14 @@
736
801
  let queued = false;
737
802
  return {
738
803
  _autoResetExpanded: () => {
804
+ var _ref, _table$options$autoRe;
739
805
  if (!registered) {
740
806
  table._queue(() => {
741
807
  registered = true;
742
808
  });
743
809
  return;
744
810
  }
745
- if (table.options.autoResetAll ?? table.options.autoResetExpanded ?? !table.options.manualExpanding) {
811
+ if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
746
812
  if (queued) return;
747
813
  queued = true;
748
814
  table._queue(() => {
@@ -753,15 +819,15 @@
753
819
  },
754
820
  setExpanded: updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater),
755
821
  toggleAllRowsExpanded: expanded => {
756
- if (expanded ?? !table.getIsAllRowsExpanded()) {
822
+ if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
757
823
  table.setExpanded(true);
758
824
  } else {
759
825
  table.setExpanded({});
760
826
  }
761
827
  },
762
828
  resetExpanded: defaultState => {
763
- var _table$initialState;
764
- table.setExpanded(defaultState ? {} : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) ?? {});
829
+ var _table$initialState$e, _table$initialState;
830
+ table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
765
831
  },
766
832
  getCanSomeRowsExpand: () => {
767
833
  return table.getRowModel().flatRows.some(row => row.getCanExpand());
@@ -820,6 +886,7 @@
820
886
  return {
821
887
  toggleExpanded: expanded => {
822
888
  table.setExpanded(old => {
889
+ var _expanded;
823
890
  const exists = old === true ? true : !!(old != null && old[row.id]);
824
891
  let oldExpanded = {};
825
892
  if (old === true) {
@@ -829,7 +896,7 @@
829
896
  } else {
830
897
  oldExpanded = old;
831
898
  }
832
- expanded = expanded ?? !exists;
899
+ expanded = (_expanded = expanded) != null ? _expanded : !exists;
833
900
  if (!exists && expanded) {
834
901
  return {
835
902
  ...oldExpanded,
@@ -847,12 +914,13 @@
847
914
  });
848
915
  },
849
916
  getIsExpanded: () => {
917
+ var _table$options$getIsR;
850
918
  const expanded = table.getState().expanded;
851
- return !!((table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) ?? (expanded === true || expanded != null && expanded[row.id]));
919
+ 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]));
852
920
  },
853
921
  getCanExpand: () => {
854
- var _row$subRows;
855
- return (table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) ?? ((table.options.enableExpanding ?? true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length));
922
+ var _table$options$getRow, _table$options$enable, _row$subRows;
923
+ return (_table$options$getRow = table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) != null ? _table$options$getRow : ((_table$options$enable = table.options.enableExpanding) != null ? _table$options$enable : true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length);
856
924
  },
857
925
  getToggleExpandedHandler: () => {
858
926
  const canExpand = row.getCanExpand();
@@ -1001,14 +1069,18 @@
1001
1069
  return filterFns.weakEquals;
1002
1070
  },
1003
1071
  getFilterFn: () => {
1004
- var _table$options$filter;
1005
- return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : ((_table$options$filter = table.options.filterFns) == null ? void 0 : _table$options$filter[column.columnDef.filterFn]) ?? filterFns[column.columnDef.filterFn];
1072
+ var _table$options$filter, _table$options$filter2;
1073
+ return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn()
1074
+ // @ts-ignore
1075
+ : (_table$options$filter = (_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[column.columnDef.filterFn]) != null ? _table$options$filter : filterFns[column.columnDef.filterFn];
1006
1076
  },
1007
1077
  getCanFilter: () => {
1008
- return (column.columnDef.enableColumnFilter ?? true) && (table.options.enableColumnFilters ?? true) && (table.options.enableFilters ?? true) && !!column.accessorFn;
1078
+ var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
1079
+ 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;
1009
1080
  },
1010
1081
  getCanGlobalFilter: () => {
1011
- return (column.columnDef.enableGlobalFilter ?? true) && (table.options.enableGlobalFilter ?? true) && (table.options.enableFilters ?? true) && ((table.options.getColumnCanGlobalFilter == null ? void 0 : table.options.getColumnCanGlobalFilter(column)) ?? true) && !!column.accessorFn;
1082
+ var _column$columnDef$ena2, _table$options$enable3, _table$options$enable4, _table$options$getCol;
1083
+ 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;
1012
1084
  },
1013
1085
  getIsFiltered: () => column.getFilterIndex() > -1,
1014
1086
  getFilterValue: () => {
@@ -1016,8 +1088,8 @@
1016
1088
  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;
1017
1089
  },
1018
1090
  getFilterIndex: () => {
1019
- var _table$getState$colum3;
1020
- return ((_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex(d => d.id === column.id)) ?? -1;
1091
+ var _table$getState$colum3, _table$getState$colum4;
1092
+ 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;
1021
1093
  },
1022
1094
  setFilterValue: value => {
1023
1095
  table.setColumnFilters(old => {
@@ -1027,19 +1099,21 @@
1027
1099
 
1028
1100
  //
1029
1101
  if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
1030
- return (old == null ? void 0 : old.filter(d => d.id !== column.id)) ?? [];
1102
+ var _old$filter;
1103
+ return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];
1031
1104
  }
1032
1105
  const newFilterObj = {
1033
1106
  id: column.id,
1034
1107
  value: newFilter
1035
1108
  };
1036
1109
  if (previousfilter) {
1037
- return (old == null ? void 0 : old.map(d => {
1110
+ var _old$map;
1111
+ return (_old$map = old == null ? void 0 : old.map(d => {
1038
1112
  if (d.id === column.id) {
1039
1113
  return newFilterObj;
1040
1114
  }
1041
1115
  return d;
1042
- })) ?? [];
1116
+ })) != null ? _old$map : [];
1043
1117
  }
1044
1118
  if (old != null && old.length) {
1045
1119
  return [...old, newFilterObj];
@@ -1085,11 +1159,13 @@
1085
1159
  return filterFns.includesString;
1086
1160
  },
1087
1161
  getGlobalFilterFn: () => {
1088
- var _table$options$filter2;
1162
+ var _table$options$filter3, _table$options$filter4;
1089
1163
  const {
1090
1164
  globalFilterFn: globalFilterFn
1091
1165
  } = table.options;
1092
- return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : ((_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) ?? filterFns[globalFilterFn];
1166
+ return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn()
1167
+ // @ts-ignore
1168
+ : (_table$options$filter3 = (_table$options$filter4 = table.options.filterFns) == null ? void 0 : _table$options$filter4[globalFilterFn]) != null ? _table$options$filter3 : filterFns[globalFilterFn];
1093
1169
  },
1094
1170
  setColumnFilters: updater => {
1095
1171
  const leafColumns = table.getAllLeafColumns();
@@ -1115,8 +1191,8 @@
1115
1191
  table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
1116
1192
  },
1117
1193
  resetColumnFilters: defaultState => {
1118
- var _table$initialState;
1119
- table.setColumnFilters(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) ?? []);
1194
+ var _table$initialState$c, _table$initialState;
1195
+ table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
1120
1196
  },
1121
1197
  getPreFilteredRowModel: () => table.getCoreRowModel(),
1122
1198
  getFilteredRowModel: () => {
@@ -1254,8 +1330,8 @@
1254
1330
  getDefaultColumnDef: () => {
1255
1331
  return {
1256
1332
  aggregatedCell: props => {
1257
- var _props$getValue;
1258
- return ((_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) ?? null;
1333
+ var _toString, _props$getValue;
1334
+ return (_toString = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
1259
1335
  },
1260
1336
  aggregationFn: 'auto'
1261
1337
  };
@@ -1280,11 +1356,12 @@
1280
1356
  if (old != null && old.includes(column.id)) {
1281
1357
  return old.filter(d => d !== column.id);
1282
1358
  }
1283
- return [...(old ?? []), column.id];
1359
+ return [...(old != null ? old : []), column.id];
1284
1360
  });
1285
1361
  },
1286
1362
  getCanGroup: () => {
1287
- return column.columnDef.enableGrouping ?? true ?? table.options.enableGrouping ?? true ?? !!column.accessorFn;
1363
+ var _ref, _ref2, _ref3, _column$columnDef$ena;
1364
+ 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;
1288
1365
  },
1289
1366
  getIsGrouped: () => {
1290
1367
  var _table$getState$group;
@@ -1312,11 +1389,11 @@
1312
1389
  }
1313
1390
  },
1314
1391
  getAggregationFn: () => {
1315
- var _table$options$aggreg;
1392
+ var _table$options$aggreg, _table$options$aggreg2;
1316
1393
  if (!column) {
1317
1394
  throw new Error();
1318
1395
  }
1319
- return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : ((_table$options$aggreg = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg[column.columnDef.aggregationFn]) ?? aggregationFns[column.columnDef.aggregationFn];
1396
+ return isFunction(column.columnDef.aggregationFn) ? column.columnDef.aggregationFn : column.columnDef.aggregationFn === 'auto' ? column.getAutoAggregationFn() : (_table$options$aggreg = (_table$options$aggreg2 = table.options.aggregationFns) == null ? void 0 : _table$options$aggreg2[column.columnDef.aggregationFn]) != null ? _table$options$aggreg : aggregationFns[column.columnDef.aggregationFn];
1320
1397
  }
1321
1398
  };
1322
1399
  },
@@ -1324,8 +1401,8 @@
1324
1401
  return {
1325
1402
  setGrouping: updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater),
1326
1403
  resetGrouping: defaultState => {
1327
- var _table$initialState;
1328
- table.setGrouping(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) ?? []);
1404
+ var _table$initialState$g, _table$initialState;
1405
+ table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
1329
1406
  },
1330
1407
  getPreGroupedRowModel: () => table.getFilteredRowModel(),
1331
1408
  getGroupedRowModel: () => {
@@ -1386,7 +1463,8 @@
1386
1463
  return {
1387
1464
  setColumnOrder: updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater),
1388
1465
  resetColumnOrder: defaultState => {
1389
- table.setColumnOrder(defaultState ? [] : table.initialState.columnOrder ?? []);
1466
+ var _table$initialState$c;
1467
+ table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
1390
1468
  },
1391
1469
  _getOrderColumnsFn: memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
1392
1470
  // Sort grouped columns to the start of the column list
@@ -1453,13 +1531,14 @@
1453
1531
  let queued = false;
1454
1532
  return {
1455
1533
  _autoResetPageIndex: () => {
1534
+ var _ref, _table$options$autoRe;
1456
1535
  if (!registered) {
1457
1536
  table._queue(() => {
1458
1537
  registered = true;
1459
1538
  });
1460
1539
  return;
1461
1540
  }
1462
- if (table.options.autoResetAll ?? table.options.autoResetPageIndex ?? !table.options.manualPagination) {
1541
+ if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
1463
1542
  if (queued) return;
1464
1543
  queued = true;
1465
1544
  table._queue(() => {
@@ -1476,7 +1555,8 @@
1476
1555
  return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
1477
1556
  },
1478
1557
  resetPagination: defaultState => {
1479
- table.setPagination(defaultState ? getDefaultPaginationState() : table.initialState.pagination ?? getDefaultPaginationState());
1558
+ var _table$initialState$p;
1559
+ table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
1480
1560
  },
1481
1561
  setPageIndex: updater => {
1482
1562
  table.setPagination(old => {
@@ -1490,12 +1570,12 @@
1490
1570
  });
1491
1571
  },
1492
1572
  resetPageIndex: defaultState => {
1493
- var _table$initialState, _table$initialState$p;
1494
- table.setPageIndex(defaultState ? defaultPageIndex : ((_table$initialState = table.initialState) == null ? void 0 : (_table$initialState$p = _table$initialState.pagination) == null ? void 0 : _table$initialState$p.pageIndex) ?? defaultPageIndex);
1573
+ var _table$initialState$p2, _table$initialState, _table$initialState$p3;
1574
+ 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);
1495
1575
  },
1496
1576
  resetPageSize: defaultState => {
1497
- var _table$initialState2, _table$initialState2$;
1498
- table.setPageSize(defaultState ? defaultPageSize : ((_table$initialState2 = table.initialState) == null ? void 0 : (_table$initialState2$ = _table$initialState2.pagination) == null ? void 0 : _table$initialState2$.pageSize) ?? defaultPageSize);
1577
+ var _table$initialState$p4, _table$initialState2, _table$initialState2$;
1578
+ 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);
1499
1579
  },
1500
1580
  setPageSize: updater => {
1501
1581
  table.setPagination(old => {
@@ -1510,7 +1590,8 @@
1510
1590
  });
1511
1591
  },
1512
1592
  setPageCount: updater => table.setPagination(old => {
1513
- let newPageCount = functionalUpdate(updater, table.options.pageCount ?? -1);
1593
+ var _table$options$pageCo;
1594
+ let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
1514
1595
  if (typeof newPageCount === 'number') {
1515
1596
  newPageCount = Math.max(-1, newPageCount);
1516
1597
  }
@@ -1527,7 +1608,10 @@
1527
1608
  return pageOptions;
1528
1609
  }, {
1529
1610
  key: 'getPageOptions',
1530
- debug: () => table.options.debugAll ?? table.options.debugTable
1611
+ debug: () => {
1612
+ var _table$options$debugA;
1613
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
1614
+ }
1531
1615
  }),
1532
1616
  getCanPreviousPage: () => table.getState().pagination.pageIndex > 0,
1533
1617
  getCanNextPage: () => {
@@ -1562,7 +1646,8 @@
1562
1646
  return table._getPaginationRowModel();
1563
1647
  },
1564
1648
  getPageCount: () => {
1565
- return table.options.pageCount ?? Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
1649
+ var _table$options$pageCo2;
1650
+ return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
1566
1651
  }
1567
1652
  };
1568
1653
  }
@@ -1591,27 +1676,33 @@
1591
1676
  pin: position => {
1592
1677
  const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);
1593
1678
  table.setColumnPinning(old => {
1679
+ var _old$left3, _old$right3;
1594
1680
  if (position === 'right') {
1681
+ var _old$left, _old$right;
1595
1682
  return {
1596
- left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1597
- right: [...((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
1683
+ left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1684
+ right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
1598
1685
  };
1599
1686
  }
1600
1687
  if (position === 'left') {
1688
+ var _old$left2, _old$right2;
1601
1689
  return {
1602
- left: [...((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1603
- right: ((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d)))
1690
+ left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1691
+ right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1604
1692
  };
1605
1693
  }
1606
1694
  return {
1607
- left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1608
- right: ((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d)))
1695
+ left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1696
+ right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1609
1697
  };
1610
1698
  });
1611
1699
  },
1612
1700
  getCanPin: () => {
1613
1701
  const leafColumns = column.getLeafColumns();
1614
- return leafColumns.some(d => (d.columnDef.enablePinning ?? true) && (table.options.enablePinning ?? true));
1702
+ return leafColumns.some(d => {
1703
+ var _d$columnDef$enablePi, _table$options$enable;
1704
+ return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_table$options$enable = table.options.enablePinning) != null ? _table$options$enable : true);
1705
+ });
1615
1706
  },
1616
1707
  getIsPinned: () => {
1617
1708
  const leafColumnIds = column.getLeafColumns().map(d => d.id);
@@ -1624,40 +1715,49 @@
1624
1715
  return isLeft ? 'left' : isRight ? 'right' : false;
1625
1716
  },
1626
1717
  getPinnedIndex: () => {
1627
- var _table$getState$colum, _table$getState$colum2;
1718
+ var _table$getState$colum, _table$getState$colum2, _table$getState$colum3;
1628
1719
  const position = column.getIsPinned();
1629
- return position ? ((_table$getState$colum = table.getState().columnPinning) == null ? void 0 : (_table$getState$colum2 = _table$getState$colum[position]) == null ? void 0 : _table$getState$colum2.indexOf(column.id)) ?? -1 : 0;
1720
+ 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;
1630
1721
  }
1631
1722
  };
1632
1723
  },
1633
1724
  createRow: (row, table) => {
1634
1725
  return {
1635
1726
  getCenterVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
1636
- const leftAndRight = [...(left ?? []), ...(right ?? [])];
1727
+ const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1637
1728
  return allCells.filter(d => !leftAndRight.includes(d.column.id));
1638
1729
  }, {
1639
1730
  key: "development" === 'production' ,
1640
- debug: () => table.options.debugAll ?? table.options.debugRows
1731
+ debug: () => {
1732
+ var _table$options$debugA;
1733
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
1734
+ }
1641
1735
  }),
1642
1736
  getLeftVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
1643
- const cells = (left ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1737
+ const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1644
1738
  ...d,
1645
1739
  position: 'left'
1646
1740
  }));
1647
1741
  return cells;
1648
1742
  }, {
1649
1743
  key: "development" === 'production' ,
1650
- debug: () => table.options.debugAll ?? table.options.debugRows
1744
+ debug: () => {
1745
+ var _table$options$debugA2;
1746
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
1747
+ }
1651
1748
  }),
1652
1749
  getRightVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
1653
- const cells = (right ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1750
+ const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1654
1751
  ...d,
1655
1752
  position: 'right'
1656
1753
  }));
1657
1754
  return cells;
1658
1755
  }, {
1659
1756
  key: "development" === 'production' ,
1660
- debug: () => table.options.debugAll ?? table.options.debugRows
1757
+ debug: () => {
1758
+ var _table$options$debugA3;
1759
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
1760
+ }
1661
1761
  })
1662
1762
  };
1663
1763
  },
@@ -1665,8 +1765,8 @@
1665
1765
  return {
1666
1766
  setColumnPinning: updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater),
1667
1767
  resetColumnPinning: defaultState => {
1668
- var _table$initialState;
1669
- return table.setColumnPinning(defaultState ? getDefaultPinningState() : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) ?? getDefaultPinningState());
1768
+ var _table$initialState$c, _table$initialState;
1769
+ return table.setColumnPinning(defaultState ? getDefaultPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultPinningState());
1670
1770
  },
1671
1771
  getIsSomeColumnsPinned: position => {
1672
1772
  var _pinningState$positio;
@@ -1678,23 +1778,32 @@
1678
1778
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
1679
1779
  },
1680
1780
  getLeftLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
1681
- return (left ?? []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1781
+ return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1682
1782
  }, {
1683
1783
  key: 'getLeftLeafColumns',
1684
- debug: () => table.options.debugAll ?? table.options.debugColumns
1784
+ debug: () => {
1785
+ var _table$options$debugA4;
1786
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
1787
+ }
1685
1788
  }),
1686
1789
  getRightLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
1687
- return (right ?? []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1790
+ return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1688
1791
  }, {
1689
1792
  key: 'getRightLeafColumns',
1690
- debug: () => table.options.debugAll ?? table.options.debugColumns
1793
+ debug: () => {
1794
+ var _table$options$debugA5;
1795
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
1796
+ }
1691
1797
  }),
1692
1798
  getCenterLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
1693
- const leftAndRight = [...(left ?? []), ...(right ?? [])];
1799
+ const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1694
1800
  return allColumns.filter(d => !leftAndRight.includes(d.id));
1695
1801
  }, {
1696
1802
  key: 'getCenterLeafColumns',
1697
- debug: () => table.options.debugAll ?? table.options.debugColumns
1803
+ debug: () => {
1804
+ var _table$options$debugA6;
1805
+ return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
1806
+ }
1698
1807
  })
1699
1808
  };
1700
1809
  }
@@ -1724,7 +1833,10 @@
1724
1833
  createTable: table => {
1725
1834
  return {
1726
1835
  setRowSelection: updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater),
1727
- resetRowSelection: defaultState => table.setRowSelection(defaultState ? {} : table.initialState.rowSelection ?? {}),
1836
+ resetRowSelection: defaultState => {
1837
+ var _table$initialState$r;
1838
+ return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
1839
+ },
1728
1840
  toggleAllRowsSelected: value => {
1729
1841
  table.setRowSelection(old => {
1730
1842
  value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
@@ -1830,7 +1942,10 @@
1830
1942
  return selectRowsFn(table, rowModel);
1831
1943
  }, {
1832
1944
  key: 'getSelectedRowModel',
1833
- debug: () => table.options.debugAll ?? table.options.debugTable
1945
+ debug: () => {
1946
+ var _table$options$debugA;
1947
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
1948
+ }
1834
1949
  }),
1835
1950
  getFilteredSelectedRowModel: memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
1836
1951
  if (!Object.keys(rowSelection).length) {
@@ -1843,7 +1958,10 @@
1843
1958
  return selectRowsFn(table, rowModel);
1844
1959
  }, {
1845
1960
  key: "development" === 'production' ,
1846
- debug: () => table.options.debugAll ?? table.options.debugTable
1961
+ debug: () => {
1962
+ var _table$options$debugA2;
1963
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
1964
+ }
1847
1965
  }),
1848
1966
  getGroupedSelectedRowModel: memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
1849
1967
  if (!Object.keys(rowSelection).length) {
@@ -1856,7 +1974,10 @@
1856
1974
  return selectRowsFn(table, rowModel);
1857
1975
  }, {
1858
1976
  key: "development" === 'production' ,
1859
- debug: () => table.options.debugAll ?? table.options.debugTable
1977
+ debug: () => {
1978
+ var _table$options$debugA3;
1979
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
1980
+ }
1860
1981
  }),
1861
1982
  ///
1862
1983
 
@@ -1899,7 +2020,8 @@
1899
2020
  return isAllPageRowsSelected;
1900
2021
  },
1901
2022
  getIsSomeRowsSelected: () => {
1902
- const totalSelected = Object.keys(table.getState().rowSelection ?? {}).length;
2023
+ var _table$getState$rowSe;
2024
+ const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
1903
2025
  return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
1904
2026
  },
1905
2027
  getIsSomePageRowsSelected: () => {
@@ -1953,22 +2075,25 @@
1953
2075
  return isSubRowSelected(row, rowSelection) === 'all';
1954
2076
  },
1955
2077
  getCanSelect: () => {
2078
+ var _table$options$enable;
1956
2079
  if (typeof table.options.enableRowSelection === 'function') {
1957
2080
  return table.options.enableRowSelection(row);
1958
2081
  }
1959
- return table.options.enableRowSelection ?? true;
2082
+ return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
1960
2083
  },
1961
2084
  getCanSelectSubRows: () => {
2085
+ var _table$options$enable2;
1962
2086
  if (typeof table.options.enableSubRowSelection === 'function') {
1963
2087
  return table.options.enableSubRowSelection(row);
1964
2088
  }
1965
- return table.options.enableSubRowSelection ?? true;
2089
+ return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
1966
2090
  },
1967
2091
  getCanMultiSelect: () => {
2092
+ var _table$options$enable3;
1968
2093
  if (typeof table.options.enableMultiRowSelection === 'function') {
1969
2094
  return table.options.enableMultiRowSelection(row);
1970
2095
  }
1971
- return table.options.enableMultiRowSelection ?? true;
2096
+ return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
1972
2097
  },
1973
2098
  getToggleSelectedHandler: () => {
1974
2099
  const canSelect = row.getCanSelect();
@@ -2039,7 +2164,8 @@
2039
2164
  };
2040
2165
  }
2041
2166
  function isRowSelected(row, selection) {
2042
- return selection[row.id] ?? false;
2167
+ var _selection$row$id;
2168
+ return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
2043
2169
  }
2044
2170
  function isSubRowSelected(row, selection, table) {
2045
2171
  if (row.subRows && row.subRows.length) {
@@ -2219,11 +2345,11 @@
2219
2345
  return 'desc';
2220
2346
  },
2221
2347
  getSortingFn: () => {
2222
- var _table$options$sortin;
2348
+ var _table$options$sortin, _table$options$sortin2;
2223
2349
  if (!column) {
2224
2350
  throw new Error();
2225
2351
  }
2226
- return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : ((_table$options$sortin = table.options.sortingFns) == null ? void 0 : _table$options$sortin[column.columnDef.sortingFn]) ?? sortingFns[column.columnDef.sortingFn];
2352
+ return isFunction(column.columnDef.sortingFn) ? column.columnDef.sortingFn : column.columnDef.sortingFn === 'auto' ? column.getAutoSortingFn() : (_table$options$sortin = (_table$options$sortin2 = table.options.sortingFns) == null ? void 0 : _table$options$sortin2[column.columnDef.sortingFn]) != null ? _table$options$sortin : sortingFns[column.columnDef.sortingFn];
2227
2353
  },
2228
2354
  toggleSorting: (desc, multi) => {
2229
2355
  // if (column.columns.length) {
@@ -2277,12 +2403,13 @@
2277
2403
  }
2278
2404
  }
2279
2405
  if (sortAction === 'add') {
2406
+ var _table$options$maxMul;
2280
2407
  newSorting = [...old, {
2281
2408
  id: column.id,
2282
2409
  desc: nextDesc
2283
2410
  }];
2284
2411
  // Take latest n columns
2285
- newSorting.splice(0, newSorting.length - (table.options.maxMultiSortColCount ?? Number.MAX_SAFE_INTEGER));
2412
+ newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
2286
2413
  } else if (sortAction === 'toggle') {
2287
2414
  // This flips (or sets) the
2288
2415
  newSorting = old.map(d => {
@@ -2306,28 +2433,32 @@
2306
2433
  });
2307
2434
  },
2308
2435
  getFirstSortDir: () => {
2309
- const sortDescFirst = column.columnDef.sortDescFirst ?? table.options.sortDescFirst ?? column.getAutoSortDir() === 'desc';
2436
+ var _ref, _column$columnDef$sor;
2437
+ const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
2310
2438
  return sortDescFirst ? 'desc' : 'asc';
2311
2439
  },
2312
2440
  getNextSortingOrder: multi => {
2441
+ var _table$options$enable, _table$options$enable2;
2313
2442
  const firstSortDirection = column.getFirstSortDir();
2314
2443
  const isSorted = column.getIsSorted();
2315
2444
  if (!isSorted) {
2316
2445
  return firstSortDirection;
2317
2446
  }
2318
- if (isSorted !== firstSortDirection && (table.options.enableSortingRemoval ?? true) && (
2447
+ if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && (
2319
2448
  // If enableSortRemove, enable in general
2320
- multi ? table.options.enableMultiRemove ?? true : true) // If multi, don't allow if enableMultiRemove))
2449
+ multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) // If multi, don't allow if enableMultiRemove))
2321
2450
  ) {
2322
2451
  return false;
2323
2452
  }
2324
2453
  return isSorted === 'desc' ? 'asc' : 'desc';
2325
2454
  },
2326
2455
  getCanSort: () => {
2327
- return (column.columnDef.enableSorting ?? true) && (table.options.enableSorting ?? true) && !!column.accessorFn;
2456
+ var _column$columnDef$ena, _table$options$enable3;
2457
+ 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;
2328
2458
  },
2329
2459
  getCanMultiSort: () => {
2330
- return column.columnDef.enableMultiSort ?? table.options.enableMultiSort ?? !!column.accessorFn;
2460
+ var _ref2, _column$columnDef$ena2;
2461
+ return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
2331
2462
  },
2332
2463
  getIsSorted: () => {
2333
2464
  var _table$getState$sorti;
@@ -2335,8 +2466,8 @@
2335
2466
  return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
2336
2467
  },
2337
2468
  getSortIndex: () => {
2338
- var _table$getState$sorti2;
2339
- return ((_table$getState$sorti2 = table.getState().sorting) == null ? void 0 : _table$getState$sorti2.findIndex(d => d.id === column.id)) ?? -1;
2469
+ var _table$getState$sorti2, _table$getState$sorti3;
2470
+ 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;
2340
2471
  },
2341
2472
  clearSorting: () => {
2342
2473
  //clear sorting for just 1 column
@@ -2356,8 +2487,8 @@
2356
2487
  return {
2357
2488
  setSorting: updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater),
2358
2489
  resetSorting: defaultState => {
2359
- var _table$initialState;
2360
- table.setSorting(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) ?? []);
2490
+ var _table$initialState$s, _table$initialState;
2491
+ table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
2361
2492
  },
2362
2493
  getPreSortedRowModel: () => table.getGroupedRowModel(),
2363
2494
  getSortedRowModel: () => {
@@ -2393,16 +2524,17 @@
2393
2524
  if (column.getCanHide()) {
2394
2525
  table.setColumnVisibility(old => ({
2395
2526
  ...old,
2396
- [column.id]: value ?? !column.getIsVisible()
2527
+ [column.id]: value != null ? value : !column.getIsVisible()
2397
2528
  }));
2398
2529
  }
2399
2530
  },
2400
2531
  getIsVisible: () => {
2401
- var _table$getState$colum;
2402
- return ((_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) ?? true;
2532
+ var _table$getState$colum, _table$getState$colum2;
2533
+ return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
2403
2534
  },
2404
2535
  getCanHide: () => {
2405
- return (column.columnDef.enableHiding ?? true) && (table.options.enableHiding ?? true);
2536
+ var _column$columnDef$ena, _table$options$enable;
2537
+ return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
2406
2538
  },
2407
2539
  getToggleVisibilityHandler: () => {
2408
2540
  return e => {
@@ -2417,11 +2549,17 @@
2417
2549
  return cells.filter(cell => cell.column.getIsVisible());
2418
2550
  }, {
2419
2551
  key: "development" === 'production' ,
2420
- debug: () => table.options.debugAll ?? table.options.debugRows
2552
+ debug: () => {
2553
+ var _table$options$debugA;
2554
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
2555
+ }
2421
2556
  }),
2422
2557
  getVisibleCells: memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
2423
2558
  key: 'row.getVisibleCells',
2424
- debug: () => table.options.debugAll ?? table.options.debugRows
2559
+ debug: () => {
2560
+ var _table$options$debugA2;
2561
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
2562
+ }
2425
2563
  })
2426
2564
  };
2427
2565
  },
@@ -2431,7 +2569,10 @@
2431
2569
  return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
2432
2570
  }, {
2433
2571
  key,
2434
- debug: () => table.options.debugAll ?? table.options.debugColumns
2572
+ debug: () => {
2573
+ var _table$options$debugA3;
2574
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2575
+ }
2435
2576
  });
2436
2577
  };
2437
2578
  return {
@@ -2442,10 +2583,12 @@
2442
2583
  getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns()),
2443
2584
  setColumnVisibility: updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater),
2444
2585
  resetColumnVisibility: defaultState => {
2445
- table.setColumnVisibility(defaultState ? {} : table.initialState.columnVisibility ?? {});
2586
+ var _table$initialState$c;
2587
+ table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
2446
2588
  },
2447
2589
  toggleAllColumnsVisible: value => {
2448
- value = value ?? !table.getIsAllColumnsVisible();
2590
+ var _value;
2591
+ value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
2449
2592
  table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({
2450
2593
  ...obj,
2451
2594
  [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
@@ -2468,6 +2611,7 @@
2468
2611
  //
2469
2612
 
2470
2613
  function createTable(options) {
2614
+ var _options$initialState;
2471
2615
  if (options.debugAll || options.debugTable) {
2472
2616
  console.info('Creating Table Instance...');
2473
2617
  }
@@ -2489,10 +2633,11 @@
2489
2633
  const coreInitialState = {};
2490
2634
  let initialState = {
2491
2635
  ...coreInitialState,
2492
- ...(options.initialState ?? {})
2636
+ ...((_options$initialState = options.initialState) != null ? _options$initialState : {})
2493
2637
  };
2494
2638
  table._features.forEach(feature => {
2495
- initialState = (feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) ?? initialState;
2639
+ var _feature$getInitialSt;
2640
+ initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
2496
2641
  });
2497
2642
  const queued = [];
2498
2643
  let queuedTimeout = false;
@@ -2533,7 +2678,10 @@
2533
2678
  setState: updater => {
2534
2679
  table.options.onStateChange == null ? void 0 : table.options.onStateChange(updater);
2535
2680
  },
2536
- _getRowId: (row, index, parent) => (table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) ?? `${parent ? [parent.id, index].join('.') : index}`,
2681
+ _getRowId: (row, index, parent) => {
2682
+ var _table$options$getRow;
2683
+ 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}`;
2684
+ },
2537
2685
  getCoreRowModel: () => {
2538
2686
  if (!table._getCoreRowModel) {
2539
2687
  table._getCoreRowModel = table.options.getCoreRowModel(table);
@@ -2556,7 +2704,8 @@
2556
2704
  return row;
2557
2705
  },
2558
2706
  _getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {
2559
- defaultColumn = defaultColumn ?? {};
2707
+ var _defaultColumn;
2708
+ defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
2560
2709
  return {
2561
2710
  header: props => {
2562
2711
  const resolvedColumnDef = props.header.column.columnDef;
@@ -2570,8 +2719,8 @@
2570
2719
  },
2571
2720
  // footer: props => props.header.column.id,
2572
2721
  cell: props => {
2573
- var _props$renderValue;
2574
- return ((_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) ?? null;
2722
+ var _props$renderValue$to, _props$renderValue;
2723
+ return (_props$renderValue$to = (_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) != null ? _props$renderValue$to : null;
2575
2724
  },
2576
2725
  ...table._features.reduce((obj, feature) => {
2577
2726
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
@@ -2579,7 +2728,10 @@
2579
2728
  ...defaultColumn
2580
2729
  };
2581
2730
  }, {
2582
- debug: () => table.options.debugAll ?? table.options.debugColumns,
2731
+ debug: () => {
2732
+ var _table$options$debugA;
2733
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
2734
+ },
2583
2735
  key: 'getDefaultColumnDef'
2584
2736
  }),
2585
2737
  _getColumnDefs: () => table.options.columns,
@@ -2598,7 +2750,10 @@
2598
2750
  return recurseColumns(columnDefs);
2599
2751
  }, {
2600
2752
  key: 'getAllColumns',
2601
- debug: () => table.options.debugAll ?? table.options.debugColumns
2753
+ debug: () => {
2754
+ var _table$options$debugA2;
2755
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
2756
+ }
2602
2757
  }),
2603
2758
  getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {
2604
2759
  return allColumns.flatMap(column => {
@@ -2606,7 +2761,10 @@
2606
2761
  });
2607
2762
  }, {
2608
2763
  key: 'getAllFlatColumns',
2609
- debug: () => table.options.debugAll ?? table.options.debugColumns
2764
+ debug: () => {
2765
+ var _table$options$debugA3;
2766
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2767
+ }
2610
2768
  }),
2611
2769
  _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {
2612
2770
  return flatColumns.reduce((acc, column) => {
@@ -2615,14 +2773,20 @@
2615
2773
  }, {});
2616
2774
  }, {
2617
2775
  key: 'getAllFlatColumnsById',
2618
- debug: () => table.options.debugAll ?? table.options.debugColumns
2776
+ debug: () => {
2777
+ var _table$options$debugA4;
2778
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
2779
+ }
2619
2780
  }),
2620
2781
  getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
2621
2782
  let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
2622
2783
  return orderColumns(leafColumns);
2623
2784
  }, {
2624
2785
  key: 'getAllLeafColumns',
2625
- debug: () => table.options.debugAll ?? table.options.debugColumns
2786
+ debug: () => {
2787
+ var _table$options$debugA5;
2788
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
2789
+ }
2626
2790
  }),
2627
2791
  getColumn: columnId => {
2628
2792
  const column = table._getAllFlatColumnsById()[columnId];
@@ -2643,7 +2807,10 @@
2643
2807
  }
2644
2808
 
2645
2809
  function createCell(table, row, column, columnId) {
2646
- const getRenderValue = () => cell.getValue() ?? table.options.renderFallbackValue;
2810
+ const getRenderValue = () => {
2811
+ var _cell$getValue;
2812
+ return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
2813
+ };
2647
2814
  const cell = {
2648
2815
  id: `${row.id}_${column.id}`,
2649
2816
  row,
@@ -2702,8 +2869,11 @@
2702
2869
  row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);
2703
2870
  return row._uniqueValuesCache[columnId];
2704
2871
  },
2705
- renderValue: columnId => row.getValue(columnId) ?? table.options.renderFallbackValue,
2706
- subRows: subRows ?? [],
2872
+ renderValue: columnId => {
2873
+ var _row$getValue;
2874
+ return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
2875
+ },
2876
+ subRows: subRows != null ? subRows : [],
2707
2877
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
2708
2878
  getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {
2709
2879
  return leafColumns.map(column => {
@@ -2711,7 +2881,10 @@
2711
2881
  });
2712
2882
  }, {
2713
2883
  key: 'row.getAllCells',
2714
- debug: () => table.options.debugAll ?? table.options.debugRows
2884
+ debug: () => {
2885
+ var _table$options$debugA;
2886
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
2887
+ }
2715
2888
  }),
2716
2889
  _getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {
2717
2890
  return allCells.reduce((acc, cell) => {
@@ -2720,7 +2893,10 @@
2720
2893
  }, {});
2721
2894
  }, {
2722
2895
  key: "development" === 'production' ,
2723
- debug: () => table.options.debugAll ?? table.options.debugRows
2896
+ debug: () => {
2897
+ var _table$options$debugA2;
2898
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
2899
+ }
2724
2900
  })
2725
2901
  };
2726
2902
  for (let i = 0; i < table._features.length; i++) {
@@ -2834,7 +3010,10 @@
2834
3010
  return rowModel;
2835
3011
  }, {
2836
3012
  key: 'getRowModel',
2837
- debug: () => table.options.debugAll ?? table.options.debugTable,
3013
+ debug: () => {
3014
+ var _table$options$debugA;
3015
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3016
+ },
2838
3017
  onChange: () => {
2839
3018
  table._autoResetPageIndex();
2840
3019
  }
@@ -2848,9 +3027,10 @@
2848
3027
  return filterRowModelFromRoot(rows, filterRowImpl, table);
2849
3028
  }
2850
3029
  function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
3030
+ var _table$options$maxLea;
2851
3031
  const newFilteredFlatRows = [];
2852
3032
  const newFilteredRowsById = {};
2853
- const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
3033
+ const maxDepth = (_table$options$maxLea = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea : 100;
2854
3034
  const recurseFilterRows = function (rowsToFilter, depth) {
2855
3035
  if (depth === void 0) {
2856
3036
  depth = 0;
@@ -2896,9 +3076,10 @@
2896
3076
  };
2897
3077
  }
2898
3078
  function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
3079
+ var _table$options$maxLea2;
2899
3080
  const newFilteredFlatRows = [];
2900
3081
  const newFilteredRowsById = {};
2901
- const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
3082
+ const maxDepth = (_table$options$maxLea2 = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea2 : 100;
2902
3083
 
2903
3084
  // Filters top level and nested rows
2904
3085
  const recurseFilterRows = function (rowsToFilter, depth) {
@@ -2945,7 +3126,8 @@
2945
3126
  }
2946
3127
  const resolvedColumnFilters = [];
2947
3128
  const resolvedGlobalFilters = [];
2948
- (columnFilters ?? []).forEach(d => {
3129
+ (columnFilters != null ? columnFilters : []).forEach(d => {
3130
+ var _filterFn$resolveFilt;
2949
3131
  const column = table.getColumn(d.id);
2950
3132
  if (!column) {
2951
3133
  {
@@ -2962,7 +3144,7 @@
2962
3144
  resolvedColumnFilters.push({
2963
3145
  id: d.id,
2964
3146
  filterFn,
2965
- resolvedValue: (filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) ?? d.value
3147
+ resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value
2966
3148
  });
2967
3149
  });
2968
3150
  const filterableIds = columnFilters.map(d => d.id);
@@ -2971,10 +3153,11 @@
2971
3153
  if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
2972
3154
  filterableIds.push('__global__');
2973
3155
  globallyFilterableColumns.forEach(column => {
3156
+ var _globalFilterFn$resol;
2974
3157
  resolvedGlobalFilters.push({
2975
3158
  id: column.id,
2976
3159
  filterFn: globalFilterFn,
2977
- resolvedValue: (globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) ?? globalFilter
3160
+ resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
2978
3161
  });
2979
3162
  });
2980
3163
  }
@@ -3027,7 +3210,10 @@
3027
3210
  return filterRows(rowModel.rows, filterRowsImpl, table);
3028
3211
  }, {
3029
3212
  key: 'getFilteredRowModel',
3030
- debug: () => table.options.debugAll ?? table.options.debugTable,
3213
+ debug: () => {
3214
+ var _table$options$debugA;
3215
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3216
+ },
3031
3217
  onChange: () => {
3032
3218
  table._autoResetPageIndex();
3033
3219
  }
@@ -3052,7 +3238,10 @@
3052
3238
  return filterRows(preRowModel.rows, filterRowsImpl, table);
3053
3239
  }, {
3054
3240
  key: 'getFacetedRowModel_' + columnId,
3055
- debug: () => table.options.debugAll ?? table.options.debugTable,
3241
+ debug: () => {
3242
+ var _table$options$debugA;
3243
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3244
+ },
3056
3245
  onChange: () => {}
3057
3246
  });
3058
3247
  }
@@ -3065,7 +3254,8 @@
3065
3254
  for (let j = 0; j < values.length; j++) {
3066
3255
  const value = values[j];
3067
3256
  if (facetedUniqueValues.has(value)) {
3068
- facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1);
3257
+ var _facetedUniqueValues$;
3258
+ facetedUniqueValues.set(value, ((_facetedUniqueValues$ = facetedUniqueValues.get(value)) != null ? _facetedUniqueValues$ : 0) + 1);
3069
3259
  } else {
3070
3260
  facetedUniqueValues.set(value, 1);
3071
3261
  }
@@ -3074,7 +3264,10 @@
3074
3264
  return facetedUniqueValues;
3075
3265
  }, {
3076
3266
  key: 'getFacetedUniqueValues_' + columnId,
3077
- debug: () => table.options.debugAll ?? table.options.debugTable,
3267
+ debug: () => {
3268
+ var _table$options$debugA;
3269
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3270
+ },
3078
3271
  onChange: () => {}
3079
3272
  });
3080
3273
  }
@@ -3101,7 +3294,10 @@
3101
3294
  return facetedMinMaxValues;
3102
3295
  }, {
3103
3296
  key: 'getFacetedMinMaxValues_' + columnId,
3104
- debug: () => table.options.debugAll ?? table.options.debugTable,
3297
+ debug: () => {
3298
+ var _table$options$debugA;
3299
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3300
+ },
3105
3301
  onChange: () => {}
3106
3302
  });
3107
3303
  }
@@ -3131,9 +3327,10 @@
3131
3327
  const sortedData = [...rows];
3132
3328
  sortedData.sort((rowA, rowB) => {
3133
3329
  for (let i = 0; i < availableSorting.length; i += 1) {
3330
+ var _sortEntry$desc;
3134
3331
  const sortEntry = availableSorting[i];
3135
3332
  const columnInfo = columnInfoById[sortEntry.id];
3136
- const isDesc = (sortEntry == null ? void 0 : sortEntry.desc) ?? false;
3333
+ const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
3137
3334
  if (columnInfo.sortUndefined) {
3138
3335
  const aValue = rowA.getValue(sortEntry.id);
3139
3336
  const bValue = rowB.getValue(sortEntry.id);
@@ -3176,7 +3373,10 @@
3176
3373
  };
3177
3374
  }, {
3178
3375
  key: 'getSortedRowModel',
3179
- debug: () => table.options.debugAll ?? table.options.debugTable,
3376
+ debug: () => {
3377
+ var _table$options$debugA;
3378
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3379
+ },
3180
3380
  onChange: () => {
3181
3381
  table._autoResetPageIndex();
3182
3382
  }
@@ -3245,7 +3445,8 @@
3245
3445
  return row._valuesCache[columnId];
3246
3446
  }
3247
3447
  if (groupedRows[0]) {
3248
- row._valuesCache[columnId] = groupedRows[0].getValue(columnId) ?? undefined;
3448
+ var _groupedRows$0$getVal;
3449
+ row._valuesCache[columnId] = (_groupedRows$0$getVal = groupedRows[0].getValue(columnId)) != null ? _groupedRows$0$getVal : undefined;
3249
3450
  }
3250
3451
  return row._valuesCache[columnId];
3251
3452
  }
@@ -3298,7 +3499,10 @@
3298
3499
  };
3299
3500
  }, {
3300
3501
  key: 'getGroupedRowModel',
3301
- debug: () => table.options.debugAll ?? table.options.debugTable,
3502
+ debug: () => {
3503
+ var _table$options$debugA;
3504
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3505
+ },
3302
3506
  onChange: () => {
3303
3507
  table._queue(() => {
3304
3508
  table._autoResetExpanded();
@@ -3323,7 +3527,7 @@
3323
3527
 
3324
3528
  function getExpandedRowModel() {
3325
3529
  return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3326
- if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded ?? {}).length) {
3530
+ if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3327
3531
  return rowModel;
3328
3532
  }
3329
3533
  if (!paginateExpandedRows) {
@@ -3333,7 +3537,10 @@
3333
3537
  return expandRows(rowModel);
3334
3538
  }, {
3335
3539
  key: 'getExpandedRowModel',
3336
- debug: () => table.options.debugAll ?? table.options.debugTable
3540
+ debug: () => {
3541
+ var _table$options$debugA;
3542
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3543
+ }
3337
3544
  });
3338
3545
  }
3339
3546
  function expandRows(rowModel) {
@@ -3395,7 +3602,10 @@
3395
3602
  return paginatedRowModel;
3396
3603
  }, {
3397
3604
  key: 'getPaginationRowModel',
3398
- debug: () => table.options.debugAll ?? table.options.debugTable
3605
+ debug: () => {
3606
+ var _table$options$debugA;
3607
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3608
+ }
3399
3609
  });
3400
3610
  }
3401
3611