handsontable 12.1.2 → 12.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. package/3rdparty/walkontable/src/border.js +43 -28
  2. package/3rdparty/walkontable/src/border.mjs +43 -28
  3. package/3rdparty/walkontable/src/table.js +13 -10
  4. package/3rdparty/walkontable/src/table.mjs +13 -10
  5. package/CHANGELOG.md +27 -4
  6. package/base.js +2 -2
  7. package/base.mjs +2 -2
  8. package/core.d.ts +1 -3
  9. package/core.js +9 -1
  10. package/core.mjs +9 -1
  11. package/dataMap/dataMap.js +35 -16
  12. package/dataMap/dataMap.mjs +30 -13
  13. package/dataMap/metaManager/lazyFactoryMap.js +24 -5
  14. package/dataMap/metaManager/lazyFactoryMap.mjs +19 -4
  15. package/dataMap/metaManager/metaSchema.js +112 -80
  16. package/dataMap/metaManager/metaSchema.mjs +112 -80
  17. package/dist/handsontable.css +2 -2
  18. package/dist/handsontable.full.css +2 -2
  19. package/dist/handsontable.full.js +40800 -57808
  20. package/dist/handsontable.full.min.css +2 -2
  21. package/dist/handsontable.full.min.js +527 -284
  22. package/dist/handsontable.js +3046 -3279
  23. package/dist/handsontable.min.css +2 -2
  24. package/dist/handsontable.min.js +3 -3
  25. package/editorManager.js +69 -35
  26. package/editorManager.mjs +69 -35
  27. package/editors/baseEditor/baseEditor.js +1 -1
  28. package/editors/baseEditor/baseEditor.mjs +1 -1
  29. package/editors/dateEditor/dateEditor.js +17 -2
  30. package/editors/dateEditor/dateEditor.mjs +16 -0
  31. package/editors/textEditor/caretPositioner.js +0 -4
  32. package/editors/textEditor/caretPositioner.mjs +0 -2
  33. package/helpers/dom/element.js +2 -4
  34. package/helpers/dom/element.mjs +1 -2
  35. package/helpers/mixed.js +2 -4
  36. package/helpers/mixed.mjs +2 -3
  37. package/helpers/object.js +0 -4
  38. package/helpers/object.mjs +0 -2
  39. package/helpers/unicode.js +0 -4
  40. package/helpers/unicode.mjs +0 -2
  41. package/package.json +1 -1
  42. package/pluginHooks.d.ts +0 -1
  43. package/pluginHooks.js +17 -14
  44. package/pluginHooks.mjs +17 -14
  45. package/plugins/base/base.js +2 -4
  46. package/plugins/base/base.mjs +1 -2
  47. package/plugins/columnSorting/sortService/engine.js +2 -6
  48. package/plugins/columnSorting/sortService/engine.mjs +2 -2
  49. package/plugins/columnSummary/columnSummary.js +17 -11
  50. package/plugins/columnSummary/columnSummary.mjs +15 -9
  51. package/plugins/columnSummary/utils.js +14 -0
  52. package/plugins/columnSummary/utils.mjs +9 -0
  53. package/plugins/contextMenu/commandExecutor.js +0 -4
  54. package/plugins/contextMenu/commandExecutor.mjs +0 -2
  55. package/plugins/contextMenu/contextMenu.js +5 -1
  56. package/plugins/contextMenu/contextMenu.mjs +5 -1
  57. package/plugins/contextMenu/menu.js +4 -0
  58. package/plugins/contextMenu/menu.mjs +4 -0
  59. package/plugins/copyPaste/copyPaste.js +2 -0
  60. package/plugins/copyPaste/copyPaste.mjs +2 -0
  61. package/plugins/dropdownMenu/dropdownMenu.js +4 -0
  62. package/plugins/dropdownMenu/dropdownMenu.mjs +4 -0
  63. package/plugins/filters/component/condition.js +11 -29
  64. package/plugins/filters/component/condition.mjs +6 -21
  65. package/plugins/filters/component/value.js +12 -5
  66. package/plugins/filters/component/value.mjs +12 -5
  67. package/plugins/filters/filters.d.ts +1 -1
  68. package/plugins/filters/filters.js +62 -82
  69. package/plugins/filters/filters.mjs +63 -83
  70. package/plugins/hiddenColumns/hiddenColumns.js +0 -4
  71. package/plugins/hiddenColumns/hiddenColumns.mjs +0 -2
  72. package/plugins/hiddenRows/hiddenRows.js +0 -4
  73. package/plugins/hiddenRows/hiddenRows.mjs +0 -2
  74. package/plugins/multiColumnSorting/domHelpers.js +2 -4
  75. package/plugins/multiColumnSorting/domHelpers.mjs +1 -2
  76. package/plugins/nestedRows/nestedRows.js +1 -1
  77. package/plugins/nestedRows/nestedRows.mjs +1 -1
  78. package/plugins/search/search.js +0 -2
  79. package/plugins/search/search.mjs +0 -1
  80. package/plugins/trimRows/trimRows.js +3 -3
  81. package/plugins/trimRows/trimRows.mjs +3 -3
  82. package/renderers/numericRenderer/numericRenderer.js +0 -2
  83. package/renderers/numericRenderer/numericRenderer.mjs +0 -1
  84. package/renderers/textRenderer/textRenderer.js +1 -1
  85. package/renderers/textRenderer/textRenderer.mjs +1 -1
  86. package/shortcuts/recorder.js +14 -10
  87. package/shortcuts/recorder.mjs +13 -10
  88. package/shortcuts/utils.js +0 -4
  89. package/shortcuts/utils.mjs +0 -2
  90. package/translations/indexMapper.js +2 -2
  91. package/translations/indexMapper.mjs +2 -2
  92. package/utils/sortingAlgorithms/mergeSort.js +0 -120
  93. package/utils/sortingAlgorithms/mergeSort.mjs +0 -110
