handsontable 11.1.0 → 12.1.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 +120 -98
- package/3rdparty/walkontable/src/border.mjs +120 -94
- package/3rdparty/walkontable/src/cell/coords.js +59 -17
- package/3rdparty/walkontable/src/cell/coords.mjs +55 -17
- package/3rdparty/walkontable/src/cell/range.d.ts +10 -2
- package/3rdparty/walkontable/src/cell/range.js +278 -99
- package/3rdparty/walkontable/src/cell/range.mjs +273 -99
- 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 +99 -66
- package/3rdparty/walkontable/src/event.mjs +99 -63
- package/3rdparty/walkontable/src/facade/core.js +251 -0
- package/3rdparty/walkontable/src/facade/core.mjs +243 -0
- package/3rdparty/walkontable/src/index.js +2 -46
- package/3rdparty/walkontable/src/index.mjs +3 -13
- package/3rdparty/walkontable/src/overlay/_base.js +124 -57
- package/3rdparty/walkontable/src/overlay/_base.mjs +124 -57
- package/3rdparty/walkontable/src/overlay/bottom.js +96 -80
- package/3rdparty/walkontable/src/overlay/bottom.mjs +96 -80
- package/3rdparty/walkontable/src/overlay/{bottomLeftCorner.js → bottomInlineStartCorner.js} +45 -62
- package/3rdparty/walkontable/src/overlay/{bottomLeftCorner.mjs → bottomInlineStartCorner.mjs} +44 -61
- 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} +113 -82
- package/3rdparty/walkontable/src/overlay/{left.mjs → inlineStart.mjs} +112 -81
- package/3rdparty/walkontable/src/overlay/top.js +93 -68
- package/3rdparty/walkontable/src/overlay/top.mjs +93 -68
- 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 +225 -156
- package/3rdparty/walkontable/src/overlays.mjs +224 -154
- package/3rdparty/walkontable/src/renderer/cells.js +4 -3
- package/3rdparty/walkontable/src/renderer/cells.mjs +4 -3
- package/3rdparty/walkontable/src/renderer/colGroup.js +2 -2
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +2 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +2 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/rows.js +2 -2
- package/3rdparty/walkontable/src/renderer/rows.mjs +2 -2
- package/3rdparty/walkontable/src/scroll.js +125 -104
- package/3rdparty/walkontable/src/scroll.mjs +124 -104
- package/3rdparty/walkontable/src/selection.js +10 -14
- package/3rdparty/walkontable/src/selection.mjs +10 -12
- package/3rdparty/walkontable/src/settings.js +235 -126
- package/3rdparty/walkontable/src/settings.mjs +235 -125
- package/3rdparty/walkontable/src/table/bottom.js +16 -5
- package/3rdparty/walkontable/src/table/bottom.mjs +15 -5
- package/3rdparty/walkontable/src/table/{bottomLeftCorner.js → bottomInlineStartCorner.js} +27 -15
- package/3rdparty/walkontable/src/table/{bottomLeftCorner.mjs → bottomInlineStartCorner.mjs} +26 -15
- package/3rdparty/walkontable/src/table/{left.js → inlineStart.js} +23 -15
- package/3rdparty/walkontable/src/table/{left.mjs → inlineStart.mjs} +22 -15
- package/3rdparty/walkontable/src/table/master.js +22 -12
- package/3rdparty/walkontable/src/table/master.mjs +22 -12
- 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 +16 -5
- package/3rdparty/walkontable/src/table/top.mjs +15 -5
- package/3rdparty/walkontable/src/table/{topLeftCorner.js → topInlineStartCorner.js} +27 -15
- package/3rdparty/walkontable/src/table/{topLeftCorner.mjs → topInlineStartCorner.mjs} +26 -15
- package/3rdparty/walkontable/src/table.js +235 -140
- package/3rdparty/walkontable/src/table.mjs +231 -134
- package/3rdparty/walkontable/src/types.js +103 -0
- package/3rdparty/walkontable/src/types.mjs +102 -0
- package/3rdparty/walkontable/src/utils/column.js +22 -33
- package/3rdparty/walkontable/src/utils/column.mjs +22 -30
- package/3rdparty/walkontable/src/utils/orderView/sharedView.js +2 -2
- package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +2 -2
- package/3rdparty/walkontable/src/utils/row.js +9 -4
- package/3rdparty/walkontable/src/utils/row.mjs +9 -4
- package/3rdparty/walkontable/src/viewport.js +89 -100
- package/3rdparty/walkontable/src/viewport.mjs +89 -97
- package/CHANGELOG.md +92 -0
- package/LICENSE.txt +1 -1
- package/README.md +0 -1
- 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 +6 -1
- package/core.js +508 -80
- package/core.mjs +517 -92
- package/dataMap/index.js +4 -0
- package/dataMap/index.mjs +2 -1
- package/dataMap/metaManager/index.js +2 -2
- package/dataMap/metaManager/index.mjs +2 -2
- package/dataMap/metaManager/metaLayers/globalMeta.js +4 -0
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +4 -0
- package/dataMap/metaManager/metaLayers/tableMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +2 -2
- package/dataMap/metaManager/metaSchema.js +282 -187
- package/dataMap/metaManager/metaSchema.mjs +282 -187
- package/dataMap/metaManager/mods/extendMetaProperties.js +126 -0
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +113 -0
- package/dataMap/replaceData.js +3 -17
- package/dataMap/replaceData.mjs +3 -17
- package/dist/handsontable.css +268 -92
- package/dist/handsontable.full.css +269 -103
- package/dist/handsontable.full.js +41990 -35658
- package/dist/handsontable.full.min.css +9 -9
- package/dist/handsontable.full.min.js +144 -144
- package/dist/handsontable.js +29561 -25597
- package/dist/handsontable.min.css +8 -8
- package/dist/handsontable.min.js +4 -4
- package/dist/languages/all.js +131 -34
- 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/cs-CZ.js +167 -0
- package/dist/languages/cs-CZ.min.js +1 -0
- package/dist/languages/de-CH.js +31 -29
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +4 -2
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +4 -2
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +4 -2
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.js +4 -2
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/it-IT.js +4 -2
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +36 -38
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +36 -39
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +2 -2
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +2 -2
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +2 -2
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +2 -2
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +2 -2
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +2 -2
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +171 -0
- package/dist/languages/sr-SP.min.js +1 -0
- package/dist/languages/zh-CN.js +24 -24
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +24 -24
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +120 -267
- package/editorManager.mjs +128 -278
- package/editors/autocompleteEditor/autocompleteEditor.js +22 -25
- package/editors/autocompleteEditor/autocompleteEditor.mjs +22 -25
- package/editors/baseEditor/baseEditor.js +205 -34
- package/editors/baseEditor/baseEditor.mjs +200 -32
- package/editors/checkboxEditor/checkboxEditor.js +2 -2
- package/editors/checkboxEditor/checkboxEditor.mjs +2 -2
- package/editors/dateEditor/dateEditor.js +21 -8
- package/editors/dateEditor/dateEditor.mjs +22 -9
- package/editors/dropdownEditor/dropdownEditor.js +3 -3
- package/editors/dropdownEditor/dropdownEditor.mjs +3 -3
- package/editors/handsontableEditor/handsontableEditor.js +106 -55
- package/editors/handsontableEditor/handsontableEditor.mjs +106 -55
- package/editors/index.d.ts +3 -0
- package/editors/index.js +6 -0
- package/editors/index.mjs +3 -1
- package/editors/numericEditor/numericEditor.js +2 -2
- package/editors/numericEditor/numericEditor.mjs +2 -2
- package/editors/passwordEditor/passwordEditor.js +3 -3
- package/editors/passwordEditor/passwordEditor.mjs +3 -3
- package/editors/selectEditor/selectEditor.js +65 -110
- package/editors/selectEditor/selectEditor.mjs +66 -109
- package/editors/textEditor/caretPositioner.js +49 -0
- package/editors/textEditor/caretPositioner.mjs +42 -0
- package/editors/textEditor/textEditor.js +205 -181
- package/editors/textEditor/textEditor.mjs +199 -179
- 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 +4 -2
- package/eventManager.mjs +4 -2
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/i18n/languages/ar-AR.js +41 -0
- package/i18n/languages/ar-AR.mjs +17 -0
- package/i18n/languages/cs-CZ.js +40 -0
- package/i18n/languages/cs-CZ.mjs +16 -0
- package/i18n/languages/index.js +12 -0
- package/i18n/languages/index.mjs +4 -1
- package/i18n/languages/sr-SP.js +40 -0
- package/i18n/languages/sr-SP.mjs +16 -0
- package/index.d.ts +4 -0
- package/languages/all.js +131 -34
- package/languages/ar-AR.js +167 -0
- package/languages/ar-AR.mjs +19 -0
- package/languages/cs-CZ.js +167 -0
- package/languages/cs-CZ.mjs +18 -0
- package/languages/de-CH.js +31 -29
- package/languages/de-DE.js +4 -2
- package/languages/en-US.js +4 -2
- package/languages/es-MX.js +4 -2
- package/languages/fr-FR.js +4 -2
- package/languages/index.js +131 -34
- package/languages/index.mjs +4 -1
- package/languages/it-IT.js +4 -2
- package/languages/ja-JP.js +36 -38
- package/languages/ko-KR.js +36 -39
- package/languages/lv-LV.js +2 -2
- package/languages/nb-NO.js +2 -2
- package/languages/nl-NL.js +2 -2
- package/languages/pl-PL.js +2 -2
- package/languages/pt-BR.js +2 -2
- package/languages/ru-RU.js +2 -2
- package/languages/sr-SP.js +171 -0
- package/languages/sr-SP.mjs +18 -0
- package/languages/zh-CN.js +24 -24
- package/languages/zh-TW.js +24 -24
- package/package.json +44 -4
- package/pluginHooks.js +49 -13
- package/pluginHooks.mjs +49 -13
- package/plugins/autoColumnSize/autoColumnSize.js +15 -10
- package/plugins/autoColumnSize/autoColumnSize.mjs +15 -10
- package/plugins/autoRowSize/autoRowSize.js +14 -9
- package/plugins/autoRowSize/autoRowSize.mjs +14 -9
- package/plugins/autofill/autofill.js +49 -33
- package/plugins/autofill/autofill.mjs +49 -32
- 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 +67 -4
- package/plugins/base/base.mjs +66 -4
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +3 -3
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +3 -3
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +3 -3
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +3 -3
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +3 -3
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +3 -3
- package/plugins/collapsibleColumns/collapsibleColumns.js +27 -9
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +27 -9
- package/plugins/columnSorting/columnSorting.js +5 -7
- package/plugins/columnSorting/columnSorting.mjs +5 -6
- package/plugins/columnSummary/columnSummary.js +3 -3
- package/plugins/columnSummary/columnSummary.mjs +3 -3
- package/plugins/comments/commentEditor.js +18 -2
- package/plugins/comments/commentEditor.mjs +19 -3
- package/plugins/comments/comments.js +57 -46
- package/plugins/comments/comments.mjs +58 -46
- package/plugins/contextMenu/contextMenu.js +10 -6
- package/plugins/contextMenu/contextMenu.mjs +10 -6
- package/plugins/contextMenu/menu.js +222 -110
- package/plugins/contextMenu/menu.mjs +219 -111
- package/plugins/contextMenu/predefinedItems/columnLeft.js +12 -4
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +11 -4
- package/plugins/contextMenu/predefinedItems/columnRight.js +9 -9
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +9 -9
- package/plugins/contextMenu/utils.js +2 -2
- package/plugins/contextMenu/utils.mjs +2 -2
- package/plugins/copyPaste/copyPaste.js +31 -21
- package/plugins/copyPaste/copyPaste.mjs +30 -21
- package/plugins/customBorders/contextMenuItem/left.js +4 -3
- package/plugins/customBorders/contextMenuItem/left.mjs +4 -3
- package/plugins/customBorders/contextMenuItem/right.js +4 -3
- package/plugins/customBorders/contextMenuItem/right.mjs +4 -3
- package/plugins/customBorders/customBorders.js +144 -87
- package/plugins/customBorders/customBorders.mjs +143 -85
- package/plugins/customBorders/utils.js +131 -27
- package/plugins/customBorders/utils.mjs +115 -27
- package/plugins/dragToScroll/dragToScroll.js +10 -5
- package/plugins/dragToScroll/dragToScroll.mjs +10 -5
- package/plugins/dropdownMenu/dropdownMenu.js +9 -7
- package/plugins/dropdownMenu/dropdownMenu.mjs +9 -7
- package/plugins/exportFile/exportFile.js +2 -2
- package/plugins/exportFile/exportFile.mjs +2 -2
- package/plugins/exportFile/types/csv.js +2 -2
- package/plugins/exportFile/types/csv.mjs +2 -2
- package/plugins/filters/component/actionBar.js +2 -2
- package/plugins/filters/component/actionBar.mjs +2 -2
- package/plugins/filters/component/condition.js +3 -3
- package/plugins/filters/component/condition.mjs +3 -3
- package/plugins/filters/component/operators.js +2 -2
- package/plugins/filters/component/operators.mjs +2 -2
- package/plugins/filters/component/value.js +3 -3
- package/plugins/filters/component/value.mjs +3 -3
- package/plugins/filters/filters.js +11 -8
- package/plugins/filters/filters.mjs +11 -8
- package/plugins/filters/ui/input.js +3 -3
- package/plugins/filters/ui/input.mjs +3 -3
- package/plugins/filters/ui/link.js +3 -3
- package/plugins/filters/ui/link.mjs +3 -3
- package/plugins/filters/ui/multipleSelect.js +18 -31
- package/plugins/filters/ui/multipleSelect.mjs +18 -31
- package/plugins/filters/ui/radioInput.js +3 -3
- package/plugins/filters/ui/radioInput.mjs +3 -3
- package/plugins/filters/ui/select.js +4 -4
- package/plugins/filters/ui/select.mjs +4 -4
- package/plugins/formulas/formulas.js +14 -9
- package/plugins/formulas/formulas.mjs +14 -9
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +2 -4
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +2 -4
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +5 -5
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +5 -5
- package/plugins/hiddenColumns/hiddenColumns.js +9 -4
- package/plugins/hiddenColumns/hiddenColumns.mjs +9 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +2 -4
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +2 -4
- package/plugins/hiddenRows/contextMenuItem/showRow.js +5 -5
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +5 -5
- package/plugins/hiddenRows/hiddenRows.js +9 -4
- package/plugins/hiddenRows/hiddenRows.mjs +9 -4
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +54 -15
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +49 -15
- package/plugins/manualColumnMove/manualColumnMove.js +70 -70
- package/plugins/manualColumnMove/manualColumnMove.mjs +71 -71
- package/plugins/manualColumnMove/ui/_base.js +25 -12
- package/plugins/manualColumnMove/ui/_base.mjs +24 -12
- package/plugins/manualColumnMove/ui/backlight.js +3 -3
- package/plugins/manualColumnMove/ui/backlight.mjs +3 -3
- package/plugins/manualColumnMove/ui/guideline.js +3 -3
- package/plugins/manualColumnMove/ui/guideline.mjs +3 -3
- package/plugins/manualColumnResize/manualColumnResize.js +37 -21
- package/plugins/manualColumnResize/manualColumnResize.mjs +37 -21
- package/plugins/manualRowMove/manualRowMove.js +26 -34
- package/plugins/manualRowMove/manualRowMove.mjs +26 -34
- package/plugins/manualRowMove/ui/backlight.js +3 -3
- package/plugins/manualRowMove/ui/backlight.mjs +3 -3
- package/plugins/manualRowMove/ui/guideline.js +3 -3
- package/plugins/manualRowMove/ui/guideline.mjs +3 -3
- package/plugins/manualRowResize/manualRowResize.js +34 -19
- package/plugins/manualRowResize/manualRowResize.mjs +34 -19
- package/plugins/mergeCells/calculations/autofill.js +6 -5
- package/plugins/mergeCells/calculations/autofill.mjs +6 -4
- package/plugins/mergeCells/calculations/selection.js +9 -4
- package/plugins/mergeCells/calculations/selection.mjs +9 -4
- package/plugins/mergeCells/cellCoords.js +16 -4
- package/plugins/mergeCells/cellCoords.mjs +16 -3
- package/plugins/mergeCells/cellsCollection.js +30 -23
- package/plugins/mergeCells/cellsCollection.mjs +30 -22
- package/plugins/mergeCells/mergeCells.js +94 -61
- package/plugins/mergeCells/mergeCells.mjs +94 -59
- package/plugins/multiColumnSorting/multiColumnSorting.js +4 -6
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +4 -5
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +51 -57
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +52 -57
- package/plugins/nestedHeaders/nestedHeaders.js +31 -20
- package/plugins/nestedHeaders/nestedHeaders.mjs +31 -20
- package/plugins/nestedHeaders/stateManager/utils.js +3 -4
- package/plugins/nestedHeaders/stateManager/utils.mjs +3 -4
- package/plugins/nestedHeaders/utils/ghostTable.js +114 -75
- package/plugins/nestedHeaders/utils/ghostTable.mjs +114 -74
- package/plugins/nestedRows/nestedRows.js +9 -4
- package/plugins/nestedRows/nestedRows.mjs +9 -4
- package/plugins/nestedRows/ui/collapsing.js +2 -2
- package/plugins/nestedRows/ui/collapsing.mjs +2 -2
- package/plugins/nestedRows/ui/contextMenu.js +2 -2
- package/plugins/nestedRows/ui/contextMenu.mjs +2 -2
- package/plugins/nestedRows/ui/headers.js +2 -2
- package/plugins/nestedRows/ui/headers.mjs +2 -2
- package/plugins/nestedRows/utils/rowMoveController.js +2 -4
- package/plugins/nestedRows/utils/rowMoveController.mjs +2 -3
- package/plugins/persistentState/persistentState.js +9 -4
- package/plugins/persistentState/persistentState.mjs +9 -4
- package/plugins/search/search.js +9 -4
- package/plugins/search/search.mjs +9 -4
- package/plugins/touchScroll/touchScroll.js +27 -21
- package/plugins/touchScroll/touchScroll.mjs +27 -21
- package/plugins/trimRows/trimRows.js +9 -4
- package/plugins/trimRows/trimRows.mjs +9 -4
- package/plugins/undoRedo/undoRedo.js +53 -47
- package/plugins/undoRedo/undoRedo.mjs +53 -46
- 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/visualSelection.js +94 -220
- package/selection/highlight/visualSelection.mjs +91 -213
- package/selection/mouseEventHandler.js +15 -10
- package/selection/mouseEventHandler.mjs +15 -9
- package/selection/range.js +4 -5
- package/selection/range.mjs +4 -5
- package/selection/selection.js +35 -22
- package/selection/selection.mjs +35 -20
- package/selection/transformation.js +4 -6
- package/selection/transformation.mjs +4 -5
- 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 +185 -0
- package/shortcuts/manager.mjs +176 -0
- package/shortcuts/recorder.js +192 -0
- package/shortcuts/recorder.mjs +180 -0
- package/shortcuts/utils.js +77 -0
- package/shortcuts/utils.mjs +54 -0
- package/tableView.js +164 -84
- package/tableView.mjs +164 -74
- package/translations/changesObservable/observer.js +0 -1
- package/translations/changesObservable/observer.mjs +0 -1
- package/translations/indexMapper.d.ts +3 -1
- package/translations/indexMapper.js +89 -11
- package/translations/indexMapper.mjs +91 -20
- package/translations/mapCollections/aggregatedCollection.js +2 -2
- package/translations/mapCollections/aggregatedCollection.mjs +2 -2
- package/translations/maps/hidingMap.js +4 -2
- package/translations/maps/hidingMap.mjs +4 -2
- package/translations/maps/indexMap.js +2 -0
- package/translations/maps/indexMap.mjs +2 -0
- package/translations/maps/indexesSequence.js +5 -3
- package/translations/maps/indexesSequence.mjs +5 -3
- package/translations/maps/linkedPhysicalIndexToValueMap.js +5 -3
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +5 -3
- package/translations/maps/physicalIndexToValueMap.js +5 -3
- package/translations/maps/physicalIndexToValueMap.mjs +5 -3
- package/translations/maps/trimmingMap.js +4 -2
- package/translations/maps/trimmingMap.mjs +4 -2
- 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 +1 -1
- package/utils/ghostTable.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,14 +101,14 @@ 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
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); }
|
@@ -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);
|
@@ -235,7 +236,53 @@ function Core(rootElement, userSettings) {
|
|
235
236
|
*/
|
236
237
|
|
237
238
|
this.executionSuspendedCounter = 0;
|
238
|
-
(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)();
|
239
286
|
this.container = this.rootDocument.createElement('div');
|
240
287
|
this.renderCall = false;
|
241
288
|
rootElement.insertBefore(this.container, rootElement.firstChild);
|
@@ -273,19 +320,25 @@ function Core(rootElement, userSettings) {
|
|
273
320
|
var visualToRenderableCoords = function visualToRenderableCoords(coords) {
|
274
321
|
var visualRow = coords.row,
|
275
322
|
visualColumn = coords.col;
|
276
|
-
return
|
323
|
+
return instance._createCellCoords( // We just store indexes for rows and columns without headers.
|
277
324
|
visualRow >= 0 ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRow) : visualRow, visualColumn >= 0 ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumn) : visualColumn);
|
278
325
|
};
|
279
326
|
|
280
327
|
var renderableToVisualCoords = function renderableToVisualCoords(coords) {
|
281
328
|
var renderableRow = coords.row,
|
282
329
|
renderableColumn = coords.col;
|
283
|
-
return
|
330
|
+
return instance._createCellCoords( // We just store indexes for rows and columns without headers.
|
284
331
|
renderableRow >= 0 ? instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow, renderableColumn >= 0 ? instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn // eslint-disable-line max-len
|
285
332
|
);
|
286
333
|
};
|
287
334
|
|
288
335
|
var selection = new _selection.Selection(tableMeta, {
|
336
|
+
rowIndexMapper: function rowIndexMapper() {
|
337
|
+
return instance.rowIndexMapper;
|
338
|
+
},
|
339
|
+
columnIndexMapper: function columnIndexMapper() {
|
340
|
+
return instance.columnIndexMapper;
|
341
|
+
},
|
289
342
|
countCols: function countCols() {
|
290
343
|
return instance.countCols();
|
291
344
|
},
|
@@ -304,6 +357,15 @@ function Core(rootElement, userSettings) {
|
|
304
357
|
countRowsTranslated: function countRowsTranslated() {
|
305
358
|
return _this.view.countRenderableRows();
|
306
359
|
},
|
360
|
+
getShortcutManager: function getShortcutManager() {
|
361
|
+
return instance.getShortcutManager();
|
362
|
+
},
|
363
|
+
createCellCoords: function createCellCoords(row, column) {
|
364
|
+
return instance._createCellCoords(row, column);
|
365
|
+
},
|
366
|
+
createCellRange: function createCellRange(highlight, from, to) {
|
367
|
+
return instance._createCellRange(highlight, from, to);
|
368
|
+
},
|
307
369
|
visualToRenderableCoords: visualToRenderableCoords,
|
308
370
|
renderableToVisualCoords: renderableToVisualCoords,
|
309
371
|
isDisabledCellSelection: function isDisabledCellSelection(visualRow, visualColumn) {
|
@@ -332,11 +394,11 @@ function Core(rootElement, userSettings) {
|
|
332
394
|
_this.runHooks('beforeSetRangeEnd', cellCoords);
|
333
395
|
|
334
396
|
if (cellCoords.row < 0) {
|
335
|
-
cellCoords.row = _this.view.
|
397
|
+
cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
|
336
398
|
}
|
337
399
|
|
338
400
|
if (cellCoords.col < 0) {
|
339
|
-
cellCoords.col = _this.view.
|
401
|
+
cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
|
340
402
|
}
|
341
403
|
});
|
342
404
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
@@ -550,8 +612,8 @@ function Core(rootElement, userSettings) {
|
|
550
612
|
|
551
613
|
selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.
|
552
614
|
|
553
|
-
selection.setRangeStartOnly(
|
554
|
-
selection.setRangeEnd(
|
615
|
+
selection.setRangeStartOnly(instance._createCellCoords(currentFromRow + delta, currentFromColumn), true);
|
616
|
+
selection.setRangeEnd(instance._createCellCoords(currentToRow + delta, currentToColumn)); // will call render() internally
|
555
617
|
} else {
|
556
618
|
instance._refreshBorders(); // it will call render and prepare methods
|
557
619
|
|
@@ -595,8 +657,8 @@ function Core(rootElement, userSettings) {
|
|
595
657
|
|
596
658
|
selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.
|
597
659
|
|
598
|
-
selection.setRangeStartOnly(
|
599
|
-
selection.setRangeEnd(
|
660
|
+
selection.setRangeStartOnly(instance._createCellCoords(_currentFromRow, _currentFromColumn + delta), true);
|
661
|
+
selection.setRangeEnd(instance._createCellCoords(_currentToRow, _currentToColumn + delta)); // will call render() internally
|
600
662
|
} else {
|
601
663
|
instance._refreshBorders(); // it will call render and prepare methods
|
602
664
|
|
@@ -688,10 +750,10 @@ function Core(rootElement, userSettings) {
|
|
688
750
|
}
|
689
751
|
|
690
752
|
metaManager.removeColumn(physicalColumnIndex, groupAmount);
|
691
|
-
var
|
753
|
+
var fixedColumnsStart = tableMeta.fixedColumnsStart;
|
692
754
|
|
693
|
-
if (
|
694
|
-
tableMeta.
|
755
|
+
if (fixedColumnsStart >= calcIndex + 1) {
|
756
|
+
tableMeta.fixedColumnsStart -= Math.min(groupAmount, fixedColumnsStart - calcIndex);
|
695
757
|
}
|
696
758
|
|
697
759
|
if (Array.isArray(tableMeta.colHeaders)) {
|
@@ -1399,6 +1461,38 @@ function Core(rootElement, userSettings) {
|
|
1399
1461
|
activeEditor.refreshValue();
|
1400
1462
|
}
|
1401
1463
|
}
|
1464
|
+
/**
|
1465
|
+
* Creates and returns the CellCoords object.
|
1466
|
+
*
|
1467
|
+
* @private
|
1468
|
+
* @memberof Core#
|
1469
|
+
* @function _createCellCoords
|
1470
|
+
* @param {number} row The row index.
|
1471
|
+
* @param {number} column The column index.
|
1472
|
+
* @returns {CellCoords}
|
1473
|
+
*/
|
1474
|
+
|
1475
|
+
|
1476
|
+
this._createCellCoords = function (row, column) {
|
1477
|
+
return instance.view._wt.createCellCoords(row, column);
|
1478
|
+
};
|
1479
|
+
/**
|
1480
|
+
* Creates and returns the CellRange object.
|
1481
|
+
*
|
1482
|
+
* @private
|
1483
|
+
* @memberof Core#
|
1484
|
+
* @function _createCellRange
|
1485
|
+
* @param {CellCoords} highlight Defines the border around a cell where selection was started and to edit the cell
|
1486
|
+
* when you press Enter. The highlight cannot point to headers (negative values).
|
1487
|
+
* @param {CellCoords} from Initial coordinates.
|
1488
|
+
* @param {CellCoords} to Final coordinates.
|
1489
|
+
* @returns {CellRange}
|
1490
|
+
*/
|
1491
|
+
|
1492
|
+
|
1493
|
+
this._createCellRange = function (highlight, from, to) {
|
1494
|
+
return instance.view._wt.createCellRange(highlight, from, to);
|
1495
|
+
};
|
1402
1496
|
/**
|
1403
1497
|
* Validate a single cell.
|
1404
1498
|
*
|
@@ -1437,7 +1531,8 @@ function Core(rootElement, userSettings) {
|
|
1437
1531
|
if (td && td.nodeName !== 'TH') {
|
1438
1532
|
var renderableRow = instance.rowIndexMapper.getRenderableFromVisualIndex(row);
|
1439
1533
|
var renderableColumn = instance.columnIndexMapper.getRenderableFromVisualIndex(col);
|
1440
|
-
|
1534
|
+
|
1535
|
+
instance.view._wt.getSetting('cellRenderer', renderableRow, renderableColumn, td);
|
1441
1536
|
}
|
1442
1537
|
|
1443
1538
|
callback(valid);
|
@@ -1662,8 +1757,8 @@ function Core(rootElement, userSettings) {
|
|
1662
1757
|
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
|
1663
1758
|
}
|
1664
1759
|
|
1665
|
-
var c = typeof endRow === 'number' ?
|
1666
|
-
return grid.populateFromArray(
|
1760
|
+
var c = typeof endRow === 'number' ? instance._createCellCoords(endRow, endCol) : null;
|
1761
|
+
return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method, direction, deltas);
|
1667
1762
|
};
|
1668
1763
|
/**
|
1669
1764
|
* Adds/removes data from the column. This method works the same as Array.splice for arrays.
|
@@ -1812,10 +1907,10 @@ function Core(rootElement, userSettings) {
|
|
1812
1907
|
|
1813
1908
|
var changes = [];
|
1814
1909
|
(0, _array.arrayEach)(selection.getSelectedRange(), function (cellRange) {
|
1815
|
-
var
|
1816
|
-
var
|
1817
|
-
(0, _number.rangeEach)(
|
1818
|
-
(0, _number.rangeEach)(
|
1910
|
+
var topStart = cellRange.getTopStartCorner();
|
1911
|
+
var bottomEnd = cellRange.getBottomEndCorner();
|
1912
|
+
(0, _number.rangeEach)(topStart.row, bottomEnd.row, function (row) {
|
1913
|
+
(0, _number.rangeEach)(topStart.col, bottomEnd.col, function (column) {
|
1819
1914
|
if (!_this2.getCellMeta(row, column).readOnly) {
|
1820
1915
|
changes.push([row, column, null]);
|
1821
1916
|
}
|
@@ -2173,7 +2268,7 @@ function Core(rootElement, userSettings) {
|
|
2173
2268
|
return;
|
2174
2269
|
}
|
2175
2270
|
|
2176
|
-
if (isSizeChanged || instance.view.
|
2271
|
+
if (isSizeChanged || instance.view._wt.wtOverlays.scrollableElement === instance.rootWindow) {
|
2177
2272
|
instance.view.setLastSize(width, height);
|
2178
2273
|
instance.render();
|
2179
2274
|
}
|
@@ -2197,8 +2292,8 @@ function Core(rootElement, userSettings) {
|
|
2197
2292
|
* To replace Handsontable's [`data`](@/api/options.md#data) and reset states, use the [`loadData()`](#loaddata) method.
|
2198
2293
|
*
|
2199
2294
|
* Read more:
|
2200
|
-
* - [Binding to data
|
2201
|
-
* - [Saving data
|
2295
|
+
* - [Binding to data](@/guides/getting-started/binding-to-data.md)
|
2296
|
+
* - [Saving data](@/guides/getting-started/saving-data.md)
|
2202
2297
|
*
|
2203
2298
|
* @memberof Core#
|
2204
2299
|
* @function updateData
|
@@ -2241,8 +2336,8 @@ function Core(rootElement, userSettings) {
|
|
2241
2336
|
* To replace Handsontable's [`data`](@/api/options.md#data) without resetting states, use the [`updateData()`](#updatedata) method.
|
2242
2337
|
*
|
2243
2338
|
* Read more:
|
2244
|
-
* - [Binding to data
|
2245
|
-
* - [Saving data
|
2339
|
+
* - [Binding to data](@/guides/getting-started/binding-to-data.md)
|
2340
|
+
* - [Saving data](@/guides/getting-started/saving-data.md)
|
2246
2341
|
*
|
2247
2342
|
* @memberof Core#
|
2248
2343
|
* @function loadData
|
@@ -2356,7 +2451,7 @@ function Core(rootElement, userSettings) {
|
|
2356
2451
|
return datamap.getAll();
|
2357
2452
|
}
|
2358
2453
|
|
2359
|
-
return datamap.getRange(
|
2454
|
+
return datamap.getRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2), datamap.DESTINATION_RENDERER);
|
2360
2455
|
};
|
2361
2456
|
/**
|
2362
2457
|
* Returns a string value of the selected range. Each column is separated by tab, each row is separated by a new
|
@@ -2373,7 +2468,7 @@ function Core(rootElement, userSettings) {
|
|
2373
2468
|
|
2374
2469
|
|
2375
2470
|
this.getCopyableText = function (startRow, startCol, endRow, endCol) {
|
2376
|
-
return datamap.getCopyableText(
|
2471
|
+
return datamap.getCopyableText(instance._createCellCoords(startRow, startCol), instance._createCellCoords(endRow, endCol));
|
2377
2472
|
};
|
2378
2473
|
/**
|
2379
2474
|
* Returns the data's copyable value at specified `row` and `column` index.
|
@@ -2403,7 +2498,7 @@ function Core(rootElement, userSettings) {
|
|
2403
2498
|
return datamap.getSchema();
|
2404
2499
|
};
|
2405
2500
|
/**
|
2406
|
-
* Use it if you need to change configuration after initialization. The `settings` argument is an object containing the
|
2501
|
+
* Use it if you need to change configuration after initialization. The `settings` argument is an object containing the changed
|
2407
2502
|
* settings, declared the same way as in the initial settings object.
|
2408
2503
|
*
|
2409
2504
|
* __Note__, that although the `updateSettings` method doesn't overwrite the previously declared settings, it might reset
|
@@ -2412,9 +2507,12 @@ function Core(rootElement, userSettings) {
|
|
2412
2507
|
* Since 8.0.0 passing `columns` or `data` inside `settings` objects will result in resetting states corresponding to rows and columns
|
2413
2508
|
* (for example, row/column sequence, column width, row height, frozen columns etc.).
|
2414
2509
|
*
|
2510
|
+
* Since 12.0.0 passing `data` inside `settings` objects no longer results in resetting states corresponding to rows and columns
|
2511
|
+
* (for example, row/column sequence, column width, row height, frozen columns etc.).
|
2512
|
+
*
|
2415
2513
|
* @memberof Core#
|
2416
2514
|
* @function updateSettings
|
2417
|
-
* @param {object} settings
|
2515
|
+
* @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.
|
2418
2516
|
* @param {boolean} [init=false] Internally used for in initialization mode.
|
2419
2517
|
* @example
|
2420
2518
|
* ```js
|
@@ -2431,12 +2529,7 @@ function Core(rootElement, userSettings) {
|
|
2431
2529
|
|
2432
2530
|
this.updateSettings = function (settings) {
|
2433
2531
|
var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
2434
|
-
|
2435
|
-
// Do not forget to re-enable the pending tests that cover the change:
|
2436
|
-
// * https://github.com/handsontable/handsontable/blob/9f62c282a1c951b27cd8406aa27105bd32b05bb6/handsontable/test/e2e/core/toPhysicalColumn.spec.js#L70
|
2437
|
-
// * https://github.com/handsontable/handsontable/blob/9f62c282a1c951b27cd8406aa27105bd32b05bb6/handsontable/test/e2e/core/toVisualColumn.spec.js#L70
|
2438
|
-
// const dataUpdateFunction = (firstRun ? instance.loadData : instance.updateData).bind(this);
|
2439
|
-
var dataUpdateFunction = instance.loadData.bind(this);
|
2532
|
+
var dataUpdateFunction = (firstRun ? instance.loadData : instance.updateData).bind(this);
|
2440
2533
|
var columnsAsFunc = false;
|
2441
2534
|
var i;
|
2442
2535
|
var j;
|
@@ -2455,19 +2548,15 @@ function Core(rootElement, userSettings) {
|
|
2455
2548
|
|
2456
2549
|
|
2457
2550
|
for (i in settings) {
|
2458
|
-
if (i === 'data') {
|
2459
|
-
/* eslint-disable-next-line no-continue */
|
2460
|
-
continue; // loadData will be triggered later
|
2551
|
+
if (i === 'data') {// Do nothing. loadData will be triggered later
|
2461
2552
|
} else if (i === 'language') {
|
2462
2553
|
setLanguage(settings.language);
|
2463
|
-
/* eslint-disable-next-line no-continue */
|
2464
|
-
|
2465
|
-
continue;
|
2466
2554
|
} else if (i === 'className') {
|
2467
2555
|
setClassName('className', settings.className);
|
2468
2556
|
} else if (i === 'tableClassName' && instance.table) {
|
2469
2557
|
setClassName('tableClassName', settings.tableClassName);
|
2470
|
-
|
2558
|
+
|
2559
|
+
instance.view._wt.wtOverlays.syncOverlayTableClassNames();
|
2471
2560
|
} else if (_pluginHooks.default.getSingleton().isRegistered(i) || _pluginHooks.default.getSingleton().isDeprecated(i)) {
|
2472
2561
|
if ((0, _function.isFunction)(settings[i]) || Array.isArray(settings[i])) {
|
2473
2562
|
settings[i].initialHook = true;
|
@@ -2570,8 +2659,9 @@ function Core(rootElement, userSettings) {
|
|
2570
2659
|
|
2571
2660
|
if (!init) {
|
2572
2661
|
if (instance.view) {
|
2573
|
-
instance.view.
|
2574
|
-
|
2662
|
+
instance.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked();
|
2663
|
+
|
2664
|
+
instance.view._wt.exportSettingsAsClassNames();
|
2575
2665
|
}
|
2576
2666
|
|
2577
2667
|
instance.runHooks('afterUpdateSettings', settings);
|
@@ -2586,12 +2676,13 @@ function Core(rootElement, userSettings) {
|
|
2586
2676
|
|
2587
2677
|
instance._refreshBorders(null);
|
2588
2678
|
|
2589
|
-
instance.view.
|
2679
|
+
instance.view._wt.wtOverlays.adjustElementsSize();
|
2680
|
+
|
2590
2681
|
editorManager.unlockEditor();
|
2591
2682
|
}
|
2592
2683
|
|
2593
2684
|
if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) {
|
2594
|
-
instance.view.
|
2685
|
+
instance.view._wt.wtOverlays.updateMainScrollableElements();
|
2595
2686
|
}
|
2596
2687
|
};
|
2597
2688
|
/**
|
@@ -2621,7 +2712,7 @@ function Core(rootElement, userSettings) {
|
|
2621
2712
|
*
|
2622
2713
|
* @memberof Core#
|
2623
2714
|
* @function getSettings
|
2624
|
-
* @returns {
|
2715
|
+
* @returns {TableMeta} Object containing the current table settings.
|
2625
2716
|
*/
|
2626
2717
|
|
2627
2718
|
|
@@ -2715,7 +2806,7 @@ function Core(rootElement, userSettings) {
|
|
2715
2806
|
return null;
|
2716
2807
|
}
|
2717
2808
|
|
2718
|
-
return instance.view.getCellAtCoords(
|
2809
|
+
return instance.view.getCellAtCoords(instance._createCellCoords(renderableRowIndex, renderableColumnIndex), topmost);
|
2719
2810
|
};
|
2720
2811
|
/**
|
2721
2812
|
* Returns the coordinates of the cell, provided as a HTML table cell element.
|
@@ -2733,7 +2824,7 @@ function Core(rootElement, userSettings) {
|
|
2733
2824
|
|
2734
2825
|
|
2735
2826
|
this.getCoords = function (element) {
|
2736
|
-
var renderableCoords = this.view.
|
2827
|
+
var renderableCoords = this.view._wt.wtTable.getCoords(element);
|
2737
2828
|
|
2738
2829
|
if (renderableCoords === null) {
|
2739
2830
|
return null;
|
@@ -2752,7 +2843,7 @@ function Core(rootElement, userSettings) {
|
|
2752
2843
|
visualColumn = this.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn);
|
2753
2844
|
}
|
2754
2845
|
|
2755
|
-
return
|
2846
|
+
return instance._createCellCoords(visualRow, visualColumn);
|
2756
2847
|
};
|
2757
2848
|
/**
|
2758
2849
|
* Returns the property name that corresponds with the given column index.
|
@@ -2894,7 +2985,7 @@ function Core(rootElement, userSettings) {
|
|
2894
2985
|
this.getDataAtCol = function (column) {
|
2895
2986
|
var _ref13;
|
2896
2987
|
|
2897
|
-
return (_ref13 = []).concat.apply(_ref13, _toConsumableArray(datamap.getRange(
|
2988
|
+
return (_ref13 = []).concat.apply(_ref13, _toConsumableArray(datamap.getRange(instance._createCellCoords(0, column), instance._createCellCoords(tableMeta.data.length - 1, column), datamap.DESTINATION_RENDERER)));
|
2898
2989
|
};
|
2899
2990
|
/**
|
2900
2991
|
* Given the object property name (e.g. `'first.name'` or `'0'`), returns an array of column's values from the table data.
|
@@ -2911,7 +3002,7 @@ function Core(rootElement, userSettings) {
|
|
2911
3002
|
this.getDataAtProp = function (prop) {
|
2912
3003
|
var _ref14;
|
2913
3004
|
|
2914
|
-
var range = datamap.getRange(
|
3005
|
+
var range = datamap.getRange(instance._createCellCoords(0, datamap.propToCol(prop)), instance._createCellCoords(tableMeta.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER);
|
2915
3006
|
return (_ref14 = []).concat.apply(_ref14, _toConsumableArray(range));
|
2916
3007
|
};
|
2917
3008
|
/**
|
@@ -2938,7 +3029,7 @@ function Core(rootElement, userSettings) {
|
|
2938
3029
|
if (row === void 0) {
|
2939
3030
|
data = dataSource.getData();
|
2940
3031
|
} else {
|
2941
|
-
data = dataSource.getByRange(
|
3032
|
+
data = dataSource.getByRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2));
|
2942
3033
|
}
|
2943
3034
|
|
2944
3035
|
return data;
|
@@ -2967,7 +3058,7 @@ function Core(rootElement, userSettings) {
|
|
2967
3058
|
if (row === void 0) {
|
2968
3059
|
data = dataSource.getData(true);
|
2969
3060
|
} else {
|
2970
|
-
data = dataSource.getByRange(
|
3061
|
+
data = dataSource.getByRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2), true);
|
2971
3062
|
}
|
2972
3063
|
|
2973
3064
|
return data;
|
@@ -3084,7 +3175,7 @@ function Core(rootElement, userSettings) {
|
|
3084
3175
|
|
3085
3176
|
|
3086
3177
|
this.getDataAtRow = function (row) {
|
3087
|
-
var data = datamap.getRange(
|
3178
|
+
var data = datamap.getRange(instance._createCellCoords(row, 0), instance._createCellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);
|
3088
3179
|
return data[0] || [];
|
3089
3180
|
};
|
3090
3181
|
/**
|
@@ -3847,7 +3938,8 @@ function Core(rootElement, userSettings) {
|
|
3847
3938
|
return Math.min(maxCols, dataLen);
|
3848
3939
|
};
|
3849
3940
|
/**
|
3850
|
-
* Returns the number of rendered rows
|
3941
|
+
* Returns the number of rendered rows including rows that are partially or fully rendered
|
3942
|
+
* outside the table viewport.
|
3851
3943
|
*
|
3852
3944
|
* @memberof Core#
|
3853
3945
|
* @function countRenderedRows
|
@@ -3856,10 +3948,11 @@ function Core(rootElement, userSettings) {
|
|
3856
3948
|
|
3857
3949
|
|
3858
3950
|
this.countRenderedRows = function () {
|
3859
|
-
return instance.view.
|
3951
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getRenderedRowsCount() : -1;
|
3860
3952
|
};
|
3861
3953
|
/**
|
3862
|
-
* Returns the number of
|
3954
|
+
* Returns the number of rendered rows that are only visible in the table viewport.
|
3955
|
+
* The rows that are partially visible are not counted.
|
3863
3956
|
*
|
3864
3957
|
* @memberof Core#
|
3865
3958
|
* @function countVisibleRows
|
@@ -3868,10 +3961,11 @@ function Core(rootElement, userSettings) {
|
|
3868
3961
|
|
3869
3962
|
|
3870
3963
|
this.countVisibleRows = function () {
|
3871
|
-
return instance.view.
|
3964
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleRowsCount() : -1;
|
3872
3965
|
};
|
3873
3966
|
/**
|
3874
|
-
* Returns the number of rendered
|
3967
|
+
* Returns the number of rendered rows including columns that are partially or fully rendered
|
3968
|
+
* outside the table viewport.
|
3875
3969
|
*
|
3876
3970
|
* @memberof Core#
|
3877
3971
|
* @function countRenderedCols
|
@@ -3880,10 +3974,11 @@ function Core(rootElement, userSettings) {
|
|
3880
3974
|
|
3881
3975
|
|
3882
3976
|
this.countRenderedCols = function () {
|
3883
|
-
return instance.view.
|
3977
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getRenderedColumnsCount() : -1;
|
3884
3978
|
};
|
3885
3979
|
/**
|
3886
|
-
* Returns the number of
|
3980
|
+
* Returns the number of rendered columns that are only visible in the table viewport.
|
3981
|
+
* The columns that are partially visible are not counted.
|
3887
3982
|
*
|
3888
3983
|
* @memberof Core#
|
3889
3984
|
* @function countVisibleCols
|
@@ -3892,7 +3987,7 @@ function Core(rootElement, userSettings) {
|
|
3892
3987
|
|
3893
3988
|
|
3894
3989
|
this.countVisibleCols = function () {
|
3895
|
-
return instance.view.
|
3990
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3896
3991
|
};
|
3897
3992
|
/**
|
3898
3993
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
@@ -4154,7 +4249,7 @@ function Core(rootElement, userSettings) {
|
|
4154
4249
|
|
4155
4250
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
4156
4251
|
// Looking for a visual index on the right and then (when not found) on the left.
|
4157
|
-
return indexMapper.
|
4252
|
+
return indexMapper.getNearestNotHiddenIndex(visualIndex, 1, true);
|
4158
4253
|
};
|
4159
4254
|
/**
|
4160
4255
|
* Scroll viewport to coordinates specified by the `row` and `column` arguments.
|
@@ -4165,8 +4260,10 @@ function Core(rootElement, userSettings) {
|
|
4165
4260
|
* we are using the index for numbering only this rows which may be rendered (we don't consider hidden rows).
|
4166
4261
|
* @param {number} [column] Column index. If the last argument isn't defined we treat the index as a visual column index.
|
4167
4262
|
* Otherwise, we are using the index for numbering only this columns which may be rendered (we don't consider hidden columns).
|
4168
|
-
* @param {boolean} [snapToBottom=false] If `true`, viewport is scrolled to show the cell
|
4169
|
-
*
|
4263
|
+
* @param {boolean} [snapToBottom=false] If `true`, the viewport is scrolled to show the cell at the bottom of the table.
|
4264
|
+
* However, if the cell's height is greater than the table's viewport height, the cell is snapped to the top edge.
|
4265
|
+
* @param {boolean} [snapToRight=false] If `true`, the viewport is scrolled to show the cell at the right side of the table.
|
4266
|
+
* However, if the cell is wider than the table's viewport width, the cell is snapped to the left edge (or to the right edge, if the layout direction is set to `rtl`).
|
4170
4267
|
* @param {boolean} [considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which
|
4171
4268
|
* may be rendered when they are in the viewport (we don't consider hidden indexes as they aren't rendered).
|
4172
4269
|
* @returns {boolean} `true` if scroll was successful, `false` otherwise.
|
@@ -4202,7 +4299,7 @@ function Core(rootElement, userSettings) {
|
|
4202
4299
|
var isColumnInteger = Number.isInteger(renderableColumn);
|
4203
4300
|
|
4204
4301
|
if (isRowInteger && isColumnInteger) {
|
4205
|
-
return instance.view.scrollViewport(
|
4302
|
+
return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop, snapToRight, snapToBottom, snapToLeft);
|
4206
4303
|
}
|
4207
4304
|
|
4208
4305
|
if (isRowInteger && isColumnInteger === false) {
|
@@ -4239,8 +4336,8 @@ function Core(rootElement, userSettings) {
|
|
4239
4336
|
}
|
4240
4337
|
|
4241
4338
|
dataSource = null;
|
4339
|
+
this.getShortcutManager().destroy();
|
4242
4340
|
metaManager.clearCache();
|
4243
|
-
(0, _keyStateObserver.stopObserving)();
|
4244
4341
|
|
4245
4342
|
if ((0, _rootInstance.isRootInstance)(instance)) {
|
4246
4343
|
var licenseInfo = this.rootDocument.querySelector('#hot-display-license-info');
|
@@ -4410,7 +4507,7 @@ function Core(rootElement, userSettings) {
|
|
4410
4507
|
|
4411
4508
|
|
4412
4509
|
this.hasHook = function (key) {
|
4413
|
-
return _pluginHooks.default.getSingleton().has(key, instance);
|
4510
|
+
return _pluginHooks.default.getSingleton().has(key, instance) || _pluginHooks.default.getSingleton().has(key);
|
4414
4511
|
};
|
4415
4512
|
/**
|
4416
4513
|
* Adds listener to specified hook name (only for this Handsontable instance). After the listener is triggered,
|
@@ -4638,6 +4735,337 @@ function Core(rootElement, userSettings) {
|
|
4638
4735
|
return instance.isLtr() ? 1 : -1;
|
4639
4736
|
};
|
4640
4737
|
|
4738
|
+
var shortcutManager = (0, _shortcuts.createShortcutManager)({
|
4739
|
+
handleEvent: function handleEvent(event) {
|
4740
|
+
var isListening = instance.isListening();
|
4741
|
+
var isKeyboardEventWithKey = (event === null || event === void 0 ? void 0 : event.key) !== void 0;
|
4742
|
+
return isListening && isKeyboardEventWithKey;
|
4743
|
+
},
|
4744
|
+
beforeKeyDown: function beforeKeyDown(event) {
|
4745
|
+
return _this.runHooks('beforeKeyDown', event);
|
4746
|
+
},
|
4747
|
+
afterKeyDown: function afterKeyDown(event) {
|
4748
|
+
if (_this.isDestroyed) {
|
4749
|
+
// Handsontable could be destroyed after performing action (executing a callback).
|
4750
|
+
return;
|
4751
|
+
}
|
4752
|
+
|
4753
|
+
instance.runHooks('afterDocumentKeyDown', event);
|
4754
|
+
},
|
4755
|
+
ownerWindow: this.rootWindow
|
4756
|
+
});
|
4757
|
+
/**
|
4758
|
+
* Returns instance of a manager responsible for handling shortcuts stored in some contexts. It run actions after
|
4759
|
+
* pressing key combination in active Handsontable instance.
|
4760
|
+
*
|
4761
|
+
* @memberof Core#
|
4762
|
+
* @since 12.0.0
|
4763
|
+
* @function getShortcutManager
|
4764
|
+
* @returns {ShortcutManager} Instance of {@link ShortcutManager}
|
4765
|
+
*/
|
4766
|
+
|
4767
|
+
this.getShortcutManager = function () {
|
4768
|
+
return shortcutManager;
|
4769
|
+
};
|
4770
|
+
|
4771
|
+
var gridContext = shortcutManager.addContext('grid');
|
4772
|
+
var gridConfig = {
|
4773
|
+
runOnlyIf: function runOnlyIf() {
|
4774
|
+
return (0, _mixed.isDefined)(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
|
4775
|
+
},
|
4776
|
+
group: SHORTCUTS_GROUP
|
4777
|
+
};
|
4778
|
+
shortcutManager.setActiveContextName('grid');
|
4779
|
+
gridContext.addShortcuts([{
|
4780
|
+
keys: [['Control/Meta', 'A']],
|
4781
|
+
callback: function callback() {
|
4782
|
+
instance.selectAll();
|
4783
|
+
}
|
4784
|
+
}, {
|
4785
|
+
keys: [['Control/Meta', 'Enter']],
|
4786
|
+
callback: function callback() {
|
4787
|
+
var selectedRange = instance.getSelectedRange();
|
4788
|
+
var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
|
4789
|
+
highlightRow = _selectedRange$highli.row,
|
4790
|
+
highlightColumn = _selectedRange$highli.col;
|
4791
|
+
var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4792
|
+
var cellValues = new Map();
|
4793
|
+
|
4794
|
+
for (var i = 0; i < selectedRange.length; i++) {
|
4795
|
+
selectedRange[i].forAll(function (row, column) {
|
4796
|
+
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4797
|
+
var _instance$getCellMeta = instance.getCellMeta(row, column),
|
4798
|
+
readOnly = _instance$getCellMeta.readOnly;
|
4799
|
+
|
4800
|
+
if (!readOnly) {
|
4801
|
+
cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
|
4802
|
+
}
|
4803
|
+
}
|
4804
|
+
});
|
4805
|
+
}
|
4806
|
+
|
4807
|
+
instance.setDataAtCell(Array.from(cellValues.values()));
|
4808
|
+
},
|
4809
|
+
runOnlyIf: function runOnlyIf() {
|
4810
|
+
return instance.getSelectedRangeLast().getCellsCount() > 1;
|
4811
|
+
}
|
4812
|
+
}, {
|
4813
|
+
keys: [['ArrowUp']],
|
4814
|
+
callback: function callback() {
|
4815
|
+
selection.transformStart(-1, 0);
|
4816
|
+
}
|
4817
|
+
}, {
|
4818
|
+
keys: [['ArrowUp', 'Control/Meta']],
|
4819
|
+
captureCtrl: true,
|
4820
|
+
callback: function callback() {
|
4821
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4822
|
+
}
|
4823
|
+
}, {
|
4824
|
+
keys: [['ArrowUp', 'Shift']],
|
4825
|
+
callback: function callback() {
|
4826
|
+
selection.transformEnd(-1, 0);
|
4827
|
+
}
|
4828
|
+
}, {
|
4829
|
+
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4830
|
+
captureCtrl: true,
|
4831
|
+
callback: function callback() {
|
4832
|
+
var _instance$getSelected = instance.getSelectedRangeLast(),
|
4833
|
+
from = _instance$getSelected.from,
|
4834
|
+
to = _instance$getSelected.to;
|
4835
|
+
|
4836
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
4837
|
+
selection.setRangeStart(from.clone());
|
4838
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4839
|
+
},
|
4840
|
+
runOnlyIf: function runOnlyIf() {
|
4841
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4842
|
+
}
|
4843
|
+
}, {
|
4844
|
+
keys: [['ArrowDown']],
|
4845
|
+
callback: function callback() {
|
4846
|
+
selection.transformStart(1, 0);
|
4847
|
+
}
|
4848
|
+
}, {
|
4849
|
+
keys: [['ArrowDown', 'Control/Meta']],
|
4850
|
+
captureCtrl: true,
|
4851
|
+
callback: function callback() {
|
4852
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4853
|
+
}
|
4854
|
+
}, {
|
4855
|
+
keys: [['ArrowDown', 'Shift']],
|
4856
|
+
callback: function callback() {
|
4857
|
+
selection.transformEnd(1, 0);
|
4858
|
+
}
|
4859
|
+
}, {
|
4860
|
+
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4861
|
+
captureCtrl: true,
|
4862
|
+
callback: function callback() {
|
4863
|
+
var _instance$getSelected2 = instance.getSelectedRangeLast(),
|
4864
|
+
from = _instance$getSelected2.from,
|
4865
|
+
to = _instance$getSelected2.to;
|
4866
|
+
|
4867
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
|
4868
|
+
selection.setRangeStart(from.clone());
|
4869
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4870
|
+
},
|
4871
|
+
runOnlyIf: function runOnlyIf() {
|
4872
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4873
|
+
}
|
4874
|
+
}, {
|
4875
|
+
keys: [['ArrowLeft']],
|
4876
|
+
callback: function callback() {
|
4877
|
+
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4878
|
+
}
|
4879
|
+
}, {
|
4880
|
+
keys: [['ArrowLeft', 'Control/Meta']],
|
4881
|
+
captureCtrl: true,
|
4882
|
+
callback: function callback() {
|
4883
|
+
var _instance$columnIndex;
|
4884
|
+
|
4885
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4886
|
+
|
4887
|
+
var column = (_instance$columnIndex = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4888
|
+
|
4889
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4890
|
+
}
|
4891
|
+
}, {
|
4892
|
+
keys: [['ArrowLeft', 'Shift']],
|
4893
|
+
callback: function callback() {
|
4894
|
+
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4895
|
+
}
|
4896
|
+
}, {
|
4897
|
+
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4898
|
+
captureCtrl: true,
|
4899
|
+
callback: function callback() {
|
4900
|
+
var _instance$columnIndex2;
|
4901
|
+
|
4902
|
+
var _instance$getSelected3 = instance.getSelectedRangeLast(),
|
4903
|
+
from = _instance$getSelected3.from,
|
4904
|
+
to = _instance$getSelected3.to;
|
4905
|
+
|
4906
|
+
var column = (_instance$columnIndex2 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4907
|
+
|
4908
|
+
selection.setRangeStart(from.clone());
|
4909
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4910
|
+
},
|
4911
|
+
runOnlyIf: function runOnlyIf() {
|
4912
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4913
|
+
}
|
4914
|
+
}, {
|
4915
|
+
keys: [['ArrowRight']],
|
4916
|
+
callback: function callback() {
|
4917
|
+
selection.transformStart(0, instance.getDirectionFactor());
|
4918
|
+
}
|
4919
|
+
}, {
|
4920
|
+
keys: [['ArrowRight', 'Control/Meta']],
|
4921
|
+
captureCtrl: true,
|
4922
|
+
callback: function callback() {
|
4923
|
+
var _instance$columnIndex3;
|
4924
|
+
|
4925
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4926
|
+
|
4927
|
+
var column = (_instance$columnIndex3 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4928
|
+
|
4929
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4930
|
+
}
|
4931
|
+
}, {
|
4932
|
+
keys: [['ArrowRight', 'Shift']],
|
4933
|
+
callback: function callback() {
|
4934
|
+
selection.transformEnd(0, instance.getDirectionFactor());
|
4935
|
+
}
|
4936
|
+
}, {
|
4937
|
+
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4938
|
+
captureCtrl: true,
|
4939
|
+
callback: function callback() {
|
4940
|
+
var _instance$columnIndex4;
|
4941
|
+
|
4942
|
+
var _instance$getSelected4 = instance.getSelectedRangeLast(),
|
4943
|
+
from = _instance$getSelected4.from,
|
4944
|
+
to = _instance$getSelected4.to;
|
4945
|
+
|
4946
|
+
var column = (_instance$columnIndex4 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4947
|
+
|
4948
|
+
selection.setRangeStart(from.clone());
|
4949
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4950
|
+
},
|
4951
|
+
runOnlyIf: function runOnlyIf() {
|
4952
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4953
|
+
}
|
4954
|
+
}, {
|
4955
|
+
keys: [['Home']],
|
4956
|
+
captureCtrl: true,
|
4957
|
+
callback: function callback() {
|
4958
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4959
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4960
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4961
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4962
|
+
},
|
4963
|
+
runOnlyIf: function runOnlyIf() {
|
4964
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4965
|
+
}
|
4966
|
+
}, {
|
4967
|
+
keys: [['Home', 'Shift']],
|
4968
|
+
callback: function callback() {
|
4969
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
4970
|
+
}
|
4971
|
+
}, {
|
4972
|
+
keys: [['Home', 'Control/Meta']],
|
4973
|
+
captureCtrl: true,
|
4974
|
+
callback: function callback() {
|
4975
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4976
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4977
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
|
4978
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4979
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4980
|
+
},
|
4981
|
+
runOnlyIf: function runOnlyIf() {
|
4982
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4983
|
+
}
|
4984
|
+
}, {
|
4985
|
+
keys: [['End']],
|
4986
|
+
captureCtrl: true,
|
4987
|
+
callback: function callback() {
|
4988
|
+
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4989
|
+
},
|
4990
|
+
runOnlyIf: function runOnlyIf() {
|
4991
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4992
|
+
}
|
4993
|
+
}, {
|
4994
|
+
keys: [['End', 'Shift']],
|
4995
|
+
callback: function callback() {
|
4996
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4997
|
+
}
|
4998
|
+
}, {
|
4999
|
+
keys: [['End', 'Control/Meta']],
|
5000
|
+
captureCtrl: true,
|
5001
|
+
callback: function callback() {
|
5002
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
5003
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
5004
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
|
5005
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
5006
|
+
},
|
5007
|
+
runOnlyIf: function runOnlyIf() {
|
5008
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
5009
|
+
}
|
5010
|
+
}, {
|
5011
|
+
keys: [['PageUp']],
|
5012
|
+
callback: function callback() {
|
5013
|
+
selection.transformStart(-instance.countVisibleRows(), 0);
|
5014
|
+
}
|
5015
|
+
}, {
|
5016
|
+
keys: [['PageUp', 'Shift']],
|
5017
|
+
callback: function callback() {
|
5018
|
+
var _instance$getSelected5 = instance.getSelectedRangeLast(),
|
5019
|
+
to = _instance$getSelected5.to;
|
5020
|
+
|
5021
|
+
var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
5022
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
|
5023
|
+
|
5024
|
+
if (row !== null) {
|
5025
|
+
var coords = instance._createCellCoords(row, to.col);
|
5026
|
+
|
5027
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
5028
|
+
var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
5029
|
+
selection.setRangeEnd(coords);
|
5030
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
5031
|
+
}
|
5032
|
+
}
|
5033
|
+
}, {
|
5034
|
+
keys: [['PageDown']],
|
5035
|
+
callback: function callback() {
|
5036
|
+
selection.transformStart(instance.countVisibleRows(), 0);
|
5037
|
+
}
|
5038
|
+
}, {
|
5039
|
+
keys: [['PageDown', 'Shift']],
|
5040
|
+
callback: function callback() {
|
5041
|
+
var _instance$getSelected6 = instance.getSelectedRangeLast(),
|
5042
|
+
to = _instance$getSelected6.to;
|
5043
|
+
|
5044
|
+
var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
5045
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
|
5046
|
+
|
5047
|
+
if (row !== null) {
|
5048
|
+
var coords = instance._createCellCoords(row, to.col);
|
5049
|
+
|
5050
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
5051
|
+
var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
5052
|
+
selection.setRangeEnd(coords);
|
5053
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
5054
|
+
}
|
5055
|
+
}
|
5056
|
+
}, {
|
5057
|
+
keys: [['Tab']],
|
5058
|
+
callback: function callback(event) {
|
5059
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
5060
|
+
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
5061
|
+
}
|
5062
|
+
}, {
|
5063
|
+
keys: [['Shift', 'Tab']],
|
5064
|
+
callback: function callback(event) {
|
5065
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
5066
|
+
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
5067
|
+
}
|
5068
|
+
}], gridConfig);
|
4641
5069
|
(0, _registry.getPluginsNames)().forEach(function (pluginName) {
|
4642
5070
|
var PluginClass = (0, _registry.getPlugin)(pluginName);
|
4643
5071
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|