@tanstack/react-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.
@@ -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();
@@ -1021,14 +1089,18 @@
1021
1089
  return filterFns.weakEquals;
1022
1090
  },
1023
1091
  getFilterFn: () => {
1024
- var _table$options$filter;
1025
- 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];
1026
1096
  },
1027
1097
  getCanFilter: () => {
1028
- 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;
1029
1100
  },
1030
1101
  getCanGlobalFilter: () => {
1031
- 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;
1032
1104
  },
1033
1105
  getIsFiltered: () => column.getFilterIndex() > -1,
1034
1106
  getFilterValue: () => {
@@ -1036,8 +1108,8 @@
1036
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;
1037
1109
  },
1038
1110
  getFilterIndex: () => {
1039
- var _table$getState$colum3;
1040
- 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;
1041
1113
  },
1042
1114
  setFilterValue: value => {
1043
1115
  table.setColumnFilters(old => {
@@ -1047,19 +1119,21 @@
1047
1119
 
1048
1120
  //
1049
1121
  if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
1050
- 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 : [];
1051
1124
  }
1052
1125
  const newFilterObj = {
1053
1126
  id: column.id,
1054
1127
  value: newFilter
1055
1128
  };
1056
1129
  if (previousfilter) {
1057
- return (old == null ? void 0 : old.map(d => {
1130
+ var _old$map;
1131
+ return (_old$map = old == null ? void 0 : old.map(d => {
1058
1132
  if (d.id === column.id) {
1059
1133
  return newFilterObj;
1060
1134
  }
1061
1135
  return d;
1062
- })) ?? [];
1136
+ })) != null ? _old$map : [];
1063
1137
  }
1064
1138
  if (old != null && old.length) {
1065
1139
  return [...old, newFilterObj];
@@ -1105,11 +1179,13 @@
1105
1179
  return filterFns.includesString;
1106
1180
  },
1107
1181
  getGlobalFilterFn: () => {
1108
- var _table$options$filter2;
1182
+ var _table$options$filter3, _table$options$filter4;
1109
1183
  const {
1110
1184
  globalFilterFn: globalFilterFn
1111
1185
  } = table.options;
1112
- 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];
1113
1189
  },
1114
1190
  setColumnFilters: updater => {
1115
1191
  const leafColumns = table.getAllLeafColumns();
@@ -1135,8 +1211,8 @@
1135
1211
  table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
1136
1212
  },
1137
1213
  resetColumnFilters: defaultState => {
1138
- var _table$initialState;
1139
- 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 : []);
1140
1216
  },
1141
1217
  getPreFilteredRowModel: () => table.getCoreRowModel(),
1142
1218
  getFilteredRowModel: () => {
@@ -1274,8 +1350,8 @@
1274
1350
  getDefaultColumnDef: () => {
1275
1351
  return {
1276
1352
  aggregatedCell: props => {
1277
- var _props$getValue;
1278
- 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;
1279
1355
  },
1280
1356
  aggregationFn: 'auto'
1281
1357
  };
@@ -1300,11 +1376,12 @@
1300
1376
  if (old != null && old.includes(column.id)) {
1301
1377
  return old.filter(d => d !== column.id);
1302
1378
  }
1303
- return [...(old ?? []), column.id];
1379
+ return [...(old != null ? old : []), column.id];
1304
1380
  });
1305
1381
  },
1306
1382
  getCanGroup: () => {
1307
- 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;
1308
1385
  },
1309
1386
  getIsGrouped: () => {
1310
1387
  var _table$getState$group;
@@ -1332,11 +1409,11 @@
1332
1409
  }
1333
1410
  },
1334
1411
  getAggregationFn: () => {
1335
- var _table$options$aggreg;
1412
+ var _table$options$aggreg, _table$options$aggreg2;
1336
1413
  if (!column) {
1337
1414
  throw new Error();
1338
1415
  }
1339
- 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];
1340
1417
  }
