handsontable 0.0.0-next-c8116f8-20240920 → 0.0.0-next-fad35d5-20240924

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 (113) hide show
  1. package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.js +23 -0
  2. package/3rdparty/walkontable/src/calculator/calculationType/renderedColumns.mjs +23 -0
  3. package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.js +23 -0
  4. package/3rdparty/walkontable/src/calculator/calculationType/renderedRows.mjs +23 -0
  5. package/3rdparty/walkontable/src/core/_base.js +7 -0
  6. package/3rdparty/walkontable/src/core/_base.mjs +7 -0
  7. package/3rdparty/walkontable/src/facade/core.js +3 -0
  8. package/3rdparty/walkontable/src/facade/core.mjs +3 -0
  9. package/3rdparty/walkontable/src/overlay/_base.js +3 -0
  10. package/3rdparty/walkontable/src/overlay/_base.mjs +3 -0
  11. package/3rdparty/walkontable/src/selection/border/border.js +32 -44
  12. package/3rdparty/walkontable/src/selection/border/border.mjs +32 -44
  13. package/3rdparty/walkontable/src/selection/scanner.js +46 -11
  14. package/3rdparty/walkontable/src/selection/scanner.mjs +46 -11
  15. package/3rdparty/walkontable/src/settings.js +8 -0
  16. package/3rdparty/walkontable/src/settings.mjs +8 -0
  17. package/3rdparty/walkontable/src/table.js +6 -3
  18. package/3rdparty/walkontable/src/table.mjs +6 -3
  19. package/3rdparty/walkontable/src/viewport.js +26 -4
  20. package/3rdparty/walkontable/src/viewport.mjs +26 -4
  21. package/base.js +4 -4
  22. package/base.mjs +3 -3
  23. package/core/hooks/bucket.js +180 -0
  24. package/core/hooks/bucket.mjs +176 -0
  25. package/{pluginHooks.mjs → core/hooks/constants.js} +20 -486
  26. package/{pluginHooks.js → core/hooks/constants.mjs} +16 -489
  27. package/{pluginHooks.d.ts → core/hooks/index.d.ts} +17 -21
  28. package/core/hooks/index.js +385 -0
  29. package/core/hooks/index.mjs +381 -0
  30. package/core.d.ts +1 -1
  31. package/core.js +13 -12
  32. package/core.mjs +5 -4
  33. package/dataMap/metaManager/metaSchema.js +68 -2
  34. package/dataMap/metaManager/metaSchema.mjs +68 -2
  35. package/dataMap/metaManager/mods/dynamicCellMeta.js +2 -3
  36. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +1 -1
  37. package/dist/handsontable.css +2 -2
  38. package/dist/handsontable.full.css +2 -2
  39. package/dist/handsontable.full.js +3009 -2582
  40. package/dist/handsontable.full.min.css +2 -2
  41. package/dist/handsontable.full.min.js +60 -60
  42. package/dist/handsontable.js +3011 -2584
  43. package/dist/handsontable.min.css +2 -2
  44. package/dist/handsontable.min.js +18 -18
  45. package/editorManager.js +2 -2
  46. package/editorManager.mjs +2 -2
  47. package/editors/baseEditor/baseEditor.js +23 -16
  48. package/editors/baseEditor/baseEditor.mjs +23 -16
  49. package/editors/dropdownEditor/dropdownEditor.js +2 -3
  50. package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
  51. package/editors/registry.js +2 -2
  52. package/editors/registry.mjs +1 -1
  53. package/helpers/mixed.js +1 -1
  54. package/helpers/mixed.mjs +1 -1
  55. package/index.d.ts +2 -1
  56. package/package.json +1 -1
  57. package/plugins/autoColumnSize/autoColumnSize.js +18 -27
  58. package/plugins/autoColumnSize/autoColumnSize.mjs +18 -27
  59. package/plugins/autoRowSize/autoRowSize.js +16 -22
  60. package/plugins/autoRowSize/autoRowSize.mjs +17 -23
  61. package/plugins/autofill/autofill.js +4 -5
  62. package/plugins/autofill/autofill.mjs +1 -1
  63. package/plugins/base/base.d.ts +1 -1
  64. package/plugins/base/base.js +39 -0
  65. package/plugins/base/base.mjs +40 -1
  66. package/plugins/base/index.js +2 -1
  67. package/plugins/base/index.mjs +1 -1
  68. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +2 -5
  69. package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +2 -5
  70. package/plugins/columnSorting/columnSorting.js +3 -4
  71. package/plugins/columnSorting/columnSorting.mjs +1 -1
  72. package/plugins/comments/comments.js +7 -15
  73. package/plugins/comments/comments.mjs +8 -16
  74. package/plugins/contextMenu/contextMenu.js +6 -7
  75. package/plugins/contextMenu/contextMenu.mjs +1 -1
  76. package/plugins/copyPaste/copyPaste.js +29 -23
  77. package/plugins/copyPaste/copyPaste.mjs +21 -15
  78. package/plugins/dropdownMenu/dropdownMenu.js +6 -7
  79. package/plugins/dropdownMenu/dropdownMenu.mjs +1 -1
  80. package/plugins/formulas/formulas.js +7 -7
  81. package/plugins/formulas/formulas.mjs +1 -1
  82. package/plugins/hiddenColumns/hiddenColumns.js +19 -30
  83. package/plugins/hiddenColumns/hiddenColumns.mjs +15 -26
  84. package/plugins/hiddenRows/hiddenRows.js +18 -29
  85. package/plugins/hiddenRows/hiddenRows.mjs +14 -25
  86. package/plugins/manualColumnFreeze/manualColumnFreeze.js +5 -5
  87. package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +1 -1
  88. package/plugins/manualColumnMove/manualColumnMove.js +3 -3
  89. package/plugins/manualColumnMove/manualColumnMove.mjs +1 -1
  90. package/plugins/manualRowMove/manualRowMove.js +5 -5
  91. package/plugins/manualRowMove/manualRowMove.mjs +3 -3
  92. package/plugins/mergeCells/cellsCollection.js +15 -3
  93. package/plugins/mergeCells/cellsCollection.mjs +16 -4
  94. package/plugins/mergeCells/mergeCells.d.ts +6 -2
  95. package/plugins/mergeCells/mergeCells.js +78 -55
  96. package/plugins/mergeCells/mergeCells.mjs +76 -53
  97. package/plugins/mergeCells/renderer.js +13 -3
  98. package/plugins/mergeCells/renderer.mjs +13 -3
  99. package/plugins/persistentState/persistentState.js +4 -4
  100. package/plugins/persistentState/persistentState.mjs +1 -1
  101. package/plugins/undoRedo/undoRedo.js +4 -5
  102. package/plugins/undoRedo/undoRedo.mjs +3 -3
  103. package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
  104. package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
  105. package/settings.d.ts +3 -1
  106. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +1 -1
  107. package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +1 -1
  108. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +1 -1
  109. package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +1 -1
  110. package/shortcutContexts/commands/scrollToFocusedCell.js +4 -4
  111. package/shortcutContexts/commands/scrollToFocusedCell.mjs +4 -4
  112. package/tableView.js +40 -9
  113. package/tableView.mjs +40 -9
