@tanstack/react-table 8.5.30 → 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.
@@ -122,13 +122,14 @@
122
122
  }
123
123
 
124
124
  function createColumn(table, columnDef, depth, parent) {
125
+ var _ref, _resolvedColumnDef$id;
125
126
  const defaultColumn = table._getDefaultColumnDef();
126
127
  const resolvedColumnDef = {
127
128
  ...defaultColumn,
128
129
  ...columnDef
129
130
  };
130
131
  const accessorKey = resolvedColumnDef.accessorKey;
131
- let id = resolvedColumnDef.id ?? (accessorKey ? accessorKey.replace('.', '_') : undefined) ?? (typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined);
132
+ let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? accessorKey.replace('.', '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
132
133
  let accessorFn;
133
134
  if (resolvedColumnDef.accessorFn) {
134
135
  accessorFn = resolvedColumnDef.accessorFn;
@@ -166,7 +167,10 @@
166
167
  return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];
167
168
  }, {
168
169
  key: "development" === 'production' ,
169
- debug: () => table.options.debugAll ?? table.options.debugColumns
170
+ debug: () => {
171
+ var _table$options$debugA;
172
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
173
+ }
170
174
  }),
171
175
  getLeafColumns: memo(() => [table._getOrderColumnsFn()], orderColumns => {
172
176
  var _column$columns2;
@@ -177,7 +181,10 @@
177
181
  return [column];
178
182
  }, {
179
183
  key: "development" === 'production' ,
180
- debug: () => table.options.debugAll ?? table.options.debugColumns
184
+ debug: () => {
185
+ var _table$options$debugA2;
186
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
187
+ }
181
188
  })
182
189
  };
183
190
  column = table._features.reduce((obj, feature) => {
@@ -191,7 +198,8 @@
191
198
  //
192
199
 
193
200
  function createHeader(table, column, options) {
194
- const id = options.id ?? column.id;
201
+ var _options$id;
202
+ const id = (_options$id = options.id) != null ? _options$id : column.id;
195
203
  let header = {
196
204
  id,
197
205
  column,
@@ -231,35 +239,50 @@
231
239
  // Header Groups
232
240
 
233
241
  getHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
234
- const leftColumns = (left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
235
- const rightColumns = (right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
242
+ var _left$map$filter, _right$map$filter;
243
+ const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
244
+ const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
236
245
  const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
237
246
  const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
238
247
  return headerGroups;
239
248
  }, {
240
249
  key: 'getHeaderGroups',
241
- debug: () => table.options.debugAll ?? table.options.debugHeaders
250
+ debug: () => {
251
+ var _table$options$debugA;
252
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
253
+ }
242
254
  }),
243
255
  getCenterHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
244
256
  leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
245
257
  return buildHeaderGroups(allColumns, leafColumns, table, 'center');
246
258
  }, {
247
259
  key: 'getCenterHeaderGroups',
248
- debug: () => table.options.debugAll ?? table.options.debugHeaders
260
+ debug: () => {
261
+ var _table$options$debugA2;
262
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
263
+ }
249
264
  }),
250
265
  getLeftHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
251
- const orderedLeafColumns = (left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
266
+ var _left$map$filter2;
267
+ const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
252
268
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
253
269
  }, {
254
270
  key: 'getLeftHeaderGroups',
255
- debug: () => table.options.debugAll ?? table.options.debugHeaders
271
+ debug: () => {
272
+ var _table$options$debugA3;
273
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
274
+ }
256
275
  }),
257
276
  getRightHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
258
- const orderedLeafColumns = (right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
277
+ var _right$map$filter2;
278
+ const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
259
279
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
260
280
  }, {
261
281
  key: 'getRightHeaderGroups',
262
- debug: () => table.options.debugAll ?? table.options.debugHeaders
282
+ debug: () => {
283
+ var _table$options$debugA4;
284
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
285
+ }
263
286
  }),
264
287
  // Footer Groups
265
288
 
@@ -267,25 +290,37 @@
267
290
  return [...headerGroups].reverse();
268
291
  }, {
269
292
  key: 'getFooterGroups',
270
- debug: () => table.options.debugAll ?? table.options.debugHeaders
293
+ debug: () => {
294
+ var _table$options$debugA5;
295
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
296
+ }
271
297
  }),
272
298
  getLeftFooterGroups: memo(() => [table.getLeftHeaderGroups()], headerGroups => {
273
299
  return [...headerGroups].reverse();
274
300
  }, {
275
301
  key: 'getLeftFooterGroups',
276
- debug: () => table.options.debugAll ?? table.options.debugHeaders
302
+ debug: () => {
303
+ var _table$options$debugA6;
304
+ return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
305
+ }
277
306
  }),
278
307
  getCenterFooterGroups: memo(() => [table.getCenterHeaderGroups()], headerGroups => {
279
308
  return [...headerGroups].reverse();
280
309
  }, {
281
310
  key: 'getCenterFooterGroups',
282
- debug: () => table.options.debugAll ?? table.options.debugHeaders
311
+ debug: () => {
312
+ var _table$options$debugA7;
313
+ return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
314
+ }
283
315
  }),
284
316
  getRightFooterGroups: memo(() => [table.getRightHeaderGroups()], headerGroups => {
285
317
  return [...headerGroups].reverse();
286
318
  }, {
287
319
  key: 'getRightFooterGroups',
288
- debug: () => table.options.debugAll ?? table.options.debugHeaders
320
+ debug: () => {
321
+ var _table$options$debugA8;
322
+ return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
323
+ }
289
324
  }),
290
325
  // Flat Headers
291
326
 
@@ -295,7 +330,10 @@
295
330
  }).flat();
296
331
  }, {
297
332
  key: 'getFlatHeaders',
298
- debug: () => table.options.debugAll ?? table.options.debugHeaders
333
+ debug: () => {
334
+ var _table$options$debugA9;
335
+ return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
336
+ }
299
337
  }),
300
338
  getLeftFlatHeaders: memo(() => [table.getLeftHeaderGroups()], left => {
301
339
  return left.map(headerGroup => {
@@ -303,7 +341,10 @@
303
341
  }).flat();
304
342
  }, {
305
343
  key: 'getLeftFlatHeaders',
306
- debug: () => table.options.debugAll ?? table.options.debugHeaders
344
+ debug: () => {
345
+ var _table$options$debugA10;
346
+ return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
347
+ }
307
348
  }),
308
349
  getCenterFlatHeaders: memo(() => [table.getCenterHeaderGroups()], left => {
309
350
  return left.map(headerGroup => {
@@ -311,7 +352,10 @@
311
352
  }).flat();
312
353
  }, {
313
354
  key: 'getCenterFlatHeaders',
314
- debug: () => table.options.debugAll ?? table.options.debugHeaders
355
+ debug: () => {
356
+ var _table$options$debugA11;
357
+ return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
358
+ }
315
359
  }),
316
360
  getRightFlatHeaders: memo(() => [table.getRightHeaderGroups()], left => {
317
361
  return left.map(headerGroup => {
@@ -319,7 +363,10 @@
319
363
  }).flat();
320
364
  }, {
321
365
  key: 'getRightFlatHeaders',
322
- debug: () => table.options.debugAll ?? table.options.debugHeaders
366
+ debug: () => {
367
+ var _table$options$debugA12;
368
+ return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
369
+ }
323
370
  }),
324
371
  // Leaf Headers
325
372
 
@@ -330,7 +377,10 @@
330
377
  });
331
378
  }, {
332
379
  key: 'getCenterLeafHeaders',
333
- debug: () => table.options.debugAll ?? table.options.debugHeaders
380
+ debug: () => {
381
+ var _table$options$debugA13;
382
+ return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
383
+ }
334
384
  }),
