handsontable 0.0.0-next-1748170-20230317 → 0.0.0-next-94c1646-20230323
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/calculator/viewportColumns.js +2 -2
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +2 -2
- package/3rdparty/walkontable/src/core/_base.js +16 -20
- package/3rdparty/walkontable/src/core/_base.mjs +16 -20
- package/CHANGELOG.md +1156 -494
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +3598 -3080
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +240 -226
- package/dist/handsontable.js +313 -115
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- 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/package.json +1 -1
- 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 +14 -8
- package/plugins/copyPaste/copyableRanges.mjs +14 -8
- package/plugins/customBorders/customBorders.js +6 -7
- package/plugins/customBorders/customBorders.mjs +6 -7
- package/plugins/formulas/formulas.js +34 -7
- package/plugins/formulas/formulas.mjs +34 -7
- 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/nestedHeaders/nestedHeaders.js +26 -7
- package/plugins/nestedHeaders/nestedHeaders.mjs +26 -7
- package/plugins/nestedHeaders/stateManager/index.js +18 -0
- package/plugins/nestedHeaders/stateManager/index.mjs +18 -0
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -0
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -0
- package/translations/changesObservable/observer.js +7 -0
- package/translations/changesObservable/observer.mjs +7 -0
- package/translations/maps/linkedPhysicalIndexToValueMap.js +6 -0
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +6 -0
@@ -67,6 +67,14 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
67
67
|
*
|
68
68
|
* @type {string}
|
69
69
|
*/
|
70
|
+
/**
|
71
|
+
* Filters and sorts by relevance.
|
72
|
+
*
|
73
|
+
* @param {*} value The selected value.
|
74
|
+
* @param {string[]} choices The list of available choices.
|
75
|
+
* @param {boolean} caseSensitive Indicates if it's sorted by case.
|
76
|
+
* @returns {number[]} Array of indexes in original choices array.
|
77
|
+
*/
|
70
78
|
_defineProperty(_assertThisInitialized(_this), "sortByRelevance", function (value, choices, caseSensitive) {
|
71
79
|
var choicesRelevance = [];
|
72
80
|
var result = [];
|
@@ -569,15 +577,6 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
569
577
|
}
|
570
578
|
}
|
571
579
|
}
|
572
|
-
|
573
|
-
/**
|
574
|
-
* Filters and sorts by relevance.
|
575
|
-
*
|
576
|
-
* @param {*} value The selected value.
|
577
|
-
* @param {string[]} choices The list of available choices.
|
578
|
-
* @param {boolean} caseSensitive Indicates if it's sorted by case.
|
579
|
-
* @returns {number[]} Array of indexes in original choices array.
|
580
|
-
*/
|
581
580
|
}], [{
|
582
581
|
key: "EDITOR_TYPE",
|
583
582
|
get: function get() {
|
@@ -62,6 +62,14 @@ export var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
62
62
|
*
|
63
63
|
* @type {string}
|
64
64
|
*/
|
65
|
+
/**
|
66
|
+
* Filters and sorts by relevance.
|
67
|
+
*
|
68
|
+
* @param {*} value The selected value.
|
69
|
+
* @param {string[]} choices The list of available choices.
|
70
|
+
* @param {boolean} caseSensitive Indicates if it's sorted by case.
|
71
|
+
* @returns {number[]} Array of indexes in original choices array.
|
72
|
+
*/
|
65
73
|
_defineProperty(_assertThisInitialized(_this), "sortByRelevance", function (value, choices, caseSensitive) {
|
66
74
|
var choicesRelevance = [];
|
67
75
|
var result = [];
|
@@ -564,15 +572,6 @@ export var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
564
572
|
}
|
565
573
|
}
|
566
574
|
}
|
567
|
-
|
568
|
-
/**
|
569
|
-
* Filters and sorts by relevance.
|
570
|
-
*
|
571
|
-
* @param {*} value The selected value.
|
572
|
-
* @param {string[]} choices The list of available choices.
|
573
|
-
* @param {boolean} caseSensitive Indicates if it's sorted by case.
|
574
|
-
* @returns {number[]} Array of indexes in original choices array.
|
575
|
-
*/
|
576
575
|
}], [{
|
577
576
|
key: "EDITOR_TYPE",
|
578
577
|
get: function get() {
|
package/helpers/mixed.js
CHANGED
@@ -152,7 +152,7 @@ var domMessages = {
|
|
152
152
|
function _injectProductInfo(key, element) {
|
153
153
|
var hasValidType = !isEmpty(key);
|
154
154
|
var isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
155
|
-
var hotVersion = "0.0.0-next-
|
155
|
+
var hotVersion = "0.0.0-next-94c1646-20230323";
|
156
156
|
var keyValidityDate;
|
157
157
|
var consoleMessageState = 'invalid';
|
158
158
|
var domMessageState = 'invalid';
|
@@ -160,7 +160,7 @@ function _injectProductInfo(key, element) {
|
|
160
160
|
var schemaValidity = _checkKeySchema(key);
|
161
161
|
if (hasValidType || isNonCommercial || schemaValidity) {
|
162
162
|
if (schemaValidity) {
|
163
|
-
var releaseDate = (0, _moment.default)("
|
163
|
+
var releaseDate = (0, _moment.default)("23/03/2023", 'DD/MM/YYYY');
|
164
164
|
var releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
|
165
165
|
var keyValidityDays = _extractTime(key);
|
166
166
|
keyValidityDate = (0, _moment.default)((keyValidityDays + 1) * 8.64e7, 'x').format('MMMM DD, YYYY');
|
package/helpers/mixed.mjs
CHANGED
@@ -142,7 +142,7 @@ var domMessages = {
|
|
142
142
|
export function _injectProductInfo(key, element) {
|
143
143
|
var hasValidType = !isEmpty(key);
|
144
144
|
var isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
145
|
-
var hotVersion = "0.0.0-next-
|
145
|
+
var hotVersion = "0.0.0-next-94c1646-20230323";
|
146
146
|
var keyValidityDate;
|
147
147
|
var consoleMessageState = 'invalid';
|
148
148
|
var domMessageState = 'invalid';
|
@@ -150,7 +150,7 @@ export function _injectProductInfo(key, element) {
|
|
150
150
|
var schemaValidity = _checkKeySchema(key);
|
151
151
|
if (hasValidType || isNonCommercial || schemaValidity) {
|
152
152
|
if (schemaValidity) {
|
153
|
-
var releaseDate = moment("
|
153
|
+
var releaseDate = moment("23/03/2023", 'DD/MM/YYYY');
|
154
154
|
var releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
|
155
155
|
var keyValidityDays = _extractTime(key);
|
156
156
|
keyValidityDate = moment((keyValidityDays + 1) * 8.64e7, 'x').format('MMMM DD, YYYY');
|
package/package.json
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
"url": "https://github.com/handsontable/handsontable/issues"
|
11
11
|
},
|
12
12
|
"author": "Handsoncode <hello@handsontable.com>",
|
13
|
-
"version": "0.0.0-next-
|
13
|
+
"version": "0.0.0-next-94c1646-20230323",
|
14
14
|
"main": "index",
|
15
15
|
"module": "index.mjs",
|
16
16
|
"jsnext:main": "index.mjs",
|
package/plugins/base/base.js
CHANGED
@@ -65,6 +65,15 @@ var BasePlugin = /*#__PURE__*/function () {
|
|
65
65
|
function BasePlugin(hotInstance) {
|
66
66
|
var _this = this;
|
67
67
|
_classCallCheck(this, BasePlugin);
|
68
|
+
/**
|
69
|
+
* Check if any of the keys defined in `SETTING_KEYS` configuration of the plugin is present in the provided
|
70
|
+
* config object, or if the `SETTING_KEYS` configuration states that the plugin is relevant to the config object
|
71
|
+
* regardless of its contents.
|
72
|
+
*
|
73
|
+
* @private
|
74
|
+
* @param {Handsontable.DefaultSettings} settings The config object passed to `updateSettings`.
|
75
|
+
* @returns {boolean}
|
76
|
+
*/
|
68
77
|
_classPrivateMethodInitSpec(this, _isRelevantToSettings);
|
69
78
|
/**
|
70
79
|
* Handsontable instance.
|
@@ -228,16 +237,6 @@ var BasePlugin = /*#__PURE__*/function () {
|
|
228
237
|
this.pluginsInitializedCallbacks.push(callback);
|
229
238
|
}
|
230
239
|
}
|
231
|
-
|
232
|
-
/**
|
233
|
-
* Check if any of the keys defined in `SETTING_KEYS` configuration of the plugin is present in the provided
|
234
|
-
* config object, or if the `SETTING_KEYS` configuration states that the plugin is relevant to the config object
|
235
|
-
* regardless of its contents.
|
236
|
-
*
|
237
|
-
* @private
|
238
|
-
* @param {Handsontable.DefaultSettings} settings The config object passed to `updateSettings`.
|
239
|
-
* @returns {boolean}
|
240
|
-
*/
|
241
240
|
}, {
|
242
241
|
key: "onAfterPluginsInitialized",
|
243
242
|
value:
|
package/plugins/base/base.mjs
CHANGED
@@ -60,6 +60,15 @@ export var BasePlugin = /*#__PURE__*/function () {
|
|
60
60
|
function BasePlugin(hotInstance) {
|
61
61
|
var _this = this;
|
62
62
|
_classCallCheck(this, BasePlugin);
|
63
|
+
/**
|
64
|
+
* Check if any of the keys defined in `SETTING_KEYS` configuration of the plugin is present in the provided
|
65
|
+
* config object, or if the `SETTING_KEYS` configuration states that the plugin is relevant to the config object
|
66
|
+
* regardless of its contents.
|
67
|
+
*
|
68
|
+
* @private
|
69
|
+
* @param {Handsontable.DefaultSettings} settings The config object passed to `updateSettings`.
|
70
|
+
* @returns {boolean}
|
71
|
+
*/
|
63
72
|
_classPrivateMethodInitSpec(this, _isRelevantToSettings);
|
64
73
|
/**
|
65
74
|
* Handsontable instance.
|
@@ -223,16 +232,6 @@ export var BasePlugin = /*#__PURE__*/function () {
|
|
223
232
|
this.pluginsInitializedCallbacks.push(callback);
|
224
233
|
}
|
225
234
|
}
|
226
|
-
|
227
|
-
/**
|
228
|
-
* Check if any of the keys defined in `SETTING_KEYS` configuration of the plugin is present in the provided
|
229
|
-
* config object, or if the `SETTING_KEYS` configuration states that the plugin is relevant to the config object
|
230
|
-
* regardless of its contents.
|
231
|
-
*
|
232
|
-
* @private
|
233
|
-
* @param {Handsontable.DefaultSettings} settings The config object passed to `updateSettings`.
|
234
|
-
* @returns {boolean}
|
235
|
-
*/
|
236
235
|
}, {
|
237
236
|
key: "onAfterPluginsInitialized",
|
238
237
|
value:
|
@@ -160,9 +160,33 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
160
160
|
args[_key] = arguments[_key];
|
161
161
|
}
|
162
162
|
_this = _super.call.apply(_super, [this].concat(args));
|
163
|
+
/**
|
164
|
+
* Cached reference to the NestedHeaders plugin.
|
165
|
+
*
|
166
|
+
* @private
|
167
|
+
* @type {NestedHeaders}
|
168
|
+
*/
|
163
169
|
_defineProperty(_assertThisInitialized(_this), "nestedHeadersPlugin", null);
|
170
|
+
/**
|
171
|
+
* Event manager instance reference.
|
172
|
+
*
|
173
|
+
* @private
|
174
|
+
* @type {EventManager}
|
175
|
+
*/
|
164
176
|
_defineProperty(_assertThisInitialized(_this), "eventManager", new _eventManager.default(_assertThisInitialized(_this)));
|
177
|
+
/**
|
178
|
+
* The NestedHeaders plugin StateManager instance.
|
179
|
+
*
|
180
|
+
* @private
|
181
|
+
* @type {StateManager}
|
182
|
+
*/
|
165
183
|
_defineProperty(_assertThisInitialized(_this), "headerStateManager", null);
|
184
|
+
/**
|
185
|
+
* Map of collapsed columns by the plugin.
|
186
|
+
*
|
187
|
+
* @private
|
188
|
+
* @type {HidingMap|null}
|
189
|
+
*/
|
166
190
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _collapsedColumnsMap, {
|
167
191
|
writable: true,
|
168
192
|
value: null
|
@@ -584,13 +608,6 @@ var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
584
608
|
get: function get() {
|
585
609
|
return [PLUGIN_KEY].concat(SETTING_KEYS);
|
586
610
|
}
|
587
|
-
|
588
|
-
/**
|
589
|
-
* Cached reference to the NestedHeaders plugin.
|
590
|
-
*
|
591
|
-
* @private
|
592
|
-
* @type {NestedHeaders}
|
593
|
-
*/
|
594
611
|
}]);
|
595
612
|
return CollapsibleColumns;
|
596
613
|
}(_base.BasePlugin);
|
@@ -153,9 +153,33 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
153
153
|
args[_key] = arguments[_key];
|
154
154
|
}
|
155
155
|
_this = _super.call.apply(_super, [this].concat(args));
|
156
|
+
/**
|
157
|
+
* Cached reference to the NestedHeaders plugin.
|
158
|
+
*
|
159
|
+
* @private
|
160
|
+
* @type {NestedHeaders}
|
161
|
+
*/
|
156
162
|
_defineProperty(_assertThisInitialized(_this), "nestedHeadersPlugin", null);
|
163
|
+
/**
|
164
|
+
* Event manager instance reference.
|
165
|
+
*
|
166
|
+
* @private
|
167
|
+
* @type {EventManager}
|
168
|
+
*/
|
157
169
|
_defineProperty(_assertThisInitialized(_this), "eventManager", new EventManager(_assertThisInitialized(_this)));
|
170
|
+
/**
|
171
|
+
* The NestedHeaders plugin StateManager instance.
|
172
|
+
*
|
173
|
+
* @private
|
174
|
+
* @type {StateManager}
|
175
|
+
*/
|
158
176
|
_defineProperty(_assertThisInitialized(_this), "headerStateManager", null);
|
177
|
+
/**
|
178
|
+
* Map of collapsed columns by the plugin.
|
179
|
+
*
|
180
|
+
* @private
|
181
|
+
* @type {HidingMap|null}
|
182
|
+
*/
|
159
183
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _collapsedColumnsMap, {
|
160
184
|
writable: true,
|
161
185
|
value: null
|
@@ -577,13 +601,6 @@ export var CollapsibleColumns = /*#__PURE__*/function (_BasePlugin) {
|
|
577
601
|
get: function get() {
|
578
602
|
return [PLUGIN_KEY].concat(SETTING_KEYS);
|
579
603
|
}
|
580
|
-
|
581
|
-
/**
|
582
|
-
* Cached reference to the NestedHeaders plugin.
|
583
|
-
*
|
584
|
-
* @private
|
585
|
-
* @type {NestedHeaders}
|
586
|
-
*/
|
587
604
|
}]);
|
588
605
|
return CollapsibleColumns;
|
589
606
|
}(BasePlugin);
|
@@ -143,35 +143,115 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
143
143
|
args[_key] = arguments[_key];
|
144
144
|
}
|
145
145
|
_this = _super.call.apply(_super, [this].concat(args));
|
146
|
+
/**
|
147
|
+
* Counts how many column headers will be copied based on the passed range.
|
148
|
+
*
|
149
|
+
* @private
|
150
|
+
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
|
151
|
+
* @returns {{ columnHeadersCount: number }} Returns an object with keys that holds
|
152
|
+
* information with the number of copied headers.
|
153
|
+
*/
|
146
154
|
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _countCopiedHeaders);
|
155
|
+
/**
|
156
|
+
* The maximum number of columns than can be copied to the clipboard.
|
157
|
+
*
|
158
|
+
* @type {number}
|
159
|
+
* @default Infinity
|
160
|
+
*/
|
147
161
|
_defineProperty(_assertThisInitialized(_this), "columnsLimit", Infinity);
|
162
|
+
/**
|
163
|
+
* The maximum number of rows than can be copied to the clipboard.
|
164
|
+
*
|
165
|
+
* @type {number}
|
166
|
+
* @default Infinity
|
167
|
+
*/
|
148
168
|
_defineProperty(_assertThisInitialized(_this), "rowsLimit", Infinity);
|
169
|
+
/**
|
170
|
+
* When pasting:
|
171
|
+
* - `'overwrite'`: overwrite the currently-selected cells
|
172
|
+
* - `'shift_down'`: move currently-selected cells down
|
173
|
+
* - `'shift_right'`: move currently-selected cells to the right
|
174
|
+
*
|
175
|
+
* @type {string}
|
176
|
+
* @default 'overwrite'
|
177
|
+
*/
|
149
178
|
_defineProperty(_assertThisInitialized(_this), "pasteMode", 'overwrite');
|
179
|
+
/**
|
180
|
+
* The UI container for the secondary focusable element.
|
181
|
+
*
|
182
|
+
* @type {HTMLElement}
|
183
|
+
*/
|
150
184
|
_defineProperty(_assertThisInitialized(_this), "uiContainer", _this.hot.rootDocument.body);
|
185
|
+
/**
|
186
|
+
* Shows the "Copy with headers" item in the context menu and extends the context menu with the
|
187
|
+
* `'copy_with_column_headers'` option that can be used for creating custom menus arrangements.
|
188
|
+
*
|
189
|
+
* @type {boolean}
|
190
|
+
* @default false
|
191
|
+
*/
|
151
192
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeaders, {
|
152
193
|
writable: true,
|
153
194
|
value: false
|
154
195
|
});
|
196
|
+
/**
|
197
|
+
* Shows the "Copy with group headers" item in the context menu and extends the context menu with the
|
198
|
+
* `'copy_with_column_group headers'` option that can be used for creating custom menus arrangements.
|
199
|
+
*
|
200
|
+
* @type {boolean}
|
201
|
+
* @default false
|
202
|
+
*/
|
155
203
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnGroupHeaders, {
|
156
204
|
writable: true,
|
157
205
|
value: false
|
158
206
|
});
|
207
|
+
/**
|
208
|
+
* Shows the "Copy headers only" item in the context menu and extends the context menu with the
|
209
|
+
* `'copy_column_headers_only'` option that can be used for creating custom menus arrangements.
|
210
|
+
*
|
211
|
+
* @type {boolean}
|
212
|
+
* @default false
|
213
|
+
*/
|
159
214
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeadersOnly, {
|
160
215
|
writable: true,
|
161
216
|
value: false
|
162
217
|
});
|
218
|
+
/**
|
219
|
+
* Defines the data range to copy. Possible values:
|
220
|
+
* * `'cells-only'` Copy selected cells only;
|
221
|
+
* * `'column-headers-only'` Copy column headers only;
|
222
|
+
* * `'with-all-column-headers'` Copy cells with all column headers;
|
223
|
+
* * `'with-column-headers'` Copy cells with column headers;
|
224
|
+
*
|
225
|
+
* @type {'cells-only' | 'column-headers-only' | 'with-all-column-headers' | 'with-column-headers'}
|
226
|
+
*/
|
163
227
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyMode, {
|
164
228
|
writable: true,
|
165
229
|
value: 'cells-only'
|
166
230
|
});
|
231
|
+
/**
|
232
|
+
* Flag that is used to prevent copying when the native shortcut was not pressed.
|
233
|
+
*
|
234
|
+
* @type {boolean}
|
235
|
+
*/
|
167
236
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCopy, {
|
168
237
|
writable: true,
|
169
238
|
value: false
|
170
239
|
});
|
240
|
+
/**
|
241
|
+
* Flag that is used to prevent cutting when the native shortcut was not pressed.
|
242
|
+
*
|
243
|
+
* @type {boolean}
|
244
|
+
*/
|
171
245
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCut, {
|
172
246
|
writable: true,
|
173
247
|
value: false
|
174
248
|
});
|
249
|
+
/**
|
250
|
+
* Class that helps generate copyable ranges based on the current selection for different copy mode
|
251
|
+
* types.
|
252
|
+
*
|
253
|
+
* @type {CopyableRangesFactory}
|
254
|
+
*/
|
175
255
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyableRangesFactory, {
|
176
256
|
writable: true,
|
177
257
|
value: new _copyableRanges.CopyableRangesFactory({
|
@@ -192,7 +272,19 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
192
272
|
}
|
193
273
|
})
|
194
274
|
});
|
275
|
+
/**
|
276
|
+
* Ranges of the cells coordinates, which should be used to copy/cut/paste actions.
|
277
|
+
*
|
278
|
+
* @private
|
279
|
+
* @type {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>}
|
280
|
+
*/
|
195
281
|
_defineProperty(_assertThisInitialized(_this), "copyableRanges", []);
|
282
|
+
/**
|
283
|
+
* Provides focusable element to support IME and copy/paste/cut actions.
|
284
|
+
*
|
285
|
+
* @private
|
286
|
+
* @type {FocusableWrapper}
|
287
|
+
*/
|
196
288
|
_defineProperty(_assertThisInitialized(_this), "focusableElement", void 0);
|
197
289
|
return _this;
|
198
290
|
}
|
@@ -501,15 +593,6 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
501
593
|
var _this$hot$getActiveEd2;
|
502
594
|
return (_this$hot$getActiveEd2 = this.hot.getActiveEditor()) === null || _this$hot$getActiveEd2 === void 0 ? void 0 : _this$hot$getActiveEd2.isOpened();
|
503
595
|
}
|
504
|
-
|
505
|
-
/**
|
506
|
-
* Counts how many column headers will be copied based on the passed range.
|
507
|
-
*
|
508
|
-
* @private
|
509
|
-
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
|
510
|
-
* @returns {{ columnHeadersCount: number }} Returns an object with keys that holds
|
511
|
-
* information with the number of copied headers.
|
512
|
-
*/
|
513
596
|
}, {
|
514
597
|
key: "populateValues",
|
515
598
|
value:
|
@@ -795,13 +878,6 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
795
878
|
get: function get() {
|
796
879
|
return PLUGIN_PRIORITY;
|
797
880
|
}
|
798
|
-
|
799
|
-
/**
|
800
|
-
* The maximum number of columns than can be copied to the clipboard.
|
801
|
-
*
|
802
|
-
* @type {number}
|
803
|
-
* @default Infinity
|
804
|
-
*/
|
805
881
|
}]);
|
806
882
|
return CopyPaste;
|
807
883
|
}(_base.BasePlugin);
|
@@ -136,35 +136,115 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
136
136
|
args[_key] = arguments[_key];
|
137
137
|
}
|
138
138
|
_this = _super.call.apply(_super, [this].concat(args));
|
139
|
+
/**
|
140
|
+
* Counts how many column headers will be copied based on the passed range.
|
141
|
+
*
|
142
|
+
* @private
|
143
|
+
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
|
144
|
+
* @returns {{ columnHeadersCount: number }} Returns an object with keys that holds
|
145
|
+
* information with the number of copied headers.
|
146
|
+
*/
|
139
147
|
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _countCopiedHeaders);
|
148
|
+
/**
|
149
|
+
* The maximum number of columns than can be copied to the clipboard.
|
150
|
+
*
|
151
|
+
* @type {number}
|
152
|
+
* @default Infinity
|
153
|
+
*/
|
140
154
|
_defineProperty(_assertThisInitialized(_this), "columnsLimit", Infinity);
|
155
|
+
/**
|
156
|
+
* The maximum number of rows than can be copied to the clipboard.
|
157
|
+
*
|
158
|
+
* @type {number}
|
159
|
+
* @default Infinity
|
160
|
+
*/
|
141
161
|
_defineProperty(_assertThisInitialized(_this), "rowsLimit", Infinity);
|
162
|
+
/**
|
163
|
+
* When pasting:
|
164
|
+
* - `'overwrite'`: overwrite the currently-selected cells
|
165
|
+
* - `'shift_down'`: move currently-selected cells down
|
166
|
+
* - `'shift_right'`: move currently-selected cells to the right
|
167
|
+
*
|
168
|
+
* @type {string}
|
169
|
+
* @default 'overwrite'
|
170
|
+
*/
|
142
171
|
_defineProperty(_assertThisInitialized(_this), "pasteMode", 'overwrite');
|
172
|
+
/**
|
173
|
+
* The UI container for the secondary focusable element.
|
174
|
+
*
|
175
|
+
* @type {HTMLElement}
|
176
|
+
*/
|
143
177
|
_defineProperty(_assertThisInitialized(_this), "uiContainer", _this.hot.rootDocument.body);
|
178
|
+
/**
|
179
|
+
* Shows the "Copy with headers" item in the context menu and extends the context menu with the
|
180
|
+
* `'copy_with_column_headers'` option that can be used for creating custom menus arrangements.
|
181
|
+
*
|
182
|
+
* @type {boolean}
|
183
|
+
* @default false
|
184
|
+
*/
|
144
185
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeaders, {
|
145
186
|
writable: true,
|
146
187
|
value: false
|
147
188
|
});
|
189
|
+
/**
|
190
|
+
* Shows the "Copy with group headers" item in the context menu and extends the context menu with the
|
191
|
+
* `'copy_with_column_group headers'` option that can be used for creating custom menus arrangements.
|
192
|
+
*
|
193
|
+
* @type {boolean}
|
194
|
+
* @default false
|
195
|
+
*/
|
148
196
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnGroupHeaders, {
|
149
197
|
writable: true,
|
150
198
|
value: false
|
151
199
|
});
|
200
|
+
/**
|
201
|
+
* Shows the "Copy headers only" item in the context menu and extends the context menu with the
|
202
|
+
* `'copy_column_headers_only'` option that can be used for creating custom menus arrangements.
|
203
|
+
*
|
204
|
+
* @type {boolean}
|
205
|
+
* @default false
|
206
|
+
*/
|
152
207
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeadersOnly, {
|
153
208
|
writable: true,
|
154
209
|
value: false
|
155
210
|
});
|
211
|
+
/**
|
212
|
+
* Defines the data range to copy. Possible values:
|
213
|
+
* * `'cells-only'` Copy selected cells only;
|
214
|
+
* * `'column-headers-only'` Copy column headers only;
|
215
|
+
* * `'with-all-column-headers'` Copy cells with all column headers;
|
216
|
+
* * `'with-column-headers'` Copy cells with column headers;
|
217
|
+
*
|
218
|
+
* @type {'cells-only' | 'column-headers-only' | 'with-all-column-headers' | 'with-column-headers'}
|
219
|
+
*/
|
156
220
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyMode, {
|
157
221
|
writable: true,
|
158
222
|
value: 'cells-only'
|
159
223
|
});
|
224
|
+
/**
|
225
|
+
* Flag that is used to prevent copying when the native shortcut was not pressed.
|
226
|
+
*
|
227
|
+
* @type {boolean}
|
228
|
+
*/
|
160
229
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCopy, {
|
161
230
|
writable: true,
|
162
231
|
value: false
|
163
232
|
});
|
233
|
+
/**
|
234
|
+
* Flag that is used to prevent cutting when the native shortcut was not pressed.
|
235
|
+
*
|
236
|
+
* @type {boolean}
|
237
|
+
*/
|
164
238
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCut, {
|
165
239
|
writable: true,
|
166
240
|
value: false
|
167
241
|
});
|
242
|
+
/**
|
243
|
+
* Class that helps generate copyable ranges based on the current selection for different copy mode
|
244
|
+
* types.
|
245
|
+
*
|
246
|
+
* @type {CopyableRangesFactory}
|
247
|
+
*/
|
168
248
|
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyableRangesFactory, {
|
169
249
|
writable: true,
|
170
250
|
value: new CopyableRangesFactory({
|
@@ -185,7 +265,19 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
185
265
|
}
|
186
266
|
})
|
187
267
|
});
|
268
|
+
/**
|
269
|
+
* Ranges of the cells coordinates, which should be used to copy/cut/paste actions.
|
270
|
+
*
|
271
|
+
* @private
|
272
|
+
* @type {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>}
|
273
|
+
*/
|
188
274
|
_defineProperty(_assertThisInitialized(_this), "copyableRanges", []);
|
275
|
+
/**
|
276
|
+
* Provides focusable element to support IME and copy/paste/cut actions.
|
277
|
+
*
|
278
|
+
* @private
|
279
|
+
* @type {FocusableWrapper}
|
280
|
+
*/
|
189
281
|
_defineProperty(_assertThisInitialized(_this), "focusableElement", void 0);
|
190
282
|
return _this;
|
191
283
|
}
|
@@ -494,15 +586,6 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
494
586
|
var _this$hot$getActiveEd2;
|
495
587
|
return (_this$hot$getActiveEd2 = this.hot.getActiveEditor()) === null || _this$hot$getActiveEd2 === void 0 ? void 0 : _this$hot$getActiveEd2.isOpened();
|
496
588
|
}
|
497
|
-
|
498
|
-
/**
|
499
|
-
* Counts how many column headers will be copied based on the passed range.
|
500
|
-
*
|
501
|
-
* @private
|
502
|
-
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
|
503
|
-
* @returns {{ columnHeadersCount: number }} Returns an object with keys that holds
|
504
|
-
* information with the number of copied headers.
|
505
|
-
*/
|
506
589
|
}, {
|
507
590
|
key: "populateValues",
|
508
591
|
value:
|
@@ -788,13 +871,6 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
788
871
|
get: function get() {
|
789
872
|
return PLUGIN_PRIORITY;
|
790
873
|
}
|
791
|
-
|
792
|
-
/**
|
793
|
-
* The maximum number of columns than can be copied to the clipboard.
|
794
|
-
*
|
795
|
-
* @type {number}
|
796
|
-
* @default Infinity
|
797
|
-
*/
|
798
874
|
}]);
|
799
875
|
return CopyPaste;
|
800
876
|
}(BasePlugin);
|
@@ -90,7 +90,21 @@ var CopyableRangesFactory = /*#__PURE__*/function () {
|
|
90
90
|
columnsLimit = _ref.columnsLimit,
|
91
91
|
countColumnHeaders = _ref.countColumnHeaders;
|
92
92
|
_classCallCheck(this, CopyableRangesFactory);
|
93
|
+
/**
|
94
|
+
* Trimmed the rows range to the limit.
|
95
|
+
*
|
96
|
+
* @param {*} startRow The lowest row index in the range.
|
97
|
+
* @param {*} endRow The highest row index in the range.
|
98
|
+
* @returns {number} Returns trimmed row index if it exceeds the limit.
|
99
|
+
*/
|
93
100
|
_classPrivateMethodInitSpec(this, _trimRowsRange);
|
101
|
+
/**
|
102
|
+
* Trimmed the columns range to the limit.
|
103
|
+
*
|
104
|
+
* @param {*} startColumn The lowest column index in the range.
|
105
|
+
* @param {*} endColumn The highest column index in the range.
|
106
|
+
* @returns {number} Returns trimmed column index if it exceeds the limit.
|
107
|
+
*/
|
94
108
|
_classPrivateMethodInitSpec(this, _trimColumnsRange);
|
95
109
|
_classPrivateFieldInitSpec(this, _selectedRange, {
|
96
110
|
writable: true,
|
@@ -218,14 +232,6 @@ var CopyableRangesFactory = /*#__PURE__*/function () {
|
|
218
232
|
endCol: finalEndCol
|
219
233
|
};
|
220
234
|
}
|
221
|
-
|
222
|
-
/**
|
223
|
-
* Trimmed the columns range to the limit.
|
224
|
-
*
|
225
|
-
* @param {*} startColumn The lowest column index in the range.
|
226
|
-
* @param {*} endColumn The highest column index in the range.
|
227
|
-
* @returns {number} Returns trimmed column index if it exceeds the limit.
|
228
|
-
*/
|
229
235
|
}]);
|
230
236
|
return CopyableRangesFactory;
|
231
237
|
}();
|
@@ -85,7 +85,21 @@ export var CopyableRangesFactory = /*#__PURE__*/function () {
|
|
85
85
|
columnsLimit = _ref.columnsLimit,
|
86
86
|
countColumnHeaders = _ref.countColumnHeaders;
|
87
87
|
_classCallCheck(this, CopyableRangesFactory);
|
88
|
+
/**
|
89
|
+
* Trimmed the rows range to the limit.
|
90
|
+
*
|
91
|
+
* @param {*} startRow The lowest row index in the range.
|
92
|
+
* @param {*} endRow The highest row index in the range.
|
93
|
+
* @returns {number} Returns trimmed row index if it exceeds the limit.
|
94
|
+
*/
|
88
95
|
_classPrivateMethodInitSpec(this, _trimRowsRange);
|
96
|
+
/**
|
97
|
+
* Trimmed the columns range to the limit.
|
98
|
+
*
|
99
|
+
* @param {*} startColumn The lowest column index in the range.
|
100
|
+
* @param {*} endColumn The highest column index in the range.
|
101
|
+
* @returns {number} Returns trimmed column index if it exceeds the limit.
|
102
|
+
*/
|
89
103
|
_classPrivateMethodInitSpec(this, _trimColumnsRange);
|
90
104
|
_classPrivateFieldInitSpec(this, _selectedRange, {
|
91
105
|
writable: true,
|
@@ -213,14 +227,6 @@ export var CopyableRangesFactory = /*#__PURE__*/function () {
|
|
213
227
|
endCol: finalEndCol
|
214
228
|
};
|
215
229
|
}
|
216
|
-
|
217
|
-
/**
|
218
|
-
* Trimmed the columns range to the limit.
|
219
|
-
*
|
220
|
-
* @param {*} startColumn The lowest column index in the range.
|
221
|
-
* @param {*} endColumn The highest column index in the range.
|
222
|
-
* @returns {number} Returns trimmed column index if it exceeds the limit.
|
223
|
-
*/
|
224
230
|
}]);
|
225
231
|
return CopyableRangesFactory;
|
226
232
|
}();
|