@@ -21,6 +21,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
21
21
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
22
22
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
23
23
  const DEPS_TYPE_CHECKERS = new Map([['plugin', _registry.hasPlugin], ['cell-type', _registry2.hasCellType], ['editor', _registry3.hasEditor], ['renderer', _registry4.hasRenderer], ['validator', _registry5.hasValidator]]);
24
+ const defaultMainSettingSymbol = exports.defaultMainSettingSymbol = Symbol('mainSetting');
24
25
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'base';
25
26
  const missingDepsMsgs = [];
26
27
  let initializedPlugins = null;
@@ -49,6 +50,15 @@ class BasePlugin {
49
50
  return [this.PLUGIN_KEY];
50
51
  }
51
52
 
53
+ /**
54
+ * The `DEFAULT_SETTINGS` getter defines the plugin default settings.
55
+ *
56
+ * @returns {object}
57
+ */
58
+ static get DEFAULT_SETTINGS() {
59
+ return {};
60
+ }
61
+
52
62
  /**
53
63
  * The instance of the {@link EventManager} class.
54
64
  *
@@ -149,6 +159,7 @@ class BasePlugin {
149
159
  if (isAllPluginsAreInitialized) {
150
160
  if (missingDepsMsgs.length > 0) {
151
161
  const errorMsg = [`${missingDepsMsgs.join('\n')}\n`, 'You have to import and register them manually.'].join('');
162
+ missingDepsMsgs.length = 0;
152
163
  throw new Error(errorMsg);
153
164
  }
154
165
  this.hot.runHooks('afterPluginsInitialized');
@@ -173,6 +184,34 @@ class BasePlugin {
173
184
  this.enabled = false;
174
185
  }
175
186
 
187
+ /**
188
+ * Gets the plugin settings. If there is no setting under the provided key, it returns the default setting
189
+ * provided by the DEFAULT_SETTINGS static property of the class.
190
+ *
191
+ * @param {string} [settingName] The setting name. If the setting name is not provided, it returns
192
+ * the whole plugin's settings object.
193
+ * @returns {*}
194
+ */
195
+ getSetting(settingName) {
196
+ const pluginSettings = this.hot.getSettings()[this.constructor.PLUGIN_KEY];
197
+ if (settingName === undefined) {
198
+ return pluginSettings;
199
+ }
200
+ const defaultSettings = this.constructor.DEFAULT_SETTINGS;
201
+ if ((Array.isArray(pluginSettings) || (0, _object.isObject)(pluginSettings)) && defaultSettings[defaultMainSettingSymbol] === settingName) {
202
+ var _pluginSettings$setti;
203
+ if (Array.isArray(pluginSettings)) {
204
+ return pluginSettings;
205
+ }
206
+ return (_pluginSettings$setti = pluginSettings[settingName]) !== null && _pluginSettings$setti !== void 0 ? _pluginSettings$setti : defaultSettings[settingName];
207
+ }
208
+ if ((0, _object.isObject)(pluginSettings)) {
209
+ var _pluginSettings$setti2;
210
+ return (_pluginSettings$setti2 = pluginSettings[settingName]) !== null && _pluginSettings$setti2 !== void 0 ? _pluginSettings$setti2 : defaultSettings[settingName];
211
+ }
212
+ return defaultSettings[settingName];
213
+ }
214
+
176
215
  /**
177
216
  * Add listener to plugin hooks system.
178
217
  *
@@ -8,7 +8,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
8
8
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
9
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
10
10
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
11
- import { defineGetter, objectEach } from "../../helpers/object.mjs";
11
+ import { defineGetter, objectEach, isObject } from "../../helpers/object.mjs";
12
12
  import { arrayEach } from "../../helpers/array.mjs";
13
13
  import { getPluginsNames, hasPlugin } from "../registry.mjs";
14
14
  import { hasCellType } from "../../cellTypes/registry.mjs";
@@ -17,6 +17,7 @@ import { hasRenderer } from "../../renderers/registry.mjs";
17
17
  import { hasValidator } from "../../validators/registry.mjs";
18
18
  import EventManager from "../../eventManager.mjs";
19
19
  const DEPS_TYPE_CHECKERS = new Map([['plugin', hasPlugin], ['cell-type', hasCellType], ['editor', hasEditor], ['renderer', hasRenderer], ['validator', hasValidator]]);
20
+ export const defaultMainSettingSymbol = Symbol('mainSetting');
20
21
  export const PLUGIN_KEY = 'base';
21
22
  const missingDepsMsgs = [];
22
23
  let initializedPlugins = null;
@@ -45,6 +46,15 @@ export class BasePlugin {
45
46
  return [this.PLUGIN_KEY];
46
47
  }
47
48
 
49
+ /**
50
+ * The `DEFAULT_SETTINGS` getter defines the plugin default settings.
51
+ *
52
+ * @returns {object}
53
+ */
54
+ static get DEFAULT_SETTINGS() {
55
+ return {};
56
+ }
57
+
48
58
  /**
49
59
  * The instance of the {@link EventManager} class.
50
60
  *
@@ -145,6 +155,7 @@ export class BasePlugin {
145
155
  if (isAllPluginsAreInitialized) {
146
156
  if (missingDepsMsgs.length > 0) {
147
157
  const errorMsg = [`${missingDepsMsgs.join('\n')}\n`, 'You have to import and register them manually.'].join('');
158
+ missingDepsMsgs.length = 0;
148
159
  throw new Error(errorMsg);
149
160
  }
150
161
  this.hot.runHooks('afterPluginsInitialized');
@@ -169,6 +180,34 @@ export class BasePlugin {
169
180
  this.enabled = false;
170
181
  }
171
182
 
183
+ /**
184
+ * Gets the plugin settings. If there is no setting under the provided key, it returns the default setting
185
+ * provided by the DEFAULT_SETTINGS static property of the class.
186
+ *
187
+ * @param {string} [settingName] The setting name. If the setting name is not provided, it returns
188
+ * the whole plugin's settings object.
189
+ * @returns {*}
190
+ */
191
+ getSetting(settingName) {
192
+ const pluginSettings = this.hot.getSettings()[this.constructor.PLUGIN_KEY];
193
+ if (settingName === undefined) {
194
+ return pluginSettings;
195
+ }
196
+ const defaultSettings = this.constructor.DEFAULT_SETTINGS;
197
+ if ((Array.isArray(pluginSettings) || isObject(pluginSettings)) && defaultSettings[defaultMainSettingSymbol] === settingName) {
198
+ var _pluginSettings$setti;
199
+ if (Array.isArray(pluginSettings)) {
200
+ return pluginSettings;
201
+ }
202
+ return (_pluginSettings$setti = pluginSettings[settingName]) !== null && _pluginSettings$setti !== void 0 ? _pluginSettings$setti : defaultSettings[settingName];
203
+ }
204
+ if (isObject(pluginSettings)) {
205
+ var _pluginSettings$setti2;
206
+ return (_pluginSettings$setti2 = pluginSettings[settingName]) !== null && _pluginSettings$setti2 !== void 0 ? _pluginSettings$setti2 : defaultSettings[settingName];
207
+ }
208
+ return defaultSettings[settingName];
209
+ }
210
+
172
211
  /**
173
212
  * Add listener to plugin hooks system.
174
213
  *
@@ -3,4 +3,5 @@
3
3
  exports.__esModule = true;
4
4
  var _base = require("./base");
5
5
  exports.PLUGIN_KEY = _base.PLUGIN_KEY;
6
- exports.BasePlugin = _base.BasePlugin;
6
+ exports.BasePlugin = _base.BasePlugin;
7
+ exports.defaultMainSettingSymbol = _base.defaultMainSettingSymbol;
@@ -1 +1 @@
1
- export { PLUGIN_KEY, BasePlugin } from "./base.mjs";
1
+ export { PLUGIN_KEY, BasePlugin, defaultMainSettingSymbol } from "./base.mjs";
@@ -88,14 +88,11 @@ class BindRowsWithHeaders extends _base.BasePlugin {
88
88
  * Enables the plugin functionality for this Handsontable instance.
89
89
  */
