handsontable 15.2.0 → 15.3.0-next-6f5f494-20250424

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.
Files changed (224) hide show
  1. package/3rdparty/walkontable/src/cell/range.js +14 -0
  2. package/3rdparty/walkontable/src/cell/range.mjs +14 -0
  3. package/3rdparty/walkontable/src/core/_base.js +2 -2
  4. package/3rdparty/walkontable/src/core/_base.mjs +3 -3
  5. package/3rdparty/walkontable/src/overlay/_base.js +0 -2
  6. package/3rdparty/walkontable/src/overlay/_base.mjs +0 -2
  7. package/3rdparty/walkontable/src/overlay/bottom.js +9 -6
  8. package/3rdparty/walkontable/src/overlay/bottom.mjs +9 -6
  9. package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -5
  10. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +8 -5
  11. package/3rdparty/walkontable/src/overlay/top.js +11 -6
  12. package/3rdparty/walkontable/src/overlay/top.mjs +11 -6
  13. package/3rdparty/walkontable/src/overlays.js +15 -11
  14. package/3rdparty/walkontable/src/overlays.mjs +15 -11
  15. package/3rdparty/walkontable/src/renderer/rowHeaders.js +4 -1
  16. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
  17. package/3rdparty/walkontable/src/selection/border/border.js +5 -0
  18. package/3rdparty/walkontable/src/selection/border/border.mjs +5 -0
  19. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +3 -4
  20. package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +3 -4
  21. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +8 -10
  22. package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +8 -10
  23. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +3 -4
  24. package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +3 -4
  25. package/3rdparty/walkontable/src/table.js +5 -2
  26. package/3rdparty/walkontable/src/table.mjs +5 -2
  27. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +0 -2
  28. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +0 -2
  29. package/CHANGELOG.md +45 -1
  30. package/README.md +1 -1
  31. package/base.js +2 -2
  32. package/base.mjs +2 -2
  33. package/core/focusCatcher/focusDetector.js +1 -1
  34. package/core/focusCatcher/focusDetector.mjs +2 -2
  35. package/core/hooks/constants.js +8 -0
  36. package/core/hooks/constants.mjs +8 -0
  37. package/core/hooks/index.d.ts +1 -0
  38. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.js +7 -5
  39. package/core/viewportScroll/scrollStrategies/columnHeaderScroll.mjs +7 -5
  40. package/core/viewportScroll/scrollStrategies/focusScroll.js +8 -1
  41. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +8 -1
  42. package/core/viewportScroll/scrollStrategies/multipleScroll.js +13 -1
  43. package/core/viewportScroll/scrollStrategies/multipleScroll.mjs +13 -1
  44. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.js +13 -1
  45. package/core/viewportScroll/scrollStrategies/noncontiguousScroll.mjs +13 -1
  46. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.js +7 -5
  47. package/core/viewportScroll/scrollStrategies/rowHeaderScroll.mjs +7 -5
  48. package/core/viewportScroll/scrollStrategies/singleScroll.js +8 -4
  49. package/core/viewportScroll/scrollStrategies/singleScroll.mjs +8 -4
  50. package/core/viewportScroll/utils.js +111 -0
  51. package/core/viewportScroll/utils.mjs +106 -0
  52. package/core.d.ts +2 -3
  53. package/core.js +125 -71
  54. package/core.mjs +126 -72
  55. package/dataMap/dataMap.js +0 -7
  56. package/dataMap/dataMap.mjs +0 -7
  57. package/dataMap/metaManager/index.js +8 -9
  58. package/dataMap/metaManager/index.mjs +8 -9
  59. package/dataMap/metaManager/mods/dynamicCellMeta.js +4 -1
  60. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +4 -1
  61. package/dist/handsontable.css +4 -15
  62. package/dist/handsontable.full.css +4 -17
  63. package/dist/handsontable.full.js +4573 -4013
  64. package/dist/handsontable.full.min.css +3 -3
  65. package/dist/handsontable.full.min.js +148 -148
  66. package/dist/handsontable.js +4287 -3730
  67. package/dist/handsontable.min.css +3 -3
  68. package/dist/handsontable.min.js +19 -19
  69. package/editorManager.js +1 -7
  70. package/editorManager.mjs +1 -7
  71. package/editors/autocompleteEditor/autocompleteEditor.js +31 -7
  72. package/editors/autocompleteEditor/autocompleteEditor.mjs +31 -7
  73. package/focusManager.js +4 -2
  74. package/focusManager.mjs +4 -2
  75. package/helpers/browser.js +1 -1
  76. package/helpers/browser.mjs +1 -1
  77. package/helpers/dom/element.d.ts +1 -0
  78. package/helpers/dom/element.js +20 -0
  79. package/helpers/dom/element.mjs +19 -0
  80. package/helpers/mixed.js +2 -2
  81. package/helpers/mixed.mjs +2 -2
  82. package/helpers/object.js +3 -0
  83. package/helpers/object.mjs +3 -0
  84. package/package.json +1 -1
  85. package/plugins/autoColumnSize/autoColumnSize.js +38 -17
  86. package/plugins/autoColumnSize/autoColumnSize.mjs +38 -17
  87. package/plugins/autoRowSize/autoRowSize.js +12 -6
  88. package/plugins/autoRowSize/autoRowSize.mjs +12 -6
  89. package/plugins/columnSorting/columnSorting.js +0 -4
  90. package/plugins/columnSorting/columnSorting.mjs +0 -4
  91. package/plugins/comments/comments.js +1 -0
  92. package/plugins/comments/comments.mjs +1 -0
  93. package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
  94. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
  95. package/plugins/contextMenu/menu/menu.js +1 -0
  96. package/plugins/contextMenu/menu/menu.mjs +1 -0
  97. package/plugins/contextMenu/menu/positioner.js +10 -2
  98. package/plugins/contextMenu/menu/positioner.mjs +10 -2
  99. package/plugins/contextMenu/predefinedItems/redo.js +3 -3
  100. package/plugins/contextMenu/predefinedItems/redo.mjs +3 -3
  101. package/plugins/contextMenu/predefinedItems/undo.js +3 -3
  102. package/plugins/contextMenu/predefinedItems/undo.mjs +3 -3
  103. package/plugins/copyPaste/copyPaste.js +12 -9
  104. package/plugins/copyPaste/copyPaste.mjs +12 -9
  105. package/plugins/copyPaste/pasteEvent.js +3 -0
  106. package/plugins/copyPaste/pasteEvent.mjs +3 -0
  107. package/plugins/exportFile/exportFile.d.ts +1 -0
  108. package/plugins/exportFile/exportFile.js +2 -1
  109. package/plugins/exportFile/exportFile.mjs +2 -1
  110. package/plugins/exportFile/types/csv.js +76 -11
  111. package/plugins/exportFile/types/csv.mjs +76 -11
  112. package/plugins/filters/filters.js +24 -23
  113. package/plugins/filters/filters.mjs +24 -23
  114. package/plugins/filters/ui/multipleSelect.js +7 -1
  115. package/plugins/filters/ui/multipleSelect.mjs +7 -1
  116. package/plugins/formulas/formulas.d.ts +1 -1
  117. package/plugins/formulas/formulas.js +57 -60
  118. package/plugins/formulas/formulas.mjs +59 -62
  119. package/plugins/formulas/indexSyncer/axisSyncer.js +5 -1
  120. package/plugins/formulas/indexSyncer/axisSyncer.mjs +5 -1
  121. package/plugins/hiddenColumns/hiddenColumns.js +1 -1
  122. package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
  123. package/plugins/hiddenRows/hiddenRows.js +1 -1
  124. package/plugins/hiddenRows/hiddenRows.mjs +1 -1
  125. package/plugins/manualColumnResize/manualColumnResize.js +4 -6
  126. package/plugins/manualColumnResize/manualColumnResize.mjs +4 -6
  127. package/plugins/manualRowResize/manualRowResize.js +4 -6
  128. package/plugins/manualRowResize/manualRowResize.mjs +4 -6
  129. package/plugins/mergeCells/mergeCells.js +10 -30
  130. package/plugins/mergeCells/mergeCells.mjs +10 -30
  131. package/plugins/mergeCells/renderer.js +15 -0
  132. package/plugins/mergeCells/renderer.mjs +15 -0
  133. package/plugins/mergeCells/utils.js +31 -0
  134. package/plugins/mergeCells/utils.mjs +27 -0
  135. package/plugins/nestedRows/data/dataManager.js +2 -2
  136. package/plugins/nestedRows/data/dataManager.mjs +2 -2
  137. package/plugins/undoRedo/actions/index.js +0 -2
  138. package/plugins/undoRedo/actions/index.mjs +0 -2
  139. package/plugins/undoRedo/actions/removeColumn.js +19 -14
  140. package/plugins/undoRedo/actions/removeColumn.mjs +19 -14
  141. package/plugins/undoRedo/actions/removeRow.js +12 -4
  142. package/plugins/undoRedo/actions/removeRow.mjs +12 -4
  143. package/selection/selection.js +3 -1
  144. package/selection/selection.mjs +3 -1
  145. package/shortcutContexts/commands/extendCellsSelection/down.js +7 -2
  146. package/shortcutContexts/commands/extendCellsSelection/down.mjs +7 -2
  147. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +8 -2
  148. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +8 -2
  149. package/shortcutContexts/commands/extendCellsSelection/left.js +7 -2
  150. package/shortcutContexts/commands/extendCellsSelection/left.mjs +7 -2
  151. package/shortcutContexts/commands/extendCellsSelection/right.js +7 -2
  152. package/shortcutContexts/commands/extendCellsSelection/right.mjs +7 -2
  153. package/shortcutContexts/commands/extendCellsSelection/toColumns.js +7 -2
  154. package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +7 -2
  155. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +3 -1
  156. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
  157. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +3 -1
  158. package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +3 -1
  159. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +3 -1
  160. package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +3 -1
  161. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
  162. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
  163. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
  164. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
  165. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
  166. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
  167. package/shortcutContexts/commands/extendCellsSelection/toRows.js +7 -2
  168. package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +7 -2
  169. package/shortcutContexts/commands/extendCellsSelection/up.js +7 -2
  170. package/shortcutContexts/commands/extendCellsSelection/up.mjs +7 -2
  171. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +8 -2
  172. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +8 -2
  173. package/shortcutContexts/commands/index.js +0 -2
  174. package/shortcutContexts/commands/index.mjs +0 -2
  175. package/shortcutContexts/commands/moveCellSelection/down.js +2 -0
  176. package/shortcutContexts/commands/moveCellSelection/down.mjs +2 -0
  177. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +6 -1
  178. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +6 -1
  179. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +8 -3
  180. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -3
  181. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +8 -3
  182. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -3
  183. package/shortcutContexts/commands/moveCellSelection/left.js +6 -1
  184. package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -1
  185. package/shortcutContexts/commands/moveCellSelection/right.js +6 -1
  186. package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -1
  187. package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +4 -1
  188. package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +4 -1
  189. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +2 -0
  190. package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +2 -0
  191. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +2 -0
  192. package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +2 -0
  193. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +2 -0
  194. package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +2 -0
  195. package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +2 -0
  196. package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +2 -0
  197. package/shortcutContexts/commands/moveCellSelection/toMostRight.js +2 -0
  198. package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +2 -0
  199. package/shortcutContexts/commands/moveCellSelection/toMostTop.js +6 -1
  200. package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +6 -1
  201. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +2 -0
  202. package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +2 -0
  203. package/shortcutContexts/commands/moveCellSelection/up.js +2 -0
  204. package/shortcutContexts/commands/moveCellSelection/up.mjs +2 -0
  205. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +6 -1
  206. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +6 -1
  207. package/shortcutContexts/commands/selectAllCells.js +7 -2
  208. package/shortcutContexts/commands/selectAllCells.mjs +7 -2
  209. package/shortcutContexts/commands/selectAllCellsAndHeaders.js +7 -2
  210. package/shortcutContexts/commands/selectAllCellsAndHeaders.mjs +7 -2
  211. package/shortcutContexts/index.js +2 -2
  212. package/shortcutContexts/index.mjs +0 -2
  213. package/styles/handsontable.css +15 -17
  214. package/styles/handsontable.min.css +3 -3
  215. package/styles/ht-theme-horizon.css +2 -2
  216. package/styles/ht-theme-horizon.min.css +2 -2
  217. package/styles/ht-theme-main.css +2 -2
  218. package/styles/ht-theme-main.min.css +2 -2
  219. package/tableView.js +5 -8
  220. package/tableView.mjs +5 -8
  221. package/translations/indexMapper.js +0 -1
  222. package/translations/indexMapper.mjs +0 -1
  223. package/utils/ghostTable.js +3 -0
  224. package/utils/ghostTable.mjs +3 -0
