handsontable 15.2.0-next-43dc07f-20250319 → 15.3.0-next-38401d0-20250424

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 (223) hide show
  1. package/3rdparty/walkontable/src/cell/range.js +14 -0
  2. package/3rdparty/walkontable/src/cell/range.mjs +14 -0
  3. package/3rdparty/walkontable/src/core/_base.js +2 -2
  4. package/3rdparty/walkontable/src/core/_base.mjs +3 -3
  5. package/3rdparty/walkontable/src/overlay/_base.js +0 -2
  6. package/3rdparty/walkontable/src/overlay/_base.mjs +0 -2
  7. package/3rdparty/walkontable/src/overlay/bottom.js +9 -6
  8. package/3rdparty/walkontable/src/overlay/bottom.mjs +9 -6
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -5
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +8 -5
  11. package/3rdparty/walkontable/src/overlay/top.js +11 -6
  12. package/3rdparty/walkontable/src/overlay/top.mjs +11 -6
  13. package/3rdparty/walkontable/src/overlays.js +15 -11
  14. package/3rdparty/walkontable/src/overlays.mjs +15 -11
  15. package/3rdparty/walkontable/src/renderer/rowHeaders.js +4 -1
  16. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
  17. package/3rdparty/walkontable/src/selection/border/border.js +5 -0
  18. package/3rdparty/walkontable/src/selection/border/border.mjs +5 -0
  19. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +3 -4
  20. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +3 -4
  21. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +8 -10
  22. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +8 -10
  23. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +3 -4
  24. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +3 -4
  25. package/3rdparty/walkontable/src/table.js +5 -2
  26. package/3rdparty/walkontable/src/table.mjs +5 -2
  27. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +0 -2
  28. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +0 -2
  29. package/CHANGELOG.md +45 -1
  30. package/base.js +2 -2
  31. package/base.mjs +2 -2
  32. package/core/focusCatcher/focusDetector.js +1 -1
  33. package/core/focusCatcher/focusDetector.mjs +2 -2
  34. package/core/hooks/constants.js +8 -0
  35. package/core/hooks/constants.mjs +8 -0
  36. package/core/hooks/index.d.ts +1 -0
  37. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.js +7 -5
  38. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.mjs +7 -5
  39. package/core/viewportScroll/scrollStrategies/focusScroll.js +8 -1
  40. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +8 -1
  41. package/core/viewportScroll/scrollStrategies/multipleScroll.js +13 -1
  42. package/core/viewportScroll/scrollStrategies/multipleScroll.mjs +13 -1
  43. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.js +13 -1
  44. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.mjs +13 -1
  45. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.js +7 -5
  46. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.mjs +7 -5
  47. package/core/viewportScroll/scrollStrategies/singleScroll.js +8 -4
  48. package/core/viewportScroll/scrollStrategies/singleScroll.mjs +8 -4
  49. package/core/viewportScroll/utils.js +111 -0
  50. package/core/viewportScroll/utils.mjs +106 -0
  51. package/core.d.ts +2 -3
  52. package/core.js +125 -71
  53. package/core.mjs +126 -72
  54. package/dataMap/dataMap.js +0 -7
  55. package/dataMap/dataMap.mjs +0 -7
  56. package/dataMap/metaManager/index.js +8 -9
  57. package/dataMap/metaManager/index.mjs +8 -9
  58. package/dataMap/metaManager/mods/dynamicCellMeta.js +4 -1
  59. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +4 -1
  60. package/dist/handsontable.css +4 -15
  61. package/dist/handsontable.full.css +4 -17
  62. package/dist/handsontable.full.js +4573 -4013
  63. package/dist/handsontable.full.min.css +3 -3
  64. package/dist/handsontable.full.min.js +148 -148
  65. package/dist/handsontable.js +4287 -3730
  66. package/dist/handsontable.min.css +3 -3
  67. package/dist/handsontable.min.js +19 -19
  68. package/editorManager.js +1 -7
  69. package/editorManager.mjs +1 -7
  70. package/editors/autocompleteEditor/autocompleteEditor.js +31 -7
  71. package/editors/autocompleteEditor/autocompleteEditor.mjs +31 -7
  72. package/focusManager.js +4 -2
  73. package/focusManager.mjs +4 -2
  74. package/helpers/browser.js +1 -1
  75. package/helpers/browser.mjs +1 -1
  76. package/helpers/dom/element.d.ts +1 -0
  77. package/helpers/dom/element.js +20 -0
  78. package/helpers/dom/element.mjs +19 -0
  79. package/helpers/mixed.js +2 -2
  80. package/helpers/mixed.mjs +2 -2
  81. package/helpers/object.js +3 -0
  82. package/helpers/object.mjs +3 -0
  83. package/package.json +1 -1
  84. package/plugins/autoColumnSize/autoColumnSize.js +38 -17
  85. package/plugins/autoColumnSize/autoColumnSize.mjs +38 -17
  86. package/plugins/autoRowSize/autoRowSize.js +12 -6
  87. package/plugins/autoRowSize/autoRowSize.mjs +12 -6
  88. package/plugins/columnSorting/columnSorting.js +0 -4
  89. package/plugins/columnSorting/columnSorting.mjs +0 -4
  90. package/plugins/comments/comments.js +1 -0
  91. package/plugins/comments/comments.mjs +1 -0
  92. package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
  93. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
  94. package/plugins/contextMenu/menu/menu.js +1 -0
  95. package/plugins/contextMenu/menu/menu.mjs +1 -0
  96. package/plugins/contextMenu/menu/positioner.js +10 -2
  97. package/plugins/contextMenu/menu/positioner.mjs +10 -2
  98. package/plugins/contextMenu/predefinedItems/redo.js +3 -3
  99. package/plugins/contextMenu/predefinedItems/redo.mjs +3 -3
  100. package/plugins/contextMenu/predefinedItems/undo.js +3 -3
  101. package/plugins/contextMenu/predefinedItems/undo.mjs +3 -3
  102. package/plugins/copyPaste/copyPaste.js +12 -9
  103. package/plugins/copyPaste/copyPaste.mjs +12 -9
  104. package/plugins/copyPaste/pasteEvent.js +3 -0
  105. package/plugins/copyPaste/pasteEvent.mjs +3 -0
  106. package/plugins/exportFile/exportFile.d.ts +1 -0
  107. package/plugins/exportFile/exportFile.js +2 -1
  108. package/plugins/exportFile/exportFile.mjs +2 -1
  109. package/plugins/exportFile/types/csv.js +76 -11
  110. package/plugins/exportFile/types/csv.mjs +76 -11
  111. package/plugins/filters/filters.js +24 -23
  112. package/plugins/filters/filters.mjs +24 -23
  113. package/plugins/filters/ui/multipleSelect.js +7 -1
  114. package/plugins/filters/ui/multipleSelect.mjs +7 -1
  115. package/plugins/formulas/formulas.d.ts +1 -1
  116. package/plugins/formulas/formulas.js +57 -60
  117. package/plugins/formulas/formulas.mjs +59 -62
  118. package/plugins/formulas/indexSyncer/axisSyncer.js +5 -1
  119. package/plugins/formulas/indexSyncer/axisSyncer.mjs +5 -1
  120. package/plugins/hiddenColumns/hiddenColumns.js +1 -1
  121. package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
  122. package/plugins/hiddenRows/hiddenRows.js +1 -1
  123. package/plugins/hiddenRows/hiddenRows.mjs +1 -1
  124. package/plugins/manualColumnResize/manualColumnResize.js +4 -6
  125. package/plugins/manualColumnResize/manualColumnResize.mjs +4 -6
  126. package/plugins/manualRowResize/manualRowResize.js +4 -6
  127. package/plugins/manualRowResize/manualRowResize.mjs +4 -6
  128. package/plugins/mergeCells/mergeCells.js +10 -30
  129. package/plugins/mergeCells/mergeCells.mjs +10 -30
  130. package/plugins/mergeCells/renderer.js +15 -0
  131. package/plugins/mergeCells/renderer.mjs +15 -0
  132. package/plugins/mergeCells/utils.js +31 -0
  133. package/plugins/mergeCells/utils.mjs +27 -0
  134. package/plugins/nestedRows/data/dataManager.js +2 -2
  135. package/plugins/nestedRows/data/dataManager.mjs +2 -2
  136. package/plugins/undoRedo/actions/index.js +0 -2
  137. package/plugins/undoRedo/actions/index.mjs +0 -2
  138. package/plugins/undoRedo/actions/removeColumn.js +19 -14
  139. package/plugins/undoRedo/actions/removeColumn.mjs +19 -14
  140. package/plugins/undoRedo/actions/removeRow.js +12 -4
  141. package/plugins/undoRedo/actions/removeRow.mjs +12 -4
  142. package/selection/selection.js +3 -1
  143. package/selection/selection.mjs +3 -1
  144. package/shortcutContexts/commands/extendCellsSelection/down.js +7 -2
  145. package/shortcutContexts/commands/extendCellsSelection/down.mjs +7 -2
  146. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +8 -2
  147. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +8 -2
  148. package/shortcutContexts/commands/extendCellsSelection/left.js +7 -2
  149. package/shortcutContexts/commands/extendCellsSelection/left.mjs +7 -2
  150. package/shortcutContexts/commands/extendCellsSelection/right.js +7 -2
  151. package/shortcutContexts/commands/extendCellsSelection/right.mjs +7 -2
  152. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +7 -2
  153. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +7 -2
  154. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +3 -1
  155. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
  156. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -1
  157. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -1
  158. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -1
  159. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -1
  160. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
  161. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
  162. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
  163. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
  164. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
  165. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
  166. package/shortcutContexts/commands/extendCellsSelection/toRows.js +7 -2
  167. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +7 -2
  168. package/shortcutContexts/commands/extendCellsSelection/up.js +7 -2
  169. package/shortcutContexts/commands/extendCellsSelection/up.mjs +7 -2
  170. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +8 -2
  171. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +8 -2
  172. package/shortcutContexts/commands/index.js +0 -2
  173. package/shortcutContexts/commands/index.mjs +0 -2
  174. package/shortcutContexts/commands/moveCellSelection/down.js +2 -0
  175. package/shortcutContexts/commands/moveCellSelection/down.mjs +2 -0
  176. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +6 -1
  177. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +6 -1
  178. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +8 -3
  179. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -3
  180. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +8 -3
  181. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -3
  182. package/shortcutContexts/commands/moveCellSelection/left.js +6 -1
  183. package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -1
  184. package/shortcutContexts/commands/moveCellSelection/right.js +6 -1
  185. package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -1
  186. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +4 -1
  187. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +4 -1
  188. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +2 -0
  189. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +2 -0
  190. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +2 -0
  191. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +2 -0
  192. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +2 -0
  193. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +2 -0
  194. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +2 -0
  195. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +2 -0
  196. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +2 -0
  197. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +2 -0
  198. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +6 -1
  199. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +6 -1
  200. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +2 -0
  201. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +2 -0
  202. package/shortcutContexts/commands/moveCellSelection/up.js +2 -0
  203. package/shortcutContexts/commands/moveCellSelection/up.mjs +2 -0
  204. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +6 -1
  205. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +6 -1
  206. package/shortcutContexts/commands/selectAllCells.js +7 -2
  207. package/shortcutContexts/commands/selectAllCells.mjs +7 -2
  208. package/shortcutContexts/commands/selectAllCellsAndHeaders.js +7 -2
  209. package/shortcutContexts/commands/selectAllCellsAndHeaders.mjs +7 -2
  210. package/shortcutContexts/index.js +2 -2
  211. package/shortcutContexts/index.mjs +0 -2
  212. package/styles/handsontable.css +15 -17
  213. package/styles/handsontable.min.css +3 -3
  214. package/styles/ht-theme-horizon.css +2 -2
  215. package/styles/ht-theme-horizon.min.css +2 -2
  216. package/styles/ht-theme-main.css +2 -2
  217. package/styles/ht-theme-main.min.css +2 -2
  218. package/tableView.js +5 -8
  219. package/tableView.mjs +5 -8
  220. package/translations/indexMapper.js +0 -1
  221. package/translations/indexMapper.mjs +0 -1
  222. package/utils/ghostTable.js +3 -0
  223. package/utils/ghostTable.mjs +3 -0