90
90
  enablePlugin() {
91
+ var _bindTypeToMapStrateg;
91
92
  if (this.enabled) {
92
93
  return;
93
94
  }
94
- let bindType = this.hot.getSettings()[PLUGIN_KEY];
95
- if (typeof bindType !== 'string') {
96
- bindType = DEFAULT_BIND;
97
- }
98
- const MapStrategy = bindTypeToMapStrategy.get(bindType);
95
+ const MapStrategy = (_bindTypeToMapStrateg = bindTypeToMapStrategy.get(this.getSetting())) !== null && _bindTypeToMapStrateg !== void 0 ? _bindTypeToMapStrateg : bindTypeToMapStrategy.get(DEFAULT_BIND);
99
96
  this.headerIndexes = this.hot.rowIndexMapper.registerMap('bindRowsWithHeaders', new MapStrategy());
100
97
  this.addHook('modifyRowHeader', row => _assertClassBrand(_BindRowsWithHeaders_brand, this, _onModifyRowHeader).call(this, row));
101
98
  super.enablePlugin();
@@ -84,14 +84,11 @@ export class BindRowsWithHeaders extends BasePlugin {
84
84
  * Enables the plugin functionality for this Handsontable instance.
85
85
  */
86
86
  enablePlugin() {
87
+ var _bindTypeToMapStrateg;
87
88
  if (this.enabled) {
88
89
  return;
89
90
  }
90
- let bindType = this.hot.getSettings()[PLUGIN_KEY];
91
- if (typeof bindType !== 'string') {
92
- bindType = DEFAULT_BIND;
93
- }
94
- const MapStrategy = bindTypeToMapStrategy.get(bindType);
91
+ const MapStrategy = (_bindTypeToMapStrateg = bindTypeToMapStrategy.get(this.getSetting())) !== null && _bindTypeToMapStrateg !== void 0 ? _bindTypeToMapStrateg : bindTypeToMapStrategy.get(DEFAULT_BIND);
95
92
  this.headerIndexes = this.hot.rowIndexMapper.registerMap('bindRowsWithHeaders', new MapStrategy());
96
93
  this.addHook('modifyRowHeader', row => _assertClassBrand(_BindRowsWithHeaders_brand, this, _onModifyRowHeader).call(this, row));
97
94
  super.enablePlugin();
@@ -10,7 +10,7 @@ var _function = require("../../helpers/function");
10
10
  var _array = require("../../helpers/array");
11
11
  var _base = require("../base");
12
12
  var _translations = require("../../translations");
13
- var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
13
+ var _hooks = require("../../core/hooks");
14
14
  var _columnStatesManager = require("./columnStatesManager");
15
15
  var _shortcutContexts = require("../../shortcutContexts");
16
16
  var _utils = require("./utils");
@@ -18,7 +18,6 @@ var _domHelpers = require("./domHelpers");
18
18
  var _rootComparator = require("./rootComparator");
19
19
  var _sortService = require("./sortService");
20
20
  var _a11y = require("../../helpers/a11y");
21
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
22
21
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
23
22
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
24
23
  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; }
@@ -31,8 +30,8 @@ const APPEND_COLUMN_CONFIG_STRATEGY = exports.APPEND_COLUMN_CONFIG_STRATEGY = 'a
31
30
  const REPLACE_COLUMN_CONFIG_STRATEGY = exports.REPLACE_COLUMN_CONFIG_STRATEGY = 'replace';
32
31
  const SHORTCUTS_GROUP = PLUGIN_KEY;
33
32
  (0, _sortService.registerRootComparator)(PLUGIN_KEY, _rootComparator.rootComparator);
34
- _pluginHooks.default.getSingleton().register('beforeColumnSort');
35
- _pluginHooks.default.getSingleton().register('afterColumnSort');
33
+ _hooks.Hooks.getSingleton().register('beforeColumnSort');
34
+ _hooks.Hooks.getSingleton().register('afterColumnSort');
36
35
 
37
36
  // DIFF - MultiColumnSorting & ColumnSorting: changed configuration documentation.
38
37
  /**
@@ -13,7 +13,7 @@ import { isFunction } from "../../helpers/function.mjs";
13
13
  import { arrayMap } from "../../helpers/array.mjs";
14
14
  import { BasePlugin } from "../base/index.mjs";
15
15
  import { IndexesSequence, PhysicalIndexToValueMap as IndexToValueMap } from "../../translations/index.mjs";
16
- import Hooks from "../../pluginHooks.mjs";
16
+ import { Hooks } from "../../core/hooks/index.mjs";
17
17
  import { ColumnStatesManager } from "./columnStatesManager.mjs";
18
18
  import { EDITOR_EDIT_GROUP as SHORTCUTS_GROUP_EDITOR } from "../../shortcutContexts/index.mjs";
19
19
  import { HEADER_SPAN_CLASS, getNextSortOrder, areValidSortStates, getHeaderSpanElement, isFirstLevelColumnHeader, wasHeaderClickedProperly } from "./utils.mjs";
@@ -194,6 +194,11 @@ class Comments extends _base.BasePlugin {
194
194
  static get PLUGIN_PRIORITY() {
195
195
  return PLUGIN_PRIORITY;
196
196
  }
197
+ static get DEFAULT_SETTINGS() {
198
+ return {
199
+ displayDelay: 250
200
+ };
201
+ }
197
202
  /**
198
203
  * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
199
204
  * hook and if it returns `true` then the {@link Comments#enablePlugin} method is called.
@@ -222,7 +227,7 @@ class Comments extends _base.BasePlugin {
222
227
  });
223
228
  }
224
229
  if (!_classPrivateFieldGet(_displaySwitch, this)) {
225
- _classPrivateFieldSet(_displaySwitch, this, new _displaySwitch2.default(this.getDisplayDelaySetting()));
230
+ _classPrivateFieldSet(_displaySwitch, this, new _displaySwitch2.default(this.getSetting('displayDelay')));
226
231
  }
227
232
  this.addHook('afterContextMenuDefaultOptions', options => this.addToContextMenu(options));
228
233
  this.addHook('afterRenderer', (TD, row, col, prop, value, cellProperties) => _assertClassBrand(_Comments_brand, this, _onAfterRenderer).call(this, TD, cellProperties));
@@ -243,7 +248,7 @@ class Comments extends _base.BasePlugin {
243
248
  * - [`comments`](@/api/options.md#comments)
244
249
  */
245
250
  updatePlugin() {
246
- _classPrivateFieldGet(_displaySwitch, this).updateDelay(this.getDisplayDelaySetting());
251
+ _classPrivateFieldGet(_displaySwitch, this).updateDelay(this.getSetting('displayDelay'));
247
252
  super.updatePlugin();
248
253
  }
249
254
 
@@ -660,19 +665,6 @@ class Comments extends _base.BasePlugin {
660
665
  }, (0, _addEditComment.default)(this), (0, _removeComment.default)(this), (0, _readOnlyComment.default)(this));
661
666
  }
