handsontable 0.0.0-next-0306a1a-20240826 → 0.0.0-next-1dfe61f-20240910

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (106) hide show
  1. package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleColumns.js +126 -0
  2. package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleColumns.mjs +122 -0
  3. package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleRows.js +119 -0
  4. package/3rdparty/walkontable/src/calculator/calculationType/fullyVisibleRows.mjs +115 -0
  5. package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleColumns.js +125 -0
  6. package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleColumns.mjs +121 -0
  7. package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleRows.js +118 -0
  8. package/3rdparty/walkontable/src/calculator/calculationType/partiallyVisibleRows.mjs +114 -0
  9. package/3rdparty/walkontable/src/calculator/{renderAllColumns.js → calculationType/renderedAllColumns.js} +32 -9
  10. package/3rdparty/walkontable/src/calculator/{renderAllColumns.mjs → calculationType/renderedAllColumns.mjs} +31 -8
  11. package/3rdparty/walkontable/src/calculator/{renderAllRows.js → calculationType/renderedAllRows.js} +32 -9
  12. package/3rdparty/walkontable/src/calculator/{renderAllRows.mjs → calculationType/renderedAllRows.mjs} +31 -8
  13. package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.js +37 -0
  14. package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.mjs +33 -0
  15. package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.js +37 -0
  16. package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.mjs +33 -0
  17. package/3rdparty/walkontable/src/calculator/index.js +18 -17
  18. package/3rdparty/walkontable/src/calculator/index.mjs +11 -6
  19. package/3rdparty/walkontable/src/calculator/viewportBase.js +92 -0
  20. package/3rdparty/walkontable/src/calculator/viewportBase.mjs +88 -0
  21. package/3rdparty/walkontable/src/calculator/viewportColumns.js +51 -145
  22. package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +51 -145
  23. package/3rdparty/walkontable/src/calculator/viewportRows.js +59 -141
  24. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +59 -141
  25. package/3rdparty/walkontable/src/index.js +2 -0
  26. package/3rdparty/walkontable/src/index.mjs +2 -2
  27. package/3rdparty/walkontable/src/renderer/rows.js +10 -0
  28. package/3rdparty/walkontable/src/renderer/rows.mjs +11 -1
  29. package/3rdparty/walkontable/src/table.js +5 -11
  30. package/3rdparty/walkontable/src/table.mjs +5 -11
  31. package/3rdparty/walkontable/src/utils/column.js +2 -1
  32. package/3rdparty/walkontable/src/utils/column.mjs +2 -1
  33. package/3rdparty/walkontable/src/utils/columnStretching.js +10 -19
  34. package/3rdparty/walkontable/src/utils/columnStretching.mjs +10 -19
  35. package/3rdparty/walkontable/src/viewport.js +35 -46
  36. package/3rdparty/walkontable/src/viewport.mjs +36 -47
  37. package/CHANGELOG.md +27 -0
  38. package/base.js +2 -2
  39. package/base.mjs +2 -2
  40. package/core.d.ts +1 -2
  41. package/core.js +1 -1
  42. package/core.mjs +2 -2
  43. package/dataMap/metaManager/metaSchema.js +5 -6
  44. package/dataMap/metaManager/metaSchema.mjs +5 -6
  45. package/dist/handsontable.css +32 -20
  46. package/dist/handsontable.full.css +32 -20
  47. package/dist/handsontable.full.js +2751 -2091
  48. package/dist/handsontable.full.min.css +5 -5
  49. package/dist/handsontable.full.min.js +148 -148
  50. package/dist/handsontable.js +2752 -2092
  51. package/dist/handsontable.min.css +4 -4
  52. package/dist/handsontable.min.js +32 -32
  53. package/editors/autocompleteEditor/autocompleteEditor.d.ts +1 -1
  54. package/helpers/a11y.js +2 -0
  55. package/helpers/a11y.mjs +1 -0
  56. package/helpers/mixed.js +2 -2
  57. package/helpers/mixed.mjs +2 -2
  58. package/package.json +1 -1
  59. package/pluginHooks.d.ts +1 -1
  60. package/pluginHooks.js +1 -1
  61. package/pluginHooks.mjs +1 -1
  62. package/plugins/autoColumnSize/autoColumnSize.js +1 -1
  63. package/plugins/autoColumnSize/autoColumnSize.mjs +2 -2
  64. package/plugins/autoRowSize/autoRowSize.js +1 -2
  65. package/plugins/autoRowSize/autoRowSize.mjs +1 -2
  66. package/plugins/columnSorting/columnSorting.js +10 -1
  67. package/plugins/columnSorting/columnSorting.mjs +10 -1
  68. package/plugins/contextMenu/menu/menuItemRenderer.js +3 -4
  69. package/plugins/contextMenu/menu/menuItemRenderer.mjs +5 -6
  70. package/plugins/contextMenu/menu/positioner.js +4 -12
  71. package/plugins/contextMenu/menu/positioner.mjs +4 -12
  72. package/plugins/contextMenu/menu/utils.js +11 -0
  73. package/plugins/contextMenu/menu/utils.mjs +10 -0
  74. package/plugins/contextMenu/predefinedItems/alignment.js +67 -49
  75. package/plugins/contextMenu/predefinedItems/alignment.mjs +68 -50
  76. package/plugins/contextMenu/predefinedItems/readOnly.js +11 -0
  77. package/plugins/contextMenu/predefinedItems/readOnly.mjs +11 -0
  78. package/plugins/contextMenu/utils.js +26 -0
  79. package/plugins/contextMenu/utils.mjs +24 -0
  80. package/plugins/copyPaste/copyPaste.js +14 -14
  81. package/plugins/copyPaste/copyPaste.mjs +14 -14
  82. package/plugins/dropdownMenu/dropdownMenu.js +10 -4
  83. package/plugins/dropdownMenu/dropdownMenu.mjs +10 -4
  84. package/plugins/filters/component/condition.js +6 -1
  85. package/plugins/filters/component/condition.mjs +6 -1
  86. package/plugins/filters/component/value.js +6 -1
  87. package/plugins/filters/component/value.mjs +6 -1
  88. package/plugins/filters/conditionCollection.d.ts +4 -3
  89. package/plugins/filters/conditionCollection.js +26 -0
  90. package/plugins/filters/conditionCollection.mjs +26 -0
  91. package/plugins/filters/filters.js +2 -1
  92. package/plugins/filters/filters.mjs +2 -1
  93. package/plugins/filters/ui/multipleSelect.js +7 -9
  94. package/plugins/filters/ui/multipleSelect.mjs +7 -9
  95. package/plugins/manualRowResize/manualRowResize.js +1 -1
  96. package/plugins/manualRowResize/manualRowResize.mjs +2 -2
  97. package/plugins/mergeCells/cellsCollection.js +11 -9
  98. package/plugins/mergeCells/cellsCollection.mjs +12 -10
  99. package/plugins/undoRedo/undoRedo.js +9 -5
  100. package/plugins/undoRedo/undoRedo.mjs +9 -5
  101. package/shortcuts/utils.js +3 -1
  102. package/shortcuts/utils.mjs +3 -1
  103. package/utils/ghostTable.js +11 -9
  104. package/utils/ghostTable.mjs +12 -10
  105. package/3rdparty/walkontable/src/calculator/constants.js +0 -26
  106. package/3rdparty/walkontable/src/calculator/constants.mjs +0 -23
