handsontable 12.2.0 → 12.3.0-next-bb1a7c2-20221208
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/border.js +13 -6
- package/3rdparty/walkontable/src/border.mjs +12 -5
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +10 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +10 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -1
- package/3rdparty/walkontable/src/cell/coords.d.ts +1 -1
- package/3rdparty/walkontable/src/cell/coords.js +64 -26
- package/3rdparty/walkontable/src/cell/coords.mjs +64 -26
- package/3rdparty/walkontable/src/cell/range.d.ts +19 -16
- package/3rdparty/walkontable/src/cell/range.js +199 -104
- package/3rdparty/walkontable/src/cell/range.mjs +201 -106
- package/3rdparty/walkontable/src/core/_base.js +17 -3
- package/3rdparty/walkontable/src/core/_base.mjs +20 -6
- package/3rdparty/walkontable/src/core/clone.js +13 -7
- package/3rdparty/walkontable/src/core/clone.mjs +15 -9
- package/3rdparty/walkontable/src/core/core.js +8 -2
- package/3rdparty/walkontable/src/core/core.mjs +10 -4
- package/3rdparty/walkontable/src/event.js +10 -1
- package/3rdparty/walkontable/src/event.mjs +10 -1
- package/3rdparty/walkontable/src/facade/core.js +16 -2
- package/3rdparty/walkontable/src/facade/core.mjs +22 -8
- package/3rdparty/walkontable/src/filter/column.js +16 -2
- package/3rdparty/walkontable/src/filter/column.mjs +16 -2
- package/3rdparty/walkontable/src/filter/row.js +16 -2
- package/3rdparty/walkontable/src/filter/row.mjs +16 -2
- package/3rdparty/walkontable/src/overlay/_base.js +17 -3
- package/3rdparty/walkontable/src/overlay/_base.mjs +24 -10
- package/3rdparty/walkontable/src/overlay/bottom.js +13 -7
- package/3rdparty/walkontable/src/overlay/bottom.mjs +15 -9
- package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.js +8 -2
- package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.mjs +10 -4
- package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -2
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +10 -4
- package/3rdparty/walkontable/src/overlay/top.js +13 -7
- package/3rdparty/walkontable/src/overlay/top.mjs +15 -9
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +13 -7
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +15 -9
- package/3rdparty/walkontable/src/overlays.js +69 -19
- package/3rdparty/walkontable/src/overlays.mjs +71 -21
- package/3rdparty/walkontable/src/renderer/_base.js +16 -2
- package/3rdparty/walkontable/src/renderer/_base.mjs +20 -6
- package/3rdparty/walkontable/src/renderer/cells.js +8 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +20 -14
- package/3rdparty/walkontable/src/renderer/colGroup.js +8 -2
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +19 -13
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +8 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +19 -13
- package/3rdparty/walkontable/src/renderer/index.js +16 -2
- package/3rdparty/walkontable/src/renderer/index.mjs +20 -6
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +8 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +20 -14
- package/3rdparty/walkontable/src/renderer/rows.js +8 -3
- package/3rdparty/walkontable/src/renderer/rows.mjs +8 -3
- package/3rdparty/walkontable/src/renderer/table.js +16 -2
- package/3rdparty/walkontable/src/renderer/table.mjs +16 -2
- package/3rdparty/walkontable/src/scroll.js +16 -3
- package/3rdparty/walkontable/src/scroll.mjs +18 -5
- package/3rdparty/walkontable/src/selection.js +11 -5
- package/3rdparty/walkontable/src/selection.mjs +11 -5
- package/3rdparty/walkontable/src/settings.js +16 -2
- package/3rdparty/walkontable/src/settings.mjs +16 -2
- package/3rdparty/walkontable/src/table/bottom.js +8 -2
- package/3rdparty/walkontable/src/table/bottom.mjs +13 -7
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.js +8 -2
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.mjs +14 -8
- package/3rdparty/walkontable/src/table/inlineStart.js +8 -2
- package/3rdparty/walkontable/src/table/inlineStart.mjs +10 -4
- package/3rdparty/walkontable/src/table/master.js +8 -2
- package/3rdparty/walkontable/src/table/master.mjs +13 -7
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +12 -6
- package/3rdparty/walkontable/src/table/top.js +8 -2
- package/3rdparty/walkontable/src/table/top.mjs +13 -7
- package/3rdparty/walkontable/src/table/topInlineStartCorner.js +8 -2
- package/3rdparty/walkontable/src/table/topInlineStartCorner.mjs +14 -8
- package/3rdparty/walkontable/src/table.js +13 -6
- package/3rdparty/walkontable/src/table.mjs +21 -14
- package/3rdparty/walkontable/src/utils/column.js +12 -2
- package/3rdparty/walkontable/src/utils/column.mjs +16 -6
- package/3rdparty/walkontable/src/utils/nodesPool.js +16 -2
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +16 -2
- package/3rdparty/walkontable/src/utils/orderView/sharedView.js +8 -2
- package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +12 -6
- package/3rdparty/walkontable/src/utils/orderView/view.js +16 -2
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +23 -9
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +16 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +16 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +16 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +31 -17
- package/3rdparty/walkontable/src/utils/row.js +16 -2
- package/3rdparty/walkontable/src/utils/row.mjs +16 -2
- package/3rdparty/walkontable/src/viewport.js +16 -2
- package/3rdparty/walkontable/src/viewport.mjs +18 -4
- package/CHANGELOG.md +23 -0
- package/base.d.ts +1 -0
- package/base.js +7 -2
- package/base.mjs +9 -4
- package/cellTypes/index.mjs +4 -3
- package/core.d.ts +1 -1
- package/core.js +234 -122
- package/core.mjs +231 -119
- package/dataMap/dataMap.js +98 -28
- package/dataMap/dataMap.mjs +97 -27
- package/dataMap/dataSource.js +14 -2
- package/dataMap/dataSource.mjs +17 -5
- package/dataMap/metaManager/index.js +15 -2
- package/dataMap/metaManager/index.mjs +41 -28
- package/dataMap/metaManager/lazyFactoryMap.js +7 -1
- package/dataMap/metaManager/lazyFactoryMap.mjs +7 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +13 -8
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +12 -7
- package/dataMap/metaManager/metaLayers/columnMeta.js +15 -2
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +23 -9
- package/dataMap/metaManager/metaLayers/globalMeta.js +26 -2
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +27 -3
- package/dataMap/metaManager/metaLayers/tableMeta.js +17 -3
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +41 -27
- package/dataMap/metaManager/metaSchema.js +119 -66
- package/dataMap/metaManager/metaSchema.mjs +119 -66
- package/dataMap/metaManager/mods/dynamicCellMeta.js +12 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +26 -16
- package/dataMap/metaManager/mods/extendMetaProperties.js +12 -2
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +10 -1
- package/dataMap/metaManager/utils.js +44 -14
- package/dataMap/metaManager/utils.mjs +51 -20
- package/dataMap/replaceData.js +2 -1
- package/dataMap/replaceData.mjs +24 -22
- package/dist/handsontable.css +9 -9
- package/dist/handsontable.full.css +9 -9
- package/dist/handsontable.full.js +7350 -10885
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +107 -113
- package/dist/handsontable.js +5800 -4499
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/dist/languages/all.js +111 -65
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +50 -4
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +52 -6
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +52 -6
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +53 -7
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +56 -10
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +56 -10
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.js +55 -9
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/it-IT.js +55 -9
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +83 -33
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +84 -33
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +85 -33
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +86 -33
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +87 -33
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +88 -33
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +68 -19
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +68 -19
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +55 -6
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +55 -6
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +55 -6
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +18 -9
- package/editorManager.mjs +15 -6
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -5
- package/editors/autocompleteEditor/autocompleteEditor.mjs +9 -4
- package/editors/baseEditor/baseEditor.js +11 -6
- package/editors/baseEditor/baseEditor.mjs +10 -5
- package/editors/checkboxEditor/checkboxEditor.js +6 -1
- package/editors/checkboxEditor/checkboxEditor.mjs +6 -1
- package/editors/dateEditor/dateEditor.js +6 -1
- package/editors/dateEditor/dateEditor.mjs +6 -1
- package/editors/dropdownEditor/dropdownEditor.js +6 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +6 -1
- package/editors/handsontableEditor/handsontableEditor.js +6 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +6 -1
- package/editors/index.mjs +4 -3
- package/editors/numericEditor/numericEditor.js +6 -1
- package/editors/numericEditor/numericEditor.mjs +6 -1
- package/editors/passwordEditor/passwordEditor.js +6 -1
- package/editors/passwordEditor/passwordEditor.mjs +6 -1
- package/editors/registry.js +3 -0
- package/editors/registry.mjs +5 -1
- package/editors/selectEditor/selectEditor.js +6 -1
- package/editors/selectEditor/selectEditor.mjs +6 -1
- package/editors/textEditor/caretPositioner.mjs +11 -10
- package/editors/textEditor/textEditor.js +7 -2
- package/editors/textEditor/textEditor.mjs +7 -2
- package/editors/timeEditor/timeEditor.js +6 -1
- package/editors/timeEditor/timeEditor.mjs +6 -1
- package/eventManager.js +24 -9
- package/eventManager.mjs +26 -11
- package/helpers/console.mjs +6 -5
- package/helpers/data.d.ts +0 -1
- package/helpers/data.js +0 -49
- package/helpers/data.mjs +1 -49
- package/helpers/dom/element.js +23 -0
- package/helpers/dom/element.mjs +30 -7
- package/helpers/feature.js +9 -36
- package/helpers/feature.mjs +3 -30
- package/helpers/function.mjs +7 -6
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +9 -8
- package/helpers/object.js +15 -9
- package/helpers/object.mjs +17 -10
- package/helpers/string.mjs +7 -6
- package/helpers/templateLiteralTag.mjs +8 -7
- package/i18n/constants.js +49 -42
- package/i18n/constants.mjs +45 -41
- package/i18n/languages/ar-AR.js +12 -7
- package/i18n/languages/ar-AR.mjs +16 -2
- package/i18n/languages/cs-CZ.js +12 -7
- package/i18n/languages/cs-CZ.mjs +16 -2
- package/i18n/languages/de-CH.js +12 -7
- package/i18n/languages/de-CH.mjs +16 -2
- package/i18n/languages/de-DE.js +12 -7
- package/i18n/languages/de-DE.mjs +16 -2
- package/i18n/languages/en-US.js +13 -8
- package/i18n/languages/en-US.mjs +17 -3
- package/i18n/languages/es-MX.js +13 -8
- package/i18n/languages/es-MX.mjs +19 -4
- package/i18n/languages/fr-FR.js +12 -7
- package/i18n/languages/fr-FR.mjs +16 -2
- package/i18n/languages/it-IT.js +12 -7
- package/i18n/languages/it-IT.mjs +16 -2
- package/i18n/languages/ja-JP.js +12 -7
- package/i18n/languages/ja-JP.mjs +16 -2
- package/i18n/languages/ko-KR.js +12 -7
- package/i18n/languages/ko-KR.mjs +16 -2
- package/i18n/languages/lv-LV.js +13 -8
- package/i18n/languages/lv-LV.mjs +19 -5
- package/i18n/languages/nb-NO.js +12 -7
- package/i18n/languages/nb-NO.mjs +16 -2
- package/i18n/languages/nl-NL.js +13 -8
- package/i18n/languages/nl-NL.mjs +19 -5
- package/i18n/languages/pl-PL.js +13 -8
- package/i18n/languages/pl-PL.mjs +18 -4
- package/i18n/languages/pt-BR.js +12 -7
- package/i18n/languages/pt-BR.mjs +16 -2
- package/i18n/languages/ru-RU.js +12 -7
- package/i18n/languages/ru-RU.mjs +16 -2
- package/i18n/languages/sr-SP.js +12 -7
- package/i18n/languages/sr-SP.mjs +16 -2
- package/i18n/languages/zh-CN.js +12 -7
- package/i18n/languages/zh-CN.mjs +16 -2
- package/i18n/languages/zh-TW.js +12 -7
- package/i18n/languages/zh-TW.mjs +16 -2
- package/i18n/phraseFormatters/substituteVariables.mjs +9 -8
- package/i18n/utils.mjs +10 -9
- package/index.d.ts +9 -0
- package/index.js +4 -2
- package/index.mjs +2 -1
- package/languages/all.js +111 -65
- package/languages/ar-AR.js +50 -4
- package/languages/ar-AR.mjs +16 -2
- package/languages/cs-CZ.js +52 -6
- package/languages/cs-CZ.mjs +16 -2
- package/languages/de-CH.js +52 -6
- package/languages/de-CH.mjs +16 -2
- package/languages/de-DE.js +53 -7
- package/languages/de-DE.mjs +16 -2
- package/languages/en-US.js +56 -10
- package/languages/en-US.mjs +17 -3
- package/languages/es-MX.js +56 -10
- package/languages/es-MX.mjs +19 -4
- package/languages/fr-FR.js +55 -9
- package/languages/fr-FR.mjs +16 -2
- package/languages/index.js +111 -65
- package/languages/it-IT.js +55 -9
- package/languages/it-IT.mjs +16 -2
- package/languages/ja-JP.js +83 -33
- package/languages/ja-JP.mjs +16 -2
- package/languages/ko-KR.js +84 -33
- package/languages/ko-KR.mjs +16 -2
- package/languages/lv-LV.js +85 -33
- package/languages/lv-LV.mjs +19 -5
- package/languages/nb-NO.js +86 -33
- package/languages/nb-NO.mjs +16 -2
- package/languages/nl-NL.js +87 -33
- package/languages/nl-NL.mjs +19 -5
- package/languages/pl-PL.js +88 -33
- package/languages/pl-PL.mjs +18 -4
- package/languages/pt-BR.js +68 -19
- package/languages/pt-BR.mjs +16 -2
- package/languages/ru-RU.js +68 -19
- package/languages/ru-RU.mjs +16 -2
- package/languages/sr-SP.js +55 -6
- package/languages/sr-SP.mjs +16 -2
- package/languages/zh-CN.js +55 -6
- package/languages/zh-CN.mjs +16 -2
- package/languages/zh-TW.js +55 -6
- package/languages/zh-TW.mjs +16 -2
- package/mixins/hooksRefRegisterer.js +6 -3
- package/mixins/hooksRefRegisterer.mjs +6 -3
- package/mixins/localHooks.js +6 -3
- package/mixins/localHooks.mjs +6 -3
- package/package.json +2 -2
- package/pluginHooks.d.ts +7 -2
- package/pluginHooks.js +109 -24
- package/pluginHooks.mjs +109 -24
- package/plugins/autoColumnSize/autoColumnSize.js +7 -2
- package/plugins/autoColumnSize/autoColumnSize.mjs +7 -2
- package/plugins/autoRowSize/autoRowSize.js +16 -7
- package/plugins/autoRowSize/autoRowSize.mjs +16 -7
- package/plugins/autofill/autofill.js +7 -2
- package/plugins/autofill/autofill.mjs +7 -2
- package/plugins/base/base.js +8 -2
- package/plugins/base/base.mjs +8 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +6 -1
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +6 -1
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +6 -1
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +6 -1
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +6 -1
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +6 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +10 -5
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +9 -4
- package/plugins/columnSorting/columnSorting.js +8 -4
- package/plugins/columnSorting/columnSorting.mjs +8 -4
- package/plugins/columnSorting/columnStatesManager.js +12 -6
- package/plugins/columnSorting/columnStatesManager.mjs +9 -3
- package/plugins/columnSorting/rootComparator.mjs +8 -7
- package/plugins/columnSorting/sortFunction/checkbox.mjs +9 -8
- package/plugins/columnSorting/sortFunction/date.mjs +9 -8
- package/plugins/columnSorting/sortFunction/default.mjs +9 -8
- package/plugins/columnSorting/sortFunction/numeric.mjs +9 -8
- package/plugins/columnSummary/columnSummary.js +13 -8
- package/plugins/columnSummary/columnSummary.mjs +13 -8
- package/plugins/columnSummary/endpoints.js +17 -16
- package/plugins/columnSummary/endpoints.mjs +22 -21
- package/plugins/comments/commentEditor.js +16 -2
- package/plugins/comments/commentEditor.mjs +21 -7
- package/plugins/comments/comments.js +15 -4
- package/plugins/comments/comments.mjs +15 -4
- package/plugins/comments/displaySwitch.js +14 -1
- package/plugins/comments/displaySwitch.mjs +14 -1
- package/plugins/contextMenu/commandExecutor.js +22 -7
- package/plugins/contextMenu/commandExecutor.mjs +27 -12
- package/plugins/contextMenu/contextMenu.d.ts +4 -3
- package/plugins/contextMenu/contextMenu.js +7 -17
- package/plugins/contextMenu/contextMenu.mjs +7 -17
- package/plugins/contextMenu/cursor.js +16 -2
- package/plugins/contextMenu/cursor.mjs +21 -7
- package/plugins/contextMenu/itemsFactory.js +23 -8
- package/plugins/contextMenu/itemsFactory.mjs +28 -13
- package/plugins/contextMenu/menu.js +14 -3
- package/plugins/contextMenu/menu.mjs +13 -2
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems.js +12 -7
- package/plugins/contextMenu/predefinedItems.mjs +14 -1
- package/plugins/contextMenu/utils.mjs +5 -4
- package/plugins/copyPaste/clipboardData.js +16 -2
- package/plugins/copyPaste/clipboardData.mjs +16 -2
- package/plugins/copyPaste/contextMenuItem/copy.js +4 -16
- package/plugins/copyPaste/contextMenuItem/copy.mjs +8 -7
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +5 -4
- package/plugins/copyPaste/copyPaste.d.ts +10 -2
- package/plugins/copyPaste/copyPaste.js +303 -202
- package/plugins/copyPaste/copyPaste.mjs +303 -202
- package/plugins/copyPaste/copyableRanges.js +269 -0
- package/plugins/copyPaste/copyableRanges.mjs +264 -0
- package/plugins/copyPaste/focusableElement.js +12 -2
- package/plugins/copyPaste/focusableElement.mjs +15 -5
- package/plugins/copyPaste/pasteEvent.js +16 -2
- package/plugins/copyPaste/pasteEvent.mjs +18 -4
- package/plugins/customBorders/contextMenuItem/bottom.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/left.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/noBorders.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/right.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/top.mjs +5 -4
- package/plugins/customBorders/customBorders.js +12 -7
- package/plugins/customBorders/customBorders.mjs +11 -6
- package/plugins/customBorders/utils.mjs +8 -7
- package/plugins/dragToScroll/dragToScroll.js +6 -1
- package/plugins/dragToScroll/dragToScroll.mjs +6 -1
- package/plugins/dropdownMenu/dropdownMenu.js +6 -1
- package/plugins/dropdownMenu/dropdownMenu.mjs +6 -1
- package/plugins/exportFile/dataProvider.js +13 -6
- package/plugins/exportFile/dataProvider.mjs +12 -5
- package/plugins/exportFile/exportFile.js +8 -3
- package/plugins/exportFile/exportFile.mjs +6 -1
- package/plugins/exportFile/typeFactory.js +14 -1
- package/plugins/exportFile/typeFactory.mjs +14 -1
- package/plugins/exportFile/types/_base.js +16 -2
- package/plugins/exportFile/types/_base.mjs +18 -4
- package/plugins/exportFile/types/csv.js +6 -1
- package/plugins/exportFile/types/csv.mjs +6 -1
- package/plugins/filters/component/_base.js +16 -2
- package/plugins/filters/component/_base.mjs +19 -5
- package/plugins/filters/component/actionBar.js +10 -4
- package/plugins/filters/component/actionBar.mjs +11 -5
- package/plugins/filters/component/condition.js +10 -4
- package/plugins/filters/component/condition.mjs +11 -5
- package/plugins/filters/component/operators.js +8 -3
- package/plugins/filters/component/operators.mjs +8 -3
- package/plugins/filters/component/value.js +9 -3
- package/plugins/filters/component/value.mjs +12 -6
- package/plugins/filters/condition/beginsWith.js +1 -1
- package/plugins/filters/condition/beginsWith.mjs +1 -1
- package/plugins/filters/condition/between.js +1 -1
- package/plugins/filters/condition/between.mjs +1 -1
- package/plugins/filters/condition/byValue.js +1 -1
- package/plugins/filters/condition/byValue.mjs +1 -1
- package/plugins/filters/condition/contains.js +1 -1
- package/plugins/filters/condition/contains.mjs +1 -1
- package/plugins/filters/condition/date/after.js +1 -1
- package/plugins/filters/condition/date/after.mjs +1 -1
- package/plugins/filters/condition/date/before.js +1 -1
- package/plugins/filters/condition/date/before.mjs +1 -1
- package/plugins/filters/condition/endsWith.js +1 -1
- package/plugins/filters/condition/endsWith.mjs +1 -1
- package/plugins/filters/condition/equal.js +1 -1
- package/plugins/filters/condition/equal.mjs +1 -1
- package/plugins/filters/condition/greaterThan.js +1 -1
- package/plugins/filters/condition/greaterThan.mjs +1 -1
- package/plugins/filters/condition/greaterThanOrEqual.js +1 -1
- package/plugins/filters/condition/greaterThanOrEqual.mjs +1 -1
- package/plugins/filters/condition/lessThan.js +1 -1
- package/plugins/filters/condition/lessThan.mjs +1 -1
- package/plugins/filters/condition/lessThanOrEqual.js +1 -1
- package/plugins/filters/condition/lessThanOrEqual.mjs +1 -1
- package/plugins/filters/conditionCollection.js +10 -4
- package/plugins/filters/conditionCollection.mjs +18 -12
- package/plugins/filters/conditionUpdateObserver.js +15 -2
- package/plugins/filters/conditionUpdateObserver.mjs +23 -10
- package/plugins/filters/constants.js +14 -1
- package/plugins/filters/constants.mjs +14 -1
- package/plugins/filters/dataFilter.js +16 -2
- package/plugins/filters/dataFilter.mjs +19 -5
- package/plugins/filters/filters.js +7 -2
- package/plugins/filters/filters.mjs +7 -2
- package/plugins/filters/ui/_base.js +12 -7
- package/plugins/filters/ui/_base.mjs +14 -1
- package/plugins/filters/ui/input.js +6 -1
- package/plugins/filters/ui/input.mjs +6 -1
- package/plugins/filters/ui/link.js +6 -1
- package/plugins/filters/ui/link.mjs +6 -1
- package/plugins/filters/ui/multipleSelect.js +14 -8
- package/plugins/filters/ui/multipleSelect.mjs +6 -1
- package/plugins/filters/ui/radioInput.js +6 -1
- package/plugins/filters/ui/radioInput.mjs +6 -1
- package/plugins/filters/ui/select.js +6 -1
- package/plugins/filters/ui/select.mjs +6 -1
- package/plugins/formulas/engine/register.mjs +6 -5
- package/plugins/formulas/engine/settings.js +12 -1
- package/plugins/formulas/engine/settings.mjs +12 -1
- package/plugins/formulas/formulas.js +24 -11
- package/plugins/formulas/formulas.mjs +24 -11
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +6 -5
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +5 -4
- package/plugins/hiddenColumns/hiddenColumns.js +5 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +5 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +6 -5
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +5 -4
- package/plugins/hiddenRows/hiddenRows.js +5 -1
- package/plugins/hiddenRows/hiddenRows.mjs +5 -1
- package/plugins/index.mjs +4 -3
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +6 -5
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +6 -5
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +6 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +6 -1
- package/plugins/manualColumnMove/manualColumnMove.js +6 -1
- package/plugins/manualColumnMove/manualColumnMove.mjs +6 -1
- package/plugins/manualColumnMove/ui/_base.js +14 -1
- package/plugins/manualColumnMove/ui/_base.mjs +14 -1
- package/plugins/manualColumnMove/ui/backlight.js +6 -1
- package/plugins/manualColumnMove/ui/backlight.mjs +6 -1
- package/plugins/manualColumnMove/ui/guideline.js +6 -1
- package/plugins/manualColumnMove/ui/guideline.mjs +6 -1
- package/plugins/manualColumnResize/manualColumnResize.js +6 -1
- package/plugins/manualColumnResize/manualColumnResize.mjs +6 -1
- package/plugins/manualRowMove/manualRowMove.js +6 -1
- package/plugins/manualRowMove/manualRowMove.mjs +6 -1
- package/plugins/manualRowMove/ui/_base.js +14 -1
- package/plugins/manualRowMove/ui/_base.mjs +14 -1
- package/plugins/manualRowMove/ui/backlight.js +6 -1
- package/plugins/manualRowMove/ui/backlight.mjs +6 -1
- package/plugins/manualRowMove/ui/guideline.js +6 -1
- package/plugins/manualRowMove/ui/guideline.mjs +6 -1
- package/plugins/manualRowResize/manualRowResize.js +6 -1
- package/plugins/manualRowResize/manualRowResize.mjs +6 -1
- package/plugins/mergeCells/calculations/autofill.js +13 -6
- package/plugins/mergeCells/calculations/autofill.mjs +15 -8
- package/plugins/mergeCells/calculations/selection.js +16 -2
- package/plugins/mergeCells/calculations/selection.mjs +16 -2
- package/plugins/mergeCells/cellCoords.js +16 -2
- package/plugins/mergeCells/cellCoords.mjs +21 -7
- package/plugins/mergeCells/cellsCollection.js +12 -5
- package/plugins/mergeCells/cellsCollection.mjs +14 -7
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +5 -4
- package/plugins/mergeCells/mergeCells.js +7 -2
- package/plugins/mergeCells/mergeCells.mjs +7 -2
- package/plugins/multiColumnSorting/multiColumnSorting.js +6 -1
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +6 -1
- package/plugins/multiColumnSorting/rootComparator.mjs +8 -7
- package/plugins/multiColumnSorting/utils.mjs +4 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +6 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +6 -1
- package/plugins/nestedHeaders/nestedHeaders.js +124 -16
- package/plugins/nestedHeaders/nestedHeaders.mjs +131 -23
- package/plugins/nestedHeaders/stateManager/headersTree.js +10 -3
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +10 -3
- package/plugins/nestedHeaders/stateManager/index.js +34 -14
- package/plugins/nestedHeaders/stateManager/index.mjs +67 -47
- package/plugins/nestedHeaders/stateManager/matrixGenerator.mjs +33 -31
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +18 -17
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +17 -16
- package/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.mjs +7 -6
- package/plugins/nestedHeaders/stateManager/nodeModifiers/index.mjs +2 -1
- package/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.mjs +7 -6
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs +41 -39
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +11 -3
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +23 -14
- package/plugins/nestedHeaders/utils/ghostTable.js +17 -3
- package/plugins/nestedHeaders/utils/ghostTable.mjs +24 -10
- package/plugins/nestedRows/data/dataManager.js +10 -4
- package/plugins/nestedRows/data/dataManager.mjs +12 -6
- package/plugins/nestedRows/nestedRows.js +6 -1
- package/plugins/nestedRows/nestedRows.mjs +6 -1
- package/plugins/nestedRows/ui/_base.js +16 -2
- package/plugins/nestedRows/ui/_base.mjs +16 -2
- package/plugins/nestedRows/ui/collapsing.js +8 -2
- package/plugins/nestedRows/ui/collapsing.mjs +14 -8
- package/plugins/nestedRows/ui/contextMenu.js +7 -2
- package/plugins/nestedRows/ui/contextMenu.mjs +6 -1
- package/plugins/nestedRows/ui/headers.js +8 -2
- package/plugins/nestedRows/ui/headers.mjs +14 -8
- package/plugins/nestedRows/utils/rowMoveController.js +11 -4
- package/plugins/nestedRows/utils/rowMoveController.mjs +25 -18
- package/plugins/persistentState/persistentState.js +6 -1
- package/plugins/persistentState/persistentState.mjs +6 -1
- package/plugins/persistentState/storage.js +16 -2
- package/plugins/persistentState/storage.mjs +19 -5
- package/plugins/registry.js +1 -1
- package/plugins/registry.mjs +3 -2
- package/plugins/search/search.js +6 -1
- package/plugins/search/search.mjs +6 -1
- package/plugins/touchScroll/touchScroll.js +6 -1
- package/plugins/touchScroll/touchScroll.mjs +6 -1
- package/plugins/trimRows/trimRows.js +5 -1
- package/plugins/trimRows/trimRows.mjs +5 -1
- package/plugins/undoRedo/undoRedo.js +50 -32
- package/plugins/undoRedo/undoRedo.mjs +50 -32
- package/registry.mjs +2 -1
- package/renderers/baseRenderer/baseRenderer.mjs +2 -1
- package/renderers/index.mjs +4 -3
- package/selection/highlight/highlight.js +10 -3
- package/selection/highlight/highlight.mjs +24 -17
- package/selection/highlight/types/activeHeader.js +13 -2
- package/selection/highlight/types/activeHeader.mjs +19 -7
- package/selection/highlight/types/area.js +13 -2
- package/selection/highlight/types/area.mjs +22 -10
- package/selection/highlight/types/cell.js +13 -2
- package/selection/highlight/types/cell.mjs +22 -10
- package/selection/highlight/types/customSelection.js +13 -2
- package/selection/highlight/types/customSelection.mjs +23 -11
- package/selection/highlight/types/fill.js +14 -3
- package/selection/highlight/types/fill.mjs +22 -10
- package/selection/highlight/types/header.js +13 -2
- package/selection/highlight/types/header.mjs +24 -12
- package/selection/highlight/types/index.js +14 -3
- package/selection/highlight/types/index.mjs +14 -3
- package/selection/highlight/visualSelection.js +11 -6
- package/selection/highlight/visualSelection.mjs +11 -6
- package/selection/mouseEventHandler.mjs +14 -13
- package/selection/range.js +9 -2
- package/selection/range.mjs +9 -2
- package/selection/selection.js +13 -6
- package/selection/selection.mjs +21 -14
- package/selection/transformation.js +16 -2
- package/selection/transformation.mjs +24 -10
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +1 -1
- package/shortcuts/context.js +1 -1
- package/shortcuts/context.mjs +1 -1
- package/shortcuts/keyObserver.js +8 -4
- package/shortcuts/keyObserver.mjs +8 -4
- package/shortcuts/manager.js +1 -1
- package/shortcuts/manager.mjs +1 -1
- package/tableView.js +147 -68
- package/tableView.mjs +147 -68
- package/translations/changesObservable/observable.js +12 -2
- package/translations/changesObservable/observable.mjs +19 -9
- package/translations/changesObservable/observer.js +12 -2
- package/translations/changesObservable/observer.mjs +17 -7
- package/translations/indexMapper.js +12 -6
- package/translations/indexMapper.mjs +17 -11
- package/translations/mapCollections/aggregatedCollection.js +8 -2
- package/translations/mapCollections/aggregatedCollection.mjs +11 -5
- package/translations/mapCollections/mapCollection.js +10 -1
- package/translations/mapCollections/mapCollection.mjs +10 -1
- package/translations/maps/hidingMap.js +8 -2
- package/translations/maps/hidingMap.mjs +13 -7
- package/translations/maps/indexMap.js +16 -2
- package/translations/maps/indexMap.mjs +20 -6
- package/translations/maps/indexesSequence.js +8 -2
- package/translations/maps/indexesSequence.mjs +14 -8
- package/translations/maps/linkedPhysicalIndexToValueMap.js +12 -6
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +18 -12
- package/translations/maps/physicalIndexToValueMap.js +8 -2
- package/translations/maps/physicalIndexToValueMap.mjs +14 -8
- package/translations/maps/trimmingMap.js +8 -2
- package/translations/maps/trimmingMap.mjs +13 -7
- package/translations/maps/utils/actionsOnIndexes.mjs +9 -8
- package/translations/maps/utils/indexesSequence.mjs +10 -9
- package/translations/maps/utils/physicallyIndexed.mjs +11 -10
- package/utils/dataStructures/linkedList.js +21 -7
- package/utils/dataStructures/linkedList.mjs +21 -7
- package/utils/dataStructures/priorityMap.js +1 -1
- package/utils/dataStructures/priorityMap.mjs +1 -1
- package/utils/dataStructures/queue.js +16 -2
- package/utils/dataStructures/queue.mjs +16 -2
- package/utils/dataStructures/stack.js +16 -2
- package/utils/dataStructures/stack.mjs +16 -2
- package/utils/dataStructures/tree.js +8 -2
- package/utils/dataStructures/tree.mjs +8 -2
- package/utils/dataStructures/uniqueMap.js +1 -1
- package/utils/dataStructures/uniqueMap.mjs +1 -1
- package/utils/ghostTable.js +12 -5
- package/utils/ghostTable.mjs +12 -5
- package/utils/interval.js +23 -8
- package/utils/interval.mjs +18 -4
- package/utils/samplesGenerator.js +13 -3
- package/utils/samplesGenerator.mjs +15 -5
- package/validators/index.mjs +4 -3
@@ -1,49 +1,58 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
4
|
+
require("core-js/modules/es.date.to-primitive.js");
|
5
|
+
require("core-js/modules/es.symbol.js");
|
6
|
+
require("core-js/modules/es.symbol.description.js");
|
7
|
+
require("core-js/modules/es.number.constructor.js");
|
3
8
|
require("core-js/modules/es.object.set-prototype-of.js");
|
4
9
|
require("core-js/modules/es.object.get-prototype-of.js");
|
5
10
|
require("core-js/modules/es.reflect.construct.js");
|
6
11
|
require("core-js/modules/es.reflect.get.js");
|
7
12
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
8
|
-
require("core-js/modules/es.symbol.js");
|
9
|
-
require("core-js/modules/es.symbol.description.js");
|
10
13
|
require("core-js/modules/es.symbol.iterator.js");
|
11
14
|
require("core-js/modules/es.array.slice.js");
|
12
15
|
require("core-js/modules/es.function.name.js");
|
13
|
-
require("core-js/modules/es.array.from.js");
|
14
16
|
exports.__esModule = true;
|
15
17
|
exports.PLUGIN_PRIORITY = exports.PLUGIN_KEY = exports.CopyPaste = void 0;
|
18
|
+
require("core-js/modules/es.array.join.js");
|
19
|
+
require("core-js/modules/es.array.concat.js");
|
16
20
|
require("core-js/modules/es.array.iterator.js");
|
21
|
+
require("core-js/modules/es.map.js");
|
17
22
|
require("core-js/modules/es.object.to-string.js");
|
18
23
|
require("core-js/modules/es.string.iterator.js");
|
19
|
-
require("core-js/modules/es.weak-map.js");
|
20
24
|
require("core-js/modules/web.dom-collections.iterator.js");
|
21
|
-
require("core-js/modules/es.array.
|
22
|
-
require("core-js/modules/es.array.
|
25
|
+
require("core-js/modules/es.array.map.js");
|
26
|
+
require("core-js/modules/es.array.filter.js");
|
27
|
+
require("core-js/modules/es.array.from.js");
|
23
28
|
require("core-js/modules/es.regexp.exec.js");
|
24
|
-
require("core-js/modules/es.
|
29
|
+
require("core-js/modules/es.weak-map.js");
|
30
|
+
require("core-js/modules/es.weak-set.js");
|
25
31
|
var _base = require("../base");
|
26
32
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
27
33
|
var _SheetClip = require("../../3rdparty/SheetClip");
|
28
34
|
var _array = require("../../helpers/array");
|
29
|
-
var _number = require("../../helpers/number");
|
30
35
|
var _string = require("../../helpers/string");
|
31
36
|
var _element = require("../../helpers/dom/element");
|
32
37
|
var _copy = _interopRequireDefault(require("./contextMenuItem/copy"));
|
38
|
+
var _copyColumnHeadersOnly = _interopRequireDefault(require("./contextMenuItem/copyColumnHeadersOnly"));
|
39
|
+
var _copyWithColumnGroupHeaders = _interopRequireDefault(require("./contextMenuItem/copyWithColumnGroupHeaders"));
|
40
|
+
var _copyWithColumnHeaders = _interopRequireDefault(require("./contextMenuItem/copyWithColumnHeaders"));
|
33
41
|
var _cut = _interopRequireDefault(require("./contextMenuItem/cut"));
|
34
42
|
var _pasteEvent = _interopRequireDefault(require("./pasteEvent"));
|
35
43
|
var _focusableElement = require("./focusableElement");
|
44
|
+
var _copyableRanges = require("./copyableRanges");
|
36
45
|
var _parseTable = require("../../utils/parseTable");
|
37
46
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
38
47
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
39
48
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
40
49
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
41
50
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
42
|
-
function _iterableToArrayLimit(arr, i) { var _i =
|
51
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
43
52
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
44
53
|
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); }
|
45
54
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
46
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
55
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
47
56
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
48
57
|
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
49
58
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
@@ -54,6 +63,18 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
54
63
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
55
64
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
56
65
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
66
|
+
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
67
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
68
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
69
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
70
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
71
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
72
|
+
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
73
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
74
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
75
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
76
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
77
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
57
78
|
_pluginHooks.default.getSingleton().register('afterCopyLimit');
|
58
79
|
_pluginHooks.default.getSingleton().register('modifyCopyableRange');
|
59
80
|
_pluginHooks.default.getSingleton().register('beforeCut');
|
@@ -67,118 +88,131 @@ exports.PLUGIN_KEY = PLUGIN_KEY;
|
|
67
88
|
var PLUGIN_PRIORITY = 80;
|
68
89
|
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
69
90
|
var SETTING_KEYS = ['fragmentSelection'];
|
70
|
-
var ROWS_LIMIT = Infinity;
|
71
|
-
var COLUMNS_LIMIT = Infinity;
|
72
|
-
var privatePool = new WeakMap();
|
73
91
|
var META_HEAD = ['<meta name="generator" content="Handsontable"/>', '<style type="text/css">td{white-space:normal}br{mso-data-placement:same-cell}</style>'].join('');
|
74
92
|
|
75
93
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
76
94
|
/**
|
77
95
|
* @description
|
78
|
-
*
|
79
|
-
* using keyboard shortcuts and menu bar from the browser.
|
80
|
-
* Possible values:
|
81
|
-
* * `true` (to enable default options),
|
82
|
-
* * `false` (to disable completely).
|
96
|
+
* Copy, cut, and paste data by using the `CopyPaste` plugin.
|
83
97
|
*
|
84
|
-
*
|
85
|
-
* * `'columnsLimit'` (see {@link CopyPaste#columnsLimit})
|
86
|
-
* * `'rowsLimit'` (see {@link CopyPaste#rowsLimit})
|
87
|
-
* * `'pasteMode'` (see {@link CopyPaste#pasteMode})
|
88
|
-
* * `'uiContainer'` (see {@link CopyPaste#uiContainer}).
|
98
|
+
* Control the `CopyPaste` plugin programmatically through its [API methods](#methods).
|
89
99
|
*
|
90
|
-
*
|
100
|
+
* The user can access the copy-paste features through:
|
101
|
+
* - The [context menu](@/guides/cell-features/clipboard.md#context-menu).
|
102
|
+
* - The [keyboard shortcuts](@/guides/cell-features/clipboard.md#related-keyboard-shortcuts).
|
103
|
+
* - The browser's menu bar.
|
104
|
+
*
|
105
|
+
* Read more:
|
106
|
+
* - [Guides: Clipboard](@/guides/cell-features/clipboard.md)
|
107
|
+
* - [Configuration options: `copyPaste`](@/api/options.md#copypaste)
|
91
108
|
*
|
92
109
|
* @example
|
93
110
|
* ```js
|
94
|
-
* //
|
111
|
+
* // enable the plugin with the default configuration
|
95
112
|
* copyPaste: true,
|
96
|
-
*
|
113
|
+
*
|
114
|
+
* // or, enable the plugin with a custom configuration
|
97
115
|
* copyPaste: {
|
98
116
|
* columnsLimit: 25,
|
99
117
|
* rowsLimit: 50,
|
100
118
|
* pasteMode: 'shift_down',
|
119
|
+
* copyColumnHeaders: true,
|
120
|
+
* copyColumnGroupHeaders: true,
|
121
|
+
* copyColumnHeadersOnly: true,
|
101
122
|
* uiContainer: document.body,
|
102
123
|
* },
|
103
124
|
* ```
|
104
125
|
* @class CopyPaste
|
105
126
|
* @plugin CopyPaste
|
106
127
|
*/
|
128
|
+
var _enableCopyColumnHeaders = /*#__PURE__*/new WeakMap();
|
129
|
+
var _enableCopyColumnGroupHeaders = /*#__PURE__*/new WeakMap();
|
130
|
+
var _enableCopyColumnHeadersOnly = /*#__PURE__*/new WeakMap();
|
131
|
+
var _copyMode = /*#__PURE__*/new WeakMap();
|
132
|
+
var _isTriggeredByCopy = /*#__PURE__*/new WeakMap();
|
133
|
+
var _isTriggeredByCut = /*#__PURE__*/new WeakMap();
|
134
|
+
var _copyableRangesFactory = /*#__PURE__*/new WeakMap();
|
135
|
+
var _countCopiedHeaders = /*#__PURE__*/new WeakSet();
|
107
136
|
var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
108
137
|
_inherits(CopyPaste, _BasePlugin);
|
109
138
|
var _super = _createSuper(CopyPaste);
|
110
|
-
function CopyPaste(
|
139
|
+
function CopyPaste() {
|
111
140
|
var _this;
|
112
141
|
_classCallCheck(this, CopyPaste);
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
_this
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
_this
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
* @type {string}
|
142
|
-
* @default 'overwrite'
|
143
|
-
*/
|
144
|
-
_this.pasteMode = 'overwrite';
|
145
|
-
/**
|
146
|
-
* Maximum number of rows than can be copied to clipboard using <kbd>**Ctrl**</kbd>/<kbd>**Cmd**</kbd> + <kbd>**C**</kbd>.
|
147
|
-
*
|
148
|
-
* @type {number}
|
149
|
-
* @default Infinity
|
150
|
-
*/
|
151
|
-
_this.rowsLimit = ROWS_LIMIT;
|
152
|
-
|
153
|
-
/**
|
154
|
-
* UI container for the secondary focusable element.
|
155
|
-
*
|
156
|
-
* @type {HTMLElement}
|
157
|
-
*/
|
158
|
-
_this.uiContainer = _this.hot.rootDocument.body;
|
159
|
-
privatePool.set(_assertThisInitialized(_this), {
|
160
|
-
isTriggeredByCopy: false,
|
161
|
-
isTriggeredByCut: false,
|
162
|
-
isBeginEditing: false,
|
163
|
-
isFragmentSelectionEnabled: false
|
142
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
143
|
+
args[_key] = arguments[_key];
|
144
|
+
}
|
145
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
146
|
+
_classPrivateMethodInitSpec(_assertThisInitialized(_this), _countCopiedHeaders);
|
147
|
+
_defineProperty(_assertThisInitialized(_this), "columnsLimit", Infinity);
|
148
|
+
_defineProperty(_assertThisInitialized(_this), "rowsLimit", Infinity);
|
149
|
+
_defineProperty(_assertThisInitialized(_this), "pasteMode", 'overwrite');
|
150
|
+
_defineProperty(_assertThisInitialized(_this), "uiContainer", _this.hot.rootDocument.body);
|
151
|
+
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeaders, {
|
152
|
+
writable: true,
|
153
|
+
value: false
|
154
|
+
});
|
155
|
+
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnGroupHeaders, {
|
156
|
+
writable: true,
|
157
|
+
value: false
|
158
|
+
});
|
159
|
+
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _enableCopyColumnHeadersOnly, {
|
160
|
+
writable: true,
|
161
|
+
value: false
|
162
|
+
});
|
163
|
+
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyMode, {
|
164
|
+
writable: true,
|
165
|
+
value: 'cells-only'
|
166
|
+
});
|
167
|
+
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCopy, {
|
168
|
+
writable: true,
|
169
|
+
value: false
|
164
170
|
});
|
171
|
+
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _isTriggeredByCut, {
|
172
|
+
writable: true,
|
173
|
+
value: false
|
174
|
+
});
|
175
|
+
_classPrivateFieldInitSpec(_assertThisInitialized(_this), _copyableRangesFactory, {
|
176
|
+
writable: true,
|
177
|
+
value: new _copyableRanges.CopyableRangesFactory({
|
178
|
+
countRows: function countRows() {
|
179
|
+
return _this.hot.countRows();
|
180
|
+
},
|
181
|
+
countColumns: function countColumns() {
|
182
|
+
return _this.hot.countCols();
|
183
|
+
},
|
184
|
+
rowsLimit: function rowsLimit() {
|
185
|
+
return _this.rowsLimit;
|
186
|
+
},
|
187
|
+
columnsLimit: function columnsLimit() {
|
188
|
+
return _this.columnsLimit;
|
189
|
+
},
|
190
|
+
countColumnHeaders: function countColumnHeaders() {
|
191
|
+
return _this.hot.view.getColumnHeadersCount();
|
192
|
+
}
|
193
|
+
})
|
194
|
+
});
|
195
|
+
_defineProperty(_assertThisInitialized(_this), "copyableRanges", []);
|
196
|
+
_defineProperty(_assertThisInitialized(_this), "focusableElement", void 0);
|
165
197
|
return _this;
|
166
198
|
}
|
167
|
-
|
168
|
-
/**
|
169
|
-
* Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
|
170
|
-
* hook and if it returns `true` then the {@link CopyPaste#enablePlugin} method is called.
|
171
|
-
*
|
172
|
-
* @returns {boolean}
|
173
|
-
*/
|
174
199
|
_createClass(CopyPaste, [{
|
175
200
|
key: "isEnabled",
|
176
|
-
value:
|
201
|
+
value:
|
202
|
+
/**
|
203
|
+
* Checks if the [`CopyPaste`](#copypaste) plugin is enabled.
|
204
|
+
*
|
205
|
+
* This method gets called by Handsontable's [`beforeInit`](@/api/hooks.md#beforeinit) hook.
|
206
|
+
* If it returns `true`, the [`enablePlugin()`](#enableplugin) method gets called.
|
207
|
+
*
|
208
|
+
* @returns {boolean}
|
209
|
+
*/
|
210
|
+
function isEnabled() {
|
177
211
|
return !!this.hot.getSettings()[PLUGIN_KEY];
|
178
212
|
}
|
179
213
|
|
180
214
|
/**
|
181
|
-
* Enables the plugin
|
215
|
+
* Enables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
|
182
216
|
*/
|
183
217
|
}, {
|
184
218
|
key: "enablePlugin",
|
@@ -188,15 +222,16 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
188
222
|
return;
|
189
223
|
}
|
190
224
|
var _this$hot$getSettings = this.hot.getSettings(),
|
191
|
-
settings = _this$hot$getSettings[PLUGIN_KEY]
|
192
|
-
fragmentSelection = _this$hot$getSettings.fragmentSelection;
|
193
|
-
var priv = privatePool.get(this);
|
194
|
-
priv.isFragmentSelectionEnabled = !!fragmentSelection;
|
225
|
+
settings = _this$hot$getSettings[PLUGIN_KEY];
|
195
226
|
if (_typeof(settings) === 'object') {
|
196
|
-
|
227
|
+
var _settings$pasteMode, _settings$uiContainer;
|
228
|
+
this.pasteMode = (_settings$pasteMode = settings.pasteMode) !== null && _settings$pasteMode !== void 0 ? _settings$pasteMode : this.pasteMode;
|
197
229
|
this.rowsLimit = isNaN(settings.rowsLimit) ? this.rowsLimit : settings.rowsLimit;
|
198
230
|
this.columnsLimit = isNaN(settings.columnsLimit) ? this.columnsLimit : settings.columnsLimit;
|
199
|
-
this
|
231
|
+
_classPrivateFieldSet(this, _enableCopyColumnHeaders, !!settings.copyColumnHeaders);
|
232
|
+
_classPrivateFieldSet(this, _enableCopyColumnGroupHeaders, !!settings.copyColumnGroupHeaders);
|
233
|
+
_classPrivateFieldSet(this, _enableCopyColumnHeadersOnly, !!settings.copyColumnHeadersOnly);
|
234
|
+
this.uiContainer = (_settings$uiContainer = settings.uiContainer) !== null && _settings$uiContainer !== void 0 ? _settings$uiContainer : this.uiContainer;
|
200
235
|
}
|
201
236
|
this.addHook('afterContextMenuDefaultOptions', function (options) {
|
202
237
|
return _this2.onAfterContextMenuDefaultOptions(options);
|
@@ -222,9 +257,10 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
222
257
|
}
|
223
258
|
|
224
259
|
/**
|
225
|
-
* Updates the plugin
|
260
|
+
* Updates the state of the [`CopyPaste`](#copypaste) plugin.
|
226
261
|
*
|
227
|
-
*
|
262
|
+
* Gets called when [`updateSettings()`](@/api/core.md#updatesettings)
|
263
|
+
* is invoked with any of the following configuration options:
|
228
264
|
* - [`copyPaste`](@/api/options.md#copypaste)
|
229
265
|
* - [`fragmentSelection`](@/api/options.md#fragmentselection)
|
230
266
|
*/
|
@@ -238,7 +274,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
238
274
|
}
|
239
275
|
|
240
276
|
/**
|
241
|
-
* Disables the plugin
|
277
|
+
* Disables the [`CopyPaste`](#copypaste) plugin for your Handsontable instance.
|
242
278
|
*/
|
243
279
|
}, {
|
244
280
|
key: "disablePlugin",
|
@@ -250,114 +286,125 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
250
286
|
}
|
251
287
|
|
252
288
|
/**
|
253
|
-
* Copies the selected
|
289
|
+
* Copies the contents of the selected cells (and/or their related column headers) to the system clipboard.
|
290
|
+
*
|
291
|
+
* Takes an optional parameter (`copyMode`) that defines the scope of copying:
|
292
|
+
*
|
293
|
+
* | `copyMode` value | Description |
|
294
|
+
* | --------------------------- | --------------------------------------------------------------- |
|
295
|
+
* | `'cells-only'` (default) | Copy the selected cells |
|
296
|
+
* | `'with-column-headers'` | - Copy the selected cells<br>- Copy the nearest column headers |
|
297
|
+
* | `'with-all-column-headers'` | - Copy the selected cells<br>- Copy all related columns headers |
|
298
|
+
* | `'column-headers-only'` | Copy the nearest column headers (without copying cells) |
|
299
|
+
*
|
300
|
+
* @param {string} [copyMode='cells-only'] Copy mode.
|
254
301
|
*/
|
255
302
|
}, {
|
256
303
|
key: "copy",
|
257
304
|
value: function copy() {
|
258
|
-
var
|
259
|
-
|
305
|
+
var copyMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'cells-only';
|
306
|
+
_classPrivateFieldSet(this, _copyMode, copyMode);
|
307
|
+
_classPrivateFieldSet(this, _isTriggeredByCopy, true);
|
260
308
|
this.getOrCreateFocusableElement();
|
261
309
|
this.focusableElement.focus();
|
262
310
|
this.hot.rootDocument.execCommand('copy');
|
263
311
|
}
|
264
312
|
|
265
313
|
/**
|
266
|
-
*
|
314
|
+
* Copies the contents of the selected cells.
|
315
|
+
*/
|
316
|
+
}, {
|
317
|
+
key: "copyCellsOnly",
|
318
|
+
value: function copyCellsOnly() {
|
319
|
+
this.copy('cells-only');
|
320
|
+
}
|
321
|
+
/**
|
322
|
+
* Copies the contents of column headers that are nearest to the selected cells.
|
323
|
+
*/
|
324
|
+
}, {
|
325
|
+
key: "copyColumnHeadersOnly",
|
326
|
+
value: function copyColumnHeadersOnly() {
|
327
|
+
this.copy('column-headers-only');
|
328
|
+
}
|
329
|
+
/**
|
330
|
+
* Copies the contents of the selected cells and all their related column headers.
|
331
|
+
*/
|
332
|
+
}, {
|
333
|
+
key: "copyWithAllColumnHeaders",
|
334
|
+
value: function copyWithAllColumnHeaders() {
|
335
|
+
this.copy('with-column-group-headers');
|
336
|
+
}
|
337
|
+
/**
|
338
|
+
* Copies the contents of the selected cells and their nearest column headers.
|
339
|
+
*/
|
340
|
+
}, {
|
341
|
+
key: "copyWithColumnHeaders",
|
342
|
+
value: function copyWithColumnHeaders() {
|
343
|
+
this.copy('with-column-headers');
|
344
|
+
}
|
345
|
+
|
346
|
+
/**
|
347
|
+
* Cuts the contents of the selected cells to the system clipboard.
|
267
348
|
*/
|
268
349
|
}, {
|
269
350
|
key: "cut",
|
270
351
|
value: function cut() {
|
271
|
-
|
272
|
-
priv.isTriggeredByCut = true;
|
352
|
+
_classPrivateFieldSet(this, _isTriggeredByCut, true);
|
273
353
|
this.getOrCreateFocusableElement();
|
274
354
|
this.focusableElement.focus();
|
275
355
|
this.hot.rootDocument.execCommand('cut');
|
276
356
|
}
|
277
357
|
|
278
358
|
/**
|
279
|
-
*
|
359
|
+
* Converts the contents of multiple ranges (`ranges`) into a single string.
|
280
360
|
*
|
281
|
-
* @param {
|
282
|
-
* @returns {string}
|
361
|
+
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `endRow`, `startCol` and `endCol`.
|
362
|
+
* @returns {string} A string that will be copied to the clipboard.
|
283
363
|
*/
|
284
364
|
}, {
|
285
365
|
key: "getRangedCopyableData",
|
286
366
|
value: function getRangedCopyableData(ranges) {
|
287
|
-
|
288
|
-
var dataSet = [];
|
289
|
-
var copyableRows = [];
|
290
|
-
var copyableColumns = [];
|
291
|
-
|
292
|
-
// Count all copyable rows and columns
|
293
|
-
(0, _array.arrayEach)(ranges, function (range) {
|
294
|
-
(0, _number.rangeEach)(range.startRow, range.endRow, function (row) {
|
295
|
-
if (copyableRows.indexOf(row) === -1) {
|
296
|
-
copyableRows.push(row);
|
297
|
-
}
|
298
|
-
});
|
299
|
-
(0, _number.rangeEach)(range.startCol, range.endCol, function (column) {
|
300
|
-
if (copyableColumns.indexOf(column) === -1) {
|
301
|
-
copyableColumns.push(column);
|
302
|
-
}
|
303
|
-
});
|
304
|
-
});
|
305
|
-
// Concat all rows and columns data defined in ranges into one copyable string
|
306
|
-
(0, _array.arrayEach)(copyableRows, function (row) {
|
307
|
-
var rowSet = [];
|
308
|
-
(0, _array.arrayEach)(copyableColumns, function (column) {
|
309
|
-
rowSet.push(_this3.hot.getCopyableData(row, column));
|
310
|
-
});
|
311
|
-
dataSet.push(rowSet);
|
312
|
-
});
|
313
|
-
return (0, _SheetClip.stringify)(dataSet);
|
367
|
+
return (0, _SheetClip.stringify)(this.getRangedData(ranges));
|
314
368
|
}
|
315
369
|
|
316
370
|
/**
|
317
|
-
*
|
371
|
+
* Converts the contents of multiple ranges (`ranges`) into an array of arrays.
|
318
372
|
*
|
319
|
-
* @param {
|
320
|
-
* @returns {Array[]}
|
373
|
+
* @param {Array<{startRow: number, startCol: number, endRow: number, endCol: number}>} ranges Array of objects with properties `startRow`, `startCol`, `endRow` and `endCol`.
|
374
|
+
* @returns {Array[]} An array of arrays that will be copied to the clipboard.
|
321
375
|
*/
|
322
376
|
}, {
|
323
377
|
key: "getRangedData",
|
324
378
|
value: function getRangedData(ranges) {
|
325
|
-
var
|
326
|
-
var
|
327
|
-
var
|
328
|
-
|
379
|
+
var _this3 = this;
|
380
|
+
var data = [];
|
381
|
+
var _normalizeRanges = (0, _copyableRanges.normalizeRanges)(ranges),
|
382
|
+
rows = _normalizeRanges.rows,
|
383
|
+
columns = _normalizeRanges.columns;
|
329
384
|
|
330
|
-
//
|
331
|
-
(0, _array.arrayEach)(
|
332
|
-
(0, _number.rangeEach)(range.startRow, range.endRow, function (row) {
|
333
|
-
if (copyableRows.indexOf(row) === -1) {
|
334
|
-
copyableRows.push(row);
|
335
|
-
}
|
336
|
-
});
|
337
|
-
(0, _number.rangeEach)(range.startCol, range.endCol, function (column) {
|
338
|
-
if (copyableColumns.indexOf(column) === -1) {
|
339
|
-
copyableColumns.push(column);
|
340
|
-
}
|
341
|
-
});
|
342
|
-
});
|
343
|
-
// Concat all rows and columns data defined in ranges into one copyable string
|
344
|
-
(0, _array.arrayEach)(copyableRows, function (row) {
|
385
|
+
// concatenate all rows and columns data defined in ranges into one copyable string
|
386
|
+
(0, _array.arrayEach)(rows, function (row) {
|
345
387
|
var rowSet = [];
|
346
|
-
(0, _array.arrayEach)(
|
347
|
-
|
388
|
+
(0, _array.arrayEach)(columns, function (column) {
|
389
|
+
if (row < 0) {
|
390
|
+
// `row` as the second argument acts here as the `headerLevel` argument
|
391
|
+
rowSet.push(_this3.hot.getColHeader(column, row));
|
392
|
+
} else {
|
393
|
+
rowSet.push(_this3.hot.getCopyableData(row, column));
|
394
|
+
}
|
348
395
|
});
|
349
|
-
|
396
|
+
data.push(rowSet);
|
350
397
|
});
|
351
|
-
return
|
398
|
+
return data;
|
352
399
|
}
|
353
400
|
|
354
401
|
/**
|
355
402
|
* Simulates the paste action.
|
356
403
|
*
|
357
|
-
*
|
404
|
+
* For security reasons, modern browsers don't allow reading from the system clipboard.
|
358
405
|
*
|
359
|
-
* @param {string} pastableText
|
360
|
-
* @param {string} [pastableHtml='']
|
406
|
+
* @param {string} pastableText The value to paste, as a raw string.
|
407
|
+
* @param {string} [pastableHtml=''] The value to paste, as HTML.
|
361
408
|
*/
|
362
409
|
}, {
|
363
410
|
key: "paste",
|
@@ -384,27 +431,43 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
384
431
|
}, {
|
385
432
|
key: "setCopyableText",
|
386
433
|
value: function setCopyableText() {
|
387
|
-
var
|
388
|
-
if (!
|
434
|
+
var selectionRange = this.hot.getSelectedRangeLast();
|
435
|
+
if (!selectionRange) {
|
389
436
|
return;
|
390
437
|
}
|
391
|
-
|
392
|
-
var
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
438
|
+
_classPrivateFieldGet(this, _copyableRangesFactory).setSelectedRange(selectionRange);
|
439
|
+
var groupedRanges = new Map([['headers', null], ['cells', null]]);
|
440
|
+
if (_classPrivateFieldGet(this, _copyMode) === 'column-headers-only') {
|
441
|
+
groupedRanges.set('headers', _classPrivateFieldGet(this, _copyableRangesFactory).getMostBottomColumnHeadersRange());
|
442
|
+
} else {
|
443
|
+
if (_classPrivateFieldGet(this, _copyMode) === 'with-column-headers') {
|
444
|
+
groupedRanges.set('headers', _classPrivateFieldGet(this, _copyableRangesFactory).getMostBottomColumnHeadersRange());
|
445
|
+
} else if (_classPrivateFieldGet(this, _copyMode) === 'with-column-group-headers') {
|
446
|
+
groupedRanges.set('headers', _classPrivateFieldGet(this, _copyableRangesFactory).getAllColumnHeadersRange());
|
447
|
+
}
|
448
|
+
groupedRanges.set('cells', _classPrivateFieldGet(this, _copyableRangesFactory).getCellsRange());
|
449
|
+
}
|
450
|
+
this.copyableRanges = Array.from(groupedRanges.values()).filter(function (range) {
|
451
|
+
return range !== null;
|
452
|
+
}).map(function (_ref) {
|
453
|
+
var startRow = _ref.startRow,
|
454
|
+
startCol = _ref.startCol,
|
455
|
+
endRow = _ref.endRow,
|
456
|
+
endCol = _ref.endCol;
|
457
|
+
return {
|
458
|
+
startRow: startRow,
|
459
|
+
startCol: startCol,
|
460
|
+
endRow: endRow,
|
461
|
+
endCol: endCol
|
462
|
+
};
|
405
463
|
});
|
406
464
|
this.copyableRanges = this.hot.runHooks('modifyCopyableRange', this.copyableRanges);
|
407
|
-
|
465
|
+
var cellsRange = groupedRanges.get('cells');
|
466
|
+
if (cellsRange !== null && cellsRange.isRangeTrimmed) {
|
467
|
+
var startRow = cellsRange.startRow,
|
468
|
+
startCol = cellsRange.startCol,
|
469
|
+
endRow = cellsRange.endRow,
|
470
|
+
endCol = cellsRange.endCol;
|
408
471
|
this.hot.runHooks('afterCopyLimit', endRow - startRow + 1, endCol - startCol + 1, this.rowsLimit, this.columnsLimit);
|
409
472
|
}
|
410
473
|
}
|
@@ -417,8 +480,8 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
417
480
|
}, {
|
418
481
|
key: "getOrCreateFocusableElement",
|
419
482
|
value: function getOrCreateFocusableElement() {
|
420
|
-
var
|
421
|
-
var editableElement =
|
483
|
+
var _this$hot$getActiveEd;
|
484
|
+
var editableElement = (_this$hot$getActiveEd = this.hot.getActiveEditor()) === null || _this$hot$getActiveEd === void 0 ? void 0 : _this$hot$getActiveEd.TEXTAREA;
|
422
485
|
if (editableElement) {
|
423
486
|
this.focusableElement.setFocusableElement(editableElement);
|
424
487
|
} else {
|
@@ -435,10 +498,21 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
435
498
|
}, {
|
436
499
|
key: "isEditorOpened",
|
437
500
|
value: function isEditorOpened() {
|
438
|
-
var
|
439
|
-
return
|
501
|
+
var _this$hot$getActiveEd2;
|
502
|
+
return (_this$hot$getActiveEd2 = this.hot.getActiveEditor()) === null || _this$hot$getActiveEd2 === void 0 ? void 0 : _this$hot$getActiveEd2.isOpened();
|
440
503
|
}
|
441
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
|
+
}, {
|
514
|
+
key: "populateValues",
|
515
|
+
value:
|
442
516
|
/**
|
443
517
|
* Prepares new values to populate them into datasource.
|
444
518
|
*
|
@@ -447,9 +521,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
447
521
|
* @param {Array} [selection] The selection which indicates from what position the data will be populated.
|
448
522
|
* @returns {Array} Range coordinates after populate data.
|
449
523
|
*/
|
450
|
-
|
451
|
-
key: "populateValues",
|
452
|
-
value: function populateValues(inputArray) {
|
524
|
+
function populateValues(inputArray) {
|
453
525
|
var selection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.hot.getSelectedRangeLast();
|
454
526
|
if (!inputArray.length) {
|
455
527
|
return;
|
@@ -512,25 +584,26 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
512
584
|
}, {
|
513
585
|
key: "onCopy",
|
514
586
|
value: function onCopy(event) {
|
515
|
-
|
516
|
-
if (!this.hot.isListening() && !priv.isTriggeredByCopy || this.isEditorOpened()) {
|
587
|
+
if (!this.hot.isListening() && !_classPrivateFieldGet(this, _isTriggeredByCopy) || this.isEditorOpened()) {
|
517
588
|
return;
|
518
589
|
}
|
519
590
|
this.setCopyableText();
|
520
|
-
|
521
|
-
var
|
522
|
-
var
|
591
|
+
_classPrivateFieldSet(this, _isTriggeredByCopy, false);
|
592
|
+
var data = this.getRangedData(this.copyableRanges);
|
593
|
+
var copiedHeadersCount = _classPrivateMethodGet(this, _countCopiedHeaders, _countCopiedHeaders2).call(this, this.copyableRanges);
|
594
|
+
var allowCopying = !!this.hot.runHooks('beforeCopy', data, this.copyableRanges, copiedHeadersCount);
|
523
595
|
if (allowCopying) {
|
524
|
-
var textPlain = (0, _SheetClip.stringify)(
|
596
|
+
var textPlain = (0, _SheetClip.stringify)(data);
|
525
597
|
if (event && event.clipboardData) {
|
526
|
-
var textHTML = (0, _parseTable._dataToHTML)(
|
598
|
+
var textHTML = (0, _parseTable._dataToHTML)(data, this.hot.rootDocument);
|
527
599
|
event.clipboardData.setData('text/plain', textPlain);
|
528
600
|
event.clipboardData.setData('text/html', [META_HEAD, textHTML].join(''));
|
529
601
|
} else if (typeof ClipboardEvent === 'undefined') {
|
530
602
|
this.hot.rootWindow.clipboardData.setData('Text', textPlain);
|
531
603
|
}
|
532
|
-
this.hot.runHooks('afterCopy',
|
604
|
+
this.hot.runHooks('afterCopy', data, this.copyableRanges, copiedHeadersCount);
|
533
605
|
}
|
606
|
+
_classPrivateFieldSet(this, _copyMode, 'cells-only');
|
534
607
|
event.preventDefault();
|
535
608
|
}
|
536
609
|
|
@@ -543,12 +616,11 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
543
616
|
}, {
|
544
617
|
key: "onCut",
|
545
618
|
value: function onCut(event) {
|
546
|
-
|
547
|
-
if (!this.hot.isListening() && !priv.isTriggeredByCut || this.isEditorOpened()) {
|
619
|
+
if (!this.hot.isListening() && !_classPrivateFieldGet(this, _isTriggeredByCut) || this.isEditorOpened()) {
|
548
620
|
return;
|
549
621
|
}
|
550
622
|
this.setCopyableText();
|
551
|
-
|
623
|
+
_classPrivateFieldSet(this, _isTriggeredByCut, false);
|
552
624
|
var rangedData = this.getRangedData(this.copyableRanges);
|
553
625
|
var allowCuttingOut = !!this.hot.runHooks('beforeCut', rangedData, this.copyableRanges);
|
554
626
|
if (allowCuttingOut) {
|
@@ -627,7 +699,17 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
627
699
|
value: function onAfterContextMenuDefaultOptions(options) {
|
628
700
|
options.items.push({
|
629
701
|
name: '---------'
|
630
|
-
}, (0, _copy.default)(this)
|
702
|
+
}, (0, _copy.default)(this));
|
703
|
+
if (_classPrivateFieldGet(this, _enableCopyColumnHeaders)) {
|
704
|
+
options.items.push((0, _copyWithColumnHeaders.default)(this));
|
705
|
+
}
|
706
|
+
if (_classPrivateFieldGet(this, _enableCopyColumnGroupHeaders)) {
|
707
|
+
options.items.push((0, _copyWithColumnGroupHeaders.default)(this));
|
708
|
+
}
|
709
|
+
if (_classPrivateFieldGet(this, _enableCopyColumnHeadersOnly)) {
|
710
|
+
options.items.push((0, _copyColumnHeadersOnly.default)(this));
|
711
|
+
}
|
712
|
+
options.items.push((0, _cut.default)(this));
|
631
713
|
}
|
632
714
|
|
633
715
|
/**
|
@@ -655,13 +737,11 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
655
737
|
}, {
|
656
738
|
key: "onAfterSelectionEnd",
|
657
739
|
value: function onAfterSelectionEnd() {
|
658
|
-
var _privatePool$get = privatePool.get(this),
|
659
|
-
isFragmentSelectionEnabled = _privatePool$get.isFragmentSelectionEnabled;
|
660
740
|
if (this.isEditorOpened()) {
|
661
741
|
return;
|
662
742
|
}
|
663
743
|
this.getOrCreateFocusableElement();
|
664
|
-
if (
|
744
|
+
if (this.hot.getSettings().fragmentSelection && this.focusableElement.getFocusableElement() !== this.hot.rootDocument.activeElement && (0, _element.getSelectionText)()) {
|
665
745
|
return;
|
666
746
|
}
|
667
747
|
this.setCopyableText();
|
@@ -689,7 +769,7 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
689
769
|
}
|
690
770
|
|
691
771
|
/**
|
692
|
-
* Destroys the plugin instance.
|
772
|
+
* Destroys the `CopyPaste` plugin instance.
|
693
773
|
*/
|
694
774
|
}, {
|
695
775
|
key: "destroy",
|
@@ -715,7 +795,28 @@ var CopyPaste = /*#__PURE__*/function (_BasePlugin) {
|
|
715
795
|
get: function get() {
|
716
796
|
return PLUGIN_PRIORITY;
|
717
797
|
}
|
798
|
+
|
799
|
+
/**
|
800
|
+
* The maximum number of columns than can be copied to the clipboard.
|
801
|
+
*
|
802
|
+
* @type {number}
|
803
|
+
* @default Infinity
|
804
|
+
*/
|
718
805
|
}]);
|
719
806
|
return CopyPaste;
|
720
807
|
}(_base.BasePlugin);
|
721
|
-
exports.CopyPaste = CopyPaste;
|
808
|
+
exports.CopyPaste = CopyPaste;
|
809
|
+
function _countCopiedHeaders2(ranges) {
|
810
|
+
var _normalizeRanges2 = (0, _copyableRanges.normalizeRanges)(ranges),
|
811
|
+
rows = _normalizeRanges2.rows;
|
812
|
+
var columnHeadersCount = 0;
|
813
|
+
for (var row = 0; row < rows.length; row++) {
|
814
|
+
if (rows[row] >= 0) {
|
815
|
+
break;
|
816
|
+
}
|
817
|
+
columnHeadersCount += 1;
|
818
|
+
}
|
819
|
+
return {
|
820
|
+
columnHeadersCount: columnHeadersCount
|
821
|
+
};
|
822
|
+
}
|