662
667
 
663
- /**
664
- * Get `displayDelay` setting of comment plugin.
665
- *
666
- * @private
667
- * @returns {number|undefined}
668
- */
669
- getDisplayDelaySetting() {
670
- const commentSetting = this.hot.getSettings()[PLUGIN_KEY];
671
- if ((0, _object.isObject)(commentSetting)) {
672
- return commentSetting.displayDelay;
673
- }
674
- }
675
-
676
668
  /**
677
669
  * Gets the editors input element.
678
670
  *
@@ -11,7 +11,7 @@ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
11
11
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
12
12
  import { addClass, closest, isChildOf, hasClass, outerHeight } from "../../helpers/dom/element.mjs";
13
13
  import { stopImmediatePropagation } from "../../helpers/dom/event.mjs";
14
- import { deepClone, deepExtend, isObject } from "../../helpers/object.mjs";
14
+ import { deepClone, deepExtend } from "../../helpers/object.mjs";
15
15
  import { BasePlugin } from "../base/index.mjs";
16
16
  import CommentEditor from "./commentEditor.mjs";
17
17
  import DisplaySwitch from "./displaySwitch.mjs";
@@ -190,6 +190,11 @@ export class Comments extends BasePlugin {
190
190
  static get PLUGIN_PRIORITY() {
191
191
  return PLUGIN_PRIORITY;
192
192
  }
193
+ static get DEFAULT_SETTINGS() {
194
+ return {
195
+ displayDelay: 250
196
+ };
197
+ }
193
198
  /**
194
199
  * Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
195
200
  * hook and if it returns `true` then the {@link Comments#enablePlugin} method is called.
@@ -218,7 +223,7 @@ export class Comments extends BasePlugin {
218
223
  });
219
224
  }
220
225
  if (!_classPrivateFieldGet(_displaySwitch, this)) {
221
- _classPrivateFieldSet(_displaySwitch, this, new DisplaySwitch(this.getDisplayDelaySetting()));
226
+ _classPrivateFieldSet(_displaySwitch, this, new DisplaySwitch(this.getSetting('displayDelay')));
222
227
  }
223
228
  this.addHook('afterContextMenuDefaultOptions', options => this.addToContextMenu(options));
224
229
  this.addHook('afterRenderer', (TD, row, col, prop, value, cellProperties) => _assertClassBrand(_Comments_brand, this, _onAfterRenderer).call(this, TD, cellProperties));
@@ -239,7 +244,7 @@ export class Comments extends BasePlugin {
239
244
  * - [`comments`](@/api/options.md#comments)
240
245
  */
