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
package/core.mjs CHANGED
@@ -10,10 +10,11 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
10
10
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
11
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
12
12
  import "core-js/modules/es.array.iterator.js";
13
+ import "core-js/modules/es.map.js";
13
14
  import "core-js/modules/es.object.to-string.js";
14
- import "core-js/modules/es.set.js";
15
15
  import "core-js/modules/es.string.iterator.js";
16
16
  import "core-js/modules/web.dom-collections.iterator.js";
17
+ import "core-js/modules/es.set.js";
17
18
  import "core-js/modules/es.array.includes.js";
18
19
  import "core-js/modules/es.array.concat.js";
19
20
  import "core-js/modules/es.array.sort.js";
@@ -26,10 +27,10 @@ import "core-js/modules/es.array.map.js";
26
27
  import "core-js/modules/es.regexp.exec.js";
27
28
  import "core-js/modules/es.string.replace.js";
28
29
  import "core-js/modules/es.array.filter.js";
30
+ import "core-js/modules/web.dom-collections.for-each.js";
29
31
  import "core-js/modules/es.array.from.js";
30
32
  import "core-js/modules/es.array.index-of.js";
31
33
  import "core-js/modules/es.array.reverse.js";
32
- import "core-js/modules/web.dom-collections.for-each.js";
33
34
  import "core-js/modules/web.timers.js";
34
35
  import "core-js/modules/web.immediate.js";
35
36
  import "core-js/modules/es.symbol.js";
@@ -63,11 +64,21 @@ import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from
63
64
  import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
64
65
  import { Selection } from "./selection/index.mjs";
65
66
  import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
67
+ import { installFocusCatcher } from "./core/index.mjs";
66
68
  import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
67
69
  import { createShortcutManager } from "./shortcuts/index.mjs";
68
70
  import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
69
71
  var activeGuid = null;
70
72
 
73
+ /**
74
+ * Keeps the collection of the all Handsontable instances created on the same page. The
75
+ * list is then used to trigger the "afterUnlisten" hook when the "listen()" method was
76
+ * called on another instance.
77
+ *
78
+ * @type {Map<string, Core>}
79
+ */
80
+ var foreignHotInstances = new Map();
81
+
71
82
  /**
72
83
  * A set of deprecated feature names.
73
84
  *
@@ -245,6 +256,8 @@ export default function Core(rootElement, userSettings) {
245
256
  }
246
257
  this.guid = "ht_".concat(randomString()); // this is the namespace for global events
247
258
 
259
+ foreignHotInstances.set(this.guid, this);
260
+
248
261
  /**
249
262
  * Instance of index mapper which is responsible for managing the column indexes.
250
263
  *
@@ -1101,6 +1114,9 @@ export default function Core(rootElement, userSettings) {
1101
1114
  this.updateSettings(tableMeta, true);
1102
1115
  this.view = new TableView(this);
1103
1116
  editorManager = EditorManager.getInstance(instance, tableMeta, selection);
1117
+ if (isRootInstance(this)) {
1118
+ installFocusCatcher(instance);
1119
+ }
1104
1120
  instance.runHooks('init');
1105
1121
  this.forceFullRender = true; // used when data was changed
1106
1122
  this.view.render();
@@ -1517,6 +1533,11 @@ export default function Core(rootElement, userSettings) {
1517
1533
  */
