handsontable 0.0.0-next-1b1acbd-20221123 → 0.0.0-next-561a94b-20221129
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/range.js +2 -2
- package/3rdparty/walkontable/src/cell/range.mjs +2 -2
- package/CHANGELOG.md +4 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +30 -8
- package/core.mjs +30 -8
- package/dataMap/metaManager/metaSchema.js +32 -12
- package/dataMap/metaManager/metaSchema.mjs +32 -12
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +138 -109
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +4 -4
- package/dist/handsontable.js +138 -109
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.js +16 -20
- package/pluginHooks.mjs +16 -20
- package/plugins/contextMenu/contextMenu.js +1 -16
- package/plugins/contextMenu/contextMenu.mjs +1 -16
- package/plugins/copyPaste/copyPaste.js +49 -43
- package/plugins/copyPaste/copyPaste.mjs +49 -43
- package/translations/indexMapper.js +3 -3
- package/translations/indexMapper.mjs +3 -3
@@ -81,28 +81,25 @@ var META_HEAD = ['<meta name="generator" content="Handsontable"/>', '<style type
|
|
81
81
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
82
82
|
/**
|
83
83
|
* @description
|
84
|
-
*
|
85
|
-
* using keyboard shortcuts and menu bar from the browser.
|
86
|
-
* Possible values:
|
87
|
-
* * `true` (to enable default options),
|
88
|
-
* * `false` (to disable completely).
|
84
|
+
* Copy, cut, and paste data by using the `CopyPaste` plugin.
|
89
85
|
*
|
90
|
-
*
|
91
|
-
* * `'columnsLimit'` (see {@link CopyPaste#columnsLimit})
|
92
|
-
* * `'rowsLimit'` (see {@link CopyPaste#rowsLimit})
|
93
|
-
* * `'pasteMode'` (see {@link CopyPaste#pasteMode})
|
94
|
-
* * `'copyColumnHeaders'`
|
95
|
-
* * `'copyColumnGroupHeaders'`
|
96
|
-
* * `'copyColumnHeadersOnly'`
|
97
|
-
* * `'uiContainer'` (see {@link CopyPaste#uiContainer}).
|
86
|
+
* Control the `CopyPaste` plugin programmatically through its [API methods](#methods).
|
98
87
|
*
|
99
|
-
*
|
88
|
+
* The user can access the copy-paste features through:
|
89
|
+
* - The [context menu](@/guides/cell-features/clipboard.md#context-menu).
|
90
|
+
* - The [keyboard shortcuts](@/guides/cell-features/clipboard.md#related-keyboard-shortcuts).
|
91
|
+
* - The browser's menu bar.
|
92
|
+
*
|
93
|
+
* Read more:
|
94
|
+
* - [Guides: Clipboard](@/guides/cell-features/clipboard.md)
|
95
|
+
* - [Configuration options: `copyPaste`](@/api/options.md#copypaste)
|
100
96
|
*
|
101
97
|
* @example
|
102
98
|
* ```js
|
103
|
-
* //
|
99
|
+
* // enable the plugin with the default configuration
|
104
100
|
* copyPaste: true,
|
105
|
-
*
|
101
|
+
*
|
102
|
+
* // or, enable the plugin with a custom configuration
|
106
103
|
* copyPaste: {
|
107
104
|
* columnsLimit: 25,
|
108
105
|
* rowsLimit: 50,
|
@@ -191,8 +188,10 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
191
188
|
key: "isEnabled",
|
192
189
|
value:
|
193
190
|
/**
|
194
|
-
* Checks if the plugin is enabled
|
195
|
-
*
|
191
|
+
* Checks if the [`CopyPaste`](#copypaste) plugin is enabled.
|
192
|
+
*
|
193
|
+
* This method gets called by Handsontable's [`beforeInit`](@/api/hooks.md#beforeinit) hook.
|
194
|
+
* If it returns `true`, the [`enablePlugin()`](#enableplugin) method gets called.
|
196
195
|
*
|
197
196
|
* @returns {boolean}
|
198
197
|
*/
|
@@ -201,7 +200,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
201
200
|
}
|
202
201
|
|
203
202
|
/**
|
204
|
-
* Enables the plugin
|
203
|
+
* Enables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
|
205
204
|
*/
|
206
205
|
}, {
|
207
206
|
key: "enablePlugin",
|
@@ -246,9 +245,10 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
246
245
|
}
|
247
246
|
|
248
247
|
/**
|
249
|
-
* Updates the plugin
|
248
|
+
* Updates the state of the [`CopyPaste`](#copypaste) plugin.
|
250
249
|
*
|
251
|
-
*
|
250
|
+
* Gets called when [`updateSettings()`](@/api/core.md#updatesettings)
|
251
|
+
* is invoked with any of the following configuration options:
|
252
252
|
* - [`copyPaste`](@/api/options.md#copypaste)
|
253
253
|
* - [`fragmentSelection`](@/api/options.md#fragmentselection)
|
254
254
|
*/
|
@@ -262,7 +262,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
262
262
|
}
|
263
263
|
|
264
264
|
/**
|
265
|
-
* Disables the plugin
|
265
|
+
* Disables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
|
266
266
|
*/
|
267
267
|
}, {
|
268
268
|
key: "disablePlugin",
|
@@ -274,12 +274,18 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
274
274
|
}
|
275
275
|
|
276
276
|
/**
|
277
|
-
* Copies the selected
|
277
|
+
* Copies the contents of the selected cells (and/or their related column headers) to the system clipboard.
|
278
|
+
*
|
279
|
+
* Takes an optional parameter (`copyMode`) that defines the scope of copying:
|
280
|
+
*
|
281
|
+
* | `copyMode` value | Description |
|
282
|
+
* | --------------------------- | --------------------------------------------------------------- |
|
283
|
+
* | `'cells-only'` (default) | Copy the selected cells |
|
284
|
+
* | `'with-column-headers'` | - Copy the selected cells<br>- Copy the nearest column headers |
|
285
|
+
* | `'with-all-column-headers'` | - Copy the selected cells<br>- Copy all related columns headers |
|
286
|
+
* | `'column-headers-only'` | Copy the nearest column headers (without copying cells) |
|
278
287
|
*
|
279
|
-
* @param {
|
280
|
-
* Defines the data range to copy. Possible values: `cells-only` (copy selected cells only),
|
281
|
-
* `column-headers-only` (copy the most-bottom column headers only), `with-all-column-headers` (copy cells
|
282
|
-
* with all column headers levels) or `with-column-headers` (copy cells with the most-bottom column headers).
|
288
|
+
* @param {string} [copyMode='cells-only'] Copy mode.
|
283
289
|
*/
|
284
290
|
}, {
|
285
291
|
key: "copy",
|
@@ -293,7 +299,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
293
299
|
}
|
294
300
|
|
295
301
|
/**
|
296
|
-
* Copies the
|
302
|
+
* Copies the contents of the selected cells.
|
297
303
|
*/
|
298
304
|
}, {
|
299
305
|
key: "copyCellsOnly",
|
@@ -301,7 +307,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
301
307
|
this.copy('cells-only');
|
302
308
|
}
|
303
309
|
/**
|
304
|
-
* Copies
|
310
|
+
* Copies the contents of column headers that are nearest to the selected cells.
|
305
311
|
*/
|
306
312
|
}, {
|
307
313
|
key: "copyColumnHeadersOnly",
|
@@ -309,7 +315,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
309
315
|
this.copy('column-headers-only');
|
310
316
|
}
|
311
317
|
/**
|
312
|
-
* Copies the selected
|
318
|
+
* Copies the contents of the selected cells and all their related column headers.
|
313
319
|
*/
|
314
320
|
}, {
|
315
321
|
key: "copyWithAllColumnHeaders",
|
@@ -317,7 +323,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
317
323
|
this.copy('with-column-group-headers');
|
318
324
|
}
|
319
325
|
/**
|
320
|
-
* Copies the selected
|
326
|
+
* Copies the contents of the selected cells and their nearest column headers.
|
321
327
|
*/
|
322
328
|
}, {
|
323
329
|
key: "copyWithColumnHeaders",
|
@@ -326,7 +332,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
326
332
|
}
|
327
333
|
|
328
334
|
/**
|
329
|
-
* Cuts the selected
|
335
|
+
* Cuts the contents of the selected cells to the system clipboard.
|
330
336
|
*/
|
331
337
|
}, {
|
332
338
|
key: "cut",
|
@@ -338,10 +344,10 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
338
344
|
}
|
339
345
|
|
340
346
|
/**
|
341
|
-
*
|
347
|
+
* Converts the contents of multiple ranges (`ranges`) into a single string.
|
342
348
|
*
|
343
349
|
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `endRow`, `startCol` and `endCol`.
|
344
|
-
* @returns {string}
|
350
|
+
* @returns {string} A string that will be copied to the clipboard.
|
345
351
|
*/
|
346
352
|
}, {
|
347
353
|
key: "getRangedCopyableData",
|
@@ -350,10 +356,10 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
350
356
|
}
|
351
357
|
|
352
358
|
/**
|
353
|
-
*
|
359
|
+
* Converts the contents of multiple ranges (`ranges`) into an array of arrays.
|
354
360
|
*
|
355
361
|
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
|
356
|
-
* @returns {Array[]}
|
362
|
+
* @returns {Array[]} An array of arrays that will be copied to the clipboard.
|
357
363
|
*/
|
358
364
|
}, {
|
359
365
|
key: "getRangedData",
|
@@ -364,12 +370,12 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
364
370
|
rows = _normalizeRanges.rows,
|
365
371
|
columns = _normalizeRanges.columns;
|
366
372
|
|
367
|
-
//
|
373
|
+
// concatenate all rows and columns data defined in ranges into one copyable string
|
368
374
|
arrayEach(rows, function (row) {
|
369
375
|
var rowSet = [];
|
370
376
|
arrayEach(columns, function (column) {
|
371
377
|
if (row < 0) {
|
372
|
-
//
|
378
|
+
// `row` as the second argument acts here as the `headerLevel` argument
|
373
379
|
rowSet.push(_this3.hot.getColHeader(column, row));
|
374
380
|
} else {
|
375
381
|
rowSet.push(_this3.hot.getCopyableData(row, column));
|
@@ -383,10 +389,10 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
383
389
|
/**
|
384
390
|
* Simulates the paste action.
|
385
391
|
*
|
386
|
-
*
|
392
|
+
* For security reasons, modern browsers don't allow reading from the system clipboard.
|
387
393
|
*
|
388
|
-
* @param {string} pastableText
|
389
|
-
* @param {string} [pastableHtml='']
|
394
|
+
* @param {string} pastableText The value to paste, as a raw string.
|
395
|
+
* @param {string} [pastableHtml=''] The value to paste, as HTML.
|
390
396
|
*/
|
391
397
|
}, {
|
392
398
|
key: "paste",
|
@@ -751,7 +757,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
751
757
|
}
|
752
758
|
|
753
759
|
/**
|
754
|
-
* Destroys the plugin instance.
|
760
|
+
* Destroys the `CopyPaste` plugin instance.
|
755
761
|
*/
|
756
762
|
}, {
|
757
763
|
key: "destroy",
|
@@ -779,7 +785,7 @@ export var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
779
785
|
}
|
780
786
|
|
781
787
|
/**
|
782
|
-
*
|
788
|
+
* The maximum number of columns than can be copied to the clipboard.
|
783
789
|
*
|
784
790
|
* @type {number}
|
785
791
|
* @default Infinity
|
@@ -255,10 +255,10 @@ var IndexMapper = /*#__PURE__*/function () {
|
|
255
255
|
}
|
256
256
|
|
257
257
|
/**
|
258
|
-
* Creates and
|
258
|
+
* Creates and registers a new `IndexMap` for a specified `IndexMapper` instance.
|
259
259
|
*
|
260
|
-
* @param {string} indexName
|
261
|
-
* @param {string} mapType The index map type (e.
|
260
|
+
* @param {string} indexName A unique index name.
|
261
|
+
* @param {string} mapType The index map type (e.g., "hiding", "trimming", "physicalIndexToValue").
|
262
262
|
* @param {*} [initValueOrFn] The initial value for the index map.
|
263
263
|
* @returns {IndexMap}
|
264
264
|
*/
|
@@ -250,10 +250,10 @@ export var IndexMapper = /*#__PURE__*/function () {
|
|
250
250
|
}
|
251
251
|
|
252
252
|
/**
|
253
|
-
* Creates and
|
253
|
+
* Creates and registers a new `IndexMap` for a specified `IndexMapper` instance.
|
254
254
|
*
|
255
|
-
* @param {string} indexName
|
256
|
-
* @param {string} mapType The index map type (e.
|
255
|
+
* @param {string} indexName A unique index name.
|
256
|
+
* @param {string} mapType The index map type (e.g., "hiding", "trimming", "physicalIndexToValue").
|
257
257
|
* @param {*} [initValueOrFn] The initial value for the index map.
|
258
258
|
* @returns {IndexMap}
|
259
259
|
*/
|