241
246
  updatePlugin() {
242
- _classPrivateFieldGet(_displaySwitch, this).updateDelay(this.getDisplayDelaySetting());
247
+ _classPrivateFieldGet(_displaySwitch, this).updateDelay(this.getSetting('displayDelay'));
243
248
  super.updatePlugin();
244
249
  }
245
250
 
@@ -656,19 +661,6 @@ export class Comments extends BasePlugin {
656
661
  }, addEditCommentItem(this), removeCommentItem(this), readOnlyCommentItem(this));
657
662
  }
658
663
 
659
- /**
660
- * Get `displayDelay` setting of comment plugin.
661
- *
662
- * @private
663
- * @returns {number|undefined}
664
- */
665
- getDisplayDelaySetting() {
666
- const commentSetting = this.hot.getSettings()[PLUGIN_KEY];
667
- if (isObject(commentSetting)) {
668
- return commentSetting.displayDelay;
669
- }
670
- }
671
-
672
664
  /**
673
665
  * Gets the editors input element.
674
666
  *
@@ -3,7 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  var _base = require("../base");
6
- var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
6
+ var _hooks = require("../../core/hooks");
7
7
  var _array = require("../../helpers/array");
8
8
  var _object = require("../../helpers/object");
9
9
  var _commandExecutor = require("./commandExecutor");
@@ -12,7 +12,6 @@ var _menu = require("./menu");
12
12
  var _utils = require("./utils");
13
13
  var _element = require("../../helpers/dom/element");
14
14
  var _predefinedItems = require("./predefinedItems");
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
15
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
17
16
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
18
17
  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; }
@@ -22,11 +21,11 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
22
21
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'contextMenu';
23
22
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 70;
24
23
  const SHORTCUTS_GROUP = PLUGIN_KEY;
25
- _pluginHooks.default.getSingleton().register('afterContextMenuDefaultOptions');
26
- _pluginHooks.default.getSingleton().register('beforeContextMenuShow');
27
- _pluginHooks.default.getSingleton().register('afterContextMenuShow');
28
- _pluginHooks.default.getSingleton().register('afterContextMenuHide');
29
- _pluginHooks.default.getSingleton().register('afterContextMenuExecute');
24
+ _hooks.Hooks.getSingleton().register('afterContextMenuDefaultOptions');
25
+ _hooks.Hooks.getSingleton().register('beforeContextMenuShow');
26
+ _hooks.Hooks.getSingleton().register('afterContextMenuShow');
27
+ _hooks.Hooks.getSingleton().register('afterContextMenuHide');
28
+ _hooks.Hooks.getSingleton().register('afterContextMenuExecute');
30
29
 
31
30
  /* eslint-disable jsdoc/require-description-complete-sentence */
