handsontable 0.0.0-next-a148bc1-20241121 → 0.0.0-next-4ad1863-20241122

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.

Files changed (49) hide show
  1. package/3rdparty/walkontable/src/index.js +0 -2
  2. package/3rdparty/walkontable/src/index.mjs +1 -2
  3. package/3rdparty/walkontable/src/renderer/_base.js +4 -3
  4. package/3rdparty/walkontable/src/renderer/_base.mjs +2 -2
  5. package/3rdparty/walkontable/src/renderer/cells.js +10 -11
  6. package/3rdparty/walkontable/src/renderer/cells.mjs +8 -10
  7. package/3rdparty/walkontable/src/renderer/colGroup.js +7 -6
  8. package/3rdparty/walkontable/src/renderer/colGroup.mjs +5 -5
  9. package/3rdparty/walkontable/src/renderer/columnHeaders.js +5 -4
  10. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +3 -3
  11. package/3rdparty/walkontable/src/renderer/index.js +19 -18
  12. package/3rdparty/walkontable/src/renderer/index.mjs +6 -6
  13. package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -5
  14. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -4
  15. package/3rdparty/walkontable/src/renderer/rows.js +11 -23
  16. package/3rdparty/walkontable/src/renderer/rows.mjs +10 -23
  17. package/3rdparty/walkontable/src/renderer/table.js +1 -1
  18. package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
  19. package/3rdparty/walkontable/src/utils/nodesPool.js +5 -22
  20. package/3rdparty/walkontable/src/utils/nodesPool.mjs +5 -22
  21. package/3rdparty/walkontable/src/utils/orderView/index.js +5 -4
  22. package/3rdparty/walkontable/src/utils/orderView/index.mjs +2 -2
  23. package/3rdparty/walkontable/src/utils/orderView/sharedView.js +4 -3
  24. package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +2 -2
  25. package/3rdparty/walkontable/src/utils/orderView/view.js +76 -79
  26. package/3rdparty/walkontable/src/utils/orderView/view.mjs +74 -78
  27. package/3rdparty/walkontable/src/utils/orderView/viewSize.js +1 -1
  28. package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +1 -1
  29. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +5 -4
  30. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +3 -3
  31. package/base.js +2 -2
  32. package/base.mjs +2 -2
  33. package/dist/handsontable.css +2 -2
  34. package/dist/handsontable.full.css +2 -2
  35. package/dist/handsontable.full.js +1712 -1963
  36. package/dist/handsontable.full.min.css +2 -2
  37. package/dist/handsontable.full.min.js +7 -7
  38. package/dist/handsontable.js +1714 -1965
  39. package/dist/handsontable.min.css +2 -2
  40. package/dist/handsontable.min.js +7 -7
  41. package/helpers/mixed.js +1 -1
  42. package/helpers/mixed.mjs +1 -1
  43. package/package.json +1 -1
  44. package/plugins/filters/filters.js +2 -0
  45. package/plugins/filters/filters.mjs +2 -0
  46. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.js +0 -138
  47. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.mjs +0 -135
  48. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +0 -72
  49. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +0 -68
@@ -7,27 +7,21 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
7
7
  *
8
8
  * @class {NodesPool}
9
9
  */