335
385
  getLeftLeafHeaders: memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
336
386
  return flatHeaders.filter(header => {
@@ -339,7 +389,10 @@
339
389
  });
340
390
  }, {
341
391
  key: 'getLeftLeafHeaders',
342
- debug: () => table.options.debugAll ?? table.options.debugHeaders
392
+ debug: () => {
393
+ var _table$options$debugA14;
394
+ return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
395
+ }
343
396
  }),
344
397
  getRightLeafHeaders: memo(() => [table.getRightFlatHeaders()], flatHeaders => {
345
398
  return flatHeaders.filter(header => {
@@ -348,22 +401,28 @@
348
401
  });
349
402
  }, {
350
403
  key: 'getRightLeafHeaders',
351
- debug: () => table.options.debugAll ?? table.options.debugHeaders
404
+ debug: () => {
405
+ var _table$options$debugA15;
406
+ return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
407
+ }
352
408
  }),
353
409
  getLeafHeaders: memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
354
- var _left$, _center$, _right$;
355
- 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 => {
410
+ var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
411
+ 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 => {
356
412
  return header.getLeafHeaders();
357
413
  }).flat();
358
414
  }, {
359
415
  key: 'getLeafHeaders',
360
- debug: () => table.options.debugAll ?? table.options.debugHeaders
416
+ debug: () => {
417
+ var _table$options$debugA16;
418
+ return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
419
+ }
361
420
  })
362
421
  };
363
422
  }
364
423
  };
365
424
  function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
366
- var _headerGroups$;
425
+ var _headerGroups$0$heade, _headerGroups$;
367
426
  // Find the max depth of the columns:
368
427
  // build the leaf column row
369
428
  // build each buffer row going up
@@ -479,7 +538,7 @@
479
538
  };
480
539
  });
481
540
  };
482
- recurseHeadersForSpans(((_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) ?? []);
541
+ recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);
483
542
  return headerGroups;
484
543
  }
485
544
 
@@ -519,8 +578,9 @@
519
578
  createColumn: (column, table) => {
520
579
  return {
521
580
  getSize: () => {
581
+ var _column$columnDef$min, _ref, _column$columnDef$max;
522
582
  const columnSize = table.getState().columnSizing[column.id];
523
- return Math.min(Math.max(column.columnDef.minSize ?? defaultColumnSizing.minSize, columnSize ?? column.columnDef.size ?? defaultColumnSizing.size), column.columnDef.maxSize ?? defaultColumnSizing.maxSize);
583
+ 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);
524
584
  },
525
585
  getStart: position => {
526
586
  const columns = !position ? table.getVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
@@ -532,16 +592,17 @@
532
592
  return 0;
533
593
  },
534
594
  resetSize: () => {
535
- table.setColumnSizing(_ref => {
595
+ table.setColumnSizing(_ref2 => {
536
596
  let {
537
597
  [column.id]: _,
538
598
  ...rest
539
- } = _ref;
599
+ } = _ref2;
540
600
  return rest;
541
601
  });
542
602
  },
543
603
  getCanResize: () => {
544
- return (column.columnDef.enableResizing ?? true) && (table.options.enableColumnResizing ?? true);
604
+ var _column$columnDef$ena, _table$options$enable;
605
+ return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
545
606
  },
546
607
  getIsResizing: () => {
547
608
  return table.getState().columnSizingInfo.isResizingColumn === column.id;
@@ -556,7 +617,8 @@
556
617
  if (header.subHeaders.length) {
557
618
  header.subHeaders.forEach(recurse);
558
619
  } else {
559
- sum += header.column.getSize() ?? 0;
620
+ var _header$column$getSiz;
621
+ sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
560
622
  }
561
623
  };
562
624
  recurse(header);
@@ -592,10 +654,11 @@
592
654
  }
593
655
  let newColumnSizing = {};
594
656
  table.setColumnSizingInfo(old => {
595
- const deltaOffset = clientXPos - ((old == null ? void 0 : old.startOffset) ?? 0);
596
- const deltaPercentage = Math.max(deltaOffset / ((old == null ? void 0 : old.startSize) ?? 0), -0.999999);
597
- old.columnSizingStart.forEach(_ref2 => {
598
- let [columnId, headerSize] = _ref2;
657
+ var _old$startOffset, _old$startSize;
658
+ const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
659
+ const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
660
+ old.columnSizingStart.forEach(_ref3 => {
661
+ let [columnId, headerSize] = _ref3;
599
662
  newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
600
663
  });
601
664
  return {
@@ -680,34 +743,36 @@
680
743
  setColumnSizing: updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater),
681
744
  setColumnSizingInfo: updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater),
682
745
  resetColumnSizing: defaultState => {
683
- table.setColumnSizing(defaultState ? {} : table.initialState.columnSizing ?? {});
746
+ var _table$initialState$c;
747
+ table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
684
748
  },
685
749
  resetHeaderSizeInfo: defaultState => {
686
- table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : table.initialState.columnSizingInfo ?? getDefaultColumnSizingInfoState());
750
+ var _table$initialState$c2;
751
+ table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
687
752
  },
688
753
  getTotalSize: () => {
689
- var _table$getHeaderGroup;
690
- return ((_table$getHeaderGroup = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup.headers.reduce((sum, header) => {
754
+ var _table$getHeaderGroup, _table$getHeaderGroup2;
755
+ return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
691
756
  return sum + header.getSize();
692
- }, 0)) ?? 0;
757
+ }, 0)) != null ? _table$getHeaderGroup : 0;
693
758
  },
694
759
  getLeftTotalSize: () => {
695
- var _table$getLeftHeaderG;
696
- return ((_table$getLeftHeaderG = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG.headers.reduce((sum, header) => {
760
+ var _table$getLeftHeaderG, _table$getLeftHeaderG2;
761
+ return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
697
762
  return sum + header.getSize();
698
- }, 0)) ?? 0;
763
+ }, 0)) != null ? _table$getLeftHeaderG : 0;
699
764
  },
700
765
  getCenterTotalSize: () => {
701
- var _table$getCenterHeade;
702
- return ((_table$getCenterHeade = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade.headers.reduce((sum, header) => {
766
+ var _table$getCenterHeade, _table$getCenterHeade2;
767
+ return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
703
768
  return sum + header.getSize();
704
- }, 0)) ?? 0;
769
+ }, 0)) != null ? _table$getCenterHeade : 0;
705
770
  },
706
771
  getRightTotalSize: () => {
707
- var _table$getRightHeader;
708
- return ((_table$getRightHeader = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader.headers.reduce((sum, header) => {
772
+ var _table$getRightHeader, _table$getRightHeader2;
773
+ return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
709
774
  return sum + header.getSize();
710
- }, 0)) ?? 0;
775
+ }, 0)) != null ? _table$getRightHeader : 0;
711
776
  }
712
777
  };
713
778
  }
@@ -756,13 +821,14 @@
756
821
  let queued = false;