32
31
  /**
@@ -6,7 +6,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
6
6
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
8
8
  import { BasePlugin } from "../base/index.mjs";
9
- import Hooks from "../../pluginHooks.mjs";
9
+ import { Hooks } from "../../core/hooks/index.mjs";
10
10
  import { arrayEach } from "../../helpers/array.mjs";
11
11
  import { objectEach } from "../../helpers/object.mjs";
12
12
  import { CommandExecutor } from "./commandExecutor.mjs";
@@ -4,7 +4,7 @@ exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
5
  require("core-js/modules/es.array.push.js");
6
6
  var _base = require("../base");
7
- var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
7
+ var _hooks = require("../../core/hooks");
8
8
  var _SheetClip = require("../../3rdparty/SheetClip");
9
9
  var _array = require("../../helpers/array");
10
10
  var _string = require("../../helpers/string");
@@ -28,14 +28,14 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
28
28
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
29
29
  function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
30
30
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
31
- _pluginHooks.default.getSingleton().register('afterCopyLimit');
32
- _pluginHooks.default.getSingleton().register('modifyCopyableRange');
33
- _pluginHooks.default.getSingleton().register('beforeCut');
34
- _pluginHooks.default.getSingleton().register('afterCut');
35
- _pluginHooks.default.getSingleton().register('beforePaste');
36
- _pluginHooks.default.getSingleton().register('afterPaste');
37
- _pluginHooks.default.getSingleton().register('beforeCopy');
38
- _pluginHooks.default.getSingleton().register('afterCopy');
31
+ _hooks.Hooks.getSingleton().register('afterCopyLimit');
32
+ _hooks.Hooks.getSingleton().register('modifyCopyableRange');
33
+ _hooks.Hooks.getSingleton().register('beforeCut');
34
+ _hooks.Hooks.getSingleton().register('afterCut');
35
+ _hooks.Hooks.getSingleton().register('beforePaste');
36
+ _hooks.Hooks.getSingleton().register('afterPaste');
37
+ _hooks.Hooks.getSingleton().register('beforeCopy');
38
+ _hooks.Hooks.getSingleton().register('afterCopy');
39
39
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'copyPaste';
40
40
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 80;
41
41
  const SETTING_KEYS = ['fragmentSelection'];
@@ -206,6 +206,16 @@ class CopyPaste extends _base.BasePlugin {
206
206
  static get PLUGIN_PRIORITY() {
207
207
  return PLUGIN_PRIORITY;
208
208
  }
209
+ static get DEFAULT_SETTINGS() {
210
+ return {
211
+ pasteMode: 'overwrite',
212
+ rowsLimit: Infinity,
213
+ columnsLimit: Infinity,
214
+ copyColumnHeaders: false,
215
+ copyColumnGroupHeaders: false,
216
+ copyColumnHeadersOnly: false
217
+ };
218
+ }
209
219
  /**
210
220
  * Checks if the [`CopyPaste`](#copypaste) plugin is enabled.
211
221
  *
@@ -222,23 +232,19 @@ class CopyPaste extends _base.BasePlugin {
222
232
  * Enables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
223
233
  */