package/editorManager.js CHANGED
@@ -80,13 +80,7 @@ class EditorManager {
80
80
  this.selection = _selection;
81
81
  this.eventManager = new _eventManager.default(hotInstance);
82
82
  this.hot.addHook('afterDocumentKeyDown', event => _assertClassBrand(_EditorManager_brand, this, _onAfterDocumentKeyDown).call(this, event));
83
-
84
- // Open editor when text composition is started (IME editor)
85
- this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'compositionstart', event => {
86
- if (!this.destroyed && this.hot.isListening()) {
87
- this.openEditor('', event);
88
- }
89
- });
83
+ this.hot.addHook('beforeCompositionStart', event => _assertClassBrand(_EditorManager_brand, this, _onAfterDocumentKeyDown).call(this, event));
90
84
  this.hot.view._wt.update('onCellDblClick', (event, coords, elem) => _assertClassBrand(_EditorManager_brand, this, _onCellDblClick).call(this, event, coords, elem));
91
85
  }
92
86
 
package/editorManager.mjs CHANGED
@@ -76,13 +76,7 @@ class EditorManager {
76
76
  this.selection = _selection;
77
77
  this.eventManager = new EventManager(hotInstance);
78
78
  this.hot.addHook('afterDocumentKeyDown', event => _assertClassBrand(_EditorManager_brand, this, _onAfterDocumentKeyDown).call(this, event));
79
-
80
- // Open editor when text composition is started (IME editor)
81
- this.eventManager.addEventListener(this.hot.rootDocument.documentElement, 'compositionstart', event => {
82
- if (!this.destroyed && this.hot.isListening()) {
83
- this.openEditor('', event);
84
- }
85
- });
79
+ this.hot.addHook('beforeCompositionStart', event => _assertClassBrand(_EditorManager_brand, this, _onAfterDocumentKeyDown).call(this, event));
86
80
  this.hot.view._wt.update('onCellDblClick', (event, coords, elem) => _assertClassBrand(_EditorManager_brand, this, _onCellDblClick).call(this, event, coords, elem));
87
81
  }
