handsontable 15.0.1-next-ab94a4c-20250207 → 15.1.0-next-dfdf994-20250206

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 +51 -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
@@ -298,9 +298,7 @@ class AutocompleteEditor extends _handsontableEditor.HandsontableEditor {
298
298
  }
299
299
  const orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;
300
300
  if (filterSetting === false) {
301
- if (orderByRelevanceLength) {
302
- highlightIndex = orderByRelevance[0];
303
- }
301
+ highlightIndex = orderByRelevanceLength > 0 ? orderByRelevance[0] : 0;
304
302
  } else {
305
303
  const sorted = [];
306
304
  for (let i = 0, choicesCount = choices.length; i < choicesCount; i++) {
@@ -295,9 +295,7 @@ export class AutocompleteEditor extends HandsontableEditor {
295
295
  }
296
296
  const orderByRelevanceLength = Array.isArray(orderByRelevance) ? orderByRelevance.length : 0;
297
297
  if (filterSetting === false) {
298
- if (orderByRelevanceLength) {
299
- highlightIndex = orderByRelevance[0];
300
- }
298
+ highlightIndex = orderByRelevanceLength > 0 ? orderByRelevance[0] : 0;
301
299
  } else {
302
300
  const sorted = [];
303
301
  for (let i = 0, choicesCount = choices.length; i < choicesCount; i++) {
@@ -9,6 +9,7 @@ var _textEditor = require("../textEditor");
9
9
  var _element = require("../../helpers/dom/element");
10
10
  var _object = require("../../helpers/object");
11
11
  var _unicode = require("../../helpers/unicode");
12
+ var _browser = require("../../helpers/browser");
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
15
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -272,6 +273,9 @@ class DateEditor extends _textEditor.TextEditor {
272
273
  if (origOnSelect) {
273
274
  origOnSelect();
274
275
  }
276
+ if ((0, _browser.isMobileBrowser)()) {
277
+ this.hideDatepicker();
278
+ }
275
279
  };
276
280
  options.onClose = () => {
277
281
  if (!this.parentDestroyed) {
@@ -9,6 +9,7 @@ import { TextEditor } from "../textEditor/index.mjs";
9
9
  import { addClass, removeClass, hasClass, outerHeight, outerWidth } from "../../helpers/dom/element.mjs";
10
10
  import { deepExtend } from "../../helpers/object.mjs";
11
11
  import { isFunctionKey } from "../../helpers/unicode.mjs";
12
+ import { isMobileBrowser } from "../../helpers/browser.mjs";
12
13
  export const EDITOR_TYPE = 'date';
13
14
  const SHORTCUTS_GROUP_EDITOR = 'dateEditor';
14
15
 
@@ -268,6 +269,9 @@ export class DateEditor extends TextEditor {
268
269
  if (origOnSelect) {
269
270
  origOnSelect();
270
271
  }
272
+ if (isMobileBrowser()) {
273
+ this.hideDatepicker();
274
+ }
271
275
  };
272
276
  options.onClose = () => {
273
277
  if (!this.parentDestroyed) {
@@ -4,7 +4,6 @@ exports.__esModule = true;
4
4
  require("core-js/modules/esnext.iterator.constructor.js");
5
5
  require("core-js/modules/esnext.iterator.filter.js");
6
6
  var _autocompleteEditor = require("../autocompleteEditor");
7
- var _hooks = require("../../core/hooks");
8
7
  const EDITOR_TYPE = exports.EDITOR_TYPE = 'dropdown';
9
8
 
10
9
  /**
@@ -25,21 +24,9 @@ class DropdownEditor extends _autocompleteEditor.AutocompleteEditor {
25
24
  * @param {object} cellProperties The cell meta object (see {@link Core#getCellMeta}).
26
25
  */
27
26
  prepare(row, col, prop, td, value, cellProperties) {
27
+ cellProperties.filter = false;
28
+ cellProperties.strict = true;
28
29
  super.prepare(row, col, prop, td, value, cellProperties);
29
- this.cellProperties.filter = false;
30
- this.cellProperties.strict = true;
31
30
  }
32
31
  }
33
- exports.DropdownEditor = DropdownEditor;
34
- _hooks.Hooks.getSingleton().add('beforeValidate', function (value, row, col) {
35
- const visualColumnIndex = this.propToCol(col);
36
- if (Number.isInteger(visualColumnIndex)) {
37
- const cellMeta = this.getCellMeta(row, visualColumnIndex);
38
- if (cellMeta.editor === DropdownEditor) {
39
- if (cellMeta.strict === undefined) {
40
- cellMeta.filter = false;
41
- cellMeta.strict = true;
42
- }
43
- }
44
- }
45
- });
32
+ exports.DropdownEditor = DropdownEditor;
@@ -1,7 +1,6 @@
1
1
  import "core-js/modules/esnext.iterator.constructor.js";
2
2
  import "core-js/modules/esnext.iterator.filter.js";
3
3
  import { AutocompleteEditor } from "../autocompleteEditor/index.mjs";
4
- import { Hooks } from "../../core/hooks/index.mjs";
5
4
  export const EDITOR_TYPE = 'dropdown';
6
5
 
7
6
  /**
@@ -22,20 +21,8 @@ export class DropdownEditor extends AutocompleteEditor {
22
21
  * @param {object} cellProperties The cell meta object (see {@link Core#getCellMeta}).
23
22
  */
24
23
  prepare(row, col, prop, td, value, cellProperties) {
24
+ cellProperties.filter = false;
25
+ cellProperties.strict = true;
25
26
  super.prepare(row, col, prop, td, value, cellProperties);
26
- this.cellProperties.filter = false;
27
- this.cellProperties.strict = true;
28
27
  }
29
- }
30
- Hooks.getSingleton().add('beforeValidate', function (value, row, col) {
31
- const visualColumnIndex = this.propToCol(col);
32
- if (Number.isInteger(visualColumnIndex)) {
33
- const cellMeta = this.getCellMeta(row, visualColumnIndex);
34
- if (cellMeta.editor === DropdownEditor) {
35
- if (cellMeta.strict === undefined) {
36
- cellMeta.filter = false;
37
- cellMeta.strict = true;
38
- }
39
- }
40
- }
41
- });
28
+ }
@@ -183,13 +183,13 @@ class HandsontableEditor extends _textEditor.TextEditor {
183
183
  */
184
184
  assignHooks() {
185
185
  this.hot.addHook('afterDestroy', () => {
186
- if (this.htEditor) {
187
- this.htEditor.destroy();
188
- }
186
+ var _this$htEditor;
187
+ (_this$htEditor = this.htEditor) === null || _this$htEditor === void 0 || _this$htEditor.destroy();
189
188
  });
190
189
  this.hot.addHook('afterSetTheme', (themeName, firstRun) => {
191
190
  if (!firstRun) {
192
- this.htEditor.useTheme(themeName);
191
+ var _this$htEditor2;
192
+ (_this$htEditor2 = this.htEditor) === null || _this$htEditor2 === void 0 || _this$htEditor2.useTheme(themeName);
193
193
  }
194
194
  });
195
195
  }
@@ -180,13 +180,13 @@ export class HandsontableEditor extends TextEditor {
180
180
  */
181
181
  assignHooks() {
182
182
  this.hot.addHook('afterDestroy', () => {
183
- if (this.htEditor) {
184
- this.htEditor.destroy();
185
- }
183
+ var _this$htEditor;
184
+ (_this$htEditor = this.htEditor) === null || _this$htEditor === void 0 || _this$htEditor.destroy();
186
185
  });
187
186
  this.hot.addHook('afterSetTheme', (themeName, firstRun) => {
188
187
  if (!firstRun) {
189
- this.htEditor.useTheme(themeName);
188
+ var _this$htEditor2;
189
+ (_this$htEditor2 = this.htEditor) === null || _this$htEditor2 === void 0 || _this$htEditor2.useTheme(themeName);
190
190
  }
191
191
  });
192
192
  }
package/focusManager.js CHANGED
@@ -261,7 +261,7 @@ function _focusCell() {
261
261
  */
262
262
  function _focusEditorElement() {
263
263
  _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
264
- if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
264
+ if (this.getFocusMode() === FOCUS_MODES.MIXED && (selectedCell === null || selectedCell === void 0 ? void 0 : selectedCell.nodeName) === 'TD') {
265
265
  this.refocusToEditorTextarea();
266
266
  }
267
267
  });
package/focusManager.mjs CHANGED
@@ -257,7 +257,7 @@ function _focusCell() {
257
257
  */
258
258
  function _focusEditorElement() {
259
259
  _assertClassBrand(_FocusManager_brand, this, _getSelectedCell).call(this, selectedCell => {
260
- if (this.getFocusMode() === FOCUS_MODES.MIXED && selectedCell.nodeName === 'TD') {
260
+ if (this.getFocusMode() === FOCUS_MODES.MIXED && (selectedCell === null || selectedCell === void 0 ? void 0 : selectedCell.nodeName) === 'TD') {
261
261
  this.refocusToEditorTextarea();
262
262
  }
263
263
  });
@@ -24,7 +24,6 @@ export function getScrollableElement(element: HTMLElement): HTMLElement;
24
24
  export function getTrimmingContainer(base: HTMLElement): HTMLElement;
25
25
  export function getStyle(element: HTMLElement, prop: string, rootWindow?: Window): string;
26
26
  export function matchesCSSRules(element: Element, rule: CSSRule): boolean;
27
- export function getComputedStyle(element: HTMLElement, rootWindow?: Window): any;
28
27
  export function outerWidth(element: HTMLElement): number;
29
28
  export function outerHeight(element: HTMLElement): number;
30
29
  export function innerHeight(element: HTMLElement): number;
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.0.1-next-ab94a4c-20250207";
137
+ const hotVersion = "15.1.0-next-dfdf994-20250206";
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)("10/02/2025", 'DD/MM/YYYY');
145
+ const releaseDate = (0, _moment.default)("12/02/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.0.1-next-ab94a4c-20250207";
127
+ const hotVersion = "15.1.0-next-dfdf994-20250206";
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("10/02/2025", 'DD/MM/YYYY');
135
+ const releaseDate = moment("12/02/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
@@ -284,6 +284,10 @@ function setProperty(object, name, value) {
284
284
  const names = name.split('.');
285
285
  let workingObject = object;
286
286
  names.forEach((propName, index) => {
287
+ if (propName === '__proto__' || propName === 'constructor' || propName === 'prototype') {
288
+ // Security: prototype-polluting is not allowed
289
+ return;
290
+ }
287
291
  if (index !== names.length - 1) {
288
292
  if (!hasOwnProperty(workingObject, propName)) {
289
293
  workingObject[propName] = {};
@@ -265,6 +265,10 @@ export function setProperty(object, name, value) {
265
265
  const names = name.split('.');
266
266
  let workingObject = object;
267
267
  names.forEach((propName, index) => {
268
+ if (propName === '__proto__' || propName === 'constructor' || propName === 'prototype') {
269
+ // Security: prototype-polluting is not allowed
270
+ return;
271
+ }
268
272
  if (index !== names.length - 1) {
269
273
  if (!hasOwnProperty(workingObject, propName)) {
270
274
  workingObject[propName] = {};
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.0.1-next-ab94a4c-20250207",
13
+ "version": "15.1.0-next-dfdf994-20250206",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -99,7 +99,7 @@
99
99
  "webpack-remove-empty-scripts": "^1.0.4"
100
100
  },
101
101
  "optionalDependencies": {
102
- "hyperformula": "^2.6.2"
102
+ "hyperformula": "^3.0.0"
103
103
  },
104
104
  "license": "SEE LICENSE IN LICENSE.txt",
105
105
  "typings": "./index.d.ts",
@@ -142,13 +142,6 @@ class BasePlugin {
142
142
  if (!initializedPlugins) {
143
143
  initializedPlugins = (0, _registry.getPluginsNames)();
144
144
  }
145
-
146
- // Workaround for the UndoRedo plugin which, currently doesn't follow the plugin architecture.
147
- // Without this line the `callOnPluginsReady` callback won't be triggered after all plugin
148
- // initialization.
149
- if (initializedPlugins.indexOf('UndoRedo') >= 0) {
150
- initializedPlugins.splice(initializedPlugins.indexOf('UndoRedo'), 1);
151
- }
152
145
  if (initializedPlugins.indexOf(this.pluginName) >= 0) {
153
146
  initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1);
154
147
  }
@@ -138,13 +138,6 @@ export class BasePlugin {
138
138
  if (!initializedPlugins) {
139
139
  initializedPlugins = getPluginsNames();
140
140
  }
141
-
142
- // Workaround for the UndoRedo plugin which, currently doesn't follow the plugin architecture.
143
- // Without this line the `callOnPluginsReady` callback won't be triggered after all plugin
144
- // initialization.
145
- if (initializedPlugins.indexOf('UndoRedo') >= 0) {
146
- initializedPlugins.splice(initializedPlugins.indexOf('UndoRedo'), 1);
147
- }
148
141
  if (initializedPlugins.indexOf(this.pluginName) >= 0) {
149
142
  initializedPlugins.splice(initializedPlugins.indexOf(this.pluginName), 1);
150
143
  }
@@ -316,6 +316,16 @@ class Comments extends _base.BasePlugin {
316
316
  runOnlyIf: () => _classPrivateFieldGet(_editor, this).isVisible() && _classPrivateFieldGet(_editor, this).isFocused(),
317
317
  group: SHORTCUTS_GROUP
318
318
  });
319
+ pluginContext.addShortcut({
320
+ keys: [['Shift', 'Tab'], ['Tab']],
321
+ forwardToContext: manager.getContext('grid'),
322
+ callback: () => {
323
+ _classPrivateFieldGet(_editor, this).setValue(_classPrivateFieldGet(_commentValueBeforeSave, this));
324
+ this.hide();
325
+ manager.setActiveContextName('grid');
326
+ },
327
+ group: SHORTCUTS_GROUP
328
+ });
319
329
  }
320
330
 
321
331
  /**
@@ -529,7 +539,6 @@ class Comments extends _base.BasePlugin {
529
539
  * @param {boolean} [force=false] If `true` then recalculation will be forced.
530
540
  */
531
541
  refreshEditor() {
532
- var _renderableRow, _renderableColumn;
533
542
  let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
534
543
  if (!force && (!this.range.from || !_classPrivateFieldGet(_editor, this).isVisible())) {
535
544
  return;
@@ -558,8 +567,8 @@ class Comments extends _base.BasePlugin {
558
567
  }
559
568
  const isBeforeRenderedRows = renderableRow === null;
560
569
  const isBeforeRenderedColumns = renderableColumn === null;
561
- renderableRow = (_renderableRow = renderableRow) !== null && _renderableRow !== void 0 ? _renderableRow : 0;
562
- renderableColumn = (_renderableColumn = renderableColumn) !== null && _renderableColumn !== void 0 ? _renderableColumn : 0;
570
+ renderableRow = renderableRow !== null && renderableRow !== void 0 ? renderableRow : 0;
571
+ renderableColumn = renderableColumn !== null && renderableColumn !== void 0 ? renderableColumn : 0;
563
572
  const {
564
573
  rootWindow,
565
574
  view: {
@@ -312,6 +312,16 @@ export class Comments extends BasePlugin {
312
312
  runOnlyIf: () => _classPrivateFieldGet(_editor, this).isVisible() && _classPrivateFieldGet(_editor, this).isFocused(),
313
313
  group: SHORTCUTS_GROUP
314
314
  });
315
+ pluginContext.addShortcut({
316
+ keys: [['Shift', 'Tab'], ['Tab']],
317
+ forwardToContext: manager.getContext('grid'),
318
+ callback: () => {
319
+ _classPrivateFieldGet(_editor, this).setValue(_classPrivateFieldGet(_commentValueBeforeSave, this));
320
+ this.hide();
321
+ manager.setActiveContextName('grid');
322
+ },
323
+ group: SHORTCUTS_GROUP
324
+ });
315
325
  }
316
326
 
317
327
  /**
@@ -525,7 +535,6 @@ export class Comments extends BasePlugin {
525
535
  * @param {boolean} [force=false] If `true` then recalculation will be forced.
526
536
  */
527
537
  refreshEditor() {
528
- var _renderableRow, _renderableColumn;
529
538
  let force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
530
539
  if (!force && (!this.range.from || !_classPrivateFieldGet(_editor, this).isVisible())) {
531
540
  return;
@@ -554,8 +563,8 @@ export class Comments extends BasePlugin {
554
563
  }
555
564
  const isBeforeRenderedRows = renderableRow === null;
556
565
  const isBeforeRenderedColumns = renderableColumn === null;
557
- renderableRow = (_renderableRow = renderableRow) !== null && _renderableRow !== void 0 ? _renderableRow : 0;
558
- renderableColumn = (_renderableColumn = renderableColumn) !== null && _renderableColumn !== void 0 ? _renderableColumn : 0;
566
+ renderableRow = renderableRow !== null && renderableRow !== void 0 ? renderableRow : 0;
567
+ renderableColumn = renderableColumn !== null && renderableColumn !== void 0 ? renderableColumn : 0;
559
568
  const {
560
569
  rootWindow,
561
570
  view: {
@@ -237,14 +237,9 @@ class ContextMenu extends _base.BasePlugin {
237
237
  this.prepareMenuItems();
238
238
  this.menu.open();
239
239
  const themeHasTableBorder = this.menu.tableBorderWidth > 0;
240
- if (!themeHasTableBorder) {
241
- offset.below += 1;
242
- offset.right += 1;
243
- offset.above -= 1;
244
- offset.left -= 1;
245
- }
246
240
  (0, _object.objectEach)(offset, (value, key) => {
247
- this.menu.setOffset(key, value);
241
+ const valueWithoutBorder = ['below', 'right'].includes(key) ? value + 1 : value - 1;
242
+ this.menu.setOffset(key, themeHasTableBorder ? value : valueWithoutBorder);
248
243
  });
249
244
  this.menu.setPosition(position);
250
245
  }
@@ -234,14 +234,9 @@ export class ContextMenu extends BasePlugin {
234
234
  this.prepareMenuItems();
235
235
  this.menu.open();
236
236
  const themeHasTableBorder = this.menu.tableBorderWidth > 0;
237
- if (!themeHasTableBorder) {
238
- offset.below += 1;
239
- offset.right += 1;
240
- offset.above -= 1;
241
- offset.left -= 1;
242
- }
243
237
  objectEach(offset, (value, key) => {
244
- this.menu.setOffset(key, value);
238
+ const valueWithoutBorder = ['below', 'right'].includes(key) ? value + 1 : value - 1;
239
+ this.menu.setOffset(key, themeHasTableBorder ? value : valueWithoutBorder);
245
240
  });
246
241
  this.menu.setPosition(position);
247
242
  }
@@ -612,13 +612,13 @@ class Menu {
612
612
  className = className.toString();
613
613
  }
614
614
  }
615
- className = className.replace(/[^A-z0-9]/g, '_');
615
+ className = className.replace(/[^A-Za-z0-9]/g, '_');
616
616
  className = `${this.options.className}Sub_${className}`;
617
617
  container = doc.querySelector(`.${this.options.className}.${className}`);
618
618
  }
619
619
  if (!container) {
620
620
  container = doc.createElement('div');
621
- (0, _element.addClass)(container, `htMenu ${this.options.className}`);
621
+ (0, _element.addClass)(container, `htMenu handsontable ${this.options.className}`);
622
622
  if (className) {
623
623
  (0, _element.addClass)(container, className);
624
624
  }
@@ -608,13 +608,13 @@ export class Menu {
608
608
  className = className.toString();
609
609
  }
610
610
  }
611
- className = className.replace(/[^A-z0-9]/g, '_');
611
+ className = className.replace(/[^A-Za-z0-9]/g, '_');
612
612
  className = `${this.options.className}Sub_${className}`;
613
613
  container = doc.querySelector(`.${this.options.className}.${className}`);
614
614
  }
615
615
  if (!container) {
616
616
  container = doc.createElement('div');
617
- addClass(container, `htMenu ${this.options.className}`);
617
+ addClass(container, `htMenu handsontable ${this.options.className}`);
618
618
  if (className) {
619
619
  addClass(container, className);
620
620
  }
@@ -25,13 +25,24 @@ function clearColumnItem() {
25
25
  },
26
26
  disabled() {
27
27
  const range = this.getSelectedRangeLast();
28
- if (!range) {
28
+ if (!range || range.isSingleHeader() && range.highlight.col < 0 || !this.selection.isSelectedByColumnHeader()) {
29
29
  return true;
30
30
  }
31
- if (range.isSingleHeader() && range.highlight.col < 0) {
31
+ let atLeastOneNonReadOnly = false;
32
+ range.forAll((row, col) => {
33
+ if (row < 0 || col < 0) {
34
+ return true;
35
+ }
36
+ const {
37
+ readOnly
38
+ } = this.getCellMeta(row, col);
39
+ if (!readOnly) {
40
+ atLeastOneNonReadOnly = true;
41
+ return false;
42
+ }
32
43
  return true;
33
- }
34
- return !this.selection.isSelectedByColumnHeader();
44
+ });
45
+ return !atLeastOneNonReadOnly;
35
46
  }
36
47
  };
37
48
  }
@@ -19,13 +19,24 @@ export default function clearColumnItem() {
19
19
  },
20
20
  disabled() {
21
21
  const range = this.getSelectedRangeLast();
22
- if (!range) {
22
+ if (!range || range.isSingleHeader() && range.highlight.col < 0 || !this.selection.isSelectedByColumnHeader()) {
23
23
  return true;
24
24
  }
25
- if (range.isSingleHeader() && range.highlight.col < 0) {
25
+ let atLeastOneNonReadOnly = false;
26
+ range.forAll((row, col) => {
27
+ if (row < 0 || col < 0) {
28
+ return true;
29
+ }
30
+ const {
31
+ readOnly
32
+ } = this.getCellMeta(row, col);
33
+ if (!readOnly) {
34
+ atLeastOneNonReadOnly = true;
35
+ return false;
36
+ }
26
37
  return true;
27
- }
28
- return !this.selection.isSelectedByColumnHeader();
38
+ });
39
+ return !atLeastOneNonReadOnly;
29
40
  }
30
41
  };
31
42
  }
@@ -562,12 +562,10 @@ class CopyPaste extends _base.BasePlugin {
562
562
  * @private
563
563
  */
564
564
  onCopy(event) {
565
- var _event$target, _this$hot$getSelected;
565
+ var _event$target;
566
566
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
567
567
  const isHotInput = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.hasAttribute('data-hot-input');
568
- const selectedCell = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
569
- const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
570
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
568
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
571
569
  return;
572
570
  }
573
571
  event.preventDefault();
@@ -597,12 +595,10 @@ class CopyPaste extends _base.BasePlugin {
597
595
  * @private
598
596
  */
599
597
  onCut(event) {
600
- var _event$target2, _this$hot$getSelected2;
598
+ var _event$target2;
601
599
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
602
600
  const isHotInput = (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.hasAttribute('data-hot-input');
603
- const selectedCell = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
604
- const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
605
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
601
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
606
602
  return;
607
603
  }
608
604
  event.preventDefault();
@@ -631,12 +627,10 @@ class CopyPaste extends _base.BasePlugin {
631
627
  * @private
632
628
  */
633
629
  onPaste(event) {
634
- var _event$target3, _this$hot$getSelected3;
630
+ var _event$target3;
635
631
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
636
632
  const isHotInput = (_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.hasAttribute('data-hot-input');
637
- const selectedCell = (_this$hot$getSelected3 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected3 === void 0 ? void 0 : _this$hot$getSelected3.highlight;
638
- const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
639
- if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
633
+ if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
640
634
  return;
641
635
  }
642
636
  event.preventDefault();
@@ -558,12 +558,10 @@ export class CopyPaste extends BasePlugin {
558
558
  * @private
559
559
  */
560
560
  onCopy(event) {
561
- var _event$target, _this$hot$getSelected;
561
+ var _event$target;
562
562
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
563
563
  const isHotInput = (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.hasAttribute('data-hot-input');
564
- const selectedCell = (_this$hot$getSelected = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected === void 0 ? void 0 : _this$hot$getSelected.highlight;
565
- const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
566
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
564
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCopy, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
567
565
  return;
568
566
  }
569
567
  event.preventDefault();
@@ -593,12 +591,10 @@ export class CopyPaste extends BasePlugin {
593
591
  * @private
594
592
  */
595
593
  onCut(event) {
596
- var _event$target2, _this$hot$getSelected2;
594
+ var _event$target2;
597
595
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
598
596
  const isHotInput = (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.hasAttribute('data-hot-input');
599
- const selectedCell = (_this$hot$getSelected2 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected2 === void 0 ? void 0 : _this$hot$getSelected2.highlight;
600
- const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
601
- if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
597
+ if (!this.hot.isListening() && !_classPrivateFieldGet(_isTriggeredByCut, this) || this.isEditorOpened() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
602
598
  return;
603
599
  }
604
600
  event.preventDefault();
@@ -627,12 +623,10 @@ export class CopyPaste extends BasePlugin {
627
623
  * @private
628
624
  */
629
625
  onPaste(event) {
630
- var _event$target3, _this$hot$getSelected3;
626
+ var _event$target3;
631
627
  const focusedElement = this.hot.getFocusManager().getRefocusElement();
632
628
  const isHotInput = (_event$target3 = event.target) === null || _event$target3 === void 0 ? void 0 : _event$target3.hasAttribute('data-hot-input');
633
- const selectedCell = (_this$hot$getSelected3 = this.hot.getSelectedRangeLast()) === null || _this$hot$getSelected3 === void 0 ? void 0 : _this$hot$getSelected3.highlight;
634
- const TD = selectedCell ? this.hot.getCell(selectedCell.row, selectedCell.col, true) : null;
635
- if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body && TD !== event.target)) {
629
+ if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected() || event.target instanceof HTMLElement && (isHotInput && event.target !== focusedElement || !isHotInput && event.target !== this.hot.rootDocument.body)) {
636
630
  return;
637
631
  }
638
632
  event.preventDefault();