@@ -31,6 +31,8 @@ class Viewport {
31
31
  this.rowHeaderWidth = NaN;
32
32
  this.rowsVisibleCalculator = null;
33
33
  this.columnsVisibleCalculator = null;
34
+ this.rowsCalculatorTypes = new Map([['rendered', () => this.wtSettings.getSetting('renderAllRows') ? new _calculator.RenderedAllRowsCalculationType() : new _calculator.RenderedRowsCalculationType()], ['fullyVisible', () => new _calculator.FullyVisibleRowsCalculationType()], ['partiallyVisible', () => new _calculator.PartiallyVisibleRowsCalculationType()]]);
35
+ this.columnsCalculatorTypes = new Map([['rendered', () => this.wtSettings.getSetting('renderAllColumns') ? new _calculator.RenderedAllColumnsCalculationType() : new _calculator.RenderedColumnsCalculationType()], ['fullyVisible', () => new _calculator.FullyVisibleColumnsCalculationType()], ['partiallyVisible', () => new _calculator.PartiallyVisibleColumnsCalculationType()]]);
34
36
  this.eventManager = eventManager;
35
37
  this.eventManager.addEventListener(this.domBindings.rootWindow, 'resize', () => {
36
38
  this.clientHeight = this.getWorkspaceHeight();
@@ -241,25 +243,20 @@ class Viewport {
241
243
  }
242
244
 
243
245
  /**
244
- * Creates:
245
- * - rowsRenderCalculator (before draw, to qualify rows for rendering)
246
- * - rowsVisibleCalculator (after draw, to measure which rows are actually visible).
246
+ * Creates rows calculators. The type of the calculations can be chosen from the list:
247
+ * - 'rendered' Calculates rows that should be rendered within the current table's viewport;
248
+ * - 'fullyVisible' Calculates rows that are fully visible (used mostly for scrolling purposes);
249
+ * - 'partiallyVisible' Calculates rows that are partially visible (used mostly for scrolling purposes).
247
250
  *
248
- * @param {number} calculationType The render type ID, which determines for what type of
249
- * calculation calculator is created.
251
+ * @param {'rendered' | 'fullyVisible' | 'partiallyVisible'} calculatorTypes The list of the calculation types.
250
252
  * @returns {ViewportRowsCalculator}
251
253
  */
252
254
  createRowsCalculator() {
253
- let calculationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _calculator.RENDER_TYPE;
255
+ let calculatorTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['rendered', 'fullyVisible', 'partiallyVisible'];
254
256
  const {
255
257
  wtSettings,
256
258
  wtTable
257
259
  } = this;
258
- if (wtSettings.getSetting('renderAllRows') && calculationType === _calculator.RENDER_TYPE) {
259
- return new _calculator.RenderAllRowsCalculator({
260
- totalRows: wtSettings.getSetting('totalRows')
261
- });
262
- }
263
260
  let height = this.getViewportHeight();
264
261
  let scrollbarHeight;
265
262
  let fixedRowsHeight;
@@ -283,36 +280,31 @@ class Viewport {
283
280
  scrollbarHeight = (0, _element.getScrollbarWidth)(this.domBindings.rootDocument);
284
281
  }
285
282
  return new _calculator.ViewportRowsCalculator({
283
+ calculationTypes: calculatorTypes.map(type => [type, this.rowsCalculatorTypes.get(type)()]),
286
284
  viewportHeight: height,
287
285
  scrollOffset: pos,
288
286
  totalRows: wtSettings.getSetting('totalRows'),
289
287
  rowHeightFn: sourceRow => wtTable.getRowHeight(sourceRow),
290
288
  overrideFn: wtSettings.getSettingPure('viewportRowCalculatorOverride'),
291
- calculationType,
292
289
  horizontalScrollbarHeight: scrollbarHeight
293
290
  });
294
291
  }
295
292
 
296
293
  /**
297
- * Creates:
298
- * - columnsRenderCalculator (before draw, to qualify columns for rendering)
299
- * - columnsVisibleCalculator (after draw, to measure which columns are actually visible).
294
+ * Creates columns calculators. The type of the calculations can be chosen from the list:
295
+ * - 'rendered' Calculates columns that should be rendered within the current table's viewport;
296
+ * - 'fullyVisible' Calculates columns that are fully visible (used mostly for scrolling purposes);
297
+ * - 'partiallyVisible' Calculates columns that are partially visible (used mostly for scrolling purposes).
300
298
  *
301
- * @param {number} calculationType The render type ID, which determines for what type of
302
- * calculation calculator is created.
299
+ * @param {'rendered' | 'fullyVisible' | 'partiallyVisible'} calculatorTypes The list of the calculation types.
303
300
  * @returns {ViewportColumnsCalculator}
304
301
  */
305
302
  createColumnsCalculator() {
306
- let calculationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _calculator.RENDER_TYPE;
303
+ let calculatorTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['rendered', 'fullyVisible', 'partiallyVisible'];
307
304
  const {
308
305
  wtSettings,
309
306
  wtTable
310
307
  } = this;
311
- if (wtSettings.getSetting('renderAllColumns') && calculationType === _calculator.RENDER_TYPE) {
312
- return new _calculator.RenderAllColumnsCalculator({
313
- totalColumns: wtSettings.getSetting('totalColumns')
314
- });
315
- }
316
308
  let width = this.getViewportWidth();
317
309
  let pos = Math.abs(this.dataAccessObject.inlineStartScrollPosition) - this.dataAccessObject.inlineStartParentOffset;
318
310
  this.columnHeaderHeight = NaN;
@@ -326,12 +318,12 @@ class Viewport {
326
318
  width -= (0, _element.getScrollbarWidth)(this.domBindings.rootDocument);
327
319
  }
328
320
  return new _calculator.ViewportColumnsCalculator({
321
+ calculationTypes: calculatorTypes.map(type => [type, this.columnsCalculatorTypes.get(type)()]),
329
322
  viewportWidth: width,
330
323
  scrollOffset: pos,
331
324
  totalColumns: wtSettings.getSetting('totalColumns'),
332
325
  columnWidthFn: sourceCol => wtTable.getColumnWidth(sourceCol),
333
326
  overrideFn: wtSettings.getSettingPure('viewportColumnCalculatorOverride'),
334
- calculationType,
335
327
  inlineStartOffset: this.dataAccessObject.inlineStartParentOffset
336
328
  });
337
329
  }
@@ -344,46 +336,43 @@ class Viewport {
344
336
  * If `false` or `undefined`, will perform a full redraw.
345
337
  * @returns {boolean} The fastDraw value, possibly modified.
346
338
  */
347
- createRenderCalculators() {
339
+ createCalculators() {
348
340
  let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
349
341
  const {
350
342
  wtSettings
351
343
  } = this;
344
+ const rowsCalculator = this.createRowsCalculator();
345
+ const columnsCalculator = this.createColumnsCalculator();
352
346
  if (fastDraw && !wtSettings.getSetting('renderAllRows')) {
353
- const proposedRowsVisibleCalculator = this.createRowsCalculator(_calculator.FULLY_VISIBLE_TYPE);
347
+ const proposedRowsVisibleCalculator = rowsCalculator.getResultsFor('fullyVisible');
354
348
  fastDraw = this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator);
355
349
  }
356
350
  if (fastDraw && !wtSettings.getSetting('renderAllColumns')) {
357
- const proposedColumnsVisibleCalculator = this.createColumnsCalculator(_calculator.FULLY_VISIBLE_TYPE);
351
+ const proposedColumnsVisibleCalculator = columnsCalculator.getResultsFor('fullyVisible');
358
352
  fastDraw = this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator);
359
353
  }
360
354
  if (!fastDraw) {
361
- this.rowsRenderCalculator = this.createRowsCalculator(_calculator.RENDER_TYPE);
362
- this.columnsRenderCalculator = this.createColumnsCalculator(_calculator.RENDER_TYPE);
355
+ this.rowsRenderCalculator = rowsCalculator.getResultsFor('rendered');
356
+ this.columnsRenderCalculator = columnsCalculator.getResultsFor('rendered');
363
357
  }
364
-
365
- // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator
366
- this.rowsVisibleCalculator = null;
367
- this.columnsVisibleCalculator = null;
358
+ this.rowsVisibleCalculator = rowsCalculator.getResultsFor('fullyVisible');
359
+ this.columnsVisibleCalculator = columnsCalculator.getResultsFor('fullyVisible');
360
+ this.rowsPartiallyVisibleCalculator = rowsCalculator.getResultsFor('partiallyVisible');
361
+ this.columnsPartiallyVisibleCalculator = columnsCalculator.getResultsFor('partiallyVisible');
368
362
  return fastDraw;
369
363
  }
370
364
 
371
365
  /**
372
- * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are
373
- * the actually fully visible rows and columns).
366
+ * Creates rows and columns calculators (after draw, to determine what are
367
+ * the actually fully visible and partially visible rows and columns).
374
368
  */
375
369
  createVisibleCalculators() {
376
- this.rowsVisibleCalculator = this.createRowsCalculator(_calculator.FULLY_VISIBLE_TYPE);
377
- this.columnsVisibleCalculator = this.createColumnsCalculator(_calculator.FULLY_VISIBLE_TYPE);
378
- }
379
-
380
- /**
381
- * Creates rowsPartiallyVisibleCalculator and columnsPartiallyVisibleCalculator (after draw, to determine what are
382
- * the actually partially visible rows and columns).
383
- */
384
- createPartiallyVisibleCalculators() {
385
- this.rowsPartiallyVisibleCalculator = this.createRowsCalculator(_calculator.PARTIALLY_VISIBLE_TYPE);
386
- this.columnsPartiallyVisibleCalculator = this.createColumnsCalculator(_calculator.PARTIALLY_VISIBLE_TYPE);
370
+ const rowsCalculator = this.createRowsCalculator(['fullyVisible', 'partiallyVisible']);
371
+ const columnsCalculator = this.createColumnsCalculator(['fullyVisible', 'partiallyVisible']);
372
+ this.rowsVisibleCalculator = rowsCalculator.getResultsFor('fullyVisible');
373
+ this.columnsVisibleCalculator = columnsCalculator.getResultsFor('fullyVisible');
374
+ this.rowsPartiallyVisibleCalculator = rowsCalculator.getResultsFor('partiallyVisible');
375
+ this.columnsPartiallyVisibleCalculator = columnsCalculator.getResultsFor('partiallyVisible');
387
376
  }
388
377
 
389
378
  /**
@@ -1,6 +1,6 @@
1
1
  import { getScrollbarWidth, getStyle, offset, outerHeight, outerWidth } from "../../../helpers/dom/element.mjs";
2
2
  import { objectEach } from "../../../helpers/object.mjs";
3
- import { RENDER_TYPE, FULLY_VISIBLE_TYPE, PARTIALLY_VISIBLE_TYPE, RenderAllColumnsCalculator, RenderAllRowsCalculator, ViewportColumnsCalculator, ViewportRowsCalculator } from "./calculator/index.mjs";
3
+ import { FullyVisibleColumnsCalculationType, FullyVisibleRowsCalculationType, PartiallyVisibleColumnsCalculationType, PartiallyVisibleRowsCalculationType, RenderedAllColumnsCalculationType, RenderedAllRowsCalculationType, RenderedColumnsCalculationType, RenderedRowsCalculationType, ViewportColumnsCalculator, ViewportRowsCalculator } from "./calculator/index.mjs";
4
4
  /**
5
5
  * @class Viewport
6
6
  */
@@ -28,6 +28,8 @@ class Viewport {
28
28
  this.rowHeaderWidth = NaN;
29
29
  this.rowsVisibleCalculator = null;
30
30
  this.columnsVisibleCalculator = null;
31
+ this.rowsCalculatorTypes = new Map([['rendered', () => this.wtSettings.getSetting('renderAllRows') ? new RenderedAllRowsCalculationType() : new RenderedRowsCalculationType()], ['fullyVisible', () => new FullyVisibleRowsCalculationType()], ['partiallyVisible', () => new PartiallyVisibleRowsCalculationType()]]);
32
+ this.columnsCalculatorTypes = new Map([['rendered', () => this.wtSettings.getSetting('renderAllColumns') ? new RenderedAllColumnsCalculationType() : new RenderedColumnsCalculationType()], ['fullyVisible', () => new FullyVisibleColumnsCalculationType()], ['partiallyVisible', () => new PartiallyVisibleColumnsCalculationType()]]);
31
33
  this.eventManager = eventManager;
32
34
  this.eventManager.addEventListener(this.domBindings.rootWindow, 'resize', () => {
33
35
  this.clientHeight = this.getWorkspaceHeight();
@@ -238,25 +240,20 @@ class Viewport {
238
240
  }
239
241
 
240
242
  /**
241
- * Creates:
242
- * - rowsRenderCalculator (before draw, to qualify rows for rendering)
243
- * - rowsVisibleCalculator (after draw, to measure which rows are actually visible).
243
+ * Creates rows calculators. The type of the calculations can be chosen from the list:
244
+ * - 'rendered' Calculates rows that should be rendered within the current table's viewport;
245
+ * - 'fullyVisible' Calculates rows that are fully visible (used mostly for scrolling purposes);
246
+ * - 'partiallyVisible' Calculates rows that are partially visible (used mostly for scrolling purposes).
244
247
  *
245
- * @param {number} calculationType The render type ID, which determines for what type of
246
- * calculation calculator is created.
248
+ * @param {'rendered' | 'fullyVisible' | 'partiallyVisible'} calculatorTypes The list of the calculation types.
247
249
  * @returns {ViewportRowsCalculator}
248
250
  */
249
251
  createRowsCalculator() {
250
- let calculationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RENDER_TYPE;
252
+ let calculatorTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['rendered', 'fullyVisible', 'partiallyVisible'];
251
253
  const {
252
254
  wtSettings,
253
255
  wtTable
254
256
  } = this;
255
- if (wtSettings.getSetting('renderAllRows') && calculationType === RENDER_TYPE) {
256
- return new RenderAllRowsCalculator({
257
- totalRows: wtSettings.getSetting('totalRows')
258
- });
259
- }
260
257
  let height = this.getViewportHeight();
261
258
  let scrollbarHeight;
262
259
  let fixedRowsHeight;
@@ -280,36 +277,31 @@ class Viewport {
280
277
  scrollbarHeight = getScrollbarWidth(this.domBindings.rootDocument);
281
278
  }
282
279
  return new ViewportRowsCalculator({
280
+ calculationTypes: calculatorTypes.map(type => [type, this.rowsCalculatorTypes.get(type)()]),
283
281
  viewportHeight: height,
284
282
  scrollOffset: pos,
285
283
  totalRows: wtSettings.getSetting('totalRows'),
286
284
  rowHeightFn: sourceRow => wtTable.getRowHeight(sourceRow),
287
285
  overrideFn: wtSettings.getSettingPure('viewportRowCalculatorOverride'),
288
- calculationType,
289
286
  horizontalScrollbarHeight: scrollbarHeight
290
287
  });
291
288
  }
292
289
 
293
290
  /**
294
- * Creates:
295
- * - columnsRenderCalculator (before draw, to qualify columns for rendering)
296
- * - columnsVisibleCalculator (after draw, to measure which columns are actually visible).
291
+ * Creates columns calculators. The type of the calculations can be chosen from the list:
292
+ * - 'rendered' Calculates columns that should be rendered within the current table's viewport;
293
+ * - 'fullyVisible' Calculates columns that are fully visible (used mostly for scrolling purposes);
294
+ * - 'partiallyVisible' Calculates columns that are partially visible (used mostly for scrolling purposes).
297
295
  *
298
- * @param {number} calculationType The render type ID, which determines for what type of
299
- * calculation calculator is created.
296
+ * @param {'rendered' | 'fullyVisible' | 'partiallyVisible'} calculatorTypes The list of the calculation types.
300
297
  * @returns {ViewportColumnsCalculator}
301
298
  */
302
299
  createColumnsCalculator() {
303
- let calculationType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : RENDER_TYPE;
300
+ let calculatorTypes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['rendered', 'fullyVisible', 'partiallyVisible'];
304
301
  const {
305
302
  wtSettings,
306
303
  wtTable
307
304
  } = this;
308
- if (wtSettings.getSetting('renderAllColumns') && calculationType === RENDER_TYPE) {
309
- return new RenderAllColumnsCalculator({
310
- totalColumns: wtSettings.getSetting('totalColumns')
311
- });
312
- }
313
305
  let width = this.getViewportWidth();
314
306
  let pos = Math.abs(this.dataAccessObject.inlineStartScrollPosition) - this.dataAccessObject.inlineStartParentOffset;
315
307
  this.columnHeaderHeight = NaN;
@@ -323,12 +315,12 @@ class Viewport {
323
315
  width -= getScrollbarWidth(this.domBindings.rootDocument);
324
316
  }
325
317
  return new ViewportColumnsCalculator({
318
+ calculationTypes: calculatorTypes.map(type => [type, this.columnsCalculatorTypes.get(type)()]),
326
319
  viewportWidth: width,
327
320
  scrollOffset: pos,
328
321
  totalColumns: wtSettings.getSetting('totalColumns'),
329
322
  columnWidthFn: sourceCol => wtTable.getColumnWidth(sourceCol),
330
323
  overrideFn: wtSettings.getSettingPure('viewportColumnCalculatorOverride'),
331
- calculationType,
332
324
  inlineStartOffset: this.dataAccessObject.inlineStartParentOffset
333
325
  });
334
326
  }
@@ -341,46 +333,43 @@ class Viewport {
341
333
  * If `false` or `undefined`, will perform a full redraw.
342
334
  * @returns {boolean} The fastDraw value, possibly modified.
343
335
  */
344
- createRenderCalculators() {
336
+ createCalculators() {
345
337
  let fastDraw = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
346
338
  const {
347
339
  wtSettings
348
340
  } = this;
341
+ const rowsCalculator = this.createRowsCalculator();
342
+ const columnsCalculator = this.createColumnsCalculator();
349
343
  if (fastDraw && !wtSettings.getSetting('renderAllRows')) {
350
- const proposedRowsVisibleCalculator = this.createRowsCalculator(FULLY_VISIBLE_TYPE);
344
+ const proposedRowsVisibleCalculator = rowsCalculator.getResultsFor('fullyVisible');
351
345
  fastDraw = this.areAllProposedVisibleRowsAlreadyRendered(proposedRowsVisibleCalculator);
352
346
  }
353
347
  if (fastDraw && !wtSettings.getSetting('renderAllColumns')) {
354
- const proposedColumnsVisibleCalculator = this.createColumnsCalculator(FULLY_VISIBLE_TYPE);
348
+ const proposedColumnsVisibleCalculator = columnsCalculator.getResultsFor('fullyVisible');
355
349
  fastDraw = this.areAllProposedVisibleColumnsAlreadyRendered(proposedColumnsVisibleCalculator);
356
350
  }
357
351
  if (!fastDraw) {
358
- this.rowsRenderCalculator = this.createRowsCalculator(RENDER_TYPE);
359
- this.columnsRenderCalculator = this.createColumnsCalculator(RENDER_TYPE);
352
+ this.rowsRenderCalculator = rowsCalculator.getResultsFor('rendered');
353
+ this.columnsRenderCalculator = columnsCalculator.getResultsFor('rendered');
360
354
  }
361
-
362
- // delete temporarily to make sure that renderers always use rowsRenderCalculator, not rowsVisibleCalculator
363
- this.rowsVisibleCalculator = null;
364
- this.columnsVisibleCalculator = null;
355
+ this.rowsVisibleCalculator = rowsCalculator.getResultsFor('fullyVisible');
356
+ this.columnsVisibleCalculator = columnsCalculator.getResultsFor('fullyVisible');
357
+ this.rowsPartiallyVisibleCalculator = rowsCalculator.getResultsFor('partiallyVisible');
358
+ this.columnsPartiallyVisibleCalculator = columnsCalculator.getResultsFor('partiallyVisible');
365
359
  return fastDraw;
366
360
  }
367
361
 
368
362
  /**
369
- * Creates rowsVisibleCalculator and columnsVisibleCalculator (after draw, to determine what are
370
- * the actually fully visible rows and columns).
363
+ * Creates rows and columns calculators (after draw, to determine what are
364
+ * the actually fully visible and partially visible rows and columns).
371
365
  */
372
366
  createVisibleCalculators() {
373
- this.rowsVisibleCalculator = this.createRowsCalculator(FULLY_VISIBLE_TYPE);
374
- this.columnsVisibleCalculator = this.createColumnsCalculator(FULLY_VISIBLE_TYPE);
375
- }
376
-
377
- /**
378
- * Creates rowsPartiallyVisibleCalculator and columnsPartiallyVisibleCalculator (after draw, to determine what are
379
- * the actually partially visible rows and columns).
380
- */
381
- createPartiallyVisibleCalculators() {
382
- this.rowsPartiallyVisibleCalculator = this.createRowsCalculator(PARTIALLY_VISIBLE_TYPE);
383
- this.columnsPartiallyVisibleCalculator = this.createColumnsCalculator(PARTIALLY_VISIBLE_TYPE);
367
+ const rowsCalculator = this.createRowsCalculator(['fullyVisible', 'partiallyVisible']);
368
+ const columnsCalculator = this.createColumnsCalculator(['fullyVisible', 'partiallyVisible']);
369
+ this.rowsVisibleCalculator = rowsCalculator.getResultsFor('fullyVisible');
370
+ this.columnsVisibleCalculator = columnsCalculator.getResultsFor('fullyVisible');
371
+ this.rowsPartiallyVisibleCalculator = rowsCalculator.getResultsFor('partiallyVisible');
372
+ this.columnsPartiallyVisibleCalculator = columnsCalculator.getResultsFor('partiallyVisible');
384
373
  }
385
374
 
386
375
  /**
package/CHANGELOG.md CHANGED
@@ -9,6 +9,33 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
10
  <!-- UNVERSIONED -->
11
11
 
12
+ ## [14.5.0] - 2024-07-24
13
+
14
+ ### Added
15
+ - Added support for other keyboard layouts besides QWERTY (e.g. AZERTY). [#11027](https://github.com/handsontable/handsontable/pull/11027)
16
+ - Added missing "this" typing for the ColumnSummary plugin. [#11036](https://github.com/handsontable/handsontable/pull/11036)
17
+ - Added Undo/Redo logic for the ColumnSorting/ManualColumnSorting plugins. [#11037](https://github.com/handsontable/handsontable/pull/11037)
18
+ - Added new option `headerClassName`, which allows adding custom CSS classes to the column headers. [#11076](https://github.com/handsontable/handsontable/pull/11076)
19
+
20
+ ### Changed
21
+ - Improved the precision of calculating the height and width of columns and rows. [#11049](https://github.com/handsontable/handsontable/pull/11049)
22
+ - Improved the rendering performance. [#11069](https://github.com/handsontable/handsontable/pull/11069)
23
+
24
+ ### Fixed
25
+ - Fixed Context.getShortcuts type. [#10910](https://github.com/handsontable/handsontable/pull/10910)
26
+ - Improved performance of cell merging. [#10995](https://github.com/handsontable/handsontable/pull/10995)
27
+ - Fixed a problem where clicking and dragging on cells in window-controlled scrolled instances would result in unpredictable behavior. [#10996](https://github.com/handsontable/handsontable/pull/10996)
28
+ - Fixed a bug that prevented column sorting of the checkbox cell types. [#11004](https://github.com/handsontable/handsontable/pull/11004)
29
+ - Fixed merged cells misalignment in overlays. [#11007](https://github.com/handsontable/handsontable/pull/11007)
30
+ - Fixed selection expansion for merged cells. [#11010](https://github.com/handsontable/handsontable/pull/11010)
31
+ - Fixed a problem where the table could go into an endless resize loop when one of the instance's parents was using `dvh` values for sizing, and the table was not given any size itself. [#11021](https://github.com/handsontable/handsontable/pull/11021)
32
+ - Fixed a bug where the `afterSetCellMeta` was unnecessarily triggered after clicking on the comments textarea element. [#11033](https://github.com/handsontable/handsontable/pull/11033)
33
+ - Fixed invalid cell states after data population that was canceled in the `beforeChange` hook. [#11035](https://github.com/handsontable/handsontable/pull/11035)
34
+ - Fixed a problem with the Formulas plugin using wrong indexes when performing autofill. [#11038](https://github.com/handsontable/handsontable/pull/11038)
35
+ - Fixed a problem where disabling `navigableHeaders` broke keyboard navigation in the first row if the option was previously enabled and used. [#11043](https://github.com/handsontable/handsontable/pull/11043)
36
+ - Fixed a problem where the dropdown menu would not close after tapping on the table cells on mobile browsers. [#11044](https://github.com/handsontable/handsontable/pull/11044)
37
+ - Fixed the header selection with `nestedHeaders` enabled not working on mobile devices. [#11051](https://github.com/handsontable/handsontable/pull/11051)
38
+
12
39
  ## [14.4.0] - 2024-06-11
13
40
 
14
41
  ### Added
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "26/08/2024 13:21:06";
49
- Handsontable.version = "0.0.0-next-0306a1a-20240826";
48
+ Handsontable.buildDate = "10/09/2024 08:55:13";
49
+ Handsontable.version = "0.0.0-next-1dfe61f-20240910";
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 = "26/08/2024 13:21:12";
39
- Handsontable.version = "0.0.0-next-0306a1a-20240826";
38
+ Handsontable.buildDate = "10/09/2024 08:55:19";
39
+ Handsontable.version = "0.0.0-next-1dfe61f-20240910";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
package/core.d.ts CHANGED
@@ -139,8 +139,7 @@ export default class Core {
139
139
  scrollViewportTo(row?: number, column?: number, snapToBottom?: boolean, snapToRight?: boolean, considerHiddenIndexes?: boolean): boolean;
140
140
  scrollToFocusedCell(callback?: () => void): void;
141
141
  selectAll(includeRowHeaders?: boolean, includeColumnHeaders?: boolean, options?: { focusPosition?: SimpleCellCoords | CellCoords, disableHeadersHighlight?: boolean }): void;
142
- selectCell(row: number, column: number, endRow?: number, endColumn?: number, scrollToCell?: boolean, changeListener?: boolean): boolean;
143
- selectCellByProp(row: number, prop: string, endRow?: number, endProp?: string, scrollToCell?: boolean): boolean;
142
+ selectCell(row: number, column: number | string, endRow?: number, endColumn?: number | string, scrollToCell?: boolean, changeListener?: boolean): boolean;
144
143
  selectCells(coords: Array<[number, number | string, number, number | string]> | CellRange[], scrollToCell?: boolean, changeListener?: boolean): boolean;
145
144
  selectColumns(startColumn: number | string, endColumn?: number | string, focusPosition?: number | SimpleCellCoords | CellCoords): boolean;
146
145
  selectRows(startRow: number, endRow?: number, focusPosition?: number | SimpleCellCoords | CellCoords): boolean;
package/core.js CHANGED
@@ -3501,7 +3501,7 @@ function Core(rootElement, userSettings) {
3501
3501
  let width = instance._getColWidthFromSettings(column);
3502
3502
  width = instance.runHooks('modifyColWidth', width, column);
3503
3503
  if (width === undefined) {
3504
- width = _src.ViewportColumnsCalculator.DEFAULT_WIDTH;
3504
+ width = _src.DEFAULT_COLUMN_WIDTH;
3505
3505
  }
3506
3506
  return width;
3507
3507
  };
package/core.mjs CHANGED
@@ -29,7 +29,7 @@ import DataSource from "./dataMap/dataSource.mjs";
29
29
  import { spreadsheetColumnLabel } from "./helpers/data.mjs";
30
30
  import { IndexMapper } from "./translations/index.mjs";
31
31
  import { registerAsRootInstance, hasValidParameter, isRootInstance } from "./utils/rootInstance.mjs";
32
- import { ViewportColumnsCalculator } from "./3rdparty/walkontable/src/index.mjs";
32
+ import { DEFAULT_COLUMN_WIDTH } from "./3rdparty/walkontable/src/index.mjs";
33
33
  import Hooks from "./pluginHooks.mjs";
34
34
  import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from "./i18n/registry.mjs";
35
35
  import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
@@ -3496,7 +3496,7 @@ export default function Core(rootElement, userSettings) {
3496
3496
  let width = instance._getColWidthFromSettings(column);
3497
3497
  width = instance.runHooks('modifyColWidth', width, column);
3498
3498
  if (width === undefined) {
3499
- width = ViewportColumnsCalculator.DEFAULT_WIDTH;
3499
+ width = DEFAULT_COLUMN_WIDTH;
3500
3500
  }
3501
3501
  return width;
3502
3502
  };
@@ -391,8 +391,7 @@ var _default = () => {
391
391
  * | `true` | Enable the [`AutoRowSize`](@/api/autoRowSize.md) plugin with the default configuration |
392
392
  * | An object | Enable the [`AutoRowSize`](@/api/autoRowSize.md) plugin and modify the plugin options |
393
393
  *
394
- * To give Handsontable's [scrollbar](https://handsontable.com/docs/8.0.0/demo-scrolling.html)
395
- * a proper size, set the `autoRowSize` option to `true`.
394
+ * To give Handsontable's scrollbar a proper size, set the `autoRowSize` option to `true`.
396
395
  *
397
396
  * If you set the `autoRowSize` option to an object, you can set the following [`AutoRowSize`](@/api/autoRowSize.md) plugin options:
398
397
  *
@@ -2907,10 +2906,10 @@ var _default = () => {
2907
2906
  * manualRowMove: true,
2908
2907
  *
2909
2908
  * // enable the `ManualRowMove` plugin
2910
- * // at initialization, move row 0 to 1
2911
- * // at initialization, move row 1 to 4
2912
- * // at initialization, move row 2 to 6
2913
- * manualColumnMove: [1, 4, 6],
2909
+ * // at initialization, move row 1 to 0
2910
+ * // at initialization, move row 4 to 1
2911
+ * // at initialization, move row 6 to 2
2912
+ * manualRowMove: [1, 4, 6],
2914
2913
  * ```
2915
2914
  */
2916
2915
  manualRowMove: undefined,
@@ -388,8 +388,7 @@ export default (() => {
388
388
  * | `true` | Enable the [`AutoRowSize`](@/api/autoRowSize.md) plugin with the default configuration |
389
389
  * | An object | Enable the [`AutoRowSize`](@/api/autoRowSize.md) plugin and modify the plugin options |
390
390
  *
391
- * To give Handsontable's [scrollbar](https://handsontable.com/docs/8.0.0/demo-scrolling.html)
392
- * a proper size, set the `autoRowSize` option to `true`.
391
+ * To give Handsontable's scrollbar a proper size, set the `autoRowSize` option to `true`.
393
392
  *
394
393
  * If you set the `autoRowSize` option to an object, you can set the following [`AutoRowSize`](@/api/autoRowSize.md) plugin options:
395
394
  *
@@ -2904,10 +2903,10 @@ export default (() => {
2904
2903
  * manualRowMove: true,
2905
2904
  *
2906
2905
  * // enable the `ManualRowMove` plugin
2907
- * // at initialization, move row 0 to 1
2908
- * // at initialization, move row 1 to 4
2909
- * // at initialization, move row 2 to 6
2910
- * manualColumnMove: [1, 4, 6],
2906
+ * // at initialization, move row 1 to 0
2907
+ * // at initialization, move row 4 to 1
2908
+ * // at initialization, move row 6 to 2
2909
+ * manualRowMove: [1, 4, 6],
2911
2910
  * ```
2912
2911
  */
2913
2912
  manualRowMove: undefined,
@@ -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-0306a1a-20240826
29
- * Release date: 11/06/2024 (built at 26/08/2024 13:21:16)
28
+ * Version: 0.0.0-next-1dfe61f-20240910
29
+ * Release date: 30/07/2024 (built at 10/09/2024 08:55:24)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -523,24 +523,9 @@ innerBorderBottom - Property controlled by bottom overlay
523
523
  left: 0;
524
524
  right: 0;
525
525
  bottom: 0;
526
- /* Fix for IE9 to spread the ":before" pseudo element to 100% height of the parent element */
527
- bottom: -100% \9 ;
528
526
  background: #005eff;
529
527
  }
530
528
 
531
- /* Fix for IE10 and IE11 to spread the ":before" pseudo element to 100% height of the parent element */
532
- @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
533
- .handsontable td.area:before,
534
- .handsontable td.area-1:before,
535
- .handsontable td.area-2:before,
536
- .handsontable td.area-3:before,
537
- .handsontable td.area-4:before,
538
- .handsontable td.area-5:before,
539
- .handsontable td.area-6:before,
540
- .handsontable td.area-7:before {
541
- bottom: -100%;
542
- }
543
- }
544
529
  .handsontable td.area:before {
545
530
  opacity: 0.1;
546
531
  }
@@ -621,6 +606,7 @@ innerBorderBottom - Property controlled by bottom overlay
621
606
  -webkit-appearance: menulist-button !important;
622
607
  position: absolute;
623
608
  width: auto;
609
+ border: 2px solid #4b89ff;
624
610
  }
625
611
 
626
612
  .htSelectEditor:focus {
@@ -897,12 +883,26 @@ CheckboxRenderer
897
883
 
898
884
  .handsontable[dir=ltr] div.htRight span[class*=ascending],
899
885
  .handsontable[dir=ltr] div.htRight span[class*=descending] {
900
- margin-right: 20px;
886
+ margin-right: 10px;
887
+ margin-left: -10px;
901
888
  }
902
889
 
903
890
  .handsontable[dir=rtl] div.htLeft span[class*=ascending],
904
891
  .handsontable[dir=rtl] div.htLeft span[class*=descending] {
905
- margin-left: 20px;
892
+ margin-left: 10px;
893
+ margin-right: -10px;
894
+ }
895
+
896
+ .handsontable[dir=ltr] div.htRight span[class*=ascending]:only-child,
897
+ .handsontable[dir=ltr] div.htRight span[class*=descending]:only-child {
898
+ margin-right: 15px;
899
+ margin-left: -15px;
900
+ }
901
+
902
+ .handsontable[dir=rtl] div.htLeft span[class*=ascending]:only-child,
903
+ .handsontable[dir=rtl] div.htLeft span[class*=descending]:only-child {
904
+ margin-left: 15px;
905
+ margin-right: -15px;
906
906
  }
907
907
 
908
908
  .handsontable .columnSorting.sortAction:hover {
@@ -1875,11 +1875,23 @@ textarea.HandsontableCopyPaste {
1875
1875
  opacity: 0.58;
1876
1876
  }
1877
1877
  .handsontable[dir=ltr] div.htRight span[class*=sort-] {
1878
- margin-right: 20px;
1878
+ margin-right: 15px;
1879
+ margin-left: -15px;
1879
1880
  }
1880
1881
 
1881
1882
  .handsontable[dir=rtl] div.htLeft span[class*=sort-] {
1883
+ margin-left: 15px;
1884
+ margin-right: -15px;
1885
+ }
1886
+
1887
+ .handsontable[dir=ltr] div.htRight span[class*=sort-]:only-child {
1888
+ margin-right: 20px;
1889
+ margin-left: -20px;
1890
+ }
1891
+
1892
+ .handsontable[dir=rtl] div.htLeft span[class*=sort-]:only-child {
1882
1893
  margin-left: 20px;
1894
+ margin-right: -20px;
1883
1895
  }
1884
1896
 
1885
1897
  /* Column's number position */