handsontable 0.0.0-next-0d98d67-20250210 → 0.0.0-next-508ffe1-20250211

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.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (47) hide show
  1. package/3rdparty/walkontable/src/calculator/viewportColumns.js +5 -1
  2. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +5 -1
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +5 -1
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +5 -1
  5. package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -1
  6. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +8 -1
  7. package/3rdparty/walkontable/src/overlay/top.js +9 -1
  8. package/3rdparty/walkontable/src/overlay/top.mjs +9 -1
  9. package/3rdparty/walkontable/src/renderer/cells.js +1 -4
  10. package/3rdparty/walkontable/src/renderer/cells.mjs +1 -4
  11. package/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -4
  12. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +1 -4
  13. package/3rdparty/walkontable/src/renderer/rowHeaders.js +0 -3
  14. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +0 -3
  15. package/3rdparty/walkontable/src/table.js +146 -5
  16. package/3rdparty/walkontable/src/table.mjs +146 -5
  17. package/3rdparty/walkontable/src/utils/column.js +25 -4
  18. package/3rdparty/walkontable/src/utils/column.mjs +25 -4
  19. package/3rdparty/walkontable/src/utils/row.js +12 -2
  20. package/3rdparty/walkontable/src/utils/row.mjs +12 -2
  21. package/3rdparty/walkontable/src/viewport.js +36 -2
  22. package/3rdparty/walkontable/src/viewport.mjs +36 -2
  23. package/base.js +2 -2
  24. package/base.mjs +2 -2
  25. package/core.js +54 -4
  26. package/core.mjs +54 -4
  27. package/dist/handsontable.css +2 -2
  28. package/dist/handsontable.full.css +2 -2
  29. package/dist/handsontable.full.js +333 -56
  30. package/dist/handsontable.full.min.css +2 -2
  31. package/dist/handsontable.full.min.js +9 -9
  32. package/dist/handsontable.js +322 -51
  33. package/dist/handsontable.min.css +2 -2
  34. package/dist/handsontable.min.js +15 -15
  35. package/helpers/mixed.js +1 -1
  36. package/helpers/mixed.mjs +1 -1
  37. package/package.json +1 -1
  38. package/plugins/copyPaste/copyPaste.js +12 -6
  39. package/plugins/copyPaste/copyPaste.mjs +12 -6
  40. package/renderers/textRenderer/textRenderer.js +3 -8
  41. package/renderers/textRenderer/textRenderer.mjs +3 -8
  42. package/styles/handsontable.css +2 -2
  43. package/styles/handsontable.min.css +2 -2
  44. package/styles/ht-theme-horizon.css +2 -2
  45. package/styles/ht-theme-horizon.min.css +2 -2
  46. package/styles/ht-theme-main.css +2 -2
  47. package/styles/ht-theme-main.min.css +2 -2
@@ -36,7 +36,8 @@ export default class ColumnUtils {
36
36
  * @returns {number}
37
37
  */
38
38
  getWidth(sourceIndex) {
39
- return this.wtSettings.getSetting('columnWidth', sourceIndex);
39
+ const width = this.wtSettings.getSetting('columnWidth', sourceIndex) || this.wtSettings.getSetting('defaultColumnWidth');
40
+ return width;
40
41
  }
41
42
 
42
43
  /**
@@ -46,7 +47,12 @@ export default class ColumnUtils {
46
47
  * @returns {number}
47
48
  */
48
49
  getHeaderHeight(level) {
49
- return this.dataAccessObject.stylesHandler.getDefaultRowHeight();
50
+ let height = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
51
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedColumnHeaders[level];
52
+ if (oversizedHeight !== undefined) {
53
+ height = height ? Math.max(height, oversizedHeight) : oversizedHeight;
54
+ }
55
+ return height;
50
56
  }
51
57
 
52
58
  /**
@@ -56,11 +62,26 @@ export default class ColumnUtils {
56
62
  * @returns {number}
57
63
  */
58
64
  getHeaderWidth(sourceIndex) {
59
- return 50;
65
+ return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(sourceIndex));
60
66
  }