1341
1418
  };
1342
1419
  },
@@ -1344,8 +1421,8 @@
1344
1421
  return {
1345
1422
  setGrouping: updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater),
1346
1423
  resetGrouping: defaultState => {
1347
- var _table$initialState;
1348
- 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 : []);
1349
1426
  },
1350
1427
  getPreGroupedRowModel: () => table.getFilteredRowModel(),
1351
1428
  getGroupedRowModel: () => {
@@ -1406,7 +1483,8 @@
1406
1483
  return {
1407
1484
  setColumnOrder: updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater),
1408
1485
  resetColumnOrder: defaultState => {
1409
- 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 : []);
1410
1488
  },
1411
1489
  _getOrderColumnsFn: memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
1412
1490
  // Sort grouped columns to the start of the column list
@@ -1473,13 +1551,14 @@
1473
1551
  let queued = false;
1474
1552
  return {
1475
1553
  _autoResetPageIndex: () => {
1554
+ var _ref, _table$options$autoRe;
1476
1555
  if (!registered) {
1477
1556
  table._queue(() => {
1478
1557
  registered = true;
1479
1558
  });
1480
1559
  return;
1481
1560
  }
1482
- 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) {
1483
1562
  if (queued) return;
1484
1563
  queued = true;
1485
1564
  table._queue(() => {
@@ -1496,7 +1575,8 @@
1496
1575
  return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
1497
1576
  },
1498
1577
  resetPagination: defaultState => {
1499
- 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());
1500
1580
  },
1501
1581
  setPageIndex: updater => {
1502
1582
  table.setPagination(old => {
@@ -1510,12 +1590,12 @@
1510
1590
  });
1511
1591
  },
1512
1592
  resetPageIndex: defaultState => {
1513
- var _table$initialState, _table$initialState$p;
1514
- 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);
1515
1595
  },
1516
1596
  resetPageSize: defaultState => {
1517
- var _table$initialState2, _table$initialState2$;
1518
- 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);
1519
1599
  },
1520
1600
  setPageSize: updater => {
1521
1601
  table.setPagination(old => {
@@ -1530,7 +1610,8 @@
1530
1610
  });
1531
1611
  },
1532
1612
  setPageCount: updater => table.setPagination(old => {
1533
- 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);
1534
1615
  if (typeof newPageCount === 'number') {
1535
1616
  newPageCount = Math.max(-1, newPageCount);
1536
1617
  }
@@ -1547,7 +1628,10 @@
1547
1628
  return pageOptions;
1548
1629
  }, {
1549
1630
  key: 'getPageOptions',
1550
- 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
+ }
1551
1635
  }),
1552
1636
  getCanPreviousPage: () => table.getState().pagination.pageIndex > 0,
1553
1637
  getCanNextPage: () => {
@@ -1582,7 +1666,8 @@
1582
1666
  return table._getPaginationRowModel();
1583
1667
  },
1584
1668
  getPageCount: () => {
1585
- 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);
1586
1671
  }
1587
1672
  };
1588
1673
  }
@@ -1611,27 +1696,33 @@
1611
1696
  pin: position => {
1612
1697
  const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);
1613
1698
  table.setColumnPinning(old => {
1699
+ var _old$left3, _old$right3;
1614
1700
  if (position === 'right') {
1701
+ var _old$left, _old$right;
1615
1702
  return {
1616
- left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1617
- 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]
1618
1705
  };
1619
1706
  }
1620
1707
  if (position === 'left') {
1708
+ var _old$left2, _old$right2;
1621
1709
  return {
1622
- left: [...((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1623
- 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)))
1624
1712
  };
1625
1713
  }
1626
1714
  return {
1627
- left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1628
- 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)))
1629
1717
  };
1630
1718
  });
1631
1719
  },
1632
1720
  getCanPin: () => {
1633
1721
  const leafColumns = column.getLeafColumns();
1634
- 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
+ });
1635
1726
  },