757
822
  return {
758
823
  _autoResetExpanded: () => {
824
+ var _ref, _table$options$autoRe;
759
825
  if (!registered) {
760
826
  table._queue(() => {
761
827
  registered = true;
762
828
  });
763
829
  return;
764
830
  }
765
- if (table.options.autoResetAll ?? table.options.autoResetExpanded ?? !table.options.manualExpanding) {
831
+ if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
766
832
  if (queued) return;
767
833
  queued = true;
768
834
  table._queue(() => {
@@ -773,15 +839,15 @@
773
839
  },
774
840
  setExpanded: updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater),
775
841
  toggleAllRowsExpanded: expanded => {
776
- if (expanded ?? !table.getIsAllRowsExpanded()) {
842
+ if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
777
843
  table.setExpanded(true);
778
844
  } else {
779
845
  table.setExpanded({});
780
846
  }
781
847
  },
782
848
  resetExpanded: defaultState => {
783
- var _table$initialState;
784
- table.setExpanded(defaultState ? {} : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) ?? {});
849
+ var _table$initialState$e, _table$initialState;
850
+ table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
785
851
  },
786
852
  getCanSomeRowsExpand: () => {
787
853
  return table.getRowModel().flatRows.some(row => row.getCanExpand());
@@ -840,6 +906,7 @@
840
906
  return {
841
907
  toggleExpanded: expanded => {
842
908
  table.setExpanded(old => {
909
+ var _expanded;
843
910
  const exists = old === true ? true : !!(old != null && old[row.id]);
844
911
  let oldExpanded = {};
845
912
  if (old === true) {
@@ -849,7 +916,7 @@
849
916
  } else {
850
917
  oldExpanded = old;
851
918
  }
852
- expanded = expanded ?? !exists;
919
+ expanded = (_expanded = expanded) != null ? _expanded : !exists;
853
920
  if (!exists && expanded) {
854
921
  return {
855
922
  ...oldExpanded,
@@ -867,12 +934,13 @@
867
934
  });
868
935
  },
869
936
  getIsExpanded: () => {
937
+ var _table$options$getIsR;
870
938
  const expanded = table.getState().expanded;
871
- return !!((table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) ?? (expanded === true || expanded != null && expanded[row.id]));
939
+ 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]));
872
940
  },
873
941
  getCanExpand: () => {
874
- var _row$subRows;
875
- return (table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) ?? ((table.options.enableExpanding ?? true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length));
942
+ var _table$options$getRow, _table$options$enable, _row$subRows;
943
+ 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);
876
944
  },
877
945
  getToggleExpandedHandler: () => {
878
946
  const canExpand = row.getCanExpand();
@@ -989,6 +1057,7 @@
989
1057
  onColumnFiltersChange: makeStateUpdater('columnFilters', table),
990
1058
  onGlobalFilterChange: makeStateUpdater('globalFilter', table),
991
1059
  filterFromLeafRows: false,
1060
+ maxLeafRowFilterDepth: 100,
992
1061
  globalFilterFn: 'auto',
993
1062
  getColumnCanGlobalFilter: column => {
994
1063
  var _table$getCoreRowMode, _table$getCoreRowMode2;
@@ -1020,14 +1089,18 @@
1020
1089
  return filterFns.weakEquals;
1021
1090
  },
1022
1091
  getFilterFn: () => {
1023
- var _table$options$filter;
1024
- 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];
1092
+ var _table$options$filter, _table$options$filter2;
1093
+ return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn()
1094
+ // @ts-ignore
1095
+ : (_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];
1025
1096
  },
1026
1097
  getCanFilter: () => {
1027
- return (column.columnDef.enableColumnFilter ?? true) && (table.options.enableColumnFilters ?? true) && (table.options.enableFilters ?? true) && !!column.accessorFn;
1098
+ var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
1099
+ 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;
1028
1100
  },
1029
1101
  getCanGlobalFilter: () => {
1030
- 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;
1102
+ var _column$columnDef$ena2, _table$options$enable3, _table$options$enable4, _table$options$getCol;
1103
+ 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;
1031
1104
  },
1032
1105
  getIsFiltered: () => column.getFilterIndex() > -1,
1033
1106
  getFilterValue: () => {
@@ -1035,8 +1108,8 @@
1035
1108
  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;
1036
1109
  },
1037
1110
  getFilterIndex: () => {
1038
- var _table$getState$colum3;
1039
- return ((_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex(d => d.id === column.id)) ?? -1;
1111
+ var _table$getState$colum3, _table$getState$colum4;
1112
+ 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;
1040
1113
  },
1041
1114
  setFilterValue: value => {
1042
1115
  table.setColumnFilters(old => {
@@ -1046,19 +1119,21 @@
1046
1119
 
1047
1120
  //
1048
1121
  if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
1049
- return (old == null ? void 0 : old.filter(d => d.id !== column.id)) ?? [];
1122
+ var _old$filter;
1123
+ return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];
1050
1124
  }
1051
1125
  const newFilterObj = {
1052
1126
  id: column.id,
1053
1127
  value: newFilter
1054
1128
  };
1055
1129
  if (previousfilter) {
1056
- return (old == null ? void 0 : old.map(d => {
1130
+ var _old$map;
1131
+ return (_old$map = old == null ? void 0 : old.map(d => {
1057
1132
  if (d.id === column.id) {
1058
1133
  return newFilterObj;
1059
1134
  }
1060
1135
  return d;
1061
- })) ?? [];
1136
+ })) != null ? _old$map : [];
1062
1137
  }
1063
1138
  if (old != null && old.length) {
1064
1139
  return [...old, newFilterObj];
@@ -1104,11 +1179,13 @@
1104
1179
  return filterFns.includesString;
1105
1180
  },
1106
1181
  getGlobalFilterFn: () => {
1107
- var _table$options$filter2;
1182
+ var _table$options$filter3, _table$options$filter4;
1108
1183
  const {
1109
1184
  globalFilterFn: globalFilterFn
1110
1185
  } = table.options;
1111
- return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : ((_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) ?? filterFns[globalFilterFn];
1186
+ return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn()
1187
+ // @ts-ignore
1188
+ : (_table$options$filter3 = (_table$options$filter4 = table.options.filterFns) == null ? void 0 : _table$options$filter4[globalFilterFn]) != null ? _table$options$filter3 : filterFns[globalFilterFn];
1112
1189
  },
1113
1190
  setColumnFilters: updater => {
1114
1191
  const leafColumns = table.getAllLeafColumns();
@@ -1134,8 +1211,8 @@
1134
1211
  table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
1135
1212
  },
1136
1213
  resetColumnFilters: defaultState => {
1137
- var _table$initialState;
1138
- table.setColumnFilters(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) ?? []);
1214
+ var _table$initialState$c, _table$initialState;
1215
+ table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
1139
1216
  },
1140
1217
  getPreFilteredRowModel: () => table.getCoreRowModel(),
1141
1218
  getFilteredRowModel: () => {
@@ -1273,8 +1350,8 @@
1273
1350
  getDefaultColumnDef: () => {
1274
1351
  return {
1275
1352
  aggregatedCell: props => {
1276
- var _props$getValue;
1277
- return ((_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) ?? null;
1353
+ var _toString, _props$getValue;
1354
+ return (_toString = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
1278
1355
  },
1279
1356
  aggregationFn: 'auto'
1280
1357
  };
@@ -1299,11 +1376,12 @@
1299
1376
  if (old != null && old.includes(column.id)) {
1300
1377
  return old.filter(d => d !== column.id);
1301
1378
  }
1302
- return [...(old ?? []), column.id];
1379
+ return [...(old != null ? old : []), column.id];
1303
1380
  });
1304
1381
  },
1305
1382
  getCanGroup: () => {
1306
- return column.columnDef.enableGrouping ?? true ?? table.options.enableGrouping ?? true ?? !!column.accessorFn;
1383
+ var _ref, _ref2, _ref3, _column$columnDef$ena;
1384
+ 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;
1307
1385
  },
1308
1386
  getIsGrouped: () => {
1309
1387
  var _table$getState$group;
@@ -1331,11 +1409,11 @@
1331
1409
  }
1332
1410
  },
1333
1411
  getAggregationFn: () => {
1334
- var _table$options$aggreg;
1412
+ var _table$options$aggreg, _table$options$aggreg2;
1335
1413
  if (!column) {
1336
1414
  throw new Error();
1337
1415
  }
1338
- 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];
1416
+ 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];
1339
1417
  }
1340
1418
  };
1341
1419
  },
