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
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-561a94b-20221129";
|
156
156
|
var keyValidityDate;
|
157
157
|
var consoleMessageState = 'invalid';
|
158
158
|
var domMessageState = 'invalid';
|
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-561a94b-20221129";
|
146
146
|
var keyValidityDate;
|
147
147
|
var consoleMessageState = 'invalid';
|
148
148
|
var domMessageState = 'invalid';
|
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-561a94b-20221129",
|
14
14
|
"main": "index",
|
15
15
|
"module": "index.mjs",
|
16
16
|
"jsnext:main": "index.mjs",
|
package/pluginHooks.js
CHANGED
@@ -362,14 +362,12 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
362
362
|
/**
|
363
363
|
* Fired after retrieving information about a column header and appending it to the table header.
|
364
364
|
*
|
365
|
-
* Since the 12.2 the hook is triggered with the 3rd `headerLevel` argument.
|
366
|
-
*
|
367
365
|
* @event Hooks#afterGetColHeader
|
368
366
|
* @param {number} column Visual column index.
|
369
367
|
* @param {HTMLTableCellElement} TH Header's TH element.
|
370
|
-
* @param {number} [headerLevel=0]
|
371
|
-
* and negative (-1 to -
|
372
|
-
*
|
368
|
+
* @param {number} [headerLevel=0] (Since 12.2.0) Header level index. Accepts positive (0 to n)
|
369
|
+
* and negative (-1 to -n) values. For positive values, 0 points to the
|
370
|
+
* topmost header. For negative values, -1 points to the bottom-most
|
373
371
|
* header (the header closest to the cells).
|
374
372
|
*/
|
375
373
|
'afterGetColHeader',
|
@@ -1321,7 +1319,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1321
1319
|
*/
|
1322
1320
|
'modifyCopyableRange',
|
1323
1321
|
/**
|
1324
|
-
* Fired by {@link CopyPaste} plugin before copying the values
|
1322
|
+
* Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
|
1325
1323
|
* the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
|
1326
1324
|
*
|
1327
1325
|
* @event Hooks#beforeCut
|
@@ -1376,22 +1374,19 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1376
1374
|
* {@link Options#copyPaste} option is enabled.
|
1377
1375
|
*
|
1378
1376
|
* @event Hooks#afterCut
|
1379
|
-
* @param {Array[]} data An array of arrays
|
1377
|
+
* @param {Array[]} data An array of arrays with the cut data.
|
1380
1378
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1381
1379
|
* which was cut out.
|
1382
1380
|
*/
|
1383
1381
|
'afterCut',
|
1384
1382
|
/**
|
1385
|
-
* Fired before values are copied
|
1386
|
-
*
|
1387
|
-
* Since the 12.3.0 the hook is triggered with the 3rd `copiedHeadersCount` argument.
|
1383
|
+
* Fired before values are copied to the clipboard.
|
1388
1384
|
*
|
1389
1385
|
* @event Hooks#beforeCopy
|
1390
1386
|
* @param {Array[]} data An array of arrays which contains data to copied.
|
1391
1387
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1392
1388
|
* which will copied.
|
1393
|
-
* @param {{ columnHeadersCount: number }} copiedHeadersCount
|
1394
|
-
* the number of copied headers.
|
1389
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1395
1390
|
* @returns {*} If returns `false` then copying is canceled.
|
1396
1391
|
*
|
1397
1392
|
* @example
|
@@ -1454,6 +1449,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1454
1449
|
* @param {Array[]} data An array of arrays which contains the copied data.
|
1455
1450
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1456
1451
|
* which was copied.
|
1452
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1457
1453
|
*/
|
1458
1454
|
'afterCopy',
|
1459
1455
|
/**
|
@@ -1512,7 +1508,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1512
1508
|
* {@link Options#copyPaste} option is enabled.
|
1513
1509
|
*
|
1514
1510
|
* @event Hooks#afterPaste
|
1515
|
-
* @param {Array[]} data An array of arrays
|
1511
|
+
* @param {Array[]} data An array of arrays with the pasted data.
|
1516
1512
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1517
1513
|
* that correspond to the previously selected area.
|
1518
1514
|
*/
|
@@ -1820,17 +1816,17 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1820
1816
|
*/
|
1821
1817
|
'modifyColumnHeaderHeight',
|
1822
1818
|
/**
|
1823
|
-
* Fired while retrieving
|
1819
|
+
* Fired while retrieving a column header's value.
|
1824
1820
|
*
|
1825
1821
|
* @since 12.3.0
|
1826
1822
|
* @event Hooks#modifyColumnHeaderValue
|
1827
|
-
* @param {string} value
|
1828
|
-
* @param {number} visualColumnIndex
|
1829
|
-
* @param {number} [headerLevel=0]
|
1830
|
-
* and negative (-1 to -
|
1831
|
-
*
|
1823
|
+
* @param {string} value A column header value.
|
1824
|
+
* @param {number} visualColumnIndex A visual column index.
|
1825
|
+
* @param {number} [headerLevel=0] Header level index. Accepts positive (0 to n)
|
1826
|
+
* and negative (-1 to -n) values. For positive values, 0 points to the
|
1827
|
+
* topmost header. For negative values, -1 points to the bottom-most
|
1832
1828
|
* header (the header closest to the cells).
|
1833
|
-
* @returns {string}
|
1829
|
+
* @returns {string} The column header value to be updated.
|
1834
1830
|
*/
|
1835
1831
|
'modifyColumnHeaderValue',
|
1836
1832
|
/**
|
package/pluginHooks.mjs
CHANGED
@@ -357,14 +357,12 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
357
357
|
/**
|
358
358
|
* Fired after retrieving information about a column header and appending it to the table header.
|
359
359
|
*
|
360
|
-
* Since the 12.2 the hook is triggered with the 3rd `headerLevel` argument.
|
361
|
-
*
|
362
360
|
* @event Hooks#afterGetColHeader
|
363
361
|
* @param {number} column Visual column index.
|
364
362
|
* @param {HTMLTableCellElement} TH Header's TH element.
|
365
|
-
* @param {number} [headerLevel=0]
|
366
|
-
* and negative (-1 to -
|
367
|
-
*
|
363
|
+
* @param {number} [headerLevel=0] (Since 12.2.0) Header level index. Accepts positive (0 to n)
|
364
|
+
* and negative (-1 to -n) values. For positive values, 0 points to the
|
365
|
+
* topmost header. For negative values, -1 points to the bottom-most
|
368
366
|
* header (the header closest to the cells).
|
369
367
|
*/
|
370
368
|
'afterGetColHeader',
|
@@ -1316,7 +1314,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1316
1314
|
*/
|
1317
1315
|
'modifyCopyableRange',
|
1318
1316
|
/**
|
1319
|
-
* Fired by {@link CopyPaste} plugin before copying the values
|
1317
|
+
* Fired by {@link CopyPaste} plugin before copying the values to the clipboard and before clearing values of
|
1320
1318
|
* the selected cells. This hook is fired when {@link Options#copyPaste} option is enabled.
|
1321
1319
|
*
|
1322
1320
|
* @event Hooks#beforeCut
|
@@ -1371,22 +1369,19 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1371
1369
|
* {@link Options#copyPaste} option is enabled.
|
1372
1370
|
*
|
1373
1371
|
* @event Hooks#afterCut
|
1374
|
-
* @param {Array[]} data An array of arrays
|
1372
|
+
* @param {Array[]} data An array of arrays with the cut data.
|
1375
1373
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1376
1374
|
* which was cut out.
|
1377
1375
|
*/
|
1378
1376
|
'afterCut',
|
1379
1377
|
/**
|
1380
|
-
* Fired before values are copied
|
1381
|
-
*
|
1382
|
-
* Since the 12.3.0 the hook is triggered with the 3rd `copiedHeadersCount` argument.
|
1378
|
+
* Fired before values are copied to the clipboard.
|
1383
1379
|
*
|
1384
1380
|
* @event Hooks#beforeCopy
|
1385
1381
|
* @param {Array[]} data An array of arrays which contains data to copied.
|
1386
1382
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1387
1383
|
* which will copied.
|
1388
|
-
* @param {{ columnHeadersCount: number }} copiedHeadersCount
|
1389
|
-
* the number of copied headers.
|
1384
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1390
1385
|
* @returns {*} If returns `false` then copying is canceled.
|
1391
1386
|
*
|
1392
1387
|
* @example
|
@@ -1449,6 +1444,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1449
1444
|
* @param {Array[]} data An array of arrays which contains the copied data.
|
1450
1445
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1451
1446
|
* which was copied.
|
1447
|
+
* @param {{ columnHeadersCount: number }} copiedHeadersCount (Since 12.3.0) The number of copied column headers.
|
1452
1448
|
*/
|
1453
1449
|
'afterCopy',
|
1454
1450
|
/**
|
@@ -1507,7 +1503,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1507
1503
|
* {@link Options#copyPaste} option is enabled.
|
1508
1504
|
*
|
1509
1505
|
* @event Hooks#afterPaste
|
1510
|
-
* @param {Array[]} data An array of arrays
|
1506
|
+
* @param {Array[]} data An array of arrays with the pasted data.
|
1511
1507
|
* @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
|
1512
1508
|
* that correspond to the previously selected area.
|
1513
1509
|
*/
|
@@ -1815,17 +1811,17 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
|
|
1815
1811
|
*/
|
1816
1812
|
'modifyColumnHeaderHeight',
|
1817
1813
|
/**
|
1818
|
-
* Fired while retrieving
|
1814
|
+
* Fired while retrieving a column header's value.
|
1819
1815
|
*
|
1820
1816
|
* @since 12.3.0
|
1821
1817
|
* @event Hooks#modifyColumnHeaderValue
|
1822
|
-
* @param {string} value
|
1823
|
-
* @param {number} visualColumnIndex
|
1824
|
-
* @param {number} [headerLevel=0]
|
1825
|
-
* and negative (-1 to -
|
1826
|
-
*
|
1818
|
+
* @param {string} value A column header value.
|
1819
|
+
* @param {number} visualColumnIndex A visual column index.
|
1820
|
+
* @param {number} [headerLevel=0] Header level index. Accepts positive (0 to n)
|
1821
|
+
* and negative (-1 to -n) values. For positive values, 0 points to the
|
1822
|
+
* topmost header. For negative values, -1 points to the bottom-most
|
1827
1823
|
* header (the header closest to the cells).
|
1828
|
-
* @returns {string}
|
1824
|
+
* @returns {string} The column header value to be updated.
|
1829
1825
|
*/
|
1830
1826
|
'modifyColumnHeaderValue',
|
1831
1827
|
/**
|
@@ -58,22 +58,7 @@ _pluginHooks.default.getSingleton().register('afterContextMenuExecute');
|
|
58
58
|
* * `true` (to enable default options),
|
59
59
|
* * `false` (to disable completely)
|
60
60
|
* * `{ uiContainer: containerDomElement }` (to declare a container for all of the Context Menu's dom elements to be placed in).
|
61
|
-
*
|
62
|
-
* or array of any available strings:
|
63
|
-
* * `'row_above'`
|
64
|
-
* * `'row_below'`
|
65
|
-
* * `'col_left'`
|
66
|
-
* * `'col_right'`
|
67
|
-
* * `'remove_row'`
|
68
|
-
* * `'remove_col'`
|
69
|
-
* * `'undo'`
|
70
|
-
* * `'redo'`
|
71
|
-
* * `'make_read_only'`
|
72
|
-
* * `'alignment'`
|
73
|
-
* * `'---------'` (menu item separator)
|
74
|
-
* * `'borders'` (with {@link Options#customBorders} turned on)
|
75
|
-
* * `'commentsAddEdit'` (with {@link Options#comments} turned on)
|
76
|
-
* * `'commentsRemove'` (with {@link Options#comments} turned on).
|
61
|
+
* * An array of [the available strings](@/guides/accessories-and-menus/context-menu.md#context-menu-with-specific-options)
|
77
62
|
*
|
78
63
|
* See [the context menu demo](@/guides/accessories-and-menus/context-menu.md) for examples.
|
79
64
|
*
|
@@ -51,22 +51,7 @@ Hooks.getSingleton().register('afterContextMenuExecute');
|
|
51
51
|
* * `true` (to enable default options),
|
52
52
|
* * `false` (to disable completely)
|
53
53
|
* * `{ uiContainer: containerDomElement }` (to declare a container for all of the Context Menu's dom elements to be placed in).
|
54
|
-
*
|
55
|
-
* or array of any available strings:
|
56
|
-
* * `'row_above'`
|
57
|
-
* * `'row_below'`
|
58
|
-
* * `'col_left'`
|
59
|
-
* * `'col_right'`
|
60
|
-
* * `'remove_row'`
|
61
|
-
* * `'remove_col'`
|
62
|
-
* * `'undo'`
|
63
|
-
* * `'redo'`
|
64
|
-
* * `'make_read_only'`
|
65
|
-
* * `'alignment'`
|
66
|
-
* * `'---------'` (menu item separator)
|
67
|
-
* * `'borders'` (with {@link Options#customBorders} turned on)
|
68
|
-
* * `'commentsAddEdit'` (with {@link Options#comments} turned on)
|
69
|
-
* * `'commentsRemove'` (with {@link Options#comments} turned on).
|
54
|
+
* * An array of [the available strings](@/guides/accessories-and-menus/context-menu.md#context-menu-with-specific-options)
|
70
55
|
*
|
71
56
|
* See [the context menu demo](@/guides/accessories-and-menus/context-menu.md) for examples.
|
72
57
|
*
|
@@ -88,28 +88,25 @@ var META_HEAD = ['<meta name="generator" content="Handsontable"/>', '<style type
|
|
88
88
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
89
89
|
/**
|
90
90
|
* @description
|
91
|
-
*
|
92
|
-
* using keyboard shortcuts and menu bar from the browser.
|
93
|
-
* Possible values:
|
94
|
-
* * `true` (to enable default options),
|
95
|
-
* * `false` (to disable completely).
|
91
|
+
* Copy, cut, and paste data by using the `CopyPaste` plugin.
|
96
92
|
*
|
97
|
-
*
|
98
|
-
* * `'columnsLimit'` (see {@link CopyPaste#columnsLimit})
|
99
|
-
* * `'rowsLimit'` (see {@link CopyPaste#rowsLimit})
|
100
|
-
* * `'pasteMode'` (see {@link CopyPaste#pasteMode})
|
101
|
-
* * `'copyColumnHeaders'`
|
102
|
-
* * `'copyColumnGroupHeaders'`
|
103
|
-
* * `'copyColumnHeadersOnly'`
|
104
|
-
* * `'uiContainer'` (see {@link CopyPaste#uiContainer}).
|
93
|
+
* Control the `CopyPaste` plugin programmatically through its [API methods](#methods).
|
105
94
|
*
|
106
|
-
*
|
95
|
+
* The user can access the copy-paste features through:
|
96
|
+
* - The [context menu](@/guides/cell-features/clipboard.md#context-menu).
|
97
|
+
* - The [keyboard shortcuts](@/guides/cell-features/clipboard.md#related-keyboard-shortcuts).
|
98
|
+
* - The browser's menu bar.
|
99
|
+
*
|
100
|
+
* Read more:
|
101
|
+
* - [Guides: Clipboard](@/guides/cell-features/clipboard.md)
|
102
|
+
* - [Configuration options: `copyPaste`](@/api/options.md#copypaste)
|
107
103
|
*
|
108
104
|
* @example
|
109
105
|
* ```js
|
110
|
-
* //
|
106
|
+
* // enable the plugin with the default configuration
|
111
107
|
* copyPaste: true,
|
112
|
-
*
|
108
|
+
*
|
109
|
+
* // or, enable the plugin with a custom configuration
|
113
110
|
* copyPaste: {
|
114
111
|
* columnsLimit: 25,
|
115
112
|
* rowsLimit: 50,
|
@@ -198,8 +195,10 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
198
195
|
key: "isEnabled",
|
199
196
|
value:
|
200
197
|
/**
|
201
|
-
* Checks if the plugin is enabled
|
202
|
-
*
|
198
|
+
* Checks if the [`CopyPaste`](#copypaste) plugin is enabled.
|
199
|
+
*
|
200
|
+
* This method gets called by Handsontable's [`beforeInit`](@/api/hooks.md#beforeinit) hook.
|
201
|
+
* If it returns `true`, the [`enablePlugin()`](#enableplugin) method gets called.
|
203
202
|
*
|
204
203
|
* @returns {boolean}
|
205
204
|
*/
|
@@ -208,7 +207,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
208
207
|
}
|
209
208
|
|
210
209
|
/**
|
211
|
-
* Enables the plugin
|
210
|
+
* Enables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
|
212
211
|
*/
|
213
212
|
}, {
|
214
213
|
key: "enablePlugin",
|
@@ -253,9 +252,10 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
253
252
|
}
|
254
253
|
|
255
254
|
/**
|
256
|
-
* Updates the plugin
|
255
|
+
* Updates the state of the [`CopyPaste`](#copypaste) plugin.
|
257
256
|
*
|
258
|
-
*
|
257
|
+
* Gets called when [`updateSettings()`](@/api/core.md#updatesettings)
|
258
|
+
* is invoked with any of the following configuration options:
|
259
259
|
* - [`copyPaste`](@/api/options.md#copypaste)
|
260
260
|
* - [`fragmentSelection`](@/api/options.md#fragmentselection)
|
261
261
|
*/
|
@@ -269,7 +269,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
269
269
|
}
|
270
270
|
|
271
271
|
/**
|
272
|
-
* Disables the plugin
|
272
|
+
* Disables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
|
273
273
|
*/
|
274
274
|
}, {
|
275
275
|
key: "disablePlugin",
|
@@ -281,12 +281,18 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
281
281
|
}
|
282
282
|
|
283
283
|
/**
|
284
|
-
* Copies the selected
|
284
|
+
* Copies the contents of the selected cells (and/or their related column headers) to the system clipboard.
|
285
|
+
*
|
286
|
+
* Takes an optional parameter (`copyMode`) that defines the scope of copying:
|
287
|
+
*
|
288
|
+
* | `copyMode` value | Description |
|
289
|
+
* | --------------------------- | --------------------------------------------------------------- |
|
290
|
+
* | `'cells-only'` (default) | Copy the selected cells |
|
291
|
+
* | `'with-column-headers'` | - Copy the selected cells<br>- Copy the nearest column headers |
|
292
|
+
* | `'with-all-column-headers'` | - Copy the selected cells<br>- Copy all related columns headers |
|
293
|
+
* | `'column-headers-only'` | Copy the nearest column headers (without copying cells) |
|
285
294
|
*
|
286
|
-
* @param {
|
287
|
-
* Defines the data range to copy. Possible values: `cells-only` (copy selected cells only),
|
288
|
-
* `column-headers-only` (copy the most-bottom column headers only), `with-all-column-headers` (copy cells
|
289
|
-
* with all column headers levels) or `with-column-headers` (copy cells with the most-bottom column headers).
|
295
|
+
* @param {string} [copyMode='cells-only'] Copy mode.
|
290
296
|
*/
|
291
297
|
}, {
|
292
298
|
key: "copy",
|
@@ -300,7 +306,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
300
306
|
}
|
301
307
|
|
302
308
|
/**
|
303
|
-
* Copies the
|
309
|
+
* Copies the contents of the selected cells.
|
304
310
|
*/
|
305
311
|
}, {
|
306
312
|
key: "copyCellsOnly",
|
@@ -308,7 +314,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
308
314
|
this.copy('cells-only');
|
309
315
|
}
|
310
316
|
/**
|
311
|
-
* Copies
|
317
|
+
* Copies the contents of column headers that are nearest to the selected cells.
|
312
318
|
*/
|
313
319
|
}, {
|
314
320
|
key: "copyColumnHeadersOnly",
|
@@ -316,7 +322,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
316
322
|
this.copy('column-headers-only');
|
317
323
|
}
|
318
324
|
/**
|
319
|
-
* Copies the selected
|
325
|
+
* Copies the contents of the selected cells and all their related column headers.
|
320
326
|
*/
|
321
327
|
}, {
|
322
328
|
key: "copyWithAllColumnHeaders",
|
@@ -324,7 +330,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
324
330
|
this.copy('with-column-group-headers');
|
325
331
|
}
|
326
332
|
/**
|
327
|
-
* Copies the selected
|
333
|
+
* Copies the contents of the selected cells and their nearest column headers.
|
328
334
|
*/
|
329
335
|
}, {
|
330
336
|
key: "copyWithColumnHeaders",
|
@@ -333,7 +339,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
333
339
|
}
|
334
340
|
|
335
341
|
/**
|
336
|
-
* Cuts the selected
|
342
|
+
* Cuts the contents of the selected cells to the system clipboard.
|
337
343
|
*/
|
338
344
|
}, {
|
339
345
|
key: "cut",
|
@@ -345,10 +351,10 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
345
351
|
}
|
346
352
|
|
347
353
|
/**
|
348
|
-
*
|
354
|
+
* Converts the contents of multiple ranges (`ranges`) into a single string.
|
349
355
|
*
|
350
356
|
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `endRow`, `startCol` and `endCol`.
|
351
|
-
* @returns {string}
|
357
|
+
* @returns {string} A string that will be copied to the clipboard.
|
352
358
|
*/
|
353
359
|
}, {
|
354
360
|
key: "getRangedCopyableData",
|
@@ -357,10 +363,10 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
357
363
|
}
|
358
364
|
|
359
365
|
/**
|
360
|
-
*
|
366
|
+
* Converts the contents of multiple ranges (`ranges`) into an array of arrays.
|
361
367
|
*
|
362
368
|
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
|
363
|
-
* @returns {Array[]}
|
369
|
+
* @returns {Array[]} An array of arrays that will be copied to the clipboard.
|
364
370
|
*/
|
365
371
|
}, {
|
366
372
|
key: "getRangedData",
|
@@ -371,12 +377,12 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
371
377
|
rows = _normalizeRanges.rows,
|
372
378
|
columns = _normalizeRanges.columns;
|
373
379
|
|
374
|
-
//
|
380
|
+
// concatenate all rows and columns data defined in ranges into one copyable string
|
375
381
|
(0, _array.arrayEach)(rows, function (row) {
|
376
382
|
var rowSet = [];
|
377
383
|
(0, _array.arrayEach)(columns, function (column) {
|
378
384
|
if (row < 0) {
|
379
|
-
//
|
385
|
+
// `row` as the second argument acts here as the `headerLevel` argument
|
380
386
|
rowSet.push(_this3.hot.getColHeader(column, row));
|
381
387
|
} else {
|
382
388
|
rowSet.push(_this3.hot.getCopyableData(row, column));
|
@@ -390,10 +396,10 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
390
396
|
/**
|
391
397
|
* Simulates the paste action.
|
392
398
|
*
|
393
|
-
*
|
399
|
+
* For security reasons, modern browsers don't allow reading from the system clipboard.
|
394
400
|
*
|
395
|
-
* @param {string} pastableText
|
396
|
-
* @param {string} [pastableHtml='']
|
401
|
+
* @param {string} pastableText The value to paste, as a raw string.
|
402
|
+
* @param {string} [pastableHtml=''] The value to paste, as HTML.
|
397
403
|
*/
|
398
404
|
}, {
|
399
405
|
key: "paste",
|
@@ -758,7 +764,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
758
764
|
}
|
759
765
|
|
760
766
|
/**
|
761
|
-
* Destroys the plugin instance.
|
767
|
+
* Destroys the `CopyPaste` plugin instance.
|
762
768
|
*/
|
763
769
|
}, {
|
764
770
|
key: "destroy",
|
@@ -786,7 +792,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
786
792
|
}
|
787
793
|
|
788
794
|
/**
|
789
|
-
*
|
795
|
+
* The maximum number of columns than can be copied to the clipboard.
|
790
796
|
*
|
791
797
|
* @type {number}
|
792
798
|
* @default Infinity
|