@deephaven/grid 1.22.1-alpha-pivot-builder.0 → 1.22.2-alpha-pivot-builder.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/CellInputField.js +41 -22
  2. package/dist/CellInputField.js.map +1 -1
  3. package/dist/CellRenderer.js +19 -27
  4. package/dist/CellRenderer.js.map +1 -1
  5. package/dist/DataBarCellRenderer.js +61 -87
  6. package/dist/DataBarCellRenderer.js.map +1 -1
  7. package/dist/Grid.js +281 -455
  8. package/dist/Grid.js.map +1 -1
  9. package/dist/GridColorUtils.js +23 -21
  10. package/dist/GridColorUtils.js.map +1 -1
  11. package/dist/GridMetricCalculator.js +192 -303
  12. package/dist/GridMetricCalculator.js.map +1 -1
  13. package/dist/GridRange.js +18 -28
  14. package/dist/GridRange.js.map +1 -1
  15. package/dist/GridRenderer.d.ts.map +1 -1
  16. package/dist/GridRenderer.js +432 -604
  17. package/dist/GridRenderer.js.map +1 -1
  18. package/dist/GridUtils.d.ts +33 -16
  19. package/dist/GridUtils.d.ts.map +1 -1
  20. package/dist/GridUtils.js +183 -213
  21. package/dist/GridUtils.js.map +1 -1
  22. package/dist/MockGridModel.js +17 -10
  23. package/dist/MockGridModel.js.map +1 -1
  24. package/dist/MockTreeGridModel.js +36 -31
  25. package/dist/MockTreeGridModel.js.map +1 -1
  26. package/dist/TextCellRenderer.js +36 -57
  27. package/dist/TextCellRenderer.js.map +1 -1
  28. package/dist/key-handlers/EditKeyHandler.js +4 -7
  29. package/dist/key-handlers/EditKeyHandler.js.map +1 -1
  30. package/dist/key-handlers/PasteKeyHandler.js +1 -3
  31. package/dist/key-handlers/PasteKeyHandler.js.map +1 -1
  32. package/dist/key-handlers/SelectionKeyHandler.js +40 -71
  33. package/dist/key-handlers/SelectionKeyHandler.js.map +1 -1
  34. package/dist/key-handlers/TreeKeyHandler.js +4 -10
  35. package/dist/key-handlers/TreeKeyHandler.js.map +1 -1
  36. package/dist/mouse-handlers/EditMouseHandler.js +3 -7
  37. package/dist/mouse-handlers/EditMouseHandler.js.map +1 -1
  38. package/dist/mouse-handlers/GridColumnMoveMouseHandler.js +54 -82
  39. package/dist/mouse-handlers/GridColumnMoveMouseHandler.js.map +1 -1
  40. package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js +4 -8
  41. package/dist/mouse-handlers/GridColumnSeparatorMouseHandler.js.map +1 -1
  42. package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js +31 -55
  43. package/dist/mouse-handlers/GridHorizontalScrollBarMouseHandler.js.map +1 -1
  44. package/dist/mouse-handlers/GridRowMoveMouseHandler.js +26 -46
  45. package/dist/mouse-handlers/GridRowMoveMouseHandler.js.map +1 -1
  46. package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js +2 -4
  47. package/dist/mouse-handlers/GridRowSeparatorMouseHandler.js.map +1 -1
  48. package/dist/mouse-handlers/GridRowTreeMouseHandler.js +14 -22
  49. package/dist/mouse-handlers/GridRowTreeMouseHandler.js.map +1 -1
  50. package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js +8 -16
  51. package/dist/mouse-handlers/GridScrollBarCornerMouseHandler.js.map +1 -1
  52. package/dist/mouse-handlers/GridSelectionMouseHandler.js +47 -75
  53. package/dist/mouse-handlers/GridSelectionMouseHandler.js.map +1 -1
  54. package/dist/mouse-handlers/GridSeparatorMouseHandler.js +9 -23
  55. package/dist/mouse-handlers/GridSeparatorMouseHandler.js.map +1 -1
  56. package/dist/mouse-handlers/GridTokenMouseHandler.js +24 -39
  57. package/dist/mouse-handlers/GridTokenMouseHandler.js.map +1 -1
  58. package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js +31 -55
  59. package/dist/mouse-handlers/GridVerticalScrollBarMouseHandler.js.map +1 -1
  60. package/package.json +3 -3