package/pluginHooks.js CHANGED
@@ -106,7 +106,7 @@ var REGISTERED_HOOKS = [
106
106
  * __Note:__ For performance reasons, the `changes` array is null for `"loadData"` source.
107
107
  *
108
108
  * @event Hooks#afterChange
109
- * @param {Array} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`.
109
+ * @param {Array[]} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`. `row` is a visual row index.
110
110
  * @param {string} [source] String that identifies source of hook call ([list of all available sources](@/guides/getting-started/events-and-hooks.md#definition-for-source-argument)).
111
111
  * @example
112
112
  * ```js
@@ -242,7 +242,7 @@ var REGISTERED_HOOKS = [
242
242
  */
243
243
  'afterCreateRow',
244
244
  /**
245
- * Fired after the current cell is deselected.
245
+ * Fired after all selected cells are deselected.
246
246
  *
247
247
  * @event Hooks#afterDeselect
248
248
  */
@@ -623,7 +623,7 @@ var REGISTERED_HOOKS = [
623
623
  * @param {string|number} prop Property name / visual column index.
624
624
  * @param {string} [source] String that identifies source of hook call
625
625
  * ([list of all available sources](@/guides/getting-started/events-and-hooks.md#definition-for-source-argument)).
626
- * @returns {void | boolean} If `false` the cell will be marked as invalid, `true` otherwise.
626
+ * @returns {undefined | boolean} If `false` the cell will be marked as invalid, `true` otherwise.
627
627
  */
628
628
  'afterValidate',
629
629
  /**
@@ -693,10 +693,10 @@ var REGISTERED_HOOKS = [
693
693
  * table rendering.
694
694
  *
695
695
  * @event Hooks#beforeChange
696
- * @param {Array[]} changes 2D array containing information about each of the edited cells.
696
+ * @param {Array[]} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`. `row` is a visual row index.
697
697
  * @param {string} [source] String that identifies source of hook call
698
698
  * ([list of all available sources](@/guides/getting-started/events-and-hooks.md#definition-for-source-argument)).
699
- * @returns {void | boolean} If `false` all changes were cancelled, `true` otherwise.
699
+ * @returns {undefined | boolean} If `false` all changes were cancelled, `true` otherwise.
700
700
  * @example
701
701
  * ```js
702
702
  * // To disregard a single change, set changes[i] to null or remove it from array using changes.splice(i, 1).
@@ -946,7 +946,7 @@ var REGISTERED_HOOKS = [
946
946
  * @param {number} column Visual column index.
947
947
  * @param {string} key The updated meta key.
948
948
  * @param {*} value The updated meta value.
949
- * @returns {*|boolean} If false is returned the action is canceled.
949
+ * @returns {boolean|undefined} If false is returned the action is canceled.
950
950
  */
951
951
  'beforeSetCellMeta',
952
952
  /**
@@ -1080,6 +1080,7 @@ var REGISTERED_HOOKS = [
1080
1080
  * @param {boolean} topmost If set to `true`, it returns the TD element from the topmost overlay. For example,
1081
1081
  * if the wanted cell is in the range of fixed rows, it will return a TD element
1082
1082
  * from the `top` overlay.
1083
+ * @returns {undefined|number[]}
1083
1084
  */
1084
1085
  'modifyGetCellCoords',
1085
1086
  /**
@@ -1111,8 +1112,9 @@ var REGISTERED_HOOKS = [
1111
1112
  */
1112
1113
  'beforeHighlightingColumnHeader',
1113
1114
  /**
1114
- * Fired by {@link PersistentState} plugin, after loading value, saved under given key, from browser local storage. This hook is fired when
1115
- * {@link Options#persistentState} option is enabled.
1115
+ * Fired by {@link PersistentState} plugin, after loading value, saved under given key, from browser local storage.
1116
+ *
1117
+ * The `persistentStateLoad` hook is fired even when the {@link Options#persistentState} option is disabled.
1116
1118
  *
1117
1119
  * @event Hooks#persistentStateLoad
1118
1120
  * @param {string} key Key.
@@ -1128,8 +1130,9 @@ var REGISTERED_HOOKS = [
1128
1130
  */
1129
1131
  'persistentStateReset',
1130
1132
  /**
1131
- * Fired by {@link PersistentState} plugin, after saving value under given key in browser local storage. This hook is fired when
1132
- * {@link Options#persistentState} option is enabled.
1133
+ * Fired by {@link PersistentState} plugin, after saving value under given key in browser local storage.
1134
+ *
1135
+ * The `persistentStateSave` hook is fired even when the {@link Options#persistentState} option is disabled.
1133
1136
  *
1134
1137
  * @event Hooks#persistentStateSave
1135
1138
  * @param {string} key Key.
@@ -1145,7 +1148,7 @@ var REGISTERED_HOOKS = [
1145
1148
  * @event Hooks#beforeColumnSort
1146
1149
  * @param {Array} currentSortConfig Current sort configuration (for all sorted columns).
1147
1150
  * @param {Array} destinationSortConfigs Destination sort configuration (for all sorted columns).
1148
- * @returns {boolean | void} If `false` the column will not be sorted, `true` otherwise.
1151
+ * @returns {boolean | undefined} If `false` the column will not be sorted, `true` otherwise.
1149
1152
  */
1150
1153
  'beforeColumnSort',
1151
1154
  /**
@@ -1330,7 +1333,7 @@ var REGISTERED_HOOKS = [
1330
1333
  * [documentation](@/guides/columns/column-moving.md).
1331
1334
  * It's `undefined` when `dragColumns` function wasn't called.
1332
1335
  * @param {boolean} movePossible Indicates if it's possible to move rows to the desired position.
1333
- * @returns {void | boolean} If `false` the column will not be moved, `true` otherwise.
1336
+ * @returns {undefined | boolean} If `false` the column will not be moved, `true` otherwise.
1334
1337
  */
1335
1338
  'beforeColumnMove',
1336
1339
  /**
@@ -1438,7 +1441,7 @@ var REGISTERED_HOOKS = [
1438
1441
  * @param {number} newSize Calculated new row height.
1439
1442
  * @param {number} row Visual index of the resized row.
1440
1443
  * @param {boolean} isDoubleClick Flag that determines whether there was a double-click.
1441
- * @returns {number} Returns the new row size or `undefined` if row size should be calculated automatically.
1444
+ * @returns {number|undefined} Returns the new row size or `undefined` if row size should be calculated automatically.
1442
1445
  */
1443
1446
  'beforeRowResize',
1444
1447
  /**
@@ -1471,7 +1474,7 @@ var REGISTERED_HOOKS = [
1471
1474
  * @event Hooks#beforeStretchingColumnWidth
1472
1475
  * @param {number} stretchedWidth Calculated width.
1473
1476
  * @param {number} column Visual column index.
1474
- * @returns {number} Returns new width which will be applied to the column element.
1477
+ * @returns {number|undefined} Returns new width which will be applied to the column element.
1475
1478
  */
1476
1479
  'beforeStretchingColumnWidth',
1477
1480
  /**
package/pluginHooks.mjs CHANGED
@@ -89,7 +89,7 @@ var REGISTERED_HOOKS = [
89
89
  * __Note:__ For performance reasons, the `changes` array is null for `"loadData"` source.
90
90
  *
91
91
  * @event Hooks#afterChange
92
- * @param {Array} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`.
92
+ * @param {Array[]} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`. `row` is a visual row index.
93
93
  * @param {string} [source] String that identifies source of hook call ([list of all available sources](@/guides/getting-started/events-and-hooks.md#definition-for-source-argument)).
94
94
  * @example
95
95
  * ```js
@@ -225,7 +225,7 @@ var REGISTERED_HOOKS = [
225
225
  */
226
226
  'afterCreateRow',
227
227
  /**
228
- * Fired after the current cell is deselected.
228
+ * Fired after all selected cells are deselected.
229
229
  *
230
230
  * @event Hooks#afterDeselect
231
231
  */
@@ -606,7 +606,7 @@ var REGISTERED_HOOKS = [
606
606
  * @param {string|number} prop Property name / visual column index.
607
607
  * @param {string} [source] String that identifies source of hook call
608
608
  * ([list of all available sources](@/guides/getting-started/events-and-hooks.md#definition-for-source-argument)).
609
- * @returns {void | boolean} If `false` the cell will be marked as invalid, `true` otherwise.
609
+ * @returns {undefined | boolean} If `false` the cell will be marked as invalid, `true` otherwise.
610
610
  */
611
611
  'afterValidate',
612
612
  /**
@@ -676,10 +676,10 @@ var REGISTERED_HOOKS = [
676
676
  * table rendering.
677
677
  *
678
678
  * @event Hooks#beforeChange
679
- * @param {Array[]} changes 2D array containing information about each of the edited cells.
679
+ * @param {Array[]} changes 2D array containing information about each of the edited cells `[[row, prop, oldVal, newVal], ...]`. `row` is a visual row index.
680
680
  * @param {string} [source] String that identifies source of hook call
681
681
  * ([list of all available sources](@/guides/getting-started/events-and-hooks.md#definition-for-source-argument)).
682
- * @returns {void | boolean} If `false` all changes were cancelled, `true` otherwise.
682
+ * @returns {undefined | boolean} If `false` all changes were cancelled, `true` otherwise.
683
683
  * @example
684
684
  * ```js
685
685
  * // To disregard a single change, set changes[i] to null or remove it from array using changes.splice(i, 1).
@@ -929,7 +929,7 @@ var REGISTERED_HOOKS = [
929
929
  * @param {number} column Visual column index.
930
930
  * @param {string} key The updated meta key.
931
931
  * @param {*} value The updated meta value.
932
- * @returns {*|boolean} If false is returned the action is canceled.
932
+ * @returns {boolean|undefined} If false is returned the action is canceled.
933
933
  */
934
934
  'beforeSetCellMeta',
935
935
  /**
@@ -1063,6 +1063,7 @@ var REGISTERED_HOOKS = [
1063
1063
  * @param {boolean} topmost If set to `true`, it returns the TD element from the topmost overlay. For example,
1064
1064
  * if the wanted cell is in the range of fixed rows, it will return a TD element
1065
1065
  * from the `top` overlay.
1066
+ * @returns {undefined|number[]}
1066
1067
  */
1067
1068
  'modifyGetCellCoords',
1068
1069
  /**
@@ -1094,8 +1095,9 @@ var REGISTERED_HOOKS = [
1094
1095
  */
1095
1096
  'beforeHighlightingColumnHeader',
1096
1097
  /**
1097
- * Fired by {@link PersistentState} plugin, after loading value, saved under given key, from browser local storage. This hook is fired when
1098
- * {@link Options#persistentState} option is enabled.
1098
+ * Fired by {@link PersistentState} plugin, after loading value, saved under given key, from browser local storage.
1099
+ *
1100
+ * The `persistentStateLoad` hook is fired even when the {@link Options#persistentState} option is disabled.
1099
1101
  *
1100
1102
  * @event Hooks#persistentStateLoad
1101
1103
  * @param {string} key Key.
@@ -1111,8 +1113,9 @@ var REGISTERED_HOOKS = [
1111
1113
  */
1112
1114
  'persistentStateReset',
1113
1115
  /**
1114
- * Fired by {@link PersistentState} plugin, after saving value under given key in browser local storage. This hook is fired when
1115
- * {@link Options#persistentState} option is enabled.
1116
+ * Fired by {@link PersistentState} plugin, after saving value under given key in browser local storage.
1117
+ *
1118
+ * The `persistentStateSave` hook is fired even when the {@link Options#persistentState} option is disabled.
1116
1119
  *
1117
1120
  * @event Hooks#persistentStateSave
1118
1121
  * @param {string} key Key.
@@ -1128,7 +1131,7 @@ var REGISTERED_HOOKS = [
1128
1131
  * @event Hooks#beforeColumnSort
1129
1132
  * @param {Array} currentSortConfig Current sort configuration (for all sorted columns).
1130
1133
  * @param {Array} destinationSortConfigs Destination sort configuration (for all sorted columns).
1131
- * @returns {boolean | void} If `false` the column will not be sorted, `true` otherwise.
1134
+ * @returns {boolean | undefined} If `false` the column will not be sorted, `true` otherwise.
1132
1135
  */
1133
1136
  'beforeColumnSort',
1134
1137
  /**
@@ -1313,7 +1316,7 @@ var REGISTERED_HOOKS = [
1313
1316
  * [documentation](@/guides/columns/column-moving.md).
1314
1317
  * It's `undefined` when `dragColumns` function wasn't called.
1315
1318
  * @param {boolean} movePossible Indicates if it's possible to move rows to the desired position.
1316
- * @returns {void | boolean} If `false` the column will not be moved, `true` otherwise.
1319
+ * @returns {undefined | boolean} If `false` the column will not be moved, `true` otherwise.
1317
1320
  */
1318
1321
  'beforeColumnMove',
1319
1322
  /**
@@ -1421,7 +1424,7 @@ var REGISTERED_HOOKS = [
1421
1424
  * @param {number} newSize Calculated new row height.
1422
1425
  * @param {number} row Visual index of the resized row.
1423
1426
  * @param {boolean} isDoubleClick Flag that determines whether there was a double-click.
1424
- * @returns {number} Returns the new row size or `undefined` if row size should be calculated automatically.
1427
+ * @returns {number|undefined} Returns the new row size or `undefined` if row size should be calculated automatically.
1425
1428
  */
1426
1429
  'beforeRowResize',
1427
1430
  /**
@@ -1454,7 +1457,7 @@ var REGISTERED_HOOKS = [
1454
1457
  * @event Hooks#beforeStretchingColumnWidth
1455
1458
  * @param {number} stretchedWidth Calculated width.
1456
1459
  * @param {number} column Visual column index.
1457
- * @returns {number} Returns new width which will be applied to the column element.
1460
+ * @returns {number|undefined} Returns new width which will be applied to the column element.
1458
1461
  */
1459
1462
  'beforeStretchingColumnWidth',
1460
1463
  /**
@@ -12,6 +12,8 @@ require("core-js/modules/es.function.name.js");
12
12
 
13
13
  require("core-js/modules/es.array.from.js");
14
14
 
15
+ require("core-js/modules/es.regexp.exec.js");
16
+
15
17
  exports.__esModule = true;
16
18
  exports.PLUGIN_KEY = exports.BasePlugin = void 0;
17
19
 
@@ -29,10 +31,6 @@ require("core-js/modules/es.weak-map.js");
29
31
 
30
32
  require("core-js/modules/web.dom-collections.for-each.js");
31
33
 
32
- require("core-js/modules/es.regexp.exec.js");
33
-
34
- require("core-js/modules/es.string.split.js");
35
-
36
34
  require("core-js/modules/es.array.concat.js");
37
35
 
38
36
  require("core-js/modules/es.array.join.js");
@@ -29,8 +29,6 @@ import "core-js/modules/es.string.iterator.js";
29
29
  import "core-js/modules/web.dom-collections.iterator.js";
30
30
  import "core-js/modules/es.weak-map.js";
31
31
  import "core-js/modules/web.dom-collections.for-each.js";
32
- import "core-js/modules/es.regexp.exec.js";
33
- import "core-js/modules/es.string.split.js";
34
32
  import "core-js/modules/es.array.concat.js";
35
33
  import "core-js/modules/es.array.join.js";
36
34
  import "core-js/modules/es.array.index-of.js";
@@ -42,6 +40,7 @@ import "core-js/modules/es.symbol.iterator.js";
42
40
  import "core-js/modules/es.array.slice.js";
43
41
  import "core-js/modules/es.function.name.js";
44
42
  import "core-js/modules/es.array.from.js";
43
+ import "core-js/modules/es.regexp.exec.js";
45
44
  import { defineGetter, objectEach } from "../../helpers/object.mjs";
46
45
  import { arrayEach } from "../../helpers/array.mjs";
47
46
  import { getPluginsNames, hasPlugin } from "../registry.mjs";
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.array.sort.js");
4
-
5
3
  exports.__esModule = true;
6
4
  exports.FIRST_BEFORE_SECOND = exports.FIRST_AFTER_SECOND = exports.DO_NOT_SWAP = void 0;
7
5
  exports.sort = sort;
8
6
 
9
- var _mergeSort = _interopRequireDefault(require("../../../utils/sortingAlgorithms/mergeSort"));
7
+ require("core-js/modules/es.array.sort.js");
10
8
 
11
9
  var _registry = require("./registry");
12
10
 
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
11
  var DO_NOT_SWAP = 0;
16
12
  exports.DO_NOT_SWAP = DO_NOT_SWAP;
17
13
  var FIRST_BEFORE_SECOND = -1;
@@ -32,5 +28,5 @@ function sort(indexesWithData, rootComparatorId) {
32
28
  argsForRootComparator[_key - 2] = arguments[_key];
33
29
  }
34
30
 
35
- (0, _mergeSort.default)(indexesWithData, rootComparator.apply(void 0, argsForRootComparator));
31
+ indexesWithData.sort(rootComparator.apply(void 0, argsForRootComparator));
36
32
  }
@@ -1,4 +1,4 @@
1
- import mergeSort from "../../../utils/sortingAlgorithms/mergeSort.mjs";
1
+ import "core-js/modules/es.array.sort.js";
2
2
  import { getRootComparator } from "./registry.mjs";
3
3
  export var DO_NOT_SWAP = 0;
4
4
  export var FIRST_BEFORE_SECOND = -1;
@@ -16,5 +16,5 @@ export function sort(indexesWithData, rootComparatorId) {
16
16
  argsForRootComparator[_key - 2] = arguments[_key];
17
17
  }
18
18
 
19
- mergeSort(indexesWithData, rootComparator.apply(void 0, argsForRootComparator));
19
+ indexesWithData.sort(rootComparator.apply(void 0, argsForRootComparator));
20
20
  }
@@ -31,12 +31,10 @@ exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.ColumnSummary = void 0;
31
31
 
32
32
  require("core-js/modules/es.array.concat.js");
33
33
 
34
- require("core-js/modules/es.regexp.exec.js");
35
-
36
- require("core-js/modules/es.string.split.js");
37
-
38
34
  require("core-js/modules/es.array.index-of.js");
39
35
 
36
+ require("core-js/modules/es.regexp.exec.js");
37
+
40
38
  require("core-js/modules/es.string.replace.js");
41
39
 
42
40
  require("core-js/modules/es.object.set-prototype-of.js");
@@ -51,6 +49,8 @@ var _endpoints = _interopRequireDefault(require("./endpoints"));
51
49
 
52
50
  var _templateLiteralTag = require("../../helpers/templateLiteralTag");
53
51
 
52
+ var _utils = require("./utils");
53
+
54
54
  var _templateObject;
55
55
 
56
56
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -340,11 +340,15 @@ var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
340
340
  var biggestDecimalPlacesCount = 0;
341
341
 
342
342
  do {
343
- cellValue = this.getCellValue(i, col) || 0;
344
- var decimalPlaces = ("".concat(cellValue).split('.')[1] || []).length || 1;
343
+ cellValue = this.getCellValue(i, col);
344
+ cellValue = (0, _utils.isNullishOrNaN)(cellValue) ? null : cellValue;
345
+
346
+ if (cellValue !== null) {
347
+ var decimalPlaces = ("".concat(cellValue).split('.')[1] || []).length || 1;
345
348
 
346
- if (decimalPlaces > biggestDecimalPlacesCount) {
347
- biggestDecimalPlacesCount = decimalPlaces;
349
+ if (decimalPlaces > biggestDecimalPlacesCount) {
350
+ biggestDecimalPlacesCount = decimalPlaces;
351
+ }
348
352
  }
349
353
 
350
354
  sum += cellValue || 0;
@@ -400,7 +404,7 @@ var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
400
404
  * @param {Array} rowRange Range for the calculation.
401
405
  * @param {number} col Column index.
402
406
  * @param {string} type `'min'` or `'max'`.
403
- * @returns {number} Min or max value.
407
+ * @returns {number|null} Min or max value.
404
408
  */
405
409
 
406
410
  }, {
@@ -411,7 +415,8 @@ var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
411
415
  var cellValue;
412
416
 
413
417
  do {
414
- cellValue = this.getCellValue(i, col) || null;
418
+ cellValue = this.getCellValue(i, col);
419
+ cellValue = (0, _utils.isNullishOrNaN)(cellValue) ? null : cellValue;
415
420
 
416
421
  if (result === null) {
417
422
  result = cellValue;
@@ -453,8 +458,9 @@ var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
453
458
 
454
459
  do {
455
460
  cellValue = this.getCellValue(i, col);
461
+ cellValue = (0, _utils.isNullishOrNaN)(cellValue) ? null : cellValue;
456
462
 
457
- if (!cellValue) {
463
+ if (cellValue === null) {
458
464
  counter += 1;
459
465
  }
460
466
 
@@ -20,9 +20,8 @@ var _templateObject;
20
20
  function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
21
21
 
22
22
  import "core-js/modules/es.array.concat.js";
23
- import "core-js/modules/es.regexp.exec.js";
24
- import "core-js/modules/es.string.split.js";
25
23
  import "core-js/modules/es.array.index-of.js";
24
+ import "core-js/modules/es.regexp.exec.js";
26
25
  import "core-js/modules/es.string.replace.js";
27
26
 
28
27
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -53,6 +52,7 @@ import { BasePlugin } from "../base/index.mjs";
53
52
  import { objectEach } from "../../helpers/object.mjs";
54
53
  import Endpoints from "./endpoints.mjs";
55
54
  import { toSingleLine } from "../../helpers/templateLiteralTag.mjs";
55
+ import { isNullishOrNaN } from "./utils.mjs";
56
56
  export var PLUGIN_KEY = 'columnSummary';
57
57
  export var PLUGIN_PRIORITY = 220;
58
58
  /**
@@ -309,11 +309,15 @@ export var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
309
309
  var biggestDecimalPlacesCount = 0;
310
310
 
311
311
  do {
312
- cellValue = this.getCellValue(i, col) || 0;
313
- var decimalPlaces = ("".concat(cellValue).split('.')[1] || []).length || 1;
312
+ cellValue = this.getCellValue(i, col);
313
+ cellValue = isNullishOrNaN(cellValue) ? null : cellValue;
314
314
 
315
- if (decimalPlaces > biggestDecimalPlacesCount) {
316
- biggestDecimalPlacesCount = decimalPlaces;
315
+ if (cellValue !== null) {
316
+ var decimalPlaces = ("".concat(cellValue).split('.')[1] || []).length || 1;
317
+
318
+ if (decimalPlaces > biggestDecimalPlacesCount) {
319
+ biggestDecimalPlacesCount = decimalPlaces;
320
+ }
317
321
  }
318
322
 
319
323
  sum += cellValue || 0;
@@ -369,7 +373,7 @@ export var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
369
373
  * @param {Array} rowRange Range for the calculation.
370
374
  * @param {number} col Column index.
371
375
  * @param {string} type `'min'` or `'max'`.
372
- * @returns {number} Min or max value.
376
+ * @returns {number|null} Min or max value.
373
377
  */
374
378
 
375
379
  }, {
@@ -380,7 +384,8 @@ export var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
380
384
  var cellValue;
381
385
 
382
386
  do {
383
- cellValue = this.getCellValue(i, col) || null;
387
+ cellValue = this.getCellValue(i, col);
388
+ cellValue = isNullishOrNaN(cellValue) ? null : cellValue;
384
389
 
385
390
  if (result === null) {
386
391
  result = cellValue;
@@ -422,8 +427,9 @@ export var ColumnSummary = /*#__PURE__*/function (_BasePlugin) {
422
427
 
423
428
  do {
424
429
  cellValue = this.getCellValue(i, col);
430
+ cellValue = isNullishOrNaN(cellValue) ? null : cellValue;
425
431
 
426
- if (!cellValue) {
432
+ if (cellValue === null) {
427
433
  counter += 1;
428
434
  }
429
435
 
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.isNullishOrNaN = isNullishOrNaN;
5
+
6
+ /**
7
+ * Returns `true` if the value is one of the type: `null`, `undefined` or `NaN`.
8
+ *
9
+ * @param {*} value The value to check.
10
+ * @returns {boolean}
11
+ */
12
+ function isNullishOrNaN(value) {
13
+ return value === null || value === undefined || isNaN(value);
14
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns `true` if the value is one of the type: `null`, `undefined` or `NaN`.
3
+ *
4
+ * @param {*} value The value to check.
5
+ * @returns {boolean}
6
+ */
7
+ export function isNullishOrNaN(value) {
8
+ return value === null || value === undefined || isNaN(value);
9
+ }
@@ -3,10 +3,6 @@
3
3
  exports.__esModule = true;
4
4
  exports.default = void 0;
5
5
 
6
- require("core-js/modules/es.regexp.exec.js");
7
-
8
- require("core-js/modules/es.string.split.js");
9
-
10
6
  require("core-js/modules/es.array.join.js");
11
7
 
12
8
  var _array = require("../../helpers/array");
@@ -1,5 +1,3 @@
1
- import "core-js/modules/es.regexp.exec.js";
2
- import "core-js/modules/es.string.split.js";
3
1
  import "core-js/modules/es.array.join.js";
4
2
 
5
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -330,6 +330,10 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
330
330
  /**
331
331
  * Execute context menu command.
332
332
  *
333
+ * The `executeCommand()` method works only for selected cells.
334
+ *
335
+ * When no cells are selected, `executeCommand()` doesn't do anything.
336
+ *
333
337
  * You can execute all predefined commands:
334
338
  * * `'row_above'` - Insert row above
335
339
  * * `'row_below'` - Insert row below
@@ -351,7 +355,7 @@ var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
351
355
  * Or you can execute command registered in settings where `key` is your command name.
352
356
  *
353
357
  * @param {string} commandName The command name to be executed.
354
- * @param {*} params Additional paramteres passed to command executor module.
358
+ * @param {*} params Additional parameters passed to command executor module.
355
359
  */
356
360
 
357
361
  }, {
@@ -294,6 +294,10 @@ export var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
294
294
  /**
295
295
  * Execute context menu command.
296
296
  *
297
+ * The `executeCommand()` method works only for selected cells.
298
+ *
299
+ * When no cells are selected, `executeCommand()` doesn't do anything.
300
+ *
297
301
  * You can execute all predefined commands:
298
302
  * * `'row_above'` - Insert row above
299
303
  * * `'row_below'` - Insert row below
@@ -315,7 +319,7 @@ export var ContextMenu = /*#__PURE__*/function (_BasePlugin) {
315
319
  * Or you can execute command registered in settings where `key` is your command name.
316
320
  *
317
321
  * @param {string} commandName The command name to be executed.
318
- * @param {*} params Additional paramteres passed to command executor module.
322
+ * @param {*} params Additional parameters passed to command executor module.
319
323
  */
320
324
 
321
325
  }, {
@@ -607,6 +607,10 @@ var Menu = /*#__PURE__*/function () {
607
607
  /**
608
608
  * Execute menu command.
609
609
  *
610
+ * The `executeCommand()` method works only for selected cells.
611
+ *
612
+ * When no cells are selected, `executeCommand()` doesn't do anything.
613
+ *
610
614
  * @param {Event} [event] The mouse event object.
611
615
  */
612
616
 
@@ -574,6 +574,10 @@ var Menu = /*#__PURE__*/function () {
574
574
  /**
575
575
  * Execute menu command.
576
576
  *
577
+ * The `executeCommand()` method works only for selected cells.
578
+ *
579
+ * When no cells are selected, `executeCommand()` doesn't do anything.
580
+ *
577
581
  * @param {Event} [event] The mouse event object.
578
582
  */
579
583
 
@@ -433,6 +433,8 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
433
433
  /**
434
434
  * Simulates the paste action.
435
435
  *
436
+ * Due to security reasons, modern browsers disallow reading from the system clipboard.
437
+ *
436
438
  * @param {string} pastableText Value as raw string to paste.
437
439
  * @param {string} [pastableHtml=''] Value as HTML to paste.
438
440
  */
@@ -384,6 +384,8 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
384
384
  /**
385
385
  * Simulates the paste action.
386
386
  *
387
+ * Due to security reasons, modern browsers disallow reading from the system clipboard.
388
+ *
387
389
  * @param {string} pastableText Value as raw string to paste.
388
390
  * @param {string} [pastableHtml=''] Value as HTML to paste.
389
391
  */
@@ -360,6 +360,10 @@ var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
360
360
  /**
361
361
  * Executes context menu command.
362
362
  *
363
+ * The `executeCommand()` method works only for selected cells.
364
+ *
365
+ * When no cells are selected, `executeCommand()` doesn't do anything.
366
+ *
363
367
  * You can execute all predefined commands:
364
368
  * * `'row_above'` - Insert row above
365
369
  * * `'row_below'` - Insert row below
@@ -324,6 +324,10 @@ export var DropdownMenu = /*#__PURE__*/function (_BasePlugin) {
324
324
  /**
325
325
  * Executes context menu command.
326
326
  *
327
+ * The `executeCommand()` method works only for selected cells.
328
+ *
329
+ * When no cells are selected, `executeCommand()` doesn't do anything.
330
+ *
327
331
  * You can execute all predefined commands:
328
332
  * * `'row_above'` - Insert row above
329
333
  * * `'row_below'` - Insert row below