@tanstack/svelte-table 8.5.13 → 8.5.15

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.
@@ -96,7 +96,10 @@
96
96
  return str;
97
97
  };
98
98
 
99
- console.info("%c\u23F1 " + pad(resultEndTime, 5) + " /" + pad(depEndTime, 5) + " ms", "\n font-size: .6rem;\n font-weight: bold;\n color: hsl(" + Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120)) + "deg 100% 31%);", opts == null ? void 0 : opts.key);
99
+ console.info(`%c ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`, `
100
+ font-size: .6rem;
101
+ font-weight: bold;
102
+ color: hsl(${Math.max(0, Math.min(120 - 120 * resultFpsPercentage, 120))}deg 100% 31%);`, opts == null ? void 0 : opts.key);
100
103
  }
101
104
  }
102
105
 
@@ -105,15 +108,13 @@
105
108
  }
106
109
 
107
110
  function createColumn(table, columnDef, depth, parent) {
108
- var _ref, _resolvedColumnDef$id;
109
-
110
111
  const defaultColumn = table._getDefaultColumnDef();
111
112
 
112
113
  const resolvedColumnDef = { ...defaultColumn,
113
114
  ...columnDef
114
115
  };
115
116
  const accessorKey = resolvedColumnDef.accessorKey;
116
- let id = (_ref = (_resolvedColumnDef$id = resolvedColumnDef.id) != null ? _resolvedColumnDef$id : accessorKey ? accessorKey.replace('.', '_') : undefined) != null ? _ref : typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined;
117
+ let id = resolvedColumnDef.id ?? (accessorKey ? accessorKey.replace('.', '_') : undefined) ?? (typeof resolvedColumnDef.header === 'string' ? resolvedColumnDef.header : undefined);
117
118
  let accessorFn;
118
119
 
119
120
  if (resolvedColumnDef.accessorFn) {
@@ -137,12 +138,12 @@
137
138
 
138
139
  if (!id) {
139
140
  {
140
- throw new Error(resolvedColumnDef.accessorFn ? "Columns require an id when using an accessorFn" : "Columns require an id when using a non-string header");
141
+ throw new Error(resolvedColumnDef.accessorFn ? `Columns require an id when using an accessorFn` : `Columns require an id when using a non-string header`);
141
142
  }
142
143
  }
143
144
 
144
145
  let column = {
145
- id: "" + String(id),
146
+ id: `${String(id)}`,
146
147
  accessorFn,
147
148
  parent: parent,
148
149
  depth,
@@ -154,11 +155,7 @@
154
155
  return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];
155
156
  }, {
156
157
  key: "development" === 'production' ,
157
- debug: () => {
158
- var _table$options$debugA;
159
-
160
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
161
- }
158
+ debug: () => table.options.debugAll ?? table.options.debugColumns
162
159
  }),
163
160
  getLeafColumns: memo(() => [table._getOrderColumnsFn()], orderColumns => {
164
161
  var _column$columns2;
@@ -171,11 +168,7 @@
171
168
  return [column];
172
169
  }, {
173
170
  key: "development" === 'production' ,
174
- debug: () => {
175
- var _table$options$debugA2;
176
-
177
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
178
- }
171
+ debug: () => table.options.debugAll ?? table.options.debugColumns
179
172
  })
180
173
  };
181
174
  column = table._features.reduce((obj, feature) => {
@@ -187,9 +180,7 @@
187
180
 
188
181
  //
189
182
  function createHeader(table, column, options) {
190
- var _options$id;
191
-
192
- const id = (_options$id = options.id) != null ? _options$id : column.id;
183
+ const id = options.id ?? column.id;
193
184
  let header = {
194
185
  id,
195
186
  column,
@@ -234,98 +225,60 @@
234
225
  return {
235
226
  // Header Groups
236
227
  getHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
237
- var _left$map$filter, _right$map$filter;
238
-
239
- const leftColumns = (_left$map$filter = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter : [];
240
- const rightColumns = (_right$map$filter = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter : [];
228
+ const leftColumns = (left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
229
+ const rightColumns = (right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
241
230
  const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
242
231
  const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
243
232
  return headerGroups;
244
233
  }, {
245
234
  key: 'getHeaderGroups',
246
- debug: () => {
247
- var _table$options$debugA;
248
-
249
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
250
- }
235
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
251
236
  }),
252
237
  getCenterHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
253
238
  leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
254
239
  return buildHeaderGroups(allColumns, leafColumns, table, 'center');
255
240
  }, {
256
241
  key: 'getCenterHeaderGroups',
257
- debug: () => {
258
- var _table$options$debugA2;
259
-
260
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
261
- }
242
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
262
243
  }),
263
244
  getLeftHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
264
- var _left$map$filter2;
265
-
266
- const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
245
+ const orderedLeafColumns = (left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
267
246
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
268
247
  }, {
269
248
  key: 'getLeftHeaderGroups',
270
- debug: () => {
271
- var _table$options$debugA3;
272
-
273
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
274
- }
249
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
275
250
  }),
276
251
  getRightHeaderGroups: memo(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
277
- var _right$map$filter2;
278
-
279
- const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
252
+ const orderedLeafColumns = (right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) ?? [];
280
253
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
281
254
  }, {
282
255
  key: 'getRightHeaderGroups',
283
- debug: () => {
284
- var _table$options$debugA4;
285
-
286
- return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
287
- }
256
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
288
257
  }),
289
258
  // Footer Groups
290
259
  getFooterGroups: memo(() => [table.getHeaderGroups()], headerGroups => {
291
260
  return [...headerGroups].reverse();
292
261
  }, {
293
262
  key: 'getFooterGroups',
294
- debug: () => {
295
- var _table$options$debugA5;
296
-
297
- return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
298
- }
263
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
299
264
  }),
300
265
  getLeftFooterGroups: memo(() => [table.getLeftHeaderGroups()], headerGroups => {
301
266
  return [...headerGroups].reverse();
302
267
  }, {
303
268
  key: 'getLeftFooterGroups',
304
- debug: () => {
305
- var _table$options$debugA6;
306
-
307
- return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
308
- }
269
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
309
270
  }),
310
271
  getCenterFooterGroups: memo(() => [table.getCenterHeaderGroups()], headerGroups => {
311
272
  return [...headerGroups].reverse();
312
273
  }, {
313
274
  key: 'getCenterFooterGroups',
314
- debug: () => {
315
- var _table$options$debugA7;
316
-
317
- return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
318
- }
275
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
319
276
  }),
320
277
  getRightFooterGroups: memo(() => [table.getRightHeaderGroups()], headerGroups => {
321
278
  return [...headerGroups].reverse();
322
279
  }, {
323
280
  key: 'getRightFooterGroups',
324
- debug: () => {
325
- var _table$options$debugA8;
326
-
327
- return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
328
- }
281
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
329
282
  }),
330
283
  // Flat Headers
331
284
  getFlatHeaders: memo(() => [table.getHeaderGroups()], headerGroups => {
@@ -334,11 +287,7 @@
334
287
  }).flat();
335
288
  }, {
336
289
  key: 'getFlatHeaders',
337
- debug: () => {
338
- var _table$options$debugA9;
339
-
340
- return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
341
- }
290
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
342
291
  }),
343
292
  getLeftFlatHeaders: memo(() => [table.getLeftHeaderGroups()], left => {
344
293
  return left.map(headerGroup => {
@@ -346,11 +295,7 @@
346
295
  }).flat();
347
296
  }, {
348
297
  key: 'getLeftFlatHeaders',
349
- debug: () => {
350
- var _table$options$debugA10;
351
-
352
- return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
353
- }
298
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
354
299
  }),
355
300
  getCenterFlatHeaders: memo(() => [table.getCenterHeaderGroups()], left => {
356
301
  return left.map(headerGroup => {
@@ -358,11 +303,7 @@
358
303
  }).flat();
359
304
  }, {
360
305
  key: 'getCenterFlatHeaders',
361
- debug: () => {
362
- var _table$options$debugA11;
363
-
364
- return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
365
- }
306
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
366
307
  }),
367
308
  getRightFlatHeaders: memo(() => [table.getRightHeaderGroups()], left => {
368
309
  return left.map(headerGroup => {
@@ -370,11 +311,7 @@
370
311
  }).flat();
371
312
  }, {
372
313
  key: 'getRightFlatHeaders',
373
- debug: () => {
374
- var _table$options$debugA12;
375
-
376
- return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
377
- }
314
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
378
315
  }),
379
316
  // Leaf Headers
380
317
  getCenterLeafHeaders: memo(() => [table.getCenterFlatHeaders()], flatHeaders => {
@@ -385,11 +322,7 @@
385
322
  });
386
323
  }, {
387
324
  key: 'getCenterLeafHeaders',
388
- debug: () => {
389
- var _table$options$debugA13;
390
-
391
- return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
392
- }
325
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
393
326
  }),
394
327
  getLeftLeafHeaders: memo(() => [table.getLeftFlatHeaders()], flatHeaders => {
395
328
  return flatHeaders.filter(header => {
@@ -399,11 +332,7 @@
399
332
  });
400
333
  }, {
401
334
  key: 'getLeftLeafHeaders',
402
- debug: () => {
403
- var _table$options$debugA14;
404
-
405
- return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
406
- }
335
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
407
336
  }),
