handsontable 15.0.1-next-ab94a4c-20250207 → 15.1.0-next-5e493ee-20250207

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 (170) hide show
  1. package/3rdparty/walkontable/src/index.js +2 -0
  2. package/3rdparty/walkontable/src/index.mjs +2 -1
  3. package/3rdparty/walkontable/src/overlays.js +2 -39
  4. package/3rdparty/walkontable/src/overlays.mjs +2 -39
  5. package/3rdparty/walkontable/src/renderer/_base.js +3 -4
  6. package/3rdparty/walkontable/src/renderer/_base.mjs +2 -2
  7. package/3rdparty/walkontable/src/renderer/cells.js +7 -11
  8. package/3rdparty/walkontable/src/renderer/cells.mjs +6 -9
  9. package/3rdparty/walkontable/src/renderer/colGroup.js +6 -7
  10. package/3rdparty/walkontable/src/renderer/colGroup.mjs +5 -5
  11. package/3rdparty/walkontable/src/renderer/columnHeaders.js +4 -5
  12. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +3 -3
  13. package/3rdparty/walkontable/src/renderer/index.js +18 -19
  14. package/3rdparty/walkontable/src/renderer/index.mjs +6 -6
  15. package/3rdparty/walkontable/src/renderer/rowHeaders.js +6 -7
  16. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +5 -5
  17. package/3rdparty/walkontable/src/renderer/rows.js +23 -11
  18. package/3rdparty/walkontable/src/renderer/rows.mjs +23 -10
  19. package/3rdparty/walkontable/src/renderer/table.js +1 -1
  20. package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
  21. package/3rdparty/walkontable/src/selection/border/border.js +10 -2
  22. package/3rdparty/walkontable/src/selection/border/border.mjs +10 -2
  23. package/3rdparty/walkontable/src/utils/nodesPool.js +21 -6
  24. package/3rdparty/walkontable/src/utils/nodesPool.mjs +21 -6
  25. package/3rdparty/walkontable/src/utils/orderView/index.js +4 -5
  26. package/3rdparty/walkontable/src/utils/orderView/index.mjs +2 -2
  27. package/3rdparty/walkontable/src/utils/orderView/sharedView.js +3 -4
  28. package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +2 -2
  29. package/3rdparty/walkontable/src/utils/orderView/view.js +60 -76
  30. package/3rdparty/walkontable/src/utils/orderView/view.mjs +59 -74
  31. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.js +138 -0
  32. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/index.mjs +135 -0
  33. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.js +72 -0
  34. package/3rdparty/walkontable/src/utils/orderView/viewDiffer/viewOrder.mjs +68 -0
  35. package/3rdparty/walkontable/src/utils/orderView/viewSize.js +1 -1
  36. package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +1 -1
  37. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +4 -5
  38. package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +3 -3
  39. package/CHANGELOG.md +48 -2
  40. package/README.md +3 -3
  41. package/base.js +2 -2
  42. package/base.mjs +2 -2
  43. package/cellTypes/dropdownType/dropdownType.js +4 -2
  44. package/cellTypes/dropdownType/dropdownType.mjs +4 -2
  45. package/core.js +39 -38
  46. package/core.mjs +36 -35
  47. package/dataMap/dataMap.js +8 -0
  48. package/dataMap/dataMap.mjs +8 -0
  49. package/dataMap/dataSource.js +4 -0
  50. package/dataMap/dataSource.mjs +4 -0
  51. package/dataMap/metaManager/lazyFactoryMap.js +8 -5
  52. package/dataMap/metaManager/lazyFactoryMap.mjs +8 -5
  53. package/dataMap/metaManager/metaSchema.js +24 -9
  54. package/dataMap/metaManager/metaSchema.mjs +24 -9
  55. package/dist/handsontable.css +6 -2
  56. package/dist/handsontable.full.css +6 -2
  57. package/dist/handsontable.full.js +8026 -6927
  58. package/dist/handsontable.full.min.css +3 -3
  59. package/dist/handsontable.full.min.js +530 -528
  60. package/dist/handsontable.js +3833 -2914
  61. package/dist/handsontable.min.css +3 -3
  62. package/dist/handsontable.min.js +35 -33
  63. package/editors/autocompleteEditor/autocompleteEditor.js +1 -3
  64. package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -3
  65. package/editors/dateEditor/dateEditor.js +4 -0
  66. package/editors/dateEditor/dateEditor.mjs +4 -0
  67. package/editors/dropdownEditor/dropdownEditor.js +3 -16
  68. package/editors/dropdownEditor/dropdownEditor.mjs +3 -16
  69. package/editors/handsontableEditor/handsontableEditor.js +4 -4
  70. package/editors/handsontableEditor/handsontableEditor.mjs +4 -4
  71. package/focusManager.js +1 -1
  72. package/focusManager.mjs +1 -1
  73. package/helpers/dom/element.d.ts +0 -1
  74. package/helpers/mixed.js +2 -2
  75. package/helpers/mixed.mjs +2 -2
  76. package/helpers/object.js +4 -0
  77. package/helpers/object.mjs +4 -0
  78. package/package.json +2 -2
  79. package/plugins/base/base.js +0 -7
  80. package/plugins/base/base.mjs +0 -7
  81. package/plugins/comments/comments.js +12 -3
  82. package/plugins/comments/comments.mjs +12 -3
  83. package/plugins/contextMenu/contextMenu.js +2 -7
  84. package/plugins/contextMenu/contextMenu.mjs +2 -7
  85. package/plugins/contextMenu/menu/menu.js +2 -2
  86. package/plugins/contextMenu/menu/menu.mjs +2 -2
  87. package/plugins/contextMenu/predefinedItems/clearColumn.js +15 -4
  88. package/plugins/contextMenu/predefinedItems/clearColumn.mjs +15 -4
  89. package/plugins/copyPaste/copyPaste.js +6 -12
  90. package/plugins/copyPaste/copyPaste.mjs +6 -12
  91. package/plugins/filters/conditionCollection.js +8 -7
  92. package/plugins/filters/conditionCollection.mjs +8 -7
  93. package/plugins/filters/filters.js +26 -16
  94. package/plugins/filters/filters.mjs +26 -16
  95. package/plugins/filters/utils.js +7 -24
  96. package/plugins/filters/utils.mjs +7 -24
  97. package/plugins/hiddenColumns/hiddenColumns.js +1 -3
  98. package/plugins/hiddenColumns/hiddenColumns.mjs +1 -3
  99. package/plugins/hiddenRows/hiddenRows.js +1 -3
  100. package/plugins/hiddenRows/hiddenRows.mjs +1 -3
  101. package/plugins/manualRowMove/manualRowMove.js +1 -1
  102. package/plugins/manualRowMove/manualRowMove.mjs +1 -1
  103. package/plugins/mergeCells/calculations/autofill.js +60 -44
  104. package/plugins/mergeCells/calculations/autofill.mjs +60 -44
  105. package/plugins/mergeCells/cellsCollection.js +25 -8
  106. package/plugins/mergeCells/cellsCollection.mjs +25 -8
  107. package/plugins/mergeCells/mergeCells.js +15 -16
  108. package/plugins/mergeCells/mergeCells.mjs +15 -16
  109. package/plugins/nestedHeaders/nestedHeaders.js +6 -1
  110. package/plugins/nestedHeaders/nestedHeaders.mjs +6 -1
  111. package/plugins/nestedHeaders/stateManager/index.js +1 -2
  112. package/plugins/nestedHeaders/stateManager/index.mjs +1 -2
  113. package/plugins/nestedHeaders/utils/ghostTable.js +4 -0
  114. package/plugins/nestedHeaders/utils/ghostTable.mjs +4 -0
  115. package/plugins/nestedRows/utils/rowMoveController.js +1 -6
  116. package/plugins/nestedRows/utils/rowMoveController.mjs +1 -6
  117. package/plugins/undoRedo/actions/_base.js +19 -0
  118. package/plugins/undoRedo/actions/_base.mjs +15 -0
  119. package/plugins/undoRedo/actions/cellAlignment.js +85 -0
  120. package/plugins/undoRedo/actions/cellAlignment.mjs +81 -0
  121. package/plugins/undoRedo/actions/columnMove.js +84 -0
  122. package/plugins/undoRedo/actions/columnMove.mjs +80 -0
  123. package/plugins/undoRedo/actions/columnSort.js +73 -0
  124. package/plugins/undoRedo/actions/columnSort.mjs +69 -0
  125. package/plugins/undoRedo/actions/createColumn.js +60 -0
  126. package/plugins/undoRedo/actions/createColumn.mjs +56 -0
  127. package/plugins/undoRedo/actions/createRow.js +65 -0
  128. package/plugins/undoRedo/actions/createRow.mjs +61 -0
  129. package/plugins/undoRedo/actions/dataChange.js +123 -0
  130. package/plugins/undoRedo/actions/dataChange.mjs +119 -0
  131. package/plugins/undoRedo/actions/filters.js +66 -0
  132. package/plugins/undoRedo/actions/filters.mjs +62 -0
  133. package/plugins/undoRedo/actions/index.js +27 -0
  134. package/plugins/undoRedo/actions/index.mjs +23 -0
  135. package/plugins/undoRedo/actions/mergeCells.js +63 -0
  136. package/plugins/undoRedo/actions/mergeCells.mjs +59 -0
  137. package/plugins/undoRedo/actions/removeColumn.js +176 -0
  138. package/plugins/undoRedo/actions/removeColumn.mjs +172 -0
  139. package/plugins/undoRedo/actions/removeRow.js +119 -0
  140. package/plugins/undoRedo/actions/removeRow.mjs +115 -0
  141. package/plugins/undoRedo/actions/rowMove.js +84 -0
  142. package/plugins/undoRedo/actions/rowMove.mjs +80 -0
  143. package/plugins/undoRedo/actions/unmergeCells.js +56 -0
  144. package/plugins/undoRedo/actions/unmergeCells.mjs +52 -0
  145. package/plugins/undoRedo/index.js +3 -4
  146. package/plugins/undoRedo/index.mjs +1 -2
  147. package/plugins/undoRedo/undoRedo.js +277 -879
  148. package/plugins/undoRedo/undoRedo.mjs +277 -880
  149. package/plugins/undoRedo/utils.js +37 -0
  150. package/plugins/undoRedo/utils.mjs +33 -0
  151. package/renderers/checkboxRenderer/checkboxRenderer.js +8 -1
  152. package/renderers/checkboxRenderer/checkboxRenderer.mjs +8 -1
  153. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +1 -0
  154. package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +1 -0
  155. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +2 -1
  156. package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +2 -1
  157. package/styles/handsontable.css +75 -103
  158. package/styles/handsontable.min.css +3 -3
  159. package/styles/ht-theme-horizon.css +2 -2
  160. package/styles/ht-theme-horizon.min.css +2 -2
  161. package/styles/ht-theme-main.css +2 -2
  162. package/styles/ht-theme-main.min.css +2 -2
  163. package/tableView.js +17 -1
  164. package/tableView.mjs +17 -1
  165. package/utils/autoResize.js +1 -1
  166. package/utils/autoResize.mjs +1 -1
  167. package/utils/parseTable.js +1 -1
  168. package/utils/parseTable.mjs +1 -1
  169. package/validators/dateValidator/dateValidator.js +1 -1
  170. package/validators/dateValidator/dateValidator.mjs +1 -1