@@ -105,6 +105,20 @@ class CellRange {
105
105
  return this;
106
106
  }
107
107
 
108
+ /**
109
+ * Normalizes the coordinates in your `CellRange` instance to the nearest valid position.
110
+ *
111
+ * Coordinates that point to headers (negative values) are normalized to `0`.
112
+ *
113
+ * @returns {CellRange}
114
+ */
115
+ normalize() {
116
+ this.highlight.normalize();
117
+ this.from.normalize();
118
+ this.to.normalize();
119
+ return this;
120
+ }
121
+
108
122
  /**
109
123
  * Checks if the coordinates in your `CellRange` instance are valid
110
124
  * in the context of given table parameters.
@@ -101,6 +101,20 @@ class CellRange {
101
101
  return this;
102
102
  }
103
103
 
104
+ /**
105
+ * Normalizes the coordinates in your `CellRange` instance to the nearest valid position.
106
+ *
107
+ * Coordinates that point to headers (negative values) are normalized to `0`.
108
+ *
109
+ * @returns {CellRange}
110
+ */
111
+ normalize() {
112
+ this.highlight.normalize();
113
+ this.from.normalize();
114
+ this.to.normalize();
115
+ return this;
116
+ }
117
+
104
118
  /**
105
119
  * Checks if the coordinates in your `CellRange` instance are valid
106
120
  * in the context of given table parameters.
@@ -121,8 +121,8 @@ class CoreAbstract {
121
121
  draw() {
122
122
  let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
123
123
  this.drawInterrupted = false;
124
- if (!this.wtTable.isVisible()) {
125
- // draw interrupted because TABLE is not visible
124
+ if (!this.wtTable.isVisible() || (0, _element.hasZeroHeight)(this.wtTable.wtRootElement.parentNode)) {
125
+ // draw interrupted because TABLE is not visible or has the height set to 0
126
126
  this.drawInterrupted = true;
127
127
  } else {
128
128
  this.wtTable.draw(fastDraw);
@@ -3,7 +3,7 @@ import "core-js/modules/es.array.push.js";
3
3
  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; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  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); }
6
- import { fastInnerText } from "../../../../helpers/dom/element.mjs";
6
+ import { fastInnerText, hasZeroHeight } from "../../../../helpers/dom/element.mjs";
7
7
  import { randomString } from "../../../../helpers/string.mjs";
8
8
  import EventManager from "../../../../eventManager.mjs";
9
9
  import Scroll from "../scroll.mjs";
@@ -117,8 +117,8 @@ export default class CoreAbstract {
117
117
  draw() {
118
118
  let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
119
119
  this.drawInterrupted = false;
120
- if (!this.wtTable.isVisible()) {
121
- // draw interrupted because TABLE is not visible
120
+ if (!this.wtTable.isVisible() || hasZeroHeight(this.wtTable.wtRootElement.parentNode)) {
121
+ // draw interrupted because TABLE is not visible or has the height set to 0
122
122
  this.drawInterrupted = true;
123
123
  } else {
124
124
  this.wtTable.draw(fastDraw);
@@ -2,8 +2,6 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
- require("core-js/modules/esnext.iterator.constructor.js");
6
- require("core-js/modules/esnext.iterator.for-each.js");
7
5
  var _element = require("../../../../helpers/dom/element");
8
6
  var _object = require("../../../../helpers/object");
9
7
  var _console = require("../../../../helpers/console");
@@ -1,6 +1,4 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
- import "core-js/modules/esnext.iterator.constructor.js";
3
- import "core-js/modules/esnext.iterator.for-each.js";
4
2
  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; }
5
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
6
4
  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); }
@@ -116,13 +116,16 @@ class BottomOverlay extends _base.Overlay {
116
116
  const {
117
117
  rootWindow
118
118
  } = this.domBindings;
119
+ const scrollableElement = this.mainTableScrollableElement;
119
120
  let result = false;
120
- if (this.mainTableScrollableElement === rootWindow) {
121
- rootWindow.scrollTo((0, _element.getWindowScrollLeft)(rootWindow), pos);
122
- result = true;
123
- } else if (this.mainTableScrollableElement.scrollTop !== pos) {
124
- this.mainTableScrollableElement.scrollTop = pos;
125
- result = true;
121
+ if (scrollableElement === rootWindow && pos !== rootWindow.scrollY) {
122
+ const oldScrollX = rootWindow.scrollY;
123
+ rootWindow.scrollTo((0, _element.getWindowScrollLeft)(rootWindow), top);
124
+ result = oldScrollX !== rootWindow.scrollY;
125
+ } else if (pos !== scrollableElement.scrollTop) {
126
+ const oldScrollLeft = scrollableElement.scrollTop;
127
+ scrollableElement.scrollTop = pos;
128
+ result = oldScrollLeft !== scrollableElement.scrollTop;
126
129
  }
127
130
  return result;
128
131
  }
@@ -112,13 +112,16 @@ export class BottomOverlay extends Overlay {
112
112
  const {
113
113
  rootWindow
114
114
  } = this.domBindings;
115
+ const scrollableElement = this.mainTableScrollableElement;
115
116
  let result = false;
116
- if (this.mainTableScrollableElement === rootWindow) {
117
- rootWindow.scrollTo(getWindowScrollLeft(rootWindow), pos);
118
- result = true;
119
- } else if (this.mainTableScrollableElement.scrollTop !== pos) {
120
- this.mainTableScrollableElement.scrollTop = pos;
121
- result = true;
117
+ if (scrollableElement === rootWindow && pos !== rootWindow.scrollY) {
118
+ const oldScrollX = rootWindow.scrollY;
119
+ rootWindow.scrollTo(getWindowScrollLeft(rootWindow), top);
120
+ result = oldScrollX !== rootWindow.scrollY;
121
+ } else if (pos !== scrollableElement.scrollTop) {
122
+ const oldScrollLeft = scrollableElement.scrollTop;
123
+ scrollableElement.scrollTop = pos;
124
+ result = oldScrollLeft !== scrollableElement.scrollTop;
122
125
  }
123
126
  return result;
124
127
  }
@@ -90,12 +90,15 @@ class InlineStartOverlay extends _base.Overlay {
90
90
  if (this.isRtl()) {
91
91
  pos = -pos;
92
92
  }
93
- if (this.mainTableScrollableElement === rootWindow && rootWindow.scrollX !== pos) {
93
+ const scrollableElement = this.mainTableScrollableElement;
94
+ if (scrollableElement === rootWindow && pos !== rootWindow.scrollX) {
95
+ const oldScrollX = rootWindow.scrollX;
94
96
  rootWindow.scrollTo(pos, (0, _element.getWindowScrollTop)(rootWindow));
95
- result = true;
96
- } else if (this.mainTableScrollableElement.scrollLeft !== pos) {
97
- this.mainTableScrollableElement.scrollLeft = pos;
98
- result = true;
97
+ result = oldScrollX !== rootWindow.scrollX;
98
+ } else if (pos !== scrollableElement.scrollLeft) {
99
+ const oldScrollLeft = scrollableElement.scrollLeft;
100
+ scrollableElement.scrollLeft = pos;
101
+ result = oldScrollLeft !== scrollableElement.scrollLeft;
99
102
  }
100
103
  return result;
101
104
  }
@@ -86,12 +86,15 @@ export class InlineStartOverlay extends Overlay {
86
86
  if (this.isRtl()) {
87
87
  pos = -pos;
88
88
  }
89
- if (this.mainTableScrollableElement === rootWindow && rootWindow.scrollX !== pos) {
89
+ const scrollableElement = this.mainTableScrollableElement;
90
+ if (scrollableElement === rootWindow && pos !== rootWindow.scrollX) {
91
+ const oldScrollX = rootWindow.scrollX;
90
92
  rootWindow.scrollTo(pos, getWindowScrollTop(rootWindow));
91
- result = true;
92
- } else if (this.mainTableScrollableElement.scrollLeft !== pos) {
93
- this.mainTableScrollableElement.scrollLeft = pos;
94
- result = true;
93
+ result = oldScrollX !== rootWindow.scrollX;
94
+ } else if (pos !== scrollableElement.scrollLeft) {
95
+ const oldScrollLeft = scrollableElement.scrollLeft;
96
+ scrollableElement.scrollLeft = pos;
97
+ result = oldScrollLeft !== scrollableElement.scrollLeft;
95
98
  }
96
99
  return result;
97
100
  }
@@ -111,14 +111,19 @@ class TopOverlay extends _base.Overlay {
111
111
  * @returns {boolean}
112
112
  */
