handsontable 14.3.0 → 14.4.0-next-0a79a1f-20240521
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -3
- package/3rdparty/walkontable/src/core/_base.js +1 -1
- package/3rdparty/walkontable/src/core/_base.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/_base.js +24 -20
- package/3rdparty/walkontable/src/overlay/_base.mjs +24 -20
- package/3rdparty/walkontable/src/overlay/bottom.js +3 -6
- package/3rdparty/walkontable/src/overlay/bottom.mjs +3 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.js +22 -19
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +22 -19
- package/3rdparty/walkontable/src/overlay/top.js +13 -12
- package/3rdparty/walkontable/src/overlay/top.mjs +13 -12
- package/3rdparty/walkontable/src/overlays.js +46 -24
- package/3rdparty/walkontable/src/overlays.mjs +46 -24
- package/3rdparty/walkontable/src/selection/manager.js +7 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +7 -0
- package/3rdparty/walkontable/src/selection/scanner.js +7 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +7 -0
- package/3rdparty/walkontable/src/table.js +10 -11
- package/3rdparty/walkontable/src/table.mjs +10 -11
- package/3rdparty/walkontable/src/utils/columnStretching.js +4 -0
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +4 -0
- package/3rdparty/walkontable/src/viewport.js +18 -10
- package/3rdparty/walkontable/src/viewport.mjs +18 -10
- package/CHANGELOG.md +37 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +2 -2
- package/core.js +93 -162
- package/core.mjs +93 -162
- package/dataMap/dataMap.js +10 -4
- package/dataMap/dataMap.mjs +10 -4
- package/dataMap/dataSource.js +16 -3
- package/dataMap/dataSource.mjs +16 -3
- package/dataMap/metaManager/lazyFactoryMap.js +7 -0
- package/dataMap/metaManager/lazyFactoryMap.mjs +7 -0
- package/dataMap/metaManager/metaSchema.js +38 -0
- package/dataMap/metaManager/metaSchema.mjs +38 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -0
- package/dataMap/metaManager/mods/extendMetaProperties.js +44 -31
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +44 -31
- package/dataMap/metaManager/utils.js +7 -0
- package/dataMap/metaManager/utils.mjs +7 -0
- package/dist/handsontable.css +4 -5
- package/dist/handsontable.full.css +4 -5
- package/dist/handsontable.full.js +5878 -4657
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +59 -59
- package/dist/handsontable.js +5383 -4277
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +20 -20
- package/editorManager.js +0 -67
- package/editorManager.mjs +0 -67
- package/editors/autocompleteEditor/autocompleteEditor.js +6 -4
- package/editors/autocompleteEditor/autocompleteEditor.mjs +6 -4
- package/editors/baseEditor/baseEditor.js +1 -36
- package/editors/baseEditor/baseEditor.mjs +2 -37
- package/editors/dateEditor/dateEditor.js +4 -1
- package/editors/dateEditor/dateEditor.mjs +4 -1
- package/editors/dropdownEditor/dropdownEditor.js +8 -5
- package/editors/dropdownEditor/dropdownEditor.mjs +8 -5
- package/editors/handsontableEditor/handsontableEditor.js +2 -2
- package/editors/handsontableEditor/handsontableEditor.mjs +2 -2
- package/editors/selectEditor/selectEditor.js +1 -9
- package/editors/selectEditor/selectEditor.mjs +1 -9
- package/editors/textEditor/textEditor.js +2 -11
- package/editors/textEditor/textEditor.mjs +2 -11
- package/focusManager.js +3 -5
- package/focusManager.mjs +3 -5
- package/helpers/array.js +7 -0
- package/helpers/array.mjs +7 -0
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/number.js +12 -2
- package/helpers/number.mjs +12 -2
- package/package.json +3 -3
- package/pluginHooks.d.ts +1 -1
- package/pluginHooks.js +79 -2
- package/pluginHooks.mjs +79 -2
- package/plugins/autoColumnSize/autoColumnSize.js +7 -0
- package/plugins/autoColumnSize/autoColumnSize.mjs +7 -0
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/autofill/autofill.js +1 -1
- package/plugins/autofill/autofill.mjs +1 -1
- package/plugins/base/base.d.ts +1 -1
- package/plugins/base/base.js +6 -2
- package/plugins/base/base.mjs +6 -2
- package/plugins/collapsibleColumns/collapsibleColumns.js +1 -1
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +1 -1
- package/plugins/columnSorting/sortFunction/date.js +2 -46
- package/plugins/columnSorting/sortFunction/date.mjs +2 -45
- package/plugins/columnSorting/sortFunction/time.js +17 -0
- package/plugins/columnSorting/sortFunction/time.mjs +13 -0
- package/plugins/columnSorting/sortService/registry.js +4 -2
- package/plugins/columnSorting/sortService/registry.mjs +3 -1
- package/plugins/columnSorting/utils.js +64 -0
- package/plugins/columnSorting/utils.mjs +62 -0
- package/plugins/columnSummary/columnSummary.js +27 -10
- package/plugins/columnSummary/columnSummary.mjs +27 -10
- package/plugins/columnSummary/endpoints.js +15 -0
- package/plugins/columnSummary/endpoints.mjs +15 -0
- package/plugins/comments/comments.js +2 -8
- package/plugins/comments/comments.mjs +2 -8
- package/plugins/comments/contextMenuItem/addEditComment.js +0 -1
- package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -1
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/copyPaste/copyPaste.js +9 -2
- package/plugins/copyPaste/copyPaste.mjs +9 -2
- package/plugins/copyPaste/pasteEvent.js +1 -0
- package/plugins/copyPaste/pasteEvent.mjs +1 -0
- package/plugins/filters/filters.js +1 -1
- package/plugins/filters/filters.mjs +1 -1
- package/plugins/filters/ui/multipleSelect.js +22 -14
- package/plugins/filters/ui/multipleSelect.mjs +22 -14
- package/plugins/filters/utils.js +7 -0
- package/plugins/filters/utils.mjs +7 -0
- package/plugins/formulas/formulas.d.ts +10 -0
- package/plugins/formulas/formulas.js +11 -2
- package/plugins/formulas/formulas.mjs +11 -2
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +1 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +1 -1
- package/plugins/hiddenColumns/hiddenColumns.js +8 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +8 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +1 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.js +7 -0
- package/plugins/hiddenRows/hiddenRows.mjs +7 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnMove/manualColumnMove.js +1 -1
- package/plugins/manualColumnMove/manualColumnMove.mjs +1 -1
- package/plugins/manualColumnResize/manualColumnResize.js +3 -3
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -3
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.d.ts +1 -0
- package/plugins/manualRowResize/manualRowResize.js +11 -2
- package/plugins/manualRowResize/manualRowResize.mjs +11 -2
- package/plugins/mergeCells/cellsCollection.js +7 -0
- package/plugins/mergeCells/cellsCollection.mjs +7 -0
- package/plugins/mergeCells/mergeCells.js +7 -0
- package/plugins/mergeCells/mergeCells.mjs +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.js +7 -0
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +7 -0
- package/plugins/nestedRows/nestedRows.js +7 -0
- package/plugins/nestedRows/nestedRows.mjs +7 -0
- package/plugins/trimRows/trimRows.js +7 -0
- package/plugins/trimRows/trimRows.mjs +7 -0
- package/selection/selection.js +163 -4
- package/selection/selection.mjs +163 -4
- package/selection/utils.js +7 -0
- package/selection/utils.mjs +7 -0
- package/settings.d.ts +1 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -3
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -3
- package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.js +27 -0
- package/shortcutContexts/commands/editor/closeAndSaveByArrowKeys.mjs +24 -0
- package/shortcutContexts/commands/editor/closeAndSaveByEnter.js +11 -0
- package/shortcutContexts/commands/editor/closeAndSaveByEnter.mjs +8 -0
- package/shortcutContexts/commands/editor/index.js +3 -1
- package/shortcutContexts/commands/editor/index.mjs +3 -1
- package/shortcutContexts/editor.js +9 -1
- package/shortcutContexts/editor.mjs +9 -1
- package/shortcutContexts/index.js +1 -1
- package/shortcutContexts/index.mjs +1 -1
- package/shortcuts/keyObserver.js +7 -0
- package/shortcuts/keyObserver.mjs +7 -0
- package/shortcuts/utils.js +7 -0
- package/shortcuts/utils.mjs +7 -0
- package/tableView.js +1 -4
- package/tableView.mjs +1 -4
- package/translations/changesObservable/observable.js +7 -0
- package/translations/changesObservable/observable.mjs +7 -0
- package/translations/indexMapper.js +7 -0
- package/translations/indexMapper.mjs +8 -1
- package/utils/dataStructures/uniqueSet.js +7 -0
- package/utils/dataStructures/uniqueSet.mjs +7 -0
- package/utils/ghostTable.js +0 -4
- package/utils/ghostTable.mjs +0 -4
- package/utils/paginator.js +7 -0
- package/utils/paginator.mjs +7 -0
- package/validators/dateValidator/dateValidator.js +1 -3
- package/validators/dateValidator/dateValidator.mjs +1 -3
- package/validators/timeValidator/timeValidator.js +1 -3
- package/validators/timeValidator/timeValidator.mjs +1 -3
@@ -99,6 +99,7 @@ class ViewportRowsCalculator {
|
|
99
99
|
} = _classPrivateFieldGet(_options, this);
|
100
100
|
const zeroBasedScrollOffset = Math.max(_classPrivateFieldGet(_options, this).scrollOffset, 0);
|
101
101
|
const horizontalScrollbarHeight = _classPrivateFieldGet(_options, this).horizontalScrollbarHeight || 0;
|
102
|
+
const innerViewportHeight = zeroBasedScrollOffset + viewportHeight - horizontalScrollbarHeight;
|
102
103
|
let sum = 0;
|
103
104
|
let needReverse = true;
|
104
105
|
const startPositions = [];
|
@@ -116,8 +117,7 @@ class ViewportRowsCalculator {
|
|
116
117
|
this.startRow = i;
|
117
118
|
firstVisibleRowHeight = rowHeight;
|
118
119
|
}
|
119
|
-
if (sum >= zeroBasedScrollOffset && sum + (calculationType === _constants.FULLY_VISIBLE_TYPE ? rowHeight : 0) <=
|
120
|
-
// eslint-disable-line max-len
|
120
|
+
if (sum >= zeroBasedScrollOffset && sum + (calculationType === _constants.FULLY_VISIBLE_TYPE ? rowHeight : 0) <= innerViewportHeight) {
|
121
121
|
if (this.startRow === null) {
|
122
122
|
this.startRow = i;
|
123
123
|
firstVisibleRowHeight = rowHeight;
|
@@ -130,7 +130,7 @@ class ViewportRowsCalculator {
|
|
130
130
|
if (calculationType !== _constants.FULLY_VISIBLE_TYPE) {
|
131
131
|
this.endRow = i;
|
132
132
|
}
|
133
|
-
if (sum >=
|
133
|
+
if (sum >= innerViewportHeight) {
|
134
134
|
needReverse = false;
|
135
135
|
break;
|
136
136
|
}
|
@@ -96,6 +96,7 @@ export class ViewportRowsCalculator {
|
|
96
96
|
} = _classPrivateFieldGet(_options, this);
|
97
97
|
const zeroBasedScrollOffset = Math.max(_classPrivateFieldGet(_options, this).scrollOffset, 0);
|
98
98
|
const horizontalScrollbarHeight = _classPrivateFieldGet(_options, this).horizontalScrollbarHeight || 0;
|
99
|
+
const innerViewportHeight = zeroBasedScrollOffset + viewportHeight - horizontalScrollbarHeight;
|
99
100
|
let sum = 0;
|
100
101
|
let needReverse = true;
|
101
102
|
const startPositions = [];
|
@@ -113,8 +114,7 @@ export class ViewportRowsCalculator {
|
|
113
114
|
this.startRow = i;
|
114
115
|
firstVisibleRowHeight = rowHeight;
|
115
116
|
}
|
116
|
-
if (sum >= zeroBasedScrollOffset && sum + (calculationType === FULLY_VISIBLE_TYPE ? rowHeight : 0) <=
|
117
|
-
// eslint-disable-line max-len
|
117
|
+
if (sum >= zeroBasedScrollOffset && sum + (calculationType === FULLY_VISIBLE_TYPE ? rowHeight : 0) <= innerViewportHeight) {
|
118
118
|
if (this.startRow === null) {
|
119
119
|
this.startRow = i;
|
120
120
|
firstVisibleRowHeight = rowHeight;
|
@@ -127,7 +127,7 @@ export class ViewportRowsCalculator {
|
|
127
127
|
if (calculationType !== FULLY_VISIBLE_TYPE) {
|
128
128
|
this.endRow = i;
|
129
129
|
}
|
130
|
-
if (sum >=
|
130
|
+
if (sum >= innerViewportHeight) {
|
131
131
|
needReverse = false;
|
132
132
|
break;
|
133
133
|
}
|
@@ -114,7 +114,7 @@ class CoreAbstract {
|
|
114
114
|
draw() {
|
115
115
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
116
116
|
this.drawInterrupted = false;
|
117
|
-
if (!
|
117
|
+
if (!this.wtTable.isVisible()) {
|
118
118
|
// draw interrupted because TABLE is not visible
|
119
119
|
this.drawInterrupted = true;
|
120
120
|
} else {
|
@@ -110,7 +110,7 @@ export default class CoreAbstract {
|
|
110
110
|
draw() {
|
111
111
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
112
112
|
this.drawInterrupted = false;
|
113
|
-
if (!
|
113
|
+
if (!this.wtTable.isVisible()) {
|
114
114
|
// draw interrupted because TABLE is not visible
|
115
115
|
this.drawInterrupted = true;
|
116
116
|
} else {
|
@@ -4,7 +4,6 @@ exports.__esModule = true;
|
|
4
4
|
require("core-js/modules/es.error.cause.js");
|
5
5
|
var _element = require("../../../../helpers/dom/element");
|
6
6
|
var _object = require("../../../../helpers/object");
|
7
|
-
var _array = require("../../../../helpers/array");
|
8
7
|
var _console = require("../../../../helpers/console");
|
9
8
|
var _constants = require("./constants");
|
10
9
|
var _clone = _interopRequireDefault(require("../core/clone"));
|
@@ -61,24 +60,35 @@ class Overlay {
|
|
61
60
|
this.holder = holder;
|
62
61
|
this.wtRootElement = wtRootElement;
|
63
62
|
this.trimmingContainer = (0, _element.getTrimmingContainer)(this.hider.parentNode.parentNode);
|
64
|
-
this.
|
63
|
+
this.needFullRender = this.shouldBeRendered();
|
65
64
|
this.clone = this.makeClone();
|
66
65
|
}
|
67
66
|
|
68
67
|
/**
|
69
|
-
*
|
68
|
+
* Checks if the overlay rendering state has changed.
|
70
69
|
*
|
71
|
-
* @returns {boolean}
|
70
|
+
* @returns {boolean}
|
72
71
|
*/
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
72
|
+
hasRenderingStateChanged() {
|
73
|
+
return this.needFullRender !== this.shouldBeRendered();
|
74
|
+
}
|
75
|
+
|
76
|
+
/**
|
77
|
+
* Updates internal state with an information about the need of full rendering of the overlay in the next draw cycles.
|
78
|
+
*
|
79
|
+
* If the state is changed to render the overlay, the `needFullRender` property is set to `true` which means that
|
80
|
+
* the overlay will be fully rendered in the current draw cycle. If the state is changed to not render the overlay,
|
81
|
+
* the `needFullRender` property is set to `false` which means that the overlay will be fully rendered in the
|
82
|
+
* current draw cycle but it will not be rendered in the next draw cycles.
|
83
|
+
*
|
84
|
+
* @param {'before' | 'after'} drawPhase The phase of the rendering process.
|
85
|
+
*/
|
86
|
+
updateStateOfRendering(drawPhase) {
|
87
|
+
if (drawPhase === 'before' && this.shouldBeRendered()) {
|
88
|
+
this.needFullRender = true;
|
89
|
+
} else if (drawPhase === 'after' && !this.shouldBeRendered()) {
|
90
|
+
this.needFullRender = false;
|
80
91
|
}
|
81
|
-
return changed;
|
82
92
|
}
|
83
93
|
|
84
94
|
/**
|
@@ -305,27 +315,21 @@ class Overlay {
|
|
305
315
|
*/
|
306
316
|
refresh() {
|
307
317
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
308
|
-
|
309
|
-
const nextCycleRenderFlag = this.shouldBeRendered();
|
310
|
-
if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {
|
318
|
+
if (this.needFullRender) {
|
311
319
|
this.clone.draw(fastDraw);
|
312
320
|
}
|
313
|
-
this.needFullRender = nextCycleRenderFlag;
|
314
321
|
}
|
315
322
|
|
316
323
|
/**
|
317
324
|
* Reset overlay styles to initial values.
|
318
325
|
*/
|
319
326
|
reset() {
|
320
|
-
if (!this.clone) {
|
321
|
-
return;
|
322
|
-
}
|
323
327
|
const holder = this.clone.wtTable.holder; // todo refactoring: DEMETER
|
324
328
|
const hider = this.clone.wtTable.hider; // todo refactoring: DEMETER
|
325
329
|
const holderStyle = holder.style;
|
326
330
|
const hiderStyle = hider.style;
|
327
331
|
const rootStyle = holder.parentNode.style;
|
328
|
-
|
332
|
+
[holderStyle, hiderStyle, rootStyle].forEach(style => {
|
329
333
|
style.width = '';
|
330
334
|
style.height = '';
|
331
335
|
});
|
@@ -4,7 +4,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
4
4
|
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); }
|
5
5
|
import { getScrollableElement, getTrimmingContainer, getScrollbarWidth, setAttribute } from "../../../../helpers/dom/element.mjs";
|
6
6
|
import { defineGetter } from "../../../../helpers/object.mjs";
|
7
|
-
import { arrayEach } from "../../../../helpers/array.mjs";
|
8
7
|
import { warn } from "../../../../helpers/console.mjs";
|
9
8
|
import { CLONE_TYPES, CLONE_CLASS_NAMES, CLONE_TOP, CLONE_INLINE_START } from "./constants.mjs";
|
10
9
|
import Clone from "../core/clone.mjs";
|
@@ -57,24 +56,35 @@ export class Overlay {
|
|
57
56
|
this.holder = holder;
|
58
57
|
this.wtRootElement = wtRootElement;
|
59
58
|
this.trimmingContainer = getTrimmingContainer(this.hider.parentNode.parentNode);
|
60
|
-
this.
|
59
|
+
this.needFullRender = this.shouldBeRendered();
|
61
60
|
this.clone = this.makeClone();
|
62
61
|
}
|
63
62
|
|
64
63
|
/**
|
65
|
-
*
|
64
|
+
* Checks if the overlay rendering state has changed.
|
66
65
|
*
|
67
|
-
* @returns {boolean}
|
66
|
+
* @returns {boolean}
|
68
67
|
*/
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
68
|
+
hasRenderingStateChanged() {
|
69
|
+
return this.needFullRender !== this.shouldBeRendered();
|
70
|
+
}
|
71
|
+
|
72
|
+
/**
|
73
|
+
* Updates internal state with an information about the need of full rendering of the overlay in the next draw cycles.
|
74
|
+
*
|
75
|
+
* If the state is changed to render the overlay, the `needFullRender` property is set to `true` which means that
|
76
|
+
* the overlay will be fully rendered in the current draw cycle. If the state is changed to not render the overlay,
|
77
|
+
* the `needFullRender` property is set to `false` which means that the overlay will be fully rendered in the
|
78
|
+
* current draw cycle but it will not be rendered in the next draw cycles.
|
79
|
+
*
|
80
|
+
* @param {'before' | 'after'} drawPhase The phase of the rendering process.
|
81
|
+
*/
|
82
|
+
updateStateOfRendering(drawPhase) {
|
83
|
+
if (drawPhase === 'before' && this.shouldBeRendered()) {
|
84
|
+
this.needFullRender = true;
|
85
|
+
} else if (drawPhase === 'after' && !this.shouldBeRendered()) {
|
86
|
+
this.needFullRender = false;
|
76
87
|
}
|
77
|
-
return changed;
|
78
88
|
}
|
79
89
|
|
80
90
|
/**
|
@@ -301,27 +311,21 @@ export class Overlay {
|
|
301
311
|
*/
|
302
312
|
refresh() {
|
303
313
|
let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
304
|
-
|
305
|
-
const nextCycleRenderFlag = this.shouldBeRendered();
|
306
|
-
if (this.clone && (this.needFullRender || nextCycleRenderFlag)) {
|
314
|
+
if (this.needFullRender) {
|
307
315
|
this.clone.draw(fastDraw);
|
308
316
|
}
|
309
|
-
this.needFullRender = nextCycleRenderFlag;
|
310
317
|
}
|
311
318
|
|
312
319
|
/**
|
313
320
|
* Reset overlay styles to initial values.
|
314
321
|
*/
|
315
322
|
reset() {
|
316
|
-
if (!this.clone) {
|
317
|
-
return;
|
318
|
-
}
|
319
323
|
const holder = this.clone.wtTable.holder; // todo refactoring: DEMETER
|
320
324
|
const hider = this.clone.wtTable.hider; // todo refactoring: DEMETER
|
321
325
|
const holderStyle = holder.style;
|
322
326
|
const hiderStyle = hider.style;
|
323
327
|
const rootStyle = holder.parentNode.style;
|
324
|
-
|
328
|
+
[holderStyle, hiderStyle, rootStyle].forEach(style => {
|
325
329
|
style.width = '';
|
326
330
|
style.height = '';
|
327
331
|
});
|
@@ -61,7 +61,7 @@ class BottomOverlay extends _base.Overlay {
|
|
61
61
|
* @returns {boolean}
|
62
62
|
*/
|
63
63
|
resetFixedPosition() {
|
64
|
-
if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
|
64
|
+
if (!this.needFullRender || !this.shouldBeRendered() || !this.wot.wtTable.holder.parentNode) {
|
65
65
|
// removed from DOM
|
66
66
|
return false;
|
67
67
|
}
|
@@ -158,14 +158,11 @@ class BottomOverlay extends _base.Overlay {
|
|
158
158
|
}
|
159
159
|
|
160
160
|
/**
|
161
|
-
* Adjust overlay root element,
|
162
|
-
*
|
163
|
-
* @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.
|
161
|
+
* Adjust overlay root element, children and master table element sizes (width, height).
|
164
162
|
*/
|
165
163
|
adjustElementsSize() {
|
166
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
167
164
|
this.updateTrimmingContainer();
|
168
|
-
if (this.needFullRender
|
165
|
+
if (this.needFullRender) {
|
169
166
|
this.adjustRootElementSize();
|
170
167
|
this.adjustRootChildrenSize();
|
171
168
|
}
|
@@ -57,7 +57,7 @@ export class BottomOverlay extends Overlay {
|
|
57
57
|
* @returns {boolean}
|
58
58
|
*/
|
59
59
|
resetFixedPosition() {
|
60
|
-
if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
|
60
|
+
if (!this.needFullRender || !this.shouldBeRendered() || !this.wot.wtTable.holder.parentNode) {
|
61
61
|
// removed from DOM
|
62
62
|
return false;
|
63
63
|
}
|
@@ -154,14 +154,11 @@ export class BottomOverlay extends Overlay {
|
|
154
154
|
}
|
155
155
|
|
156
156
|
/**
|
157
|
-
* Adjust overlay root element,
|
158
|
-
*
|
159
|
-
* @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.
|
157
|
+
* Adjust overlay root element, children and master table element sizes (width, height).
|
160
158
|
*/
|
161
159
|
adjustElementsSize() {
|
162
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
163
160
|
this.updateTrimmingContainer();
|
164
|
-
if (this.needFullRender
|
161
|
+
if (this.needFullRender) {
|
165
162
|
this.adjustRootElementSize();
|
166
163
|
this.adjustRootChildrenSize();
|
167
164
|
}
|
@@ -54,7 +54,7 @@ class InlineStartOverlay extends _base.Overlay {
|
|
54
54
|
const {
|
55
55
|
wtTable
|
56
56
|
} = this.wot;
|
57
|
-
if (!this.needFullRender || !wtTable.holder.parentNode) {
|
57
|
+
if (!this.needFullRender || !this.shouldBeRendered() || !wtTable.holder.parentNode) {
|
58
58
|
// removed from DOM
|
59
59
|
return false;
|
60
60
|
}
|
@@ -126,14 +126,11 @@ class InlineStartOverlay extends _base.Overlay {
|
|
126
126
|
}
|
127
127
|
|
128
128
|
/**
|
129
|
-
* Adjust overlay root element,
|
130
|
-
*
|
131
|
-
* @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.
|
129
|
+
* Adjust overlay root element, children and master table element sizes (width, height).
|
132
130
|
*/
|
133
131
|
adjustElementsSize() {
|
134
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
135
132
|
this.updateTrimmingContainer();
|
136
|
-
if (this.needFullRender
|
133
|
+
if (this.needFullRender) {
|
137
134
|
this.adjustRootElementSize();
|
138
135
|
this.adjustRootChildrenSize();
|
139
136
|
}
|
@@ -322,27 +319,33 @@ class InlineStartOverlay extends _base.Overlay {
|
|
322
319
|
* @returns {boolean}
|
323
320
|
*/
|
324
321
|
adjustHeaderBordersPosition(position) {
|
322
|
+
const {
|
323
|
+
wtSettings
|
324
|
+
} = this;
|
325
325
|
const masterParent = this.wot.wtTable.holder.parentNode;
|
326
|
-
const rowHeaders =
|
327
|
-
const fixedColumnsStart =
|
328
|
-
const totalRows =
|
326
|
+
const rowHeaders = wtSettings.getSetting('rowHeaders');
|
327
|
+
const fixedColumnsStart = wtSettings.getSetting('fixedColumnsStart');
|
328
|
+
const totalRows = wtSettings.getSetting('totalRows');
|
329
|
+
const preventVerticalOverflow = wtSettings.getSetting('preventOverflow') === 'vertical';
|
329
330
|
if (totalRows) {
|
330
331
|
(0, _element.removeClass)(masterParent, 'emptyRows');
|
331
332
|
} else {
|
332
333
|
(0, _element.addClass)(masterParent, 'emptyRows');
|
333
334
|
}
|
334
335
|
let positionChanged = false;
|
335
|
-
if (
|
336
|
-
|
337
|
-
|
338
|
-
} else if (!fixedColumnsStart && rowHeaders.length) {
|
339
|
-
const previousState = (0, _element.hasClass)(masterParent, 'innerBorderInlineStart');
|
340
|
-
if (position) {
|
336
|
+
if (!preventVerticalOverflow) {
|
337
|
+
if (fixedColumnsStart && !rowHeaders.length) {
|
338
|
+
// "innerBorderLeft" is for backward compatibility
|
341
339
|
(0, _element.addClass)(masterParent, 'innerBorderLeft innerBorderInlineStart');
|
342
|
-
|
343
|
-
|
344
|
-
(
|
345
|
-
|
340
|
+
} else if (!fixedColumnsStart && rowHeaders.length) {
|
341
|
+
const previousState = (0, _element.hasClass)(masterParent, 'innerBorderInlineStart');
|
342
|
+
if (position) {
|
343
|
+
(0, _element.addClass)(masterParent, 'innerBorderLeft innerBorderInlineStart');
|
344
|
+
positionChanged = !previousState;
|
345
|
+
} else {
|
346
|
+
(0, _element.removeClass)(masterParent, 'innerBorderLeft innerBorderInlineStart');
|
347
|
+
positionChanged = previousState;
|
348
|
+
}
|
346
349
|
}
|
347
350
|
}
|
348
351
|
return positionChanged;
|
@@ -50,7 +50,7 @@ export class InlineStartOverlay extends Overlay {
|
|
50
50
|
const {
|
51
51
|
wtTable
|
52
52
|
} = this.wot;
|
53
|
-
if (!this.needFullRender || !wtTable.holder.parentNode) {
|
53
|
+
if (!this.needFullRender || !this.shouldBeRendered() || !wtTable.holder.parentNode) {
|
54
54
|
// removed from DOM
|
55
55
|
return false;
|
56
56
|
}
|
@@ -122,14 +122,11 @@ export class InlineStartOverlay extends Overlay {
|
|
122
122
|
}
|
123
123
|
|
124
124
|
/**
|
125
|
-
* Adjust overlay root element,
|
126
|
-
*
|
127
|
-
* @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.
|
125
|
+
* Adjust overlay root element, children and master table element sizes (width, height).
|
128
126
|
*/
|
129
127
|
adjustElementsSize() {
|
130
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
131
128
|
this.updateTrimmingContainer();
|
132
|
-
if (this.needFullRender
|
129
|
+
if (this.needFullRender) {
|
133
130
|
this.adjustRootElementSize();
|
134
131
|
this.adjustRootChildrenSize();
|
135
132
|
}
|
@@ -318,27 +315,33 @@ export class InlineStartOverlay extends Overlay {
|
|
318
315
|
* @returns {boolean}
|
319
316
|
*/
|
320
317
|
adjustHeaderBordersPosition(position) {
|
318
|
+
const {
|
319
|
+
wtSettings
|
320
|
+
} = this;
|
321
321
|
const masterParent = this.wot.wtTable.holder.parentNode;
|
322
|
-
const rowHeaders =
|
323
|
-
const fixedColumnsStart =
|
324
|
-
const totalRows =
|
322
|
+
const rowHeaders = wtSettings.getSetting('rowHeaders');
|
323
|
+
const fixedColumnsStart = wtSettings.getSetting('fixedColumnsStart');
|
324
|
+
const totalRows = wtSettings.getSetting('totalRows');
|
325
|
+
const preventVerticalOverflow = wtSettings.getSetting('preventOverflow') === 'vertical';
|
325
326
|
if (totalRows) {
|
326
327
|
removeClass(masterParent, 'emptyRows');
|
327
328
|
} else {
|
328
329
|
addClass(masterParent, 'emptyRows');
|
329
330
|
}
|
330
331
|
let positionChanged = false;
|
331
|
-
if (
|
332
|
-
|
333
|
-
|
334
|
-
} else if (!fixedColumnsStart && rowHeaders.length) {
|
335
|
-
const previousState = hasClass(masterParent, 'innerBorderInlineStart');
|
336
|
-
if (position) {
|
332
|
+
if (!preventVerticalOverflow) {
|
333
|
+
if (fixedColumnsStart && !rowHeaders.length) {
|
334
|
+
// "innerBorderLeft" is for backward compatibility
|
337
335
|
addClass(masterParent, 'innerBorderLeft innerBorderInlineStart');
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
336
|
+
} else if (!fixedColumnsStart && rowHeaders.length) {
|
337
|
+
const previousState = hasClass(masterParent, 'innerBorderInlineStart');
|
338
|
+
if (position) {
|
339
|
+
addClass(masterParent, 'innerBorderLeft innerBorderInlineStart');
|
340
|
+
positionChanged = !previousState;
|
341
|
+
} else {
|
342
|
+
removeClass(masterParent, 'innerBorderLeft innerBorderInlineStart');
|
343
|
+
positionChanged = previousState;
|
344
|
+
}
|
342
345
|
}
|
343
346
|
}
|
344
347
|
return positionChanged;
|
@@ -62,7 +62,7 @@ class TopOverlay extends _base.Overlay {
|
|
62
62
|
* @returns {boolean}
|
63
63
|
*/
|
64
64
|
resetFixedPosition() {
|
65
|
-
if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
|
65
|
+
if (!this.needFullRender || !this.shouldBeRendered() || !this.wot.wtTable.holder.parentNode) {
|
66
66
|
// removed from DOM
|
67
67
|
return false;
|
68
68
|
}
|
@@ -150,14 +150,11 @@ class TopOverlay extends _base.Overlay {
|
|
150
150
|
}
|
151
151
|
|
152
152
|
/**
|
153
|
-
* Adjust overlay root element,
|
154
|
-
*
|
155
|
-
* @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.
|
153
|
+
* Adjust overlay root element, children and master table element sizes (width, height).
|
156
154
|
*/
|
157
155
|
adjustElementsSize() {
|
158
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
159
156
|
this.updateTrimmingContainer();
|
160
|
-
if (this.needFullRender
|
157
|
+
if (this.needFullRender) {
|
161
158
|
this.adjustRootElementSize();
|
162
159
|
this.adjustRootChildrenSize();
|
163
160
|
}
|
@@ -349,22 +346,26 @@ class TopOverlay extends _base.Overlay {
|
|
349
346
|
*/
|
350
347
|
adjustHeaderBordersPosition(position) {
|
351
348
|
let skipInnerBorderAdjusting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
349
|
+
const {
|
350
|
+
wtSettings
|
351
|
+
} = this;
|
352
352
|
const masterParent = this.wot.wtTable.holder.parentNode;
|
353
|
-
const totalColumns =
|
353
|
+
const totalColumns = wtSettings.getSetting('totalColumns');
|
354
|
+
const preventHorizontalOverflow = wtSettings.getSetting('preventOverflow') === 'horizontal';
|
354
355
|
if (totalColumns) {
|
355
356
|
(0, _element.removeClass)(masterParent, 'emptyColumns');
|
356
357
|
} else {
|
357
358
|
(0, _element.addClass)(masterParent, 'emptyColumns');
|
358
359
|
}
|
359
360
|
let positionChanged = false;
|
360
|
-
if (!skipInnerBorderAdjusting) {
|
361
|
-
const fixedRowsTop =
|
361
|
+
if (!skipInnerBorderAdjusting && !preventHorizontalOverflow) {
|
362
|
+
const fixedRowsTop = wtSettings.getSetting('fixedRowsTop');
|
362
363
|
const areFixedRowsTopChanged = this.cachedFixedRowsTop !== fixedRowsTop;
|
363
|
-
const columnHeaders =
|
364
|
+
const columnHeaders = wtSettings.getSetting('columnHeaders');
|
364
365
|
if ((areFixedRowsTopChanged || fixedRowsTop === 0) && columnHeaders.length > 0) {
|
365
366
|
const previousState = (0, _element.hasClass)(masterParent, 'innerBorderTop');
|
366
|
-
this.cachedFixedRowsTop =
|
367
|
-
if (position ||
|
367
|
+
this.cachedFixedRowsTop = wtSettings.getSetting('fixedRowsTop');
|
368
|
+
if (position || wtSettings.getSetting('totalRows') === 0) {
|
368
369
|
(0, _element.addClass)(masterParent, 'innerBorderTop');
|
369
370
|
positionChanged = !previousState;
|
370
371
|
} else {
|
@@ -58,7 +58,7 @@ export class TopOverlay extends Overlay {
|
|
58
58
|
* @returns {boolean}
|
59
59
|
*/
|
60
60
|
resetFixedPosition() {
|
61
|
-
if (!this.needFullRender || !this.wot.wtTable.holder.parentNode) {
|
61
|
+
if (!this.needFullRender || !this.shouldBeRendered() || !this.wot.wtTable.holder.parentNode) {
|
62
62
|
// removed from DOM
|
63
63
|
return false;
|
64
64
|
}
|
@@ -146,14 +146,11 @@ export class TopOverlay extends Overlay {
|
|
146
146
|
}
|
147
147
|
|
148
148
|
/**
|
149
|
-
* Adjust overlay root element,
|
150
|
-
*
|
151
|
-
* @param {boolean} [force=false] When `true`, it adjusts the DOM nodes sizes for that overlay.
|
149
|
+
* Adjust overlay root element, children and master table element sizes (width, height).
|
152
150
|
*/
|
153
151
|
adjustElementsSize() {
|
154
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
155
152
|
this.updateTrimmingContainer();
|
156
|
-
if (this.needFullRender
|
153
|
+
if (this.needFullRender) {
|
157
154
|
this.adjustRootElementSize();
|
158
155
|
this.adjustRootChildrenSize();
|
159
156
|
}
|
@@ -345,22 +342,26 @@ export class TopOverlay extends Overlay {
|
|
345
342
|
*/
|
346
343
|
adjustHeaderBordersPosition(position) {
|
347
344
|
let skipInnerBorderAdjusting = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
345
|
+
const {
|
346
|
+
wtSettings
|
347
|
+
} = this;
|
348
348
|
const masterParent = this.wot.wtTable.holder.parentNode;
|
349
|
-
const totalColumns =
|
349
|
+
const totalColumns = wtSettings.getSetting('totalColumns');
|
350
|
+
const preventHorizontalOverflow = wtSettings.getSetting('preventOverflow') === 'horizontal';
|
350
351
|
if (totalColumns) {
|
351
352
|
removeClass(masterParent, 'emptyColumns');
|
352
353
|
} else {
|
353
354
|
addClass(masterParent, 'emptyColumns');
|
354
355
|
}
|
355
356
|
let positionChanged = false;
|
356
|
-
if (!skipInnerBorderAdjusting) {
|
357
|
-
const fixedRowsTop =
|
357
|
+
if (!skipInnerBorderAdjusting && !preventHorizontalOverflow) {
|
358
|
+
const fixedRowsTop = wtSettings.getSetting('fixedRowsTop');
|
358
359
|
const areFixedRowsTopChanged = this.cachedFixedRowsTop !== fixedRowsTop;
|
359
|
-
const columnHeaders =
|
360
|
+
const columnHeaders = wtSettings.getSetting('columnHeaders');
|
360
361
|
if ((areFixedRowsTopChanged || fixedRowsTop === 0) && columnHeaders.length > 0) {
|
361
362
|
const previousState = hasClass(masterParent, 'innerBorderTop');
|
362
|
-
this.cachedFixedRowsTop =
|
363
|
-
if (position ||
|
363
|
+
this.cachedFixedRowsTop = wtSettings.getSetting('fixedRowsTop');
|
364
|
+
if (position || wtSettings.getSetting('totalRows') === 0) {
|
364
365
|
addClass(masterParent, 'innerBorderTop');
|
365
366
|
positionChanged = !previousState;
|
366
367
|
} else {
|