handsontable 0.0.0-next-820d8a2-20221122 → 0.0.0-next-6812ce6-20221122

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.

Files changed (57) hide show
  1. package/3rdparty/walkontable/src/cell/range.js +8 -0
  2. package/3rdparty/walkontable/src/cell/range.mjs +8 -0
  3. package/base.js +2 -2
  4. package/base.mjs +2 -2
  5. package/core.d.ts +1 -1
  6. package/core.js +37 -29
  7. package/core.mjs +37 -29
  8. package/dist/handsontable.css +2 -2
  9. package/dist/handsontable.full.css +2 -2
  10. package/dist/handsontable.full.js +3135 -2444
  11. package/dist/handsontable.full.min.css +2 -2
  12. package/dist/handsontable.full.min.js +62 -62
  13. package/dist/handsontable.js +2563 -1872
  14. package/dist/handsontable.min.css +2 -2
  15. package/dist/handsontable.min.js +3 -3
  16. package/dist/languages/all.js +1 -1
  17. package/dist/languages/all.min.js +1 -1
  18. package/dist/languages/en-US.js +1 -1
  19. package/dist/languages/en-US.min.js +1 -1
  20. package/helpers/mixed.js +1 -1
  21. package/helpers/mixed.mjs +1 -1
  22. package/i18n/constants.js +49 -42
  23. package/i18n/constants.mjs +45 -41
  24. package/i18n/languages/en-US.js +1 -1
  25. package/i18n/languages/en-US.mjs +1 -1
  26. package/languages/all.js +1 -1
  27. package/languages/en-US.js +1 -1
  28. package/languages/en-US.mjs +1 -1
  29. package/languages/index.js +1 -1
  30. package/package.json +1 -1
  31. package/pluginHooks.d.ts +7 -2
  32. package/pluginHooks.js +23 -3
  33. package/pluginHooks.mjs +23 -3
  34. package/plugins/contextMenu/contextMenu.d.ts +4 -3
  35. package/plugins/copyPaste/contextMenuItem/copy.js +4 -16
  36. package/plugins/copyPaste/contextMenuItem/copy.mjs +4 -4
  37. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +35 -0
  38. package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +31 -0
  39. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +35 -0
  40. package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +31 -0
  41. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +35 -0
  42. package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +31 -0
  43. package/plugins/copyPaste/copyPaste.d.ts +10 -2
  44. package/plugins/copyPaste/copyPaste.js +263 -173
  45. package/plugins/copyPaste/copyPaste.mjs +263 -173
  46. package/plugins/copyPaste/copyableRanges.js +260 -0
  47. package/plugins/copyPaste/copyableRanges.mjs +255 -0
  48. package/plugins/nestedHeaders/nestedHeaders.js +114 -11
  49. package/plugins/nestedHeaders/nestedHeaders.mjs +114 -11
  50. package/plugins/nestedHeaders/stateManager/headersTree.js +1 -0
  51. package/plugins/nestedHeaders/stateManager/headersTree.mjs +1 -0
  52. package/plugins/nestedHeaders/stateManager/index.js +21 -10
  53. package/plugins/nestedHeaders/stateManager/index.mjs +21 -10
  54. package/selection/selection.js +2 -1
  55. package/selection/selection.mjs +2 -1
  56. package/tableView.js +133 -63
  57. package/tableView.mjs +133 -63
@@ -231,7 +231,7 @@ var _dictionary;
231
231
  var C = _handsontable.default.languages.dictionaryKeys;
