handsontable 0.0.0-next-542a54e-20250121 → 0.0.0-next-8d1d868-20250121

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.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (43) hide show
  1. package/3rdparty/walkontable/src/core/_base.js +19 -0
  2. package/3rdparty/walkontable/src/core/_base.mjs +19 -0
  3. package/3rdparty/walkontable/src/overlay/_base.js +44 -8
  4. package/3rdparty/walkontable/src/overlay/_base.mjs +44 -8
  5. package/3rdparty/walkontable/src/overlay/bottom.js +0 -1
  6. package/3rdparty/walkontable/src/overlay/bottom.mjs +0 -1
  7. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.js +0 -1
  8. package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.mjs +0 -1
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +0 -1
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +0 -1
  11. package/3rdparty/walkontable/src/overlay/top.js +0 -1
  12. package/3rdparty/walkontable/src/overlay/top.mjs +0 -1
  13. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +0 -1
  14. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +0 -1
  15. package/3rdparty/walkontable/src/overlays.js +355 -45
  16. package/3rdparty/walkontable/src/overlays.mjs +355 -45
  17. package/3rdparty/walkontable/src/table.js +94 -99
  18. package/3rdparty/walkontable/src/table.mjs +94 -99
  19. package/base.js +2 -2
  20. package/base.mjs +2 -2
  21. package/dist/handsontable.css +20 -4
  22. package/dist/handsontable.full.css +20 -4
  23. package/dist/handsontable.full.js +522 -166
  24. package/dist/handsontable.full.min.css +3 -3
  25. package/dist/handsontable.full.min.js +108 -108
  26. package/dist/handsontable.js +522 -166
  27. package/dist/handsontable.min.css +3 -3
  28. package/dist/handsontable.min.js +15 -15
  29. package/editors/baseEditor/baseEditor.js +2 -1
  30. package/editors/baseEditor/baseEditor.mjs +2 -1
  31. package/helpers/mixed.js +1 -1
  32. package/helpers/mixed.mjs +1 -1
  33. package/package.json +1 -1
  34. package/plugins/dragToScroll/dragToScroll.js +1 -1
  35. package/plugins/dragToScroll/dragToScroll.mjs +1 -1
  36. package/styles/handsontable.css +7 -2
  37. package/styles/handsontable.min.css +3 -3
  38. package/styles/ht-theme-horizon.css +2 -2
  39. package/styles/ht-theme-horizon.min.css +2 -2
  40. package/styles/ht-theme-main.css +2 -2
  41. package/styles/ht-theme-main.min.css +2 -2
  42. package/tableView.js +2 -2
  43. package/tableView.mjs +2 -2
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-542a54e-20250121
29
- * Release date: 16/12/2024 (built at 21/01/2025 09:00:27)
28
+ * Version: 0.0.0-next-8d1d868-20250121
29
+ * Release date: 16/12/2024 (built at 21/01/2025 11:19:54)
30
30
  */
