handsontable 0.0.0-next-b02b3d1-20230710 → 0.0.0-next-3b33ccd-20230710

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 (64) hide show
  1. package/base.js +2 -2
  2. package/base.mjs +2 -2
  3. package/core.d.ts +1 -0
  4. package/core.js +31 -24
  5. package/core.mjs +31 -24
  6. package/dataMap/metaManager/metaSchema.js +0 -22
  7. package/dataMap/metaManager/metaSchema.mjs +0 -22
  8. package/dist/handsontable.css +2 -13
  9. package/dist/handsontable.full.css +2 -13
  10. package/dist/handsontable.full.js +4811 -4809
  11. package/dist/handsontable.full.min.css +3 -3
  12. package/dist/handsontable.full.min.js +61 -61
  13. package/dist/handsontable.js +13683 -13681
  14. package/dist/handsontable.min.css +3 -3
  15. package/dist/handsontable.min.js +4 -4
  16. package/editorManager.js +4 -10
  17. package/editorManager.mjs +4 -10
  18. package/helpers/mixed.js +1 -1
  19. package/helpers/mixed.mjs +1 -1
  20. package/package.json +1 -1
  21. package/pluginHooks.d.ts +1 -1
  22. package/pluginHooks.js +7 -10
  23. package/pluginHooks.mjs +7 -10
  24. package/plugins/comments/commentEditor.js +1 -0
  25. package/plugins/comments/commentEditor.mjs +1 -0
  26. package/plugins/comments/comments.js +289 -231
  27. package/plugins/comments/comments.mjs +297 -241
  28. package/plugins/comments/contextMenuItem/addEditComment.js +51 -0
  29. package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
  30. package/plugins/comments/contextMenuItem/readOnlyComment.js +63 -0
  31. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +55 -0
  32. package/plugins/comments/contextMenuItem/removeComment.js +48 -0
  33. package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
  34. package/plugins/contextMenu/contextMenu.js +1 -0
  35. package/plugins/contextMenu/contextMenu.mjs +1 -0
  36. package/plugins/copyPaste/copyPaste.js +1 -1
  37. package/plugins/copyPaste/copyPaste.mjs +1 -1
  38. package/plugins/dropdownMenu/dropdownMenu.js +0 -1
  39. package/plugins/dropdownMenu/dropdownMenu.mjs +0 -1
  40. package/plugins/formulas/engine/settings.js +2 -2
  41. package/plugins/formulas/engine/settings.mjs +2 -2
  42. package/plugins/formulas/formulas.js +2 -2
  43. package/plugins/formulas/formulas.mjs +2 -2
  44. package/plugins/manualRowResize/manualRowResize.js +2 -2
  45. package/plugins/manualRowResize/manualRowResize.mjs +2 -2
  46. package/settings.d.ts +0 -1
  47. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +7 -2
  48. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +7 -2
  49. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +7 -2
  50. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +7 -2
  51. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +7 -2
  52. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +7 -2
  53. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +7 -2
  54. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +7 -2
  55. package/shortcutContexts/constants.js +6 -1
  56. package/shortcutContexts/constants.mjs +4 -0
  57. package/tableView.js +9 -4
  58. package/tableView.mjs +9 -4
  59. package/core/focusCatcher/focusDetector.js +0 -62
  60. package/core/focusCatcher/focusDetector.mjs +0 -58
  61. package/core/focusCatcher/index.js +0 -133
  62. package/core/focusCatcher/index.mjs +0 -129
  63. package/core/index.js +0 -12
  64. package/core/index.mjs +0 -1
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ require("core-js/modules/es.array.iterator.js");
5
+ require("core-js/modules/es.object.to-string.js");
6
+ require("core-js/modules/es.string.iterator.js");
7
+ require("core-js/modules/es.weak-map.js");
8
+ require("core-js/modules/web.dom-collections.iterator.js");
9
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
10
+ require("core-js/modules/es.symbol.js");
11
+ require("core-js/modules/es.symbol.description.js");
12
+ require("core-js/modules/es.symbol.iterator.js");
13
+ exports.__esModule = true;
14
+ exports.default = addEditCommentItem;
15
+ var C = _interopRequireWildcard(require("../../../i18n/constants"));
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ /**
19
+ * @param {Comments} plugin The Comments plugin instance.
20
+ * @returns {object}
21
+ */
22
+ function addEditCommentItem(plugin) {
23
+ return {
24
+ key: 'commentsAddEdit',
25
+ name: function name() {
26
+ var _this$getSelectedRang;
27
+ var highlight = (_this$getSelectedRang = this.getSelectedRangeLast()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
28
+ if (highlight && highlight.isCell() && plugin.getCommentAtCell(highlight.row, highlight.col)) {
29
+ return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_EDIT_COMMENT);
30
+ }
31
+ return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ADD_COMMENT);
32
+ },
33
+ callback: function callback() {
34
+ var range = this.getSelectedRangeLast();
35
+ this.deselectCell();
36
+ plugin.setRange(range);
37
+ plugin.show();
38
+ plugin.focusEditor();
39
+ },
40
+ disabled: function disabled() {
41
+ var range = this.getSelectedRangeLast();
42
+ if (!range) {
43
+ return true;
44
+ }
45
+ if (range.highlight.isHeader()) {
46
+ return true;
47
+ }
48
+ return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
49
+ }
50
+ };
51
+ }
@@ -0,0 +1,35 @@
1
+ import * as C from "../../../i18n/constants.mjs";
2
+ /**
3
+ * @param {Comments} plugin The Comments plugin instance.
4
+ * @returns {object}
5
+ */
6
+ export default function addEditCommentItem(plugin) {
7
+ return {
8
+ key: 'commentsAddEdit',
9
+ name: function name() {
10
+ var _this$getSelectedRang;
11
+ var highlight = (_this$getSelectedRang = this.getSelectedRangeLast()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
12
+ if (highlight && highlight.isCell() && plugin.getCommentAtCell(highlight.row, highlight.col)) {
13
+ return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_EDIT_COMMENT);
14
+ }
15
+ return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_ADD_COMMENT);
16
+ },
17
+ callback: function callback() {
18
+ var range = this.getSelectedRangeLast();
19
+ this.deselectCell();
20
+ plugin.setRange(range);
21
+ plugin.show();
22
+ plugin.focusEditor();
23
+ },
24
+ disabled: function disabled() {
25
+ var range = this.getSelectedRangeLast();
26
+ if (!range) {
27
+ return true;
28
+ }
29
+ if (range.highlight.isHeader()) {
30
+ return true;
31
+ }
32
+ return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
33
+ }
34
+ };
35
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.iterator.js");
4
+ require("core-js/modules/es.array.iterator.js");
5
+ require("core-js/modules/es.string.iterator.js");
6
+ require("core-js/modules/web.dom-collections.iterator.js");
7
+ require("core-js/modules/es.weak-map.js");
8
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
9
+ exports.__esModule = true;
10
+ exports.default = readOnlyCommentItem;
11
+ require("core-js/modules/es.symbol.to-primitive.js");
12
+ require("core-js/modules/es.date.to-primitive.js");
13
+ require("core-js/modules/es.symbol.js");
14
+ require("core-js/modules/es.symbol.description.js");
15
+ require("core-js/modules/es.object.to-string.js");
16
+ require("core-js/modules/es.number.constructor.js");
17
+ var C = _interopRequireWildcard(require("../../../i18n/constants"));
18
+ var _utils = require("../../contextMenu/utils");
19
+ var _comments = require("../comments");
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
23
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
24
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
25
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
26
+ /**
27
+ * @param {Comments} plugin The Comments plugin instance.
28
+ * @returns {object}
29
+ */
30
+ function readOnlyCommentItem(plugin) {
31
+ return {
32
+ key: 'commentsReadOnly',
33
+ name: function name() {
34
+ var label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT);
35
+ var areReadOnly = (0, _utils.checkSelectionConsistency)(this.getSelectedRange(), function (row, col) {
36
+ return plugin.getCommentMeta(row, col, _comments.META_READONLY);
37
+ });
38
+ return areReadOnly ? (0, _utils.markLabelAsSelected)(label) : label;
39
+ },
40
+ callback: function callback() {
41
+ var range = this.getSelectedRangeLast();
42
+ range.forAll(function (row, column) {
43
+ if (row >= 0 && column >= 0) {
44
+ var currentState = !!plugin.getCommentMeta(row, column, _comments.META_READONLY);
45
+ plugin.updateCommentMeta(row, column, _defineProperty({}, _comments.META_READONLY, !currentState));
46
+ }
47
+ });
48
+ },
49
+ disabled: function disabled() {
50
+ var range = this.getSelectedRangeLast();
51
+ if (!range) {
52
+ return true;
53
+ }
54
+ if (range.highlight.isHeader()) {
55
+ return true;
56
+ }
57
+ if (!plugin.getCommentAtCell(range.highlight.row, range.highlight.col)) {
58
+ return true;
59
+ }
60
+ return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
61
+ }
62
+ };
63
+ }
@@ -0,0 +1,55 @@
1
+ import "core-js/modules/es.symbol.to-primitive.js";
2
+ import "core-js/modules/es.date.to-primitive.js";
3
+ import "core-js/modules/es.symbol.js";
4
+ import "core-js/modules/es.symbol.description.js";
5
+ import "core-js/modules/es.object.to-string.js";
6
+ import "core-js/modules/es.number.constructor.js";
7
+ import "core-js/modules/es.symbol.iterator.js";
8
+ import "core-js/modules/es.array.iterator.js";
9
+ import "core-js/modules/es.string.iterator.js";
10
+ import "core-js/modules/web.dom-collections.iterator.js";
11
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
15
+ import * as C from "../../../i18n/constants.mjs";
16
+ import { checkSelectionConsistency, markLabelAsSelected } from "../../contextMenu/utils.mjs";
17
+ import { META_READONLY } from "../comments.mjs";
18
+ /**
19
+ * @param {Comments} plugin The Comments plugin instance.
20
+ * @returns {object}
21
+ */
22
+ export default function readOnlyCommentItem(plugin) {
23
+ return {
24
+ key: 'commentsReadOnly',
25
+ name: function name() {
26
+ var label = this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT);
27
+ var areReadOnly = checkSelectionConsistency(this.getSelectedRange(), function (row, col) {
28
+ return plugin.getCommentMeta(row, col, META_READONLY);
29
+ });
30
+ return areReadOnly ? markLabelAsSelected(label) : label;
31
+ },
32
+ callback: function callback() {
33
+ var range = this.getSelectedRangeLast();
34
+ range.forAll(function (row, column) {
35
+ if (row >= 0 && column >= 0) {
36
+ var currentState = !!plugin.getCommentMeta(row, column, META_READONLY);
37
+ plugin.updateCommentMeta(row, column, _defineProperty({}, META_READONLY, !currentState));
38
+ }
39
+ });
40
+ },
41
+ disabled: function disabled() {
42
+ var range = this.getSelectedRangeLast();
43
+ if (!range) {
44
+ return true;
45
+ }
46
+ if (range.highlight.isHeader()) {
47
+ return true;
48
+ }
49
+ if (!plugin.getCommentAtCell(range.highlight.row, range.highlight.col)) {
50
+ return true;
51
+ }
52
+ return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
53
+ }
54
+ };
55
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ require("core-js/modules/es.array.iterator.js");
5
+ require("core-js/modules/es.object.to-string.js");
6
+ require("core-js/modules/es.string.iterator.js");
7
+ require("core-js/modules/es.weak-map.js");
8
+ require("core-js/modules/web.dom-collections.iterator.js");
9
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
10
+ require("core-js/modules/es.symbol.js");
11
+ require("core-js/modules/es.symbol.description.js");
12
+ require("core-js/modules/es.symbol.iterator.js");
13
+ exports.__esModule = true;
14
+ exports.default = removeCommentItem;
15
+ var C = _interopRequireWildcard(require("../../../i18n/constants"));
16
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
18
+ /**
19
+ * @param {Comments} plugin The Comments plugin instance.
20
+ * @returns {object}
21
+ */
22
+ function removeCommentItem(plugin) {
23
+ return {
24
+ key: 'commentsRemove',
25
+ name: function name() {
26
+ return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COMMENT);
27
+ },
28
+ callback: function callback() {
29
+ var range = this.getSelectedRangeLast();
30
+ range.forAll(function (row, column) {
31
+ if (row >= 0 && column >= 0) {
32
+ plugin.removeCommentAtCell(row, column, false);
33
+ }
34
+ });
35
+ this.render();
36
+ },
37
+ disabled: function disabled() {
38
+ var range = this.getSelectedRangeLast();
39
+ if (!range) {
40
+ return true;
41
+ }
42
+ if (range.highlight.isHeader()) {
43
+ return true;
44
+ }
45
+ return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
46
+ }
47
+ };
48
+ }
@@ -0,0 +1,32 @@
1
+ import * as C from "../../../i18n/constants.mjs";
2
+ /**
3
+ * @param {Comments} plugin The Comments plugin instance.
4
+ * @returns {object}
5
+ */
6
+ export default function removeCommentItem(plugin) {
7
+ return {
8
+ key: 'commentsRemove',
9
+ name: function name() {
10
+ return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_REMOVE_COMMENT);
11
+ },
12
+ callback: function callback() {
13
+ var range = this.getSelectedRangeLast();
14
+ range.forAll(function (row, column) {
15
+ if (row >= 0 && column >= 0) {
16
+ plugin.removeCommentAtCell(row, column, false);
17
+ }
18
+ });
19
+ this.render();
20
+ },
21
+ disabled: function disabled() {
22
+ var range = this.getSelectedRangeLast();
23
+ if (!range) {
24
+ return true;
25
+ }
26
+ if (range.highlight.isHeader()) {
27
+ return true;
28
+ }
29
+ return this.countRenderedRows() === 0 || this.countRenderedCols() === 0;
30
+ }
31
+ };
32
+ }
@@ -218,6 +218,7 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
218
218
  callback: function callback() {
219
219
  var _this3$hot$getSelecte = _this3.hot.getSelectedRangeLast(),
220
220
  highlight = _this3$hot$getSelecte.highlight;
221
+ _this3.hot.scrollToFocusedCell();
221
222
  var rect = _this3.hot.getCell(highlight.row, highlight.col, true).getBoundingClientRect();
222
223
  var offset = (0, _utils.getDocumentOffsetByElement)(_this3.menu.container, _this3.hot.rootDocument);
223
224
  _this3.open({
@@ -211,6 +211,7 @@ export var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
211
211
  callback: function callback() {
212
212
  var _this3$hot$getSelecte = _this3.hot.getSelectedRangeLast(),
213
213
  highlight = _this3$hot$getSelecte.highlight;
214
+ _this3.hot.scrollToFocusedCell();
214
215
  var rect = _this3.hot.getCell(highlight.row, highlight.col, true).getBoundingClientRect();
215
216
  var offset = getDocumentOffsetByElement(_this3.menu.container, _this3.hot.rootDocument);
216
217
  _this3.open({
@@ -735,7 +735,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
735
735
  }, {
736
736
  key: "onPaste",
737
737
  value: function onPaste(event) {
738
- if (!this.hot.isListening() || this.isEditorOpened()) {
738
+ if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected()) {
739
739
  return;
740
740
  }
741
741
  if (event && event.preventDefault) {
@@ -728,7 +728,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
728
728
  }, {
729
729
  key: "onPaste",
730
730
  value: function onPaste(event) {
731
- if (!this.hot.isListening() || this.isEditorOpened()) {
731
+ if (!this.hot.isListening() || this.isEditorOpened() || !this.hot.getSelected()) {
732
732
  return;
733
733
  }
734
734
  if (event && event.preventDefault) {
@@ -488,7 +488,6 @@ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
488
488
  var button = this.hot.rootDocument.createElement('button');
489
489
  button.className = BUTTON_CLASS_NAME;
490
490
  button.type = 'button';
491
- button.tabIndex = -1;
492
491
 
493
492
  // prevent page reload on button click
494
493
  button.onclick = function () {
@@ -482,7 +482,6 @@ export var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
482
482
  var button = this.hot.rootDocument.createElement('button');
483
483
  button.className = BUTTON_CLASS_NAME;
484
484
  button.type = 'button';
485
- button.tabIndex = -1;
486
485
 
487
486
  // prevent page reload on button click
488
487
  button.onclick = function () {
@@ -66,11 +66,11 @@ var DEFAULT_SETTINGS = {
66
66
  */
67
67
  exports.DEFAULT_SETTINGS = DEFAULT_SETTINGS;
68
68
  function getEngineSettingsOverrides(hotSettings) {
69
- var _hotSettings$PLUGIN_K;
69
+ var _hotSettings$PLUGIN_K, _hotSettings$PLUGIN_K2;
70
70
  return {
71
71
  maxColumns: hotSettings.maxColumns,
72
72
  maxRows: hotSettings.maxRows,
73
- language: (_hotSettings$PLUGIN_K = hotSettings[_formulas.PLUGIN_KEY]) === null || _hotSettings$PLUGIN_K === void 0 || (_hotSettings$PLUGIN_K = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K === void 0 ? void 0 : _hotSettings$PLUGIN_K.langCode
73
+ language: (_hotSettings$PLUGIN_K = hotSettings[_formulas.PLUGIN_KEY]) === null || _hotSettings$PLUGIN_K === void 0 ? void 0 : (_hotSettings$PLUGIN_K2 = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K2 === void 0 ? void 0 : _hotSettings$PLUGIN_K2.langCode
74
74
  };
75
75
  }
76
76
 
@@ -56,11 +56,11 @@ export var DEFAULT_SETTINGS = {
56
56
  * @returns {object} Object containing the overriding options.
57
57
  */
58
58
  export function getEngineSettingsOverrides(hotSettings) {
59
- var _hotSettings$PLUGIN_K;
59
+ var _hotSettings$PLUGIN_K, _hotSettings$PLUGIN_K2;
60
60
  return {
61
61
  maxColumns: hotSettings.maxColumns,
62
62
  maxRows: hotSettings.maxRows,
63
- language: (_hotSettings$PLUGIN_K = hotSettings[PLUGIN_KEY]) === null || _hotSettings$PLUGIN_K === void 0 || (_hotSettings$PLUGIN_K = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K === void 0 ? void 0 : _hotSettings$PLUGIN_K.langCode
63
+ language: (_hotSettings$PLUGIN_K = hotSettings[PLUGIN_KEY]) === null || _hotSettings$PLUGIN_K === void 0 ? void 0 : (_hotSettings$PLUGIN_K2 = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K2 === void 0 ? void 0 : _hotSettings$PLUGIN_K2.langCode
64
64
  };
65
65
  }
66
66
 
@@ -573,7 +573,7 @@ var Formulas = /*#__PURE__*/function (_BasePlugin) {
573
573
  dependentCells.forEach(function (change) {
574
574
  var _change$address;
575
575
  // For the Named expression the address is empty, hence the `sheetId` is undefined.
576
- var sheetId = change === null || change === void 0 || (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
576
+ var sheetId = change === null || change === void 0 ? void 0 : (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
577
577
  if (sheetId !== void 0) {
578
578
  if (!affectedSheetIds.has(sheetId)) {
579
579
  affectedSheetIds.add(sheetId);
@@ -624,7 +624,7 @@ var Formulas = /*#__PURE__*/function (_BasePlugin) {
624
624
  }
625
625
 
626
626
  // For the Named expression the address is empty, hence the `sheetId` is undefined.
627
- var sheetId = change === null || change === void 0 || (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
627
+ var sheetId = change === null || change === void 0 ? void 0 : (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
628
628
  var addressId = stringifyAddress(change);
629
629
 
630
630
  // Validate the cells that depend on the calculated formulas. Skip that cells
@@ -565,7 +565,7 @@ export var Formulas = /*#__PURE__*/function (_BasePlugin) {
565
565
  dependentCells.forEach(function (change) {
566
566
  var _change$address;
567
567
  // For the Named expression the address is empty, hence the `sheetId` is undefined.
568
- var sheetId = change === null || change === void 0 || (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
568
+ var sheetId = change === null || change === void 0 ? void 0 : (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
569
569
  if (sheetId !== void 0) {
570
570
  if (!affectedSheetIds.has(sheetId)) {
571
571
  affectedSheetIds.add(sheetId);
@@ -616,7 +616,7 @@ export var Formulas = /*#__PURE__*/function (_BasePlugin) {
616
616
  }
617
617
 
618
618
  // For the Named expression the address is empty, hence the `sheetId` is undefined.
619
- var sheetId = change === null || change === void 0 || (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
619
+ var sheetId = change === null || change === void 0 ? void 0 : (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
620
620
  var addressId = stringifyAddress(change);
621
621
 
622
622
  // Validate the cells that depend on the calculated formulas. Skip that cells
@@ -354,9 +354,9 @@ var ManualRowResize = /*#__PURE__*/function (_BasePlugin) {
354
354
  }, {
355
355
  key: "checkIfRowHeader",
356
356
  value: function checkIfRowHeader(element) {
357
- var _element$parentNode;
357
+ var _element$parentNode, _element$parentNode$p;
358
358
  var thElement = (0, _element.closest)(element, ['TH'], this.hot.rootElement);
359
- return thElement && ((_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 || (_element$parentNode = _element$parentNode.parentNode) === null || _element$parentNode === void 0 ? void 0 : _element$parentNode.tagName) === 'TBODY';
359
+ return thElement && ((_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : (_element$parentNode$p = _element$parentNode.parentNode) === null || _element$parentNode$p === void 0 ? void 0 : _element$parentNode$p.tagName) === 'TBODY';
360
360
  }
361
361
 
362
362
  /**
@@ -345,9 +345,9 @@ export var ManualRowResize = /*#__PURE__*/function (_BasePlugin) {
345
345
  }, {
346
346
  key: "checkIfRowHeader",
347
347
  value: function checkIfRowHeader(element) {
348
- var _element$parentNode;
348
+ var _element$parentNode, _element$parentNode$p;
349
349
  var thElement = closest(element, ['TH'], this.hot.rootElement);
350
- return thElement && ((_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 || (_element$parentNode = _element$parentNode.parentNode) === null || _element$parentNode === void 0 ? void 0 : _element$parentNode.tagName) === 'TBODY';
350
+ return thElement && ((_element$parentNode = element.parentNode) === null || _element$parentNode === void 0 ? void 0 : (_element$parentNode$p = _element$parentNode.parentNode) === null || _element$parentNode$p === void 0 ? void 0 : _element$parentNode$p.tagName) === 'TBODY';
351
351
  }
352
352
 
353
353
  /**
package/settings.d.ts CHANGED
@@ -124,7 +124,6 @@ export interface GridSettings extends Events {
124
124
  dateFormat?: string;
125
125
  datePickerConfig?: PikadayOptions;
126
126
  defaultDate?: string;
127
- disableTabNavigation?: boolean;
128
127
  disableVisualSelection?: boolean | 'current' | 'area' | 'header' | Array<'current' | 'area' | 'header'>;
129
128
  dragToScroll?: boolean;
130
129
  dropdownMenu?: DropdownMenuSettings;
@@ -11,10 +11,15 @@ var command = {
11
11
  highlight = _hot$getSelectedRange.highlight,
12
12
  from = _hot$getSelectedRange.from,
13
13
  to = _hot$getSelectedRange.to;
14
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
14
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
15
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
15
16
  var row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
16
17
  selection.setRangeStart(from.clone());
17
- selection.selectedByRowHeader.add(selection.getLayerLevel());
18
+
19
+ // Restore the row highlight by header flag after setting up a new selection.
20
+ if (isFocusHighlightedByHeader) {
21
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
22
+ }
18
23
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
19
24
  }
20
25
  }
@@ -7,10 +7,15 @@ export var command = {
7
7
  highlight = _hot$getSelectedRange.highlight,
8
8
  from = _hot$getSelectedRange.from,
9
9
  to = _hot$getSelectedRange.to;
10
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
10
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
11
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
11
12
  var row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
12
13
  selection.setRangeStart(from.clone());
13
- selection.selectedByRowHeader.add(selection.getLayerLevel());
14
+
15
+ // Restore the row highlight by header flag after setting up a new selection.
16
+ if (isFocusHighlightedByHeader) {
17
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
18
+ }
14
19
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
15
20
  }
16
21
  }
@@ -29,10 +29,15 @@ var command = {
29
29
  highlight = _hot$getSelectedRange.highlight,
30
30
  from = _hot$getSelectedRange.from,
31
31
  to = _hot$getSelectedRange.to;
32
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
32
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
33
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
33
34
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
34
35
  selection.setRangeStart(from.clone());
35
- selection.selectedByColumnHeader.add(selection.getLayerLevel());
36
+
37
+ // Restore the column highlight by header flag after setting up a new selection.
38
+ if (isFocusHighlightedByHeader) {
39
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
40
+ }
36
41
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
37
42
  }
38
43
  }
@@ -25,10 +25,15 @@ export var command = {
25
25
  highlight = _hot$getSelectedRange.highlight,
26
26
  from = _hot$getSelectedRange.from,
27
27
  to = _hot$getSelectedRange.to;
28
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
28
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
29
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
29
30
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
30
31
  selection.setRangeStart(from.clone());
31
- selection.selectedByColumnHeader.add(selection.getLayerLevel());
32
+
33
+ // Restore the column highlight by header flag after setting up a new selection.
34
+ if (isFocusHighlightedByHeader) {
35
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
36
+ }
32
37
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
33
38
  }
34
39
  }
@@ -29,10 +29,15 @@ var command = {
29
29
  highlight = _hot$getSelectedRange.highlight,
30
30
  from = _hot$getSelectedRange.from,
31
31
  to = _hot$getSelectedRange.to;
32
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
32
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
33
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
33
34
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
34
35
  selection.setRangeStart(from.clone());
35
- selection.selectedByColumnHeader.add(selection.getLayerLevel());
36
+
37
+ // Restore the column highlight by header flag after setting up a new selection.
38
+ if (isFocusHighlightedByHeader) {
39
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
40
+ }
36
41
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
37
42
  }
38
43
  }
@@ -25,10 +25,15 @@ export var command = {
25
25
  highlight = _hot$getSelectedRange.highlight,
26
26
  from = _hot$getSelectedRange.from,
27
27
  to = _hot$getSelectedRange.to;
28
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
28
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
29
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
29
30
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
30
31
  selection.setRangeStart(from.clone());
31
- selection.selectedByColumnHeader.add(selection.getLayerLevel());
32
+
33
+ // Restore the column highlight by header flag after setting up a new selection.
34
+ if (isFocusHighlightedByHeader) {
35
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
36
+ }
32
37
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
33
38
  }
34
39
  }
@@ -11,10 +11,15 @@ var command = {
11
11
  highlight = _hot$getSelectedRange.highlight,
12
12
  from = _hot$getSelectedRange.from,
13
13
  to = _hot$getSelectedRange.to;
14
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
14
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
15
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
15
16
  var row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
16
17
  selection.setRangeStart(from.clone());
17
- selection.selectedByRowHeader.add(selection.getLayerLevel());
18
+
19
+ // Restore the row highlight by header flag after setting up a new selection.
20
+ if (isFocusHighlightedByHeader) {
21
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
22
+ }
18
23
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
19
24
  }
20
25
  }
@@ -7,10 +7,15 @@ export var command = {
7
7
  highlight = _hot$getSelectedRange.highlight,
8
8
  from = _hot$getSelectedRange.from,
9
9
  to = _hot$getSelectedRange.to;
10
- if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
10
+ var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
11
+ if (highlight.isCell() || isFocusHighlightedByHeader) {
11
12
  var row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
12
13
  selection.setRangeStart(from.clone());
13
- selection.selectedByRowHeader.add(selection.getLayerLevel());
14
+
15
+ // Restore the row highlight by header flag after setting up a new selection.
16
+ if (isFocusHighlightedByHeader) {
17
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
18
+ }
14
19
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
15
20
  }
16
21
  }
@@ -1,10 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
4
- exports.GRID_GROUP = exports.EDITOR_EDIT_GROUP = void 0;
4
+ exports.HEADERS_GROUP = exports.GRID_GROUP = exports.EDITOR_EDIT_GROUP = void 0;
5
+ /**
6
+ * Group name for keyboard shortcuts that are active when the header is selected.
7
+ */
8
+ var HEADERS_GROUP = 'headersDefault';
5
9
  /**
6
10
  * Group name for keyboard shortcuts that are active when the cell is selected.
7
11
  */
12
+ exports.HEADERS_GROUP = HEADERS_GROUP;
8
13
  var GRID_GROUP = 'gridDefault';
9
14
  /**
10
15
  * Group name for keyboard shortcuts that are active when the cell editor is active.
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Group name for keyboard shortcuts that are active when the header is selected.
3
+ */
4
+ export var HEADERS_GROUP = 'headersDefault';
1
5
  /**
2
6
  * Group name for keyboard shortcuts that are active when the cell is selected.
3
7
  */