408
337
  getRightLeafHeaders: memo(() => [table.getRightFlatHeaders()], flatHeaders => {
409
338
  return flatHeaders.filter(header => {
@@ -413,31 +342,23 @@
413
342
  });
414
343
  }, {
415
344
  key: 'getRightLeafHeaders',
416
- debug: () => {
417
- var _table$options$debugA15;
418
-
419
- return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
420
- }
345
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
421
346
  }),
422
347
  getLeafHeaders: memo(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
423
- var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
348
+ var _left$, _center$, _right$;
424
349
 
425
- 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 => {
350
+ 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 => {
426
351
  return header.getLeafHeaders();
427
352
  }).flat();
428
353
  }, {
429
354
  key: 'getLeafHeaders',
430
- debug: () => {
431
- var _table$options$debugA16;
432
-
433
- return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
434
- }
355
+ debug: () => table.options.debugAll ?? table.options.debugHeaders
435
356
  })
436
357
  };
437
358
  }
438
359
  };
439
360
  function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
440
- var _headerGroups$0$heade, _headerGroups$;
361
+ var _headerGroups$;
441
362
 
442
363
  // Find the max depth of the columns:
443
364
  // build the leaf column row
@@ -468,7 +389,7 @@
468
389
  // The header group we are creating
469
390
  const headerGroup = {
470
391
  depth,
471
- id: [headerFamily, "" + depth].filter(Boolean).join('_'),
392
+ id: [headerFamily, `${depth}`].filter(Boolean).join('_'),
472
393
  headers: []
473
394
  }; // The parent columns we're going to scan next
474
395
 
@@ -498,7 +419,7 @@
498
419
  const header = createHeader(table, column, {
499
420
  id: [headerFamily, depth, column.id, headerToGroup == null ? void 0 : headerToGroup.id].filter(Boolean).join('_'),
500
421
  isPlaceholder,
501
- placeholderId: isPlaceholder ? "" + pendingParentHeaders.filter(d => d.column === column).length : undefined,
422
+ placeholderId: isPlaceholder ? `${pendingParentHeaders.filter(d => d.column === column).length}` : undefined,
502
423
  depth,
503
424
  index: pendingParentHeaders.length
504
425
  }); // Add the headerToGroup as a subHeader of the new header
@@ -560,7 +481,7 @@
560
481
  });
561
482
  };
562
483
 
563
- recurseHeadersForSpans((_headerGroups$0$heade = (_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) != null ? _headerGroups$0$heade : []);
484
+ recurseHeadersForSpans(((_headerGroups$ = headerGroups[0]) == null ? void 0 : _headerGroups$.headers) ?? []);
564
485
  return headerGroups;
565
486
  }
566
487
 