@@ -1343,8 +1421,8 @@
1343
1421
  return {
1344
1422
  setGrouping: updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater),
1345
1423
  resetGrouping: defaultState => {
1346
- var _table$initialState;
1347
- table.setGrouping(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) ?? []);
1424
+ var _table$initialState$g, _table$initialState;
1425
+ table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
1348
1426
  },
1349
1427
  getPreGroupedRowModel: () => table.getFilteredRowModel(),
1350
1428
  getGroupedRowModel: () => {
@@ -1405,7 +1483,8 @@
1405
1483
  return {
1406
1484
  setColumnOrder: updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater),
1407
1485
  resetColumnOrder: defaultState => {
1408
- table.setColumnOrder(defaultState ? [] : table.initialState.columnOrder ?? []);
1486
+ var _table$initialState$c;
1487
+ table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
1409
1488
  },
1410
1489
  _getOrderColumnsFn: memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
1411
1490
  // Sort grouped columns to the start of the column list
@@ -1472,13 +1551,14 @@
1472
1551
  let queued = false;
1473
1552
  return {
1474
1553
  _autoResetPageIndex: () => {
1554
+ var _ref, _table$options$autoRe;
1475
1555
  if (!registered) {
1476
1556
  table._queue(() => {
1477
1557
  registered = true;
1478
1558
  });
1479
1559
  return;
1480
1560
  }
1481
- if (table.options.autoResetAll ?? table.options.autoResetPageIndex ?? !table.options.manualPagination) {
1561
+ if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
1482
1562
  if (queued) return;
1483
1563
  queued = true;
1484
1564
  table._queue(() => {
@@ -1495,7 +1575,8 @@
1495
1575
  return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
1496
1576
  },
1497
1577
  resetPagination: defaultState => {
1498
- table.setPagination(defaultState ? getDefaultPaginationState() : table.initialState.pagination ?? getDefaultPaginationState());
1578
+ var _table$initialState$p;
1579
+ table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
1499
1580
  },
1500
1581
  setPageIndex: updater => {
1501
1582
  table.setPagination(old => {
@@ -1509,12 +1590,12 @@
1509
1590
  });
1510
1591
  },
1511
1592
  resetPageIndex: defaultState => {
1512
- var _table$initialState, _table$initialState$p;
1513
- 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);
1593
+ var _table$initialState$p2, _table$initialState, _table$initialState$p3;
1594
+ 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);
1514
1595
  },
1515
1596
  resetPageSize: defaultState => {
1516
- var _table$initialState2, _table$initialState2$;
1517
- table.setPageSize(defaultState ? defaultPageSize : ((_table$initialState2 = table.initialState) == null ? void 0 : (_table$initialState2$ = _table$initialState2.pagination) == null ? void 0 : _table$initialState2$.pageSize) ?? defaultPageSize);
1597
+ var _table$initialState$p4, _table$initialState2, _table$initialState2$;
1598
+ 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);
1518
1599
  },
1519
1600
  setPageSize: updater => {
1520
1601
  table.setPagination(old => {
@@ -1529,7 +1610,8 @@
1529
1610
  });
1530
1611
  },
1531
1612
  setPageCount: updater => table.setPagination(old => {
1532
- let newPageCount = functionalUpdate(updater, table.options.pageCount ?? -1);
1613
+ var _table$options$pageCo;
1614
+ let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
1533
1615
  if (typeof newPageCount === 'number') {
1534
1616
  newPageCount = Math.max(-1, newPageCount);
1535
1617
  }
@@ -1546,7 +1628,10 @@
1546
1628
  return pageOptions;
1547
1629
  }, {
1548
1630
  key: 'getPageOptions',
1549
- debug: () => table.options.debugAll ?? table.options.debugTable
1631
+ debug: () => {
1632
+ var _table$options$debugA;
1633
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
1634
+ }
1550
1635
  }),
1551
1636
  getCanPreviousPage: () => table.getState().pagination.pageIndex > 0,
1552
1637
  getCanNextPage: () => {
@@ -1581,7 +1666,8 @@
1581
1666
  return table._getPaginationRowModel();
1582
1667
  },
1583
1668
  getPageCount: () => {
1584
- return table.options.pageCount ?? Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
1669
+ var _table$options$pageCo2;
1670
+ return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
1585
1671
  }
1586
1672
  };
1587
1673
  }
@@ -1610,27 +1696,33 @@
1610
1696
  pin: position => {
1611
1697
  const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);
1612
1698
  table.setColumnPinning(old => {
1699
+ var _old$left3, _old$right3;
1613
1700
  if (position === 'right') {
1701
+ var _old$left, _old$right;
1614
1702
  return {
1615
- left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1616
- right: [...((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
1703
+ left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1704
+ right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
1617
1705
  };
1618
1706
  }
1619
1707
  if (position === 'left') {
1708
+ var _old$left2, _old$right2;
1620
1709
  return {
1621
- left: [...((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1622
- right: ((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d)))
1710
+ left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1711
+ right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1623
1712
  };
1624
1713
  }
1625
1714
  return {
1626
- left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1627
- right: ((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d)))
1715
+ left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1716
+ right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1628
1717
  };
1629
1718
  });
1630
1719
  },
1631
1720
  getCanPin: () => {
1632
1721
  const leafColumns = column.getLeafColumns();
1633
- return leafColumns.some(d => (d.columnDef.enablePinning ?? true) && (table.options.enablePinning ?? true));
1722
+ return leafColumns.some(d => {
1723
+ var _d$columnDef$enablePi, _table$options$enable;
1724
+ return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_table$options$enable = table.options.enablePinning) != null ? _table$options$enable : true);
1725
+ });
1634
1726
  },
1635
1727
  getIsPinned: () => {
1636
1728
  const leafColumnIds = column.getLeafColumns().map(d => d.id);
@@ -1643,40 +1735,49 @@
1643
1735
  return isLeft ? 'left' : isRight ? 'right' : false;
1644
1736
  },
1645
1737
  getPinnedIndex: () => {
1646
- var _table$getState$colum, _table$getState$colum2;
1738
+ var _table$getState$colum, _table$getState$colum2, _table$getState$colum3;
1647
1739
  const position = column.getIsPinned();
1648
- 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;
1740
+ 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;
1649
1741
  }
1650
1742
  };
1651
1743
  },
1652
1744
  createRow: (row, table) => {
1653
1745
  return {
1654
1746
  getCenterVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
1655
- const leftAndRight = [...(left ?? []), ...(right ?? [])];
1747
+ const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1656
1748
  return allCells.filter(d => !leftAndRight.includes(d.column.id));
1657
1749
  }, {
1658
1750
  key: "development" === 'production' ,
1659
- debug: () => table.options.debugAll ?? table.options.debugRows
1751
+ debug: () => {
1752
+ var _table$options$debugA;
1753
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
1754
+ }
1660
1755
  }),
1661
1756
  getLeftVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
1662
- const cells = (left ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1757
+ const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1663
1758
  ...d,
1664
1759
  position: 'left'
1665
1760
  }));
1666
1761
  return cells;