1636
1727
  getIsPinned: () => {
1637
1728
  const leafColumnIds = column.getLeafColumns().map(d => d.id);
@@ -1644,40 +1735,49 @@
1644
1735
  return isLeft ? 'left' : isRight ? 'right' : false;
1645
1736
  },
1646
1737
  getPinnedIndex: () => {
1647
- var _table$getState$colum, _table$getState$colum2;
1738
+ var _table$getState$colum, _table$getState$colum2, _table$getState$colum3;
1648
1739
  const position = column.getIsPinned();
1649
- 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;
1650
1741
  }
1651
1742
  };
1652
1743
  },
1653
1744
  createRow: (row, table) => {
1654
1745
  return {
1655
1746
  getCenterVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
1656
- const leftAndRight = [...(left ?? []), ...(right ?? [])];
1747
+ const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1657
1748
  return allCells.filter(d => !leftAndRight.includes(d.column.id));
1658
1749
  }, {
1659
1750
  key: "development" === 'production' ,
1660
- 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
+ }
1661
1755
  }),
1662
1756
  getLeftVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
1663
- 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 => ({
1664
1758
  ...d,
1665
1759
  position: 'left'
1666
1760
  }));
1667
1761
  return cells;
1668
1762
  }, {
1669
1763
  key: "development" === 'production' ,
1670
- 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
+ }
1671
1768
  }),
1672
1769
  getRightVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
1673
- 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 => ({
1674
1771
  ...d,
1675
1772
  position: 'right'
1676
1773
  }));
1677
1774
  return cells;
1678
1775
  }, {
1679
1776
  key: "development" === 'production' ,
1680
- 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
+ }
1681
1781
  })
1682
1782
  };
1683
1783
  },
@@ -1685,8 +1785,8 @@
1685
1785
  return {
1686
1786
  setColumnPinning: updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater),
1687
1787
  resetColumnPinning: defaultState => {
1688
- var _table$initialState;
1689
- 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());
1690
1790
  },
1691
1791
  getIsSomeColumnsPinned: position => {
1692
1792
  var _pinningState$positio;
@@ -1698,23 +1798,32 @@
1698
1798
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
1699
1799
  },
1700
1800
  getLeftLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
1701
- 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);
1702
1802
  }, {
1703
1803
  key: 'getLeftLeafColumns',
1704
- 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
+ }
1705
1808
  }),
1706
1809
  getRightLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
1707
- 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);
1708
1811
  }, {
1709
1812
  key: 'getRightLeafColumns',
1710
- 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
+ }
1711
1817
  }),
1712
1818
  getCenterLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
1713
- const leftAndRight = [...(left ?? []), ...(right ?? [])];
1819
+ const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1714
1820
  return allColumns.filter(d => !leftAndRight.includes(d.id));
1715
1821
  }, {
1716
1822
  key: 'getCenterLeafColumns',
1717
- 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
+ }
1718
1827
  })
1719
1828
  };
1720
1829
  }
@@ -1744,7 +1853,10 @@
1744
1853
  createTable: table => {
1745
1854
  return {
1746
1855
  setRowSelection: updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater),
1747
- 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
+ },
1748
1860
  toggleAllRowsSelected: value => {
1749
1861
  table.setRowSelection(old => {
1750
1862
  value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
@@ -1850,7 +1962,10 @@
1850
1962
  return selectRowsFn(table, rowModel);
1851
1963
  }, {
1852
1964
  key: 'getSelectedRowModel',
1853
- 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
+ }
1854
1969
  }),
1855
1970
  getFilteredSelectedRowModel: memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
1856
1971
  if (!Object.keys(rowSelection).length) {
@@ -1863,7 +1978,10 @@
1863
1978
  return selectRowsFn(table, rowModel);
1864
1979
  }, {
1865
1980
  key: "development" === 'production' ,
1866
- 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
+ }
1867
1985
  }),