88
82
 
@@ -15,6 +15,7 @@ var _string = require("../../helpers/string");
15
15
  var _unicode = require("../../helpers/unicode");
16
16
  var _textRenderer = require("../../renderers/textRenderer");
17
17
  var _a11y = require("../../helpers/a11y");
18
+ var _function = require("../../helpers/function");
18
19
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
19
20
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
20
21
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
@@ -30,6 +31,7 @@ const EDITOR_TYPE = exports.EDITOR_TYPE = 'autocomplete';
30
31
  * @class AutocompleteEditor
31
32
  */
32
33
  var _idPrefix = /*#__PURE__*/new WeakMap();
34
+ var _focusDebounced = /*#__PURE__*/new WeakMap();
33
35
  var _AutocompleteEditor_brand = /*#__PURE__*/new WeakSet();
34
36
  class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
35
37
  constructor() {
@@ -62,6 +64,12 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
62
64
  * @type {string}
63
65
  */
64
66
  _classPrivateFieldInitSpec(this, _idPrefix, this.hot.guid.slice(0, 9));
67
+ /**
68
+ * Runs focus method after debounce.
69
+ */
70
+ _classPrivateFieldInitSpec(this, _focusDebounced, (0, _function.debounce)(() => {
71
+ this.focus();
72
+ }, 100));
65
73
  /**
66
74
  * Filters and sorts by relevance.
67
75
  *
@@ -147,7 +155,6 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
147
155
  }
148
156
  return this.TEXTAREA.value;
149
157
  }
150
-
151
158
  /**
152
159
  * Creates an editor's elements and adds necessary CSS classnames.
153
160
  */
@@ -193,10 +200,10 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
193
200
  this.showEditableElement();
194
201
  this.focus();
195
202
  this.addHook('beforeKeyDown', event => this.onBeforeKeyDown(event));
203
+ this.htEditor.addHook('afterScroll', _classPrivateFieldGet(_focusDebounced, this));
196
204
  this.htEditor.updateSettings({
197
205
  colWidths: trimDropdown ? [(0, _element.outerWidth)(this.TEXTAREA) - 2] : undefined,
198
206
  autoColumnSize: true,
199
- autoRowSize: true,
200
207
  renderer: (hotInstance, TD, row, col, prop, value, cellProperties) => {
201
208
  (0, _textRenderer.textRenderer)(hotInstance, TD, row, col, prop, value, cellProperties);
202
209
  const {
@@ -224,9 +231,21 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
224
231
  },
225
232
  afterSelectionEnd: (startRow, startCol) => {
226
233
  if (rootInstanceAriaTagsEnabled) {
234
+ const setA11yAttributes = TD => {
235
+ (0, _element.setAttribute)(TD, [(0, _a11y.A11Y_SELECTED)()]);
236
+ (0, _element.setAttribute)(this.TEXTAREA, ...(0, _a11y.A11Y_ACTIVEDESCENDANT)(TD.id));
237
+ };
227
238
  const TD = this.htEditor.getCell(startRow, startCol, true);
228
- (0, _element.setAttribute)(TD, [(0, _a11y.A11Y_SELECTED)()]);
229
- (0, _element.setAttribute)(this.TEXTAREA, ...(0, _a11y.A11Y_ACTIVEDESCENDANT)(TD.id));
239
+ if (TD !== null) {
240
+ setA11yAttributes(TD);
241
+ } else {
242
+ // If TD is null, it means that the cell is not (yet) in the viewport.
243
+ // Moving the logic to after it's been scrolled to the requested cell.
244
+ this.htEditor.addHookOnce('afterScrollVertically', () => {
245
+ const renderedTD = this.htEditor.getCell(startRow, startCol, true);
246
+ setA11yAttributes(renderedTD);
247
+ });
248
+ }
230
249
  }
231
250
  }
232
251
  });
@@ -304,7 +323,9 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
304
323
  }
305
324
  const orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;
306
325
  if (filterSetting === false) {
307
- highlightIndex = orderByRelevanceLength > 0 ? orderByRelevance[0] : 0;
326
+ if (orderByRelevanceLength) {
327
+ highlightIndex = orderByRelevance[0];
328
+ }
308
329
  } else {
309
330
  const sorted = [];
310
331
  for (let i = 0, choicesCount = choices.length; i < choicesCount; i++) {
@@ -468,7 +489,10 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
468
489
  const maxItems = Math.min(this.cellProperties.visibleRows, this.strippedChoices.length);
469
490
  const height = Array.from({
470
491
  length: maxItems
471
- }, (_, i) => i).reduce((h, index) => h + this.htEditor.getRowHeight(index), 0);
492
+ }, (_, i) => i).reduce((totalHeight, index) => {
493
+ const rowHeight = this.htEditor.getRowHeight(index) || this.htEditor.view.getDefaultRowHeight();
494
+ return totalHeight + rowHeight;
495
+ }, 0);
472
496
  return height + borderVerticalCompensation + 1;
473
497
  }
