handsontable 0.0.0-next-f52ab71-20250121 → 0.0.0-next-5cb0a2b-20250129

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 +8 -3
  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
@@ -145,6 +145,25 @@ class CoreAbstract {
145
145
  if (!topmost) {
146
146
  return this.wtTable.getCell(coords);
147
147
  }
148
+ const totalRows = this.wtSettings.getSetting('totalRows');
149
+ const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
150
+ const fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
151
+ const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
152
+ if (coords.row < fixedRowsTop && coords.col < fixedColumnsStart) {
153
+ return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(coords);
154
+ } else if (coords.row < fixedRowsTop) {
155
+ return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);
156
+ } else if (coords.col < fixedColumnsStart && coords.row >= totalRows - fixedRowsBottom) {
157
+ if (this.wtOverlays.bottomInlineStartCornerOverlay && this.wtOverlays.bottomInlineStartCornerOverlay.clone) {
158
+ return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(coords);
159
+ }
160
+ } else if (coords.col < fixedColumnsStart) {
161
+ return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(coords);
162
+ } else if (coords.row < totalRows && coords.row >= totalRows - fixedRowsBottom) {
163
+ if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {
164
+ return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);
165
+ }
166
+ }
148
167
  return this.wtTable.getCell(coords);
149
168
  }
150
169
 
@@ -141,6 +141,25 @@ export default class CoreAbstract {
141
141
  if (!topmost) {
142
142
  return this.wtTable.getCell(coords);
143
143
  }
144
+ const totalRows = this.wtSettings.getSetting('totalRows');
145
+ const fixedRowsTop = this.wtSettings.getSetting('fixedRowsTop');
146
+ const fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
147
+ const fixedColumnsStart = this.wtSettings.getSetting('fixedColumnsStart');
148
+ if (coords.row < fixedRowsTop && coords.col < fixedColumnsStart) {
149
+ return this.wtOverlays.topInlineStartCornerOverlay.clone.wtTable.getCell(coords);
150
+ } else if (coords.row < fixedRowsTop) {
151
+ return this.wtOverlays.topOverlay.clone.wtTable.getCell(coords);
152
+ } else if (coords.col < fixedColumnsStart && coords.row >= totalRows - fixedRowsBottom) {
153
+ if (this.wtOverlays.bottomInlineStartCornerOverlay && this.wtOverlays.bottomInlineStartCornerOverlay.clone) {
154
+ return this.wtOverlays.bottomInlineStartCornerOverlay.clone.wtTable.getCell(coords);
155
+ }
156
+ } else if (coords.col < fixedColumnsStart) {
157
+ return this.wtOverlays.inlineStartOverlay.clone.wtTable.getCell(coords);
158
+ } else if (coords.row < totalRows && coords.row >= totalRows - fixedRowsBottom) {
159
+ if (this.wtOverlays.bottomOverlay && this.wtOverlays.bottomOverlay.clone) {
160
+ return this.wtOverlays.bottomOverlay.clone.wtTable.getCell(coords);
161
+ }
162
+ }
144
163
  return this.wtTable.getCell(coords);
145
164
  }
146
165
 
@@ -63,14 +63,33 @@ class Overlay {
63
63
  this.wtRootElement = wtRootElement;
64
64
  this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
65
65
  this.needFullRender = this.shouldBeRendered();
66
- const preventOverflow = this.wtSettings.getSetting('preventOverflow');
67
- const tableParent = this.wot.wtTable.wtRootElement.parentNode;
68
- if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === _constants.CLONE_TOP || preventOverflow === 'vertical' && this.type === _constants.CLONE_INLINE_START) {
69
- this.mainTableScrollableElement = domBindings.rootWindow;
70
- } else if (domBindings.rootWindow.getComputedStyle(tableParent).getPropertyValue('overflow') === 'hidden') {
71
- this.mainTableScrollableElement = holder;
72
- } else {
73
- this.mainTableScrollableElement = (0, _element.getScrollableElement)(TABLE);
66
+ this.clone = this.makeClone();
67
+ }
68
+
69
+ /**
70
+ * Checks if the overlay rendering state has changed.
71
+ *
72
+ * @returns {boolean}
73
+ */
74
+ hasRenderingStateChanged() {
75
+ return this.needFullRender !== this.shouldBeRendered();
76
+ }
77
+
78
+ /**
79
+ * Updates internal state with an information about the need of full rendering of the overlay in the next draw cycles.
80
+ *
81
+ * If the state is changed to render the overlay, the `needFullRender` property is set to `true` which means that
82
+ * the overlay will be fully rendered in the current draw cycle. If the state is changed to not render the overlay,
83
+ * the `needFullRender` property is set to `false` which means that the overlay will be fully rendered in the
84
+ * current draw cycle but it will not be rendered in the next draw cycles.
85
+ *
86
+ * @param {'before' | 'after'} drawPhase The phase of the rendering process.
87
+ */
88
+ updateStateOfRendering(drawPhase) {
89
+ if (drawPhase === 'before' && this.shouldBeRendered()) {
90
+ this.needFullRender = true;
91
+ } else if (drawPhase === 'after' && !this.shouldBeRendered()) {
92
+ this.needFullRender = false;
74
93
  }
75
94
  }
