handsontable 0.0.0-next-e989337-20240117 → 0.0.0-next-40cdda4-20240118
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/core/_base.js +12 -0
- package/3rdparty/walkontable/src/core/_base.mjs +12 -0
- package/3rdparty/walkontable/src/scroll.js +125 -98
- package/3rdparty/walkontable/src/scroll.mjs +127 -100
- 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/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.js +11 -52
- package/core.mjs +12 -53
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +1583 -1079
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +41 -41
- package/dist/handsontable.js +1585 -1081
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +16 -16
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/selection/mouseEventHandler.js +4 -0
- package/selection/mouseEventHandler.mjs +4 -0
- package/selection/selection.js +63 -4
- package/selection/selection.mjs +63 -4
- package/tableView.js +76 -0
- package/tableView.mjs +76 -0
- package/utils/ghostTable.js +6 -6
- package/utils/ghostTable.mjs +6 -6
package/helpers/mixed.js
CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
|
|
134
134
|
function _injectProductInfo(key, element) {
|
135
135
|
const hasValidType = !isEmpty(key);
|
136
136
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
137
|
-
const hotVersion = "0.0.0-next-
|
137
|
+
const hotVersion = "0.0.0-next-40cdda4-20240118";
|
138
138
|
let keyValidityDate;
|
139
139
|
let consoleMessageState = 'invalid';
|
140
140
|
let domMessageState = 'invalid';
|
package/helpers/mixed.mjs
CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
|
|
124
124
|
export function _injectProductInfo(key, element) {
|
125
125
|
const hasValidType = !isEmpty(key);
|
126
126
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
127
|
-
const hotVersion = "0.0.0-next-
|
127
|
+
const hotVersion = "0.0.0-next-40cdda4-20240118";
|
128
128
|
let keyValidityDate;
|
129
129
|
let consoleMessageState = 'invalid';
|
130
130
|
let domMessageState = 'invalid';
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"url": "https://github.com/handsontable/handsontable/issues"
|
11
11
|
},
|
12
12
|
"author": "Handsoncode <hello@handsontable.com>",
|
13
|
-
"version": "0.0.0-next-
|
13
|
+
"version": "0.0.0-next-40cdda4-20240118",
|
14
14
|
"main": "index",
|
15
15
|
"module": "index.mjs",
|
16
16
|
"jsnext:main": "index.mjs",
|
@@ -31,6 +31,7 @@ function mouseDown(_ref) {
|
|
31
31
|
const currentSelection = selection.isSelected() ? selection.getSelectedRange().current() : null;
|
32
32
|
const selectedCorner = selection.isSelectedByCorner();
|
33
33
|
const selectedRow = selection.isSelectedByRowHeader();
|
34
|
+
selection.markSource('mouse');
|
34
35
|
if (isShiftKey && currentSelection) {
|
35
36
|
if (coords.row >= 0 && coords.col >= 0 && !controller.cell) {
|
36
37
|
selection.setRangeEnd(coords);
|
@@ -74,6 +75,7 @@ function mouseDown(_ref) {
|
|
74
75
|
});
|
75
76
|
}
|
76
77
|
}
|
78
|
+
selection.markEndSource();
|
77
79
|
}
|
78
80
|
|
79
81
|
/**
|
@@ -102,6 +104,7 @@ function mouseOver(_ref2) {
|
|
102
104
|
const selectedColumn = selection.isSelectedByColumnHeader();
|
103
105
|
const countCols = selection.tableProps.countCols();
|
104
106
|
const countRows = selection.tableProps.countRows();
|
107
|
+
selection.markSource('mouse');
|
105
108
|
if (selectedColumn && !controller.column) {
|
106
109
|
selection.setRangeEnd(cellCoordsFactory(countRows - 1, coords.col));
|
107
110
|
} else if (selectedRow && !controller.row) {
|
@@ -109,6 +112,7 @@ function mouseOver(_ref2) {
|
|
109
112
|
} else if (!controller.cell) {
|
110
113
|
selection.setRangeEnd(coords);
|
111
114
|
}
|
115
|
+
selection.markEndSource();
|
112
116
|
}
|
113
117
|
const handlers = new Map([['mousedown', mouseDown], ['mouseover', mouseOver], ['touchstart', mouseDown]]);
|
114
118
|
|
@@ -25,6 +25,7 @@ export function mouseDown(_ref) {
|
|
25
25
|
const currentSelection = selection.isSelected() ? selection.getSelectedRange().current() : null;
|
26
26
|
const selectedCorner = selection.isSelectedByCorner();
|
27
27
|
const selectedRow = selection.isSelectedByRowHeader();
|
28
|
+
selection.markSource('mouse');
|
28
29
|
if (isShiftKey && currentSelection) {
|
29
30
|
if (coords.row >= 0 && coords.col >= 0 && !controller.cell) {
|
30
31
|
selection.setRangeEnd(coords);
|
@@ -68,6 +69,7 @@ export function mouseDown(_ref) {
|
|
68
69
|
});
|
69
70
|
}
|
70
71
|
}
|
72
|
+
selection.markEndSource();
|
71
73
|
}
|
72
74
|
|
73
75
|
/**
|
@@ -96,6 +98,7 @@ export function mouseOver(_ref2) {
|
|
96
98
|
const selectedColumn = selection.isSelectedByColumnHeader();
|
97
99
|
const countCols = selection.tableProps.countCols();
|
98
100
|
const countRows = selection.tableProps.countRows();
|
101
|
+
selection.markSource('mouse');
|
99
102
|
if (selectedColumn && !controller.column) {
|
100
103
|
selection.setRangeEnd(cellCoordsFactory(countRows - 1, coords.col));
|
101
104
|
} else if (selectedRow && !controller.row) {
|
@@ -103,6 +106,7 @@ export function mouseOver(_ref2) {
|
|
103
106
|
} else if (!controller.cell) {
|
104
107
|
selection.setRangeEnd(coords);
|
105
108
|
}
|
109
|
+
selection.markEndSource();
|
106
110
|
}
|
107
111
|
const handlers = new Map([['mousedown', mouseDown], ['mouseover', mouseOver], ['touchstart', mouseDown]]);
|
108
112
|
|
package/selection/selection.js
CHANGED
@@ -21,16 +21,18 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
21
21
|
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; }
|
22
22
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
23
23
|
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); }
|
24
|
-
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
25
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
26
24
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
27
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
28
25
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
26
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
27
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
28
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
29
29
|
/**
|
30
30
|
* @class Selection
|
31
31
|
* @util
|
32
32
|
*/
|
33
33
|
var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
|
34
|
+
var _selectionSource = /*#__PURE__*/new WeakMap();
|
35
|
+
var _expectedLayersCount = /*#__PURE__*/new WeakMap();
|
34
36
|
class Selection {
|
35
37
|
constructor(settings, tableProps) {
|
36
38
|
var _this = this;
|
@@ -95,6 +97,25 @@ class Selection {
|
|
95
97
|
writable: true,
|
96
98
|
value: false
|
97
99
|
});
|
100
|
+
/**
|
101
|
+
* The source of the selection. It can be one of the following values: `mouse`, `unknown` or any other string.
|
102
|
+
*
|
103
|
+
* @type {'mouse' | 'unknown' | string}
|
104
|
+
*/
|
105
|
+
_classPrivateFieldInitSpec(this, _selectionSource, {
|
106
|
+
writable: true,
|
107
|
+
value: 'unknown'
|
108
|
+
});
|
109
|
+
/**
|
110
|
+
* The number of expected layers. It is used mostly to track when the last selection layer of non-contiguous
|
111
|
+
* selection is applied, thus the viewport scroll is triggered.
|
112
|
+
*
|
113
|
+
* @param {number}
|
114
|
+
*/
|
115
|
+
_classPrivateFieldInitSpec(this, _expectedLayersCount, {
|
116
|
+
writable: true,
|
117
|
+
value: -1
|
118
|
+
});
|
98
119
|
this.settings = settings;
|
99
120
|
this.tableProps = tableProps;
|
100
121
|
this.highlight = new _highlight.default({
|
@@ -193,6 +214,41 @@ class Selection {
|
|
193
214
|
return this.selectedRange;
|
194
215
|
}
|
195
216
|
|
217
|
+
/**
|
218
|
+
* Marks the source of the selection. It can be one of the following values: `mouse`, or any other string.
|
219
|
+
*
|
220
|
+
* @param {'mouse' | 'unknown' | string} sourceName The source name.
|
221
|
+
*/
|
222
|
+
markSource(sourceName) {
|
223
|
+
_classPrivateFieldSet(this, _selectionSource, sourceName);
|
224
|
+
}
|
225
|
+
|
226
|
+
/**
|
227
|
+
* Marks end of the selection source. It restores the selection source to default value which is 'unknown'.
|
228
|
+
*/
|
229
|
+
markEndSource() {
|
230
|
+
_classPrivateFieldSet(this, _selectionSource, 'unknown');
|
231
|
+
}
|
232
|
+
|
233
|
+
/**
|
234
|
+
* Returns the source of the selection.
|
235
|
+
*
|
236
|
+
* @returns {'mouse' | 'unknown' | string}
|
237
|
+
*/
|
238
|
+
getSelectionSource() {
|
239
|
+
return _classPrivateFieldGet(this, _selectionSource);
|
240
|
+
}
|
241
|
+
|
242
|
+
/**
|
243
|
+
* Set the number of expected layers. The method is not obligatory to call. It is used mostly internally
|
244
|
+
* to determine when the last selection layer of non-contiguous is applied, thus the viewport scroll is triggered.
|
245
|
+
*
|
246
|
+
* @param {number} layersCount The number of expected layers.
|
247
|
+
*/
|
248
|
+
setExpectedLayers(layersCount) {
|
249
|
+
_classPrivateFieldSet(this, _expectedLayersCount, layersCount);
|
250
|
+
}
|
251
|
+
|
196
252
|
/**
|
197
253
|
* Indicate that selection process began. It sets internally `.inProgress` property to `true`.
|
198
254
|
*/
|
@@ -206,6 +262,7 @@ class Selection {
|
|
206
262
|
finish() {
|
207
263
|
this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));
|
208
264
|
this.inProgress = false;
|
265
|
+
_classPrivateFieldSet(this, _expectedLayersCount, -1);
|
209
266
|
}
|
210
267
|
|
211
268
|
/**
|
@@ -390,7 +447,8 @@ class Selection {
|
|
390
447
|
activeCornerHeaderHighlight.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(), -this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1, -1)).commit();
|
391
448
|
}
|
392
449
|
}
|
393
|
-
this.
|
450
|
+
const isLastLayer = _classPrivateFieldGet(this, _expectedLayersCount) === -1 || this.selectedRange.size() === _classPrivateFieldGet(this, _expectedLayersCount);
|
451
|
+
this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
|
394
452
|
}
|
395
453
|
|
396
454
|
/**
|
@@ -708,6 +766,7 @@ class Selection {
|
|
708
766
|
});
|
709
767
|
if (isValid) {
|
710
768
|
this.clear();
|
769
|
+
this.setExpectedLayers(selectionRanges.length);
|
711
770
|
(0, _array.arrayEach)(selectionRanges, selection => {
|
712
771
|
const {
|
713
772
|
from,
|
package/selection/selection.mjs
CHANGED
@@ -4,11 +4,11 @@ function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollect
|
|
4
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; }
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
6
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 _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
8
|
-
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
9
7
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
10
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
11
8
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
9
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
11
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
12
12
|
import Highlight, { AREA_TYPE, HEADER_TYPE, FOCUS_TYPE } from "./highlight/highlight.mjs";
|
13
13
|
import SelectionRange from "./range.mjs";
|
14
14
|
import { createObjectPropListener, mixin } from "./../helpers/object.mjs";
|
@@ -25,6 +25,8 @@ import { A11Y_SELECTED } from "../helpers/a11y.mjs";
|
|
25
25
|
* @util
|
26
26
|
*/
|
27
27
|
var _disableHeadersHighlight = /*#__PURE__*/new WeakMap();
|
28
|
+
var _selectionSource = /*#__PURE__*/new WeakMap();
|
29
|
+
var _expectedLayersCount = /*#__PURE__*/new WeakMap();
|
28
30
|
class Selection {
|
29
31
|
constructor(settings, tableProps) {
|
30
32
|
var _this = this;
|
@@ -89,6 +91,25 @@ class Selection {
|
|
89
91
|
writable: true,
|
90
92
|
value: false
|
91
93
|
});
|
94
|
+
/**
|
95
|
+
* The source of the selection. It can be one of the following values: `mouse`, `unknown` or any other string.
|
96
|
+
*
|
97
|
+
* @type {'mouse' | 'unknown' | string}
|
98
|
+
*/
|
99
|
+
_classPrivateFieldInitSpec(this, _selectionSource, {
|
100
|
+
writable: true,
|
101
|
+
value: 'unknown'
|
102
|
+
});
|
103
|
+
/**
|
104
|
+
* The number of expected layers. It is used mostly to track when the last selection layer of non-contiguous
|
105
|
+
* selection is applied, thus the viewport scroll is triggered.
|
106
|
+
*
|
107
|
+
* @param {number}
|
108
|
+
*/
|
109
|
+
_classPrivateFieldInitSpec(this, _expectedLayersCount, {
|
110
|
+
writable: true,
|
111
|
+
value: -1
|
112
|
+
});
|
92
113
|
this.settings = settings;
|
93
114
|
this.tableProps = tableProps;
|
94
115
|
this.highlight = new Highlight({
|
@@ -187,6 +208,41 @@ class Selection {
|
|
187
208
|
return this.selectedRange;
|
188
209
|
}
|
189
210
|
|
211
|
+
/**
|
212
|
+
* Marks the source of the selection. It can be one of the following values: `mouse`, or any other string.
|
213
|
+
*
|
214
|
+
* @param {'mouse' | 'unknown' | string} sourceName The source name.
|
215
|
+
*/
|
216
|
+
markSource(sourceName) {
|
217
|
+
_classPrivateFieldSet(this, _selectionSource, sourceName);
|
218
|
+
}
|
219
|
+
|
220
|
+
/**
|
221
|
+
* Marks end of the selection source. It restores the selection source to default value which is 'unknown'.
|
222
|
+
*/
|
223
|
+
markEndSource() {
|
224
|
+
_classPrivateFieldSet(this, _selectionSource, 'unknown');
|
225
|
+
}
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Returns the source of the selection.
|
229
|
+
*
|
230
|
+
* @returns {'mouse' | 'unknown' | string}
|
231
|
+
*/
|
232
|
+
getSelectionSource() {
|
233
|
+
return _classPrivateFieldGet(this, _selectionSource);
|
234
|
+
}
|
235
|
+
|
236
|
+
/**
|
237
|
+
* Set the number of expected layers. The method is not obligatory to call. It is used mostly internally
|
238
|
+
* to determine when the last selection layer of non-contiguous is applied, thus the viewport scroll is triggered.
|
239
|
+
*
|
240
|
+
* @param {number} layersCount The number of expected layers.
|
241
|
+
*/
|
242
|
+
setExpectedLayers(layersCount) {
|
243
|
+
_classPrivateFieldSet(this, _expectedLayersCount, layersCount);
|
244
|
+
}
|
245
|
+
|
190
246
|
/**
|
191
247
|
* Indicate that selection process began. It sets internally `.inProgress` property to `true`.
|
192
248
|
*/
|
@@ -200,6 +256,7 @@ class Selection {
|
|
200
256
|
finish() {
|
201
257
|
this.runLocalHooks('afterSelectionFinished', Array.from(this.selectedRange));
|
202
258
|
this.inProgress = false;
|
259
|
+
_classPrivateFieldSet(this, _expectedLayersCount, -1);
|
203
260
|
}
|
204
261
|
|
205
262
|
/**
|
@@ -384,7 +441,8 @@ class Selection {
|
|
384
441
|
activeCornerHeaderHighlight.add(this.tableProps.createCellCoords(-this.tableProps.countColHeaders(), -this.tableProps.countRowHeaders())).add(this.tableProps.createCellCoords(-1, -1)).commit();
|
385
442
|
}
|
386
443
|
}
|
387
|
-
this.
|
444
|
+
const isLastLayer = _classPrivateFieldGet(this, _expectedLayersCount) === -1 || this.selectedRange.size() === _classPrivateFieldGet(this, _expectedLayersCount);
|
445
|
+
this.runLocalHooks('afterSetRangeEnd', coords, isLastLayer);
|
388
446
|
}
|
389
447
|
|
390
448
|
/**
|
@@ -702,6 +760,7 @@ class Selection {
|
|
702
760
|
});
|
703
761
|
if (isValid) {
|
704
762
|
this.clear();
|
763
|
+
this.setExpectedLayers(selectionRanges.length);
|
705
764
|
arrayEach(selectionRanges, selection => {
|
706
765
|
const {
|
707
766
|
from,
|
package/tableView.js
CHANGED
@@ -1310,6 +1310,42 @@ class TableView {
|
|
1310
1310
|
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn());
|
1311
1311
|
}
|
1312
1312
|
|
1313
|
+
/**
|
1314
|
+
* Returns the first partially visible row in the table viewport.
|
1315
|
+
*
|
1316
|
+
* @returns {number}
|
1317
|
+
*/
|
1318
|
+
getFirstPartiallyVisibleRow() {
|
1319
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleRow());
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
/**
|
1323
|
+
* Returns the last partially visible row in the table viewport.
|
1324
|
+
*
|
1325
|
+
* @returns {number}
|
1326
|
+
*/
|
1327
|
+
getLastPartiallyVisibleRow() {
|
1328
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleRow());
|
1329
|
+
}
|
1330
|
+
|
1331
|
+
/**
|
1332
|
+
* Returns the first partially visible column in the table viewport.
|
1333
|
+
*
|
1334
|
+
* @returns {number}
|
1335
|
+
*/
|
1336
|
+
getFirstPartiallyVisibleColumn() {
|
1337
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleColumn());
|
1338
|
+
}
|
1339
|
+
|
1340
|
+
/**
|
1341
|
+
* Returns the last partially visible column in the table viewport.
|
1342
|
+
*
|
1343
|
+
* @returns {number}
|
1344
|
+
*/
|
1345
|
+
getLastPartiallyVisibleColumn() {
|
1346
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleColumn());
|
1347
|
+
}
|
1348
|
+
|
1313
1349
|
/**
|
1314
1350
|
* Returns the total count of the rendered column headers.
|
1315
1351
|
*
|
@@ -1327,6 +1363,46 @@ class TableView {
|
|
1327
1363
|
getRowHeadersCount() {
|
1328
1364
|
return _classPrivateFieldGet(this, _rowHeadersCount);
|
1329
1365
|
}
|
1366
|
+
|
1367
|
+
/**
|
1368
|
+
* Returns the table's viewport width. When the table has defined the size of the container,
|
1369
|
+
* and the columns do not fill the entire viewport, the viewport width is equal to the sum of
|
1370
|
+
* the columns' widths.
|
1371
|
+
*
|
1372
|
+
* @returns {number}
|
1373
|
+
*/
|
1374
|
+
getViewportWidth() {
|
1375
|
+
return this.hot.view._wt.wtViewport.getViewportWidth();
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
/**
|
1379
|
+
* Returns the table's total width including the scrollbar width.
|
1380
|
+
*
|
1381
|
+
* @returns {number}
|
1382
|
+
*/
|
1383
|
+
getWorkspaceWidth() {
|
1384
|
+
return this.hot.view._wt.wtViewport.getWorkspaceWidth();
|
1385
|
+
}
|
1386
|
+
|
1387
|
+
/**
|
1388
|
+
* Returns the table's viewport height. When the table has defined the size of the container,
|
1389
|
+
* and the rows do not fill the entire viewport, the viewport height is equal to the sum of
|
1390
|
+
* the rows' heights.
|
1391
|
+
*
|
1392
|
+
* @returns {number}
|
1393
|
+
*/
|
1394
|
+
getViewportHeight() {
|
1395
|
+
return this.hot.view._wt.wtViewport.getViewportHeight();
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
/**
|
1399
|
+
* Returns the table's total height including the scrollbar height.
|
1400
|
+
*
|
1401
|
+
* @returns {number}
|
1402
|
+
*/
|
1403
|
+
getWorkspaceHeight() {
|
1404
|
+
return this.hot.view._wt.wtViewport.getWorkspaceHeight();
|
1405
|
+
}
|
1330
1406
|
/**
|
1331
1407
|
* Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
|
1332
1408
|
*
|
package/tableView.mjs
CHANGED
@@ -1306,6 +1306,42 @@ class TableView {
|
|
1306
1306
|
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn());
|
1307
1307
|
}
|
1308
1308
|
|
1309
|
+
/**
|
1310
|
+
* Returns the first partially visible row in the table viewport.
|
1311
|
+
*
|
1312
|
+
* @returns {number}
|
1313
|
+
*/
|
1314
|
+
getFirstPartiallyVisibleRow() {
|
1315
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleRow());
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
/**
|
1319
|
+
* Returns the last partially visible row in the table viewport.
|
1320
|
+
*
|
1321
|
+
* @returns {number}
|
1322
|
+
*/
|
1323
|
+
getLastPartiallyVisibleRow() {
|
1324
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleRow());
|
1325
|
+
}
|
1326
|
+
|
1327
|
+
/**
|
1328
|
+
* Returns the first partially visible column in the table viewport.
|
1329
|
+
*
|
1330
|
+
* @returns {number}
|
1331
|
+
*/
|
1332
|
+
getFirstPartiallyVisibleColumn() {
|
1333
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleColumn());
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
/**
|
1337
|
+
* Returns the last partially visible column in the table viewport.
|
1338
|
+
*
|
1339
|
+
* @returns {number}
|
1340
|
+
*/
|
1341
|
+
getLastPartiallyVisibleColumn() {
|
1342
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleColumn());
|
1343
|
+
}
|
1344
|
+
|
1309
1345
|
/**
|
1310
1346
|
* Returns the total count of the rendered column headers.
|
1311
1347
|
*
|
@@ -1323,6 +1359,46 @@ class TableView {
|
|
1323
1359
|
getRowHeadersCount() {
|
1324
1360
|
return _classPrivateFieldGet(this, _rowHeadersCount);
|
1325
1361
|
}
|
1362
|
+
|
1363
|
+
/**
|
1364
|
+
* Returns the table's viewport width. When the table has defined the size of the container,
|
1365
|
+
* and the columns do not fill the entire viewport, the viewport width is equal to the sum of
|
1366
|
+
* the columns' widths.
|
1367
|
+
*
|
1368
|
+
* @returns {number}
|
1369
|
+
*/
|
1370
|
+
getViewportWidth() {
|
1371
|
+
return this.hot.view._wt.wtViewport.getViewportWidth();
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
/**
|
1375
|
+
* Returns the table's total width including the scrollbar width.
|
1376
|
+
*
|
1377
|
+
* @returns {number}
|
1378
|
+
*/
|
1379
|
+
getWorkspaceWidth() {
|
1380
|
+
return this.hot.view._wt.wtViewport.getWorkspaceWidth();
|
1381
|
+
}
|
1382
|
+
|
1383
|
+
/**
|
1384
|
+
* Returns the table's viewport height. When the table has defined the size of the container,
|
1385
|
+
* and the rows do not fill the entire viewport, the viewport height is equal to the sum of
|
1386
|
+
* the rows' heights.
|
1387
|
+
*
|
1388
|
+
* @returns {number}
|
1389
|
+
*/
|
1390
|
+
getViewportHeight() {
|
1391
|
+
return this.hot.view._wt.wtViewport.getViewportHeight();
|
1392
|
+
}
|
1393
|
+
|
1394
|
+
/**
|
1395
|
+
* Returns the table's total height including the scrollbar height.
|
1396
|
+
*
|
1397
|
+
* @returns {number}
|
1398
|
+
*/
|
1399
|
+
getWorkspaceHeight() {
|
1400
|
+
return this.hot.view._wt.wtViewport.getWorkspaceHeight();
|
1401
|
+
}
|
1326
1402
|
/**
|
1327
1403
|
* Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
|
1328
1404
|
*
|
package/utils/ghostTable.js
CHANGED
@@ -65,7 +65,7 @@ class GhostTable {
|
|
65
65
|
/**
|
66
66
|
* Add row.
|
67
67
|
*
|
68
|
-
* @param {number} row
|
68
|
+
* @param {number} row Visual row index.
|
69
69
|
* @param {Map} samples Samples Map object.
|
70
70
|
*/
|
71
71
|
addRow(row, samples) {
|
@@ -112,7 +112,7 @@ class GhostTable {
|
|
112
112
|
/**
|
113
113
|
* Add column.
|
114
114
|
*
|
115
|
-
* @param {number} column
|
115
|
+
* @param {number} column Visual column index.
|
116
116
|
* @param {Map} samples A map with sampled table values.
|
117
117
|
*/
|
118
118
|
addColumn(column, samples) {
|
@@ -244,7 +244,7 @@ class GhostTable {
|
|
244
244
|
/**
|
245
245
|
* Create table row element.
|
246
246
|
*
|
247
|
-
* @param {number} row
|
247
|
+
* @param {number} row Visual row index.
|
248
248
|
* @returns {DocumentFragment} Returns created table row elements.
|
249
249
|
*/
|
250
250
|
createRow(row) {
|
@@ -312,7 +312,7 @@ class GhostTable {
|
|
312
312
|
/**
|
313
313
|
* Create table column elements.
|
314
314
|
*
|
315
|
-
* @param {number} column
|
315
|
+
* @param {number} column Visual column index.
|
316
316
|
* @returns {DocumentFragment} Returns created column table column elements.
|
317
317
|
*/
|
318
318
|
createCol(column) {
|
@@ -392,10 +392,10 @@ class GhostTable {
|
|
392
392
|
if (row >= 0 && column >= 0) {
|
393
393
|
colspan = this.hot.getCellMeta(row, column).colspan;
|
394
394
|
}
|
395
|
-
let width = this.hot.
|
395
|
+
let width = this.hot.getColWidth(column);
|
396
396
|
if (colspan > 1) {
|
397
397
|
for (let nextColumn = column + 1; nextColumn < column + colspan; nextColumn++) {
|
398
|
-
width += this.hot.
|
398
|
+
width += this.hot.getColWidth(nextColumn);
|
399
399
|
}
|
400
400
|
}
|
401
401
|
col.style.width = `${width}px`;
|
package/utils/ghostTable.mjs
CHANGED
@@ -62,7 +62,7 @@ class GhostTable {
|
|
62
62
|
/**
|
63
63
|
* Add row.
|
64
64
|
*
|
65
|
-
* @param {number} row
|
65
|
+
* @param {number} row Visual row index.
|
66
66
|
* @param {Map} samples Samples Map object.
|
67
67
|
*/
|
68
68
|
addRow(row, samples) {
|
@@ -109,7 +109,7 @@ class GhostTable {
|
|
109
109
|
/**
|
110
110
|
* Add column.
|
111
111
|
*
|
112
|
-
* @param {number} column
|
112
|
+
* @param {number} column Visual column index.
|
113
113
|
* @param {Map} samples A map with sampled table values.
|
114
114
|
*/
|
115
115
|
addColumn(column, samples) {
|
@@ -241,7 +241,7 @@ class GhostTable {
|
|
241
241
|
/**
|
242
242
|
* Create table row element.
|
243
243
|
*
|
244
|
-
* @param {number} row
|
244
|
+
* @param {number} row Visual row index.
|
245
245
|
* @returns {DocumentFragment} Returns created table row elements.
|
246
246
|
*/
|
247
247
|
createRow(row) {
|
@@ -309,7 +309,7 @@ class GhostTable {
|
|
309
309
|
/**
|
310
310
|
* Create table column elements.
|
311
311
|
*
|
312
|
-
* @param {number} column
|
312
|
+
* @param {number} column Visual column index.
|
313
313
|
* @returns {DocumentFragment} Returns created column table column elements.
|
314
314
|
*/
|
315
315
|
createCol(column) {
|
@@ -389,10 +389,10 @@ class GhostTable {
|
|
389
389
|
if (row >= 0 && column >= 0) {
|
390
390
|
colspan = this.hot.getCellMeta(row, column).colspan;
|
391
391
|
}
|
392
|
-
let width = this.hot.
|
392
|
+
let width = this.hot.getColWidth(column);
|
393
393
|
if (colspan > 1) {
|
394
394
|
for (let nextColumn = column + 1; nextColumn < column + colspan; nextColumn++) {
|
395
|
-
width += this.hot.
|
395
|
+
width += this.hot.getColWidth(nextColumn);
|
396
396
|
}
|
397
397
|
}
|
398
398
|
col.style.width = `${width}px`;
|