handsontable 12.3.3-next-e19badf-20230328 → 12.4.0-next-ddbea0c-20230512

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. package/3rdparty/walkontable/src/cell/coords.js +13 -16
  2. package/3rdparty/walkontable/src/cell/coords.mjs +13 -16
  3. package/3rdparty/walkontable/src/cell/range.js +25 -29
  4. package/3rdparty/walkontable/src/cell/range.mjs +24 -28
  5. package/3rdparty/walkontable/src/event.js +4 -0
  6. package/3rdparty/walkontable/src/event.mjs +4 -0
  7. package/3rdparty/walkontable/src/overlay/_base.js +6 -7
  8. package/3rdparty/walkontable/src/overlay/_base.mjs +6 -7
  9. package/3rdparty/walkontable/src/overlay/bottom.js +6 -7
  10. package/3rdparty/walkontable/src/overlay/bottom.mjs +6 -7
  11. package/3rdparty/walkontable/src/overlay/top.js +6 -7
  12. package/3rdparty/walkontable/src/overlay/top.mjs +6 -7
  13. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +10 -12
  14. package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +10 -12
  15. package/3rdparty/walkontable/src/overlays.js +55 -64
  16. package/3rdparty/walkontable/src/overlays.mjs +55 -64
  17. package/3rdparty/walkontable/src/scroll.js +20 -23
  18. package/3rdparty/walkontable/src/scroll.mjs +20 -23
  19. package/3rdparty/walkontable/src/settings.js +13 -15
  20. package/3rdparty/walkontable/src/settings.mjs +13 -15
  21. package/3rdparty/walkontable/src/table.js +22 -26
  22. package/3rdparty/walkontable/src/table.mjs +22 -26
  23. package/CHANGELOG.md +14 -0
  24. package/base.js +2 -4
  25. package/base.mjs +2 -2
  26. package/core.js +23 -6
  27. package/core.mjs +23 -6
  28. package/dataMap/dataSource.js +5 -5
  29. package/dataMap/dataSource.mjs +5 -5
  30. package/dataMap/metaManager/metaSchema.js +9 -7
  31. package/dataMap/metaManager/metaSchema.mjs +9 -7
  32. package/dist/handsontable.css +2 -2
  33. package/dist/handsontable.full.css +2 -2
  34. package/dist/handsontable.full.js +5047 -4193
  35. package/dist/handsontable.full.min.css +2 -2
  36. package/dist/handsontable.full.min.js +86 -78
  37. package/dist/handsontable.js +4023 -3170
  38. package/dist/handsontable.min.css +2 -2
  39. package/dist/handsontable.min.js +11 -3
  40. package/dist/languages/all.js +133 -0
  41. package/dist/languages/ar-AR.js +7 -0
  42. package/dist/languages/cs-CZ.js +7 -0
  43. package/dist/languages/de-CH.js +7 -0
  44. package/dist/languages/de-DE.js +7 -0
  45. package/dist/languages/en-US.js +7 -0
  46. package/dist/languages/es-MX.js +7 -0
  47. package/dist/languages/fr-FR.js +7 -0
  48. package/dist/languages/it-IT.js +7 -0
  49. package/dist/languages/ja-JP.js +7 -0
  50. package/dist/languages/ko-KR.js +7 -0
  51. package/dist/languages/lv-LV.js +7 -0
  52. package/dist/languages/nb-NO.js +7 -0
  53. package/dist/languages/nl-NL.js +7 -0
  54. package/dist/languages/pl-PL.js +7 -0
  55. package/dist/languages/pt-BR.js +7 -0
  56. package/dist/languages/ru-RU.js +7 -0
  57. package/dist/languages/sr-SP.js +7 -0
  58. package/dist/languages/zh-CN.js +7 -0
  59. package/dist/languages/zh-TW.js +7 -0
  60. package/helpers/mixed.js +2 -2
  61. package/helpers/mixed.mjs +2 -2
  62. package/i18n/languages/ar-AR.js +7 -1
  63. package/i18n/languages/cs-CZ.js +7 -1
  64. package/i18n/languages/de-CH.js +7 -1
  65. package/i18n/languages/de-DE.js +7 -1
  66. package/i18n/languages/en-US.js +7 -1
  67. package/i18n/languages/es-MX.js +7 -1
  68. package/i18n/languages/fr-FR.js +7 -1
  69. package/i18n/languages/it-IT.js +7 -1
  70. package/i18n/languages/ja-JP.js +7 -1
  71. package/i18n/languages/ko-KR.js +7 -1
  72. package/i18n/languages/lv-LV.js +7 -1
  73. package/i18n/languages/nb-NO.js +7 -1
  74. package/i18n/languages/nl-NL.js +7 -1
  75. package/i18n/languages/pl-PL.js +7 -1
  76. package/i18n/languages/pt-BR.js +7 -1
  77. package/i18n/languages/ru-RU.js +7 -1
  78. package/i18n/languages/sr-SP.js +7 -1
  79. package/i18n/languages/zh-CN.js +7 -1
  80. package/i18n/languages/zh-TW.js +7 -1
  81. package/languages/all.js +133 -0
  82. package/languages/ar-AR.js +7 -0
  83. package/languages/cs-CZ.js +7 -0
  84. package/languages/de-CH.js +7 -0
  85. package/languages/de-DE.js +7 -0
  86. package/languages/en-US.js +7 -0
  87. package/languages/es-MX.js +7 -0
  88. package/languages/fr-FR.js +7 -0
  89. package/languages/index.js +133 -0
  90. package/languages/it-IT.js +7 -0
  91. package/languages/ja-JP.js +7 -0
  92. package/languages/ko-KR.js +7 -0
  93. package/languages/lv-LV.js +7 -0
  94. package/languages/nb-NO.js +7 -0
  95. package/languages/nl-NL.js +7 -0
  96. package/languages/pl-PL.js +7 -0
  97. package/languages/pt-BR.js +7 -0
  98. package/languages/ru-RU.js +7 -0
  99. package/languages/sr-SP.js +7 -0
  100. package/languages/zh-CN.js +7 -0
  101. package/languages/zh-TW.js +7 -0
  102. package/package.json +3 -2
  103. package/pluginHooks.js +16 -6
  104. package/pluginHooks.mjs +15 -3
  105. package/plugins/autoRowSize/autoRowSize.js +2 -2
  106. package/plugins/autoRowSize/autoRowSize.mjs +2 -2
  107. package/plugins/copyPaste/copyableRanges.js +25 -31
  108. package/plugins/copyPaste/copyableRanges.mjs +18 -24
  109. package/plugins/customBorders/customBorders.d.ts +2 -0
  110. package/plugins/filters/filters.js +5 -0
  111. package/plugins/filters/filters.mjs +5 -0
  112. package/plugins/formulas/engine/register.js +9 -0
  113. package/plugins/formulas/engine/register.mjs +13 -4
  114. package/plugins/formulas/engine/settings.js +18 -3
  115. package/plugins/formulas/engine/settings.mjs +16 -3
  116. package/plugins/formulas/formulas.js +274 -155
  117. package/plugins/formulas/formulas.mjs +274 -156
  118. package/plugins/formulas/indexSyncer/axisSyncer.js +379 -0
  119. package/plugins/formulas/indexSyncer/axisSyncer.mjs +374 -0
  120. package/plugins/formulas/indexSyncer/index.js +225 -0
  121. package/plugins/formulas/indexSyncer/index.mjs +219 -0
  122. package/plugins/formulas/utils.js +81 -0
  123. package/plugins/formulas/utils.mjs +74 -0
  124. package/plugins/manualRowMove/manualRowMove.js +26 -11
  125. package/plugins/manualRowMove/manualRowMove.mjs +27 -12
  126. package/plugins/nestedHeaders/stateManager/headersTree.js +23 -26
  127. package/plugins/nestedHeaders/stateManager/headersTree.mjs +20 -23
  128. package/plugins/nestedHeaders/stateManager/index.js +3 -3
  129. package/plugins/nestedHeaders/stateManager/matrixGenerator.js +1 -0
  130. package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
  131. package/plugins/nestedHeaders/utils/ghostTable.js +30 -35
  132. package/plugins/nestedHeaders/utils/ghostTable.mjs +30 -35
  133. package/plugins/registry.js +3 -1
  134. package/plugins/undoRedo/undoRedo.js +0 -1
  135. package/plugins/undoRedo/undoRedo.mjs +0 -1
  136. package/selection/highlight/visualSelection.js +5 -6
  137. package/selection/highlight/visualSelection.mjs +5 -6
  138. package/tableView.js +62 -72
  139. package/tableView.mjs +62 -72
  140. package/translations/changesObservable/observable.js +41 -46
  141. package/translations/changesObservable/observable.mjs +36 -41
  142. package/translations/changesObservable/observer.js +1 -1
  143. package/translations/indexMapper.js +21 -0
  144. package/translations/indexMapper.mjs +21 -0
  145. package/utils/dataStructures/tree.js +15 -18
  146. package/utils/dataStructures/tree.mjs +15 -18
  147. package/utils/parseTable.js +5 -1
  148. package/utils/parseTable.mjs +5 -1