@@ -601,10 +522,8 @@
601
522
  createColumn: (column, table) => {
602
523
  return {
603
524
  getSize: () => {
604
- var _column$columnDef$min, _ref, _column$columnDef$max;
605
-
606
525
  const columnSize = table.getState().columnSizing[column.id];
607
- 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);
526
+ return Math.min(Math.max(column.columnDef.minSize ?? defaultColumnSizing.minSize, columnSize ?? column.columnDef.size ?? defaultColumnSizing.size), column.columnDef.maxSize ?? defaultColumnSizing.maxSize);
608
527
  },
609
528
  getStart: position => {
610
529
  const columns = !position ? table.getVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
@@ -618,18 +537,16 @@
618
537
  return 0;
619
538
  },
620
539
  resetSize: () => {
621
- table.setColumnSizing(_ref2 => {
540
+ table.setColumnSizing(_ref => {
622
541
  let {
623
542
  [column.id]: _,
624
543
  ...rest
625
- } = _ref2;
544
+ } = _ref;
626
545
  return rest;
627
546
  });
628
547
  },
629
548
  getCanResize: () => {
630
- var _column$columnDef$ena, _table$options$enable;
631
-
632
- return ((_column$columnDef$ena = column.columnDef.enableResizing) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableColumnResizing) != null ? _table$options$enable : true);
549
+ return (column.columnDef.enableResizing ?? true) && (table.options.enableColumnResizing ?? true);
633
550
  },
634
551
  getIsResizing: () => {
635
552
  return table.getState().columnSizingInfo.isResizingColumn === column.id;
@@ -645,9 +562,7 @@
645
562
  if (header.subHeaders.length) {
646
563
  header.subHeaders.forEach(recurse);
647
564
  } else {
648
- var _header$column$getSiz;
649
-
650
- sum += (_header$column$getSiz = header.column.getSize()) != null ? _header$column$getSiz : 0;
565
+ sum += header.column.getSize() ?? 0;
651
566
  }
652
567
  };
653
568
 
@@ -689,12 +604,10 @@
689
604
 
690
605
  let newColumnSizing = {};
691
606
  table.setColumnSizingInfo(old => {
692
- var _old$startOffset, _old$startSize;
693
-
694
- const deltaOffset = clientXPos - ((_old$startOffset = old == null ? void 0 : old.startOffset) != null ? _old$startOffset : 0);
695
- const deltaPercentage = Math.max(deltaOffset / ((_old$startSize = old == null ? void 0 : old.startSize) != null ? _old$startSize : 0), -0.999999);
696
- old.columnSizingStart.forEach(_ref3 => {
697
- let [columnId, headerSize] = _ref3;
607
+ const deltaOffset = clientXPos - ((old == null ? void 0 : old.startOffset) ?? 0);
608
+ const deltaPercentage = Math.max(deltaOffset / ((old == null ? void 0 : old.startSize) ?? 0), -0.999999);
609
+ old.columnSizingStart.forEach(_ref2 => {
610
+ let [columnId, headerSize] = _ref2;
698
611
  newColumnSizing[columnId] = Math.round(Math.max(headerSize + headerSize * deltaPercentage, 0) * 100) / 100;
699
612
  });
700
613
  return { ...old,
@@ -758,42 +671,38 @@
758
671
  setColumnSizing: updater => table.options.onColumnSizingChange == null ? void 0 : table.options.onColumnSizingChange(updater),
759
672
  setColumnSizingInfo: updater => table.options.onColumnSizingInfoChange == null ? void 0 : table.options.onColumnSizingInfoChange(updater),
760
673
  resetColumnSizing: defaultState => {
761
- var _table$initialState$c;
762
-
763
- table.setColumnSizing(defaultState ? {} : (_table$initialState$c = table.initialState.columnSizing) != null ? _table$initialState$c : {});
674
+ table.setColumnSizing(defaultState ? {} : table.initialState.columnSizing ?? {});
764
675
  },
765
676
  resetHeaderSizeInfo: defaultState => {
766
- var _table$initialState$c2;
767
-
768
- table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : (_table$initialState$c2 = table.initialState.columnSizingInfo) != null ? _table$initialState$c2 : getDefaultColumnSizingInfoState());
677
+ table.setColumnSizingInfo(defaultState ? getDefaultColumnSizingInfoState() : table.initialState.columnSizingInfo ?? getDefaultColumnSizingInfoState());
769
678
  },
770
679
  getTotalSize: () => {
771
- var _table$getHeaderGroup, _table$getHeaderGroup2;
680
+ var _table$getHeaderGroup;
772
681
 
773
- return (_table$getHeaderGroup = (_table$getHeaderGroup2 = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup2.headers.reduce((sum, header) => {
682
+ return ((_table$getHeaderGroup = table.getHeaderGroups()[0]) == null ? void 0 : _table$getHeaderGroup.headers.reduce((sum, header) => {
774
683
  return sum + header.getSize();
775
- }, 0)) != null ? _table$getHeaderGroup : 0;
684
+ }, 0)) ?? 0;
776
685
  },
777
686
  getLeftTotalSize: () => {
778
- var _table$getLeftHeaderG, _table$getLeftHeaderG2;
687
+ var _table$getLeftHeaderG;
779
688
 
780
- return (_table$getLeftHeaderG = (_table$getLeftHeaderG2 = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG2.headers.reduce((sum, header) => {
689
+ return ((_table$getLeftHeaderG = table.getLeftHeaderGroups()[0]) == null ? void 0 : _table$getLeftHeaderG.headers.reduce((sum, header) => {
781
690
  return sum + header.getSize();
782
- }, 0)) != null ? _table$getLeftHeaderG : 0;
691
+ }, 0)) ?? 0;
783
692
  },
784
693
  getCenterTotalSize: () => {
785
- var _table$getCenterHeade, _table$getCenterHeade2;
694
+ var _table$getCenterHeade;
786
695
 
787
- return (_table$getCenterHeade = (_table$getCenterHeade2 = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade2.headers.reduce((sum, header) => {
696
+ return ((_table$getCenterHeade = table.getCenterHeaderGroups()[0]) == null ? void 0 : _table$getCenterHeade.headers.reduce((sum, header) => {
788
697
  return sum + header.getSize();
789
- }, 0)) != null ? _table$getCenterHeade : 0;
698
+ }, 0)) ?? 0;
790
699
  },
791
700
  getRightTotalSize: () => {
792
- var _table$getRightHeader, _table$getRightHeader2;
701
+ var _table$getRightHeader;
793
702
 
794
- return (_table$getRightHeader = (_table$getRightHeader2 = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader2.headers.reduce((sum, header) => {
703
+ return ((_table$getRightHeader = table.getRightHeaderGroups()[0]) == null ? void 0 : _table$getRightHeader.headers.reduce((sum, header) => {
795
704
  return sum + header.getSize();
796
- }, 0)) != null ? _table$getRightHeader : 0;
705
+ }, 0)) ?? 0;
797
706
  }
798
707
  };
799
708
  }
@@ -847,8 +756,6 @@
847
756
  let queued = false;
848
757
  return {
849
758
  _autoResetExpanded: () => {
850
- var _ref, _table$options$autoRe;
851
-
852
759
  if (!registered) {
853
760
  table._queue(() => {
854
761
  registered = true;
@@ -857,7 +764,7 @@
857
764
  return;
858
765
  }
859
766
 
860
- if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
767
+ if (table.options.autoResetAll ?? table.options.autoResetExpanded ?? !table.options.manualExpanding) {
861
768
  if (queued) return;
862
769
  queued = true;
863
770
 
@@ -869,16 +776,16 @@
869
776
  },
870
777
  setExpanded: updater => table.options.onExpandedChange == null ? void 0 : table.options.onExpandedChange(updater),
871
778
  toggleAllRowsExpanded: expanded => {
872
- if (expanded != null ? expanded : !table.getIsAllRowsExpanded()) {
779
+ if (expanded ?? !table.getIsAllRowsExpanded()) {
873
780
  table.setExpanded(true);
874
781
  } else {
875
782
  table.setExpanded({});
876
783
  }
877
784
  },
878
785
  resetExpanded: defaultState => {
879
- var _table$initialState$e, _table$initialState;
786
+ var _table$initialState;
880
787
 
881
- table.setExpanded(defaultState ? {} : (_table$initialState$e = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) != null ? _table$initialState$e : {});
788
+ table.setExpanded(defaultState ? {} : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.expanded) ?? {});
882
789
  },
883
790
  getCanSomeRowsExpand: () => {
884
791
  return table.getRowModel().flatRows.some(row => row.getCanExpand());
@@ -905,7 +812,7 @@
905
812
  } // If any row is not expanded, return false
906
813
 
907
814
 
908
- if (table.getRowModel().flatRows.some(row => row.getIsExpanded())) {
815
+ if (table.getRowModel().flatRows.some(row => !row.getIsExpanded())) {
909
816
  return false;
910
817
  } // They must all be expanded :shrug:
911
818
 
@@ -939,8 +846,6 @@
939
846
  return {
940
847
  toggleExpanded: expanded => {
941
848
  table.setExpanded(old => {
942
- var _expanded;
943
-
944
849
  const exists = old === true ? true : !!(old != null && old[row.id]);
945
850
  let oldExpanded = {};
946
851
 
@@ -952,7 +857,7 @@
952
857
  oldExpanded = old;
953
858
  }
954
859
 
955
- expanded = (_expanded = expanded) != null ? _expanded : !exists;
860
+ expanded = expanded ?? !exists;
956
861
 
957
862
  if (!exists && expanded) {
958
863
  return { ...oldExpanded,
@@ -972,15 +877,13 @@
972
877
  });
973
878
  },
974
879
  getIsExpanded: () => {
975
- var _table$options$getIsR;
976
-
977
880
  const expanded = table.getState().expanded;
978
- 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]));
881
+ return !!((table.options.getIsRowExpanded == null ? void 0 : table.options.getIsRowExpanded(row)) ?? (expanded === true || expanded != null && expanded[row.id]));
979
882
  },
980
883
  getCanExpand: () => {
981
- var _table$options$getRow, _table$options$enable, _row$subRows;
884
+ var _row$subRows;
982
885
 
983
- 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);
886
+ return (table.options.getRowCanExpand == null ? void 0 : table.options.getRowCanExpand(row)) ?? ((table.options.enableExpanding ?? true) && !!((_row$subRows = row.subRows) != null && _row$subRows.length));
984
887
  },
985
888
  getToggleExpandedHandler: () => {
986
889
  const canExpand = row.getCanExpand();
@@ -1159,19 +1062,15 @@
1159
1062
  return filterFns.weakEquals;
1160
1063
  },
1161
1064
  getFilterFn: () => {
1162
- var _table$options$filter, _table$options$filter2;
1065
+ var _table$options$filter;
1163
1066
 
1164
- return isFunction(column.columnDef.filterFn) ? column.columnDef.filterFn : column.columnDef.filterFn === 'auto' ? column.getAutoFilterFn() : (_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];
1067
+ 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];
1165
1068
  },
1166
1069
  getCanFilter: () => {
1167
- var _column$columnDef$ena, _table$options$enable, _table$options$enable2;
1168
-
1169
- 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;
1070
+ return (column.columnDef.enableColumnFilter ?? true) && (table.options.enableColumnFilters ?? true) && (table.options.enableFilters ?? true) && !!column.accessorFn;
1170
1071
  },
1171
1072
  getCanGlobalFilter: () => {
1172
- var _column$columnDef$ena2, _table$options$enable3, _table$options$enable4, _table$options$getCol;
1173
-
1174
- 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;
1073
+ 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;
1175
1074
  },
1176
1075
  getIsFiltered: () => column.getFilterIndex() > -1,
1177
1076
  getFilterValue: () => {
@@ -1180,9 +1079,9 @@
1180
1079
  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;
1181
1080
  },
1182
1081
  getFilterIndex: () => {
1183
- var _table$getState$colum3, _table$getState$colum4;
1082
+ var _table$getState$colum3;
1184
1083
 
1185
- 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;
1084
+ return ((_table$getState$colum3 = table.getState().columnFilters) == null ? void 0 : _table$getState$colum3.findIndex(d => d.id === column.id)) ?? -1;
1186
1085
  },
1187
1086
  setFilterValue: value => {
1188
1087
  table.setColumnFilters(old => {
@@ -1191,9 +1090,7 @@
1191
1090
  const newFilter = functionalUpdate(value, previousfilter ? previousfilter.value : undefined); //
1192
1091
 
1193
1092
  if (shouldAutoRemoveFilter(filterFn, newFilter, column)) {
1194
- var _old$filter;
1195
-
1196
- return (_old$filter = old == null ? void 0 : old.filter(d => d.id !== column.id)) != null ? _old$filter : [];
1093
+ return (old == null ? void 0 : old.filter(d => d.id !== column.id)) ?? [];
1197
1094
  }
1198
1095
 
1199
1096
  const newFilterObj = {
@@ -1202,15 +1099,13 @@
1202
1099
  };
1203
1100
 
1204
1101
  if (previousfilter) {
1205
- var _old$map;
1206
-
1207
- return (_old$map = old == null ? void 0 : old.map(d => {
1102
+ return (old == null ? void 0 : old.map(d => {
1208
1103
  if (d.id === column.id) {
1209
1104
  return newFilterObj;
1210
1105
  }
1211
1106
 
1212
1107
  return d;
1213
- })) != null ? _old$map : [];
1108
+ })) ?? [];
1214
1109
  }
1215
1110
 
1216
1111
  if (old != null && old.length) {
@@ -1260,12 +1155,12 @@
1260
1155
  return filterFns.includesString;
1261
1156
  },
1262
1157
  getGlobalFilterFn: () => {
1263
- var _table$options$filter3, _table$options$filter4;
1158
+ var _table$options$filter2;
1264
1159
 
1265
1160
  const {
1266
1161
  globalFilterFn: globalFilterFn
1267
1162
  } = table.options;
1268
- return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : (_table$options$filter3 = (_table$options$filter4 = table.options.filterFns) == null ? void 0 : _table$options$filter4[globalFilterFn]) != null ? _table$options$filter3 : filterFns[globalFilterFn];
1163
+ return isFunction(globalFilterFn) ? globalFilterFn : globalFilterFn === 'auto' ? table.getGlobalAutoFilterFn() : ((_table$options$filter2 = table.options.filterFns) == null ? void 0 : _table$options$filter2[globalFilterFn]) ?? filterFns[globalFilterFn];
1269
1164
  },
1270
1165
  setColumnFilters: updater => {
1271
1166
  const leafColumns = table.getAllLeafColumns();
@@ -1297,9 +1192,9 @@
1297
1192
  table.setGlobalFilter(defaultState ? undefined : table.initialState.globalFilter);
1298
1193
  },
1299
1194
  resetColumnFilters: defaultState => {
1300
- var _table$initialState$c, _table$initialState;
1195
+ var _table$initialState;
1301
1196
 
1302
- table.setColumnFilters(defaultState ? [] : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) != null ? _table$initialState$c : []);
1197
+ table.setColumnFilters(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnFilters) ?? []);
1303
1198
  },
1304
1199
  getPreFilteredRowModel: () => table.getCoreRowModel(),
1305
1200
  getFilteredRowModel: () => {
@@ -1456,9 +1351,9 @@
1456
1351
  getDefaultColumnDef: () => {
1457
1352
  return {
1458
1353
  aggregatedCell: props => {
1459
- var _toString, _props$getValue;
1354
+ var _props$getValue;
1460
1355
 
1461
- return (_toString = (_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) != null ? _toString : null;
1356
+ return ((_props$getValue = props.getValue()) == null ? void 0 : _props$getValue.toString == null ? void 0 : _props$getValue.toString()) ?? null;
1462
1357
  },
1463
1358
  aggregationFn: 'auto'
1464
1359
  };
@@ -1484,13 +1379,11 @@
1484
1379
  return old.filter(d => d !== column.id);
1485
1380
  }
1486
1381
 
1487
- return [...(old != null ? old : []), column.id];
1382
+ return [...(old ?? []), column.id];
1488
1383
  });
1489
1384
  },
1490
1385
  getCanGroup: () => {
1491
- var _ref, _ref2, _ref3, _column$columnDef$ena;
1492
-
1493
- 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;
1386
+ return column.columnDef.enableGrouping ?? true ?? table.options.enableGrouping ?? true ?? !!column.accessorFn;
1494
1387
  },
1495
1388
  getIsGrouped: () => {
1496
1389
  var _table$getState$group;
@@ -1522,13 +1415,13 @@
1522
1415
  }
1523
1416
  },
1524
1417
  getAggregationFn: () => {
1525
- var _table$options$aggreg, _table$options$aggreg2;
1418
+ var _table$options$aggreg;
1526
1419
 
1527
1420
  if (!column) {
1528
1421
  throw new Error();
1529
1422
  }
1530
1423
 
1531
- 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];
1424
+ 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];
1532
1425
  }
1533
1426
  };
1534
1427
  },
@@ -1536,9 +1429,9 @@
1536
1429
  return {
1537
1430
  setGrouping: updater => table.options.onGroupingChange == null ? void 0 : table.options.onGroupingChange(updater),
1538
1431
  resetGrouping: defaultState => {
1539
- var _table$initialState$g, _table$initialState;
1432
+ var _table$initialState;
1540
1433
 
1541
- table.setGrouping(defaultState ? [] : (_table$initialState$g = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) != null ? _table$initialState$g : []);
1434
+ table.setGrouping(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.grouping) ?? []);
1542
1435
  },
1543
1436
  getPreGroupedRowModel: () => table.getFilteredRowModel(),
1544
1437
  getGroupedRowModel: () => {
@@ -1605,9 +1498,7 @@
1605
1498
  return {
1606
1499
  setColumnOrder: updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater),
1607
1500
  resetColumnOrder: defaultState => {
1608
- var _table$initialState$c;
1609
-
1610
- table.setColumnOrder(defaultState ? [] : (_table$initialState$c = table.initialState.columnOrder) != null ? _table$initialState$c : []);
1501
+ table.setColumnOrder(defaultState ? [] : table.initialState.columnOrder ?? []);
1611
1502
  },
1612
1503
  _getOrderColumnsFn: memo(() => [table.getState().columnOrder, table.getState().grouping, table.options.groupedColumnMode], (columnOrder, grouping, groupedColumnMode) => columns => {
1613
1504
  // Sort grouped columns to the start of the column list
@@ -1671,8 +1562,6 @@
1671
1562
  let queued = false;
1672
1563
  return {
1673
1564
  _autoResetPageIndex: () => {
1674
- var _ref, _table$options$autoRe;
1675
-
1676
1565
  if (!registered) {
1677
1566
  table._queue(() => {
1678
1567
  registered = true;
@@ -1681,7 +1570,7 @@
1681
1570
  return;
1682
1571
  }
1683
1572
 
1684
- if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
1573
+ if (table.options.autoResetAll ?? table.options.autoResetPageIndex ?? !table.options.manualPagination) {
1685
1574
  if (queued) return;
1686
1575
  queued = true;
1687
1576
 
@@ -1700,9 +1589,7 @@
1700
1589
  return table.options.onPaginationChange == null ? void 0 : table.options.onPaginationChange(safeUpdater);
1701
1590
  },
1702
1591
  resetPagination: defaultState => {
1703
- var _table$initialState$p;
1704
-
1705
- table.setPagination(defaultState ? getDefaultPaginationState() : (_table$initialState$p = table.initialState.pagination) != null ? _table$initialState$p : getDefaultPaginationState());
1592
+ table.setPagination(defaultState ? getDefaultPaginationState() : table.initialState.pagination ?? getDefaultPaginationState());
1706
1593
  },
1707
1594
  setPageIndex: updater => {
1708
1595
  table.setPagination(old => {
@@ -1715,14 +1602,14 @@
1715
1602
  });
1716
1603
  },
1717
1604
  resetPageIndex: defaultState => {
1718
- var _table$initialState$p2, _table$initialState, _table$initialState$p3;
1605
+ var _table$initialState, _table$initialState$p;
1719
1606
 
1720
- 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);
1607
+ 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);
1721
1608
  },
1722
1609
  resetPageSize: defaultState => {
1723
- var _table$initialState$p4, _table$initialState2, _table$initialState2$;
1610
+ var _table$initialState2, _table$initialState2$;
1724
1611
 
1725
- 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);
1612
+ table.setPageSize(defaultState ? defaultPageSize : ((_table$initialState2 = table.initialState) == null ? void 0 : (_table$initialState2$ = _table$initialState2.pagination) == null ? void 0 : _table$initialState2$.pageSize) ?? defaultPageSize);
1726
1613
  },
1727
1614
  setPageSize: updater => {
1728
1615
  table.setPagination(old => {
@@ -1736,9 +1623,7 @@
1736
1623
  });
1737
1624
  },
1738
1625
  setPageCount: updater => table.setPagination(old => {
1739
- var _table$options$pageCo;
1740
-
1741
- let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
1626
+ let newPageCount = functionalUpdate(updater, table.options.pageCount ?? -1);
1742
1627
 
1743
1628
  if (typeof newPageCount === 'number') {
1744
1629
  newPageCount = Math.max(-1, newPageCount);
@@ -1758,11 +1643,7 @@
1758
1643
  return pageOptions;
1759
1644
  }, {
1760
1645
  key: 'getPageOptions',
1761
- debug: () => {
1762
- var _table$options$debugA;
1763
-
1764
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
1765
- }
1646
+ debug: () => table.options.debugAll ?? table.options.debugTable
1766
1647
  }),
1767
1648
  getCanPreviousPage: () => table.getState().pagination.pageIndex > 0,
1768
1649
  getCanNextPage: () => {
@@ -1802,9 +1683,7 @@
1802
1683
  return table._getPaginationRowModel();
1803
1684
  },
1804
1685
  getPageCount: () => {
1805
- var _table$options$pageCo2;
1806
-
1807
- return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
1686
+ return table.options.pageCount ?? Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
1808
1687
  }
1809
1688
  };
1810
1689
  }
@@ -1833,39 +1712,29 @@
1833
1712
  pin: position => {
1834
1713
  const columnIds = column.getLeafColumns().map(d => d.id).filter(Boolean);
1835
1714
  table.setColumnPinning(old => {
1836
- var _old$left3, _old$right3;
1837
-
1838
1715
  if (position === 'right') {
1839
- var _old$left, _old$right;
1840
-
1841
1716
  return {
1842
- left: ((_old$left = old == null ? void 0 : old.left) != null ? _old$left : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1843
- right: [...((_old$right = old == null ? void 0 : old.right) != null ? _old$right : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
1717
+ left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1718
+ right: [...((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds]
1844
1719
  };
1845
1720
  }
1846
1721
 
1847
1722
  if (position === 'left') {
1848
- var _old$left2, _old$right2;
1849
-
1850
1723
  return {
1851
- left: [...((_old$left2 = old == null ? void 0 : old.left) != null ? _old$left2 : []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1852
- right: ((_old$right2 = old == null ? void 0 : old.right) != null ? _old$right2 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1724
+ left: [...((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))), ...columnIds],
1725
+ right: ((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d)))
1853
1726
  };
1854
1727
  }
1855
1728
 
1856
1729
  return {
1857
- left: ((_old$left3 = old == null ? void 0 : old.left) != null ? _old$left3 : []).filter(d => !(columnIds != null && columnIds.includes(d))),
1858
- right: ((_old$right3 = old == null ? void 0 : old.right) != null ? _old$right3 : []).filter(d => !(columnIds != null && columnIds.includes(d)))
1730
+ left: ((old == null ? void 0 : old.left) ?? []).filter(d => !(columnIds != null && columnIds.includes(d))),
1731
+ right: ((old == null ? void 0 : old.right) ?? []).filter(d => !(columnIds != null && columnIds.includes(d)))
1859
1732
  };
1860
1733
  });
1861
1734
  },
1862
1735
  getCanPin: () => {
1863
1736
  const leafColumns = column.getLeafColumns();
1864
- return leafColumns.some(d => {
1865
- var _d$columnDef$enablePi, _table$options$enable;
1866
-
1867
- return ((_d$columnDef$enablePi = d.columnDef.enablePinning) != null ? _d$columnDef$enablePi : true) && ((_table$options$enable = table.options.enablePinning) != null ? _table$options$enable : true);
1868
- });
1737
+ return leafColumns.some(d => (d.columnDef.enablePinning ?? true) && (table.options.enablePinning ?? true));
1869
1738
  },
1870
1739
  getIsPinned: () => {
1871
1740
  const leafColumnIds = column.getLeafColumns().map(d => d.id);
@@ -1878,51 +1747,39 @@
1878
1747
  return isLeft ? 'left' : isRight ? 'right' : false;
1879
1748
  },
1880
1749
  getPinnedIndex: () => {
1881
- var _table$getState$colum, _table$getState$colum2, _table$getState$colum3;
1750
+ var _table$getState$colum, _table$getState$colum2;
1882
1751
 
1883
1752
  const position = column.getIsPinned();
1884
- 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;
1753
+ 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;
1885
1754
  }
1886
1755
  };
1887
1756
  },
1888
1757
  createRow: (row, table) => {
1889
1758
  return {
1890
1759
  getCenterVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
1891
- const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1760
+ const leftAndRight = [...(left ?? []), ...(right ?? [])];
1892
1761
  return allCells.filter(d => !leftAndRight.includes(d.column.id));
1893
1762
  }, {
1894
1763
  key: "development" === 'production' ,
1895
- debug: () => {
1896
- var _table$options$debugA;
1897
-
1898
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
1899
- }
1764
+ debug: () => table.options.debugAll ?? table.options.debugRows
1900
1765
  }),
1901
1766
  getLeftVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
1902
- const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d,
1767
+ const cells = (left ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d,
1903
1768
  position: 'left'
1904
1769
  }));
1905
1770
  return cells;
1906
1771
  }, {
1907
1772
  key: "development" === 'production' ,
1908
- debug: () => {
1909
- var _table$options$debugA2;
1910
-
1911
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
1912
- }
1773
+ debug: () => table.options.debugAll ?? table.options.debugRows
1913
1774
  }),
1914
1775
  getRightVisibleCells: memo(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
1915
- const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d,
1776
+ const cells = (right ?? []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({ ...d,
1916
1777
  position: 'right'
1917
1778
  }));
1918
1779
  return cells;
1919
1780
  }, {
1920
1781
  key: "development" === 'production' ,
1921
- debug: () => {
1922
- var _table$options$debugA3;
1923
-
1924
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
1925
- }
1782
+ debug: () => table.options.debugAll ?? table.options.debugRows
1926
1783
  })
1927
1784
  };
1928
1785
  },
@@ -1930,9 +1787,9 @@
1930
1787
  return {
1931
1788
  setColumnPinning: updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater),
1932
1789
  resetColumnPinning: defaultState => {
1933
- var _table$initialState$c, _table$initialState;
1790
+ var _table$initialState;
1934
1791
 
1935
- return table.setColumnPinning(defaultState ? getDefaultPinningState() : (_table$initialState$c = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) != null ? _table$initialState$c : getDefaultPinningState());
1792
+ return table.setColumnPinning(defaultState ? getDefaultPinningState() : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.columnPinning) ?? getDefaultPinningState());
1936
1793
  },
1937
1794
  getIsSomeColumnsPinned: position => {
1938
1795
  var _pinningState$positio;
@@ -1948,35 +1805,23 @@
1948
1805
  return Boolean((_pinningState$positio = pinningState[position]) == null ? void 0 : _pinningState$positio.length);
1949
1806
  },
1950
1807
  getLeftLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
1951
- return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1808
+ return (left ?? []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1952
1809
  }, {
1953
1810
  key: 'getLeftLeafColumns',
1954
- debug: () => {
1955
- var _table$options$debugA4;
1956
-
1957
- return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
1958
- }
1811
+ debug: () => table.options.debugAll ?? table.options.debugColumns
1959
1812
  }),
1960
1813
  getRightLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
1961
- return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1814
+ return (right ?? []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
1962
1815
  }, {
1963
1816
  key: 'getRightLeafColumns',
1964
- debug: () => {
1965
- var _table$options$debugA5;
1966
-
1967
- return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
1968
- }
1817
+ debug: () => table.options.debugAll ?? table.options.debugColumns
1969
1818
  }),
1970
1819
  getCenterLeafColumns: memo(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
1971
- const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
1820
+ const leftAndRight = [...(left ?? []), ...(right ?? [])];
1972
1821
  return allColumns.filter(d => !leftAndRight.includes(d.id));
1973
1822
  }, {
1974
1823
  key: 'getCenterLeafColumns',
1975
- debug: () => {
1976
- var _table$options$debugA6;
1977
-
1978
- return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
1979
- }
1824
+ debug: () => table.options.debugAll ?? table.options.debugColumns
1980
1825
  })
