handsontable 12.4.0 → 13.0.0-next-900887e-20230613
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/border.js +1 -0
- package/3rdparty/walkontable/src/border.mjs +1 -0
- package/3rdparty/walkontable/src/selection.js +1 -0
- package/3rdparty/walkontable/src/selection.mjs +1 -0
- package/3rdparty/walkontable/src/table.js +1 -0
- package/3rdparty/walkontable/src/table.mjs +1 -0
- package/CHANGELOG.md +15 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.d.ts +3 -4
- package/core.js +90 -107
- package/core.mjs +94 -111
- package/dataMap/dataMap.js +1 -0
- package/dataMap/dataMap.mjs +1 -0
- package/dataMap/metaManager/lazyFactoryMap.js +1 -0
- package/dataMap/metaManager/lazyFactoryMap.mjs +1 -0
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -0
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -0
- package/dataMap/metaManager/metaSchema.js +6 -6
- package/dataMap/metaManager/metaSchema.mjs +6 -6
- package/dist/handsontable.css +24 -2
- package/dist/handsontable.full.css +24 -2
- package/dist/handsontable.full.js +3294 -3169
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +96 -92
- package/dist/handsontable.js +856 -952
- package/dist/handsontable.min.css +4 -4
- package/dist/handsontable.min.js +4 -4
- package/editorManager.js +1 -0
- package/editorManager.mjs +1 -0
- package/editors/baseEditor/baseEditor.js +1 -0
- package/editors/baseEditor/baseEditor.mjs +1 -0
- package/editors/textEditor/textEditor.js +1 -0
- package/editors/textEditor/textEditor.mjs +1 -0
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/object.js +2 -0
- package/helpers/object.mjs +2 -0
- package/package.json +1 -1
- package/pluginHooks.d.ts +0 -1
- package/pluginHooks.js +1 -12
- package/pluginHooks.mjs +1 -12
- package/plugins/autoColumnSize/autoColumnSize.js +1 -0
- package/plugins/autoColumnSize/autoColumnSize.mjs +1 -0
- package/plugins/autoRowSize/autoRowSize.js +1 -0
- package/plugins/autoRowSize/autoRowSize.mjs +1 -0
- package/plugins/autofill/autofill.js +2 -2
- package/plugins/autofill/autofill.mjs +3 -3
- package/plugins/autofill/utils.js +1 -39
- package/plugins/autofill/utils.mjs +0 -37
- package/plugins/base/base.js +1 -0
- package/plugins/base/base.mjs +1 -0
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +1 -0
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +1 -0
- package/plugins/collapsibleColumns/collapsibleColumns.js +1 -0
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +1 -0
- package/plugins/columnSorting/columnSorting.js +1 -0
- package/plugins/columnSorting/columnSorting.mjs +1 -0
- package/plugins/columnSorting/columnStatesManager.js +1 -0
- package/plugins/columnSorting/columnStatesManager.mjs +1 -0
- package/plugins/columnSorting/rootComparator.js +1 -0
- package/plugins/columnSorting/rootComparator.mjs +1 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -0
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -0
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -0
- package/plugins/copyPaste/copyPaste.js +1 -0
- package/plugins/copyPaste/copyPaste.mjs +1 -0
- package/plugins/customBorders/customBorders.js +1 -0
- package/plugins/customBorders/customBorders.mjs +1 -0
- package/plugins/exportFile/dataProvider.js +1 -0
- package/plugins/exportFile/dataProvider.mjs +1 -0
- package/plugins/filters/component/value.js +1 -0
- package/plugins/filters/component/value.mjs +1 -0
- package/plugins/filters/condition/beginsWith.js +1 -0
- package/plugins/filters/condition/beginsWith.mjs +1 -0
- package/plugins/filters/condition/between.js +1 -0
- package/plugins/filters/condition/between.mjs +1 -0
- package/plugins/filters/condition/byValue.js +1 -0
- package/plugins/filters/condition/byValue.mjs +1 -0
- package/plugins/filters/condition/contains.js +1 -0
- package/plugins/filters/condition/contains.mjs +1 -0
- package/plugins/filters/condition/date/after.js +1 -0
- package/plugins/filters/condition/date/after.mjs +1 -0
- package/plugins/filters/condition/date/before.js +1 -0
- package/plugins/filters/condition/date/before.mjs +1 -0
- package/plugins/filters/condition/endsWith.js +1 -0
- package/plugins/filters/condition/endsWith.mjs +1 -0
- package/plugins/filters/condition/equal.js +1 -0
- package/plugins/filters/condition/equal.mjs +1 -0
- package/plugins/filters/condition/greaterThan.js +1 -0
- package/plugins/filters/condition/greaterThan.mjs +1 -0
- package/plugins/filters/condition/greaterThanOrEqual.js +1 -0
- package/plugins/filters/condition/greaterThanOrEqual.mjs +1 -0
- package/plugins/filters/condition/lessThan.js +1 -0
- package/plugins/filters/condition/lessThan.mjs +1 -0
- package/plugins/filters/condition/lessThanOrEqual.js +1 -0
- package/plugins/filters/condition/lessThanOrEqual.mjs +1 -0
- package/plugins/filters/conditionCollection.js +1 -0
- package/plugins/filters/conditionCollection.mjs +1 -0
- package/plugins/filters/filters.js +1 -0
- package/plugins/filters/filters.mjs +1 -0
- package/plugins/filters/ui/multipleSelect.js +1 -0
- package/plugins/filters/ui/multipleSelect.mjs +1 -0
- package/plugins/formulas/formulas.js +1 -0
- package/plugins/formulas/formulas.mjs +1 -0
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -0
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +1 -0
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -0
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +1 -0
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -0
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +1 -0
- package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -0
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +1 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -0
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -0
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -0
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -0
- package/plugins/manualRowMove/manualRowMove.js +5 -1
- package/plugins/manualRowMove/manualRowMove.mjs +5 -1
- package/plugins/mergeCells/calculations/autofill.js +1 -0
- package/plugins/mergeCells/calculations/autofill.mjs +1 -0
- package/plugins/mergeCells/cellsCollection.js +1 -0
- package/plugins/mergeCells/cellsCollection.mjs +1 -0
- package/plugins/mergeCells/mergeCells.js +1 -0
- package/plugins/mergeCells/mergeCells.mjs +1 -0
- package/plugins/multiColumnSorting/rootComparator.js +1 -0
- package/plugins/multiColumnSorting/rootComparator.mjs +1 -0
- package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -0
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs +1 -0
- package/plugins/nestedRows/data/dataManager.js +1 -0
- package/plugins/nestedRows/data/dataManager.mjs +1 -0
- package/plugins/nestedRows/nestedRows.js +1 -0
- package/plugins/nestedRows/nestedRows.mjs +1 -0
- package/plugins/nestedRows/ui/collapsing.js +1 -0
- package/plugins/nestedRows/ui/collapsing.mjs +1 -0
- package/plugins/nestedRows/utils/rowMoveController.js +1 -0
- package/plugins/nestedRows/utils/rowMoveController.mjs +1 -0
- package/plugins/persistentState/storage.js +1 -0
- package/plugins/persistentState/storage.mjs +1 -0
- package/plugins/registry.js +1 -0
- package/plugins/registry.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +1 -0
- package/plugins/undoRedo/undoRedo.mjs +1 -0
- package/selection/highlight/highlight.js +1 -0
- package/selection/highlight/highlight.mjs +1 -0
- package/selection/selection.js +1 -0
- package/selection/selection.mjs +1 -0
- package/selection/utils.js +1 -0
- package/selection/utils.mjs +1 -0
- package/settings.d.ts +1 -0
- package/shortcuts/context.js +1 -0
- package/shortcuts/context.mjs +1 -0
- package/tableView.js +1 -0
- package/tableView.mjs +1 -0
- package/translations/indexMapper.js +8 -56
- package/translations/indexMapper.mjs +9 -56
- package/translations/maps/linkedPhysicalIndexToValueMap.js +1 -0
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +1 -0
- package/translations/maps/utils/indexesSequence.js +1 -0
- package/translations/maps/utils/indexesSequence.mjs +1 -0
- package/translations/maps/utils/physicallyIndexed.js +1 -0
- package/translations/maps/utils/physicallyIndexed.mjs +1 -0
- package/utils/dataStructures/priorityMap.js +1 -0
- package/utils/dataStructures/priorityMap.mjs +1 -0
- package/utils/dataStructures/tree.js +1 -0
- package/utils/dataStructures/tree.mjs +1 -0
- package/utils/dataStructures/uniqueMap.js +1 -0
- package/utils/dataStructures/uniqueMap.mjs +1 -0
- package/utils/dataStructures/uniqueSet.js +1 -0
- package/utils/dataStructures/uniqueSet.mjs +1 -0
- package/utils/ghostTable.js +1 -0
- package/utils/ghostTable.mjs +1 -0
- package/utils/staticRegister.js +1 -0
- package/utils/staticRegister.mjs +1 -0
package/core.mjs
CHANGED
@@ -1,11 +1,4 @@
|
|
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.function.name.js";
|
5
|
-
import "core-js/modules/es.object.freeze.js";
|
6
|
-
var _templateObject, _templateObject2;
|
7
1
|
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); }
|
8
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
9
2
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
10
3
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
11
4
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
@@ -32,6 +25,7 @@ import "core-js/modules/es.array.fill.js";
|
|
32
25
|
import "core-js/modules/es.array.map.js";
|
33
26
|
import "core-js/modules/es.regexp.exec.js";
|
34
27
|
import "core-js/modules/es.string.replace.js";
|
28
|
+
import "core-js/modules/es.array.filter.js";
|
35
29
|
import "core-js/modules/es.array.from.js";
|
36
30
|
import "core-js/modules/es.array.index-of.js";
|
37
31
|
import "core-js/modules/es.array.reverse.js";
|
@@ -39,12 +33,15 @@ import "core-js/modules/web.dom-collections.for-each.js";
|
|
39
33
|
import "core-js/modules/web.timers.js";
|
40
34
|
import "core-js/modules/web.immediate.js";
|
41
35
|
import "core-js/modules/es.map.js";
|
36
|
+
import "core-js/modules/es.symbol.js";
|
37
|
+
import "core-js/modules/es.symbol.description.js";
|
38
|
+
import "core-js/modules/es.symbol.iterator.js";
|
39
|
+
import "core-js/modules/es.regexp.to-string.js";
|
40
|
+
import "core-js/modules/es.function.name.js";
|
42
41
|
import { addClass, empty, observeVisibilityChangeOnce, removeClass } from "./helpers/dom/element.mjs";
|
43
42
|
import { isFunction } from "./helpers/function.mjs";
|
44
43
|
import { isDefined, isUndefined, isRegExp, _injectProductInfo, isEmpty } from "./helpers/mixed.mjs";
|
45
44
|
import { isMobileBrowser, isIpadOS } from "./helpers/browser.mjs";
|
46
|
-
import { warn } from "./helpers/console.mjs";
|
47
|
-
import { toSingleLine } from "./helpers/templateLiteralTag.mjs";
|
48
45
|
import EditorManager from "./editorManager.mjs";
|
49
46
|
import EventManager from "./eventManager.mjs";
|
50
47
|
import { deepClone, duckSchema, isObjectEqual, isObject, deepObjectSize, hasOwnProperty, createObjectPropListener, objectEach } from "./helpers/object.mjs";
|
@@ -71,6 +68,13 @@ import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
|
71
68
|
import { createShortcutManager } from "./shortcuts/index.mjs";
|
72
69
|
var SHORTCUTS_GROUP = 'gridDefault';
|
73
70
|
var activeGuid = null;
|
71
|
+
|
72
|
+
/**
|
73
|
+
* A set of deprecated feature names.
|
74
|
+
*
|
75
|
+
* @type {Set<string>}
|
76
|
+
*/
|
77
|
+
// eslint-disable-next-line no-unused-vars
|
74
78
|
var deprecationWarns = new Set();
|
75
79
|
|
76
80
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
@@ -499,13 +503,6 @@ export default function Core(rootElement, userSettings) {
|
|
499
503
|
|
500
504
|
/* eslint-disable no-case-declarations */
|
501
505
|
switch (action) {
|
502
|
-
case 'insert_row':
|
503
|
-
// backward compatibility
|
504
|
-
if (!deprecationWarns.has(action)) {
|
505
|
-
deprecationWarns.add(action);
|
506
|
-
warn(toSingleLine(_templateObject || (_templateObject = _taggedTemplateLiteral(["The `", "` action of the `alter()` method is deprecated and will be removed \n in the next major release of Handsontable. Use the `insert_row_above` action instead."], ["The \\`", "\\` action of the \\`alter()\\` method is deprecated and will be removed\\x20\n in the next major release of Handsontable. Use the \\`insert_row_above\\` action instead."])), action));
|
507
|
-
}
|
508
|
-
// falls through
|
509
506
|
case 'insert_row_below':
|
510
507
|
case 'insert_row_above':
|
511
508
|
var numberOfSourceRows = instance.countSourceRows();
|
@@ -516,11 +513,9 @@ export default function Core(rootElement, userSettings) {
|
|
516
513
|
// `above` is the default behavior for creating new rows
|
517
514
|
var insertRowMode = action === 'insert_row_below' ? 'below' : 'above';
|
518
515
|
|
519
|
-
// The line below ensures backward compatibility of the `alter()` method's `insert_row` action.
|
520
|
-
// Calling the `insert_row` action with no arguments adds a new row at the end of the data set.
|
521
516
|
// Calling the `insert_row_above` action adds a new row at the beginning of the data set.
|
522
517
|
// eslint-disable-next-line no-param-reassign
|
523
|
-
index = (_index = index) !== null && _index !== void 0 ? _index :
|
518
|
+
index = (_index = index) !== null && _index !== void 0 ? _index : insertRowMode === 'below' ? numberOfSourceRows : 0;
|
524
519
|
var _datamap$createRow = datamap.createRow(index, amount, {
|
525
520
|
source: source,
|
526
521
|
mode: insertRowMode
|
@@ -559,23 +554,14 @@ export default function Core(rootElement, userSettings) {
|
|
559
554
|
}
|
560
555
|
|
561
556
|
break;
|
562
|
-
case 'insert_col':
|
563
|
-
// backward compatibility
|
564
|
-
if (!deprecationWarns.has(action)) {
|
565
|
-
deprecationWarns.add(action);
|
566
|
-
warn(toSingleLine(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["The `", "` action of the `alter()` method is deprecated and will be removed \n in the next major release of Handsontable. Use the `insert_col_start` action instead."], ["The \\`", "\\` action of the \\`alter()\\` method is deprecated and will be removed\\x20\n in the next major release of Handsontable. Use the \\`insert_col_start\\` action instead."])), action));
|
567
|
-
}
|
568
|
-
// falls through
|
569
557
|
case 'insert_col_start':
|
570
558
|
case 'insert_col_end':
|
571
559
|
// "start" is a default behavior for creating new columns
|
572
560
|
var insertColumnMode = action === 'insert_col_end' ? 'end' : 'start';
|
573
561
|
|
574
|
-
// The line below ensures backward compatibility of the `alter()` method's `insert_col` action.
|
575
|
-
// Calling the `insert_col` action with no arguments adds a new column to the right of the data set.
|
576
562
|
// Calling the `insert_col_start` action adds a new column to the left of the data set.
|
577
563
|
// eslint-disable-next-line no-param-reassign
|
578
|
-
index = (_index2 = index) !== null && _index2 !== void 0 ? _index2 :
|
564
|
+
index = (_index2 = index) !== null && _index2 !== void 0 ? _index2 : insertColumnMode === 'end' ? instance.countSourceCols() : 0;
|
579
565
|
var _datamap$createCol = datamap.createCol(index, amount, {
|
580
566
|
source: source,
|
581
567
|
mode: insertColumnMode
|
@@ -846,13 +832,9 @@ export default function Core(rootElement, userSettings) {
|
|
846
832
|
* @param {object} [end] End selection position (only for drag-down mode). Visual indexes.
|
847
833
|
* @param {string} [source="populateFromArray"] Source information string.
|
848
834
|
* @param {string} [method="overwrite"] Populate method. Possible options: `shift_down`, `shift_right`, `overwrite`.
|
849
|
-
* @param {string} direction (left|right|up|down) String specifying the direction.
|
850
|
-
* @param {Array} deltas The deltas array. A difference between values of adjacent cells.
|
851
|
-
* Useful **only** when the type of handled cells is `numeric`.
|
852
835
|
* @returns {object|undefined} Ending td in pasted area (only if any cell was changed).
|
853
836
|
*/
|
854
|
-
populateFromArray: function populateFromArray(start, input, end, source, method
|
855
|
-
// TODO: either remove or implement the `direction` argument. Currently it's not working at all.
|
837
|
+
populateFromArray: function populateFromArray(start, input, end, source, method) {
|
856
838
|
var r;
|
857
839
|
var rlen;
|
858
840
|
var c;
|
@@ -940,11 +922,6 @@ export default function Core(rootElement, userSettings) {
|
|
940
922
|
// overwrite and other not specified options
|
941
923
|
current.row = start.row;
|
942
924
|
current.col = start.col;
|
943
|
-
var selected = {
|
944
|
-
// selected range
|
945
|
-
row: end && start ? end.row - start.row + 1 : 1,
|
946
|
-
col: end && start ? end.col - start.col + 1 : 1
|
947
|
-
};
|
948
925
|
var skippedRow = 0;
|
949
926
|
var skippedColumn = 0;
|
950
927
|
var pushData = true;
|
@@ -1005,16 +982,6 @@ export default function Core(rootElement, userSettings) {
|
|
1005
982
|
var visualColumn = c - skippedColumn;
|
1006
983
|
var value = getInputValue(visualRow, visualColumn);
|
1007
984
|
var orgValue = instance.getDataAtCell(current.row, current.col);
|
1008
|
-
var index = {
|
1009
|
-
row: visualRow,
|
1010
|
-
col: visualColumn
|
1011
|
-
};
|
1012
|
-
if (source === 'Autofill.fill') {
|
1013
|
-
var result = instance.runHooks('beforeAutofillInsidePopulate', index, direction, input, deltas, {}, selected);
|
1014
|
-
if (result) {
|
1015
|
-
value = isUndefined(result.value) ? value : result.value;
|
1016
|
-
}
|
1017
|
-
}
|
1018
985
|
if (value !== null && _typeof(value) === 'object') {
|
1019
986
|
// when 'value' is array and 'orgValue' is null, set 'orgValue' to
|
1020
987
|
// an empty array so that the null value can be compared to 'value'
|
@@ -1184,15 +1151,8 @@ export default function Core(rootElement, userSettings) {
|
|
1184
1151
|
return;
|
1185
1152
|
}
|
1186
1153
|
var activeEditor = instance.getActiveEditor();
|
1187
|
-
var beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');
|
1188
|
-
var shouldBeCanceled = true;
|
1189
|
-
if (beforeChangeResult === false) {
|
1190
|
-
if (activeEditor) {
|
1191
|
-
activeEditor.cancelChanges();
|
1192
|
-
}
|
1193
|
-
return;
|
1194
|
-
}
|
1195
1154
|
var waitingForValidator = new ValidatorsQueue();
|
1155
|
+
var shouldBeCanceled = true;
|
1196
1156
|
waitingForValidator.onQueueEmpty = function (isValid) {
|
1197
1157
|
if (activeEditor && shouldBeCanceled) {
|
1198
1158
|
activeEditor.cancelChanges();
|
@@ -1201,43 +1161,37 @@ export default function Core(rootElement, userSettings) {
|
|
1201
1161
|
};
|
1202
1162
|
|
1203
1163
|
for (var i = changes.length - 1; i >= 0; i--) {
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
if (cellProperties.type === 'numeric' && typeof newValue === 'string' && isNumericLike(newValue)) {
|
1214
|
-
changes[i][3] = getParsedNumber(newValue);
|
1215
|
-
}
|
1164
|
+
var _changes$i = _slicedToArray(changes[i], 4),
|
1165
|
+
row = _changes$i[0],
|
1166
|
+
prop = _changes$i[1],
|
1167
|
+
newValue = _changes$i[3];
|
1168
|
+
var col = datamap.propToCol(prop);
|
1169
|
+
var cellProperties = instance.getCellMeta(row, col);
|
1170
|
+
if (cellProperties.type === 'numeric' && typeof newValue === 'string' && isNumericLike(newValue)) {
|
1171
|
+
changes[i][3] = getParsedNumber(newValue);
|
1172
|
+
}
|
1216
1173
|
|
1217
|
-
|
1218
|
-
|
1219
|
-
|
1220
|
-
|
1221
|
-
|
1222
|
-
|
1223
|
-
|
1224
|
-
|
1225
|
-
|
1226
|
-
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
}
|
1234
|
-
// index -= 1;
|
1174
|
+
/* eslint-disable no-loop-func */
|
1175
|
+
if (instance.getCellValidator(cellProperties)) {
|
1176
|
+
waitingForValidator.addValidatorToQueue();
|
1177
|
+
instance.validateCell(changes[i][3], cellProperties, function (index, cellPropertiesReference) {
|
1178
|
+
return function (result) {
|
1179
|
+
if (typeof result !== 'boolean') {
|
1180
|
+
throw new Error('Validation error: result is not boolean');
|
1181
|
+
}
|
1182
|
+
if (result === false && cellPropertiesReference.allowInvalid === false) {
|
1183
|
+
shouldBeCanceled = false;
|
1184
|
+
changes.splice(index, 1); // cancel the change
|
1185
|
+
cellPropertiesReference.valid = true; // we cancelled the change, so cell value is still valid
|
1186
|
+
|
1187
|
+
var cell = instance.getCell(cellPropertiesReference.visualRow, cellPropertiesReference.visualCol);
|
1188
|
+
if (cell !== null) {
|
1189
|
+
removeClass(cell, tableMeta.invalidCellClassName);
|
1235
1190
|
}
|
1236
|
-
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
}
|
1191
|
+
}
|
1192
|
+
waitingForValidator.removeValidatorFormQueue();
|
1193
|
+
};
|
1194
|
+
}(i, cellProperties), source);
|
1241
1195
|
}
|
1242
1196
|
}
|
1243
1197
|
waitingForValidator.checkIfQueueIsEmpty();
|
@@ -1427,6 +1381,31 @@ export default function Core(rootElement, userSettings) {
|
|
1427
1381
|
return [[row, propOrCol, value]];
|
1428
1382
|
}
|
1429
1383
|
|
1384
|
+
/**
|
1385
|
+
* Process changes prepared for applying to the dataset (unifying list of changes, closing an editor - when needed,
|
1386
|
+
* calling a hook).
|
1387
|
+
*
|
1388
|
+
* @private
|
1389
|
+
* @param {Array} changes Array of changes in format `[[row, col, value],...]`.
|
1390
|
+
* @param {string} [source] String that identifies how this change will be described in the changes array (useful in afterChange or beforeChange callback). Set to 'edit' if left empty.
|
1391
|
+
* @returns {Array} List of changes finally applied to the dataset.
|
1392
|
+
*/
|
1393
|
+
function processChanges(changes, source) {
|
1394
|
+
var activeEditor = instance.getActiveEditor();
|
1395
|
+
var beforeChangeResult = instance.runHooks('beforeChange', changes, source || 'edit');
|
1396
|
+
// The `beforeChange` hook could add a `null` for purpose of cancelling some dataset's change.
|
1397
|
+
var filteredChanges = changes.filter(function (change) {
|
1398
|
+
return change !== null;
|
1399
|
+
});
|
1400
|
+
if (beforeChangeResult === false || filteredChanges.length === 0) {
|
1401
|
+
if (activeEditor) {
|
1402
|
+
activeEditor.cancelChanges();
|
1403
|
+
}
|
1404
|
+
return [];
|
1405
|
+
}
|
1406
|
+
return filteredChanges;
|
1407
|
+
}
|
1408
|
+
|
1430
1409
|
/**
|
1431
1410
|
* @description
|
1432
1411
|
* Set new value to a cell. To change many cells at once (recommended way), pass an array of `changes` in format
|
@@ -1464,9 +1443,10 @@ export default function Core(rootElement, userSettings) {
|
|
1464
1443
|
if (!changeSource && _typeof(row) === 'object') {
|
1465
1444
|
changeSource = column;
|
1466
1445
|
}
|
1467
|
-
|
1468
|
-
|
1469
|
-
|
1446
|
+
var processedChanges = processChanges(changes, source);
|
1447
|
+
instance.runHooks('afterSetDataAtCell', processedChanges, changeSource);
|
1448
|
+
validateChanges(processedChanges, changeSource, function () {
|
1449
|
+
applyChanges(processedChanges, changeSource);
|
1470
1450
|
});
|
1471
1451
|
};
|
1472
1452
|
|
@@ -1494,9 +1474,10 @@ export default function Core(rootElement, userSettings) {
|
|
1494
1474
|
if (!changeSource && _typeof(row) === 'object') {
|
1495
1475
|
changeSource = prop;
|
1496
1476
|
}
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1477
|
+
var processedChanges = processChanges(changes, source);
|
1478
|
+
instance.runHooks('afterSetDataAtRowProp', processedChanges, changeSource);
|
1479
|
+
validateChanges(processedChanges, changeSource, function () {
|
1480
|
+
applyChanges(processedChanges, changeSource);
|
1500
1481
|
});
|
1501
1482
|
};
|
1502
1483
|
|
@@ -1571,18 +1552,15 @@ export default function Core(rootElement, userSettings) {
|
|
1571
1552
|
* @param {number} [endCol] End visual column index (use when you want to cut input when certain column is reached).
|
1572
1553
|
* @param {string} [source=populateFromArray] Used to identify this call in the resulting events (beforeChange, afterChange).
|
1573
1554
|
* @param {string} [method=overwrite] Populate method, possible values: `'shift_down'`, `'shift_right'`, `'overwrite'`.
|
1574
|
-
* @param {string} direction Populate direction, possible values: `'left'`, `'right'`, `'up'`, `'down'`.
|
1575
|
-
* @param {Array} deltas The deltas array. A difference between values of adjacent cells.
|
1576
|
-
* Useful **only** when the type of handled cells is `numeric`.
|
1577
1555
|
* @returns {object|undefined} Ending td in pasted area (only if any cell was changed).
|
1578
1556
|
*/
|
1579
|
-
this.populateFromArray = function (row, column, input, endRow, endCol, source, method
|
1557
|
+
this.populateFromArray = function (row, column, input, endRow, endCol, source, method) {
|
1580
1558
|
if (!(_typeof(input) === 'object' && _typeof(input[0]) === 'object')) {
|
1581
1559
|
throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly
|
1582
1560
|
}
|
1583
1561
|
|
1584
1562
|
var c = typeof endRow === 'number' ? instance._createCellCoords(endRow, endCol) : null;
|
1585
|
-
return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method
|
1563
|
+
return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method);
|
1586
1564
|
};
|
1587
1565
|
|
1588
1566
|
/**
|
@@ -2508,10 +2486,11 @@ export default function Core(rootElement, userSettings) {
|
|
2508
2486
|
* | `'insert_col_start'` | Inserts columns before the `index` column. | Inserts columns before the first column. |
|
2509
2487
|
* | `'insert_col_end'` | Inserts columns after the `index` column. | Inserts columns after the last column. |
|
2510
2488
|
* | `'remove_col'` | Removes columns, starting from the `index` column. | Removes columns, starting from the last column. |
|
2511
|
-
* | `'insert_row'` (<b>Deprecated</b>) | Inserts rows above the `index` row. | Inserts rows below the last row. |
|
2512
|
-
* | `'insert_col'` (<b>Deprecated</b>) | Inserts columns before the `index` column. | Inserts columns after the last column. |
|
2513
2489
|
*
|
2514
|
-
*
|
2490
|
+
* Additional information about `'insert_col_start'` and `'insert_col_end'`:
|
2491
|
+
* - Their behavior depends on your [`layoutDirection`](@/api/options.md#layoutdirection).
|
2492
|
+
* - If the provided `index` is higher than the actual number of columns, Handsontable doesn't generate
|
2493
|
+
* the columns missing in between. Instead, the new columns are inserted next to the last column.
|
2515
2494
|
*
|
2516
2495
|
* @memberof Core#
|
2517
2496
|
* @function alter
|
@@ -2523,8 +2502,6 @@ export default function Core(rootElement, userSettings) {
|
|
2523
2502
|
* <li> `'insert_col_start'` </li>
|
2524
2503
|
* <li> `'insert_col_end'` </li>
|
2525
2504
|
* <li> `'remove_col'` </li>
|
2526
|
-
* <li> `'insert_row'` (<b>Deprecated</b>) </li>
|
2527
|
-
* <li> `'insert_col'` (<b>Deprecated</b>) </li>
|
2528
2505
|
* </ul>
|
2529
2506
|
* @param {number|number[]} [index] A visual index of the row/column before or after which the new row/column will be
|
2530
2507
|
* inserted or removed. Can also be an array of arrays, in format `[[index, amount],...]`.
|
@@ -3235,10 +3212,16 @@ export default function Core(rootElement, userSettings) {
|
|
3235
3212
|
};
|
3236
3213
|
|
3237
3214
|
/**
|
3238
|
-
* Validates
|
3215
|
+
* Validates every cell in the data set,
|
3216
|
+
* using a [validator function](@/guides/cell-functions/cell-validator.md) configured for each cell.
|
3239
3217
|
*
|
3240
|
-
*
|
3241
|
-
*
|
3218
|
+
* Doesn't validate cells that are currently [trimmed](@/guides/rows/row-trimming.md),
|
3219
|
+
* [hidden](@/guides/rows/row-hiding.md), or [filtered](@/guides/columns/column-filter.md),
|
3220
|
+
* as such cells are not included in the data set until you bring them back again.
|
3221
|
+
*
|
3222
|
+
* After the validation, the `callback` function is fired, with the `valid` argument set to:
|
3223
|
+
* - `true` for valid cells
|
3224
|
+
* - `false` for invalid cells
|
3242
3225
|
*
|
3243
3226
|
* @memberof Core#
|
3244
3227
|
* @function validateCells
|
package/dataMap/dataMap.js
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require("core-js/modules/es.symbol.iterator.js");
|
4
4
|
require("core-js/modules/es.array.from.js");
|
5
|
+
require("core-js/modules/es.regexp.to-string.js");
|
5
6
|
require("core-js/modules/es.function.name.js");
|
6
7
|
require("core-js/modules/es.regexp.exec.js");
|
7
8
|
exports.__esModule = true;
|
package/dataMap/dataMap.mjs
CHANGED
@@ -25,6 +25,7 @@ import "core-js/modules/es.symbol.js";
|
|
25
25
|
import "core-js/modules/es.symbol.description.js";
|
26
26
|
import "core-js/modules/es.symbol.iterator.js";
|
27
27
|
import "core-js/modules/es.array.from.js";
|
28
|
+
import "core-js/modules/es.regexp.to-string.js";
|
28
29
|
import "core-js/modules/es.function.name.js";
|
29
30
|
import "core-js/modules/es.regexp.exec.js";
|
30
31
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -21,6 +21,7 @@ import "core-js/modules/es.symbol.to-primitive.js";
|
|
21
21
|
import "core-js/modules/es.date.to-primitive.js";
|
22
22
|
import "core-js/modules/es.number.constructor.js";
|
23
23
|
import "core-js/modules/es.array.from.js";
|
24
|
+
import "core-js/modules/es.regexp.to-string.js";
|
24
25
|
import "core-js/modules/es.function.name.js";
|
25
26
|
import "core-js/modules/es.regexp.exec.js";
|
26
27
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require("core-js/modules/es.symbol.iterator.js");
|
4
4
|
require("core-js/modules/es.array.slice.js");
|
5
|
+
require("core-js/modules/es.regexp.to-string.js");
|
5
6
|
require("core-js/modules/es.function.name.js");
|
6
7
|
require("core-js/modules/es.regexp.exec.js");
|
7
8
|
exports.__esModule = true;
|
@@ -18,6 +18,7 @@ import "core-js/modules/es.symbol.description.js";
|
|
18
18
|
import "core-js/modules/es.number.constructor.js";
|
19
19
|
import "core-js/modules/es.symbol.iterator.js";
|
20
20
|
import "core-js/modules/es.array.slice.js";
|
21
|
+
import "core-js/modules/es.regexp.to-string.js";
|
21
22
|
import "core-js/modules/es.function.name.js";
|
22
23
|
import "core-js/modules/es.regexp.exec.js";
|
23
24
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
@@ -1116,15 +1116,15 @@ var _default = function _default() {
|
|
1116
1116
|
* contextMenu: {
|
1117
1117
|
* items: {
|
1118
1118
|
* 'option1': {
|
1119
|
-
* name: '
|
1119
|
+
* name: 'Option 1'
|
1120
1120
|
* },
|
1121
1121
|
* 'option2': {
|
1122
|
-
* name: '
|
1122
|
+
* name: 'Option 2',
|
1123
1123
|
* submenu: {
|
1124
1124
|
* items: [
|
1125
1125
|
* {
|
1126
1126
|
* key: 'option2:suboption1',
|
1127
|
-
* name: '
|
1127
|
+
* name: 'Suboption 1',
|
1128
1128
|
* callback: function(key, options) {
|
1129
1129
|
* ...
|
1130
1130
|
* }
|
@@ -1774,15 +1774,15 @@ var _default = function _default() {
|
|
1774
1774
|
* dropdownMenu: {
|
1775
1775
|
* items: {
|
1776
1776
|
* 'option1': {
|
1777
|
-
* name: '
|
1777
|
+
* name: 'Option 1'
|
1778
1778
|
* },
|
1779
1779
|
* 'option2': {
|
1780
|
-
* name: '
|
1780
|
+
* name: 'Option 2',
|
1781
1781
|
* submenu: {
|
1782
1782
|
* items: [
|
1783
1783
|
* {
|
1784
1784
|
* key: 'option2:suboption1',
|
1785
|
-
* name: '
|
1785
|
+
* name: 'Suboption 1',
|
1786
1786
|
* callback(key, options) {
|
1787
1787
|
* ...
|
1788
1788
|
* }
|
@@ -1112,15 +1112,15 @@ export default (function () {
|
|
1112
1112
|
* contextMenu: {
|
1113
1113
|
* items: {
|
1114
1114
|
* 'option1': {
|
1115
|
-
* name: '
|
1115
|
+
* name: 'Option 1'
|
1116
1116
|
* },
|
1117
1117
|
* 'option2': {
|
1118
|
-
* name: '
|
1118
|
+
* name: 'Option 2',
|
1119
1119
|
* submenu: {
|
1120
1120
|
* items: [
|
1121
1121
|
* {
|
1122
1122
|
* key: 'option2:suboption1',
|
1123
|
-
* name: '
|
1123
|
+
* name: 'Suboption 1',
|
1124
1124
|
* callback: function(key, options) {
|
1125
1125
|
* ...
|
1126
1126
|
* }
|
@@ -1770,15 +1770,15 @@ export default (function () {
|
|
1770
1770
|
* dropdownMenu: {
|
1771
1771
|
* items: {
|
1772
1772
|
* 'option1': {
|
1773
|
-
* name: '
|
1773
|
+
* name: 'Option 1'
|
1774
1774
|
* },
|
1775
1775
|
* 'option2': {
|
1776
|
-
* name: '
|
1776
|
+
* name: 'Option 2',
|
1777
1777
|
* submenu: {
|
1778
1778
|
* items: [
|
1779
1779
|
* {
|
1780
1780
|
* key: 'option2:suboption1',
|
1781
|
-
* name: '
|
1781
|
+
* name: 'Suboption 1',
|
1782
1782
|
* callback(key, options) {
|
1783
1783
|
* ...
|
1784
1784
|
* }
|
package/dist/handsontable.css
CHANGED
@@ -25,8 +25,8 @@
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
27
27
|
*
|
28
|
-
* Version:
|
29
|
-
* Release date:
|
28
|
+
* Version: 13.0.0-next-900887e-20230613
|
29
|
+
* Release date: 20/06/2023 (built at 13/06/2023 14:32:35)
|
30
30
|
*/
|
31
31
|
/**
|
32
32
|
* Fix for bootstrap styles
|
@@ -1064,10 +1064,21 @@ CheckboxRenderer
|
|
1064
1064
|
margin-right: 6px;
|
1065
1065
|
}
|
1066
1066
|
|
1067
|
+
[dir=rtl].htContextMenu table tbody tr td .htItemWrapper {
|
1068
|
+
margin-right: 10px;
|
1069
|
+
margin-left: 6px;
|
1070
|
+
}
|
1071
|
+
|
1067
1072
|
.htContextMenu table tbody tr td div span.selected {
|
1068
1073
|
margin-top: -2px;
|
1069
1074
|
position: absolute;
|
1070
1075
|
left: 4px;
|
1076
|
+
right: 0;
|
1077
|
+
}
|
1078
|
+
|
1079
|
+
[dir=rtl].htContextMenu table tbody tr td div span.selected {
|
1080
|
+
right: 4px;
|
1081
|
+
left: 0;
|
1071
1082
|
}
|
1072
1083
|
|
1073
1084
|
.htContextMenu .ht_master .wtHolder {
|
@@ -1202,10 +1213,21 @@ textarea.HandsontableCopyPaste {
|
|
1202
1213
|
margin-right: 10px;
|
1203
1214
|
}
|
1204
1215
|
|
1216
|
+
[dir=rtl].htDropdownMenu table tbody tr td .htItemWrapper {
|
1217
|
+
margin-right: 10px;
|
1218
|
+
margin-left: 10px;
|
1219
|
+
}
|
1220
|
+
|
1205
1221
|
.htDropdownMenu table tbody tr td div span.selected {
|
1206
1222
|
margin-top: -2px;
|
1207
1223
|
position: absolute;
|
1208
1224
|
left: 4px;
|
1225
|
+
right: 0;
|
1226
|
+
}
|
1227
|
+
|
1228
|
+
[dir=rtl].htDropdownMenu table tbody tr td div span.selected {
|
1229
|
+
right: 4px;
|
1230
|
+
left: 0;
|
1209
1231
|
}
|
1210
1232
|
|
1211
1233
|
.htDropdownMenu .ht_master .wtHolder {
|
@@ -25,8 +25,8 @@
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
27
27
|
*
|
28
|
-
* Version:
|
29
|
-
* Release date:
|
28
|
+
* Version: 13.0.0-next-900887e-20230613
|
29
|
+
* Release date: 20/06/2023 (built at 13/06/2023 14:32:35)
|
30
30
|
*/
|
31
31
|
/**
|
32
32
|
* Fix for bootstrap styles
|
@@ -1297,10 +1297,21 @@ CheckboxRenderer
|
|
1297
1297
|
margin-right: 6px;
|
1298
1298
|
}
|
1299
1299
|
|
1300
|
+
[dir=rtl].htContextMenu table tbody tr td .htItemWrapper {
|
1301
|
+
margin-right: 10px;
|
1302
|
+
margin-left: 6px;
|
1303
|
+
}
|
1304
|
+
|
1300
1305
|
.htContextMenu table tbody tr td div span.selected {
|
1301
1306
|
margin-top: -2px;
|
1302
1307
|
position: absolute;
|
1303
1308
|
left: 4px;
|
1309
|
+
right: 0;
|
1310
|
+
}
|
1311
|
+
|
1312
|
+
[dir=rtl].htContextMenu table tbody tr td div span.selected {
|
1313
|
+
right: 4px;
|
1314
|
+
left: 0;
|
1304
1315
|
}
|
1305
1316
|
|
1306
1317
|
.htContextMenu .ht_master .wtHolder {
|
@@ -1435,10 +1446,21 @@ textarea.HandsontableCopyPaste {
|
|
1435
1446
|
margin-right: 10px;
|
1436
1447
|
}
|
1437
1448
|
|
1449
|
+
[dir=rtl].htDropdownMenu table tbody tr td .htItemWrapper {
|
1450
|
+
margin-right: 10px;
|
1451
|
+
margin-left: 10px;
|
1452
|
+
}
|
1453
|
+
|
1438
1454
|
.htDropdownMenu table tbody tr td div span.selected {
|
1439
1455
|
margin-top: -2px;
|
1440
1456
|
position: absolute;
|
1441
1457
|
left: 4px;
|
1458
|
+
right: 0;
|
1459
|
+
}
|
1460
|
+
|
1461
|
+
[dir=rtl].htDropdownMenu table tbody tr td div span.selected {
|
1462
|
+
right: 4px;
|
1463
|
+
left: 0;
|
1442
1464
|
}
|
1443
1465
|
|
1444
1466
|
.htDropdownMenu .ht_master .wtHolder {
|