handsontable 0.0.0-next-abfe462-20231207 → 0.0.0-next-3d099da-20231208
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/index.js +6 -11
- package/3rdparty/walkontable/src/calculator/index.mjs +3 -5
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +122 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +124 -2
- package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -2
- package/3rdparty/walkontable/src/core/_base.js +12 -0
- package/3rdparty/walkontable/src/core/_base.mjs +12 -0
- package/3rdparty/walkontable/src/core/core.js +2 -0
- package/3rdparty/walkontable/src/core/core.mjs +2 -0
- package/3rdparty/walkontable/src/facade/core.js +9 -0
- package/3rdparty/walkontable/src/facade/core.mjs +9 -0
- package/3rdparty/walkontable/src/index.js +4 -3
- package/3rdparty/walkontable/src/index.mjs +2 -1
- package/3rdparty/walkontable/src/overlays.js +3 -0
- package/3rdparty/walkontable/src/overlays.mjs +4 -0
- package/3rdparty/walkontable/src/renderer/colGroup.js +0 -10
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +0 -10
- package/3rdparty/walkontable/src/renderer/rows.js +3 -4
- package/3rdparty/walkontable/src/renderer/rows.mjs +3 -4
- package/3rdparty/walkontable/src/selection/manager.js +1 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +1 -0
- package/3rdparty/walkontable/src/settings.js +0 -3
- package/3rdparty/walkontable/src/settings.mjs +0 -2
- package/3rdparty/walkontable/src/table.js +1 -0
- package/3rdparty/walkontable/src/table.mjs +1 -0
- package/3rdparty/walkontable/src/utils/column.js +12 -27
- package/3rdparty/walkontable/src/utils/column.mjs +12 -27
- package/3rdparty/walkontable/src/viewport.js +17 -22
- package/3rdparty/walkontable/src/viewport.mjs +18 -23
- package/base.js +2 -4
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +6 -44
- package/core/focusCatcher/index.mjs +6 -44
- package/core.js +11 -0
- package/core.mjs +11 -0
- package/dataMap/dataMap.js +0 -1
- package/dataMap/metaManager/metaSchema.js +2 -28
- package/dataMap/metaManager/metaSchema.mjs +2 -28
- package/dataMap/metaManager/mods/extendMetaProperties.js +0 -12
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +0 -12
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3902 -2639
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +70 -66
- package/dist/handsontable.js +3905 -2642
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +39 -35
- package/editorManager.js +4 -3
- package/editorManager.mjs +4 -3
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -0
- package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -0
- package/editors/handsontableEditor/handsontableEditor.js +1 -0
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -0
- package/editors/textEditor/textEditor.js +4 -0
- package/editors/textEditor/textEditor.mjs +4 -0
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +29 -6
- package/pluginHooks.js +123 -65
- package/pluginHooks.mjs +122 -62
- package/plugins/copyPaste/clipboardData/clipboardData.js +588 -0
- package/plugins/copyPaste/clipboardData/clipboardData.mjs +584 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.js +69 -0
- package/plugins/copyPaste/clipboardData/copyClipboardData.mjs +65 -0
- package/plugins/copyPaste/clipboardData/index.js +9 -0
- package/plugins/copyPaste/clipboardData/index.mjs +4 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.js +81 -0
- package/plugins/copyPaste/clipboardData/pasteClipboardData.mjs +77 -0
- package/plugins/copyPaste/copyPaste.js +51 -129
- package/plugins/copyPaste/copyPaste.mjs +54 -132
- package/plugins/copyPaste/copyableRanges.js +7 -43
- package/plugins/copyPaste/copyableRanges.mjs +7 -42
- package/plugins/copyPaste/pasteEvent.mjs +1 -1
- package/plugins/customBorders/customBorders.js +5 -0
- package/plugins/customBorders/customBorders.mjs +5 -0
- package/plugins/customBorders/utils.js +1 -0
- package/plugins/customBorders/utils.mjs +1 -0
- package/plugins/formulas/formulas.js +2 -0
- package/plugins/formulas/formulas.mjs +2 -0
- package/plugins/formulas/indexSyncer/axisSyncer.js +1 -0
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +1 -0
- package/plugins/manualColumnResize/manualColumnResize.js +1 -0
- package/plugins/manualColumnResize/manualColumnResize.mjs +1 -0
- package/plugins/mergeCells/mergeCells.js +127 -1
- package/plugins/mergeCells/mergeCells.mjs +127 -1
- package/plugins/nestedHeaders/nestedHeaders.js +87 -41
- package/plugins/nestedHeaders/nestedHeaders.mjs +88 -42
- package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +2 -0
- package/plugins/undoRedo/undoRedo.mjs +2 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -0
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -0
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -0
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +2 -0
- package/selection/highlight/highlight.js +1 -0
- package/selection/highlight/highlight.mjs +1 -0
- package/selection/index.js +3 -1
- package/selection/index.mjs +2 -2
- package/selection/utils.js +34 -0
- package/selection/utils.mjs +33 -0
- package/settings.d.ts +0 -1
- package/tableView.js +2 -1
- package/tableView.mjs +2 -1
- package/translations/indexMapper.js +1 -2
- package/utils/parseTable.js +538 -84
- package/utils/parseTable.mjs +534 -83
- package/validators/timeValidator/timeValidator.js +1 -0
- package/validators/timeValidator/timeValidator.mjs +1 -0
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +0 -50
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +0 -46
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +0 -50
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +0 -46
- package/3rdparty/walkontable/src/utils/columnStretching.js +0 -219
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +0 -215
- package/plugins/copyPaste/clipboardData.js +0 -18
- package/plugins/copyPaste/clipboardData.mjs +0 -14
@@ -2,12 +2,8 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
var _base = _interopRequireDefault(require("./_base"));
|
5
|
-
var _console = require("./../../../../helpers/console");
|
6
|
-
var _templateLiteralTag = require("./../../../../helpers/templateLiteralTag");
|
7
5
|
var _element = require("./../../../../helpers/dom/element");
|
8
6
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9
|
-
let performanceWarningAppeared = false;
|
10
|
-
|
11
7
|
/**
|
12
8
|
* Colgroup renderer responsible for managing (inserting, tracking, rendering) COL elements.
|
13
9
|
*
|
@@ -53,12 +49,6 @@ class ColGroupRenderer extends _base.default {
|
|
53
49
|
columnsToRender,
|
54
50
|
rowHeadersCount
|
55
51
|
} = this.table;
|
56
|
-
if (!performanceWarningAppeared && columnsToRender > 1000) {
|
57
|
-
performanceWarningAppeared = true;
|
58
|
-
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
|
59
|
-
Consider limiting the number of rendered columns by specifying the table width and/or\x20
|
60
|
-
turning off the "renderAllColumns" option.`);
|
61
|
-
}
|
62
52
|
|
63
53
|
// Render column nodes for row headers
|
64
54
|
for (let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {
|
@@ -1,9 +1,5 @@
|
|
1
1
|
import BaseRenderer from "./_base.mjs";
|
2
|
-
import { warn } from "./../../../../helpers/console.mjs";
|
3
|
-
import { toSingleLine } from "./../../../../helpers/templateLiteralTag.mjs";
|
4
2
|
import { addClass } from "./../../../../helpers/dom/element.mjs";
|
5
|
-
let performanceWarningAppeared = false;
|
6
|
-
|
7
3
|
/**
|
8
4
|
* Colgroup renderer responsible for managing (inserting, tracking, rendering) COL elements.
|
9
5
|
*
|
@@ -49,12 +45,6 @@ export default class ColGroupRenderer extends BaseRenderer {
|
|
49
45
|
columnsToRender,
|
50
46
|
rowHeadersCount
|
51
47
|
} = this.table;
|
52
|
-
if (!performanceWarningAppeared && columnsToRender > 1000) {
|
53
|
-
performanceWarningAppeared = true;
|
54
|
-
warn(toSingleLine`Performance tip: Handsontable rendered more than 1000 visible columns.\x20
|
55
|
-
Consider limiting the number of rendered columns by specifying the table width and/or\x20
|
56
|
-
turning off the "renderAllColumns" option.`);
|
57
|
-
}
|
58
48
|
|
59
49
|
// Render column nodes for row headers
|
60
50
|
for (let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {
|
@@ -2,10 +2,10 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
|
-
var _base = _interopRequireDefault(require("./_base"));
|
6
5
|
var _console = require("./../../../../helpers/console");
|
7
6
|
var _templateLiteralTag = require("./../../../../helpers/templateLiteralTag");
|
8
7
|
var _orderView = require("./../utils/orderView");
|
8
|
+
var _base = _interopRequireDefault(require("./_base"));
|
9
9
|
var _element = require("../../../../helpers/dom/element");
|
10
10
|
var _a11y = require("../../../../helpers/a11y");
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
@@ -57,9 +57,8 @@ class RowsRenderer extends _base.default {
|
|
57
57
|
} = this.table;
|
58
58
|
if (!performanceWarningAppeared && rowsToRender > 1000) {
|
59
59
|
performanceWarningAppeared = true;
|
60
|
-
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`Performance tip: Handsontable rendered more than 1000 visible rows
|
61
|
-
|
62
|
-
turning off the "renderAllRows" option.`);
|
60
|
+
(0, _console.warn)((0, _templateLiteralTag.toSingleLine)`Performance tip: Handsontable rendered more than 1000 visible rows. Consider limiting\x20
|
61
|
+
the number of rendered rows by specifying the table height and/or turning off the "renderAllRows" option.`);
|
63
62
|
}
|
64
63
|
if (this.table.isAriaEnabled()) {
|
65
64
|
(0, _element.setAttribute)(this.rootNode, [(0, _a11y.A11Y_ROWGROUP)()]);
|
@@ -2,10 +2,10 @@ import "core-js/modules/es.error.cause.js";
|
|
2
2
|
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
3
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
4
4
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
5
|
-
import BaseRenderer from "./_base.mjs";
|
6
5
|
import { warn } from "./../../../../helpers/console.mjs";
|
7
6
|
import { toSingleLine } from "./../../../../helpers/templateLiteralTag.mjs";
|
8
7
|
import { OrderView } from "./../utils/orderView/index.mjs";
|
8
|
+
import BaseRenderer from "./_base.mjs";
|
9
9
|
import { setAttribute } from "../../../../helpers/dom/element.mjs";
|
10
10
|
import { A11Y_ROW, A11Y_ROWGROUP, A11Y_ROWINDEX } from "../../../../helpers/a11y.mjs";
|
11
11
|
let performanceWarningAppeared = false;
|
@@ -53,9 +53,8 @@ export default class RowsRenderer extends BaseRenderer {
|
|
53
53
|
} = this.table;
|
54
54
|
if (!performanceWarningAppeared && rowsToRender > 1000) {
|
55
55
|
performanceWarningAppeared = true;
|
56
|
-
warn(toSingleLine`Performance tip: Handsontable rendered more than 1000 visible rows
|
57
|
-
|
58
|
-
turning off the "renderAllRows" option.`);
|
56
|
+
warn(toSingleLine`Performance tip: Handsontable rendered more than 1000 visible rows. Consider limiting\x20
|
57
|
+
the number of rendered rows by specifying the table height and/or turning off the "renderAllRows" option.`);
|
59
58
|
}
|
60
59
|
if (this.table.isAriaEnabled()) {
|
61
60
|
setAttribute(this.rootNode, [A11Y_ROWGROUP()]);
|
@@ -208,6 +208,7 @@ class SelectionManager {
|
|
208
208
|
borderInstance === null || borderInstance === void 0 || borderInstance.disappear();
|
209
209
|
continue; // eslint-disable-line no-continue
|
210
210
|
}
|
211
|
+
|
211
212
|
if (className) {
|
212
213
|
const elements = _classPrivateFieldGet(this, _scanner).setActiveSelection(selection).scan();
|
213
214
|
elements.forEach(element => {
|
@@ -204,6 +204,7 @@ export class SelectionManager {
|
|
204
204
|
borderInstance === null || borderInstance === void 0 || borderInstance.disappear();
|
205
205
|
continue; // eslint-disable-line no-continue
|
206
206
|
}
|
207
|
+
|
207
208
|
if (className) {
|
208
209
|
const elements = _classPrivateFieldGet(this, _scanner).setActiveSelection(selection).scan();
|
209
210
|
elements.forEach(element => {
|
@@ -36,7 +36,6 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
36
36
|
* @property {Option} onBeforeStretchingColumnWidth Option `onBeforeStretchingColumnWidth`.
|
37
37
|
* @property {Option} preventOverflow Option `preventOverflow`.
|
38
38
|
* @property {Option} preventWheel Option `preventWheel`.
|
39
|
-
* @property {Option} renderAllColumns Option `renderAllColumns`.
|
40
39
|
* @property {Option} renderAllRows Option `renderAllRows`.
|
41
40
|
* @property {Option} rowHeaders Option `rowHeaders`.
|
42
41
|
* @property {Option} rowHeight Option `,`.
|
@@ -81,7 +80,6 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
|
|
81
80
|
* @template TValue.
|
82
81
|
* @typedef { TValue | Array.<TValue> | (function(...*): TValue) } Option
|
83
82
|
*/
|
84
|
-
|
85
83
|
/**
|
86
84
|
* @class Settings
|
87
85
|
*/
|
@@ -220,7 +218,6 @@ class Settings {
|
|
220
218
|
onBeforeHighlightingColumnHeader: sourceCol => sourceCol,
|
221
219
|
onWindowResize: null,
|
222
220
|
onContainerElementResize: null,
|
223
|
-
renderAllColumns: false,
|
224
221
|
renderAllRows: false,
|
225
222
|
groups: false,
|
226
223
|
rowHeaderWidth: null,
|
@@ -33,7 +33,6 @@ import { objectEach } from "../../../helpers/object.mjs";
|
|
33
33
|
* @property {Option} onBeforeStretchingColumnWidth Option `onBeforeStretchingColumnWidth`.
|
34
34
|
* @property {Option} preventOverflow Option `preventOverflow`.
|
35
35
|
* @property {Option} preventWheel Option `preventWheel`.
|
36
|
-
* @property {Option} renderAllColumns Option `renderAllColumns`.
|
37
36
|
* @property {Option} renderAllRows Option `renderAllRows`.
|
38
37
|
* @property {Option} rowHeaders Option `rowHeaders`.
|
39
38
|
* @property {Option} rowHeight Option `,`.
|
@@ -215,7 +214,6 @@ export default class Settings {
|
|
215
214
|
onBeforeHighlightingColumnHeader: sourceCol => sourceCol,
|
216
215
|
onWindowResize: null,
|
217
216
|
onContainerElementResize: null,
|
218
|
-
renderAllColumns: false,
|
219
217
|
renderAllRows: false,
|
220
218
|
groups: false,
|
221
219
|
rowHeaderWidth: null,
|
@@ -96,6 +96,7 @@ class Table {
|
|
96
96
|
if (this.isMaster) {
|
97
97
|
this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
|
98
98
|
}
|
99
|
+
|
99
100
|
this.fixTableDomTree();
|
100
101
|
this.rowFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
|
101
102
|
this.columnFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
|
@@ -92,6 +92,7 @@ class Table {
|
|
92
92
|
if (this.isMaster) {
|
93
93
|
this.alignOverlaysWithTrimmingContainer(); // todo wow, It calls method from child class (MasterTable).
|
94
94
|
}
|
95
|
+
|
95
96
|
this.fixTableDomTree();
|
96
97
|
this.rowFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
|
97
98
|
this.columnFilter = null; // TODO refactoring, eliminate all (re)creations of this object, then updates state when needed.
|
@@ -3,7 +3,6 @@
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
5
|
var _element = require("./../../../../helpers/dom/element");
|
6
|
-
var _columnStretching = require("./columnStretching");
|
7
6
|
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; }
|
8
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
9
8
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
@@ -30,18 +29,8 @@ class ColumnUtils {
|
|
30
29
|
* @type {Map<number, number>}
|
31
30
|
*/
|
32
31
|
_defineProperty(this, "headerWidths", new Map());
|
33
|
-
/**
|
34
|
-
* @type {ColumnStretching}
|
35
|
-
*/
|
36
|
-
_defineProperty(this, "stretching", void 0);
|
37
32
|
this.dataAccessObject = dataAccessObject;
|
38
33
|
this.wtSettings = wtSettings;
|
39
|
-
this.stretching = new _columnStretching.ColumnStretching({
|
40
|
-
totalColumns: () => this.wtSettings.getSetting('totalColumns'),
|
41
|
-
stretchMode: () => this.wtSettings.getSetting('stretchH'),
|
42
|
-
stretchingColumnWidthFn: (stretchedWidth, column) => this.wtSettings.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column),
|
43
|
-
columnWidthFn: sourceCol => this.dataAccessObject.wtTable.getColumnWidth(sourceCol)
|
44
|
-
});
|
45
34
|
}
|
46
35
|
|
47
36
|
/**
|
@@ -61,10 +50,13 @@ class ColumnUtils {
|
|
61
50
|
* @returns {number}
|
62
51
|
*/
|
63
52
|
getStretchedColumnWidth(sourceIndex) {
|
53
|
+
const calculator = this.dataAccessObject.wtViewport.columnsRenderCalculator;
|
64
54
|
let width = this.getWidth(sourceIndex);
|
65
|
-
|
66
|
-
|
67
|
-
|
55
|
+
if (calculator) {
|
56
|
+
const stretchedWidth = calculator.getStretchedColumnWidth(sourceIndex, width);
|
57
|
+
if (stretchedWidth) {
|
58
|
+
width = stretchedWidth;
|
59
|
+
}
|
68
60
|
}
|
69
61
|
return width;
|
70
62
|
}
|
@@ -95,9 +87,12 @@ class ColumnUtils {
|
|
95
87
|
}
|
96
88
|
|
97
89
|
/**
|
98
|
-
*
|
90
|
+
* Calculates column header widths that can be retrieved from the cache.
|
99
91
|
*/
|
100
|
-
|
92
|
+
calculateWidths() {
|
93
|
+
const {
|
94
|
+
wtSettings
|
95
|
+
} = this;
|
101
96
|
const {
|
102
97
|
wtTable,
|
103
98
|
wtViewport,
|
@@ -105,18 +100,8 @@ class ColumnUtils {
|
|
105
100
|
} = this.dataAccessObject;
|
106
101
|
const mainHolder = cloneSource ? cloneSource.wtTable.holder : wtTable.holder;
|
107
102
|
const scrollbarCompensation = mainHolder.offsetHeight < mainHolder.scrollHeight ? (0, _element.getScrollbarWidth)() : 0;
|
108
|
-
this.stretching.refreshStretching(wtViewport.getViewportWidth() - scrollbarCompensation);
|
109
|
-
}
|
110
|
-
|
111
|
-
/**
|
112
|
-
* Calculates column header widths that can be retrieved from the cache.
|
113
|
-
*/
|
114
|
-
calculateWidths() {
|
115
|
-
const {
|
116
|
-
wtSettings
|
117
|
-
} = this;
|
118
103
|
let rowHeaderWidthSetting = wtSettings.getSetting('rowHeaderWidth');
|
119
|
-
|
104
|
+
wtViewport.columnsRenderCalculator.refreshStretching(wtViewport.getViewportWidth() - scrollbarCompensation);
|
120
105
|
rowHeaderWidthSetting = wtSettings.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
|
121
106
|
if (rowHeaderWidthSetting !== null && rowHeaderWidthSetting !== undefined) {
|
122
107
|
const rowHeadersCount = wtSettings.getSetting('rowHeaders').length;
|
@@ -3,7 +3,6 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
3
3
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
4
4
|
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
5
5
|
import { getScrollbarWidth } from "./../../../../helpers/dom/element.mjs";
|
6
|
-
import { ColumnStretching } from "./columnStretching.mjs";
|
7
6
|
/**
|
8
7
|
* Column utils class contains all necessary information about sizes of the columns.
|
9
8
|
*
|
@@ -27,18 +26,8 @@ export default class ColumnUtils {
|
|
27
26
|
* @type {Map<number, number>}
|
28
27
|
*/
|
29
28
|
_defineProperty(this, "headerWidths", new Map());
|
30
|
-
/**
|
31
|
-
* @type {ColumnStretching}
|
32
|
-
*/
|
33
|
-
_defineProperty(this, "stretching", void 0);
|
34
29
|
this.dataAccessObject = dataAccessObject;
|
35
30
|
this.wtSettings = wtSettings;
|
36
|
-
this.stretching = new ColumnStretching({
|
37
|
-
totalColumns: () => this.wtSettings.getSetting('totalColumns'),
|
38
|
-
stretchMode: () => this.wtSettings.getSetting('stretchH'),
|
39
|
-
stretchingColumnWidthFn: (stretchedWidth, column) => this.wtSettings.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column),
|
40
|
-
columnWidthFn: sourceCol => this.dataAccessObject.wtTable.getColumnWidth(sourceCol)
|
41
|
-
});
|
42
31
|
}
|
43
32
|
|
44
33
|
/**
|
@@ -58,10 +47,13 @@ export default class ColumnUtils {
|
|
58
47
|
* @returns {number}
|
59
48
|
*/
|
60
49
|
getStretchedColumnWidth(sourceIndex) {
|
50
|
+
const calculator = this.dataAccessObject.wtViewport.columnsRenderCalculator;
|
61
51
|
let width = this.getWidth(sourceIndex);
|
62
|
-
|
63
|
-
|
64
|
-
|
52
|
+
if (calculator) {
|
53
|
+
const stretchedWidth = calculator.getStretchedColumnWidth(sourceIndex, width);
|
54
|
+
if (stretchedWidth) {
|
55
|
+
width = stretchedWidth;
|
56
|
+
}
|
65
57
|
}
|
66
58
|
return width;
|
67
59
|
}
|
@@ -92,9 +84,12 @@ export default class ColumnUtils {
|
|
92
84
|
}
|
93
85
|
|
94
86
|
/**
|
95
|
-
*
|
87
|
+
* Calculates column header widths that can be retrieved from the cache.
|
96
88
|
*/
|
97
|
-
|
89
|
+
calculateWidths() {
|
90
|
+
const {
|
91
|
+
wtSettings
|
92
|
+
} = this;
|
98
93
|
const {
|
99
94
|
wtTable,
|
100
95
|
wtViewport,
|
@@ -102,18 +97,8 @@ export default class ColumnUtils {
|
|
102
97
|
} = this.dataAccessObject;
|
103
98
|
const mainHolder = cloneSource ? cloneSource.wtTable.holder : wtTable.holder;
|
104
99
|
const scrollbarCompensation = mainHolder.offsetHeight < mainHolder.scrollHeight ? getScrollbarWidth() : 0;
|
105
|
-
this.stretching.refreshStretching(wtViewport.getViewportWidth() - scrollbarCompensation);
|
106
|
-
}
|
107
|
-
|
108
|
-
/**
|
109
|
-
* Calculates column header widths that can be retrieved from the cache.
|
110
|
-
*/
|
111
|
-
calculateWidths() {
|
112
|
-
const {
|
113
|
-
wtSettings
|
114
|
-
} = this;
|
115
100
|
let rowHeaderWidthSetting = wtSettings.getSetting('rowHeaderWidth');
|
116
|
-
|
101
|
+
wtViewport.columnsRenderCalculator.refreshStretching(wtViewport.getViewportWidth() - scrollbarCompensation);
|
117
102
|
rowHeaderWidthSetting = wtSettings.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
|
118
103
|
if (rowHeaderWidthSetting !== null && rowHeaderWidthSetting !== undefined) {
|
119
104
|
const rowHeadersCount = wtSettings.getSetting('rowHeaders').length;
|
@@ -255,15 +255,15 @@ class Viewport {
|
|
255
255
|
wtSettings,
|
256
256
|
wtTable
|
257
257
|
} = this;
|
258
|
-
|
259
|
-
return new _calculator.RenderAllRowsCalculator({
|
260
|
-
totalRows: wtSettings.getSetting('totalRows')
|
261
|
-
});
|
262
|
-
}
|
263
|
-
let height = this.getViewportHeight();
|
258
|
+
let height;
|
264
259
|
let scrollbarHeight;
|
265
260
|
let fixedRowsHeight;
|
266
261
|
this.rowHeaderWidth = NaN;
|
262
|
+
if (wtSettings.getSetting('renderAllRows') && calculationType === _calculator.RENDER_TYPE) {
|
263
|
+
height = Infinity;
|
264
|
+
} else {
|
265
|
+
height = this.getViewportHeight();
|
266
|
+
}
|
267
267
|
let pos = this.dataAccessObject.topScrollPosition - this.dataAccessObject.topParentOffset;
|
268
268
|
const fixedRowsTop = wtSettings.getSetting('fixedRowsTop');
|
269
269
|
const fixedRowsBottom = wtSettings.getSetting('fixedRowsBottom');
|
@@ -308,11 +308,6 @@ class Viewport {
|
|
308
308
|
wtSettings,
|
309
309
|
wtTable
|
310
310
|
} = this;
|
311
|
-
if (wtSettings.getSetting('renderAllColumns') && calculationType === _calculator.RENDER_TYPE) {
|
312
|
-
return new _calculator.RenderAllColumnsCalculator({
|
313
|
-
totalColumns: wtSettings.getSetting('totalColumns')
|
314
|
-
});
|
315
|
-
}
|
316
311
|
let width = this.getViewportWidth();
|
317
312
|
let pos = Math.abs(this.dataAccessObject.inlineStartScrollPosition) - this.dataAccessObject.inlineStartParentOffset;
|
318
313
|
this.columnHeaderHeight = NaN;
|
@@ -332,6 +327,10 @@ class Viewport {
|
|
332
327
|
columnWidthFn: sourceCol => wtTable.getColumnWidth(sourceCol),
|
333
328
|
overrideFn: wtSettings.getSettingPure('viewportColumnCalculatorOverride'),
|
334
329
|
calculationType,
|
330
|
+
stretchMode: wtSettings.getSetting('stretchH'),
|
331
|
+
stretchingColumnWidthFn: (stretchedWidth, column) => {
|
332
|
+
return wtSettings.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);
|
333
|
+
},
|
335
334
|
inlineStartOffset: this.dataAccessObject.inlineStartParentOffset
|
336
335
|
});
|
337
336
|
}
|
@@ -346,26 +345,22 @@ class Viewport {
|
|
346
345
|
*/
|
347
346
|
createRenderCalculators() {
|
348
347
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
349
|
-
|
350
|
-
|
351
|
-
} = this;
|
352
|
-
if (fastDraw && !wtSettings.getSetting('renderAllRows')) {
|
348
|
+
let runFastDraw = fastDraw;
|
349
|
+
if (runFastDraw) {
|
353
350
|
const proposedRowsVisibleCalculator = this.createRowsCalculator(_calculator.FULLY_VISIBLE_TYPE);
|
354
|
-
fastDraw = this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator);
|
355
|
-
}
|
356
|
-
if (fastDraw && !wtSettings.getSetting('renderAllColumns')) {
|
357
351
|
const proposedColumnsVisibleCalculator = this.createColumnsCalculator(_calculator.FULLY_VISIBLE_TYPE);
|
358
|
-
|
352
|
+
if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {
|
353
|
+
runFastDraw = false;
|
354
|
+
}
|
359
355
|
}
|
360
|
-
if (!
|
356
|
+
if (!runFastDraw) {
|
361
357
|
this.rowsRenderCalculator = this.createRowsCalculator(_calculator.RENDER_TYPE);
|
362
358
|
this.columnsRenderCalculator = this.createColumnsCalculator(_calculator.RENDER_TYPE);
|
363
359
|
}
|
364
|
-
|
365
360
|
// delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator
|
366
361
|
this.rowsVisibleCalculator = null;
|
367
362
|
this.columnsVisibleCalculator = null;
|
368
|
-
return
|
363
|
+
return runFastDraw;
|
369
364
|
}
|
370
365
|
|
371
366
|
/**
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { getScrollbarWidth, getStyle, offset, outerHeight, outerWidth } from "../../../helpers/dom/element.mjs";
|
2
2
|
import { objectEach } from "../../../helpers/object.mjs";
|
3
|
-
import { RENDER_TYPE, FULLY_VISIBLE_TYPE,
|
3
|
+
import { RENDER_TYPE, FULLY_VISIBLE_TYPE, ViewportColumnsCalculator, ViewportRowsCalculator } from "./calculator/index.mjs";
|
4
4
|
/**
|
5
5
|
* @class Viewport
|
6
6
|
*/
|
@@ -252,15 +252,15 @@ class Viewport {
|
|
252
252
|
wtSettings,
|
253
253
|
wtTable
|
254
254
|
} = this;
|
255
|
-
|
256
|
-
return new RenderAllRowsCalculator({
|
257
|
-
totalRows: wtSettings.getSetting('totalRows')
|
258
|
-
});
|
259
|
-
}
|
260
|
-
let height = this.getViewportHeight();
|
255
|
+
let height;
|
261
256
|
let scrollbarHeight;
|
262
257
|
let fixedRowsHeight;
|
263
258
|
this.rowHeaderWidth = NaN;
|
259
|
+
if (wtSettings.getSetting('renderAllRows') && calculationType === RENDER_TYPE) {
|
260
|
+
height = Infinity;
|
261
|
+
} else {
|
262
|
+
height = this.getViewportHeight();
|
263
|
+
}
|
264
264
|
let pos = this.dataAccessObject.topScrollPosition - this.dataAccessObject.topParentOffset;
|
265
265
|
const fixedRowsTop = wtSettings.getSetting('fixedRowsTop');
|
266
266
|
const fixedRowsBottom = wtSettings.getSetting('fixedRowsBottom');
|
@@ -305,11 +305,6 @@ class Viewport {
|
|
305
305
|
wtSettings,
|
306
306
|
wtTable
|
307
307
|
} = this;
|
308
|
-
if (wtSettings.getSetting('renderAllColumns') && calculationType === RENDER_TYPE) {
|
309
|
-
return new RenderAllColumnsCalculator({
|
310
|
-
totalColumns: wtSettings.getSetting('totalColumns')
|
311
|
-
});
|
312
|
-
}
|
313
308
|
let width = this.getViewportWidth();
|
314
309
|
let pos = Math.abs(this.dataAccessObject.inlineStartScrollPosition) - this.dataAccessObject.inlineStartParentOffset;
|
315
310
|
this.columnHeaderHeight = NaN;
|
@@ -329,6 +324,10 @@ class Viewport {
|
|
329
324
|
columnWidthFn: sourceCol => wtTable.getColumnWidth(sourceCol),
|
330
325
|
overrideFn: wtSettings.getSettingPure('viewportColumnCalculatorOverride'),
|
331
326
|
calculationType,
|
327
|
+
stretchMode: wtSettings.getSetting('stretchH'),
|
328
|
+
stretchingColumnWidthFn: (stretchedWidth, column) => {
|
329
|
+
return wtSettings.getSetting('onBeforeStretchingColumnWidth', stretchedWidth, column);
|
330
|
+
},
|
332
331
|
inlineStartOffset: this.dataAccessObject.inlineStartParentOffset
|
333
332
|
});
|
334
333
|
}
|
@@ -343,26 +342,22 @@ class Viewport {
|
|
343
342
|
*/
|
344
343
|
createRenderCalculators() {
|
345
344
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
346
|
-
|
347
|
-
|
348
|
-
} = this;
|
349
|
-
if (fastDraw && !wtSettings.getSetting('renderAllRows')) {
|
345
|
+
let runFastDraw = fastDraw;
|
346
|
+
if (runFastDraw) {
|
350
347
|
const proposedRowsVisibleCalculator = this.createRowsCalculator(FULLY_VISIBLE_TYPE);
|
351
|
-
fastDraw = this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator);
|
352
|
-
}
|
353
|
-
if (fastDraw && !wtSettings.getSetting('renderAllColumns')) {
|
354
348
|
const proposedColumnsVisibleCalculator = this.createColumnsCalculator(FULLY_VISIBLE_TYPE);
|
355
|
-
|
349
|
+
if (!(this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator) && this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator))) {
|
350
|
+
runFastDraw = false;
|
351
|
+
}
|
356
352
|
}
|
357
|
-
if (!
|
353
|
+
if (!runFastDraw) {
|
358
354
|
this.rowsRenderCalculator = this.createRowsCalculator(RENDER_TYPE);
|
359
355
|
this.columnsRenderCalculator = this.createColumnsCalculator(RENDER_TYPE);
|
360
356
|
}
|
361
|
-
|
362
357
|
// delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator
|
363
358
|
this.rowsVisibleCalculator = null;
|
364
359
|
this.columnsVisibleCalculator = null;
|
365
|
-
return
|
360
|
+
return runFastDraw;
|
366
361
|
}
|
367
362
|
|
368
363
|
/**
|
package/base.js
CHANGED
@@ -15,9 +15,7 @@ exports.CellRange = _src.CellRange;
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
16
16
|
// FIXME: Bug in eslint-plugin-import: https://github.com/benmosher/eslint-plugin-import/issues/1883
|
17
17
|
/* eslint-disable import/named */
|
18
|
-
|
19
18
|
/* eslint-enable import/named */
|
20
|
-
|
21
19
|
// register default mandatory cell type for the Base package
|
22
20
|
(0, _registry2.registerCellType)(_textType.TextCellType);
|
23
21
|
|
@@ -45,8 +43,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
45
43
|
Handsontable.CellCoords = _src.CellCoords;
|
46
44
|
Handsontable.CellRange = _src.CellRange;
|
47
45
|
Handsontable.packageName = 'handsontable';
|
48
|
-
Handsontable.buildDate = "
|
49
|
-
Handsontable.version = "0.0.0-next-
|
46
|
+
Handsontable.buildDate = "08/12/2023 08:37:33";
|
47
|
+
Handsontable.version = "0.0.0-next-3d099da-20231208";
|
50
48
|
Handsontable.languages = {
|
51
49
|
dictionaryKeys: _registry.dictionaryKeys,
|
52
50
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
package/base.mjs
CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
|
|
35
35
|
Handsontable.CellCoords = CellCoords;
|
36
36
|
Handsontable.CellRange = CellRange;
|
37
37
|
Handsontable.packageName = 'handsontable';
|
38
|
-
Handsontable.buildDate = "
|
39
|
-
Handsontable.version = "0.0.0-next-
|
38
|
+
Handsontable.buildDate = "08/12/2023 08:37:39";
|
39
|
+
Handsontable.version = "0.0.0-next-3d099da-20231208";
|
40
40
|
Handsontable.languages = {
|
41
41
|
dictionaryKeys,
|
42
42
|
getLanguageDictionary,
|
@@ -12,15 +12,14 @@ var _focusDetector = require("./focusDetector");
|
|
12
12
|
* @param {Core} hot The Handsontable instance.
|
13
13
|
*/
|
14
14
|
function installFocusCatcher(hot) {
|
15
|
-
const clampCoordsIfNeeded = normalizeCoordsIfNeeded(hot);
|
16
15
|
let recentlyAddedFocusCoords;
|
17
16
|
const {
|
18
17
|
activate,
|
19
18
|
deactivate
|
20
19
|
} = (0, _focusDetector.installFocusDetector)(hot, {
|
21
20
|
onFocusFromTop() {
|
22
|
-
var
|
23
|
-
const mostTopStartCoords = (
|
21
|
+
var _recentlyAddedFocusCo;
|
22
|
+
const mostTopStartCoords = (_recentlyAddedFocusCo = recentlyAddedFocusCoords) !== null && _recentlyAddedFocusCo !== void 0 ? _recentlyAddedFocusCo : getMostTopStartPosition(hot);
|
24
23
|
if (mostTopStartCoords) {
|
25
24
|
hot.runHooks('modifyFocusOnTabNavigation', 'from_above', mostTopStartCoords);
|
26
25
|
hot.selectCell(mostTopStartCoords.row, mostTopStartCoords.col);
|
@@ -28,8 +27,8 @@ function installFocusCatcher(hot) {
|
|
28
27
|
hot.listen();
|
29
28
|
},
|
30
29
|
onFocusFromBottom() {
|
31
|
-
var
|
32
|
-
const mostBottomEndCoords = (
|
30
|
+
var _recentlyAddedFocusCo2;
|
31
|
+
const mostBottomEndCoords = (_recentlyAddedFocusCo2 = recentlyAddedFocusCoords) !== null && _recentlyAddedFocusCo2 !== void 0 ? _recentlyAddedFocusCo2 : getMostBottomEndPosition(hot);
|
33
32
|
if (mostBottomEndCoords) {
|
34
33
|
hot.runHooks('modifyFocusOnTabNavigation', 'from_below', mostBottomEndCoords);
|
35
34
|
hot.selectCell(mostBottomEndCoords.row, mostBottomEndCoords.col);
|
@@ -43,12 +42,10 @@ function installFocusCatcher(hot) {
|
|
43
42
|
};
|
44
43
|
let isSavingCoordsEnabled = true;
|
45
44
|
let isTabOrShiftTabPressed = false;
|
46
|
-
let preventViewportScroll = false;
|
47
45
|
hot.addHook('afterListen', () => deactivate());
|
48
46
|
hot.addHook('afterUnlisten', () => activate());
|
49
47
|
hot.addHook('afterSelection', (row, column, row2, column2, preventScrolling) => {
|
50
|
-
if (isTabOrShiftTabPressed &&
|
51
|
-
preventViewportScroll = false;
|
48
|
+
if (isTabOrShiftTabPressed && rowWrapState.wrapped && rowWrapState.flipped) {
|
52
49
|
preventScrolling.value = true;
|
53
50
|
}
|
54
51
|
if (isSavingCoordsEnabled) {
|
@@ -80,16 +77,10 @@ function installFocusCatcher(hot) {
|
|
80
77
|
hot.getShortcutManager().getContext('grid').addShortcuts([{
|
81
78
|
...shortcutOptions,
|
82
79
|
callback: () => {
|
83
|
-
const {
|
84
|
-
tabNavigation
|
85
|
-
} = hot.getSettings();
|
86
80
|
isTabOrShiftTabPressed = true;
|
87
|
-
if (hot.getSelectedRangeLast() && !tabNavigation) {
|
81
|
+
if (hot.getSelectedRangeLast() && !hot.getSettings().tabNavigation) {
|
88
82
|
isSavingCoordsEnabled = false;
|
89
83
|
}
|
90
|
-
if (!tabNavigation) {
|
91
|
-
preventViewportScroll = true;
|
92
|
-
}
|
93
84
|
},
|
94
85
|
position: 'before'
|
95
86
|
}, {
|
@@ -174,33 +165,4 @@ function getMostBottomEndPosition(hot) {
|
|
174
165
|
endColumn = -1;
|
175
166
|
}
|
176
167
|
return hot._createCellCoords((_rowIndexMapper$getVi = rowIndexMapper.getVisualFromRenderableIndex(bottomRow)) !== null && _rowIndexMapper$getVi !== void 0 ? _rowIndexMapper$getVi : bottomRow, (_columnIndexMapper$ge = columnIndexMapper.getVisualFromRenderableIndex(endColumn)) !== null && _columnIndexMapper$ge !== void 0 ? _columnIndexMapper$ge : endColumn);
|
177
|
-
}
|
178
|
-
|
179
|
-
/**
|
180
|
-
* Normalizes the coordinates (clamps to nearest visible cell position within dataset range).
|
181
|
-
*
|
182
|
-
* @param {Core} hot The Handsontable instance.
|
183
|
-
* @returns {function(Coords | undefined): Coords | null}
|
184
|
-
*/
|
185
|
-
function normalizeCoordsIfNeeded(hot) {
|
186
|
-
return coords => {
|
187
|
-
if (!coords) {
|
188
|
-
return null;
|
189
|
-
}
|
190
|
-
const mostTopStartCoords = getMostTopStartPosition(hot);
|
191
|
-
const mostBottomEndCoords = getMostBottomEndPosition(hot);
|
192
|
-
if (coords.col < mostTopStartCoords.col) {
|
193
|
-
coords.col = mostTopStartCoords.col;
|
194
|
-
}
|
195
|
-
if (coords.col > mostBottomEndCoords.col) {
|
196
|
-
coords.col = mostBottomEndCoords.col;
|
197
|
-
}
|
198
|
-
if (coords.row < mostTopStartCoords.row) {
|
199
|
-
coords.row = mostTopStartCoords.row;
|
200
|
-
}
|
201
|
-
if (coords.row > mostBottomEndCoords.row) {
|
202
|
-
coords.row = mostBottomEndCoords.row;
|
203
|
-
}
|
204
|
-
return coords;
|
205
|
-
};
|
206
168
|
}
|