1868
1986
  getGroupedSelectedRowModel: memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
1869
1987
  if (!Object.keys(rowSelection).length) {
@@ -1876,7 +1994,10 @@
1876
1994
  return selectRowsFn(table, rowModel);
1877
1995
  }, {
1878
1996
  key: "development" === 'production' ,
1879
- 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
+ }
1880
2001
  }),
1881
2002
  ///
1882
2003
 
@@ -1919,7 +2040,8 @@
1919
2040
  return isAllPageRowsSelected;
1920
2041
  },
1921
2042
  getIsSomeRowsSelected: () => {
1922
- 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;
1923
2045
  return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
1924
2046
  },
1925
2047
  getIsSomePageRowsSelected: () => {
@@ -1973,22 +2095,25 @@
1973
2095
  return isSubRowSelected(row, rowSelection) === 'all';
1974
2096
  },
1975
2097
  getCanSelect: () => {
2098
+ var _table$options$enable;
1976
2099
  if (typeof table.options.enableRowSelection === 'function') {
1977
2100
  return table.options.enableRowSelection(row);
1978
2101
  }
1979
- return table.options.enableRowSelection ?? true;
2102
+ return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
1980
2103
  },
1981
2104
  getCanSelectSubRows: () => {
2105
+ var _table$options$enable2;
1982
2106
  if (typeof table.options.enableSubRowSelection === 'function') {
1983
2107
  return table.options.enableSubRowSelection(row);
1984
2108
  }
1985
- return table.options.enableSubRowSelection ?? true;
2109
+ return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
1986
2110
  },
1987
2111
  getCanMultiSelect: () => {
2112
+ var _table$options$enable3;
1988
2113
  if (typeof table.options.enableMultiRowSelection === 'function') {
1989
2114
  return table.options.enableMultiRowSelection(row);
1990
2115
  }
1991
- return table.options.enableMultiRowSelection ?? true;
2116
+ return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
1992
2117
  },
1993
2118
  getToggleSelectedHandler: () => {
1994
2119
  const canSelect = row.getCanSelect();
@@ -2059,7 +2184,8 @@
2059
2184
  };
2060
2185
  }
2061
2186
  function isRowSelected(row, selection) {
2062
- return selection[row.id] ?? false;
2187
+ var _selection$row$id;
2188
+ return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
2063
2189
  }
2064
2190
  function isSubRowSelected(row, selection, table) {
2065
2191
  if (row.subRows && row.subRows.length) {
@@ -2239,11 +2365,11 @@
2239
2365
  return 'desc';
2240
2366
  },
2241
2367
  getSortingFn: () => {
2242
- var _table$options$sortin;
2368
+ var _table$options$sortin, _table$options$sortin2;
2243
2369
  if (!column) {
2244
2370
  throw new Error();
2245
2371
  }
2246
- 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];
2247
2373
  },
2248
2374
  toggleSorting: (desc, multi) => {
2249
2375
  // if (column.columns.length) {
@@ -2297,12 +2423,13 @@
2297
2423
  }
2298
2424
  }
2299
2425
  if (sortAction === 'add') {
2426
+ var _table$options$maxMul;
2300
2427
  newSorting = [...old, {
2301
2428
  id: column.id,
2302
2429
  desc: nextDesc
2303
2430
  }];
2304
2431
  // Take latest n columns
2305
- 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));
2306
2433
  } else if (sortAction === 'toggle') {
2307
2434
  // This flips (or sets) the
2308
2435
  newSorting = old.map(d => {
@@ -2326,28 +2453,32 @@
2326
2453
  });
2327
2454
  },
2328
2455
  getFirstSortDir: () => {
2329
- 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';
2330
2458
  return sortDescFirst ? 'desc' : 'asc';
2331
2459
  },