1981
1826
  };
1982
1827
  }
@@ -2004,11 +1849,7 @@
2004
1849
  createTable: table => {
2005
1850
  return {
2006
1851
  setRowSelection: updater => table.options.onRowSelectionChange == null ? void 0 : table.options.onRowSelectionChange(updater),
2007
- resetRowSelection: defaultState => {
2008
- var _table$initialState$r;
2009
-
2010
- return table.setRowSelection(defaultState ? {} : (_table$initialState$r = table.initialState.rowSelection) != null ? _table$initialState$r : {});
2011
- },
1852
+ resetRowSelection: defaultState => table.setRowSelection(defaultState ? {} : table.initialState.rowSelection ?? {}),
2012
1853
  toggleAllRowsSelected: value => {
2013
1854
  table.setRowSelection(old => {
2014
1855
  value = typeof value !== 'undefined' ? value : !table.getIsAllRowsSelected();
@@ -2106,11 +1947,7 @@
2106
1947
  return selectRowsFn(table, rowModel);
2107
1948
  }, {
2108
1949
  key: 'getSelectedRowModel',
2109
- debug: () => {
2110
- var _table$options$debugA;
2111
-
2112
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
2113
- }
1950
+ debug: () => table.options.debugAll ?? table.options.debugTable
2114
1951
  }),
2115
1952
  getFilteredSelectedRowModel: memo(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
2116
1953
  if (!Object.keys(rowSelection).length) {
@@ -2124,11 +1961,7 @@
2124
1961
  return selectRowsFn(table, rowModel);
2125
1962
  }, {
2126
1963
  key: "development" === 'production' ,
2127
- debug: () => {
2128
- var _table$options$debugA2;
2129
-
2130
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
2131
- }
1964
+ debug: () => table.options.debugAll ?? table.options.debugTable
2132
1965
  }),
2133
1966
  getGroupedSelectedRowModel: memo(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
2134
1967
  if (!Object.keys(rowSelection).length) {
@@ -2142,11 +1975,7 @@
2142
1975
  return selectRowsFn(table, rowModel);
2143
1976
  }, {
2144
1977
  key: "development" === 'production' ,
2145
- debug: () => {
2146
- var _table$options$debugA3;
2147
-
2148
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
2149
- }
1978
+ debug: () => table.options.debugAll ?? table.options.debugTable
2150
1979
  }),
2151
1980
  ///
2152
1981
  // getGroupingRowCanSelect: rowId => {
@@ -2188,9 +2017,7 @@
2188
2017
  return isAllPageRowsSelected;
2189
2018
  },
2190
2019
  getIsSomeRowsSelected: () => {
2191
- var _table$getState$rowSe;
2192
-
2193
- const totalSelected = Object.keys((_table$getState$rowSe = table.getState().rowSelection) != null ? _table$getState$rowSe : {}).length;
2020
+ const totalSelected = Object.keys(table.getState().rowSelection ?? {}).length;
2194
2021
  return totalSelected > 0 && totalSelected < table.getFilteredRowModel().flatRows.length;
2195
2022
  },
2196
2023
  getIsSomePageRowsSelected: () => {
@@ -2245,31 +2072,25 @@
2245
2072
  return isSubRowSelected(row, rowSelection) === 'all';
2246
2073
  },
2247
2074
  getCanSelect: () => {
2248
- var _table$options$enable;
2249
-
2250
2075
  if (typeof table.options.enableRowSelection === 'function') {
2251
2076
  return table.options.enableRowSelection(row);
2252
2077
  }
2253
2078
 
2254
- return (_table$options$enable = table.options.enableRowSelection) != null ? _table$options$enable : true;
2079
+ return table.options.enableRowSelection ?? true;
2255
2080
  },
2256
2081
  getCanSelectSubRows: () => {
2257
- var _table$options$enable2;
2258
-
2259
2082
  if (typeof table.options.enableSubRowSelection === 'function') {
2260
2083
  return table.options.enableSubRowSelection(row);
2261
2084
  }
2262
2085
 
2263
- return (_table$options$enable2 = table.options.enableSubRowSelection) != null ? _table$options$enable2 : true;
2086
+ return table.options.enableSubRowSelection ?? true;
2264
2087
  },
2265
2088
  getCanMultiSelect: () => {
2266
- var _table$options$enable3;
2267
-
2268
2089
  if (typeof table.options.enableMultiRowSelection === 'function') {
2269
2090
  return table.options.enableMultiRowSelection(row);
2270
2091
  }
2271
2092
 
2272
- return (_table$options$enable3 = table.options.enableMultiRowSelection) != null ? _table$options$enable3 : true;
2093
+ return table.options.enableMultiRowSelection ?? true;
2273
2094
  },
2274
2095
  getToggleSelectedHandler: () => {
2275
2096
  const canSelect = row.getCanSelect();
@@ -2347,9 +2168,7 @@
2347
2168
  };
2348
2169
  }
2349
2170
  function isRowSelected(row, selection) {
2350
- var _selection$row$id;
2351
-
2352
- return (_selection$row$id = selection[row.id]) != null ? _selection$row$id : false;
2171
+ return selection[row.id] ?? false;
2353
2172
  }
2354
2173
  function isSubRowSelected(row, selection, table) {
2355
2174
  if (row.subRows && row.subRows.length) {
@@ -2545,13 +2364,13 @@
2545
2364
  return 'desc';
2546
2365
  },
2547
2366
  getSortingFn: () => {
2548
- var _table$options$sortin, _table$options$sortin2;
2367
+ var _table$options$sortin;
2549
2368
 
2550
2369
  if (!column) {
2551
2370
  throw new Error();
2552
2371
  }
2553
2372
 
2554
- 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];
2373
+ 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];
2555
2374
  },
