handsontable 14.1.0 → 14.2.0-next-7ae341f-20240229
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.
- package/3rdparty/walkontable/src/core/_base.js +12 -0
- package/3rdparty/walkontable/src/core/_base.mjs +12 -0
- package/3rdparty/walkontable/src/scroll.js +131 -98
- package/3rdparty/walkontable/src/scroll.mjs +133 -100
- package/3rdparty/walkontable/src/selection/border/border.js +3 -3
- package/3rdparty/walkontable/src/selection/border/border.mjs +3 -3
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +26 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +26 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +26 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +26 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +20 -0
- package/3rdparty/walkontable/src/table.js +2 -0
- package/3rdparty/walkontable/src/table.mjs +2 -0
- package/3rdparty/walkontable/src/viewport.js +9 -0
- package/3rdparty/walkontable/src/viewport.mjs +10 -1
- package/CHANGELOG.md +36 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/index.js +6 -0
- package/core/index.mjs +2 -1
- package/core/viewportScroll/index.js +65 -0
- package/core/viewportScroll/index.mjs +61 -0
- package/core/viewportScroll/scrollStrategies/columnHeaderScroll.js +20 -0
- package/core/viewportScroll/scrollStrategies/columnHeaderScroll.mjs +16 -0
- package/core/viewportScroll/scrollStrategies/cornerHeaderScroll.js +14 -0
- package/core/viewportScroll/scrollStrategies/cornerHeaderScroll.mjs +10 -0
- package/core/viewportScroll/scrollStrategies/multipleScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/multipleScroll.mjs +11 -0
- package/core/viewportScroll/scrollStrategies/noncontiguousScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/noncontiguousScroll.mjs +11 -0
- package/core/viewportScroll/scrollStrategies/rowHeaderScroll.js +20 -0
- package/core/viewportScroll/scrollStrategies/rowHeaderScroll.mjs +16 -0
- package/core/viewportScroll/scrollStrategies/singleScroll.js +46 -0
- package/core/viewportScroll/scrollStrategies/singleScroll.mjs +42 -0
- package/core.d.ts +1 -1
- package/core.js +11 -52
- package/core.mjs +12 -53
- package/dataMap/metaManager/index.js +1 -1
- package/dataMap/metaManager/index.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +6 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +6 -1
- package/dataMap/metaManager/metaSchema.js +36 -12
- package/dataMap/metaManager/metaSchema.mjs +36 -12
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +2996 -1928
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +42 -42
- package/dist/handsontable.js +2998 -1930
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.js +130 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/hr-HR.js +167 -0
- package/dist/languages/hr-HR.min.js +1 -0
- package/editorManager.js +15 -4
- package/editorManager.mjs +15 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -2
- package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -2
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/checkboxEditor/checkboxEditor.js +5 -4
- package/editors/checkboxEditor/checkboxEditor.mjs +5 -4
- package/editors/dateEditor/dateEditor.js +1 -1
- package/editors/dateEditor/dateEditor.mjs +1 -1
- package/editors/dropdownEditor/dropdownEditor.js +1 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
- package/editors/handsontableEditor/handsontableEditor.js +1 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -1
- package/editors/selectEditor/selectEditor.js +1 -1
- package/editors/selectEditor/selectEditor.mjs +1 -1
- package/editors/textEditor/textEditor.js +1 -2
- package/editors/textEditor/textEditor.mjs +1 -2
- package/editors/timeEditor/timeEditor.js +1 -1
- package/editors/timeEditor/timeEditor.mjs +1 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/moves.js +86 -0
- package/helpers/moves.mjs +82 -0
- package/i18n/languages/hr-HR.js +96 -0
- package/i18n/languages/hr-HR.mjs +90 -0
- package/i18n/languages/index.js +2 -0
- package/i18n/languages/index.mjs +2 -1
- package/languages/all.js +130 -25
- package/languages/hr-HR.js +167 -0
- package/languages/hr-HR.mjs +92 -0
- package/languages/index.js +130 -25
- package/languages/index.mjs +2 -1
- package/package.json +11 -1
- package/pluginHooks.d.ts +4 -2
- package/pluginHooks.js +33 -3
- package/pluginHooks.mjs +33 -3
- package/plugins/autoColumnSize/autoColumnSize.js +6 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +6 -1
- package/plugins/autoRowSize/autoRowSize.js +5 -0
- package/plugins/autoRowSize/autoRowSize.mjs +5 -0
- package/plugins/autofill/autofill.js +3 -2
- package/plugins/autofill/autofill.mjs +3 -2
- package/plugins/dropdownMenu/dropdownMenu.js +58 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +58 -4
- package/plugins/filters/component/value.js +51 -5
- package/plugins/filters/component/value.mjs +51 -5
- package/plugins/filters/utils.js +1 -1
- package/plugins/filters/utils.mjs +1 -1
- package/plugins/formulas/formulas.js +10 -1
- package/plugins/formulas/formulas.mjs +10 -1
- package/plugins/formulas/indexSyncer/axisSyncer.js +3 -75
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +3 -75
- package/plugins/manualColumnResize/manualColumnResize.js +3 -0
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -0
- package/plugins/mergeCells/cellsCollection.js +1 -1
- package/plugins/mergeCells/cellsCollection.mjs +1 -1
- package/plugins/mergeCells/mergeCells.js +30 -0
- package/plugins/mergeCells/mergeCells.mjs +30 -0
- package/plugins/undoRedo/undoRedo.js +61 -14
- package/plugins/undoRedo/undoRedo.mjs +61 -14
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -1
- package/renderers/baseRenderer/baseRenderer.js +1 -1
- package/renderers/baseRenderer/baseRenderer.mjs +1 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +36 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +36 -8
- package/renderers/dateRenderer/dateRenderer.js +1 -1
- package/renderers/dateRenderer/dateRenderer.mjs +1 -1
- package/renderers/dropdownRenderer/dropdownRenderer.js +1 -1
- package/renderers/dropdownRenderer/dropdownRenderer.mjs +1 -1
- package/renderers/handsontableRenderer/handsontableRenderer.js +1 -1
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +1 -1
- package/renderers/htmlRenderer/htmlRenderer.js +1 -1
- package/renderers/htmlRenderer/htmlRenderer.mjs +1 -1
- package/renderers/numericRenderer/index.js +2 -1
- package/renderers/numericRenderer/index.mjs +1 -1
- package/renderers/numericRenderer/numericRenderer.js +28 -13
- package/renderers/numericRenderer/numericRenderer.mjs +27 -13
- package/renderers/passwordRenderer/passwordRenderer.js +1 -1
- package/renderers/passwordRenderer/passwordRenderer.mjs +1 -1
- package/renderers/selectRenderer/selectRenderer.js +1 -1
- package/renderers/selectRenderer/selectRenderer.mjs +1 -1
- package/renderers/textRenderer/textRenderer.js +1 -1
- package/renderers/textRenderer/textRenderer.mjs +1 -1
- package/renderers/timeRenderer/timeRenderer.js +1 -1
- package/renderers/timeRenderer/timeRenderer.mjs +1 -1
- package/selection/mouseEventHandler.js +4 -0
- package/selection/mouseEventHandler.mjs +4 -0
- package/selection/selection.js +64 -5
- package/selection/selection.mjs +64 -5
- package/shortcuts/recorder.js +27 -8
- package/shortcuts/recorder.mjs +27 -8
- package/tableView.js +86 -5
- package/tableView.mjs +87 -6
- package/utils/autoResize.js +0 -1
- package/utils/autoResize.mjs +0 -1
- package/utils/ghostTable.js +6 -6
- package/utils/ghostTable.mjs +6 -6
- package/utils/parseTable.js +9 -1
- package/utils/parseTable.mjs +9 -1
@@ -318,12 +318,18 @@ class CoreAbstract {
|
|
318
318
|
get startColumnVisible() {
|
319
319
|
return wot.wtViewport.columnsVisibleCalculator.startColumn;
|
320
320
|
},
|
321
|
+
get startColumnPartiallyVisible() {
|
322
|
+
return wot.wtViewport.columnsPartiallyVisibleCalculator.startColumn;
|
323
|
+
},
|
321
324
|
get endColumnRendered() {
|
322
325
|
return wot.wtViewport.columnsRenderCalculator.endColumn;
|
323
326
|
},
|
324
327
|
get endColumnVisible() {
|
325
328
|
return wot.wtViewport.columnsVisibleCalculator.endColumn;
|
326
329
|
},
|
330
|
+
get endColumnPartiallyVisible() {
|
331
|
+
return wot.wtViewport.columnsPartiallyVisibleCalculator.endColumn;
|
332
|
+
},
|
327
333
|
get countColumnsRendered() {
|
328
334
|
return wot.wtViewport.columnsRenderCalculator.count;
|
329
335
|
},
|
@@ -336,12 +342,18 @@ class CoreAbstract {
|
|
336
342
|
get startRowVisible() {
|
337
343
|
return wot.wtViewport.rowsVisibleCalculator.startRow;
|
338
344
|
},
|
345
|
+
get startRowPartiallyVisible() {
|
346
|
+
return wot.wtViewport.rowsPartiallyVisibleCalculator.startRow;
|
347
|
+
},
|
339
348
|
get endRowRendered() {
|
340
349
|
return wot.wtViewport.rowsRenderCalculator.endRow;
|
341
350
|
},
|
342
351
|
get endRowVisible() {
|
343
352
|
return wot.wtViewport.rowsVisibleCalculator.endRow;
|
344
353
|
},
|
354
|
+
get endRowPartiallyVisible() {
|
355
|
+
return wot.wtViewport.rowsPartiallyVisibleCalculator.endRow;
|
356
|
+
},
|
345
357
|
get countRowsRendered() {
|
346
358
|
return wot.wtViewport.rowsRenderCalculator.count;
|
347
359
|
},
|
@@ -314,12 +314,18 @@ export default class CoreAbstract {
|
|
314
314
|
get startColumnVisible() {
|
315
315
|
return wot.wtViewport.columnsVisibleCalculator.startColumn;
|
316
316
|
},
|
317
|
+
get startColumnPartiallyVisible() {
|
318
|
+
return wot.wtViewport.columnsPartiallyVisibleCalculator.startColumn;
|
319
|
+
},
|
317
320
|
get endColumnRendered() {
|
318
321
|
return wot.wtViewport.columnsRenderCalculator.endColumn;
|
319
322
|
},
|
320
323
|
get endColumnVisible() {
|
321
324
|
return wot.wtViewport.columnsVisibleCalculator.endColumn;
|
322
325
|
},
|
326
|
+
get endColumnPartiallyVisible() {
|
327
|
+
return wot.wtViewport.columnsPartiallyVisibleCalculator.endColumn;
|
328
|
+
},
|
323
329
|
get countColumnsRendered() {
|
324
330
|
return wot.wtViewport.columnsRenderCalculator.count;
|
325
331
|
},
|
@@ -332,12 +338,18 @@ export default class CoreAbstract {
|
|
332
338
|
get startRowVisible() {
|
333
339
|
return wot.wtViewport.rowsVisibleCalculator.startRow;
|
334
340
|
},
|
341
|
+
get startRowPartiallyVisible() {
|
342
|
+
return wot.wtViewport.rowsPartiallyVisibleCalculator.startRow;
|
343
|
+
},
|
335
344
|
get endRowRendered() {
|
336
345
|
return wot.wtViewport.rowsRenderCalculator.endRow;
|
337
346
|
},
|
338
347
|
get endRowVisible() {
|
339
348
|
return wot.wtViewport.rowsVisibleCalculator.endRow;
|
340
349
|
},
|
350
|
+
get endRowPartiallyVisible() {
|
351
|
+
return wot.wtViewport.rowsPartiallyVisibleCalculator.endRow;
|
352
|
+
},
|
341
353
|
get countRowsRendered() {
|
342
354
|
return wot.wtViewport.rowsRenderCalculator.count;
|
343
355
|
},
|
@@ -3,40 +3,43 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
5
|
var _element = require("../../../helpers/dom/element");
|
6
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
7
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
6
8
|
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; }
|
7
9
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
8
10
|
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); }
|
11
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
9
12
|
/**
|
10
13
|
* @class Scroll
|
11
14
|
*/
|
15
|
+
var _getLastColumnIndex = /*#__PURE__*/new WeakSet();
|
16
|
+
var _getLastRowIndex = /*#__PURE__*/new WeakSet();
|
12
17
|
class Scroll {
|
13
18
|
/**
|
14
19
|
* @param {ScrollDao} dataAccessObject Tha data access object.
|
15
20
|
*/
|
16
21
|
constructor(dataAccessObject) {
|
17
22
|
/**
|
18
|
-
*
|
23
|
+
* Get last visible row based on virtual dom and how table is visible in browser window viewport.
|
19
24
|
*
|
20
|
-
* @
|
21
|
-
* @
|
25
|
+
* @param {number} lastRowIndex The last visible row index.
|
26
|
+
* @returns {number}
|
22
27
|
*/
|
23
|
-
|
28
|
+
_classPrivateMethodInitSpec(this, _getLastRowIndex);
|
24
29
|
/**
|
25
|
-
*
|
26
|
-
* (left or right) for a next horizontal scroll.
|
30
|
+
* Get last visible column based on virtual dom and how table is visible in browser window viewport.
|
27
31
|
*
|
28
|
-
* @
|
29
|
-
* @
|
32
|
+
* @param {number} lastColumnIndex The last visible column index.
|
33
|
+
* @returns {number}
|
30
34
|
*/
|
31
|
-
|
35
|
+
_classPrivateMethodInitSpec(this, _getLastColumnIndex);
|
32
36
|
/**
|
33
|
-
*
|
34
|
-
* (top or bottom) for a next vertical scroll.
|
37
|
+
* The data access object.
|
35
38
|
*
|
36
39
|
* @protected
|
37
|
-
* @type {
|
40
|
+
* @type {ScrollDao}
|
38
41
|
*/
|
39
|
-
_defineProperty(this, "
|
42
|
+
_defineProperty(this, "dataAccessObject", void 0);
|
40
43
|
this.dataAccessObject = dataAccessObject;
|
41
44
|
}
|
42
45
|
|
@@ -74,8 +77,6 @@ class Scroll {
|
|
74
77
|
if (!drawn || !Number.isInteger(column) || column < 0 || column > totalColumns) {
|
75
78
|
return false;
|
76
79
|
}
|
77
|
-
const firstVisibleColumn = this.getFirstVisibleColumn();
|
78
|
-
const lastVisibleColumn = this.getLastVisibleColumn();
|
79
80
|
const autoSnapping = snapToRight === undefined && snapToLeft === undefined;
|
80
81
|
const {
|
81
82
|
fixedColumnsStart,
|
@@ -87,20 +88,17 @@ class Scroll {
|
|
87
88
|
if (autoSnapping && column < fixedColumnsStart) {
|
88
89
|
return false;
|
89
90
|
}
|
90
|
-
let result = false;
|
91
91
|
column = this.dataAccessObject.wtSettings.getSetting('onBeforeViewportScrollHorizontally', column);
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
92
|
+
if (!Number.isInteger(column) || column < 0 || column > totalColumns) {
|
93
|
+
return false;
|
94
|
+
}
|
95
|
+
const firstColumn = this.getFirstVisibleColumn();
|
96
|
+
const lastColumn = this.getLastVisibleColumn();
|
97
|
+
let result = false;
|
98
|
+
if (autoSnapping && (column < firstColumn || column > lastColumn) || !autoSnapping) {
|
98
99
|
// if there is at least one fully visible column determine the snapping direction based on
|
99
100
|
// that columns or by snapToRight/snapToLeft flags, if provided.
|
100
|
-
result = inlineStartOverlay.scrollTo(column, autoSnapping ? column
|
101
|
-
}
|
102
|
-
if (result) {
|
103
|
-
this.lastScrolledColumnPos = column;
|
101
|
+
result = inlineStartOverlay.scrollTo(column, autoSnapping ? column >= this.getLastPartiallyVisibleColumn() : snapToRight);
|
104
102
|
}
|
105
103
|
return result;
|
106
104
|
}
|
@@ -123,8 +121,6 @@ class Scroll {
|
|
123
121
|
if (!drawn || !Number.isInteger(row) || row < 0 || row > totalRows) {
|
124
122
|
return false;
|
125
123
|
}
|
126
|
-
const firstVisibleRow = this.getFirstVisibleRow();
|
127
|
-
const lastVisibleRow = this.getLastVisibleRow();
|
128
124
|
const autoSnapping = snapToTop === undefined && snapToBottom === undefined;
|
129
125
|
const {
|
130
126
|
fixedRowsBottom,
|
@@ -137,20 +133,17 @@ class Scroll {
|
|
137
133
|
if (autoSnapping && (row < fixedRowsTop || row > totalRows - fixedRowsBottom - 1)) {
|
138
134
|
return false;
|
139
135
|
}
|
140
|
-
let result = false;
|
141
136
|
row = this.dataAccessObject.wtSettings.getSetting('onBeforeViewportScrollVertically', row);
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
137
|
+
if (!Number.isInteger(row) || row < 0 || row > totalRows) {
|
138
|
+
return false;
|
139
|
+
}
|
140
|
+
const firstRow = this.getFirstVisibleRow();
|
141
|
+
const lastRow = this.getLastVisibleRow();
|
142
|
+
let result = false;
|
143
|
+
if (autoSnapping && (row < firstRow || row > lastRow) || !autoSnapping) {
|
148
144
|
// if there is at least one fully visible row determine the snapping direction based on
|
149
145
|
// that rows or by snapToTop/snapToBottom flags, if provided.
|
150
|
-
result = topOverlay.scrollTo(row, autoSnapping ? row
|
151
|
-
}
|
152
|
-
if (result) {
|
153
|
-
this.lastScrolledRowPos = row;
|
146
|
+
result = topOverlay.scrollTo(row, autoSnapping ? row >= this.getLastPartiallyVisibleRow() : snapToBottom);
|
154
147
|
}
|
155
148
|
return result;
|
156
149
|
}
|
@@ -170,33 +163,25 @@ class Scroll {
|
|
170
163
|
* @returns {number}
|
171
164
|
*/
|
172
165
|
getLastVisibleRow() {
|
173
|
-
|
174
|
-
|
175
|
-
wtTable,
|
176
|
-
wtViewport,
|
177
|
-
totalRows,
|
178
|
-
rootWindow
|
179
|
-
} = this.dataAccessObject;
|
180
|
-
let lastVisibleRow = wtTable.getLastVisibleRow();
|
181
|
-
if (topOverlay.mainTableScrollableElement === rootWindow) {
|
182
|
-
const rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
|
183
|
-
const windowScrollTop = (0, _element.getScrollTop)(rootWindow, rootWindow);
|
166
|
+
return _classPrivateMethodGet(this, _getLastRowIndex, _getLastRowIndex2).call(this, this.dataAccessObject.wtTable.getLastVisibleRow());
|
167
|
+
}
|
184
168
|
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
169
|
+
/**
|
170
|
+
* Get first partially visible row based on virtual dom and how table is visible in browser window viewport.
|
171
|
+
*
|
172
|
+
* @returns {number}
|
173
|
+
*/
|
174
|
+
getFirstPartiallyVisibleRow() {
|
175
|
+
return this.dataAccessObject.wtTable.getFirstPartiallyVisibleRow();
|
176
|
+
}
|
177
|
+
|
178
|
+
/**
|
179
|
+
* Get last visible row based on virtual dom and how table is visible in browser window viewport.
|
180
|
+
*
|
181
|
+
* @returns {number}
|
182
|
+
*/
|
183
|
+
getLastPartiallyVisibleRow() {
|
184
|
+
return _classPrivateMethodGet(this, _getLastRowIndex, _getLastRowIndex2).call(this, this.dataAccessObject.wtTable.getLastPartiallyVisibleRow());
|
200
185
|
}
|
201
186
|
|
202
187
|
/**
|
@@ -214,44 +199,92 @@ class Scroll {
|
|
214
199
|
* @returns {number}
|
215
200
|
*/
|
216
201
|
getLastVisibleColumn() {
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
202
|
+
return _classPrivateMethodGet(this, _getLastColumnIndex, _getLastColumnIndex2).call(this, this.dataAccessObject.wtTable.getLastVisibleColumn());
|
203
|
+
}
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Get first partially visible column based on virtual dom and how table is visible in browser window viewport.
|
207
|
+
*
|
208
|
+
* @returns {number}
|
209
|
+
*/
|
210
|
+
getFirstPartiallyVisibleColumn() {
|
211
|
+
return this.dataAccessObject.wtTable.getFirstPartiallyVisibleColumn();
|
212
|
+
}
|
213
|
+
|
214
|
+
/**
|
215
|
+
* Get last partially visible column based on virtual dom and how table is visible in browser window viewport.
|
216
|
+
*
|
217
|
+
* @returns {number}
|
218
|
+
*/
|
219
|
+
getLastPartiallyVisibleColumn() {
|
220
|
+
return _classPrivateMethodGet(this, _getLastColumnIndex, _getLastColumnIndex2).call(this, this.dataAccessObject.wtTable.getLastPartiallyVisibleColumn());
|
221
|
+
}
|
222
|
+
}
|
223
|
+
function _getLastColumnIndex2(lastColumnIndex) {
|
224
|
+
const {
|
225
|
+
wtSettings,
|
226
|
+
inlineStartOverlay,
|
227
|
+
wtTable,
|
228
|
+
wtViewport,
|
229
|
+
totalColumns,
|
230
|
+
rootWindow
|
231
|
+
} = this.dataAccessObject;
|
232
|
+
if (inlineStartOverlay.mainTableScrollableElement === rootWindow) {
|
233
|
+
const isRtl = wtSettings.getSetting('rtlMode');
|
234
|
+
let inlineStartRootElementOffset = null;
|
235
|
+
if (isRtl) {
|
236
|
+
const tableRect = wtTable.TABLE.getBoundingClientRect();
|
237
|
+
const rootDocument = this.dataAccessObject.rootWindow.document;
|
238
|
+
const docOffsetWidth = rootDocument.documentElement.offsetWidth;
|
239
|
+
inlineStartRootElementOffset = Math.abs(tableRect.right - docOffsetWidth);
|
240
|
+
} else {
|
241
|
+
const rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
|
242
|
+
inlineStartRootElementOffset = rootElementOffset.left;
|
243
|
+
}
|
244
|
+
const windowScrollLeft = Math.abs((0, _element.getScrollLeft)(rootWindow, rootWindow));
|
245
|
+
|
246
|
+
// Only calculate lastColumnIndex when table didn't filled (from right) whole viewport space
|
247
|
+
if (inlineStartRootElementOffset > windowScrollLeft) {
|
248
|
+
const windowWidth = (0, _element.innerWidth)(rootWindow);
|
249
|
+
let columnsWidth = wtViewport.getRowHeaderWidth();
|
250
|
+
for (let column = 1; column <= totalColumns; column++) {
|
251
|
+
columnsWidth += inlineStartOverlay.sumCellSizes(column - 1, column);
|
252
|
+
if (inlineStartRootElementOffset + columnsWidth - windowScrollLeft >= windowWidth) {
|
253
|
+
// Return physical column - 1 (-2 because rangeEach gives column index + 1 - sumCellSizes requirements)
|
254
|
+
lastColumnIndex = column - 2;
|
255
|
+
break;
|
256
|
+
}
|
237
257
|
}
|
238
|
-
|
258
|
+
}
|
259
|
+
}
|
260
|
+
return lastColumnIndex;
|
261
|
+
}
|
262
|
+
function _getLastRowIndex2(lastRowIndex) {
|
263
|
+
const {
|
264
|
+
topOverlay,
|
265
|
+
wtTable,
|
266
|
+
wtViewport,
|
267
|
+
totalRows,
|
268
|
+
rootWindow
|
269
|
+
} = this.dataAccessObject;
|
270
|
+
if (topOverlay.mainTableScrollableElement === rootWindow) {
|
271
|
+
const rootElementOffset = (0, _element.offset)(wtTable.wtRootElement);
|
272
|
+
const windowScrollTop = (0, _element.getScrollTop)(rootWindow, rootWindow);
|
239
273
|
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
}
|
274
|
+
// Only calculate lastRowIndex when table didn't filled (from bottom) whole viewport space
|
275
|
+
if (rootElementOffset.top > windowScrollTop) {
|
276
|
+
const windowHeight = (0, _element.innerHeight)(rootWindow);
|
277
|
+
let rowsHeight = wtViewport.getColumnHeaderHeight();
|
278
|
+
for (let row = 1; row <= totalRows; row++) {
|
279
|
+
rowsHeight += topOverlay.sumCellSizes(row - 1, row);
|
280
|
+
if (rootElementOffset.top + rowsHeight - windowScrollTop >= windowHeight) {
|
281
|
+
// Return physical row - 1 (-2 because rangeEach gives row index + 1 - sumCellSizes requirements)
|
282
|
+
lastRowIndex = row - 2;
|
283
|
+
break;
|
251
284
|
}
|
252
285
|
}
|
253
286
|
}
|
254
|
-
return lastVisibleColumn;
|
255
287
|
}
|
288
|
+
return lastRowIndex;
|
256
289
|
}
|
257
290
|
var _default = exports.default = Scroll;
|