handsontable 14.1.0 → 14.2.0-next-4873a35-20240228

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 (161) hide show
  1. package/3rdparty/walkontable/src/core/_base.js +12 -0
  2. package/3rdparty/walkontable/src/core/_base.mjs +12 -0
  3. package/3rdparty/walkontable/src/scroll.js +131 -98
  4. package/3rdparty/walkontable/src/scroll.mjs +133 -100
  5. package/3rdparty/walkontable/src/selection/border/border.js +3 -3
  6. package/3rdparty/walkontable/src/selection/border/border.mjs +3 -3
  7. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +26 -0
  8. package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +26 -0
  9. package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +26 -0
  10. package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +26 -0
  11. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +20 -0
  12. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +20 -0
  13. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +20 -0
  14. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +20 -0
  15. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +20 -0
  16. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +20 -0
  17. package/3rdparty/walkontable/src/table.js +2 -0
  18. package/3rdparty/walkontable/src/table.mjs +2 -0
  19. package/3rdparty/walkontable/src/viewport.js +9 -0
  20. package/3rdparty/walkontable/src/viewport.mjs +10 -1
  21. package/CHANGELOG.md +38 -0
  22. package/base.js +2 -2
  23. package/base.mjs +2 -2
  24. package/core/index.js +6 -0
  25. package/core/index.mjs +2 -1
  26. package/core/viewportScroll/index.js +65 -0
  27. package/core/viewportScroll/index.mjs +61 -0
  28. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.js +20 -0
  29. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.mjs +16 -0
  30. package/core/viewportScroll/scrollStrategies/cornerHeaderScroll.js +14 -0
  31. package/core/viewportScroll/scrollStrategies/cornerHeaderScroll.mjs +10 -0
  32. package/core/viewportScroll/scrollStrategies/multipleScroll.js +15 -0
  33. package/core/viewportScroll/scrollStrategies/multipleScroll.mjs +11 -0
  34. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.js +15 -0
  35. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.mjs +11 -0
  36. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.js +20 -0
  37. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.mjs +16 -0
  38. package/core/viewportScroll/scrollStrategies/singleScroll.js +46 -0
  39. package/core/viewportScroll/scrollStrategies/singleScroll.mjs +42 -0
  40. package/core.d.ts +1 -1
  41. package/core.js +11 -52
  42. package/core.mjs +12 -53
  43. package/dataMap/metaManager/index.js +1 -1
  44. package/dataMap/metaManager/index.mjs +1 -1
  45. package/dataMap/metaManager/metaLayers/cellMeta.js +6 -1
  46. package/dataMap/metaManager/metaLayers/cellMeta.mjs +6 -1
  47. package/dataMap/metaManager/metaSchema.js +36 -12
  48. package/dataMap/metaManager/metaSchema.mjs +36 -12
  49. package/dist/handsontable.css +2 -2
  50. package/dist/handsontable.full.css +2 -2
  51. package/dist/handsontable.full.js +2996 -1928
  52. package/dist/handsontable.full.min.css +2 -2
  53. package/dist/handsontable.full.min.js +42 -42
  54. package/dist/handsontable.js +2998 -1930
  55. package/dist/handsontable.min.css +2 -2
  56. package/dist/handsontable.min.js +25 -25
  57. package/dist/languages/all.js +130 -25
  58. package/dist/languages/all.min.js +1 -1
  59. package/dist/languages/hr-HR.js +167 -0
  60. package/dist/languages/hr-HR.min.js +1 -0
  61. package/editorManager.js +15 -4
  62. package/editorManager.mjs +15 -4
  63. package/editors/autocompleteEditor/autocompleteEditor.js +2 -2
  64. package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -2
  65. package/editors/baseEditor/baseEditor.js +1 -1
  66. package/editors/baseEditor/baseEditor.mjs +1 -1
  67. package/editors/checkboxEditor/checkboxEditor.js +5 -4
  68. package/editors/checkboxEditor/checkboxEditor.mjs +5 -4
  69. package/editors/dateEditor/dateEditor.js +1 -1
  70. package/editors/dateEditor/dateEditor.mjs +1 -1
  71. package/editors/dropdownEditor/dropdownEditor.js +1 -1
  72. package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
  73. package/editors/handsontableEditor/handsontableEditor.js +1 -1
  74. package/editors/handsontableEditor/handsontableEditor.mjs +1 -1
  75. package/editors/selectEditor/selectEditor.js +1 -1
  76. package/editors/selectEditor/selectEditor.mjs +1 -1
  77. package/editors/textEditor/textEditor.js +1 -2
  78. package/editors/textEditor/textEditor.mjs +1 -2
  79. package/editors/timeEditor/timeEditor.js +1 -1
  80. package/editors/timeEditor/timeEditor.mjs +1 -1
  81. package/helpers/mixed.js +2 -2
  82. package/helpers/mixed.mjs +2 -2
  83. package/helpers/moves.js +86 -0
  84. package/helpers/moves.mjs +82 -0
  85. package/i18n/languages/hr-HR.js +96 -0
  86. package/i18n/languages/hr-HR.mjs +90 -0
  87. package/i18n/languages/index.js +2 -0
  88. package/i18n/languages/index.mjs +2 -1
  89. package/languages/all.js +130 -25
  90. package/languages/hr-HR.js +167 -0
  91. package/languages/hr-HR.mjs +92 -0
  92. package/languages/index.js +130 -25
  93. package/languages/index.mjs +2 -1
  94. package/package.json +11 -1
  95. package/pluginHooks.d.ts +4 -2
  96. package/pluginHooks.js +33 -3
  97. package/pluginHooks.mjs +33 -3
  98. package/plugins/autoColumnSize/autoColumnSize.js +6 -1
  99. package/plugins/autoColumnSize/autoColumnSize.mjs +6 -1
  100. package/plugins/autoRowSize/autoRowSize.js +5 -0
  101. package/plugins/autoRowSize/autoRowSize.mjs +5 -0
  102. package/plugins/autofill/autofill.js +3 -2
  103. package/plugins/autofill/autofill.mjs +3 -2
  104. package/plugins/dropdownMenu/dropdownMenu.js +58 -4
  105. package/plugins/dropdownMenu/dropdownMenu.mjs +58 -4
  106. package/plugins/filters/component/value.js +51 -5
  107. package/plugins/filters/component/value.mjs +51 -5
  108. package/plugins/filters/utils.js +1 -1
  109. package/plugins/filters/utils.mjs +1 -1
  110. package/plugins/formulas/formulas.js +10 -1
  111. package/plugins/formulas/formulas.mjs +10 -1
  112. package/plugins/formulas/indexSyncer/axisSyncer.js +3 -75
  113. package/plugins/formulas/indexSyncer/axisSyncer.mjs +3 -75
  114. package/plugins/manualColumnResize/manualColumnResize.js +3 -0
  115. package/plugins/manualColumnResize/manualColumnResize.mjs +3 -0
  116. package/plugins/mergeCells/cellsCollection.js +1 -1
  117. package/plugins/mergeCells/cellsCollection.mjs +1 -1
  118. package/plugins/mergeCells/mergeCells.js +30 -0
  119. package/plugins/mergeCells/mergeCells.mjs +30 -0
  120. package/plugins/undoRedo/undoRedo.js +61 -14
  121. package/plugins/undoRedo/undoRedo.mjs +61 -14
  122. package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -1
  123. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -1
  124. package/renderers/baseRenderer/baseRenderer.js +1 -1
  125. package/renderers/baseRenderer/baseRenderer.mjs +1 -1
  126. package/renderers/checkboxRenderer/checkboxRenderer.js +36 -8
  127. package/renderers/checkboxRenderer/checkboxRenderer.mjs +36 -8
  128. package/renderers/dateRenderer/dateRenderer.js +1 -1
  129. package/renderers/dateRenderer/dateRenderer.mjs +1 -1
  130. package/renderers/dropdownRenderer/dropdownRenderer.js +1 -1
  131. package/renderers/dropdownRenderer/dropdownRenderer.mjs +1 -1
  132. package/renderers/handsontableRenderer/handsontableRenderer.js +1 -1
  133. package/renderers/handsontableRenderer/handsontableRenderer.mjs +1 -1
  134. package/renderers/htmlRenderer/htmlRenderer.js +1 -1
  135. package/renderers/htmlRenderer/htmlRenderer.mjs +1 -1
  136. package/renderers/numericRenderer/index.js +2 -1
  137. package/renderers/numericRenderer/index.mjs +1 -1
  138. package/renderers/numericRenderer/numericRenderer.js +28 -13
  139. package/renderers/numericRenderer/numericRenderer.mjs +27 -13
  140. package/renderers/passwordRenderer/passwordRenderer.js +1 -1
  141. package/renderers/passwordRenderer/passwordRenderer.mjs +1 -1
  142. package/renderers/selectRenderer/selectRenderer.js +1 -1
  143. package/renderers/selectRenderer/selectRenderer.mjs +1 -1
  144. package/renderers/textRenderer/textRenderer.js +1 -1
  145. package/renderers/textRenderer/textRenderer.mjs +1 -1
  146. package/renderers/timeRenderer/timeRenderer.js +1 -1
  147. package/renderers/timeRenderer/timeRenderer.mjs +1 -1
  148. package/selection/mouseEventHandler.js +4 -0
  149. package/selection/mouseEventHandler.mjs +4 -0
  150. package/selection/selection.js +64 -5
  151. package/selection/selection.mjs +64 -5
  152. package/shortcuts/recorder.js +27 -8
  153. package/shortcuts/recorder.mjs +27 -8
  154. package/tableView.js +86 -5
  155. package/tableView.mjs +87 -6
  156. package/utils/autoResize.js +0 -1
  157. package/utils/autoResize.mjs +0 -1
  158. package/utils/ghostTable.js +6 -6
  159. package/utils/ghostTable.mjs +6 -6
  160. package/utils/parseTable.js +9 -1
  161. package/utils/parseTable.mjs +9 -1
