handsontable 0.0.0-next-3b33ccd-20230710 → 0.0.0-next-90e205d-20230711

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/focusCatcher/focusDetector.js +62 -0
  4. package/core/focusCatcher/focusDetector.mjs +58 -0
  5. package/core/focusCatcher/index.js +140 -0
  6. package/core/focusCatcher/index.mjs +136 -0
  7. package/core/index.js +12 -0
  8. package/core/index.mjs +1 -0
  9. package/core.d.ts +0 -1
  10. package/core.js +24 -31
  11. package/core.mjs +24 -31
  12. package/dataMap/metaManager/metaSchema.js +22 -0
  13. package/dataMap/metaManager/metaSchema.mjs +22 -0
  14. package/dist/handsontable.css +13 -2
  15. package/dist/handsontable.full.css +13 -2
  16. package/dist/handsontable.full.js +4815 -4810
  17. package/dist/handsontable.full.min.css +3 -3
  18. package/dist/handsontable.full.min.js +61 -61
  19. package/dist/handsontable.js +13215 -13210
  20. package/dist/handsontable.min.css +3 -3
  21. package/dist/handsontable.min.js +4 -4
  22. package/editorManager.js +10 -4
  23. package/editorManager.mjs +10 -4
  24. package/helpers/mixed.js +1 -1
  25. package/helpers/mixed.mjs +1 -1
  26. package/package.json +1 -1
  27. package/pluginHooks.d.ts +1 -1
  28. package/pluginHooks.js +10 -7
  29. package/pluginHooks.mjs +10 -7
  30. package/plugins/comments/commentEditor.js +0 -1
  31. package/plugins/comments/commentEditor.mjs +0 -1
  32. package/plugins/comments/comments.js +231 -289
  33. package/plugins/comments/comments.mjs +241 -297
  34. package/plugins/contextMenu/contextMenu.js +0 -1
  35. package/plugins/contextMenu/contextMenu.mjs +0 -1
  36. package/plugins/copyPaste/copyPaste.js +1 -1
  37. package/plugins/copyPaste/copyPaste.mjs +1 -1
  38. package/plugins/dropdownMenu/dropdownMenu.js +1 -0
  39. package/plugins/dropdownMenu/dropdownMenu.mjs +1 -0
  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 +1 -0
  47. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +2 -7
  48. package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +2 -7
  49. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +2 -7
  50. package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +2 -7
  51. package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +2 -7
  52. package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +2 -7
  53. package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +2 -7
  54. package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +2 -7
  55. package/shortcutContexts/constants.js +1 -6
  56. package/shortcutContexts/constants.mjs +0 -4
  57. package/tableView.js +4 -9
  58. package/tableView.mjs +4 -9
  59. package/plugins/comments/contextMenuItem/addEditComment.js +0 -51
  60. package/plugins/comments/contextMenuItem/addEditComment.mjs +0 -35
  61. package/plugins/comments/contextMenuItem/readOnlyComment.js +0 -63
  62. package/plugins/comments/contextMenuItem/readOnlyComment.mjs +0 -55
  63. package/plugins/comments/contextMenuItem/removeComment.js +0 -48
  64. package/plugins/comments/contextMenuItem/removeComment.mjs +0 -32
@@ -218,7 +218,6 @@ 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();
222
221
  var rect = _this3.hot.getCell(highlight.row, highlight.col, true).getBoundingClientRect();
223
222
  var offset = (0, _utils.getDocumentOffsetByElement)(_this3.menu.container, _this3.hot.rootDocument);
