handsontable 18.0.0-rc4 → 18.0.0
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/renderer/cells.d.ts +0 -6
- package/3rdparty/walkontable/src/renderer/cells.js +2 -7
- package/3rdparty/walkontable/src/renderer/cells.mjs +2 -7
- package/3rdparty/walkontable/src/renderer/colGroup.js +1 -1
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaderRows.js +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaderRows.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/columnHeaders.d.ts +0 -6
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +2 -7
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -7
- package/3rdparty/walkontable/src/renderer/rowHeaders.d.ts +0 -6
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +5 -10
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +5 -10
- package/3rdparty/walkontable/src/renderer/rows.js +1 -1
- package/3rdparty/walkontable/src/renderer/rows.mjs +1 -1
- package/3rdparty/walkontable/src/utils/nodesPool.d.ts +10 -10
- package/3rdparty/walkontable/src/utils/nodesPool.js +16 -32
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +11 -31
- package/3rdparty/walkontable/src/utils/orderView/constants.d.ts +0 -36
- package/3rdparty/walkontable/src/utils/orderView/constants.js +0 -24
- package/3rdparty/walkontable/src/utils/orderView/constants.mjs +0 -30
- package/3rdparty/walkontable/src/utils/orderView/view.d.ts +27 -20
- package/3rdparty/walkontable/src/utils/orderView/view.js +79 -16
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +86 -17
- package/3rdparty/walkontable/src/utils/orderView/viewSize.d.ts +2 -14
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +2 -14
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +2 -14
- package/CHANGELOG.md +4 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/types.d.ts +4 -0
- package/core.js +25 -4
- package/core.mjs +25 -4
- package/dataMap/metaManager/index.d.ts +22 -0
- package/dataMap/metaManager/index.js +20 -0
- package/dataMap/metaManager/index.mjs +20 -0
- package/dataMap/metaManager/metaLayers/cellMeta.d.ts +30 -0
- package/dataMap/metaManager/metaLayers/cellMeta.js +110 -0
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +111 -1
- package/dataMap/metaManager/metaSchema.js +9 -0
- package/dataMap/metaManager/metaSchema.mjs +9 -0
- package/dataMap/sourceDataValidator.d.ts +25 -2
- package/dataMap/sourceDataValidator.js +163 -29
- package/dataMap/sourceDataValidator.mjs +178 -30
- package/dist/handsontable.full.js +2182 -2392
- package/dist/handsontable.full.min.js +95 -95
- package/dist/handsontable.js +2182 -2387
- package/dist/handsontable.min.js +95 -95
- package/dist/themes/classic.js +2 -2
- package/dist/themes/classic.min.js +2 -2
- package/dist/themes/horizon.js +2 -2
- package/dist/themes/horizon.min.js +2 -2
- package/dist/themes/main.js +2 -2
- package/dist/themes/main.min.js +2 -2
- package/dist/themes/static/variables/colors/ant.js +2 -2
- package/dist/themes/static/variables/colors/ant.min.js +2 -2
- package/dist/themes/static/variables/colors/classic.js +2 -2
- package/dist/themes/static/variables/colors/classic.min.js +2 -2
- package/dist/themes/static/variables/colors/horizon.js +2 -2
- package/dist/themes/static/variables/colors/horizon.min.js +2 -2
- package/dist/themes/static/variables/colors/main.js +2 -2
- package/dist/themes/static/variables/colors/main.min.js +2 -2
- package/dist/themes/static/variables/colors/material.js +2 -2
- package/dist/themes/static/variables/colors/material.min.js +2 -2
- package/dist/themes/static/variables/colors/shadcn.js +2 -2
- package/dist/themes/static/variables/colors/shadcn.min.js +2 -2
- package/dist/themes/static/variables/density.js +2 -2
- package/dist/themes/static/variables/density.min.js +2 -2
- package/dist/themes/static/variables/helpers/iconsMap.js +2 -2
- package/dist/themes/static/variables/helpers/iconsMap.min.js +2 -2
- package/dist/themes/static/variables/icons/horizon.js +2 -2
- package/dist/themes/static/variables/icons/horizon.min.js +2 -2
- package/dist/themes/static/variables/icons/main.js +2 -2
- package/dist/themes/static/variables/icons/main.min.js +2 -2
- package/dist/themes/static/variables/sizing.js +2 -2
- package/dist/themes/static/variables/sizing.min.js +2 -2
- package/dist/themes/static/variables/tokens/classic.js +2 -2
- package/dist/themes/static/variables/tokens/classic.min.js +2 -2
- package/dist/themes/static/variables/tokens/horizon.js +2 -2
- package/dist/themes/static/variables/tokens/horizon.min.js +2 -2
- package/dist/themes/static/variables/tokens/main.js +2 -2
- package/dist/themes/static/variables/tokens/main.min.js +2 -2
- package/helpers/dom/element.js +13 -6
- package/helpers/dom/element.mjs +13 -6
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/package.json +1 -1
- package/styles/handsontable.css +2 -2
- package/styles/handsontable.min.css +2 -2
- package/styles/handsontableStyles.js +1 -1
- package/styles/handsontableStyles.mjs +1 -1
- package/styles/ht-icons-horizon.min.css +2 -2
- package/styles/ht-icons-main.min.css +2 -2
- package/styles/ht-theme-classic-no-icons.min.css +2 -2
- package/styles/ht-theme-classic.min.css +2 -2
- package/styles/ht-theme-horizon-no-icons.min.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main-no-icons.min.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/utils/licenseNotification.js +1 -1
- package/utils/licenseNotification.mjs +1 -1
- package/validators/dateValidator/dateValidator.d.ts +3 -0
- package/validators/dateValidator/dateValidator.js +4 -0
- package/validators/dateValidator/dateValidator.mjs +4 -0
- package/validators/timeValidator/timeValidator.d.ts +3 -0
- package/validators/timeValidator/timeValidator.js +4 -0
- package/validators/timeValidator/timeValidator.mjs +4 -0
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/differBasedRendererAdapter.d.mts +0 -1
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/differBasedRendererAdapter.d.ts +0 -60
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/differBasedRendererAdapter.js +0 -96
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/differBasedRendererAdapter.mjs +0 -91
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/directDomRendererAdapter.d.mts +0 -1
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/directDomRendererAdapter.d.ts +0 -45
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/directDomRendererAdapter.js +0 -97
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/directDomRendererAdapter.mjs +0 -91
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/index.d.mts +0 -1
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/index.d.ts +0 -10
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/index.js +0 -19
- package/3rdparty/walkontable/src/utils/orderView/rendererAdapter/index.mjs +0 -14
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.d.mts +0 -1
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.d.ts +0 -44
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.js +0 -138
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.mjs +0 -133
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.d.mts +0 -1
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.d.ts +0 -57
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +0 -137
- package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +0 -127
|
@@ -20,12 +20,6 @@ export declare class CellsRenderer extends BaseRenderer {
|
|
|
20
20
|
* @type {WeakMap}
|
|
21
21
|
*/
|
|
22
22
|
orderViews: WeakMap<object, SharedOrderView>;
|
|
23
|
-
/**
|
|
24
|
-
* Row index which specifies the row position of the processed cell.
|
|
25
|
-
*
|
|
26
|
-
* @type {number}
|
|
27
|
-
*/
|
|
28
|
-
sourceRowIndex: number;
|
|
29
23
|
/**
|
|
30
24
|
* Creates a new CellsRenderer instance.
|
|
31
25
|
*/
|
|
@@ -20,7 +20,7 @@ class CellsRenderer extends _base.BaseRenderer {
|
|
|
20
20
|
* @returns {SharedOrderView}
|
|
21
21
|
*/ obtainOrderView(rootNode) {
|
|
22
22
|
if (!this.orderViews.has(rootNode)) {
|
|
23
|
-
this.orderViews.set(rootNode, new _orderView.SharedOrderView(rootNode, (
|
|
23
|
+
this.orderViews.set(rootNode, new _orderView.SharedOrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType));
|
|
24
24
|
}
|
|
25
25
|
return this.orderViews.get(rootNode);
|
|
26
26
|
}
|
|
@@ -31,7 +31,6 @@ class CellsRenderer extends _base.BaseRenderer {
|
|
|
31
31
|
for(let visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++){
|
|
32
32
|
const sourceRowIndex = this.table.renderedRowToSource(visibleRowIndex);
|
|
33
33
|
const TR = rows.getRenderedNode(visibleRowIndex);
|
|
34
|
-
this.sourceRowIndex = sourceRowIndex;
|
|
35
34
|
if (!TR) {
|
|
36
35
|
continue; // eslint-disable-line no-continue
|
|
37
36
|
}
|
|
@@ -77,10 +76,6 @@ class CellsRenderer extends _base.BaseRenderer {
|
|
|
77
76
|
* Cache for OrderView classes connected to specified node.
|
|
78
77
|
*
|
|
79
78
|
* @type {WeakMap}
|
|
80
|
-
*/ this.orderViews = new WeakMap()
|
|
81
|
-
* Row index which specifies the row position of the processed cell.
|
|
82
|
-
*
|
|
83
|
-
* @type {number}
|
|
84
|
-
*/ this.sourceRowIndex = 0;
|
|
79
|
+
*/ this.orderViews = new WeakMap();
|
|
85
80
|
}
|
|
86
81
|
}
|
|
@@ -22,7 +22,7 @@ import { A11Y_COLINDEX, A11Y_GRIDCELL, A11Y_TABINDEX } from '../../../../helpers
|
|
|
22
22
|
* @returns {SharedOrderView}
|
|
23
23
|
*/ obtainOrderView(rootNode) {
|
|
24
24
|
if (!this.orderViews.has(rootNode)) {
|
|
25
|
-
this.orderViews.set(rootNode, new SharedOrderView(rootNode, (
|
|
25
|
+
this.orderViews.set(rootNode, new SharedOrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType));
|
|
26
26
|
}
|
|
27
27
|
return this.orderViews.get(rootNode);
|
|
28
28
|
}
|
|
@@ -33,7 +33,6 @@ import { A11Y_COLINDEX, A11Y_GRIDCELL, A11Y_TABINDEX } from '../../../../helpers
|
|
|
33
33
|
for(let visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++){
|
|
34
34
|
const sourceRowIndex = this.table.renderedRowToSource(visibleRowIndex);
|
|
35
35
|
const TR = rows.getRenderedNode(visibleRowIndex);
|
|
36
|
-
this.sourceRowIndex = sourceRowIndex;
|
|
37
36
|
if (!TR) {
|
|
38
37
|
continue; // eslint-disable-line no-continue
|
|
39
38
|
}
|
|
@@ -79,10 +78,6 @@ import { A11Y_COLINDEX, A11Y_GRIDCELL, A11Y_TABINDEX } from '../../../../helpers
|
|
|
79
78
|
* Cache for OrderView classes connected to specified node.
|
|
80
79
|
*
|
|
81
80
|
* @type {WeakMap}
|
|
82
|
-
*/ this.orderViews = new WeakMap()
|
|
83
|
-
* Row index which specifies the row position of the processed cell.
|
|
84
|
-
*
|
|
85
|
-
* @type {number}
|
|
86
|
-
*/ this.sourceRowIndex = 0;
|
|
81
|
+
*/ this.orderViews = new WeakMap();
|
|
87
82
|
}
|
|
88
83
|
}
|
|
@@ -53,6 +53,6 @@ class ColGroupRenderer extends _base.BaseRenderer {
|
|
|
53
53
|
* @param {HTMLElement} rootNode - The root HTML element (colgroup) for rendering COL elements.
|
|
54
54
|
*/ constructor(rootNode){
|
|
55
55
|
super('COL', rootNode);
|
|
56
|
-
this.orderView = new _orderView.OrderView(rootNode, (
|
|
56
|
+
this.orderView = new _orderView.OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -54,6 +54,6 @@ let performanceWarningAppeared = false;
|
|
|
54
54
|
* @param {HTMLElement} rootNode - The root HTML element (colgroup) for rendering COL elements.
|
|
55
55
|
*/ constructor(rootNode){
|
|
56
56
|
super('COL', rootNode);
|
|
57
|
-
this.orderView = new OrderView(rootNode, (
|
|
57
|
+
this.orderView = new OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -49,6 +49,6 @@ class ColumnHeaderRowsRenderer extends _base.BaseRenderer {
|
|
|
49
49
|
* @param {HTMLElement} rootNode - The root HTML element (THEAD) to manage TR elements within.
|
|
50
50
|
*/ constructor(rootNode){
|
|
51
51
|
super('TR', rootNode);
|
|
52
|
-
this.orderView = new _orderView.OrderView(rootNode, (
|
|
52
|
+
this.orderView = new _orderView.OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -50,6 +50,6 @@ import { A11Y_ROW, A11Y_ROWGROUP, A11Y_ROWINDEX } from '../../../../helpers/a11y
|
|
|
50
50
|
* @param {HTMLElement} rootNode - The root HTML element (THEAD) to manage TR elements within.
|
|
51
51
|
*/ constructor(rootNode){
|
|
52
52
|
super('TR', rootNode);
|
|
53
|
-
this.orderView = new OrderView(rootNode, (
|
|
53
|
+
this.orderView = new OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -19,12 +19,6 @@ export declare class ColumnHeadersRenderer extends BaseRenderer {
|
|
|
19
19
|
* @type {WeakMap}
|
|
20
20
|
*/
|
|
21
21
|
orderViews: WeakMap<HTMLElement, OrderView>;
|
|
22
|
-
/**
|
|
23
|
-
* Row index which specifies the row position of the processed column header.
|
|
24
|
-
*
|
|
25
|
-
* @type {number}
|
|
26
|
-
*/
|
|
27
|
-
sourceRowIndex: number;
|
|
28
22
|
/**
|
|
29
23
|
* Creates a new ColumnHeadersRenderer instance.
|
|
30
24
|
*/
|
|
@@ -20,7 +20,7 @@ class ColumnHeadersRenderer extends _base.BaseRenderer {
|
|
|
20
20
|
* @returns {OrderView}
|
|
21
21
|
*/ obtainOrderView(rootNode) {
|
|
22
22
|
if (!this.orderViews.has(rootNode)) {
|
|
23
|
-
this.orderViews.set(rootNode, new _orderView.OrderView(rootNode, (
|
|
23
|
+
this.orderViews.set(rootNode, new _orderView.OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType));
|
|
24
24
|
}
|
|
25
25
|
return this.orderViews.get(rootNode);
|
|
26
26
|
}
|
|
@@ -34,7 +34,6 @@ class ColumnHeadersRenderer extends _base.BaseRenderer {
|
|
|
34
34
|
if (!TR) {
|
|
35
35
|
continue; // eslint-disable-line no-continue
|
|
36
36
|
}
|
|
37
|
-
this.sourceRowIndex = visibleRowIndex;
|
|
38
37
|
const orderView = this.obtainOrderView(TR);
|
|
39
38
|
orderView.setSize(allColumnsToRender).setOffset(0).start();
|
|
40
39
|
for(let visibleColumnIndex = 0; visibleColumnIndex < allColumnsToRender; visibleColumnIndex++){
|
|
@@ -79,10 +78,6 @@ class ColumnHeadersRenderer extends _base.BaseRenderer {
|
|
|
79
78
|
* Cache for OrderView classes connected to specified node.
|
|
80
79
|
*
|
|
81
80
|
* @type {WeakMap}
|
|
82
|
-
*/ this.orderViews = new WeakMap()
|
|
83
|
-
* Row index which specifies the row position of the processed column header.
|
|
84
|
-
*
|
|
85
|
-
* @type {number}
|
|
86
|
-
*/ this.sourceRowIndex = 0;
|
|
81
|
+
*/ this.orderViews = new WeakMap();
|
|
87
82
|
}
|
|
88
83
|
}
|
|
@@ -21,7 +21,7 @@ import { A11Y_COLINDEX, A11Y_COLUMNHEADER, A11Y_GRIDCELL_BUTTON, A11Y_LABEL, A11
|
|
|
21
21
|
* @returns {OrderView}
|
|
22
22
|
*/ obtainOrderView(rootNode) {
|
|
23
23
|
if (!this.orderViews.has(rootNode)) {
|
|
24
|
-
this.orderViews.set(rootNode, new OrderView(rootNode, (
|
|
24
|
+
this.orderViews.set(rootNode, new OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType));
|
|
25
25
|
}
|
|
26
26
|
return this.orderViews.get(rootNode);
|
|
27
27
|
}
|
|
@@ -35,7 +35,6 @@ import { A11Y_COLINDEX, A11Y_COLUMNHEADER, A11Y_GRIDCELL_BUTTON, A11Y_LABEL, A11
|
|
|
35
35
|
if (!TR) {
|
|
36
36
|
continue; // eslint-disable-line no-continue
|
|
37
37
|
}
|
|
38
|
-
this.sourceRowIndex = visibleRowIndex;
|
|
39
38
|
const orderView = this.obtainOrderView(TR);
|
|
40
39
|
orderView.setSize(allColumnsToRender).setOffset(0).start();
|
|
41
40
|
for(let visibleColumnIndex = 0; visibleColumnIndex < allColumnsToRender; visibleColumnIndex++){
|
|
@@ -80,10 +79,6 @@ import { A11Y_COLINDEX, A11Y_COLUMNHEADER, A11Y_GRIDCELL_BUTTON, A11Y_LABEL, A11
|
|
|
80
79
|
* Cache for OrderView classes connected to specified node.
|
|
81
80
|
*
|
|
82
81
|
* @type {WeakMap}
|
|
83
|
-
*/ this.orderViews = new WeakMap()
|
|
84
|
-
* Row index which specifies the row position of the processed column header.
|
|
85
|
-
*
|
|
86
|
-
* @type {number}
|
|
87
|
-
*/ this.sourceRowIndex = 0;
|
|
82
|
+
*/ this.orderViews = new WeakMap();
|
|
88
83
|
}
|
|
89
84
|
}
|
|
@@ -20,12 +20,6 @@ export declare class RowHeadersRenderer extends BaseRenderer {
|
|
|
20
20
|
* @type {WeakMap}
|
|
21
21
|
*/
|
|
22
22
|
orderViews: WeakMap<object, SharedOrderView>;
|
|
23
|
-
/**
|
|
24
|
-
* Row index which specifies the row position of the processed row header.
|
|
25
|
-
*
|
|
26
|
-
* @type {number}
|
|
27
|
-
*/
|
|
28
|
-
sourceRowIndex: number;
|
|
29
23
|
/**
|
|
30
24
|
* Creates a new RowHeadersRenderer instance.
|
|
31
25
|
*/
|
|
@@ -20,7 +20,7 @@ class RowHeadersRenderer extends _base.BaseRenderer {
|
|
|
20
20
|
* @returns {SharedOrderView}
|
|
21
21
|
*/ obtainOrderView(rootNode) {
|
|
22
22
|
if (!this.orderViews.has(rootNode)) {
|
|
23
|
-
this.orderViews.set(rootNode, new _orderView.SharedOrderView(rootNode, (
|
|
23
|
+
this.orderViews.set(rootNode, new _orderView.SharedOrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType));
|
|
24
24
|
}
|
|
25
25
|
return this.orderViews.get(rootNode);
|
|
26
26
|
}
|
|
@@ -34,13 +34,12 @@ class RowHeadersRenderer extends _base.BaseRenderer {
|
|
|
34
34
|
if (!TR) {
|
|
35
35
|
continue; // eslint-disable-line no-continue
|
|
36
36
|
}
|
|
37
|
-
this.sourceRowIndex = sourceRowIndex;
|
|
38
37
|
const orderView = this.obtainOrderView(TR);
|
|
39
38
|
const cellsView = cells.obtainOrderView(TR);
|
|
40
39
|
orderView.appendView(cellsView).setSize(rowHeadersCount).setOffset(0).start();
|
|
41
|
-
//
|
|
42
|
-
// (
|
|
43
|
-
for(let visibleColumnIndex =
|
|
40
|
+
// Render the row header levels in order: the renderer fills the row header nodes positionally
|
|
41
|
+
// (childNodes[0], [1], …), so level 0 must be written first to land in the leftmost position.
|
|
42
|
+
for(let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++){
|
|
44
43
|
orderView.render();
|
|
45
44
|
const TH = orderView.getCurrentNode();
|
|
46
45
|
if (!TH) {
|
|
@@ -73,10 +72,6 @@ class RowHeadersRenderer extends _base.BaseRenderer {
|
|
|
73
72
|
* Cache for OrderView classes connected to specified node.
|
|
74
73
|
*
|
|
75
74
|
* @type {WeakMap}
|
|
76
|
-
*/ this.orderViews = new WeakMap()
|
|
77
|
-
* Row index which specifies the row position of the processed row header.
|
|
78
|
-
*
|
|
79
|
-
* @type {number}
|
|
80
|
-
*/ this.sourceRowIndex = 0;
|
|
75
|
+
*/ this.orderViews = new WeakMap();
|
|
81
76
|
}
|
|
82
77
|
}
|
|
@@ -22,7 +22,7 @@ import { A11Y_COLINDEX, A11Y_ROWHEADER, A11Y_SCOPE_ROW, A11Y_TABINDEX } from '..
|
|
|
22
22
|
* @returns {SharedOrderView}
|
|
23
23
|
*/ obtainOrderView(rootNode) {
|
|
24
24
|
if (!this.orderViews.has(rootNode)) {
|
|
25
|
-
this.orderViews.set(rootNode, new SharedOrderView(rootNode, (
|
|
25
|
+
this.orderViews.set(rootNode, new SharedOrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType));
|
|
26
26
|
}
|
|
27
27
|
return this.orderViews.get(rootNode);
|
|
28
28
|
}
|
|
@@ -36,13 +36,12 @@ import { A11Y_COLINDEX, A11Y_ROWHEADER, A11Y_SCOPE_ROW, A11Y_TABINDEX } from '..
|
|
|
36
36
|
if (!TR) {
|
|
37
37
|
continue; // eslint-disable-line no-continue
|
|
38
38
|
}
|
|
39
|
-
this.sourceRowIndex = sourceRowIndex;
|
|
40
39
|
const orderView = this.obtainOrderView(TR);
|
|
41
40
|
const cellsView = cells.obtainOrderView(TR);
|
|
42
41
|
orderView.appendView(cellsView).setSize(rowHeadersCount).setOffset(0).start();
|
|
43
|
-
//
|
|
44
|
-
// (
|
|
45
|
-
for(let visibleColumnIndex =
|
|
42
|
+
// Render the row header levels in order: the renderer fills the row header nodes positionally
|
|
43
|
+
// (childNodes[0], [1], …), so level 0 must be written first to land in the leftmost position.
|
|
44
|
+
for(let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++){
|
|
46
45
|
orderView.render();
|
|
47
46
|
const TH = orderView.getCurrentNode();
|
|
48
47
|
if (!TH) {
|
|
@@ -75,10 +74,6 @@ import { A11Y_COLINDEX, A11Y_ROWHEADER, A11Y_SCOPE_ROW, A11Y_TABINDEX } from '..
|
|
|
75
74
|
* Cache for OrderView classes connected to specified node.
|
|
76
75
|
*
|
|
77
76
|
* @type {WeakMap}
|
|
78
|
-
*/ this.orderViews = new WeakMap()
|
|
79
|
-
* Row index which specifies the row position of the processed row header.
|
|
80
|
-
*
|
|
81
|
-
* @type {number}
|
|
82
|
-
*/ this.sourceRowIndex = 0;
|
|
77
|
+
*/ this.orderViews = new WeakMap();
|
|
83
78
|
}
|
|
84
79
|
}
|
|
@@ -76,6 +76,6 @@ class RowsRenderer extends _base.BaseRenderer {
|
|
|
76
76
|
* @param {HTMLElement} rootNode - The root node (TBODY element) for managing TR elements.
|
|
77
77
|
*/ constructor(rootNode){
|
|
78
78
|
super('TR', rootNode);
|
|
79
|
-
this.orderView = new _orderView.OrderView(rootNode, (
|
|
79
|
+
this.orderView = new _orderView.OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -77,6 +77,6 @@ let performanceWarningAppeared = false;
|
|
|
77
77
|
* @param {HTMLElement} rootNode - The root node (TBODY element) for managing TR elements.
|
|
78
78
|
*/ constructor(rootNode){
|
|
79
79
|
super('TR', rootNode);
|
|
80
|
-
this.orderView = new OrderView(rootNode, (
|
|
80
|
+
this.orderView = new OrderView(rootNode, ()=>this.nodesPool.obtain(), this.nodeType);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Factory for newly created DOM elements.
|
|
3
3
|
*
|
|
4
|
+
* Historically this class cached nodes keyed by source coordinate so the diffing renderer could
|
|
5
|
+
* reuse them. The engine now renders directly to a fixed, viewport-sized set of DOM nodes
|
|
6
|
+
* (see OrderView), so no cache is needed — `obtain()` simply creates a fresh element. The class is
|
|
7
|
+
* kept as a thin factory for backward compatibility with the Walkontable export surface.
|
|
8
|
+
*
|
|
4
9
|
* @class {NodesPool}
|
|
5
10
|
*/
|
|
6
11
|
export declare class NodesPool {
|
|
@@ -16,12 +21,6 @@ export declare class NodesPool {
|
|
|
16
21
|
* @type {Document}
|
|
17
22
|
*/
|
|
18
23
|
rootDocument: Document;
|
|
19
|
-
/**
|
|
20
|
-
* The holder for all created DOM nodes (THs, TDs).
|
|
21
|
-
*
|
|
22
|
-
* @type {Map<number, HTMLElement>}
|
|
23
|
-
*/
|
|
24
|
-
pool: Map<number, HTMLElement>;
|
|
25
24
|
/**
|
|
26
25
|
* Creates a new NodesPool instance.
|
|
27
26
|
*
|
|
@@ -35,11 +34,12 @@ export declare class NodesPool {
|
|
|
35
34
|
*/
|
|
36
35
|
setRootDocument(rootDocument: Document): void;
|
|
37
36
|
/**
|
|
38
|
-
*
|
|
37
|
+
* Creates and returns a new DOM element of the configured node type. The row/column arguments are
|
|
38
|
+
* accepted for backward compatibility with the renderer factories and are ignored.
|
|
39
39
|
*
|
|
40
|
-
* @param {number}
|
|
41
|
-
* @param {number} [
|
|
40
|
+
* @param {number} [_rowIndex] Ignored. Kept for call-site compatibility.
|
|
41
|
+
* @param {number} [_columnIndex] Ignored. Kept for call-site compatibility.
|
|
42
42
|
* @returns {HTMLElement}
|
|
43
43
|
*/
|
|
44
|
-
obtain(
|
|
44
|
+
obtain(_rowIndex?: number, _columnIndex?: number): HTMLElement;
|
|
45
45
|
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Factory for newly created DOM elements.
|
|
3
|
+
*
|
|
4
|
+
* Historically this class cached nodes keyed by source coordinate so the diffing renderer could
|
|
5
|
+
* reuse them. The engine now renders directly to a fixed, viewport-sized set of DOM nodes
|
|
6
|
+
* (see OrderView), so no cache is needed — `obtain()` simply creates a fresh element. The class is
|
|
7
|
+
* kept as a thin factory for backward compatibility with the Walkontable export surface.
|
|
8
|
+
*
|
|
9
|
+
* @class {NodesPool}
|
|
10
|
+
*/ "use strict";
|
|
2
11
|
Object.defineProperty(exports, "__esModule", {
|
|
3
12
|
value: true
|
|
4
13
|
});
|
|
@@ -8,14 +17,6 @@ Object.defineProperty(exports, "NodesPool", {
|
|
|
8
17
|
return NodesPool;
|
|
9
18
|
}
|
|
10
19
|
});
|
|
11
|
-
const _browser = require("../../../../helpers/browser");
|
|
12
|
-
/**
|
|
13
|
-
* Multiplier used to pack (row, column) into a single numeric Map key.
|
|
14
|
-
* 2^20 (1 048 576) supports up to ~1M columns while keeping the combined
|
|
15
|
-
* value well within the 2^53 safe-integer range for any realistic row count.
|
|
16
|
-
*
|
|
17
|
-
* @type {number}
|
|
18
|
-
*/ const COLUMN_OFFSET = 1048576;
|
|
19
20
|
class NodesPool {
|
|
20
21
|
/**
|
|
21
22
|
* Set document owner for this instance.
|
|
@@ -25,37 +26,20 @@ class NodesPool {
|
|
|
25
26
|
this.rootDocument = rootDocument;
|
|
26
27
|
}
|
|
27
28
|
/**
|
|
28
|
-
*
|
|
29
|
+
* Creates and returns a new DOM element of the configured node type. The row/column arguments are
|
|
30
|
+
* accepted for backward compatibility with the renderer factories and are ignored.
|
|
29
31
|
*
|
|
30
|
-
* @param {number}
|
|
31
|
-
* @param {number} [
|
|
32
|
+
* @param {number} [_rowIndex] Ignored. Kept for call-site compatibility.
|
|
33
|
+
* @param {number} [_columnIndex] Ignored. Kept for call-site compatibility.
|
|
32
34
|
* @returns {HTMLElement}
|
|
33
|
-
*/ obtain(
|
|
34
|
-
|
|
35
|
-
// rendering issues. This bypasses the pooling mechanism and is consistent with the
|
|
36
|
-
// Direct DOM renderer adapter used in OrderView.
|
|
37
|
-
if ((0, _browser.isFirefox)()) {
|
|
38
|
-
return this.rootDocument.createElement(this.nodeType);
|
|
39
|
-
}
|
|
40
|
-
const key = typeof columnIndex === 'number' ? rowIndex * COLUMN_OFFSET + columnIndex : rowIndex;
|
|
41
|
-
let node = this.pool.get(key);
|
|
42
|
-
if (node !== undefined) {
|
|
43
|
-
return node;
|
|
44
|
-
}
|
|
45
|
-
node = this.rootDocument.createElement(this.nodeType);
|
|
46
|
-
this.pool.set(key, node);
|
|
47
|
-
return node;
|
|
35
|
+
*/ obtain(_rowIndex, _columnIndex) {
|
|
36
|
+
return this.rootDocument.createElement(this.nodeType);
|
|
48
37
|
}
|
|
49
38
|
/**
|
|
50
39
|
* Creates a new NodesPool instance.
|
|
51
40
|
*
|
|
52
41
|
* @param {string} nodeType The type of DOM node to generate (e.g. 'TH', 'TD').
|
|
53
42
|
*/ constructor(nodeType){
|
|
54
|
-
/**
|
|
55
|
-
* The holder for all created DOM nodes (THs, TDs).
|
|
56
|
-
*
|
|
57
|
-
* @type {Map<number, HTMLElement>}
|
|
58
|
-
*/ this.pool = new Map();
|
|
59
43
|
this.nodeType = nodeType.toUpperCase();
|
|
60
44
|
}
|
|
61
45
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import { isFirefox } from '../../../../helpers/browser.mjs';
|
|
2
|
-
/**
|
|
3
|
-
* Multiplier used to pack (row, column) into a single numeric Map key.
|
|
4
|
-
* 2^20 (1 048 576) supports up to ~1M columns while keeping the combined
|
|
5
|
-
* value well within the 2^53 safe-integer range for any realistic row count.
|
|
6
|
-
*
|
|
7
|
-
* @type {number}
|
|
8
|
-
*/ const COLUMN_OFFSET = 1048576;
|
|
9
1
|
/**
|
|
10
2
|
* Factory for newly created DOM elements.
|
|
11
3
|
*
|
|
4
|
+
* Historically this class cached nodes keyed by source coordinate so the diffing renderer could
|
|
5
|
+
* reuse them. The engine now renders directly to a fixed, viewport-sized set of DOM nodes
|
|
6
|
+
* (see OrderView), so no cache is needed — `obtain()` simply creates a fresh element. The class is
|
|
7
|
+
* kept as a thin factory for backward compatibility with the Walkontable export surface.
|
|
8
|
+
*
|
|
12
9
|
* @class {NodesPool}
|
|
13
10
|
*/ export class NodesPool {
|
|
14
11
|
/**
|
|
@@ -19,37 +16,20 @@ import { isFirefox } from '../../../../helpers/browser.mjs';
|
|
|
19
16
|
this.rootDocument = rootDocument;
|
|
20
17
|
}
|
|
21
18
|
/**
|
|
22
|
-
*
|
|
19
|
+
* Creates and returns a new DOM element of the configured node type. The row/column arguments are
|
|
20
|
+
* accepted for backward compatibility with the renderer factories and are ignored.
|
|
23
21
|
*
|
|
24
|
-
* @param {number}
|
|
25
|
-
* @param {number} [
|
|
22
|
+
* @param {number} [_rowIndex] Ignored. Kept for call-site compatibility.
|
|
23
|
+
* @param {number} [_columnIndex] Ignored. Kept for call-site compatibility.
|
|
26
24
|
* @returns {HTMLElement}
|
|
27
|
-
*/ obtain(
|
|
28
|
-
|
|
29
|
-
// rendering issues. This bypasses the pooling mechanism and is consistent with the
|
|
30
|
-
// Direct DOM renderer adapter used in OrderView.
|
|
31
|
-
if (isFirefox()) {
|
|
32
|
-
return this.rootDocument.createElement(this.nodeType);
|
|
33
|
-
}
|
|
34
|
-
const key = typeof columnIndex === 'number' ? rowIndex * COLUMN_OFFSET + columnIndex : rowIndex;
|
|
35
|
-
let node = this.pool.get(key);
|
|
36
|
-
if (node !== undefined) {
|
|
37
|
-
return node;
|
|
38
|
-
}
|
|
39
|
-
node = this.rootDocument.createElement(this.nodeType);
|
|
40
|
-
this.pool.set(key, node);
|
|
41
|
-
return node;
|
|
25
|
+
*/ obtain(_rowIndex, _columnIndex) {
|
|
26
|
+
return this.rootDocument.createElement(this.nodeType);
|
|
42
27
|
}
|
|
43
28
|
/**
|
|
44
29
|
* Creates a new NodesPool instance.
|
|
45
30
|
*
|
|
46
31
|
* @param {string} nodeType The type of DOM node to generate (e.g. 'TH', 'TD').
|
|
47
32
|
*/ constructor(nodeType){
|
|
48
|
-
/**
|
|
49
|
-
* The holder for all created DOM nodes (THs, TDs).
|
|
50
|
-
*
|
|
51
|
-
* @type {Map<number, HTMLElement>}
|
|
52
|
-
*/ this.pool = new Map();
|
|
53
33
|
this.nodeType = nodeType.toUpperCase();
|
|
54
34
|
}
|
|
55
35
|
}
|
|
@@ -21,39 +21,3 @@ export declare const WORKING_SPACE_TOP = 1;
|
|
|
21
21
|
* @type {number}
|
|
22
22
|
*/
|
|
23
23
|
export declare const WORKING_SPACE_BOTTOM = 2;
|
|
24
|
-
/**
|
|
25
|
-
* Command type: no action needed, element is already in correct position.
|
|
26
|
-
*
|
|
27
|
-
* @type {number}
|
|
28
|
-
*/
|
|
29
|
-
export declare const CMD_NONE = 0;
|
|
30
|
-
/**
|
|
31
|
-
* Command type: remove the element from the root node.
|
|
32
|
-
*
|
|
33
|
-
* @type {number}
|
|
34
|
-
*/
|
|
35
|
-
export declare const CMD_REMOVE = 1;
|
|
36
|
-
/**
|
|
37
|
-
* Command type: append the element at the end of the root node.
|
|
38
|
-
*
|
|
39
|
-
* @type {number}
|
|
40
|
-
*/
|
|
41
|
-
export declare const CMD_APPEND = 2;
|
|
42
|
-
/**
|
|
43
|
-
* Command type: prepend the element at the beginning of the root node.
|
|
44
|
-
*
|
|
45
|
-
* @type {number}
|
|
46
|
-
*/
|
|
47
|
-
export declare const CMD_PREPEND = 3;
|
|
48
|
-
/**
|
|
49
|
-
* Command type: insert the element before another element in the root node.
|
|
50
|
-
*
|
|
51
|
-
* @type {number}
|
|
52
|
-
*/
|
|
53
|
-
export declare const CMD_INSERT_BEFORE = 4;
|
|
54
|
-
/**
|
|
55
|
-
* Command type: replace an existing element with a new one in the root node.
|
|
56
|
-
*
|
|
57
|
-
* @type {number}
|
|
58
|
-
*/
|
|
59
|
-
export declare const CMD_REPLACE = 5;
|
|
@@ -14,24 +14,6 @@ function _export(target, all) {
|
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
_export(exports, {
|
|
17
|
-
get CMD_APPEND () {
|
|
18
|
-
return CMD_APPEND;
|
|
19
|
-
},
|
|
20
|
-
get CMD_INSERT_BEFORE () {
|
|
21
|
-
return CMD_INSERT_BEFORE;
|
|
22
|
-
},
|
|
23
|
-
get CMD_NONE () {
|
|
24
|
-
return CMD_NONE;
|
|
25
|
-
},
|
|
26
|
-
get CMD_PREPEND () {
|
|
27
|
-
return CMD_PREPEND;
|
|
28
|
-
},
|
|
29
|
-
get CMD_REMOVE () {
|
|
30
|
-
return CMD_REMOVE;
|
|
31
|
-
},
|
|
32
|
-
get CMD_REPLACE () {
|
|
33
|
-
return CMD_REPLACE;
|
|
34
|
-
},
|
|
35
17
|
get WORKING_SPACE_ALL () {
|
|
36
18
|
return WORKING_SPACE_ALL;
|
|
37
19
|
},
|
|
@@ -45,9 +27,3 @@ _export(exports, {
|
|
|
45
27
|
const WORKING_SPACE_ALL = 0;
|
|
46
28
|
const WORKING_SPACE_TOP = 1;
|
|
47
29
|
const WORKING_SPACE_BOTTOM = 2;
|
|
48
|
-
const CMD_NONE = 0;
|
|
49
|
-
const CMD_REMOVE = 1;
|
|
50
|
-
const CMD_APPEND = 2;
|
|
51
|
-
const CMD_PREPEND = 3;
|
|
52
|
-
const CMD_INSERT_BEFORE = 4;
|
|
53
|
-
const CMD_REPLACE = 5;
|
|
@@ -18,33 +18,3 @@
|
|
|
18
18
|
*
|
|
19
19
|
* @type {number}
|
|
20
20
|
*/ export const WORKING_SPACE_BOTTOM = 2;
|
|
21
|
-
/**
|
|
22
|
-
* Command type: no action needed, element is already in correct position.
|
|
23
|
-
*
|
|
24
|
-
* @type {number}
|
|
25
|
-
*/ export const CMD_NONE = 0;
|
|
26
|
-
/**
|
|
27
|
-
* Command type: remove the element from the root node.
|
|
28
|
-
*
|
|
29
|
-
* @type {number}
|
|
30
|
-
*/ export const CMD_REMOVE = 1;
|
|
31
|
-
/**
|
|
32
|
-
* Command type: append the element at the end of the root node.
|
|
33
|
-
*
|
|
34
|
-
* @type {number}
|
|
35
|
-
*/ export const CMD_APPEND = 2;
|
|
36
|
-
/**
|
|
37
|
-
* Command type: prepend the element at the beginning of the root node.
|
|
38
|
-
*
|
|
39
|
-
* @type {number}
|
|
40
|
-
*/ export const CMD_PREPEND = 3;
|
|
41
|
-
/**
|
|
42
|
-
* Command type: insert the element before another element in the root node.
|
|
43
|
-
*
|
|
44
|
-
* @type {number}
|
|
45
|
-
*/ export const CMD_INSERT_BEFORE = 4;
|
|
46
|
-
/**
|
|
47
|
-
* Command type: replace an existing element with a new one in the root node.
|
|
48
|
-
*
|
|
49
|
-
* @type {number}
|
|
50
|
-
*/ export const CMD_REPLACE = 5;
|