1667
1762
  }, {
1668
1763
  key: "development" === 'production' ,
1669
- debug: () => table.options.debugAll ?? table.options.debugRows
1764
+ debug: () => {
1765
+ var _table$options$debugA2;
1766
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
1767
+ }
1670
1768
  }),
1671
1769
  getRightVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
1672
- const cells = (right ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1770
+ const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
1673
1771
  ...d,
1674
1772
  position: 'right'
1675
1773
  }));
1676
1774
  return cells;
1677
1775
  }, {
1678
1776
  key: "development" === 'production' ,
1679
- debug: () => table.options.debugAll ?? table.options.debugRows
1777
+ debug: () => {
1778
+ var _table$options$debugA3;
1779
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
1780
+ }
1680
1781
  })
1681
1782
  };
1682
1783
  },
@@ -1684,8 +1785,8 @@
1684
1785
  return {
1685
1786
  setColumnPinning: updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater),
1686
1787
  resetColumnPinning: defaultState => {
1687
- var _table$initialState;
1688
- return table.setColumnPinning(defaultState ? getDefaultPinningState() : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) ?? getDefaultPinningState());
1788
+ var _table$initialState$c, _table$initialState;
1789
+ return table.setColumnPinning(defaultState ? getDefaultPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultPinningState());
1689
1790
  },
1690
1791
  getIsSomeColumnsPinned: position => {
1691
1792
  var _pinningState$positio;
@@ -1697,23 +1798,32 @@
1697
1798
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
1698
1799
  },
1699
1800
  getLeftLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
1700
- return (left ?? []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1801
+ return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1701
1802
  }, {
1702
1803
  key: 'getLeftLeafColumns',
1703
- debug: () => table.options.debugAll ?? table.options.debugColumns
1804
+ debug: () => {
1805
+ var _table$options$debugA4;
1806
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
1807
+ }
1704
1808
  }),
1705
1809
  getRightLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
1706
- return (right ?? []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1810
+ return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1707
1811
  }, {
1708
1812
  key: 'getRightLeafColumns',
1709
- debug: () => table.options.debugAll ?? table.options.debugColumns
1813
+ debug: () => {
1814
+ var _table$options$debugA5;
1815
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
1816
+ }
1710
1817
  }),
1711
1818
  getCenterLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
1712
- const leftAndRight = [...(left ?? []), ...(right ?? [])];
1819
+ const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1713
1820
  return allColumns.filter(d => !leftAndRight.includes(d.id));
1714
1821
  }, {
1715
1822
  key: 'getCenterLeafColumns',
1716
- debug: () => table.options.debugAll ?? table.options.debugColumns
1823
+ debug: () => {
1824
+ var _table$options$debugA6;
1825
+ return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
1826
+ }
1717
1827
  })
1718
1828
  };
1719
1829
  }
@@ -1743,7 +1853,10 @@
1743
1853
  createTable: table => {
1744
1854
  return {
1745
1855
  setRowSelection: updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater),
1746
- resetRowSelection: defaultState => table.setRowSelection(defaultState ? {} : table.initialState.rowSelection ?? {}),
1856
+ resetRowSelection: defaultState => {
1857
+ var _table$initialState$r;
1858
+ return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
1859
+ },
1747
1860
  toggleAllRowsSelected: value => {
1748
1861
  table.setRowSelection(old => {
1749
1862
  value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
@@ -1849,7 +1962,10 @@
1849
1962
  return selectRowsFn(table, rowModel);
1850
1963
  }, {
1851
1964
  key: 'getSelectedRowModel',
1852
- debug: () => table.options.debugAll ?? table.options.debugTable
1965
+ debug: () => {
1966
+ var _table$options$debugA;
1967
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
1968
+ }
1853
1969
  }),
1854
1970
  getFilteredSelectedRowModel: memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
1855
1971
  if (!Object.keys(rowSelection).length) {
@@ -1862,7 +1978,10 @@
1862
1978
  return selectRowsFn(table, rowModel);
1863
1979
  }, {
1864
1980
  key: "development" === 'production' ,
1865
- debug: () => table.options.debugAll ?? table.options.debugTable
1981
+ debug: () => {
1982
+ var _table$options$debugA2;
1983
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
1984
+ }
1866
1985
  }),
1867
1986
  getGroupedSelectedRowModel: memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
1868
1987
  if (!Object.keys(rowSelection).length) {
@@ -1875,7 +1994,10 @@
1875
1994
  return selectRowsFn(table, rowModel);
1876
1995
  }, {
1877
1996
  key: "development" === 'production' ,
1878
- debug: () => table.options.debugAll ?? table.options.debugTable
1997
+ debug: () => {
1998
+ var _table$options$debugA3;
1999
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
2000
+ }
1879
2001
  }),
1880
2002
  ///
1881
2003
 
@@ -1918,7 +2040,8 @@
1918
2040
  return isAllPageRowsSelected;
1919
2041
  },
1920
2042
  getIsSomeRowsSelected: () => {
1921
- const totalSelected = Object.keys(table.getState().rowSelection ?? {}).length;
2043
+ var _table$getState$rowSe;
2044
+ const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
1922
2045
  return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
1923
2046
  },
1924
2047
  getIsSomePageRowsSelected: () => {
@@ -1972,22 +2095,25 @@
1972
2095
  return isSubRowSelected(row, rowSelection) === 'all';
1973
2096
  },
1974
2097
  getCanSelect: () => {
2098
+ var _table$options$enable;
1975
2099
  if (typeof table.options.enableRowSelection === 'function') {
1976
2100
  return table.options.enableRowSelection(row);
1977
2101
  }
1978
- return table.options.enableRowSelection ?? true;
2102
+ return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
1979
2103
  },
1980
2104
  getCanSelectSubRows: () => {
2105
+ var _table$options$enable2;
1981
2106
  if (typeof table.options.enableSubRowSelection === 'function') {
1982
2107
  return table.options.enableSubRowSelection(row);
1983
2108
  }
1984
- return table.options.enableSubRowSelection ?? true;
2109
+ return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
1985
2110
  },
1986
2111
  getCanMultiSelect: () => {
2112
+ var _table$options$enable3;
1987
2113
  if (typeof table.options.enableMultiRowSelection === 'function') {
1988
2114
  return table.options.enableMultiRowSelection(row);
1989
2115
  }
1990
- return table.options.enableMultiRowSelection ?? true;
2116
+ return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
1991
2117
  },
1992
2118
  getToggleSelectedHandler: () => {
1993
2119
  const canSelect = row.getCanSelect();
@@ -2058,7 +2184,8 @@
2058
2184
  };
2059
2185
  }
2060
2186
  function isRowSelected(row, selection) {
2061
- return selection[row.id] ?? false;
2187
+ var _selection$row$id;
2188
+ return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
2062
2189
  }
2063
2190
  function isSubRowSelected(row, selection, table) {
2064
2191
  if (row.subRows && row.subRows.length) {
@@ -2238,11 +2365,11 @@
2238
2365
  return 'desc';
2239
2366
  },
2240
2367
  getSortingFn: () => {
2241
- var _table$options$sortin;
2368
+ var _table$options$sortin, _table$options$sortin2;
2242
2369
  if (!column) {
2243
2370
  throw new Error();
2244
2371
  }
2245
- 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];
2372
+ 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];
2246
2373
  },
2247
2374
  toggleSorting: (desc, multi) => {
2248
2375
  // if (column.columns.length) {
@@ -2296,12 +2423,13 @@
2296
2423
  }
2297
2424
  }