2556
2375
  toggleSorting: (desc, multi) => {
2557
2376
  // if (column.columns.length) {
@@ -2603,14 +2422,12 @@
2603
2422
  }
2604
2423
 
2605
2424
  if (sortAction === 'add') {
2606
- var _table$options$maxMul;
2607
-
2608
2425
  newSorting = [...old, {
2609
2426
  id: column.id,
2610
2427
  desc: nextDesc
2611
2428
  }]; // Take latest n columns
2612
2429
 
2613
- newSorting.splice(0, newSorting.length - ((_table$options$maxMul = table.options.maxMultiSortColCount) != null ? _table$options$maxMul : Number.MAX_SAFE_INTEGER));
2430
+ newSorting.splice(0, newSorting.length - (table.options.maxMultiSortColCount ?? Number.MAX_SAFE_INTEGER));
2614
2431
  } else if (sortAction === 'toggle') {
2615
2432
  // This flips (or sets) the
2616
2433
  newSorting = old.map(d => {
@@ -2635,14 +2452,10 @@
2635
2452
  });
2636
2453
  },
2637
2454
  getFirstSortDir: () => {
2638
- var _ref, _column$columnDef$sor;
2639
-
2640
- const sortDescFirst = (_ref = (_column$columnDef$sor = column.columnDef.sortDescFirst) != null ? _column$columnDef$sor : table.options.sortDescFirst) != null ? _ref : column.getAutoSortDir() === 'desc';
2455
+ const sortDescFirst = column.columnDef.sortDescFirst ?? table.options.sortDescFirst ?? column.getAutoSortDir() === 'desc';
2641
2456
  return sortDescFirst ? 'desc' : 'asc';
2642
2457
  },
2643
2458
  getNextSortingOrder: multi => {
2644
- var _table$options$enable, _table$options$enable2;
2645
-
2646
2459
  const firstSortDirection = column.getFirstSortDir();
2647
2460
  const isSorted = column.getIsSorted();
2648
2461
 
@@ -2650,8 +2463,8 @@
2650
2463
  return firstSortDirection;
2651
2464
  }
2652
2465
 
2653
- if (isSorted !== firstSortDirection && ((_table$options$enable = table.options.enableSortingRemoval) != null ? _table$options$enable : true) && ( // If enableSortRemove, enable in general
2654
- multi ? (_table$options$enable2 = table.options.enableMultiRemove) != null ? _table$options$enable2 : true : true) // If multi, don't allow if enableMultiRemove))
2466
+ if (isSorted !== firstSortDirection && (table.options.enableSortingRemoval ?? true) && ( // If enableSortRemove, enable in general
2467
+ multi ? table.options.enableMultiRemove ?? true : true) // If multi, don't allow if enableMultiRemove))
2655
2468
  ) {
2656
2469
  return false;
2657
2470
  }
@@ -2659,14 +2472,10 @@
2659
2472
  return isSorted === 'desc' ? 'asc' : 'desc';
2660
2473
  },
2661
2474
  getCanSort: () => {
2662
- var _column$columnDef$ena, _table$options$enable3;
2663
-
2664
- 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;
2475
+ return (column.columnDef.enableSorting ?? true) && (table.options.enableSorting ?? true) && !!column.accessorFn;
2665
2476
  },
2666
2477
  getCanMultiSort: () => {
2667
- var _ref2, _column$columnDef$ena2;
2668
-
2669
- return (_ref2 = (_column$columnDef$ena2 = column.columnDef.enableMultiSort) != null ? _column$columnDef$ena2 : table.options.enableMultiSort) != null ? _ref2 : !!column.accessorFn;
2478
+ return column.columnDef.enableMultiSort ?? table.options.enableMultiSort ?? !!column.accessorFn;
2670
2479
  },
2671
2480
  getIsSorted: () => {
2672
2481
  var _table$getState$sorti;
@@ -2675,9 +2484,9 @@
2675
2484
  return !columnSort ? false : columnSort.desc ? 'desc' : 'asc';
2676
2485
  },
2677
2486
  getSortIndex: () => {
2678
- var _table$getState$sorti2, _table$getState$sorti3;
2487
+ var _table$getState$sorti2;
2679
2488
 
2680
- 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;
2489
+ return ((_table$getState$sorti2 = table.getState().sorting) == null ? void 0 : _table$getState$sorti2.findIndex(d => d.id === column.id)) ?? -1;
2681
2490
  },
2682
2491
  clearSorting: () => {
2683
2492
  //clear sorting for just 1 column
@@ -2697,9 +2506,9 @@
2697
2506
  return {
2698
2507
  setSorting: updater => table.options.onSortingChange == null ? void 0 : table.options.onSortingChange(updater),
2699
2508
  resetSorting: defaultState => {
2700
- var _table$initialState$s, _table$initialState;
2509
+ var _table$initialState;
2701
2510
 
2702
- table.setSorting(defaultState ? [] : (_table$initialState$s = (_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) != null ? _table$initialState$s : []);
2511
+ table.setSorting(defaultState ? [] : ((_table$initialState = table.initialState) == null ? void 0 : _table$initialState.sorting) ?? []);
2703
2512
  },
2704
2513
  getPreSortedRowModel: () => table.getGroupedRowModel(),
2705
2514
  getSortedRowModel: () => {
@@ -2735,19 +2544,17 @@
2735
2544
  toggleVisibility: value => {
2736
2545
  if (column.getCanHide()) {
2737
2546
  table.setColumnVisibility(old => ({ ...old,
2738
- [column.id]: value != null ? value : !column.getIsVisible()
2547
+ [column.id]: value ?? !column.getIsVisible()
2739
2548
  }));
2740
2549
  }
2741
2550
  },
2742
2551
  getIsVisible: () => {
2743
- var _table$getState$colum, _table$getState$colum2;
2552
+ var _table$getState$colum;
2744
2553
 
2745
- return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
2554
+ return ((_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) ?? true;
2746
2555
  },
2747
2556
  getCanHide: () => {
2748
- var _column$columnDef$ena, _table$options$enable;
2749
-
2750
- return ((_column$columnDef$ena = column.columnDef.enableHiding) != null ? _column$columnDef$ena : true) && ((_table$options$enable = table.options.enableHiding) != null ? _table$options$enable : true);
2557
+ return (column.columnDef.enableHiding ?? true) && (table.options.enableHiding ?? true);
2751
2558
  },
2752
2559
  getToggleVisibilityHandler: () => {
2753
2560
  return e => {
@@ -2762,19 +2569,11 @@
2762
2569
  return cells.filter(cell => cell.column.getIsVisible());
2763
2570
  }, {
2764
2571
  key: "development" === 'production' ,
2765
- debug: () => {
2766
- var _table$options$debugA;
2767
-
2768
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
2769
- }
2572
+ debug: () => table.options.debugAll ?? table.options.debugRows
2770
2573
  }),
2771
2574
  getVisibleCells: memo(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
2772
2575
  key: 'row.getVisibleCells',
2773
- debug: () => {
2774
- var _table$options$debugA2;
2775
-
2776
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
2777
- }
2576
+ debug: () => table.options.debugAll ?? table.options.debugRows
2778
2577
  })
2779
2578
  };
2780
2579
  },
@@ -2784,11 +2583,7 @@
2784
2583
  return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
2785
2584
  }, {
2786
2585
  key,
2787
- debug: () => {
2788
- var _table$options$debugA3;
2789
-
2790
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
2791
- }
2586
+ debug: () => table.options.debugAll ?? table.options.debugColumns
2792
2587
  });
2793
2588
  };
2794
2589
 
@@ -2800,14 +2595,10 @@
2800
2595
  getCenterVisibleLeafColumns: makeVisibleColumnsMethod('getCenterVisibleLeafColumns', () => table.getCenterLeafColumns()),
2801
2596
  setColumnVisibility: updater => table.options.onColumnVisibilityChange == null ? void 0 : table.options.onColumnVisibilityChange(updater),
2802
2597
  resetColumnVisibility: defaultState => {
2803
- var _table$initialState$c;
2804
-
2805
- table.setColumnVisibility(defaultState ? {} : (_table$initialState$c = table.initialState.columnVisibility) != null ? _table$initialState$c : {});
2598
+ table.setColumnVisibility(defaultState ? {} : table.initialState.columnVisibility ?? {});
2806
2599
  },