474
498
 
@@ -566,7 +590,7 @@ exports.AutocompleteEditor = AutocompleteEditor;
566
590
  function _fixDropdownWidth() {
567
591
  if (this.htEditor.view.hasVerticalScroll()) {
568
592
  this.htEditor.updateSettings({
569
- width: this.htEditor.getSettings().width + (0, _element.getScrollbarWidth)(this.hot.rootDocument)
593
+ width: this.getWidth() + (0, _element.getScrollbarWidth)(this.hot.rootDocument)
570
594
  });
571
595
  }
572
596
  }
@@ -20,6 +20,7 @@ import { stripTags } from "../../helpers/string.mjs";
20
20
  import { KEY_CODES, isPrintableChar } from "../../helpers/unicode.mjs";
21
21
  import { textRenderer } from "../../renderers/textRenderer/index.mjs";
22
22
  import { A11Y_ACTIVEDESCENDANT, A11Y_AUTOCOMPLETE, A11Y_COMBOBOX, A11Y_CONTROLS, A11Y_EXPANDED, A11Y_HASPOPUP, A11Y_LISTBOX, A11Y_LIVE, A11Y_OPTION, A11Y_POSINSET, A11Y_PRESENTATION, A11Y_RELEVANT, A11Y_SELECTED, A11Y_SETSIZE, A11Y_TEXT } from "../../helpers/a11y.mjs";
23
+ import { debounce } from "../../helpers/function.mjs";
23
24
  export const EDITOR_TYPE = 'autocomplete';
24
25
 
25
26
  /**
@@ -27,6 +28,7 @@ export const EDITOR_TYPE = 'autocomplete';
27
28
  * @class AutocompleteEditor
28
29
  */
29
30
  var _idPrefix = /*#__PURE__*/new WeakMap();
31
+ var _focusDebounced = /*#__PURE__*/new WeakMap();
30
32
  var _AutocompleteEditor_brand = /*#__PURE__*/new WeakSet();
