handsontable 0.0.0-next-8951d31-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
@@ -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-8951d31-20250210
29
- * Release date: 16/12/2024 (built at 10/02/2025 11:00:22)
28
+ * Version: 0.0.0-next-508ffe1-20250211
29
+ * Release date: 16/12/2024 (built at 11/02/2025 09:50:32)
30
30
  */
31
31
  (function webpackUniversalModuleDefinition(root, factory) {
32
32
  if(typeof exports === 'object' && typeof module === 'object')
@@ -42855,8 +42855,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
42855
42855
  Handsontable.CellCoords = _src.CellCoords;
42856
42856
  Handsontable.CellRange = _src.CellRange;
42857
42857
  Handsontable.packageName = 'handsontable';
42858
- Handsontable.buildDate = "10/02/2025 11:00:22";
42859
- Handsontable.version = "0.0.0-next-8951d31-20250210";
42858
+ Handsontable.buildDate = "11/02/2025 09:50:32";
42859
+ Handsontable.version = "0.0.0-next-508ffe1-20250211";
42860
42860
  Handsontable.languages = {
42861
42861
  dictionaryKeys: _registry.dictionaryKeys,
42862
42862
  getLanguageDictionary: _registry.getLanguageDictionary,
@@ -46374,7 +46374,33 @@ function Core(rootElement, userSettings) {
46374
46374
  * @returns {number}
46375
46375
  */
46376
46376
  this._getColWidthFromSettings = function (col) {
46377
- return tableMeta.colWidths[col];
46377
+ let width;
46378
+
46379
+ // We currently don't support cell meta objects for headers (negative values)
46380
+ if (col >= 0) {
46381
+ const cellProperties = instance.getCellMeta(0, col);
46382
+ width = cellProperties.width;
46383
+ }
46384
+ if (width === undefined || width === tableMeta.width) {
46385
+ width = tableMeta.colWidths;
46386
+ }
46387
+ if (width !== undefined && width !== null) {
46388
+ switch (typeof width) {
46389
+ case 'object':
46390
+ // array
46391
+ width = width[col];
46392
+ break;
46393
+ case 'function':
46394
+ width = width(col);
46395
+ break;
46396
+ default:
46397
+ break;
46398
+ }
46399
+ if (typeof width === 'string') {
46400
+ width = parseInt(width, 10);
46401
+ }
46402
+ }
46403
+ return width;
46378
46404
  };
46379
46405
 
46380
46406
  /**
@@ -46388,7 +46414,12 @@ function Core(rootElement, userSettings) {
46388
46414
  * @fires Hooks#modifyColWidth
46389
46415
  */
46390
46416
  this.getColWidth = function (column, source) {
46391
- return instance._getColWidthFromSettings(column);
46417
+ let width = instance._getColWidthFromSettings(column);
46418
+ width = instance.runHooks('modifyColWidth', width, column, source);
46419
+ if (width === undefined) {
46420
+ width = _src.DEFAULT_COLUMN_WIDTH;
46421
+ }
46422
+ return width;
46392
46423
  };
46393
46424
 
46394
46425
  /**
@@ -46401,7 +46432,24 @@ function Core(rootElement, userSettings) {
46401
46432
  * @returns {number}
46402
46433
  */
46403
46434
  this._getRowHeightFromSettings = function (row) {
46404
- return tableMeta.rowHeights;
46435
+ let height = tableMeta.rowHeights;
46436
+ if (height !== undefined && height !== null) {
46437
+ switch (typeof height) {
46438
+ case 'object':
46439
+ // array
46440
+ height = height[row];
46441
+ break;
46442
+ case 'function':
46443
+ height = height(row);
46444
+ break;
46445
+ default:
46446
+ break;
46447
+ }
46448
+ if (typeof height === 'string') {
46449
+ height = parseInt(height, 10);
46450
+ }
46451
+ }
46452
+ return height;
46405
46453
  };
46406
46454
 
46407
46455
  /**
@@ -46432,7 +46480,9 @@ function Core(rootElement, userSettings) {
46432
46480
  * @fires Hooks#modifyRowHeight
46433
46481
  */
46434
46482
  this.getRowHeight = function (row, source) {
46435
- return instance._getRowHeightFromSettings(row);
46483
+ let height = instance._getRowHeightFromSettings(row);
46484
+ height = instance.runHooks('modifyRowHeight', height, row, source);
46485
+ return height;
46436
46486
  };
46437
46487
 
46438
46488
  /**
@@ -52659,7 +52709,7 @@ function sanitize(string, options) {
52659
52709
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
52660
52710
 
52661
52711
  "use strict";
52662
- /*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */
52712
+ /*! @license DOMPurify 3.2.4 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.4/LICENSE */
52663
52713
 
52664
52714
 
52665
52715
 
@@ -52700,8 +52750,10 @@ if (!construct) {
52700
52750
  };
52701
52751
  }
52702
52752
  const arrayForEach = unapply(Array.prototype.forEach);
52753
+ const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
52703
52754
  const arrayPop = unapply(Array.prototype.pop);
52704
52755
  const arrayPush = unapply(Array.prototype.push);
52756
+ const arraySplice = unapply(Array.prototype.splice);
52705
52757
  const stringToLowerCase = unapply(String.prototype.toLowerCase);
52706
52758
  const stringToString = unapply(String.prototype.toString);
52707
52759
  const stringMatch = unapply(String.prototype.match);
@@ -52857,7 +52909,7 @@ const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:x
52857
52909
  // eslint-disable-next-line unicorn/better-regex
52858
52910
  const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
52859
52911
  const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
52860
- const TMPLIT_EXPR = seal(/\$\{[\w\W]*}/gm); // eslint-disable-line unicorn/better-regex
52912
+ const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
52861
52913
  const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
52862
52914
  const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
52863
52915
  const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
@@ -52957,9 +53009,9 @@ const _createHooksMap = function _createHooksMap() {
52957
53009
  function createDOMPurify() {
52958
53010
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
52959
53011
  const DOMPurify = root => createDOMPurify(root);
52960
- DOMPurify.version = '3.2.3';
53012
+ DOMPurify.version = '3.2.4';
52961
53013
  DOMPurify.removed = [];
52962
- if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {
53014
+ if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
52963
53015
  // Not running in a browser, provide a factory function
52964
53016
  // so that you can pass your own Window
52965
53017
  DOMPurify.isSupported = false;
@@ -53978,7 +54030,11 @@ function createDOMPurify() {
53978
54030
  }
53979
54031
  arrayPush(hooks[entryPoint], hookFunction);
53980
54032
  };
53981
- DOMPurify.removeHook = function (entryPoint) {
54033
+ DOMPurify.removeHook = function (entryPoint, hookFunction) {
54034
+ if (hookFunction !== undefined) {
54035
+ const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
54036
+ return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
54037
+ }
53982
54038
  return arrayPop(hooks[entryPoint]);
53983
54039
  };
53984
54040
  DOMPurify.removeHooks = function (entryPoint) {
@@ -54139,7 +54195,7 @@ const domMessages = {
54139
54195
  function _injectProductInfo(key, element) {
54140
54196
  const hasValidType = !isEmpty(key);
54141
54197
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
54142
- const hotVersion = "0.0.0-next-8951d31-20250210";
54198
+ const hotVersion = "0.0.0-next-508ffe1-20250211";
54143
54199
  let keyValidityDate;
54144
54200
  let consoleMessageState = 'invalid';
54145
54201
  let domMessageState = 'invalid';
@@ -71271,7 +71327,11 @@ class ViewportColumnsCalculator extends _viewportBase.ViewportBaseCalculator {
71271
71327
  * @returns {number}
71272
71328
  */
71273
71329
  getColumnWidth(column) {
71274
- return this.columnWidthFn(column);
71330
+ const width = this.columnWidthFn(column);
71331
+ if (isNaN(width)) {
71332
+ return DEFAULT_WIDTH;
71333
+ }
71334
+ return width;
71275
71335
  }
71276
71336
  }
71277
71337
  exports.ViewportColumnsCalculator = ViewportColumnsCalculator;
@@ -71466,7 +71526,11 @@ class ViewportRowsCalculator extends _viewportBase.ViewportBaseCalculator {
71466
71526
  * @returns {number}
71467
71527
  */
71468
71528
  getRowHeight(row) {
71469
- return this.rowHeightFn(row);
71529
+ const rowHeight = this.rowHeightFn(row);
71530
+ if (isNaN(rowHeight)) {
71531
+ return this.defaultHeight;
71532
+ }
71533
+ return rowHeight;
71470
71534
  }
71471
71535
  }
71472
71536
  exports.ViewportRowsCalculator = ViewportRowsCalculator;
@@ -74452,6 +74516,16 @@ class Table {
74452
74516
  this.resetOversizedRows();
74453
74517
  this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
74454
74518
  if (this.isMaster) {
74519
+ this.markOversizedColumnHeaders();
74520
+ }
74521
+ this.adjustColumnHeaderHeights();
74522
+ if (this.isMaster || this.is(_overlay.CLONE_BOTTOM)) {
74523
+ this.markOversizedRows();
74524
+ }
74525
+ if (this.isMaster) {
74526
+ if (!this.wtSettings.getSetting('externalRowCalculator')) {
74527
+ wtViewport.createVisibleCalculators();
74528
+ }
74455
74529
  wtOverlays.refresh(false);
74456
74530
  wtOverlays.applyToDOM();
74457
74531
  this.wtSettings.getSetting('onDraw', true);
@@ -74493,18 +74567,85 @@ class Table {
74493
74567
  /**
74494
74568
  * @param {number} col The visual column index.
74495
74569
  */
74496
- markIfOversizedColumnHeader(col) {}
74570
+ markIfOversizedColumnHeader(col) {
74571
+ const sourceColIndex = this.columnFilter.renderedToSource(col);
74572
+ let level = this.wtSettings.getSetting('columnHeaders').length;
74573
+ const defaultRowHeight = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
74574
+ let previousColHeaderHeight;
74575
+ let currentHeader;
74576
+ let currentHeaderHeight;
74577
+ const columnHeaderHeightSetting = this.wtSettings.getSetting('columnHeaderHeight') || [];
74578
+ while (level) {
74579
+ level -= 1;
74580
+ previousColHeaderHeight = this.getColumnHeaderHeight(level);
74581
+ currentHeader = this.getColumnHeader(sourceColIndex, level);
74582
+ if (!currentHeader) {
74583
+ /* eslint-disable no-continue */
74584
+ continue;
74585
+ }
74586
+ currentHeaderHeight = (0, _element.innerHeight)(currentHeader);
74587
+ if (!previousColHeaderHeight && defaultRowHeight < currentHeaderHeight || previousColHeaderHeight < currentHeaderHeight) {
74588
+ this.dataAccessObject.wtViewport.oversizedColumnHeaders[level] = currentHeaderHeight;
74589
+ }
74590
+ if (Array.isArray(columnHeaderHeightSetting)) {
74591
+ if (columnHeaderHeightSetting[level] !== null && columnHeaderHeightSetting[level] !== undefined) {
74592
+ this.dataAccessObject.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level];
74593
+ }
74594
+ } else if (!isNaN(columnHeaderHeightSetting)) {
74595
+ this.dataAccessObject.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting;
74596
+ }
74597
+ if (this.dataAccessObject.wtViewport.oversizedColumnHeaders[level] < (columnHeaderHeightSetting[level] || columnHeaderHeightSetting)) {
74598
+ this.dataAccessObject.wtViewport.oversizedColumnHeaders[level] = columnHeaderHeightSetting[level] || columnHeaderHeightSetting; // eslint-disable-line max-len
74599
+ }
74600
+ }
74601
+ }
74497
74602
 
74498
74603
  /**
74499
74604
  *
74500
74605
  */
74501
- adjustColumnHeaderHeights() {}
74606
+ adjustColumnHeaderHeights() {
74607
+ const {
74608
+ wtSettings
74609
+ } = this;
74610
+ const children = this.THEAD.childNodes;
74611
+ const oversizedColumnHeaders = this.dataAccessObject.wtViewport.oversizedColumnHeaders;
74612
+ const columnHeaders = wtSettings.getSetting('columnHeaders');
74613
+ for (let i = 0, len = columnHeaders.length; i < len; i++) {
74614
+ if (oversizedColumnHeaders[i]) {
74615
+ if (!children[i] || children[i].childNodes.length === 0) {
74616
+ return;
74617
+ }
74618
+ children[i].childNodes[0].style.height = `${oversizedColumnHeaders[i]}px`;
74619
+ }
74620
+ }
74621
+ }
74502
74622
 
74503
74623
  /**
74504
74624
  * Resets cache of row heights. The cache should be cached for each render cycle in a case
74505
74625
  * when new cell values have content which increases/decreases cell height.
74506
74626
  */
74507
- resetOversizedRows() {}
74627
+ resetOversizedRows() {
74628
+ const {
74629
+ wtSettings
74630
+ } = this;
74631
+ const {
74632
+ wtViewport
74633
+ } = this.dataAccessObject;
74634
+ if (!this.isMaster && !this.is(_overlay.CLONE_BOTTOM)) {
74635
+ return;
74636
+ }
74637
+ if (!wtSettings.getSetting('externalRowCalculator')) {
74638
+ const rowsToRender = this.getRenderedRowsCount();
74639
+
74640
+ // Reset the oversized row cache for rendered rows
74641
+ for (let visibleRowIndex = 0; visibleRowIndex < rowsToRender; visibleRowIndex++) {
74642
+ const sourceRow = this.rowFilter.renderedToSource(visibleRowIndex);
74643
+ if (wtViewport.oversizedRows && wtViewport.oversizedRows[sourceRow]) {
74644
+ wtViewport.oversizedRows[sourceRow] = undefined;
74645
+ }
74646
+ }
74647
+ }
74648
+ }
74508
74649
 
74509
74650
  /**
74510
74651
  * Get cell element at coords.
@@ -74702,7 +74843,46 @@ class Table {
74702
74843
  /**
74703
74844
  * Check if any of the rendered rows is higher than expected, and if so, cache them.
74704
74845
  */
74705
- markOversizedRows() {}
74846
+ markOversizedRows() {
74847
+ if (this.wtSettings.getSetting('externalRowCalculator')) {
74848
+ return;
74849
+ }
74850
+ let rowCount = this.TBODY.childNodes.length;
74851
+ const expectedTableHeight = rowCount * this.dataAccessObject.stylesHandler.getDefaultRowHeight();
74852
+ const actualTableHeight = (0, _element.innerHeight)(this.TBODY) - 1;
74853
+ const borderBoxSizing = this.wot.stylesHandler.areCellsBorderBox();
74854
+ const rowHeightFn = borderBoxSizing ? _element.outerHeight : _element.innerHeight;
74855
+ const borderCompensation = borderBoxSizing ? 0 : 1;
74856
+ const firstRowBorderCompensation = borderBoxSizing ? 1 : 0;
74857
+ let previousRowHeight;
74858
+ let rowCurrentHeight;
74859
+ let sourceRowIndex;
74860
+ let currentTr;
74861
+ let rowHeader;
74862
+ if (expectedTableHeight === actualTableHeight && !this.wtSettings.getSetting('fixedRowsBottom')) {
74863
+ // If the actual table height equals rowCount * default single row height, no row is oversized -> no need to iterate over them
74864
+ return;
74865
+ }
74866
+ while (rowCount) {
74867
+ rowCount -= 1;
74868
+ sourceRowIndex = this.rowFilter.renderedToSource(rowCount);
74869
+ previousRowHeight = this.getRowHeight(sourceRowIndex);
74870
+ currentTr = this.getTrForRow(sourceRowIndex);
74871
+ rowHeader = currentTr.querySelector('th');
74872
+ const topBorderCompensation = sourceRowIndex === 0 ? firstRowBorderCompensation : 0;
74873
+ if (rowHeader) {
74874
+ rowCurrentHeight = rowHeightFn(rowHeader);
74875
+ } else {
74876
+ rowCurrentHeight = rowHeightFn(currentTr) - borderCompensation;
74877
+ }
74878
+ if (!previousRowHeight && this.dataAccessObject.stylesHandler.getDefaultRowHeight() < rowCurrentHeight - topBorderCompensation || previousRowHeight < rowCurrentHeight) {
74879
+ if (!borderBoxSizing) {
74880
+ rowCurrentHeight += 1;
74881
+ }
74882
+ this.dataAccessObject.wtViewport.oversizedRows[sourceRowIndex] = rowCurrentHeight;
74883
+ }
74884
+ }
74885
+ }
74706
74886
 
74707
74887
  /**
74708
74888
  * @param {number} row The visual row index.
@@ -75017,7 +75197,32 @@ class Table {
75017
75197
  * @returns {number}
75018
75198
  */
75019
75199
  _modifyRowHeaderWidth(rowHeaderWidthFactory) {
75020
- return 50;
75200
+ let widths = (0, _function.isFunction)(rowHeaderWidthFactory) ? rowHeaderWidthFactory() : null;
75201
+ if (Array.isArray(widths)) {
75202
+ widths = [...widths];
75203
+ widths[widths.length - 1] = this._correctRowHeaderWidth(widths[widths.length - 1]);
75204
+ } else {
75205
+ widths = this._correctRowHeaderWidth(widths);
75206
+ }
75207
+ return widths;
75208
+ }
75209
+
75210
+ /**
75211
+ * Correct row header width if necessary.
75212
+ *
75213
+ * @private
75214
+ * @param {number} width The width to process.
75215
+ * @returns {number}
75216
+ */
75217
+ _correctRowHeaderWidth(width) {
75218
+ let rowHeaderWidth = width;
75219
+ if (typeof width !== 'number') {
75220
+ rowHeaderWidth = this.wtSettings.getSetting('defaultColumnWidth');
75221
+ }
75222
+ if (this.correctHeaderWidth) {
75223
+ rowHeaderWidth += 1;
75224
+ }
75225
+ return rowHeaderWidth;
75021
75226
  }
75022
75227
  }
75023
75228
  var _default = exports["default"] = Table;
@@ -75430,9 +75635,6 @@ class RowHeadersRenderer extends _base.BaseRenderer {
75430
75635
  for (let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {
75431
75636
  orderView.render();
75432
75637
  const TH = orderView.getCurrentNode();
75433
- if (TH.innerHTML !== '') {
75434
- continue;
75435
- }
75436
75638
  TH.className = '';
75437
75639
  TH.removeAttribute('style');
75438
75640
 
@@ -76378,7 +76580,7 @@ var _a11y = __webpack_require__(496);
76378
76580
  */
76379
76581
  class ColumnHeadersRenderer extends _base.BaseRenderer {
76380
76582
  constructor(rootNode) {
76381
- super('TR', rootNode); // NodePool is not implemented for this renderer yet
76583
+ super(null, rootNode); // NodePool is not implemented for this renderer yet
76382
76584
  }
76383
76585
 
76384
76586
  /**
@@ -76446,9 +76648,6 @@ class ColumnHeadersRenderer extends _base.BaseRenderer {
76446
76648
  // eslint-disable-line max-len
76447
76649
  const sourceColumnIndex = this.table.renderedColumnToSource(renderedColumnIndex);
76448
76650
  const TH = TR.childNodes[renderedColumnIndex + rowHeadersCount];
76449
- if (TH.innerHTML !== '') {
76450
- continue;
76451
- }
76452
76651
  TH.className = '';
76453
76652
  TH.removeAttribute('style');
76454
76653
 
@@ -76739,14 +76938,11 @@ class CellsRenderer extends _base.BaseRenderer {
76739
76938
  this.sourceRowIndex = sourceRowIndex;
76740
76939
  const orderView = this.obtainOrderView(TR);
76741
76940
  const rowHeadersView = rowHeaders.obtainOrderView(TR);
76742
- orderView.prependView(rowHeadersView).setSize(columnsToRender).setOffset(this.table.renderedColumnToSource(0)).start();
76941
+ orderView.prependView(rowHeadersView).setSize(columnsToRender).setOffset(0).start();
76743
76942
  for (let visibleColumnIndex = 0; visibleColumnIndex < columnsToRender; visibleColumnIndex++) {
76744
76943
  orderView.render();
76745
76944
  const sourceColumnIndex = this.table.renderedColumnToSource(visibleColumnIndex);
76746
76945
  const TD = orderView.getCurrentNode();
76747
- if (TD.innerHTML !== '') {
76748
- continue;
76749
- }
76750
76946
  if (!(0, _element.hasClass)(TD, 'hide')) {
76751
76947
  // Workaround for hidden columns plugin
76752
76948
  TD.className = '';
@@ -77156,7 +77352,8 @@ class ColumnUtils {
77156
77352
  * @returns {number}
77157
77353
  */
77158
77354
  getWidth(sourceIndex) {
77159
- return this.wtSettings.getSetting('columnWidth', sourceIndex);
77355
+ const width = this.wtSettings.getSetting('columnWidth', sourceIndex) || this.wtSettings.getSetting('defaultColumnWidth');
77356
+ return width;
77160
77357
  }
77161
77358
 
77162
77359
  /**
@@ -77166,7 +77363,12 @@ class ColumnUtils {
77166
77363
  * @returns {number}
77167
77364
  */
77168
77365
  getHeaderHeight(level) {
77169
- return this.dataAccessObject.stylesHandler.getDefaultRowHeight();
77366
+ let height = this.dataAccessObject.stylesHandler.getDefaultRowHeight();
77367
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedColumnHeaders[level];
77368
+ if (oversizedHeight !== undefined) {
77369
+ height = height ? Math.max(height, oversizedHeight) : oversizedHeight;
77370
+ }
77371
+ return height;
77170
77372
  }
77171
77373
 
77172
77374
  /**
@@ -77176,13 +77378,28 @@ class ColumnUtils {
77176
77378
  * @returns {number}
77177
77379
  */
77178
77380
  getHeaderWidth(sourceIndex) {
77179
- return 50;
77381
+ return this.headerWidths.get(this.dataAccessObject.wtTable.columnFilter.sourceToRendered(sourceIndex));
77180
77382
  }
77181
77383
 
77182
77384
  /**
77183
77385
  * Calculates column header widths that can be retrieved from the cache.
77184
77386
  */
77185
- calculateWidths() {}
77387
+ calculateWidths() {
77388
+ const {
77389
+ wtSettings
77390
+ } = this;
77391
+ let rowHeaderWidthSetting = wtSettings.getSetting('rowHeaderWidth');
77392
+ rowHeaderWidthSetting = wtSettings.getSetting('onModifyRowHeaderWidth', rowHeaderWidthSetting);
77393
+ if (rowHeaderWidthSetting !== null && rowHeaderWidthSetting !== undefined) {
77394
+ const rowHeadersCount = wtSettings.getSetting('rowHeaders').length;
77395
+ const defaultColumnWidth = wtSettings.getSetting('defaultColumnWidth');
77396
+ for (let visibleColumnIndex = 0; visibleColumnIndex < rowHeadersCount; visibleColumnIndex++) {
77397
+ let width = Array.isArray(rowHeaderWidthSetting) ? rowHeaderWidthSetting[visibleColumnIndex] : rowHeaderWidthSetting;
77398
+ width = width === null || width === undefined ? defaultColumnWidth : width;
77399
+ this.headerWidths.set(visibleColumnIndex, width);
77400
+ }
77401
+ }
77402
+ }
77186
77403
  }
77187
77404
  exports["default"] = ColumnUtils;
77188
77405
 
@@ -77226,7 +77443,12 @@ class RowUtils {
77226
77443
  * @returns {number}
77227
77444
  */
77228
77445
  getHeight(sourceIndex) {
77229
- return this.wtSettings.getSetting('rowHeight', sourceIndex);
77446
+ let height = this.wtSettings.getSetting('rowHeight', sourceIndex);
77447
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
77448
+ if (oversizedHeight !== undefined) {
77449
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
77450
+ }
77451
+ return height;
77230
77452
  }
77231
77453
 
77232
77454
  /**
@@ -77237,7 +77459,12 @@ class RowUtils {
77237
77459
  * @returns {number}
77238
77460
  */
77239
77461
  getHeightByOverlayName(sourceIndex, overlayName) {
77240
- return this.wtSettings.getSetting('rowHeight', sourceIndex);
77462
+ let height = this.wtSettings.getSetting('rowHeightByOverlayName', sourceIndex, overlayName);
77463
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
77464
+ if (oversizedHeight !== undefined) {
77465
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
77466
+ }
77467
+ return height;
77241
77468
  }
77242
77469
  }
77243
77470
  exports["default"] = RowUtils;
@@ -79234,7 +79461,14 @@ class InlineStartOverlay extends _base.Overlay {
79234
79461
  * @returns {number} Width sum.
79235
79462
  */
79236
79463
  sumCellSizes(from, to) {
79237
- return (to - from) * 80;
79464
+ const defaultColumnWidth = this.wtSettings.getSetting('defaultColumnWidth');
79465
+ let column = from;
79466
+ let sum = 0;
79467
+ while (column < to) {
79468
+ sum += this.wot.wtTable.getColumnWidth(column) || defaultColumnWidth;
79469
+ column += 1;
79470
+ }
79471
+ return sum;
79238
79472
  }
79239
79473
 
79240
79474
  /**
@@ -81617,7 +81851,15 @@ class TopOverlay extends _base.Overlay {
81617
81851
  * @returns {number} Height sum.
81618
81852
  */
81619
81853
  sumCellSizes(from, to) {
81620
- return (to - from) * 29;
81854
+ const defaultRowHeight = this.wot.stylesHandler.getDefaultRowHeight();
81855
+ let row = from;
81856
+ let sum = 0;
81857
+ while (row < to) {
81858
+ const height = this.wot.wtTable.getRowHeight(row);
81859
+ sum += height === undefined ? defaultRowHeight : height;
81860
+ row += 1;
81861
+ }
81862
+ return sum;
81621
81863
  }
81622
81864
 
81623
81865
  /**
@@ -82330,6 +82572,7 @@ class Viewport {
82330
82572
  this.domBindings = domBindings;
82331
82573
  this.wtSettings = wtSettings;
82332
82574
  this.wtTable = wtTable;
82575
+ this.oversizedRows = [];
82333
82576
  this.oversizedColumnHeaders = [];
82334
82577
  this.hasOversizedColumnHeadersMarked = {};
82335
82578
  this.clientHeight = 0;
@@ -82484,14 +82727,47 @@ class Viewport {
82484
82727
  * @returns {number}
82485
82728
  */
82486
82729
  getColumnHeaderHeight() {
82487
- return 59;
82730
+ const columnHeaders = this.wtSettings.getSetting('columnHeaders');
82731
+ if (!columnHeaders.length) {
82732
+ this.columnHeaderHeight = 0;
82733
+ } else if (isNaN(this.columnHeaderHeight)) {
82734
+ this.columnHeaderHeight = (0, _element.outerHeight)(this.wtTable.THEAD);
82735
+ }
82736
+ return this.columnHeaderHeight;
82488
82737
  }
82489
82738
 
82490
82739
  /**
82491
82740
  * @returns {number}
82492
82741
  */
82493
82742
  getRowHeaderWidth() {
82494
- return 50;
82743
+ const rowHeadersWidthSetting = this.wtSettings.getSetting('rowHeaderWidth');
82744
+ const rowHeaders = this.wtSettings.getSetting('rowHeaders');
82745
+ if (rowHeadersWidthSetting) {
82746
+ this.rowHeaderWidth = 0;
82747
+ for (let i = 0, len = rowHeaders.length; i < len; i++) {
82748
+ this.rowHeaderWidth += rowHeadersWidthSetting[i] || rowHeadersWidthSetting;
82749
+ }
82750
+ }
82751
+ if (isNaN(this.rowHeaderWidth)) {
82752
+ if (rowHeaders.length) {
82753
+ let TH = this.wtTable.TABLE.querySelector('TH');
82754
+ this.rowHeaderWidth = 0;
82755
+ for (let i = 0, len = rowHeaders.length; i < len; i++) {
82756
+ if (TH) {
82757
+ this.rowHeaderWidth += (0, _element.outerWidth)(TH);
82758
+ TH = TH.nextSibling;
82759
+ } else {
82760
+ // yes this is a cheat but it worked like that before, just taking assumption from CSS instead of measuring.
82761
+ // TODO: proper fix
82762
+ this.rowHeaderWidth += 50;
82763
+ }
82764
+ }
82765
+ } else {
82766
+ this.rowHeaderWidth = 0;
82767
+ }
82768
+ }
82769
+ this.rowHeaderWidth = this.wtSettings.getSetting('onModifyRowHeaderWidth', this.rowHeaderWidth) || this.rowHeaderWidth;
82770
+ return this.rowHeaderWidth;
82495
82771
  }
82496
82772
 
82497
82773
  /**
@@ -101451,14 +101727,9 @@ function textRenderer(hotInstance, TD, row, col, prop, value, cellProperties) {
101451
101727
  if (cellProperties.trimWhitespace) {
101452
101728
  escaped = escaped.trim();
101453
101729
  }
101454
- if (TD.firstChild) {
101455
- (0, _element.fastInnerText)(TD.firstChild, escaped);
101456
- } else {
101457
- const div = hotInstance.rootDocument.createElement('div');
101458
- div.style.height = '20px';
101459
- TD.appendChild(div);
101460
- (0, _element.fastInnerText)(div, escaped);
101461
- }
101730
+
101731
+ // this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
101732
+ (0, _element.fastInnerText)(TD, escaped);
101462
101733
  }
101463
101734
  textRenderer.RENDERER_TYPE = RENDERER_TYPE;
101464
101735
 
@@ -123722,10 +123993,12 @@ class CopyPaste extends _base.BasePlugin {
123722
123993
  * @private
123723
123994
  */
123724
123995
  onCopy(event) {
123725
- var _event$target;
123996
+ var _event$target, _this$hot$getSelected;
123726
123997
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
123727
123998
  const isHotInput = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.hasAttribute('data-hot-input');
123728
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
123999
+ const selectedCell = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
124000
+ const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
124001
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
123729
124002
  return;
123730
124003
  }
123731
124004
  event.preventDefault();
@@ -123755,10 +124028,12 @@ class CopyPaste extends _base.BasePlugin {
123755
124028
  * @private
123756
124029
  */
123757
124030
  onCut(event) {
123758
- var _event$target2;
124031
+ var _event$target2, _this$hot$getSelected2;
123759
124032
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
123760
124033
  const isHotInput = (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.hasAttribute('data-hot-input');
123761
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
124034
+ const selectedCell = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
124035
+ const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
124036
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
123762
124037
  return;
123763
124038
  }
123764
124039
  event.preventDefault();
@@ -123787,10 +124062,12 @@ class CopyPaste extends _base.BasePlugin {
123787
124062
  * @private
123788
124063
  */
123789
124064
  onPaste(event) {
123790
- var _event$target3;
124065
+ var _event$target3, _this$hot$getSelected3;
123791
124066
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
123792
124067
  const isHotInput = (_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.hasAttribute('data-hot-input');
123793
- if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
124068
+ const selectedCell = (_this$hot$getSelected3 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected3 === void 0 ? void 0 : _this$hot$getSelected3.highlight;
124069
+ const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
124070
+ if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
123794
124071
  return;
123795
124072
  }
123796
124073
  event.preventDefault();