package/tableView.mjs CHANGED
@@ -27,6 +27,7 @@ var _mouseDown = /*#__PURE__*/new WeakMap();
27
27
  var _table = /*#__PURE__*/new WeakMap();
28
28
  var _lastWidth = /*#__PURE__*/new WeakMap();
29
29
  var _lastHeight = /*#__PURE__*/new WeakMap();
30
+ var _mouseDownLastPos = /*#__PURE__*/new WeakMap();
30
31
  var _TableView_brand = /*#__PURE__*/new WeakSet();
31
32
  class TableView {
32
33
  /**
@@ -138,6 +139,12 @@ class TableView {
138
139
  * @type {number}
139
140
  */
140
141
  _classPrivateFieldInitSpec(this, _lastHeight, 0);
142
+ /**
143
+ * The last mouse position of the mousedown event.
144
+ *
145
+ * @type {{ x: number, y: number } | null}
146
+ */
147
+ _classPrivateFieldInitSpec(this, _mouseDownLastPos, null);
141
148
  this.hot = hotInstance;
142
149
  this.eventManager = new EventManager(this.hot);
143
150
  this.settings = this.hot.getSettings();
@@ -783,6 +790,10 @@ class TableView {
783
790
  this.hot.listen();
784
791
  this.activeWt = wt;
785
792
  _classPrivateFieldSet(_mouseDown, this, true);
793
+ _classPrivateFieldSet(_mouseDownLastPos, this, {
794
+ x: event.clientX,
795
+ y: event.clientY
796
+ });
786
797
  this.hot.runHooks('beforeOnCellMouseDown', event, visualCoords, TD, controller);
787
798
  if (isImmediatePropagationStopped(event)) {
788
799
  return;
@@ -832,7 +843,11 @@ class TableView {
832
843
  if (isImmediatePropagationStopped(event)) {
833
844
  return;
834
845
  }
835
- if (_classPrivateFieldGet(_mouseDown, this)) {
846
+
847
+ // Ignore mouseover events when the mouse has not moved. This solves an issue (#dev-1479) where
848
+ // column resizing triggered by the long text in the cell causes the mouseover event to be fired,
849
+ // thus selecting multiple cells with no user intention.
850
+ if (_classPrivateFieldGet(_mouseDown, this) && (!_classPrivateFieldGet(_mouseDownLastPos, this) || _classPrivateFieldGet(_mouseDownLastPos, this).x !== event.clientX || _classPrivateFieldGet(_mouseDownLastPos, this).y !== event.clientY)) {
836
851
  handleMouseEvent(event, {
837
852
  coords: visualCoords,
838
853
  selection: this.hot.selection,
@@ -842,6 +857,7 @@ class TableView {
842
857
  }
843
858
  this.hot.runHooks('afterOnCellMouseOver', event, visualCoords, TD);
844
859
  this.activeWt = this._wt;
860
+ _classPrivateFieldSet(_mouseDownLastPos, this, null);
845
861
  },
846
862
  onCellMouseUp: (event, coords, TD, wt) => {
847
863
  const visualCoords = this.translateFromRenderableToVisualCoords(coords);
@@ -93,7 +93,7 @@ function createInputElementResizer(ownerDocument) {
93
93
  body.appendChild(textContainer);
94
94
  const paddingStart = parseInt(((_getComputedStyle = getComputedStyle(observedElement)) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.paddingInlineStart) || 0, 10);
95
95
  const paddingEnd = parseInt(((_getComputedStyle2 = getComputedStyle(observedElement)) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.paddingInlineEnd) || 0, 10);
96
- const width = textContainer.clientWidth + 2 + paddingStart + paddingEnd;
96
+ const width = textContainer.clientWidth + paddingStart + paddingEnd + 1;
97
97
  body.removeChild(textContainer);
98
98
  const elementStyle = observedElement.style;
99
99
  elementStyle.height = `${defaults.minHeight}px`;
@@ -89,7 +89,7 @@ export function createInputElementResizer(ownerDocument) {
89
89
  body.appendChild(textContainer);
90
90
  const paddingStart = parseInt(((_getComputedStyle = getComputedStyle(observedElement)) === null || _getComputedStyle === void 0 ? void 0 : _getComputedStyle.paddingInlineStart) || 0, 10);
91
91
  const paddingEnd = parseInt(((_getComputedStyle2 = getComputedStyle(observedElement)) === null || _getComputedStyle2 === void 0 ? void 0 : _getComputedStyle2.paddingInlineEnd) || 0, 10);
92
- const width = textContainer.clientWidth + 2 + paddingStart + paddingEnd;
92
+ const width = textContainer.clientWidth + paddingStart + paddingEnd + 1;
93
93
  body.removeChild(textContainer);
94
94
  const elementStyle = observedElement.style;
95
95
  elementStyle.height = `${defaults.minHeight}px`;
@@ -75,7 +75,7 @@ function instanceToHTML(instance) {
75
75
  if ((0, _mixed.isEmpty)(cellData)) {
76
76
  cell = `<td ${attrs.join(' ')}></td>`;
77
77
  } else {
78
- const value = cellData.toString().replace('<', '&lt;').replace('>', '&gt;').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20/gi, '&nbsp;').replace(/\t/gi, '&#9;');
78
+ const value = cellData.toString().replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20/gi, '&nbsp;').replace(/\t/gi, '&#9;');
79
79
  cell = `<td ${attrs.join(' ')}>${value}</td>`;
80
80
  }
81
81
  }
@@ -69,7 +69,7 @@ export function instanceToHTML(instance) {
69
69
  if (isEmpty(cellData)) {
70
70
  cell = `<td ${attrs.join(' ')}></td>`;
71
71
  } else {
72
- const value = cellData.toString().replace('<', '&lt;').replace('>', '&gt;').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20/gi, '&nbsp;').replace(/\t/gi, '&#9;');
72
+ const value = cellData.toString().replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20/gi, '&nbsp;').replace(/\t/gi, '&#9;');
73
73
  cell = `<td ${attrs.join(' ')}>${value}</td>`;
74
74
  }
75
75
  }
@@ -60,7 +60,7 @@ dateValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;
60
60
  function correctFormat(value, dateFormat) {
61
61
  const dateFromDate = (0, _moment.default)((0, _date.getNormalizedDate)(value));
62
62
  const dateFromMoment = (0, _moment.default)(value, dateFormat);
63
- const isAlphanumeric = value.search(/[A-z]/g) > -1;
63
+ const isAlphanumeric = value.search(/[A-Za-z]/g) > -1;
64
64
  let date;
65
65
  if (dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x') || !dateFromMoment.isValid() || isAlphanumeric) {
66
66
  date = dateFromDate;
@@ -54,7 +54,7 @@ dateValidator.VALIDATOR_TYPE = VALIDATOR_TYPE;
54
54
  export function correctFormat(value, dateFormat) {
55
55
  const dateFromDate = moment(getNormalizedDate(value));
56
56
  const dateFromMoment = moment(value, dateFormat);
57
- const isAlphanumeric = value.search(/[A-z]/g) > -1;
57
+ const isAlphanumeric = value.search(/[A-Za-z]/g) > -1;
58
58
  let date;
59
59
  if (dateFromDate.isValid() && dateFromDate.format('x') === dateFromMoment.format('x') || !dateFromMoment.isValid() || isAlphanumeric) {
60
60
  date = dateFromDate;