handsontable 12.1.1 → 12.1.3
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/walkontable/src/border.js +43 -28
- package/3rdparty/walkontable/src/border.mjs +43 -28
- package/3rdparty/walkontable/src/table.js +13 -10
- package/3rdparty/walkontable/src/table.mjs +13 -10
- package/CHANGELOG.md +31 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +1 -3
- package/core.js +9 -1
- package/core.mjs +9 -1
- package/dataMap/dataMap.js +35 -16
- package/dataMap/dataMap.mjs +30 -13
- package/dataMap/metaManager/lazyFactoryMap.js +24 -5
- package/dataMap/metaManager/lazyFactoryMap.mjs +19 -4
- package/dataMap/metaManager/metaSchema.js +112 -80
- package/dataMap/metaManager/metaSchema.mjs +112 -80
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +35200 -52208
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +527 -284
- package/dist/handsontable.js +3046 -3279
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/editorManager.js +69 -35
- package/editorManager.mjs +69 -35
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +17 -2
- package/editors/dateEditor/dateEditor.mjs +16 -0
- package/editors/textEditor/caretPositioner.js +0 -4
- package/editors/textEditor/caretPositioner.mjs +0 -2
- package/helpers/dom/element.js +2 -4
- package/helpers/dom/element.mjs +1 -2
- package/helpers/mixed.js +2 -4
- package/helpers/mixed.mjs +2 -3
- package/helpers/object.js +0 -4
- package/helpers/object.mjs +0 -2
- package/helpers/unicode.js +0 -4
- package/helpers/unicode.mjs +0 -2
- package/package.json +2 -2
- package/pluginHooks.d.ts +0 -1
- package/pluginHooks.js +17 -14
- package/pluginHooks.mjs +17 -14
- package/plugins/base/base.js +2 -4
- package/plugins/base/base.mjs +1 -2
- package/plugins/columnSorting/sortService/engine.js +2 -6
- package/plugins/columnSorting/sortService/engine.mjs +2 -2
- package/plugins/columnSummary/columnSummary.js +17 -11
- package/plugins/columnSummary/columnSummary.mjs +15 -9
- package/plugins/columnSummary/utils.js +14 -0
- package/plugins/columnSummary/utils.mjs +9 -0
- package/plugins/contextMenu/commandExecutor.js +0 -4
- package/plugins/contextMenu/commandExecutor.mjs +0 -2
- package/plugins/contextMenu/contextMenu.js +5 -1
- package/plugins/contextMenu/contextMenu.mjs +5 -1
- package/plugins/contextMenu/menu.js +4 -0
- package/plugins/contextMenu/menu.mjs +4 -0
- package/plugins/copyPaste/copyPaste.js +2 -0
- package/plugins/copyPaste/copyPaste.mjs +2 -0
- package/plugins/dropdownMenu/dropdownMenu.js +4 -0
- package/plugins/dropdownMenu/dropdownMenu.mjs +4 -0
- package/plugins/filters/component/condition.js +11 -29
- package/plugins/filters/component/condition.mjs +6 -21
- package/plugins/filters/component/value.js +12 -5
- package/plugins/filters/component/value.mjs +12 -5
- package/plugins/filters/filters.d.ts +1 -1
- package/plugins/filters/filters.js +62 -82
- package/plugins/filters/filters.mjs +63 -83
- package/plugins/hiddenColumns/hiddenColumns.js +0 -4
- package/plugins/hiddenColumns/hiddenColumns.mjs +0 -2
- package/plugins/hiddenRows/hiddenRows.js +0 -4
- package/plugins/hiddenRows/hiddenRows.mjs +0 -2
- package/plugins/multiColumnSorting/domHelpers.js +2 -4
- package/plugins/multiColumnSorting/domHelpers.mjs +1 -2
- package/plugins/nestedRows/nestedRows.js +1 -1
- package/plugins/nestedRows/nestedRows.mjs +1 -1
- package/plugins/search/search.js +0 -2
- package/plugins/search/search.mjs +0 -1
- package/plugins/trimRows/trimRows.js +3 -3
- package/plugins/trimRows/trimRows.mjs +3 -3
- package/renderers/numericRenderer/numericRenderer.js +0 -2
- package/renderers/numericRenderer/numericRenderer.mjs +0 -1
- package/renderers/textRenderer/textRenderer.js +1 -1
- package/renderers/textRenderer/textRenderer.mjs +1 -1
- package/shortcuts/recorder.js +14 -10
- package/shortcuts/recorder.mjs +13 -10
- package/shortcuts/utils.js +0 -4
- package/shortcuts/utils.mjs +0 -2
- package/translations/indexMapper.js +2 -2
- package/translations/indexMapper.mjs +2 -2
- package/utils/sortingAlgorithms/mergeSort.js +0 -120
- package/utils/sortingAlgorithms/mergeSort.mjs +0 -110
package/pluginHooks.d.ts
CHANGED
@@ -231,7 +231,6 @@ export interface Events {
|
|
231
231
|
modifyRowHeader?: (row: number) => void;
|
232
232
|
modifyRowHeaderWidth?: (rowHeaderWidth: number) => void;
|
233
233
|
modifyRowHeight?: (height: number, row: number) => void;
|
234
|
-
modifyRowSourceData?: (row: number) => void;
|
235
234
|
modifySourceData?: (row: number, column: number, valueHolder: { value: CellValue }, ioMode: 'get' | 'set') => void;
|
236
235
|
modifyTransformEnd?: (delta: CellCoords) => void;
|
237
236
|
modifyTransformStart?: (delta: CellCoords) => void;
|
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
|
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 {
|
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 {
|
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 {
|
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.
|
1115
|
-
*
|
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.
|
1132
|
-
*
|
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 |
|
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 {
|
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
|
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 {
|
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 {
|
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 {
|
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.
|
1098
|
-
*
|
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.
|
1115
|
-
*
|
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 |
|
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 {
|
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
|
/**
|
package/plugins/base/base.js
CHANGED
@@ -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");
|
package/plugins/base/base.mjs
CHANGED
@@ -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
|
-
|
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
|
-
|
31
|
+
indexesWithData.sort(rootComparator.apply(void 0, argsForRootComparator));
|
36
32
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import
|
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
|
-
|
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)
|
344
|
-
|
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
|
-
|
347
|
-
|
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)
|
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 (
|
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)
|
313
|
-
|
312
|
+
cellValue = this.getCellValue(i, col);
|
313
|
+
cellValue = isNullishOrNaN(cellValue) ? null : cellValue;
|
314
314
|
|
315
|
-
if (
|
316
|
-
|
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)
|
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 (
|
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
|
+
}
|
@@ -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
|
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
|
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
|