2332
2460
  getNextSortingOrder: multi => {
2461
+ var _table$options$enable, _table$options$enable2;
2333
2462
  const firstSortDirection = column.getFirstSortDir();
2334
2463
  const isSorted = column.getIsSorted();
2335
2464
  if (!isSorted) {
2336
2465
  return firstSortDirection;
2337
2466
  }
2338
- if (isSorted !== firstSortDirection && (table.options.enableSortingRemoval ?? true) && (
2467
+ if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && (
2339
2468
  // If enableSortRemove, enable in general
2340
- 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))
2341
2470
  ) {
2342
2471
  return false;
2343
2472
  }
2344
2473
  return isSorted === 'desc' ? 'asc' : 'desc';
2345
2474
  },
2346
2475
  getCanSort: () => {
2347
- 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;
2348
2478
  },
2349
2479
  getCanMultiSort: () => {
2350
- 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;
2351
2482
  },
2352
2483
  getIsSorted: () => {
2353
2484
  var _table$getState$sorti;
@@ -2355,8 +2486,8 @@
2355
2486
  return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
2356
2487
  },
2357
2488
  getSortIndex: () => {
2358
- var _table$getState$sorti2;
2359
- 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;
2360
2491
  },
2361
2492
  clearSorting: () => {
2362
2493
  //clear sorting for just 1 column
@@ -2376,8 +2507,8 @@
2376
2507
  return {
2377
2508
  setSorting: updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater),
2378
2509
  resetSorting: defaultState => {
2379
- var _table$initialState;
2380
- 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 : []);
2381
2512
  },
2382
2513
  getPreSortedRowModel: () => table.getGroupedRowModel(),
2383
2514
  getSortedRowModel: () => {
@@ -2413,16 +2544,17 @@
2413
2544
  if (column.getCanHide()) {
2414
2545
  table.setColumnVisibility(old => ({
2415
2546
  ...old,
2416
- [column.id]: value ?? !column.getIsVisible()
2547
+ [column.id]: value != null ? value : !column.getIsVisible()
2417
2548
  }));
2418
2549
  }
2419
2550
  },
2420
2551
  getIsVisible: () => {
2421
- var _table$getState$colum;
2422
- 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;
2423
2554
  },
2424
2555
  getCanHide: () => {
2425
- 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);
2426
2558
  },
2427
2559
  getToggleVisibilityHandler: () => {
2428
2560
  return e => {
@@ -2437,11 +2569,17 @@
2437
2569
  return cells.filter(cell => cell.column.getIsVisible());
2438
2570
  }, {
2439
2571
  key: "development" === 'production' ,
2440
- 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
+ }
2441
2576
  }),
2442
2577
  getVisibleCells: memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
2443
2578
  key: 'row.getVisibleCells',
2444
- 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
+ }
2445
2583
  })
2446
2584
  };
2447
2585
  },
@@ -2451,7 +2589,10 @@
2451
2589
  return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
2452
2590
  }, {
2453
2591
  key,
2454
- 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
+ }
2455
2596
  });
2456
2597
  };
2457
2598
  return {
@@ -2462,10 +2603,12 @@
2462
2603
  getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns()),
2463
2604
  setColumnVisibility: updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater),
2464
2605
  resetColumnVisibility: defaultState => {
2465
- 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 : {});
2466
2608
  },
