handsontable 0.0.0-next-02c94b0-20240416 → 0.0.0-next-534415d-20240418
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/viewportColumns.js +2 -2
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +2 -2
- package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.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 +3 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +3 -6
- package/3rdparty/walkontable/src/overlay/top.js +3 -6
- package/3rdparty/walkontable/src/overlay/top.mjs +3 -6
- package/3rdparty/walkontable/src/overlays.js +46 -24
- package/3rdparty/walkontable/src/overlays.mjs +46 -24
- package/3rdparty/walkontable/src/table.js +10 -11
- package/3rdparty/walkontable/src/table.mjs +10 -11
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +37 -31
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +37 -31
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +169 -152
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +10 -10
- package/dist/handsontable.js +169 -152
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +10 -10
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/collapsibleColumns/collapsibleColumns.js +1 -1
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +1 -1
- package/plugins/comments/comments.js +2 -8
- package/plugins/comments/comments.mjs +2 -8
- package/plugins/filters/filters.js +1 -1
- package/plugins/filters/filters.mjs +1 -1
- package/plugins/filters/ui/multipleSelect.js +15 -12
- package/plugins/filters/ui/multipleSelect.mjs +15 -12
- 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/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/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 +2 -2
- package/plugins/manualColumnResize/manualColumnResize.mjs +2 -2
- package/plugins/manualRowMove/manualRowMove.js +1 -1
- package/plugins/manualRowMove/manualRowMove.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.js +2 -2
- package/plugins/manualRowResize/manualRowResize.mjs +2 -2
- package/tableView.js +1 -4
- package/tableView.mjs +1 -4
@@ -137,9 +137,9 @@ class ViewportColumnsCalculator {
|
|
137
137
|
const inlineStartColumnOffset = calculationType === _constants.FULLY_VISIBLE_TYPE ? firstVisibleColumnWidth : 0;
|
138
138
|
if (
|
139
139
|
// the table is to the left of the viewport
|
140
|
-
mostRightScrollOffset < -1 * _classPrivateFieldGet(_options, this).inlineStartOffset || scrollOffset
|
140
|
+
mostRightScrollOffset < -1 * _classPrivateFieldGet(_options, this).inlineStartOffset || scrollOffset >= startPositions.at(-1) + inlineEndColumnOffset ||
|
141
141
|
// the table is to the right of the viewport
|
142
|
-
-1 * _classPrivateFieldGet(_options, this).scrollOffset - _classPrivateFieldGet(_options, this).viewportWidth
|
142
|
+
-1 * _classPrivateFieldGet(_options, this).scrollOffset - _classPrivateFieldGet(_options, this).viewportWidth >= -1 * inlineStartColumnOffset) {
|
143
143
|
this.isVisibleInTrimmingContainer = false;
|
144
144
|
} else {
|
145
145
|
this.isVisibleInTrimmingContainer = true;
|
@@ -134,9 +134,9 @@ export class ViewportColumnsCalculator {
|
|
134
134
|
const inlineStartColumnOffset = calculationType === FULLY_VISIBLE_TYPE ? firstVisibleColumnWidth : 0;
|
135
135
|
if (
|
136
136
|
// the table is to the left of the viewport
|
137
|
-
mostRightScrollOffset < -1 * _classPrivateFieldGet(_options, this).inlineStartOffset || scrollOffset
|
137
|
+
mostRightScrollOffset < -1 * _classPrivateFieldGet(_options, this).inlineStartOffset || scrollOffset >= startPositions.at(-1) + inlineEndColumnOffset ||
|
138
138
|
// the table is to the right of the viewport
|
139
|
-
-1 * _classPrivateFieldGet(_options, this).scrollOffset - _classPrivateFieldGet(_options, this).viewportWidth
|
139
|
+
-1 * _classPrivateFieldGet(_options, this).scrollOffset - _classPrivateFieldGet(_options, this).viewportWidth >= -1 * inlineStartColumnOffset) {
|
140
140
|
this.isVisibleInTrimmingContainer = false;
|
141
141
|
} else {
|
142
142
|
this.isVisibleInTrimmingContainer = true;
|
@@ -138,7 +138,7 @@ class ViewportRowsCalculator {
|
|
138
138
|
const mostBottomScrollOffset = scrollOffset + viewportHeight - horizontalScrollbarHeight;
|
139
139
|
const topRowOffset = calculationType === _constants.FULLY_VISIBLE_TYPE ? firstVisibleRowHeight : 0;
|
140
140
|
const bottomRowOffset = calculationType === _constants.FULLY_VISIBLE_TYPE ? 0 : lastVisibleRowHeight;
|
141
|
-
if (mostBottomScrollOffset
|
141
|
+
if (mostBottomScrollOffset <= topRowOffset || scrollOffset >= startPositions.at(-1) + bottomRowOffset) {
|
142
142
|
this.isVisibleInTrimmingContainer = false;
|
143
143
|
} else {
|
144
144
|
this.isVisibleInTrimmingContainer = true;
|
@@ -135,7 +135,7 @@ export class ViewportRowsCalculator {
|
|
135
135
|
const mostBottomScrollOffset = scrollOffset + viewportHeight - horizontalScrollbarHeight;
|
136
136
|
const topRowOffset = calculationType === FULLY_VISIBLE_TYPE ? firstVisibleRowHeight : 0;
|
137
137
|
const bottomRowOffset = calculationType === FULLY_VISIBLE_TYPE ? 0 : lastVisibleRowHeight;
|
138
|
-
if (mostBottomScrollOffset
|
138
|
+
if (mostBottomScrollOffset <= topRowOffset || scrollOffset >= startPositions.at(-1) + bottomRowOffset) {
|
139
139
|
this.isVisibleInTrimmingContainer = false;
|
140
140
|
} else {
|
141
141
|
this.isVisibleInTrimmingContainer = true;
|
@@ -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
|
}
|
@@ -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
|
}
|
@@ -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
|
}
|
@@ -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
|
}
|
@@ -9,12 +9,19 @@ var _array = require("../../../helpers/array");
|
|
9
9
|
var _unicode = require("../../../helpers/unicode");
|
10
10
|
var _browser = require("../../../helpers/browser");
|
11
11
|
var _overlay = require("./overlay");
|
12
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
13
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
12
14
|
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; }
|
13
15
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
14
16
|
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); }
|
17
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
18
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
19
|
+
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"); }
|
15
20
|
/**
|
16
21
|
* @class Overlays
|
17
22
|
*/
|
23
|
+
var _overlays = /*#__PURE__*/new WeakMap();
|
24
|
+
var _hasRenderingStateChanged = /*#__PURE__*/new WeakMap();
|
18
25
|
class Overlays {
|
19
26
|
/**
|
20
27
|
* @param {Walkontable} wotInstance The Walkontable instance. @todo refactoring remove.
|
@@ -32,6 +39,12 @@ class Overlays {
|
|
32
39
|
* @type {Walkontable}
|
33
40
|
*/
|
34
41
|
_defineProperty(this, "wot", null);
|
42
|
+
/**
|
43
|
+
* An array of the all overlays.
|
44
|
+
*
|
45
|
+
* @type {Overlay[]}
|
46
|
+
*/
|
47
|
+
_classPrivateFieldInitSpec(this, _overlays, []);
|
35
48
|
/**
|
36
49
|
* Refer to the TopOverlay instance.
|
37
50
|
*
|
@@ -81,6 +94,12 @@ class Overlays {
|
|
81
94
|
* @type {Settings}
|
82
95
|
*/
|
83
96
|
_defineProperty(this, "wtSettings", null);
|
97
|
+
/**
|
98
|
+
* Indicates whether the rendering state has changed for one of the overlays.
|
99
|
+
*
|
100
|
+
* @type {boolean}
|
101
|
+
*/
|
102
|
+
_classPrivateFieldInitSpec(this, _hasRenderingStateChanged, false);
|
84
103
|
/**
|
85
104
|
* The instance of the ResizeObserver that observes the size of the Walkontable wrapper element.
|
86
105
|
* In case of the size change detection the `onContainerElementResize` is fired.
|
@@ -140,7 +159,7 @@ class Overlays {
|
|
140
159
|
*/
|
141
160
|
getOverlays() {
|
142
161
|
let includeMaster = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
143
|
-
const overlays = [
|
162
|
+
const overlays = [..._classPrivateFieldGet(_overlays, this)];
|
144
163
|
if (includeMaster) {
|
145
164
|
overlays.push(this.wtTable);
|
146
165
|
}
|
@@ -185,29 +204,31 @@ class Overlays {
|
|
185
204
|
// TODO cond. Has no any visual impact. They're initially hidden in same way like left, top, and bottom overlays.
|
186
205
|
this.topInlineStartCornerOverlay = new _overlay.TopInlineStartCornerOverlay(...args, this.topOverlay, this.inlineStartOverlay);
|
187
206
|
this.bottomInlineStartCornerOverlay = new _overlay.BottomInlineStartCornerOverlay(...args, this.bottomOverlay, this.inlineStartOverlay);
|
207
|
+
_classPrivateFieldSet(_overlays, this, [this.topOverlay, this.bottomOverlay, this.inlineStartOverlay, this.topInlineStartCornerOverlay, this.bottomInlineStartCornerOverlay]);
|
188
208
|
}
|
189
209
|
|
190
210
|
/**
|
191
|
-
*
|
192
|
-
*
|
193
|
-
* @package
|
194
|
-
* @returns {boolean} Returns `true` if changes applied to overlay needs scroll synchronization.
|
211
|
+
* Runs logic for the overlays before the table is drawn.
|
195
212
|
*/
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
213
|
+
beforeDraw() {
|
214
|
+
_classPrivateFieldSet(_hasRenderingStateChanged, this, _classPrivateFieldGet(_overlays, this).reduce((acc, overlay) => {
|
215
|
+
return overlay.hasRenderingStateChanged() || acc;
|
216
|
+
}, false));
|
217
|
+
_classPrivateFieldGet(_overlays, this).forEach(overlay => overlay.updateStateOfRendering('before'));
|
218
|
+
}
|
200
219
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
220
|
+
/**
|
221
|
+
* Runs logic for the overlays after the table is drawn.
|
222
|
+
*/
|
223
|
+
afterDraw() {
|
224
|
+
this.syncScrollWithMaster();
|
225
|
+
_classPrivateFieldGet(_overlays, this).forEach(overlay => {
|
226
|
+
const hasRenderingStateChanged = overlay.hasRenderingStateChanged();
|
227
|
+
overlay.updateStateOfRendering('after');
|
228
|
+
if (hasRenderingStateChanged && !overlay.needFullRender) {
|
229
|
+
overlay.reset();
|
208
230
|
}
|
209
|
-
}
|
210
|
-
return syncScroll;
|
231
|
+
});
|
211
232
|
}
|
212
233
|
|
213
234
|
/**
|
@@ -447,6 +468,9 @@ class Overlays {
|
|
447
468
|
* Synchronize overlay scrollbars with the master scrollbar.
|
448
469
|
*/
|
449
470
|
syncScrollWithMaster() {
|
471
|
+
if (!_classPrivateFieldGet(_hasRenderingStateChanged, this)) {
|
472
|
+
return;
|
473
|
+
}
|
450
474
|
const master = this.topOverlay.mainTableScrollableElement;
|
451
475
|
const {
|
452
476
|
scrollLeft,
|
@@ -461,6 +485,7 @@ class Overlays {
|
|
461
485
|
if (this.inlineStartOverlay.needFullRender) {
|
462
486
|
this.inlineStartOverlay.clone.wtTable.holder.scrollTop = scrollTop; // todo rethink, *overlay.setScroll*()
|
463
487
|
}
|
488
|
+
_classPrivateFieldSet(_hasRenderingStateChanged, this, false);
|
464
489
|
}
|
465
490
|
|
466
491
|
/**
|
@@ -551,11 +576,8 @@ class Overlays {
|
|
551
576
|
|
552
577
|
/**
|
553
578
|
* Adjust overlays elements size and master table size.
|
554
|
-
*
|
555
|
-
* @param {boolean} [force=false] When `true`, it adjust the DOM nodes sizes for all overlays.
|
556
579
|
*/
|
557
580
|
adjustElementsSize() {
|
558
|
-
let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
559
581
|
const {
|
560
582
|
wtViewport
|
561
583
|
} = this.wot;
|
@@ -605,9 +627,9 @@ class Overlays {
|
|
605
627
|
this.hasScrollbarRight = true;
|
606
628
|
}
|
607
629
|
}
|
608
|
-
this.topOverlay.adjustElementsSize(
|
609
|
-
this.inlineStartOverlay.adjustElementsSize(
|
610
|
-
this.bottomOverlay.adjustElementsSize(
|
630
|
+
this.topOverlay.adjustElementsSize();
|
631
|
+
this.inlineStartOverlay.adjustElementsSize();
|
632
|
+
this.bottomOverlay.adjustElementsSize();
|
611
633
|
}
|
612
634
|
|
613
635
|
/**
|