10
- export class NodesPool {
10
+ export default class NodesPool {
11
11
  constructor(nodeType) {
12
12
  /**
13
- * Node type to generate (e.g. 'TH', 'TD').
13
+ * Node type to generate (ew 'th', 'td').
14
14
  *
15
15
  * @type {string}
16
16
  */
17
17
  _defineProperty(this, "nodeType", void 0);
18
- /**
19
- * The holder for all created DOM nodes (THs, TDs).
20
- *
21
- * @type {Map<string, HTMLElement>}
22
- */
23
- _defineProperty(this, "pool", new Map());
24
18
  this.nodeType = nodeType.toUpperCase();
25
19
  }
26
20
 
27
21
  /**
28
22
  * Set document owner for this instance.
29
23
  *
30
- * @param {Document} rootDocument The document window owner.
24
+ * @param {HTMLDocument} rootDocument The document window owner.
31
25
  */
32
26
  setRootDocument(rootDocument) {
33
27
  this.rootDocument = rootDocument;
@@ -36,20 +30,9 @@ export class NodesPool {
36
30
  /**
37
31
  * Obtains an element. The returned elements in the feature can be cached.
38
32
  *
39
- * @param {number} rowIndex The row index.
40
- * @param {number} [columnIndex] The column index.
41
33
  * @returns {HTMLElement}
42
34
  */
43
- obtain(rowIndex, columnIndex) {
44
- const hasColumnIndex = typeof columnIndex === 'number';
45
- const key = hasColumnIndex ? `${rowIndex}x${columnIndex}` : rowIndex.toString();
46
- if (this.pool.has(key)) {
47
- return this.pool.get(key);
48
- }
49
- const node = this.rootDocument.createElement(this.nodeType);
50
-
51
- // node.dataset.id = key; // Uncomment for debug purposes
52
- this.pool.set(key, node);
53
- return node;
35
+ obtain() {
36
+ return this.rootDocument.createElement(this.nodeType);
54
37
  }
55
38
  }
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- var _view = require("./view");
5
- exports.OrderView = _view.OrderView;
6
- var _sharedView = require("./sharedView");
7
- exports.SharedOrderView = _sharedView.SharedOrderView;
4
+ var _view = _interopRequireDefault(require("./view"));
5
+ exports.OrderView = _view.default;
6
+ var _sharedView = _interopRequireDefault(require("./sharedView"));
7
+ exports.SharedOrderView = _sharedView.default;
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -1,3 +1,3 @@
1
- import { OrderView } from "./view.mjs";
2
- import { SharedOrderView } from "./sharedView.mjs";
1
+ import OrderView from "./view.mjs";
2
+ import SharedOrderView from "./sharedView.mjs";
3
3
  export { OrderView, SharedOrderView };
@@ -1,13 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- var _view = require("./view");
4
+ var _view = _interopRequireDefault(require("./view"));
5
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
5
6
  /**
6
7
  * Executive model for TR root nodes.
7
8
  *
8
9
  * @class {SharedOrderView}
9
10
  */
10
- class SharedOrderView extends _view.OrderView {
11
+ class SharedOrderView extends _view.default {
11
12
  /**
12
13
  * The method results in merging external order view into the current order. This happens only for order views which
13
14
  * operate on the same root node.
@@ -42,4 +43,4 @@ class SharedOrderView extends _view.OrderView {
42
43
  return this;
43
44
  }
44
45
  }
45
- exports.SharedOrderView = SharedOrderView;
46
+ exports.default = SharedOrderView;
@@ -1,10 +1,10 @@
1
- import { OrderView } from "./view.mjs";
1
+ import OrderView from "./view.mjs";
2
2
  /**
3
3
  * Executive model for TR root nodes.
4
4
  *
5
5
  * @class {SharedOrderView}
6
6
  */
7
- export class SharedOrderView extends OrderView {
7
+ export default class SharedOrderView extends OrderView {
8
8
  /**
9
9
  * The method results in merging external order view into the current order. This happens only for order views which
10
10
  * operate on the same root node.
@@ -3,8 +3,9 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
- var _viewSizeSet = require("./viewSizeSet");
7
- var _viewDiffer = require("./viewDiffer");
6
+ var _constants = require("./constants");
7
+ var _viewSizeSet = _interopRequireDefault(require("./viewSizeSet"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
8
9
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
10
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
10
11
  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,7 +18,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
17
18
  * @class {OrderView}
18
19
  */
19
20
  class OrderView {
20
- constructor(rootNode, nodesPool) {
21
+ constructor(rootNode, nodesPool, childNodeType) {
21
22
  /**
22
23
  * The root node to manage with.
23
24
  *
@@ -27,7 +28,7 @@ class OrderView {
27
28
  /**
28
29
  * Factory for newly created DOM elements.
29
30
  *
30
- * @type {function(number): HTMLElement}
31
+ * @type {Function}
31
32
  */
32
33
  _defineProperty(this, "nodesPool", void 0);
33
34
  /**
@@ -35,41 +36,28 @@ class OrderView {
35
36
  *
36
37
  * @type {ViewSizeSet}
37
38
  */
38
- _defineProperty(this, "sizeSet", new _viewSizeSet.ViewSizeSet());
39
+ _defineProperty(this, "sizeSet", new _viewSizeSet.default());
39
40
  /**
40
- * The list of DOM elements which are rendered for this render cycle.
41
+ * Node type which the order view will manage while rendering the DOM elements.
41
42
  *
42
- * @type {HTMLElement[]}
43
+ * @type {string}
43
44
  */
44
- _defineProperty(this, "collectedNodes", []);
45
+ _defineProperty(this, "childNodeType", void 0);
45
46
  /**
46
- * The differ which calculates the differences between current and next view. It generates
47
- * commands that are processed by the OrderView (see `applyCommand` method).
47
+ * The visual index of currently processed row.
48
48
  *
49
- * @type {ViewDiffer}
49
+ * @type {number}
50
50
  */
51
- _defineProperty(this, "viewDiffer", new _viewDiffer.ViewDiffer(this.sizeSet));
51
+ _defineProperty(this, "visualIndex", 0);
52
52
  /**
53
- * @type {number[]}
54
- */
55
- _defineProperty(this, "staleNodeIndexes", []);
56
- /**
57
- * The list of render commands to execute. The command is an array with the following
58
- * structure: [
59
- * [
60
- * 'prepend' | 'append' | 'insert_before' | 'replace' | 'remove', // command name
61
- * 10, // processed node index
62
- * 9, // previous node index (only for 'insert_before' and 'replace' commands)
63
- * 8 // node index to remove (only for 'insert_before' command)
64
- * ],
65
- * ...
66
- * ].
53
+ * The list of DOM elements which are rendered for this render cycle.
67
54
  *
68
- * @type {Array[]}
55
+ * @type {HTMLElement[]}
69
56
  */
70
- _defineProperty(this, "leads", []);
57
+ _defineProperty(this, "collectedNodes", []);
71
58
  this.rootNode = rootNode;
72
59
  this.nodesPool = nodesPool;
60
+ this.childNodeType = childNodeType.toUpperCase();
73
61
  }
74
62
 
75
63
  /**
@@ -96,14 +84,6 @@ class OrderView {
96
84
  return this;
97
85
  }
98
86
 
99
- /**
100
- * @param {number} sourceIndex The source index.
101
- * @returns {boolean}
102
- */
103
- hasStaleContent(sourceIndex) {
104
- return this.staleNodeIndexes.includes(sourceIndex);
105
- }
106
-
107
87
  /**
108
88
  * Checks if this instance of the view shares the root node with another instance. This happens only once when
109
89
  * a row (TR) as a root node is managed by two OrderView instances. If this happens another DOM injection
@@ -136,44 +116,30 @@ class OrderView {
136
116
  }
137
117
 
138
118
  /**
139
- * Applies the commands generated by the differ into the specific DOM operations.
119
+ * Returns rendered child count for this instance.
140
120
  *
141
- * @param {Array} command The command to apply.
121
+ * @returns {number}
142
122
  */
143
- applyCommand(command) {
123
+ getRenderedChildCount() {
144
124
  const {
145
- rootNode
125
+ rootNode,
126
+ sizeSet
146
127
  } = this;
147
- const [name, nodeIndex, nodePrevIndex, nodeIndexToRemove] = command;
148
- const node = this.nodesPool(nodeIndex);
149
- this.collectedNodes.push(node);
150
-
151
- // @TODO(perf-tip): Only nodes which are first time rendered (hasn't any inner content) can be marked as stale
152
- // e.q `name !== 'none' && !node.firstChild`.
153
- if (name !== 'none') {
154
- this.staleNodeIndexes.push(nodeIndex);
155
- }
156
- switch (name) {
157
- case 'prepend':
158
- rootNode.insertBefore(node, rootNode.firstChild);
159
- break;
160
- case 'append':
161
- rootNode.appendChild(node);
162
- break;
163
- case 'insert_before':
164
- rootNode.insertBefore(node, this.nodesPool(nodePrevIndex));
165
- // To keep the constant length of child nodes (after inserting a node) remove the last child.
166
- rootNode.removeChild(this.nodesPool(nodeIndexToRemove));
167
- break;
168
- case 'replace':
169
- rootNode.replaceChild(node, this.nodesPool(nodePrevIndex));
170
- break;
171
- case 'remove':
172
- rootNode.removeChild(node);
173
- break;
174
- default:
175
- break;
128
+ let childElementCount = 0;
129
+ if (this.isSharedViewSet()) {
130
+ let element = rootNode.firstElementChild;
131
+ while (element) {
132
+ if (element.tagName === this.childNodeType) {
133
+ childElementCount += 1;
134
+ } else if (sizeSet.isPlaceOn(_constants.WORKING_SPACE_TOP)) {
135
+ break;
136
+ }
137
+ element = element.nextElementSibling;
138
+ }
139
+ } else {
140
+ childElementCount = rootNode.childElementCount;
176
141
  }
142
+ return childElementCount;
177
143
  }
178
144
 
179
145
  /**
@@ -182,8 +148,30 @@ class OrderView {
182
148
  */
183
149
  start() {
184
150
  this.collectedNodes.length = 0;
185
- this.staleNodeIndexes.length = 0;
186
- this.leads = this.viewDiffer.diff();
151
+ this.visualIndex = 0;
152
+ const {
153
+ rootNode,
154
+ sizeSet
155
+ } = this;
156
+ const isShared = this.isSharedViewSet();
157
+ const {
158
+ nextSize
159
+ } = sizeSet.getViewSize();
160
+ let childElementCount = this.getRenderedChildCount();
161
+ while (childElementCount < nextSize) {
162
+ const newNode = this.nodesPool();
163
+ if (!isShared || isShared && sizeSet.isPlaceOn(_constants.WORKING_SPACE_BOTTOM)) {
164
+ rootNode.appendChild(newNode);
165
+ } else {
166
+ rootNode.insertBefore(newNode, rootNode.firstChild);
167
+ }
168
+ childElementCount += 1;
169
+ }
170
+ const isSharedPlacedOnTop = isShared && sizeSet.isPlaceOn(_constants.WORKING_SPACE_TOP);
171
+ while (childElementCount > nextSize) {
172
+ rootNode.removeChild(isSharedPlacedOnTop ? rootNode.firstChild : rootNode.lastChild);
173
+ childElementCount -= 1;
174
+ }
187
175
  }
188
176
 
189
177
  /**
@@ -191,19 +179,28 @@ class OrderView {
191
179
  * This method has to be called as many times as the size count is met (to cover all previously rendered DOM elements).
192
180
  */
193
181
  render() {
194
- if (this.leads.length > 0) {
195
- this.applyCommand(this.leads.shift());
182
+ const {
183
+ rootNode,
184
+ sizeSet
185
+ } = this;
186
+ let visualIndex = this.visualIndex;
187
+ if (this.isSharedViewSet() && sizeSet.isPlaceOn(_constants.WORKING_SPACE_BOTTOM)) {
188
+ visualIndex += sizeSet.sharedSize.nextSize;
189
+ }
190
+ let node = rootNode.childNodes[visualIndex];
191
+ if (node.tagName !== this.childNodeType) {
192
+ const newNode = this.nodesPool();
193
+ rootNode.replaceChild(newNode, node);
194
+ node = newNode;
196
195
  }
196
+ this.collectedNodes.push(node);
197
+ this.visualIndex += 1;
197
198
  }
198
199
 
199
200
  /**
200
201
  * Ends the render process.
201
202
  * This method has to be called only once (at the end) for the render cycle.
202
203
  */
203
- end() {
204
- while (this.leads.length > 0) {
205
- this.applyCommand(this.leads.shift());
206
- }
207
- }
204
+ end() {}
208
205
  }
209
- exports.OrderView = OrderView;
206
+ exports.default = OrderView;
@@ -3,8 +3,8 @@ import "core-js/modules/es.array.push.js";
3
3
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- import { ViewSizeSet } from "./viewSizeSet.mjs";
7
- import { ViewDiffer } from "./viewDiffer/index.mjs";
6
+ import { WORKING_SPACE_TOP, WORKING_SPACE_BOTTOM } from "./constants.mjs";
7
+ import ViewSizeSet from "./viewSizeSet.mjs";
8
8
  /**
9
9
  * Executive model for each table renderer. It's responsible for injecting DOM nodes in a
10
10
  * specified order and adjusting the number of elements in the root node.
@@ -13,8 +13,8 @@ import { ViewDiffer } from "./viewDiffer/index.mjs";
13
13
  *
14
14
  * @class {OrderView}
15
15
  */
16
- export class OrderView {
17
- constructor(rootNode, nodesPool) {
16
+ export default class OrderView {
17
+ constructor(rootNode, nodesPool, childNodeType) {
18
18
  /**
19
19
  * The root node to manage with.
20
20
  *
@@ -24,7 +24,7 @@ export class OrderView {
24
24
  /**
25
25
  * Factory for newly created DOM elements.
26
26
  *
27
- * @type {function(number): HTMLElement}
27
+ * @type {Function}
28
28
  */
29
29
  _defineProperty(this, "nodesPool", void 0);
30
30
  /**
@@ -34,39 +34,26 @@ export class OrderView {
34
34
  */
35
35
  _defineProperty(this, "sizeSet", new ViewSizeSet());
36
36
  /**
37
- * The list of DOM elements which are rendered for this render cycle.
37
+ * Node type which the order view will manage while rendering the DOM elements.
38
38
  *
39
- * @type {HTMLElement[]}
39
+ * @type {string}
40
40
  */
41
- _defineProperty(this, "collectedNodes", []);
41
+ _defineProperty(this, "childNodeType", void 0);
42
42
  /**
43
- * The differ which calculates the differences between current and next view. It generates
44
- * commands that are processed by the OrderView (see `applyCommand` method).
43
+ * The visual index of currently processed row.
45
44
  *
46
- * @type {ViewDiffer}
45
+ * @type {number}
47
46
  */
48
- _defineProperty(this, "viewDiffer", new ViewDiffer(this.sizeSet));
47
+ _defineProperty(this, "visualIndex", 0);
49
48
  /**
50
- * @type {number[]}
51
- */
52
- _defineProperty(this, "staleNodeIndexes", []);
53
- /**
54
- * The list of render commands to execute. The command is an array with the following
55
- * structure: [
56
- * [
57
- * 'prepend' | 'append' | 'insert_before' | 'replace' | 'remove', // command name
58
- * 10, // processed node index
59
- * 9, // previous node index (only for 'insert_before' and 'replace' commands)
60
- * 8 // node index to remove (only for 'insert_before' command)
61
- * ],
62
- * ...
63
- * ].
49
+ * The list of DOM elements which are rendered for this render cycle.
64
50
  *
65
- * @type {Array[]}
51
+ * @type {HTMLElement[]}
66
52
  */
67
- _defineProperty(this, "leads", []);
53
+ _defineProperty(this, "collectedNodes", []);
68
54
  this.rootNode = rootNode;
69
55
  this.nodesPool = nodesPool;
56
+ this.childNodeType = childNodeType.toUpperCase();
70
57
  }
71
58
 
72
59
  /**
@@ -93,14 +80,6 @@ export class OrderView {
93
80
  return this;
94
81
  }
95
82
 
96
- /**
97
- * @param {number} sourceIndex The source index.
98
- * @returns {boolean}
99
- */
100
- hasStaleContent(sourceIndex) {
101
- return this.staleNodeIndexes.includes(sourceIndex);
102
- }
103
-
104
83
  /**
105
84
  * Checks if this instance of the view shares the root node with another instance. This happens only once when
106
85
  * a row (TR) as a root node is managed by two OrderView instances. If this happens another DOM injection
@@ -133,44 +112,30 @@ export class OrderView {
133
112
  }
134
113
 
135
114
  /**
136
- * Applies the commands generated by the differ into the specific DOM operations.
115
+ * Returns rendered child count for this instance.
137
116
  *
138
- * @param {Array} command The command to apply.
117
+ * @returns {number}
139
118
  */
140
- applyCommand(command) {
119
+ getRenderedChildCount() {
141
120
  const {
142
- rootNode
121
+ rootNode,
122
+ sizeSet
143
123
  } = this;
144
- const [name, nodeIndex, nodePrevIndex, nodeIndexToRemove] = command;
145
- const node = this.nodesPool(nodeIndex);
146
- this.collectedNodes.push(node);
147
-
148
- // @TODO(perf-tip): Only nodes which are first time rendered (hasn't any inner content) can be marked as stale
149
- // e.q `name !== 'none' && !node.firstChild`.
150
- if (name !== 'none') {
151
- this.staleNodeIndexes.push(nodeIndex);
152
- }
153
- switch (name) {
154
- case 'prepend':
155
- rootNode.insertBefore(node, rootNode.firstChild);
156
- break;
157
- case 'append':
158
- rootNode.appendChild(node);
159
- break;
160
- case 'insert_before':
161
- rootNode.insertBefore(node, this.nodesPool(nodePrevIndex));
162
- // To keep the constant length of child nodes (after inserting a node) remove the last child.
163
- rootNode.removeChild(this.nodesPool(nodeIndexToRemove));
164
- break;
165
- case 'replace':
166
- rootNode.replaceChild(node, this.nodesPool(nodePrevIndex));
167
- break;
168
- case 'remove':
169
- rootNode.removeChild(node);
170
- break;
171
- default:
172
- break;
124
+ let childElementCount = 0;
125
+ if (this.isSharedViewSet()) {
126
+ let element = rootNode.firstElementChild;
127
+ while (element) {
128
+ if (element.tagName === this.childNodeType) {
129
+ childElementCount += 1;
130
+ } else if (sizeSet.isPlaceOn(WORKING_SPACE_TOP)) {
131
+ break;
132
+ }
133
+ element = element.nextElementSibling;
134
+ }
135
+ } else {
136
+ childElementCount = rootNode.childElementCount;
173
137
  }
138
+ return childElementCount;
174
139
  }
175
140
 
176
141
  /**
@@ -179,8 +144,30 @@ export class OrderView {
179
144
  */
180
145
  start() {
181
146
  this.collectedNodes.length = 0;
182
- this.staleNodeIndexes.length = 0;
183
- this.leads = this.viewDiffer.diff();
147
+ this.visualIndex = 0;
148
+ const {
149
+ rootNode,
150
+ sizeSet
151
+ } = this;
152
+ const isShared = this.isSharedViewSet();
153
+ const {
154
+ nextSize
155
+ } = sizeSet.getViewSize();
156
+ let childElementCount = this.getRenderedChildCount();
157
+ while (childElementCount < nextSize) {
158
+ const newNode = this.nodesPool();
159
+ if (!isShared || isShared && sizeSet.isPlaceOn(WORKING_SPACE_BOTTOM)) {
160
+ rootNode.appendChild(newNode);
161
+ } else {
162
+ rootNode.insertBefore(newNode, rootNode.firstChild);
163
+ }
164
+ childElementCount += 1;
165
+ }
166
+ const isSharedPlacedOnTop = isShared && sizeSet.isPlaceOn(WORKING_SPACE_TOP);
167
+ while (childElementCount > nextSize) {
168
+ rootNode.removeChild(isSharedPlacedOnTop ? rootNode.firstChild : rootNode.lastChild);
169
+ childElementCount -= 1;
170
+ }
184
171
  }
185
172
 
186
173
  /**
@@ -188,18 +175,27 @@ export class OrderView {
188
175
  * This method has to be called as many times as the size count is met (to cover all previously rendered DOM elements).
189
176
  */
190
177
  render() {
191
- if (this.leads.length > 0) {
192
- this.applyCommand(this.leads.shift());
178
+ const {
179
+ rootNode,
180
+ sizeSet
181
+ } = this;
182
+ let visualIndex = this.visualIndex;
183
+ if (this.isSharedViewSet() && sizeSet.isPlaceOn(WORKING_SPACE_BOTTOM)) {
184
+ visualIndex += sizeSet.sharedSize.nextSize;
185
+ }
186
+ let node = rootNode.childNodes[visualIndex];
187
+ if (node.tagName !== this.childNodeType) {
188
+ const newNode = this.nodesPool();
189
+ rootNode.replaceChild(newNode, node);
190
+ node = newNode;
193
191
  }
192
+ this.collectedNodes.push(node);
193
+ this.visualIndex += 1;
194
194
  }
195
195
 
196
196
  /**
197
197
  * Ends the render process.
198
198
  * This method has to be called only once (at the end) for the render cycle.
199
199
  */
200
- end() {
201
- while (this.leads.length > 0) {
202
- this.applyCommand(this.leads.shift());
203
- }
204
- }
200
+ end() {}
205
201
  }
@@ -57,4 +57,4 @@ class ViewSize {
57
57
  this.nextOffset = offset;
58
58
  }
59
59
  }
60
- exports.ViewSize = ViewSize;
60
+ exports.default = ViewSize;
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
7
7
  *
8
8
  * @class {ViewSize}
9
9
  */
10
- export class ViewSize {
10
+ export default class ViewSize {
11
11
  constructor() {
12
12
  /**
13
13
  * Current size of the rendered DOM elements.
@@ -2,8 +2,9 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
- var _viewSize = require("./viewSize");
5
+ var _viewSize = _interopRequireDefault(require("./viewSize"));
6
6
  var _constants = require("./constants");
7
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
7
8
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
9
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
10
  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); }
@@ -30,7 +31,7 @@ class ViewSizeSet {
30
31
  *
31
32
  * @type {ViewSize}
32
33
  */
33
- _defineProperty(this, "size", new _viewSize.ViewSize());
34
+ _defineProperty(this, "size", new _viewSize.default());
34
35
  /**
35
36
  * Defines if this instance shares its size with another instance. If it's in the shared
36
37
  * mode it defines what space it occupies ('top' or 'bottom').
@@ -80,7 +81,7 @@ class ViewSizeSet {
80
81
  * @returns {boolean}
81
82
  */
82
83
  isShared() {
83
- return this.sharedSize !== null;
84
+ return this.sharedSize instanceof _viewSize.default;
84
85
  }
85
86
 
86
87
  /**
@@ -115,4 +116,4 @@ class ViewSizeSet {
115
116
  this.sharedSize = viewSize.getViewSize();
116
117
  }
117
118
  }
118
- exports.ViewSizeSet = ViewSizeSet;
119
+ exports.default = ViewSizeSet;
@@ -2,7 +2,7 @@ import "core-js/modules/es.error.cause.js";
2
2
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
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
- import { ViewSize } from "./viewSize.mjs";
5
+ import ViewSize from "./viewSize.mjs";
6
6
  import { WORKING_SPACE_ALL, WORKING_SPACE_TOP, WORKING_SPACE_BOTTOM } from "./constants.mjs";
7
7
  /**
8
8
  * The class is a source of the truth of information about the current and
@@ -20,7 +20,7 @@ import { WORKING_SPACE_ALL, WORKING_SPACE_TOP, WORKING_SPACE_BOTTOM } from "./co
20
20
  *
21
21
  * @class {ViewSizeSet}
22
22
  */
23
- export class ViewSizeSet {
23
+ export default class ViewSizeSet {
24
24
  constructor() {
25
25
  /**
26
26
  * Holder for current and next view size and offset.
@@ -77,7 +77,7 @@ export class ViewSizeSet {
77
77
  * @returns {boolean}
78
78
  */
79
79
  isShared() {
80
- return this.sharedSize !== null;
80
+ return this.sharedSize instanceof ViewSize;
81
81
  }
82
82
 
83
83
  /**
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "21/11/2024 21:20:05";
49
- Handsontable.version = "0.0.0-next-a148bc1-20241121";
48
+ Handsontable.buildDate = "22/11/2024 09:39:28";
49
+ Handsontable.version = "0.0.0-next-4ad1863-20241122";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,