2467
2609
  toggleAllColumnsVisible: value => {
2468
- value = value ?? !table.getIsAllColumnsVisible();
2610
+ var _value;
2611
+ value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
2469
2612
  table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({
2470
2613
  ...obj,
2471
2614
  [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
@@ -2488,6 +2631,7 @@
2488
2631
  //
2489
2632
 
2490
2633
  function createTable(options) {
2634
+ var _options$initialState;
2491
2635
  if (options.debugAll || options.debugTable) {
2492
2636
  console.info('Creating Table Instance...');
2493
2637
  }
@@ -2509,10 +2653,11 @@
2509
2653
  const coreInitialState = {};
2510
2654
  let initialState = {
2511
2655
  ...coreInitialState,
2512
- ...(options.initialState ?? {})
2656
+ ...((_options$initialState = options.initialState) != null ? _options$initialState : {})
2513
2657
  };
2514
2658
  table._features.forEach(feature => {
2515
- 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;
2516
2661
  });
2517
2662
  const queued = [];
2518
2663
  let queuedTimeout = false;
@@ -2553,7 +2698,10 @@
2553
2698
  setState: updater => {
2554
2699
  table.options.onStateChange == null ? void 0 : table.options.onStateChange(updater);
2555
2700
  },
2556
- _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
+ },
2557
2705
  getCoreRowModel: () => {
2558
2706
  if (!table._getCoreRowModel) {
2559
2707
  table._getCoreRowModel = table.options.getCoreRowModel(table);
@@ -2576,7 +2724,8 @@
2576
2724
  return row;
2577
2725
  },
2578
2726
  _getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {
2579
- defaultColumn = defaultColumn ?? {};
2727
+ var _defaultColumn;
2728
+ defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
2580
2729
  return {
2581
2730
  header: props => {
2582
2731
  const resolvedColumnDef = props.header.column.columnDef;
@@ -2590,8 +2739,8 @@
2590
2739
  },
2591
2740
  // footer: props => props.header.column.id,
2592
2741
  cell: props => {
2593
- var _props$renderValue;
2594
- 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;
2595
2744
  },
2596
2745
  ...table._features.reduce((obj, feature) => {
2597
2746
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
@@ -2599,7 +2748,10 @@
2599
2748
  ...defaultColumn
2600
2749
  };
2601
2750
  }, {
2602
- 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
+ },
2603
2755
  key: 'getDefaultColumnDef'
2604
2756
  }),
2605
2757
  _getColumnDefs: () => table.options.columns,
@@ -2618,7 +2770,10 @@
2618
2770
  return recurseColumns(columnDefs);
2619
2771
  }, {
2620
2772
  key: 'getAllColumns',
2621
- 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
+ }
2622
2777
  }),
2623
2778
  getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {
2624
2779
  return allColumns.flatMap(column => {
@@ -2626,7 +2781,10 @@
2626
2781
  });
2627
2782
  }, {
2628
2783
  key: 'getAllFlatColumns',
2629
- 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
+ }
2630
2788
  }),
2631
2789
  _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {
2632
2790
  return flatColumns.reduce((acc, column) => {
@@ -2635,14 +2793,20 @@
2635
2793
  }, {});
2636
2794
  }, {
2637
2795
  key: 'getAllFlatColumnsById',
2638
- 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
+ }
2639
2800
  }),
2640
2801
  getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
2641
2802
  let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
2642
2803
  return orderColumns(leafColumns);
2643
2804
  }, {
2644
2805
  key: 'getAllLeafColumns',
2645
- 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
+ }
2646
2810
  }),
2647
2811
  getColumn: columnId => {
2648
2812
  const column = table._getAllFlatColumnsById()[columnId];
@@ -2663,7 +2827,10 @@
2663
2827
  }
2664
2828
 
2665
2829
  function createCell(table, row, column, columnId) {
2666
- 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
+ };
2667
2834
  const cell = {
2668
2835
  id: `${row.id}_${column.id}`,
2669
2836
  row,
@@ -2722,8 +2889,11 @@
2722
2889
  row._uniqueValuesCache[columnId] = column.columnDef.getUniqueValues(row.original, rowIndex);
2723
2890
  return row._uniqueValuesCache[columnId];
2724
2891
  },
2725
- renderValue: columnId => row.getValue(columnId) ?? table.options.renderFallbackValue,
2726
- 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 : [],
2727
2897
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
2728
2898
  getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {
2729
2899
  return leafColumns.map(column => {
@@ -2731,7 +2901,10 @@
2731
2901
  });
2732
2902
  }, {
2733
2903
  key: 'row.getAllCells',
2734
- 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
+ }
2735
2908
  }),