61
67
 
62
68
  /**
63
69
  * Calculates column header widths that can be retrieved from the cache.
64
70
  */
65
- calculateWidths() {}
71
+ calculateWidths() {
72
+ const {
73
+ wtSettings
74
+ } = this;
75
+ let rowHeaderWidthSetting = wtSettings.getSetting('rowHeaderWidth');
76
+ rowHeaderWidthSetting = wtSettings.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
77
+ if (rowHeaderWidthSetting !== null && rowHeaderWidthSetting !== undefined) {
78
+ const rowHeadersCount = wtSettings.getSetting('rowHeaders').length;
79
+ const defaultColumnWidth = wtSettings.getSetting('defaultColumnWidth');
80
+ for (let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {
81
+ let width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[visibleColumnIndex] : rowHeaderWidthSetting;
82
+ width = width === null || width === undefined ? defaultColumnWidth : width;
83
+ this.headerWidths.set(visibleColumnIndex, width);
84
+ }
85
+ }
86
+ }
66
87
  }
@@ -35,7 +35,12 @@ class RowUtils {
35
35
  * @returns {number}
36
36
  */
37
37
  getHeight(sourceIndex) {
38
- return this.wtSettings.getSetting('rowHeight', sourceIndex);
38
+ let height = this.wtSettings.getSetting('rowHeight', sourceIndex);
39
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
40
+ if (oversizedHeight !== undefined) {
41
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
42
+ }
43
+ return height;
39
44
  }
40
45
 
41
46
  /**
@@ -46,7 +51,12 @@ class RowUtils {
46
51
  * @returns {number}
47
52
  */
48
53
  getHeightByOverlayName(sourceIndex, overlayName) {
49
- return this.wtSettings.getSetting('rowHeight', sourceIndex);
54
+ let height = this.wtSettings.getSetting('rowHeightByOverlayName', sourceIndex, overlayName);
55
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
56
+ if (oversizedHeight !== undefined) {
57
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
58
+ }
59
+ return height;
50
60
  }
51
61
  }
52
62
  exports.default = RowUtils;
@@ -32,7 +32,12 @@ export default class RowUtils {
32
32
  * @returns {number}
33
33
  */
34
34
  getHeight(sourceIndex) {
35
- return this.wtSettings.getSetting('rowHeight', sourceIndex);
35
+ let height = this.wtSettings.getSetting('rowHeight', sourceIndex);
36
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
37
+ if (oversizedHeight !== undefined) {
38
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
39
+ }
40
+ return height;
36
41
  }
37
42
 
38
43
  /**
@@ -43,6 +48,11 @@ export default class RowUtils {
43
48
  * @returns {number}
44
49
  */
45
50
  getHeightByOverlayName(sourceIndex, overlayName) {
46
- return this.wtSettings.getSetting('rowHeight', sourceIndex);
51
+ let height = this.wtSettings.getSetting('rowHeightByOverlayName', sourceIndex, overlayName);
52
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
53
+ if (oversizedHeight !== undefined) {
54
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
55
+ }
56
+ return height;
47
57
  }
48
58
  }