76
95
 
@@ -90,6 +109,23 @@ class Overlay {
90
109
  this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
91
110
  }
92
111
 
112
+ /**
113
+ * Update the main scrollable element.
114
+ */
115
+ updateMainScrollableElement() {
116
+ const {
117
+ wtTable
118
+ } = this.wot;
119
+ const {
120
+ rootWindow
121
+ } = this.domBindings;
122
+ if (rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden') {
123
+ this.mainTableScrollableElement = this.wot.wtTable.holder;
124
+ } else {
125
+ this.mainTableScrollableElement = (0, _element.getScrollableElement)(wtTable.TABLE);
126
+ }
127
+ }
128
+
93
129
  /**
94
130
  * Calculates coordinates of the provided element, relative to the root Handsontable element.
95
131
  * NOTE: The element needs to be a child of the overlay in order for the method to work correctly.
@@ -59,14 +59,33 @@ export class Overlay {
59
59
  this.wtRootElement = wtRootElement;
60
60
  this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);
61
61
  this.needFullRender = this.shouldBeRendered();
62
- const preventOverflow = this.wtSettings.getSetting('preventOverflow');
63
- const tableParent = this.wot.wtTable.wtRootElement.parentNode;
64
- if (preventOverflow === true || preventOverflow === 'horizontal' && this.type === CLONE_TOP || preventOverflow === 'vertical' && this.type === CLONE_INLINE_START) {
65
- this.mainTableScrollableElement = domBindings.rootWindow;
66
- } else if (domBindings.rootWindow.getComputedStyle(tableParent).getPropertyValue('overflow') === 'hidden') {
67
- this.mainTableScrollableElement = holder;
68
- } else {
69
- this.mainTableScrollableElement = getScrollableElement(TABLE);
62
+ this.clone = this.makeClone();
63
+ }
64
+
65
+ /**
66
+ * Checks if the overlay rendering state has changed.
67
+ *
68
+ * @returns {boolean}
69
+ */
70
+ hasRenderingStateChanged() {
71
+ return this.needFullRender !== this.shouldBeRendered();
72
+ }
73
+
74
+ /**
75
+ * Updates internal state with an information about the need of full rendering of the overlay in the next draw cycles.
76
+ *
77
+ * If the state is changed to render the overlay, the `needFullRender` property is set to `true` which means that
78
+ * the overlay will be fully rendered in the current draw cycle. If the state is changed to not render the overlay,
79
+ * the `needFullRender` property is set to `false` which means that the overlay will be fully rendered in the
80
+ * current draw cycle but it will not be rendered in the next draw cycles.
81
+ *
82
+ * @param {'before' | 'after'} drawPhase The phase of the rendering process.
83
+ */
84
+ updateStateOfRendering(drawPhase) {
85
+ if (drawPhase === 'before' && this.shouldBeRendered()) {
86
+ this.needFullRender = true;
87
+ } else if (drawPhase === 'after' && !this.shouldBeRendered()) {
88
+ this.needFullRender = false;
70
89
  }
71
90
  }
72
91
 
@@ -86,6 +105,23 @@ export class Overlay {
86
105
  this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);
87
106
  }