224
223
  _this3.open({
@@ -211,7 +211,6 @@ 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();
215
214
  var rect = _this3.hot.getCell(highlight.row, highlight.col, true).getBoundingClientRect();
216
215
  var offset = getDocumentOffsetByElement(_this3.menu.container, _this3.hot.rootDocument);
217
216
  _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() || !this.hot.getSelected()) {
738
+ if (!this.hot.isListening() || this.isEditorOpened()) {
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() || !this.hot.getSelected()) {
731
+ if (!this.hot.isListening() || this.isEditorOpened()) {
732
732
  return;
733
733
  }
734
734
  if (event && event.preventDefault) {
@@ -488,6 +488,7 @@ 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;
491
492
 
492
493
  // prevent page reload on button click
493
494
  button.onclick = function () {
@@ -482,6 +482,7 @@ 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;
485
486
 
486
487
  // prevent page reload on button click
487
488
  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, _hotSettings$PLUGIN_K2;
69
+ var _hotSettings$PLUGIN_K;
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 ? void 0 : (_hotSettings$PLUGIN_K2 = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K2 === void 0 ? void 0 : _hotSettings$PLUGIN_K2.langCode
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
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, _hotSettings$PLUGIN_K2;
59
+ var _hotSettings$PLUGIN_K;
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 ? void 0 : (_hotSettings$PLUGIN_K2 = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K2 === void 0 ? void 0 : _hotSettings$PLUGIN_K2.langCode
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
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 ? void 0 : (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
576
+ var sheetId = change === null || change === 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 ? void 0 : (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
627
+ var sheetId = change === null || change === 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 ? void 0 : (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
568
+ var sheetId = change === null || change === 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 ? void 0 : (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
619
+ var sheetId = change === null || change === 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, _element$parentNode$p;
357
+ var _element$parentNode;
358
358
  var thElement = (0, _element.closest)(element, ['TH'], this.hot.rootElement);
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';
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';
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, _element$parentNode$p;
348
+ var _element$parentNode;
349
349
  var thElement = closest(element, ['TH'], this.hot.rootElement);
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';
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';
351
351
  }
352
352
 
353
353
  /**
package/settings.d.ts CHANGED
@@ -124,6 +124,7 @@ export interface GridSettings extends Events {
124
124
  dateFormat?: string;
125
125
  datePickerConfig?: PikadayOptions;
126
126
  defaultDate?: string;
127
+ disableTabNavigation?: boolean;
127
128
  disableVisualSelection?: boolean | 'current' | 'area' | 'header' | Array<'current' | 'area' | 'header'>;
128
129
  dragToScroll?: boolean;
129
130
  dropdownMenu?: DropdownMenuSettings;
@@ -11,15 +11,10 @@ var command = {
11
11
  highlight = _hot$getSelectedRange.highlight,
12
12
  from = _hot$getSelectedRange.from,
13
13
  to = _hot$getSelectedRange.to;
14
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
15
- if (highlight.isCell() || isFocusHighlightedByHeader) {
14
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
16
15
  var row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
17
16
  selection.setRangeStart(from.clone());
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
- }
17
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
23
18
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
24
19
  }
25
20
  }
@@ -7,15 +7,10 @@ export var command = {
7
7
  highlight = _hot$getSelectedRange.highlight,
8
8
  from = _hot$getSelectedRange.from,
9
9
  to = _hot$getSelectedRange.to;
10
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
11
- if (highlight.isCell() || isFocusHighlightedByHeader) {
10
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
12
11
  var row = rowIndexMapper.getNearestNotHiddenIndex(hot.countRows() - 1, -1);
13
12
  selection.setRangeStart(from.clone());
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
- }
13
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
19
14
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
20
15
  }
21
16
  }
@@ -29,15 +29,10 @@ var command = {
29
29
  highlight = _hot$getSelectedRange.highlight,
30
30
  from = _hot$getSelectedRange.from,
31
31
  to = _hot$getSelectedRange.to;
32
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
33
- if (highlight.isCell() || isFocusHighlightedByHeader) {
32
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
34
33
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
35
34
  selection.setRangeStart(from.clone());
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
- }
35
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
41
36
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
42
37
  }
43
38
  }
@@ -25,15 +25,10 @@ export var command = {
25
25
  highlight = _hot$getSelectedRange.highlight,
26
26
  from = _hot$getSelectedRange.from,
27
27
  to = _hot$getSelectedRange.to;
28
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
29
- if (highlight.isCell() || isFocusHighlightedByHeader) {
28
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
30
29
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [hot.countCols() - 1, -1] : [0, 1]));
31
30
  selection.setRangeStart(from.clone());
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
- }
31
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
37
32
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
38
33
  }
39
34
  }
@@ -29,15 +29,10 @@ var command = {
29
29
  highlight = _hot$getSelectedRange.highlight,
30
30
  from = _hot$getSelectedRange.from,
31
31
  to = _hot$getSelectedRange.to;
32
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
33
- if (highlight.isCell() || isFocusHighlightedByHeader) {
32
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
34
33
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
35
34
  selection.setRangeStart(from.clone());
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
- }
35
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
41
36
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
42
37
  }
43
38
  }
@@ -25,15 +25,10 @@ export var command = {
25
25
  highlight = _hot$getSelectedRange.highlight,
26
26
  from = _hot$getSelectedRange.from,
27
27
  to = _hot$getSelectedRange.to;
28
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByColumnHeader();
29
- if (highlight.isCell() || isFocusHighlightedByHeader) {
28
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByColumnHeader()) {
30
29
  var column = columnIndexMapper.getNearestNotHiddenIndex.apply(columnIndexMapper, _toConsumableArray(hot.isRtl() ? [0, 1] : [hot.countCols() - 1, -1]));
31
30
  selection.setRangeStart(from.clone());
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
- }
31
+ selection.selectedByColumnHeader.add(selection.getLayerLevel());
37
32
  selection.setRangeEnd(hot._createCellCoords(to.row, column));
38
33
  }
39
34
  }
@@ -11,15 +11,10 @@ var command = {
11
11
  highlight = _hot$getSelectedRange.highlight,
12
12
  from = _hot$getSelectedRange.from,
13
13
  to = _hot$getSelectedRange.to;
14
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
15
- if (highlight.isCell() || isFocusHighlightedByHeader) {
14
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
16
15
  var row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
17
16
  selection.setRangeStart(from.clone());
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
- }
17
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
23
18
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
24
19
  }
25
20
  }
@@ -7,15 +7,10 @@ export var command = {
7
7
  highlight = _hot$getSelectedRange.highlight,
8
8
  from = _hot$getSelectedRange.from,
9
9
  to = _hot$getSelectedRange.to;
10
- var isFocusHighlightedByHeader = highlight.isHeader() && hot.selection.isSelectedByRowHeader();
11
- if (highlight.isCell() || isFocusHighlightedByHeader) {
10
+ if (highlight.isCell() || highlight.isHeader() && hot.selection.isSelectedByRowHeader()) {
12
11
  var row = rowIndexMapper.getNearestNotHiddenIndex(0, 1);
13
12
  selection.setRangeStart(from.clone());
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
- }
13
+ selection.selectedByRowHeader.add(selection.getLayerLevel());
19
14
  selection.setRangeEnd(hot._createCellCoords(row, to.col));
20
15
  }
21
16
  }
@@ -1,15 +1,10 @@
1
1
  "use strict";
2
2
 
3
3
  exports.__esModule = true;
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';
4
+ exports.GRID_GROUP = exports.EDITOR_EDIT_GROUP = void 0;
9
5
  /**
10
6
  * Group name for keyboard shortcuts that are active when the cell is selected.
11
7
  */
12
- exports.HEADERS_GROUP = HEADERS_GROUP;
13
8
  var GRID_GROUP = 'gridDefault';
14
9
  /**
15
10
  * Group name for keyboard shortcuts that are active when the cell editor is active.
@@ -1,7 +1,3 @@
1
- /**
2
- * Group name for keyboard shortcuts that are active when the header is selected.
3
- */
4
- export var HEADERS_GROUP = 'headersDefault';
5
1
  /**
6
2
  * Group name for keyboard shortcuts that are active when the cell is selected.
7
3
  */
package/tableView.js CHANGED
@@ -356,14 +356,11 @@ var TableView = /*#__PURE__*/function () {
356
356
  });
357
357
  this.eventManager.addEventListener(documentElement, 'mouseup', function (event) {
358
358
  if (selection.isInProgress() && (0, _event.isLeftClick)(event)) {
359
+ // is left mouse button
359
360
  selection.finish();
360
361
  }
361
362
  priv.mouseDown = false;
362
- var isOutsideInputElement = (0, _element.isOutsideInput)(rootDocument.activeElement);
363
- if (!isOutsideInputElement) {
364
- return;
365
- }
366
- if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !(0, _event.isRightClick)(event)) {
363
+ if ((0, _element.isOutsideInput)(rootDocument.activeElement) || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !(0, _event.isRightClick)(event)) {
367
364
  _this.instance.unlisten();
368
365
  }
369
366
  });
@@ -915,12 +912,10 @@ var TableView = /*#__PURE__*/function () {
915
912
  return _this2.afterRender(force);
916
913
  },
917
914
  onScrollVertically: function onScrollVertically() {
918
- _this2.instance.runHooks('afterScrollVertically');
919
- _this2.instance.runHooks('afterScroll');
915
+ return _this2.instance.runHooks('afterScrollVertically');
920
916
  },
921
917
  onScrollHorizontally: function onScrollHorizontally() {
922
- _this2.instance.runHooks('afterScrollHorizontally');
923
- _this2.instance.runHooks('afterScroll');
918
+ return _this2.instance.runHooks('afterScrollHorizontally');
924
919
  },
925
920
  onBeforeRemoveCellClassNames: function onBeforeRemoveCellClassNames() {
926
921
  return _this2.instance.runHooks('beforeRemoveCellClassNames');
package/tableView.mjs CHANGED
@@ -351,14 +351,11 @@ var TableView = /*#__PURE__*/function () {
351
351
  });
352
352
  this.eventManager.addEventListener(documentElement, 'mouseup', function (event) {
353
353
  if (selection.isInProgress() && isLeftClick(event)) {
354
+ // is left mouse button
354
355
  selection.finish();
355
356
  }
356
357
  priv.mouseDown = false;
357
- var isOutsideInputElement = isOutsideInput(rootDocument.activeElement);
358
- if (!isOutsideInputElement) {
359
- return;
360
- }
361
- if (isOutsideInputElement || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !isRightClick(event)) {
358
+ if (isOutsideInput(rootDocument.activeElement) || !selection.isSelected() && !selection.isSelectedByAnyHeader() && !rootElement.contains(event.target) && !isRightClick(event)) {
362
359
  _this.instance.unlisten();
363
360
  }
364
361
  });
@@ -910,12 +907,10 @@ var TableView = /*#__PURE__*/function () {
910
907
  return _this2.afterRender(force);
911
908
  },
912
909
  onScrollVertically: function onScrollVertically() {
913
- _this2.instance.runHooks('afterScrollVertically');
914
- _this2.instance.runHooks('afterScroll');
910
+ return _this2.instance.runHooks('afterScrollVertically');
915
911
  },
916
912
  onScrollHorizontally: function onScrollHorizontally() {
917
- _this2.instance.runHooks('afterScrollHorizontally');
918
- _this2.instance.runHooks('afterScroll');
913
+ return _this2.instance.runHooks('afterScrollHorizontally');
919
914
  },
920
915
  onBeforeRemoveCellClassNames: function onBeforeRemoveCellClassNames() {
921
916
  return _this2.instance.runHooks('beforeRemoveCellClassNames');
@@ -1,51 +0,0 @@
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
- }
@@ -1,35 +0,0 @@
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
- }
@@ -1,63 +0,0 @@
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
- }
@@ -1,55 +0,0 @@
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
- }