handsontable 12.3.3 → 12.4.0-next-acb5d99-20230512
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/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/core/_base.js +16 -20
- package/3rdparty/walkontable/src/core/_base.mjs +16 -20
- 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 +7364 -5992
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +256 -234
- package/dist/handsontable.js +4326 -3275
- 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/editors/autocompleteEditor/autocompleteEditor.js +8 -9
- package/editors/autocompleteEditor/autocompleteEditor.mjs +8 -9
- 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/base/base.js +9 -10
- package/plugins/base/base.mjs +9 -10
- package/plugins/collapsibleColumns/collapsibleColumns.js +24 -7
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +24 -7
- package/plugins/copyPaste/copyPaste.js +92 -16
- package/plugins/copyPaste/copyPaste.mjs +92 -16
- package/plugins/copyPaste/copyableRanges.js +39 -39
- package/plugins/copyPaste/copyableRanges.mjs +32 -32
- package/plugins/customBorders/customBorders.d.ts +2 -0
- package/plugins/customBorders/customBorders.js +6 -7
- package/plugins/customBorders/customBorders.mjs +6 -7
- 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 +308 -162
- package/plugins/formulas/formulas.mjs +308 -163
- 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/hiddenColumns/hiddenColumns.js +12 -7
- package/plugins/hiddenColumns/hiddenColumns.mjs +12 -7
- package/plugins/hiddenRows/hiddenRows.js +12 -7
- package/plugins/hiddenRows/hiddenRows.mjs +12 -7
- package/plugins/manualRowMove/manualRowMove.js +26 -11
- package/plugins/manualRowMove/manualRowMove.mjs +27 -12
- package/plugins/nestedHeaders/nestedHeaders.js +26 -7
- package/plugins/nestedHeaders/nestedHeaders.mjs +26 -7
- package/plugins/nestedHeaders/stateManager/headersTree.js +23 -26
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +20 -23
- package/plugins/nestedHeaders/stateManager/index.js +21 -3
- package/plugins/nestedHeaders/stateManager/index.mjs +18 -0
- package/plugins/nestedHeaders/stateManager/matrixGenerator.js +1 -0
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.js +1 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -0
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -0
- 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 +8 -1
- package/translations/changesObservable/observer.mjs +7 -0
- package/translations/indexMapper.js +21 -0
- package/translations/indexMapper.mjs +21 -0
- package/translations/maps/linkedPhysicalIndexToValueMap.js +6 -0
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +6 -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
package/tableView.js
CHANGED
@@ -58,98 +58,88 @@ var privatePool = new WeakMap();
|
|
58
58
|
var _columnHeadersCount = /*#__PURE__*/new WeakMap();
|
59
59
|
var _rowHeadersCount = /*#__PURE__*/new WeakMap();
|
60
60
|
var TableView = /*#__PURE__*/function () {
|
61
|
-
/**
|
62
|
-
* Instance of {@link Handsontable}.
|
63
|
-
*
|
64
|
-
* @private
|
65
|
-
* @type {Handsontable}
|
66
|
-
*/
|
67
|
-
|
68
|
-
/**
|
69
|
-
* Instance of {@link EventManager}.
|
70
|
-
*
|
71
|
-
* @private
|
72
|
-
* @type {EventManager}
|
73
|
-
*/
|
74
|
-
|
75
|
-
/**
|
76
|
-
* Current Handsontable's GridSettings object.
|
77
|
-
*
|
78
|
-
* @private
|
79
|
-
* @type {GridSettings}
|
80
|
-
*/
|
81
|
-
|
82
|
-
/**
|
83
|
-
* Main <THEAD> element.
|
84
|
-
*
|
85
|
-
* @private
|
86
|
-
* @type {HTMLTableSectionElement}
|
87
|
-
*/
|
88
|
-
|
89
|
-
/**
|
90
|
-
* Main <TBODY> element.
|
91
|
-
*
|
92
|
-
* @private
|
93
|
-
* @type {HTMLTableSectionElement}
|
94
|
-
*/
|
95
|
-
|
96
|
-
/**
|
97
|
-
* Main Walkontable instance.
|
98
|
-
*
|
99
|
-
* @private
|
100
|
-
* @type {Walkontable}
|
101
|
-
*/
|
102
|
-
|
103
|
-
/**
|
104
|
-
* Main Walkontable instance.
|
105
|
-
*
|
106
|
-
* @private
|
107
|
-
* @type {Walkontable}
|
108
|
-
*/
|
109
|
-
|
110
|
-
/**
|
111
|
-
* The total number of the column header renderers applied to the table through the
|
112
|
-
* `afterGetColumnHeaderRenderers` hook.
|
113
|
-
*
|
114
|
-
* @type {number}
|
115
|
-
*/
|
116
|
-
|
117
|
-
/**
|
118
|
-
* The total number of the row header renderers applied to the table through the
|
119
|
-
* `afterGetRowHeaderRenderers` hook.
|
120
|
-
*
|
121
|
-
* @type {number}
|
122
|
-
*/
|
123
|
-
|
124
|
-
/**
|
125
|
-
* The flag determines if the `adjustElementsSize` method call was made during
|
126
|
-
* the render suspending. If true, the method has to be triggered once after render
|
127
|
-
* resuming.
|
128
|
-
*
|
129
|
-
* @private
|
130
|
-
* @type {boolean}
|
131
|
-
*/
|
132
|
-
|
133
61
|
/**
|
134
62
|
* @param {Hanstontable} instance Instance of {@link Handsontable}.
|
135
63
|
*/
|
136
64
|
function TableView(instance) {
|
137
65
|
_classCallCheck(this, TableView);
|
66
|
+
/**
|
67
|
+
* Instance of {@link Handsontable}.
|
68
|
+
*
|
69
|
+
* @private
|
70
|
+
* @type {Handsontable}
|
71
|
+
*/
|
138
72
|
_defineProperty(this, "instance", void 0);
|
73
|
+
/**
|
74
|
+
* Instance of {@link EventManager}.
|
75
|
+
*
|
76
|
+
* @private
|
77
|
+
* @type {EventManager}
|
78
|
+
*/
|
139
79
|
_defineProperty(this, "eventManager", void 0);
|
80
|
+
/**
|
81
|
+
* Current Handsontable's GridSettings object.
|
82
|
+
*
|
83
|
+
* @private
|
84
|
+
* @type {GridSettings}
|
85
|
+
*/
|
140
86
|
_defineProperty(this, "settings", void 0);
|
87
|
+
/**
|
88
|
+
* Main <THEAD> element.
|
89
|
+
*
|
90
|
+
* @private
|
91
|
+
* @type {HTMLTableSectionElement}
|
92
|
+
*/
|
141
93
|
_defineProperty(this, "THEAD", void 0);
|
94
|
+
/**
|
95
|
+
* Main <TBODY> element.
|
96
|
+
*
|
97
|
+
* @private
|
98
|
+
* @type {HTMLTableSectionElement}
|
99
|
+
*/
|
142
100
|
_defineProperty(this, "TBODY", void 0);
|
101
|
+
/**
|
102
|
+
* Main Walkontable instance.
|
103
|
+
*
|
104
|
+
* @private
|
105
|
+
* @type {Walkontable}
|
106
|
+
*/
|
143
107
|
_defineProperty(this, "_wt", void 0);
|
108
|
+
/**
|
109
|
+
* Main Walkontable instance.
|
110
|
+
*
|
111
|
+
* @private
|
112
|
+
* @type {Walkontable}
|
113
|
+
*/
|
144
114
|
_defineProperty(this, "activeWt", void 0);
|
115
|
+
/**
|
116
|
+
* The total number of the column header renderers applied to the table through the
|
117
|
+
* `afterGetColumnHeaderRenderers` hook.
|
118
|
+
*
|
119
|
+
* @type {number}
|
120
|
+
*/
|
145
121
|
_classPrivateFieldInitSpec(this, _columnHeadersCount, {
|
146
122
|
writable: true,
|
147
123
|
value: 0
|
148
124
|
});
|
125
|
+
/**
|
126
|
+
* The total number of the row header renderers applied to the table through the
|
127
|
+
* `afterGetRowHeaderRenderers` hook.
|
128
|
+
*
|
129
|
+
* @type {number}
|
130
|
+
*/
|
149
131
|
_classPrivateFieldInitSpec(this, _rowHeadersCount, {
|
150
132
|
writable: true,
|
151
133
|
value: 0
|
152
134
|
});
|
135
|
+
/**
|
136
|
+
* The flag determines if the `adjustElementsSize` method call was made during
|
137
|
+
* the render suspending. If true, the method has to be triggered once after render
|
138
|
+
* resuming.
|
139
|
+
*
|
140
|
+
* @private
|
141
|
+
* @type {boolean}
|
142
|
+
*/
|
153
143
|
_defineProperty(this, "postponedAdjustElementsSize", false);
|
154
144
|
this.instance = instance;
|
155
145
|
this.eventManager = new _eventManager.default(this.instance);
|
package/tableView.mjs
CHANGED
@@ -53,98 +53,88 @@ var privatePool = new WeakMap();
|
|
53
53
|
var _columnHeadersCount = /*#__PURE__*/new WeakMap();
|
54
54
|
var _rowHeadersCount = /*#__PURE__*/new WeakMap();
|
55
55
|
var TableView = /*#__PURE__*/function () {
|
56
|
-
/**
|
57
|
-
* Instance of {@link Handsontable}.
|
58
|
-
*
|
59
|
-
* @private
|
60
|
-
* @type {Handsontable}
|
61
|
-
*/
|
62
|
-
|
63
|
-
/**
|
64
|
-
* Instance of {@link EventManager}.
|
65
|
-
*
|
66
|
-
* @private
|
67
|
-
* @type {EventManager}
|
68
|
-
*/
|
69
|
-
|
70
|
-
/**
|
71
|
-
* Current Handsontable's GridSettings object.
|
72
|
-
*
|
73
|
-
* @private
|
74
|
-
* @type {GridSettings}
|
75
|
-
*/
|
76
|
-
|
77
|
-
/**
|
78
|
-
* Main <THEAD> element.
|
79
|
-
*
|
80
|
-
* @private
|
81
|
-
* @type {HTMLTableSectionElement}
|
82
|
-
*/
|
83
|
-
|
84
|
-
/**
|
85
|
-
* Main <TBODY> element.
|
86
|
-
*
|
87
|
-
* @private
|
88
|
-
* @type {HTMLTableSectionElement}
|
89
|
-
*/
|
90
|
-
|
91
|
-
/**
|
92
|
-
* Main Walkontable instance.
|
93
|
-
*
|
94
|
-
* @private
|
95
|
-
* @type {Walkontable}
|
96
|
-
*/
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Main Walkontable instance.
|
100
|
-
*
|
101
|
-
* @private
|
102
|
-
* @type {Walkontable}
|
103
|
-
*/
|
104
|
-
|
105
|
-
/**
|
106
|
-
* The total number of the column header renderers applied to the table through the
|
107
|
-
* `afterGetColumnHeaderRenderers` hook.
|
108
|
-
*
|
109
|
-
* @type {number}
|
110
|
-
*/
|
111
|
-
|
112
|
-
/**
|
113
|
-
* The total number of the row header renderers applied to the table through the
|
114
|
-
* `afterGetRowHeaderRenderers` hook.
|
115
|
-
*
|
116
|
-
* @type {number}
|
117
|
-
*/
|
118
|
-
|
119
|
-
/**
|
120
|
-
* The flag determines if the `adjustElementsSize` method call was made during
|
121
|
-
* the render suspending. If true, the method has to be triggered once after render
|
122
|
-
* resuming.
|
123
|
-
*
|
124
|
-
* @private
|
125
|
-
* @type {boolean}
|
126
|
-
*/
|
127
|
-
|
128
56
|
/**
|
129
57
|
* @param {Hanstontable} instance Instance of {@link Handsontable}.
|
130
58
|
*/
|
131
59
|
function TableView(instance) {
|
132
60
|
_classCallCheck(this, TableView);
|
61
|
+
/**
|
62
|
+
* Instance of {@link Handsontable}.
|
63
|
+
*
|
64
|
+
* @private
|
65
|
+
* @type {Handsontable}
|
66
|
+
*/
|
133
67
|
_defineProperty(this, "instance", void 0);
|
68
|
+
/**
|
69
|
+
* Instance of {@link EventManager}.
|
70
|
+
*
|
71
|
+
* @private
|
72
|
+
* @type {EventManager}
|
73
|
+
*/
|
134
74
|
_defineProperty(this, "eventManager", void 0);
|
75
|
+
/**
|
76
|
+
* Current Handsontable's GridSettings object.
|
77
|
+
*
|
78
|
+
* @private
|
79
|
+
* @type {GridSettings}
|
80
|
+
*/
|
135
81
|
_defineProperty(this, "settings", void 0);
|
82
|
+
/**
|
83
|
+
* Main <THEAD> element.
|
84
|
+
*
|
85
|
+
* @private
|
86
|
+
* @type {HTMLTableSectionElement}
|
87
|
+
*/
|
136
88
|
_defineProperty(this, "THEAD", void 0);
|
89
|
+
/**
|
90
|
+
* Main <TBODY> element.
|
91
|
+
*
|
92
|
+
* @private
|
93
|
+
* @type {HTMLTableSectionElement}
|
94
|
+
*/
|
137
95
|
_defineProperty(this, "TBODY", void 0);
|
96
|
+
/**
|
97
|
+
* Main Walkontable instance.
|
98
|
+
*
|
99
|
+
* @private
|
100
|
+
* @type {Walkontable}
|
101
|
+
*/
|
138
102
|
_defineProperty(this, "_wt", void 0);
|
103
|
+
/**
|
104
|
+
* Main Walkontable instance.
|
105
|
+
*
|
106
|
+
* @private
|
107
|
+
* @type {Walkontable}
|
108
|
+
*/
|
139
109
|
_defineProperty(this, "activeWt", void 0);
|
110
|
+
/**
|
111
|
+
* The total number of the column header renderers applied to the table through the
|
112
|
+
* `afterGetColumnHeaderRenderers` hook.
|
113
|
+
*
|
114
|
+
* @type {number}
|
115
|
+
*/
|
140
116
|
_classPrivateFieldInitSpec(this, _columnHeadersCount, {
|
141
117
|
writable: true,
|
142
118
|
value: 0
|
143
119
|
});
|
120
|
+
/**
|
121
|
+
* The total number of the row header renderers applied to the table through the
|
122
|
+
* `afterGetRowHeaderRenderers` hook.
|
123
|
+
*
|
124
|
+
* @type {number}
|
125
|
+
*/
|
144
126
|
_classPrivateFieldInitSpec(this, _rowHeadersCount, {
|
145
127
|
writable: true,
|
146
128
|
value: 0
|
147
129
|
});
|
130
|
+
/**
|
131
|
+
* The flag determines if the `adjustElementsSize` method call was made during
|
132
|
+
* the render suspending. If true, the method has to be triggered once after render
|
133
|
+
* resuming.
|
134
|
+
*
|
135
|
+
* @private
|
136
|
+
* @type {boolean}
|
137
|
+
*/
|
148
138
|
_defineProperty(this, "postponedAdjustElementsSize", false);
|
149
139
|
this.instance = instance;
|
150
140
|
this.eventManager = new EventManager(this.instance);
|
@@ -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,16 +29,23 @@ 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);
|
42
|
+
/**
|
43
|
+
* The field holds initial changes that will be used to notify the callbacks added using
|
44
|
+
* subscribe method. Regardless of the moment of listening for changes, the subscriber
|
45
|
+
* will be notified once with all changes made before subscribing.
|
46
|
+
*
|
47
|
+
* @type {Array}
|
48
|
+
*/
|
42
49
|
_classPrivateFieldInitSpec(this, _currentInitialChanges, {
|
43
50
|
writable: true,
|
44
51
|
value: []
|
@@ -34,6 +34,13 @@ var _currentInitialChanges = /*#__PURE__*/new WeakMap();
|
|
34
34
|
export var ChangesObserver = /*#__PURE__*/function () {
|
35
35
|
function ChangesObserver() {
|
36
36
|
_classCallCheck(this, ChangesObserver);
|
37
|
+
/**
|
38
|
+
* The field holds initial changes that will be used to notify the callbacks added using
|
39
|
+
* subscribe method. Regardless of the moment of listening for changes, the subscriber
|
40
|
+
* will be notified once with all changes made before subscribing.
|
41
|
+
*
|
42
|
+
* @type {Array}
|
43
|
+
*/
|
37
44
|
_classPrivateFieldInitSpec(this, _currentInitialChanges, {
|
38
45
|
writable: true,
|
39
46
|
value: []
|
@@ -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);
|