113
113
  setScrollPosition(pos) {
114
- const rootWindow = this.domBindings.rootWindow;
114
+ const {
115
+ rootWindow
116
+ } = this.domBindings;
117
+ const scrollableElement = this.mainTableScrollableElement;
115
118
  let result = false;
116
- if (this.mainTableScrollableElement === rootWindow && rootWindow.scrollY !== pos) {
119
+ if (scrollableElement === rootWindow && pos !== rootWindow.scrollY) {
120
+ const oldScrollX = rootWindow.scrollY;
117
121
  rootWindow.scrollTo((0, _element.getWindowScrollLeft)(rootWindow), pos);
118
- result = true;
119
- } else if (this.mainTableScrollableElement.scrollTop !== pos) {
120
- this.mainTableScrollableElement.scrollTop = pos;
121
- result = true;
122
+ result = oldScrollX !== rootWindow.scrollY;
123
+ } else if (pos !== scrollableElement.scrollTop) {
124
+ const oldScrollLeft = scrollableElement.scrollTop;
125
+ scrollableElement.scrollTop = pos;
126
+ result = oldScrollLeft !== scrollableElement.scrollTop;
122
127
  }
123
128
  return result;
124
129
  }
@@ -107,14 +107,19 @@ export class TopOverlay extends Overlay {
107
107
  * @returns {boolean}
108
108
  */
109
109
  setScrollPosition(pos) {
110
- const rootWindow = this.domBindings.rootWindow;
110
+ const {
111
+ rootWindow
112
+ } = this.domBindings;
113
+ const scrollableElement = this.mainTableScrollableElement;
111
114
  let result = false;
112
- if (this.mainTableScrollableElement === rootWindow && rootWindow.scrollY !== pos) {
115
+ if (scrollableElement === rootWindow && pos !== rootWindow.scrollY) {
116
+ const oldScrollX = rootWindow.scrollY;
113
117
  rootWindow.scrollTo(getWindowScrollLeft(rootWindow), pos);
114
- result = true;
115
- } else if (this.mainTableScrollableElement.scrollTop !== pos) {
116
- this.mainTableScrollableElement.scrollTop = pos;
117
- result = true;
118
+ result = oldScrollX !== rootWindow.scrollY;
119
+ } else if (pos !== scrollableElement.scrollTop) {
120
+ const oldScrollLeft = scrollableElement.scrollTop;
121
+ scrollableElement.scrollTop = pos;
122
+ result = oldScrollLeft !== scrollableElement.scrollTop;
118
123
  }
119
124
  return result;
120
125
  }
@@ -460,27 +460,31 @@ class Overlays {
460
460
  if (this.destroyed) {
461
461
  return;
462
462
  }
463
- const {
464
- rootWindow
465
- } = this.domBindings;
466
463
  const topHolder = this.topOverlay.clone.wtTable.holder; // todo rethink
467
464
  const leftHolder = this.inlineStartOverlay.clone.wtTable.holder; // todo rethink
468
465
 
469
- const [scrollLeft, scrollTop] = [this.scrollableElement.scrollLeft, this.scrollableElement.scrollTop];
470
- this.horizontalScrolling = topHolder.scrollLeft !== scrollLeft || this.lastScrollX !== rootWindow.scrollX;
471
- this.verticalScrolling = leftHolder.scrollTop !== scrollTop || this.lastScrollY !== rootWindow.scrollY;
472
- this.lastScrollX = rootWindow.scrollX;
473
- this.lastScrollY = rootWindow.scrollY;
466
+ let scrollX = this.scrollableElement.scrollLeft;
467
+ let scrollY = this.scrollableElement.scrollTop;
468
+ if (this.wot.wtViewport.isHorizontallyScrollableByWindow()) {
469
+ scrollX = this.scrollableElement.scrollX;
470
+ }
471
+ if (this.wot.wtViewport.isVerticallyScrollableByWindow()) {
472
+ scrollY = this.scrollableElement.scrollY;
473
+ }
474
+ this.horizontalScrolling = this.lastScrollX !== scrollX;
475
+ this.verticalScrolling = this.lastScrollY !== scrollY;
476
+ this.lastScrollX = scrollX;
477
+ this.lastScrollY = scrollY;
474
478
  if (this.horizontalScrolling) {
475
- topHolder.scrollLeft = scrollLeft;
479
+ topHolder.scrollLeft = scrollX;
476
480
  const bottomHolder = this.bottomOverlay.needFullRender ? this.bottomOverlay.clone.wtTable.holder : null; // todo rethink
477
481
 
478
482
  if (bottomHolder) {
479
- bottomHolder.scrollLeft = scrollLeft;
483
+ bottomHolder.scrollLeft = scrollX;
480
484
  }
481
485
  }
482
486
  if (this.verticalScrolling) {
483
- leftHolder.scrollTop = scrollTop;
487
+ leftHolder.scrollTop = scrollY;
484
488
  }
485
489
  this.refreshAll();
486
490
  }
@@ -457,27 +457,31 @@ class Overlays {
457
457
  if (this.destroyed) {
458
458
  return;
459
459
  }
460
- const {
461
- rootWindow
462
- } = this.domBindings;
463
460
  const topHolder = this.topOverlay.clone.wtTable.holder; // todo rethink
464
461
  const leftHolder = this.inlineStartOverlay.clone.wtTable.holder; // todo rethink
465
462
 
466
- const [scrollLeft, scrollTop] = [this.scrollableElement.scrollLeft, this.scrollableElement.scrollTop];
467
- this.horizontalScrolling = topHolder.scrollLeft !== scrollLeft || this.lastScrollX !== rootWindow.scrollX;
468
- this.verticalScrolling = leftHolder.scrollTop !== scrollTop || this.lastScrollY !== rootWindow.scrollY;
469
- this.lastScrollX = rootWindow.scrollX;
470
- this.lastScrollY = rootWindow.scrollY;
463
+ let scrollX = this.scrollableElement.scrollLeft;
464
+ let scrollY = this.scrollableElement.scrollTop;
465
+ if (this.wot.wtViewport.isHorizontallyScrollableByWindow()) {
466
+ scrollX = this.scrollableElement.scrollX;
467
+ }
468
+ if (this.wot.wtViewport.isVerticallyScrollableByWindow()) {
469
+ scrollY = this.scrollableElement.scrollY;
470
+ }
471
+ this.horizontalScrolling = this.lastScrollX !== scrollX;
472
+ this.verticalScrolling = this.lastScrollY !== scrollY;
473
+ this.lastScrollX = scrollX;
474
+ this.lastScrollY = scrollY;
471
475
  if (this.horizontalScrolling) {
472
- topHolder.scrollLeft = scrollLeft;
476
+ topHolder.scrollLeft = scrollX;
473
477
  const bottomHolder = this.bottomOverlay.needFullRender ? this.bottomOverlay.clone.wtTable.holder : null; // todo rethink
474
478
 
475
479
  if (bottomHolder) {
476
- bottomHolder.scrollLeft = scrollLeft;
480
+ bottomHolder.scrollLeft = scrollX;
477
481
  }
478
482
  }
479
483
  if (this.verticalScrolling) {
480
- leftHolder.scrollTop = scrollTop;
484
+ leftHolder.scrollTop = scrollY;
481
485
  }
482
486
  this.refreshAll();
483
487
  }
@@ -74,7 +74,10 @@ class RowHeadersRenderer extends _base.BaseRenderer {
74
74
  const orderView = this.obtainOrderView(TR);
75
75
  const cellsView = cells.obtainOrderView(TR);
76
76
  orderView.appendView(cellsView).setSize(rowHeadersCount).setOffset(0).start();
77
- for (let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {
77
+
78
+ // Reading the row header renderers in reverse because of how the Eco Renderers handle rendering
79
+ // (prepending the nodes when rendering row headers).
80
+ for (let visibleColumnIndex = rowHeadersCount - 1; visibleColumnIndex >= 0; visibleColumnIndex--) {
78
81
  orderView.render();
79
82
  const TH = orderView.getCurrentNode();
80
83
  TH.className = '';
@@ -71,7 +71,10 @@ export class RowHeadersRenderer extends BaseRenderer {
71
71
  const orderView = this.obtainOrderView(TR);
72
72
  const cellsView = cells.obtainOrderView(TR);
73
73
  orderView.appendView(cellsView).setSize(rowHeadersCount).setOffset(0).start();
74
- for (let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {
74
+
75
+ // Reading the row header renderers in reverse because of how the Eco Renderers handle rendering
76
+ // (prepending the nodes when rendering row headers).
77
+ for (let visibleColumnIndex = rowHeadersCount - 1; visibleColumnIndex >= 0; visibleColumnIndex--) {
75
78
  orderView.render();
76
79
  const TH = orderView.getCurrentNode();
77
80
  TH.className = '';
@@ -352,6 +352,11 @@ class Border {
352
352
  const lastRenderedRow = wtTable.getLastRenderedRow();
353
353
  const firstRenderedColumn = wtTable.getFirstRenderedColumn();
354
354
  const lastRenderedColumn = wtTable.getLastRenderedColumn();
355
+ if (firstRenderedColumn < 0 && lastRenderedColumn < 0 || firstRenderedRow < 0 && lastRenderedRow < 0) {
356
+ // ...also when overlays have rendered only headers skip it
357
+ this.disappear();
358
+ return;
359
+ }
355
360
  let fromTD;
356
361
  if (isMultiple) {
357
362
  fromColumn = Math.max(fromColumn, firstRenderedColumn);
@@ -349,6 +349,11 @@ class Border {
349
349
  const lastRenderedRow = wtTable.getLastRenderedRow();
350
350
  const firstRenderedColumn = wtTable.getFirstRenderedColumn();
351
351
  const lastRenderedColumn = wtTable.getLastRenderedColumn();
352
+ if (firstRenderedColumn < 0 && lastRenderedColumn < 0 || firstRenderedRow < 0 && lastRenderedRow < 0) {
353
+ // ...also when overlays have rendered only headers skip it
354
+ this.disappear();
355
+ return;
356
+ }
352
357
  let fromTD;
353
358
  if (isMultiple) {
354
359
  fromColumn = Math.max(fromColumn, firstRenderedColumn);
@@ -20,8 +20,8 @@ const stickyColumnsStart = {
20
20
  * @this Table
21
21
  */
22
22
  getFirstRenderedColumn() {
23
- const totalColumns = this.wtSettings.getSetting('totalColumns');
24
- if (totalColumns === 0) {
23
+ const allStickyColumns = this.getRenderedColumnsCount();
24
+ if (allStickyColumns === 0) {
25
25
  return -1;
26
26
  }
27
27
  return 0;
@@ -82,8 +82,7 @@ const stickyColumnsStart = {
82
82
  * @this Table
83
83
  */
84
84
  getRenderedColumnsCount() {
85
- const totalColumns = this.wtSettings.getSetting('totalColumns');
86
- return Math.min(this.wtSettings.getSetting('fixedColumnsStart'), totalColumns);
85
+ return Math.min(this.wtSettings.getSetting('totalColumns'), this.wtSettings.getSetting('fixedColumnsStart'));
87
86
  },
88
87
  /**
89
88
  * Get the number of fully visible columns in the viewport.
@@ -17,8 +17,8 @@ const stickyColumnsStart = {
17
17
  * @this Table
18
18
  */
19
19
  getFirstRenderedColumn() {
20
- const totalColumns = this.wtSettings.getSetting('totalColumns');
21
- if (totalColumns === 0) {
20
+ const allStickyColumns = this.getRenderedColumnsCount();
21
+ if (allStickyColumns === 0) {
22
22
  return -1;
23
23
  }
24
24
  return 0;
@@ -79,8 +79,7 @@ const stickyColumnsStart = {
79
79
  * @this Table
80
80
  */
81
81
  getRenderedColumnsCount() {
82
- const totalColumns = this.wtSettings.getSetting('totalColumns');
83
- return Math.min(this.wtSettings.getSetting('fixedColumnsStart'), totalColumns);
82
+ return Math.min(this.wtSettings.getSetting('totalColumns'), this.wtSettings.getSetting('fixedColumnsStart'));
84
83
  },
85
84
  /**
86
85
  * Get the number of fully visible columns in the viewport.
@@ -20,16 +20,11 @@ const stickyRowsBottom = {
20
20
  * @this Table
21
21
  */
22
22
  getFirstRenderedRow() {
23
- const totalRows = this.wtSettings.getSetting('totalRows');
24
- const fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
25
- const index = totalRows - fixedRowsBottom;
26
- if (totalRows === 0 || fixedRowsBottom === 0) {
23
+ const allStickyRows = this.getRenderedRowsCount();
24
+ if (allStickyRows === 0) {
27
25
  return -1;
28
26
  }
29
- if (index < 0) {
30
- return 0;
31
- }
32
- return index;
27
+ return this.wtSettings.getSetting('totalRows') - allStickyRows;
33
28
  },
34
29
  /**
35
30
  * Get the source index of the first row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.
@@ -58,6 +53,10 @@ const stickyRowsBottom = {
58
53
  * @this Table
59
54
  */
60
55
  getLastRenderedRow() {
56
+ const allStickyRows = this.getRenderedRowsCount();
57
+ if (allStickyRows === 0) {
58
+ return -1;
59
+ }
61
60
  return this.wtSettings.getSetting('totalRows') - 1;
62
61
  },
63
62
  /**
@@ -87,8 +86,7 @@ const stickyRowsBottom = {
87
86
  * @this Table
88
87
  */
89
88
  getRenderedRowsCount() {
90
- const totalRows = this.wtSettings.getSetting('totalRows');
91
- return Math.min(this.wtSettings.getSetting('fixedRowsBottom'), totalRows);
89
+ return Math.min(this.wtSettings.getSetting('totalRows'), this.wtSettings.getSetting('fixedRowsBottom'));
92
90
  },
93
91
  /**
94
92
  * Get the number of fully visible rows in the viewport.
@@ -17,16 +17,11 @@ const stickyRowsBottom = {
17
17
  * @this Table
18
18
  */
19
19
  getFirstRenderedRow() {
20
- const totalRows = this.wtSettings.getSetting('totalRows');
21
- const fixedRowsBottom = this.wtSettings.getSetting('fixedRowsBottom');
22
- const index = totalRows - fixedRowsBottom;
23
- if (totalRows === 0 || fixedRowsBottom === 0) {
20
+ const allStickyRows = this.getRenderedRowsCount();
21
+ if (allStickyRows === 0) {
24
22
  return -1;
25
23
  }
26
- if (index < 0) {
27
- return 0;
28
- }
29
- return index;
24
+ return this.wtSettings.getSetting('totalRows') - allStickyRows;
30
25
  },
31
26
  /**
32
27
  * Get the source index of the first row fully visible in the viewport. If no rows are fully visible, returns an error code: -1.
@@ -55,6 +50,10 @@ const stickyRowsBottom = {
55
50
  * @this Table
56
51
  */
57
52
  getLastRenderedRow() {
53
+ const allStickyRows = this.getRenderedRowsCount();
54
+ if (allStickyRows === 0) {
55
+ return -1;
56
+ }
58
57
  return this.wtSettings.getSetting('totalRows') - 1;
59
58
  },
60
59
  /**
@@ -84,8 +83,7 @@ const stickyRowsBottom = {
84
83
  * @this Table
85
84
  */
86
85
  getRenderedRowsCount() {
87
- const totalRows = this.wtSettings.getSetting('totalRows');
88
- return Math.min(this.wtSettings.getSetting('fixedRowsBottom'), totalRows);
86
+ return Math.min(this.wtSettings.getSetting('totalRows'), this.wtSettings.getSetting('fixedRowsBottom'));
89
87
  },
90
88
  /**
91
89
  * Get the number of fully visible rows in the viewport.
@@ -20,8 +20,8 @@ const stickyRowsTop = {
20
20
  * @this Table
21
21
  */
22
22
  getFirstRenderedRow() {
23
- const totalRows = this.wtSettings.getSetting('totalRows');
24
- if (totalRows === 0) {
23
+ const allStickyRows = this.getRenderedRowsCount();
24
+ if (allStickyRows === 0) {
25
25
  return -1;
26
26
  }
27
27
  return 0;
@@ -82,8 +82,7 @@ const stickyRowsTop = {
82
82
  * @this Table
83
83
  */
84
84
  getRenderedRowsCount() {
85
- const totalRows = this.wtSettings.getSetting('totalRows');
86
- return Math.min(this.wtSettings.getSetting('fixedRowsTop'), totalRows);
85
+ return Math.min(this.wtSettings.getSetting('totalRows'), this.wtSettings.getSetting('fixedRowsTop'));
87
86
  },
88
87
  /**
89
88
  * Get the number of fully visible rows in the viewport.
@@ -17,8 +17,8 @@ const stickyRowsTop = {
17
17
  * @this Table
18
18
  */
19
19
  getFirstRenderedRow() {
20
- const totalRows = this.wtSettings.getSetting('totalRows');
21
- if (totalRows === 0) {
20
+ const allStickyRows = this.getRenderedRowsCount();
21
+ if (allStickyRows === 0) {
22
22
  return -1;
23
23
  }
24
24
  return 0;
@@ -79,8 +79,7 @@ const stickyRowsTop = {
79
79
  * @this Table
80
80
  */
81
81
  getRenderedRowsCount() {
82
- const totalRows = this.wtSettings.getSetting('totalRows');
83
- return Math.min(this.wtSettings.getSetting('fixedRowsTop'), totalRows);
82
+ return Math.min(this.wtSettings.getSetting('totalRows'), this.wtSettings.getSetting('fixedRowsTop'));
84
83
  },
85
84
  /**
86
85
  * Get the number of fully visible rows in the viewport.
@@ -279,8 +279,8 @@ class Table {
279
279
  } else {
280
280
  this.tableOffset = this.dataAccessObject.parentTableOffset;
281
281
  }
282
- const startRow = totalRows > 0 ? this.getFirstRenderedRow() : 0;
283
- const startColumn = totalColumns > 0 ? this.getFirstRenderedColumn() : 0;
282
+ const startRow = Math.max(this.getFirstRenderedRow(), 0);
283
+ const startColumn = Math.max(this.getFirstRenderedColumn(), 0);
284
284
  this.rowFilter = new _row.default(startRow, totalRows, columnHeadersCount);
285
285
  this.columnFilter = new _column.default(startColumn, totalColumns, rowHeadersCount);
286
286
  let performRedraw = true;
@@ -598,6 +598,9 @@ class Table {
598
598
  return null;
599
599
  }
600
600
  const TR = cellElement.parentNode;
601
+ if (!TR) {
602
+ return null;
603
+ }
601
604
  const CONTAINER = TR.parentNode;
602
605
  let row = (0, _element.index)(TR);
603
606
  let col = cellElement.cellIndex;
@@ -275,8 +275,8 @@ class Table {
275
275
  } else {
276
276
  this.tableOffset = this.dataAccessObject.parentTableOffset;
277
277
  }
278
- const startRow = totalRows > 0 ? this.getFirstRenderedRow() : 0;
279
- const startColumn = totalColumns > 0 ? this.getFirstRenderedColumn() : 0;
278
+ const startRow = Math.max(this.getFirstRenderedRow(), 0);
279
+ const startColumn = Math.max(this.getFirstRenderedColumn(), 0);
280
280
  this.rowFilter = new RowFilter(startRow, totalRows, columnHeadersCount);
281
281
  this.columnFilter = new ColumnFilter(startColumn, totalColumns, rowHeadersCount);
282
282
  let performRedraw = true;
@@ -594,6 +594,9 @@ class Table {
594
594
  return null;
595
595
  }
596
596
  const TR = cellElement.parentNode;
597
+ if (!TR) {
598
+ return null;
599
+ }
597
600
  const CONTAINER = TR.parentNode;
598
601
  let row = index(TR);
599
602
  let col = cellElement.cellIndex;
@@ -3,8 +3,6 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.unshift.js");
6
- require("core-js/modules/esnext.iterator.constructor.js");
7
- require("core-js/modules/esnext.iterator.map.js");
8
6
  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; }
9
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
8
  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); }
@@ -1,7 +1,5 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
2
  import "core-js/modules/es.array.unshift.js";
3
- import "core-js/modules/esnext.iterator.constructor.js";
4
- import "core-js/modules/esnext.iterator.map.js";
5
3
  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; }
6
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
7
5
  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); }