232
232
  var dictionary = (_dictionary = {
233
233
  languageCode: 'en-US'
234
- }, (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_NO_ITEMS, 'No available options'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ROW_ABOVE, 'Insert row above'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ROW_BELOW, 'Insert row below'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_INSERT_LEFT, 'Insert column left'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_INSERT_RIGHT, 'Insert column right'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_ROW, ['Remove row', 'Remove rows']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_COLUMN, ['Remove column', 'Remove columns']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_UNDO, 'Undo'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REDO, 'Redo'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_READ_ONLY, 'Read only'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_CLEAR_COLUMN, 'Clear column'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT, 'Alignment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT, 'Left'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER, 'Center'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT, 'Right'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY, 'Justify'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP, 'Top'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE, 'Middle'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM, 'Bottom'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_FREEZE_COLUMN, 'Freeze column'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN, 'Unfreeze column'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS, 'Borders'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_TOP, 'Top'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_RIGHT, 'Right'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_BOTTOM, 'Bottom'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_LEFT, 'Left'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_BORDERS, 'Remove border(s)'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ADD_COMMENT, 'Add comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_EDIT_COMMENT, 'Edit comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_COMMENT, 'Delete comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT, 'Read-only comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_MERGE_CELLS, 'Merge cells'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_UNMERGE_CELLS, 'Unmerge cells'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_COPY, 'Copy'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_CUT, 'Cut'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD, 'Insert child row'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD, 'Detach from parent'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_HIDE_COLUMN, ['Hide column', 'Hide columns']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_SHOW_COLUMN, ['Show column', 'Show columns']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_HIDE_ROW, ['Hide row', 'Hide rows']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_SHOW_ROW, ['Show row', 'Show rows']), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NONE, 'None'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_EMPTY, 'Is empty'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_EMPTY, 'Is not empty'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_EQUAL, 'Is equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_EQUAL, 'Is not equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_BEGINS_WITH, 'Begins with'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_ENDS_WITH, 'Ends with'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_CONTAINS, 'Contains'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_CONTAIN, 'Does not contain'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_GREATER_THAN, 'Greater than'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL, 'Greater than or equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_LESS_THAN, 'Less than'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL, 'Less than or equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_BETWEEN, 'Is between'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_BETWEEN, 'Is not between'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_AFTER, 'After'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_BEFORE, 'Before'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_TODAY, 'Today'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_TOMORROW, 'Tomorrow'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_YESTERDAY, 'Yesterday'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_VALUES_BLANK_CELLS, 'Blank cells'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_DIVS_FILTER_BY_CONDITION, 'Filter by condition'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_DIVS_FILTER_BY_VALUE, 'Filter by value'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_LABELS_CONJUNCTION, 'And'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_LABELS_DISJUNCTION, 'Or'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_SELECT_ALL, 'Select all'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_CLEAR, 'Clear'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_OK, 'OK'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_CANCEL, 'Cancel'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_SEARCH, 'Search'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_VALUE, 'Value'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE, 'Second value'), _dictionary);
234
+ }, (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_NO_ITEMS, 'No available options'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ROW_ABOVE, 'Insert row above'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ROW_BELOW, 'Insert row below'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_INSERT_LEFT, 'Insert column left'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_INSERT_RIGHT, 'Insert column right'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_ROW, ['Remove row', 'Remove rows']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_COLUMN, ['Remove column', 'Remove columns']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_UNDO, 'Undo'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REDO, 'Redo'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_READ_ONLY, 'Read only'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_CLEAR_COLUMN, 'Clear column'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT, 'Alignment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_LEFT, 'Left'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_CENTER, 'Center'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_RIGHT, 'Right'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_JUSTIFY, 'Justify'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_TOP, 'Top'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_MIDDLE, 'Middle'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ALIGNMENT_BOTTOM, 'Bottom'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_FREEZE_COLUMN, 'Freeze column'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_UNFREEZE_COLUMN, 'Unfreeze column'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS, 'Borders'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_TOP, 'Top'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_RIGHT, 'Right'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_BOTTOM, 'Bottom'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_BORDERS_LEFT, 'Left'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_BORDERS, 'Remove border(s)'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_ADD_COMMENT, 'Add comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_EDIT_COMMENT, 'Edit comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_REMOVE_COMMENT, 'Delete comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_READ_ONLY_COMMENT, 'Read-only comment'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_MERGE_CELLS, 'Merge cells'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_UNMERGE_CELLS, 'Unmerge cells'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_COPY, 'Copy'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS, ['Copy with header', 'Copy with headers']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS, ['Copy with group header', 'Copy with group headers']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY, ['Copy header only', 'Copy headers only']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_CUT, 'Cut'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_NESTED_ROWS_INSERT_CHILD, 'Insert child row'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_NESTED_ROWS_DETACH_CHILD, 'Detach from parent'), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_HIDE_COLUMN, ['Hide column', 'Hide columns']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_SHOW_COLUMN, ['Show column', 'Show columns']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_HIDE_ROW, ['Hide row', 'Hide rows']), (0, _defineProperty2.default)(_dictionary, C.CONTEXTMENU_ITEMS_SHOW_ROW, ['Show row', 'Show rows']), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NONE, 'None'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_EMPTY, 'Is empty'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_EMPTY, 'Is not empty'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_EQUAL, 'Is equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_EQUAL, 'Is not equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_BEGINS_WITH, 'Begins with'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_ENDS_WITH, 'Ends with'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_CONTAINS, 'Contains'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_CONTAIN, 'Does not contain'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_GREATER_THAN, 'Greater than'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_GREATER_THAN_OR_EQUAL, 'Greater than or equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_LESS_THAN, 'Less than'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_LESS_THAN_OR_EQUAL, 'Less than or equal to'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_BETWEEN, 'Is between'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_NOT_BETWEEN, 'Is not between'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_AFTER, 'After'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_BEFORE, 'Before'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_TODAY, 'Today'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_TOMORROW, 'Tomorrow'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_CONDITIONS_YESTERDAY, 'Yesterday'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_VALUES_BLANK_CELLS, 'Blank cells'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_DIVS_FILTER_BY_CONDITION, 'Filter by condition'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_DIVS_FILTER_BY_VALUE, 'Filter by value'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_LABELS_CONJUNCTION, 'And'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_LABELS_DISJUNCTION, 'Or'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_SELECT_ALL, 'Select all'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_CLEAR, 'Clear'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_OK, 'OK'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_CANCEL, 'Cancel'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_SEARCH, 'Search'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_VALUE, 'Value'), (0, _defineProperty2.default)(_dictionary, C.FILTERS_BUTTONS_PLACEHOLDER_SECOND_VALUE, 'Second value'), _dictionary);
235
235
  _handsontable.default.languages.registerLanguageDictionary(dictionary);