2736
2909
  _getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {
2737
2910
  return allCells.reduce((acc, cell) => {
@@ -2740,7 +2913,10 @@
2740
2913
  }, {});
2741
2914
  }, {
2742
2915
  key: "development" === 'production' ,
2743
- 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
+ }
2744
2920
  })
2745
2921
  };
2746
2922
  for (let i = 0; i < table._features.length; i++) {
@@ -2854,7 +3030,10 @@
2854
3030
  return rowModel;
2855
3031
  }, {
2856
3032
  key: 'getRowModel',
2857
- 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
+ },
2858
3037
  onChange: () => {
2859
3038
  table._autoResetPageIndex();
2860
3039
  }
@@ -2868,9 +3047,10 @@
2868
3047
  return filterRowModelFromRoot(rows, filterRowImpl, table);
2869
3048
  }
2870
3049
  function filterRowModelFromLeafs(rowsToFilter, filterRow, table) {
3050
+ var _table$options$maxLea;
2871
3051
  const newFilteredFlatRows = [];
2872
3052
  const newFilteredRowsById = {};
2873
- const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
3053
+ const maxDepth = (_table$options$maxLea = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea : 100;
2874
3054
  const recurseFilterRows = function (rowsToFilter, depth) {
2875
3055
  if (depth === void 0) {
2876
3056
  depth = 0;
@@ -2916,9 +3096,10 @@
2916
3096
  };
2917
3097
  }
2918
3098
  function filterRowModelFromRoot(rowsToFilter, filterRow, table) {
3099
+ var _table$options$maxLea2;
2919
3100
  const newFilteredFlatRows = [];
2920
3101
  const newFilteredRowsById = {};
2921
- const maxDepth = table.options.maxLeafRowFilterDepth ?? 100;
3102
+ const maxDepth = (_table$options$maxLea2 = table.options.maxLeafRowFilterDepth) != null ? _table$options$maxLea2 : 100;
2922
3103
 
2923
3104
  // Filters top level and nested rows
2924
3105
  const recurseFilterRows = function (rowsToFilter, depth) {
@@ -2965,7 +3146,8 @@
2965
3146
  }
2966
3147
  const resolvedColumnFilters = [];
2967
3148
  const resolvedGlobalFilters = [];
2968
- (columnFilters ?? []).forEach(d => {
3149
+ (columnFilters != null ? columnFilters : []).forEach(d => {
3150
+ var _filterFn$resolveFilt;
2969
3151
  const column = table.getColumn(d.id);
2970
3152
  if (!column) {
2971
3153
  {
@@ -2982,7 +3164,7 @@
2982
3164
  resolvedColumnFilters.push({
2983
3165
  id: d.id,
2984
3166
  filterFn,
2985
- 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
2986
3168
  });
2987
3169
  });
2988
3170
  const filterableIds = columnFilters.map(d => d.id);
@@ -2991,10 +3173,11 @@
2991
3173
  if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
2992
3174
  filterableIds.push('__global__');
2993
3175
  globallyFilterableColumns.forEach(column => {
3176
+ var _globalFilterFn$resol;
2994
3177
  resolvedGlobalFilters.push({
2995
3178
  id: column.id,
2996
3179
  filterFn: globalFilterFn,
2997
- 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
2998
3181
  });
2999
3182
  });
3000
3183
  }
@@ -3047,7 +3230,10 @@
3047
3230
  return filterRows(rowModel.rows, filterRowsImpl, table);
3048
3231
  }, {
3049
3232
  key: 'getFilteredRowModel',
3050
- 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
+ },
3051
3237
  onChange: () => {
3052
3238
  table._autoResetPageIndex();
3053
3239
  }
@@ -3072,7 +3258,10 @@
3072
3258
  return filterRows(preRowModel.rows, filterRowsImpl, table);
3073
3259
  }, {
3074
3260
  key: 'getFacetedRowModel_' + columnId,
3075
- 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
+ },
3076
3265
  onChange: () => {}
3077
3266
  });
3078
3267
  }
@@ -3085,7 +3274,8 @@
3085
3274
  for (let j = 0; j < values.length; j++) {
3086
3275
  const value = values[j];
3087
3276
  if (facetedUniqueValues.has(value)) {
3088
- facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1);
3277
+ var _facetedUniqueValues$;
3278
+ facetedUniqueValues.set(value, ((_facetedUniqueValues$ = facetedUniqueValues.get(value)) != null ? _facetedUniqueValues$ : 0) + 1);
3089
3279
  } else {
3090
3280
  facetedUniqueValues.set(value, 1);
3091
3281
  }
@@ -3094,7 +3284,10 @@
3094
3284
  return facetedUniqueValues;
3095
3285
  }, {
3096
3286
  key: 'getFacetedUniqueValues_' + columnId,
3097
- 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
+ },
3098
3291
  onChange: () => {}