1518
1534
  this.listen = function () {
1519
1535
  if (instance && !instance.isListening()) {
1536
+ foreignHotInstances.forEach(function (foreignHot) {
1537
+ if (instance !== foreignHot) {
1538
+ foreignHot.unlisten();
1539
+ }
1540
+ });
1520
1541
  activeGuid = instance.guid;
1521
1542
  instance.runHooks('afterListen');
1522
1543
  }
@@ -4119,35 +4140,6 @@ export default function Core(rootElement, userSettings) {
4119
4140
  return false;
4120
4141
  };
4121
4142
 
4122
- /**
4123
- * Scrolls the viewport to coordinates specified by the currently focused cell.
4124
- *
4125
- * @since 14.0.0
4126
- * @memberof Core#
4127
- * @function scrollToFocusedCell
4128
- * @param {Function} callback The callback function to call after the viewport is scrolled.
4129
- */
4130
- this.scrollToFocusedCell = function () {
4131
- var callback = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
4132
- if (!this.selection.isSelected()) {
4133
- return;
4134
- }
4135
- this.addHookOnce('afterScroll', callback);
4136
- var _this$getSelectedRang = this.getSelectedRangeLast(),
4137
- highlight = _this$getSelectedRang.highlight;
4138
- var renderableRowIndex = this.rowIndexMapper.getRenderableFromVisualIndex(highlight.row);
4139
- var renderableColumnIndex = this.columnIndexMapper.getRenderableFromVisualIndex(highlight.col);
4140
- var isScrolled = this.view.scrollViewport(this._createCellCoords(renderableRowIndex, renderableColumnIndex));
4141
- if (isScrolled) {
4142
- this.view.render();
4143
- } else {
4144
- this.removeHook('afterScroll', callback);
4145
- this._registerImmediate(function () {
4146
- return callback();
4147
- });
4148
- }
4149
- };
4150
-
4151
4143
  /**
4152
4144
  * Removes the table from the DOM and destroys the instance of the Handsontable.
4153
4145
  *
@@ -4168,6 +4160,7 @@ export default function Core(rootElement, userSettings) {
4168
4160
  dataSource = null;
4169
4161
  this.getShortcutManager().destroy();
4170
4162
  metaManager.clearCache();
4163
+ foreignHotInstances.delete(this.guid);
4171
4164
  if (isRootInstance(instance)) {
4172
4165
  var licenseInfo = this.rootDocument.querySelector('.hot-display-license-info');
4173
4166
  if (licenseInfo) {
@@ -3131,6 +3131,28 @@ var _default = function _default() {
3131
3131
  * ```
3132
3132
  */
3133
3133
  navigableHeaders: false,
3134
+ /**
3135
+ * When set to `true`, the `disableTabNavigation` option changes the behavior of the
3136
+ * <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts. The Handsontable
3137
+ * no more captures that shortcuts to make the grid navigation available (`disableTabNavigation: false`)
3138
+ * but returns control to the browser so the native page navigation is possible.
3139
+ *
3140
+ * @since 14.0.0
3141
+ * @memberof Options#
3142
+ * @type {boolean}
3143
+ * @default false
3144
+ * @category Core
3145
+ *
3146
+ * @example
3147
+ * ```js
3148
+ * // you can't navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
3149
+ * disableTabNavigation: true,
3150
+ *
3151
+ * // default behavior: you can navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
3152
+ * disableTabNavigation: false,
3153
+ * ```
3154
+ */
3155
+ disableTabNavigation: false,
3134
3156
  /**
3135
3157
  * @description
3136
3158
  * The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
@@ -3127,6 +3127,28 @@ export default (function () {
3127
3127
  * ```
3128
3128
  */
3129
3129
  navigableHeaders: false,
3130
+ /**
3131
+ * When set to `true`, the `disableTabNavigation` option changes the behavior of the
3132
+ * <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts. The Handsontable
3133
+ * no more captures that shortcuts to make the grid navigation available (`disableTabNavigation: false`)
3134
+ * but returns control to the browser so the native page navigation is possible.
3135
+ *
3136
+ * @since 14.0.0
3137
+ * @memberof Options#
3138
+ * @type {boolean}
3139
+ * @default false
3140
+ * @category Core
3141
+ *
3142
+ * @example
3143
+ * ```js
3144
+ * // you can't navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
3145
+ * disableTabNavigation: true,
3146
+ *
3147
+ * // default behavior: you can navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
3148
+ * disableTabNavigation: false,
3149
+ * ```
3150
+ */
3151
+ disableTabNavigation: false,
3130
3152
  /**
3131
3153
  * @description
3132
3154
  * The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-3b33ccd-20230710
29
- * Release date: 22/06/2023 (built at 10/07/2023 09:30:15)
28
+ * Version: 0.0.0-next-90e205d-20230711
29
+ * Release date: 22/06/2023 (built at 11/07/2023 14:08:29)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -410,6 +410,17 @@ innerBorderBottom - Property controlled by bottom overlay
410
410
  font-size: 10px;
411
411
  }
412
412
 
413
+ .handsontable .htFocusCatcher {
414
+ position: absolute;
415
+ z-index: -1;
416
+ opacity: 0;
417
+ border: 0;
418
+ margin: 0;
419
+ padding: 0;
420
+ width: 0;
421
+ height: 0;
422
+ }
423
+
413
424
  /* plugins */
414
425
  /* row + column resizer*/
415
426
  .handsontable .manualColumnResizer {
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-3b33ccd-20230710
29
- * Release date: 22/06/2023 (built at 10/07/2023 09:30:15)
28
+ * Version: 0.0.0-next-90e205d-20230711
29
+ * Release date: 22/06/2023 (built at 11/07/2023 14:08:29)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -410,6 +410,17 @@ innerBorderBottom - Property controlled by bottom overlay
410
410
  font-size: 10px;
411
411
  }
412
412
 
413
+ .handsontable .htFocusCatcher {
414
+ position: absolute;
415
+ z-index: -1;
416
+ opacity: 0;
417
+ border: 0;
418
+ margin: 0;
419
+ padding: 0;
420
+ width: 0;
421
+ height: 0;
422
+ }
423
+
413
424
  /* plugins */
414
425
  /* row + column resizer*/
415
426
  .handsontable .manualColumnResizer {