236
236
  var _default = dictionary;
237
237
  exports.default = _default;
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-820d8a2-20221122",
13
+ "version": "0.0.0-next-6812ce6-20221122",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
package/pluginHooks.d.ts CHANGED
@@ -65,13 +65,15 @@ export interface Events {
65
65
  afterChangesObserved?: () => void;
66
66
  afterColumnCollapse?: (currentCollapsedColumns: number[], destinationCollapsedColumns: number[], collapsePossible: boolean, successfullyCollapsed: boolean) => void;
67
67
  afterColumnExpand?: (currentCollapsedColumns: number[], destinationCollapsedColumns: number[], expandPossible: boolean, successfullyExpanded: boolean) => void;
68
+ afterColumnFreeze?: (columnIndex: number, isFreezingPerformed: boolean) => void;
68
69
  afterColumnMove?: (movedColumns: number[], finalIndex: number, dropIndex: number | undefined, movePossible: boolean, orderChanged: boolean) => void;
69
70
  afterColumnResize?: (newSize: number, column: number, isDoubleClick: boolean) => void;
70
71
  afterColumnSort?: (currentSortConfig: ColumnSortingConfig[], destinationSortConfigs: ColumnSortingConfig[]) => void;
72
+ afterColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void;
71
73
  afterContextMenuDefaultOptions?: (predefinedItems: Array<ContextMenuPredefinedMenuItemKey | ContextMenuMenuItemConfig>) => void;
72
74
  afterContextMenuHide?: (context: ContextMenu) => void;
73
75
  afterContextMenuShow?: (context: ContextMenu) => void;
74
- afterCopy?: (data: CellValue[][], coords: RangeType[]) => void;
76
+ afterCopy?: (data: CellValue[][], coords: RangeType[], copiedHeadersCount: { columnHeadersCount: number }) => void;
75
77
  afterCopyLimit?: (selectedRows: number, selectedColumns: number, copyRowsLimit: number, copyColumnsLimit: number) => void;
76
78
  afterCreateCol?: (index: number, amount: number, source?: ChangeSource) => void;
77
79
  afterCreateRow?: (index: number, amount: number, source?: ChangeSource) => void;
@@ -158,12 +160,14 @@ export interface Events {
158
160
  beforeChangeRender?: (changes: CellChange[], source: ChangeSource) => void;
159
161
  beforeColumnCollapse?: (currentCollapsedColumn: number[], destinationCollapsedColumns: number[], collapsePossible: boolean) => void | boolean;
160
162
  beforeColumnExpand?: (currentCollapsedColumn: number[], destinationCollapsedColumns: number[], expandPossible: boolean) => void | boolean;
163
+ beforeColumnFreeze?: (columnIndex: number, isFreezingPerformed: boolean) => void | boolean;
161
164
  beforeColumnMove?: (movedColumns: number[], finalIndex: number, dropIndex: number | undefined, movePossible: boolean) => void | boolean;
162
165
  beforeColumnResize?: (newSize: number, column: number, isDoubleClick: boolean) => void | number;
163
166
  beforeColumnSort?: (currentSortConfig: ColumnSortingConfig[], destinationSortConfigs: ColumnSortingConfig[]) => void | boolean;
167
+ beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
164
168
  beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
165
169
  beforeContextMenuShow?: (context: ContextMenu) => void;
166
- beforeCopy?: (data: CellValue[][], coords: RangeType[]) => void | boolean;
170
+ beforeCopy?: (data: CellValue[][], coords: RangeType[], copiedHeadersCount: { columnHeadersCount: number }) => void | boolean;
167
171
  beforeCreateCol?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
168
172
  beforeCreateRow?: (index: number, amount: number, source?: ChangeSource) => void | boolean;
169
173
  beforeCut?: (data: CellValue[][], coords: RangeType[]) => void | boolean;
@@ -223,6 +227,7 @@ export interface Events {
223
227
  modifyAutofillRange?: (startArea: Array<[number, number, number, number]>, entireArea: Array<[number, number, number, number]>) => void;
224
228
  modifyColHeader?: (column: number) => void;
225
229
  modifyColumnHeaderHeight?: () => void;
230
+ modifyColumnHeaderValue?: (headerValue: string, visualColumnIndex: number, headerLevel: number) => void | string;
226
231
  modifyColWidth?: (width: number, column: number) => void;
227
232
  modifyCopyableRange?: (copyableRanges: RangeType[]) => void;
228
233
  modifyData?: (row: number, column: number, valueHolder: { value: CellValue }, ioMode: 'get' | 'set') => void;
package/pluginHooks.js CHANGED
@@ -367,8 +367,10 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
367
367
  * @event Hooks#afterGetColHeader
368
368
  * @param {number} column Visual column index.
369
369
  * @param {HTMLTableCellElement} TH Header's TH element.
370
- * @param {number} [headerLevel=0] The index of header level counting from the top (positive
371
- * values counting from 0 to N).
370
+ * @param {number} [headerLevel=0] The index of header level. The header level accepts positive (0 to N)
371
+ * and negative (-1 to -N) values. For positive values, 0 points to the
372
+ * top most header, and for negative direction, -1 points to the most bottom
373
+ * header (the header closest to the cells).
372
374
  */
373
375
  'afterGetColHeader',
374
376
  /**
@@ -1374,7 +1376,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
1374
1376
  * {@link Options#copyPaste} option is enabled.
1375
1377
  *
1376
1378
  * @event Hooks#afterCut
1377
- * @param {Array[]} data An array of arrays which contains the cutted out data.
1379
+ * @param {Array[]} data An array of arrays which contains the cut out data.
1378
1380
  * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1379
1381
  * which was cut out.
1380
1382
  */
@@ -1382,10 +1384,14 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
1382
1384
  /**
1383
1385
  * Fired before values are copied into clipboard.
1384
1386
  *
1387
+ * Since the 12.3.0 the hook is triggered with the 3rd `copiedHeadersCount` argument.
1388
+ *
1385
1389
  * @event Hooks#beforeCopy
1386
1390
  * @param {Array[]} data An array of arrays which contains data to copied.
1387
1391
  * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1388
1392
  * which will copied.
1393
+ * @param {{ columnHeadersCount: number }} copiedHeadersCount An object with keys that holds information with
1394
+ * the number of copied headers.
1389
1395
  * @returns {*} If returns `false` then copying is canceled.
1390
1396
  *
1391
1397
  * @example
@@ -1813,6 +1819,20 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
1813
1819
  * @event Hooks#modifyColumnHeaderHeight
1814
1820
  */
1815
1821
  'modifyColumnHeaderHeight',
1822
+ /**
1823
+ * Fired while retrieving the column header value.
1824
+ *
1825
+ * @since 12.3.0
1826
+ * @event Hooks#modifyColumnHeaderValue
1827
+ * @param {string} value The column header value.
1828
+ * @param {number} visualColumnIndex The visual column index.
1829
+ * @param {number} [headerLevel=0] The index of header level. The header level accepts positive (0 to N)
1830
+ * and negative (-1 to -N) values. For positive values, 0 points to the
1831
+ * top most header, and for negative direction, -1 points to the most bottom
1832
+ * header (the header closest to the cells).
1833
+ * @returns {string} Returns the column header value to update.
1834
+ */
1835
+ 'modifyColumnHeaderValue',
1816
1836
  /**
1817
1837
  * Fired by {@link UndoRedo} plugin before the undo action. Contains information about the action that is being undone.
1818
1838
  * This hook is fired when {@link Options#undo} option is enabled.
package/pluginHooks.mjs CHANGED
@@ -362,8 +362,10 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
362
362
  * @event Hooks#afterGetColHeader
363
363
  * @param {number} column Visual column index.
364
364
  * @param {HTMLTableCellElement} TH Header's TH element.
365
- * @param {number} [headerLevel=0] The index of header level counting from the top (positive
366
- * values counting from 0 to N).
365
+ * @param {number} [headerLevel=0] The index of header level. The header level accepts positive (0 to N)
366
+ * and negative (-1 to -N) values. For positive values, 0 points to the
367
+ * top most header, and for negative direction, -1 points to the most bottom
368
+ * header (the header closest to the cells).
367
369
  */
368
370
  'afterGetColHeader',
369
371
  /**
@@ -1369,7 +1371,7 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
1369
1371
  * {@link Options#copyPaste} option is enabled.
1370
1372
  *
1371
1373
  * @event Hooks#afterCut
1372
- * @param {Array[]} data An array of arrays which contains the cutted out data.
1374
+ * @param {Array[]} data An array of arrays which contains the cut out data.
1373
1375
  * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1374
1376
  * which was cut out.
1375
1377
  */
@@ -1377,10 +1379,14 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
1377
1379
  /**
1378
1380
  * Fired before values are copied into clipboard.
1379
1381
  *
1382
+ * Since the 12.3.0 the hook is triggered with the 3rd `copiedHeadersCount` argument.
1383
+ *
1380
1384
  * @event Hooks#beforeCopy
1381
1385
  * @param {Array[]} data An array of arrays which contains data to copied.
1382
1386
  * @param {object[]} coords An array of objects with ranges of the visual indexes (`startRow`, `startCol`, `endRow`, `endCol`)
1383
1387
  * which will copied.
1388
+ * @param {{ columnHeadersCount: number }} copiedHeadersCount An object with keys that holds information with
1389
+ * the number of copied headers.
1384
1390
  * @returns {*} If returns `false` then copying is canceled.
1385
1391
  *
1386
1392
  * @example
@@ -1808,6 +1814,20 @@ var REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-sen
1808
1814
  * @event Hooks#modifyColumnHeaderHeight
1809
1815
  */
1810
1816
  'modifyColumnHeaderHeight',
1817
+ /**
1818
+ * Fired while retrieving the column header value.
1819
+ *
1820
+ * @since 12.3.0
1821
+ * @event Hooks#modifyColumnHeaderValue
1822
+ * @param {string} value The column header value.
1823
+ * @param {number} visualColumnIndex The visual column index.
1824
+ * @param {number} [headerLevel=0] The index of header level. The header level accepts positive (0 to N)
1825
+ * and negative (-1 to -N) values. For positive values, 0 points to the
1826
+ * top most header, and for negative direction, -1 points to the most bottom
1827
+ * header (the header closest to the cells).
1828
+ * @returns {string} Returns the column header value to update.
1829
+ */
1830
+ 'modifyColumnHeaderValue',
1811
1831
  /**
1812
1832
  * Fired by {@link UndoRedo} plugin before the undo action. Contains information about the action that is being undone.
1813
1833
  * This hook is fired when {@link Options#undo} option is enabled.
@@ -4,9 +4,10 @@ import { BasePlugin } from '../base';
4
4
 
5
5
  export type PredefinedMenuItemKey = 'row_above' | 'row_below' | 'col_left' | 'col_right' |
6
6
  '---------' | 'remove_row' | 'remove_col' | 'clear_column' | 'undo' | 'redo' |
7
- 'make_read_only' | 'alignment' | 'cut' | 'copy' | 'freeze_column' | 'unfreeze_column' |
8
- 'borders' | 'commentsAddEdit' | 'commentsRemove' | 'commentsReadOnly' | 'mergeCells' |
9
- 'add_child' | 'detach_from_parent' | 'hidden_columns_hide' | 'hidden_columns_show' |
7
+ 'make_read_only' | 'alignment' | 'cut' | 'copy' | 'copy_column_headers_only' |
8
+ 'copy_with_column_group_headers' | 'copy_with_column_headers' | 'freeze_column' |
9
+ 'unfreeze_column' | 'borders' | 'commentsAddEdit' | 'commentsRemove' | 'commentsReadOnly' |
10
+ 'mergeCells' | 'add_child' | 'detach_from_parent' | 'hidden_columns_hide' | 'hidden_columns_show' |
10
11
  'hidden_rows_hide' | 'hidden_rows_show' | 'filter_by_condition' | 'filter_operators' |
11
12
  'filter_by_condition2' | 'filter_by_value' | 'filter_action_bar';
12
13
 
@@ -1,20 +1,8 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
- require("core-js/modules/es.array.iterator.js");
5
- require("core-js/modules/es.object.to-string.js");
6
- require("core-js/modules/es.string.iterator.js");
7
- require("core-js/modules/es.weak-map.js");
8
- require("core-js/modules/web.dom-collections.iterator.js");
9
- require("core-js/modules/es.object.get-own-property-descriptor.js");
10
- require("core-js/modules/es.symbol.js");
11
- require("core-js/modules/es.symbol.description.js");
12
- require("core-js/modules/es.symbol.iterator.js");
13
3
  exports.__esModule = true;
14
4
  exports.default = copyItem;
15
- var C = _interopRequireWildcard(require("../../../i18n/constants"));
16
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
5
+ var _constants = require("../../../i18n/constants");
18
6
  /**
19
7
  * @param {CopyPaste} copyPastePlugin The plugin instance.
20
8
  * @returns {object}
@@ -23,10 +11,10 @@ function copyItem(copyPastePlugin) {
23
11
  return {
24
12
  key: 'copy',
25
13
  name: function name() {
26
- return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_COPY);
14
+ return this.getTranslatedPhrase(_constants.CONTEXTMENU_ITEMS_COPY);
27
15
  },
28
16
  callback: function callback() {
29
- copyPastePlugin.copy();
17
+ copyPastePlugin.copyCellsOnly();
30
18
  },
31
19
  disabled: function disabled() {
32
20
  if (this.countRows() === 0 || this.countCols() === 0) {
@@ -34,7 +22,7 @@ function copyItem(copyPastePlugin) {
34
22
  }
35
23
  var selected = this.getSelected();
36
24
 
37
- // Disable for no selection or for non-contiquous selection.
25
+ // Disable for no selection or for non-contiguous selection.
38
26
  if (!selected || selected.length > 1) {
39
27
  return true;
40
28
  }
@@ -1,4 +1,4 @@
1
- import * as C from "../../../i18n/constants.mjs";
1
+ import { CONTEXTMENU_ITEMS_COPY } from "../../../i18n/constants.mjs";
2
2
  /**
3
3
  * @param {CopyPaste} copyPastePlugin The plugin instance.
4
4
  * @returns {object}
@@ -7,10 +7,10 @@ export default function copyItem(copyPastePlugin) {
7
7
  return {
8
8
  key: 'copy',
9
9
  name: function name() {
10
- return this.getTranslatedPhrase(C.CONTEXTMENU_ITEMS_COPY);
10
+ return this.getTranslatedPhrase(CONTEXTMENU_ITEMS_COPY);
11
11
  },
12
12
  callback: function callback() {
13
- copyPastePlugin.copy();
13
+ copyPastePlugin.copyCellsOnly();
14
14
  },
15
15
  disabled: function disabled() {
16
16
  if (this.countRows() === 0 || this.countCols() === 0) {
@@ -18,7 +18,7 @@ export default function copyItem(copyPastePlugin) {
18
18
  }
19
19
  var selected = this.getSelected();
20
20
 
21
- // Disable for no selection or for non-contiquous selection.
21
+ // Disable for no selection or for non-contiguous selection.
22
22
  if (!selected || selected.length > 1) {
23
23
  return true;
24
24
  }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = copyColumnHeadersOnlyItem;
5
+ var _constants = require("../../../i18n/constants");
6
+ /**
7
+ * @param {CopyPaste} copyPastePlugin The plugin instance.
8
+ * @returns {object}
9
+ */
10
+ function copyColumnHeadersOnlyItem(copyPastePlugin) {
11
+ return {
12
+ key: 'copy_column_headers_only',
13
+ name: function name() {
14
+ var selectedRange = this.getSelectedRangeLast();
15
+ var nounForm = selectedRange ? Math.min(selectedRange.getWidth() - 1, 1) : 0;
16
+ return this.getTranslatedPhrase(_constants.CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY, nounForm);
17
+ },
18
+ callback: function callback() {
19
+ copyPastePlugin.copyColumnHeadersOnly();
20
+ },
21
+ disabled: function disabled() {
22
+ if (!this.hasColHeaders()) {
23
+ return true;
24
+ }
25
+ var selected = this.getSelected();
26
+
27
+ // Disable for no selection or for non-contiguous selection.
28
+ if (!selected || selected.length > 1) {
29
+ return true;
30
+ }
31
+ return false;
32
+ },
33
+ hidden: false
34
+ };
35
+ }
@@ -0,0 +1,31 @@
1
+ import { CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY } from "../../../i18n/constants.mjs";
2
+ /**
3
+ * @param {CopyPaste} copyPastePlugin The plugin instance.
4
+ * @returns {object}
5
+ */
6
+ export default function copyColumnHeadersOnlyItem(copyPastePlugin) {
7
+ return {
8
+ key: 'copy_column_headers_only',
9
+ name: function name() {
10
+ var selectedRange = this.getSelectedRangeLast();
11
+ var nounForm = selectedRange ? Math.min(selectedRange.getWidth() - 1, 1) : 0;
12
+ return this.getTranslatedPhrase(CONTEXTMENU_ITEMS_COPY_COLUMN_HEADERS_ONLY, nounForm);
13
+ },
14
+ callback: function callback() {
15
+ copyPastePlugin.copyColumnHeadersOnly();
16
+ },
17
+ disabled: function disabled() {
18
+ if (!this.hasColHeaders()) {
19
+ return true;
20
+ }
21
+ var selected = this.getSelected();
22
+
23
+ // Disable for no selection or for non-contiguous selection.
24
+ if (!selected || selected.length > 1) {
25
+ return true;
26
+ }
27
+ return false;
28
+ },
29
+ hidden: false
30
+ };
31
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = copyWithColumnGroupHeadersItem;
5
+ var _constants = require("../../../i18n/constants");
6
+ /**
7
+ * @param {CopyPaste} copyPastePlugin The plugin instance.
8
+ * @returns {object}
9
+ */
10
+ function copyWithColumnGroupHeadersItem(copyPastePlugin) {
11
+ return {
12
+ key: 'copy_with_column_group_headers',
13
+ name: function name() {
14
+ var selectedRange = this.getSelectedRangeLast();
15
+ var nounForm = selectedRange ? Math.min(selectedRange.getWidth() - 1, 1) : 0;
16
+ return this.getTranslatedPhrase(_constants.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS, nounForm);
17
+ },
18
+ callback: function callback() {
19
+ copyPastePlugin.copyWithAllColumnHeaders();
20
+ },
21
+ disabled: function disabled() {
22
+ if (!this.hasColHeaders() || !this.getSettings().nestedHeaders) {
23
+ return true;
24
+ }
25
+ var selected = this.getSelected();
26
+
27
+ // Disable for no selection or for non-contiguous selection.
28
+ if (!selected || selected.length > 1) {
29
+ return true;
30
+ }
31
+ return false;
32
+ },
33
+ hidden: false
34
+ };
35
+ }
@@ -0,0 +1,31 @@
1
+ import { CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS } from "../../../i18n/constants.mjs";
2
+ /**
3
+ * @param {CopyPaste} copyPastePlugin The plugin instance.
4
+ * @returns {object}
5
+ */
6
+ export default function copyWithColumnGroupHeadersItem(copyPastePlugin) {
7
+ return {
8
+ key: 'copy_with_column_group_headers',
9
+ name: function name() {
10
+ var selectedRange = this.getSelectedRangeLast();
11
+ var nounForm = selectedRange ? Math.min(selectedRange.getWidth() - 1, 1) : 0;
12
+ return this.getTranslatedPhrase(CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_GROUP_HEADERS, nounForm);
13
+ },
14
+ callback: function callback() {
15
+ copyPastePlugin.copyWithAllColumnHeaders();
16
+ },
17
+ disabled: function disabled() {
18
+ if (!this.hasColHeaders() || !this.getSettings().nestedHeaders) {
19
+ return true;
20
+ }
21
+ var selected = this.getSelected();
22
+
23
+ // Disable for no selection or for non-contiguous selection.
24
+ if (!selected || selected.length > 1) {
25
+ return true;
26
+ }
27
+ return false;
28
+ },
29
+ hidden: false
30
+ };
31
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.default = copyWithColumnHeadersItem;
5
+ var _constants = require("../../../i18n/constants");
6
+ /**
7
+ * @param {CopyPaste} copyPastePlugin The plugin instance.
8
+ * @returns {object}
9
+ */
10
+ function copyWithColumnHeadersItem(copyPastePlugin) {
11
+ return {
12
+ key: 'copy_with_column_headers',
13
+ name: function name() {
14
+ var selectedRange = this.getSelectedRangeLast();
15
+ var nounForm = selectedRange ? Math.min(selectedRange.getWidth() - 1, 1) : 0;
16
+ return this.getTranslatedPhrase(_constants.CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS, nounForm);
17
+ },
18
+ callback: function callback() {
19
+ copyPastePlugin.copyWithColumnHeaders();
20
+ },
21
+ disabled: function disabled() {
22
+ if (!this.hasColHeaders()) {
23
+ return true;
24
+ }
25
+ var selected = this.getSelected();
26
+
27
+ // Disable for no selection or for non-contiguous selection.
28
+ if (!selected || selected.length > 1) {
29
+ return true;
30
+ }
31
+ return false;
32
+ },
33
+ hidden: false
34
+ };
35
+ }
@@ -0,0 +1,31 @@
1
+ import { CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS } from "../../../i18n/constants.mjs";
2
+ /**
3
+ * @param {CopyPaste} copyPastePlugin The plugin instance.
4
+ * @returns {object}
5
+ */
6
+ export default function copyWithColumnHeadersItem(copyPastePlugin) {
7
+ return {
8
+ key: 'copy_with_column_headers',
9
+ name: function name() {
10
+ var selectedRange = this.getSelectedRangeLast();
11
+ var nounForm = selectedRange ? Math.min(selectedRange.getWidth() - 1, 1) : 0;
12
+ return this.getTranslatedPhrase(CONTEXTMENU_ITEMS_COPY_WITH_COLUMN_HEADERS, nounForm);
13
+ },
14
+ callback: function callback() {
15
+ copyPastePlugin.copyWithColumnHeaders();
16
+ },
17
+ disabled: function disabled() {
18
+ if (!this.hasColHeaders()) {
19
+ return true;
20
+ }
21
+ var selected = this.getSelected();
22
+
23
+ // Disable for no selection or for non-contiguous selection.
24
+ if (!selected || selected.length > 1) {
25
+ return true;
26
+ }
27
+ return false;
28
+ },
29
+ hidden: false
30
+ };
31
+ }
@@ -6,10 +6,14 @@ export interface DetailedSettings {
6
6
  pasteMode?: PasteModeType;
7
7
  rowsLimit?: number;
8
8
  columnsLimit?: number;
9
+ copyColumnHeaders?: boolean;
10
+ copyColumnGroupHeaders?: boolean;
11
+ copyColumnHeadersOnly?: boolean;
9
12
  }
10
13
 
11
14
  export type Settings = boolean | DetailedSettings;
12
15
  export type PasteModeType = 'overwrite' | 'shift_down' | 'shift_right';
16
+ export type CopyModeType = 'cells-only' | 'column-headers-only' | 'with-all-column-headers' | 'with-column-headers';
13
17
 
14
18
  export interface RangeType {
15
19
  startRow: number;
@@ -22,11 +26,15 @@ export class CopyPaste extends BasePlugin {
22
26
  constructor(hotInstance: Core);
23
27
 
24
28
  columnsLimit: number;
25
- pasteMode: string;
26
29
  rowsLimit: number;
30
+ pasteMode: string;
27
31
 
28
32
  isEnabled(): boolean;
29
- copy(): void;
33
+ copy(copyMode?: CopyModeType): void;
34
+ copyCellsOnly(): void;
35
+ copyColumnHeadersOnly(): void;
36
+ copyWithAllColumnHeaders(): void;
37
+ copyWithColumnHeaders(): void;
30
38
  cut(): void;
31
39
  getRangedCopyableData(ranges: RangeType[]): string;
32
40
  getRangedData(ranges: RangeType[]): CellValue[][];