3099
3292
  });
3100
3293
  }
@@ -3121,7 +3314,10 @@
3121
3314
  return facetedMinMaxValues;
3122
3315
  }, {
3123
3316
  key: 'getFacetedMinMaxValues_' + columnId,
3124
- 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
+ },
3125
3321
  onChange: () => {}
3126
3322
  });
3127
3323
  }
@@ -3151,9 +3347,10 @@
3151
3347
  const sortedData = [...rows];
3152
3348
  sortedData.sort((rowA, rowB) => {
3153
3349
  for (let i = 0; i < availableSorting.length; i += 1) {
3350
+ var _sortEntry$desc;
3154
3351
  const sortEntry = availableSorting[i];
3155
3352
  const columnInfo = columnInfoById[sortEntry.id];
3156
- const isDesc = (sortEntry == null ? void 0 : sortEntry.desc) ?? false;
3353
+ const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
3157
3354
  if (columnInfo.sortUndefined) {
3158
3355
  const aValue = rowA.getValue(sortEntry.id);
3159
3356
  const bValue = rowB.getValue(sortEntry.id);
@@ -3196,7 +3393,10 @@
3196
3393
  };
3197
3394
  }, {
3198
3395
  key: 'getSortedRowModel',
3199
- 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
+ },
3200
3400
  onChange: () => {
3201
3401
  table._autoResetPageIndex();
3202
3402
  }
@@ -3265,7 +3465,8 @@
3265
3465
  return row._valuesCache[columnId];
3266
3466
  }
3267
3467
  if (groupedRows[0]) {
3268
- 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;
3269
3470
  }
3270
3471
  return row._valuesCache[columnId];
3271
3472
  }
@@ -3318,7 +3519,10 @@
3318
3519
  };
3319
3520
  }, {
3320
3521
  key: 'getGroupedRowModel',
3321
- 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
+ },
3322
3526
  onChange: () => {
3323
3527
  table._queue(() => {
3324
3528
  table._autoResetExpanded();
@@ -3343,7 +3547,7 @@
3343
3547
 
3344
3548
  function getExpandedRowModel() {
3345
3549
  return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3346
- if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded ?? {}).length) {
3550
+ if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3347
3551
  return rowModel;
3348
3552
  }
3349
3553
  if (!paginateExpandedRows) {
@@ -3353,7 +3557,10 @@
3353
3557
  return expandRows(rowModel);
3354
3558
  }, {
3355
3559
  key: 'getExpandedRowModel',
3356
- 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
+ }
3357
3564
  });
3358
3565
  }
3359
3566
  function expandRows(rowModel) {
@@ -3415,7 +3622,10 @@
3415
3622
  return paginatedRowModel;
3416
3623
  }, {
3417
3624
  key: 'getPaginationRowModel',
3418
- 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
+ }
3419
3629
  });
3420
3630
  }
3421
3631