31
33
  export class AutocompleteEditor extends HandsontableEditor {
32
34
  constructor() {
@@ -59,6 +61,12 @@ export class AutocompleteEditor extends HandsontableEditor {
59
61
  * @type {string}
60
62
  */
61
63
  _classPrivateFieldInitSpec(this, _idPrefix, this.hot.guid.slice(0, 9));
64
+ /**
65
+ * Runs focus method after debounce.
66
+ */
67
+ _classPrivateFieldInitSpec(this, _focusDebounced, debounce(() => {
68
+ this.focus();
69
+ }, 100));
62
70
  /**
63
71
  * Filters and sorts by relevance.
64
72
  *
@@ -144,7 +152,6 @@ export class AutocompleteEditor extends HandsontableEditor {
144
152
  }
145
153
  return this.TEXTAREA.value;
146
154
  }
147
-
148
155
  /**
149
156
  * Creates an editor's elements and adds necessary CSS classnames.
150
157
  */
@@ -190,10 +197,10 @@ export class AutocompleteEditor extends HandsontableEditor {
190
197
  this.showEditableElement();
191
198
  this.focus();
192
199
  this.addHook('beforeKeyDown', event => this.onBeforeKeyDown(event));
200
+ this.htEditor.addHook('afterScroll', _classPrivateFieldGet(_focusDebounced, this));
193
201
  this.htEditor.updateSettings({
194
202
  colWidths: trimDropdown ? [outerWidth(this.TEXTAREA) - 2] : undefined,
195
203
  autoColumnSize: true,
196
- autoRowSize: true,
197
204
  renderer: (hotInstance, TD, row, col, prop, value, cellProperties) => {
198
205
  textRenderer(hotInstance, TD, row, col, prop, value, cellProperties);
199
206
  const {
@@ -221,9 +228,21 @@ export class AutocompleteEditor extends HandsontableEditor {
221
228
  },
222
229
  afterSelectionEnd: (startRow, startCol) => {
223
230
  if (rootInstanceAriaTagsEnabled) {
231
+ const setA11yAttributes = TD => {
232
+ setAttribute(TD, [A11Y_SELECTED()]);
233
+ setAttribute(this.TEXTAREA, ...A11Y_ACTIVEDESCENDANT(TD.id));
234
+ };
224
235
  const TD = this.htEditor.getCell(startRow, startCol, true);
225
- setAttribute(TD, [A11Y_SELECTED()]);
226
- setAttribute(this.TEXTAREA, ...A11Y_ACTIVEDESCENDANT(TD.id));
236
+ if (TD !== null) {
237
+ setA11yAttributes(TD);
238
+ } else {
239
+ // If TD is null, it means that the cell is not (yet) in the viewport.
240
+ // Moving the logic to after it's been scrolled to the requested cell.
241
+ this.htEditor.addHookOnce('afterScrollVertically', () => {
242
+ const renderedTD = this.htEditor.getCell(startRow, startCol, true);
243
+ setA11yAttributes(renderedTD);
244
+ });
245
+ }
227
246
  }
228
247
  }
229
248
  });
@@ -301,7 +320,9 @@ export class AutocompleteEditor extends HandsontableEditor {
301
320
  }
302
321
  const orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;
303
322
  if (filterSetting === false) {
304
- highlightIndex = orderByRelevanceLength > 0 ? orderByRelevance[0] : 0;
323
+ if (orderByRelevanceLength) {
324
+ highlightIndex = orderByRelevance[0];
325
+ }
305
326
  } else {
306
327
  const sorted = [];
307
328
  for (let i = 0, choicesCount = choices.length; i < choicesCount; i++) {
@@ -465,7 +486,10 @@ export class AutocompleteEditor extends HandsontableEditor {
465
486
  const maxItems = Math.min(this.cellProperties.visibleRows, this.strippedChoices.length);
466
487
  const height = Array.from({
467
488
  length: maxItems
468
- }, (_, i) => i).reduce((h, index) => h + this.htEditor.getRowHeight(index), 0);
489
+ }, (_, i) => i).reduce((totalHeight, index) => {
490
+ const rowHeight = this.htEditor.getRowHeight(index) || this.htEditor.view.getDefaultRowHeight();
491
+ return totalHeight + rowHeight;
492
+ }, 0);
469
493
  return height + borderVerticalCompensation + 1;
470
494
  }
471
495
 
@@ -562,7 +586,7 @@ export class AutocompleteEditor extends HandsontableEditor {
562
586
  function _fixDropdownWidth() {
563
587
  if (this.htEditor.view.hasVerticalScroll()) {
564
588
  this.htEditor.updateSettings({
565
- width: this.htEditor.getSettings().width + getScrollbarWidth(this.hot.rootDocument)
589
+ width: this.getWidth() + getScrollbarWidth(this.hot.rootDocument)
566
590
  });
567
591
  }
568
592
  }
package/focusManager.js CHANGED
@@ -214,8 +214,10 @@ class FocusManager {
214
214
  (_classPrivateFieldGet6 = _classPrivateFieldGet(_hot, this).getActiveEditor()) === null || _classPrivateFieldGet6 === void 0 || (_classPrivateFieldGet7 = _classPrivateFieldGet6.refreshValue) === null || _classPrivateFieldGet7 === void 0 || _classPrivateFieldGet7.call(_classPrivateFieldGet6);
215
215
  if (!_classPrivateFieldGet(_debouncedSelect, this).has(delay)) {
216
216
  _classPrivateFieldGet(_debouncedSelect, this).set(delay, (0, _function.debounce)(() => {
217
- var _this$getRefocusEleme;
218
- (_this$getRefocusEleme = this.getRefocusElement()) === null || _this$getRefocusEleme === void 0 || _this$getRefocusEleme.select();
217
+ if (!_classPrivateFieldGet(_hot, this).isDestroyed) {
218
+ var _this$getRefocusEleme;
219
+ (_this$getRefocusEleme = this.getRefocusElement()) === null || _this$getRefocusEleme === void 0 || _this$getRefocusEleme.select();
220
+ }
219
221
  }, delay));
220
222
  }
221
223
  _classPrivateFieldGet(_debouncedSelect, this).get(delay)();
package/focusManager.mjs CHANGED
@@ -211,8 +211,10 @@ export class FocusManager {
211
211
  (_classPrivateFieldGet6 = _classPrivateFieldGet(_hot, this).getActiveEditor()) === null || _classPrivateFieldGet6 === void 0 || (_classPrivateFieldGet7 = _classPrivateFieldGet6.refreshValue) === null || _classPrivateFieldGet7 === void 0 || _classPrivateFieldGet7.call(_classPrivateFieldGet6);
212
212
  if (!_classPrivateFieldGet(_debouncedSelect, this).has(delay)) {
213
213
  _classPrivateFieldGet(_debouncedSelect, this).set(delay, debounce(() => {
214
- var _this$getRefocusEleme;
215
- (_this$getRefocusEleme = this.getRefocusElement()) === null || _this$getRefocusEleme === void 0 || _this$getRefocusEleme.select();
214
+ if (!_classPrivateFieldGet(_hot, this).isDestroyed) {
215
+ var _this$getRefocusEleme;
216
+ (_this$getRefocusEleme = this.getRefocusElement()) === null || _this$getRefocusEleme === void 0 || _this$getRefocusEleme.select();
217
+ }
216
218
  }, delay));
217
219
  }
218
220
  _classPrivateFieldGet(_debouncedSelect, this).get(delay)();
@@ -41,7 +41,7 @@ const platforms = {
41
41
  mac: tester(platform => /^Mac/.test(platform)),
42
42
  win: tester(platform => /^Win/.test(platform)),
43
43
  linux: tester(platform => /^Linux/.test(platform)),
44
- ios: tester(ua => /iPhone|iPad|iPod/i.test(ua))
44
+ ios: tester(platform => /iPhone|iPad|iPod/i.test(platform))
45
45
  };
46
46
 
47
47
  /**
@@ -23,7 +23,7 @@ const platforms = {
23
23
  mac: tester(platform => /^Mac/.test(platform)),
24
24
  win: tester(platform => /^Win/.test(platform)),
25
25
  linux: tester(platform => /^Linux/.test(platform)),
26
- ios: tester(ua => /iPhone|iPad|iPod/i.test(ua))
26
+ ios: tester(platform => /iPhone|iPad|iPod/i.test(platform))
27
27
  };
28
28
 
29
29
  /**
@@ -38,6 +38,7 @@ export function setCaretPosition(element: Element, pos: number, endPos: number):
38
38
  export function getScrollbarWidth(rootDocument?: Document): number;
39
39
  export function hasVerticalScrollbar(element: HTMLElement): boolean;
40
40
  export function hasHorizontalScrollbar(element: HTMLElement): boolean;
41
+ export function hasZeroHeight(element: HTMLElement): boolean;
41
42
  export function setOverlayPosition(overlayElem: HTMLElement, left: string | number, top: string | number): void;
42
43
  export function getCssTransform(element: HTMLElement): number;
43
44
  export function resetCssTransform(element: HTMLElement): void;
@@ -31,6 +31,7 @@ exports.hasAccessToParentWindow = hasAccessToParentWindow;
31
31
  exports.hasClass = hasClass;
32
32
  exports.hasHorizontalScrollbar = hasHorizontalScrollbar;
33
33
  exports.hasVerticalScrollbar = hasVerticalScrollbar;
34
+ exports.hasZeroHeight = hasZeroHeight;
34
35
  exports.index = index;
35
36
  exports.innerHeight = innerHeight;
36
37
  exports.innerWidth = innerWidth;
@@ -553,6 +554,25 @@ function isVisible(element) {
553
554
  return true;
554
555
  }
555
556
 
557
+ /**
558
+ * Returns true if the element has the height set to `0` or `0px` and overflow to `hidden` (height deliberately set to be 0).
559
+ *
560
+ * @param {HTMLElement} element The element to check.
561
+ * @returns {boolean} `true` if the element has height set to `0` or `0px` and overflow is set to `hidden`, `false` otherwise.
562
+ */
563
+ function hasZeroHeight(element) {
564
+ const rootDocument = element.ownerDocument;
565
+ const rootWindow = rootDocument.defaultView;
566
+ let currentElement = element;
567
+ while (currentElement.parentNode) {
568
+ if (currentElement.style.height === '0px' || currentElement.style.height === '0') {
569
+ return rootWindow.getComputedStyle(currentElement).overflow === 'hidden';
570
+ }
571
+ currentElement = currentElement.parentNode;
572
+ }
573
+ return false;
574
+ }
575
+
556
576
  /**
557
577
  * Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.
558
578
  *
@@ -492,6 +492,25 @@ export function isVisible(element) {
492
492
  return true;
493
493
  }
494
494
 
495
+ /**
496
+ * Returns true if the element has the height set to `0` or `0px` and overflow to `hidden` (height deliberately set to be 0).
497
+ *
498
+ * @param {HTMLElement} element The element to check.
499
+ * @returns {boolean} `true` if the element has height set to `0` or `0px` and overflow is set to `hidden`, `false` otherwise.
500
+ */
501
+ export function hasZeroHeight(element) {
502
+ const rootDocument = element.ownerDocument;
503
+ const rootWindow = rootDocument.defaultView;
504
+ let currentElement = element;
505
+ while (currentElement.parentNode) {
506
+ if (currentElement.style.height === '0px' || currentElement.style.height === '0') {
507
+ return rootWindow.getComputedStyle(currentElement).overflow === 'hidden';
508
+ }
509
+ currentElement = currentElement.parentNode;
510
+ }
511
+ return false;
512
+ }
513
+
495
514
  /**
496
515
  * Returns elements top and left offset relative to the document. Function is not compatible with jQuery offset.
497
516
  *
package/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "15.2.0";
137
+ const hotVersion = "15.3.0-next-6f5f494-20250424";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';
@@ -142,7 +142,7 @@ function _injectProductInfo(key, element) {
142
142
  const schemaValidity = _checkKeySchema(key);
143
143
  if (hasValidType || isNonCommercial || schemaValidity) {
144
144
  if (schemaValidity) {
145
- const releaseDate = (0, _moment.default)("19/03/2025", 'DD/MM/YYYY');
145
+ const releaseDate = (0, _moment.default)("29/04/2025", 'DD/MM/YYYY');
146
146
  const releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
147
147
  const keyValidityDays = _extractTime(key);
148
148
  keyValidityDate = (0, _moment.default)((keyValidityDays + 1) * 8.64e7, 'x').format('MMMM DD, YYYY');
package/helpers/mixed.mjs CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
124
124
  export function _injectProductInfo(key, element) {
125
125
  const hasValidType = !isEmpty(key);
126
126
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
127
- const hotVersion = "15.2.0";
127
+ const hotVersion = "15.3.0-next-6f5f494-20250424";
128
128
  let keyValidityDate;
129
129
  let consoleMessageState = 'invalid';
130
130
  let domMessageState = 'invalid';
@@ -132,7 +132,7 @@ export function _injectProductInfo(key, element) {
132
132
  const schemaValidity = _checkKeySchema(key);
133
133
  if (hasValidType || isNonCommercial || schemaValidity) {
134
134
  if (schemaValidity) {
135
- const releaseDate = moment("19/03/2025", 'DD/MM/YYYY');
135
+ const releaseDate = moment("29/04/2025", 'DD/MM/YYYY');
136
136
  const releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
137
137
  const keyValidityDays = _extractTime(key);
138
138
  keyValidityDate = moment((keyValidityDays + 1) * 8.64e7, 'x').format('MMMM DD, YYYY');
package/helpers/object.js CHANGED
@@ -281,6 +281,9 @@ function getProperty(object, name) {
281
281
  * @param {*} value Value to be assigned at the provided property.
282
282
  */
283
283
  function setProperty(object, name, value) {
284
+ if (typeof name !== 'string') {
285
+ return;
286
+ }
284
287
  const names = name.split('.');
285
288
  let workingObject = object;
286
289
  names.forEach((propName, index) => {
@@ -262,6 +262,9 @@ export function getProperty(object, name) {
262
262
  * @param {*} value Value to be assigned at the provided property.
263
263
  */
264
264
  export function setProperty(object, name, value) {
265
+ if (typeof name !== 'string') {
266
+ return;
267
+ }
265
268
  const names = name.split('.');
266
269
  let workingObject = object;
267
270
  names.forEach((propName, index) => {
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "15.2.0",
13
+ "version": "15.3.0-next-6f5f494-20250424",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -129,6 +129,7 @@ const COLUMN_SIZE_MAP_NAME = 'autoColumnSize';
129
129
  * :::
130
130
  */
131
131
  /* eslint-enable jsdoc/require-description-complete-sentence */
132
+ var _isInitialized = /*#__PURE__*/new WeakMap();
132
133
  var _cachedColumnHeaders = /*#__PURE__*/new WeakMap();
133
134
  var _visualColumnsToRefresh = /*#__PURE__*/new WeakMap();
134
135
  var _AutoColumnSize_brand = /*#__PURE__*/new WeakSet();
@@ -218,6 +219,12 @@ class AutoColumnSize extends _base.BasePlugin {
218
219
  * @type {PhysicalIndexToValueMap}
219
220
  */
220
221
  _defineProperty(this, "columnWidthsMap", new _translations.PhysicalIndexToValueMap());
222
+ /**
223
+ * `true` value indicates that the #onInit() function has been already called.
224
+ *
225
+ * @type {boolean}
226
+ */
227
+ _classPrivateFieldInitSpec(this, _isInitialized, false);
221
228
  /**
222
229
  * Cached column header names. It is used to diff current column headers with previous state and detect which
223
230
  * columns width should be updated.
@@ -318,7 +325,7 @@ class AutoColumnSize extends _base.BasePlugin {
318
325
  if (firstVisibleColumn === -1 || lastVisibleColumn === -1) {
319
326
  return;
320
327
  }
321
- const overwriteCache = this.hot.renderCall;
328
+ const overwriteCache = this.hot.forceFullRender;
322
329
  this.calculateColumnsWidth({
323
330
  from: firstVisibleColumn,
324
331
  to: lastVisibleColumn
@@ -356,17 +363,11 @@ class AutoColumnSize extends _base.BasePlugin {
356
363
  physicalColumn = visualColumn;
357
364
  }
358
365
  if (overwriteCache || this.columnWidthsMap.getValueAtIndex(physicalColumn) === null && !this.hot._getColWidthFromSettings(physicalColumn)) {
359
- const samples = this.samplesGenerator.generateColumnSamples(visualColumn, rowsRange);
360
- samples.forEach((sample, column) => this.ghostTable.addColumn(column, sample));
366
+ _assertClassBrand(_AutoColumnSize_brand, this, _fillGhostTableWithSamples).call(this, visualColumn, rowsRange);
361
367
  }
362
368
  });
363
369
  if (this.ghostTable.columns.length) {
364
- this.hot.batchExecution(() => {
365
- this.ghostTable.getWidths((visualColumn, width) => {
366
- const physicalColumn = this.hot.toPhysicalColumn(visualColumn);
367
- this.columnWidthsMap.setValueAtIndex(physicalColumn, width);
368
- });
369
- }, true);
370
+ _assertClassBrand(_AutoColumnSize_brand, this, _updateColumnWidthsMapBasedOnGhostTable).call(this);
370
371
  this.measuredColumns = columnsRange.to + 1;
371
372
  this.ghostTable.clean();
372
373
  }
@@ -577,20 +578,36 @@ function _calculateSpecificColumnsWidth(visualColumns) {
577
578
  return;
578
579
  }
579
580
  if (!this.hot._getColWidthFromSettings(physicalColumn)) {
580
- const samples = this.samplesGenerator.generateColumnSamples(visualColumn, rowsRange);
581
- samples.forEach((sample, column) => this.ghostTable.addColumn(column, sample));
581
+ _assertClassBrand(_AutoColumnSize_brand, this, _fillGhostTableWithSamples).call(this, visualColumn, rowsRange);
582
582
  }
583
583
  });
584
584
  if (this.ghostTable.columns.length) {
585
- this.hot.batchExecution(() => {
586
- this.ghostTable.getWidths((visualColumn, width) => {
587
- const physicalColumn = this.hot.toPhysicalColumn(visualColumn);
588
- this.columnWidthsMap.setValueAtIndex(physicalColumn, width);
589
- });
590
- }, true);
585
+ _assertClassBrand(_AutoColumnSize_brand, this, _updateColumnWidthsMapBasedOnGhostTable).call(this);
591
586
  this.ghostTable.clean();
592
587
  }
593
588
  }
589
+ /**
590
+ * Processes a single column for width calculation.
591
+ *
592
+ * @param {number} visualColumn Visual column index.
593
+ * @param {object} rowsRange Range of rows to process.
594
+ */
595
+ function _fillGhostTableWithSamples(visualColumn, rowsRange) {
596
+ const samples = this.samplesGenerator.generateColumnSamples(visualColumn, rowsRange);
597
+ samples.forEach((sample, column) => this.ghostTable.addColumn(column, sample));
598
+ }
599
+ /**
600
+ * Updates the column widths map with calculated widths from the ghost table.
601
+ *
602
+ */
603
+ function _updateColumnWidthsMapBasedOnGhostTable() {
604
+ this.hot.batchExecution(() => {
605
+ this.ghostTable.getWidths((visualColumn, width) => {
606
+ const physicalColumn = this.hot.toPhysicalColumn(visualColumn);
607
+ this.columnWidthsMap.setValueAtIndex(physicalColumn, width);
608
+ });
609
+ }, true);
610
+ }
594
611
  function _onBeforeRender() {
595
612
  this.calculateVisibleColumnsWidth();
596
613
  if (!this.inProgress) {
@@ -647,6 +664,7 @@ function _onBeforeColumnResize(size, column, isDblClick) {
647
664
  function _onInit() {
648
665
  _classPrivateFieldSet(_cachedColumnHeaders, this, this.hot.getColHeader());
649
666
  this.recalculateAllColumnsWidth();
667
+ _classPrivateFieldSet(_isInitialized, this, true);
650
668
  }
651
669
  /**
652
670
  * After formulas values updated listener.
@@ -654,6 +672,9 @@ function _onInit() {
654
672
  * @param {Array} changes An array of modified data.
655
673
  */
656
674
  function _onAfterFormulasValuesUpdate(changes) {
675
+ if (!_classPrivateFieldGet(_isInitialized, this)) {
676
+ return;
677
+ }
657
678
  const changedColumns = changes.reduce((acc, change) => {
658
679
  var _change$address;
659
680
  const physicalColumn = (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.col;
@@ -125,6 +125,7 @@ const COLUMN_SIZE_MAP_NAME = 'autoColumnSize';
125
125
  * :::
126
126
  */
127
127
  /* eslint-enable jsdoc/require-description-complete-sentence */
128
+ var _isInitialized = /*#__PURE__*/new WeakMap();
128
129
  var _cachedColumnHeaders = /*#__PURE__*/new WeakMap();
129
130
  var _visualColumnsToRefresh = /*#__PURE__*/new WeakMap();
130
131
  var _AutoColumnSize_brand = /*#__PURE__*/new WeakSet();
@@ -214,6 +215,12 @@ export class AutoColumnSize extends BasePlugin {
214
215
  * @type {PhysicalIndexToValueMap}
215
216
  */
216
217
  _defineProperty(this, "columnWidthsMap", new IndexToValueMap());
218
+ /**
219
+ * `true` value indicates that the #onInit() function has been already called.
220
+ *
221
+ * @type {boolean}
222
+ */
223
+ _classPrivateFieldInitSpec(this, _isInitialized, false);
217
224
  /**
218
225
  * Cached column header names. It is used to diff current column headers with previous state and detect which
219
226
  * columns width should be updated.
@@ -314,7 +321,7 @@ export class AutoColumnSize extends BasePlugin {
314
321
  if (firstVisibleColumn === -1 || lastVisibleColumn === -1) {
315
322
  return;
316
323
  }
317
- const overwriteCache = this.hot.renderCall;
324
+ const overwriteCache = this.hot.forceFullRender;
318
325
  this.calculateColumnsWidth({
319
326
  from: firstVisibleColumn,
320
327
  to: lastVisibleColumn
@@ -352,17 +359,11 @@ export class AutoColumnSize extends BasePlugin {
352
359
  physicalColumn = visualColumn;
353
360
  }
354
361
  if (overwriteCache || this.columnWidthsMap.getValueAtIndex(physicalColumn) === null && !this.hot._getColWidthFromSettings(physicalColumn)) {
355
- const samples = this.samplesGenerator.generateColumnSamples(visualColumn, rowsRange);
356
- samples.forEach((sample, column) => this.ghostTable.addColumn(column, sample));
362
+ _assertClassBrand(_AutoColumnSize_brand, this, _fillGhostTableWithSamples).call(this, visualColumn, rowsRange);
357
363
  }
358
364
  });
359
365
  if (this.ghostTable.columns.length) {
360
- this.hot.batchExecution(() => {
361
- this.ghostTable.getWidths((visualColumn, width) => {
362
- const physicalColumn = this.hot.toPhysicalColumn(visualColumn);
363
- this.columnWidthsMap.setValueAtIndex(physicalColumn, width);
364
- });
365
- }, true);
366
+ _assertClassBrand(_AutoColumnSize_brand, this, _updateColumnWidthsMapBasedOnGhostTable).call(this);
366
367
  this.measuredColumns = columnsRange.to + 1;
367
368
  this.ghostTable.clean();
368
369
  }
@@ -572,20 +573,36 @@ function _calculateSpecificColumnsWidth(visualColumns) {
572
573
  return;
573
574
  }
574
575
  if (!this.hot._getColWidthFromSettings(physicalColumn)) {
575
- const samples = this.samplesGenerator.generateColumnSamples(visualColumn, rowsRange);
576
- samples.forEach((sample, column) => this.ghostTable.addColumn(column, sample));
576
+ _assertClassBrand(_AutoColumnSize_brand, this, _fillGhostTableWithSamples).call(this, visualColumn, rowsRange);
577
577
  }
578
578
  });
579
579
  if (this.ghostTable.columns.length) {
580
- this.hot.batchExecution(() => {
581
- this.ghostTable.getWidths((visualColumn, width) => {
582
- const physicalColumn = this.hot.toPhysicalColumn(visualColumn);
583
- this.columnWidthsMap.setValueAtIndex(physicalColumn, width);
584
- });
585
- }, true);
580
+ _assertClassBrand(_AutoColumnSize_brand, this, _updateColumnWidthsMapBasedOnGhostTable).call(this);
586
581
  this.ghostTable.clean();
587
582
  }
588
583
  }
584
+ /**
585
+ * Processes a single column for width calculation.
586
+ *
587
+ * @param {number} visualColumn Visual column index.
588
+ * @param {object} rowsRange Range of rows to process.
589
+ */
590
+ function _fillGhostTableWithSamples(visualColumn, rowsRange) {
591
+ const samples = this.samplesGenerator.generateColumnSamples(visualColumn, rowsRange);
592
+ samples.forEach((sample, column) => this.ghostTable.addColumn(column, sample));
593
+ }
594
+ /**
595
+ * Updates the column widths map with calculated widths from the ghost table.
596
+ *
597
+ */
598
+ function _updateColumnWidthsMapBasedOnGhostTable() {
599
+ this.hot.batchExecution(() => {
600
+ this.ghostTable.getWidths((visualColumn, width) => {
601
+ const physicalColumn = this.hot.toPhysicalColumn(visualColumn);
602
+ this.columnWidthsMap.setValueAtIndex(physicalColumn, width);
603
+ });
604
+ }, true);
605
+ }
589
606
  function _onBeforeRender() {
590
607
  this.calculateVisibleColumnsWidth();
591
608
  if (!this.inProgress) {
@@ -642,6 +659,7 @@ function _onBeforeColumnResize(size, column, isDblClick) {
642
659
  function _onInit() {
643
660
  _classPrivateFieldSet(_cachedColumnHeaders, this, this.hot.getColHeader());
644
661
  this.recalculateAllColumnsWidth();
662
+ _classPrivateFieldSet(_isInitialized, this, true);
645
663
  }
646
664
  /**
647
665
  * After formulas values updated listener.
@@ -649,6 +667,9 @@ function _onInit() {
649
667
  * @param {Array} changes An array of modified data.
650
668
  */
651
669
  function _onAfterFormulasValuesUpdate(changes) {
670
+ if (!_classPrivateFieldGet(_isInitialized, this)) {
671
+ return;
672
+ }
652
673
  const changedColumns = changes.reduce((acc, change) => {
653
674
  var _change$address;
654
675
  const physicalColumn = (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.col;