handsontable 12.2.0 → 12.3.0-next-bb1a7c2-20221208
Sign up to get free protection for your applications and to get access to all the features.
- 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
package/dataMap/dataMap.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
require("core-js/modules/es.symbol.js");
|
4
|
-
require("core-js/modules/es.symbol.description.js");
|
5
3
|
require("core-js/modules/es.symbol.iterator.js");
|
6
4
|
require("core-js/modules/es.array.from.js");
|
7
5
|
require("core-js/modules/es.function.name.js");
|
@@ -18,10 +16,14 @@ require("core-js/modules/es.number.constructor.js");
|
|
18
16
|
require("core-js/modules/es.array.splice.js");
|
19
17
|
require("core-js/modules/es.array.sort.js");
|
20
18
|
require("core-js/modules/es.array.slice.js");
|
21
|
-
require("core-js/modules/es.array.concat.js");
|
22
19
|
require("core-js/modules/web.dom-collections.for-each.js");
|
20
|
+
require("core-js/modules/es.array.concat.js");
|
23
21
|
require("core-js/modules/es.array.filter.js");
|
24
22
|
require("core-js/modules/es.array.index-of.js");
|
23
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
24
|
+
require("core-js/modules/es.date.to-primitive.js");
|
25
|
+
require("core-js/modules/es.symbol.js");
|
26
|
+
require("core-js/modules/es.symbol.description.js");
|
25
27
|
var _SheetClip = require("../3rdparty/SheetClip");
|
26
28
|
var _data = require("../helpers/data");
|
27
29
|
var _object = require("../helpers/object");
|
@@ -36,10 +38,10 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
36
38
|
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; }
|
37
39
|
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); }
|
38
40
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
39
|
-
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); } }
|
41
|
+
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); } }
|
40
42
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
41
|
-
var
|
42
|
-
|
43
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
44
|
+
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); }
|
43
45
|
/*
|
44
46
|
This class contains open-source contributions covered by the MIT license.
|
45
47
|
|
@@ -61,7 +63,6 @@ The above copyright notice and this permission notice shall be included in all c
|
|
61
63
|
|
62
64
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
63
65
|
*/
|
64
|
-
|
65
66
|
/**
|
66
67
|
* Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names.
|
67
68
|
*
|
@@ -75,9 +76,9 @@ var DataMap = /*#__PURE__*/function () {
|
|
75
76
|
/**
|
76
77
|
* @param {object} instance Instance of Handsontable.
|
77
78
|
* @param {Array} data Array of arrays or array of objects containing data.
|
78
|
-
* @param {
|
79
|
+
* @param {MetaManager} metaManager The meta manager instance.
|
79
80
|
*/
|
80
|
-
function DataMap(instance, data,
|
81
|
+
function DataMap(instance, data, metaManager) {
|
81
82
|
_classCallCheck(this, DataMap);
|
82
83
|
/**
|
83
84
|
* Instance of {@link Handsontable}.
|
@@ -86,13 +87,20 @@ var DataMap = /*#__PURE__*/function () {
|
|
86
87
|
* @type {Handsontable}
|
87
88
|
*/
|
88
89
|
this.instance = instance;
|
90
|
+
/**
|
91
|
+
* Instance of {@link MetaManager}.
|
92
|
+
*
|
93
|
+
* @private
|
94
|
+
* @type {MetaManager}
|
95
|
+
*/
|
96
|
+
this.metaManager = metaManager;
|
89
97
|
/**
|
90
98
|
* Instance of {@link TableMeta}.
|
91
99
|
*
|
92
100
|
* @private
|
93
101
|
* @type {TableMeta}
|
94
102
|
*/
|
95
|
-
this.tableMeta =
|
103
|
+
this.tableMeta = metaManager.getTableMeta();
|
96
104
|
/**
|
97
105
|
* Reference to the original dataset.
|
98
106
|
*
|
@@ -104,7 +112,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
104
112
|
*
|
105
113
|
* @type {object}
|
106
114
|
*/
|
107
|
-
this.duckSchema = this.
|
115
|
+
this.duckSchema = this.createDuckSchema();
|
108
116
|
/**
|
109
117
|
* Cached array of properties to columns.
|
110
118
|
*
|
@@ -275,6 +283,26 @@ var DataMap = /*#__PURE__*/function () {
|
|
275
283
|
return this.duckSchema;
|
276
284
|
}
|
277
285
|
|
286
|
+
/**
|
287
|
+
* Creates the duck schema based on the current dataset.
|
288
|
+
*
|
289
|
+
* @returns {Array|object}
|
290
|
+
*/
|
291
|
+
}, {
|
292
|
+
key: "createDuckSchema",
|
293
|
+
value: function createDuckSchema() {
|
294
|
+
return this.dataSource && this.dataSource[0] ? (0, _object.duckSchema)(this.dataSource[0]) : {};
|
295
|
+
}
|
296
|
+
|
297
|
+
/**
|
298
|
+
* Refresh the data schema.
|
299
|
+
*/
|
300
|
+
}, {
|
301
|
+
key: "refreshDuckSchema",
|
302
|
+
value: function refreshDuckSchema() {
|
303
|
+
this.duckSchema = this.createDuckSchema();
|
304
|
+
}
|
305
|
+
|
278
306
|
/**
|
279
307
|
* Creates row at the bottom of the data array.
|
280
308
|
*
|
@@ -307,10 +335,12 @@ var DataMap = /*#__PURE__*/function () {
|
|
307
335
|
}
|
308
336
|
var continueProcess = this.instance.runHooks('beforeCreateRow', rowIndex, amount, source);
|
309
337
|
if (continueProcess === false || physicalRowIndex === null) {
|
310
|
-
return
|
338
|
+
return {
|
339
|
+
delta: 0
|
340
|
+
};
|
311
341
|
}
|
312
342
|
var maxRows = this.tableMeta.maxRows;
|
313
|
-
var columnCount = this.
|
343
|
+
var columnCount = this.getSchema().length;
|
314
344
|
var rowsToAdd = [];
|
315
345
|
var _loop = function _loop() {
|
316
346
|
var row = null;
|
@@ -343,6 +373,21 @@ var DataMap = /*#__PURE__*/function () {
|
|
343
373
|
}
|
344
374
|
this.spliceData(physicalRowIndex, 0, rowsToAdd);
|
345
375
|
var newVisualRowIndex = this.instance.toVisualRow(physicalRowIndex);
|
376
|
+
|
377
|
+
// In case the created rows are the only ones in the table, the column index mappers need to be rebuilt based on
|
378
|
+
// the number of columns created in the row or the schema.
|
379
|
+
if (this.instance.countSourceRows() === rowsToAdd.length) {
|
380
|
+
this.instance.columnIndexMapper.initToLength(this.instance.getInitialColumnCount());
|
381
|
+
}
|
382
|
+
if (numberOfCreatedRows > 0) {
|
383
|
+
if (index === void 0 || index === null) {
|
384
|
+
// Creates the meta rows at the end of the rows collection without shifting the cells
|
385
|
+
// that were defined out of the range of the dataset.
|
386
|
+
this.metaManager.createRow(null, numberOfCreatedRows);
|
387
|
+
} else if (source !== 'auto') {
|
388
|
+
this.metaManager.createRow(physicalRowIndex, amount);
|
389
|
+
}
|
390
|
+
}
|
346
391
|
this.instance.runHooks('afterCreateRow', newVisualRowIndex, numberOfCreatedRows, source);
|
347
392
|
this.instance.forceFullRender = true; // used when data was changed
|
348
393
|
|
@@ -384,7 +429,9 @@ var DataMap = /*#__PURE__*/function () {
|
|
384
429
|
}
|
385
430
|
var continueProcess = this.instance.runHooks('beforeCreateCol', columnIndex, amount, source);
|
386
431
|
if (continueProcess === false) {
|
387
|
-
return
|
432
|
+
return {
|
433
|
+
delta: 0
|
434
|
+
};
|
388
435
|
}
|
389
436
|
var physicalColumnIndex = countSourceCols;
|
390
437
|
if (columnIndex < this.instance.countCols()) {
|
@@ -420,10 +467,20 @@ var DataMap = /*#__PURE__*/function () {
|
|
420
467
|
nrOfColumns += 1;
|
421
468
|
}
|
422
469
|
this.instance.columnIndexMapper.insertIndexes(columnIndex, numberOfCreatedCols);
|
470
|
+
if (numberOfCreatedCols > 0) {
|
471
|
+
if (index === void 0 || index === null) {
|
472
|
+
// Creates the meta columns at the end of the columns collection without shifting the cells
|
473
|
+
// that were defined out of the range of the dataset.
|
474
|
+
this.metaManager.createColumn(null, numberOfCreatedCols);
|
475
|
+
} else if (source !== 'auto') {
|
476
|
+
this.metaManager.createColumn(startPhysicalIndex, amount);
|
477
|
+
}
|
478
|
+
}
|
423
479
|
var newVisualColumnIndex = this.instance.toVisualColumn(startPhysicalIndex);
|
424
480
|
this.instance.runHooks('afterCreateCol', newVisualColumnIndex, numberOfCreatedCols, source);
|
425
481
|
this.instance.forceFullRender = true; // used when data was changed
|
426
482
|
|
483
|
+
this.refreshDuckSchema();
|
427
484
|
return {
|
428
485
|
delta: numberOfCreatedCols,
|
429
486
|
startPhysicalIndex: startPhysicalIndex
|
@@ -443,6 +500,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
443
500
|
}, {
|
444
501
|
key: "removeRow",
|
445
502
|
value: function removeRow(index) {
|
503
|
+
var _this3 = this;
|
446
504
|
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
447
505
|
var source = arguments.length > 2 ? arguments[2] : undefined;
|
448
506
|
var rowIndex = Number.isInteger(index) ? index : -amount; // -amount = taking indexes from the end.
|
@@ -470,6 +528,12 @@ var DataMap = /*#__PURE__*/function () {
|
|
470
528
|
this.instance.columnIndexMapper.setIndexesSequence([]);
|
471
529
|
}
|
472
530
|
}
|
531
|
+
var descendingPhysicalRows = removedPhysicalIndexes.slice(0).sort(function (a, b) {
|
532
|
+
return b - a;
|
533
|
+
});
|
534
|
+
descendingPhysicalRows.forEach(function (rowPhysicalIndex) {
|
535
|
+
_this3.metaManager.removeRow(rowPhysicalIndex, 1);
|
536
|
+
});
|
473
537
|
this.instance.runHooks('afterRemoveRow', rowIndex, numberOfRemovedIndexes, removedPhysicalIndexes, source);
|
474
538
|
this.instance.forceFullRender = true; // used when data was changed
|
475
539
|
|
@@ -496,46 +560,52 @@ var DataMap = /*#__PURE__*/function () {
|
|
496
560
|
}
|
497
561
|
var columnIndex = typeof index !== 'number' ? -amount : index;
|
498
562
|
columnIndex = (this.instance.countCols() + columnIndex) % this.instance.countCols();
|
499
|
-
var
|
500
|
-
var
|
563
|
+
var removedPhysicalIndexes = this.visualColumnsToPhysical(columnIndex, amount);
|
564
|
+
var descendingPhysicalColumns = removedPhysicalIndexes.slice(0).sort(function (a, b) {
|
501
565
|
return b - a;
|
502
566
|
});
|
503
|
-
var actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', columnIndex, amount,
|
567
|
+
var actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
|
504
568
|
if (actionWasNotCancelled === false) {
|
505
569
|
return false;
|
506
570
|
}
|
507
571
|
var isTableUniform = true;
|
508
|
-
var removedColumnsCount =
|
572
|
+
var removedColumnsCount = descendingPhysicalColumns.length;
|
509
573
|
var data = this.dataSource;
|
510
574
|
for (var c = 0; c < removedColumnsCount; c++) {
|
511
|
-
if (isTableUniform &&
|
575
|
+
if (isTableUniform && removedPhysicalIndexes[0] !== removedPhysicalIndexes[c] - c) {
|
512
576
|
isTableUniform = false;
|
513
577
|
}
|
514
578
|
}
|
515
579
|
if (isTableUniform) {
|
516
580
|
for (var r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {
|
517
|
-
data[r].splice(
|
581
|
+
data[r].splice(removedPhysicalIndexes[0], amount);
|
582
|
+
if (r === 0) {
|
583
|
+
this.metaManager.removeColumn(removedPhysicalIndexes[0], amount);
|
584
|
+
}
|
518
585
|
}
|
519
586
|
} else {
|
520
587
|
for (var _r = 0, _rlen = this.instance.countSourceRows(); _r < _rlen; _r++) {
|
521
588
|
for (var _c = 0; _c < removedColumnsCount; _c++) {
|
522
|
-
data[_r].splice(
|
589
|
+
data[_r].splice(descendingPhysicalColumns[_c], 1);
|
590
|
+
if (_r === 0) {
|
591
|
+
this.metaManager.removeColumn(descendingPhysicalColumns[_c], 1);
|
592
|
+
}
|
523
593
|
}
|
524
594
|
}
|
525
595
|
}
|
526
596
|
|
527
597
|
// TODO: Function `removeCol` should validate fully, probably above.
|
528
598
|
if (columnIndex < this.instance.countCols()) {
|
529
|
-
this.instance.columnIndexMapper.removeIndexes(
|
599
|
+
this.instance.columnIndexMapper.removeIndexes(removedPhysicalIndexes);
|
530
600
|
|
531
601
|
// All columns have been removed. There shouldn't be any rows.
|
532
602
|
if (this.instance.columnIndexMapper.getNotTrimmedIndexesLength() === 0) {
|
533
603
|
this.instance.rowIndexMapper.setIndexesSequence([]);
|
534
604
|
}
|
535
605
|
}
|
536
|
-
this.instance.runHooks('afterRemoveCol', columnIndex, amount,
|
606
|
+
this.instance.runHooks('afterRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
|
537
607
|
this.instance.forceFullRender = true; // used when data was changed
|
538
|
-
|
608
|
+
this.refreshDuckSchema();
|
539
609
|
return true;
|
540
610
|
}
|
541
611
|
|
@@ -606,7 +676,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
606
676
|
}, {
|
607
677
|
key: "spliceData",
|
608
678
|
value: function spliceData(index, deleteCount, elements) {
|
609
|
-
var
|
679
|
+
var _this4 = this;
|
610
680
|
var continueSplicing = this.instance.runHooks('beforeDataSplice', index, deleteCount, elements);
|
611
681
|
if (continueSplicing !== false) {
|
612
682
|
var newData = [].concat(_toConsumableArray(this.dataSource.slice(0, index)), _toConsumableArray(elements), _toConsumableArray(this.dataSource.slice(index)));
|
@@ -617,7 +687,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
617
687
|
// Pushing to array instead of using `splice`, because Babel changes the code to one that uses the `apply` method.
|
618
688
|
// The used method was cause of the problem described within #7840.
|
619
689
|
newData.forEach(function (row) {
|
620
|
-
return
|
690
|
+
return _this4.dataSource.push(row);
|
621
691
|
});
|
622
692
|
}
|
623
693
|
}
|
@@ -703,7 +773,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
703
773
|
}, {
|
704
774
|
key: "getCopyable",
|
705
775
|
value: function getCopyable(row, prop) {
|
706
|
-
if (
|
776
|
+
if (this.instance.getCellMeta(row, this.propToCol(prop)).copyable) {
|
707
777
|
return this.get(row, prop);
|
708
778
|
}
|
709
779
|
return '';
|
@@ -943,7 +1013,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
943
1013
|
key: "destroy",
|
944
1014
|
value: function destroy() {
|
945
1015
|
this.instance = null;
|
946
|
-
this.
|
1016
|
+
this.metaManager = null;
|
947
1017
|
this.dataSource = null;
|
948
1018
|
this.duckSchema = null;
|
949
1019
|
this.colToPropCache.length = 0;
|
package/dataMap/dataMap.mjs
CHANGED
@@ -15,10 +15,12 @@ import "core-js/modules/es.number.constructor.js";
|
|
15
15
|
import "core-js/modules/es.array.splice.js";
|
16
16
|
import "core-js/modules/es.array.sort.js";
|
17
17
|
import "core-js/modules/es.array.slice.js";
|
18
|
-
import "core-js/modules/es.array.concat.js";
|
19
18
|
import "core-js/modules/web.dom-collections.for-each.js";
|
19
|
+
import "core-js/modules/es.array.concat.js";
|
20
20
|
import "core-js/modules/es.array.filter.js";
|
21
21
|
import "core-js/modules/es.array.index-of.js";
|
22
|
+
import "core-js/modules/es.symbol.to-primitive.js";
|
23
|
+
import "core-js/modules/es.date.to-primitive.js";
|
22
24
|
import "core-js/modules/es.symbol.js";
|
23
25
|
import "core-js/modules/es.symbol.description.js";
|
24
26
|
import "core-js/modules/es.symbol.iterator.js";
|
@@ -26,16 +28,16 @@ import "core-js/modules/es.array.from.js";
|
|
26
28
|
import "core-js/modules/es.function.name.js";
|
27
29
|
import "core-js/modules/es.regexp.exec.js";
|
28
30
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
29
|
-
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); } }
|
31
|
+
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); } }
|
30
32
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
33
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
34
|
+
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); }
|
31
35
|
import { stringify } from "../3rdparty/SheetClip/index.mjs";
|
32
|
-
import {
|
36
|
+
import { countFirstRowKeys as _countFirstRowKeys } from "../helpers/data.mjs";
|
33
37
|
import { createObjectPropListener, deepClone, deepExtend, deepObjectSize, duckSchema, hasOwnProperty, isObject, objectEach } from "../helpers/object.mjs";
|
34
38
|
import { extendArray, to2dArray } from "../helpers/array.mjs";
|
35
39
|
import { rangeEach } from "../helpers/number.mjs";
|
36
40
|
import { isDefined } from "../helpers/mixed.mjs";
|
37
|
-
var copyableLookup = cellMethodLookupFactory('copyable', false);
|
38
|
-
|
39
41
|
/*
|
40
42
|
This class contains open-source contributions covered by the MIT license.
|
41
43
|
|
@@ -57,7 +59,6 @@ The above copyright notice and this permission notice shall be included in all c
|
|
57
59
|
|
58
60
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
59
61
|
*/
|
60
|
-
|
61
62
|
/**
|
62
63
|
* Utility class that gets and saves data from/to the data source using mapping of columns numbers to object property names.
|
63
64
|
*
|
@@ -71,9 +72,9 @@ var DataMap = /*#__PURE__*/function () {
|
|
71
72
|
/**
|
72
73
|
* @param {object} instance Instance of Handsontable.
|
73
74
|
* @param {Array} data Array of arrays or array of objects containing data.
|
74
|
-
* @param {
|
75
|
+
* @param {MetaManager} metaManager The meta manager instance.
|
75
76
|
*/
|
76
|
-
function DataMap(instance, data,
|
77
|
+
function DataMap(instance, data, metaManager) {
|
77
78
|
_classCallCheck(this, DataMap);
|
78
79
|
/**
|
79
80
|
* Instance of {@link Handsontable}.
|
@@ -82,13 +83,20 @@ var DataMap = /*#__PURE__*/function () {
|
|
82
83
|
* @type {Handsontable}
|
83
84
|
*/
|
84
85
|
this.instance = instance;
|
86
|
+
/**
|
87
|
+
* Instance of {@link MetaManager}.
|
88
|
+
*
|
89
|
+
* @private
|
90
|
+
* @type {MetaManager}
|
91
|
+
*/
|
92
|
+
this.metaManager = metaManager;
|
85
93
|
/**
|
86
94
|
* Instance of {@link TableMeta}.
|
87
95
|
*
|
88
96
|
* @private
|
89
97
|
* @type {TableMeta}
|
90
98
|
*/
|
91
|
-
this.tableMeta =
|
99
|
+
this.tableMeta = metaManager.getTableMeta();
|
92
100
|
/**
|
93
101
|
* Reference to the original dataset.
|
94
102
|
*
|
@@ -100,7 +108,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
100
108
|
*
|
101
109
|
* @type {object}
|
102
110
|
*/
|
103
|
-
this.duckSchema = this.
|
111
|
+
this.duckSchema = this.createDuckSchema();
|
104
112
|
/**
|
105
113
|
* Cached array of properties to columns.
|
106
114
|
*
|
@@ -271,6 +279,26 @@ var DataMap = /*#__PURE__*/function () {
|
|
271
279
|
return this.duckSchema;
|
272
280
|
}
|
273
281
|
|
282
|
+
/**
|
283
|
+
* Creates the duck schema based on the current dataset.
|
284
|
+
*
|
285
|
+
* @returns {Array|object}
|
286
|
+
*/
|
287
|
+
}, {
|
288
|
+
key: "createDuckSchema",
|
289
|
+
value: function createDuckSchema() {
|
290
|
+
return this.dataSource && this.dataSource[0] ? duckSchema(this.dataSource[0]) : {};
|
291
|
+
}
|
292
|
+
|
293
|
+
/**
|
294
|
+
* Refresh the data schema.
|
295
|
+
*/
|
296
|
+
}, {
|
297
|
+
key: "refreshDuckSchema",
|
298
|
+
value: function refreshDuckSchema() {
|
299
|
+
this.duckSchema = this.createDuckSchema();
|
300
|
+
}
|
301
|
+
|
274
302
|
/**
|
275
303
|
* Creates row at the bottom of the data array.
|
276
304
|
*
|
@@ -303,10 +331,12 @@ var DataMap = /*#__PURE__*/function () {
|
|
303
331
|
}
|
304
332
|
var continueProcess = this.instance.runHooks('beforeCreateRow', rowIndex, amount, source);
|
305
333
|
if (continueProcess === false || physicalRowIndex === null) {
|
306
|
-
return
|
334
|
+
return {
|
335
|
+
delta: 0
|
336
|
+
};
|
307
337
|
}
|
308
338
|
var maxRows = this.tableMeta.maxRows;
|
309
|
-
var columnCount = this.
|
339
|
+
var columnCount = this.getSchema().length;
|
310
340
|
var rowsToAdd = [];
|
311
341
|
var _loop = function _loop() {
|
312
342
|
var row = null;
|
@@ -339,6 +369,21 @@ var DataMap = /*#__PURE__*/function () {
|
|
339
369
|
}
|
340
370
|
this.spliceData(physicalRowIndex, 0, rowsToAdd);
|
341
371
|
var newVisualRowIndex = this.instance.toVisualRow(physicalRowIndex);
|
372
|
+
|
373
|
+
// In case the created rows are the only ones in the table, the column index mappers need to be rebuilt based on
|
374
|
+
// the number of columns created in the row or the schema.
|
375
|
+
if (this.instance.countSourceRows() === rowsToAdd.length) {
|
376
|
+
this.instance.columnIndexMapper.initToLength(this.instance.getInitialColumnCount());
|
377
|
+
}
|
378
|
+
if (numberOfCreatedRows > 0) {
|
379
|
+
if (index === void 0 || index === null) {
|
380
|
+
// Creates the meta rows at the end of the rows collection without shifting the cells
|
381
|
+
// that were defined out of the range of the dataset.
|
382
|
+
this.metaManager.createRow(null, numberOfCreatedRows);
|
383
|
+
} else if (source !== 'auto') {
|
384
|
+
this.metaManager.createRow(physicalRowIndex, amount);
|
385
|
+
}
|
386
|
+
}
|
342
387
|
this.instance.runHooks('afterCreateRow', newVisualRowIndex, numberOfCreatedRows, source);
|
343
388
|
this.instance.forceFullRender = true; // used when data was changed
|
344
389
|
|
@@ -380,7 +425,9 @@ var DataMap = /*#__PURE__*/function () {
|
|
380
425
|
}
|
381
426
|
var continueProcess = this.instance.runHooks('beforeCreateCol', columnIndex, amount, source);
|
382
427
|
if (continueProcess === false) {
|
383
|
-
return
|
428
|
+
return {
|
429
|
+
delta: 0
|
430
|
+
};
|
384
431
|
}
|
385
432
|
var physicalColumnIndex = countSourceCols;
|
386
433
|
if (columnIndex < this.instance.countCols()) {
|
@@ -416,10 +463,20 @@ var DataMap = /*#__PURE__*/function () {
|
|
416
463
|
nrOfColumns += 1;
|
417
464
|
}
|
418
465
|
this.instance.columnIndexMapper.insertIndexes(columnIndex, numberOfCreatedCols);
|
466
|
+
if (numberOfCreatedCols > 0) {
|
467
|
+
if (index === void 0 || index === null) {
|
468
|
+
// Creates the meta columns at the end of the columns collection without shifting the cells
|
469
|
+
// that were defined out of the range of the dataset.
|
470
|
+
this.metaManager.createColumn(null, numberOfCreatedCols);
|
471
|
+
} else if (source !== 'auto') {
|
472
|
+
this.metaManager.createColumn(startPhysicalIndex, amount);
|
473
|
+
}
|
474
|
+
}
|
419
475
|
var newVisualColumnIndex = this.instance.toVisualColumn(startPhysicalIndex);
|
420
476
|
this.instance.runHooks('afterCreateCol', newVisualColumnIndex, numberOfCreatedCols, source);
|
421
477
|
this.instance.forceFullRender = true; // used when data was changed
|
422
478
|
|
479
|
+
this.refreshDuckSchema();
|
423
480
|
return {
|
424
481
|
delta: numberOfCreatedCols,
|
425
482
|
startPhysicalIndex: startPhysicalIndex
|
@@ -439,6 +496,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
439
496
|
}, {
|
440
497
|
key: "removeRow",
|
441
498
|
value: function removeRow(index) {
|
499
|
+
var _this3 = this;
|
442
500
|
var amount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
443
501
|
var source = arguments.length > 2 ? arguments[2] : undefined;
|
444
502
|
var rowIndex = Number.isInteger(index) ? index : -amount; // -amount = taking indexes from the end.
|
@@ -466,6 +524,12 @@ var DataMap = /*#__PURE__*/function () {
|
|
466
524
|
this.instance.columnIndexMapper.setIndexesSequence([]);
|
467
525
|
}
|
468
526
|
}
|
527
|
+
var descendingPhysicalRows = removedPhysicalIndexes.slice(0).sort(function (a, b) {
|
528
|
+
return b - a;
|
529
|
+
});
|
530
|
+
descendingPhysicalRows.forEach(function (rowPhysicalIndex) {
|
531
|
+
_this3.metaManager.removeRow(rowPhysicalIndex, 1);
|
532
|
+
});
|
469
533
|
this.instance.runHooks('afterRemoveRow', rowIndex, numberOfRemovedIndexes, removedPhysicalIndexes, source);
|
470
534
|
this.instance.forceFullRender = true; // used when data was changed
|
471
535
|
|
@@ -492,46 +556,52 @@ var DataMap = /*#__PURE__*/function () {
|
|
492
556
|
}
|
493
557
|
var columnIndex = typeof index !== 'number' ? -amount : index;
|
494
558
|
columnIndex = (this.instance.countCols() + columnIndex) % this.instance.countCols();
|
495
|
-
var
|
496
|
-
var
|
559
|
+
var removedPhysicalIndexes = this.visualColumnsToPhysical(columnIndex, amount);
|
560
|
+
var descendingPhysicalColumns = removedPhysicalIndexes.slice(0).sort(function (a, b) {
|
497
561
|
return b - a;
|
498
562
|
});
|
499
|
-
var actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', columnIndex, amount,
|
563
|
+
var actionWasNotCancelled = this.instance.runHooks('beforeRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
|
500
564
|
if (actionWasNotCancelled === false) {
|
501
565
|
return false;
|
502
566
|
}
|
503
567
|
var isTableUniform = true;
|
504
|
-
var removedColumnsCount =
|
568
|
+
var removedColumnsCount = descendingPhysicalColumns.length;
|
505
569
|
var data = this.dataSource;
|
506
570
|
for (var c = 0; c < removedColumnsCount; c++) {
|
507
|
-
if (isTableUniform &&
|
571
|
+
if (isTableUniform && removedPhysicalIndexes[0] !== removedPhysicalIndexes[c] - c) {
|
508
572
|
isTableUniform = false;
|
509
573
|
}
|
510
574
|
}
|
511
575
|
if (isTableUniform) {
|
512
576
|
for (var r = 0, rlen = this.instance.countSourceRows(); r < rlen; r++) {
|
513
|
-
data[r].splice(
|
577
|
+
data[r].splice(removedPhysicalIndexes[0], amount);
|
578
|
+
if (r === 0) {
|
579
|
+
this.metaManager.removeColumn(removedPhysicalIndexes[0], amount);
|
580
|
+
}
|
514
581
|
}
|
515
582
|
} else {
|
516
583
|
for (var _r = 0, _rlen = this.instance.countSourceRows(); _r < _rlen; _r++) {
|
517
584
|
for (var _c = 0; _c < removedColumnsCount; _c++) {
|
518
|
-
data[_r].splice(
|
585
|
+
data[_r].splice(descendingPhysicalColumns[_c], 1);
|
586
|
+
if (_r === 0) {
|
587
|
+
this.metaManager.removeColumn(descendingPhysicalColumns[_c], 1);
|
588
|
+
}
|
519
589
|
}
|
520
590
|
}
|
521
591
|
}
|
522
592
|
|
523
593
|
// TODO: Function `removeCol` should validate fully, probably above.
|
524
594
|
if (columnIndex < this.instance.countCols()) {
|
525
|
-
this.instance.columnIndexMapper.removeIndexes(
|
595
|
+
this.instance.columnIndexMapper.removeIndexes(removedPhysicalIndexes);
|
526
596
|
|
527
597
|
// All columns have been removed. There shouldn't be any rows.
|
528
598
|
if (this.instance.columnIndexMapper.getNotTrimmedIndexesLength() === 0) {
|
529
599
|
this.instance.rowIndexMapper.setIndexesSequence([]);
|
530
600
|
}
|
531
601
|
}
|
532
|
-
this.instance.runHooks('afterRemoveCol', columnIndex, amount,
|
602
|
+
this.instance.runHooks('afterRemoveCol', columnIndex, amount, removedPhysicalIndexes, source);
|
533
603
|
this.instance.forceFullRender = true; // used when data was changed
|
534
|
-
|
604
|
+
this.refreshDuckSchema();
|
535
605
|
return true;
|
536
606
|
}
|
537
607
|
|
@@ -602,7 +672,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
602
672
|
}, {
|
603
673
|
key: "spliceData",
|
604
674
|
value: function spliceData(index, deleteCount, elements) {
|
605
|
-
var
|
675
|
+
var _this4 = this;
|
606
676
|
var continueSplicing = this.instance.runHooks('beforeDataSplice', index, deleteCount, elements);
|
607
677
|
if (continueSplicing !== false) {
|
608
678
|
var newData = [].concat(_toConsumableArray(this.dataSource.slice(0, index)), _toConsumableArray(elements), _toConsumableArray(this.dataSource.slice(index)));
|
@@ -613,7 +683,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
613
683
|
// Pushing to array instead of using `splice`, because Babel changes the code to one that uses the `apply` method.
|
614
684
|
// The used method was cause of the problem described within #7840.
|
615
685
|
newData.forEach(function (row) {
|
616
|
-
return
|
686
|
+
return _this4.dataSource.push(row);
|
617
687
|
});
|
618
688
|
}
|
619
689
|
}
|
@@ -699,7 +769,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
699
769
|
}, {
|
700
770
|
key: "getCopyable",
|
701
771
|
value: function getCopyable(row, prop) {
|
702
|
-
if (
|
772
|
+
if (this.instance.getCellMeta(row, this.propToCol(prop)).copyable) {
|
703
773
|
return this.get(row, prop);
|
704
774
|
}
|
705
775
|
return '';
|
@@ -939,7 +1009,7 @@ var DataMap = /*#__PURE__*/function () {
|
|
939
1009
|
key: "destroy",
|
940
1010
|
value: function destroy() {
|
941
1011
|
this.instance = null;
|
942
|
-
this.
|
1012
|
+
this.metaManager = null;
|
943
1013
|
this.dataSource = null;
|
944
1014
|
this.duckSchema = null;
|
945
1015
|
this.colToPropCache.length = 0;
|
package/dataMap/dataSource.js
CHANGED
@@ -1,23 +1,35 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
require("core-js/modules/es.symbol.iterator.js");
|
4
|
+
require("core-js/modules/es.array.iterator.js");
|
5
|
+
require("core-js/modules/es.string.iterator.js");
|
6
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
3
7
|
exports.__esModule = true;
|
4
8
|
exports.default = void 0;
|
5
9
|
require("core-js/modules/es.number.is-integer.js");
|
6
10
|
require("core-js/modules/es.number.constructor.js");
|
7
11
|
require("core-js/modules/es.object.to-string.js");
|
8
12
|
require("core-js/modules/web.dom-collections.for-each.js");
|
13
|
+
require("core-js/modules/es.symbol.to-primitive.js");
|
14
|
+
require("core-js/modules/es.date.to-primitive.js");
|
15
|
+
require("core-js/modules/es.symbol.js");
|
16
|
+
require("core-js/modules/es.symbol.description.js");
|
9
17
|
var _object = require("../helpers/object");
|
10
18
|
var _data = require("../helpers/data");
|
11
19
|
var _array = require("../helpers/array");
|
12
20
|
var _number = require("../helpers/number");
|
13
21
|
var _function = require("../helpers/function");
|
22
|
+
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); }
|
14
23
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
15
|
-
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); } }
|
24
|
+
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); } }
|
16
25
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
26
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
27
|
+
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); }
|
17
28
|
/**
|
18
29
|
* @class DataSource
|
19
30
|
* @private
|
20
|
-
*/
|
31
|
+
*/
|
32
|
+
var DataSource = /*#__PURE__*/function () {
|
21
33
|
function DataSource(hotInstance) {
|
22
34
|
var dataSource = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
23
35
|
_classCallCheck(this, DataSource);
|