@@ -33,6 +33,13 @@ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) {
33
33
  function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
34
34
  function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
35
35
  function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
36
+ /**
37
+ * The utils class produces the selection ranges in the `{startRow, startCol, endRow, endCol}` format
38
+ * based on the current table selection. The CopyPaste plugin consumes that ranges to generate
39
+ * appropriate data ready to copy to the clipboard.
40
+ *
41
+ * @private
42
+ */
36
43
  var _selectedRange = /*#__PURE__*/new WeakMap();
37
44
  var _countRows = /*#__PURE__*/new WeakMap();
38
45
  var _countColumns = /*#__PURE__*/new WeakMap();
@@ -41,38 +48,7 @@ var _columnsLimit = /*#__PURE__*/new WeakMap();
41
48
  var _countColumnHeaders = /*#__PURE__*/new WeakMap();
42
49
  var _trimColumnsRange = /*#__PURE__*/new WeakSet();
43
50
  var _trimRowsRange = /*#__PURE__*/new WeakSet();
44
- /**
45
- * The utils class produces the selection ranges in the `{startRow, startCol, endRow, endCol}` format
46
- * based on the current table selection. The CopyPaste plugin consumes that ranges to generate
47
- * appropriate data ready to copy to the clipboard.
48
- *
49
- * @private
50
- */
51
51
  var CopyableRangesFactory = /*#__PURE__*/function () {
52
- /**
53
- * @type {CellRange}
54
- */
55
-
56
- /**
57
- * @type {function(): number}
58
- */
59
-
60
- /**
61
- * @type {function(): number}
62
- */
63
-
64
- /**
65
- * @type {function(): number}
66
- */
67
-
68
- /**
69
- * @type {function(): number}
70
- */
71
-
72
- /**
73
- * @type {function(): number}
74
- */
75
-
76
52
  /* eslint-disable jsdoc/require-description-complete-sentence */
77
53
  /**
78
54
  * @param {{
@@ -106,26 +82,44 @@ var CopyableRangesFactory = /*#__PURE__*/function () {
106
82
  * @returns {number} Returns trimmed column index if it exceeds the limit.
107
83
  */
108
84
  _classPrivateMethodInitSpec(this, _trimColumnsRange);
85
+ /**
86
+ * @type {CellRange}
87
+ */
109
88
  _classPrivateFieldInitSpec(this, _selectedRange, {
110
89
  writable: true,
111
90
  value: void 0
112
91
  });
92
+ /**
93
+ * @type {function(): number}
94
+ */
113
95
  _classPrivateFieldInitSpec(this, _countRows, {
114
96
  writable: true,
115
97
  value: void 0
116
98
  });
99
+ /**
100
+ * @type {function(): number}
101
+ */
117
102
  _classPrivateFieldInitSpec(this, _countColumns, {
118
103
  writable: true,
119
104
  value: void 0
120
105
  });
106
+ /**
107
+ * @type {function(): number}
108
+ */
121
109
  _classPrivateFieldInitSpec(this, _rowsLimit, {
122
110
  writable: true,
123
111
  value: void 0
124
112
  });
113
+ /**
114
+ * @type {function(): number}
115
+ */
125
116
  _classPrivateFieldInitSpec(this, _columnsLimit, {
126
117
  writable: true,
127
118
  value: void 0
128
119
  });
120
+ /**
121
+ * @type {function(): number}
122
+ */
129
123
  _classPrivateFieldInitSpec(this, _countColumnHeaders, {
130
124
  writable: true,
131
125
  value: void 0
@@ -44,30 +44,6 @@ var _countColumnHeaders = /*#__PURE__*/new WeakMap();
44
44
  var _trimColumnsRange = /*#__PURE__*/new WeakSet();
45
45
  var _trimRowsRange = /*#__PURE__*/new WeakSet();
46
46
  export var CopyableRangesFactory = /*#__PURE__*/function () {
47
- /**
48
- * @type {CellRange}
49
- */
50
-
51
- /**
52
- * @type {function(): number}
53
- */
54
-
55
- /**
56
- * @type {function(): number}
57
- */
58
-
59
- /**
60
- * @type {function(): number}
61
- */
62
-
63
- /**
64
- * @type {function(): number}
65
- */
66
-
67
- /**
68
- * @type {function(): number}
69
- */
70
-
71
47
  /* eslint-disable jsdoc/require-description-complete-sentence */
72
48
  /**
73
49
  * @param {{
@@ -101,26 +77,44 @@ export var CopyableRangesFactory = /*#__PURE__*/function () {
101
77
  * @returns {number} Returns trimmed column index if it exceeds the limit.
102
78
  */
103
79
  _classPrivateMethodInitSpec(this, _trimColumnsRange);
80
+ /**
81
+ * @type {CellRange}
82
+ */
104
83
  _classPrivateFieldInitSpec(this, _selectedRange, {
105
84
  writable: true,
106
85
  value: void 0
107
86
  });
87
+ /**
88
+ * @type {function(): number}
89
+ */
108
90
  _classPrivateFieldInitSpec(this, _countRows, {
109
91
  writable: true,
110
92
  value: void 0
111
93
  });
94
+ /**
95
+ * @type {function(): number}
96
+ */
112
97
  _classPrivateFieldInitSpec(this, _countColumns, {
113
98
  writable: true,
114
99
  value: void 0
115
100
  });
101
+ /**
102
+ * @type {function(): number}
103
+ */
116
104
  _classPrivateFieldInitSpec(this, _rowsLimit, {
117
105
  writable: true,
118
106
  value: void 0
119
107
  });
108
+ /**
109
+ * @type {function(): number}
110
+ */
120
111
  _classPrivateFieldInitSpec(this, _columnsLimit, {
121
112
  writable: true,
122
113
  value: void 0
123
114
  });
115
+ /**
116
+ * @type {function(): number}
117
+ */
124
118
  _classPrivateFieldInitSpec(this, _countColumnHeaders, {
125
119
  writable: true,
126
120
  value: void 0
@@ -14,6 +14,8 @@ export interface BorderRange {
14
14
  };
15
15
  }
16
16
  export type DetailedSettings = (SimpleCellCoords | BorderRange) & {
17
+ start?: BorderOptions | string;
18
+ end?: BorderOptions | string;
17
19
  left?: BorderOptions | string;
18
20
  right?: BorderOptions | string;
19
21
  top?: BorderOptions | string;
@@ -329,6 +329,11 @@ var Filters = /*#__PURE__*/function (_BasePlugin) {
329
329
  * * `between` - Between
330
330
  * * `by_value` - By value
331
331
  * * `contains` - Contains
332
+ * * `date_after` - After a date
333
+ * * `date_before` - Before a date
334
+ * * `date_today` - Today
335
+ * * `date_tomorrow` - Tomorrow
336
+ * * `date_yesterday` - Yesterday
332
337
  * * `empty` - Empty
333
338
  * * `ends_with` - Ends with
334
339
  * * `eq` - Equal
@@ -319,6 +319,11 @@ export var Filters = /*#__PURE__*/function (_BasePlugin) {
319
319
  * * `between` - Between
320
320
  * * `by_value` - By value
321
321
  * * `contains` - Contains
322
+ * * `date_after` - After a date
323
+ * * `date_before` - Before a date
324
+ * * `date_today` - Today
325
+ * * `date_tomorrow` - Tomorrow
326
+ * * `date_yesterday` - Yesterday
322
327
  * * `empty` - Empty
323
328
  * * `ends_with` - Ends with
324
329
  * * `eq` - Equal
@@ -3,6 +3,8 @@
3
3
  require("core-js/modules/es.symbol.js");
4
4
  require("core-js/modules/es.symbol.description.js");
5
5
  require("core-js/modules/es.symbol.iterator.js");
6
+ require("core-js/modules/es.array.slice.js");
7
+ require("core-js/modules/es.object.freeze.js");
6
8
  exports.__esModule = true;
7
9
  exports.getRegisteredHotInstances = getRegisteredHotInstances;
8
10
  exports.registerCustomFunctions = registerCustomFunctions;
@@ -27,10 +29,14 @@ require("core-js/modules/web.dom-collections.for-each.js");
27
29
  require("core-js/modules/es.function.name.js");
28
30
  var _staticRegister = _interopRequireDefault(require("../../../utils/staticRegister"));
29
31
  var _mixed = require("../../../helpers/mixed");
32
+ var _templateLiteralTag = require("../../../helpers/templateLiteralTag");
30
33
  var _console = require("../../../helpers/console");
34
+ var _object = require("../../../helpers/object");
31
35
  var _formulas = require("../formulas");
32
36
  var _settings = require("./settings");
37
+ var _templateObject;
33
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
34
40
  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); }
35
41
  /**
36
42
  * Prepares and returns the collection for the engine relationship with the HoT instances.
@@ -99,6 +105,9 @@ function setupEngine(hotInstance) {
99
105
  licenseKey: _settings.DEFAULT_LICENSE_KEY
100
106
  });
101
107
  }
108
+ if (engineConfigItem.getConfig().leapYear1900 !== _settings.DEFAULT_SETTINGS.leapYear1900 || (0, _object.isObjectEqual)(engineConfigItem.getConfig().nullDate, _settings.DEFAULT_SETTINGS.nullDate) === false) {
109
+ (0, _console.warn)((0, _templateLiteralTag.toSingleLine)(_templateObject || (_templateObject = _taggedTemplateLiteral(["If you use HyperFormula with Handsontable, keep the default `leapYear1900` and `nullDate` \n settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates."], ["If you use HyperFormula with Handsontable, keep the default \\`leapYear1900\\` and \\`nullDate\\` \n settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates."]))));
110
+ }
102
111
  return engineConfigItem;
103
112
  }
104
113
  return null;
@@ -1,3 +1,10 @@
1
+ import "core-js/modules/es.symbol.js";
2
+ import "core-js/modules/es.symbol.description.js";
3
+ import "core-js/modules/es.symbol.iterator.js";
4
+ import "core-js/modules/es.array.slice.js";
5
+ import "core-js/modules/es.object.freeze.js";
6
+ var _templateObject;
7
+ function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
1
8
  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); }
2
9
  import "core-js/modules/es.array.iterator.js";
3
10
  import "core-js/modules/es.map.js";
@@ -12,14 +19,13 @@ import "core-js/modules/es.array.splice.js";
12
19
  import "core-js/modules/es.array.index-of.js";
13
20
  import "core-js/modules/web.dom-collections.for-each.js";
14
21
  import "core-js/modules/es.function.name.js";
15
- import "core-js/modules/es.symbol.js";
16
- import "core-js/modules/es.symbol.description.js";
17
- import "core-js/modules/es.symbol.iterator.js";
18
22
  import staticRegister from "../../../utils/staticRegister.mjs";
19
23
  import { isUndefined } from "../../../helpers/mixed.mjs";
24
+ import { toSingleLine } from "../../../helpers/templateLiteralTag.mjs";
20
25
  import { warn } from "../../../helpers/console.mjs";
26
+ import { isObjectEqual } from "../../../helpers/object.mjs";
21
27
  import { PLUGIN_KEY } from "../formulas.mjs";
22
- import { DEFAULT_LICENSE_KEY, getEngineSettingsWithDefaultsAndOverrides } from "./settings.mjs";
28
+ import { DEFAULT_LICENSE_KEY, DEFAULT_SETTINGS, getEngineSettingsWithDefaultsAndOverrides } from "./settings.mjs";
23
29
  /**
24
30
  * Prepares and returns the collection for the engine relationship with the HoT instances.
25
31
  *
@@ -87,6 +93,9 @@ export function setupEngine(hotInstance) {
87
93
  licenseKey: DEFAULT_LICENSE_KEY
88
94
  });
89
95
  }
96
+ if (engineConfigItem.getConfig().leapYear1900 !== DEFAULT_SETTINGS.leapYear1900 || isObjectEqual(engineConfigItem.getConfig().nullDate, DEFAULT_SETTINGS.nullDate) === false) {
97
+ warn(toSingleLine(_templateObject || (_templateObject = _taggedTemplateLiteral(["If you use HyperFormula with Handsontable, keep the default `leapYear1900` and `nullDate` \n settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates."], ["If you use HyperFormula with Handsontable, keep the default \\`leapYear1900\\` and \\`nullDate\\` \n settings. Otherwise, HyperFormula's dates may not sync correctly with Handsontable's dates."]))));
98
+ }
90
99
  return engineConfigItem;
91
100
  }
92
101
  return null;
@@ -15,10 +15,11 @@ require("core-js/modules/es.string.iterator.js");
15
15
  require("core-js/modules/web.dom-collections.iterator.js");
16
16
  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); }
17
17
  exports.__esModule = true;
18
- exports.DEFAULT_LICENSE_KEY = void 0;
18
+ exports.DEFAULT_SETTINGS = exports.DEFAULT_LICENSE_KEY = void 0;
19
19
  exports.getEngineSettingsOverrides = getEngineSettingsOverrides;
20
20
  exports.getEngineSettingsWithDefaultsAndOverrides = getEngineSettingsWithDefaultsAndOverrides;
21
21
  exports.getEngineSettingsWithOverrides = getEngineSettingsWithOverrides;
22
+ exports.haveEngineSettingsChanged = haveEngineSettingsChanged;
22
23
  require("core-js/modules/es.array.reduce.js");
23
24
  require("core-js/modules/es.object.to-string.js");
24
25
  require("core-js/modules/es.object.keys.js");
@@ -39,11 +40,11 @@ var DEFAULT_SETTINGS = {
39
40
  precisionEpsilon: 1e-13,
40
41
  precisionRounding: 14,
41
42
  smartRounding: true,
42
- leapYear1900: true,
43
+ leapYear1900: false,
43
44
  nullDate: {
44
45
  year: 1899,
45
46
  month: 12,
46
- day: 31
47
+ day: 30
47
48
  },
48
49
  nullYear: 30,
49
50
  dateFormats: ['DD/MM/YYYY', 'DD/MM/YY'],
@@ -63,6 +64,7 @@ var DEFAULT_SETTINGS = {
63
64
  * @param {object} hotSettings Handsontable settings object.
64
65
  * @returns {object} Object containing the overriding options.
65
66
  */
67
+ exports.DEFAULT_SETTINGS = DEFAULT_SETTINGS;
66
68
  function getEngineSettingsOverrides(hotSettings) {
67
69
  var _hotSettings$PLUGIN_K, _hotSettings$PLUGIN_K2;
68
70
  return {
@@ -123,4 +125,17 @@ function getEngineSettingsWithOverrides(hotSettings) {
123
125
  var userSettings = cleanEngineSettings(pluginSettings !== null && pluginSettings !== void 0 && (_pluginSettings$engin2 = pluginSettings.engine) !== null && _pluginSettings$engin2 !== void 0 && _pluginSettings$engin2.hyperformula ? pluginSettings.engine : {});
124
126
  var overrides = getEngineSettingsOverrides(hotSettings);
125
127
  return _objectSpread(_objectSpread({}, userSettings), overrides);
128
+ }
129
+
130
+ /**
131
+ * Check if the new settings are defined and are different from the ones currently used by the engine.
132
+ *
133
+ * @param {object} currentEngineSettings Currently used engine settings.
134
+ * @param {object} newEngineSettings New engine settings.
135
+ * @returns {boolean}
136
+ */
137
+ function haveEngineSettingsChanged(currentEngineSettings, newEngineSettings) {
138
+ return Object.keys(newEngineSettings).some(function (settingOption) {
139
+ return newEngineSettings[settingOption] !== void 0 && newEngineSettings[settingOption] !== currentEngineSettings[settingOption];
140
+ });
126
141
  }
@@ -22,7 +22,7 @@ import "core-js/modules/es.string.iterator.js";
22
22
  import "core-js/modules/web.dom-collections.iterator.js";
23
23
  import { PLUGIN_KEY } from "../formulas.mjs";
24
24
  export var DEFAULT_LICENSE_KEY = 'internal-use-in-handsontable';
25
- var DEFAULT_SETTINGS = {
25
+ export var DEFAULT_SETTINGS = {
26
26
  licenseKey: DEFAULT_LICENSE_KEY,
27
27
  useArrayArithmetic: true,
28
28
  useColumnIndex: false,
@@ -31,11 +31,11 @@ var DEFAULT_SETTINGS = {
31
31
  precisionEpsilon: 1e-13,
32
32
  precisionRounding: 14,
33
33
  smartRounding: true,
34
- leapYear1900: true,
34
+ leapYear1900: false,
35
35
  nullDate: {
36
36
  year: 1899,
37
37
  month: 12,
38
- day: 31
38
+ day: 30
39
39
  },
40
40
  nullYear: 30,
41
41
  dateFormats: ['DD/MM/YYYY', 'DD/MM/YY'],
@@ -115,4 +115,17 @@ export function getEngineSettingsWithOverrides(hotSettings) {
115
115
  var userSettings = cleanEngineSettings(pluginSettings !== null && pluginSettings !== void 0 && (_pluginSettings$engin2 = pluginSettings.engine) !== null && _pluginSettings$engin2 !== void 0 && _pluginSettings$engin2.hyperformula ? pluginSettings.engine : {});
116
116
  var overrides = getEngineSettingsOverrides(hotSettings);
117
117
  return _objectSpread(_objectSpread({}, userSettings), overrides);
118
+ }
119
+
120
+ /**
121
+ * Check if the new settings are defined and are different from the ones currently used by the engine.
122
+ *
123
+ * @param {object} currentEngineSettings Currently used engine settings.
124
+ * @param {object} newEngineSettings New engine settings.
125
+ * @returns {boolean}
126
+ */
127
+ export function haveEngineSettingsChanged(currentEngineSettings, newEngineSettings) {
128
+ return Object.keys(newEngineSettings).some(function (settingOption) {
129
+ return newEngineSettings[settingOption] !== void 0 && newEngineSettings[settingOption] !== currentEngineSettings[settingOption];
130
+ });
118
131
  }