@@ -1,3 +1,9 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
1
7
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
8
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
9
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
@@ -58,23 +64,37 @@ export function getFloatingCoordinates(startCount, endCount, totalCount, max, si
58
64
  */
59
65
  export class GridMetricCalculator {
60
66
  constructor() {
61
- var {
62
- userColumnWidths = new Map(),
63
- userRowHeights = new Map(),
64
- calculatedColumnWidths = new Map(),
65
- calculatedRowHeights = new Map(),
66
- contentColumnWidths = new Map(),
67
- contentRowHeights = new Map(),
68
- fontWidthsLower = new Map(),
69
- fontWidthsUpper = new Map(),
70
- allCharWidths = new Map(),
71
- modelRows = new Map(),
72
- modelColumns = new Map(),
73
- movedRows = [],
74
- movedColumns = [],
75
- initialRowHeights = new Map(),
76
- initialColumnWidths = new Map()
77
- } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
67
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
68
+ _ref$userColumnWidths = _ref.userColumnWidths,
69
+ userColumnWidths = _ref$userColumnWidths === void 0 ? new Map() : _ref$userColumnWidths,
70
+ _ref$userRowHeights = _ref.userRowHeights,
71
+ userRowHeights = _ref$userRowHeights === void 0 ? new Map() : _ref$userRowHeights,
72
+ _ref$calculatedColumn = _ref.calculatedColumnWidths,
73
+ calculatedColumnWidths = _ref$calculatedColumn === void 0 ? new Map() : _ref$calculatedColumn,
74
+ _ref$calculatedRowHei = _ref.calculatedRowHeights,
75
+ calculatedRowHeights = _ref$calculatedRowHei === void 0 ? new Map() : _ref$calculatedRowHei,
76
+ _ref$contentColumnWid = _ref.contentColumnWidths,
77
+ contentColumnWidths = _ref$contentColumnWid === void 0 ? new Map() : _ref$contentColumnWid,
78
+ _ref$contentRowHeight = _ref.contentRowHeights,
79
+ contentRowHeights = _ref$contentRowHeight === void 0 ? new Map() : _ref$contentRowHeight,
80
+ _ref$fontWidthsLower = _ref.fontWidthsLower,
81
+ fontWidthsLower = _ref$fontWidthsLower === void 0 ? new Map() : _ref$fontWidthsLower,
82
+ _ref$fontWidthsUpper = _ref.fontWidthsUpper,
83
+ fontWidthsUpper = _ref$fontWidthsUpper === void 0 ? new Map() : _ref$fontWidthsUpper,
84
+ _ref$allCharWidths = _ref.allCharWidths,
85
+ allCharWidths = _ref$allCharWidths === void 0 ? new Map() : _ref$allCharWidths,
86
+ _ref$modelRows = _ref.modelRows,
87
+ modelRows = _ref$modelRows === void 0 ? new Map() : _ref$modelRows,
88
+ _ref$modelColumns = _ref.modelColumns,
89
+ modelColumns = _ref$modelColumns === void 0 ? new Map() : _ref$modelColumns,
90
+ _ref$movedRows = _ref.movedRows,
91
+ movedRows = _ref$movedRows === void 0 ? [] : _ref$movedRows,
92
+ _ref$movedColumns = _ref.movedColumns,
93
+ movedColumns = _ref$movedColumns === void 0 ? [] : _ref$movedColumns,
94
+ _ref$initialRowHeight = _ref.initialRowHeights,
95
+ initialRowHeights = _ref$initialRowHeight === void 0 ? new Map() : _ref$initialRowHeight,
96
+ _ref$initialColumnWid = _ref.initialColumnWidths,
97
+ initialColumnWidths = _ref$initialColumnWid === void 0 ? new Map() : _ref$initialColumnWid;
78
98
  /** The initial row heights if any overrides from the default calculated values */
79
99
  _defineProperty(this, "initialRowHeights", void 0);
80
100
  // Readonly so it should be safe to make public
@@ -132,28 +152,24 @@ export class GridMetricCalculator {
132
152
  * @returns The full metrics
133
153
  */
134
154
  getMetrics(state) {
135
- var {
136
- left,
137
- top,
138
- leftOffset,
139
- topOffset,
140
- width,
141
- height,
142
- theme,
143
- model,
144
- movedRows,
145
- movedColumns,
146
- draggingColumn
147
- } = state;
148
- var {
149
- rowHeight,
150
- rowHeaderWidth,
151
- rowFooterWidth,
152
- columnWidth,
153
- columnHeaderHeight,
154
- minScrollHandleSize,
155
- scrollBarSize
156
- } = theme;
155
+ var left = state.left,
156
+ top = state.top,
157
+ leftOffset = state.leftOffset,
158
+ topOffset = state.topOffset,
159
+ width = state.width,
160
+ height = state.height,
161
+ theme = state.theme,
162
+ model = state.model,
163
+ movedRows = state.movedRows,
164
+ movedColumns = state.movedColumns,
165
+ draggingColumn = state.draggingColumn;
166
+ var rowHeight = theme.rowHeight,
167
+ rowHeaderWidth = theme.rowHeaderWidth,
168
+ rowFooterWidth = theme.rowFooterWidth,
169
+ columnWidth = theme.columnWidth,
170
+ columnHeaderHeight = theme.columnHeaderHeight,
171
+ minScrollHandleSize = theme.minScrollHandleSize,
172
+ scrollBarSize = theme.scrollBarSize;
157
173
  if (movedRows !== this.movedRows) {
158
174
  this.movedRows = movedRows;
159
175
  this.modelRows.clear();
@@ -162,15 +178,13 @@ export class GridMetricCalculator {
162
178
  this.movedColumns = movedColumns;
163
179
  this.modelColumns.clear();
164
180
  }
165
- var {
166
- columnCount,
167
- rowCount,
168
- floatingTopRowCount,
169
- floatingBottomRowCount,
170
- floatingLeftColumnCount,
171
- floatingRightColumnCount,
172
- columnHeaderMaxDepth
173
- } = model;
181
+ var columnCount = model.columnCount,
182
+ rowCount = model.rowCount,
183
+ floatingTopRowCount = model.floatingTopRowCount,
184
+ floatingBottomRowCount = model.floatingBottomRowCount,
185
+ floatingLeftColumnCount = model.floatingLeftColumnCount,
186
+ floatingRightColumnCount = model.floatingRightColumnCount,
187
+ columnHeaderMaxDepth = model.columnHeaderMaxDepth;
174
188
 
175
189
  // Get some basic metrics
176
190
  var firstRow = this.getFirstRow(state);
@@ -181,7 +195,10 @@ export class GridMetricCalculator {
181
195
  var treePaddingY = 0; // We don't support trees on columns (at least not yet)
182
196
 
183
197
  var visibleRowHeights = this.getVisibleRowHeights(state);
184
- var [visibleColumnWidths, columnsForRender] = this.getVisibleColumnWidths(state, firstColumn, treePaddingX);
198
+ var _this$getVisibleColum = this.getVisibleColumnWidths(state, firstColumn, treePaddingX),
199
+ _this$getVisibleColum2 = _slicedToArray(_this$getVisibleColum, 2),
200
+ visibleColumnWidths = _this$getVisibleColum2[0],
201
+ columnsForRender = _this$getVisibleColum2[1];
185
202
 
186
203
  // Calculate the metrics for the main grid
187
204
  var visibleRows = Array.from(visibleRowHeights.keys());
@@ -278,16 +295,14 @@ export class GridMetricCalculator {
278
295
  var leftVisible = this.getLeftVisible(state, allColumnXs, allColumnWidths, visibleColumns);
279
296
  var bottomVisible = lastTop > 0 ? this.getBottomVisible(state, allRowYs, allRowHeights, visibleRows, gridY) : bottom;
280
297
  var rightVisible = lastLeft > 0 ? this.getRightVisible(state, allColumnXs, allColumnWidths, visibleColumns, gridX) : right;
281
- var {
282
- fontWidthsLower,
283
- fontWidthsUpper,
284
- userColumnWidths,
285
- userRowHeights,
286
- calculatedRowHeights,
287
- calculatedColumnWidths,
288
- contentColumnWidths,
289
- contentRowHeights
290
- } = this;
298
+ var fontWidthsLower = this.fontWidthsLower,
299
+ fontWidthsUpper = this.fontWidthsUpper,
300
+ userColumnWidths = this.userColumnWidths,
301
+ userRowHeights = this.userRowHeights,
302
+ calculatedRowHeights = this.calculatedRowHeights,
303
+ calculatedColumnWidths = this.calculatedColumnWidths,
304
+ contentColumnWidths = this.contentColumnWidths,
305
+ contentRowHeights = this.contentRowHeights;
291
306
  return {
292
307
  // Row/Column metrics from model
293
308
  rowHeight,
@@ -410,12 +425,8 @@ export class GridMetricCalculator {
410
425
  * @returns x value of the left side of the first cell
411
426
  */
412
427
  getGridX(state) {
413
- var {
414
- theme
415
- } = state;
416
- var {
417
- rowHeaderWidth
418
- } = theme;
428
+ var theme = state.theme;
429
+ var rowHeaderWidth = theme.rowHeaderWidth;
419
430
  return rowHeaderWidth;
420
431
  }
421
432
 
@@ -425,16 +436,10 @@ export class GridMetricCalculator {
425
436
  * @returns y value of the top side of the first cell
426
437
  */
427
438
  getGridY(state) {
428
- var {
429
- theme,
430
- model
431
- } = state;
432
- var {
433
- columnHeaderHeight
434
- } = theme;
435
- var {
436
- columnHeaderMaxDepth
437
- } = model;
439
+ var theme = state.theme,
440
+ model = state.model;
441
+ var columnHeaderHeight = theme.columnHeaderHeight;
442
+ var columnHeaderMaxDepth = model.columnHeaderMaxDepth;
438
443
  return columnHeaderMaxDepth * columnHeaderHeight;
439
444
  }
440
445
 
@@ -446,13 +451,9 @@ export class GridMetricCalculator {
446
451
  */
447
452
  getVisibleHeight(state) {
448
453
  var visibleRowHeights = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFloatingRowHeights(state);
449
- var {
450
- height,
451
- theme
452
- } = state;
453
- var {
454
- scrollBarSize
455
- } = theme;
454
+ var height = state.height,
455
+ theme = state.theme;
456
+ var scrollBarSize = theme.scrollBarSize;
456
457
  var gridY = this.getGridY(state);
457
458
  var floatingBottomHeight = this.getFloatingBottomHeight(state, visibleRowHeights);
458
459
  var floatingTopHeight = this.getFloatingTopHeight(state, visibleRowHeights);
@@ -467,14 +468,10 @@ export class GridMetricCalculator {
467
468
  */
468
469
  getVisibleWidth(state) {
469
470
  var visibleColumnWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFloatingColumnWidths(state);
470
- var {
471
- width,
472
- theme
473
- } = state;
474
- var {
475
- scrollBarSize,
476
- rowFooterWidth
477
- } = theme;
471
+ var width = state.width,
472
+ theme = state.theme;
473
+ var scrollBarSize = theme.scrollBarSize,
474
+ rowFooterWidth = theme.rowFooterWidth;
478
475
  var gridX = this.getGridX(state);
479
476
  var floatingRightWidth = this.getFloatingRightWidth(state, visibleColumnWidths);
480
477
  var floatingLeftWidth = this.getFloatingLeftWidth(state, visibleColumnWidths);
@@ -527,13 +524,9 @@ export class GridMetricCalculator {
527
524
  * @returns The index of the last left visible column
528
525
  */
529
526
  getLastLeft(state, right, visibleWidth) {
530
- var {
531
- model
532
- } = state;
533
- var {
534
- columnCount,
535
- floatingRightColumnCount
536
- } = model;
527
+ var model = state.model;
528
+ var columnCount = model.columnCount,
529
+ floatingRightColumnCount = model.floatingRightColumnCount;
537
530
  if (columnCount === 0) {
538
531
  return 0;
539
532
  }
@@ -562,13 +555,9 @@ export class GridMetricCalculator {
562
555
  * @returns The index of the last top visible row
563
556
  */
564
557
  getLastTop(state, bottom, visibleHeight) {
565
- var {
566
- model
567
- } = state;
568
- var {
569
- rowCount,
570
- floatingBottomRowCount
571
- } = model;
558
+ var model = state.model;
559
+ var rowCount = model.rowCount,
560
+ floatingBottomRowCount = model.floatingBottomRowCount;
572
561
  var lastTop = Math.max(0, rowCount - floatingBottomRowCount - 1);
573
562
  if (bottom != null) {
574
563
  lastTop = bottom;
@@ -612,13 +601,9 @@ export class GridMetricCalculator {
612
601
  * @returns The index of the top row to scroll to (under the floating top rows)
613
602
  */
614
603
  getTopForBottomVisible(state, bottomVisible) {
615
- var {
616
- height,
617
- theme
618
- } = state;
619
- var {
620
- scrollBarSize
621
- } = theme;
604
+ var height = state.height,
605
+ theme = state.theme;
606
+ var scrollBarSize = theme.scrollBarSize;
622
607
  var gridY = this.getGridY(state);
623
608
  var floatingBottomHeight = this.getFloatingBottomHeight(state);
624
609
  // Account for scrollbar space to match lastTop calculation
@@ -652,13 +637,9 @@ export class GridMetricCalculator {
652
637
  * @returns The index of the left column to scroll to (under the floating left columns)
653
638
  */
654
639
  getLeftForRightVisible(state, rightVisible) {
655
- var {
656
- width,
657
- theme
658
- } = state;
659
- var {
660
- scrollBarSize
661
- } = theme;
640
+ var width = state.width,
641
+ theme = state.theme;
642
+ var scrollBarSize = theme.scrollBarSize;
662
643
  var gridX = this.getGridX(state);
663
644
  var floatingRightWidth = this.getFloatingRightWidth(state);
664
645
  // Account for scrollbar space to match lastLeft calculation
@@ -672,14 +653,10 @@ export class GridMetricCalculator {
672
653
  * @returns The heights of all the floating rows
673
654
  */
674
655
  getFloatingRowHeights(state) {
675
- var {
676
- model
677
- } = state;
678
- var {
679
- floatingTopRowCount,
680
- floatingBottomRowCount,
681
- rowCount
682
- } = model;
656
+ var model = state.model;
657
+ var floatingTopRowCount = model.floatingTopRowCount,
658
+ floatingBottomRowCount = model.floatingBottomRowCount,
659
+ rowCount = model.rowCount;
683
660
  var rowHeights = new Map();
684
661
  for (var i = 0; i < floatingTopRowCount && i < rowCount; i += 1) {
685
662
  rowHeights.set(i, this.getVisibleRowHeight(i, state));
@@ -697,19 +674,15 @@ export class GridMetricCalculator {
697
674
  * @returns The heights of all the visible rows
698
675
  */
699
676
  getVisibleRowHeights(state) {
700
- var {
701
- top,
702
- topOffset,
703
- height,
704
- model
705
- } = state;
677
+ var top = state.top,
678
+ topOffset = state.topOffset,
679
+ height = state.height,
680
+ model = state.model;
706
681
  var y = 0;
707
682
  var row = top;
708
683
  var rowHeights = new Map();
709
- var {
710
- rowCount,
711
- floatingBottomRowCount
712
- } = model;
684
+ var rowCount = model.rowCount,
685
+ floatingBottomRowCount = model.floatingBottomRowCount;
713
686
  while (y < height + topOffset && row < rowCount - floatingBottomRowCount) {
714
687
  var rowHeight = this.getVisibleRowHeight(row, state);
715
688
  rowHeights.set(row, rowHeight);
@@ -729,14 +702,10 @@ export class GridMetricCalculator {
729
702
  getFloatingColumnWidths(state) {
730
703
  var firstColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFirstColumn(state);
731
704
  var treePaddingX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.calculateTreePaddingX(state);
732
- var {
733
- model
734
- } = state;
735
- var {
736
- columnCount,
737
- floatingLeftColumnCount,
738
- floatingRightColumnCount
739
- } = model;
705
+ var model = state.model;
706
+ var columnCount = model.columnCount,
707
+ floatingLeftColumnCount = model.floatingLeftColumnCount,
708
+ floatingRightColumnCount = model.floatingRightColumnCount;
740
709
  var columnWidths = new Map();
741
710
  for (var i = 0; i < floatingLeftColumnCount && i < columnCount; i += 1) {
742
711
  columnWidths.set(i, this.getVisibleColumnWidth(i, state, firstColumn, treePaddingX));
@@ -756,20 +725,16 @@ export class GridMetricCalculator {
756
725
  getVisibleColumnWidths(state) {
757
726
  var firstColumn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFirstColumn(state);
758
727
  var treePaddingX = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.calculateTreePaddingX(state);
759
- var {
760
- left,
761
- leftOffset,
762
- width,
763
- model
764
- } = state;
728
+ var left = state.left,
729
+ leftOffset = state.leftOffset,
730
+ width = state.width,
731
+ model = state.model;
765
732
  var x = 0;
766
733
  var column = left;
767
734
  var columnWidths = new Map();
768
735
  var columnsForRender = [];
769
- var {
770
- columnCount,
771
- floatingRightColumnCount
772
- } = model;
736
+ var columnCount = model.columnCount,
737
+ floatingRightColumnCount = model.floatingRightColumnCount;
773
738
  while (x < width + leftOffset && column < columnCount - floatingRightColumnCount) {
774
739
  var columnWidth = this.getVisibleColumnWidth(column, state, firstColumn, treePaddingX);
775
740
  columnWidths.set(column, columnWidth);
@@ -790,14 +755,10 @@ export class GridMetricCalculator {
790
755
  * @returns Map of the x coordinate of all floating columns
791
756
  */
792
757
  getFloatingColumnXs(state, columnWidthMap, maxX) {
793
- var {
794
- model
795
- } = state;
796
- var {
797
- columnCount,
798
- floatingLeftColumnCount,
799
- floatingRightColumnCount
800
- } = model;
758
+ var model = state.model;
759
+ var columnCount = model.columnCount,
760
+ floatingLeftColumnCount = model.floatingLeftColumnCount,
761
+ floatingRightColumnCount = model.floatingRightColumnCount;
801
762
  return getFloatingCoordinates(floatingLeftColumnCount, floatingRightColumnCount, columnCount, maxX, columnWidthMap);
802
763
  }
803
764
 
@@ -830,14 +791,10 @@ export class GridMetricCalculator {
830
791
  * @returns Map of the y coordinate of all floating rows
831
792
  */
832
793
  getFloatingRowYs(state, rowHeightMap, maxY) {
833
- var {
834
- model
835
- } = state;
836
- var {
837
- floatingTopRowCount,
838
- floatingBottomRowCount,
839
- rowCount
840
- } = model;
794
+ var model = state.model;
795
+ var floatingTopRowCount = model.floatingTopRowCount,
796
+ floatingBottomRowCount = model.floatingBottomRowCount,
797
+ rowCount = model.rowCount;
841
798
  return getFloatingCoordinates(floatingTopRowCount, floatingBottomRowCount, rowCount, maxY, rowHeightMap);
842
799
  }
843
800
 
@@ -871,14 +828,10 @@ export class GridMetricCalculator {
871
828
  */
872
829
  getVisibleRowTreeBoxes(visibleRowHeights, modelRows, state) {
873
830
  var visibleRowTreeBoxes = new Map();
874
- var {
875
- model,
876
- theme
877
- } = state;
878
- var {
879
- treeDepthIndent,
880
- treeHorizontalPadding
881
- } = theme;
831
+ var model = state.model,
832
+ theme = state.theme;
833
+ var treeDepthIndent = theme.treeDepthIndent,
834
+ treeHorizontalPadding = theme.treeHorizontalPadding;
882
835
  if (isExpandableGridModel(model) && model.hasExpandableRows) {
883
836
  visibleRowHeights.forEach((rowHeight, row) => {
884
837
  var modelRow = getOrThrow(modelRows, row);
@@ -908,12 +861,8 @@ export class GridMetricCalculator {
908
861
  */
909
862
  getFloatingLeftWidth(state) {
910
863
  var columnWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFloatingColumnWidths(state);
911
- var {
912
- model
913
- } = state;
914
- var {
915
- floatingLeftColumnCount
916
- } = model;
864
+ var model = state.model;
865
+ var floatingLeftColumnCount = model.floatingLeftColumnCount;
917
866
  var floatingWidth = 0;
918
867
  for (var i = 0; i < floatingLeftColumnCount; i += 1) {
919
868
  floatingWidth += getOrThrow(columnWidths, i);
@@ -929,13 +878,9 @@ export class GridMetricCalculator {
929
878
  */
930
879
  getFloatingRightWidth(state) {
931
880
  var columnWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFloatingColumnWidths(state);
932
- var {
933
- model
934
- } = state;
935
- var {
936
- floatingRightColumnCount,
937
- columnCount
938
- } = model;
881
+ var model = state.model;
882
+ var floatingRightColumnCount = model.floatingRightColumnCount,
883
+ columnCount = model.columnCount;
939
884
  var floatingWidth = 0;
940
885
  for (var i = 0; i < floatingRightColumnCount; i += 1) {
941
886
  floatingWidth += getOrThrow(columnWidths, columnCount - i - 1);
@@ -951,12 +896,8 @@ export class GridMetricCalculator {
951
896
  */
952
897
  getFloatingTopHeight(state) {
953
898
  var rowHeights = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFloatingRowHeights(state);
954
- var {
955
- model
956
- } = state;
957
- var {
958
- floatingTopRowCount
959
- } = model;
899
+ var model = state.model;
900
+ var floatingTopRowCount = model.floatingTopRowCount;
960
901
  var floatingHeight = 0;
961
902
  for (var i = 0; i < floatingTopRowCount; i += 1) {
962
903
  floatingHeight += getOrThrow(rowHeights, i);
@@ -972,13 +913,9 @@ export class GridMetricCalculator {
972
913
  */
973
914
  getFloatingBottomHeight(state) {
974
915
  var rowHeights = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.getFloatingRowHeights(state);
975
- var {
976
- model
977
- } = state;
978
- var {
979
- floatingBottomRowCount,
980
- rowCount
981
- } = model;
916
+ var model = state.model;
917
+ var floatingBottomRowCount = model.floatingBottomRowCount,
918
+ rowCount = model.rowCount;
982
919
  var floatingHeight = 0;
983
920
  for (var i = 0; i < floatingBottomRowCount; i += 1) {
984
921
  floatingHeight += getOrThrow(rowHeights, rowCount - i - 1);
@@ -1039,13 +976,9 @@ export class GridMetricCalculator {
1039
976
  * @returns Index of the bottom visible row
1040
977
  */
1041
978
  getBottomVisible(state, visibleRowYs, visibleRowHeights, visibleRows, gridY) {
1042
- var {
1043
- height,
1044
- theme
1045
- } = state;
1046
- var {
1047
- scrollBarSize
1048
- } = theme;
979
+ var height = state.height,
980
+ theme = state.theme;
981
+ var scrollBarSize = theme.scrollBarSize;
1049
982
  var floatingHeight = this.getFloatingBottomHeight(state, visibleRowHeights);
1050
983
  var visibleHeight = height - gridY - scrollBarSize - floatingHeight;
1051
984
  for (var i = visibleRows.length - 1; i >= 0; i -= 1) {
@@ -1069,13 +1002,9 @@ export class GridMetricCalculator {
1069
1002
  * @returns Index of the right visible column
1070
1003
  */
1071
1004
  getRightVisible(state, visibleColumnXs, visibleColumnWidths, visibleColumns, gridX) {
1072
- var {
1073
- width,
1074
- theme
1075
- } = state;
1076
- var {
1077
- scrollBarSize
1078
- } = theme;
1005
+ var width = state.width,
1006
+ theme = state.theme;
1007
+ var scrollBarSize = theme.scrollBarSize;
1079
1008
  var floatingWidth = this.getFloatingRightWidth(state, visibleColumnWidths);
1080
1009
  var visibleWidth = width - gridX - scrollBarSize - floatingWidth;
1081
1010
  for (var i = visibleColumns.length - 1; i >= 0; i -= 1) {
@@ -1098,13 +1027,9 @@ export class GridMetricCalculator {
1098
1027
  * @returns The index of the bottom viewport possible
1099
1028
  */
1100
1029
  getBottomViewport(state, visibleRows, visibleRowYs, visibleRowHeights) {
1101
- var {
1102
- height,
1103
- theme
1104
- } = state;
1105
- var {
1106
- rowHeight
1107
- } = theme;
1030
+ var height = state.height,
1031
+ theme = state.theme;
1032
+ var rowHeight = theme.rowHeight;
1108
1033
  return this.getLastIndexViewport(visibleRows, visibleRowYs, visibleRowHeights, height, rowHeight);
1109
1034
  }
1110
1035
 
@@ -1117,13 +1042,9 @@ export class GridMetricCalculator {
1117
1042
  * @returns The index of the right viewport possible
1118
1043
  */
1119
1044
  getRightViewport(state, visibleColumns, visibleColumnXs, visibleColumnWidths) {
1120
- var {
1121
- width,
1122
- theme
1123
- } = state;
1124
- var {
1125
- columnWidth
1126
- } = theme;
1045
+ var width = state.width,
1046
+ theme = state.theme;
1047
+ var columnWidth = theme.columnWidth;
1127
1048
  return this.getLastIndexViewport(visibleColumns, visibleColumnXs, visibleColumnWidths, width, columnWidth);
1128
1049
  }
1129
1050
 
@@ -1230,9 +1151,7 @@ export class GridMetricCalculator {
1230
1151
  if (this.modelRows.has(visibleRow)) {
1231
1152
  return getOrThrow(this.modelRows, visibleRow);
1232
1153
  }
1233
- var {
1234
- movedRows
1235
- } = state;
1154
+ var movedRows = state.movedRows;
1236
1155
  var modelRow = GridUtils.getModelIndex(visibleRow, movedRows);
1237
1156
  this.modelRows.set(visibleRow, modelRow);
1238
1157
  return modelRow;
@@ -1265,9 +1184,7 @@ export class GridMetricCalculator {
1265
1184
  if (hasVisibleColumn) {
1266
1185
  return getOrThrow(this.modelColumns, visibleColumn);
1267
1186
  }
1268
- var {
1269
- movedColumns
1270
- } = state;
1187
+ var movedColumns = state.movedColumns;
1271
1188
  var modelColumn = GridUtils.getModelIndex(visibleColumn, movedColumns);
1272
1189
  this.modelColumns.set(visibleColumn, modelColumn);
1273
1190
  return modelColumn;
@@ -1281,13 +1198,9 @@ export class GridMetricCalculator {
1281
1198
  * @returns The height of the row
1282
1199
  */
1283
1200
  calculateRowHeight(row, modelRow, state) {
1284
- var {
1285
- theme
1286
- } = state;
1287
- var {
1288
- autoSizeRows,
1289
- rowHeight
1290
- } = theme;
1201
+ var theme = state.theme;
1202
+ var autoSizeRows = theme.autoSizeRows,
1203
+ rowHeight = theme.rowHeight;
1291
1204
  if (!autoSizeRows) {
1292
1205
  return rowHeight;
1293
1206
  }
@@ -1318,18 +1231,12 @@ export class GridMetricCalculator {
1318
1231
  calculateColumnWidth(column, modelColumn, state) {
1319
1232
  var firstColumn = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : this.getFirstColumn(state);
1320
1233
  var treePaddingX = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : this.calculateTreePaddingX(state);
1321
- var {
1322
- theme
1323
- } = state;
1324
- var {
1325
- autoSizeColumns,
1326
- minColumnWidth,
1327
- maxColumnWidth
1328
- } = theme;
1234
+ var theme = state.theme;
1235
+ var autoSizeColumns = theme.autoSizeColumns,
1236
+ minColumnWidth = theme.minColumnWidth,
1237
+ maxColumnWidth = theme.maxColumnWidth;
1329
1238
  if (!autoSizeColumns) {
1330
- var {
1331
- columnWidth: _columnWidth
1332
- } = theme;
1239
+ var _columnWidth = theme.columnWidth;
1333
1240
  return _columnWidth;
1334
1241
  }
1335
1242
  var cachedValue = this.calculatedColumnWidths.get(modelColumn);
@@ -1375,15 +1282,11 @@ export class GridMetricCalculator {
1375
1282
  * @returns The calculated width of the column header
1376
1283
  */
1377
1284
  calculateColumnHeaderWidth(modelColumn, state, maxColumnWidth) {
1378
- var {
1379
- model,
1380
- theme,
1381
- context
1382
- } = state;
1383
- var {
1384
- headerHorizontalPadding,
1385
- headerFont
1386
- } = theme;
1285
+ var model = state.model,
1286
+ theme = state.theme,
1287
+ context = state.context;
1288
+ var headerHorizontalPadding = theme.headerHorizontalPadding,
1289
+ headerFont = theme.headerFont;
1387
1290
  this.calculateLowerFontWidth(headerFont, context);
1388
1291
  this.calculateUpperFontWidth(headerFont, context);
1389
1292
  var totalPadding = headerHorizontalPadding * 2;
@@ -1401,28 +1304,22 @@ export class GridMetricCalculator {
1401
1304
  * @returns The calculated width of the column data
1402
1305
  */
1403
1306
  calculateColumnDataWidth(modelColumn, state, maxColumnWidth) {
1404
- var {
1405
- top,
1406
- height,
1407
- width,
1408
- model,
1409
- theme,
1410
- context
1411
- } = state;
1412
- var {
1413
- floatingTopRowCount,
1414
- floatingBottomRowCount,
1415
- rowCount
1416
- } = model;
1417
- var {
1418
- font,
1419
- cellHorizontalPadding,
1420
- rowHeight,
1421
- rowHeaderWidth,
1422
- rowFooterWidth,
1423
- scrollBarSize,
1424
- dataBarHorizontalPadding
1425
- } = theme;
1307
+ var top = state.top,
1308
+ height = state.height,
1309
+ width = state.width,
1310
+ model = state.model,
1311
+ theme = state.theme,
1312
+ context = state.context;
1313
+ var floatingTopRowCount = model.floatingTopRowCount,
1314
+ floatingBottomRowCount = model.floatingBottomRowCount,
1315
+ rowCount = model.rowCount;
1316
+ var font = theme.font,
1317
+ cellHorizontalPadding = theme.cellHorizontalPadding,
1318
+ rowHeight = theme.rowHeight,
1319
+ rowHeaderWidth = theme.rowHeaderWidth,
1320
+ rowFooterWidth = theme.rowFooterWidth,
1321
+ scrollBarSize = theme.scrollBarSize,
1322
+ dataBarHorizontalPadding = theme.dataBarHorizontalPadding;
1426
1323
  this.calculateLowerFontWidth(font, context);
1427
1324
  this.calculateUpperFontWidth(font, context);
1428
1325
  var columnWidth = 0;
@@ -1498,16 +1395,12 @@ export class GridMetricCalculator {
1498
1395
  * @returns The coordinate for tree padding
1499
1396
  */
1500
1397
  calculateTreePaddingX(state) {
1501
- var {
1502
- top,
1503
- height,
1504
- model,
1505
- theme
1506
- } = state;
1507
- var {
1508
- rowHeight,
1509
- treeDepthIndent
1510
- } = theme;
1398
+ var top = state.top,
1399
+ height = state.height,
1400
+ model = state.model,
1401
+ theme = state.theme;
1402
+ var rowHeight = theme.rowHeight,
1403
+ treeDepthIndent = theme.treeDepthIndent;
1511
1404
  if (!isExpandableGridModel(model) || !model.hasExpandableRows) {
1512
1405
  return 0;
1513
1406
  }
@@ -1534,9 +1427,7 @@ export class GridMetricCalculator {
1534
1427
  context.font = font;
1535
1428
  // Assume char `.` is the smallest character
1536
1429
  var textMetrics = context.measureText('.');
1537
- var {
1538
- width
1539
- } = textMetrics;
1430
+ var width = textMetrics.width;
1540
1431
 
1541
1432
  // context.font changes the string a little bit, e.g. '10px Arial, sans serif' => '10px Arial, "sans serif"'
1542
1433
  // Rather than require checking with the correct font def (theme, or context font), just key it to both
@@ -1556,9 +1447,7 @@ export class GridMetricCalculator {
1556
1447
  context.font = font;
1557
1448
  // Assume char `m` is the largest character
1558
1449
  var textMetrics = context.measureText('m');
1559
- var {
1560
- width
1561
- } = textMetrics;
1450
+ var width = textMetrics.width;
1562
1451
 
1563
1452
  // context.font changes the string a little bit, e.g. '10px Arial, sans serif' => '10px Arial, "sans serif"'
1564
1453
  // Rather than require checking with the correct font def (theme, or context font), just key it to both