31
31
  (function webpackUniversalModuleDefinition(root, factory) {
32
32
  if(typeof exports === 'object' && typeof module === 'object')
@@ -42855,8 +42855,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
42855
42855
  Handsontable.CellCoords = _src.CellCoords;
42856
42856
  Handsontable.CellRange = _src.CellRange;
42857
42857
  Handsontable.packageName = 'handsontable';
42858
- Handsontable.buildDate = "21/01/2025 09:00:27";
42859
- Handsontable.version = "0.0.0-next-542a54e-20250121";
42858
+ Handsontable.buildDate = "21/01/2025 11:19:54";
42859
+ Handsontable.version = "0.0.0-next-8d1d868-20250121";
42860
42860
  Handsontable.languages = {
42861
42861
  dictionaryKeys: _registry.dictionaryKeys,
42862
42862
  getLanguageDictionary: _registry.getLanguageDictionary,
@@ -54189,7 +54189,7 @@ const domMessages = {
54189
54189
  function _injectProductInfo(key, element) {
54190
54190
  const hasValidType = !isEmpty(key);
54191
54191
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
54192
- const hotVersion = "0.0.0-next-542a54e-20250121";
54192
+ const hotVersion = "0.0.0-next-8d1d868-20250121";
54193
54193
  let keyValidityDate;
54194
54194
  let consoleMessageState = 'invalid';
54195
54195
  let domMessageState = 'invalid';
@@ -68807,7 +68807,7 @@ class TableView {
68807
68807
  if (this.hot.isRenderSuspended()) {
68808
68808
  this.postponedAdjustElementsSize = true;
68809
68809
  } else {
68810
- // this._wt.wtOverlays.adjustElementsSize();
68810
+ this._wt.wtOverlays.adjustElementsSize();
68811
68811
  }
68812
68812
  }
68813
68813
 
@@ -69888,7 +69888,7 @@ class TableView {
69888
69888
  updateCellHeader(element, index, content) {
69889
69889
  let headerLevel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
69890
69890
  let renderedIndex = index;
69891
- const parentOverlay = this._wt;
69891
+ const parentOverlay = this._wt.wtOverlays.getParentOverlay(element) || this._wt;
69892
69892
 
69893
69893
  // prevent wrong calculations from SampleGenerator
69894
69894
  if (element.parentNode) {
@@ -73329,6 +73329,9 @@ var _interopRequireDefault = __webpack_require__(197);
73329
73329
  exports.__esModule = true;
73330
73330
  __webpack_require__(201);
73331
73331
  __webpack_require__(283);
73332
+ __webpack_require__(311);
73333
+ __webpack_require__(329);
73334
+ __webpack_require__(530);
73332
73335
  var _defineProperty2 = _interopRequireDefault(__webpack_require__(504));
73333
73336
  var _element = __webpack_require__(351);
73334
73337
  var _feature = __webpack_require__(502);
@@ -73346,6 +73349,7 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
73346
73349
  * @class Overlays
73347
73350
  */
73348
73351
  var _overlays = /*#__PURE__*/new WeakMap();
73352
+ var _hasRenderingStateChanged = /*#__PURE__*/new WeakMap();
73349
73353
  var _containerDomResizeCount = /*#__PURE__*/new WeakMap();
73350
73354
  var _containerDomResizeCountTimeout = /*#__PURE__*/new WeakMap();
73351
73355
  class Overlays {
@@ -73420,6 +73424,12 @@ class Overlays {
73420
73424
  * @type {Settings}
73421
73425
  */
73422
73426
  (0, _defineProperty2.default)(this, "wtSettings", null);
73427
+ /**
73428
+ * Indicates whether the rendering state has changed for one of the overlays.
73429
+ *
73430
+ * @type {boolean}
73431
+ */
73432
+ _classPrivateFieldInitSpec(this, _hasRenderingStateChanged, false);
73423
73433
  /**
73424
73434
  * The amount of times the ResizeObserver callback was fired in direct succession.
73425
73435
  *
@@ -73466,16 +73476,32 @@ class Overlays {
73466
73476
  this.domBindings = domBindings;
73467
73477
  this.facadeGetter = facadeGetter;
73468
73478
  this.wtTable = wtTable;
73469
- this.eventManager = eventManager;
73470
- this.destroyed = false;
73471
73479
  const {
73480
+ rootDocument,
73472
73481
  rootWindow
73473
73482
  } = this.domBindings;
73483
+
73484
+ // legacy support
73485
+ this.instance = this.wot; // todo refactoring: move to facade
73486
+ this.eventManager = eventManager;
73487
+
73488
+ // TODO refactoring: probably invalid place to this logic
73489
+ this.scrollbarSize = (0, _element.getScrollbarWidth)(rootDocument);
73474
73490
  const isOverflowHidden = rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden';
73475
73491
  this.scrollableElement = isOverflowHidden ? wtTable.holder : (0, _element.getScrollableElement)(wtTable.TABLE);
73476
73492
  this.initOverlays();
73493
+ this.destroyed = false;
73494
+ this.keyPressed = false;
73495
+ this.spreaderLastSize = {
73496
+ width: null,
73497
+ height: null
73498
+ };
73499
+ this.verticalScrolling = false;
73500
+ this.horizontalScrolling = false;
73477
73501
  this.initBrowserLineHeight();
73478
73502
  this.registerListeners();
73503
+ this.lastScrollX = rootWindow.scrollX;
73504
+ this.lastScrollY = rootWindow.scrollY;
73479
73505
  }
73480
73506
 
73481
73507
  /**
@@ -73510,8 +73536,8 @@ class Overlays {
73510
73536
  * Https://developer.mozilla.org/pl/docs/Web/CSS/line-height#Values.
73511
73537
  */
73512
73538
  const lineHeight = parseInt(computedStyle.lineHeight, 10);
73513
- const lineHeightFallback = parseInt(computedStyle.fontSize, 10) * 1.2;
73514
- this.browserLineHeight = lineHeight || lineHeightFallback;
73539
+ const lineHeightFalback = parseInt(computedStyle.fontSize, 10) * 1.2;
73540
+ this.browserLineHeight = lineHeight || lineHeightFalback;
73515
73541
  }
73516
73542
 
73517
73543
  /**
@@ -73521,9 +73547,15 @@ class Overlays {
73521
73547
  */
73522
73548
  initOverlays() {
73523
73549
  const args = [this.wot, this.facadeGetter, this.wtSettings, this.domBindings];
73550
+
73551
+ // todo refactoring: IOC, collection or factories.
73552
+ // TODO refactoring, conceive about using generic collection of overlays.
73524
73553
  this.topOverlay = new _overlay.TopOverlay(...args);
73525
73554
  this.bottomOverlay = new _overlay.BottomOverlay(...args);
73526
73555
  this.inlineStartOverlay = new _overlay.InlineStartOverlay(...args);
73556
+
73557
+ // TODO discuss, the controversial here would be removing the lazy creation mechanism for corners.
73558
+ // TODO cond. Has no any visual impact. They're initially hidden in same way like left, top, and bottom overlays.
73527
73559
  this.topInlineStartCornerOverlay = new _overlay.TopInlineStartCornerOverlay(...args, this.topOverlay, this.inlineStartOverlay);
73528
73560
  this.bottomInlineStartCornerOverlay = new _overlay.BottomInlineStartCornerOverlay(...args, this.bottomOverlay, this.inlineStartOverlay);
73529
73561
  _classPrivateFieldSet(_overlays, this, [this.topOverlay, this.bottomOverlay, this.inlineStartOverlay, this.topInlineStartCornerOverlay, this.bottomInlineStartCornerOverlay]);
@@ -73532,20 +73564,48 @@ class Overlays {
73532
73564
  /**
73533
73565
  * Runs logic for the overlays before the table is drawn.
73534
73566
  */
73535
- beforeDraw() {}
73567
+ beforeDraw() {
73568
+ _classPrivateFieldSet(_hasRenderingStateChanged, this, _classPrivateFieldGet(_overlays, this).reduce((acc, overlay) => {
73569
+ return overlay.hasRenderingStateChanged() || acc;
73570
+ }, false));
73571
+ _classPrivateFieldGet(_overlays, this).forEach(overlay => overlay.updateStateOfRendering('before'));
73572
+ }
73536
73573
 
73537
73574
  /**
73538
73575
  * Runs logic for the overlays after the table is drawn.
73539
73576
  */
73540
- afterDraw() {}
73577
+ afterDraw() {
73578
+ this.syncScrollWithMaster();
73579
+ _classPrivateFieldGet(_overlays, this).forEach(overlay => {
73580
+ const hasRenderingStateChanged = overlay.hasRenderingStateChanged();
73581
+ overlay.updateStateOfRendering('after');
73582
+ if (hasRenderingStateChanged && !overlay.needFullRender) {
73583
+ overlay.reset();
73584
+ }
73585
+ });
73586
+ }
73541
73587
 
73542
73588
  /**
73543
73589
  * Refresh and redraw table.
73544
73590
  */
73545
- draw(fastDraw) {
73546
- (0, _array.arrayEach)(_classPrivateFieldGet(_overlays, this), overlay => {
73547
- overlay.adjustRootElementSize();
73548
- });
73591
+ refreshAll() {
73592
+ if (!this.wot.drawn) {
73593
+ return;
73594
+ }
73595
+ if (!this.wtTable.holder.parentNode) {
73596
+ // Walkontable was detached from DOM, but this handler was not removed
73597
+ this.destroy();
73598
+ return;
73599
+ }
73600
+ this.wot.draw(true);
73601
+ if (this.verticalScrolling) {
73602
+ this.inlineStartOverlay.onScroll(); // todo the inlineStartOverlay.onScroll() fires hook. Why is it needed there, not in any another place?
73603
+ }
73604
+ if (this.horizontalScrolling) {
73605
+ this.topOverlay.onScroll();
73606
+ }
73607
+ this.verticalScrolling = false;
73608
+ this.horizontalScrolling = false;
73549
73609
  }
73550
73610
 
73551
73611
  /**
@@ -73553,22 +73613,39 @@ class Overlays {
73553
73613
  */
73554
73614
  registerListeners() {
73555
73615
  const {
73616
+ rootDocument,
73556
73617
  rootWindow
73557
73618
  } = this.domBindings;
73619
+ const {
73620
+ mainTableScrollableElement: topOverlayScrollableElement
73621
+ } = this.topOverlay;
73622
+ const {
73623
+ mainTableScrollableElement: inlineStartOverlayScrollableElement
73624
+ } = this.inlineStartOverlay;
73625
+ this.eventManager.addEventListener(rootDocument.documentElement, 'keydown', event => this.onKeyDown(event));
73626
+ this.eventManager.addEventListener(rootDocument.documentElement, 'keyup', () => this.onKeyUp());
73627
+ this.eventManager.addEventListener(rootDocument, 'visibilitychange', () => this.onKeyUp());
73628
+ this.eventManager.addEventListener(topOverlayScrollableElement, 'scroll', event => this.onTableScroll(event), {
73629
+ passive: true
73630
+ });
73631
+ if (topOverlayScrollableElement !== inlineStartOverlayScrollableElement) {
73632
+ this.eventManager.addEventListener(inlineStartOverlayScrollableElement, 'scroll', event => this.onTableScroll(event), {
73633
+ passive: true
73634
+ });
73635
+ }
73558
73636
  const isHighPixelRatio = rootWindow.devicePixelRatio && rootWindow.devicePixelRatio > 1;
73559
73637
  const isScrollOnWindow = this.scrollableElement === rootWindow;
73560
73638
  const preventWheel = this.wtSettings.getSetting('preventWheel');
73561
73639
  const wheelEventOptions = {
73562
73640
  passive: isScrollOnWindow
73563
73641
  };
73564
- this.eventManager.addEventListener(this.scrollableElement, 'scroll', event => {
73565
- this.wot.draw(true);
73566
- }, {
73567
- passive: true
73568
- });
73569
73642
  if (preventWheel || isHighPixelRatio || !(0, _browser.isChrome)()) {
73570
73643
  this.eventManager.addEventListener(this.wtTable.wtRootElement, 'wheel', event => this.onCloneWheel(event, preventWheel), wheelEventOptions);
73571
73644
  }
73645
+ const overlays = [this.topOverlay, this.bottomOverlay, this.inlineStartOverlay, this.topInlineStartCornerOverlay, this.bottomInlineStartCornerOverlay];
73646
+ overlays.forEach(overlay => {
73647
+ this.eventManager.addEventListener(overlay.clone.wtTable.holder, 'wheel', event => this.onCloneWheel(event, preventWheel), wheelEventOptions);
73648
+ });
73572
73649
  let resizeTimeout;
73573
73650
  this.eventManager.addEventListener(rootWindow, 'resize', () => {
73574
73651
  (0, _feature.requestAnimationFrame)(() => {
@@ -73585,6 +73662,29 @@ class Overlays {
73585
73662
  }
73586
73663
  }
73587
73664
 
73665
+ /**
73666
+ * Scroll listener.
73667
+ *
73668
+ * @param {Event} event The mouse event object.
73669
+ */
73670
+ onTableScroll(event) {
73671
+ // There was if statement which controlled flow of this function. It avoided the execution of the next lines
73672
+ // on mobile devices. It was changed. Broader description of this case is included within issue #4856.
73673
+ const rootWindow = this.domBindings.rootWindow;
73674
+ const masterHorizontal = this.inlineStartOverlay.mainTableScrollableElement;
73675
+ const masterVertical = this.topOverlay.mainTableScrollableElement;
73676
+ const target = event.target;
73677
+
73678
+ // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered
73679
+ // by hot.refreshBorder
73680
+ if (this.keyPressed) {
73681
+ if (masterVertical !== rootWindow && target !== rootWindow && !event.target.contains(masterVertical) || masterHorizontal !== rootWindow && target !== rootWindow && !event.target.contains(masterHorizontal)) {
73682
+ return;
73683
+ }
73684
+ }
73685
+ this.syncScrollPositions(event);
73686
+ }
73687
+
73588
73688
  /**
73589
73689
  * Wheel listener for cloned overlays.
73590
73690
  *
@@ -73595,12 +73695,43 @@ class Overlays {
73595
73695
  const {
73596
73696
  rootWindow
73597
73697
  } = this.domBindings;
73698
+
73699
+ // There was if statement which controlled flow of this function. It avoided the execution of the next lines
73700
+ // on mobile devices. It was changed. Broader description of this case is included within issue #4856.
73701
+
73702
+ const masterHorizontal = this.inlineStartOverlay.mainTableScrollableElement;
73703
+ const masterVertical = this.topOverlay.mainTableScrollableElement;
73704
+ const target = event.target;
73705
+
73706
+ // For key press, sync only master -> overlay position because while pressing Walkontable.render is triggered
73707
+ // by hot.refreshBorder
73708
+ const shouldNotWheelVertically = masterVertical !== rootWindow && target !== rootWindow && !target.contains(masterVertical);
73709
+ const shouldNotWheelHorizontally = masterHorizontal !== rootWindow && target !== rootWindow && !target.contains(masterHorizontal);
73710
+ if (this.keyPressed && (shouldNotWheelVertically || shouldNotWheelHorizontally) || this.scrollableElement === rootWindow) {
73711
+ return;
73712
+ }
73598
73713
  const isScrollPossible = this.translateMouseWheelToScroll(event);
73599
73714
  if (preventDefault || this.scrollableElement !== rootWindow && isScrollPossible) {
73600
73715
  event.preventDefault();
73601
73716
  }
73602
73717
  }
73603
73718
 
73719
+ /**
73720
+ * Key down listener.
73721
+ *
73722
+ * @param {Event} event The keyboard event object.
73723
+ */
73724
+ onKeyDown(event) {
73725
+ this.keyPressed = (0, _unicode.isKey)(event.keyCode, 'ARROW_UP|ARROW_RIGHT|ARROW_DOWN|ARROW_LEFT');
73726
+ }
73727
+
73728
+ /**
73729
+ * Key up listener.
73730
+ */
73731
+ onKeyUp() {
73732
+ this.keyPressed = false;
73733
+ }
73734
+
73604
73735
  /**
73605
73736
  * Translate wheel event into scroll event and sync scroll overlays position.
73606
73737
  *
@@ -73643,6 +73774,130 @@ class Overlays {
73643
73774
  this.scrollableElement.scrollLeft += delta;
73644
73775
  return previousScroll !== this.scrollableElement.scrollLeft;
73645
73776
  }
73777
+
73778
+ /**
73779
+ * Synchronize scroll position between master table and overlay table.
73780
+ *
73781
+ * @private
73782
+ */
73783
+ syncScrollPositions() {
73784
+ if (this.destroyed) {
73785
+ return;
73786
+ }
73787
+ const {
73788
+ rootWindow
73789
+ } = this.domBindings;
73790
+ const topHolder = this.topOverlay.clone.wtTable.holder; // todo rethink
73791
+ const leftHolder = this.inlineStartOverlay.clone.wtTable.holder; // todo rethink
73792
+
73793
+ const [scrollLeft, scrollTop] = [this.scrollableElement.scrollLeft, this.scrollableElement.scrollTop];
73794
+ this.horizontalScrolling = topHolder.scrollLeft !== scrollLeft || this.lastScrollX !== rootWindow.scrollX;
73795
+ this.verticalScrolling = leftHolder.scrollTop !== scrollTop || this.lastScrollY !== rootWindow.scrollY;
73796
+ this.lastScrollX = rootWindow.scrollX;
73797
+ this.lastScrollY = rootWindow.scrollY;
73798
+ if (this.horizontalScrolling) {
73799
+ topHolder.scrollLeft = scrollLeft;
73800
+ const bottomHolder = this.bottomOverlay.needFullRender ? this.bottomOverlay.clone.wtTable.holder : null; // todo rethink
73801
+
73802
+ if (bottomHolder) {
73803
+ bottomHolder.scrollLeft = scrollLeft;
73804
+ }
73805
+ }
73806
+ if (this.verticalScrolling) {
73807
+ leftHolder.scrollTop = scrollTop;
73808
+ }
73809
+ this.refreshAll();
73810
+ }
73811
+
73812
+ /**
73813
+ * Synchronize overlay scrollbars with the master scrollbar.
73814
+ */
73815
+ syncScrollWithMaster() {
73816
+ if (!_classPrivateFieldGet(_hasRenderingStateChanged, this)) {
73817
+ return;
73818
+ }
73819
+ const master = this.topOverlay.mainTableScrollableElement;
73820
+ const {
73821
+ scrollLeft,
73822
+ scrollTop
73823
+ } = master;
73824
+ if (this.topOverlay.needFullRender) {
73825
+ this.topOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()
73826
+ }
73827
+ if (this.bottomOverlay.needFullRender) {
73828
+ this.bottomOverlay.clone.wtTable.holder.scrollLeft = scrollLeft; // todo rethink, *overlay.setScroll*()
73829
+ }
73830
+ if (this.inlineStartOverlay.needFullRender) {
73831
+ this.inlineStartOverlay.clone.wtTable.holder.scrollTop = scrollTop; // todo rethink, *overlay.setScroll*()
73832
+ }
73833
+ _classPrivateFieldSet(_hasRenderingStateChanged, this, false);
73834
+ }
73835
+
73836
+ /**
73837
+ *
73838
+ */
73839
+ destroy() {
73840
+ this.resizeObserver.disconnect();
73841
+ this.eventManager.destroy();
73842
+ // todo, probably all below `destroy` calls has no sense. To analyze
73843
+ this.topOverlay.destroy();
73844
+ if (this.bottomOverlay.clone) {
73845
+ this.bottomOverlay.destroy();
73846
+ }
73847
+ this.inlineStartOverlay.destroy();
73848
+ if (this.topInlineStartCornerOverlay) {
73849
+ this.topInlineStartCornerOverlay.destroy();
73850
+ }
73851
+ if (this.bottomInlineStartCornerOverlay && this.bottomInlineStartCornerOverlay.clone) {
73852
+ this.bottomInlineStartCornerOverlay.destroy();
73853
+ }
73854
+ this.destroyed = true;
73855
+ }
73856
+
73857
+ /**
73858
+ * @param {boolean} [fastDraw=false] When `true`, try to refresh only the positions of borders without rerendering
73859
+ * the data. It will only work if Table.draw() does not force
73860
+ * rendering anyway.
73861
+ */
73862
+ refresh() {
73863
+ let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
73864
+ const wasSpreaderSizeUpdated = this.updateLastSpreaderSize();
73865
+ if (wasSpreaderSizeUpdated) {
73866
+ this.adjustElementsSize();
73867
+ }
73868
+ if (this.bottomOverlay.clone) {
73869
+ this.bottomOverlay.refresh(fastDraw);
73870
+ }
73871
+ this.inlineStartOverlay.refresh(fastDraw);
73872
+ this.topOverlay.refresh(fastDraw);
73873
+ if (this.topInlineStartCornerOverlay) {
73874
+ this.topInlineStartCornerOverlay.refresh(fastDraw);
73875
+ }
73876
+ if (this.bottomInlineStartCornerOverlay && this.bottomInlineStartCornerOverlay.clone) {
73877
+ this.bottomInlineStartCornerOverlay.refresh(fastDraw);
73878
+ }
73879
+ }
73880
+
73881
+ /**
73882
+ * Update the last cached spreader size with the current size.
73883
+ *
73884
+ * @returns {boolean} `true` if the lastSpreaderSize cache was updated, `false` otherwise.
73885
+ */
73886
+ updateLastSpreaderSize() {
73887
+ const spreader = this.wtTable.spreader;
73888
+ const width = spreader.clientWidth;
73889
+ const height = spreader.clientHeight;
73890
+ const needsUpdating = width !== this.spreaderLastSize.width || height !== this.spreaderLastSize.height;
73891
+ if (needsUpdating) {
73892
+ this.spreaderLastSize.width = width;
73893
+ this.spreaderLastSize.height = height;
73894
+ }
73895
+ return needsUpdating;
73896
+ }
73897
+
73898
+ /**
73899
+ * Adjust overlays elements size and master table size.
73900
+ */
73646
73901
  adjustElementsSize() {
73647
73902
  const {
73648
73903
  wtViewport
@@ -73662,44 +73917,99 @@ class Overlays {
73662
73917
  const proposedHiderWidth = headerRowSize + this.inlineStartOverlay.sumCellSizes(0, totalColumns);
73663
73918
  const hiderElement = wtTable.hider;
73664
73919
  const hiderStyle = hiderElement.style;
73665
- hiderStyle.width = `${proposedHiderWidth}px`;
73666
- hiderStyle.height = `${proposedHiderHeight}px`;
73667
- const styleProperty = this.wtSettings.getSetting('rtlMode') ? 'right' : 'paddingLeft';
73668
- if (typeof this.wot.wtViewport.columnsRenderCalculator.startPosition === 'number') {
73669
- wtTable.spreader.style[styleProperty] = `${this.wot.wtViewport.columnsRenderCalculator.startPosition}px`;
73670
- } else if (totalColumns === 0) {
73671
- wtTable.spreader.style[styleProperty] = '0';
73672
- } else {
73673
- throw new Error('Incorrect value of the columnsRenderCalculator');
73674
- }
73675
- if (typeof this.wot.wtViewport.rowsRenderCalculator.startPosition === 'number') {
73676
- wtTable.spreader.style.paddingTop = `${this.wot.wtViewport.rowsRenderCalculator.startPosition}px`;
73677
- } else if (totalRows === 0) {
73678
- wtTable.spreader.style.paddingTop = '0';
73679
- } else {
73680
- throw new Error('Incorrect value of the rowsRenderCalculator');
73681
- }
73920
+ const isScrolledBeyondHiderHeight = () => {
73921
+ return isWindowScrolled ? false : this.scrollableElement.scrollTop > Math.max(0, proposedHiderHeight - wtTable.holder.clientHeight);
73922
+ };
73923
+ const isScrolledBeyondHiderWidth = () => {
73924
+ return isWindowScrolled ? false : this.scrollableElement.scrollLeft > Math.max(0, proposedHiderWidth - wtTable.holder.clientWidth);
73925
+ };
73926
+ const columnHeaderBorderCompensation = isScrolledBeyondHiderHeight() ? 1 : 0;
73927
+ const rowHeaderBorderCompensation = isScrolledBeyondHiderWidth() ? 1 : 0;
73928
+
73929
+ // If the elements are being adjusted after scrolling the table from the very beginning to the very end,
73930
+ // we need to adjust the hider dimensions by the header border size. (https://github.com/handsontable/dev-handsontable/issues/1772)
73931
+ hiderStyle.width = `${proposedHiderWidth + rowHeaderBorderCompensation}px`;
73932
+ hiderStyle.height = `${proposedHiderHeight + columnHeaderBorderCompensation}px`;
73933
+ this.topOverlay.adjustElementsSize();
73934
+ this.inlineStartOverlay.adjustElementsSize();
73935
+ this.bottomOverlay.adjustElementsSize();
73682
73936
  }
73683
73937
 
73684
73938
  /**
73939
+ * Expand the hider vertically element by the provided delta value.
73685
73940
  *
73941
+ * @param {number} heightDelta The delta value to expand the hider element by.
73686
73942
  */
73687
- destroy() {
73688
- this.resizeObserver.disconnect();
73689
- this.eventManager.destroy();
73690
- // todo, probably all below `destroy` calls has no sense. To analyze
73691
- this.topOverlay.destroy();
73692
- if (this.bottomOverlay.clone) {
73693
- this.bottomOverlay.destroy();
73943
+ expandHiderVerticallyBy(heightDelta) {
73944
+ const {
73945
+ wtTable
73946
+ } = this;
73947
+ wtTable.hider.style.height = `${parseInt(wtTable.hider.style.height, 10) + heightDelta}px`;
73948
+ }
73949
+
73950
+ /**
73951
+ * Expand the hider horizontally element by the provided delta value.
73952
+ *
73953
+ * @param {number} widthDelta The delta value to expand the hider element by.
73954
+ */
73955
+ expandHiderHorizontallyBy(widthDelta) {
73956
+ const {
73957
+ wtTable
73958
+ } = this;
73959
+ wtTable.hider.style.width = `${parseInt(wtTable.hider.style.width, 10) + widthDelta}px`;
73960
+ }
73961
+
73962
+ /**
73963
+ *
73964
+ */
73965
+ applyToDOM() {
73966
+ if (!this.wtTable.isVisible()) {
73967
+ return;
73694
73968
  }
73695
- this.inlineStartOverlay.destroy();
73696
- if (this.topInlineStartCornerOverlay) {
73697
- this.topInlineStartCornerOverlay.destroy();
73969
+ this.topOverlay.applyToDOM();
73970
+ if (this.bottomOverlay.clone) {
73971
+ this.bottomOverlay.applyToDOM();
73698
73972
  }
73699
- if (this.bottomInlineStartCornerOverlay && this.bottomInlineStartCornerOverlay.clone) {
73700
- this.bottomInlineStartCornerOverlay.destroy();
73973
+ this.inlineStartOverlay.applyToDOM();
73974
+ }
73975
+
73976
+ /**
73977
+ * Get the parent overlay of the provided element.
73978
+ *
73979
+ * @param {HTMLElement} element An element to process.
73980
+ * @returns {object|null}
73981
+ */
73982
+ getParentOverlay(element) {
73983
+ if (!element) {
73984
+ return null;
73701
73985
  }
73702
- this.destroyed = true;
73986
+ const overlays = [this.topOverlay, this.inlineStartOverlay, this.bottomOverlay, this.topInlineStartCornerOverlay, this.bottomInlineStartCornerOverlay];
73987
+ let result = null;
73988
+ (0, _array.arrayEach)(overlays, overlay => {
73989
+ if (!overlay) {
73990
+ return;
73991
+ }
73992
+ if (overlay.clone && overlay.clone.wtTable.TABLE.contains(element)) {
73993
+ // todo demeter
73994
+ result = overlay.clone;
73995
+ }
73996
+ });
73997
+ return result;
73998
+ }
73999
+
74000
+ /**
74001
+ * Synchronize the class names between the main overlay table and the tables on the other overlays.
74002
+ *
74003
+ */
74004
+ syncOverlayTableClassNames() {
74005
+ const masterTable = this.wtTable.TABLE;
74006
+ const overlays = [this.topOverlay, this.inlineStartOverlay, this.bottomOverlay, this.topInlineStartCornerOverlay, this.bottomInlineStartCornerOverlay];
74007
+ (0, _array.arrayEach)(overlays, elem => {
74008
+ if (!elem) {
74009
+ return;
74010
+ }
74011
+ elem.clone.wtTable.TABLE.className = masterTable.className; // todo demeter
74012
+ });
73703
74013
  }
73704
74014
  }
73705
74015
  var _default = exports["default"] = Overlays;
@@ -73795,7 +74105,6 @@ class BottomInlineStartCornerOverlay extends _base.Overlay {
73795
74105
  shouldBeRendered() {
73796
74106
  return this.wtSettings.getSetting('shouldRenderBottomOverlay') && this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
73797
74107
  }
73798
- draw() {}
73799
74108
 
73800
74109
  /**
73801
74110
  * Updates the corner overlay position.
@@ -73905,7 +74214,6 @@ __webpack_require__(201);
73905
74214
  __webpack_require__(283);
73906
74215
  __webpack_require__(311);
73907
74216
  __webpack_require__(329);
73908
- __webpack_require__(338);
73909
74217
  var _defineProperty2 = _interopRequireDefault(__webpack_require__(504));
73910
74218
  var _element = __webpack_require__(351);
73911
74219
  var _function = __webpack_require__(497);
@@ -73919,6 +74227,7 @@ var _a11y = __webpack_require__(496);
73919
74227
  /**
73920
74228
  * @todo These mixes are never added to the class Table, however their members are used here.
73921
74229
  * @todo Continue: Potentially it works only, because some of these mixes are added to every inherited class.
74230
+ * @todo Refactoring, move code from `if(this.isMaster)` into MasterTable, and others like that.
73922
74231
  * @mixes stickyColumnsStart
73923
74232
  * @mixes stickyRowsBottom
73924
74233
  * @mixes stickyRowsTop
@@ -73975,6 +74284,7 @@ class Table {
73975
74284
  *
73976
74285
  * @type {boolean}
73977
74286
  */
74287
+ this.isMaster = name === 'master';
73978
74288
  this.name = name;
73979
74289
  this.dataAccessObject = dataAccessObject;
73980
74290
  this.facadeGetter = facadeGetter;
@@ -73991,7 +74301,9 @@ class Table {
73991
74301
  this.hider = this.createHider(this.spreader);
73992
74302
  this.holder = this.createHolder(this.hider);
73993
74303
  this.wtRootElement = this.holder.parentNode;
73994
- this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
74304
+ if (this.isMaster) {
74305
+ this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
74306
+ }
73995
74307
  this.fixTableDomTree();
73996
74308
  this.rowFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
73997
74309
  this.columnFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
@@ -74011,31 +74323,7 @@ class Table {
74011
74323
  TBODY: this.TBODY,
74012
74324
  rowUtils: this.rowUtils,
74013
74325
  columnUtils: this.columnUtils,
74014
- cellRenderer: (row, column, TD) => {
74015
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
74016
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
74017
- this.wtSettings.getSettingPure('cellRenderer')(row, column, TD);
74018
- if (column < fixedColumnsStart) {
74019
- const left = this.dataAccessObject.wtViewport.getRowHeaderWidth() + this.dataAccessObject.wtOverlays.inlineStartOverlay.sumCellSizes(0, column);
74020
- TD.style.position = 'sticky';
74021
- TD.style.left = `${left}px`;
74022
- if (row < fixedRowsTop) {
74023
- TD.style.zIndex = '9';
74024
- } else {
74025
- TD.style.zIndex = '5';
74026
- }
74027
- }
74028
- if (row < fixedRowsTop) {
74029
- const top = this.dataAccessObject.wtViewport.getColumnHeaderHeight() + this.dataAccessObject.wtOverlays.topOverlay.sumCellSizes(0, row);
74030
- TD.style.position = 'sticky';
74031
- TD.style.top = `${top}px`;
74032
- if (column < fixedColumnsStart) {
74033
- TD.style.zIndex = '10';
74034
- } else {
74035
- TD.style.zIndex = '6';
74036
- }
74037
- }
74038
- },
74326
+ cellRenderer: this.wtSettings.getSettingPure('cellRenderer'),
74039
74327
  stylesHandler: this.dataAccessObject.stylesHandler
74040
74328
  });
74041
74329
  }
@@ -74135,10 +74423,12 @@ class Table {
74135
74423
  // if TABLE is detached (e.g. in Jasmine test), it has no parentNode so we cannot attach holder to it
74136
74424
  parent.insertBefore(holder, hider);
74137
74425
  }
74138
- holder.parentNode.className += 'ht_master handsontable';
74139
- holder.parentNode.setAttribute('dir', this.wtSettings.getSettingPure('rtlMode') ? 'rtl' : 'ltr');
74140
- if (this.wtSettings.getSetting('ariaTags')) {
74141
- (0, _element.setAttribute)(holder.parentNode, [(0, _a11y.A11Y_PRESENTATION)()]);
74426
+ if (this.isMaster) {
74427
+ holder.parentNode.className += 'ht_master handsontable';
74428
+ holder.parentNode.setAttribute('dir', this.wtSettings.getSettingPure('rtlMode') ? 'rtl' : 'ltr');
74429
+ if (this.wtSettings.getSetting('ariaTags')) {
74430
+ (0, _element.setAttribute)(holder.parentNode, [(0, _a11y.A11Y_PRESENTATION)()]);
74431
+ }
74142
74432
  }
74143
74433
  holder.appendChild(hider);
74144
74434
  }
@@ -74166,89 +74456,100 @@ class Table {
74166
74456
  } = this.dataAccessObject;
74167
74457
  const totalRows = wtSettings.getSetting('totalRows');
74168
74458
  const totalColumns = wtSettings.getSetting('totalColumns');
74169
- const rowHeaders = wtSettings.getSetting('rowHeaders').map(origRowRenderer => {
74170
- return (row, TH, column) => {
74171
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
74172
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
74173
- if (row < fixedRowsTop) {
74174
- let top = 0;
74175
- if (row >= 0) {
74176
- top = this.dataAccessObject.wtViewport.getColumnHeaderHeight() + this.dataAccessObject.wtOverlays.topOverlay.sumCellSizes(0, row);
74177
- }
74178
- TH.style.top = `${top}px`;
74179
- if (column < fixedColumnsStart) {
74180
- TH.style.zIndex = '20';
74181
- } else {
74182
- TH.style.zIndex = '10';
74183
- }
74184
- } else {
74185
- TH.style.top = '0px';
74186
- TH.style.zIndex = '3';
74187
- }
74188
- origRowRenderer(row, TH, column);
74189
- TH.style.position = 'sticky';
74190
- TH.style.left = '0px';
74191
- };
74192
- });
74459
+ const rowHeaders = wtSettings.getSetting('rowHeaders');
74193
74460
  const rowHeadersCount = rowHeaders.length;
74194
- const columnHeaders = wtSettings.getSetting('columnHeaders').map(origColumnRenderer => {
74195
- return (column, TH, row) => {
74196
- const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
74197
- const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
74198
- if (column < fixedColumnsStart) {
74199
- let left = 0;
74200
- if (column >= 0) {
74201
- left = this.dataAccessObject.wtViewport.getRowHeaderWidth() + this.dataAccessObject.wtOverlays.inlineStartOverlay.sumCellSizes(0, column);
74202
- }
74203
- TH.style.left = `${left}px`;
74204
- if (row < fixedRowsTop) {
74205
- TH.style.zIndex = '20';
74206
- } else {
74207
- TH.style.zIndex = '10';
74208
- }
74209
- } else {
74210
- TH.style.zIndex = '3';
74211
- TH.style.left = '0px';
74212
- }
74213
- origColumnRenderer(column, TH, row);
74214
- TH.style.position = 'sticky';
74215
- TH.style.top = '0px';
74216
- };
74217
- });
74461
+ const columnHeaders = wtSettings.getSetting('columnHeaders');
74218
74462
  const columnHeadersCount = columnHeaders.length;
74219
74463
  let runFastDraw = fastDraw;
74220
- wtOverlays.beforeDraw();
74221
- this.holderOffset = (0, _element.offset)(this.holder);
74222
- runFastDraw = wtViewport.createCalculators(runFastDraw);
74223
- if (!runFastDraw) {
74224
- this.tableOffset = (0, _element.offset)(this.TABLE);
74464
+ if (this.isMaster) {
74465
+ wtOverlays.beforeDraw();
74466
+ this.holderOffset = (0, _element.offset)(this.holder);
74467
+ runFastDraw = wtViewport.createCalculators(runFastDraw);
74468
+ if (rowHeadersCount && !wtSettings.getSetting('fixedColumnsStart')) {
74469
+ const leftScrollPos = wtOverlays.inlineStartOverlay.getScrollPosition();
74470
+ const previousState = this.correctHeaderWidth;
74471
+ this.correctHeaderWidth = leftScrollPos !== 0;
74472
+ if (previousState !== this.correctHeaderWidth) {
74473
+ runFastDraw = false;
74474
+ }
74475
+ }
74476
+ }
74477
+ if (runFastDraw) {
74478
+ if (this.isMaster) {
74479
+ wtOverlays.refresh(true);
74480
+ }
74481
+ } else {
74482
+ if (this.isMaster) {
74483
+ this.tableOffset = (0, _element.offset)(this.TABLE);
74484
+ } else {
74485
+ this.tableOffset = this.dataAccessObject.parentTableOffset;
74486
+ }
74225
74487
  const startRow = totalRows > 0 ? this.getFirstRenderedRow() : 0;
74226
74488
  const startColumn = totalColumns > 0 ? this.getFirstRenderedColumn() : 0;
74227
74489
  this.rowFilter = new _row.default(startRow, totalRows, columnHeadersCount);
74228
74490
  this.columnFilter = new _column.default(startColumn, totalColumns, rowHeadersCount);
74229
74491
  let performRedraw = true;
74230
- this.alignOverlaysWithTrimmingContainer(); // todo It calls method from child class (MasterTable).
74231
- const skipRender = {};
74232
- this.wtSettings.getSetting('beforeDraw', true, skipRender);
74233
- performRedraw = skipRender.skipRender !== true;
74492
+
74493
+ // Only master table rendering can be skipped
74494
+ if (this.isMaster) {
74495
+ this.alignOverlaysWithTrimmingContainer(); // todo It calls method from child class (MasterTable).
74496
+ const skipRender = {};
74497
+ this.wtSettings.getSetting('beforeDraw', true, skipRender);
74498
+ performRedraw = skipRender.skipRender !== true;
74499
+ }
74234
74500
  if (performRedraw) {
74235
74501
  this.tableRenderer.setHeaderContentRenderers(rowHeaders, columnHeaders);
74502
+ if (this.is(_overlay.CLONE_BOTTOM) || this.is(_overlay.CLONE_BOTTOM_INLINE_START_CORNER)) {
74503
+ // do NOT render headers on the bottom or bottom-left corner overlay
74504
+ this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);
74505
+ }
74236
74506
  this.resetOversizedRows();
74237
74507
  this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
74238
- this.markOversizedColumnHeaders();
74508
+ if (this.isMaster) {
74509
+ this.markOversizedColumnHeaders();
74510
+ }
74239
74511
  this.adjustColumnHeaderHeights();
74240
- this.markOversizedRows();
74241
- if (!this.wtSettings.getSetting('externalRowCalculator')) {
74242
- wtViewport.createVisibleCalculators();
74512
+ if (this.isMaster || this.is(_overlay.CLONE_BOTTOM)) {
74513
+ this.markOversizedRows();
74243
74514
  }
74244
- wtOverlays.adjustElementsSize();
74245
- // wtOverlays.draw(fastDraw);
74246
-
74247
- this.wtSettings.getSetting('onDraw', true);
74515
+ if (this.isMaster) {
74516
+ if (!this.wtSettings.getSetting('externalRowCalculator')) {
74517
+ wtViewport.createVisibleCalculators();
74518
+ }
74519
+ wtOverlays.refresh(false);
74520
+ wtOverlays.applyToDOM();
74521
+ this.wtSettings.getSetting('onDraw', true);
74522
+ } else if (this.is(_overlay.CLONE_BOTTOM)) {
74523
+ this.dataAccessObject.cloneSource.wtOverlays.adjustElementsSize();
74524
+ }
74525
+ }
74526
+ }
74527
+ let positionChanged = false;
74528
+ if (this.isMaster) {
74529
+ positionChanged = wtOverlays.topOverlay.resetFixedPosition();
74530
+ if (wtOverlays.bottomOverlay.clone) {
74531
+ positionChanged = wtOverlays.bottomOverlay.resetFixedPosition() || positionChanged;
74532
+ }
74533
+ positionChanged = wtOverlays.inlineStartOverlay.resetFixedPosition() || positionChanged;
74534
+ if (wtOverlays.topInlineStartCornerOverlay) {
74535
+ wtOverlays.topInlineStartCornerOverlay.resetFixedPosition();
74248
74536
  }
74537
+ if (wtOverlays.bottomInlineStartCornerOverlay && wtOverlays.bottomInlineStartCornerOverlay.clone) {
74538
+ wtOverlays.bottomInlineStartCornerOverlay.resetFixedPosition();
74539
+ }
74540
+ }
74541
+ if (positionChanged) {
74542
+ // It refreshes the cells borders caused by a 1px shift (introduced by overlays which add or
74543
+ // remove `innerBorderTop` and `innerBorderInlineStart` CSS classes to the DOM element. This happens
74544
+ // when there is a switch between rendering from 0 to N rows/columns and vice versa).
74545
+ wtOverlays.refreshAll(); // `refreshAll()` internally already calls `refreshSelections()` method
74546
+ wtOverlays.adjustElementsSize();
74547
+ } else {
74548
+ this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
74549
+ }
74550
+ if (this.isMaster) {
74551
+ wtOverlays.afterDraw();
74249
74552
  }
74250
- this.dataAccessObject.selectionManager.setActiveOverlay(this.facadeGetter()).render(runFastDraw);
74251
- wtOverlays.afterDraw();
74252
74553
  this.dataAccessObject.drawn = true;
74253
74554
  return this;
74254
74555
  }
@@ -74320,6 +74621,9 @@ class Table {
74320
74621
  const {
74321
74622
  wtViewport
74322
74623
  } = this.dataAccessObject;
74624
+ if (!this.isMaster && !this.is(_overlay.CLONE_BOTTOM)) {
74625
+ return;
74626
+ }
74323
74627
  if (!wtSettings.getSetting('externalRowCalculator')) {
74324
74628
  const rowsToRender = this.getRenderedRowsCount();
74325
74629
 
@@ -74355,7 +74659,7 @@ class Table {
74355
74659
  getCell(coords) {
74356
74660
  let row = coords.row;
74357
74661
  let column = coords.col;
74358
- const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, false, 'render');
74662
+ const hookResult = this.wtSettings.getSetting('onModifyGetCellCoords', row, column, !this.isMaster, 'render');
74359
74663
  if (hookResult && Array.isArray(hookResult)) {
74360
74664
  [row, column] = hookResult;
74361
74665
  }
@@ -77464,14 +77768,33 @@ class Overlay {
77464
77768
  this.wtRootElement = wtRootElement;
77465
77769
  this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
77466
77770
  this.needFullRender = this.shouldBeRendered();
77467
- const preventOverflow = this.wtSettings.getSetting('preventOverflow');
77468
- const tableParent = this.wot.wtTable.wtRootElement.parentNode;
77469
- if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === _constants.CLONE_TOP || preventOverflow === 'vertical' && this.type === _constants.CLONE_INLINE_START) {
77470
- this.mainTableScrollableElement = domBindings.rootWindow;
77471
- } else if (domBindings.rootWindow.getComputedStyle(tableParent).getPropertyValue('overflow') === 'hidden') {
77472
- this.mainTableScrollableElement = holder;
77473
- } else {
77474
- this.mainTableScrollableElement = (0, _element.getScrollableElement)(TABLE);
77771
+ this.clone = this.makeClone();
77772
+ }
77773
+
77774
+ /**
77775
+ * Checks if the overlay rendering state has changed.
77776
+ *
77777
+ * @returns {boolean}
77778
+ */
77779
+ hasRenderingStateChanged() {
77780
+ return this.needFullRender !== this.shouldBeRendered();
77781
+ }
77782
+
77783
+ /**
77784
+ * Updates internal state with an information about the need of full rendering of the overlay in the next draw cycles.
77785
+ *
77786
+ * If the state is changed to render the overlay, the `needFullRender` property is set to `true` which means that
77787
+ * the overlay will be fully rendered in the current draw cycle. If the state is changed to not render the overlay,
77788
+ * the `needFullRender` property is set to `false` which means that the overlay will be fully rendered in the
77789
+ * current draw cycle but it will not be rendered in the next draw cycles.
77790
+ *
77791
+ * @param {'before' | 'after'} drawPhase The phase of the rendering process.
77792
+ */
77793
+ updateStateOfRendering(drawPhase) {
77794
+ if (drawPhase === 'before' && this.shouldBeRendered()) {
77795
+ this.needFullRender = true;
77796
+ } else if (drawPhase === 'after' && !this.shouldBeRendered()) {
77797
+ this.needFullRender = false;
77475
77798
  }
77476
77799
  }
77477
77800
 
@@ -77491,6 +77814,23 @@ class Overlay {
77491
77814
  this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
77492
77815
  }
77493
77816
 
77817
+ /**
77818
+ * Update the main scrollable element.
77819
+ */
77820
+ updateMainScrollableElement() {
77821
+ const {
77822
+ wtTable
77823
+ } = this.wot;
77824
+ const {
77825
+ rootWindow
77826
+ } = this.domBindings;
77827
+ if (rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden') {
77828
+ this.mainTableScrollableElement = this.wot.wtTable.holder;
77829
+ } else {
77830
+ this.mainTableScrollableElement = (0, _element.getScrollableElement)(wtTable.TABLE);
77831
+ }
77832
+ }
77833
+
77494
77834
  /**
77495
77835
  * Calculates coordinates of the provided element, relative to the root Handsontable element.
77496
77836
  * NOTE: The element needs to be a child of the overlay in order for the method to work correctly.
@@ -77937,6 +78277,25 @@ class CoreAbstract {
77937
78277
  if (!topmost) {
77938
78278
  return this.wtTable.getCell(coords);
77939
78279
  }
78280
+ const totalRows = this.wtSettings.getSetting('totalRows');
78281
+ const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
78282
+ const fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
78283
+ const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
78284
+ if (coords.row < fixedRowsTop && coords.col < fixedColumnsStart) {
78285
+ return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(coords);
78286
+ } else if (coords.row < fixedRowsTop) {
78287
+ return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);
78288
+ } else if (coords.col < fixedColumnsStart && coords.row >= totalRows - fixedRowsBottom) {
78289
+ if (this.wtOverlays.bottomInlineStartCornerOverlay && this.wtOverlays.bottomInlineStartCornerOverlay.clone) {
78290
+ return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(coords);
78291
+ }
78292
+ } else if (coords.col < fixedColumnsStart) {
78293
+ return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(coords);
78294
+ } else if (coords.row < totalRows && coords.row >= totalRows - fixedRowsBottom) {
78295
+ if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {
78296
+ return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);
78297
+ }
78298
+ }
77940
78299
  return this.wtTable.getCell(coords);
77941
78300
  }
77942
78301
 
@@ -78511,7 +78870,6 @@ class BottomOverlay extends _base.Overlay {
78511
78870
  shouldBeRendered() {
78512
78871
  return this.wtSettings.getSetting('shouldRenderBottomOverlay');
78513
78872
  }
78514
- draw() {}
78515
78873
 
78516
78874
  /**
78517
78875
  * Updates the top overlay position.
@@ -79022,7 +79380,6 @@ class InlineStartOverlay extends _base.Overlay {
79022
79380
  shouldBeRendered() {
79023
79381
  return this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
79024
79382
  }
79025
- draw() {}
79026
79383
 
79027
79384
  /**
79028
79385
  * Updates the left overlay position.
@@ -81155,7 +81512,6 @@ class TopInlineStartCornerOverlay extends _base.Overlay {
81155
81512
  shouldBeRendered() {
81156
81513
  return this.wtSettings.getSetting('shouldRenderTopOverlay') && this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
81157
81514
  }
81158
- draw() {}
81159
81515
 
81160
81516
  /**
81161
81517
  * Updates the corner overlay position.
@@ -81402,7 +81758,6 @@ class TopOverlay extends _base.Overlay {
81402
81758
  shouldBeRendered() {
81403
81759
  return this.wtSettings.getSetting('shouldRenderTopOverlay');
81404
81760
  }
81405
- draw() {}
81406
81761
 
81407
81762
  /**
81408
81763
  * Updates the top overlay position.
@@ -97955,6 +98310,7 @@ class BaseEditor {
97955
98310
  * @returns {{top: number, start: number, width: number, maxWidth: number, height: number, maxHeight: number} | undefined}
97956
98311
  */
97957
98312
  getEditedCellRect() {
98313
+ var _wtOverlays$getParent;
97958
98314
  const TD = this.getEditedCell();
97959
98315
 
97960
98316
  // TD is outside of the viewport.
@@ -97977,7 +98333,7 @@ class BaseEditor {
97977
98333
  const gridMostRightPos = rootWindow.innerWidth - containerOffset.left - containerWidth;
97978
98334
  const {
97979
98335
  wtTable: overlayTable
97980
- } = this.hot.view._wt;
98336
+ } = (_wtOverlays$getParent = wtOverlays.getParentOverlay(TD)) !== null && _wtOverlays$getParent !== void 0 ? _wtOverlays$getParent : this.hot.view._wt;
97981
98337
  const overlayName = overlayTable.name;
97982
98338
  const scrollTop = ['master', 'inline_start'].includes(overlayName) ? containerScrollTop : 0;
97983
98339
  const scrollLeft = ['master', 'top', 'bottom'].includes(overlayName) ? containerScrollLeft : 0;
@@ -125872,7 +126228,7 @@ function _setupListening(event) {
125872
126228
  if ((0, _event.isRightClick)(event)) {
125873
126229
  return;
125874
126230
  }
125875
- const scrollHandler = this.hot.view._wt.wtOverlays.scrollableElement;
126231
+ const scrollHandler = this.hot.view._wt.wtOverlays.topOverlay.mainTableScrollableElement;
125876
126232
  this.setBoundaries(scrollHandler !== this.hot.rootWindow ? scrollHandler.getBoundingClientRect() : undefined);
125877
126233
  this.setCallback((scrollX, scrollY) => {
125878
126234
  var _scrollHandler$scroll, _scrollHandler$scroll2;