@@ -24,6 +24,7 @@ class Viewport {
24
24
  this.domBindings = domBindings;
25
25
  this.wtSettings = wtSettings;
26
26
  this.wtTable = wtTable;
27
+ this.oversizedRows = [];
27
28
  this.oversizedColumnHeaders = [];
28
29
  this.hasOversizedColumnHeadersMarked = {};
29
30
  this.clientHeight = 0;
@@ -178,14 +179,47 @@ class Viewport {
178
179
  * @returns {number}
179
180
  */
180
181
  getColumnHeaderHeight() {
181
- return 59;
182
+ const columnHeaders = this.wtSettings.getSetting('columnHeaders');
183
+ if (!columnHeaders.length) {
184
+ this.columnHeaderHeight = 0;
185
+ } else if (isNaN(this.columnHeaderHeight)) {
186
+ this.columnHeaderHeight = (0, _element.outerHeight)(this.wtTable.THEAD);
187
+ }
188
+ return this.columnHeaderHeight;
182
189
  }
183
190
 
184
191
  /**
185
192
  * @returns {number}
186
193
  */
187
194
  getRowHeaderWidth() {
188
- return 50;
195
+ const rowHeadersWidthSetting = this.wtSettings.getSetting('rowHeaderWidth');
196
+ const rowHeaders = this.wtSettings.getSetting('rowHeaders');
197
+ if (rowHeadersWidthSetting) {
198
+ this.rowHeaderWidth = 0;
199
+ for (let i = 0, len = rowHeaders.length; i < len; i++) {
200
+ this.rowHeaderWidth += rowHeadersWidthSetting[i] || rowHeadersWidthSetting;
201
+ }
202
+ }
203
+ if (isNaN(this.rowHeaderWidth)) {
204
+ if (rowHeaders.length) {
205
+ let TH = this.wtTable.TABLE.querySelector('TH');
206
+ this.rowHeaderWidth = 0;
207
+ for (let i = 0, len = rowHeaders.length; i < len; i++) {
208
+ if (TH) {
209
+ this.rowHeaderWidth += (0, _element.outerWidth)(TH);
210
+ TH = TH.nextSibling;
211
+ } else {
212
+ // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.
213
+ // TODO: proper fix
214
+ this.rowHeaderWidth += 50;
215
+ }
216
+ }
217
+ } else {
218
+ this.rowHeaderWidth = 0;
219
+ }
220
+ }
221
+ this.rowHeaderWidth = this.wtSettings.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;
222
+ return this.rowHeaderWidth;
189
223
  }
190
224
 
191
225
  /**
@@ -21,6 +21,7 @@ class Viewport {
21
21
  this.domBindings = domBindings;
22
22
  this.wtSettings = wtSettings;
23
23
  this.wtTable = wtTable;
24
+ this.oversizedRows = [];
24
25
  this.oversizedColumnHeaders = [];
25
26
  this.hasOversizedColumnHeadersMarked = {};
26
27
  this.clientHeight = 0;
@@ -175,14 +176,47 @@ class Viewport {
175
176
  * @returns {number}
176
177
  */
177
178
  getColumnHeaderHeight() {
178
- return 59;
179
+ const columnHeaders = this.wtSettings.getSetting('columnHeaders');
180
+ if (!columnHeaders.length) {
181
+ this.columnHeaderHeight = 0;
182
+ } else if (isNaN(this.columnHeaderHeight)) {
183
+ this.columnHeaderHeight = outerHeight(this.wtTable.THEAD);
184
+ }
185
+ return this.columnHeaderHeight;
179
186
  }
180
187
 
181
188
  /**
182
189
  * @returns {number}
183
190
  */
184
191
  getRowHeaderWidth() {
185
- return 50;
192
+ const rowHeadersWidthSetting = this.wtSettings.getSetting('rowHeaderWidth');
193
+ const rowHeaders = this.wtSettings.getSetting('rowHeaders');
194
+ if (rowHeadersWidthSetting) {
195
+ this.rowHeaderWidth = 0;
196
+ for (let i = 0, len = rowHeaders.length; i < len; i++) {
197
+ this.rowHeaderWidth += rowHeadersWidthSetting[i] || rowHeadersWidthSetting;
198
+ }
199
+ }
200
+ if (isNaN(this.rowHeaderWidth)) {
201
+ if (rowHeaders.length) {
202
+ let TH = this.wtTable.TABLE.querySelector('TH');
203
+ this.rowHeaderWidth = 0;
204
+ for (let i = 0, len = rowHeaders.length; i < len; i++) {
205
+ if (TH) {
206
+ this.rowHeaderWidth += outerWidth(TH);
207
+ TH = TH.nextSibling;
208
+ } else {
209
+ // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.
210
+ // TODO: proper fix
211
+ this.rowHeaderWidth += 50;
212
+ }
213
+ }
214
+ } else {
215
+ this.rowHeaderWidth = 0;
216
+ }
217
+ }
218
+ this.rowHeaderWidth = this.wtSettings.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;
219
+ return this.rowHeaderWidth;
186
220
  }
187
221
 
188
222
  /**
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 = "10/02/2025 14:31:18";
49
- Handsontable.version = "0.0.0-next-0d98d67-20250210";
48
+ Handsontable.buildDate = "11/02/2025 09:50:22";
49
+ Handsontable.version = "0.0.0-next-508ffe1-20250211";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "10/02/2025 14:31:23";
39
- Handsontable.version = "0.0.0-next-0d98d67-20250210";
38
+ Handsontable.buildDate = "11/02/2025 09:50:28";
39
+ Handsontable.version = "0.0.0-next-508ffe1-20250211";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
package/core.js CHANGED
@@ -3495,7 +3495,33 @@ function Core(rootElement, userSettings) {
3495
3495
  * @returns {number}
3496
3496
  */
3497
3497
  this._getColWidthFromSettings = function (col) {
3498
- return tableMeta.colWidths;
3498
+ let width;
3499
+
3500
+ // We currently don't support cell meta objects for headers (negative values)
3501
+ if (col >= 0) {
3502
+ const cellProperties = instance.getCellMeta(0, col);
3503
+ width = cellProperties.width;
3504
+ }
3505
+ if (width === undefined || width === tableMeta.width) {
3506
+ width = tableMeta.colWidths;
3507
+ }
3508
+ if (width !== undefined && width !== null) {
3509
+ switch (typeof width) {
3510
+ case 'object':
3511
+ // array
3512
+ width = width[col];
3513
+ break;
3514
+ case 'function':
3515
+ width = width(col);
3516
+ break;
3517
+ default:
3518
+ break;
3519
+ }
3520
+ if (typeof width === 'string') {
3521
+ width = parseInt(width, 10);
3522
+ }
3523
+ }
3524
+ return width;
3499
3525
  };
3500
3526
 
3501
3527
  /**
@@ -3509,7 +3535,12 @@ function Core(rootElement, userSettings) {
3509
3535
  * @fires Hooks#modifyColWidth
3510
3536
  */
3511
3537
  this.getColWidth = function (column, source) {
3512
- return instance._getColWidthFromSettings(column);
3538
+ let width = instance._getColWidthFromSettings(column);
3539
+ width = instance.runHooks('modifyColWidth', width, column, source);
3540
+ if (width === undefined) {
3541
+ width = _src.DEFAULT_COLUMN_WIDTH;
3542
+ }
3543
+ return width;
3513
3544
  };
3514
3545
 
3515
3546
  /**
@@ -3522,7 +3553,24 @@ function Core(rootElement, userSettings) {
3522
3553
  * @returns {number}
3523
3554
  */
3524
3555
  this._getRowHeightFromSettings = function (row) {
3525
- return tableMeta.rowHeights;
3556
+ let height = tableMeta.rowHeights;
3557
+ if (height !== undefined && height !== null) {
3558
+ switch (typeof height) {
3559
+ case 'object':
3560
+ // array
3561
+ height = height[row];
3562
+ break;
3563
+ case 'function':
3564
+ height = height(row);
3565
+ break;
3566
+ default:
3567
+ break;
3568
+ }
3569
+ if (typeof height === 'string') {
3570
+ height = parseInt(height, 10);
3571
+ }
3572
+ }
3573
+ return height;
3526
3574
  };
3527
3575
 
3528
3576
  /**
@@ -3553,7 +3601,9 @@ function Core(rootElement, userSettings) {
3553
3601
  * @fires Hooks#modifyRowHeight
3554
3602
  */
3555
3603
  this.getRowHeight = function (row, source) {
3556
- return instance._getRowHeightFromSettings(row);
3604
+ let height = instance._getRowHeightFromSettings(row);
3605
+ height = instance.runHooks('modifyRowHeight', height, row, source);
3606
+ return height;
3557
3607
  };
3558
3608
 
3559
3609
  /**
package/core.mjs CHANGED
@@ -3490,7 +3490,33 @@ export default function Core(rootElement, userSettings) {
3490
3490
  * @returns {number}
3491
3491
  */
3492
3492
  this._getColWidthFromSettings = function (col) {
3493
- return tableMeta.colWidths;
3493
+ let width;
3494
+
3495
+ // We currently don't support cell meta objects for headers (negative values)
3496
+ if (col >= 0) {
3497
+ const cellProperties = instance.getCellMeta(0, col);
3498
+ width = cellProperties.width;
3499
+ }
3500
+ if (width === undefined || width === tableMeta.width) {
3501
+ width = tableMeta.colWidths;
3502
+ }
3503
+ if (width !== undefined && width !== null) {
3504
+ switch (typeof width) {
3505
+ case 'object':
3506
+ // array
3507
+ width = width[col];
3508
+ break;
3509
+ case 'function':
3510
+ width = width(col);
3511
+ break;
3512
+ default:
3513
+ break;
3514
+ }
3515
+ if (typeof width === 'string') {
3516
+ width = parseInt(width, 10);
3517
+ }
3518
+ }
3519
+ return width;
3494
3520
  };
3495
3521
 
3496
3522
  /**
@@ -3504,7 +3530,12 @@ export default function Core(rootElement, userSettings) {
3504
3530
  * @fires Hooks#modifyColWidth
3505
3531
  */
3506
3532
  this.getColWidth = function (column, source) {
3507
- return instance._getColWidthFromSettings(column);
3533
+ let width = instance._getColWidthFromSettings(column);
3534
+ width = instance.runHooks('modifyColWidth', width, column, source);
3535
+ if (width === undefined) {
3536
+ width = DEFAULT_COLUMN_WIDTH;
3537
+ }
3538
+ return width;
3508
3539
  };
3509
3540
 
3510
3541
  /**
@@ -3517,7 +3548,24 @@ export default function Core(rootElement, userSettings) {
3517
3548
  * @returns {number}
3518
3549
  */
3519
3550
  this._getRowHeightFromSettings = function (row) {
3520
- return tableMeta.rowHeights;
3551
+ let height = tableMeta.rowHeights;
3552
+ if (height !== undefined && height !== null) {
3553
+ switch (typeof height) {
3554
+ case 'object':
3555
+ // array
3556
+ height = height[row];
3557
+ break;
3558
+ case 'function':
3559
+ height = height(row);
3560
+ break;
3561
+ default:
3562
+ break;
3563
+ }
3564
+ if (typeof height === 'string') {
3565
+ height = parseInt(height, 10);
3566
+ }
3567
+ }
3568
+ return height;
3521
3569
  };
3522
3570
 
3523
3571
  /**
@@ -3548,7 +3596,9 @@ export default function Core(rootElement, userSettings) {
3548
3596
  * @fires Hooks#modifyRowHeight
3549
3597
  */
3550
3598
  this.getRowHeight = function (row, source) {
3551
- return instance._getRowHeightFromSettings(row);
3599
+ let height = instance._getRowHeightFromSettings(row);
3600
+ height = instance.runHooks('modifyRowHeight', height, row, source);
3601
+ return height;
3552
3602
  };
3553
3603
 
3554
3604
  /**
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-0d98d67-20250210
29
- * Release date: 16/12/2024 (built at 10/02/2025 14:31:45)
28
+ * Version: 0.0.0-next-508ffe1-20250211
29
+ * Release date: 16/12/2024 (built at 11/02/2025 09:50:50)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-0d98d67-20250210
29
- * Release date: 16/12/2024 (built at 10/02/2025 14:31:45)
28
+ * Version: 0.0.0-next-508ffe1-20250211
29
+ * Release date: 16/12/2024 (built at 11/02/2025 09:50:50)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles