@ni/nimble-components 21.7.1 → 21.8.1

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.
@@ -16301,7 +16301,7 @@
16301
16301
 
16302
16302
  /**
16303
16303
  * Do not edit directly
16304
- * Generated on Wed, 28 Feb 2024 21:07:23 GMT
16304
+ * Generated on Fri, 01 Mar 2024 22:47:47 GMT
16305
16305
  */
16306
16306
 
16307
16307
  const Information100DarkUi = "#a46eff";
@@ -21190,6 +21190,11 @@
21190
21190
  this.emitChangeIfValueUpdated();
21191
21191
  return returnValue;
21192
21192
  }
21193
+ focusAndScrollOptionIntoView() {
21194
+ if (this.open) {
21195
+ super.focusAndScrollOptionIntoView();
21196
+ }
21197
+ }
21193
21198
  openChanged() {
21194
21199
  super.openChanged();
21195
21200
  if (this.dropdownButton) {
@@ -28003,7 +28008,7 @@
28003
28008
  ProseMirror document conforming to a given schema. Its behavior is
28004
28009
  defined by an array of [rules](https://prosemirror.net/docs/ref/#model.ParseRule).
28005
28010
  */
28006
- let DOMParser$1 = class DOMParser {
28011
+ class DOMParser {
28007
28012
  /**
28008
28013
  Create a parser that targets the given schema, using the given
28009
28014
  parsing rules.
@@ -28148,7 +28153,7 @@
28148
28153
  return schema.cached.domParser ||
28149
28154
  (schema.cached.domParser = new DOMParser(schema, DOMParser.schemaRules(schema)));
28150
28155
  }
28151
- };
28156
+ }
28152
28157
  const blockTags = {
28153
28158
  address: true, article: true, aside: true, blockquote: true, canvas: true,
28154
28159
  dd: true, div: true, dl: true, fieldset: true, figcaption: true, figure: true,
@@ -34772,7 +34777,7 @@
34772
34777
  dom = child;
34773
34778
  }
34774
34779
  if (!slice) {
34775
- let parser = view.someProp("clipboardParser") || view.someProp("domParser") || DOMParser$1.fromSchema(view.state.schema);
34780
+ let parser = view.someProp("clipboardParser") || view.someProp("domParser") || DOMParser.fromSchema(view.state.schema);
34776
34781
  slice = parser.parseSlice(dom, {
34777
34782
  preserveWhitespace: !!(asText || sliceData),
34778
34783
  context: $context,
@@ -36024,9 +36029,6 @@
36024
36029
  return this;
36025
36030
  return local.length || children.length ? new DecorationSet(local, children) : empty$1;
36026
36031
  }
36027
- /**
36028
- @internal
36029
- */
36030
36032
  forChild(offset, node) {
36031
36033
  if (this == empty$1)
36032
36034
  return this;
@@ -36716,7 +36718,7 @@
36716
36718
  }
36717
36719
  }
36718
36720
  let startDoc = view.state.doc;
36719
- let parser = view.someProp("domParser") || DOMParser$1.fromSchema(view.state.schema);
36721
+ let parser = view.someProp("domParser") || DOMParser.fromSchema(view.state.schema);
36720
36722
  let $from = startDoc.resolve(from);
36721
36723
  let sel = null, doc = parser.parse(parent, {
36722
36724
  topNode: $from.parent,
@@ -39355,8 +39357,8 @@
39355
39357
  let dragSourceElement = null;
39356
39358
  let isPastedFromProseMirror = false;
39357
39359
  let isDroppedFromProseMirror = false;
39358
- let pasteEvent = new ClipboardEvent('paste');
39359
- let dropEvent = new DragEvent('drop');
39360
+ let pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
39361
+ let dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
39360
39362
  const plugins = rules.map(rule => {
39361
39363
  return new Plugin({
39362
39364
  // we register a global drag handler to track the current drag source element
@@ -39423,8 +39425,8 @@
39423
39425
  if (!handler || !tr.steps.length) {
39424
39426
  return;
39425
39427
  }
39426
- dropEvent = new DragEvent('drop');
39427
- pasteEvent = new ClipboardEvent('paste');
39428
+ dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
39429
+ pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
39428
39430
  return tr;
39429
39431
  },
39430
39432
  });
@@ -40175,7 +40177,7 @@
40175
40177
  }
40176
40178
  }
40177
40179
  if (typeof content === 'string') {
40178
- const parser = DOMParser$1.fromSchema(schema);
40180
+ const parser = DOMParser.fromSchema(schema);
40179
40181
  return options.slice
40180
40182
  ? parser.parseSlice(elementFromString(content), options.parseOptions).content
40181
40183
  : parser.parse(elementFromString(content), options.parseOptions);
@@ -42853,7 +42855,7 @@ img.ProseMirror-separator {
42853
42855
  >
42854
42856
  </slot>
42855
42857
  </div>
42856
- </${anchoredRegionTag}>
42858
+ </${anchoredRegionTag}>
42857
42859
  </template>
42858
42860
  `;
42859
42861
 
@@ -43064,7 +43066,7 @@ img.ProseMirror-separator {
43064
43066
  * Overrides: `Listbox.focusAndScrollOptionIntoView`
43065
43067
  */
43066
43068
  focusAndScrollOptionIntoView() {
43067
- if (this.firstSelectedOption) {
43069
+ if (this.open && this.firstSelectedOption) {
43068
43070
  requestAnimationFrame(() => {
43069
43071
  this.firstSelectedOption?.scrollIntoView({ block: 'nearest' });
43070
43072
  });
@@ -56183,25 +56185,8 @@ img.ProseMirror-separator {
56183
56185
  addPasteRules() {
56184
56186
  return [
56185
56187
  markPasteRule({
56186
- find: (text, event) => {
56187
- var _a;
56188
- const html = (_a = event === null || event === void 0 ? void 0 : event.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text/html');
56188
+ find: text => {
56189
56189
  const foundLinks = [];
56190
- if (html) {
56191
- const dom = new DOMParser().parseFromString(html, 'text/html');
56192
- const anchors = dom.querySelectorAll('a');
56193
- if (anchors.length) {
56194
- [...anchors].forEach(anchor => (foundLinks.push({
56195
- text: anchor.innerText,
56196
- data: {
56197
- href: anchor.getAttribute('href'),
56198
- },
56199
- // get the index of the anchor inside the text
56200
- // and add the length of the anchor text
56201
- index: dom.body.innerText.indexOf(anchor.innerText) + anchor.innerText.length,
56202
- })));
56203
- }
56204
- }
56205
56190
  if (text) {
56206
56191
  const links = find$1(text).filter(item => item.isLink);
56207
56192
  if (links.length) {
@@ -58559,8 +58544,8 @@ img.ProseMirror-separator {
58559
58544
  super.setSelectedOptions();
58560
58545
  }
58561
58546
  focusAndScrollOptionIntoView() {
58562
- super.focusAndScrollOptionIntoView();
58563
58547
  if (this.open) {
58548
+ super.focusAndScrollOptionIntoView();
58564
58549
  window.requestAnimationFrame(() => {
58565
58550
  this.filterInput?.focus();
58566
58551
  });
@@ -59462,10 +59447,10 @@ img.ProseMirror-separator {
59462
59447
  function memo$1(getDeps, fn, opts) {
59463
59448
  let deps = [];
59464
59449
  let result;
59465
- return () => {
59450
+ return depArgs => {
59466
59451
  let depTime;
59467
59452
  if (opts.key && opts.debug) depTime = Date.now();
59468
- const newDeps = getDeps();
59453
+ const newDeps = getDeps(depArgs);
59469
59454
  const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
59470
59455
  if (!depsChanged) {
59471
59456
  return result;
@@ -59496,6 +59481,16 @@ img.ProseMirror-separator {
59496
59481
  return result;
59497
59482
  };
59498
59483
  }
59484
+ function getMemoOptions(tableOptions, debugLevel, key, onChange) {
59485
+ return {
59486
+ debug: () => {
59487
+ var _tableOptions$debugAl;
59488
+ return (_tableOptions$debugAl = tableOptions == null ? void 0 : tableOptions.debugAll) != null ? _tableOptions$debugAl : tableOptions[debugLevel];
59489
+ },
59490
+ key: key,
59491
+ onChange
59492
+ };
59493
+ }
59499
59494
 
59500
59495
  function createColumn(table, columnDef, depth, parent) {
59501
59496
  var _ref, _resolvedColumnDef$id;
@@ -59542,13 +59537,7 @@ img.ProseMirror-separator {
59542
59537
  getFlatColumns: memo$1(() => [true], () => {
59543
59538
  var _column$columns;
59544
59539
  return [column, ...((_column$columns = column.columns) == null ? void 0 : _column$columns.flatMap(d => d.getFlatColumns()))];
59545
- }, {
59546
- key: "development" === 'production' ,
59547
- debug: () => {
59548
- var _table$options$debugA;
59549
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
59550
- }
59551
- }),
59540
+ }, getMemoOptions(table.options, 'debugColumns', 'column.getFlatColumns')),
59552
59541
  getLeafColumns: memo$1(() => [table._getOrderColumnsFn()], orderColumns => {
59553
59542
  var _column$columns2;
59554
59543
  if ((_column$columns2 = column.columns) != null && _column$columns2.length) {
@@ -59556,13 +59545,7 @@ img.ProseMirror-separator {
59556
59545
  return orderColumns(leafColumns);
59557
59546
  }
59558
59547
  return [column];
59559
- }, {
59560
- key: "development" === 'production' ,
59561
- debug: () => {
59562
- var _table$options$debugA2;
59563
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
59564
- }
59565
- })
59548
+ }, getMemoOptions(table.options, 'debugColumns', 'column.getLeafColumns'))
59566
59549
  };
59567
59550
  for (const feature of table._features) {
59568
59551
  feature.createColumn == null || feature.createColumn(column, table);
@@ -59572,6 +59555,7 @@ img.ProseMirror-separator {
59572
59555
  return column;
59573
59556
  }
59574
59557
 
59558
+ const debug = 'debugHeaders';
59575
59559
  //
59576
59560
 
59577
59561
  function createHeader(table, column, options) {
@@ -59621,84 +59605,36 @@ img.ProseMirror-separator {
59621
59605
  const centerColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
59622
59606
  const headerGroups = buildHeaderGroups(allColumns, [...leftColumns, ...centerColumns, ...rightColumns], table);
59623
59607
  return headerGroups;
59624
- }, {
59625
- key: 'getHeaderGroups',
59626
- debug: () => {
59627
- var _table$options$debugA;
59628
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugHeaders;
59629
- }
59630
- });
59608
+ }, getMemoOptions(table.options, debug, 'getHeaderGroups'));
59631
59609
  table.getCenterHeaderGroups = memo$1(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, leafColumns, left, right) => {
59632
59610
  leafColumns = leafColumns.filter(column => !(left != null && left.includes(column.id)) && !(right != null && right.includes(column.id)));
59633
59611
  return buildHeaderGroups(allColumns, leafColumns, table, 'center');
59634
- }, {
59635
- key: 'getCenterHeaderGroups',
59636
- debug: () => {
59637
- var _table$options$debugA2;
59638
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugHeaders;
59639
- }
59640
- });
59612
+ }, getMemoOptions(table.options, debug, 'getCenterHeaderGroups'));
59641
59613
  table.getLeftHeaderGroups = memo$1(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.left], (allColumns, leafColumns, left) => {
59642
59614
  var _left$map$filter2;
59643
59615
  const orderedLeafColumns = (_left$map$filter2 = left == null ? void 0 : left.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _left$map$filter2 : [];
59644
59616
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'left');
59645
- }, {
59646
- key: 'getLeftHeaderGroups',
59647
- debug: () => {
59648
- var _table$options$debugA3;
59649
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugHeaders;
59650
- }
59651
- });
59617
+ }, getMemoOptions(table.options, debug, 'getLeftHeaderGroups'));
59652
59618
  table.getRightHeaderGroups = memo$1(() => [table.getAllColumns(), table.getVisibleLeafColumns(), table.getState().columnPinning.right], (allColumns, leafColumns, right) => {
59653
59619
  var _right$map$filter2;
59654
59620
  const orderedLeafColumns = (_right$map$filter2 = right == null ? void 0 : right.map(columnId => leafColumns.find(d => d.id === columnId)).filter(Boolean)) != null ? _right$map$filter2 : [];
59655
59621
  return buildHeaderGroups(allColumns, orderedLeafColumns, table, 'right');
59656
- }, {
59657
- key: 'getRightHeaderGroups',
59658
- debug: () => {
59659
- var _table$options$debugA4;
59660
- return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugHeaders;
59661
- }
59662
- });
59622
+ }, getMemoOptions(table.options, debug, 'getRightHeaderGroups'));
59663
59623
 
59664
59624
  // Footer Groups
59665
59625
 
59666
59626
  table.getFooterGroups = memo$1(() => [table.getHeaderGroups()], headerGroups => {
59667
59627
  return [...headerGroups].reverse();
59668
- }, {
59669
- key: 'getFooterGroups',
59670
- debug: () => {
59671
- var _table$options$debugA5;
59672
- return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugHeaders;
59673
- }
59674
- });
59628
+ }, getMemoOptions(table.options, debug, 'getFooterGroups'));
59675
59629
  table.getLeftFooterGroups = memo$1(() => [table.getLeftHeaderGroups()], headerGroups => {
59676
59630
  return [...headerGroups].reverse();
59677
- }, {
59678
- key: 'getLeftFooterGroups',
59679
- debug: () => {
59680
- var _table$options$debugA6;
59681
- return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugHeaders;
59682
- }
59683
- });
59631
+ }, getMemoOptions(table.options, debug, 'getLeftFooterGroups'));
59684
59632
  table.getCenterFooterGroups = memo$1(() => [table.getCenterHeaderGroups()], headerGroups => {
59685
59633
  return [...headerGroups].reverse();
59686
- }, {
59687
- key: 'getCenterFooterGroups',
59688
- debug: () => {
59689
- var _table$options$debugA7;
59690
- return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugHeaders;
59691
- }
59692
- });
59634
+ }, getMemoOptions(table.options, debug, 'getCenterFooterGroups'));
59693
59635
  table.getRightFooterGroups = memo$1(() => [table.getRightHeaderGroups()], headerGroups => {
59694
59636
  return [...headerGroups].reverse();
59695
- }, {
59696
- key: 'getRightFooterGroups',
59697
- debug: () => {
59698
- var _table$options$debugA8;
59699
- return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugHeaders;
59700
- }
59701
- });
59637
+ }, getMemoOptions(table.options, debug, 'getRightFooterGroups'));
59702
59638
 
59703
59639
  // Flat Headers
59704
59640
 
@@ -59706,46 +59642,22 @@ img.ProseMirror-separator {
59706
59642
  return headerGroups.map(headerGroup => {
59707
59643
  return headerGroup.headers;
59708
59644
  }).flat();
59709
- }, {
59710
- key: 'getFlatHeaders',
59711
- debug: () => {
59712
- var _table$options$debugA9;
59713
- return (_table$options$debugA9 = table.options.debugAll) != null ? _table$options$debugA9 : table.options.debugHeaders;
59714
- }
59715
- });
59645
+ }, getMemoOptions(table.options, debug, 'getFlatHeaders'));
59716
59646
  table.getLeftFlatHeaders = memo$1(() => [table.getLeftHeaderGroups()], left => {
59717
59647
  return left.map(headerGroup => {
59718
59648
  return headerGroup.headers;
59719
59649
  }).flat();
59720
- }, {
59721
- key: 'getLeftFlatHeaders',
59722
- debug: () => {
59723
- var _table$options$debugA10;
59724
- return (_table$options$debugA10 = table.options.debugAll) != null ? _table$options$debugA10 : table.options.debugHeaders;
59725
- }
59726
- });
59650
+ }, getMemoOptions(table.options, debug, 'getLeftFlatHeaders'));
59727
59651
  table.getCenterFlatHeaders = memo$1(() => [table.getCenterHeaderGroups()], left => {
59728
59652
  return left.map(headerGroup => {
59729
59653
  return headerGroup.headers;
59730
59654
  }).flat();
59731
- }, {
59732
- key: 'getCenterFlatHeaders',
59733
- debug: () => {
59734
- var _table$options$debugA11;
59735
- return (_table$options$debugA11 = table.options.debugAll) != null ? _table$options$debugA11 : table.options.debugHeaders;
59736
- }
59737
- });
59655
+ }, getMemoOptions(table.options, debug, 'getCenterFlatHeaders'));
59738
59656
  table.getRightFlatHeaders = memo$1(() => [table.getRightHeaderGroups()], left => {
59739
59657
  return left.map(headerGroup => {
59740
59658
  return headerGroup.headers;
59741
59659
  }).flat();
59742
- }, {
59743
- key: 'getRightFlatHeaders',
59744
- debug: () => {
59745
- var _table$options$debugA12;
59746
- return (_table$options$debugA12 = table.options.debugAll) != null ? _table$options$debugA12 : table.options.debugHeaders;
59747
- }
59748
- });
59660
+ }, getMemoOptions(table.options, debug, 'getRightFlatHeaders'));
59749
59661
 
59750
59662
  // Leaf Headers
59751
59663
 
@@ -59754,49 +59666,25 @@ img.ProseMirror-separator {
59754
59666
  var _header$subHeaders;
59755
59667
  return !((_header$subHeaders = header.subHeaders) != null && _header$subHeaders.length);
59756
59668
  });
59757
- }, {
59758
- key: 'getCenterLeafHeaders',
59759
- debug: () => {
59760
- var _table$options$debugA13;
59761
- return (_table$options$debugA13 = table.options.debugAll) != null ? _table$options$debugA13 : table.options.debugHeaders;
59762
- }
59763
- });
59669
+ }, getMemoOptions(table.options, debug, 'getCenterLeafHeaders'));
59764
59670
  table.getLeftLeafHeaders = memo$1(() => [table.getLeftFlatHeaders()], flatHeaders => {
59765
59671
  return flatHeaders.filter(header => {
59766
59672
  var _header$subHeaders2;
59767
59673
  return !((_header$subHeaders2 = header.subHeaders) != null && _header$subHeaders2.length);
59768
59674
  });
59769
- }, {
59770
- key: 'getLeftLeafHeaders',
59771
- debug: () => {
59772
- var _table$options$debugA14;
59773
- return (_table$options$debugA14 = table.options.debugAll) != null ? _table$options$debugA14 : table.options.debugHeaders;
59774
- }
59775
- });
59675
+ }, getMemoOptions(table.options, debug, 'getLeftLeafHeaders'));
59776
59676
  table.getRightLeafHeaders = memo$1(() => [table.getRightFlatHeaders()], flatHeaders => {
59777
59677
  return flatHeaders.filter(header => {
59778
59678
  var _header$subHeaders3;
59779
59679
  return !((_header$subHeaders3 = header.subHeaders) != null && _header$subHeaders3.length);
59780
59680
  });
59781
- }, {
59782
- key: 'getRightLeafHeaders',
59783
- debug: () => {
59784
- var _table$options$debugA15;
59785
- return (_table$options$debugA15 = table.options.debugAll) != null ? _table$options$debugA15 : table.options.debugHeaders;
59786
- }
59787
- });
59681
+ }, getMemoOptions(table.options, debug, 'getRightLeafHeaders'));
59788
59682
  table.getLeafHeaders = memo$1(() => [table.getLeftHeaderGroups(), table.getCenterHeaderGroups(), table.getRightHeaderGroups()], (left, center, right) => {
59789
59683
  var _left$0$headers, _left$, _center$0$headers, _center$, _right$0$headers, _right$;
59790
59684
  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 => {
59791
59685
  return header.getLeafHeaders();
59792
59686
  }).flat();
59793
- }, {
59794
- key: 'getLeafHeaders',
59795
- debug: () => {
59796
- var _table$options$debugA16;
59797
- return (_table$options$debugA16 = table.options.debugAll) != null ? _table$options$debugA16 : table.options.debugHeaders;
59798
- }
59799
- });
59687
+ }, getMemoOptions(table.options, debug, 'getLeafHeaders'));
59800
59688
  }
59801
59689
  };
59802
59690
  function buildHeaderGroups(allColumns, columnsToGroup, table, headerFamily) {
@@ -59962,15 +59850,8 @@ img.ProseMirror-separator {
59962
59850
  const columnSize = table.getState().columnSizing[column.id];
59963
59851
  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);
59964
59852
  };
59965
- column.getStart = position => {
59966
- const columns = !position ? table.getVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
59967
- const index = columns.findIndex(d => d.id === column.id);
59968
- if (index > 0) {
59969
- const prevSiblingColumn = columns[index - 1];
59970
- return prevSiblingColumn.getStart(position) + prevSiblingColumn.getSize();
59971
- }
59972
- return 0;
59973
- };
59853
+ column.getStart = memo$1(position => [position, _getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(0, column.getIndex(position)).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, 'debugColumns', 'getStart'));
59854
+ column.getAfter = memo$1(position => [position, _getVisibleLeafColumns(table, position), table.getState().columnSizing], (position, columns) => columns.slice(column.getIndex(position) + 1).reduce((sum, column) => sum + column.getSize(), 0), getMemoOptions(table.options, 'debugColumns', 'getAfter'));
59974
59855
  column.resetSize = () => {
59975
59856
  table.setColumnSizing(_ref2 => {
59976
59857
  let {
@@ -60855,6 +60736,19 @@ img.ProseMirror-separator {
60855
60736
  onColumnOrderChange: makeStateUpdater('columnOrder', table)
60856
60737
  };
60857
60738
  },
60739
+ createColumn: (column, table) => {
60740
+ column.getIndex = memo$1(position => [_getVisibleLeafColumns(table, position)], columns => columns.findIndex(d => d.id === column.id), getMemoOptions(table.options, 'debugColumns', 'getIndex'));
60741
+ column.getIsFirstColumn = position => {
60742
+ var _columns$;
60743
+ const columns = _getVisibleLeafColumns(table, position);
60744
+ return ((_columns$ = columns[0]) == null ? void 0 : _columns$.id) === column.id;
60745
+ };
60746
+ column.getIsLastColumn = position => {
60747
+ var _columns;
60748
+ const columns = _getVisibleLeafColumns(table, position);
60749
+ return ((_columns = columns[columns.length - 1]) == null ? void 0 : _columns.id) === column.id;
60750
+ };
60751
+ },
60858
60752
  createTable: table => {
60859
60753
  table.setColumnOrder = updater => table.options.onColumnOrderChange == null ? void 0 : table.options.onColumnOrderChange(updater);
60860
60754
  table.resetColumnOrder = defaultState => {
@@ -60890,10 +60784,7 @@ img.ProseMirror-separator {
60890
60784
  orderedColumns = [...orderedColumns, ...columnsCopy];
60891
60785
  }
60892
60786
  return orderColumns(orderedColumns, grouping, groupedColumnMode);
60893
- }, {
60894
- key: 'getOrderColumnsFn'
60895
- // debug: () => table.options.debugAll ?? table.options.debugTable,
60896
- });
60787
+ }, getMemoOptions(table.options, 'debugTable', '_getOrderColumnsFn'));
60897
60788
  }
60898
60789
  };
60899
60790
 
@@ -60982,6 +60873,7 @@ img.ProseMirror-separator {
60982
60873
  };
60983
60874
  });
60984
60875
  };
60876
+ //deprecated
60985
60877
  table.setPageCount = updater => table.setPagination(old => {
60986
60878
  var _table$options$pageCo;
60987
60879
  let newPageCount = functionalUpdate(updater, (_table$options$pageCo = table.options.pageCount) != null ? _table$options$pageCo : -1);
@@ -60999,13 +60891,7 @@ img.ProseMirror-separator {
60999
60891
  pageOptions = [...new Array(pageCount)].fill(null).map((_, i) => i);
61000
60892
  }
61001
60893
  return pageOptions;
61002
- }, {
61003
- key: 'getPageOptions',
61004
- debug: () => {
61005
- var _table$options$debugA;
61006
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
61007
- }
61008
- });
60894
+ }, getMemoOptions(table.options, 'debugTable', 'getPageOptions'));
61009
60895
  table.getCanPreviousPage = () => table.getState().pagination.pageIndex > 0;
61010
60896
  table.getCanNextPage = () => {
61011
60897
  const {
@@ -61028,6 +60914,12 @@ img.ProseMirror-separator {
61028
60914
  return old + 1;
61029
60915
  });
61030
60916
  };
60917
+ table.firstPage = () => {
60918
+ return table.setPageIndex(0);
60919
+ };
60920
+ table.lastPage = () => {
60921
+ return table.setPageIndex(table.getPageCount() - 1);
60922
+ };
61031
60923
  table.getPrePaginationRowModel = () => table.getExpandedRowModel();
61032
60924
  table.getPaginationRowModel = () => {
61033
60925
  if (!table._getPaginationRowModel && table.options.getPaginationRowModel) {
@@ -61040,7 +60932,11 @@ img.ProseMirror-separator {
61040
60932
  };
61041
60933
  table.getPageCount = () => {
61042
60934
  var _table$options$pageCo2;
61043
- return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getPrePaginationRowModel().rows.length / table.getState().pagination.pageSize);
60935
+ return (_table$options$pageCo2 = table.options.pageCount) != null ? _table$options$pageCo2 : Math.ceil(table.getRowCount() / table.getState().pagination.pageSize);
60936
+ };
60937
+ table.getRowCount = () => {
60938
+ var _table$options$rowCou;
60939
+ return (_table$options$rowCou = table.options.rowCount) != null ? _table$options$rowCou : table.getPrePaginationRowModel().rows.length;
61044
60940
  };
61045
60941
  }
61046
60942
  };
@@ -61190,39 +61086,21 @@ img.ProseMirror-separator {
61190
61086
  row.getCenterVisibleCells = memo$1(() => [row._getAllVisibleCells(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allCells, left, right) => {
61191
61087
  const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
61192
61088
  return allCells.filter(d => !leftAndRight.includes(d.column.id));
61193
- }, {
61194
- key: 'row.getCenterVisibleCells',
61195
- debug: () => {
61196
- var _table$options$debugA;
61197
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
61198
- }
61199
- });
61200
- row.getLeftVisibleCells = memo$1(() => [row._getAllVisibleCells(), table.getState().columnPinning.left,,], (allCells, left) => {
61089
+ }, getMemoOptions(table.options, 'debugRows', 'getCenterVisibleCells'));
61090
+ row.getLeftVisibleCells = memo$1(() => [row._getAllVisibleCells(), table.getState().columnPinning.left], (allCells, left) => {
61201
61091
  const cells = (left != null ? left : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
61202
61092
  ...d,
61203
61093
  position: 'left'
61204
61094
  }));
61205
61095
  return cells;
61206
- }, {
61207
- key: 'row.getLeftVisibleCells',
61208
- debug: () => {
61209
- var _table$options$debugA2;
61210
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
61211
- }
61212
- });
61096
+ }, getMemoOptions(table.options, 'debugRows', 'getLeftVisibleCells'));
61213
61097
  row.getRightVisibleCells = memo$1(() => [row._getAllVisibleCells(), table.getState().columnPinning.right], (allCells, right) => {
61214
61098
  const cells = (right != null ? right : []).map(columnId => allCells.find(cell => cell.column.id === columnId)).filter(Boolean).map(d => ({
61215
61099
  ...d,
61216
61100
  position: 'right'
61217
61101
  }));
61218
61102
  return cells;
61219
- }, {
61220
- key: 'row.getRightVisibleCells',
61221
- debug: () => {
61222
- var _table$options$debugA3;
61223
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugRows;
61224
- }
61225
- });
61103
+ }, getMemoOptions(table.options, 'debugRows', 'getRightVisibleCells'));
61226
61104
  },
61227
61105
  createTable: table => {
61228
61106
  table.setColumnPinning = updater => table.options.onColumnPinningChange == null ? void 0 : table.options.onColumnPinningChange(updater);
@@ -61241,32 +61119,14 @@ img.ProseMirror-separator {
61241
61119
  };
61242
61120
  table.getLeftLeafColumns = memo$1(() => [table.getAllLeafColumns(), table.getState().columnPinning.left], (allColumns, left) => {
61243
61121
  return (left != null ? left : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
61244
- }, {
61245
- key: 'getLeftLeafColumns',
61246
- debug: () => {
61247
- var _table$options$debugA4;
61248
- return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
61249
- }
61250
- });
61122
+ }, getMemoOptions(table.options, 'debugColumns', 'getLeftLeafColumns'));
61251
61123
  table.getRightLeafColumns = memo$1(() => [table.getAllLeafColumns(), table.getState().columnPinning.right], (allColumns, right) => {
61252
61124
  return (right != null ? right : []).map(columnId => allColumns.find(column => column.id === columnId)).filter(Boolean);
61253
- }, {
61254
- key: 'getRightLeafColumns',
61255
- debug: () => {
61256
- var _table$options$debugA5;
61257
- return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
61258
- }
61259
- });
61125
+ }, getMemoOptions(table.options, 'debugColumns', 'getRightLeafColumns'));
61260
61126
  table.getCenterLeafColumns = memo$1(() => [table.getAllLeafColumns(), table.getState().columnPinning.left, table.getState().columnPinning.right], (allColumns, left, right) => {
61261
61127
  const leftAndRight = [...(left != null ? left : []), ...(right != null ? right : [])];
61262
61128
  return allColumns.filter(d => !leftAndRight.includes(d.id));
61263
- }, {
61264
- key: 'getCenterLeafColumns',
61265
- debug: () => {
61266
- var _table$options$debugA6;
61267
- return (_table$options$debugA6 = table.options.debugAll) != null ? _table$options$debugA6 : table.options.debugColumns;
61268
- }
61269
- });
61129
+ }, getMemoOptions(table.options, 'debugColumns', 'getCenterLeafColumns'));
61270
61130
  table.setRowPinning = updater => table.options.onRowPinningChange == null ? void 0 : table.options.onRowPinningChange(updater);
61271
61131
  table.resetRowPinning = defaultState => {
61272
61132
  var _table$initialState$r, _table$initialState2;
@@ -61281,7 +61141,7 @@ img.ProseMirror-separator {
61281
61141
  }
61282
61142
  return Boolean((_pinningState$positio2 = pinningState[position]) == null ? void 0 : _pinningState$positio2.length);
61283
61143
  };
61284
- table._getPinnedRows = position => memo$1(() => [table.getRowModel().rows, table.getState().rowPinning[position]], (visibleRows, pinnedRowIds) => {
61144
+ table._getPinnedRows = memo$1(position => [table.getRowModel().rows, table.getState().rowPinning[position], position], (visibleRows, pinnedRowIds, position) => {
61285
61145
  var _table$options$keepPi;
61286
61146
  const rows = ((_table$options$keepPi = table.options.keepPinnedRows) != null ? _table$options$keepPi : true) ?
61287
61147
  //get all rows that are pinned even if they would not be otherwise visible
@@ -61296,25 +61156,13 @@ img.ProseMirror-separator {
61296
61156
  ...d,
61297
61157
  position
61298
61158
  }));
61299
- }, {
61300
- key: `row.get${position === 'top' ? 'Top' : 'Bottom'}Rows`,
61301
- debug: () => {
61302
- var _table$options$debugA7;
61303
- return (_table$options$debugA7 = table.options.debugAll) != null ? _table$options$debugA7 : table.options.debugRows;
61304
- }
61305
- })();
61159
+ }, getMemoOptions(table.options, 'debugRows', '_getPinnedRows'));
61306
61160
  table.getTopRows = () => table._getPinnedRows('top');
61307
61161
  table.getBottomRows = () => table._getPinnedRows('bottom');
61308
61162
  table.getCenterRows = memo$1(() => [table.getRowModel().rows, table.getState().rowPinning.top, table.getState().rowPinning.bottom], (allRows, top, bottom) => {
61309
61163
  const topAndBottom = new Set([...(top != null ? top : []), ...(bottom != null ? bottom : [])]);
61310
61164
  return allRows.filter(d => !topAndBottom.has(d.id));
61311
- }, {
61312
- key: 'row.getCenterRows',
61313
- debug: () => {
61314
- var _table$options$debugA8;
61315
- return (_table$options$debugA8 = table.options.debugAll) != null ? _table$options$debugA8 : table.options.debugRows;
61316
- }
61317
- });
61165
+ }, getMemoOptions(table.options, 'debugRows', 'getCenterRows'));
61318
61166
  }
61319
61167
  };
61320
61168
 
@@ -61448,13 +61296,7 @@ img.ProseMirror-separator {
61448
61296
  };
61449
61297
  }
61450
61298
  return selectRowsFn(table, rowModel);
61451
- }, {
61452
- key: 'getSelectedRowModel',
61453
- debug: () => {
61454
- var _table$options$debugA;
61455
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
61456
- }
61457
- });
61299
+ }, getMemoOptions(table.options, 'debugTable', 'getSelectedRowModel'));
61458
61300
  table.getFilteredSelectedRowModel = memo$1(() => [table.getState().rowSelection, table.getFilteredRowModel()], (rowSelection, rowModel) => {
61459
61301
  if (!Object.keys(rowSelection).length) {
61460
61302
  return {
@@ -61464,13 +61306,7 @@ img.ProseMirror-separator {
61464
61306
  };
61465
61307
  }
61466
61308
  return selectRowsFn(table, rowModel);
61467
- }, {
61468
- key: "development" === 'production' ,
61469
- debug: () => {
61470
- var _table$options$debugA2;
61471
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugTable;
61472
- }
61473
- });
61309
+ }, getMemoOptions(table.options, 'debugTable', 'getFilteredSelectedRowModel'));
61474
61310
  table.getGroupedSelectedRowModel = memo$1(() => [table.getState().rowSelection, table.getSortedRowModel()], (rowSelection, rowModel) => {
61475
61311
  if (!Object.keys(rowSelection).length) {
61476
61312
  return {
@@ -61480,13 +61316,7 @@ img.ProseMirror-separator {
61480
61316
  };
61481
61317
  }
61482
61318
  return selectRowsFn(table, rowModel);
61483
- }, {
61484
- key: "development" === 'production' ,
61485
- debug: () => {
61486
- var _table$options$debugA3;
61487
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugTable;
61488
- }
61489
- });
61319
+ }, getMemoOptions(table.options, 'debugTable', 'getGroupedSelectedRowModel'));
61490
61320
 
61491
61321
  ///
61492
61322
 
@@ -62046,8 +61876,9 @@ img.ProseMirror-separator {
62046
61876
  }
62047
61877
  };
62048
61878
  column.getIsVisible = () => {
62049
- var _table$getState$colum, _table$getState$colum2;
62050
- return (_table$getState$colum = (_table$getState$colum2 = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum2[column.id]) != null ? _table$getState$colum : true;
61879
+ var _ref, _table$getState$colum;
61880
+ const childColumns = column.columns;
61881
+ return (_ref = childColumns.length ? childColumns.some(c => c.getIsVisible()) : (_table$getState$colum = table.getState().columnVisibility) == null ? void 0 : _table$getState$colum[column.id]) != null ? _ref : true;
62051
61882
  };
62052
61883
  column.getCanHide = () => {
62053
61884
  var _column$columnDef$ena, _table$options$enable;
@@ -62062,32 +61893,14 @@ img.ProseMirror-separator {
62062
61893
  createRow: (row, table) => {
62063
61894
  row._getAllVisibleCells = memo$1(() => [row.getAllCells(), table.getState().columnVisibility], cells => {
62064
61895
  return cells.filter(cell => cell.column.getIsVisible());
62065
- }, {
62066
- key: "development" === 'production' ,
62067
- debug: () => {
62068
- var _table$options$debugA;
62069
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
62070
- }
62071
- });
62072
- row.getVisibleCells = memo$1(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], {
62073
- key: 'row.getVisibleCells',
62074
- debug: () => {
62075
- var _table$options$debugA2;
62076
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
62077
- }
62078
- });
61896
+ }, getMemoOptions(table.options, 'debugRows', '_getAllVisibleCells'));
61897
+ row.getVisibleCells = memo$1(() => [row.getLeftVisibleCells(), row.getCenterVisibleCells(), row.getRightVisibleCells()], (left, center, right) => [...left, ...center, ...right], getMemoOptions(table.options, 'debugRows', 'getVisibleCells'));
62079
61898
  },
62080
61899
  createTable: table => {
62081
61900
  const makeVisibleColumnsMethod = (key, getColumns) => {
62082
61901
  return memo$1(() => [getColumns(), getColumns().filter(d => d.getIsVisible()).map(d => d.id).join('_')], columns => {
62083
61902
  return columns.filter(d => d.getIsVisible == null ? void 0 : d.getIsVisible());
62084
- }, {
62085
- key,
62086
- debug: () => {
62087
- var _table$options$debugA3;
62088
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
62089
- }
62090
- });
61903
+ }, getMemoOptions(table.options, 'debugColumns', key));
62091
61904
  };
62092
61905
  table.getVisibleFlatColumns = makeVisibleColumnsMethod('getVisibleFlatColumns', () => table.getAllFlatColumns());
62093
61906
  table.getVisibleLeafColumns = makeVisibleColumnsMethod('getVisibleLeafColumns', () => table.getAllLeafColumns());
@@ -62117,6 +61930,9 @@ img.ProseMirror-separator {
62117
61930
  };
62118
61931
  }
62119
61932
  };
61933
+ function _getVisibleLeafColumns(table, position) {
61934
+ return !position ? table.getVisibleLeafColumns() : position === 'center' ? table.getCenterVisibleLeafColumns() : position === 'left' ? table.getLeftVisibleLeafColumns() : table.getRightVisibleLeafColumns();
61935
+ }
62120
61936
 
62121
61937
  const features = [Headers, Visibility, Ordering, Pinning, Filters, Sorting, Grouping, Expanding, Pagination, RowSelection, ColumnSizing];
62122
61938
 
@@ -62243,13 +62059,7 @@ img.ProseMirror-separator {
62243
62059
  }, {}),
62244
62060
  ...defaultColumn
62245
62061
  };
62246
- }, {
62247
- debug: () => {
62248
- var _table$options$debugA;
62249
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugColumns;
62250
- },
62251
- key: 'getDefaultColumnDef'
62252
- }),
62062
+ }, getMemoOptions(options, 'debugColumns', '_getDefaultColumnDef')),
62253
62063
  _getColumnDefs: () => table.options.columns,
62254
62064
  getAllColumns: memo$1(() => [table._getColumnDefs()], columnDefs => {
62255
62065
  const recurseColumns = function (columnDefs, parent, depth) {
@@ -62264,46 +62074,22 @@ img.ProseMirror-separator {
62264
62074
  });
62265
62075
  };
62266
62076
  return recurseColumns(columnDefs);
62267
- }, {
62268
- key: 'getAllColumns',
62269
- debug: () => {
62270
- var _table$options$debugA2;
62271
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugColumns;
62272
- }
62273
- }),
62077
+ }, getMemoOptions(options, 'debugColumns', 'getAllColumns')),
62274
62078
  getAllFlatColumns: memo$1(() => [table.getAllColumns()], allColumns => {
62275
62079
  return allColumns.flatMap(column => {
62276
62080
  return column.getFlatColumns();
62277
62081
  });
62278
- }, {
62279
- key: 'getAllFlatColumns',
62280
- debug: () => {
62281
- var _table$options$debugA3;
62282
- return (_table$options$debugA3 = table.options.debugAll) != null ? _table$options$debugA3 : table.options.debugColumns;
62283
- }
62284
- }),
62082
+ }, getMemoOptions(options, 'debugColumns', 'getAllFlatColumns')),
62285
62083
  _getAllFlatColumnsById: memo$1(() => [table.getAllFlatColumns()], flatColumns => {
62286
62084
  return flatColumns.reduce((acc, column) => {
62287
62085
  acc[column.id] = column;
62288
62086
  return acc;
62289
62087
  }, {});
62290
- }, {
62291
- key: 'getAllFlatColumnsById',
62292
- debug: () => {
62293
- var _table$options$debugA4;
62294
- return (_table$options$debugA4 = table.options.debugAll) != null ? _table$options$debugA4 : table.options.debugColumns;
62295
- }
62296
- }),
62088
+ }, getMemoOptions(options, 'debugColumns', 'getAllFlatColumnsById')),
62297
62089
  getAllLeafColumns: memo$1(() => [table.getAllColumns(), table._getOrderColumnsFn()], (allColumns, orderColumns) => {
62298
62090
  let leafColumns = allColumns.flatMap(column => column.getLeafColumns());
62299
62091
  return orderColumns(leafColumns);
62300
- }, {
62301
- key: 'getAllLeafColumns',
62302
- debug: () => {
62303
- var _table$options$debugA5;
62304
- return (_table$options$debugA5 = table.options.debugAll) != null ? _table$options$debugA5 : table.options.debugColumns;
62305
- }
62306
- }),
62092
+ }, getMemoOptions(options, 'debugColumns', 'getAllLeafColumns')),
62307
62093
  getColumn: columnId => {
62308
62094
  const column = table._getAllFlatColumnsById()[columnId];
62309
62095
  if (!column) {
@@ -62338,10 +62124,7 @@ img.ProseMirror-separator {
62338
62124
  cell: cell,
62339
62125
  getValue: cell.getValue,
62340
62126
  renderValue: cell.renderValue
62341
- }), {
62342
- key: 'cell.getContext',
62343
- debug: () => table.options.debugAll
62344
- })
62127
+ }), getMemoOptions(table.options, 'debugCells', 'cell.getContext'))
62345
62128
  };
62346
62129
  table._features.forEach(feature => {
62347
62130
  feature.createCell == null || feature.createCell(cell, column, row, table);
@@ -62406,25 +62189,13 @@ img.ProseMirror-separator {
62406
62189
  return leafColumns.map(column => {
62407
62190
  return createCell(table, row, column, column.id);
62408
62191
  });
62409
- }, {
62410
- key: 'row.getAllCells',
62411
- debug: () => {
62412
- var _table$options$debugA;
62413
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugRows;
62414
- }
62415
- }),
62192
+ }, getMemoOptions(table.options, 'debugRows', 'getAllCells')),
62416
62193
  _getAllCellsByColumnId: memo$1(() => [row.getAllCells()], allCells => {
62417
62194
  return allCells.reduce((acc, cell) => {
62418
62195
  acc[cell.column.id] = cell;
62419
62196
  return acc;
62420
62197
  }, {});
62421
- }, {
62422
- key: "development" === 'production' ,
62423
- debug: () => {
62424
- var _table$options$debugA2;
62425
- return (_table$options$debugA2 = table.options.debugAll) != null ? _table$options$debugA2 : table.options.debugRows;
62426
- }
62427
- })
62198
+ }, getMemoOptions(table.options, 'debugRows', 'getAllCellsByColumnId'))
62428
62199
  };
62429
62200
  for (let i = 0; i < table._features.length; i++) {
62430
62201
  const feature = table._features[i];
@@ -62478,16 +62249,7 @@ img.ProseMirror-separator {
62478
62249
  };
62479
62250
  rowModel.rows = accessRows(data);
62480
62251
  return rowModel;
62481
- }, {
62482
- key: 'getRowModel',
62483
- debug: () => {
62484
- var _table$options$debugA;
62485
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
62486
- },
62487
- onChange: () => {
62488
- table._autoResetPageIndex();
62489
- }
62490
- });
62252
+ }, getMemoOptions(table.options, 'debugTable', 'getRowModel', () => table._autoResetPageIndex()));
62491
62253
  }
62492
62254
 
62493
62255
  function getSortedRowModel() {
@@ -62570,16 +62332,7 @@ img.ProseMirror-separator {
62570
62332
  flatRows: sortedFlatRows,
62571
62333
  rowsById: rowModel.rowsById
62572
62334
  };
62573
- }, {
62574
- key: 'getSortedRowModel',
62575
- debug: () => {
62576
- var _table$options$debugA;
62577
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
62578
- },
62579
- onChange: () => {
62580
- table._autoResetPageIndex();
62581
- }
62582
- });
62335
+ }, getMemoOptions(table.options, 'debugTable', 'getSortedRowModel', () => table._autoResetPageIndex()));
62583
62336
  }
62584
62337
 
62585
62338
  function getGroupedRowModel() {
@@ -62694,19 +62447,12 @@ img.ProseMirror-separator {
62694
62447
  flatRows: groupedFlatRows,
62695
62448
  rowsById: groupedRowsById
62696
62449
  };
62697
- }, {
62698
- key: 'getGroupedRowModel',
62699
- debug: () => {
62700
- var _table$options$debugA;
62701
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
62702
- },
62703
- onChange: () => {
62704
- table._queue(() => {
62705
- table._autoResetExpanded();
62706
- table._autoResetPageIndex();
62707
- });
62708
- }
62709
- });
62450
+ }, getMemoOptions(table.options, 'debugTable', 'getGroupedRowModel', () => {
62451
+ table._queue(() => {
62452
+ table._autoResetExpanded();
62453
+ table._autoResetPageIndex();
62454
+ });
62455
+ }));
62710
62456
  }
62711
62457
  function groupBy(rows, columnId) {
62712
62458
  const groupMap = new Map();
@@ -62732,13 +62478,7 @@ img.ProseMirror-separator {
62732
62478
  return rowModel;
62733
62479
  }
62734
62480
  return expandRows(rowModel);
62735
- }, {
62736
- key: 'getExpandedRowModel',
62737
- debug: () => {
62738
- var _table$options$debugA;
62739
- return (_table$options$debugA = table.options.debugAll) != null ? _table$options$debugA : table.options.debugTable;
62740
- }
62741
- });
62481
+ }, getMemoOptions(table.options, 'debugTable', 'getExpandedRowModel'));
62742
62482
  }
62743
62483
  function expandRows(rowModel) {
62744
62484
  const expandedRows = [];
@@ -64512,659 +64252,621 @@ img.ProseMirror-separator {
64512
64252
  </template>
64513
64253
  `;
64514
64254
 
64515
- /**
64516
- * virtual-core
64517
- *
64518
- * Copyright (c) TanStack
64519
- *
64520
- * This source code is licensed under the MIT license found in the
64521
- * LICENSE.md file in the root directory of this source tree.
64522
- *
64523
- * @license MIT
64524
- */
64525
- function _extends() {
64526
- _extends = Object.assign ? Object.assign.bind() : function (target) {
64527
- for (var i = 1; i < arguments.length; i++) {
64528
- var source = arguments[i];
64529
- for (var key in source) {
64530
- if (Object.prototype.hasOwnProperty.call(source, key)) {
64531
- target[key] = source[key];
64532
- }
64533
- }
64534
- }
64535
- return target;
64536
- };
64537
- return _extends.apply(this, arguments);
64538
- }
64539
-
64540
- /**
64541
- * virtual-core
64542
- *
64543
- * Copyright (c) TanStack
64544
- *
64545
- * This source code is licensed under the MIT license found in the
64546
- * LICENSE.md file in the root directory of this source tree.
64547
- *
64548
- * @license MIT
64549
- */
64550
64255
  function memo(getDeps, fn, opts) {
64551
- var _opts$initialDeps;
64552
- var deps = (_opts$initialDeps = opts.initialDeps) != null ? _opts$initialDeps : [];
64553
- var result;
64554
- return function () {
64555
- var depTime;
64556
- if (opts.key && opts.debug != null && opts.debug()) depTime = Date.now();
64557
- var newDeps = getDeps();
64558
- var depsChanged = newDeps.length !== deps.length || newDeps.some(function (dep, index) {
64559
- return deps[index] !== dep;
64560
- });
64256
+ let deps = opts.initialDeps ?? [];
64257
+ let result;
64258
+ return () => {
64259
+ var _a, _b, _c, _d;
64260
+ let depTime;
64261
+ if (opts.key && ((_a = opts.debug) == null ? void 0 : _a.call(opts)))
64262
+ depTime = Date.now();
64263
+ const newDeps = getDeps();
64264
+ const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
64561
64265
  if (!depsChanged) {
64562
64266
  return result;
64563
64267
  }
64564
64268
  deps = newDeps;
64565
- var resultTime;
64566
- if (opts.key && opts.debug != null && opts.debug()) resultTime = Date.now();
64567
- result = fn.apply(void 0, newDeps);
64568
- if (opts.key && opts.debug != null && opts.debug()) {
64569
- var depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
64570
- var resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
64571
- var resultFpsPercentage = resultEndTime / 16;
64572
- var pad = function pad(str, num) {
64269
+ let resultTime;
64270
+ if (opts.key && ((_b = opts.debug) == null ? void 0 : _b.call(opts)))
64271
+ resultTime = Date.now();
64272
+ result = fn(...newDeps);
64273
+ if (opts.key && ((_c = opts.debug) == null ? void 0 : _c.call(opts))) {
64274
+ const depEndTime = Math.round((Date.now() - depTime) * 100) / 100;
64275
+ const resultEndTime = Math.round((Date.now() - resultTime) * 100) / 100;
64276
+ const resultFpsPercentage = resultEndTime / 16;
64277
+ const pad = (str, num) => {
64573
64278
  str = String(str);
64574
64279
  while (str.length < num) {
64575
- str = ' ' + str;
64280
+ str = " " + str;
64576
64281
  }
64577
64282
  return str;
64578
64283
  };
64579
- 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);
64284
+ console.info(
64285
+ `%c⏱ ${pad(resultEndTime, 5)} /${pad(depEndTime, 5)} ms`,
64286
+ `
64287
+ font-size: .6rem;
64288
+ font-weight: bold;
64289
+ color: hsl(${Math.max(
64290
+ 0,
64291
+ Math.min(120 - 120 * resultFpsPercentage, 120)
64292
+ )}deg 100% 31%);`,
64293
+ opts == null ? void 0 : opts.key
64294
+ );
64580
64295
  }
64581
- opts == null || opts.onChange == null || opts.onChange(result);
64296
+ (_d = opts == null ? void 0 : opts.onChange) == null ? void 0 : _d.call(opts, result);
64582
64297
  return result;
64583
64298
  };
64584
64299
  }
64585
64300
  function notUndefined(value, msg) {
64586
- if (value === undefined) {
64587
- throw new Error("Unexpected undefined" + (msg ? ": " + msg : ''));
64301
+ if (value === void 0) {
64302
+ throw new Error(`Unexpected undefined${msg ? `: ${msg}` : ""}`);
64588
64303
  } else {
64589
64304
  return value;
64590
64305
  }
64591
64306
  }
64592
- var approxEqual = function approxEqual(a, b) {
64593
- return Math.abs(a - b) < 1;
64594
- };
64595
-
64596
- /**
64597
- * virtual-core
64598
- *
64599
- * Copyright (c) TanStack
64600
- *
64601
- * This source code is licensed under the MIT license found in the
64602
- * LICENSE.md file in the root directory of this source tree.
64603
- *
64604
- * @license MIT
64605
- */
64606
-
64607
- //
64608
-
64609
- //
64307
+ const approxEqual = (a, b) => Math.abs(a - b) < 1;
64610
64308
 
64611
- var defaultKeyExtractor = function defaultKeyExtractor(index) {
64612
- return index;
64613
- };
64614
- var defaultRangeExtractor = function defaultRangeExtractor(range) {
64615
- var start = Math.max(range.startIndex - range.overscan, 0);
64616
- var end = Math.min(range.endIndex + range.overscan, range.count - 1);
64617
- var arr = [];
64618
- for (var _i = start; _i <= end; _i++) {
64619
- arr.push(_i);
64309
+ const defaultKeyExtractor = (index) => index;
64310
+ const defaultRangeExtractor = (range) => {
64311
+ const start = Math.max(range.startIndex - range.overscan, 0);
64312
+ const end = Math.min(range.endIndex + range.overscan, range.count - 1);
64313
+ const arr = [];
64314
+ for (let i = start; i <= end; i++) {
64315
+ arr.push(i);
64620
64316
  }
64621
64317
  return arr;
64622
64318
  };
64623
- var observeElementRect = function observeElementRect(instance, cb) {
64624
- var element = instance.scrollElement;
64319
+ const observeElementRect = (instance, cb) => {
64320
+ const element = instance.scrollElement;
64625
64321
  if (!element) {
64626
64322
  return;
64627
64323
  }
64628
- var handler = function handler(rect) {
64629
- var width = rect.width,
64630
- height = rect.height;
64631
- cb({
64632
- width: Math.round(width),
64633
- height: Math.round(height)
64634
- });
64324
+ const handler = (rect) => {
64325
+ const { width, height } = rect;
64326
+ cb({ width: Math.round(width), height: Math.round(height) });
64635
64327
  };
64636
64328
  handler(element.getBoundingClientRect());
64637
- var observer = new ResizeObserver(function (entries) {
64638
- var entry = entries[0];
64639
- if (entry != null && entry.borderBoxSize) {
64640
- var box = entry.borderBoxSize[0];
64329
+ if (typeof ResizeObserver === "undefined") {
64330
+ return () => {
64331
+ };
64332
+ }
64333
+ const observer = new ResizeObserver((entries) => {
64334
+ const entry = entries[0];
64335
+ if (entry == null ? void 0 : entry.borderBoxSize) {
64336
+ const box = entry.borderBoxSize[0];
64641
64337
  if (box) {
64642
- handler({
64643
- width: box.inlineSize,
64644
- height: box.blockSize
64645
- });
64338
+ handler({ width: box.inlineSize, height: box.blockSize });
64646
64339
  return;
64647
64340
  }
64648
64341
  }
64649
64342
  handler(element.getBoundingClientRect());
64650
64343
  });
64651
- observer.observe(element, {
64652
- box: 'border-box'
64653
- });
64654
- return function () {
64344
+ observer.observe(element, { box: "border-box" });
64345
+ return () => {
64655
64346
  observer.unobserve(element);
64656
64347
  };
64657
64348
  };
64658
- var observeElementOffset = function observeElementOffset(instance, cb) {
64659
- var element = instance.scrollElement;
64349
+ const observeElementOffset = (instance, cb) => {
64350
+ const element = instance.scrollElement;
64660
64351
  if (!element) {
64661
64352
  return;
64662
64353
  }
64663
- var handler = function handler() {
64664
- cb(element[instance.options.horizontal ? 'scrollLeft' : 'scrollTop']);
64354
+ const handler = () => {
64355
+ cb(element[instance.options.horizontal ? "scrollLeft" : "scrollTop"]);
64665
64356
  };
64666
64357
  handler();
64667
- element.addEventListener('scroll', handler, {
64358
+ element.addEventListener("scroll", handler, {
64668
64359
  passive: true
64669
64360
  });
64670
- return function () {
64671
- element.removeEventListener('scroll', handler);
64361
+ return () => {
64362
+ element.removeEventListener("scroll", handler);
64672
64363
  };
64673
64364
  };
64674
- var measureElement = function measureElement(element, entry, instance) {
64675
- if (entry != null && entry.borderBoxSize) {
64676
- var box = entry.borderBoxSize[0];
64365
+ const measureElement = (element, entry, instance) => {
64366
+ if (entry == null ? void 0 : entry.borderBoxSize) {
64367
+ const box = entry.borderBoxSize[0];
64677
64368
  if (box) {
64678
- var size = Math.round(box[instance.options.horizontal ? 'inlineSize' : 'blockSize']);
64369
+ const size = Math.round(
64370
+ box[instance.options.horizontal ? "inlineSize" : "blockSize"]
64371
+ );
64679
64372
  return size;
64680
64373
  }
64681
64374
  }
64682
- return Math.round(element.getBoundingClientRect()[instance.options.horizontal ? 'width' : 'height']);
64683
- };
64684
- var elementScroll = function elementScroll(offset, _ref2, instance) {
64685
- var _instance$scrollEleme3, _instance$scrollEleme4;
64686
- var _ref2$adjustments = _ref2.adjustments,
64687
- adjustments = _ref2$adjustments === void 0 ? 0 : _ref2$adjustments,
64688
- behavior = _ref2.behavior;
64689
- var toOffset = offset + adjustments;
64690
- (_instance$scrollEleme3 = instance.scrollElement) == null || _instance$scrollEleme3.scrollTo == null || _instance$scrollEleme3.scrollTo((_instance$scrollEleme4 = {}, _instance$scrollEleme4[instance.options.horizontal ? 'left' : 'top'] = toOffset, _instance$scrollEleme4.behavior = behavior, _instance$scrollEleme4));
64691
- };
64692
- var Virtualizer$1 = function Virtualizer(_opts) {
64693
- var _this = this;
64694
- this.unsubs = [];
64695
- this.scrollElement = null;
64696
- this.isScrolling = false;
64697
- this.isScrollingTimeoutId = null;
64698
- this.scrollToIndexTimeoutId = null;
64699
- this.measurementsCache = [];
64700
- this.itemSizeCache = new Map();
64701
- this.pendingMeasuredCacheIndexes = [];
64702
- this.scrollDirection = null;
64703
- this.scrollAdjustments = 0;
64704
- this.measureElementCache = new Map();
64705
- this.observer = function () {
64706
- var _ro = null;
64707
- var get = function get() {
64708
- if (_ro) {
64709
- return _ro;
64710
- } else if (typeof ResizeObserver !== 'undefined') {
64711
- return _ro = new ResizeObserver(function (entries) {
64712
- entries.forEach(function (entry) {
64713
- _this._measureElement(entry.target, entry);
64375
+ return Math.round(
64376
+ element.getBoundingClientRect()[instance.options.horizontal ? "width" : "height"]
64377
+ );
64378
+ };
64379
+ const elementScroll = (offset, {
64380
+ adjustments = 0,
64381
+ behavior
64382
+ }, instance) => {
64383
+ var _a, _b;
64384
+ const toOffset = offset + adjustments;
64385
+ (_b = (_a = instance.scrollElement) == null ? void 0 : _a.scrollTo) == null ? void 0 : _b.call(_a, {
64386
+ [instance.options.horizontal ? "left" : "top"]: toOffset,
64387
+ behavior
64388
+ });
64389
+ };
64390
+ let Virtualizer$1 = class Virtualizer {
64391
+ constructor(opts) {
64392
+ this.unsubs = [];
64393
+ this.scrollElement = null;
64394
+ this.isScrolling = false;
64395
+ this.isScrollingTimeoutId = null;
64396
+ this.scrollToIndexTimeoutId = null;
64397
+ this.measurementsCache = [];
64398
+ this.itemSizeCache = /* @__PURE__ */ new Map();
64399
+ this.pendingMeasuredCacheIndexes = [];
64400
+ this.scrollDirection = null;
64401
+ this.scrollAdjustments = 0;
64402
+ this.measureElementCache = /* @__PURE__ */ new Map();
64403
+ this.observer = /* @__PURE__ */ (() => {
64404
+ let _ro = null;
64405
+ const get = () => {
64406
+ if (_ro) {
64407
+ return _ro;
64408
+ } else if (typeof ResizeObserver !== "undefined") {
64409
+ return _ro = new ResizeObserver((entries) => {
64410
+ entries.forEach((entry) => {
64411
+ this._measureElement(entry.target, entry);
64412
+ });
64714
64413
  });
64414
+ } else {
64415
+ return null;
64416
+ }
64417
+ };
64418
+ return {
64419
+ disconnect: () => {
64420
+ var _a;
64421
+ return (_a = get()) == null ? void 0 : _a.disconnect();
64422
+ },
64423
+ observe: (target) => {
64424
+ var _a;
64425
+ return (_a = get()) == null ? void 0 : _a.observe(target, { box: "border-box" });
64426
+ },
64427
+ unobserve: (target) => {
64428
+ var _a;
64429
+ return (_a = get()) == null ? void 0 : _a.unobserve(target);
64430
+ }
64431
+ };
64432
+ })();
64433
+ this.range = null;
64434
+ this.setOptions = (opts2) => {
64435
+ Object.entries(opts2).forEach(([key, value]) => {
64436
+ if (typeof value === "undefined")
64437
+ delete opts2[key];
64438
+ });
64439
+ this.options = {
64440
+ debug: false,
64441
+ initialOffset: 0,
64442
+ overscan: 1,
64443
+ paddingStart: 0,
64444
+ paddingEnd: 0,
64445
+ scrollPaddingStart: 0,
64446
+ scrollPaddingEnd: 0,
64447
+ horizontal: false,
64448
+ getItemKey: defaultKeyExtractor,
64449
+ rangeExtractor: defaultRangeExtractor,
64450
+ onChange: () => {
64451
+ },
64452
+ measureElement,
64453
+ initialRect: { width: 0, height: 0 },
64454
+ scrollMargin: 0,
64455
+ scrollingDelay: 150,
64456
+ indexAttribute: "data-index",
64457
+ initialMeasurementsCache: [],
64458
+ lanes: 1,
64459
+ ...opts2
64460
+ };
64461
+ };
64462
+ this.notify = (sync) => {
64463
+ var _a, _b;
64464
+ (_b = (_a = this.options).onChange) == null ? void 0 : _b.call(_a, this, sync);
64465
+ };
64466
+ this.maybeNotify = memo(
64467
+ () => {
64468
+ this.calculateRange();
64469
+ return [
64470
+ this.isScrolling,
64471
+ this.range ? this.range.startIndex : null,
64472
+ this.range ? this.range.endIndex : null
64473
+ ];
64474
+ },
64475
+ (isScrolling) => {
64476
+ this.notify(isScrolling);
64477
+ },
64478
+ {
64479
+ key: "maybeNotify",
64480
+ debug: () => this.options.debug,
64481
+ initialDeps: [
64482
+ this.isScrolling,
64483
+ this.range ? this.range.startIndex : null,
64484
+ this.range ? this.range.endIndex : null
64485
+ ]
64486
+ }
64487
+ );
64488
+ this.cleanup = () => {
64489
+ this.unsubs.filter(Boolean).forEach((d) => d());
64490
+ this.unsubs = [];
64491
+ this.scrollElement = null;
64492
+ };
64493
+ this._didMount = () => {
64494
+ this.measureElementCache.forEach(this.observer.observe);
64495
+ return () => {
64496
+ this.observer.disconnect();
64497
+ this.cleanup();
64498
+ };
64499
+ };
64500
+ this._willUpdate = () => {
64501
+ const scrollElement = this.options.getScrollElement();
64502
+ if (this.scrollElement !== scrollElement) {
64503
+ this.cleanup();
64504
+ this.scrollElement = scrollElement;
64505
+ this._scrollToOffset(this.scrollOffset, {
64506
+ adjustments: void 0,
64507
+ behavior: void 0
64715
64508
  });
64716
- } else {
64717
- return null;
64509
+ this.unsubs.push(
64510
+ this.options.observeElementRect(this, (rect) => {
64511
+ this.scrollRect = rect;
64512
+ this.maybeNotify();
64513
+ })
64514
+ );
64515
+ this.unsubs.push(
64516
+ this.options.observeElementOffset(this, (offset) => {
64517
+ this.scrollAdjustments = 0;
64518
+ if (this.scrollOffset === offset) {
64519
+ return;
64520
+ }
64521
+ if (this.isScrollingTimeoutId !== null) {
64522
+ clearTimeout(this.isScrollingTimeoutId);
64523
+ this.isScrollingTimeoutId = null;
64524
+ }
64525
+ this.isScrolling = true;
64526
+ this.scrollDirection = this.scrollOffset < offset ? "forward" : "backward";
64527
+ this.scrollOffset = offset;
64528
+ this.maybeNotify();
64529
+ this.isScrollingTimeoutId = setTimeout(() => {
64530
+ this.isScrollingTimeoutId = null;
64531
+ this.isScrolling = false;
64532
+ this.scrollDirection = null;
64533
+ this.maybeNotify();
64534
+ }, this.options.scrollingDelay);
64535
+ })
64536
+ );
64718
64537
  }
64719
64538
  };
64720
- return {
64721
- disconnect: function disconnect() {
64722
- var _get;
64723
- return (_get = get()) == null ? void 0 : _get.disconnect();
64539
+ this.getSize = () => {
64540
+ return this.scrollRect[this.options.horizontal ? "width" : "height"];
64541
+ };
64542
+ this.memoOptions = memo(
64543
+ () => [
64544
+ this.options.count,
64545
+ this.options.paddingStart,
64546
+ this.options.scrollMargin,
64547
+ this.options.getItemKey
64548
+ ],
64549
+ (count, paddingStart, scrollMargin, getItemKey) => {
64550
+ this.pendingMeasuredCacheIndexes = [];
64551
+ return {
64552
+ count,
64553
+ paddingStart,
64554
+ scrollMargin,
64555
+ getItemKey
64556
+ };
64557
+ },
64558
+ {
64559
+ key: false
64560
+ }
64561
+ );
64562
+ this.getFurthestMeasurement = (measurements, index) => {
64563
+ const furthestMeasurementsFound = /* @__PURE__ */ new Map();
64564
+ const furthestMeasurements = /* @__PURE__ */ new Map();
64565
+ for (let m = index - 1; m >= 0; m--) {
64566
+ const measurement = measurements[m];
64567
+ if (furthestMeasurementsFound.has(measurement.lane)) {
64568
+ continue;
64569
+ }
64570
+ const previousFurthestMeasurement = furthestMeasurements.get(
64571
+ measurement.lane
64572
+ );
64573
+ if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
64574
+ furthestMeasurements.set(measurement.lane, measurement);
64575
+ } else if (measurement.end < previousFurthestMeasurement.end) {
64576
+ furthestMeasurementsFound.set(measurement.lane, true);
64577
+ }
64578
+ if (furthestMeasurementsFound.size === this.options.lanes) {
64579
+ break;
64580
+ }
64581
+ }
64582
+ return furthestMeasurements.size === this.options.lanes ? Array.from(furthestMeasurements.values()).sort((a, b) => {
64583
+ if (a.end === b.end) {
64584
+ return a.index - b.index;
64585
+ }
64586
+ return a.end - b.end;
64587
+ })[0] : void 0;
64588
+ };
64589
+ this.getMeasurements = memo(
64590
+ () => [this.memoOptions(), this.itemSizeCache],
64591
+ ({ count, paddingStart, scrollMargin, getItemKey }, itemSizeCache) => {
64592
+ const min = this.pendingMeasuredCacheIndexes.length > 0 ? Math.min(...this.pendingMeasuredCacheIndexes) : 0;
64593
+ this.pendingMeasuredCacheIndexes = [];
64594
+ const measurements = this.measurementsCache.slice(0, min);
64595
+ for (let i = min; i < count; i++) {
64596
+ const key = getItemKey(i);
64597
+ const furthestMeasurement = this.options.lanes === 1 ? measurements[i - 1] : this.getFurthestMeasurement(measurements, i);
64598
+ const start = furthestMeasurement ? furthestMeasurement.end : paddingStart + scrollMargin;
64599
+ const measuredSize = itemSizeCache.get(key);
64600
+ const size = typeof measuredSize === "number" ? measuredSize : this.options.estimateSize(i);
64601
+ const end = start + size;
64602
+ const lane = furthestMeasurement ? furthestMeasurement.lane : i % this.options.lanes;
64603
+ measurements[i] = {
64604
+ index: i,
64605
+ start,
64606
+ size,
64607
+ end,
64608
+ key,
64609
+ lane
64610
+ };
64611
+ }
64612
+ this.measurementsCache = measurements;
64613
+ return measurements;
64614
+ },
64615
+ {
64616
+ key: "getMeasurements",
64617
+ debug: () => this.options.debug
64618
+ }
64619
+ );
64620
+ this.calculateRange = memo(
64621
+ () => [this.getMeasurements(), this.getSize(), this.scrollOffset],
64622
+ (measurements, outerSize, scrollOffset) => {
64623
+ return this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
64624
+ measurements,
64625
+ outerSize,
64626
+ scrollOffset
64627
+ }) : null;
64724
64628
  },
64725
- observe: function observe(target) {
64726
- var _get2;
64727
- return (_get2 = get()) == null ? void 0 : _get2.observe(target, {
64728
- box: 'border-box'
64629
+ {
64630
+ key: "calculateRange",
64631
+ debug: () => this.options.debug
64632
+ }
64633
+ );
64634
+ this.getIndexes = memo(
64635
+ () => [
64636
+ this.options.rangeExtractor,
64637
+ this.calculateRange(),
64638
+ this.options.overscan,
64639
+ this.options.count
64640
+ ],
64641
+ (rangeExtractor, range, overscan, count) => {
64642
+ return range === null ? [] : rangeExtractor({
64643
+ ...range,
64644
+ overscan,
64645
+ count
64729
64646
  });
64730
64647
  },
64731
- unobserve: function unobserve(target) {
64732
- var _get3;
64733
- return (_get3 = get()) == null ? void 0 : _get3.unobserve(target);
64648
+ {
64649
+ key: "getIndexes",
64650
+ debug: () => this.options.debug
64651
+ }
64652
+ );
64653
+ this.indexFromElement = (node) => {
64654
+ const attributeName = this.options.indexAttribute;
64655
+ const indexStr = node.getAttribute(attributeName);
64656
+ if (!indexStr) {
64657
+ console.warn(
64658
+ `Missing attribute name '${attributeName}={index}' on measured element.`
64659
+ );
64660
+ return -1;
64734
64661
  }
64662
+ return parseInt(indexStr, 10);
64735
64663
  };
64736
- }();
64737
- this.range = null;
64738
- this.setOptions = function (opts) {
64739
- Object.entries(opts).forEach(function (_ref3) {
64740
- var key = _ref3[0],
64741
- value = _ref3[1];
64742
- if (typeof value === 'undefined') delete opts[key];
64743
- });
64744
- _this.options = _extends({
64745
- debug: false,
64746
- initialOffset: 0,
64747
- overscan: 1,
64748
- paddingStart: 0,
64749
- paddingEnd: 0,
64750
- scrollPaddingStart: 0,
64751
- scrollPaddingEnd: 0,
64752
- horizontal: false,
64753
- getItemKey: defaultKeyExtractor,
64754
- rangeExtractor: defaultRangeExtractor,
64755
- onChange: function onChange() {},
64756
- measureElement: measureElement,
64757
- initialRect: {
64758
- width: 0,
64759
- height: 0
64760
- },
64761
- scrollMargin: 0,
64762
- scrollingDelay: 150,
64763
- indexAttribute: 'data-index',
64764
- initialMeasurementsCache: [],
64765
- lanes: 1
64766
- }, opts);
64767
- };
64768
- this.notify = function (sync) {
64769
- _this.options.onChange == null || _this.options.onChange(_this, sync);
64770
- };
64771
- this.maybeNotify = memo(function () {
64772
- _this.calculateRange();
64773
- return [_this.isScrolling, _this.range ? _this.range.startIndex : null, _this.range ? _this.range.endIndex : null];
64774
- }, function (isScrolling) {
64775
- _this.notify(isScrolling);
64776
- }, {
64777
- key: 'maybeNotify',
64778
- debug: function debug() {
64779
- return _this.options.debug;
64780
- },
64781
- initialDeps: [this.isScrolling, this.range ? this.range.startIndex : null, this.range ? this.range.endIndex : null]
64782
- });
64783
- this.cleanup = function () {
64784
- _this.unsubs.filter(Boolean).forEach(function (d) {
64785
- return d();
64786
- });
64787
- _this.unsubs = [];
64788
- _this.scrollElement = null;
64789
- };
64790
- this._didMount = function () {
64791
- _this.measureElementCache.forEach(_this.observer.observe);
64792
- return function () {
64793
- _this.observer.disconnect();
64794
- _this.cleanup();
64664
+ this._measureElement = (node, entry) => {
64665
+ const item = this.measurementsCache[this.indexFromElement(node)];
64666
+ if (!item || !node.isConnected) {
64667
+ this.measureElementCache.forEach((cached, key) => {
64668
+ if (cached === node) {
64669
+ this.observer.unobserve(node);
64670
+ this.measureElementCache.delete(key);
64671
+ }
64672
+ });
64673
+ return;
64674
+ }
64675
+ const prevNode = this.measureElementCache.get(item.key);
64676
+ if (prevNode !== node) {
64677
+ if (prevNode) {
64678
+ this.observer.unobserve(prevNode);
64679
+ }
64680
+ this.observer.observe(node);
64681
+ this.measureElementCache.set(item.key, node);
64682
+ }
64683
+ const measuredItemSize = this.options.measureElement(node, entry, this);
64684
+ this.resizeItem(item, measuredItemSize);
64795
64685
  };
64796
- };
64797
- this._willUpdate = function () {
64798
- var scrollElement = _this.options.getScrollElement();
64799
- if (_this.scrollElement !== scrollElement) {
64800
- _this.cleanup();
64801
- _this.scrollElement = scrollElement;
64802
- _this._scrollToOffset(_this.scrollOffset, {
64803
- adjustments: undefined,
64804
- behavior: undefined
64805
- });
64806
- _this.unsubs.push(_this.options.observeElementRect(_this, function (rect) {
64807
- _this.scrollRect = rect;
64808
- _this.maybeNotify();
64809
- }));
64810
- _this.unsubs.push(_this.options.observeElementOffset(_this, function (offset) {
64811
- _this.scrollAdjustments = 0;
64812
- if (_this.scrollOffset === offset) {
64813
- return;
64686
+ this.resizeItem = (item, size) => {
64687
+ const itemSize = this.itemSizeCache.get(item.key) ?? item.size;
64688
+ const delta = size - itemSize;
64689
+ if (delta !== 0) {
64690
+ if (item.start < this.scrollOffset + this.scrollAdjustments) {
64691
+ if (this.options.debug) {
64692
+ console.info("correction", delta);
64693
+ }
64694
+ this._scrollToOffset(this.scrollOffset, {
64695
+ adjustments: this.scrollAdjustments += delta,
64696
+ behavior: void 0
64697
+ });
64814
64698
  }
64815
- if (_this.isScrollingTimeoutId !== null) {
64816
- clearTimeout(_this.isScrollingTimeoutId);
64817
- _this.isScrollingTimeoutId = null;
64818
- }
64819
- _this.isScrolling = true;
64820
- _this.scrollDirection = _this.scrollOffset < offset ? 'forward' : 'backward';
64821
- _this.scrollOffset = offset;
64822
- _this.maybeNotify();
64823
- _this.isScrollingTimeoutId = setTimeout(function () {
64824
- _this.isScrollingTimeoutId = null;
64825
- _this.isScrolling = false;
64826
- _this.scrollDirection = null;
64827
- _this.maybeNotify();
64828
- }, _this.options.scrollingDelay);
64829
- }));
64830
- }
64831
- };
64832
- this.getSize = function () {
64833
- return _this.scrollRect[_this.options.horizontal ? 'width' : 'height'];
64834
- };
64835
- this.memoOptions = memo(function () {
64836
- return [_this.options.count, _this.options.paddingStart, _this.options.scrollMargin, _this.options.getItemKey];
64837
- }, function (count, paddingStart, scrollMargin, getItemKey) {
64838
- _this.pendingMeasuredCacheIndexes = [];
64839
- return {
64840
- count: count,
64841
- paddingStart: paddingStart,
64842
- scrollMargin: scrollMargin,
64843
- getItemKey: getItemKey
64699
+ this.pendingMeasuredCacheIndexes.push(item.index);
64700
+ this.itemSizeCache = new Map(this.itemSizeCache.set(item.key, size));
64701
+ this.notify(false);
64702
+ }
64844
64703
  };
64845
- }, {
64846
- key: false
64847
- });
64848
- this.getFurthestMeasurement = function (measurements, index) {
64849
- var furthestMeasurementsFound = new Map();
64850
- var furthestMeasurements = new Map();
64851
- for (var m = index - 1; m >= 0; m--) {
64852
- var measurement = measurements[m];
64853
- if (furthestMeasurementsFound.has(measurement.lane)) {
64854
- continue;
64704
+ this.measureElement = (node) => {
64705
+ if (!node) {
64706
+ return;
64855
64707
  }
64856
- var previousFurthestMeasurement = furthestMeasurements.get(measurement.lane);
64857
- if (previousFurthestMeasurement == null || measurement.end > previousFurthestMeasurement.end) {
64858
- furthestMeasurements.set(measurement.lane, measurement);
64859
- } else if (measurement.end < previousFurthestMeasurement.end) {
64860
- furthestMeasurementsFound.set(measurement.lane, true);
64708
+ this._measureElement(node, void 0);
64709
+ };
64710
+ this.getVirtualItems = memo(
64711
+ () => [this.getIndexes(), this.getMeasurements()],
64712
+ (indexes, measurements) => {
64713
+ const virtualItems = [];
64714
+ for (let k = 0, len = indexes.length; k < len; k++) {
64715
+ const i = indexes[k];
64716
+ const measurement = measurements[i];
64717
+ virtualItems.push(measurement);
64718
+ }
64719
+ return virtualItems;
64720
+ },
64721
+ {
64722
+ key: "getIndexes",
64723
+ debug: () => this.options.debug
64861
64724
  }
64862
- if (furthestMeasurementsFound.size === _this.options.lanes) {
64863
- break;
64725
+ );
64726
+ this.getVirtualItemForOffset = (offset) => {
64727
+ const measurements = this.getMeasurements();
64728
+ return notUndefined(
64729
+ measurements[findNearestBinarySearch(
64730
+ 0,
64731
+ measurements.length - 1,
64732
+ (index) => notUndefined(measurements[index]).start,
64733
+ offset
64734
+ )]
64735
+ );
64736
+ };
64737
+ this.getOffsetForAlignment = (toOffset, align) => {
64738
+ const size = this.getSize();
64739
+ if (align === "auto") {
64740
+ if (toOffset <= this.scrollOffset) {
64741
+ align = "start";
64742
+ } else if (toOffset >= this.scrollOffset + size) {
64743
+ align = "end";
64744
+ } else {
64745
+ align = "start";
64746
+ }
64864
64747
  }
64865
- }
64866
- return furthestMeasurements.size === _this.options.lanes ? Array.from(furthestMeasurements.values()).sort(function (a, b) {
64867
- if (a.end === b.end) {
64868
- return a.index - b.index;
64748
+ if (align === "start") {
64749
+ toOffset = toOffset;
64750
+ } else if (align === "end") {
64751
+ toOffset = toOffset - size;
64752
+ } else if (align === "center") {
64753
+ toOffset = toOffset - size / 2;
64869
64754
  }
64870
- return a.end - b.end;
64871
- })[0] : undefined;
64872
- };
64873
- this.getMeasurements = memo(function () {
64874
- return [_this.memoOptions(), _this.itemSizeCache];
64875
- }, function (_ref4, itemSizeCache) {
64876
- var count = _ref4.count,
64877
- paddingStart = _ref4.paddingStart,
64878
- scrollMargin = _ref4.scrollMargin,
64879
- getItemKey = _ref4.getItemKey;
64880
- var min = _this.pendingMeasuredCacheIndexes.length > 0 ? Math.min.apply(Math, _this.pendingMeasuredCacheIndexes) : 0;
64881
- _this.pendingMeasuredCacheIndexes = [];
64882
- var measurements = _this.measurementsCache.slice(0, min);
64883
- for (var _i2 = min; _i2 < count; _i2++) {
64884
- var key = getItemKey(_i2);
64885
- var furthestMeasurement = _this.options.lanes === 1 ? measurements[_i2 - 1] : _this.getFurthestMeasurement(measurements, _i2);
64886
- var start = furthestMeasurement ? furthestMeasurement.end : paddingStart + scrollMargin;
64887
- var measuredSize = itemSizeCache.get(key);
64888
- var size = typeof measuredSize === 'number' ? measuredSize : _this.options.estimateSize(_i2);
64889
- var end = start + size;
64890
- var lane = furthestMeasurement ? furthestMeasurement.lane : _i2 % _this.options.lanes;
64891
- measurements[_i2] = {
64892
- index: _i2,
64893
- start: start,
64894
- size: size,
64895
- end: end,
64896
- key: key,
64897
- lane: lane
64898
- };
64899
- }
64900
- _this.measurementsCache = measurements;
64901
- return measurements;
64902
- }, {
64903
- key: 'getMeasurements',
64904
- debug: function debug() {
64905
- return _this.options.debug;
64906
- }
64907
- });
64908
- this.calculateRange = memo(function () {
64909
- return [_this.getMeasurements(), _this.getSize(), _this.scrollOffset];
64910
- }, function (measurements, outerSize, scrollOffset) {
64911
- return _this.range = measurements.length > 0 && outerSize > 0 ? calculateRange({
64912
- measurements: measurements,
64913
- outerSize: outerSize,
64914
- scrollOffset: scrollOffset
64915
- }) : null;
64916
- }, {
64917
- key: 'calculateRange',
64918
- debug: function debug() {
64919
- return _this.options.debug;
64920
- }
64921
- });
64922
- this.getIndexes = memo(function () {
64923
- return [_this.options.rangeExtractor, _this.calculateRange(), _this.options.overscan, _this.options.count];
64924
- }, function (rangeExtractor, range, overscan, count) {
64925
- return range === null ? [] : rangeExtractor(_extends({}, range, {
64926
- overscan: overscan,
64927
- count: count
64928
- }));
64929
- }, {
64930
- key: 'getIndexes',
64931
- debug: function debug() {
64932
- return _this.options.debug;
64933
- }
64934
- });
64935
- this.indexFromElement = function (node) {
64936
- var attributeName = _this.options.indexAttribute;
64937
- var indexStr = node.getAttribute(attributeName);
64938
- if (!indexStr) {
64939
- console.warn("Missing attribute name '" + attributeName + "={index}' on measured element.");
64940
- return -1;
64941
- }
64942
- return parseInt(indexStr, 10);
64943
- };
64944
- this._measureElement = function (node, entry) {
64945
- var item = _this.measurementsCache[_this.indexFromElement(node)];
64946
- if (!item || !node.isConnected) {
64947
- _this.measureElementCache.forEach(function (cached, key) {
64948
- if (cached === node) {
64949
- _this.observer.unobserve(node);
64950
- _this.measureElementCache["delete"](key);
64755
+ const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
64756
+ const scrollSize = this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[scrollSizeProp] : this.scrollElement[scrollSizeProp] : 0;
64757
+ const maxOffset = scrollSize - this.getSize();
64758
+ return Math.max(Math.min(maxOffset, toOffset), 0);
64759
+ };
64760
+ this.getOffsetForIndex = (index, align = "auto") => {
64761
+ index = Math.max(0, Math.min(index, this.options.count - 1));
64762
+ const measurement = notUndefined(this.getMeasurements()[index]);
64763
+ if (align === "auto") {
64764
+ if (measurement.end >= this.scrollOffset + this.getSize() - this.options.scrollPaddingEnd) {
64765
+ align = "end";
64766
+ } else if (measurement.start <= this.scrollOffset + this.options.scrollPaddingStart) {
64767
+ align = "start";
64768
+ } else {
64769
+ return [this.scrollOffset, align];
64951
64770
  }
64771
+ }
64772
+ const toOffset = align === "end" ? measurement.end + this.options.scrollPaddingEnd : measurement.start - this.options.scrollPaddingStart;
64773
+ return [this.getOffsetForAlignment(toOffset, align), align];
64774
+ };
64775
+ this.isDynamicMode = () => this.measureElementCache.size > 0;
64776
+ this.cancelScrollToIndex = () => {
64777
+ if (this.scrollToIndexTimeoutId !== null) {
64778
+ clearTimeout(this.scrollToIndexTimeoutId);
64779
+ this.scrollToIndexTimeoutId = null;
64780
+ }
64781
+ };
64782
+ this.scrollToOffset = (toOffset, { align = "start", behavior } = {}) => {
64783
+ this.cancelScrollToIndex();
64784
+ if (behavior === "smooth" && this.isDynamicMode()) {
64785
+ console.warn(
64786
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
64787
+ );
64788
+ }
64789
+ this._scrollToOffset(this.getOffsetForAlignment(toOffset, align), {
64790
+ adjustments: void 0,
64791
+ behavior
64952
64792
  });
64953
- return;
64954
- }
64955
- var prevNode = _this.measureElementCache.get(item.key);
64956
- if (prevNode !== node) {
64957
- if (prevNode) {
64958
- _this.observer.unobserve(prevNode);
64793
+ };
64794
+ this.scrollToIndex = (index, { align: initialAlign = "auto", behavior } = {}) => {
64795
+ index = Math.max(0, Math.min(index, this.options.count - 1));
64796
+ this.cancelScrollToIndex();
64797
+ if (behavior === "smooth" && this.isDynamicMode()) {
64798
+ console.warn(
64799
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
64800
+ );
64959
64801
  }
64960
- _this.observer.observe(node);
64961
- _this.measureElementCache.set(item.key, node);
64962
- }
64963
- var measuredItemSize = _this.options.measureElement(node, entry, _this);
64964
- _this.resizeItem(item, measuredItemSize);
64965
- };
64966
- this.resizeItem = function (item, size) {
64967
- var _this$itemSizeCache$g;
64968
- var itemSize = (_this$itemSizeCache$g = _this.itemSizeCache.get(item.key)) != null ? _this$itemSizeCache$g : item.size;
64969
- var delta = size - itemSize;
64970
- if (delta !== 0) {
64971
- if (item.start < _this.scrollOffset + _this.scrollAdjustments) {
64972
- if (_this.options.debug) {
64973
- console.info('correction', delta);
64974
- }
64975
- _this._scrollToOffset(_this.scrollOffset, {
64976
- adjustments: _this.scrollAdjustments += delta,
64977
- behavior: undefined
64802
+ const [toOffset, align] = this.getOffsetForIndex(index, initialAlign);
64803
+ this._scrollToOffset(toOffset, { adjustments: void 0, behavior });
64804
+ if (behavior !== "smooth" && this.isDynamicMode()) {
64805
+ this.scrollToIndexTimeoutId = setTimeout(() => {
64806
+ this.scrollToIndexTimeoutId = null;
64807
+ const elementInDOM = this.measureElementCache.has(
64808
+ this.options.getItemKey(index)
64809
+ );
64810
+ if (elementInDOM) {
64811
+ const [toOffset2] = this.getOffsetForIndex(index, align);
64812
+ if (!approxEqual(toOffset2, this.scrollOffset)) {
64813
+ this.scrollToIndex(index, { align, behavior });
64814
+ }
64815
+ } else {
64816
+ this.scrollToIndex(index, { align, behavior });
64817
+ }
64978
64818
  });
64979
64819
  }
64980
- _this.pendingMeasuredCacheIndexes.push(item.index);
64981
- _this.itemSizeCache = new Map(_this.itemSizeCache.set(item.key, size));
64982
- _this.notify(false);
64983
- }
64984
- };
64985
- this.measureElement = function (node) {
64986
- if (!node) {
64987
- return;
64988
- }
64989
- _this._measureElement(node, undefined);
64990
- };
64991
- this.getVirtualItems = memo(function () {
64992
- return [_this.getIndexes(), _this.getMeasurements()];
64993
- }, function (indexes, measurements) {
64994
- var virtualItems = [];
64995
- for (var k = 0, len = indexes.length; k < len; k++) {
64996
- var _i3 = indexes[k];
64997
- var measurement = measurements[_i3];
64998
- virtualItems.push(measurement);
64999
- }
65000
- return virtualItems;
65001
- }, {
65002
- key: 'getIndexes',
65003
- debug: function debug() {
65004
- return _this.options.debug;
65005
- }
65006
- });
65007
- this.getVirtualItemForOffset = function (offset) {
65008
- var measurements = _this.getMeasurements();
65009
- return notUndefined(measurements[findNearestBinarySearch(0, measurements.length - 1, function (index) {
65010
- return notUndefined(measurements[index]).start;
65011
- }, offset)]);
65012
- };
65013
- this.getOffsetForAlignment = function (toOffset, align) {
65014
- var size = _this.getSize();
65015
- if (align === 'auto') {
65016
- if (toOffset <= _this.scrollOffset) {
65017
- align = 'start';
65018
- } else if (toOffset >= _this.scrollOffset + size) {
65019
- align = 'end';
65020
- } else {
65021
- align = 'start';
64820
+ };
64821
+ this.scrollBy = (delta, { behavior } = {}) => {
64822
+ this.cancelScrollToIndex();
64823
+ if (behavior === "smooth" && this.isDynamicMode()) {
64824
+ console.warn(
64825
+ "The `smooth` scroll behavior is not fully supported with dynamic size."
64826
+ );
65022
64827
  }
65023
- }
65024
- if (align === 'start') {
65025
- toOffset = toOffset;
65026
- } else if (align === 'end') {
65027
- toOffset = toOffset - size;
65028
- } else if (align === 'center') {
65029
- toOffset = toOffset - size / 2;
65030
- }
65031
- var scrollSizeProp = _this.options.horizontal ? 'scrollWidth' : 'scrollHeight';
65032
- var scrollSize = _this.scrollElement ? 'document' in _this.scrollElement ? _this.scrollElement.document.documentElement[scrollSizeProp] : _this.scrollElement[scrollSizeProp] : 0;
65033
- var maxOffset = scrollSize - _this.getSize();
65034
- return Math.max(Math.min(maxOffset, toOffset), 0);
65035
- };
65036
- this.getOffsetForIndex = function (index, align) {
65037
- if (align === void 0) {
65038
- align = 'auto';
65039
- }
65040
- index = Math.max(0, Math.min(index, _this.options.count - 1));
65041
- var measurement = notUndefined(_this.getMeasurements()[index]);
65042
- if (align === 'auto') {
65043
- if (measurement.end >= _this.scrollOffset + _this.getSize() - _this.options.scrollPaddingEnd) {
65044
- align = 'end';
65045
- } else if (measurement.start <= _this.scrollOffset + _this.options.scrollPaddingStart) {
65046
- align = 'start';
64828
+ this._scrollToOffset(this.scrollOffset + delta, {
64829
+ adjustments: void 0,
64830
+ behavior
64831
+ });
64832
+ };
64833
+ this.getTotalSize = () => {
64834
+ var _a;
64835
+ const measurements = this.getMeasurements();
64836
+ let end;
64837
+ if (measurements.length === 0) {
64838
+ end = this.options.paddingStart;
65047
64839
  } else {
65048
- return [_this.scrollOffset, align];
64840
+ end = this.options.lanes === 1 ? ((_a = measurements[measurements.length - 1]) == null ? void 0 : _a.end) ?? 0 : Math.max(
64841
+ ...measurements.slice(-this.options.lanes).map((m) => m.end)
64842
+ );
65049
64843
  }
65050
- }
65051
- var toOffset = align === 'end' ? measurement.end + _this.options.scrollPaddingEnd : measurement.start - _this.options.scrollPaddingStart;
65052
- return [_this.getOffsetForAlignment(toOffset, align), align];
65053
- };
65054
- this.isDynamicMode = function () {
65055
- return _this.measureElementCache.size > 0;
65056
- };
65057
- this.cancelScrollToIndex = function () {
65058
- if (_this.scrollToIndexTimeoutId !== null) {
65059
- clearTimeout(_this.scrollToIndexTimeoutId);
65060
- _this.scrollToIndexTimeoutId = null;
65061
- }
65062
- };
65063
- this.scrollToOffset = function (toOffset, _temp) {
65064
- var _ref5 = _temp === void 0 ? {} : _temp,
65065
- _ref5$align = _ref5.align,
65066
- align = _ref5$align === void 0 ? 'start' : _ref5$align,
65067
- behavior = _ref5.behavior;
65068
- _this.cancelScrollToIndex();
65069
- if (behavior === 'smooth' && _this.isDynamicMode()) {
65070
- console.warn('The `smooth` scroll behavior is not fully supported with dynamic size.');
65071
- }
65072
- _this._scrollToOffset(_this.getOffsetForAlignment(toOffset, align), {
65073
- adjustments: undefined,
65074
- behavior: behavior
65075
- });
65076
- };
65077
- this.scrollToIndex = function (index, _temp2) {
65078
- var _ref6 = _temp2 === void 0 ? {} : _temp2,
65079
- _ref6$align = _ref6.align,
65080
- initialAlign = _ref6$align === void 0 ? 'auto' : _ref6$align,
65081
- behavior = _ref6.behavior;
65082
- index = Math.max(0, Math.min(index, _this.options.count - 1));
65083
- _this.cancelScrollToIndex();
65084
- if (behavior === 'smooth' && _this.isDynamicMode()) {
65085
- console.warn('The `smooth` scroll behavior is not fully supported with dynamic size.');
65086
- }
65087
- var _this$getOffsetForInd = _this.getOffsetForIndex(index, initialAlign),
65088
- toOffset = _this$getOffsetForInd[0],
65089
- align = _this$getOffsetForInd[1];
65090
- _this._scrollToOffset(toOffset, {
65091
- adjustments: undefined,
65092
- behavior: behavior
65093
- });
65094
- if (behavior !== 'smooth' && _this.isDynamicMode()) {
65095
- _this.scrollToIndexTimeoutId = setTimeout(function () {
65096
- _this.scrollToIndexTimeoutId = null;
65097
- var elementInDOM = _this.measureElementCache.has(_this.options.getItemKey(index));
65098
- if (elementInDOM) {
65099
- var _this$getOffsetForInd2 = _this.getOffsetForIndex(index, align),
65100
- _toOffset = _this$getOffsetForInd2[0];
65101
- if (!approxEqual(_toOffset, _this.scrollOffset)) {
65102
- _this.scrollToIndex(index, {
65103
- align: align,
65104
- behavior: behavior
65105
- });
65106
- }
65107
- } else {
65108
- _this.scrollToIndex(index, {
65109
- align: align,
65110
- behavior: behavior
65111
- });
65112
- }
65113
- });
65114
- }
65115
- };
65116
- this.scrollBy = function (delta, _temp3) {
65117
- var _ref7 = _temp3 === void 0 ? {} : _temp3,
65118
- behavior = _ref7.behavior;
65119
- _this.cancelScrollToIndex();
65120
- if (behavior === 'smooth' && _this.isDynamicMode()) {
65121
- console.warn('The `smooth` scroll behavior is not fully supported with dynamic size.');
65122
- }
65123
- _this._scrollToOffset(_this.scrollOffset + delta, {
65124
- adjustments: undefined,
65125
- behavior: behavior
64844
+ return end - this.options.scrollMargin + this.options.paddingEnd;
64845
+ };
64846
+ this._scrollToOffset = (offset, {
64847
+ adjustments,
64848
+ behavior
64849
+ }) => {
64850
+ this.options.scrollToFn(offset, { behavior, adjustments }, this);
64851
+ };
64852
+ this.measure = () => {
64853
+ this.itemSizeCache = /* @__PURE__ */ new Map();
64854
+ this.notify(false);
64855
+ };
64856
+ this.setOptions(opts);
64857
+ this.scrollRect = this.options.initialRect;
64858
+ this.scrollOffset = this.options.initialOffset;
64859
+ this.measurementsCache = this.options.initialMeasurementsCache;
64860
+ this.measurementsCache.forEach((item) => {
64861
+ this.itemSizeCache.set(item.key, item.size);
65126
64862
  });
65127
- };
65128
- this.getTotalSize = function () {
65129
- var measurements = _this.getMeasurements();
65130
- var end;
65131
- // If there are no measurements, set the end to paddingStart
65132
- if (measurements.length === 0) {
65133
- end = _this.options.paddingStart;
65134
- } else {
65135
- var _measurements$end, _measurements;
65136
- // If lanes is 1, use the last measurement's end, otherwise find the maximum end value among all measurements
65137
- end = _this.options.lanes === 1 ? (_measurements$end = (_measurements = measurements[measurements.length - 1]) == null ? void 0 : _measurements.end) != null ? _measurements$end : 0 : Math.max.apply(Math, measurements.slice(-_this.options.lanes).map(function (m) {
65138
- return m.end;
65139
- }));
65140
- }
65141
- return end - _this.options.scrollMargin + _this.options.paddingEnd;
65142
- };
65143
- this._scrollToOffset = function (offset, _ref8) {
65144
- var adjustments = _ref8.adjustments,
65145
- behavior = _ref8.behavior;
65146
- _this.options.scrollToFn(offset, {
65147
- behavior: behavior,
65148
- adjustments: adjustments
65149
- }, _this);
65150
- };
65151
- this.measure = function () {
65152
- _this.itemSizeCache = new Map();
65153
- _this.notify(false);
65154
- };
65155
- this.setOptions(_opts);
65156
- this.scrollRect = this.options.initialRect;
65157
- this.scrollOffset = this.options.initialOffset;
65158
- this.measurementsCache = this.options.initialMeasurementsCache;
65159
- this.measurementsCache.forEach(function (item) {
65160
- _this.itemSizeCache.set(item.key, item.size);
65161
- });
65162
- this.maybeNotify();
64863
+ this.maybeNotify();
64864
+ }
65163
64865
  };
65164
- var findNearestBinarySearch = function findNearestBinarySearch(low, high, getCurrentValue, value) {
64866
+ const findNearestBinarySearch = (low, high, getCurrentValue, value) => {
65165
64867
  while (low <= high) {
65166
- var middle = (low + high) / 2 | 0;
65167
- var currentValue = getCurrentValue(middle);
64868
+ const middle = (low + high) / 2 | 0;
64869
+ const currentValue = getCurrentValue(middle);
65168
64870
  if (currentValue < value) {
65169
64871
  low = middle + 1;
65170
64872
  } else if (currentValue > value) {
@@ -65179,23 +64881,19 @@ img.ProseMirror-separator {
65179
64881
  return 0;
65180
64882
  }
65181
64883
  };
65182
- function calculateRange(_ref9) {
65183
- var measurements = _ref9.measurements,
65184
- outerSize = _ref9.outerSize,
65185
- scrollOffset = _ref9.scrollOffset;
65186
- var count = measurements.length - 1;
65187
- var getOffset = function getOffset(index) {
65188
- return measurements[index].start;
65189
- };
65190
- var startIndex = findNearestBinarySearch(0, count, getOffset, scrollOffset);
65191
- var endIndex = startIndex;
64884
+ function calculateRange({
64885
+ measurements,
64886
+ outerSize,
64887
+ scrollOffset
64888
+ }) {
64889
+ const count = measurements.length - 1;
64890
+ const getOffset = (index) => measurements[index].start;
64891
+ const startIndex = findNearestBinarySearch(0, count, getOffset, scrollOffset);
64892
+ let endIndex = startIndex;
65192
64893
  while (endIndex < count && measurements[endIndex].end < scrollOffset + outerSize) {
65193
64894
  endIndex++;
65194
64895
  }
65195
- return {
65196
- startIndex: startIndex,
65197
- endIndex: endIndex
65198
- };
64896
+ return { startIndex, endIndex };
65199
64897
  }
65200
64898
 
65201
64899
  /**
@@ -68982,6 +68680,10 @@ img.ProseMirror-separator {
68982
68680
  static isSupportedMappingElement(mapping) {
68983
68681
  return (mapping instanceof MappingIcon || mapping instanceof MappingSpinner);
68984
68682
  }
68683
+ static hasUnresolvedIcon(mappingIcon) {
68684
+ return (typeof mappingIcon.icon === 'string'
68685
+ && mappingIcon.resolvedIcon === undefined);
68686
+ }
68985
68687
  validate(mappings, keyType) {
68986
68688
  super.validate(mappings, keyType);
68987
68689
  this.validateMappingTypes(mappings);
@@ -68991,7 +68693,7 @@ img.ProseMirror-separator {
68991
68693
  validateIconNames(mappings) {
68992
68694
  const invalid = mappings
68993
68695
  .filter(TableColumnIconValidator.isIconMappingElement)
68994
- .some(mappingIcon => mappingIcon.resolvedIcon === undefined);
68696
+ .some(TableColumnIconValidator.hasUnresolvedIcon);
68995
68697
  this.setConditionValue('invalidIconName', invalid);
68996
68698
  }
68997
68699
  validateNoMissingText(mappings) {
@@ -69049,15 +68751,25 @@ img.ProseMirror-separator {
69049
68751
  `)}
69050
68752
  `;
69051
68753
 
69052
- const createIconTemplate = (icon) => html `
69053
- <${icon}
69054
- title="${x => x.text}"
69055
- role="img"
69056
- aria-label="${x => x.text}"
69057
- severity="${x => x.severity}"
69058
- class="no-shrink"
69059
- >
69060
- </${icon}>`;
68754
+ // Create an empty template containing only a space because creating a ViewTemplate
68755
+ // with an empty string throws an exception at runtime.
68756
+ // prettier-ignore
68757
+ const emptyTemplate = html ` `;
68758
+ const createIconTemplate = (icon) => {
68759
+ if (icon === undefined) {
68760
+ return emptyTemplate;
68761
+ }
68762
+ return html `
68763
+ <${icon}
68764
+ title="${x => x.text}"
68765
+ role="img"
68766
+ aria-label="${x => x.text}"
68767
+ severity="${x => x.severity}"
68768
+ class="no-shrink"
68769
+ >
68770
+ </${icon}>
68771
+ `;
68772
+ };
69061
68773
  /**
69062
68774
  * Mapping configuration corresponding to a icon mapping
69063
68775
  */
@@ -69215,9 +68927,6 @@ img.ProseMirror-separator {
69215
68927
  }
69216
68928
  createMappingConfig(mapping) {
69217
68929
  if (mapping instanceof MappingIcon) {
69218
- if (!mapping.resolvedIcon) {
69219
- throw Error('Unresolved icon');
69220
- }
69221
68930
  return new MappingIconConfig(mapping.resolvedIcon, mapping.severity, mapping.text);
69222
68931
  }
69223
68932
  if (mapping instanceof MappingSpinner) {