handsontable 12.3.3-next-e19badf-20230328 → 12.4.0-next-ddbea0c-20230512
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/walkontable/src/cell/coords.js +13 -16
- package/3rdparty/walkontable/src/cell/coords.mjs +13 -16
- package/3rdparty/walkontable/src/cell/range.js +25 -29
- package/3rdparty/walkontable/src/cell/range.mjs +24 -28
- package/3rdparty/walkontable/src/event.js +4 -0
- package/3rdparty/walkontable/src/event.mjs +4 -0
- package/3rdparty/walkontable/src/overlay/_base.js +6 -7
- package/3rdparty/walkontable/src/overlay/_base.mjs +6 -7
- package/3rdparty/walkontable/src/overlay/bottom.js +6 -7
- package/3rdparty/walkontable/src/overlay/bottom.mjs +6 -7
- package/3rdparty/walkontable/src/overlay/top.js +6 -7
- package/3rdparty/walkontable/src/overlay/top.mjs +6 -7
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +10 -12
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +10 -12
- package/3rdparty/walkontable/src/overlays.js +55 -64
- package/3rdparty/walkontable/src/overlays.mjs +55 -64
- package/3rdparty/walkontable/src/scroll.js +20 -23
- package/3rdparty/walkontable/src/scroll.mjs +20 -23
- package/3rdparty/walkontable/src/settings.js +13 -15
- package/3rdparty/walkontable/src/settings.mjs +13 -15
- package/3rdparty/walkontable/src/table.js +22 -26
- package/3rdparty/walkontable/src/table.mjs +22 -26
- package/CHANGELOG.md +14 -0
- package/base.js +2 -4
- package/base.mjs +2 -2
- package/core.js +23 -6
- package/core.mjs +23 -6
- package/dataMap/dataSource.js +5 -5
- package/dataMap/dataSource.mjs +5 -5
- package/dataMap/metaManager/metaSchema.js +9 -7
- package/dataMap/metaManager/metaSchema.mjs +9 -7
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +5047 -4193
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +86 -78
- package/dist/handsontable.js +4023 -3170
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +11 -3
- package/dist/languages/all.js +133 -0
- package/dist/languages/ar-AR.js +7 -0
- package/dist/languages/cs-CZ.js +7 -0
- package/dist/languages/de-CH.js +7 -0
- package/dist/languages/de-DE.js +7 -0
- package/dist/languages/en-US.js +7 -0
- package/dist/languages/es-MX.js +7 -0
- package/dist/languages/fr-FR.js +7 -0
- package/dist/languages/it-IT.js +7 -0
- package/dist/languages/ja-JP.js +7 -0
- package/dist/languages/ko-KR.js +7 -0
- package/dist/languages/lv-LV.js +7 -0
- package/dist/languages/nb-NO.js +7 -0
- package/dist/languages/nl-NL.js +7 -0
- package/dist/languages/pl-PL.js +7 -0
- package/dist/languages/pt-BR.js +7 -0
- package/dist/languages/ru-RU.js +7 -0
- package/dist/languages/sr-SP.js +7 -0
- package/dist/languages/zh-CN.js +7 -0
- package/dist/languages/zh-TW.js +7 -0
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/i18n/languages/ar-AR.js +7 -1
- package/i18n/languages/cs-CZ.js +7 -1
- package/i18n/languages/de-CH.js +7 -1
- package/i18n/languages/de-DE.js +7 -1
- package/i18n/languages/en-US.js +7 -1
- package/i18n/languages/es-MX.js +7 -1
- package/i18n/languages/fr-FR.js +7 -1
- package/i18n/languages/it-IT.js +7 -1
- package/i18n/languages/ja-JP.js +7 -1
- package/i18n/languages/ko-KR.js +7 -1
- package/i18n/languages/lv-LV.js +7 -1
- package/i18n/languages/nb-NO.js +7 -1
- package/i18n/languages/nl-NL.js +7 -1
- package/i18n/languages/pl-PL.js +7 -1
- package/i18n/languages/pt-BR.js +7 -1
- package/i18n/languages/ru-RU.js +7 -1
- package/i18n/languages/sr-SP.js +7 -1
- package/i18n/languages/zh-CN.js +7 -1
- package/i18n/languages/zh-TW.js +7 -1
- package/languages/all.js +133 -0
- package/languages/ar-AR.js +7 -0
- package/languages/cs-CZ.js +7 -0
- package/languages/de-CH.js +7 -0
- package/languages/de-DE.js +7 -0
- package/languages/en-US.js +7 -0
- package/languages/es-MX.js +7 -0
- package/languages/fr-FR.js +7 -0
- package/languages/index.js +133 -0
- package/languages/it-IT.js +7 -0
- package/languages/ja-JP.js +7 -0
- package/languages/ko-KR.js +7 -0
- package/languages/lv-LV.js +7 -0
- package/languages/nb-NO.js +7 -0
- package/languages/nl-NL.js +7 -0
- package/languages/pl-PL.js +7 -0
- package/languages/pt-BR.js +7 -0
- package/languages/ru-RU.js +7 -0
- package/languages/sr-SP.js +7 -0
- package/languages/zh-CN.js +7 -0
- package/languages/zh-TW.js +7 -0
- package/package.json +3 -2
- package/pluginHooks.js +16 -6
- package/pluginHooks.mjs +15 -3
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/copyPaste/copyableRanges.js +25 -31
- package/plugins/copyPaste/copyableRanges.mjs +18 -24
- package/plugins/customBorders/customBorders.d.ts +2 -0
- package/plugins/filters/filters.js +5 -0
- package/plugins/filters/filters.mjs +5 -0
- package/plugins/formulas/engine/register.js +9 -0
- package/plugins/formulas/engine/register.mjs +13 -4
- package/plugins/formulas/engine/settings.js +18 -3
- package/plugins/formulas/engine/settings.mjs +16 -3
- package/plugins/formulas/formulas.js +274 -155
- package/plugins/formulas/formulas.mjs +274 -156
- package/plugins/formulas/indexSyncer/axisSyncer.js +379 -0
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +374 -0
- package/plugins/formulas/indexSyncer/index.js +225 -0
- package/plugins/formulas/indexSyncer/index.mjs +219 -0
- package/plugins/formulas/utils.js +81 -0
- package/plugins/formulas/utils.mjs +74 -0
- package/plugins/manualRowMove/manualRowMove.js +26 -11
- package/plugins/manualRowMove/manualRowMove.mjs +27 -12
- package/plugins/nestedHeaders/stateManager/headersTree.js +23 -26
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +20 -23
- package/plugins/nestedHeaders/stateManager/index.js +3 -3
- package/plugins/nestedHeaders/stateManager/matrixGenerator.js +1 -0
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.js +30 -35
- package/plugins/nestedHeaders/utils/ghostTable.mjs +30 -35
- package/plugins/registry.js +3 -1
- package/plugins/undoRedo/undoRedo.js +0 -1
- package/plugins/undoRedo/undoRedo.mjs +0 -1
- package/selection/highlight/visualSelection.js +5 -6
- package/selection/highlight/visualSelection.mjs +5 -6
- package/tableView.js +62 -72
- package/tableView.mjs +62 -72
- package/translations/changesObservable/observable.js +41 -46
- package/translations/changesObservable/observable.mjs +36 -41
- package/translations/changesObservable/observer.js +1 -1
- package/translations/indexMapper.js +21 -0
- package/translations/indexMapper.mjs +21 -0
- package/utils/dataStructures/tree.js +15 -18
- package/utils/dataStructures/tree.mjs +15 -18
- package/utils/parseTable.js +5 -1
- package/utils/parseTable.mjs +5 -1
@@ -31,11 +31,6 @@ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) {
|
|
31
31
|
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
32
32
|
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
33
33
|
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; } }
|
34
|
-
var _observers = /*#__PURE__*/new WeakMap();
|
35
|
-
var _indexMatrix = /*#__PURE__*/new WeakMap();
|
36
|
-
var _currentIndexState = /*#__PURE__*/new WeakMap();
|
37
|
-
var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
|
38
|
-
var _initialIndexValue = /*#__PURE__*/new WeakMap();
|
39
34
|
/**
|
40
35
|
* The ChangesObservable module is an object that represents a resource that provides
|
41
36
|
* the ability to observe the changes that happened in the index map indexes during
|
@@ -44,68 +39,68 @@ var _initialIndexValue = /*#__PURE__*/new WeakMap();
|
|
44
39
|
* @private
|
45
40
|
* @class ChangesObservable
|
46
41
|
*/
|
42
|
+
var _observers = /*#__PURE__*/new WeakMap();
|
43
|
+
var _indexMatrix = /*#__PURE__*/new WeakMap();
|
44
|
+
var _currentIndexState = /*#__PURE__*/new WeakMap();
|
45
|
+
var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
|
46
|
+
var _initialIndexValue = /*#__PURE__*/new WeakMap();
|
47
47
|
var ChangesObservable = /*#__PURE__*/function () {
|
48
|
-
/**
|
49
|
-
* The list of registered ChangesObserver instances.
|
50
|
-
*
|
51
|
-
* @type {ChangesObserver[]}
|
52
|
-
*/
|
53
|
-
|
54
|
-
/**
|
55
|
-
* An array with default values that act as a base array that will be compared with
|
56
|
-
* the last saved index state. The changes are generated and immediately send through
|
57
|
-
* the newly created ChangesObserver object. Thanks to that, the observer initially has
|
58
|
-
* all information about what indexes are currently changed.
|
59
|
-
*
|
60
|
-
* @type {Array}
|
61
|
-
*/
|
62
|
-
|
63
|
-
/**
|
64
|
-
* An array that holds the indexes state that is currently valid. The value is changed on every
|
65
|
-
* index mapper cache update.
|
66
|
-
*
|
67
|
-
* @type {Array}
|
68
|
-
*/
|
69
|
-
|
70
|
-
/**
|
71
|
-
* The flag determines if the observable is initialized or not. Not initialized object creates
|
72
|
-
* index matrix once while emitting new changes.
|
73
|
-
*
|
74
|
-
* @type {boolean}
|
75
|
-
*/
|
76
|
-
|
77
|
-
/**
|
78
|
-
* The initial index value allows control from what value the index matrix array will be created.
|
79
|
-
* Changing that value changes how the array diff generates the changes for the initial data
|
80
|
-
* sent to the subscribers. For example, the changes can be triggered by detecting the changes
|
81
|
-
* from `false` to `true` value or vice versa. Generally, it depends on which index map type
|
82
|
-
* the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
|
83
|
-
* values. For various index maps, it can be anything, but I suspect that the most appropriate
|
84
|
-
* initial value will be "undefined" in that case.
|
85
|
-
*
|
86
|
-
* @type {boolean}
|
87
|
-
*/
|
88
|
-
|
89
48
|
function ChangesObservable() {
|
90
49
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
91
50
|
initialIndexValue = _ref.initialIndexValue;
|
92
51
|
_classCallCheck(this, ChangesObservable);
|
52
|
+
/**
|
53
|
+
* The list of registered ChangesObserver instances.
|
54
|
+
*
|
55
|
+
* @type {ChangesObserver[]}
|
56
|
+
*/
|
93
57
|
_classPrivateFieldInitSpec(this, _observers, {
|
94
58
|
writable: true,
|
95
59
|
value: new Set()
|
96
60
|
});
|
61
|
+
/**
|
62
|
+
* An array with default values that act as a base array that will be compared with
|
63
|
+
* the last saved index state. The changes are generated and immediately send through
|
64
|
+
* the newly created ChangesObserver object. Thanks to that, the observer initially has
|
65
|
+
* all information about what indexes are currently changed.
|
66
|
+
*
|
67
|
+
* @type {Array}
|
68
|
+
*/
|
97
69
|
_classPrivateFieldInitSpec(this, _indexMatrix, {
|
98
70
|
writable: true,
|
99
71
|
value: []
|
100
72
|
});
|
73
|
+
/**
|
74
|
+
* An array that holds the indexes state that is currently valid. The value is changed on every
|
75
|
+
* index mapper cache update.
|
76
|
+
*
|
77
|
+
* @type {Array}
|
78
|
+
*/
|
101
79
|
_classPrivateFieldInitSpec(this, _currentIndexState, {
|
102
80
|
writable: true,
|
103
81
|
value: []
|
104
82
|
});
|
83
|
+
/**
|
84
|
+
* The flag determines if the observable is initialized or not. Not initialized object creates
|
85
|
+
* index matrix once while emitting new changes.
|
86
|
+
*
|
87
|
+
* @type {boolean}
|
88
|
+
*/
|
105
89
|
_classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
|
106
90
|
writable: true,
|
107
91
|
value: false
|
108
92
|
});
|
93
|
+
/**
|
94
|
+
* The initial index value allows control from what value the index matrix array will be created.
|
95
|
+
* Changing that value changes how the array diff generates the changes for the initial data
|
96
|
+
* sent to the subscribers. For example, the changes can be triggered by detecting the changes
|
97
|
+
* from `false` to `true` value or vice versa. Generally, it depends on which index map type
|
98
|
+
* the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
|
99
|
+
* values. For various index maps, it can be anything, but I suspect that the most appropriate
|
100
|
+
* initial value will be "undefined" in that case.
|
101
|
+
*
|
102
|
+
* @type {boolean}
|
103
|
+
*/
|
109
104
|
_classPrivateFieldInitSpec(this, _initialIndexValue, {
|
110
105
|
writable: true,
|
111
106
|
value: false
|
@@ -41,67 +41,62 @@ var _currentIndexState = /*#__PURE__*/new WeakMap();
|
|
41
41
|
var _isMatrixIndexesInitialized = /*#__PURE__*/new WeakMap();
|
42
42
|
var _initialIndexValue = /*#__PURE__*/new WeakMap();
|
43
43
|
export var ChangesObservable = /*#__PURE__*/function () {
|
44
|
-
/**
|
45
|
-
* The list of registered ChangesObserver instances.
|
46
|
-
*
|
47
|
-
* @type {ChangesObserver[]}
|
48
|
-
*/
|
49
|
-
|
50
|
-
/**
|
51
|
-
* An array with default values that act as a base array that will be compared with
|
52
|
-
* the last saved index state. The changes are generated and immediately send through
|
53
|
-
* the newly created ChangesObserver object. Thanks to that, the observer initially has
|
54
|
-
* all information about what indexes are currently changed.
|
55
|
-
*
|
56
|
-
* @type {Array}
|
57
|
-
*/
|
58
|
-
|
59
|
-
/**
|
60
|
-
* An array that holds the indexes state that is currently valid. The value is changed on every
|
61
|
-
* index mapper cache update.
|
62
|
-
*
|
63
|
-
* @type {Array}
|
64
|
-
*/
|
65
|
-
|
66
|
-
/**
|
67
|
-
* The flag determines if the observable is initialized or not. Not initialized object creates
|
68
|
-
* index matrix once while emitting new changes.
|
69
|
-
*
|
70
|
-
* @type {boolean}
|
71
|
-
*/
|
72
|
-
|
73
|
-
/**
|
74
|
-
* The initial index value allows control from what value the index matrix array will be created.
|
75
|
-
* Changing that value changes how the array diff generates the changes for the initial data
|
76
|
-
* sent to the subscribers. For example, the changes can be triggered by detecting the changes
|
77
|
-
* from `false` to `true` value or vice versa. Generally, it depends on which index map type
|
78
|
-
* the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
|
79
|
-
* values. For various index maps, it can be anything, but I suspect that the most appropriate
|
80
|
-
* initial value will be "undefined" in that case.
|
81
|
-
*
|
82
|
-
* @type {boolean}
|
83
|
-
*/
|
84
|
-
|
85
44
|
function ChangesObservable() {
|
86
45
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
87
46
|
initialIndexValue = _ref.initialIndexValue;
|
88
47
|
_classCallCheck(this, ChangesObservable);
|
48
|
+
/**
|
49
|
+
* The list of registered ChangesObserver instances.
|
50
|
+
*
|
51
|
+
* @type {ChangesObserver[]}
|
52
|
+
*/
|
89
53
|
_classPrivateFieldInitSpec(this, _observers, {
|
90
54
|
writable: true,
|
91
55
|
value: new Set()
|
92
56
|
});
|
57
|
+
/**
|
58
|
+
* An array with default values that act as a base array that will be compared with
|
59
|
+
* the last saved index state. The changes are generated and immediately send through
|
60
|
+
* the newly created ChangesObserver object. Thanks to that, the observer initially has
|
61
|
+
* all information about what indexes are currently changed.
|
62
|
+
*
|
63
|
+
* @type {Array}
|
64
|
+
*/
|
93
65
|
_classPrivateFieldInitSpec(this, _indexMatrix, {
|
94
66
|
writable: true,
|
95
67
|
value: []
|
96
68
|
});
|
69
|
+
/**
|
70
|
+
* An array that holds the indexes state that is currently valid. The value is changed on every
|
71
|
+
* index mapper cache update.
|
72
|
+
*
|
73
|
+
* @type {Array}
|
74
|
+
*/
|
97
75
|
_classPrivateFieldInitSpec(this, _currentIndexState, {
|
98
76
|
writable: true,
|
99
77
|
value: []
|
100
78
|
});
|
79
|
+
/**
|
80
|
+
* The flag determines if the observable is initialized or not. Not initialized object creates
|
81
|
+
* index matrix once while emitting new changes.
|
82
|
+
*
|
83
|
+
* @type {boolean}
|
84
|
+
*/
|
101
85
|
_classPrivateFieldInitSpec(this, _isMatrixIndexesInitialized, {
|
102
86
|
writable: true,
|
103
87
|
value: false
|
104
88
|
});
|
89
|
+
/**
|
90
|
+
* The initial index value allows control from what value the index matrix array will be created.
|
91
|
+
* Changing that value changes how the array diff generates the changes for the initial data
|
92
|
+
* sent to the subscribers. For example, the changes can be triggered by detecting the changes
|
93
|
+
* from `false` to `true` value or vice versa. Generally, it depends on which index map type
|
94
|
+
* the Observable will work with. For "hiding" or "trimming" index types, it will be boolean
|
95
|
+
* values. For various index maps, it can be anything, but I suspect that the most appropriate
|
96
|
+
* initial value will be "undefined" in that case.
|
97
|
+
*
|
98
|
+
* @type {boolean}
|
99
|
+
*/
|
105
100
|
_classPrivateFieldInitSpec(this, _initialIndexValue, {
|
106
101
|
writable: true,
|
107
102
|
value: false
|
@@ -29,13 +29,13 @@ function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.
|
|
29
29
|
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
30
30
|
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
31
31
|
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
32
|
-
var _currentInitialChanges = /*#__PURE__*/new WeakMap();
|
33
32
|
/**
|
34
33
|
* The ChangesObserver module is an object that represents a disposable resource
|
35
34
|
* provided by the ChangesObservable module.
|
36
35
|
*
|
37
36
|
* @class ChangesObserver
|
38
37
|
*/
|
38
|
+
var _currentInitialChanges = /*#__PURE__*/new WeakMap();
|
39
39
|
var ChangesObserver = /*#__PURE__*/function () {
|
40
40
|
function ChangesObserver() {
|
41
41
|
_classCallCheck(this, ChangesObserver);
|
@@ -160,6 +160,12 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
160
160
|
* @type {boolean}
|
161
161
|
*/
|
162
162
|
this.indexesSequenceChanged = false;
|
163
|
+
/**
|
164
|
+
* Flag informing about source of the change.
|
165
|
+
*
|
166
|
+
* @type {undefined|string}
|
167
|
+
*/
|
168
|
+
this.indexesChangeSource = void 0;
|
163
169
|
/**
|
164
170
|
* Flag determining whether any action on trimmed indexes has been performed. It's used for cache management.
|
165
171
|
*
|
@@ -200,6 +206,7 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
200
206
|
|
201
207
|
// Sequence of stored indexes might change.
|
202
208
|
_this.updateCache();
|
209
|
+
_this.runLocalHooks('indexesSequenceChange', _this.indexesChangeSource);
|
203
210
|
_this.runLocalHooks('change', _this.indexesSequence, null);
|
204
211
|
});
|
205
212
|
this.trimmingMapsCollection.addLocalHook('change', function (changedMap) {
|
@@ -520,7 +527,9 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
520
527
|
this.notTrimmedIndexesCache = _toConsumableArray(new Array(length).keys());
|
521
528
|
this.notHiddenIndexesCache = _toConsumableArray(new Array(length).keys());
|
522
529
|
this.suspendOperations();
|
530
|
+
this.indexesChangeSource = 'init';
|
523
531
|
this.indexesSequence.init(length);
|
532
|
+
this.indexesChangeSource = void 0;
|
524
533
|
this.trimmingMapsCollection.initEvery(length);
|
525
534
|
this.resumeOperations();
|
526
535
|
|
@@ -572,7 +581,13 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
572
581
|
}, {
|
573
582
|
key: "setIndexesSequence",
|
574
583
|
value: function setIndexesSequence(indexes) {
|
584
|
+
if (this.indexesChangeSource === void 0) {
|
585
|
+
this.indexesChangeSource = 'update';
|
586
|
+
}
|
575
587
|
this.indexesSequence.setValues(indexes);
|
588
|
+
if (this.indexesChangeSource === 'update') {
|
589
|
+
this.indexesChangeSource = void 0;
|
590
|
+
}
|
576
591
|
}
|
577
592
|
|
578
593
|
/**
|
@@ -722,9 +737,11 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
722
737
|
})[finalIndex];
|
723
738
|
destinationPosition = listWithRemovedItems.indexOf(physicalIndex);
|
724
739
|
}
|
740
|
+
this.indexesChangeSource = 'move';
|
725
741
|
|
726
742
|
// Adding indexes without re-indexing.
|
727
743
|
this.setIndexesSequence((0, _maps.getListWithInsertedItems)(listWithRemovedItems, destinationPosition, physicalMovedIndexes));
|
744
|
+
this.indexesChangeSource = void 0;
|
728
745
|
}
|
729
746
|
|
730
747
|
/**
|
@@ -768,7 +785,9 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
768
785
|
return nextIndex + stepsFromStart;
|
769
786
|
});
|
770
787
|
this.suspendOperations();
|
788
|
+
this.indexesChangeSource = 'insert';
|
771
789
|
this.indexesSequence.insert(insertionIndex, insertedIndexes);
|
790
|
+
this.indexesChangeSource = void 0;
|
772
791
|
this.trimmingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
|
773
792
|
this.hidingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
|
774
793
|
this.variousMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
|
@@ -785,7 +804,9 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
785
804
|
key: "removeIndexes",
|
786
805
|
value: function removeIndexes(removedIndexes) {
|
787
806
|
this.suspendOperations();
|
807
|
+
this.indexesChangeSource = 'remove';
|
788
808
|
this.indexesSequence.remove(removedIndexes);
|
809
|
+
this.indexesChangeSource = void 0;
|
789
810
|
this.trimmingMapsCollection.removeFromEvery(removedIndexes);
|
790
811
|
this.hidingMapsCollection.removeFromEvery(removedIndexes);
|
791
812
|
this.variousMapsCollection.removeFromEvery(removedIndexes);
|
@@ -155,6 +155,12 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
155
155
|
* @type {boolean}
|
156
156
|
*/
|
157
157
|
this.indexesSequenceChanged = false;
|
158
|
+
/**
|
159
|
+
* Flag informing about source of the change.
|
160
|
+
*
|
161
|
+
* @type {undefined|string}
|
162
|
+
*/
|
163
|
+
this.indexesChangeSource = void 0;
|
158
164
|
/**
|
159
165
|
* Flag determining whether any action on trimmed indexes has been performed. It's used for cache management.
|
160
166
|
*
|
@@ -195,6 +201,7 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
195
201
|
|
196
202
|
// Sequence of stored indexes might change.
|
197
203
|
_this.updateCache();
|
204
|
+
_this.runLocalHooks('indexesSequenceChange', _this.indexesChangeSource);
|
198
205
|
_this.runLocalHooks('change', _this.indexesSequence, null);
|
199
206
|
});
|
200
207
|
this.trimmingMapsCollection.addLocalHook('change', function (changedMap) {
|
@@ -515,7 +522,9 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
515
522
|
this.notTrimmedIndexesCache = _toConsumableArray(new Array(length).keys());
|
516
523
|
this.notHiddenIndexesCache = _toConsumableArray(new Array(length).keys());
|
517
524
|
this.suspendOperations();
|
525
|
+
this.indexesChangeSource = 'init';
|
518
526
|
this.indexesSequence.init(length);
|
527
|
+
this.indexesChangeSource = void 0;
|
519
528
|
this.trimmingMapsCollection.initEvery(length);
|
520
529
|
this.resumeOperations();
|
521
530
|
|
@@ -567,7 +576,13 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
567
576
|
}, {
|
568
577
|
key: "setIndexesSequence",
|
569
578
|
value: function setIndexesSequence(indexes) {
|
579
|
+
if (this.indexesChangeSource === void 0) {
|
580
|
+
this.indexesChangeSource = 'update';
|
581
|
+
}
|
570
582
|
this.indexesSequence.setValues(indexes);
|
583
|
+
if (this.indexesChangeSource === 'update') {
|
584
|
+
this.indexesChangeSource = void 0;
|
585
|
+
}
|
571
586
|
}
|
572
587
|
|
573
588
|
/**
|
@@ -717,9 +732,11 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
717
732
|
})[finalIndex];
|
718
733
|
destinationPosition = listWithRemovedItems.indexOf(physicalIndex);
|
719
734
|
}
|
735
|
+
this.indexesChangeSource = 'move';
|
720
736
|
|
721
737
|
// Adding indexes without re-indexing.
|
722
738
|
this.setIndexesSequence(getListWithInsertedItems(listWithRemovedItems, destinationPosition, physicalMovedIndexes));
|
739
|
+
this.indexesChangeSource = void 0;
|
723
740
|
}
|
724
741
|
|
725
742
|
/**
|
@@ -763,7 +780,9 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
763
780
|
return nextIndex + stepsFromStart;
|
764
781
|
});
|
765
782
|
this.suspendOperations();
|
783
|
+
this.indexesChangeSource = 'insert';
|
766
784
|
this.indexesSequence.insert(insertionIndex, insertedIndexes);
|
785
|
+
this.indexesChangeSource = void 0;
|
767
786
|
this.trimmingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
|
768
787
|
this.hidingMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
|
769
788
|
this.variousMapsCollection.insertToEvery(insertionIndex, insertedIndexes);
|
@@ -780,7 +799,9 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
780
799
|
key: "removeIndexes",
|
781
800
|
value: function removeIndexes(removedIndexes) {
|
782
801
|
this.suspendOperations();
|
802
|
+
this.indexesChangeSource = 'remove';
|
783
803
|
this.indexesSequence.remove(removedIndexes);
|
804
|
+
this.indexesChangeSource = void 0;
|
784
805
|
this.trimmingMapsCollection.removeFromEvery(removedIndexes);
|
785
806
|
this.hidingMapsCollection.removeFromEvery(removedIndexes);
|
786
807
|
this.variousMapsCollection.removeFromEvery(removedIndexes);
|
@@ -130,28 +130,25 @@ var TRAVERSAL_STRATEGIES = new Map([[TRAVERSAL_DF_PRE, depthFirstPreOrder], [TRA
|
|
130
130
|
*
|
131
131
|
*/
|
132
132
|
var TreeNode = /*#__PURE__*/function () {
|
133
|
-
/**
|
134
|
-
* A tree data.
|
135
|
-
*
|
136
|
-
* @type {object}
|
137
|
-
*/
|
138
|
-
|
139
|
-
/**
|
140
|
-
* A parent node.
|
141
|
-
*
|
142
|
-
* @type {TreeNode}
|
143
|
-
*/
|
144
|
-
|
145
|
-
/**
|
146
|
-
* A tree leaves.
|
147
|
-
*
|
148
|
-
* @type {TreeNode[]}
|
149
|
-
*/
|
150
|
-
|
151
133
|
function TreeNode(data) {
|
152
134
|
_classCallCheck(this, TreeNode);
|
135
|
+
/**
|
136
|
+
* A tree data.
|
137
|
+
*
|
138
|
+
* @type {object}
|
139
|
+
*/
|
153
140
|
_defineProperty(this, "data", {});
|
141
|
+
/**
|
142
|
+
* A parent node.
|
143
|
+
*
|
144
|
+
* @type {TreeNode}
|
145
|
+
*/
|
154
146
|
_defineProperty(this, "parent", null);
|
147
|
+
/**
|
148
|
+
* A tree leaves.
|
149
|
+
*
|
150
|
+
* @type {TreeNode[]}
|
151
|
+
*/
|
155
152
|
_defineProperty(this, "childs", []);
|
156
153
|
this.data = data;
|
157
154
|
}
|
@@ -122,28 +122,25 @@ var TRAVERSAL_STRATEGIES = new Map([[TRAVERSAL_DF_PRE, depthFirstPreOrder], [TRA
|
|
122
122
|
*
|
123
123
|
*/
|
124
124
|
var TreeNode = /*#__PURE__*/function () {
|
125
|
-
/**
|
126
|
-
* A tree data.
|
127
|
-
*
|
128
|
-
* @type {object}
|
129
|
-
*/
|
130
|
-
|
131
|
-
/**
|
132
|
-
* A parent node.
|
133
|
-
*
|
134
|
-
* @type {TreeNode}
|
135
|
-
*/
|
136
|
-
|
137
|
-
/**
|
138
|
-
* A tree leaves.
|
139
|
-
*
|
140
|
-
* @type {TreeNode[]}
|
141
|
-
*/
|
142
|
-
|
143
125
|
function TreeNode(data) {
|
144
126
|
_classCallCheck(this, TreeNode);
|
127
|
+
/**
|
128
|
+
* A tree data.
|
129
|
+
*
|
130
|
+
* @type {object}
|
131
|
+
*/
|
145
132
|
_defineProperty(this, "data", {});
|
133
|
+
/**
|
134
|
+
* A parent node.
|
135
|
+
*
|
136
|
+
* @type {TreeNode}
|
137
|
+
*/
|
146
138
|
_defineProperty(this, "parent", null);
|
139
|
+
/**
|
140
|
+
* A tree leaves.
|
141
|
+
*
|
142
|
+
* @type {TreeNode[]}
|
143
|
+
*/
|
147
144
|
_defineProperty(this, "childs", []);
|
148
145
|
this.data = data;
|
149
146
|
}
|
package/utils/parseTable.js
CHANGED
@@ -21,6 +21,7 @@ require("core-js/modules/es.string.replace.js");
|
|
21
21
|
require("core-js/modules/es.object.to-string.js");
|
22
22
|
require("core-js/modules/es.array.concat.js");
|
23
23
|
require("core-js/modules/es.array.splice.js");
|
24
|
+
require("core-js/modules/es.string.repeat.js");
|
24
25
|
require("core-js/modules/es.string.match.js");
|
25
26
|
require("core-js/modules/es.array.last-index-of.js");
|
26
27
|
require("core-js/modules/es.array.reduce.js");
|
@@ -139,7 +140,10 @@ function _dataToHTML(input) {
|
|
139
140
|
}
|
140
141
|
for (var column = 0; column < columnsLen; column += 1) {
|
141
142
|
var cellData = rowData[column];
|
142
|
-
var parsedCellData = (0, _mixed.isEmpty)(cellData) ? '' : cellData.toString().replace(/</g, '<').replace(/>/g, '>').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20/gi,
|
143
|
+
var parsedCellData = (0, _mixed.isEmpty)(cellData) ? '' : cellData.toString().replace(/</g, '<').replace(/>/g, '>').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20{2,}/gi, function (substring) {
|
144
|
+
// The way how Excel serializes data with at least two spaces.
|
145
|
+
return "<span style=\"mso-spacerun: yes\">".concat(' '.repeat(substring.length - 1), " </span>");
|
146
|
+
}).replace(/\t/gi, '	');
|
143
147
|
columnsResult.push("<td>".concat(parsedCellData, "</td>"));
|
144
148
|
}
|
145
149
|
result.push.apply(result, ['<tr>'].concat(columnsResult, ['</tr>']));
|
package/utils/parseTable.mjs
CHANGED
@@ -14,6 +14,7 @@ import "core-js/modules/es.string.replace.js";
|
|
14
14
|
import "core-js/modules/es.object.to-string.js";
|
15
15
|
import "core-js/modules/es.array.concat.js";
|
16
16
|
import "core-js/modules/es.array.splice.js";
|
17
|
+
import "core-js/modules/es.string.repeat.js";
|
17
18
|
import "core-js/modules/es.string.match.js";
|
18
19
|
import "core-js/modules/es.array.last-index-of.js";
|
19
20
|
import "core-js/modules/es.array.reduce.js";
|
@@ -133,7 +134,10 @@ export function _dataToHTML(input) {
|
|
133
134
|
}
|
134
135
|
for (var column = 0; column < columnsLen; column += 1) {
|
135
136
|
var cellData = rowData[column];
|
136
|
-
var parsedCellData = isEmpty(cellData) ? '' : cellData.toString().replace(/</g, '<').replace(/>/g, '>').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20/gi,
|
137
|
+
var parsedCellData = isEmpty(cellData) ? '' : cellData.toString().replace(/</g, '<').replace(/>/g, '>').replace(/(<br(\s*|\/)>(\r\n|\n)?|\r\n|\n)/g, '<br>\r\n').replace(/\x20{2,}/gi, function (substring) {
|
138
|
+
// The way how Excel serializes data with at least two spaces.
|
139
|
+
return "<span style=\"mso-spacerun: yes\">".concat(' '.repeat(substring.length - 1), " </span>");
|
140
|
+
}).replace(/\t/gi, '	');
|
137
141
|
columnsResult.push("<td>".concat(parsedCellData, "</td>"));
|
138
142
|
}
|
139
143
|
result.push.apply(result, ['<tr>'].concat(columnsResult, ['</tr>']));
|