2298
2425
  if (sortAction === 'add') {
2426
+ var _table$options$maxMul;
2299
2427
  newSorting = [...old, {
2300
2428
  id: column.id,
2301
2429
  desc: nextDesc
2302
2430
  }];
2303
2431
  // Take latest n columns
2304
- newSorting.splice(0, newSorting.length - (table.options.maxMultiSortColCount ?? Number.MAX_SAFE_INTEGER));
2432
+ newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
2305
2433
  } else if (sortAction === 'toggle') {
2306
2434
  // This flips (or sets) the
2307
2435
  newSorting = old.map(d => {
@@ -2325,28 +2453,32 @@
2325
2453
  });
2326
2454
  },
2327
2455
  getFirstSortDir: () => {
2328
- const sortDescFirst = column.columnDef.sortDescFirst ?? table.options.sortDescFirst ?? column.getAutoSortDir() === 'desc';
2456
+ var _ref, _column$columnDef$sor;
2457
+ const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
2329
2458
  return sortDescFirst ? 'desc' : 'asc';
2330
2459
  },
2331
2460
  getNextSortingOrder: multi => {
2461
+ var _table$options$enable, _table$options$enable2;
2332
2462
  const firstSortDirection = column.getFirstSortDir();
2333
2463
  const isSorted = column.getIsSorted();
2334
2464
  if (!isSorted) {
2335
2465
  return firstSortDirection;
2336
2466
  }
2337
- if (isSorted !== firstSortDirection && (table.options.enableSortingRemoval ?? true) && (
2467
+ if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && (
2338
2468
  // If enableSortRemove, enable in general
2339
- multi ? table.options.enableMultiRemove ?? true : true) // If multi, don't allow if enableMultiRemove))
2469
+ multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) // If multi, don't allow if enableMultiRemove))
2340
2470
  ) {
2341
2471
  return false;
2342
2472
  }
2343
2473
  return isSorted === 'desc' ? 'asc' : 'desc';
2344
2474
  },
2345
2475
  getCanSort: () => {
2346
- return (column.columnDef.enableSorting ?? true) && (table.options.enableSorting ?? true) && !!column.accessorFn;
2476
+ var _column$columnDef$ena, _table$options$enable3;
2477
+ 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;
2347
2478
  },
2348
2479
  getCanMultiSort: () => {
2349
- return column.columnDef.enableMultiSort ?? table.options.enableMultiSort ?? !!column.accessorFn;
2480
+ var _ref2, _column$columnDef$ena2;
2481
+ return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
2350
2482
  },
2351
2483
  getIsSorted: () => {
2352
2484
  var _table$getState$sorti;
@@ -2354,8 +2486,8 @@
2354
2486
  return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
2355
2487
  },
2356
2488
  getSortIndex: () => {
2357
- var _table$getState$sorti2;
2358
- return ((_table$getState$sorti2 = table.getState().sorting) == null ? void 0 : _table$getState$sorti2.findIndex(d => d.id === column.id)) ?? -1;
2489
+ var _table$getState$sorti2, _table$getState$sorti3;
2490
+ 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;
2359
2491
  },
2360
2492
  clearSorting: () => {
2361
2493
  //clear sorting for just 1 column
@@ -2375,8 +2507,8 @@
2375
2507
  return {
2376
2508
  setSorting: updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater),
2377
2509
  resetSorting: defaultState => {
2378
- var _table$initialState;
2379
- table.setSorting(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) ?? []);
2510
+ var _table$initialState$s, _table$initialState;
2511
+ table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
2380
2512
  },
2381
2513
  getPreSortedRowModel: () => table.getGroupedRowModel(),
2382
2514
  getSortedRowModel: () => {
@@ -2412,16 +2544,17 @@
2412
2544
  if (column.getCanHide()) {
2413
2545
  table.setColumnVisibility(old => ({
2414
2546
  ...old,
2415
- [column.id]: value ?? !column.getIsVisible()
2547
+ [column.id]: value != null ? value : !column.getIsVisible()
2416
2548
  }));
2417
2549
  }
2418
2550
  },
2419
2551
  getIsVisible: () => {
2420
- var _table$getState$colum;
2421
- return ((_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) ?? true;
2552
+ var _table$getState$colum, _table$getState$colum2;
2553
+ return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
2422
2554
  },
2423
2555
  getCanHide: () => {
2424
- return (column.columnDef.enableHiding ?? true) && (table.options.enableHiding ?? true);
2556
+ var _column$columnDef$ena, _table$options$enable;
2557
+ return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
2425
2558
  },
2426
2559
  getToggleVisibilityHandler: () => {
2427
2560
  return e => {
@@ -2436,11 +2569,17 @@
2436
2569
  return cells.filter(cell => cell.column.getIsVisible());
2437
2570
  }, {
2438
2571
  key: "development" === 'production' ,
2439
- debug: () => table.options.debugAll ?? table.options.debugRows
2572
+ debug: () => {
2573
+ var _table$options$debugA;
2574
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
2575
+ }
2440
2576
  }),
2441
2577
  getVisibleCells: memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
2442
2578
  key: 'row.getVisibleCells',
2443
- debug: () => table.options.debugAll ?? table.options.debugRows
2579
+ debug: () => {
2580
+ var _table$options$debugA2;
2581
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
2582
+ }
2444
2583
  })
2445
2584
  };
2446
2585
  },
@@ -2450,7 +2589,10 @@
2450
2589
  return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
2451
2590
  }, {
2452
2591
  key,
2453
- debug: () => table.options.debugAll ?? table.options.debugColumns
2592
+ debug: () => {
2593
+ var _table$options$debugA3;
2594
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2595
+ }
2454
2596
  });
2455
2597
  };
2456
2598
  return {
@@ -2461,10 +2603,12 @@
2461
2603
  getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns()),
2462
2604
  setColumnVisibility: updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater),
2463
2605
  resetColumnVisibility: defaultState => {
2464
- table.setColumnVisibility(defaultState ? {} : table.initialState.columnVisibility ?? {});
2606
+ var _table$initialState$c;
2607
+ table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
2465
2608
  },
