handsontable 11.0.0 → 12.0.0
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 +121 -99
- package/3rdparty/walkontable/src/border.mjs +122 -96
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +1 -1
- package/3rdparty/walkontable/src/cell/coords.js +60 -18
- package/3rdparty/walkontable/src/cell/coords.mjs +56 -18
- package/3rdparty/walkontable/src/cell/range.d.ts +10 -2
- package/3rdparty/walkontable/src/cell/range.js +279 -100
- package/3rdparty/walkontable/src/cell/range.mjs +274 -100
- package/3rdparty/walkontable/src/core/_base.js +452 -0
- package/3rdparty/walkontable/src/core/_base.mjs +440 -0
- package/3rdparty/walkontable/src/core/clone.js +97 -0
- package/3rdparty/walkontable/src/core/clone.mjs +80 -0
- package/3rdparty/walkontable/src/core/core.js +183 -0
- package/3rdparty/walkontable/src/core/core.mjs +160 -0
- package/3rdparty/walkontable/src/event.js +100 -67
- package/3rdparty/walkontable/src/event.mjs +100 -64
- package/3rdparty/walkontable/src/facade/core.js +251 -0
- package/3rdparty/walkontable/src/facade/core.mjs +243 -0
- package/3rdparty/walkontable/src/filter/column.js +1 -1
- package/3rdparty/walkontable/src/filter/column.mjs +1 -1
- package/3rdparty/walkontable/src/filter/row.js +1 -1
- package/3rdparty/walkontable/src/filter/row.mjs +1 -1
- package/3rdparty/walkontable/src/index.js +3 -47
- package/3rdparty/walkontable/src/index.mjs +3 -13
- package/3rdparty/walkontable/src/overlay/_base.js +125 -58
- package/3rdparty/walkontable/src/overlay/_base.mjs +126 -59
- package/3rdparty/walkontable/src/overlay/bottom.js +86 -76
- package/3rdparty/walkontable/src/overlay/bottom.mjs +86 -76
- package/3rdparty/walkontable/src/overlay/{bottomLeftCorner.js → bottomInlineStartCorner.js} +35 -58
- package/3rdparty/walkontable/src/overlay/{bottomLeftCorner.mjs → bottomInlineStartCorner.mjs} +34 -57
- package/3rdparty/walkontable/src/overlay/constants.js +25 -9
- package/3rdparty/walkontable/src/overlay/constants.mjs +14 -4
- package/3rdparty/walkontable/src/overlay/index.js +10 -19
- package/3rdparty/walkontable/src/overlay/index.mjs +4 -5
- package/3rdparty/walkontable/src/overlay/{left.js → inlineStart.js} +102 -80
- package/3rdparty/walkontable/src/overlay/{left.mjs → inlineStart.mjs} +101 -79
- package/3rdparty/walkontable/src/overlay/top.js +84 -79
- package/3rdparty/walkontable/src/overlay/top.mjs +84 -79
- package/3rdparty/walkontable/src/overlay/{topLeftCorner.js → topInlineStartCorner.js} +56 -57
- package/3rdparty/walkontable/src/overlay/{topLeftCorner.mjs → topInlineStartCorner.mjs} +51 -52
- package/3rdparty/walkontable/src/overlays.js +226 -157
- package/3rdparty/walkontable/src/overlays.mjs +226 -156
- package/3rdparty/walkontable/src/renderer/_base.js +1 -1
- package/3rdparty/walkontable/src/renderer/_base.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/cells.js +5 -4
- package/3rdparty/walkontable/src/renderer/cells.mjs +5 -4
- package/3rdparty/walkontable/src/renderer/colGroup.js +3 -3
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +3 -3
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +3 -3
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +3 -3
- package/3rdparty/walkontable/src/renderer/index.js +1 -1
- package/3rdparty/walkontable/src/renderer/index.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +3 -3
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +3 -3
- package/3rdparty/walkontable/src/renderer/rows.js +3 -3
- package/3rdparty/walkontable/src/renderer/rows.mjs +3 -3
- package/3rdparty/walkontable/src/renderer/table.js +1 -1
- package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +61 -88
- package/3rdparty/walkontable/src/scroll.mjs +61 -88
- package/3rdparty/walkontable/src/selection.js +12 -16
- package/3rdparty/walkontable/src/selection.mjs +12 -14
- package/3rdparty/walkontable/src/settings.js +236 -127
- package/3rdparty/walkontable/src/settings.mjs +236 -126
- package/3rdparty/walkontable/src/table/bottom.js +21 -6
- package/3rdparty/walkontable/src/table/bottom.mjs +20 -6
- package/3rdparty/walkontable/src/table/{bottomLeftCorner.js → bottomInlineStartCorner.js} +31 -15
- package/3rdparty/walkontable/src/table/{bottomLeftCorner.mjs → bottomInlineStartCorner.mjs} +30 -15
- package/3rdparty/walkontable/src/table/{left.js → inlineStart.js} +27 -15
- package/3rdparty/walkontable/src/table/{left.mjs → inlineStart.mjs} +26 -15
- package/3rdparty/walkontable/src/table/master.js +23 -13
- package/3rdparty/walkontable/src/table/master.mjs +23 -13
- 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/{stickyColumnsLeft.js → stickyColumnsStart.js} +13 -7
- package/3rdparty/walkontable/src/table/mixin/{stickyColumnsLeft.mjs → stickyColumnsStart.mjs} +13 -7
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +11 -5
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +11 -5
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -3
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -3
- package/3rdparty/walkontable/src/table/top.js +21 -6
- package/3rdparty/walkontable/src/table/top.mjs +20 -6
- package/3rdparty/walkontable/src/table/{topLeftCorner.js → topInlineStartCorner.js} +31 -15
- package/3rdparty/walkontable/src/table/{topLeftCorner.mjs → topInlineStartCorner.mjs} +30 -15
- package/3rdparty/walkontable/src/table.js +236 -141
- package/3rdparty/walkontable/src/table.mjs +232 -135
- package/3rdparty/walkontable/src/types.js +103 -0
- package/3rdparty/walkontable/src/types.mjs +102 -0
- package/3rdparty/walkontable/src/utils/column.js +23 -34
- package/3rdparty/walkontable/src/utils/column.mjs +23 -31
- package/3rdparty/walkontable/src/utils/nodesPool.js +1 -1
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +1 -1
- package/3rdparty/walkontable/src/utils/orderView/sharedView.js +3 -3
- package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +3 -3
- package/3rdparty/walkontable/src/utils/orderView/view.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +1 -1
- package/3rdparty/walkontable/src/utils/row.js +10 -5
- package/3rdparty/walkontable/src/utils/row.mjs +10 -5
- package/3rdparty/walkontable/src/viewport.js +78 -81
- package/3rdparty/walkontable/src/viewport.mjs +78 -78
- package/CHANGELOG.md +94 -17
- package/README.md +10 -7
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/cellTypes/timeType/timeType.d.ts +6 -6
- package/cellTypes/timeType/timeType.js +4 -5
- package/cellTypes/timeType/timeType.mjs +4 -5
- package/core.d.ts +9 -3
- package/core.js +590 -157
- package/core.mjs +599 -169
- package/dataMap/dataMap.js +2 -2
- package/dataMap/dataMap.mjs +2 -2
- package/dataMap/index.js +8 -0
- package/dataMap/index.mjs +3 -1
- package/dataMap/metaManager/index.js +3 -3
- package/dataMap/metaManager/index.mjs +3 -3
- package/dataMap/metaManager/lazyFactoryMap.js +1 -1
- package/dataMap/metaManager/lazyFactoryMap.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +1 -1
- package/dataMap/metaManager/metaLayers/columnMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +1 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +7 -3
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +7 -3
- package/dataMap/metaManager/metaLayers/tableMeta.js +3 -3
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +3 -3
- package/dataMap/metaManager/metaSchema.js +2931 -2676
- package/dataMap/metaManager/metaSchema.mjs +2931 -2676
- package/dataMap/metaManager/mods/dynamicCellMeta.js +1 -1
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +1 -1
- package/dataMap/metaManager/mods/extendMetaProperties.js +126 -0
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +113 -0
- package/dataMap/replaceData.js +140 -0
- package/dataMap/replaceData.mjs +124 -0
- package/dataSource.js +1 -1
- package/dataSource.mjs +1 -1
- package/dist/README.md +2 -2
- package/dist/handsontable.css +424 -166
- package/dist/handsontable.full.css +559 -298
- package/dist/handsontable.full.js +47163 -41289
- package/dist/handsontable.full.min.css +8 -13
- package/dist/handsontable.full.min.js +143 -142
- package/dist/handsontable.js +28270 -24105
- package/dist/handsontable.min.css +8 -11
- package/dist/handsontable.min.js +3 -3
- package/dist/languages/all.js +69 -38
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +167 -0
- package/dist/languages/ar-AR.min.js +1 -0
- package/dist/languages/de-CH.js +32 -33
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +5 -6
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +5 -6
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +5 -6
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.js +5 -6
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/it-IT.js +5 -6
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +5 -6
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +37 -42
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +4 -6
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +4 -6
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +4 -6
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +4 -6
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +4 -6
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +4 -6
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/zh-CN.js +4 -6
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +25 -27
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +121 -268
- package/editorManager.mjs +129 -279
- package/editors/autocompleteEditor/autocompleteEditor.js +19 -17
- package/editors/autocompleteEditor/autocompleteEditor.mjs +19 -17
- package/editors/baseEditor/baseEditor.js +207 -36
- package/editors/baseEditor/baseEditor.mjs +202 -34
- package/editors/checkboxEditor/checkboxEditor.js +3 -3
- package/editors/checkboxEditor/checkboxEditor.mjs +3 -3
- package/editors/dateEditor/dateEditor.js +22 -9
- package/editors/dateEditor/dateEditor.mjs +23 -10
- package/editors/dropdownEditor/dropdownEditor.js +4 -4
- package/editors/dropdownEditor/dropdownEditor.mjs +4 -4
- package/editors/handsontableEditor/handsontableEditor.js +107 -56
- package/editors/handsontableEditor/handsontableEditor.mjs +107 -56
- package/editors/index.d.ts +3 -0
- package/editors/index.js +6 -0
- package/editors/index.mjs +3 -1
- package/editors/numericEditor/numericEditor.js +3 -3
- package/editors/numericEditor/numericEditor.mjs +3 -3
- package/editors/passwordEditor/passwordEditor.js +4 -4
- package/editors/passwordEditor/passwordEditor.mjs +4 -4
- package/editors/selectEditor/selectEditor.js +66 -111
- package/editors/selectEditor/selectEditor.mjs +67 -110
- package/editors/textEditor/caretPositioner.js +49 -0
- package/editors/textEditor/caretPositioner.mjs +42 -0
- package/editors/textEditor/textEditor.js +206 -182
- package/editors/textEditor/textEditor.mjs +200 -180
- package/editors/timeEditor/index.d.ts +1 -0
- package/editors/timeEditor/index.js +9 -0
- package/editors/timeEditor/index.mjs +1 -0
- package/editors/timeEditor/timeEditor.d.ts +7 -0
- package/editors/timeEditor/timeEditor.js +105 -0
- package/editors/timeEditor/timeEditor.mjs +84 -0
- package/eventManager.js +11 -5
- package/eventManager.mjs +11 -5
- package/helpers/data.js +1 -1
- package/helpers/data.mjs +1 -1
- package/helpers/dom/element.js +1 -1
- package/helpers/dom/element.mjs +1 -1
- package/helpers/feature.js +1 -1
- package/helpers/feature.mjs +1 -1
- package/helpers/mixed.js +3 -3
- package/helpers/mixed.mjs +3 -3
- package/helpers/number.js +4 -4
- package/helpers/number.mjs +4 -4
- package/helpers/object.js +1 -1
- package/helpers/object.mjs +1 -1
- package/i18n/languages/ar-AR.js +41 -0
- package/i18n/languages/ar-AR.mjs +17 -0
- package/i18n/languages/de-CH.js +1 -1
- package/i18n/languages/de-DE.js +1 -1
- package/i18n/languages/en-US.js +1 -1
- package/i18n/languages/es-MX.js +1 -1
- package/i18n/languages/fr-FR.js +1 -1
- package/i18n/languages/index.js +4 -0
- package/i18n/languages/index.mjs +2 -1
- package/i18n/languages/it-IT.js +1 -1
- package/i18n/languages/ja-JP.js +1 -1
- package/i18n/languages/ko-KR.js +1 -1
- package/i18n/languages/lv-LV.js +1 -1
- package/i18n/languages/nb-NO.js +1 -1
- package/i18n/languages/nl-NL.js +1 -1
- package/i18n/languages/pl-PL.js +1 -1
- package/i18n/languages/pt-BR.js +1 -1
- package/i18n/languages/ru-RU.js +1 -1
- package/i18n/languages/zh-CN.js +1 -1
- package/i18n/languages/zh-TW.js +1 -1
- package/i18n/registry.js +1 -1
- package/index.d.ts +4 -0
- package/index.js +1 -1
- package/languages/all.js +69 -38
- package/languages/ar-AR.js +167 -0
- package/languages/ar-AR.mjs +19 -0
- package/languages/de-CH.js +32 -33
- package/languages/de-DE.js +5 -6
- package/languages/en-US.js +5 -6
- package/languages/es-MX.js +5 -6
- package/languages/fr-FR.js +5 -6
- package/languages/index.js +69 -38
- package/languages/index.mjs +2 -1
- package/languages/it-IT.js +5 -6
- package/languages/ja-JP.js +5 -6
- package/languages/ko-KR.js +37 -42
- package/languages/lv-LV.js +4 -6
- package/languages/nb-NO.js +4 -6
- package/languages/nl-NL.js +4 -6
- package/languages/pl-PL.js +4 -6
- package/languages/pt-BR.js +4 -6
- package/languages/ru-RU.js +4 -6
- package/languages/zh-CN.js +4 -6
- package/languages/zh-TW.js +25 -27
- package/package.json +26 -8
- package/pluginHooks.d.ts +2 -0
- package/pluginHooks.js +58 -27
- package/pluginHooks.mjs +58 -27
- package/plugins/autoColumnSize/autoColumnSize.js +14 -9
- package/plugins/autoColumnSize/autoColumnSize.mjs +14 -9
- package/plugins/autoRowSize/autoRowSize.js +15 -10
- package/plugins/autoRowSize/autoRowSize.mjs +15 -10
- package/plugins/autofill/autofill.js +50 -34
- package/plugins/autofill/autofill.mjs +50 -33
- package/plugins/autofill/utils.js +10 -11
- package/plugins/autofill/utils.mjs +10 -10
- package/plugins/base/base.d.ts +8 -2
- package/plugins/base/base.js +68 -5
- package/plugins/base/base.mjs +67 -5
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +4 -4
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +4 -4
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +4 -4
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +4 -4
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +4 -4
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +4 -4
- package/plugins/collapsibleColumns/collapsibleColumns.js +49 -30
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +49 -30
- package/plugins/columnSorting/columnSorting.d.ts +1 -1
- package/plugins/columnSorting/columnSorting.js +10 -12
- package/plugins/columnSorting/columnSorting.mjs +10 -11
- package/plugins/columnSorting/columnStatesManager.js +3 -3
- package/plugins/columnSorting/columnStatesManager.mjs +3 -3
- package/plugins/columnSummary/columnSummary.js +4 -4
- package/plugins/columnSummary/columnSummary.mjs +4 -4
- package/plugins/columnSummary/endpoints.js +1 -1
- package/plugins/columnSummary/endpoints.mjs +1 -1
- package/plugins/comments/commentEditor.js +24 -4
- package/plugins/comments/commentEditor.mjs +25 -5
- package/plugins/comments/comments.js +63 -104
- package/plugins/comments/comments.mjs +63 -102
- package/plugins/comments/displaySwitch.js +1 -1
- package/plugins/comments/displaySwitch.mjs +1 -1
- package/plugins/contextMenu/commandExecutor.js +1 -1
- package/plugins/contextMenu/commandExecutor.mjs +1 -1
- package/plugins/contextMenu/contextMenu.js +11 -7
- package/plugins/contextMenu/contextMenu.mjs +11 -7
- package/plugins/contextMenu/cursor.js +1 -1
- package/plugins/contextMenu/cursor.mjs +1 -1
- package/plugins/contextMenu/itemsFactory.js +1 -1
- package/plugins/contextMenu/itemsFactory.mjs +1 -1
- package/plugins/contextMenu/menu.js +223 -111
- package/plugins/contextMenu/menu.mjs +220 -112
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +13 -5
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +11 -4
- package/plugins/contextMenu/predefinedItems/columnRight.js +10 -10
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +9 -9
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/redo.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +1 -1
- package/plugins/contextMenu/predefinedItems/rowBelow.js +1 -1
- package/plugins/contextMenu/predefinedItems/undo.js +1 -1
- package/plugins/contextMenu/predefinedItems.js +1 -1
- package/plugins/contextMenu/utils.js +2 -2
- package/plugins/contextMenu/utils.mjs +2 -2
- package/plugins/copyPaste/clipboardData.js +1 -1
- package/plugins/copyPaste/clipboardData.mjs +1 -1
- package/plugins/copyPaste/contextMenuItem/copy.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/copyPaste.js +29 -19
- package/plugins/copyPaste/copyPaste.mjs +28 -19
- package/plugins/copyPaste/focusableElement.js +1 -1
- package/plugins/copyPaste/focusableElement.mjs +1 -1
- package/plugins/copyPaste/pasteEvent.js +6 -2
- package/plugins/copyPaste/pasteEvent.mjs +6 -2
- package/plugins/customBorders/contextMenuItem/bottom.js +1 -1
- package/plugins/customBorders/contextMenuItem/left.js +5 -4
- package/plugins/customBorders/contextMenuItem/left.mjs +4 -3
- package/plugins/customBorders/contextMenuItem/noBorders.js +1 -1
- package/plugins/customBorders/contextMenuItem/right.js +5 -4
- package/plugins/customBorders/contextMenuItem/right.mjs +4 -3
- package/plugins/customBorders/contextMenuItem/top.js +1 -1
- package/plugins/customBorders/customBorders.js +141 -85
- package/plugins/customBorders/customBorders.mjs +139 -82
- package/plugins/customBorders/utils.js +131 -27
- package/plugins/customBorders/utils.mjs +115 -27
- package/plugins/dragToScroll/dragToScroll.js +11 -6
- package/plugins/dragToScroll/dragToScroll.mjs +11 -6
- package/plugins/dropdownMenu/dropdownMenu.js +8 -7
- package/plugins/dropdownMenu/dropdownMenu.mjs +8 -7
- package/plugins/exportFile/dataProvider.js +1 -1
- package/plugins/exportFile/dataProvider.mjs +1 -1
- package/plugins/exportFile/exportFile.js +3 -3
- package/plugins/exportFile/exportFile.mjs +3 -3
- package/plugins/exportFile/types/_base.js +1 -1
- package/plugins/exportFile/types/_base.mjs +1 -1
- package/plugins/exportFile/types/csv.js +3 -3
- package/plugins/exportFile/types/csv.mjs +3 -3
- package/plugins/filters/component/_base.js +1 -1
- package/plugins/filters/component/_base.mjs +1 -1
- package/plugins/filters/component/actionBar.js +3 -3
- package/plugins/filters/component/actionBar.mjs +3 -3
- package/plugins/filters/component/condition.js +4 -4
- package/plugins/filters/component/condition.mjs +4 -4
- package/plugins/filters/component/operators.js +3 -3
- package/plugins/filters/component/operators.mjs +3 -3
- package/plugins/filters/component/value.js +4 -4
- package/plugins/filters/component/value.mjs +4 -4
- package/plugins/filters/condition/beginsWith.js +1 -1
- package/plugins/filters/condition/between.js +1 -1
- package/plugins/filters/condition/contains.js +1 -1
- package/plugins/filters/condition/date/after.js +1 -1
- package/plugins/filters/condition/date/before.js +1 -1
- package/plugins/filters/condition/date/today.js +1 -1
- package/plugins/filters/condition/date/tomorrow.js +1 -1
- package/plugins/filters/condition/date/yesterday.js +1 -1
- package/plugins/filters/condition/empty.js +1 -1
- package/plugins/filters/condition/endsWith.js +1 -1
- package/plugins/filters/condition/equal.js +1 -1
- package/plugins/filters/condition/greaterThan.js +1 -1
- package/plugins/filters/condition/greaterThanOrEqual.js +1 -1
- package/plugins/filters/condition/lessThan.js +1 -1
- package/plugins/filters/condition/lessThanOrEqual.js +1 -1
- package/plugins/filters/condition/none.js +1 -1
- package/plugins/filters/condition/notBetween.js +1 -1
- package/plugins/filters/condition/notContains.js +1 -1
- package/plugins/filters/condition/notEmpty.js +1 -1
- package/plugins/filters/condition/notEqual.js +1 -1
- package/plugins/filters/conditionCollection.js +1 -1
- package/plugins/filters/conditionCollection.mjs +1 -1
- package/plugins/filters/conditionUpdateObserver.js +1 -1
- package/plugins/filters/conditionUpdateObserver.mjs +1 -1
- package/plugins/filters/dataFilter.js +1 -1
- package/plugins/filters/dataFilter.mjs +1 -1
- package/plugins/filters/filters.js +12 -9
- package/plugins/filters/filters.mjs +12 -9
- package/plugins/filters/logicalOperations/conjunction.js +1 -1
- package/plugins/filters/logicalOperations/disjunction.js +1 -1
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.js +1 -1
- package/plugins/filters/ui/_base.js +2 -2
- package/plugins/filters/ui/_base.mjs +1 -1
- package/plugins/filters/ui/input.js +4 -4
- package/plugins/filters/ui/input.mjs +4 -4
- package/plugins/filters/ui/link.js +4 -4
- package/plugins/filters/ui/link.mjs +4 -4
- package/plugins/filters/ui/multipleSelect.js +19 -32
- package/plugins/filters/ui/multipleSelect.mjs +19 -32
- package/plugins/filters/ui/radioInput.js +4 -4
- package/plugins/filters/ui/radioInput.mjs +4 -4
- package/plugins/filters/ui/select.js +5 -5
- package/plugins/filters/ui/select.mjs +5 -5
- package/plugins/formulas/engine/register.js +1 -1
- package/plugins/formulas/engine/register.mjs +1 -1
- package/plugins/formulas/engine/settings.js +2 -2
- package/plugins/formulas/engine/settings.mjs +2 -2
- package/plugins/formulas/formulas.js +10 -10
- package/plugins/formulas/formulas.mjs +10 -10
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +3 -3
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -2
- package/plugins/hiddenColumns/hiddenColumns.js +10 -5
- package/plugins/hiddenColumns/hiddenColumns.mjs +10 -5
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.js +3 -3
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -2
- package/plugins/hiddenRows/hiddenRows.js +10 -5
- package/plugins/hiddenRows/hiddenRows.mjs +10 -5
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +2 -2
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +2 -2
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +26 -13
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +26 -13
- package/plugins/manualColumnMove/manualColumnMove.js +73 -62
- package/plugins/manualColumnMove/manualColumnMove.mjs +74 -63
- package/plugins/manualColumnMove/ui/_base.js +26 -13
- package/plugins/manualColumnMove/ui/_base.mjs +25 -13
- package/plugins/manualColumnMove/ui/backlight.js +4 -4
- package/plugins/manualColumnMove/ui/backlight.mjs +4 -4
- package/plugins/manualColumnMove/ui/guideline.js +4 -4
- package/plugins/manualColumnMove/ui/guideline.mjs +4 -4
- package/plugins/manualColumnResize/manualColumnResize.js +38 -22
- package/plugins/manualColumnResize/manualColumnResize.mjs +38 -22
- package/plugins/manualRowMove/manualRowMove.js +27 -17
- package/plugins/manualRowMove/manualRowMove.mjs +27 -17
- package/plugins/manualRowMove/ui/_base.js +1 -1
- package/plugins/manualRowMove/ui/_base.mjs +1 -1
- package/plugins/manualRowMove/ui/backlight.js +4 -4
- package/plugins/manualRowMove/ui/backlight.mjs +4 -4
- package/plugins/manualRowMove/ui/guideline.js +4 -4
- package/plugins/manualRowMove/ui/guideline.mjs +4 -4
- package/plugins/manualRowResize/manualRowResize.js +35 -20
- package/plugins/manualRowResize/manualRowResize.mjs +35 -20
- package/plugins/mergeCells/calculations/autofill.js +7 -6
- package/plugins/mergeCells/calculations/autofill.mjs +7 -5
- package/plugins/mergeCells/calculations/selection.js +10 -5
- package/plugins/mergeCells/calculations/selection.mjs +10 -5
- package/plugins/mergeCells/cellCoords.js +17 -5
- package/plugins/mergeCells/cellCoords.mjs +17 -4
- package/plugins/mergeCells/cellsCollection.js +28 -21
- package/plugins/mergeCells/cellsCollection.mjs +28 -20
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +1 -1
- package/plugins/mergeCells/mergeCells.js +83 -50
- package/plugins/mergeCells/mergeCells.mjs +83 -48
- package/plugins/multiColumnSorting/multiColumnSorting.js +5 -7
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +5 -6
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +52 -58
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +53 -58
- package/plugins/nestedHeaders/nestedHeaders.js +26 -19
- package/plugins/nestedHeaders/nestedHeaders.mjs +26 -19
- package/plugins/nestedHeaders/stateManager/headersTree.js +3 -3
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +3 -3
- package/plugins/nestedHeaders/stateManager/index.js +3 -3
- package/plugins/nestedHeaders/stateManager/index.mjs +3 -3
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +3 -3
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +3 -3
- package/plugins/nestedHeaders/utils/ghostTable.js +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.mjs +1 -1
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/nestedRows/nestedRows.js +11 -5
- package/plugins/nestedRows/nestedRows.mjs +11 -5
- package/plugins/nestedRows/ui/_base.js +6 -2
- package/plugins/nestedRows/ui/_base.mjs +6 -2
- package/plugins/nestedRows/ui/collapsing.js +3 -3
- package/plugins/nestedRows/ui/collapsing.mjs +3 -3
- package/plugins/nestedRows/ui/contextMenu.js +3 -3
- package/plugins/nestedRows/ui/contextMenu.mjs +3 -3
- package/plugins/nestedRows/ui/headers.js +3 -3
- package/plugins/nestedRows/ui/headers.mjs +3 -3
- package/plugins/nestedRows/utils/rowMoveController.js +3 -5
- package/plugins/nestedRows/utils/rowMoveController.mjs +3 -4
- package/plugins/persistentState/persistentState.js +10 -5
- package/plugins/persistentState/persistentState.mjs +10 -5
- package/plugins/persistentState/storage.js +1 -1
- package/plugins/persistentState/storage.mjs +1 -1
- package/plugins/search/search.js +10 -5
- package/plugins/search/search.mjs +10 -5
- package/plugins/touchScroll/touchScroll.js +32 -26
- package/plugins/touchScroll/touchScroll.mjs +32 -25
- package/plugins/trimRows/trimRows.js +10 -5
- package/plugins/trimRows/trimRows.mjs +10 -5
- package/plugins/undoRedo/index.js +1 -1
- package/plugins/undoRedo/undoRedo.js +54 -48
- package/plugins/undoRedo/undoRedo.mjs +54 -47
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -3
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -2
- package/renderers/checkboxRenderer/checkboxRenderer.js +48 -43
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +48 -41
- package/renderers/index.d.ts +4 -1
- package/renderers/index.js +6 -0
- package/renderers/index.mjs +3 -1
- package/renderers/numericRenderer/numericRenderer.js +1 -0
- package/renderers/numericRenderer/numericRenderer.mjs +1 -0
- package/renderers/timeRenderer/index.d.ts +1 -0
- package/renderers/timeRenderer/index.js +9 -0
- package/renderers/timeRenderer/index.mjs +1 -0
- package/renderers/timeRenderer/timeRenderer.d.ts +5 -0
- package/renderers/timeRenderer/timeRenderer.js +31 -0
- package/renderers/timeRenderer/timeRenderer.mjs +20 -0
- package/selection/highlight/highlight.js +3 -3
- package/selection/highlight/highlight.mjs +3 -3
- package/selection/highlight/types/activeHeader.js +2 -2
- package/selection/highlight/types/activeHeader.mjs +2 -2
- package/selection/highlight/types/area.js +2 -2
- package/selection/highlight/types/area.mjs +2 -2
- package/selection/highlight/types/cell.js +2 -2
- package/selection/highlight/types/cell.mjs +2 -2
- package/selection/highlight/types/customSelection.js +2 -2
- package/selection/highlight/types/customSelection.mjs +2 -2
- package/selection/highlight/types/fill.js +2 -2
- package/selection/highlight/types/fill.mjs +2 -2
- package/selection/highlight/types/header.js +2 -2
- package/selection/highlight/types/header.mjs +2 -2
- package/selection/highlight/types/index.js +2 -2
- package/selection/highlight/types/index.mjs +2 -2
- package/selection/highlight/visualSelection.js +17 -16
- package/selection/highlight/visualSelection.mjs +18 -17
- package/selection/mouseEventHandler.js +15 -10
- package/selection/mouseEventHandler.mjs +15 -9
- package/selection/range.js +5 -6
- package/selection/range.mjs +5 -6
- package/selection/selection.js +27 -20
- package/selection/selection.mjs +27 -18
- package/selection/transformation.js +5 -7
- package/selection/transformation.mjs +5 -6
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +1 -1
- package/settings.d.ts +3 -1
- package/shortcuts/context.d.ts +20 -0
- package/shortcuts/context.js +296 -0
- package/shortcuts/context.mjs +268 -0
- package/shortcuts/index.d.ts +1 -0
- package/shortcuts/index.js +8 -0
- package/shortcuts/index.mjs +1 -0
- package/shortcuts/keyObserver.js +67 -0
- package/shortcuts/keyObserver.mjs +58 -0
- package/shortcuts/manager.d.ts +10 -0
- package/shortcuts/manager.js +183 -0
- package/shortcuts/manager.mjs +174 -0
- package/shortcuts/recorder.js +183 -0
- package/shortcuts/recorder.mjs +171 -0
- package/shortcuts/utils.js +77 -0
- package/shortcuts/utils.mjs +54 -0
- package/tableView.js +138 -80
- package/tableView.mjs +138 -70
- package/translations/changesObservable/observable.js +1 -1
- package/translations/changesObservable/observable.mjs +1 -1
- package/translations/changesObservable/observer.js +1 -2
- package/translations/changesObservable/observer.mjs +1 -2
- package/translations/indexMapper.d.ts +1 -0
- package/translations/indexMapper.js +25 -2
- package/translations/indexMapper.mjs +24 -2
- package/translations/mapCollections/aggregatedCollection.js +3 -3
- package/translations/mapCollections/aggregatedCollection.mjs +3 -3
- package/translations/mapCollections/mapCollection.js +1 -1
- package/translations/mapCollections/mapCollection.mjs +1 -1
- package/translations/maps/hidingMap.js +5 -3
- package/translations/maps/hidingMap.mjs +5 -3
- package/translations/maps/indexMap.js +3 -1
- package/translations/maps/indexMap.mjs +3 -1
- package/translations/maps/indexesSequence.js +6 -4
- package/translations/maps/indexesSequence.mjs +6 -4
- package/translations/maps/linkedPhysicalIndexToValueMap.js +6 -4
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +6 -4
- package/translations/maps/physicalIndexToValueMap.js +6 -4
- package/translations/maps/physicalIndexToValueMap.mjs +6 -4
- package/translations/maps/trimmingMap.js +5 -3
- package/translations/maps/trimmingMap.mjs +5 -3
- package/utils/dataStructures/linkedList.js +3 -3
- package/utils/dataStructures/linkedList.mjs +3 -3
- package/utils/dataStructures/queue.js +1 -1
- package/utils/dataStructures/queue.mjs +1 -1
- package/utils/dataStructures/stack.js +1 -1
- package/utils/dataStructures/stack.mjs +1 -1
- package/utils/dataStructures/tree.js +3 -3
- package/utils/dataStructures/tree.mjs +3 -3
- package/utils/dataStructures/uniqueMap.js +14 -1
- package/utils/dataStructures/uniqueMap.mjs +14 -1
- package/utils/dataStructures/uniqueSet.js +9 -0
- package/utils/dataStructures/uniqueSet.mjs +9 -0
- package/utils/ghostTable.js +14 -3
- package/utils/ghostTable.mjs +15 -4
- package/utils/interval.js +1 -1
- package/utils/interval.mjs +1 -1
- package/utils/samplesGenerator.js +1 -1
- package/utils/samplesGenerator.mjs +1 -1
- package/3rdparty/walkontable/src/core.js +0 -309
- package/3rdparty/walkontable/src/core.mjs +0 -293
- package/3rdparty/walkontable/src/overlay/registerer.js +0 -70
- package/3rdparty/walkontable/src/overlay/registerer.mjs +0 -57
- package/utils/keyStateObserver.js +0 -121
- package/utils/keyStateObserver.mjs +0 -103
package/core.js
CHANGED
@@ -6,15 +6,13 @@ require("core-js/modules/es.symbol.description.js");
|
|
6
6
|
|
7
7
|
require("core-js/modules/es.symbol.iterator.js");
|
8
8
|
|
9
|
-
require("core-js/modules/es.array.iterator.js");
|
10
|
-
|
11
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
12
|
-
|
13
9
|
require("core-js/modules/es.function.name.js");
|
14
10
|
|
15
11
|
exports.__esModule = true;
|
16
12
|
exports.default = Core;
|
17
13
|
|
14
|
+
require("core-js/modules/es.array.includes.js");
|
15
|
+
|
18
16
|
require("core-js/modules/es.array.sort.js");
|
19
17
|
|
20
18
|
require("core-js/modules/es.array.splice.js");
|
@@ -51,6 +49,12 @@ require("core-js/modules/web.timers.js");
|
|
51
49
|
|
52
50
|
require("core-js/modules/web.immediate.js");
|
53
51
|
|
52
|
+
require("core-js/modules/es.array.iterator.js");
|
53
|
+
|
54
|
+
require("core-js/modules/es.map.js");
|
55
|
+
|
56
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
57
|
+
|
54
58
|
var _element = require("./helpers/dom/element");
|
55
59
|
|
56
60
|
var _function = require("./helpers/function");
|
@@ -97,17 +101,17 @@ var _registry4 = require("./i18n/registry");
|
|
97
101
|
|
98
102
|
var _utils = require("./i18n/utils");
|
99
103
|
|
100
|
-
var _keyStateObserver = require("./utils/keyStateObserver");
|
101
|
-
|
102
104
|
var _selection = require("./selection");
|
103
105
|
|
104
106
|
var _dataMap = require("./dataMap");
|
105
107
|
|
106
108
|
var _uniqueMap = require("./utils/dataStructures/uniqueMap");
|
107
109
|
|
110
|
+
var _shortcuts = require("./shortcuts");
|
111
|
+
|
108
112
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
109
113
|
|
110
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
114
|
+
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); }
|
111
115
|
|
112
116
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
113
117
|
|
@@ -129,6 +133,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
129
133
|
|
130
134
|
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; }
|
131
135
|
|
136
|
+
var SHORTCUTS_GROUP = 'gridDefault';
|
132
137
|
var activeGuid = null;
|
133
138
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
134
139
|
|
@@ -157,7 +162,8 @@ var activeGuid = null;
|
|
157
162
|
*/
|
158
163
|
|
159
164
|
function Core(rootElement, userSettings) {
|
160
|
-
var
|
165
|
+
var _userSettings$layoutD,
|
166
|
+
_this = this;
|
161
167
|
|
162
168
|
var rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
163
169
|
var preventScrollingToCell = false;
|
@@ -168,11 +174,6 @@ function Core(rootElement, userSettings) {
|
|
168
174
|
var grid;
|
169
175
|
var editorManager;
|
170
176
|
var firstRun = true;
|
171
|
-
userSettings.language = (0, _registry4.getValidLanguageCode)(userSettings.language);
|
172
|
-
var metaManager = new _dataMap.MetaManager(instance, userSettings, [_dataMap.DynamicCellMetaMod]);
|
173
|
-
var tableMeta = metaManager.getTableMeta();
|
174
|
-
var globalMeta = metaManager.getGlobalMeta();
|
175
|
-
var pluginsRegistry = (0, _uniqueMap.createUniqueMap)();
|
176
177
|
|
177
178
|
if ((0, _rootInstance.hasValidParameter)(rootInstanceSymbol)) {
|
178
179
|
(0, _rootInstance.registerAsRootInstance)(this);
|
@@ -187,8 +188,6 @@ function Core(rootElement, userSettings) {
|
|
187
188
|
|
188
189
|
|
189
190
|
this.rootElement = rootElement;
|
190
|
-
/* eslint-enable jsdoc/require-description-complete-sentence */
|
191
|
-
|
192
191
|
/**
|
193
192
|
* The nearest document over container.
|
194
193
|
*
|
@@ -237,7 +236,53 @@ function Core(rootElement, userSettings) {
|
|
237
236
|
*/
|
238
237
|
|
239
238
|
this.executionSuspendedCounter = 0;
|
240
|
-
(0
|
239
|
+
var layoutDirection = (_userSettings$layoutD = userSettings === null || userSettings === void 0 ? void 0 : userSettings.layoutDirection) !== null && _userSettings$layoutD !== void 0 ? _userSettings$layoutD : 'inherit';
|
240
|
+
var rootElementDirection = ['rtl', 'ltr'].includes(layoutDirection) ? layoutDirection : this.rootWindow.getComputedStyle(this.rootElement).direction;
|
241
|
+
this.rootElement.setAttribute('dir', rootElementDirection);
|
242
|
+
/**
|
243
|
+
* Checks if the grid is rendered using the right-to-left layout direction.
|
244
|
+
*
|
245
|
+
* @since 12.0.0
|
246
|
+
* @memberof Core#
|
247
|
+
* @function isRtl
|
248
|
+
* @returns {boolean} True if RTL.
|
249
|
+
*/
|
250
|
+
|
251
|
+
this.isRtl = function () {
|
252
|
+
return rootElementDirection === 'rtl';
|
253
|
+
};
|
254
|
+
/**
|
255
|
+
* Checks if the grid is rendered using the left-to-right layout direction.
|
256
|
+
*
|
257
|
+
* @since 12.0.0
|
258
|
+
* @memberof Core#
|
259
|
+
* @function isLtr
|
260
|
+
* @returns {boolean} True if LTR.
|
261
|
+
*/
|
262
|
+
|
263
|
+
|
264
|
+
this.isLtr = function () {
|
265
|
+
return !instance.isRtl();
|
266
|
+
};
|
267
|
+
/**
|
268
|
+
* Returns 1 for LTR; -1 for RTL. Useful for calculations.
|
269
|
+
*
|
270
|
+
* @since 12.0.0
|
271
|
+
* @memberof Core#
|
272
|
+
* @function getDirectionFactor
|
273
|
+
* @returns {number} Returns 1 for LTR; -1 for RTL.
|
274
|
+
*/
|
275
|
+
|
276
|
+
|
277
|
+
this.getDirectionFactor = function () {
|
278
|
+
return instance.isLtr() ? 1 : -1;
|
279
|
+
};
|
280
|
+
|
281
|
+
userSettings.language = (0, _registry4.getValidLanguageCode)(userSettings.language);
|
282
|
+
var metaManager = new _dataMap.MetaManager(instance, userSettings, [_dataMap.DynamicCellMetaMod, _dataMap.ExtendMetaPropertiesMod]);
|
283
|
+
var tableMeta = metaManager.getTableMeta();
|
284
|
+
var globalMeta = metaManager.getGlobalMeta();
|
285
|
+
var pluginsRegistry = (0, _uniqueMap.createUniqueMap)();
|
241
286
|
this.container = this.rootDocument.createElement('div');
|
242
287
|
this.renderCall = false;
|
243
288
|
rootElement.insertBefore(this.container, rootElement.firstChild);
|
@@ -275,14 +320,14 @@ function Core(rootElement, userSettings) {
|
|
275
320
|
var visualToRenderableCoords = function visualToRenderableCoords(coords) {
|
276
321
|
var visualRow = coords.row,
|
277
322
|
visualColumn = coords.col;
|
278
|
-
return
|
323
|
+
return instance._createCellCoords( // We just store indexes for rows and columns without headers.
|
279
324
|
visualRow >= 0 ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRow) : visualRow, visualColumn >= 0 ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumn) : visualColumn);
|
280
325
|
};
|
281
326
|
|
282
327
|
var renderableToVisualCoords = function renderableToVisualCoords(coords) {
|
283
328
|
var renderableRow = coords.row,
|
284
329
|
renderableColumn = coords.col;
|
285
|
-
return
|
330
|
+
return instance._createCellCoords( // We just store indexes for rows and columns without headers.
|
286
331
|
renderableRow >= 0 ? instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow, renderableColumn >= 0 ? instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn // eslint-disable-line max-len
|
287
332
|
);
|
288
333
|
};
|
@@ -306,6 +351,15 @@ function Core(rootElement, userSettings) {
|
|
306
351
|
countRowsTranslated: function countRowsTranslated() {
|
307
352
|
return _this.view.countRenderableRows();
|
308
353
|
},
|
354
|
+
getShortcutManager: function getShortcutManager() {
|
355
|
+
return instance.getShortcutManager();
|
356
|
+
},
|
357
|
+
createCellCoords: function createCellCoords(row, column) {
|
358
|
+
return instance._createCellCoords(row, column);
|
359
|
+
},
|
360
|
+
createCellRange: function createCellRange(highlight, from, to) {
|
361
|
+
return instance._createCellRange(highlight, from, to);
|
362
|
+
},
|
309
363
|
visualToRenderableCoords: visualToRenderableCoords,
|
310
364
|
renderableToVisualCoords: renderableToVisualCoords,
|
311
365
|
isDisabledCellSelection: function isDisabledCellSelection(visualRow, visualColumn) {
|
@@ -334,11 +388,11 @@ function Core(rootElement, userSettings) {
|
|
334
388
|
_this.runHooks('beforeSetRangeEnd', cellCoords);
|
335
389
|
|
336
390
|
if (cellCoords.row < 0) {
|
337
|
-
cellCoords.row = _this.view.
|
391
|
+
cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
|
338
392
|
}
|
339
393
|
|
340
394
|
if (cellCoords.col < 0) {
|
341
|
-
cellCoords.col = _this.view.
|
395
|
+
cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
|
342
396
|
}
|
343
397
|
});
|
344
398
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
@@ -552,8 +606,8 @@ function Core(rootElement, userSettings) {
|
|
552
606
|
|
553
607
|
selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.
|
554
608
|
|
555
|
-
selection.setRangeStartOnly(
|
556
|
-
selection.setRangeEnd(
|
609
|
+
selection.setRangeStartOnly(instance._createCellCoords(currentFromRow + delta, currentFromColumn), true);
|
610
|
+
selection.setRangeEnd(instance._createCellCoords(currentToRow + delta, currentToColumn)); // will call render() internally
|
557
611
|
} else {
|
558
612
|
instance._refreshBorders(); // it will call render and prepare methods
|
559
613
|
|
@@ -597,8 +651,8 @@ function Core(rootElement, userSettings) {
|
|
597
651
|
|
598
652
|
selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.
|
599
653
|
|
600
|
-
selection.setRangeStartOnly(
|
601
|
-
selection.setRangeEnd(
|
654
|
+
selection.setRangeStartOnly(instance._createCellCoords(_currentFromRow, _currentFromColumn + delta), true);
|
655
|
+
selection.setRangeEnd(instance._createCellCoords(_currentToRow, _currentToColumn + delta)); // will call render() internally
|
602
656
|
} else {
|
603
657
|
instance._refreshBorders(); // it will call render and prepare methods
|
604
658
|
|
@@ -690,10 +744,10 @@ function Core(rootElement, userSettings) {
|
|
690
744
|
}
|
691
745
|
|
692
746
|
metaManager.removeColumn(physicalColumnIndex, groupAmount);
|
693
|
-
var
|
747
|
+
var fixedColumnsStart = tableMeta.fixedColumnsStart;
|
694
748
|
|
695
|
-
if (
|
696
|
-
tableMeta.
|
749
|
+
if (fixedColumnsStart >= calcIndex + 1) {
|
750
|
+
tableMeta.fixedColumnsStart -= Math.min(groupAmount, fixedColumnsStart - calcIndex);
|
697
751
|
}
|
698
752
|
|
699
753
|
if (Array.isArray(tableMeta.colHeaders)) {
|
@@ -1401,6 +1455,38 @@ function Core(rootElement, userSettings) {
|
|
1401
1455
|
activeEditor.refreshValue();
|
1402
1456
|
}
|
1403
1457
|
}
|
1458
|
+
/**
|
1459
|
+
* Creates and returns the CellCoords object.
|
1460
|
+
*
|
1461
|
+
* @private
|
1462
|
+
* @memberof Core#
|
1463
|
+
* @function _createCellCoords
|
1464
|
+
* @param {number} row The row index.
|
1465
|
+
* @param {number} column The column index.
|
1466
|
+
* @returns {CellCoords}
|
1467
|
+
*/
|
1468
|
+
|
1469
|
+
|
1470
|
+
this._createCellCoords = function (row, column) {
|
1471
|
+
return instance.view._wt.createCellCoords(row, column);
|
1472
|
+
};
|
1473
|
+
/**
|
1474
|
+
* Creates and returns the CellRange object.
|
1475
|
+
*
|
1476
|
+
* @private
|
1477
|
+
* @memberof Core#
|
1478
|
+
* @function _createCellRange
|
1479
|
+
* @param {CellCoords} highlight Defines the border around a cell where selection was started and to edit the cell
|
1480
|
+
* when you press Enter. The highlight cannot point to headers (negative values).
|
1481
|
+
* @param {CellCoords} from Initial coordinates.
|
1482
|
+
* @param {CellCoords} to Final coordinates.
|
1483
|
+
* @returns {CellRange}
|
1484
|
+
*/
|
1485
|
+
|
1486
|
+
|
1487
|
+
this._createCellRange = function (highlight, from, to) {
|
1488
|
+
return instance.view._wt.createCellRange(highlight, from, to);
|
1489
|
+
};
|
1404
1490
|
/**
|
1405
1491
|
* Validate a single cell.
|
1406
1492
|
*
|
@@ -1439,7 +1525,8 @@ function Core(rootElement, userSettings) {
|
|
1439
1525
|
if (td && td.nodeName !== 'TH') {
|
1440
1526
|
var renderableRow = instance.rowIndexMapper.getRenderableFromVisualIndex(row);
|
1441
1527
|
var renderableColumn = instance.columnIndexMapper.getRenderableFromVisualIndex(col);
|
1442
|
-
|
1528
|
+
|
1529
|
+
instance.view._wt.getSetting('cellRenderer', renderableRow, renderableColumn, td);
|
1443
1530
|
}
|
1444
1531
|
|
1445
1532
|
callback(valid);
|
@@ -1664,8 +1751,8 @@ function Core(rootElement, userSettings) {
|
|
1664
1751
|
throw new Error('populateFromArray parameter `input` must be an array of arrays'); // API changed in 0.9-beta2, let's check if you use it correctly
|
1665
1752
|
}
|
1666
1753
|
|
1667
|
-
var c = typeof endRow === 'number' ?
|
1668
|
-
return grid.populateFromArray(
|
1754
|
+
var c = typeof endRow === 'number' ? instance._createCellCoords(endRow, endCol) : null;
|
1755
|
+
return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method, direction, deltas);
|
1669
1756
|
};
|
1670
1757
|
/**
|
1671
1758
|
* Adds/removes data from the column. This method works the same as Array.splice for arrays.
|
@@ -1814,10 +1901,10 @@ function Core(rootElement, userSettings) {
|
|
1814
1901
|
|
1815
1902
|
var changes = [];
|
1816
1903
|
(0, _array.arrayEach)(selection.getSelectedRange(), function (cellRange) {
|
1817
|
-
var
|
1818
|
-
var
|
1819
|
-
(0, _number.rangeEach)(
|
1820
|
-
(0, _number.rangeEach)(
|
1904
|
+
var topStart = cellRange.getTopStartCorner();
|
1905
|
+
var bottomEnd = cellRange.getBottomEndCorner();
|
1906
|
+
(0, _number.rangeEach)(topStart.row, bottomEnd.row, function (row) {
|
1907
|
+
(0, _number.rangeEach)(topStart.col, bottomEnd.col, function (column) {
|
1821
1908
|
if (!_this2.getCellMeta(row, column).readOnly) {
|
1822
1909
|
changes.push([row, column, null]);
|
1823
1910
|
}
|
@@ -2175,7 +2262,7 @@ function Core(rootElement, userSettings) {
|
|
2175
2262
|
return;
|
2176
2263
|
}
|
2177
2264
|
|
2178
|
-
if (isSizeChanged || instance.view.
|
2265
|
+
if (isSizeChanged || instance.view._wt.wtOverlays.scrollableElement === instance.rootWindow) {
|
2179
2266
|
instance.view.setLastSize(width, height);
|
2180
2267
|
instance.render();
|
2181
2268
|
}
|
@@ -2189,14 +2276,67 @@ function Core(rootElement, userSettings) {
|
|
2189
2276
|
}, isSizeChanged);
|
2190
2277
|
};
|
2191
2278
|
/**
|
2192
|
-
*
|
2193
|
-
*
|
2194
|
-
* (
|
2279
|
+
* The `updateData()` method replaces Handsontable's [`data`](@/api/options.md#data) with a new dataset.
|
2280
|
+
*
|
2281
|
+
* The `updateData()` method:
|
2282
|
+
* - Keeps cells' states (e.g. cells' [formatting](@/guides/cell-features/formatting-cells.md) and cells' [`readOnly`](@/api/options.md#readonly) states)
|
2283
|
+
* - Keeps rows' states (e.g. row order)
|
2284
|
+
* - Keeps columns' states (e.g. column order)
|
2285
|
+
*
|
2286
|
+
* To replace Handsontable's [`data`](@/api/options.md#data) and reset states, use the [`loadData()`](#loaddata) method.
|
2287
|
+
*
|
2288
|
+
* Read more:
|
2289
|
+
* - [Binding to data →](@/guides/getting-started/binding-to-data.md)
|
2290
|
+
* - [Saving data →](@/guides/getting-started/saving-data.md)
|
2291
|
+
*
|
2292
|
+
* @memberof Core#
|
2293
|
+
* @function updateData
|
2294
|
+
* @since 11.1.0
|
2295
|
+
* @param {Array} data An [array of arrays](@/guides/getting-started/binding-to-data.md#array-of-arrays), or an [array of objects](@/guides/getting-started/binding-to-data.md#array-of-objects), that contains Handsontable's data
|
2296
|
+
* @param {string} [source] The source of the `updateData()` call
|
2297
|
+
* @fires Hooks#beforeUpdateData
|
2298
|
+
* @fires Hooks#afterUpdateData
|
2299
|
+
* @fires Hooks#afterChange
|
2300
|
+
*/
|
2301
|
+
|
2302
|
+
|
2303
|
+
this.updateData = function (data, source) {
|
2304
|
+
var _this3 = this;
|
2305
|
+
|
2306
|
+
(0, _dataMap.replaceData)(data, function (newDataMap) {
|
2307
|
+
datamap = newDataMap;
|
2308
|
+
}, function (newDataMap) {
|
2309
|
+
datamap = newDataMap;
|
2310
|
+
instance.columnIndexMapper.fitToLength(_this3.getInitialColumnCount());
|
2311
|
+
instance.rowIndexMapper.fitToLength(_this3.countSourceRows());
|
2312
|
+
grid.adjustRowsAndCols();
|
2313
|
+
}, {
|
2314
|
+
hotInstance: instance,
|
2315
|
+
dataMap: datamap,
|
2316
|
+
dataSource: dataSource,
|
2317
|
+
internalSource: 'updateData',
|
2318
|
+
source: source,
|
2319
|
+
firstRun: firstRun
|
2320
|
+
});
|
2321
|
+
};
|
2322
|
+
/**
|
2323
|
+
* The `loadData()` method replaces Handsontable's [`data`](@/api/options.md#data) with a new dataset.
|
2324
|
+
*
|
2325
|
+
* Additionally, the `loadData()` method:
|
2326
|
+
* - Resets cells' states (e.g. cells' [formatting](@/guides/cell-features/formatting-cells.md) and cells' [`readOnly`](@/api/options.md#readonly) states)
|
2327
|
+
* - Resets rows' states (e.g. row order)
|
2328
|
+
* - Resets columns' states (e.g. column order)
|
2329
|
+
*
|
2330
|
+
* To replace Handsontable's [`data`](@/api/options.md#data) without resetting states, use the [`updateData()`](#updatedata) method.
|
2331
|
+
*
|
2332
|
+
* Read more:
|
2333
|
+
* - [Binding to data →](@/guides/getting-started/binding-to-data.md)
|
2334
|
+
* - [Saving data →](@/guides/getting-started/saving-data.md)
|
2195
2335
|
*
|
2196
2336
|
* @memberof Core#
|
2197
2337
|
* @function loadData
|
2198
|
-
* @param {Array} data
|
2199
|
-
* @param {string} [source]
|
2338
|
+
* @param {Array} data An [array of arrays](@/guides/getting-started/binding-to-data.md#array-of-arrays), or an [array of objects](@/guides/getting-started/binding-to-data.md#array-of-objects), that contains Handsontable's data
|
2339
|
+
* @param {string} [source] The source of the `loadData()` call
|
2200
2340
|
* @fires Hooks#beforeLoadData
|
2201
2341
|
* @fires Hooks#afterLoadData
|
2202
2342
|
* @fires Hooks#afterChange
|
@@ -2204,88 +2344,34 @@ function Core(rootElement, userSettings) {
|
|
2204
2344
|
|
2205
2345
|
|
2206
2346
|
this.loadData = function (data, source) {
|
2207
|
-
|
2208
|
-
|
2209
|
-
}
|
2210
|
-
|
2211
|
-
|
2212
|
-
|
2213
|
-
}
|
2214
|
-
|
2215
|
-
if (datamap) {
|
2216
|
-
datamap.destroy();
|
2217
|
-
}
|
2218
|
-
|
2219
|
-
data = instance.runHooks('beforeLoadData', data, firstRun, source);
|
2220
|
-
datamap = new _dataMap.DataMap(instance, data, tableMeta);
|
2221
|
-
|
2222
|
-
if (_typeof(data) === 'object' && data !== null) {
|
2223
|
-
if (!(data.push && data.splice)) {
|
2224
|
-
// check if data is array. Must use duck-type check so Backbone Collections also pass it
|
2225
|
-
// when data is not an array, attempt to make a single-row array of it
|
2226
|
-
// eslint-disable-next-line no-param-reassign
|
2227
|
-
data = [data];
|
2228
|
-
}
|
2229
|
-
} else if (data === null) {
|
2230
|
-
var dataSchema = datamap.getSchema(); // eslint-disable-next-line no-param-reassign
|
2231
|
-
|
2232
|
-
data = [];
|
2233
|
-
var row;
|
2234
|
-
var r = 0;
|
2235
|
-
var rlen = 0;
|
2236
|
-
|
2237
|
-
for (r = 0, rlen = tableMeta.startRows; r < rlen; r++) {
|
2238
|
-
if ((instance.dataType === 'object' || instance.dataType === 'function') && tableMeta.dataSchema) {
|
2239
|
-
row = (0, _object.deepClone)(dataSchema);
|
2240
|
-
data.push(row);
|
2241
|
-
} else if (instance.dataType === 'array') {
|
2242
|
-
row = (0, _object.deepClone)(dataSchema[0]);
|
2243
|
-
data.push(row);
|
2244
|
-
} else {
|
2245
|
-
row = [];
|
2246
|
-
|
2247
|
-
for (var c = 0, clen = tableMeta.startCols; c < clen; c++) {
|
2248
|
-
row.push(null);
|
2249
|
-
}
|
2347
|
+
(0, _dataMap.replaceData)(data, function (newDataMap) {
|
2348
|
+
datamap = newDataMap;
|
2349
|
+
}, function () {
|
2350
|
+
metaManager.clearCellsCache();
|
2351
|
+
instance.initIndexMappers();
|
2352
|
+
grid.adjustRowsAndCols();
|
2250
2353
|
|
2251
|
-
|
2252
|
-
|
2354
|
+
if (firstRun) {
|
2355
|
+
firstRun = [null, 'loadData'];
|
2253
2356
|
}
|
2254
|
-
}
|
2255
|
-
|
2256
|
-
|
2257
|
-
|
2258
|
-
|
2259
|
-
|
2260
|
-
|
2261
|
-
|
2262
|
-
tableMeta.data = data;
|
2263
|
-
datamap.dataSource = data;
|
2264
|
-
dataSource.data = data;
|
2265
|
-
dataSource.dataType = instance.dataType;
|
2266
|
-
dataSource.colToProp = datamap.colToProp.bind(datamap);
|
2267
|
-
dataSource.propToCol = datamap.propToCol.bind(datamap);
|
2268
|
-
dataSource.countCachedColumns = datamap.countCachedColumns.bind(datamap);
|
2269
|
-
metaManager.clearCellsCache();
|
2270
|
-
instance.initIndexMappers();
|
2271
|
-
grid.adjustRowsAndCols();
|
2272
|
-
instance.runHooks('afterLoadData', data, firstRun, source);
|
2273
|
-
|
2274
|
-
if (firstRun) {
|
2275
|
-
firstRun = [null, 'loadData'];
|
2276
|
-
} else {
|
2277
|
-
instance.runHooks('afterChange', null, 'loadData');
|
2278
|
-
instance.render();
|
2279
|
-
}
|
2357
|
+
}, {
|
2358
|
+
hotInstance: instance,
|
2359
|
+
dataMap: datamap,
|
2360
|
+
dataSource: dataSource,
|
2361
|
+
internalSource: 'loadData',
|
2362
|
+
source: source,
|
2363
|
+
firstRun: firstRun
|
2364
|
+
});
|
2280
2365
|
};
|
2281
2366
|
/**
|
2282
|
-
*
|
2367
|
+
* Gets the initial column count, calculated based on the `columns` setting.
|
2283
2368
|
*
|
2284
2369
|
* @private
|
2370
|
+
* @returns {number} The calculated number of columns.
|
2285
2371
|
*/
|
2286
2372
|
|
2287
2373
|
|
2288
|
-
this.
|
2374
|
+
this.getInitialColumnCount = function () {
|
2289
2375
|
var columnsSettings = tableMeta.columns;
|
2290
2376
|
var finalNrOfColumns = 0; // We will check number of columns when the `columns` property was defined as an array. Columns option may
|
2291
2377
|
// narrow down or expand displayed dataset in that case.
|
@@ -2315,7 +2401,17 @@ function Core(rootElement, userSettings) {
|
|
2315
2401
|
finalNrOfColumns = this.countSourceCols();
|
2316
2402
|
}
|
2317
2403
|
|
2318
|
-
|
2404
|
+
return finalNrOfColumns;
|
2405
|
+
};
|
2406
|
+
/**
|
2407
|
+
* Init index mapper which manage indexes assigned to the data.
|
2408
|
+
*
|
2409
|
+
* @private
|
2410
|
+
*/
|
2411
|
+
|
2412
|
+
|
2413
|
+
this.initIndexMappers = function () {
|
2414
|
+
this.columnIndexMapper.initToLength(this.getInitialColumnCount());
|
2319
2415
|
this.rowIndexMapper.initToLength(this.countSourceRows());
|
2320
2416
|
};
|
2321
2417
|
/**
|
@@ -2349,7 +2445,7 @@ function Core(rootElement, userSettings) {
|
|
2349
2445
|
return datamap.getAll();
|
2350
2446
|
}
|
2351
2447
|
|
2352
|
-
return datamap.getRange(
|
2448
|
+
return datamap.getRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2), datamap.DESTINATION_RENDERER);
|
2353
2449
|
};
|
2354
2450
|
/**
|
2355
2451
|
* Returns a string value of the selected range. Each column is separated by tab, each row is separated by a new
|
@@ -2366,7 +2462,7 @@ function Core(rootElement, userSettings) {
|
|
2366
2462
|
|
2367
2463
|
|
2368
2464
|
this.getCopyableText = function (startRow, startCol, endRow, endCol) {
|
2369
|
-
return datamap.getCopyableText(
|
2465
|
+
return datamap.getCopyableText(instance._createCellCoords(startRow, startCol), instance._createCellCoords(endRow, endCol));
|
2370
2466
|
};
|
2371
2467
|
/**
|
2372
2468
|
* Returns the data's copyable value at specified `row` and `column` index.
|
@@ -2396,7 +2492,7 @@ function Core(rootElement, userSettings) {
|
|
2396
2492
|
return datamap.getSchema();
|
2397
2493
|
};
|
2398
2494
|
/**
|
2399
|
-
* Use it if you need to change configuration after initialization. The `settings` argument is an object containing the
|
2495
|
+
* Use it if you need to change configuration after initialization. The `settings` argument is an object containing the changed
|
2400
2496
|
* settings, declared the same way as in the initial settings object.
|
2401
2497
|
*
|
2402
2498
|
* __Note__, that although the `updateSettings` method doesn't overwrite the previously declared settings, it might reset
|
@@ -2405,9 +2501,12 @@ function Core(rootElement, userSettings) {
|
|
2405
2501
|
* Since 8.0.0 passing `columns` or `data` inside `settings` objects will result in resetting states corresponding to rows and columns
|
2406
2502
|
* (for example, row/column sequence, column width, row height, frozen columns etc.).
|
2407
2503
|
*
|
2504
|
+
* Since 12.0.0 passing `data` inside `settings` objects no longer results in resetting states corresponding to rows and columns
|
2505
|
+
* (for example, row/column sequence, column width, row height, frozen columns etc.).
|
2506
|
+
*
|
2408
2507
|
* @memberof Core#
|
2409
2508
|
* @function updateSettings
|
2410
|
-
* @param {object} settings
|
2509
|
+
* @param {object} settings A settings object (see {@link Options}). Only provide the settings that are changed, not the whole settings object that was used for initialization.
|
2411
2510
|
* @param {boolean} [init=false] Internally used for in initialization mode.
|
2412
2511
|
* @example
|
2413
2512
|
* ```js
|
@@ -2424,6 +2523,7 @@ function Core(rootElement, userSettings) {
|
|
2424
2523
|
|
2425
2524
|
this.updateSettings = function (settings) {
|
2426
2525
|
var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
2526
|
+
var dataUpdateFunction = (firstRun ? instance.loadData : instance.updateData).bind(this);
|
2427
2527
|
var columnsAsFunc = false;
|
2428
2528
|
var i;
|
2429
2529
|
var j;
|
@@ -2442,19 +2542,15 @@ function Core(rootElement, userSettings) {
|
|
2442
2542
|
|
2443
2543
|
|
2444
2544
|
for (i in settings) {
|
2445
|
-
if (i === 'data') {
|
2446
|
-
/* eslint-disable-next-line no-continue */
|
2447
|
-
continue; // loadData will be triggered later
|
2545
|
+
if (i === 'data') {// Do nothing. loadData will be triggered later
|
2448
2546
|
} else if (i === 'language') {
|
2449
2547
|
setLanguage(settings.language);
|
2450
|
-
/* eslint-disable-next-line no-continue */
|
2451
|
-
|
2452
|
-
continue;
|
2453
2548
|
} else if (i === 'className') {
|
2454
2549
|
setClassName('className', settings.className);
|
2455
2550
|
} else if (i === 'tableClassName' && instance.table) {
|
2456
2551
|
setClassName('tableClassName', settings.tableClassName);
|
2457
|
-
|
2552
|
+
|
2553
|
+
instance.view._wt.wtOverlays.syncOverlayTableClassNames();
|
2458
2554
|
} else if (_pluginHooks.default.getSingleton().isRegistered(i) || _pluginHooks.default.getSingleton().isDeprecated(i)) {
|
2459
2555
|
if ((0, _function.isFunction)(settings[i]) || Array.isArray(settings[i])) {
|
2460
2556
|
settings[i].initialHook = true;
|
@@ -2468,9 +2564,9 @@ function Core(rootElement, userSettings) {
|
|
2468
2564
|
|
2469
2565
|
|
2470
2566
|
if (settings.data === void 0 && tableMeta.data === void 0) {
|
2471
|
-
|
2567
|
+
dataUpdateFunction(null, 'updateSettings'); // data source created just now
|
2472
2568
|
} else if (settings.data !== void 0) {
|
2473
|
-
|
2569
|
+
dataUpdateFunction(settings.data, 'updateSettings'); // data source given as option
|
2474
2570
|
} else if (settings.columns !== void 0) {
|
2475
2571
|
datamap.createMap(); // The `column` property has changed - dataset may be expanded or narrowed down. The `loadData` do the same.
|
2476
2572
|
|
@@ -2557,8 +2653,9 @@ function Core(rootElement, userSettings) {
|
|
2557
2653
|
|
2558
2654
|
if (!init) {
|
2559
2655
|
if (instance.view) {
|
2560
|
-
instance.view.
|
2561
|
-
|
2656
|
+
instance.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked();
|
2657
|
+
|
2658
|
+
instance.view._wt.exportSettingsAsClassNames();
|
2562
2659
|
}
|
2563
2660
|
|
2564
2661
|
instance.runHooks('afterUpdateSettings', settings);
|
@@ -2573,12 +2670,13 @@ function Core(rootElement, userSettings) {
|
|
2573
2670
|
|
2574
2671
|
instance._refreshBorders(null);
|
2575
2672
|
|
2576
|
-
instance.view.
|
2673
|
+
instance.view._wt.wtOverlays.adjustElementsSize();
|
2674
|
+
|
2577
2675
|
editorManager.unlockEditor();
|
2578
2676
|
}
|
2579
2677
|
|
2580
2678
|
if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) {
|
2581
|
-
instance.view.
|
2679
|
+
instance.view._wt.wtOverlays.updateMainScrollableElements();
|
2582
2680
|
}
|
2583
2681
|
};
|
2584
2682
|
/**
|
@@ -2608,7 +2706,7 @@ function Core(rootElement, userSettings) {
|
|
2608
2706
|
*
|
2609
2707
|
* @memberof Core#
|
2610
2708
|
* @function getSettings
|
2611
|
-
* @returns {
|
2709
|
+
* @returns {TableMeta} Object containing the current table settings.
|
2612
2710
|
*/
|
2613
2711
|
|
2614
2712
|
|
@@ -2702,7 +2800,7 @@ function Core(rootElement, userSettings) {
|
|
2702
2800
|
return null;
|
2703
2801
|
}
|
2704
2802
|
|
2705
|
-
return instance.view.getCellAtCoords(
|
2803
|
+
return instance.view.getCellAtCoords(instance._createCellCoords(renderableRowIndex, renderableColumnIndex), topmost);
|
2706
2804
|
};
|
2707
2805
|
/**
|
2708
2806
|
* Returns the coordinates of the cell, provided as a HTML table cell element.
|
@@ -2720,7 +2818,7 @@ function Core(rootElement, userSettings) {
|
|
2720
2818
|
|
2721
2819
|
|
2722
2820
|
this.getCoords = function (element) {
|
2723
|
-
var renderableCoords = this.view.
|
2821
|
+
var renderableCoords = this.view._wt.wtTable.getCoords(element);
|
2724
2822
|
|
2725
2823
|
if (renderableCoords === null) {
|
2726
2824
|
return null;
|
@@ -2739,7 +2837,7 @@ function Core(rootElement, userSettings) {
|
|
2739
2837
|
visualColumn = this.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn);
|
2740
2838
|
}
|
2741
2839
|
|
2742
|
-
return
|
2840
|
+
return instance._createCellCoords(visualRow, visualColumn);
|
2743
2841
|
};
|
2744
2842
|
/**
|
2745
2843
|
* Returns the property name that corresponds with the given column index.
|
@@ -2881,7 +2979,7 @@ function Core(rootElement, userSettings) {
|
|
2881
2979
|
this.getDataAtCol = function (column) {
|
2882
2980
|
var _ref13;
|
2883
2981
|
|
2884
|
-
return (_ref13 = []).concat.apply(_ref13, _toConsumableArray(datamap.getRange(
|
2982
|
+
return (_ref13 = []).concat.apply(_ref13, _toConsumableArray(datamap.getRange(instance._createCellCoords(0, column), instance._createCellCoords(tableMeta.data.length - 1, column), datamap.DESTINATION_RENDERER)));
|
2885
2983
|
};
|
2886
2984
|
/**
|
2887
2985
|
* Given the object property name (e.g. `'first.name'` or `'0'`), returns an array of column's values from the table data.
|
@@ -2898,7 +2996,7 @@ function Core(rootElement, userSettings) {
|
|
2898
2996
|
this.getDataAtProp = function (prop) {
|
2899
2997
|
var _ref14;
|
2900
2998
|
|
2901
|
-
var range = datamap.getRange(
|
2999
|
+
var range = datamap.getRange(instance._createCellCoords(0, datamap.propToCol(prop)), instance._createCellCoords(tableMeta.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER);
|
2902
3000
|
return (_ref14 = []).concat.apply(_ref14, _toConsumableArray(range));
|
2903
3001
|
};
|
2904
3002
|
/**
|
@@ -2925,7 +3023,7 @@ function Core(rootElement, userSettings) {
|
|
2925
3023
|
if (row === void 0) {
|
2926
3024
|
data = dataSource.getData();
|
2927
3025
|
} else {
|
2928
|
-
data = dataSource.getByRange(
|
3026
|
+
data = dataSource.getByRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2));
|
2929
3027
|
}
|
2930
3028
|
|
2931
3029
|
return data;
|
@@ -2954,7 +3052,7 @@ function Core(rootElement, userSettings) {
|
|
2954
3052
|
if (row === void 0) {
|
2955
3053
|
data = dataSource.getData(true);
|
2956
3054
|
} else {
|
2957
|
-
data = dataSource.getByRange(
|
3055
|
+
data = dataSource.getByRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2), true);
|
2958
3056
|
}
|
2959
3057
|
|
2960
3058
|
return data;
|
@@ -3071,7 +3169,7 @@ function Core(rootElement, userSettings) {
|
|
3071
3169
|
|
3072
3170
|
|
3073
3171
|
this.getDataAtRow = function (row) {
|
3074
|
-
var data = datamap.getRange(
|
3172
|
+
var data = datamap.getRange(instance._createCellCoords(row, 0), instance._createCellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);
|
3075
3173
|
return data[0] || [];
|
3076
3174
|
};
|
3077
3175
|
/**
|
@@ -3092,7 +3190,7 @@ function Core(rootElement, userSettings) {
|
|
3092
3190
|
|
3093
3191
|
|
3094
3192
|
this.getDataType = function (rowFrom, columnFrom, rowTo, columnTo) {
|
3095
|
-
var
|
3193
|
+
var _this4 = this;
|
3096
3194
|
|
3097
3195
|
var coords = rowFrom === void 0 ? [0, 0, this.countRows(), this.countCols()] : [rowFrom, columnFrom, rowTo, columnTo];
|
3098
3196
|
var rowStart = coords[0],
|
@@ -3114,7 +3212,7 @@ function Core(rootElement, userSettings) {
|
|
3114
3212
|
(0, _number.rangeEach)(Math.max(Math.min(rowStart, rowEnd), 0), Math.max(rowStart, rowEnd), function (row) {
|
3115
3213
|
var isTypeEqual = true;
|
3116
3214
|
(0, _number.rangeEach)(Math.max(Math.min(columnStart, columnEnd), 0), Math.max(columnStart, columnEnd), function (column) {
|
3117
|
-
var cellType =
|
3215
|
+
var cellType = _this4.getCellMeta(row, column);
|
3118
3216
|
|
3119
3217
|
currentType = cellType.type;
|
3120
3218
|
|
@@ -3171,7 +3269,7 @@ function Core(rootElement, userSettings) {
|
|
3171
3269
|
|
3172
3270
|
|
3173
3271
|
this.spliceCellsMeta = function (visualIndex) {
|
3174
|
-
var
|
3272
|
+
var _this5 = this;
|
3175
3273
|
|
3176
3274
|
var deleteAmount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
3177
3275
|
|
@@ -3189,9 +3287,9 @@ function Core(rootElement, userSettings) {
|
|
3189
3287
|
|
3190
3288
|
if (cellMetaRows.length > 0) {
|
3191
3289
|
(0, _array.arrayEach)(cellMetaRows.reverse(), function (cellMetaRow) {
|
3192
|
-
metaManager.createRow(
|
3290
|
+
metaManager.createRow(_this5.toPhysicalRow(visualIndex));
|
3193
3291
|
(0, _array.arrayEach)(cellMetaRow, function (cellMeta, columnIndex) {
|
3194
|
-
return
|
3292
|
+
return _this5.setCellMetaObject(visualIndex, columnIndex, cellMeta);
|
3195
3293
|
});
|
3196
3294
|
});
|
3197
3295
|
}
|
@@ -3210,11 +3308,11 @@ function Core(rootElement, userSettings) {
|
|
3210
3308
|
|
3211
3309
|
|
3212
3310
|
this.setCellMetaObject = function (row, column, prop) {
|
3213
|
-
var
|
3311
|
+
var _this6 = this;
|
3214
3312
|
|
3215
3313
|
if (_typeof(prop) === 'object') {
|
3216
3314
|
(0, _object.objectEach)(prop, function (value, key) {
|
3217
|
-
|
3315
|
+
_this6.setCellMeta(row, column, key, value);
|
3218
3316
|
});
|
3219
3317
|
}
|
3220
3318
|
};
|
@@ -3834,7 +3932,8 @@ function Core(rootElement, userSettings) {
|
|
3834
3932
|
return Math.min(maxCols, dataLen);
|
3835
3933
|
};
|
3836
3934
|
/**
|
3837
|
-
* Returns the number of rendered rows
|
3935
|
+
* Returns the number of rendered rows including rows that are partially or fully rendered
|
3936
|
+
* outside the table viewport.
|
3838
3937
|
*
|
3839
3938
|
* @memberof Core#
|
3840
3939
|
* @function countRenderedRows
|
@@ -3843,10 +3942,11 @@ function Core(rootElement, userSettings) {
|
|
3843
3942
|
|
3844
3943
|
|
3845
3944
|
this.countRenderedRows = function () {
|
3846
|
-
return instance.view.
|
3945
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getRenderedRowsCount() : -1;
|
3847
3946
|
};
|
3848
3947
|
/**
|
3849
|
-
* Returns the number of
|
3948
|
+
* Returns the number of rendered rows that are only visible in the table viewport.
|
3949
|
+
* The rows that are partially visible are not counted.
|
3850
3950
|
*
|
3851
3951
|
* @memberof Core#
|
3852
3952
|
* @function countVisibleRows
|
@@ -3855,10 +3955,11 @@ function Core(rootElement, userSettings) {
|
|
3855
3955
|
|
3856
3956
|
|
3857
3957
|
this.countVisibleRows = function () {
|
3858
|
-
return instance.view.
|
3958
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleRowsCount() : -1;
|
3859
3959
|
};
|
3860
3960
|
/**
|
3861
|
-
* Returns the number of rendered
|
3961
|
+
* Returns the number of rendered rows including columns that are partially or fully rendered
|
3962
|
+
* outside the table viewport.
|
3862
3963
|
*
|
3863
3964
|
* @memberof Core#
|
3864
3965
|
* @function countRenderedCols
|
@@ -3867,10 +3968,11 @@ function Core(rootElement, userSettings) {
|
|
3867
3968
|
|
3868
3969
|
|
3869
3970
|
this.countRenderedCols = function () {
|
3870
|
-
return instance.view.
|
3971
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getRenderedColumnsCount() : -1;
|
3871
3972
|
};
|
3872
3973
|
/**
|
3873
|
-
* Returns the number of
|
3974
|
+
* Returns the number of rendered columns that are only visible in the table viewport.
|
3975
|
+
* The columns that are partially visible are not counted.
|
3874
3976
|
*
|
3875
3977
|
* @memberof Core#
|
3876
3978
|
* @function countVisibleCols
|
@@ -3879,7 +3981,7 @@ function Core(rootElement, userSettings) {
|
|
3879
3981
|
|
3880
3982
|
|
3881
3983
|
this.countVisibleCols = function () {
|
3882
|
-
return instance.view.
|
3984
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3883
3985
|
};
|
3884
3986
|
/**
|
3885
3987
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
@@ -4189,7 +4291,7 @@ function Core(rootElement, userSettings) {
|
|
4189
4291
|
var isColumnInteger = Number.isInteger(renderableColumn);
|
4190
4292
|
|
4191
4293
|
if (isRowInteger && isColumnInteger) {
|
4192
|
-
return instance.view.scrollViewport(
|
4294
|
+
return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop, snapToRight, snapToBottom, snapToLeft);
|
4193
4295
|
}
|
4194
4296
|
|
4195
4297
|
if (isRowInteger && isColumnInteger === false) {
|
@@ -4226,8 +4328,8 @@ function Core(rootElement, userSettings) {
|
|
4226
4328
|
}
|
4227
4329
|
|
4228
4330
|
dataSource = null;
|
4331
|
+
this.getShortcutManager().destroy();
|
4229
4332
|
metaManager.clearCache();
|
4230
|
-
(0, _keyStateObserver.stopObserving)();
|
4231
4333
|
|
4232
4334
|
if ((0, _rootInstance.isRootInstance)(instance)) {
|
4233
4335
|
var licenseInfo = this.rootDocument.querySelector('#hot-display-license-info');
|
@@ -4625,6 +4727,337 @@ function Core(rootElement, userSettings) {
|
|
4625
4727
|
return instance.isLtr() ? 1 : -1;
|
4626
4728
|
};
|
4627
4729
|
|
4730
|
+
var shortcutManager = (0, _shortcuts.createShortcutManager)({
|
4731
|
+
beforeKeyDown: function beforeKeyDown(event) {
|
4732
|
+
if (_this.isListening() === false) {
|
4733
|
+
// Performing action (executing a callback) and triggering hook only for listening Handsontable.
|
4734
|
+
return false;
|
4735
|
+
}
|
4736
|
+
|
4737
|
+
return _this.runHooks('beforeKeyDown', event);
|
4738
|
+
},
|
4739
|
+
afterKeyDown: function afterKeyDown(event) {
|
4740
|
+
if (_this.isDestroyed) {
|
4741
|
+
// Handsontable could be destroyed after performing action (executing a callback).
|
4742
|
+
return;
|
4743
|
+
}
|
4744
|
+
|
4745
|
+
instance.runHooks('afterDocumentKeyDown', event);
|
4746
|
+
},
|
4747
|
+
ownerWindow: this.rootWindow
|
4748
|
+
});
|
4749
|
+
/**
|
4750
|
+
* Returns instance of a manager responsible for handling shortcuts stored in some contexts. It run actions after
|
4751
|
+
* pressing key combination in active Handsontable instance.
|
4752
|
+
*
|
4753
|
+
* @memberof Core#
|
4754
|
+
* @since 12.0.0
|
4755
|
+
* @function getShortcutManager
|
4756
|
+
* @returns {ShortcutManager} Instance of {@link ShortcutManager}
|
4757
|
+
*/
|
4758
|
+
|
4759
|
+
this.getShortcutManager = function () {
|
4760
|
+
return shortcutManager;
|
4761
|
+
};
|
4762
|
+
|
4763
|
+
var gridContext = shortcutManager.addContext('grid');
|
4764
|
+
var gridConfig = {
|
4765
|
+
runOnlyIf: function runOnlyIf() {
|
4766
|
+
return (0, _mixed.isDefined)(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
|
4767
|
+
},
|
4768
|
+
group: SHORTCUTS_GROUP
|
4769
|
+
};
|
4770
|
+
shortcutManager.setActiveContextName('grid');
|
4771
|
+
gridContext.addShortcuts([{
|
4772
|
+
keys: [['Control/Meta', 'A']],
|
4773
|
+
callback: function callback() {
|
4774
|
+
instance.selectAll();
|
4775
|
+
}
|
4776
|
+
}, {
|
4777
|
+
keys: [['Control/Meta', 'Enter']],
|
4778
|
+
callback: function callback() {
|
4779
|
+
var selectedRange = instance.getSelectedRange();
|
4780
|
+
var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
|
4781
|
+
highlightRow = _selectedRange$highli.row,
|
4782
|
+
highlightColumn = _selectedRange$highli.col;
|
4783
|
+
var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4784
|
+
var cellValues = new Map();
|
4785
|
+
|
4786
|
+
for (var i = 0; i < selectedRange.length; i++) {
|
4787
|
+
selectedRange[i].forAll(function (row, column) {
|
4788
|
+
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4789
|
+
var _instance$getCellMeta = instance.getCellMeta(row, column),
|
4790
|
+
readOnly = _instance$getCellMeta.readOnly;
|
4791
|
+
|
4792
|
+
if (!readOnly) {
|
4793
|
+
cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
|
4794
|
+
}
|
4795
|
+
}
|
4796
|
+
});
|
4797
|
+
}
|
4798
|
+
|
4799
|
+
instance.setDataAtCell(Array.from(cellValues.values()));
|
4800
|
+
},
|
4801
|
+
runOnlyIf: function runOnlyIf() {
|
4802
|
+
return instance.getSelectedRangeLast().getCellsCount() > 1;
|
4803
|
+
}
|
4804
|
+
}, {
|
4805
|
+
keys: [['ArrowUp']],
|
4806
|
+
callback: function callback() {
|
4807
|
+
selection.transformStart(-1, 0);
|
4808
|
+
}
|
4809
|
+
}, {
|
4810
|
+
keys: [['ArrowUp', 'Control/Meta']],
|
4811
|
+
captureCtrl: true,
|
4812
|
+
callback: function callback() {
|
4813
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getFirstNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4814
|
+
}
|
4815
|
+
}, {
|
4816
|
+
keys: [['ArrowUp', 'Shift']],
|
4817
|
+
callback: function callback() {
|
4818
|
+
selection.transformEnd(-1, 0);
|
4819
|
+
}
|
4820
|
+
}, {
|
4821
|
+
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4822
|
+
captureCtrl: true,
|
4823
|
+
callback: function callback() {
|
4824
|
+
var _instance$getSelected = instance.getSelectedRangeLast(),
|
4825
|
+
from = _instance$getSelected.from,
|
4826
|
+
to = _instance$getSelected.to;
|
4827
|
+
|
4828
|
+
var row = instance.rowIndexMapper.getFirstNotHiddenIndex(0, 1);
|
4829
|
+
selection.setRangeStart(from.clone());
|
4830
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4831
|
+
},
|
4832
|
+
runOnlyIf: function runOnlyIf() {
|
4833
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4834
|
+
}
|
4835
|
+
}, {
|
4836
|
+
keys: [['ArrowDown']],
|
4837
|
+
callback: function callback() {
|
4838
|
+
selection.transformStart(1, 0);
|
4839
|
+
}
|
4840
|
+
}, {
|
4841
|
+
keys: [['ArrowDown', 'Control/Meta']],
|
4842
|
+
captureCtrl: true,
|
4843
|
+
callback: function callback() {
|
4844
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getFirstNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4845
|
+
}
|
4846
|
+
}, {
|
4847
|
+
keys: [['ArrowDown', 'Shift']],
|
4848
|
+
callback: function callback() {
|
4849
|
+
selection.transformEnd(1, 0);
|
4850
|
+
}
|
4851
|
+
}, {
|
4852
|
+
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4853
|
+
captureCtrl: true,
|
4854
|
+
callback: function callback() {
|
4855
|
+
var _instance$getSelected2 = instance.getSelectedRangeLast(),
|
4856
|
+
from = _instance$getSelected2.from,
|
4857
|
+
to = _instance$getSelected2.to;
|
4858
|
+
|
4859
|
+
var row = instance.rowIndexMapper.getFirstNotHiddenIndex(instance.countRows() - 1, -1);
|
4860
|
+
selection.setRangeStart(from.clone());
|
4861
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4862
|
+
},
|
4863
|
+
runOnlyIf: function runOnlyIf() {
|
4864
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4865
|
+
}
|
4866
|
+
}, {
|
4867
|
+
keys: [['ArrowLeft']],
|
4868
|
+
callback: function callback() {
|
4869
|
+
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4870
|
+
}
|
4871
|
+
}, {
|
4872
|
+
keys: [['ArrowLeft', 'Control/Meta']],
|
4873
|
+
captureCtrl: true,
|
4874
|
+
callback: function callback() {
|
4875
|
+
var _instance$columnIndex;
|
4876
|
+
|
4877
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4878
|
+
|
4879
|
+
var column = (_instance$columnIndex = instance.columnIndexMapper).getFirstNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4880
|
+
|
4881
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4882
|
+
}
|
4883
|
+
}, {
|
4884
|
+
keys: [['ArrowLeft', 'Shift']],
|
4885
|
+
callback: function callback() {
|
4886
|
+
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4887
|
+
}
|
4888
|
+
}, {
|
4889
|
+
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4890
|
+
captureCtrl: true,
|
4891
|
+
callback: function callback() {
|
4892
|
+
var _instance$columnIndex2;
|
4893
|
+
|
4894
|
+
var _instance$getSelected3 = instance.getSelectedRangeLast(),
|
4895
|
+
from = _instance$getSelected3.from,
|
4896
|
+
to = _instance$getSelected3.to;
|
4897
|
+
|
4898
|
+
var column = (_instance$columnIndex2 = instance.columnIndexMapper).getFirstNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4899
|
+
|
4900
|
+
selection.setRangeStart(from.clone());
|
4901
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4902
|
+
},
|
4903
|
+
runOnlyIf: function runOnlyIf() {
|
4904
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4905
|
+
}
|
4906
|
+
}, {
|
4907
|
+
keys: [['ArrowRight']],
|
4908
|
+
callback: function callback() {
|
4909
|
+
selection.transformStart(0, instance.getDirectionFactor());
|
4910
|
+
}
|
4911
|
+
}, {
|
4912
|
+
keys: [['ArrowRight', 'Control/Meta']],
|
4913
|
+
captureCtrl: true,
|
4914
|
+
callback: function callback() {
|
4915
|
+
var _instance$columnIndex3;
|
4916
|
+
|
4917
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4918
|
+
|
4919
|
+
var column = (_instance$columnIndex3 = instance.columnIndexMapper).getFirstNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4920
|
+
|
4921
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4922
|
+
}
|
4923
|
+
}, {
|
4924
|
+
keys: [['ArrowRight', 'Shift']],
|
4925
|
+
callback: function callback() {
|
4926
|
+
selection.transformEnd(0, instance.getDirectionFactor());
|
4927
|
+
}
|
4928
|
+
}, {
|
4929
|
+
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4930
|
+
captureCtrl: true,
|
4931
|
+
callback: function callback() {
|
4932
|
+
var _instance$columnIndex4;
|
4933
|
+
|
4934
|
+
var _instance$getSelected4 = instance.getSelectedRangeLast(),
|
4935
|
+
from = _instance$getSelected4.from,
|
4936
|
+
to = _instance$getSelected4.to;
|
4937
|
+
|
4938
|
+
var column = (_instance$columnIndex4 = instance.columnIndexMapper).getFirstNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4939
|
+
|
4940
|
+
selection.setRangeStart(from.clone());
|
4941
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4942
|
+
},
|
4943
|
+
runOnlyIf: function runOnlyIf() {
|
4944
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4945
|
+
}
|
4946
|
+
}, {
|
4947
|
+
keys: [['Home']],
|
4948
|
+
captureCtrl: true,
|
4949
|
+
callback: function callback() {
|
4950
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4951
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4952
|
+
var column = instance.columnIndexMapper.getFirstNotHiddenIndex(fixedColumns, 1);
|
4953
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4954
|
+
},
|
4955
|
+
runOnlyIf: function runOnlyIf() {
|
4956
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4957
|
+
}
|
4958
|
+
}, {
|
4959
|
+
keys: [['Home', 'Shift']],
|
4960
|
+
callback: function callback() {
|
4961
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getFirstNotHiddenIndex(0, 1)));
|
4962
|
+
}
|
4963
|
+
}, {
|
4964
|
+
keys: [['Home', 'Control/Meta']],
|
4965
|
+
captureCtrl: true,
|
4966
|
+
callback: function callback() {
|
4967
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4968
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4969
|
+
var row = instance.rowIndexMapper.getFirstNotHiddenIndex(fixedRows, 1);
|
4970
|
+
var column = instance.columnIndexMapper.getFirstNotHiddenIndex(fixedColumns, 1);
|
4971
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4972
|
+
},
|
4973
|
+
runOnlyIf: function runOnlyIf() {
|
4974
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4975
|
+
}
|
4976
|
+
}, {
|
4977
|
+
keys: [['End']],
|
4978
|
+
captureCtrl: true,
|
4979
|
+
callback: function callback() {
|
4980
|
+
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getFirstNotHiddenIndex(instance.countCols() - 1, -1)));
|
4981
|
+
},
|
4982
|
+
runOnlyIf: function runOnlyIf() {
|
4983
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4984
|
+
}
|
4985
|
+
}, {
|
4986
|
+
keys: [['End', 'Shift']],
|
4987
|
+
callback: function callback() {
|
4988
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getFirstNotHiddenIndex(instance.countCols() - 1, -1)));
|
4989
|
+
}
|
4990
|
+
}, {
|
4991
|
+
keys: [['End', 'Control/Meta']],
|
4992
|
+
captureCtrl: true,
|
4993
|
+
callback: function callback() {
|
4994
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
4995
|
+
var row = instance.rowIndexMapper.getFirstNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
4996
|
+
var column = instance.columnIndexMapper.getFirstNotHiddenIndex(instance.countCols() - 1, -1);
|
4997
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4998
|
+
},
|
4999
|
+
runOnlyIf: function runOnlyIf() {
|
5000
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
5001
|
+
}
|
5002
|
+
}, {
|
5003
|
+
keys: [['PageUp']],
|
5004
|
+
callback: function callback() {
|
5005
|
+
selection.transformStart(-instance.countVisibleRows(), 0);
|
5006
|
+
}
|
5007
|
+
}, {
|
5008
|
+
keys: [['PageUp', 'Shift']],
|
5009
|
+
callback: function callback() {
|
5010
|
+
var _instance$getSelected5 = instance.getSelectedRangeLast(),
|
5011
|
+
to = _instance$getSelected5.to;
|
5012
|
+
|
5013
|
+
var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
5014
|
+
var row = instance.rowIndexMapper.getFirstNotHiddenIndex(nextRowIndexToSelect, 1);
|
5015
|
+
|
5016
|
+
if (row !== null) {
|
5017
|
+
var coords = instance._createCellCoords(row, to.col);
|
5018
|
+
|
5019
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
5020
|
+
var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
5021
|
+
selection.setRangeEnd(coords);
|
5022
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
5023
|
+
}
|
5024
|
+
}
|
5025
|
+
}, {
|
5026
|
+
keys: [['PageDown']],
|
5027
|
+
callback: function callback() {
|
5028
|
+
selection.transformStart(instance.countVisibleRows(), 0);
|
5029
|
+
}
|
5030
|
+
}, {
|
5031
|
+
keys: [['PageDown', 'Shift']],
|
5032
|
+
callback: function callback() {
|
5033
|
+
var _instance$getSelected6 = instance.getSelectedRangeLast(),
|
5034
|
+
to = _instance$getSelected6.to;
|
5035
|
+
|
5036
|
+
var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
5037
|
+
var row = instance.rowIndexMapper.getFirstNotHiddenIndex(nextRowIndexToSelect, -1);
|
5038
|
+
|
5039
|
+
if (row !== null) {
|
5040
|
+
var coords = instance._createCellCoords(row, to.col);
|
5041
|
+
|
5042
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
5043
|
+
var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
5044
|
+
selection.setRangeEnd(coords);
|
5045
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
5046
|
+
}
|
5047
|
+
}
|
5048
|
+
}, {
|
5049
|
+
keys: [['Tab']],
|
5050
|
+
callback: function callback(event) {
|
5051
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
5052
|
+
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
5053
|
+
}
|
5054
|
+
}, {
|
5055
|
+
keys: [['Shift', 'Tab']],
|
5056
|
+
callback: function callback(event) {
|
5057
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
5058
|
+
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
5059
|
+
}
|
5060
|
+
}], gridConfig);
|
4628
5061
|
(0, _registry.getPluginsNames)().forEach(function (pluginName) {
|
4629
5062
|
var PluginClass = (0, _registry.getPlugin)(pluginName);
|
4630
5063
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|