handsontable 0.0.0-next-b66c79f-20230713 → 0.0.0-next-85c3085-20230713
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.js +37 -22
- package/3rdparty/walkontable/src/cell/coords.mjs +37 -22
- package/3rdparty/walkontable/src/cell/range.js +54 -39
- package/3rdparty/walkontable/src/cell/range.mjs +54 -39
- package/3rdparty/walkontable/src/core/_base.js +33 -31
- package/3rdparty/walkontable/src/core/_base.mjs +33 -31
- package/3rdparty/walkontable/src/core/clone.js +6 -3
- package/3rdparty/walkontable/src/core/clone.mjs +6 -3
- package/3rdparty/walkontable/src/event.js +2 -1
- package/3rdparty/walkontable/src/event.mjs +2 -1
- package/3rdparty/walkontable/src/overlay/_base.js +10 -8
- package/3rdparty/walkontable/src/overlay/_base.mjs +10 -8
- package/3rdparty/walkontable/src/overlay/bottom.js +10 -8
- package/3rdparty/walkontable/src/overlay/bottom.mjs +10 -8
- package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/top.js +11 -9
- package/3rdparty/walkontable/src/overlay/top.mjs +11 -9
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +16 -13
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +16 -13
- package/3rdparty/walkontable/src/overlays.js +75 -80
- package/3rdparty/walkontable/src/overlays.mjs +75 -80
- package/3rdparty/walkontable/src/scroll.js +27 -24
- package/3rdparty/walkontable/src/scroll.mjs +27 -24
- package/3rdparty/walkontable/src/settings.js +18 -17
- package/3rdparty/walkontable/src/settings.mjs +18 -17
- package/3rdparty/walkontable/src/table.js +42 -37
- package/3rdparty/walkontable/src/table.mjs +42 -37
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +8 -8
- package/core.mjs +8 -8
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +1 -1
- package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +3 -2
- package/dataMap/metaManager/utils.js +4 -2
- package/dataMap/metaManager/utils.mjs +4 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3247 -2847
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +17 -17
- package/dist/handsontable.js +3249 -2849
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +17 -17
- package/editors/autocompleteEditor/autocompleteEditor.js +70 -67
- package/editors/autocompleteEditor/autocompleteEditor.mjs +70 -67
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +2 -1
- package/editors/dateEditor/dateEditor.mjs +2 -1
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/object.js +1 -0
- package/helpers/object.mjs +1 -0
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +1 -1
- package/plugins/autoColumnSize/autoColumnSize.js +4 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +4 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +54 -38
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +54 -38
- package/plugins/columnSorting/columnSorting.js +2 -1
- package/plugins/columnSorting/columnSorting.mjs +2 -1
- package/plugins/columnSorting/columnStatesManager.js +2 -1
- package/plugins/columnSorting/columnStatesManager.mjs +2 -1
- package/plugins/comments/comments.js +2 -2
- package/plugins/comments/comments.mjs +2 -2
- package/plugins/copyPaste/copyPaste.js +6 -4
- package/plugins/copyPaste/copyPaste.mjs +6 -4
- package/plugins/customBorders/customBorders.js +13 -9
- package/plugins/customBorders/customBorders.mjs +13 -9
- package/plugins/customBorders/utils.js +3 -3
- package/plugins/customBorders/utils.mjs +3 -3
- package/plugins/filters/conditionCollection.js +6 -5
- package/plugins/filters/conditionCollection.mjs +6 -5
- package/plugins/filters/filters.js +13 -7
- package/plugins/filters/filters.mjs +13 -7
- package/plugins/formulas/engine/register.js +3 -3
- package/plugins/formulas/engine/register.mjs +3 -3
- package/plugins/formulas/engine/settings.js +6 -3
- package/plugins/formulas/engine/settings.mjs +6 -3
- package/plugins/formulas/formulas.js +151 -143
- package/plugins/formulas/formulas.mjs +151 -143
- package/plugins/formulas/indexSyncer/axisSyncer.js +115 -79
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +115 -79
- package/plugins/formulas/indexSyncer/index.js +100 -64
- package/plugins/formulas/indexSyncer/index.mjs +100 -64
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +2 -2
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -2
- package/plugins/hiddenColumns/hiddenColumns.js +51 -34
- package/plugins/hiddenColumns/hiddenColumns.mjs +51 -34
- package/plugins/hiddenRows/contextMenuItem/showRow.js +2 -2
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -2
- package/plugins/hiddenRows/hiddenRows.js +50 -33
- package/plugins/hiddenRows/hiddenRows.mjs +50 -33
- package/plugins/manualRowResize/manualRowResize.js +2 -1
- package/plugins/manualRowResize/manualRowResize.mjs +2 -1
- package/plugins/mergeCells/mergeCells.js +1 -1
- package/plugins/mergeCells/mergeCells.mjs +1 -1
- package/plugins/nestedHeaders/nestedHeaders.js +88 -67
- package/plugins/nestedHeaders/nestedHeaders.mjs +87 -66
- package/plugins/nestedHeaders/stateManager/headersTree.js +58 -38
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +58 -38
- package/plugins/nestedHeaders/stateManager/index.js +70 -49
- package/plugins/nestedHeaders/stateManager/index.mjs +68 -47
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +1 -1
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +1 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +57 -37
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +57 -37
- package/plugins/nestedHeaders/utils/ghostTable.js +39 -35
- package/plugins/nestedHeaders/utils/ghostTable.mjs +39 -35
- package/plugins/nestedRows/data/dataManager.js +4 -2
- package/plugins/nestedRows/data/dataManager.mjs +4 -2
- package/plugins/persistentState/storage.js +1 -0
- package/plugins/persistentState/storage.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +2 -1
- package/plugins/undoRedo/undoRedo.mjs +2 -1
- package/selection/highlight/visualSelection.js +10 -6
- package/selection/highlight/visualSelection.mjs +10 -6
- package/tableView.js +98 -80
- package/tableView.mjs +98 -80
- package/translations/changesObservable/observable.js +82 -54
- package/translations/changesObservable/observable.mjs +82 -54
- package/translations/changesObservable/observer.js +24 -11
- package/translations/changesObservable/observer.mjs +24 -11
- package/translations/maps/linkedPhysicalIndexToValueMap.js +14 -8
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +14 -8
- package/utils/dataStructures/tree.js +21 -18
- package/utils/dataStructures/tree.mjs +21 -18
@@ -1,4 +1,16 @@
|
|
1
|
+
import "core-js/modules/es.json.stringify.js";
|
1
2
|
import "core-js/modules/es.array.push.js";
|
3
|
+
import "core-js/modules/es.error.cause.js";
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
6
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
7
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
8
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
9
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
10
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
11
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
12
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
13
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
2
14
|
import { BasePlugin } from "../base/index.mjs";
|
3
15
|
import staticRegister from "../../utils/staticRegister.mjs";
|
4
16
|
import { error, warn } from "../../helpers/console.mjs";
|
@@ -37,7 +49,94 @@ const isBlockedSource = source => source === 'UndoRedo.undo' || source === 'Undo
|
|
37
49
|
* @plugin Formulas
|
38
50
|
* @class Formulas
|
39
51
|
*/
|
52
|
+
var _internalOperationPending = /*#__PURE__*/new WeakMap();
|
53
|
+
var _hotWasInitializedWithEmptyData = /*#__PURE__*/new WeakMap();
|
54
|
+
var _engineListeners = /*#__PURE__*/new WeakMap();
|
40
55
|
export class Formulas extends BasePlugin {
|
56
|
+
constructor() {
|
57
|
+
var _this;
|
58
|
+
super(...arguments);
|
59
|
+
_this = this;
|
60
|
+
/**
|
61
|
+
* Flag used to bypass hooks in internal operations.
|
62
|
+
*
|
63
|
+
* @private
|
64
|
+
* @type {boolean}
|
65
|
+
*/
|
66
|
+
_classPrivateFieldInitSpec(this, _internalOperationPending, {
|
67
|
+
writable: true,
|
68
|
+
value: false
|
69
|
+
});
|
70
|
+
/**
|
71
|
+
* Flag needed to mark if Handsontable was initialized with no data.
|
72
|
+
* (Required to work around the fact, that Handsontable auto-generates sample data, when no data is provided).
|
73
|
+
*
|
74
|
+
* @type {boolean}
|
75
|
+
*/
|
76
|
+
_classPrivateFieldInitSpec(this, _hotWasInitializedWithEmptyData, {
|
77
|
+
writable: true,
|
78
|
+
value: false
|
79
|
+
});
|
80
|
+
/**
|
81
|
+
* The list of the HyperFormula listeners.
|
82
|
+
*
|
83
|
+
* @type {Array}
|
84
|
+
*/
|
85
|
+
_classPrivateFieldInitSpec(this, _engineListeners, {
|
86
|
+
writable: true,
|
87
|
+
value: [['valuesUpdated', function () {
|
88
|
+
return _this.onEngineValuesUpdated(...arguments);
|
89
|
+
}], ['namedExpressionAdded', function () {
|
90
|
+
return _this.onEngineNamedExpressionsAdded(...arguments);
|
91
|
+
}], ['namedExpressionRemoved', function () {
|
92
|
+
return _this.onEngineNamedExpressionsRemoved(...arguments);
|
93
|
+
}], ['sheetAdded', function () {
|
94
|
+
return _this.onEngineSheetAdded(...arguments);
|
95
|
+
}], ['sheetRenamed', function () {
|
96
|
+
return _this.onEngineSheetRenamed(...arguments);
|
97
|
+
}], ['sheetRemoved', function () {
|
98
|
+
return _this.onEngineSheetRemoved(...arguments);
|
99
|
+
}]]
|
100
|
+
});
|
101
|
+
/**
|
102
|
+
* Static register used to set up one global HyperFormula instance.
|
103
|
+
* TODO: currently used in tests, might be removed later.
|
104
|
+
*
|
105
|
+
* @private
|
106
|
+
* @type {object}
|
107
|
+
*/
|
108
|
+
_defineProperty(this, "staticRegister", staticRegister('formulas'));
|
109
|
+
/**
|
110
|
+
* The engine instance that will be used for this instance of Handsontable.
|
111
|
+
*
|
112
|
+
* @type {HyperFormula|null}
|
113
|
+
*/
|
114
|
+
_defineProperty(this, "engine", null);
|
115
|
+
/**
|
116
|
+
* HyperFormula's sheet name.
|
117
|
+
*
|
118
|
+
* @type {string|null}
|
119
|
+
*/
|
120
|
+
_defineProperty(this, "sheetName", null);
|
121
|
+
/**
|
122
|
+
* Index synchronizer responsible for manipulating with some general options related to indexes synchronization.
|
123
|
+
*
|
124
|
+
* @type {IndexSyncer|null}
|
125
|
+
*/
|
126
|
+
_defineProperty(this, "indexSyncer", null);
|
127
|
+
/**
|
128
|
+
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the rows.
|
129
|
+
*
|
130
|
+
* @type {AxisSyncer|null}
|
131
|
+
*/
|
132
|
+
_defineProperty(this, "rowAxisSyncer", null);
|
133
|
+
/**
|
134
|
+
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the columns.
|
135
|
+
*
|
136
|
+
* @type {AxisSyncer|null}
|
137
|
+
*/
|
138
|
+
_defineProperty(this, "columnAxisSyncer", null);
|
139
|
+
}
|
41
140
|
static get PLUGIN_KEY() {
|
42
141
|
return PLUGIN_KEY;
|
43
142
|
}
|
@@ -47,101 +146,6 @@ export class Formulas extends BasePlugin {
|
|
47
146
|
static get SETTING_KEYS() {
|
48
147
|
return [PLUGIN_KEY, ...SETTING_KEYS];
|
49
148
|
}
|
50
|
-
|
51
|
-
/**
|
52
|
-
* Flag used to bypass hooks in internal operations.
|
53
|
-
*
|
54
|
-
* @private
|
55
|
-
* @type {boolean}
|
56
|
-
*/
|
57
|
-
#internalOperationPending = false;
|
58
|
-
|
59
|
-
/**
|
60
|
-
* Flag needed to mark if Handsontable was initialized with no data.
|
61
|
-
* (Required to work around the fact, that Handsontable auto-generates sample data, when no data is provided).
|
62
|
-
*
|
63
|
-
* @type {boolean}
|
64
|
-
*/
|
65
|
-
#hotWasInitializedWithEmptyData = false;
|
66
|
-
|
67
|
-
/**
|
68
|
-
* The list of the HyperFormula listeners.
|
69
|
-
*
|
70
|
-
* @type {Array}
|
71
|
-
*/
|
72
|
-
#engineListeners = [['valuesUpdated', (() => {
|
73
|
-
var _this = this;
|
74
|
-
return function () {
|
75
|
-
return _this.onEngineValuesUpdated(...arguments);
|
76
|
-
};
|
77
|
-
})()], ['namedExpressionAdded', (() => {
|
78
|
-
var _this2 = this;
|
79
|
-
return function () {
|
80
|
-
return _this2.onEngineNamedExpressionsAdded(...arguments);
|
81
|
-
};
|
82
|
-
})()], ['namedExpressionRemoved', (() => {
|
83
|
-
var _this3 = this;
|
84
|
-
return function () {
|
85
|
-
return _this3.onEngineNamedExpressionsRemoved(...arguments);
|
86
|
-
};
|
87
|
-
})()], ['sheetAdded', (() => {
|
88
|
-
var _this4 = this;
|
89
|
-
return function () {
|
90
|
-
return _this4.onEngineSheetAdded(...arguments);
|
91
|
-
};
|
92
|
-
})()], ['sheetRenamed', (() => {
|
93
|
-
var _this5 = this;
|
94
|
-
return function () {
|
95
|
-
return _this5.onEngineSheetRenamed(...arguments);
|
96
|
-
};
|
97
|
-
})()], ['sheetRemoved', (() => {
|
98
|
-
var _this6 = this;
|
99
|
-
return function () {
|
100
|
-
return _this6.onEngineSheetRemoved(...arguments);
|
101
|
-
};
|
102
|
-
})()]];
|
103
|
-
|
104
|
-
/**
|
105
|
-
* Static register used to set up one global HyperFormula instance.
|
106
|
-
* TODO: currently used in tests, might be removed later.
|
107
|
-
*
|
108
|
-
* @private
|
109
|
-
* @type {object}
|
110
|
-
*/
|
111
|
-
staticRegister = staticRegister('formulas');
|
112
|
-
|
113
|
-
/**
|
114
|
-
* The engine instance that will be used for this instance of Handsontable.
|
115
|
-
*
|
116
|
-
* @type {HyperFormula|null}
|
117
|
-
*/
|
118
|
-
engine = null;
|
119
|
-
|
120
|
-
/**
|
121
|
-
* HyperFormula's sheet name.
|
122
|
-
*
|
123
|
-
* @type {string|null}
|
124
|
-
*/
|
125
|
-
sheetName = null;
|
126
|
-
/**
|
127
|
-
* Index synchronizer responsible for manipulating with some general options related to indexes synchronization.
|
128
|
-
*
|
129
|
-
* @type {IndexSyncer|null}
|
130
|
-
*/
|
131
|
-
indexSyncer = null;
|
132
|
-
/**
|
133
|
-
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the rows.
|
134
|
-
*
|
135
|
-
* @type {AxisSyncer|null}
|
136
|
-
*/
|
137
|
-
rowAxisSyncer = null;
|
138
|
-
/**
|
139
|
-
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the columns.
|
140
|
-
*
|
141
|
-
* @type {AxisSyncer|null}
|
142
|
-
*/
|
143
|
-
columnAxisSyncer = null;
|
144
|
-
|
145
149
|
/**
|
146
150
|
* HyperFormula's sheet id.
|
147
151
|
*
|
@@ -167,11 +171,11 @@ export class Formulas extends BasePlugin {
|
|
167
171
|
*/
|
168
172
|
enablePlugin() {
|
169
173
|
var _setupEngine,
|
170
|
-
|
174
|
+
_this2 = this;
|
171
175
|
if (this.enabled) {
|
172
176
|
return;
|
173
177
|
}
|
174
|
-
this.engine = (_setupEngine = setupEngine(this.hot))
|
178
|
+
this.engine = (_setupEngine = setupEngine(this.hot)) !== null && _setupEngine !== void 0 ? _setupEngine : this.engine;
|
175
179
|
if (!this.engine) {
|
176
180
|
warn('Missing the required `engine` key in the Formulas settings. Please fill it with either an' + ' engine class or an engine instance.');
|
177
181
|
return;
|
@@ -185,60 +189,60 @@ export class Formulas extends BasePlugin {
|
|
185
189
|
}
|
186
190
|
}
|
187
191
|
this.addHook('beforeLoadData', function () {
|
188
|
-
return
|
192
|
+
return _this2.onBeforeLoadData(...arguments);
|
189
193
|
});
|
190
194
|
this.addHook('afterLoadData', function () {
|
191
|
-
return
|
195
|
+
return _this2.onAfterLoadData(...arguments);
|
192
196
|
});
|
193
197
|
|
194
198
|
// The `updateData` hooks utilize the same logic as the `loadData` hooks.
|
195
199
|
this.addHook('beforeUpdateData', function () {
|
196
|
-
return
|
200
|
+
return _this2.onBeforeLoadData(...arguments);
|
197
201
|
});
|
198
202
|
this.addHook('afterUpdateData', function () {
|
199
|
-
return
|
203
|
+
return _this2.onAfterLoadData(...arguments);
|
200
204
|
});
|
201
205
|
this.addHook('modifyData', function () {
|
202
|
-
return
|
206
|
+
return _this2.onModifyData(...arguments);
|
203
207
|
});
|
204
208
|
this.addHook('modifySourceData', function () {
|
205
|
-
return
|
209
|
+
return _this2.onModifySourceData(...arguments);
|
206
210
|
});
|
207
211
|
this.addHook('beforeValidate', function () {
|
208
|
-
return
|
212
|
+
return _this2.onBeforeValidate(...arguments);
|
209
213
|
});
|
210
214
|
this.addHook('afterSetSourceDataAtCell', function () {
|
211
|
-
return
|
215
|
+
return _this2.onAfterSetSourceDataAtCell(...arguments);
|
212
216
|
});
|
213
217
|
this.addHook('afterSetDataAtCell', function () {
|
214
|
-
return
|
218
|
+
return _this2.onAfterSetDataAtCell(...arguments);
|
215
219
|
});
|
216
220
|
this.addHook('afterSetDataAtRowProp', function () {
|
217
|
-
return
|
221
|
+
return _this2.onAfterSetDataAtCell(...arguments);
|
218
222
|
});
|
219
223
|
this.addHook('beforeCreateRow', function () {
|
220
|
-
return
|
224
|
+
return _this2.onBeforeCreateRow(...arguments);
|
221
225
|
});
|
222
226
|
this.addHook('beforeCreateCol', function () {
|
223
|
-
return
|
227
|
+
return _this2.onBeforeCreateCol(...arguments);
|
224
228
|
});
|
225
229
|
this.addHook('afterCreateRow', function () {
|
226
|
-
return
|
230
|
+
return _this2.onAfterCreateRow(...arguments);
|
227
231
|
});
|
228
232
|
this.addHook('afterCreateCol', function () {
|
229
|
-
return
|
233
|
+
return _this2.onAfterCreateCol(...arguments);
|
230
234
|
});
|
231
235
|
this.addHook('beforeRemoveRow', function () {
|
232
|
-
return
|
236
|
+
return _this2.onBeforeRemoveRow(...arguments);
|
233
237
|
});
|
234
238
|
this.addHook('beforeRemoveCol', function () {
|
235
|
-
return
|
239
|
+
return _this2.onBeforeRemoveCol(...arguments);
|
236
240
|
});
|
237
241
|
this.addHook('afterRemoveRow', function () {
|
238
|
-
return
|
242
|
+
return _this2.onAfterRemoveRow(...arguments);
|
239
243
|
});
|
240
244
|
this.addHook('afterRemoveCol', function () {
|
241
|
-
return
|
245
|
+
return _this2.onAfterRemoveCol(...arguments);
|
242
246
|
});
|
243
247
|
this.indexSyncer = new IndexSyncer(this.hot.rowIndexMapper, this.hot.columnIndexMapper, postponedAction => {
|
244
248
|
this.hot.addHookOnce('init', () => {
|
@@ -280,7 +284,7 @@ export class Formulas extends BasePlugin {
|
|
280
284
|
// hook, because some hooks, such as `afterLoadData` doesn't have information about composed cell properties.
|
281
285
|
// Another hooks are triggered to late for setting HF's engine data needed for some actions.
|
282
286
|
this.addHook('afterCellMetaReset', function () {
|
283
|
-
return
|
287
|
+
return _this2.onAfterCellMetaReset(...arguments);
|
284
288
|
});
|
285
289
|
|
286
290
|
// Handling undo actions on data just using HyperFormula's UndoRedo mechanism
|
@@ -301,12 +305,12 @@ export class Formulas extends BasePlugin {
|
|
301
305
|
this.indexSyncer.setPerformRedo(false);
|
302
306
|
});
|
303
307
|
this.addHook('afterDetachChild', function () {
|
304
|
-
return
|
308
|
+
return _this2.onAfterDetachChild(...arguments);
|
305
309
|
});
|
306
310
|
this.addHook('beforeAutofill', function () {
|
307
|
-
return
|
311
|
+
return _this2.onBeforeAutofill(...arguments);
|
308
312
|
});
|
309
|
-
this
|
313
|
+
_classPrivateFieldGet(this, _engineListeners).forEach(_ref => {
|
310
314
|
let [eventName, listener] = _ref;
|
311
315
|
return this.engine.on(eventName, listener);
|
312
316
|
});
|
@@ -317,7 +321,7 @@ export class Formulas extends BasePlugin {
|
|
317
321
|
* Disables the plugin functionality for this Handsontable instance.
|
318
322
|
*/
|
319
323
|
disablePlugin() {
|
320
|
-
this
|
324
|
+
_classPrivateFieldGet(this, _engineListeners).forEach(_ref2 => {
|
321
325
|
let [eventName, listener] = _ref2;
|
322
326
|
return this.engine.off(eventName, listener);
|
323
327
|
});
|
@@ -349,7 +353,7 @@ export class Formulas extends BasePlugin {
|
|
349
353
|
if (sheetName && this.engine.doesSheetExist(sheetName)) {
|
350
354
|
this.switchSheet(this.sheetName);
|
351
355
|
} else {
|
352
|
-
this.sheetName = this.addSheet(sheetName
|
356
|
+
this.sheetName = this.addSheet(sheetName !== null && sheetName !== void 0 ? sheetName : void 0, this.hot.getSourceDataArray());
|
353
357
|
}
|
354
358
|
}
|
355
359
|
super.updatePlugin(newSettings);
|
@@ -359,11 +363,12 @@ export class Formulas extends BasePlugin {
|
|
359
363
|
* Destroys the plugin instance.
|
360
364
|
*/
|
361
365
|
destroy() {
|
362
|
-
this
|
366
|
+
_classPrivateFieldGet(this, _engineListeners).forEach(_ref3 => {
|
367
|
+
var _this$engine;
|
363
368
|
let [eventName, listener] = _ref3;
|
364
|
-
return this.engine
|
369
|
+
return (_this$engine = this.engine) === null || _this$engine === void 0 ? void 0 : _this$engine.off(eventName, listener);
|
365
370
|
});
|
366
|
-
this
|
371
|
+
_classPrivateFieldSet(this, _engineListeners, null);
|
367
372
|
unregisterEngine(this.engine, this.hot);
|
368
373
|
this.engine = null;
|
369
374
|
super.destroy();
|
@@ -389,7 +394,7 @@ export class Formulas extends BasePlugin {
|
|
389
394
|
return false;
|
390
395
|
}
|
391
396
|
try {
|
392
|
-
const actualSheetName = this.engine.addSheet(sheetName
|
397
|
+
const actualSheetName = this.engine.addSheet(sheetName !== null && sheetName !== void 0 ? sheetName : void 0);
|
393
398
|
if (sheetData) {
|
394
399
|
this.engine.setSheetContent(this.engine.getSheetId(actualSheetName), sheetData);
|
395
400
|
}
|
@@ -471,8 +476,9 @@ export class Formulas extends BasePlugin {
|
|
471
476
|
let renderSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
472
477
|
const affectedSheetIds = new Set();
|
473
478
|
dependentCells.forEach(change => {
|
479
|
+
var _change$address;
|
474
480
|
// For the Named expression the address is empty, hence the `sheetId` is undefined.
|
475
|
-
const sheetId = change
|
481
|
+
const sheetId = change === null || change === void 0 || (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
|
476
482
|
if (sheetId !== void 0) {
|
477
483
|
if (!affectedSheetIds.has(sheetId)) {
|
478
484
|
affectedSheetIds.add(sheetId);
|
@@ -481,8 +487,9 @@ export class Formulas extends BasePlugin {
|
|
481
487
|
});
|
482
488
|
getRegisteredHotInstances(this.engine).forEach((relatedHot, sheetId) => {
|
483
489
|
if ((renderSelf || sheetId !== this.sheetId) && affectedSheetIds.has(sheetId)) {
|
490
|
+
var _relatedHot$view;
|
484
491
|
relatedHot.render();
|
485
|
-
relatedHot.view
|
492
|
+
(_relatedHot$view = relatedHot.view) === null || _relatedHot$view === void 0 ? void 0 : _relatedHot$view.adjustElementsSize();
|
486
493
|
}
|
487
494
|
});
|
488
495
|
}
|
@@ -497,21 +504,21 @@ export class Formulas extends BasePlugin {
|
|
497
504
|
validateDependentCells(dependentCells) {
|
498
505
|
let changedCells = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
499
506
|
const stringifyAddress = change => {
|
500
|
-
var _change$
|
507
|
+
var _change$address2;
|
501
508
|
const {
|
502
509
|
row,
|
503
510
|
col,
|
504
511
|
sheet
|
505
|
-
} = (_change$
|
512
|
+
} = (_change$address2 = change === null || change === void 0 ? void 0 : change.address) !== null && _change$address2 !== void 0 ? _change$address2 : {};
|
506
513
|
return isDefined(sheet) ? `${sheet}:${row}x${col}` : '';
|
507
514
|
};
|
508
515
|
const changedCellsSet = new Set(changedCells.map(change => stringifyAddress(change)));
|
509
516
|
dependentCells.forEach(change => {
|
510
|
-
var _change$
|
517
|
+
var _change$address3, _change$address4;
|
511
518
|
const {
|
512
519
|
row,
|
513
520
|
col
|
514
|
-
} = (_change$
|
521
|
+
} = (_change$address3 = change.address) !== null && _change$address3 !== void 0 ? _change$address3 : {};
|
515
522
|
|
516
523
|
// Don't try to validate cells outside of the visual part of the table.
|
517
524
|
if (isDefined(row) === false || isDefined(col) === false || row >= this.hot.countRows() || col >= this.hot.countCols()) {
|
@@ -519,7 +526,7 @@ export class Formulas extends BasePlugin {
|
|
519
526
|
}
|
520
527
|
|
521
528
|
// For the Named expression the address is empty, hence the `sheetId` is undefined.
|
522
|
-
const sheetId = change
|
529
|
+
const sheetId = change === null || change === void 0 || (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
|
523
530
|
const addressId = stringifyAddress(change);
|
524
531
|
|
525
532
|
// Validate the cells that depend on the calculated formulas. Skip that cells
|
@@ -705,7 +712,7 @@ export class Formulas extends BasePlugin {
|
|
705
712
|
|
706
713
|
// This flag needs to be defined, because not passing data to HOT results in HOT auto-generating a `null`-filled
|
707
714
|
// initial dataset.
|
708
|
-
this
|
715
|
+
_classPrivateFieldSet(this, _hotWasInitializedWithEmptyData, isUndefined(this.hot.getSettings().data));
|
709
716
|
}
|
710
717
|
|
711
718
|
/**
|
@@ -733,9 +740,9 @@ export class Formulas extends BasePlugin {
|
|
733
740
|
});
|
734
741
|
});
|
735
742
|
if (valueChanged === true) {
|
736
|
-
this
|
743
|
+
_classPrivateFieldSet(this, _internalOperationPending, true);
|
737
744
|
this.engine.setSheetContent(this.sheetId, sourceDataArray);
|
738
|
-
this
|
745
|
+
_classPrivateFieldSet(this, _internalOperationPending, false);
|
739
746
|
}
|
740
747
|
}
|
741
748
|
|
@@ -753,14 +760,14 @@ export class Formulas extends BasePlugin {
|
|
753
760
|
return;
|
754
761
|
}
|
755
762
|
this.sheetName = setupSheet(this.engine, this.hot.getSettings()[PLUGIN_KEY].sheetName);
|
756
|
-
if (!this
|
763
|
+
if (!_classPrivateFieldGet(this, _hotWasInitializedWithEmptyData)) {
|
757
764
|
const sourceDataArray = this.hot.getSourceDataArray();
|
758
765
|
if (this.engine.isItPossibleToReplaceSheetContent(this.sheetId, sourceDataArray)) {
|
759
|
-
this
|
766
|
+
_classPrivateFieldSet(this, _internalOperationPending, true);
|
760
767
|
const dependentCells = this.engine.setSheetContent(this.sheetId, sourceDataArray);
|
761
768
|
this.indexSyncer.setupSyncEndpoint(this.engine, this.sheetId);
|
762
769
|
this.renderDependentSheets(dependentCells);
|
763
|
-
this
|
770
|
+
_classPrivateFieldSet(this, _internalOperationPending, false);
|
764
771
|
}
|
765
772
|
} else {
|
766
773
|
this.switchSheet(this.sheetName);
|
@@ -778,7 +785,7 @@ export class Formulas extends BasePlugin {
|
|
778
785
|
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
779
786
|
*/
|
780
787
|
onModifyData(physicalRow, visualColumn, valueHolder, ioMode) {
|
781
|
-
if (ioMode !== 'get' || this
|
788
|
+
if (ioMode !== 'get' || _classPrivateFieldGet(this, _internalOperationPending) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) {
|
782
789
|
return;
|
783
790
|
}
|
784
791
|
const visualRow = this.hot.toVisualRow(physicalRow);
|
@@ -824,7 +831,7 @@ export class Formulas extends BasePlugin {
|
|
824
831
|
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
825
832
|
*/
|
826
833
|
onModifySourceData(row, columnOrProp, valueHolder, ioMode) {
|
827
|
-
if (ioMode !== 'get' || this
|
834
|
+
if (ioMode !== 'get' || _classPrivateFieldGet(this, _internalOperationPending) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) {
|
828
835
|
return;
|
829
836
|
}
|
830
837
|
const visualRow = this.hot.toVisualRow(row);
|
@@ -1110,9 +1117,10 @@ export class Formulas extends BasePlugin {
|
|
1110
1117
|
* @param {number} finalElementRowIndex The final row index of the detached element.
|
1111
1118
|
*/
|
1112
1119
|
onAfterDetachChild(parent, element, finalElementRowIndex) {
|
1113
|
-
|
1114
|
-
|
1115
|
-
this
|
1120
|
+
var _element$__children;
|
1121
|
+
_classPrivateFieldSet(this, _internalOperationPending, true);
|
1122
|
+
const rowsData = this.hot.getSourceDataArray(finalElementRowIndex, 0, finalElementRowIndex + (((_element$__children = element.__children) === null || _element$__children === void 0 ? void 0 : _element$__children.length) || 0), this.hot.countSourceCols());
|
1123
|
+
_classPrivateFieldSet(this, _internalOperationPending, false);
|
1116
1124
|
rowsData.forEach((row, relativeRowIndex) => {
|
1117
1125
|
row.forEach((value, colIndex) => {
|
1118
1126
|
this.engine.setCellContents({
|