handsontable 0.0.0-next-9891faa-20240822 → 0.0.0-next-0306a1a-20240826
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/calculator/constants.js +26 -0
- package/3rdparty/walkontable/src/calculator/constants.mjs +23 -0
- package/3rdparty/walkontable/src/calculator/index.js +17 -18
- package/3rdparty/walkontable/src/calculator/index.mjs +6 -11
- package/3rdparty/walkontable/src/calculator/{calculationType/renderedAllColumns.js → renderAllColumns.js} +9 -32
- package/3rdparty/walkontable/src/calculator/{calculationType/renderedAllColumns.mjs → renderAllColumns.mjs} +8 -31
- package/3rdparty/walkontable/src/calculator/{calculationType/renderedAllRows.js → renderAllRows.js} +9 -32
- package/3rdparty/walkontable/src/calculator/{calculationType/renderedAllRows.mjs → renderAllRows.mjs} +8 -31
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +145 -51
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +145 -51
- package/3rdparty/walkontable/src/calculator/viewportRows.js +141 -59
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +141 -59
- package/3rdparty/walkontable/src/index.js +0 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/table.js +11 -5
- package/3rdparty/walkontable/src/table.mjs +11 -5
- package/3rdparty/walkontable/src/utils/column.js +1 -2
- package/3rdparty/walkontable/src/utils/column.mjs +1 -2
- package/3rdparty/walkontable/src/utils/columnStretching.js +19 -10
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +19 -10
- package/3rdparty/walkontable/src/viewport.js +46 -35
- package/3rdparty/walkontable/src/viewport.mjs +47 -36
- package/CHANGELOG.md +0 -27
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +2 -1
- package/core.js +1 -1
- package/core.mjs +2 -2
- package/dataMap/metaManager/metaSchema.js +6 -5
- package/dataMap/metaManager/metaSchema.mjs +6 -5
- package/dist/handsontable.css +20 -32
- package/dist/handsontable.full.css +20 -32
- package/dist/handsontable.full.js +2085 -2703
- package/dist/handsontable.full.min.css +5 -5
- package/dist/handsontable.full.min.js +148 -148
- package/dist/handsontable.js +2086 -2704
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +14 -14
- package/editors/autocompleteEditor/autocompleteEditor.d.ts +1 -1
- package/helpers/a11y.js +0 -2
- package/helpers/a11y.mjs +0 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/package.json +1 -1
- package/pluginHooks.js +1 -0
- package/pluginHooks.mjs +1 -0
- package/plugins/autoColumnSize/autoColumnSize.js +1 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +2 -2
- package/plugins/autoRowSize/autoRowSize.js +2 -1
- package/plugins/autoRowSize/autoRowSize.mjs +2 -1
- package/plugins/columnSorting/columnSorting.js +1 -10
- package/plugins/columnSorting/columnSorting.mjs +1 -10
- package/plugins/contextMenu/menu/menuItemRenderer.js +4 -3
- package/plugins/contextMenu/menu/menuItemRenderer.mjs +6 -5
- package/plugins/contextMenu/menu/positioner.js +12 -4
- package/plugins/contextMenu/menu/positioner.mjs +12 -4
- package/plugins/contextMenu/menu/utils.js +0 -11
- package/plugins/contextMenu/menu/utils.mjs +0 -10
- package/plugins/contextMenu/predefinedItems/alignment.js +49 -67
- package/plugins/contextMenu/predefinedItems/alignment.mjs +50 -68
- package/plugins/contextMenu/predefinedItems/readOnly.js +0 -11
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +0 -11
- package/plugins/contextMenu/utils.js +0 -26
- package/plugins/contextMenu/utils.mjs +0 -24
- package/plugins/copyPaste/copyPaste.js +14 -14
- package/plugins/copyPaste/copyPaste.mjs +14 -14
- package/plugins/dropdownMenu/dropdownMenu.js +4 -10
- package/plugins/dropdownMenu/dropdownMenu.mjs +4 -10
- package/plugins/filters/component/condition.js +1 -6
- package/plugins/filters/component/condition.mjs +1 -6
- package/plugins/filters/component/value.js +1 -6
- package/plugins/filters/component/value.mjs +1 -6
- package/plugins/filters/conditionCollection.d.ts +3 -4
- package/plugins/filters/ui/multipleSelect.js +9 -7
- package/plugins/filters/ui/multipleSelect.mjs +9 -7
- package/plugins/manualRowResize/manualRowResize.js +1 -1
- package/plugins/manualRowResize/manualRowResize.mjs +2 -2
- package/plugins/mergeCells/cellsCollection.js +9 -11
- package/plugins/mergeCells/cellsCollection.mjs +10 -12
- package/shortcuts/utils.js +1 -3
- package/shortcuts/utils.mjs +1 -3
- package/utils/ghostTable.js +9 -11
- package/utils/ghostTable.mjs +10 -12
- package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleColumns.js +0 -126
- package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleColumns.mjs +0 -122
- package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleRows.js +0 -119
- package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleRows.mjs +0 -115
- package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleColumns.js +0 -125
- package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleColumns.mjs +0 -121
- package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleRows.js +0 -118
- package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleRows.mjs +0 -114
- package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.js +0 -37
- package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.mjs +0 -33
- package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.js +0 -37
- package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.mjs +0 -33
- package/3rdparty/walkontable/src/calculator/viewportBase.js +0 -92
- package/3rdparty/walkontable/src/calculator/viewportBase.mjs +0 -88
@@ -227,7 +227,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
227
227
|
*/
|
228
228
|
setManualSize(row, height) {
|
229
229
|
const physicalRow = this.hot.toPhysicalRow(row);
|
230
|
-
const newHeight = Math.max(height, _src.
|
230
|
+
const newHeight = Math.max(height, _src.ViewportRowsCalculator.DEFAULT_HEIGHT);
|
231
231
|
_classPrivateFieldGet(_rowHeightsMap, this).setValueAtIndex(physicalRow, newHeight);
|
232
232
|
return newHeight;
|
233
233
|
}
|
@@ -11,7 +11,7 @@ import { addClass, closest, hasClass, removeClass, outerWidth, isDetached } from
|
|
11
11
|
import { arrayEach } from "../../helpers/array.mjs";
|
12
12
|
import { rangeEach } from "../../helpers/number.mjs";
|
13
13
|
import { PhysicalIndexToValueMap as IndexToValueMap } from "../../translations/index.mjs";
|
14
|
-
import {
|
14
|
+
import { ViewportRowsCalculator } from "../../3rdparty/walkontable/src/index.mjs"; // Developer note! Whenever you make a change in this file, make an analogous change in manualColumnResize.js
|
15
15
|
export const PLUGIN_KEY = 'manualRowResize';
|
16
16
|
export const PLUGIN_PRIORITY = 30;
|
17
17
|
const PERSISTENT_STATE_KEY = 'manualRowHeights';
|
@@ -222,7 +222,7 @@ export class ManualRowResize extends BasePlugin {
|
|
222
222
|
*/
|
223
223
|
setManualSize(row, height) {
|
224
224
|
const physicalRow = this.hot.toPhysicalRow(row);
|
225
|
-
const newHeight = Math.max(height,
|
225
|
+
const newHeight = Math.max(height, ViewportRowsCalculator.DEFAULT_HEIGHT);
|
226
226
|
_classPrivateFieldGet(_rowHeightsMap, this).setValueAtIndex(physicalRow, newHeight);
|
227
227
|
return newHeight;
|
228
228
|
}
|
@@ -424,20 +424,18 @@ class MergedCellsCollection {
|
|
424
424
|
break;
|
425
425
|
default:
|
426
426
|
}
|
427
|
-
|
428
|
-
|
427
|
+
(0, _array.arrayEach)(this.mergedCells, currentMerge => {
|
428
|
+
_assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
|
429
429
|
currentMerge.shift(shiftVector, index);
|
430
|
-
if (currentMerge.removed) {
|
431
|
-
removedMergedCells.push(currentMerge);
|
432
|
-
}
|
433
|
-
});
|
434
|
-
removedMergedCells.forEach(removedMerge => {
|
435
|
-
this.mergedCells.splice(this.mergedCells.indexOf(removedMerge), 1);
|
436
|
-
});
|
437
|
-
this.mergedCellsMatrix.clear();
|
438
|
-
this.mergedCells.forEach(currentMerge => {
|
439
430
|
_assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, currentMerge);
|
440
431
|
});
|
432
|
+
(0, _number.rangeEachReverse)(this.mergedCells.length - 1, 0, i => {
|
433
|
+
const currentMerge = this.mergedCells[i];
|
434
|
+
if (currentMerge && currentMerge.removed) {
|
435
|
+
this.mergedCells.splice(this.mergedCells.indexOf(currentMerge), 1);
|
436
|
+
_assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
|
437
|
+
}
|
438
|
+
});
|
441
439
|
}
|
442
440
|
|
443
441
|
/**
|
@@ -15,7 +15,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
15
15
|
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); }
|
16
16
|
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
17
17
|
import MergedCellCoords from "./cellCoords.mjs";
|
18
|
-
import { rangeEach } from "../../helpers/number.mjs";
|
18
|
+
import { rangeEach, rangeEachReverse } from "../../helpers/number.mjs";
|
19
19
|
import { warn } from "../../helpers/console.mjs";
|
20
20
|
import { arrayEach } from "../../helpers/array.mjs";
|
21
21
|
import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
|
@@ -420,20 +420,18 @@ class MergedCellsCollection {
|
|
420
420
|
break;
|
421
421
|
default:
|
422
422
|
}
|
423
|
-
|
424
|
-
|
423
|
+
arrayEach(this.mergedCells, currentMerge => {
|
424
|
+
_assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
|
425
425
|
currentMerge.shift(shiftVector, index);
|
426
|
-
if (currentMerge.removed) {
|
427
|
-
removedMergedCells.push(currentMerge);
|
428
|
-
}
|
429
|
-
});
|
430
|
-
removedMergedCells.forEach(removedMerge => {
|
431
|
-
this.mergedCells.splice(this.mergedCells.indexOf(removedMerge), 1);
|
432
|
-
});
|
433
|
-
this.mergedCellsMatrix.clear();
|
434
|
-
this.mergedCells.forEach(currentMerge => {
|
435
426
|
_assertClassBrand(_MergedCellsCollection_brand, this, _addMergedCellToMatrix).call(this, currentMerge);
|
436
427
|
});
|
428
|
+
rangeEachReverse(this.mergedCells.length - 1, 0, i => {
|
429
|
+
const currentMerge = this.mergedCells[i];
|
430
|
+
if (currentMerge && currentMerge.removed) {
|
431
|
+
this.mergedCells.splice(this.mergedCells.indexOf(currentMerge), 1);
|
432
|
+
_assertClassBrand(_MergedCellsCollection_brand, this, _removeMergedCellFromMatrix).call(this, currentMerge);
|
433
|
+
}
|
434
|
+
});
|
437
435
|
}
|
438
436
|
|
439
437
|
/**
|
package/shortcuts/utils.js
CHANGED
@@ -36,9 +36,7 @@ const getKeysList = normalizedKeys => {
|
|
36
36
|
return normalizedKeys.split('+');
|
37
37
|
};
|
38
38
|
exports.getKeysList = getKeysList;
|
39
|
-
const specialCharactersSet = new Map([[
|
40
|
-
// firefox
|
41
|
-
[109, 'subtract'], [110, 'decimal'], [111, 'divide'], [112, 'f1'], [113, 'f2'], [114, 'f3'], [115, 'f4'], [116, 'f5'], [117, 'f6'], [118, 'f7'], [119, 'f8'], [120, 'f9'], [121, 'f10'], [122, 'f11'], [123, 'f12'], [186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
|
39
|
+
const specialCharactersSet = new Map([[186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
|
42
40
|
|
43
41
|
/**
|
44
42
|
* Normalizes a keyboard event key value to a key before its modification.
|
package/shortcuts/utils.mjs
CHANGED
@@ -31,9 +31,7 @@ export const normalizeKeys = keys => {
|
|
31
31
|
export const getKeysList = normalizedKeys => {
|
32
32
|
return normalizedKeys.split('+');
|
33
33
|
};
|
34
|
-
const specialCharactersSet = new Map([[
|
35
|
-
// firefox
|
36
|
-
[109, 'subtract'], [110, 'decimal'], [111, 'divide'], [112, 'f1'], [113, 'f2'], [114, 'f3'], [115, 'f4'], [116, 'f5'], [117, 'f6'], [118, 'f7'], [119, 'f8'], [120, 'f9'], [121, 'f10'], [122, 'f11'], [123, 'f12'], [186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
|
34
|
+
const specialCharactersSet = new Map([[186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
|
37
35
|
|
38
36
|
/**
|
39
37
|
* Normalizes a keyboard event key value to a key before its modification.
|
package/utils/ghostTable.js
CHANGED
@@ -148,15 +148,8 @@ class GhostTable {
|
|
148
148
|
this.injectTable();
|
149
149
|
}
|
150
150
|
(0, _array.arrayEach)(this.rows, row => {
|
151
|
-
// In cases when the cell's content produces the height with a decimal point, the height
|
152
|
-
// needs to be rounded up to make sure that there will be a space for the cell's content.
|
153
|
-
// The `.offsetHeight` always returns the rounded number (floored), so it's not suitable for this case.
|
154
|
-
const {
|
155
|
-
height
|
156
|
-
} = row.table.getBoundingClientRect();
|
157
|
-
|
158
151
|
// -1 <- reduce border-top from table
|
159
|
-
callback(row.row,
|
152
|
+
callback(row.row, (0, _element.outerHeight)(row.table) - 1);
|
160
153
|
});
|
161
154
|
}
|
162
155
|
|
@@ -170,9 +163,14 @@ class GhostTable {
|
|
170
163
|
this.injectTable();
|
171
164
|
}
|
172
165
|
(0, _array.arrayEach)(this.columns, column => {
|
173
|
-
//
|
174
|
-
//
|
175
|
-
//
|
166
|
+
// The GhostTable class is responsible for calculating the columns' width based on the
|
167
|
+
// contents rendered in the cells. In some cases, when the column's width calculated by
|
168
|
+
// the browser is a decimal point with a fractional component. For example, 35.32px.
|
169
|
+
// The usage of the `.offsetWidth` (or our helper `outerWidth`) is incorrect.
|
170
|
+
// The `outerWidth` in the mentioned example (35.32px) would return 35 pixels that
|
171
|
+
// would cause the text to not fit in the cell, thus increasing the row height.
|
172
|
+
// That's why the `getBoundingClientRect` method is used. The method returns the number
|
173
|
+
// that is rounded up to make sure that there will be a space for the cell's content.
|
176
174
|
const {
|
177
175
|
width
|
178
176
|
} = column.table.getBoundingClientRect();
|
package/utils/ghostTable.mjs
CHANGED
@@ -3,7 +3,7 @@ import "core-js/modules/es.array.push.js";
|
|
3
3
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
4
4
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
5
5
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
6
|
-
import { addClass } from "./../helpers/dom/element.mjs";
|
6
|
+
import { addClass, outerHeight } from "./../helpers/dom/element.mjs";
|
7
7
|
import { arrayEach } from "./../helpers/array.mjs";
|
8
8
|
/**
|
9
9
|
* @class GhostTable
|
@@ -145,15 +145,8 @@ class GhostTable {
|
|
145
145
|
this.injectTable();
|
146
146
|
}
|
147
147
|
arrayEach(this.rows, row => {
|
148
|
-
// In cases when the cell's content produces the height with a decimal point, the height
|
149
|
-
// needs to be rounded up to make sure that there will be a space for the cell's content.
|
150
|
-
// The `.offsetHeight` always returns the rounded number (floored), so it's not suitable for this case.
|
151
|
-
const {
|
152
|
-
height
|
153
|
-
} = row.table.getBoundingClientRect();
|
154
|
-
|
155
148
|
// -1 <- reduce border-top from table
|
156
|
-
callback(row.row,
|
149
|
+
callback(row.row, outerHeight(row.table) - 1);
|
157
150
|
});
|
158
151
|
}
|
159
152
|
|
@@ -167,9 +160,14 @@ class GhostTable {
|
|
167
160
|
this.injectTable();
|
168
161
|
}
|
169
162
|
arrayEach(this.columns, column => {
|
170
|
-
//
|
171
|
-
//
|
172
|
-
//
|
163
|
+
// The GhostTable class is responsible for calculating the columns' width based on the
|
164
|
+
// contents rendered in the cells. In some cases, when the column's width calculated by
|
165
|
+
// the browser is a decimal point with a fractional component. For example, 35.32px.
|
166
|
+
// The usage of the `.offsetWidth` (or our helper `outerWidth`) is incorrect.
|
167
|
+
// The `outerWidth` in the mentioned example (35.32px) would return 35 pixels that
|
168
|
+
// would cause the text to not fit in the cell, thus increasing the row height.
|
169
|
+
// That's why the `getBoundingClientRect` method is used. The method returns the number
|
170
|
+
// that is rounded up to make sure that there will be a space for the cell's content.
|
173
171
|
const {
|
174
172
|
width
|
175
173
|
} = column.table.getBoundingClientRect();
|
@@ -1,126 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
|
-
require("core-js/modules/es.array.at.js");
|
6
|
-
require("core-js/modules/es.string.at-alternative.js");
|
7
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
|
-
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); }
|
10
|
-
/**
|
11
|
-
* @class FullyVisibleColumnsCalculationType
|
12
|
-
*/
|
13
|
-
class FullyVisibleColumnsCalculationType {
|
14
|
-
constructor() {
|
15
|
-
/**
|
16
|
-
* Total number of fully visible columns in the viewport.
|
17
|
-
*
|
18
|
-
* @type {number}
|
19
|
-
*/
|
20
|
-
_defineProperty(this, "count", 0);
|
21
|
-
/**
|
22
|
-
* The column index of the first fully visible column in the viewport.
|
23
|
-
*
|
24
|
-
* @type {number|null}
|
25
|
-
*/
|
26
|
-
_defineProperty(this, "startColumn", null);
|
27
|
-
/**
|
28
|
-
* The column index of the last fully visible column in the viewport.
|
29
|
-
*
|
30
|
-
* @type {number|null}
|
31
|
-
*/
|
32
|
-
_defineProperty(this, "endColumn", null);
|
33
|
-
/**
|
34
|
-
* Position of the first fully visible column (in px).
|
35
|
-
*
|
36
|
-
* @type {number|null}
|
37
|
-
*/
|
38
|
-
_defineProperty(this, "startPosition", null);
|
39
|
-
/**
|
40
|
-
* Determines if the viewport is visible in the trimming container.
|
41
|
-
*
|
42
|
-
* @type {boolean}
|
43
|
-
*/
|
44
|
-
_defineProperty(this, "isVisibleInTrimmingContainer", false);
|
45
|
-
}
|
46
|
-
/**
|
47
|
-
* Initializes the calculation.
|
48
|
-
*/
|
49
|
-
initialize() {}
|
50
|
-
|
51
|
-
/**
|
52
|
-
* Processes the column.
|
53
|
-
*
|
54
|
-
* @param {number} column The column index.
|
55
|
-
* @param {ViewportColumnsCalculator} viewportCalculator The viewport calculator object.
|
56
|
-
*/
|
57
|
-
process(column, viewportCalculator) {
|
58
|
-
const {
|
59
|
-
totalCalculatedWidth,
|
60
|
-
zeroBasedScrollOffset,
|
61
|
-
viewportWidth,
|
62
|
-
columnWidth
|
63
|
-
} = viewportCalculator;
|
64
|
-
const compensatedViewportWidth = zeroBasedScrollOffset > 0 ? viewportWidth + 1 : viewportWidth;
|
65
|
-
if (totalCalculatedWidth >= zeroBasedScrollOffset && totalCalculatedWidth + columnWidth <= zeroBasedScrollOffset + compensatedViewportWidth) {
|
66
|
-
if (this.startColumn === null || this.startColumn === undefined) {
|
67
|
-
this.startColumn = column;
|
68
|
-
}
|
69
|
-
this.endColumn = column;
|
70
|
-
}
|
71
|
-
}
|
72
|
-
|
73
|
-
/**
|
74
|
-
* Finalizes the calculation.
|
75
|
-
*
|
76
|
-
* @param {ViewportColumnsCalculator} viewportCalculator The viewport calculator object.
|
77
|
-
*/
|
78
|
-
finalize(viewportCalculator) {
|
79
|
-
var _startPositions$this$;
|
80
|
-
const {
|
81
|
-
scrollOffset,
|
82
|
-
viewportWidth,
|
83
|
-
inlineStartOffset,
|
84
|
-
zeroBasedScrollOffset,
|
85
|
-
totalColumns,
|
86
|
-
needReverse,
|
87
|
-
startPositions,
|
88
|
-
columnWidth
|
89
|
-
} = viewportCalculator;
|
90
|
-
|
91
|
-
// If the estimation has reached the last column and there is still some space available in the viewport,
|
92
|
-
// we need to render in reverse in order to fill the whole viewport with columns
|
93
|
-
if (this.endColumn === totalColumns - 1 && needReverse) {
|
94
|
-
this.startColumn = this.endColumn;
|
95
|
-
while (this.startColumn > 0) {
|
96
|
-
const calculatedViewportHeight = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];
|
97
|
-
if (calculatedViewportHeight <= viewportWidth) {
|
98
|
-
this.startColumn -= 1;
|
99
|
-
}
|
100
|
-
if (calculatedViewportHeight >= viewportWidth) {
|
101
|
-
break;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
}
|
105
|
-
this.startPosition = (_startPositions$this$ = startPositions[this.startColumn]) !== null && _startPositions$this$ !== void 0 ? _startPositions$this$ : null;
|
106
|
-
const compensatedViewportWidth = zeroBasedScrollOffset > 0 ? viewportWidth + 1 : viewportWidth;
|
107
|
-
const mostRightScrollOffset = scrollOffset + viewportWidth - compensatedViewportWidth;
|
108
|
-
const inlineStartColumnOffset = this.startColumn === null ? 0 : viewportCalculator.getColumnWidth(this.startColumn);
|
109
|
-
if (
|
110
|
-
// the table is to the left of the viewport
|
111
|
-
mostRightScrollOffset < -1 * inlineStartOffset || scrollOffset > startPositions.at(-1) ||
|
112
|
-
// the table is to the right of the viewport
|
113
|
-
-1 * scrollOffset - viewportWidth > -1 * inlineStartColumnOffset) {
|
114
|
-
this.isVisibleInTrimmingContainer = false;
|
115
|
-
} else {
|
116
|
-
this.isVisibleInTrimmingContainer = true;
|
117
|
-
}
|
118
|
-
if (totalColumns < this.endColumn) {
|
119
|
-
this.endColumn = totalColumns - 1;
|
120
|
-
}
|
121
|
-
if (this.startColumn !== null) {
|
122
|
-
this.count = this.endColumn - this.startColumn + 1;
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
exports.FullyVisibleColumnsCalculationType = FullyVisibleColumnsCalculationType;
|
@@ -1,122 +0,0 @@
|
|
1
|
-
import "core-js/modules/es.error.cause.js";
|
2
|
-
import "core-js/modules/es.array.at.js";
|
3
|
-
import "core-js/modules/es.string.at-alternative.js";
|
4
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
5
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
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
|
-
/**
|
8
|
-
* @class FullyVisibleColumnsCalculationType
|
9
|
-
*/
|
10
|
-
export class FullyVisibleColumnsCalculationType {
|
11
|
-
constructor() {
|
12
|
-
/**
|
13
|
-
* Total number of fully visible columns in the viewport.
|
14
|
-
*
|
15
|
-
* @type {number}
|
16
|
-
*/
|
17
|
-
_defineProperty(this, "count", 0);
|
18
|
-
/**
|
19
|
-
* The column index of the first fully visible column in the viewport.
|
20
|
-
*
|
21
|
-
* @type {number|null}
|
22
|
-
*/
|
23
|
-
_defineProperty(this, "startColumn", null);
|
24
|
-
/**
|
25
|
-
* The column index of the last fully visible column in the viewport.
|
26
|
-
*
|
27
|
-
* @type {number|null}
|
28
|
-
*/
|
29
|
-
_defineProperty(this, "endColumn", null);
|
30
|
-
/**
|
31
|
-
* Position of the first fully visible column (in px).
|
32
|
-
*
|
33
|
-
* @type {number|null}
|
34
|
-
*/
|
35
|
-
_defineProperty(this, "startPosition", null);
|
36
|
-
/**
|
37
|
-
* Determines if the viewport is visible in the trimming container.
|
38
|
-
*
|
39
|
-
* @type {boolean}
|
40
|
-
*/
|
41
|
-
_defineProperty(this, "isVisibleInTrimmingContainer", false);
|
42
|
-
}
|
43
|
-
/**
|
44
|
-
* Initializes the calculation.
|
45
|
-
*/
|
46
|
-
initialize() {}
|
47
|
-
|
48
|
-
/**
|
49
|
-
* Processes the column.
|
50
|
-
*
|
51
|
-
* @param {number} column The column index.
|
52
|
-
* @param {ViewportColumnsCalculator} viewportCalculator The viewport calculator object.
|
53
|
-
*/
|
54
|
-
process(column, viewportCalculator) {
|
55
|
-
const {
|
56
|
-
totalCalculatedWidth,
|
57
|
-
zeroBasedScrollOffset,
|
58
|
-
viewportWidth,
|
59
|
-
columnWidth
|
60
|
-
} = viewportCalculator;
|
61
|
-
const compensatedViewportWidth = zeroBasedScrollOffset > 0 ? viewportWidth + 1 : viewportWidth;
|
62
|
-
if (totalCalculatedWidth >= zeroBasedScrollOffset && totalCalculatedWidth + columnWidth <= zeroBasedScrollOffset + compensatedViewportWidth) {
|
63
|
-
if (this.startColumn === null || this.startColumn === undefined) {
|
64
|
-
this.startColumn = column;
|
65
|
-
}
|
66
|
-
this.endColumn = column;
|
67
|
-
}
|
68
|
-
}
|
69
|
-
|
70
|
-
/**
|
71
|
-
* Finalizes the calculation.
|
72
|
-
*
|
73
|
-
* @param {ViewportColumnsCalculator} viewportCalculator The viewport calculator object.
|
74
|
-
*/
|
75
|
-
finalize(viewportCalculator) {
|
76
|
-
var _startPositions$this$;
|
77
|
-
const {
|
78
|
-
scrollOffset,
|
79
|
-
viewportWidth,
|
80
|
-
inlineStartOffset,
|
81
|
-
zeroBasedScrollOffset,
|
82
|
-
totalColumns,
|
83
|
-
needReverse,
|
84
|
-
startPositions,
|
85
|
-
columnWidth
|
86
|
-
} = viewportCalculator;
|
87
|
-
|
88
|
-
// If the estimation has reached the last column and there is still some space available in the viewport,
|
89
|
-
// we need to render in reverse in order to fill the whole viewport with columns
|
90
|
-
if (this.endColumn === totalColumns - 1 && needReverse) {
|
91
|
-
this.startColumn = this.endColumn;
|
92
|
-
while (this.startColumn > 0) {
|
93
|
-
const calculatedViewportHeight = startPositions[this.endColumn] + columnWidth - startPositions[this.startColumn - 1];
|
94
|
-
if (calculatedViewportHeight <= viewportWidth) {
|
95
|
-
this.startColumn -= 1;
|
96
|
-
}
|
97
|
-
if (calculatedViewportHeight >= viewportWidth) {
|
98
|
-
break;
|
99
|
-
}
|
100
|
-
}
|
101
|
-
}
|
102
|
-
this.startPosition = (_startPositions$this$ = startPositions[this.startColumn]) !== null && _startPositions$this$ !== void 0 ? _startPositions$this$ : null;
|
103
|
-
const compensatedViewportWidth = zeroBasedScrollOffset > 0 ? viewportWidth + 1 : viewportWidth;
|
104
|
-
const mostRightScrollOffset = scrollOffset + viewportWidth - compensatedViewportWidth;
|
105
|
-
const inlineStartColumnOffset = this.startColumn === null ? 0 : viewportCalculator.getColumnWidth(this.startColumn);
|
106
|
-
if (
|
107
|
-
// the table is to the left of the viewport
|
108
|
-
mostRightScrollOffset < -1 * inlineStartOffset || scrollOffset > startPositions.at(-1) ||
|
109
|
-
// the table is to the right of the viewport
|
110
|
-
-1 * scrollOffset - viewportWidth > -1 * inlineStartColumnOffset) {
|
111
|
-
this.isVisibleInTrimmingContainer = false;
|
112
|
-
} else {
|
113
|
-
this.isVisibleInTrimmingContainer = true;
|
114
|
-
}
|
115
|
-
if (totalColumns < this.endColumn) {
|
116
|
-
this.endColumn = totalColumns - 1;
|
117
|
-
}
|
118
|
-
if (this.startColumn !== null) {
|
119
|
-
this.count = this.endColumn - this.startColumn + 1;
|
120
|
-
}
|
121
|
-
}
|
122
|
-
}
|
@@ -1,119 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.error.cause.js");
|
5
|
-
require("core-js/modules/es.array.at.js");
|
6
|
-
require("core-js/modules/es.string.at-alternative.js");
|
7
|
-
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
8
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
9
|
-
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); }
|
10
|
-
/**
|
11
|
-
* @class FullyVisibleRowsCalculationType
|
12
|
-
*/
|
13
|
-
class FullyVisibleRowsCalculationType {
|
14
|
-
constructor() {
|
15
|
-
/**
|
16
|
-
* Total number of fully visible rows in the viewport.
|
17
|
-
*
|
18
|
-
* @type {number}
|
19
|
-
*/
|
20
|
-
_defineProperty(this, "count", 0);
|
21
|
-
/**
|
22
|
-
* The row index of the first fully visible row in the viewport.
|
23
|
-
*
|
24
|
-
* @type {number|null}
|
25
|
-
*/
|
26
|
-
_defineProperty(this, "startRow", null);
|
27
|
-
/**
|
28
|
-
* The row index of the last fully visible row in the viewport.
|
29
|
-
*
|
30
|
-
* @type {number|null}
|
31
|
-
*/
|
32
|
-
_defineProperty(this, "endRow", null);
|
33
|
-
/**
|
34
|
-
* Position of the first fully visible row (in px).
|
35
|
-
*
|
36
|
-
* @type {number|null}
|
37
|
-
*/
|
38
|
-
_defineProperty(this, "startPosition", null);
|
39
|
-
/**
|
40
|
-
* Determines if the viewport is visible in the trimming container.
|
41
|
-
*
|
42
|
-
* @type {boolean}
|
43
|
-
*/
|
44
|
-
_defineProperty(this, "isVisibleInTrimmingContainer", false);
|
45
|
-
}
|
46
|
-
/**
|
47
|
-
* Initializes the calculation.
|
48
|
-
*/
|
49
|
-
initialize() {}
|
50
|
-
|
51
|
-
/**
|
52
|
-
* Processes the row.
|
53
|
-
*
|
54
|
-
* @param {number} row The row index.
|
55
|
-
* @param {ViewportRowsCalculator} viewportCalculator The viewport calculator object.
|
56
|
-
*/
|
57
|
-
process(row, viewportCalculator) {
|
58
|
-
const {
|
59
|
-
totalCalculatedHeight,
|
60
|
-
zeroBasedScrollOffset,
|
61
|
-
innerViewportHeight,
|
62
|
-
rowHeight
|
63
|
-
} = viewportCalculator;
|
64
|
-
if (totalCalculatedHeight >= zeroBasedScrollOffset && totalCalculatedHeight + rowHeight <= innerViewportHeight) {
|
65
|
-
if (this.startRow === null) {
|
66
|
-
this.startRow = row;
|
67
|
-
}
|
68
|
-
this.endRow = row;
|
69
|
-
}
|
70
|
-
}
|
71
|
-
|
72
|
-
/**
|
73
|
-
* Finalizes the calculation.
|
74
|
-
*
|
75
|
-
* @param {ViewportRowsCalculator} viewportCalculator The viewport calculator object.
|
76
|
-
*/
|
77
|
-
finalize(viewportCalculator) {
|
78
|
-
var _startPositions$this$;
|
79
|
-
const {
|
80
|
-
scrollOffset,
|
81
|
-
viewportHeight,
|
82
|
-
horizontalScrollbarHeight,
|
83
|
-
totalRows,
|
84
|
-
needReverse,
|
85
|
-
startPositions,
|
86
|
-
rowHeight
|
87
|
-
} = viewportCalculator;
|
88
|
-
|
89
|
-
// If the estimation has reached the last row and there is still some space available in the viewport,
|
90
|
-
// we need to render in reverse in order to fill the whole viewport with rows
|
91
|
-
if (this.endRow === totalRows - 1 && needReverse) {
|
92
|
-
this.startRow = this.endRow;
|
93
|
-
while (this.startRow > 0) {
|
94
|
-
const calculatedViewportHeight = startPositions[this.endRow] + rowHeight - startPositions[this.startRow - 1];
|
95
|
-
if (calculatedViewportHeight <= viewportHeight - horizontalScrollbarHeight) {
|
96
|
-
this.startRow -= 1;
|
97
|
-
}
|
98
|
-
if (calculatedViewportHeight >= viewportHeight - horizontalScrollbarHeight) {
|
99
|
-
break;
|
100
|
-
}
|
101
|
-
}
|
102
|
-
}
|
103
|
-
this.startPosition = (_startPositions$this$ = startPositions[this.startRow]) !== null && _startPositions$this$ !== void 0 ? _startPositions$this$ : null;
|
104
|
-
const mostBottomScrollOffset = scrollOffset + viewportHeight - horizontalScrollbarHeight;
|
105
|
-
const topRowOffset = this.startRow === null ? 0 : viewportCalculator.getRowHeight(this.startRow);
|
106
|
-
if (mostBottomScrollOffset < topRowOffset || scrollOffset > startPositions.at(-1)) {
|
107
|
-
this.isVisibleInTrimmingContainer = false;
|
108
|
-
} else {
|
109
|
-
this.isVisibleInTrimmingContainer = true;
|
110
|
-
}
|
111
|
-
if (totalRows < this.endRow) {
|
112
|
-
this.endRow = totalRows - 1;
|
113
|
-
}
|
114
|
-
if (this.startRow !== null) {
|
115
|
-
this.count = this.endRow - this.startRow + 1;
|
116
|
-
}
|
117
|
-
}
|
118
|
-
}
|
119
|
-
exports.FullyVisibleRowsCalculationType = FullyVisibleRowsCalculationType;
|