@@ -1,39 +1,42 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
3
+ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
2
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
4
6
  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); }
7
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
5
8
  import { innerHeight, innerWidth, getScrollLeft, getScrollTop, offset } from "../../../helpers/dom/element.mjs";
6
9
  /**
7
10
  * @class Scroll
8
11
  */
12
+ var _getLastColumnIndex = /*#__PURE__*/new WeakSet();
13
+ var _getLastRowIndex = /*#__PURE__*/new WeakSet();
9
14
  class Scroll {
10
15
  /**
11
16
  * @param {ScrollDao} dataAccessObject Tha data access object.
12
17
  */
13
18
  constructor(dataAccessObject) {
14
19
  /**
15
- * The data access object.
20
+ * Get last visible row based on virtual dom and how table is visible in browser window viewport.
16
21
  *
17
- * @protected
18
- * @type {ScrollDao}
22
+ * @param {number} lastRowIndex The last visible row index.
23
+ * @returns {number}
19
24
  */
20
- _defineProperty(this, "dataAccessObject", void 0);
25
+ _classPrivateMethodInitSpec(this, _getLastRowIndex);
21
26
  /**
22
- * Holds the last column reached by the scroll, which determines the scroll snapping direction
23
- * (left or right) for a next horizontal scroll.
27
+ * Get last visible column based on virtual dom and how table is visible in browser window viewport.
24
28
  *
25
- * @protected
26
- * @type {number}
29
+ * @param {number} lastColumnIndex The last visible column index.
30
+ * @returns {number}
27
31
  */
28
- _defineProperty(this, "lastScrolledColumnPos", -1);
32
+ _classPrivateMethodInitSpec(this, _getLastColumnIndex);
29
33
  /**
30
- * Holds the last row reached by the scroll, which determines the scroll snapping direction
31
- * (top or bottom) for a next vertical scroll.
34
+ * The data access object.
32
35
  *
33
36
  * @protected
34
- * @type {number}
37
+ * @type {ScrollDao}
35
38
  */
36
- _defineProperty(this, "lastScrolledRowPos", -1);
39
+ _defineProperty(this, "dataAccessObject", void 0);
37
40
  this.dataAccessObject = dataAccessObject;
38
41
  }
39
42
 
@@ -71,8 +74,6 @@ class Scroll {
71
74
  if (!drawn || !Number.isInteger(column) || column < 0 || column > totalColumns) {
72
75
  return false;
73
76
  }
74
- const firstVisibleColumn = this.getFirstVisibleColumn();
75
- const lastVisibleColumn = this.getLastVisibleColumn();
76
77
  const autoSnapping = snapToRight === undefined && snapToLeft === undefined;
77
78
  const {
78
79
  fixedColumnsStart,
@@ -84,20 +85,17 @@ class Scroll {
84
85
  if (autoSnapping && column < fixedColumnsStart) {
85
86
  return false;
86
87
  }
87
- let result = false;
88
88
  column = this.dataAccessObject.wtSettings.getSetting('onBeforeViewportScrollHorizontally', column);
89
-
90
- // if there is no fully visible columns use the supporting variable (lastScrolledColumnPos) to
91
- // determine the snapping direction (left or right)
92
- if (firstVisibleColumn === -1) {
93
- result = inlineStartOverlay.scrollTo(column, autoSnapping ? column > this.lastScrolledColumnPos : snapToRight);
94
- } else if (autoSnapping && (column < firstVisibleColumn || column > lastVisibleColumn) || !autoSnapping) {
89
+ if (!Number.isInteger(column) || column < 0 || column > totalColumns) {
90
+ return false;
91
+ }
92
+ const firstColumn = this.getFirstVisibleColumn();
93
+ const lastColumn = this.getLastVisibleColumn();
94
+ let result = false;
95
+ if (autoSnapping && (column < firstColumn || column > lastColumn) || !autoSnapping) {
95
96
  // if there is at least one fully visible column determine the snapping direction based on
96
97
  // that columns or by snapToRight/snapToLeft flags, if provided.
97
- result = inlineStartOverlay.scrollTo(column, autoSnapping ? column > lastVisibleColumn : snapToRight);
98
- }
99
- if (result) {
100
- this.lastScrolledColumnPos = column;
98
+ result = inlineStartOverlay.scrollTo(column, autoSnapping ? column >= this.getLastPartiallyVisibleColumn() : snapToRight);
101
99
  }
102
100
  return result;
103
101
  }
@@ -120,8 +118,6 @@ class Scroll {
120
118
  if (!drawn || !Number.isInteger(row) || row < 0 || row > totalRows) {
121
119
  return false;
122
120
  }
123
- const firstVisibleRow = this.getFirstVisibleRow();
124
- const lastVisibleRow = this.getLastVisibleRow();
125
121
  const autoSnapping = snapToTop === undefined && snapToBottom === undefined;
126
122
  const {
127
123
  fixedRowsBottom,
@@ -134,20 +130,17 @@ class Scroll {
134
130
  if (autoSnapping && (row < fixedRowsTop || row > totalRows - fixedRowsBottom - 1)) {
135
131
  return false;
136
132
  }
137
- let result = false;
138
133
  row = this.dataAccessObject.wtSettings.getSetting('onBeforeViewportScrollVertically', row);
139
-
140
- // if there is no fully visible rows use the supporting variable (lastScrolledRowPos) to
141
- // determine the snapping direction (top or bottom)
142
- if (firstVisibleRow === -1) {
143
- result = topOverlay.scrollTo(row, autoSnapping ? row > this.lastScrolledRowPos : snapToBottom);
144
- } else if (autoSnapping && (row < firstVisibleRow || row > lastVisibleRow) || !autoSnapping) {
134
+ if (!Number.isInteger(row) || row < 0 || row > totalRows) {
135
+ return false;
136
+ }
137
+ const firstRow = this.getFirstVisibleRow();
138
+ const lastRow = this.getLastVisibleRow();
139
+ let result = false;
140
+ if (autoSnapping && (row < firstRow || row > lastRow) || !autoSnapping) {
145
141
  // if there is at least one fully visible row determine the snapping direction based on
146
142
  // that rows or by snapToTop/snapToBottom flags, if provided.
147
- result = topOverlay.scrollTo(row, autoSnapping ? row > lastVisibleRow : snapToBottom);
148
- }
149
- if (result) {
150
- this.lastScrolledRowPos = row;
143
+ result = topOverlay.scrollTo(row, autoSnapping ? row >= this.getLastPartiallyVisibleRow() : snapToBottom);
151
144
  }
152
145
  return result;
153
146
  }
@@ -167,33 +160,25 @@ class Scroll {
167
160
  * @returns {number}
168
161
  */
169
162
  getLastVisibleRow() {
170
- const {
171
- topOverlay,
172
- wtTable,
173
- wtViewport,
174
- totalRows,
175
- rootWindow
176
- } = this.dataAccessObject;
177
- let lastVisibleRow = wtTable.getLastVisibleRow();
178
- if (topOverlay.mainTableScrollableElement === rootWindow) {
179
- const rootElementOffset = offset(wtTable.wtRootElement);
180
- const windowScrollTop = getScrollTop(rootWindow, rootWindow);
181
-
182
- // Only calculate lastVisibleRow when table didn't filled (from bottom) whole viewport space
183
- if (rootElementOffset.top > windowScrollTop) {
184
- const windowHeight = innerHeight(rootWindow);
185
- let rowsHeight = wtViewport.getColumnHeaderHeight();
186
- for (let row = 1; row <= totalRows; row++) {
187
- rowsHeight += topOverlay.sumCellSizes(row - 1, row);
188
- if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {
189
- // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)
190
- lastVisibleRow = row - 2;
191
- break;
192
- }
193
- }
194
- }
195
- }
196
- return lastVisibleRow;
163
+ return _classPrivateMethodGet(this, _getLastRowIndex, _getLastRowIndex2).call(this, this.dataAccessObject.wtTable.getLastVisibleRow());
164
+ }
165
+
166
+ /**
167
+ * Get first partially visible row based on virtual dom and how table is visible in browser window viewport.
168
+ *
169
+ * @returns {number}
170
+ */
171
+ getFirstPartiallyVisibleRow() {
172
+ return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow();
173
+ }
174
+
175
+ /**
176
+ * Get last visible row based on virtual dom and how table is visible in browser window viewport.
177
+ *
178
+ * @returns {number}
179
+ */
180
+ getLastPartiallyVisibleRow() {
181
+ return _classPrivateMethodGet(this, _getLastRowIndex, _getLastRowIndex2).call(this, this.dataAccessObject.wtTable.getLastPartiallyVisibleRow());
197
182
  }
198
183
 
199
184
  /**
@@ -211,44 +196,92 @@ class Scroll {
211
196
  * @returns {number}
212
197
  */
213
198
  getLastVisibleColumn() {
214
- const {
215
- wtSettings,
216
- inlineStartOverlay,
217
- wtTable,
218
- wtViewport,
219
- totalColumns,
220
- rootWindow
221
- } = this.dataAccessObject;
222
- let lastVisibleColumn = wtTable.getLastVisibleColumn();
223
- if (inlineStartOverlay.mainTableScrollableElement === rootWindow) {
224
- const isRtl = wtSettings.getSetting('rtlMode');
225
- let inlineStartRootElementOffset = null;
226
- if (isRtl) {
227
- const tableRect = wtTable.TABLE.getBoundingClientRect();
228
- const rootDocument = this.dataAccessObject.rootWindow.document;
229
- const docOffsetWidth = rootDocument.documentElement.offsetWidth;
230
- inlineStartRootElementOffset = Math.abs(tableRect.right - docOffsetWidth);
231
- } else {
232
- const rootElementOffset = offset(wtTable.wtRootElement);
233
- inlineStartRootElementOffset = rootElementOffset.left;
199
+ return _classPrivateMethodGet(this, _getLastColumnIndex, _getLastColumnIndex2).call(this, this.dataAccessObject.wtTable.getLastVisibleColumn());
200
+ }
201
+
202
+ /**
203
+ * Get first partially visible column based on virtual dom and how table is visible in browser window viewport.
204
+ *
205
+ * @returns {number}
206
+ */
207
+ getFirstPartiallyVisibleColumn() {
208
+ return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn();
209
+ }
210
+
211
+ /**
212
+ * Get last partially visible column based on virtual dom and how table is visible in browser window viewport.
213
+ *
214
+ * @returns {number}
215
+ */
216
+ getLastPartiallyVisibleColumn() {
217
+ return _classPrivateMethodGet(this, _getLastColumnIndex, _getLastColumnIndex2).call(this, this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn());
218
+ }
219
+ }
220
+ function _getLastColumnIndex2(lastColumnIndex) {
221
+ const {
222
+ wtSettings,
223
+ inlineStartOverlay,
224
+ wtTable,
225
+ wtViewport,
226
+ totalColumns,
227
+ rootWindow
228
+ } = this.dataAccessObject;
229
+ if (inlineStartOverlay.mainTableScrollableElement === rootWindow) {
230
+ const isRtl = wtSettings.getSetting('rtlMode');
231
+ let inlineStartRootElementOffset = null;
232
+ if (isRtl) {
233
+ const tableRect = wtTable.TABLE.getBoundingClientRect();
234
+ const rootDocument = this.dataAccessObject.rootWindow.document;
235
+ const docOffsetWidth = rootDocument.documentElement.offsetWidth;
236
+ inlineStartRootElementOffset = Math.abs(tableRect.right - docOffsetWidth);
237
+ } else {
238
+ const rootElementOffset = offset(wtTable.wtRootElement);
239
+ inlineStartRootElementOffset = rootElementOffset.left;
240
+ }
241
+ const windowScrollLeft = Math.abs(getScrollLeft(rootWindow, rootWindow));
242
+
243
+ // Only calculate lastColumnIndex when table didn't filled (from right) whole viewport space
244
+ if (inlineStartRootElementOffset > windowScrollLeft) {
245
+ const windowWidth = innerWidth(rootWindow);
246
+ let columnsWidth = wtViewport.getRowHeaderWidth();
247
+ for (let column = 1; column <= totalColumns; column++) {
248
+ columnsWidth += inlineStartOverlay.sumCellSizes(column - 1, column);
249
+ if (inlineStartRootElementOffset + columnsWidth - windowScrollLeft >= windowWidth) {
250
+ // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)
251
+ lastColumnIndex = column - 2;
252
+ break;
253
+ }
234
254
  }
235
- const windowScrollLeft = Math.abs(getScrollLeft(rootWindow, rootWindow));
236
-
237
- // Only calculate lastVisibleColumn when table didn't filled (from right) whole viewport space
238
- if (inlineStartRootElementOffset > windowScrollLeft) {
239
- const windowWidth = innerWidth(rootWindow);
240
- let columnsWidth = wtViewport.getRowHeaderWidth();
241
- for (let column = 1; column <= totalColumns; column++) {
242
- columnsWidth += inlineStartOverlay.sumCellSizes(column - 1, column);
243
- if (inlineStartRootElementOffset + columnsWidth - windowScrollLeft >= windowWidth) {
244
- // Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)
245
- lastVisibleColumn = column - 2;
246
- break;
247
- }
255
+ }
256
+ }
257
+ return lastColumnIndex;
258
+ }
259
+ function _getLastRowIndex2(lastRowIndex) {
260
+ const {
261
+ topOverlay,
262
+ wtTable,
263
+ wtViewport,
264
+ totalRows,
265
+ rootWindow
266
+ } = this.dataAccessObject;
267
+ if (topOverlay.mainTableScrollableElement === rootWindow) {
268
+ const rootElementOffset = offset(wtTable.wtRootElement);
269
+ const windowScrollTop = getScrollTop(rootWindow, rootWindow);
270
+
271
+ // Only calculate lastRowIndex when table didn't filled (from bottom) whole viewport space
272
+ if (rootElementOffset.top > windowScrollTop) {
273
+ const windowHeight = innerHeight(rootWindow);
274
+ let rowsHeight = wtViewport.getColumnHeaderHeight();
275
+ for (let row = 1; row <= totalRows; row++) {
276
+ rowsHeight += topOverlay.sumCellSizes(row - 1, row);
277
+ if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {
278
+ // Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)
279
+ lastRowIndex = row - 2;
280
+ break;
248
281
  }
249
282
  }
250
283
  }
251
- return lastVisibleColumn;
252
284
  }
285
+ return lastRowIndex;
253
286
  }
254
287
  export default Scroll;
@@ -169,7 +169,7 @@ class Border {
169
169
  this.cornerStyle.width = this.cornerDefaultStyle.width;
170
170
  this.cornerStyle.height = this.cornerDefaultStyle.height;
171
171
  this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
172
- if ((0, _browser.isMobileBrowser)()) {
172
+ if ((0, _browser.isMobileBrowser)() && this.instance.getSetting('isDataViewInstance')) {
173
173
  this.createMultipleSelectorHandles();
174
174
  }
175
175
  this.disappear();
@@ -490,7 +490,7 @@ class Border {
490
490
  }
491
491
  this.cornerStyle.display = 'block';
492
492
  }
493
- if ((0, _browser.isMobileBrowser)()) {
493
+ if ((0, _browser.isMobileBrowser)() && this.instance.getSetting('isDataViewInstance')) {
494
494
  this.updateMultipleSelectionHandlesPosition(toRow, toColumn, top, inlineStartPos, width, height);
495
495
  }
496
496
  }
@@ -652,7 +652,7 @@ class Border {
652
652
  this.startStyle.display = 'none';
653
653
  this.endStyle.display = 'none';
654
654
  this.cornerStyle.display = 'none';
655
- if ((0, _browser.isMobileBrowser)()) {
655
+ if ((0, _browser.isMobileBrowser)() && this.instance.getSetting('isDataViewInstance')) {
656
656
  this.selectionHandles.styles.top.display = 'none';
657
657
  this.selectionHandles.styles.topHitArea.display = 'none';
658
658
  this.selectionHandles.styles.bottom.display = 'none';
@@ -166,7 +166,7 @@ class Border {
166
166
  this.cornerStyle.width = this.cornerDefaultStyle.width;
167
167
  this.cornerStyle.height = this.cornerDefaultStyle.height;
168
168
  this.cornerStyle.border = [this.cornerDefaultStyle.borderWidth, this.cornerDefaultStyle.borderStyle, this.cornerDefaultStyle.borderColor].join(' ');
169
- if (isMobileBrowser()) {
169
+ if (isMobileBrowser() && this.instance.getSetting('isDataViewInstance')) {
170
170
  this.createMultipleSelectorHandles();
171
171
  }
172
172
  this.disappear();
@@ -487,7 +487,7 @@ class Border {
487
487
  }
488
488
  this.cornerStyle.display = 'block';
489
489
  }
490
- if (isMobileBrowser()) {
490
+ if (isMobileBrowser() && this.instance.getSetting('isDataViewInstance')) {
491
491
  this.updateMultipleSelectionHandlesPosition(toRow, toColumn, top, inlineStartPos, width, height);
492
492
  }
493
493
  }
@@ -649,7 +649,7 @@ class Border {
649
649
  this.startStyle.display = 'none';
650
650
  this.endStyle.display = 'none';
651
651
  this.cornerStyle.display = 'none';
652
- if (isMobileBrowser()) {
652
+ if (isMobileBrowser() && this.instance.getSetting('isDataViewInstance')) {
653
653
  this.selectionHandles.styles.top.display = 'none';
654
654
  this.selectionHandles.styles.topHitArea.display = 'none';
655
655
  this.selectionHandles.styles.bottom.display = 'none';
@@ -39,6 +39,19 @@ const calculatedColumns = {
39
39
  }
40
40
  return startColumn;
41
41
  },
42
+ /**
43
+ * Get the source index of the first column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
44
+ *
45
+ * @returns {number}
46
+ * @this Table
47
+ */
48
+ getFirstPartiallyVisibleColumn() {
49
+ const startColumn = this.dataAccessObject.startColumnPartiallyVisible;
50
+ if (startColumn === null) {
51
+ return -1;
52
+ }
53
+ return startColumn;
54
+ },
42
55
  /**
43
56
  * Get the source index of the last rendered column. If no columns are rendered, returns an error code: -1.
44
57
  *
@@ -65,6 +78,19 @@ const calculatedColumns = {
65
78
  }
66
79
  return endColumn;
67
80
  },
81
+ /**
82
+ * Get the source index of the last column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
83
+ *
84
+ * @returns {number}
85
+ * @this Table
86
+ */
87
+ getLastPartiallyVisibleColumn() {
88
+ const endColumn = this.dataAccessObject.endColumnPartiallyVisible;
89
+ if (endColumn === null) {
90
+ return -1;
91
+ }
92
+ return endColumn;
93
+ },
68
94
  /**
69
95
  * Get the number of rendered columns.
70
96
  *
@@ -36,6 +36,19 @@ const calculatedColumns = {
36
36
  }
37
37
  return startColumn;
38
38
  },
39
+ /**
40
+ * Get the source index of the first column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
41
+ *
42
+ * @returns {number}
43
+ * @this Table
44
+ */
45
+ getFirstPartiallyVisibleColumn() {
46
+ const startColumn = this.dataAccessObject.startColumnPartiallyVisible;
47
+ if (startColumn === null) {
48
+ return -1;
49
+ }
50
+ return startColumn;
51
+ },
39
52
  /**
40
53
  * Get the source index of the last rendered column. If no columns are rendered, returns an error code: -1.
41
54
  *
@@ -62,6 +75,19 @@ const calculatedColumns = {
62
75
  }
63
76
  return endColumn;
64
77
  },
78
+ /**
79
+ * Get the source index of the last column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
80
+ *
81
+ * @returns {number}
82
+ * @this Table
83
+ */
84
+ getLastPartiallyVisibleColumn() {
85
+ const endColumn = this.dataAccessObject.endColumnPartiallyVisible;
86
+ if (endColumn === null) {
87
+ return -1;
88
+ }
89
+ return endColumn;
90
+ },
65
91
  /**
66
92
  * Get the number of rendered columns.
67
93
  *
@@ -39,6 +39,19 @@ const calculatedRows = {
39
39
  }
40
40
  return startRow;
41
41
  },
42
+ /**
43
+ * Get the source index of the first row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
44
+ *
45
+ * @returns {number}
46
+ * @this Table
47
+ */
48
+ getFirstPartiallyVisibleRow() {
49
+ const startRow = this.dataAccessObject.startRowPartiallyVisible;
50
+ if (startRow === null) {
51
+ return -1;
52
+ }
53
+ return startRow;
54
+ },
42
55
  /**
43
56
  * Get the source index of the last rendered row. If no rows are rendered, returns an error code: -1.
44
57
  *
@@ -65,6 +78,19 @@ const calculatedRows = {
65
78
  }
66
79
  return endRow;
67
80
  },
81
+ /**
82
+ * Get the source index of the last row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
83
+ *
84
+ * @returns {number}
85
+ * @this Table
86
+ */
87
+ getLastPartiallyVisibleRow() {
88
+ const endRow = this.dataAccessObject.endRowPartiallyVisible;
89
+ if (endRow === null) {
90
+ return -1;
91
+ }
92
+ return endRow;
93
+ },
68
94
  /**
69
95
  * Get the number of rendered rows.
70
96
  *
@@ -36,6 +36,19 @@ const calculatedRows = {
36
36
  }
37
37
  return startRow;
38
38
  },
39
+ /**
40
+ * Get the source index of the first row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
41
+ *
42
+ * @returns {number}
43
+ * @this Table
44
+ */
45
+ getFirstPartiallyVisibleRow() {
46
+ const startRow = this.dataAccessObject.startRowPartiallyVisible;
47
+ if (startRow === null) {
48
+ return -1;
49
+ }
50
+ return startRow;
51
+ },
39
52
  /**
40
53
  * Get the source index of the last rendered row. If no rows are rendered, returns an error code: -1.
41
54
  *
@@ -62,6 +75,19 @@ const calculatedRows = {
62
75
  }
63
76
  return endRow;
64
77
  },
78
+ /**
79
+ * Get the source index of the last row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
80
+ *
81
+ * @returns {number}
82
+ * @this Table
83
+ */
84
+ getLastPartiallyVisibleRow() {
85
+ const endRow = this.dataAccessObject.endRowPartiallyVisible;
86
+ if (endRow === null) {
87
+ return -1;
88
+ }
89
+ return endRow;
90
+ },
65
91
  /**
66
92
  * Get the number of rendered rows.
67
93
  *
@@ -36,6 +36,16 @@ const stickyColumnsStart = {
36
36
  getFirstVisibleColumn() {
37
37
  return this.getFirstRenderedColumn();
38
38
  },
39
+ /**
40
+ * Get the source index of the first column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
41
+ * Assumes that all rendered columns are fully visible.
42
+ *
43
+ * @returns {number}
44
+ * @this Table
45
+ */
46
+ getFirstPartiallyVisibleColumn() {
47
+ return this.getFirstRenderedColumn();
48
+ },
39
49
  /**
40
50
  * Get the source index of the last rendered column. If no columns are rendered, returns an error code: -1.
41
51
  *
@@ -55,6 +65,16 @@ const stickyColumnsStart = {
55
65
  getLastVisibleColumn() {
56
66
  return this.getLastRenderedColumn();
57
67
  },
68
+ /**
69
+ * Get the source index of the last column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
70
+ * Assumes that all rendered columns are fully visible.
71
+ *
72
+ * @returns {number}
73
+ * @this Table
74
+ */
75
+ getLastPartiallyVisibleColumn() {
76
+ return this.getLastRenderedColumn();
77
+ },
58
78
  /**
59
79
  * Get the number of rendered columns.
60
80
  *
@@ -33,6 +33,16 @@ const stickyColumnsStart = {
33
33
  getFirstVisibleColumn() {
34
34
  return this.getFirstRenderedColumn();
35
35
  },
36
+ /**
37
+ * Get the source index of the first column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
38
+ * Assumes that all rendered columns are fully visible.
39
+ *
40
+ * @returns {number}
41
+ * @this Table
42
+ */
43
+ getFirstPartiallyVisibleColumn() {
44
+ return this.getFirstRenderedColumn();
45
+ },
36
46
  /**
37
47
  * Get the source index of the last rendered column. If no columns are rendered, returns an error code: -1.
38
48
  *
@@ -52,6 +62,16 @@ const stickyColumnsStart = {
52
62
  getLastVisibleColumn() {
53
63
  return this.getLastRenderedColumn();
54
64
  },
65
+ /**
66
+ * Get the source index of the last column partially visible in the viewport. If no columns are partially visible, returns an error code: -1.
67
+ * Assumes that all rendered columns are fully visible.
68
+ *
69
+ * @returns {number}
70
+ * @this Table
71
+ */
72
+ getLastPartiallyVisibleColumn() {
73
+ return this.getLastRenderedColumn();
74
+ },
55
75
  /**
56
76
  * Get the number of rendered columns.
57
77
  *
@@ -41,6 +41,16 @@ const stickyRowsBottom = {
41
41
  getFirstVisibleRow() {
42
42
  return this.getFirstRenderedRow();
43
43
  },
44
+ /**
45
+ * Get the source index of the first row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
46
+ * Assumes that all rendered rows are fully visible.
47
+ *
48
+ * @returns {number}
49
+ * @this Table
50
+ */
51
+ getFirstPartiallyVisibleRow() {
52
+ return this.getFirstRenderedRow();
53
+ },
44
54
  /**
45
55
  * Get the source index of the last rendered row. If no rows are rendered, returns an error code: -1.
46
56
  *
@@ -60,6 +70,16 @@ const stickyRowsBottom = {
60
70
  getLastVisibleRow() {
61
71
  return this.getLastRenderedRow();
62
72
  },
73
+ /**
74
+ * Get the source index of the last row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
75
+ * Assumes that all rendered rows are fully visible.
76
+ *
77
+ * @returns {number}
78
+ * @this Table
79
+ */
80
+ getLastPartiallyVisibleRow() {
81
+ return this.getLastRenderedRow();
82
+ },
63
83
  /**
64
84
  * Get the number of rendered rows.
65
85
  *
@@ -38,6 +38,16 @@ const stickyRowsBottom = {
38
38
  getFirstVisibleRow() {
39
39
  return this.getFirstRenderedRow();
40
40
  },
41
+ /**
42
+ * Get the source index of the first row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
43
+ * Assumes that all rendered rows are fully visible.
44
+ *
45
+ * @returns {number}
46
+ * @this Table
47
+ */
48
+ getFirstPartiallyVisibleRow() {
49
+ return this.getFirstRenderedRow();
50
+ },
41
51
  /**
42
52
  * Get the source index of the last rendered row. If no rows are rendered, returns an error code: -1.
43
53
  *
@@ -57,6 +67,16 @@ const stickyRowsBottom = {
57
67
  getLastVisibleRow() {
58
68
  return this.getLastRenderedRow();
59
69
  },
70
+ /**
71
+ * Get the source index of the last row partially visible in the viewport. If no rows are partially visible, returns an error code: -1.
72
+ * Assumes that all rendered rows are fully visible.
73
+ *
74
+ * @returns {number}
75
+ * @this Table
76
+ */
77
+ getLastPartiallyVisibleRow() {
78
+ return this.getLastRenderedRow();
79
+ },
60
80
  /**
61
81
  * Get the number of rendered rows.
62
82
  *