224
234
  enablePlugin() {
225
- var _this = this;
235
+ var _this$getSetting,
236
+ _this$getSetting2,
237
+ _this = this;
226
238
  if (this.enabled) {
227
239
  return;
228
240
  }
229
- const {
230
- [PLUGIN_KEY]: settings
231
- } = this.hot.getSettings();
232
- if (typeof settings === 'object') {
233
- var _settings$pasteMode, _settings$uiContainer;
234
- this.pasteMode = (_settings$pasteMode = settings.pasteMode) !== null && _settings$pasteMode !== void 0 ? _settings$pasteMode : this.pasteMode;
235
- this.rowsLimit = isNaN(settings.rowsLimit) ? this.rowsLimit : settings.rowsLimit;
236
- this.columnsLimit = isNaN(settings.columnsLimit) ? this.columnsLimit : settings.columnsLimit;
237
- _classPrivateFieldSet(_enableCopyColumnHeaders, this, !!settings.copyColumnHeaders);
238
- _classPrivateFieldSet(_enableCopyColumnGroupHeaders, this, !!settings.copyColumnGroupHeaders);
239
- _classPrivateFieldSet(_enableCopyColumnHeadersOnly, this, !!settings.copyColumnHeadersOnly);
240
- this.uiContainer = (_settings$uiContainer = settings.uiContainer) !== null && _settings$uiContainer !== void 0 ? _settings$uiContainer : this.uiContainer;
241
- }
241
+ this.pasteMode = (_this$getSetting = this.getSetting('pasteMode')) !== null && _this$getSetting !== void 0 ? _this$getSetting : this.pasteMode;
242
+ this.rowsLimit = isNaN(this.getSetting('rowsLimit')) ? this.rowsLimit : this.getSetting('rowsLimit');
243
+ this.columnsLimit = isNaN(this.getSetting('columnsLimit')) ? this.columnsLimit : this.getSetting('columnsLimit');
244
+ _classPrivateFieldSet(_enableCopyColumnHeaders, this, this.getSetting('copyColumnHeaders'));
245
+ _classPrivateFieldSet(_enableCopyColumnGroupHeaders, this, this.getSetting('copyColumnGroupHeaders'));
246
+ _classPrivateFieldSet(_enableCopyColumnHeadersOnly, this, this.getSetting('copyColumnHeadersOnly'));
247
+ this.uiContainer = (_this$getSetting2 = this.getSetting('uiContainer')) !== null && _this$getSetting2 !== void 0 ? _this$getSetting2 : this.uiContainer;
242
248
  this.addHook('afterContextMenuDefaultOptions', options => _assertClassBrand(_CopyPaste_brand, this, _onAfterContextMenuDefaultOptions).call(this, options));
243
249
  this.addHook('afterSelection', function () {
244
250
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -10,7 +10,7 @@ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
10
10
  function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
11
11
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
12
12
  import { BasePlugin } from "../base/index.mjs";
13
- import Hooks from "../../pluginHooks.mjs";
13
+ import { Hooks } from "../../core/hooks/index.mjs";
14
14
  import { stringify, parse } from "../../3rdparty/SheetClip/index.mjs";
15
15
  import { arrayEach } from "../../helpers/array.mjs";
16
16
  import { sanitize } from "../../helpers/string.mjs";
@@ -202,6 +202,16 @@ export class CopyPaste extends BasePlugin {
202
202
  static get PLUGIN_PRIORITY() {
203
203
  return PLUGIN_PRIORITY;
204
204
  }
205
+ static get DEFAULT_SETTINGS() {
206
+ return {
207
+ pasteMode: 'overwrite',
208
+ rowsLimit: Infinity,
209
+ columnsLimit: Infinity,
210
+ copyColumnHeaders: false,
211
+ copyColumnGroupHeaders: false,
212
+ copyColumnHeadersOnly: false
213
+ };
214
+ }
205
215
  /**
206
216
  * Checks if the [`CopyPaste`](#copypaste) plugin is enabled.
207
217
  *
@@ -218,23 +228,19 @@ export class CopyPaste extends BasePlugin {
218
228
  * Enables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
219
229
  */
220
230
  enablePlugin() {
221
- var _this = this;
231
+ var _this$getSetting,
232
+ _this$getSetting2,
233
+ _this = this;
222
234
  if (this.enabled) {
223
235
  return;
224
236
  }
225
- const {
226
- [PLUGIN_KEY]: settings
227
- } = this.hot.getSettings();
228
- if (typeof settings === 'object') {
229
- var _settings$pasteMode, _settings$uiContainer;
230
- this.pasteMode = (_settings$pasteMode = settings.pasteMode) !== null && _settings$pasteMode !== void 0 ? _settings$pasteMode : this.pasteMode;
231
- this.rowsLimit = isNaN(settings.rowsLimit) ? this.rowsLimit : settings.rowsLimit;
232
- this.columnsLimit = isNaN(settings.columnsLimit) ? this.columnsLimit : settings.columnsLimit;
233
- _classPrivateFieldSet(_enableCopyColumnHeaders, this, !!settings.copyColumnHeaders);
234
- _classPrivateFieldSet(_enableCopyColumnGroupHeaders, this, !!settings.copyColumnGroupHeaders);
235
- _classPrivateFieldSet(_enableCopyColumnHeadersOnly, this, !!settings.copyColumnHeadersOnly);
236
- this.uiContainer = (_settings$uiContainer = settings.uiContainer) !== null && _settings$uiContainer !== void 0 ? _settings$uiContainer : this.uiContainer;
237
- }
237
+ this.pasteMode = (_this$getSetting = this.getSetting('pasteMode')) !== null && _this$getSetting !== void 0 ? _this$getSetting : this.pasteMode;
238
+ this.rowsLimit = isNaN(this.getSetting('rowsLimit')) ? this.rowsLimit : this.getSetting('rowsLimit');
239
+ this.columnsLimit = isNaN(this.getSetting('columnsLimit')) ? this.columnsLimit : this.getSetting('columnsLimit');
240
+ _classPrivateFieldSet(_enableCopyColumnHeaders, this, this.getSetting('copyColumnHeaders'));
241
+ _classPrivateFieldSet(_enableCopyColumnGroupHeaders, this, this.getSetting('copyColumnGroupHeaders'));
242
+ _classPrivateFieldSet(_enableCopyColumnHeadersOnly, this, this.getSetting('copyColumnHeadersOnly'));
243
+ this.uiContainer = (_this$getSetting2 = this.getSetting('uiContainer')) !== null && _this$getSetting2 !== void 0 ? _this$getSetting2 : this.uiContainer;
238
244
  this.addHook('afterContextMenuDefaultOptions', options => _assertClassBrand(_CopyPaste_brand, this, _onAfterContextMenuDefaultOptions).call(this, options));
239
245
  this.addHook('afterSelection', function () {
240
246
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
@@ -10,10 +10,9 @@ var _utils = require("../contextMenu/utils");
10
10
  var _element = require("../../helpers/dom/element");
11
11
  var _itemsFactory = require("../contextMenu/itemsFactory");
12
12
  var _menu = require("../contextMenu/menu");
13
- var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
13
+ var _hooks = require("../../core/hooks");
14
14
  var _predefinedItems = require("../contextMenu/predefinedItems");
15
15
  var _a11y = require("../../helpers/a11y");
16
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
16
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
18
17
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
19
18
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
@@ -23,11 +22,11 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
23
22
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
24
23
  function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
25
24
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
26
- _pluginHooks.default.getSingleton().register('afterDropdownMenuDefaultOptions');
27
- _pluginHooks.default.getSingleton().register('beforeDropdownMenuShow');
28
- _pluginHooks.default.getSingleton().register('afterDropdownMenuShow');
29
- _pluginHooks.default.getSingleton().register('afterDropdownMenuHide');
30
- _pluginHooks.default.getSingleton().register('afterDropdownMenuExecute');
25
+ _hooks.Hooks.getSingleton().register('afterDropdownMenuDefaultOptions');
26
+ _hooks.Hooks.getSingleton().register('beforeDropdownMenuShow');
27
+ _hooks.Hooks.getSingleton().register('afterDropdownMenuShow');
28
+ _hooks.Hooks.getSingleton().register('afterDropdownMenuHide');
29
+ _hooks.Hooks.getSingleton().register('afterDropdownMenuExecute');
31
30
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'dropdownMenu';
32
31
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 230;
33
32
  const BUTTON_CLASS_NAME = 'changeType';
@@ -16,7 +16,7 @@ import { getDocumentOffsetByElement } from "../contextMenu/utils.mjs";
16
16
  import { hasClass, setAttribute } from "../../helpers/dom/element.mjs";
17
17
  import { ItemsFactory } from "../contextMenu/itemsFactory.mjs";
18
18
  import { Menu } from "../contextMenu/menu/index.mjs";
19
- import Hooks from "../../pluginHooks.mjs";
19
+ import { Hooks } from "../../core/hooks/index.mjs";
20
20
  import { COLUMN_LEFT, COLUMN_RIGHT, REMOVE_COLUMN, CLEAR_COLUMN, READ_ONLY, ALIGNMENT, SEPARATOR } from "../contextMenu/predefinedItems/index.mjs";
21
21
  import { A11Y_HASPOPUP, A11Y_HIDDEN, A11Y_LABEL } from "../../helpers/a11y.mjs";
22
22
  Hooks.getSingleton().register('afterDropdownMenuDefaultOptions');
@@ -21,7 +21,7 @@ var _utils = require("./utils");
21
21
  var _settings = require("./engine/settings");
22
22
  var _data = require("../../helpers/data");
23
23
  var _string = require("../../helpers/string");
24
- var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
24
+ var _hooks = require("../../core/hooks");
25
25
  var _indexSyncer = _interopRequireDefault(require("./indexSyncer"));
26
26
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
27
27
  function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
@@ -36,12 +36,12 @@ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.h
36
36
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'formulas';
37
37
  const SETTING_KEYS = exports.SETTING_KEYS = ['maxRows', 'maxColumns', 'language'];
38
38
  const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 260;
39
- _pluginHooks.default.getSingleton().register('afterNamedExpressionAdded');
40
- _pluginHooks.default.getSingleton().register('afterNamedExpressionRemoved');
41
- _pluginHooks.default.getSingleton().register('afterSheetAdded');
42
- _pluginHooks.default.getSingleton().register('afterSheetRemoved');
43
- _pluginHooks.default.getSingleton().register('afterSheetRenamed');
44
- _pluginHooks.default.getSingleton().register('afterFormulasValuesUpdate');
39
+ _hooks.Hooks.getSingleton().register('afterNamedExpressionAdded');
40
+ _hooks.Hooks.getSingleton().register('afterNamedExpressionRemoved');
41
+ _hooks.Hooks.getSingleton().register('afterSheetAdded');
42
+ _hooks.Hooks.getSingleton().register('afterSheetRemoved');
43
+ _hooks.Hooks.getSingleton().register('afterSheetRenamed');
44
+ _hooks.Hooks.getSingleton().register('afterFormulasValuesUpdate');
45
45
 
46
46
  // This function will be used for detecting changes coming from the `UndoRedo` plugin. This kind of change won't be
47
47
  // handled by whole body of listeners and therefore won't change undo/redo stack inside engine provided by HyperFormula.
@@ -27,7 +27,7 @@ import { isEscapedFormulaExpression, unescapeFormulaExpression, isDate, isDateVa
27
27
  import { getEngineSettingsWithOverrides, haveEngineSettingsChanged } from "./engine/settings.mjs";
28
28
  import { isArrayOfArrays } from "../../helpers/data.mjs";
29
29
  import { toUpperCaseFirst } from "../../helpers/string.mjs";
30
- import Hooks from "../../pluginHooks.mjs";
30
+ import { Hooks } from "../../core/hooks/index.mjs";
31
31
  import IndexSyncer from "./indexSyncer/index.mjs";
32
32
  export const PLUGIN_KEY = 'formulas';
33
33
  export const SETTING_KEYS = ['maxRows', 'maxColumns', 'language'];