2807
2600
  toggleAllColumnsVisible: value => {
2808
- var _value;
2809
-
2810
- value = (_value = value) != null ? _value : !table.getIsAllColumnsVisible();
2601
+ value = value ?? !table.getIsAllColumnsVisible();
2811
2602
  table.setColumnVisibility(table.getAllLeafColumns().reduce((obj, column) => ({ ...obj,
2812
2603
  [column.id]: !value ? !(column.getCanHide != null && column.getCanHide()) : value
2813
2604
  }), {}));
@@ -2828,8 +2619,6 @@
2828
2619
  const features = [Headers, Visibility, Ordering, Pinning, Filters, Sorting, Grouping, Expanding, Pagination, RowSelection, ColumnSizing]; //
2829
2620
 
2830
2621
  function createTable(options) {
2831
- var _options$initialState;
2832
-
2833
2622
  if (options.debugAll || options.debugTable) {
2834
2623
  console.info('Creating Table Instance...');
2835
2624
  }
@@ -2854,13 +2643,11 @@
2854
2643
 
2855
2644
  const coreInitialState = {};
2856
2645
  let initialState = { ...coreInitialState,
2857
- ...((_options$initialState = options.initialState) != null ? _options$initialState : {})
2646
+ ...(options.initialState ?? {})
2858
2647
  };
2859
2648
 
2860
2649
  table._features.forEach(feature => {
2861
- var _feature$getInitialSt;
2862
-
2863
- initialState = (_feature$getInitialSt = feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) != null ? _feature$getInitialSt : initialState;
2650
+ initialState = (feature.getInitialState == null ? void 0 : feature.getInitialState(initialState)) ?? initialState;
2864
2651
  });
2865
2652
 
2866
2653
  const queued = [];
@@ -2902,11 +2689,7 @@
2902
2689
  setState: updater => {
2903
2690
  table.options.onStateChange == null ? void 0 : table.options.onStateChange(updater);
2904
2691
  },
2905
- _getRowId: (row, index, parent) => {
2906
- var _table$options$getRow;
2907
-
2908
- 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);
2909
- },
2692
+ _getRowId: (row, index, parent) => (table.options.getRowId == null ? void 0 : table.options.getRowId(row, index, parent)) ?? `${parent ? [parent.id, index].join('.') : index}`,
2910
2693
  getCoreRowModel: () => {
2911
2694
  if (!table._getCoreRowModel) {
2912
2695
  table._getCoreRowModel = table.options.getCoreRowModel(table);
@@ -2924,16 +2707,14 @@
2924
2707
 
2925
2708
  if (!row) {
2926
2709
  {
2927
- throw new Error("getRow expected an ID, but got " + id);
2710
+ throw new Error(`getRow expected an ID, but got ${id}`);
2928
2711
  }
2929
2712
  }
2930
2713
 
2931
2714
  return row;
2932
2715
  },
2933
2716
  _getDefaultColumnDef: memo(() => [table.options.defaultColumn], defaultColumn => {
2934
- var _defaultColumn;
2935
-
2936
- defaultColumn = (_defaultColumn = defaultColumn) != null ? _defaultColumn : {};
2717
+ defaultColumn = defaultColumn ?? {};
2937
2718
  return {
2938
2719
  header: props => {
2939
2720
  const resolvedColumnDef = props.header.column.columnDef;
@@ -2950,9 +2731,9 @@
2950
2731
  },
2951
2732
  // footer: props => props.header.column.id,
2952
2733
  cell: props => {
2953
- var _props$renderValue$to, _props$renderValue;
2734
+ var _props$renderValue;
2954
2735
 
2955
- 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;
2736
+ return ((_props$renderValue = props.renderValue()) == null ? void 0 : _props$renderValue.toString == null ? void 0 : _props$renderValue.toString()) ?? null;
2956
2737
  },
2957
2738
  ...table._features.reduce((obj, feature) => {
2958
2739
  return Object.assign(obj, feature.getDefaultColumnDef == null ? void 0 : feature.getDefaultColumnDef());
@@ -2960,11 +2741,7 @@
2960
2741
  ...defaultColumn
2961
2742
  };
2962
2743
  }, {
2963
- debug: () => {
2964
- var _table$options$debugA;
2965
-
2966
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
2967
- },
2744
+ debug: () => table.options.debugAll ?? table.options.debugColumns,
2968
2745
  key: 'getDefaultColumnDef'
2969
2746
  }),
2970
2747
  _getColumnDefs: () => table.options.columns,
@@ -2985,11 +2762,7 @@
2985
2762
  return recurseColumns(columnDefs);
2986
2763
  }, {
2987
2764
  key: 'getAllColumns',
2988
- debug: () => {
2989
- var _table$options$debugA2;
2990
-
2991
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
2992
- }
2765
+ debug: () => table.options.debugAll ?? table.options.debugColumns
2993
2766
  }),
2994
2767
  getAllFlatColumns: memo(() => [table.getAllColumns()], allColumns => {
2995
2768
  return allColumns.flatMap(column => {
@@ -2997,11 +2770,7 @@
2997
2770
  });
2998
2771
  }, {
2999
2772
  key: 'getAllFlatColumns',
3000
- debug: () => {
3001
- var _table$options$debugA3;
3002
-
3003
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
3004
- }
2773
+ debug: () => table.options.debugAll ?? table.options.debugColumns
3005
2774
  }),
3006
2775
  _getAllFlatColumnsById: memo(() => [table.getAllFlatColumns()], flatColumns => {
3007
2776
  return flatColumns.reduce((acc, column) => {
@@ -3010,29 +2779,21 @@
3010
2779
  }, {});
3011
2780
  }, {
3012
2781
  key: 'getAllFlatColumnsById',
3013
- debug: () => {
3014
- var _table$options$debugA4;
3015
-
3016
- return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
3017
- }
2782
+ debug: () => table.options.debugAll ?? table.options.debugColumns
3018
2783
  }),
3019
2784
  getAllLeafColumns: memo(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
3020
2785
  let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
3021
2786
  return orderColumns(leafColumns);
3022
2787
  }, {
3023
2788
  key: 'getAllLeafColumns',
3024
- debug: () => {
3025
- var _table$options$debugA5;
3026
-
3027
- return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
3028
- }
2789
+ debug: () => table.options.debugAll ?? table.options.debugColumns
3029
2790
  }),
3030
2791
  getColumn: columnId => {
3031
2792
  const column = table._getAllFlatColumnsById()[columnId];
3032
2793
 
3033
2794
  if (!column) {
3034
2795
  {
3035
- console.warn("[Table] Column with id " + columnId + " does not exist.");
2796
+ console.warn(`[Table] Column with id ${columnId} does not exist.`);
3036
2797
  }
3037
2798
 
3038
2799
  throw new Error();
@@ -3051,14 +2812,10 @@
3051
2812
  }
3052
2813
 
3053
2814
  function createCell(table, row, column, columnId) {
3054
- const getRenderValue = () => {
3055
- var _cell$getValue;
3056
-
3057
- return (_cell$getValue = cell.getValue()) != null ? _cell$getValue : table.options.renderFallbackValue;
3058
- };
2815
+ const getRenderValue = () => cell.getValue() ?? table.options.renderFallbackValue;
3059
2816
 
3060
2817
  const cell = {
3061
- id: row.id + "_" + column.id,
2818
+ id: `${row.id}_${column.id}`,
3062
2819
  row,
3063
2820
  column,
3064
2821
  getValue: () => row.getValue(columnId),
@@ -3104,12 +2861,8 @@
3104
2861
  row._valuesCache[columnId] = column.accessorFn(row.original, rowIndex);
3105
2862
  return row._valuesCache[columnId];
3106
2863
  },
3107
- renderValue: columnId => {
3108
- var _row$getValue;
3109
-
3110
- return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
3111
- },
3112
- subRows: subRows != null ? subRows : [],
2864
+ renderValue: columnId => row.getValue(columnId) ?? table.options.renderFallbackValue,
2865
+ subRows: subRows ?? [],
3113
2866
  getLeafRows: () => flattenBy(row.subRows, d => d.subRows),
3114
2867
  getAllCells: memo(() => [table.getAllLeafColumns()], leafColumns => {
3115
2868
  return leafColumns.map(column => {
@@ -3117,11 +2870,7 @@
3117
2870
  });
3118
2871
  }, {
3119
2872
  key: 'row.getAllCells',
3120
- debug: () => {
3121
- var _table$options$debugA;
3122
-
3123
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
3124
- }
2873
+ debug: () => table.options.debugAll ?? table.options.debugRows
3125
2874
  }),
3126
2875
  _getAllCellsByColumnId: memo(() => [row.getAllCells()], allCells => {
3127
2876
  return allCells.reduce((acc, cell) => {
@@ -3130,11 +2879,7 @@
3130
2879
  }, {});
3131
2880
  }, {
3132
2881
  key: "development" === 'production' ,
3133
- debug: () => {
3134
- var _table$options$debugA2;
3135
-
3136
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
3137
- }
2882
+ debug: () => table.options.debugAll ?? table.options.debugRows
3138
2883
  })
3139
2884
  };
3140
2885
 
@@ -3244,11 +2989,7 @@
3244
2989
  return rowModel;
3245
2990
  }, {
3246
2991
  key: 'getRowModel',
3247
- debug: () => {
3248
- var _table$options$debugA;
3249
-
3250
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3251
- },
2992
+ debug: () => table.options.debugAll ?? table.options.debugTable,
3252
2993
  onChange: () => {
3253
2994
  table._autoResetPageIndex();
3254
2995
  }
@@ -3354,14 +3095,12 @@
3354
3095
 
3355
3096
  const resolvedColumnFilters = [];
3356
3097
  const resolvedGlobalFilters = [];
3357
- (columnFilters != null ? columnFilters : []).forEach(d => {
3358
- var _filterFn$resolveFilt;
3359
-
3098
+ (columnFilters ?? []).forEach(d => {
3360
3099
  const column = table.getColumn(d.id);
3361
3100
 
3362
3101
  if (!column) {
3363
3102
  {
3364
- console.warn("Table: Could not find a column to filter with columnId: " + d.id);
3103
+ console.warn(`Table: Could not find a column to filter with columnId: ${d.id}`);
3365
3104
  }
3366
3105
  }
3367
3106
 
@@ -3369,7 +3108,7 @@
3369
3108
 
3370
3109
  if (!filterFn) {
3371
3110
  {
3372
- console.warn("Could not find a valid 'column.filterFn' for column with the ID: " + column.id + ".");
3111
+ console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${column.id}.`);
3373
3112
  }
3374
3113
 
3375
3114
  return;
@@ -3378,7 +3117,7 @@
3378
3117
  resolvedColumnFilters.push({
3379
3118
  id: d.id,
3380
3119
  filterFn,
3381
- resolvedValue: (_filterFn$resolveFilt = filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) != null ? _filterFn$resolveFilt : d.value
3120
+ resolvedValue: (filterFn.resolveFilterValue == null ? void 0 : filterFn.resolveFilterValue(d.value)) ?? d.value
3382
3121
  });
3383
3122
  });
3384
3123
  const filterableIds = columnFilters.map(d => d.id);
@@ -3388,12 +3127,10 @@
3388
3127
  if (globalFilter && globalFilterFn && globallyFilterableColumns.length) {
3389
3128
  filterableIds.push('__global__');
3390
3129
  globallyFilterableColumns.forEach(column => {
3391
- var _globalFilterFn$resol;
3392
-
3393
3130
  resolvedGlobalFilters.push({
3394
3131
  id: column.id,
3395
3132
  filterFn: globalFilterFn,
3396
- resolvedValue: (_globalFilterFn$resol = globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) != null ? _globalFilterFn$resol : globalFilter
3133
+ resolvedValue: (globalFilterFn.resolveFilterValue == null ? void 0 : globalFilterFn.resolveFilterValue(globalFilter)) ?? globalFilter
3397
3134
  });
3398
3135
  });
3399
3136
  }
@@ -3450,11 +3187,7 @@
3450
3187
  return filterRows(rowModel.rows, filterRowsImpl, table);
3451
3188
  }, {
3452
3189
  key: 'getFilteredRowModel',
3453
- debug: () => {
3454
- var _table$options$debugA;
3455
-
3456
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3457
- },
3190
+ debug: () => table.options.debugAll ?? table.options.debugTable,
3458
3191
  onChange: () => {
3459
3192
  table._autoResetPageIndex();
3460
3193
  }
@@ -3483,11 +3216,7 @@
3483
3216
  return filterRows(preRowModel.rows, filterRowsImpl, table);
3484
3217
  }, {
3485
3218
  key: 'getFacetedRowModel_' + columnId,
3486
- debug: () => {
3487
- var _table$options$debugA;
3488
-
3489
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3490
- },
3219
+ debug: () => table.options.debugAll ?? table.options.debugTable,
3491
3220
  onChange: () => {}
3492
3221
  });
3493
3222
  }
@@ -3502,9 +3231,7 @@
3502
3231
  const value = (_facetedRowModel$flat = facetedRowModel.flatRows[i]) == null ? void 0 : _facetedRowModel$flat.getValue(columnId);
3503
3232
 
3504
3233
  if (facetedUniqueValues.has(value)) {
3505
- var _facetedUniqueValues$;
3506
-
3507
- facetedUniqueValues.set(value, ((_facetedUniqueValues$ = facetedUniqueValues.get(value)) != null ? _facetedUniqueValues$ : 0) + 1);
3234
+ facetedUniqueValues.set(value, (facetedUniqueValues.get(value) ?? 0) + 1);
3508
3235
  } else {
3509
3236
  facetedUniqueValues.set(value, 1);
3510
3237
  }
@@ -3513,11 +3240,7 @@
3513
3240
  return facetedUniqueValues;
3514
3241
  }, {
3515
3242
  key: 'getFacetedUniqueValues_' + columnId,
3516
- debug: () => {
3517
- var _table$options$debugA;
3518
-
3519
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3520
- },
3243
+ debug: () => table.options.debugAll ?? table.options.debugTable,
3521
3244
  onChange: () => {}
3522
3245
  });
3523
3246
  }
@@ -3547,11 +3270,7 @@
3547
3270
  return facetedMinMaxValues;
3548
3271
  }, {
3549
3272
  key: 'getFacetedMinMaxValues_' + columnId,
3550
- debug: () => {
3551
- var _table$options$debugA;
3552
-
3553
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3554
- },
3273
+ debug: () => table.options.debugAll ?? table.options.debugTable,
3555
3274
  onChange: () => {}
3556
3275
  });
3557
3276
  }
@@ -3582,11 +3301,9 @@
3582
3301
  const sortedData = rows.slice();
3583
3302
  sortedData.sort((rowA, rowB) => {
3584
3303
  for (let i = 0; i < availableSorting.length; i += 1) {
3585
- var _sortEntry$desc;
3586
-
3587
3304
  const sortEntry = availableSorting[i];
3588
3305
  const columnInfo = columnInfoById[sortEntry.id];
3589
- const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
3306
+ const isDesc = (sortEntry == null ? void 0 : sortEntry.desc) ?? false;
3590
3307
 
3591
3308
  if (columnInfo.sortUndefined) {
3592
3309
  const aValue = rowA.getValue(sortEntry.id);
@@ -3637,11 +3354,7 @@
3637
3354
  };
3638
3355
  }, {
3639
3356
  key: 'getSortedRowModel',
3640
- debug: () => {
3641
- var _table$options$debugA;
3642
-
3643
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3644
- },
3357
+ debug: () => table.options.debugAll ?? table.options.debugTable,
3645
3358
  onChange: () => {
3646
3359
  table._autoResetPageIndex();
3647
3360
  }
@@ -3690,8 +3403,8 @@
3690
3403
 
3691
3404
  const aggregatedGroupedRows = Array.from(rowGroupsMap.entries()).map((_ref, index) => {
3692
3405
  let [groupingValue, groupedRows] = _ref;
3693
- let id = columnId + ":" + groupingValue;
3694
- id = parentId ? parentId + ">" + id : id; // First, Recurse to group sub rows before aggregation
3406
+ let id = `${columnId}:${groupingValue}`;
3407
+ id = parentId ? `${parentId}>${id}` : id; // First, Recurse to group sub rows before aggregation
3695
3408
 
3696
3409
  const subRows = groupUpRecursively(groupedRows, depth + 1, id); // Flatten the leaf rows of the rows in this group
3697
3410
 
@@ -3710,9 +3423,7 @@
3710
3423
  }
3711
3424
 
3712
3425
  if (groupedRows[0]) {
3713
- var _groupedRows$0$getVal;
3714
-
3715
- row._valuesCache[columnId] = (_groupedRows$0$getVal = groupedRows[0].getValue(columnId)) != null ? _groupedRows$0$getVal : undefined;
3426
+ row._valuesCache[columnId] = groupedRows[0].getValue(columnId) ?? undefined;
3716
3427
  }
3717
3428
 
3718
3429
  return row._valuesCache[columnId];
@@ -3765,11 +3476,7 @@
3765
3476
  };
3766
3477
  }, {
3767
3478
  key: 'getGroupedRowModel',
3768
- debug: () => {
3769
- var _table$options$debugA;
3770
-
3771
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3772
- },
3479
+ debug: () => table.options.debugAll ?? table.options.debugTable,
3773
3480
  onChange: () => {
3774
3481
  table._queue(() => {
3775
3482
  table._autoResetExpanded();
@@ -3783,7 +3490,7 @@
3783
3490
  function groupBy(rows, columnId) {
3784
3491
  const groupMap = new Map();
3785
3492
  return rows.reduce((map, row) => {
3786
- const resKey = "" + row.getValue(columnId);
3493
+ const resKey = `${row.getValue(columnId)}`;
3787
3494
  const previous = map.get(resKey);
3788
3495
 
3789
3496
  if (!previous) {
@@ -3798,7 +3505,7 @@
3798
3505
 
3799
3506
  function getExpandedRowModel() {
3800
3507
  return table => memo(() => [table.getState().expanded, table.getPreExpandedRowModel(), table.options.paginateExpandedRows], (expanded, rowModel, paginateExpandedRows) => {
3801
- if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded != null ? expanded : {}).length) {
3508
+ if (!rowModel.rows.length || expanded !== true && !Object.keys(expanded ?? {}).length) {
3802
3509
  return rowModel;
3803
3510
  }
3804
3511
 
@@ -3810,11 +3517,7 @@
3810
3517
  return expandRows(rowModel);
3811
3518
  }, {
3812
3519
  key: 'getExpandedRowModel',
3813
- debug: () => {
3814
- var _table$options$debugA;
3815
-
3816
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3817
- }
3520
+ debug: () => table.options.debugAll ?? table.options.debugTable
3818
3521
  });
3819
3522
  }
3820
3523
  function expandRows(rowModel) {
@@ -3886,15 +3589,11 @@
3886
3589
  return paginatedRowModel;
3887
3590
  }, {
3888
3591
  key: 'getPaginationRowModel',
3889
- debug: () => {
3890
- var _table$options$debugA;
3891
-
3892
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
3893
- }
3592
+ debug: () => table.options.debugAll ?? table.options.debugTable
3894
3593
  });
3895
3594
  }
3896
3595
 
3897
- /* packages/svelte-table/src/placeholder.svelte generated by Svelte v3.49.0 */
3596
+ /* packages/svelte-table/src/placeholder.svelte generated by Svelte v3.50.1 */
3898
3597
 
3899
3598
  function create_fragment$1(ctx) {
3900
3599
  let t;
@@ -3935,7 +3634,7 @@
3935
3634
  }
3936
3635
 
3937
3636
  const PlaceholderServer = internal.create_ssr_component(($$result, $$props, $$bindings, slots) => {
3938
- return "" + internal.escape($$props.content);
3637
+ return `${internal.escape($$props.content)}`;
3939
3638
  });
3940
3639
  var Placeholder = typeof document === 'undefined' ? PlaceholderServer : Placeholder$1;
3941
3640
 
@@ -3993,7 +3692,7 @@
3993
3692
 
3994
3693
  function renderServer(Comp, props) {
3995
3694
  const WrapperComp = internal.create_ssr_component(($$result, $$props, $$bindings, slots) => {
3996
- return "" + internal.validate_component(Comp, 'TableComponent').$$render($$result, props, {}, {});
3695
+ return `${internal.validate_component(Comp, 'TableComponent').$$render($$result, props, {}, {})}`;
3997
3696
  });
3998
3697
  return WrapperComp;
3999
3698
  }