2466
2609
  toggleAllColumnsVisible: value => {
2467
- value = value ?? !table.getIsAllColumnsVisible();
2610
+ var _value;
2611
+ value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
2468
2612
  table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({
2469
2613
  ...obj,
2470
2614
  [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
@@ -2487,6 +2631,7 @@
2487
2631
  //
2488
2632
 
2489
2633
  function createTable(options) {
2634
+ var _options$initialState;
2490
2635
  if (options.debugAll || options.debugTable) {
2491
2636
  console.info('Creating Table Instance...');
2492
2637
  }
@@ -2508,10 +2653,11 @@
2508
2653
  const coreInitialState = {};
2509
2654
  let initialState = {
2510
2655
  ...coreInitialState,
2511
- ...(options.initialState ?? {})
2656
+ ...((_options$initialState = options.initialState) != null ? _options$initialState : {})
2512
2657
  };
2513
2658
  table._features.forEach(feature => {
2514
- initialState = (feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) ?? initialState;
2659
+ var _feature$getInitialSt;
2660
+ initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
2515
2661
  });
2516
2662
  const queued = [];
2517
2663
  let queuedTimeout = false;
@@ -2552,7 +2698,10 @@
2552
2698
  setState: updater => {
2553
2699
  table.options.onStateChange == null ? void 0 : table.options.onStateChange(updater);
2554
2700
  },
2555
- _getRowId: (row, index, parent) => (table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) ?? `${parent ? [parent.id, index].join('.') : index}`,
2701
+ _getRowId: (row, index, parent) => {
2702
+ var _table$options$getRow;
2703
+ 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}`;
2704
+ },
2556
2705
  getCoreRowModel: () => {
2557
2706
  if (!table._getCoreRowModel) {
2558
2707
  table._getCoreRowModel = table.options.getCoreRowModel(table);
@@ -2575,7 +2724,8 @@
2575
2724
  return row;
2576
2725
  },
2577
2726
  _getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {
2578
- defaultColumn = defaultColumn ?? {};
2727
+ var _defaultColumn;
2728
+ defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
2579
2729
  return {
2580
2730
  header: props => {
2581
2731
  const resolvedColumnDef = props.header.column.columnDef;
@@ -2589,8 +2739,8 @@
2589
2739
  },
2590
2740
  // footer: props => props.header.column.id,
2591
2741
  cell: props => {
2592
- var _props$renderValue;
2593
- return ((_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) ?? null;
2742
+ var _props$renderValue$to, _props$renderValue;
2743
+ 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;
2594
2744
  },
2595
2745
  ...table._features.reduce((obj, feature) => {
2596
2746
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
@@ -2598,7 +2748,10 @@
2598
2748
  ...defaultColumn
2599
2749
  };
2600
2750
  }, {
2601
- debug: () => table.options.debugAll ?? table.options.debugColumns,
2751
+ debug: () => {
2752
+ var _table$options$debugA;
2753
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
2754
+ },
2602
2755
  key: 'getDefaultColumnDef'
2603
2756
  }),
2604
2757
  _getColumnDefs: () => table.options.columns,
@@ -2617,7 +2770,10 @@
2617
2770
  return recurseColumns(columnDefs);
2618
2771
  }, {
2619
2772
  key: 'getAllColumns',
2620
- debug: () => table.options.debugAll ?? table.options.debugColumns
2773
+ debug: () => {
2774
+ var _table$options$debugA2;
2775
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
2776
+ }
2621
2777
  }),
2622
2778
  getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {
2623
2779
  return allColumns.flatMap(column => {
@@ -2625,7 +2781,10 @@
2625
2781
  });
2626
2782
  }, {
2627
2783
  key: 'getAllFlatColumns',
2628
- debug: () => table.options.debugAll ?? table.options.debugColumns
2784
+ debug: () => {
2785
+ var _table$options$debugA3;
2786
+ return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2787
+ }
2629
2788
  }),
2630
2789
  _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {
2631
2790
  return flatColumns.reduce((acc, column) => {
@@ -2634,14 +2793,20 @@
2634
2793
  }, {});
2635
2794
  }, {
2636
2795
  key: 'getAllFlatColumnsById',
2637
- debug: () => table.options.debugAll ?? table.options.debugColumns
2796
+ debug: () => {
2797
+ var _table$options$debugA4;
2798
+ return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
2799
+ }
2638
2800
  }),
2639
2801
  getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
2640
2802
  let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
2641
2803
  return orderColumns(leafColumns);
2642
2804
  }, {
2643
2805
  key: 'getAllLeafColumns',
2644
- debug: () => table.options.debugAll ?? table.options.debugColumns
2806
+ debug: () => {
2807
+ var _table$options$debugA5;
2808
+ return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
2809
+ }
2645
2810
  }),
2646
2811
  getColumn: columnId => {
2647
2812
  const column = table._getAllFlatColumnsById()[columnId];
@@ -2662,7 +2827,10 @@
2662
2827
  }
2663
2828
 
2664
2829
  function createCell(table, row, column, columnId) {
2665
- const getRenderValue = () => cell.getValue() ?? table.options.renderFallbackValue;
2830
+ const getRenderValue = () => {
2831
+ var _cell$getValue;
2832
+ return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
2833
+ };
2666
2834
  const cell = {
2667
2835
  id: `${row.id}_${column.id}`,
2668
2836
  row,
@@ -2721,8 +2889,11 @@
2721
2889
  row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);
2722
2890
  return row._uniqueValuesCache[columnId];
2723
2891
  },
2724
- renderValue: columnId => row.getValue(columnId) ?? table.options.renderFallbackValue,
2725
- subRows: subRows ?? [],
2892
+ renderValue: columnId => {
2893
+ var _row$getValue;
2894
+ return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
2895
+ },
2896
+ subRows: subRows != null ? subRows : [],
2726
2897
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
2727
2898
  getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {
2728
2899
  return leafColumns.map(column => {
@@ -2730,7 +2901,10 @@
2730
2901
  });
2731
2902
  }, {
2732
2903
  key: 'row.getAllCells',
2733
- debug: () => table.options.debugAll ?? table.options.debugRows
2904
+ debug: () => {
2905
+ var _table$options$debugA;
2906
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
2907
+ }
2734
2908
  }),
2735
2909
  _getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {
2736
2910
  return allCells.reduce((acc, cell) => {
@@ -2739,7 +2913,10 @@
2739
2913
  }, {});
2740
2914
  }, {
2741
2915
  key: "development" === 'production' ,
2742
- debug: () => table.options.debugAll ?? table.options.debugRows
2916
+ debug: () => {
2917
+ var _table$options$debugA2;
2918
+ return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
2919
+ }
2743
2920
  })
2744
2921
  };
2745
2922
  for (let i = 0; i < table._features.length; i++) {
@@ -2853,7 +3030,10 @@
2853
3030
  return rowModel;
2854
3031
  }, {
2855
3032
  key: 'getRowModel',
2856
- debug: () => table.options.debugAll ?? table.options.debugTable,
3033
+ debug: () => {
3034
+ var _table$options$debugA;
3035
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3036
+ },
2857
3037
  onChange: () => {
2858
3038
  table._autoResetPageIndex();
2859
3039
  }
@@ -2867,9 +3047,14 @@
2867
3047
  return filterRowModelFromRoot(rows, filterRowImpl, table);
2868
3048
  }
2869
3049
  function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
3050
+ var _table$options$maxLea;
2870
3051
  const newFilteredFlatRows = [];
2871
3052
  const newFilteredRowsById = {};
3053
+ const maxDepth = (_table$options$maxLea = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea : 100;
2872
3054
  const recurseFilterRows = function (rowsToFilter, depth) {
3055
+ if (depth === void 0) {
3056
+ depth = 0;
3057
+ }
2873
3058
  const rows = [];
2874
3059
 
2875
3060
  // Filter from children up first
@@ -2878,8 +3063,8 @@
2878
3063
  let row = rowsToFilter[i];
2879
3064
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2880
3065
  newRow.columnFilters = row.columnFilters;
2881
- if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
2882
- newRow.subRows = recurseFilterRows(row.subRows);
3066
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length && depth < maxDepth) {
3067
+ newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
2883
3068
  row = newRow;
2884
3069
  if (filterRow(row) && !newRow.subRows.length) {
2885
3070
  rows.push(row);
@@ -2911,11 +3096,16 @@
2911
3096
  };
2912
3097
  }
2913
3098
  function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
3099
+ var _table$options$maxLea2;
2914
3100
  const newFilteredFlatRows = [];
2915
3101
  const newFilteredRowsById = {};
3102
+ const maxDepth = (_table$options$maxLea2 = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea2 : 100;
2916
3103
 
2917
3104
  // Filters top level and nested rows
2918
3105
  const recurseFilterRows = function (rowsToFilter, depth) {
3106
+ if (depth === void 0) {
3107
+ depth = 0;
3108
+ }
2919
3109
  // Filter from parents downward first
2920
3110
 
2921
3111
  const rows = [];
@@ -2926,9 +3116,9 @@
2926
3116
  const pass = filterRow(row);
2927
3117
  if (pass) {
2928
3118
  var _row$subRows2;
2929
- if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length) {
3119
+ if ((_row$subRows2 = row.subRows) != null && _row$subRows2.length && depth < maxDepth) {
2930
3120
  const newRow = createRow(table, row.id, row.original, row.index, row.depth);
2931
- newRow.subRows = recurseFilterRows(row.subRows);
3121
+ newRow.subRows = recurseFilterRows(row.subRows, depth + 1);
2932
3122
  row = newRow;
2933
3123
  }
2934
3124
  rows.push(row);
@@ -2956,7 +3146,8 @@
2956
3146
  }
2957
3147
  const resolvedColumnFilters = [];
2958
3148
  const resolvedGlobalFilters = [];
2959
- (columnFilters ?? []).forEach(d => {
3149
+ (columnFilters != null ? columnFilters : []).forEach(d => {
3150
+ var _filterFn$resolveFilt;
2960
3151
  const column = table.getColumn(d.id);
2961
3152
  if (!column) {
2962
3153
  {
@@ -2973,7 +3164,7 @@
2973
3164
  resolvedColumnFilters.push({
2974
3165
  id: d.id,
2975
3166
  filterFn,
2976
- resolvedValue: (filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) ?? d.value
3167
+ resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value
2977
3168
  });
2978
3169
  });
2979
3170
  const filterableIds = columnFilters.map(d => d.id);
@@ -2982,10 +3173,11 @@
2982
3173
  if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
2983
3174
  filterableIds.push('__global__');
2984
3175
  globallyFilterableColumns.forEach(column => {
3176
+ var _globalFilterFn$resol;
2985
3177
  resolvedGlobalFilters.push({
2986
3178
  id: column.id,
2987
3179
  filterFn: globalFilterFn,
2988
- resolvedValue: (globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) ?? globalFilter
3180
+ resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
2989
3181
  });
2990
3182
  });
2991
3183
  }
@@ -3038,7 +3230,10 @@
3038
3230
  return filterRows(rowModel.rows, filterRowsImpl, table);
3039
3231
  }, {
3040
3232
  key: 'getFilteredRowModel',
3041
- debug: () => table.options.debugAll ?? table.options.debugTable,
3233
+ debug: () => {
3234
+ var _table$options$debugA;
3235
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3236
+ },
3042
3237
  onChange: () => {
3043
3238
  table._autoResetPageIndex();
3044
3239
  }
@@ -3063,7 +3258,10 @@
3063
3258
  return filterRows(preRowModel.rows, filterRowsImpl, table);
3064
3259
  }, {
3065
3260
  key: 'getFacetedRowModel_' + columnId,
3066
- debug: () => table.options.debugAll ?? table.options.debugTable,
3261
+ debug: () => {
3262
+ var _table$options$debugA;
3263
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3264
+ },
3067
3265
  onChange: () => {}
3068
3266
  });
3069
3267
  }
@@ -3076,7 +3274,8 @@
3076
3274
  for (let j = 0; j < values.length; j++) {
3077
3275
  const value = values[j];
3078
3276
  if (facetedUniqueValues.has(value)) {
3079
- facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1);
3277
+ var _facetedUniqueValues$;
3278
+ facetedUniqueValues.set(value, ((_facetedUniqueValues$ = facetedUniqueValues.get(value)) != null ? _facetedUniqueValues$ : 0) + 1);
3080
3279
  } else {
3081
3280
  facetedUniqueValues.set(value, 1);
3082
3281
  }
@@ -3085,7 +3284,10 @@
3085
3284
  return facetedUniqueValues;
3086
3285
  }, {
3087
3286
  key: 'getFacetedUniqueValues_' + columnId,
3088
- debug: () => table.options.debugAll ?? table.options.debugTable,
3287
+ debug: () => {
3288
+ var _table$options$debugA;
3289
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3290
+ },
3089
3291
  onChange: () => {}
3090
3292
  });
3091
3293
  }
@@ -3112,7 +3314,10 @@
3112
3314
  return facetedMinMaxValues;
3113
3315
  }, {
3114
3316
  key: 'getFacetedMinMaxValues_' + columnId,
3115
- debug: () => table.options.debugAll ?? table.options.debugTable,
3317
+ debug: () => {
3318
+ var _table$options$debugA;
3319
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3320
+ },
3116
3321
  onChange: () => {}
3117
3322
  });
3118
3323
  }
@@ -3142,9 +3347,10 @@
3142
3347
  const sortedData = [...rows];
3143
3348
  sortedData.sort((rowA, rowB) => {
3144
3349
  for (let i = 0; i < availableSorting.length; i += 1) {
3350
+ var _sortEntry$desc;
3145
3351
  const sortEntry = availableSorting[i];
3146
3352
  const columnInfo = columnInfoById[sortEntry.id];
3147
- const isDesc = (sortEntry == null ? void 0 : sortEntry.desc) ?? false;
3353
+ const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
3148
3354
  if (columnInfo.sortUndefined) {
3149
3355
  const aValue = rowA.getValue(sortEntry.id);
3150
3356
  const bValue = rowB.getValue(sortEntry.id);
@@ -3187,7 +3393,10 @@
3187
3393
  };
3188
3394
  }, {
3189
3395
  key: 'getSortedRowModel',
3190
- debug: () => table.options.debugAll ?? table.options.debugTable,
3396
+ debug: () => {
3397
+ var _table$options$debugA;
3398
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3399
+ },
3191
3400
  onChange: () => {
3192
3401
  table._autoResetPageIndex();
3193
3402
  }
@@ -3256,7 +3465,8 @@
3256
3465
  return row._valuesCache[columnId];
3257
3466
  }
3258
3467
  if (groupedRows[0]) {
3259
- row._valuesCache[columnId] = groupedRows[0].getValue(columnId) ?? undefined;
3468
+ var _groupedRows$0$getVal;
3469
+ row._valuesCache[columnId] = (_groupedRows$0$getVal = groupedRows[0].getValue(columnId)) != null ? _groupedRows$0$getVal : undefined;
3260
3470
  }
3261
3471
  return row._valuesCache[columnId];
3262
3472
  }
@@ -3309,7 +3519,10 @@
3309
3519
  };
3310
3520
  }, {
3311
3521
  key: 'getGroupedRowModel',
3312
- debug: () => table.options.debugAll ?? table.options.debugTable,
3522
+ debug: () => {
3523
+ var _table$options$debugA;
3524
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3525
+ },
3313
3526
  onChange: () => {
3314
3527
  table._queue(() => {
3315
3528
  table._autoResetExpanded();
@@ -3334,7 +3547,7 @@
3334
3547
 
3335
3548
  function getExpandedRowModel() {
3336
3549
  return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3337
- if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded ?? {}).length) {
3550
+ if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3338
3551
  return rowModel;
3339
3552
  }
3340
3553
  if (!paginateExpandedRows) {
@@ -3344,7 +3557,10 @@
3344
3557
  return expandRows(rowModel);
3345
3558
  }, {
3346
3559
  key: 'getExpandedRowModel',
3347
- debug: () => table.options.debugAll ?? table.options.debugTable
3560
+ debug: () => {
3561
+ var _table$options$debugA;
3562
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3563
+ }
3348
3564
  });
3349
3565
  }
3350
3566
  function expandRows(rowModel) {
@@ -3406,7 +3622,10 @@
3406
3622
  return paginatedRowModel;
3407
3623
  }, {
3408
3624
  key: 'getPaginationRowModel',
3409
- debug: () => table.options.debugAll ?? table.options.debugTable
3625
+ debug: () => {
3626
+ var _table$options$debugA;
3627
+ return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3628
+ }
3410
3629
  });
3411
3630
  }
3412
3631