88
107
 
108
+ /**
109
+ * Update the main scrollable element.
110
+ */
111
+ updateMainScrollableElement() {
112
+ const {
113
+ wtTable
114
+ } = this.wot;
115
+ const {
116
+ rootWindow
117
+ } = this.domBindings;
118
+ if (rootWindow.getComputedStyle(wtTable.wtRootElement.parentNode).getPropertyValue('overflow') === 'hidden') {
119
+ this.mainTableScrollableElement = this.wot.wtTable.holder;
120
+ } else {
121
+ this.mainTableScrollableElement = getScrollableElement(wtTable.TABLE);
122
+ }
123
+ }
124
+
89
125
  /**
90
126
  * Calculates coordinates of the provided element, relative to the root Handsontable element.
91
127
  * NOTE: The element needs to be a child of the overlay in order for the method to work correctly.
@@ -54,7 +54,6 @@ class BottomOverlay extends _base.Overlay {
54
54
  shouldBeRendered() {
55
55
  return this.wtSettings.getSetting('shouldRenderBottomOverlay');
56
56
  }
57
- draw() {}
58
57
 
59
58
  /**
60
59
  * Updates the top overlay position.
@@ -50,7 +50,6 @@ export class BottomOverlay extends Overlay {
50
50
  shouldBeRendered() {
51
51
  return this.wtSettings.getSetting('shouldRenderBottomOverlay');
52
52
  }
53
- draw() {}
54
53
 
55
54
  /**
56
55
  * Updates the top overlay position.
@@ -46,7 +46,6 @@ class BottomInlineStartCornerOverlay extends _base.Overlay {
46
46
  shouldBeRendered() {
47
47
  return this.wtSettings.getSetting('shouldRenderBottomOverlay') && this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
48
48
  }
49
- draw() {}
50
49
 
51
50
  /**
52
51
  * Updates the corner overlay position.
@@ -42,7 +42,6 @@ export class BottomInlineStartCornerOverlay extends Overlay {
42
42
  shouldBeRendered() {
43
43
  return this.wtSettings.getSetting('shouldRenderBottomOverlay') && this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
44
44
  }
45
- draw() {}
46
45
 
47
46
  /**
48
47
  * Updates the corner overlay position.
@@ -44,7 +44,6 @@ class InlineStartOverlay extends _base.Overlay {
44
44
  shouldBeRendered() {
45
45
  return this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
46
46
  }
47
- draw() {}
48
47
 
49
48
  /**
50
49
  * Updates the left overlay position.
@@ -40,7 +40,6 @@ export class InlineStartOverlay extends Overlay {
40
40
  shouldBeRendered() {
41
41
  return this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
42
42
  }
43
- draw() {}
44
43
 
45
44
  /**
46
45
  * Updates the left overlay position.
@@ -55,7 +55,6 @@ class TopOverlay extends _base.Overlay {
55
55
  shouldBeRendered() {
56
56
  return this.wtSettings.getSetting('shouldRenderTopOverlay');
57
57
  }
58
- draw() {}
59
58
 
60
59
  /**
61
60
  * Updates the top overlay position.
@@ -51,7 +51,6 @@ export class TopOverlay extends Overlay {
51
51
  shouldBeRendered() {
52
52
  return this.wtSettings.getSetting('shouldRenderTopOverlay');
53
53
  }
54
- draw() {}
55
54
 
56
55
  /**
57
56
  * Updates the top overlay position.
@@ -62,7 +62,6 @@ class TopInlineStartCornerOverlay extends _base.Overlay {
62
62
  shouldBeRendered() {
63
63
  return this.wtSettings.getSetting('shouldRenderTopOverlay') && this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
64
64
  }
65
- draw() {}
66
65
 
67
66
  /**
68
67
  * Updates the corner overlay position.
@@ -58,7 +58,6 @@ export class TopInlineStartCornerOverlay extends Overlay {
58
58
  shouldBeRendered() {
59
59
  return this.wtSettings.getSetting('shouldRenderTopOverlay') && this.wtSettings.getSetting('shouldRenderInlineStartOverlay');
60
60
  }
61
- draw() {}
62
61
 
63
62
  /**
64
63
  * Updates the corner overlay position.