handsontable 11.1.0 → 12.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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.mjs
CHANGED
@@ -8,6 +8,19 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
8
8
|
|
9
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
10
10
|
|
11
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
12
|
+
|
13
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
14
|
+
|
15
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
16
|
+
|
17
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
18
|
+
|
19
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
20
|
+
|
21
|
+
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; }
|
22
|
+
|
23
|
+
import "core-js/modules/es.array.includes.js";
|
11
24
|
import "core-js/modules/es.array.sort.js";
|
12
25
|
import "core-js/modules/es.array.splice.js";
|
13
26
|
import "core-js/modules/es.number.is-integer.js";
|
@@ -26,25 +39,13 @@ import "core-js/modules/es.object.to-string.js";
|
|
26
39
|
import "core-js/modules/web.dom-collections.for-each.js";
|
27
40
|
import "core-js/modules/web.timers.js";
|
28
41
|
import "core-js/modules/web.immediate.js";
|
42
|
+
import "core-js/modules/es.array.iterator.js";
|
43
|
+
import "core-js/modules/es.map.js";
|
44
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
29
45
|
import "core-js/modules/es.symbol.js";
|
30
46
|
import "core-js/modules/es.symbol.description.js";
|
31
47
|
import "core-js/modules/es.symbol.iterator.js";
|
32
|
-
import "core-js/modules/es.array.iterator.js";
|
33
|
-
import "core-js/modules/web.dom-collections.iterator.js";
|
34
48
|
import "core-js/modules/es.function.name.js";
|
35
|
-
|
36
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
37
|
-
|
38
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
39
|
-
|
40
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
41
|
-
|
42
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
43
|
-
|
44
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
45
|
-
|
46
|
-
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; }
|
47
|
-
|
48
49
|
import { addClass, empty, removeClass } from "./helpers/dom/element.mjs";
|
49
50
|
import { isFunction } from "./helpers/function.mjs";
|
50
51
|
import { isDefined, isUndefined, isRegExp, _injectProductInfo, isEmpty } from "./helpers/mixed.mjs";
|
@@ -64,14 +65,15 @@ import DataSource from "./dataSource.mjs";
|
|
64
65
|
import { cellMethodLookupFactory, spreadsheetColumnLabel } from "./helpers/data.mjs";
|
65
66
|
import { IndexMapper } from "./translations/index.mjs";
|
66
67
|
import { registerAsRootInstance, hasValidParameter, isRootInstance } from "./utils/rootInstance.mjs";
|
67
|
-
import {
|
68
|
+
import { ViewportColumnsCalculator } from "./3rdparty/walkontable/src/index.mjs";
|
68
69
|
import Hooks from "./pluginHooks.mjs";
|
69
70
|
import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from "./i18n/registry.mjs";
|
70
71
|
import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
|
71
|
-
import { startObserving as keyStateStartObserving, stopObserving as keyStateStopObserving } from "./utils/keyStateObserver.mjs";
|
72
72
|
import { Selection } from "./selection/index.mjs";
|
73
|
-
import { MetaManager, DynamicCellMetaMod, replaceData } from "./dataMap/index.mjs";
|
73
|
+
import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
|
74
74
|
import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
75
|
+
import { createShortcutManager } from "./shortcuts/index.mjs";
|
76
|
+
var SHORTCUTS_GROUP = 'gridDefault';
|
75
77
|
var activeGuid = null;
|
76
78
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
77
79
|
|
@@ -100,7 +102,8 @@ var activeGuid = null;
|
|
100
102
|
*/
|
101
103
|
|
102
104
|
export default function Core(rootElement, userSettings) {
|
103
|
-
var
|
105
|
+
var _userSettings$layoutD,
|
106
|
+
_this = this;
|
104
107
|
|
105
108
|
var rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
106
109
|
var preventScrollingToCell = false;
|
@@ -111,11 +114,6 @@ export default function Core(rootElement, userSettings) {
|
|
111
114
|
var grid;
|
112
115
|
var editorManager;
|
113
116
|
var firstRun = true;
|
114
|
-
userSettings.language = getValidLanguageCode(userSettings.language);
|
115
|
-
var metaManager = new MetaManager(instance, userSettings, [DynamicCellMetaMod]);
|
116
|
-
var tableMeta = metaManager.getTableMeta();
|
117
|
-
var globalMeta = metaManager.getGlobalMeta();
|
118
|
-
var pluginsRegistry = createUniqueMap();
|
119
117
|
|
120
118
|
if (hasValidParameter(rootInstanceSymbol)) {
|
121
119
|
registerAsRootInstance(this);
|
@@ -178,7 +176,53 @@ export default function Core(rootElement, userSettings) {
|
|
178
176
|
*/
|
179
177
|
|
180
178
|
this.executionSuspendedCounter = 0;
|
181
|
-
|
179
|
+
var layoutDirection = (_userSettings$layoutD = userSettings === null || userSettings === void 0 ? void 0 : userSettings.layoutDirection) !== null && _userSettings$layoutD !== void 0 ? _userSettings$layoutD : 'inherit';
|
180
|
+
var rootElementDirection = ['rtl', 'ltr'].includes(layoutDirection) ? layoutDirection : this.rootWindow.getComputedStyle(this.rootElement).direction;
|
181
|
+
this.rootElement.setAttribute('dir', rootElementDirection);
|
182
|
+
/**
|
183
|
+
* Checks if the grid is rendered using the right-to-left layout direction.
|
184
|
+
*
|
185
|
+
* @since 12.0.0
|
186
|
+
* @memberof Core#
|
187
|
+
* @function isRtl
|
188
|
+
* @returns {boolean} True if RTL.
|
189
|
+
*/
|
190
|
+
|
191
|
+
this.isRtl = function () {
|
192
|
+
return rootElementDirection === 'rtl';
|
193
|
+
};
|
194
|
+
/**
|
195
|
+
* Checks if the grid is rendered using the left-to-right layout direction.
|
196
|
+
*
|
197
|
+
* @since 12.0.0
|
198
|
+
* @memberof Core#
|
199
|
+
* @function isLtr
|
200
|
+
* @returns {boolean} True if LTR.
|
201
|
+
*/
|
202
|
+
|
203
|
+
|
204
|
+
this.isLtr = function () {
|
205
|
+
return !instance.isRtl();
|
206
|
+
};
|
207
|
+
/**
|
208
|
+
* Returns 1 for LTR; -1 for RTL. Useful for calculations.
|
209
|
+
*
|
210
|
+
* @since 12.0.0
|
211
|
+
* @memberof Core#
|
212
|
+
* @function getDirectionFactor
|
213
|
+
* @returns {number} Returns 1 for LTR; -1 for RTL.
|
214
|
+
*/
|
215
|
+
|
216
|
+
|
217
|
+
this.getDirectionFactor = function () {
|
218
|
+
return instance.isLtr() ? 1 : -1;
|
219
|
+
};
|
220
|
+
|
221
|
+
userSettings.language = getValidLanguageCode(userSettings.language);
|
222
|
+
var metaManager = new MetaManager(instance, userSettings, [DynamicCellMetaMod, ExtendMetaPropertiesMod]);
|
223
|
+
var tableMeta = metaManager.getTableMeta();
|
224
|
+
var globalMeta = metaManager.getGlobalMeta();
|
225
|
+
var pluginsRegistry = createUniqueMap();
|
182
226
|
this.container = this.rootDocument.createElement('div');
|
183
227
|
this.renderCall = false;
|
184
228
|
rootElement.insertBefore(this.container, rootElement.firstChild);
|
@@ -216,19 +260,25 @@ export default function Core(rootElement, userSettings) {
|
|
216
260
|
var visualToRenderableCoords = function visualToRenderableCoords(coords) {
|
217
261
|
var visualRow = coords.row,
|
218
262
|
visualColumn = coords.col;
|
219
|
-
return
|
263
|
+
return instance._createCellCoords( // We just store indexes for rows and columns without headers.
|
220
264
|
visualRow >= 0 ? instance.rowIndexMapper.getRenderableFromVisualIndex(visualRow) : visualRow, visualColumn >= 0 ? instance.columnIndexMapper.getRenderableFromVisualIndex(visualColumn) : visualColumn);
|
221
265
|
};
|
222
266
|
|
223
267
|
var renderableToVisualCoords = function renderableToVisualCoords(coords) {
|
224
268
|
var renderableRow = coords.row,
|
225
269
|
renderableColumn = coords.col;
|
226
|
-
return
|
270
|
+
return instance._createCellCoords( // We just store indexes for rows and columns without headers.
|
227
271
|
renderableRow >= 0 ? instance.rowIndexMapper.getVisualFromRenderableIndex(renderableRow) : renderableRow, renderableColumn >= 0 ? instance.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn) : renderableColumn // eslint-disable-line max-len
|
228
272
|
);
|
229
273
|
};
|
230
274
|
|
231
275
|
var selection = new Selection(tableMeta, {
|
276
|
+
rowIndexMapper: function rowIndexMapper() {
|
277
|
+
return instance.rowIndexMapper;
|
278
|
+
},
|
279
|
+
columnIndexMapper: function columnIndexMapper() {
|
280
|
+
return instance.columnIndexMapper;
|
281
|
+
},
|
232
282
|
countCols: function countCols() {
|
233
283
|
return instance.countCols();
|
234
284
|
},
|
@@ -247,6 +297,15 @@ export default function Core(rootElement, userSettings) {
|
|
247
297
|
countRowsTranslated: function countRowsTranslated() {
|
248
298
|
return _this.view.countRenderableRows();
|
249
299
|
},
|
300
|
+
getShortcutManager: function getShortcutManager() {
|
301
|
+
return instance.getShortcutManager();
|
302
|
+
},
|
303
|
+
createCellCoords: function createCellCoords(row, column) {
|
304
|
+
return instance._createCellCoords(row, column);
|
305
|
+
},
|
306
|
+
createCellRange: function createCellRange(highlight, from, to) {
|
307
|
+
return instance._createCellRange(highlight, from, to);
|
308
|
+
},
|
250
309
|
visualToRenderableCoords: visualToRenderableCoords,
|
251
310
|
renderableToVisualCoords: renderableToVisualCoords,
|
252
311
|
isDisabledCellSelection: function isDisabledCellSelection(visualRow, visualColumn) {
|
@@ -275,11 +334,11 @@ export default function Core(rootElement, userSettings) {
|
|
275
334
|
_this.runHooks('beforeSetRangeEnd', cellCoords);
|
276
335
|
|
277
336
|
if (cellCoords.row < 0) {
|
278
|
-
cellCoords.row = _this.view.
|
337
|
+
cellCoords.row = _this.view._wt.wtTable.getFirstVisibleRow();
|
279
338
|
}
|
280
339
|
|
281
340
|
if (cellCoords.col < 0) {
|
282
|
-
cellCoords.col = _this.view.
|
341
|
+
cellCoords.col = _this.view._wt.wtTable.getFirstVisibleColumn();
|
283
342
|
}
|
284
343
|
});
|
285
344
|
this.selection.addLocalHook('afterSetRangeEnd', function (cellCoords) {
|
@@ -493,8 +552,8 @@ export default function Core(rootElement, userSettings) {
|
|
493
552
|
|
494
553
|
selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.
|
495
554
|
|
496
|
-
selection.setRangeStartOnly(
|
497
|
-
selection.setRangeEnd(
|
555
|
+
selection.setRangeStartOnly(instance._createCellCoords(currentFromRow + delta, currentFromColumn), true);
|
556
|
+
selection.setRangeEnd(instance._createCellCoords(currentToRow + delta, currentToColumn)); // will call render() internally
|
498
557
|
} else {
|
499
558
|
instance._refreshBorders(); // it will call render and prepare methods
|
500
559
|
|
@@ -538,8 +597,8 @@ export default function Core(rootElement, userSettings) {
|
|
538
597
|
|
539
598
|
selection.getSelectedRange().pop(); // I can't use transforms as they don't work in negative indexes.
|
540
599
|
|
541
|
-
selection.setRangeStartOnly(
|
542
|
-
selection.setRangeEnd(
|
600
|
+
selection.setRangeStartOnly(instance._createCellCoords(_currentFromRow, _currentFromColumn + delta), true);
|
601
|
+
selection.setRangeEnd(instance._createCellCoords(_currentToRow, _currentToColumn + delta)); // will call render() internally
|
543
602
|
} else {
|
544
603
|
instance._refreshBorders(); // it will call render and prepare methods
|
545
604
|
|
@@ -631,10 +690,10 @@ export default function Core(rootElement, userSettings) {
|
|
631
690
|
}
|
632
691
|
|
633
692
|
metaManager.removeColumn(physicalColumnIndex, groupAmount);
|
634
|
-
var
|
693
|
+
var fixedColumnsStart = tableMeta.fixedColumnsStart;
|
635
694
|
|
636
|
-
if (
|
637
|
-
tableMeta.
|
695
|
+
if (fixedColumnsStart >= calcIndex + 1) {
|
696
|
+
tableMeta.fixedColumnsStart -= Math.min(groupAmount, fixedColumnsStart - calcIndex);
|
638
697
|
}
|
639
698
|
|
640
699
|
if (Array.isArray(tableMeta.colHeaders)) {
|
@@ -1342,6 +1401,38 @@ export default function Core(rootElement, userSettings) {
|
|
1342
1401
|
activeEditor.refreshValue();
|
1343
1402
|
}
|
1344
1403
|
}
|
1404
|
+
/**
|
1405
|
+
* Creates and returns the CellCoords object.
|
1406
|
+
*
|
1407
|
+
* @private
|
1408
|
+
* @memberof Core#
|
1409
|
+
* @function _createCellCoords
|
1410
|
+
* @param {number} row The row index.
|
1411
|
+
* @param {number} column The column index.
|
1412
|
+
* @returns {CellCoords}
|
1413
|
+
*/
|
1414
|
+
|
1415
|
+
|
1416
|
+
this._createCellCoords = function (row, column) {
|
1417
|
+
return instance.view._wt.createCellCoords(row, column);
|
1418
|
+
};
|
1419
|
+
/**
|
1420
|
+
* Creates and returns the CellRange object.
|
1421
|
+
*
|
1422
|
+
* @private
|
1423
|
+
* @memberof Core#
|
1424
|
+
* @function _createCellRange
|
1425
|
+
* @param {CellCoords} highlight Defines the border around a cell where selection was started and to edit the cell
|
1426
|
+
* when you press Enter. The highlight cannot point to headers (negative values).
|
1427
|
+
* @param {CellCoords} from Initial coordinates.
|
1428
|
+
* @param {CellCoords} to Final coordinates.
|
1429
|
+
* @returns {CellRange}
|
1430
|
+
*/
|
1431
|
+
|
1432
|
+
|
1433
|
+
this._createCellRange = function (highlight, from, to) {
|
1434
|
+
return instance.view._wt.createCellRange(highlight, from, to);
|
1435
|
+
};
|
1345
1436
|
/**
|
1346
1437
|
* Validate a single cell.
|
1347
1438
|
*
|
@@ -1380,7 +1471,8 @@ export default function Core(rootElement, userSettings) {
|
|
1380
1471
|
if (td && td.nodeName !== 'TH') {
|
1381
1472
|
var renderableRow = instance.rowIndexMapper.getRenderableFromVisualIndex(row);
|
1382
1473
|
var renderableColumn = instance.columnIndexMapper.getRenderableFromVisualIndex(col);
|
1383
|
-
|
1474
|
+
|
1475
|
+
instance.view._wt.getSetting('cellRenderer', renderableRow, renderableColumn, td);
|
1384
1476
|
}
|
1385
1477
|
|
1386
1478
|
callback(valid);
|
@@ -1605,8 +1697,8 @@ export default function Core(rootElement, userSettings) {
|
|
1605
1697
|
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
|
1606
1698
|
}
|
1607
1699
|
|
1608
|
-
var c = typeof endRow === 'number' ?
|
1609
|
-
return grid.populateFromArray(
|
1700
|
+
var c = typeof endRow === 'number' ? instance._createCellCoords(endRow, endCol) : null;
|
1701
|
+
return grid.populateFromArray(instance._createCellCoords(row, column), input, c, source, method, direction, deltas);
|
1610
1702
|
};
|
1611
1703
|
/**
|
1612
1704
|
* Adds/removes data from the column. This method works the same as Array.splice for arrays.
|
@@ -1755,10 +1847,10 @@ export default function Core(rootElement, userSettings) {
|
|
1755
1847
|
|
1756
1848
|
var changes = [];
|
1757
1849
|
arrayEach(selection.getSelectedRange(), function (cellRange) {
|
1758
|
-
var
|
1759
|
-
var
|
1760
|
-
rangeEach(
|
1761
|
-
rangeEach(
|
1850
|
+
var topStart = cellRange.getTopStartCorner();
|
1851
|
+
var bottomEnd = cellRange.getBottomEndCorner();
|
1852
|
+
rangeEach(topStart.row, bottomEnd.row, function (row) {
|
1853
|
+
rangeEach(topStart.col, bottomEnd.col, function (column) {
|
1762
1854
|
if (!_this2.getCellMeta(row, column).readOnly) {
|
1763
1855
|
changes.push([row, column, null]);
|
1764
1856
|
}
|
@@ -2116,7 +2208,7 @@ export default function Core(rootElement, userSettings) {
|
|
2116
2208
|
return;
|
2117
2209
|
}
|
2118
2210
|
|
2119
|
-
if (isSizeChanged || instance.view.
|
2211
|
+
if (isSizeChanged || instance.view._wt.wtOverlays.scrollableElement === instance.rootWindow) {
|
2120
2212
|
instance.view.setLastSize(width, height);
|
2121
2213
|
instance.render();
|
2122
2214
|
}
|
@@ -2140,8 +2232,8 @@ export default function Core(rootElement, userSettings) {
|
|
2140
2232
|
* To replace Handsontable's [`data`](@/api/options.md#data) and reset states, use the [`loadData()`](#loaddata) method.
|
2141
2233
|
*
|
2142
2234
|
* Read more:
|
2143
|
-
* - [Binding to data
|
2144
|
-
* - [Saving data
|
2235
|
+
* - [Binding to data](@/guides/getting-started/binding-to-data.md)
|
2236
|
+
* - [Saving data](@/guides/getting-started/saving-data.md)
|
2145
2237
|
*
|
2146
2238
|
* @memberof Core#
|
2147
2239
|
* @function updateData
|
@@ -2184,8 +2276,8 @@ export default function Core(rootElement, userSettings) {
|
|
2184
2276
|
* To replace Handsontable's [`data`](@/api/options.md#data) without resetting states, use the [`updateData()`](#updatedata) method.
|
2185
2277
|
*
|
2186
2278
|
* Read more:
|
2187
|
-
* - [Binding to data
|
2188
|
-
* - [Saving data
|
2279
|
+
* - [Binding to data](@/guides/getting-started/binding-to-data.md)
|
2280
|
+
* - [Saving data](@/guides/getting-started/saving-data.md)
|
2189
2281
|
*
|
2190
2282
|
* @memberof Core#
|
2191
2283
|
* @function loadData
|
@@ -2299,7 +2391,7 @@ export default function Core(rootElement, userSettings) {
|
|
2299
2391
|
return datamap.getAll();
|
2300
2392
|
}
|
2301
2393
|
|
2302
|
-
return datamap.getRange(
|
2394
|
+
return datamap.getRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2), datamap.DESTINATION_RENDERER);
|
2303
2395
|
};
|
2304
2396
|
/**
|
2305
2397
|
* Returns a string value of the selected range. Each column is separated by tab, each row is separated by a new
|
@@ -2316,7 +2408,7 @@ export default function Core(rootElement, userSettings) {
|
|
2316
2408
|
|
2317
2409
|
|
2318
2410
|
this.getCopyableText = function (startRow, startCol, endRow, endCol) {
|
2319
|
-
return datamap.getCopyableText(
|
2411
|
+
return datamap.getCopyableText(instance._createCellCoords(startRow, startCol), instance._createCellCoords(endRow, endCol));
|
2320
2412
|
};
|
2321
2413
|
/**
|
2322
2414
|
* Returns the data's copyable value at specified `row` and `column` index.
|
@@ -2346,7 +2438,7 @@ export default function Core(rootElement, userSettings) {
|
|
2346
2438
|
return datamap.getSchema();
|
2347
2439
|
};
|
2348
2440
|
/**
|
2349
|
-
* Use it if you need to change configuration after initialization. The `settings` argument is an object containing the
|
2441
|
+
* Use it if you need to change configuration after initialization. The `settings` argument is an object containing the changed
|
2350
2442
|
* settings, declared the same way as in the initial settings object.
|
2351
2443
|
*
|
2352
2444
|
* __Note__, that although the `updateSettings` method doesn't overwrite the previously declared settings, it might reset
|
@@ -2355,9 +2447,12 @@ export default function Core(rootElement, userSettings) {
|
|
2355
2447
|
* Since 8.0.0 passing `columns` or `data` inside `settings` objects will result in resetting states corresponding to rows and columns
|
2356
2448
|
* (for example, row/column sequence, column width, row height, frozen columns etc.).
|
2357
2449
|
*
|
2450
|
+
* Since 12.0.0 passing `data` inside `settings` objects no longer results in resetting states corresponding to rows and columns
|
2451
|
+
* (for example, row/column sequence, column width, row height, frozen columns etc.).
|
2452
|
+
*
|
2358
2453
|
* @memberof Core#
|
2359
2454
|
* @function updateSettings
|
2360
|
-
* @param {object} settings
|
2455
|
+
* @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.
|
2361
2456
|
* @param {boolean} [init=false] Internally used for in initialization mode.
|
2362
2457
|
* @example
|
2363
2458
|
* ```js
|
@@ -2374,12 +2469,7 @@ export default function Core(rootElement, userSettings) {
|
|
2374
2469
|
|
2375
2470
|
this.updateSettings = function (settings) {
|
2376
2471
|
var init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
2377
|
-
|
2378
|
-
// Do not forget to re-enable the pending tests that cover the change:
|
2379
|
-
// * https://github.com/handsontable/handsontable/blob/9f62c282a1c951b27cd8406aa27105bd32b05bb6/handsontable/test/e2e/core/toPhysicalColumn.spec.js#L70
|
2380
|
-
// * https://github.com/handsontable/handsontable/blob/9f62c282a1c951b27cd8406aa27105bd32b05bb6/handsontable/test/e2e/core/toVisualColumn.spec.js#L70
|
2381
|
-
// const dataUpdateFunction = (firstRun ? instance.loadData : instance.updateData).bind(this);
|
2382
|
-
var dataUpdateFunction = instance.loadData.bind(this);
|
2472
|
+
var dataUpdateFunction = (firstRun ? instance.loadData : instance.updateData).bind(this);
|
2383
2473
|
var columnsAsFunc = false;
|
2384
2474
|
var i;
|
2385
2475
|
var j;
|
@@ -2398,19 +2488,15 @@ export default function Core(rootElement, userSettings) {
|
|
2398
2488
|
|
2399
2489
|
|
2400
2490
|
for (i in settings) {
|
2401
|
-
if (i === 'data') {
|
2402
|
-
/* eslint-disable-next-line no-continue */
|
2403
|
-
continue; // loadData will be triggered later
|
2491
|
+
if (i === 'data') {// Do nothing. loadData will be triggered later
|
2404
2492
|
} else if (i === 'language') {
|
2405
2493
|
setLanguage(settings.language);
|
2406
|
-
/* eslint-disable-next-line no-continue */
|
2407
|
-
|
2408
|
-
continue;
|
2409
2494
|
} else if (i === 'className') {
|
2410
2495
|
setClassName('className', settings.className);
|
2411
2496
|
} else if (i === 'tableClassName' && instance.table) {
|
2412
2497
|
setClassName('tableClassName', settings.tableClassName);
|
2413
|
-
|
2498
|
+
|
2499
|
+
instance.view._wt.wtOverlays.syncOverlayTableClassNames();
|
2414
2500
|
} else if (Hooks.getSingleton().isRegistered(i) || Hooks.getSingleton().isDeprecated(i)) {
|
2415
2501
|
if (isFunction(settings[i]) || Array.isArray(settings[i])) {
|
2416
2502
|
settings[i].initialHook = true;
|
@@ -2513,8 +2599,9 @@ export default function Core(rootElement, userSettings) {
|
|
2513
2599
|
|
2514
2600
|
if (!init) {
|
2515
2601
|
if (instance.view) {
|
2516
|
-
instance.view.
|
2517
|
-
|
2602
|
+
instance.view._wt.wtViewport.resetHasOversizedColumnHeadersMarked();
|
2603
|
+
|
2604
|
+
instance.view._wt.exportSettingsAsClassNames();
|
2518
2605
|
}
|
2519
2606
|
|
2520
2607
|
instance.runHooks('afterUpdateSettings', settings);
|
@@ -2529,12 +2616,13 @@ export default function Core(rootElement, userSettings) {
|
|
2529
2616
|
|
2530
2617
|
instance._refreshBorders(null);
|
2531
2618
|
|
2532
|
-
instance.view.
|
2619
|
+
instance.view._wt.wtOverlays.adjustElementsSize();
|
2620
|
+
|
2533
2621
|
editorManager.unlockEditor();
|
2534
2622
|
}
|
2535
2623
|
|
2536
2624
|
if (!init && instance.view && (currentHeight === '' || height === '' || height === void 0) && currentHeight !== height) {
|
2537
|
-
instance.view.
|
2625
|
+
instance.view._wt.wtOverlays.updateMainScrollableElements();
|
2538
2626
|
}
|
2539
2627
|
};
|
2540
2628
|
/**
|
@@ -2564,7 +2652,7 @@ export default function Core(rootElement, userSettings) {
|
|
2564
2652
|
*
|
2565
2653
|
* @memberof Core#
|
2566
2654
|
* @function getSettings
|
2567
|
-
* @returns {
|
2655
|
+
* @returns {TableMeta} Object containing the current table settings.
|
2568
2656
|
*/
|
2569
2657
|
|
2570
2658
|
|
@@ -2658,7 +2746,7 @@ export default function Core(rootElement, userSettings) {
|
|
2658
2746
|
return null;
|
2659
2747
|
}
|
2660
2748
|
|
2661
|
-
return instance.view.getCellAtCoords(
|
2749
|
+
return instance.view.getCellAtCoords(instance._createCellCoords(renderableRowIndex, renderableColumnIndex), topmost);
|
2662
2750
|
};
|
2663
2751
|
/**
|
2664
2752
|
* Returns the coordinates of the cell, provided as a HTML table cell element.
|
@@ -2676,7 +2764,7 @@ export default function Core(rootElement, userSettings) {
|
|
2676
2764
|
|
2677
2765
|
|
2678
2766
|
this.getCoords = function (element) {
|
2679
|
-
var renderableCoords = this.view.
|
2767
|
+
var renderableCoords = this.view._wt.wtTable.getCoords(element);
|
2680
2768
|
|
2681
2769
|
if (renderableCoords === null) {
|
2682
2770
|
return null;
|
@@ -2695,7 +2783,7 @@ export default function Core(rootElement, userSettings) {
|
|
2695
2783
|
visualColumn = this.columnIndexMapper.getVisualFromRenderableIndex(renderableColumn);
|
2696
2784
|
}
|
2697
2785
|
|
2698
|
-
return
|
2786
|
+
return instance._createCellCoords(visualRow, visualColumn);
|
2699
2787
|
};
|
2700
2788
|
/**
|
2701
2789
|
* Returns the property name that corresponds with the given column index.
|
@@ -2837,7 +2925,7 @@ export default function Core(rootElement, userSettings) {
|
|
2837
2925
|
this.getDataAtCol = function (column) {
|
2838
2926
|
var _ref13;
|
2839
2927
|
|
2840
|
-
return (_ref13 = []).concat.apply(_ref13, _toConsumableArray(datamap.getRange(
|
2928
|
+
return (_ref13 = []).concat.apply(_ref13, _toConsumableArray(datamap.getRange(instance._createCellCoords(0, column), instance._createCellCoords(tableMeta.data.length - 1, column), datamap.DESTINATION_RENDERER)));
|
2841
2929
|
};
|
2842
2930
|
/**
|
2843
2931
|
* Given the object property name (e.g. `'first.name'` or `'0'`), returns an array of column's values from the table data.
|
@@ -2854,7 +2942,7 @@ export default function Core(rootElement, userSettings) {
|
|
2854
2942
|
this.getDataAtProp = function (prop) {
|
2855
2943
|
var _ref14;
|
2856
2944
|
|
2857
|
-
var range = datamap.getRange(
|
2945
|
+
var range = datamap.getRange(instance._createCellCoords(0, datamap.propToCol(prop)), instance._createCellCoords(tableMeta.data.length - 1, datamap.propToCol(prop)), datamap.DESTINATION_RENDERER);
|
2858
2946
|
return (_ref14 = []).concat.apply(_ref14, _toConsumableArray(range));
|
2859
2947
|
};
|
2860
2948
|
/**
|
@@ -2881,7 +2969,7 @@ export default function Core(rootElement, userSettings) {
|
|
2881
2969
|
if (row === void 0) {
|
2882
2970
|
data = dataSource.getData();
|
2883
2971
|
} else {
|
2884
|
-
data = dataSource.getByRange(
|
2972
|
+
data = dataSource.getByRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2));
|
2885
2973
|
}
|
2886
2974
|
|
2887
2975
|
return data;
|
@@ -2910,7 +2998,7 @@ export default function Core(rootElement, userSettings) {
|
|
2910
2998
|
if (row === void 0) {
|
2911
2999
|
data = dataSource.getData(true);
|
2912
3000
|
} else {
|
2913
|
-
data = dataSource.getByRange(
|
3001
|
+
data = dataSource.getByRange(instance._createCellCoords(row, column), instance._createCellCoords(row2, column2), true);
|
2914
3002
|
}
|
2915
3003
|
|
2916
3004
|
return data;
|
@@ -3027,7 +3115,7 @@ export default function Core(rootElement, userSettings) {
|
|
3027
3115
|
|
3028
3116
|
|
3029
3117
|
this.getDataAtRow = function (row) {
|
3030
|
-
var data = datamap.getRange(
|
3118
|
+
var data = datamap.getRange(instance._createCellCoords(row, 0), instance._createCellCoords(row, this.countCols() - 1), datamap.DESTINATION_RENDERER);
|
3031
3119
|
return data[0] || [];
|
3032
3120
|
};
|
3033
3121
|
/**
|
@@ -3790,7 +3878,8 @@ export default function Core(rootElement, userSettings) {
|
|
3790
3878
|
return Math.min(maxCols, dataLen);
|
3791
3879
|
};
|
3792
3880
|
/**
|
3793
|
-
* Returns the number of rendered rows
|
3881
|
+
* Returns the number of rendered rows including rows that are partially or fully rendered
|
3882
|
+
* outside the table viewport.
|
3794
3883
|
*
|
3795
3884
|
* @memberof Core#
|
3796
3885
|
* @function countRenderedRows
|
@@ -3799,10 +3888,11 @@ export default function Core(rootElement, userSettings) {
|
|
3799
3888
|
|
3800
3889
|
|
3801
3890
|
this.countRenderedRows = function () {
|
3802
|
-
return instance.view.
|
3891
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getRenderedRowsCount() : -1;
|
3803
3892
|
};
|
3804
3893
|
/**
|
3805
|
-
* Returns the number of
|
3894
|
+
* Returns the number of rendered rows that are only visible in the table viewport.
|
3895
|
+
* The rows that are partially visible are not counted.
|
3806
3896
|
*
|
3807
3897
|
* @memberof Core#
|
3808
3898
|
* @function countVisibleRows
|
@@ -3811,10 +3901,11 @@ export default function Core(rootElement, userSettings) {
|
|
3811
3901
|
|
3812
3902
|
|
3813
3903
|
this.countVisibleRows = function () {
|
3814
|
-
return instance.view.
|
3904
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleRowsCount() : -1;
|
3815
3905
|
};
|
3816
3906
|
/**
|
3817
|
-
* Returns the number of rendered
|
3907
|
+
* Returns the number of rendered rows including columns that are partially or fully rendered
|
3908
|
+
* outside the table viewport.
|
3818
3909
|
*
|
3819
3910
|
* @memberof Core#
|
3820
3911
|
* @function countRenderedCols
|
@@ -3823,10 +3914,11 @@ export default function Core(rootElement, userSettings) {
|
|
3823
3914
|
|
3824
3915
|
|
3825
3916
|
this.countRenderedCols = function () {
|
3826
|
-
return instance.view.
|
3917
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getRenderedColumnsCount() : -1;
|
3827
3918
|
};
|
3828
3919
|
/**
|
3829
|
-
* Returns the number of
|
3920
|
+
* Returns the number of rendered columns that are only visible in the table viewport.
|
3921
|
+
* The columns that are partially visible are not counted.
|
3830
3922
|
*
|
3831
3923
|
* @memberof Core#
|
3832
3924
|
* @function countVisibleCols
|
@@ -3835,7 +3927,7 @@ export default function Core(rootElement, userSettings) {
|
|
3835
3927
|
|
3836
3928
|
|
3837
3929
|
this.countVisibleCols = function () {
|
3838
|
-
return instance.view.
|
3930
|
+
return instance.view._wt.drawn ? instance.view._wt.wtTable.getVisibleColumnsCount() : -1;
|
3839
3931
|
};
|
3840
3932
|
/**
|
3841
3933
|
* Returns the number of empty rows. If the optional ending parameter is `true`, returns the
|
@@ -4097,7 +4189,7 @@ export default function Core(rootElement, userSettings) {
|
|
4097
4189
|
|
4098
4190
|
var getIndexToScroll = function getIndexToScroll(indexMapper, visualIndex) {
|
4099
4191
|
// Looking for a visual index on the right and then (when not found) on the left.
|
4100
|
-
return indexMapper.
|
4192
|
+
return indexMapper.getNearestNotHiddenIndex(visualIndex, 1, true);
|
4101
4193
|
};
|
4102
4194
|
/**
|
4103
4195
|
* Scroll viewport to coordinates specified by the `row` and `column` arguments.
|
@@ -4108,8 +4200,10 @@ export default function Core(rootElement, userSettings) {
|
|
4108
4200
|
* we are using the index for numbering only this rows which may be rendered (we don't consider hidden rows).
|
4109
4201
|
* @param {number} [column] Column index. If the last argument isn't defined we treat the index as a visual column index.
|
4110
4202
|
* Otherwise, we are using the index for numbering only this columns which may be rendered (we don't consider hidden columns).
|
4111
|
-
* @param {boolean} [snapToBottom=false] If `true`, viewport is scrolled to show the cell
|
4112
|
-
*
|
4203
|
+
* @param {boolean} [snapToBottom=false] If `true`, the viewport is scrolled to show the cell at the bottom of the table.
|
4204
|
+
* However, if the cell's height is greater than the table's viewport height, the cell is snapped to the top edge.
|
4205
|
+
* @param {boolean} [snapToRight=false] If `true`, the viewport is scrolled to show the cell at the right side of the table.
|
4206
|
+
* 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`).
|
4113
4207
|
* @param {boolean} [considerHiddenIndexes=true] If `true`, we handle visual indexes, otherwise we handle only indexes which
|
4114
4208
|
* may be rendered when they are in the viewport (we don't consider hidden indexes as they aren't rendered).
|
4115
4209
|
* @returns {boolean} `true` if scroll was successful, `false` otherwise.
|
@@ -4145,7 +4239,7 @@ export default function Core(rootElement, userSettings) {
|
|
4145
4239
|
var isColumnInteger = Number.isInteger(renderableColumn);
|
4146
4240
|
|
4147
4241
|
if (isRowInteger && isColumnInteger) {
|
4148
|
-
return instance.view.scrollViewport(
|
4242
|
+
return instance.view.scrollViewport(instance._createCellCoords(renderableRow, renderableColumn), snapToTop, snapToRight, snapToBottom, snapToLeft);
|
4149
4243
|
}
|
4150
4244
|
|
4151
4245
|
if (isRowInteger && isColumnInteger === false) {
|
@@ -4182,8 +4276,8 @@ export default function Core(rootElement, userSettings) {
|
|
4182
4276
|
}
|
4183
4277
|
|
4184
4278
|
dataSource = null;
|
4279
|
+
this.getShortcutManager().destroy();
|
4185
4280
|
metaManager.clearCache();
|
4186
|
-
keyStateStopObserving();
|
4187
4281
|
|
4188
4282
|
if (isRootInstance(instance)) {
|
4189
4283
|
var licenseInfo = this.rootDocument.querySelector('#hot-display-license-info');
|
@@ -4351,7 +4445,7 @@ export default function Core(rootElement, userSettings) {
|
|
4351
4445
|
|
4352
4446
|
|
4353
4447
|
this.hasHook = function (key) {
|
4354
|
-
return Hooks.getSingleton().has(key, instance);
|
4448
|
+
return Hooks.getSingleton().has(key, instance) || Hooks.getSingleton().has(key);
|
4355
4449
|
};
|
4356
4450
|
/**
|
4357
4451
|
* Adds listener to specified hook name (only for this Handsontable instance). After the listener is triggered,
|
@@ -4579,6 +4673,337 @@ export default function Core(rootElement, userSettings) {
|
|
4579
4673
|
return instance.isLtr() ? 1 : -1;
|
4580
4674
|
};
|
4581
4675
|
|
4676
|
+
var shortcutManager = createShortcutManager({
|
4677
|
+
handleEvent: function handleEvent(event) {
|
4678
|
+
var isListening = instance.isListening();
|
4679
|
+
var isKeyboardEventWithKey = (event === null || event === void 0 ? void 0 : event.key) !== void 0;
|
4680
|
+
return isListening && isKeyboardEventWithKey;
|
4681
|
+
},
|
4682
|
+
beforeKeyDown: function beforeKeyDown(event) {
|
4683
|
+
return _this.runHooks('beforeKeyDown', event);
|
4684
|
+
},
|
4685
|
+
afterKeyDown: function afterKeyDown(event) {
|
4686
|
+
if (_this.isDestroyed) {
|
4687
|
+
// Handsontable could be destroyed after performing action (executing a callback).
|
4688
|
+
return;
|
4689
|
+
}
|
4690
|
+
|
4691
|
+
instance.runHooks('afterDocumentKeyDown', event);
|
4692
|
+
},
|
4693
|
+
ownerWindow: this.rootWindow
|
4694
|
+
});
|
4695
|
+
/**
|
4696
|
+
* Returns instance of a manager responsible for handling shortcuts stored in some contexts. It run actions after
|
4697
|
+
* pressing key combination in active Handsontable instance.
|
4698
|
+
*
|
4699
|
+
* @memberof Core#
|
4700
|
+
* @since 12.0.0
|
4701
|
+
* @function getShortcutManager
|
4702
|
+
* @returns {ShortcutManager} Instance of {@link ShortcutManager}
|
4703
|
+
*/
|
4704
|
+
|
4705
|
+
this.getShortcutManager = function () {
|
4706
|
+
return shortcutManager;
|
4707
|
+
};
|
4708
|
+
|
4709
|
+
var gridContext = shortcutManager.addContext('grid');
|
4710
|
+
var gridConfig = {
|
4711
|
+
runOnlyIf: function runOnlyIf() {
|
4712
|
+
return isDefined(instance.getSelected()) && instance.countRenderedRows() > 0 && instance.countRenderedCols() > 0;
|
4713
|
+
},
|
4714
|
+
group: SHORTCUTS_GROUP
|
4715
|
+
};
|
4716
|
+
shortcutManager.setActiveContextName('grid');
|
4717
|
+
gridContext.addShortcuts([{
|
4718
|
+
keys: [['Control/Meta', 'A']],
|
4719
|
+
callback: function callback() {
|
4720
|
+
instance.selectAll();
|
4721
|
+
}
|
4722
|
+
}, {
|
4723
|
+
keys: [['Control/Meta', 'Enter']],
|
4724
|
+
callback: function callback() {
|
4725
|
+
var selectedRange = instance.getSelectedRange();
|
4726
|
+
var _selectedRange$highli = selectedRange[selectedRange.length - 1].highlight,
|
4727
|
+
highlightRow = _selectedRange$highli.row,
|
4728
|
+
highlightColumn = _selectedRange$highli.col;
|
4729
|
+
var valueToPopulate = instance.getDataAtCell(highlightRow, highlightColumn);
|
4730
|
+
var cellValues = new Map();
|
4731
|
+
|
4732
|
+
for (var i = 0; i < selectedRange.length; i++) {
|
4733
|
+
selectedRange[i].forAll(function (row, column) {
|
4734
|
+
if (row >= 0 && column >= 0 && (row !== highlightRow || column !== highlightColumn)) {
|
4735
|
+
var _instance$getCellMeta = instance.getCellMeta(row, column),
|
4736
|
+
readOnly = _instance$getCellMeta.readOnly;
|
4737
|
+
|
4738
|
+
if (!readOnly) {
|
4739
|
+
cellValues.set("".concat(row, "x").concat(column), [row, column, valueToPopulate]);
|
4740
|
+
}
|
4741
|
+
}
|
4742
|
+
});
|
4743
|
+
}
|
4744
|
+
|
4745
|
+
instance.setDataAtCell(Array.from(cellValues.values()));
|
4746
|
+
},
|
4747
|
+
runOnlyIf: function runOnlyIf() {
|
4748
|
+
return instance.getSelectedRangeLast().getCellsCount() > 1;
|
4749
|
+
}
|
4750
|
+
}, {
|
4751
|
+
keys: [['ArrowUp']],
|
4752
|
+
callback: function callback() {
|
4753
|
+
selection.transformStart(-1, 0);
|
4754
|
+
}
|
4755
|
+
}, {
|
4756
|
+
keys: [['ArrowUp', 'Control/Meta']],
|
4757
|
+
captureCtrl: true,
|
4758
|
+
callback: function callback() {
|
4759
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1), instance.getSelectedRangeLast().highlight.col));
|
4760
|
+
}
|
4761
|
+
}, {
|
4762
|
+
keys: [['ArrowUp', 'Shift']],
|
4763
|
+
callback: function callback() {
|
4764
|
+
selection.transformEnd(-1, 0);
|
4765
|
+
}
|
4766
|
+
}, {
|
4767
|
+
keys: [['ArrowUp', 'Shift', 'Control/Meta']],
|
4768
|
+
captureCtrl: true,
|
4769
|
+
callback: function callback() {
|
4770
|
+
var _instance$getSelected = instance.getSelectedRangeLast(),
|
4771
|
+
from = _instance$getSelected.from,
|
4772
|
+
to = _instance$getSelected.to;
|
4773
|
+
|
4774
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(0, 1);
|
4775
|
+
selection.setRangeStart(from.clone());
|
4776
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4777
|
+
},
|
4778
|
+
runOnlyIf: function runOnlyIf() {
|
4779
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4780
|
+
}
|
4781
|
+
}, {
|
4782
|
+
keys: [['ArrowDown']],
|
4783
|
+
callback: function callback() {
|
4784
|
+
selection.transformStart(1, 0);
|
4785
|
+
}
|
4786
|
+
}, {
|
4787
|
+
keys: [['ArrowDown', 'Control/Meta']],
|
4788
|
+
captureCtrl: true,
|
4789
|
+
callback: function callback() {
|
4790
|
+
selection.setRangeStart(instance._createCellCoords(instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1), instance.getSelectedRangeLast().highlight.col));
|
4791
|
+
}
|
4792
|
+
}, {
|
4793
|
+
keys: [['ArrowDown', 'Shift']],
|
4794
|
+
callback: function callback() {
|
4795
|
+
selection.transformEnd(1, 0);
|
4796
|
+
}
|
4797
|
+
}, {
|
4798
|
+
keys: [['ArrowDown', 'Shift', 'Control/Meta']],
|
4799
|
+
captureCtrl: true,
|
4800
|
+
callback: function callback() {
|
4801
|
+
var _instance$getSelected2 = instance.getSelectedRangeLast(),
|
4802
|
+
from = _instance$getSelected2.from,
|
4803
|
+
to = _instance$getSelected2.to;
|
4804
|
+
|
4805
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - 1, -1);
|
4806
|
+
selection.setRangeStart(from.clone());
|
4807
|
+
selection.setRangeEnd(instance._createCellCoords(row, to.col));
|
4808
|
+
},
|
4809
|
+
runOnlyIf: function runOnlyIf() {
|
4810
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByColumnHeader());
|
4811
|
+
}
|
4812
|
+
}, {
|
4813
|
+
keys: [['ArrowLeft']],
|
4814
|
+
callback: function callback() {
|
4815
|
+
selection.transformStart(0, -1 * instance.getDirectionFactor());
|
4816
|
+
}
|
4817
|
+
}, {
|
4818
|
+
keys: [['ArrowLeft', 'Control/Meta']],
|
4819
|
+
captureCtrl: true,
|
4820
|
+
callback: function callback() {
|
4821
|
+
var _instance$columnIndex;
|
4822
|
+
|
4823
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4824
|
+
|
4825
|
+
var column = (_instance$columnIndex = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4826
|
+
|
4827
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4828
|
+
}
|
4829
|
+
}, {
|
4830
|
+
keys: [['ArrowLeft', 'Shift']],
|
4831
|
+
callback: function callback() {
|
4832
|
+
selection.transformEnd(0, -1 * instance.getDirectionFactor());
|
4833
|
+
}
|
4834
|
+
}, {
|
4835
|
+
keys: [['ArrowLeft', 'Shift', 'Control/Meta']],
|
4836
|
+
captureCtrl: true,
|
4837
|
+
callback: function callback() {
|
4838
|
+
var _instance$columnIndex2;
|
4839
|
+
|
4840
|
+
var _instance$getSelected3 = instance.getSelectedRangeLast(),
|
4841
|
+
from = _instance$getSelected3.from,
|
4842
|
+
to = _instance$getSelected3.to;
|
4843
|
+
|
4844
|
+
var column = (_instance$columnIndex2 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex2, _toConsumableArray(instance.isRtl() ? [instance.countCols() - 1, -1] : [0, 1]));
|
4845
|
+
|
4846
|
+
selection.setRangeStart(from.clone());
|
4847
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4848
|
+
},
|
4849
|
+
runOnlyIf: function runOnlyIf() {
|
4850
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4851
|
+
}
|
4852
|
+
}, {
|
4853
|
+
keys: [['ArrowRight']],
|
4854
|
+
callback: function callback() {
|
4855
|
+
selection.transformStart(0, instance.getDirectionFactor());
|
4856
|
+
}
|
4857
|
+
}, {
|
4858
|
+
keys: [['ArrowRight', 'Control/Meta']],
|
4859
|
+
captureCtrl: true,
|
4860
|
+
callback: function callback() {
|
4861
|
+
var _instance$columnIndex3;
|
4862
|
+
|
4863
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4864
|
+
|
4865
|
+
var column = (_instance$columnIndex3 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex3, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4866
|
+
|
4867
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4868
|
+
}
|
4869
|
+
}, {
|
4870
|
+
keys: [['ArrowRight', 'Shift']],
|
4871
|
+
callback: function callback() {
|
4872
|
+
selection.transformEnd(0, instance.getDirectionFactor());
|
4873
|
+
}
|
4874
|
+
}, {
|
4875
|
+
keys: [['ArrowRight', 'Shift', 'Control/Meta']],
|
4876
|
+
captureCtrl: true,
|
4877
|
+
callback: function callback() {
|
4878
|
+
var _instance$columnIndex4;
|
4879
|
+
|
4880
|
+
var _instance$getSelected4 = instance.getSelectedRangeLast(),
|
4881
|
+
from = _instance$getSelected4.from,
|
4882
|
+
to = _instance$getSelected4.to;
|
4883
|
+
|
4884
|
+
var column = (_instance$columnIndex4 = instance.columnIndexMapper).getNearestNotHiddenIndex.apply(_instance$columnIndex4, _toConsumableArray(instance.isRtl() ? [0, 1] : [instance.countCols() - 1, -1]));
|
4885
|
+
|
4886
|
+
selection.setRangeStart(from.clone());
|
4887
|
+
selection.setRangeEnd(instance._createCellCoords(to.row, column));
|
4888
|
+
},
|
4889
|
+
runOnlyIf: function runOnlyIf() {
|
4890
|
+
return !(instance.selection.isSelectedByCorner() || instance.selection.isSelectedByRowHeader());
|
4891
|
+
}
|
4892
|
+
}, {
|
4893
|
+
keys: [['Home']],
|
4894
|
+
captureCtrl: true,
|
4895
|
+
callback: function callback() {
|
4896
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4897
|
+
var row = instance.getSelectedRangeLast().highlight.row;
|
4898
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4899
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4900
|
+
},
|
4901
|
+
runOnlyIf: function runOnlyIf() {
|
4902
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4903
|
+
}
|
4904
|
+
}, {
|
4905
|
+
keys: [['Home', 'Shift']],
|
4906
|
+
callback: function callback() {
|
4907
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(0, 1)));
|
4908
|
+
}
|
4909
|
+
}, {
|
4910
|
+
keys: [['Home', 'Control/Meta']],
|
4911
|
+
captureCtrl: true,
|
4912
|
+
callback: function callback() {
|
4913
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsTop, 10);
|
4914
|
+
var fixedColumns = parseInt(instance.getSettings().fixedColumnsStart, 10);
|
4915
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(fixedRows, 1);
|
4916
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(fixedColumns, 1);
|
4917
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4918
|
+
},
|
4919
|
+
runOnlyIf: function runOnlyIf() {
|
4920
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4921
|
+
}
|
4922
|
+
}, {
|
4923
|
+
keys: [['End']],
|
4924
|
+
captureCtrl: true,
|
4925
|
+
callback: function callback() {
|
4926
|
+
selection.setRangeStart(instance._createCellCoords(instance.getSelectedRangeLast().highlight.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4927
|
+
},
|
4928
|
+
runOnlyIf: function runOnlyIf() {
|
4929
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4930
|
+
}
|
4931
|
+
}, {
|
4932
|
+
keys: [['End', 'Shift']],
|
4933
|
+
callback: function callback() {
|
4934
|
+
selection.setRangeEnd(instance._createCellCoords(selection.selectedRange.current().from.row, instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1)));
|
4935
|
+
}
|
4936
|
+
}, {
|
4937
|
+
keys: [['End', 'Control/Meta']],
|
4938
|
+
captureCtrl: true,
|
4939
|
+
callback: function callback() {
|
4940
|
+
var fixedRows = parseInt(instance.getSettings().fixedRowsBottom, 10);
|
4941
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(instance.countRows() - fixedRows - 1, -1);
|
4942
|
+
var column = instance.columnIndexMapper.getNearestNotHiddenIndex(instance.countCols() - 1, -1);
|
4943
|
+
selection.setRangeStart(instance._createCellCoords(row, column));
|
4944
|
+
},
|
4945
|
+
runOnlyIf: function runOnlyIf() {
|
4946
|
+
return instance.view.isMainTableNotFullyCoveredByOverlays();
|
4947
|
+
}
|
4948
|
+
}, {
|
4949
|
+
keys: [['PageUp']],
|
4950
|
+
callback: function callback() {
|
4951
|
+
selection.transformStart(-instance.countVisibleRows(), 0);
|
4952
|
+
}
|
4953
|
+
}, {
|
4954
|
+
keys: [['PageUp', 'Shift']],
|
4955
|
+
callback: function callback() {
|
4956
|
+
var _instance$getSelected5 = instance.getSelectedRangeLast(),
|
4957
|
+
to = _instance$getSelected5.to;
|
4958
|
+
|
4959
|
+
var nextRowIndexToSelect = Math.max(to.row - instance.countVisibleRows(), 0);
|
4960
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, 1);
|
4961
|
+
|
4962
|
+
if (row !== null) {
|
4963
|
+
var coords = instance._createCellCoords(row, to.col);
|
4964
|
+
|
4965
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4966
|
+
var nextVerticalScroll = Math.max(coords.row - scrollPadding, 0);
|
4967
|
+
selection.setRangeEnd(coords);
|
4968
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
4969
|
+
}
|
4970
|
+
}
|
4971
|
+
}, {
|
4972
|
+
keys: [['PageDown']],
|
4973
|
+
callback: function callback() {
|
4974
|
+
selection.transformStart(instance.countVisibleRows(), 0);
|
4975
|
+
}
|
4976
|
+
}, {
|
4977
|
+
keys: [['PageDown', 'Shift']],
|
4978
|
+
callback: function callback() {
|
4979
|
+
var _instance$getSelected6 = instance.getSelectedRangeLast(),
|
4980
|
+
to = _instance$getSelected6.to;
|
4981
|
+
|
4982
|
+
var nextRowIndexToSelect = Math.min(to.row + instance.countVisibleRows(), instance.countRows() - 1);
|
4983
|
+
var row = instance.rowIndexMapper.getNearestNotHiddenIndex(nextRowIndexToSelect, -1);
|
4984
|
+
|
4985
|
+
if (row !== null) {
|
4986
|
+
var coords = instance._createCellCoords(row, to.col);
|
4987
|
+
|
4988
|
+
var scrollPadding = to.row - instance.view.getFirstFullyVisibleRow();
|
4989
|
+
var nextVerticalScroll = Math.min(coords.row - scrollPadding, instance.countRows() - 1);
|
4990
|
+
selection.setRangeEnd(coords);
|
4991
|
+
instance.scrollViewportTo(nextVerticalScroll);
|
4992
|
+
}
|
4993
|
+
}
|
4994
|
+
}, {
|
4995
|
+
keys: [['Tab']],
|
4996
|
+
callback: function callback(event) {
|
4997
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
4998
|
+
selection.transformStart(tabMoves.row, tabMoves.col, true);
|
4999
|
+
}
|
5000
|
+
}, {
|
5001
|
+
keys: [['Shift', 'Tab']],
|
5002
|
+
callback: function callback(event) {
|
5003
|
+
var tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
5004
|
+
selection.transformStart(-tabMoves.row, -tabMoves.col);
|
5005
|
+
}
|
5006
|
+
}], gridConfig);
|
4582
5007
|
getPluginsNames().forEach(function (pluginName) {
|
4583
5008
|
var PluginClass = getPlugin(pluginName);
|
4584
5009
|
pluginsRegistry.addItem(pluginName, new PluginClass(_this));
|