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/editorManager.mjs
CHANGED
@@ -1,3 +1,17 @@
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
2
|
+
|
3
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
4
|
+
|
5
|
+
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); }
|
6
|
+
|
7
|
+
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; }
|
8
|
+
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
10
|
+
|
11
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
12
|
+
|
13
|
+
import "core-js/modules/es.array.includes.js";
|
14
|
+
import "core-js/modules/es.string.includes.js";
|
1
15
|
import "core-js/modules/es.array.iterator.js";
|
2
16
|
import "core-js/modules/es.object.to-string.js";
|
3
17
|
import "core-js/modules/es.string.iterator.js";
|
@@ -11,31 +25,19 @@ import "core-js/modules/es.function.name.js";
|
|
11
25
|
import "core-js/modules/es.array.from.js";
|
12
26
|
import "core-js/modules/es.regexp.exec.js";
|
13
27
|
|
14
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
15
|
-
|
16
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
17
|
-
|
18
|
-
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); }
|
19
|
-
|
20
|
-
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; }
|
21
|
-
|
22
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
23
|
-
|
24
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
25
|
-
|
26
28
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
27
29
|
|
28
30
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
29
31
|
|
30
32
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
31
33
|
|
32
|
-
import {
|
33
|
-
import {
|
34
|
-
import { stopImmediatePropagation, isImmediatePropagationStopped } from "./helpers/dom/event.mjs";
|
34
|
+
import { isFunctionKey, isCtrlMetaKey } from "./helpers/unicode.mjs";
|
35
|
+
import { stopImmediatePropagation } from "./helpers/dom/event.mjs";
|
35
36
|
import { getEditorInstance } from "./editors/registry.mjs";
|
36
37
|
import EventManager from "./eventManager.mjs";
|
37
|
-
import {
|
38
|
-
|
38
|
+
import { isDefined } from "./helpers/mixed.mjs";
|
39
|
+
export var SHORTCUTS_GROUP_NAVIGATION = 'editorManager.navigation';
|
40
|
+
export var SHORTCUTS_GROUP_EDITOR = 'editorManager.handlingEditor';
|
39
41
|
|
40
42
|
var EditorManager = /*#__PURE__*/function () {
|
41
43
|
/**
|
@@ -110,44 +112,97 @@ var EditorManager = /*#__PURE__*/function () {
|
|
110
112
|
*/
|
111
113
|
|
112
114
|
this.cellProperties = void 0;
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
* @type {number}
|
117
|
-
*/
|
118
|
-
|
119
|
-
this.lastKeyCode = void 0;
|
115
|
+
var shortcutManager = this.instance.getShortcutManager();
|
116
|
+
shortcutManager.addContext('editor');
|
117
|
+
this.registerShortcuts();
|
120
118
|
this.instance.addHook('afterDocumentKeyDown', function (event) {
|
121
119
|
return _this.onAfterDocumentKeyDown(event);
|
122
|
-
});
|
123
|
-
var frame = this.instance.rootWindow;
|
124
|
-
|
125
|
-
while (frame) {
|
126
|
-
this.eventManager.addEventListener(frame.document.documentElement, 'keydown', function (event) {
|
127
|
-
if (!_this.destroyed) {
|
128
|
-
_this.instance.runHooks('afterDocumentKeyDown', event);
|
129
|
-
}
|
130
|
-
});
|
131
|
-
frame = getParentWindow(frame);
|
132
|
-
} // Open editor when text composition is started (IME editor)
|
133
|
-
|
120
|
+
}); // Open editor when text composition is started (IME editor)
|
134
121
|
|
135
122
|
this.eventManager.addEventListener(this.instance.rootDocument.documentElement, 'compositionstart', function (event) {
|
136
123
|
if (!_this.destroyed && _this.activeEditor && !_this.activeEditor.isOpened() && _this.instance.isListening()) {
|
137
124
|
_this.openEditor('', event);
|
138
125
|
}
|
139
126
|
});
|
140
|
-
|
127
|
+
|
128
|
+
this.instance.view._wt.update('onCellDblClick', function (event, coords, elem) {
|
141
129
|
return _this.onCellDblClick(event, coords, elem);
|
142
130
|
});
|
143
131
|
}
|
144
132
|
/**
|
145
|
-
*
|
146
|
-
*
|
133
|
+
* Register shortcuts responsible for handling some actions related to an editor.
|
134
|
+
*
|
135
|
+
* @private
|
147
136
|
*/
|
148
137
|
|
149
138
|
|
150
139
|
_createClass(EditorManager, [{
|
140
|
+
key: "registerShortcuts",
|
141
|
+
value: function registerShortcuts() {
|
142
|
+
var _this2 = this;
|
143
|
+
|
144
|
+
var shortcutManager = this.instance.getShortcutManager();
|
145
|
+
var gridContext = shortcutManager.getContext('grid');
|
146
|
+
var editorContext = shortcutManager.getContext('editor');
|
147
|
+
var config = {
|
148
|
+
group: SHORTCUTS_GROUP_EDITOR
|
149
|
+
};
|
150
|
+
editorContext.addShortcuts([{
|
151
|
+
keys: [['Enter'], ['Enter', 'Shift'], ['Enter', 'Control/Meta'], ['Enter', 'Control/Meta', 'Shift']],
|
152
|
+
callback: function callback(event, keys) {
|
153
|
+
_this2.closeEditorAndSaveChanges(shortcutManager.isCtrlPressed());
|
154
|
+
|
155
|
+
_this2.moveSelectionAfterEnter(keys.includes('shift'));
|
156
|
+
}
|
157
|
+
}, {
|
158
|
+
keys: [['Escape'], ['Escape', 'Control/Meta']],
|
159
|
+
callback: function callback() {
|
160
|
+
_this2.closeEditorAndRestoreOriginalValue(shortcutManager.isCtrlPressed());
|
161
|
+
|
162
|
+
_this2.activeEditor.focus();
|
163
|
+
}
|
164
|
+
}], config);
|
165
|
+
gridContext.addShortcuts([{
|
166
|
+
keys: [['F2']],
|
167
|
+
callback: function callback(event) {
|
168
|
+
if (_this2.activeEditor) {
|
169
|
+
_this2.activeEditor.enableFullEditMode();
|
170
|
+
}
|
171
|
+
|
172
|
+
_this2.openEditor(null, event);
|
173
|
+
}
|
174
|
+
}, {
|
175
|
+
keys: [['Backspace'], ['Delete']],
|
176
|
+
callback: function callback() {
|
177
|
+
_this2.instance.emptySelectedCells();
|
178
|
+
|
179
|
+
_this2.prepareEditor();
|
180
|
+
}
|
181
|
+
}, {
|
182
|
+
keys: [['Enter'], ['Enter', 'Shift']],
|
183
|
+
callback: function callback(event, keys) {
|
184
|
+
if (_this2.instance.getSettings().enterBeginsEditing) {
|
185
|
+
if (_this2.cellProperties.readOnly) {
|
186
|
+
_this2.moveSelectionAfterEnter();
|
187
|
+
} else if (_this2.activeEditor) {
|
188
|
+
_this2.activeEditor.enableFullEditMode();
|
189
|
+
|
190
|
+
_this2.openEditor(null, event);
|
191
|
+
}
|
192
|
+
} else {
|
193
|
+
_this2.moveSelectionAfterEnter(keys.includes('shift'));
|
194
|
+
}
|
195
|
+
|
196
|
+
stopImmediatePropagation(event); // required by HandsontableEditor
|
197
|
+
}
|
198
|
+
}], config);
|
199
|
+
}
|
200
|
+
/**
|
201
|
+
* Lock the editor from being prepared and closed. Locking the editor prevents its closing and
|
202
|
+
* reinitialized after selecting the new cell. This feature is necessary for a mobile editor.
|
203
|
+
*/
|
204
|
+
|
205
|
+
}, {
|
151
206
|
key: "lockEditor",
|
152
207
|
value: function lockEditor() {
|
153
208
|
this.lock = true;
|
@@ -194,7 +249,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
194
249
|
}, {
|
195
250
|
key: "prepareEditor",
|
196
251
|
value: function prepareEditor() {
|
197
|
-
var
|
252
|
+
var _this3 = this;
|
198
253
|
|
199
254
|
if (this.lock) {
|
200
255
|
return;
|
@@ -203,7 +258,7 @@ var EditorManager = /*#__PURE__*/function () {
|
|
203
258
|
if (this.activeEditor && this.activeEditor.isWaiting()) {
|
204
259
|
this.closeEditor(false, false, function (dataSaved) {
|
205
260
|
if (dataSaved) {
|
206
|
-
|
261
|
+
_this3.prepareEditor();
|
207
262
|
}
|
208
263
|
});
|
209
264
|
return;
|
@@ -351,71 +406,6 @@ var EditorManager = /*#__PURE__*/function () {
|
|
351
406
|
this.selection.transformStart(enterMoves.row, enterMoves.col, true);
|
352
407
|
}
|
353
408
|
}
|
354
|
-
/**
|
355
|
-
* Controls selection behaviour after clicking `arrow up`.
|
356
|
-
*
|
357
|
-
* @private
|
358
|
-
* @param {boolean} isShiftPressed If `true`, then the selection will expand up.
|
359
|
-
*/
|
360
|
-
|
361
|
-
}, {
|
362
|
-
key: "moveSelectionUp",
|
363
|
-
value: function moveSelectionUp(isShiftPressed) {
|
364
|
-
if (isShiftPressed) {
|
365
|
-
this.selection.transformEnd(-1, 0);
|
366
|
-
} else {
|
367
|
-
this.selection.transformStart(-1, 0);
|
368
|
-
}
|
369
|
-
}
|
370
|
-
/**
|
371
|
-
* Controls selection's behaviour after clicking `arrow down`.
|
372
|
-
*
|
373
|
-
* @private
|
374
|
-
* @param {boolean} isShiftPressed If `true`, then the selection will expand down.
|
375
|
-
*/
|
376
|
-
|
377
|
-
}, {
|
378
|
-
key: "moveSelectionDown",
|
379
|
-
value: function moveSelectionDown(isShiftPressed) {
|
380
|
-
if (isShiftPressed) {
|
381
|
-
// expanding selection down with shift
|
382
|
-
this.selection.transformEnd(1, 0);
|
383
|
-
} else {
|
384
|
-
this.selection.transformStart(1, 0);
|
385
|
-
}
|
386
|
-
}
|
387
|
-
/**
|
388
|
-
* Controls selection's behaviour after clicking `arrow right`.
|
389
|
-
*
|
390
|
-
* @private
|
391
|
-
* @param {boolean} isShiftPressed If `true`, then the selection will expand right.
|
392
|
-
*/
|
393
|
-
|
394
|
-
}, {
|
395
|
-
key: "moveSelectionRight",
|
396
|
-
value: function moveSelectionRight(isShiftPressed) {
|
397
|
-
if (isShiftPressed) {
|
398
|
-
this.selection.transformEnd(0, this.instance.getDirectionFactor());
|
399
|
-
} else {
|
400
|
-
this.selection.transformStart(0, this.instance.getDirectionFactor());
|
401
|
-
}
|
402
|
-
}
|
403
|
-
/**
|
404
|
-
* Controls selection's behaviour after clicking `arrow left`.
|
405
|
-
*
|
406
|
-
* @private
|
407
|
-
* @param {boolean} isShiftPressed If `true`, then the selection will expand left.
|
408
|
-
*/
|
409
|
-
|
410
|
-
}, {
|
411
|
-
key: "moveSelectionLeft",
|
412
|
-
value: function moveSelectionLeft(isShiftPressed) {
|
413
|
-
if (isShiftPressed) {
|
414
|
-
this.selection.transformEnd(0, -1 * this.instance.getDirectionFactor());
|
415
|
-
} else {
|
416
|
-
this.selection.transformStart(0, -1 * this.instance.getDirectionFactor());
|
417
|
-
}
|
418
|
-
}
|
419
409
|
/**
|
420
410
|
* OnAfterDocumentKeyDown callback.
|
421
411
|
*
|
@@ -426,24 +416,19 @@ var EditorManager = /*#__PURE__*/function () {
|
|
426
416
|
}, {
|
427
417
|
key: "onAfterDocumentKeyDown",
|
428
418
|
value: function onAfterDocumentKeyDown(event) {
|
419
|
+
var _this4 = this;
|
420
|
+
|
429
421
|
if (!this.instance.isListening()) {
|
430
422
|
return;
|
431
423
|
}
|
432
424
|
|
433
|
-
this.instance.runHooks('beforeKeyDown', event);
|
434
425
|
var keyCode = event.keyCode; // keyCode 229 aka 'uninitialized' doesn't take into account with editors. This key code is produced when unfinished
|
435
426
|
// character is entering (using IME editor). It is fired mainly on linux (ubuntu) with installed ibus-pinyin package.
|
436
427
|
|
437
|
-
if (
|
438
|
-
return;
|
439
|
-
}
|
440
|
-
|
441
|
-
if (isImmediatePropagationStopped(event)) {
|
428
|
+
if (keyCode === 229) {
|
442
429
|
return;
|
443
430
|
}
|
444
431
|
|
445
|
-
this.lastKeyCode = keyCode;
|
446
|
-
|
447
432
|
if (!this.selection.isSelected()) {
|
448
433
|
return;
|
449
434
|
} // catch CTRL but not right ALT (which in some systems triggers ALT+CTRL)
|
@@ -453,172 +438,37 @@ var EditorManager = /*#__PURE__*/function () {
|
|
453
438
|
|
454
439
|
if (this.activeEditor && !this.activeEditor.isWaiting()) {
|
455
440
|
if (!isFunctionKey(keyCode) && !isCtrlMetaKey(keyCode) && !isCtrlPressed && !this.isEditorOpened()) {
|
456
|
-
this.
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
this.instance.selectAll();
|
469
|
-
event.preventDefault();
|
470
|
-
event.stopPropagation();
|
471
|
-
}
|
472
|
-
|
473
|
-
break;
|
474
|
-
|
475
|
-
case KEY_CODES.ARROW_UP:
|
476
|
-
if (this.isEditorOpened() && !this.activeEditor.isWaiting()) {
|
477
|
-
this.closeEditorAndSaveChanges(isCtrlPressed);
|
478
|
-
}
|
479
|
-
|
480
|
-
this.moveSelectionUp(isShiftPressed);
|
481
|
-
event.preventDefault();
|
482
|
-
event.stopPropagation();
|
483
|
-
break;
|
484
|
-
|
485
|
-
case KEY_CODES.ARROW_DOWN:
|
486
|
-
if (this.isEditorOpened() && !this.activeEditor.isWaiting()) {
|
487
|
-
this.closeEditorAndSaveChanges(isCtrlPressed);
|
488
|
-
}
|
489
|
-
|
490
|
-
this.moveSelectionDown(isShiftPressed);
|
491
|
-
event.preventDefault();
|
492
|
-
event.stopPropagation();
|
493
|
-
break;
|
494
|
-
|
495
|
-
case KEY_CODES.ARROW_RIGHT:
|
496
|
-
if (this.isEditorOpened() && !this.activeEditor.isWaiting()) {
|
497
|
-
this.closeEditorAndSaveChanges(isCtrlPressed);
|
498
|
-
}
|
499
|
-
|
500
|
-
this.moveSelectionRight(isShiftPressed);
|
501
|
-
event.preventDefault();
|
502
|
-
event.stopPropagation();
|
503
|
-
break;
|
504
|
-
|
505
|
-
case KEY_CODES.ARROW_LEFT:
|
506
|
-
if (this.isEditorOpened() && !this.activeEditor.isWaiting()) {
|
507
|
-
this.closeEditorAndSaveChanges(isCtrlPressed);
|
508
|
-
}
|
509
|
-
|
510
|
-
this.moveSelectionLeft(isShiftPressed);
|
511
|
-
event.preventDefault();
|
512
|
-
event.stopPropagation();
|
513
|
-
break;
|
514
|
-
|
515
|
-
case KEY_CODES.TAB:
|
516
|
-
tabMoves = typeof this.tableMeta.tabMoves === 'function' ? this.tableMeta.tabMoves(event) : this.tableMeta.tabMoves;
|
517
|
-
|
518
|
-
if (isShiftPressed) {
|
519
|
-
// move selection left
|
520
|
-
this.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
521
|
-
} else {
|
522
|
-
// move selection right (add a new column if needed)
|
523
|
-
this.selection.transformStart(tabMoves.row, tabMoves.col, true);
|
524
|
-
}
|
525
|
-
|
526
|
-
event.preventDefault();
|
527
|
-
event.stopPropagation();
|
528
|
-
break;
|
529
|
-
|
530
|
-
case KEY_CODES.BACKSPACE:
|
531
|
-
case KEY_CODES.DELETE:
|
532
|
-
this.instance.emptySelectedCells();
|
533
|
-
this.prepareEditor();
|
534
|
-
event.preventDefault();
|
535
|
-
break;
|
536
|
-
|
537
|
-
case KEY_CODES.F2:
|
538
|
-
/* F2 */
|
539
|
-
if (this.activeEditor) {
|
540
|
-
this.activeEditor.enableFullEditMode();
|
541
|
-
}
|
542
|
-
|
543
|
-
this.openEditor(null, event);
|
544
|
-
event.preventDefault(); // prevent Opera from opening 'Go to Page dialog'
|
545
|
-
|
546
|
-
break;
|
547
|
-
|
548
|
-
case KEY_CODES.ENTER:
|
549
|
-
/* return/enter */
|
550
|
-
if (this.isEditorOpened()) {
|
551
|
-
if (this.activeEditor && this.activeEditor.state !== EDITOR_STATE.WAITING) {
|
552
|
-
this.closeEditorAndSaveChanges(isCtrlPressed);
|
441
|
+
var shortcutManager = this.instance.getShortcutManager();
|
442
|
+
var editorContext = shortcutManager.getContext('editor');
|
443
|
+
var runOnlySelectedConfig = {
|
444
|
+
runOnlyIf: function runOnlyIf() {
|
445
|
+
return isDefined(_this4.instance.getSelected());
|
446
|
+
},
|
447
|
+
group: SHORTCUTS_GROUP_NAVIGATION
|
448
|
+
};
|
449
|
+
editorContext.addShortcuts([{
|
450
|
+
keys: [['ArrowUp']],
|
451
|
+
callback: function callback() {
|
452
|
+
_this4.instance.selection.transformStart(-1, 0);
|
553
453
|
}
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
this.moveSelectionAfterEnter();
|
559
|
-
} else if (this.activeEditor) {
|
560
|
-
this.activeEditor.enableFullEditMode();
|
561
|
-
this.openEditor(null, event);
|
454
|
+
}, {
|
455
|
+
keys: [['ArrowDown']],
|
456
|
+
callback: function callback() {
|
457
|
+
_this4.instance.selection.transformStart(1, 0);
|
562
458
|
}
|
563
|
-
}
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
this.activeEditor.focus();
|
577
|
-
}
|
578
|
-
|
579
|
-
event.preventDefault();
|
580
|
-
break;
|
581
|
-
|
582
|
-
case KEY_CODES.HOME:
|
583
|
-
if (event.ctrlKey || event.metaKey) {
|
584
|
-
rangeModifier.call(this.selection, new CellCoords(this.instance.rowIndexMapper.getFirstNotHiddenIndex(0, 1), this.selection.selectedRange.current().from.col));
|
585
|
-
} else {
|
586
|
-
rangeModifier.call(this.selection, new CellCoords(this.selection.selectedRange.current().from.row, this.instance.columnIndexMapper.getFirstNotHiddenIndex(0, 1)));
|
587
|
-
}
|
588
|
-
|
589
|
-
event.preventDefault(); // don't scroll the window
|
590
|
-
|
591
|
-
event.stopPropagation();
|
592
|
-
break;
|
593
|
-
|
594
|
-
case KEY_CODES.END:
|
595
|
-
if (event.ctrlKey || event.metaKey) {
|
596
|
-
rangeModifier.call(this.selection, new CellCoords(this.instance.rowIndexMapper.getFirstNotHiddenIndex(this.instance.countRows() - 1, -1), this.selection.selectedRange.current().from.col));
|
597
|
-
} else {
|
598
|
-
rangeModifier.call(this.selection, new CellCoords(this.selection.selectedRange.current().from.row, this.instance.columnIndexMapper.getFirstNotHiddenIndex(this.instance.countCols() - 1, -1)));
|
599
|
-
}
|
600
|
-
|
601
|
-
event.preventDefault(); // don't scroll the window
|
602
|
-
|
603
|
-
event.stopPropagation();
|
604
|
-
break;
|
605
|
-
|
606
|
-
case KEY_CODES.PAGE_UP:
|
607
|
-
this.selection.transformStart(-this.instance.countVisibleRows(), 0);
|
608
|
-
event.preventDefault(); // don't page up the window
|
609
|
-
|
610
|
-
event.stopPropagation();
|
611
|
-
break;
|
612
|
-
|
613
|
-
case KEY_CODES.PAGE_DOWN:
|
614
|
-
this.selection.transformStart(this.instance.countVisibleRows(), 0);
|
615
|
-
event.preventDefault(); // don't page down the window
|
616
|
-
|
617
|
-
event.stopPropagation();
|
618
|
-
break;
|
619
|
-
|
620
|
-
default:
|
621
|
-
break;
|
459
|
+
}, {
|
460
|
+
keys: [['ArrowLeft']],
|
461
|
+
callback: function callback() {
|
462
|
+
_this4.instance.selection.transformStart(0, -1 * _this4.instance.getDirectionFactor());
|
463
|
+
}
|
464
|
+
}, {
|
465
|
+
keys: [['ArrowRight']],
|
466
|
+
callback: function callback() {
|
467
|
+
_this4.instance.selection.transformStart(0, _this4.instance.getDirectionFactor());
|
468
|
+
}
|
469
|
+
}], runOnlySelectedConfig);
|
470
|
+
this.openEditor('', event);
|
471
|
+
}
|
622
472
|
}
|
623
473
|
}
|
624
474
|
/**
|
@@ -63,13 +63,13 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
63
63
|
|
64
64
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
65
65
|
|
66
|
-
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
66
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
67
67
|
|
68
68
|
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
69
69
|
|
70
70
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
71
71
|
|
72
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf
|
72
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
73
73
|
|
74
74
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
75
75
|
|
@@ -79,7 +79,7 @@ function _assertThisInitialized(self) { if (self === void 0) { throw new Referen
|
|
79
79
|
|
80
80
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
81
81
|
|
82
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
82
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
83
83
|
|
84
84
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
85
85
|
|
@@ -259,6 +259,9 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
259
259
|
scrollbarWidth += 15; // default scroll bar width if scroll bars are visible only when scrolling
|
260
260
|
}
|
261
261
|
|
262
|
+
this.addHook('beforeKeyDown', function (event) {
|
263
|
+
return _this3.onBeforeKeyDown(event);
|
264
|
+
});
|
262
265
|
choicesListHot.updateSettings({
|
263
266
|
colWidths: trimDropdown ? [(0, _element.outerWidth)(this.TEXTAREA) - 2] : void 0,
|
264
267
|
width: trimDropdown ? (0, _element.outerWidth)(this.TEXTAREA) + scrollbarWidth : void 0,
|
@@ -417,21 +420,20 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
417
420
|
}, {
|
418
421
|
key: "flipDropdownIfNeeded",
|
419
422
|
value: function flipDropdownIfNeeded() {
|
423
|
+
var trimmingContainer = (0, _element.getTrimmingContainer)(this.hot.view._wt.wtTable.TABLE);
|
424
|
+
var isWindowAsScrollableElement = trimmingContainer === this.hot.rootWindow;
|
425
|
+
var preventOverflow = this.cellProperties.preventOverflow;
|
426
|
+
|
427
|
+
if (isWindowAsScrollableElement || !isWindowAsScrollableElement && (preventOverflow || preventOverflow === 'horizontal')) {
|
428
|
+
return false;
|
429
|
+
}
|
430
|
+
|
420
431
|
var textareaOffset = (0, _element.offset)(this.TEXTAREA);
|
421
432
|
var textareaHeight = (0, _element.outerHeight)(this.TEXTAREA);
|
422
433
|
var dropdownHeight = this.getDropdownHeight();
|
423
|
-
var trimmingContainer = (0, _element.getTrimmingContainer)(this.hot.view.wt.wtTable.TABLE);
|
424
434
|
var trimmingContainerScrollTop = trimmingContainer.scrollTop;
|
425
|
-
var headersHeight = (0, _element.outerHeight)(this.hot.view.
|
426
|
-
var containerOffset =
|
427
|
-
row: 0,
|
428
|
-
col: 0
|
429
|
-
};
|
430
|
-
|
431
|
-
if (trimmingContainer !== this.hot.rootWindow) {
|
432
|
-
containerOffset = (0, _element.offset)(trimmingContainer);
|
433
|
-
}
|
434
|
-
|
435
|
+
var headersHeight = (0, _element.outerHeight)(this.hot.view._wt.wtTable.THEAD);
|
436
|
+
var containerOffset = (0, _element.offset)(trimmingContainer);
|
435
437
|
var spaceAbove = textareaOffset.top - containerOffset.top - headersHeight + trimmingContainerScrollTop;
|
436
438
|
var spaceBelow = trimmingContainer.scrollHeight - spaceAbove - headersHeight - textareaHeight;
|
437
439
|
var flipNeeded = dropdownHeight > spaceBelow && spaceAbove > spaceBelow;
|
@@ -449,7 +451,7 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
449
451
|
* Checks if the internal table should generate scrollbar or could be rendered without it.
|
450
452
|
*
|
451
453
|
* @private
|
452
|
-
* @param {number} spaceAvailable The free space as height
|
454
|
+
* @param {number} spaceAvailable The free space as height defined in px available for dropdown list.
|
453
455
|
* @param {number} dropdownHeight The dropdown height.
|
454
456
|
*/
|
455
457
|
|
@@ -463,7 +465,7 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
463
465
|
var height = null;
|
464
466
|
|
465
467
|
do {
|
466
|
-
lastRowHeight = this.htEditor.getRowHeight(i) || this.htEditor.view.
|
468
|
+
lastRowHeight = this.htEditor.getRowHeight(i) || this.htEditor.view._wt.getSetting('defaultRowHeight');
|
467
469
|
tempHeight += lastRowHeight;
|
468
470
|
i += 1;
|
469
471
|
} while (tempHeight < spaceAvailable);
|
@@ -502,12 +504,8 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
502
504
|
key: "unflipDropdown",
|
503
505
|
value: function unflipDropdown() {
|
504
506
|
var dropdownStyle = this.htEditor.rootElement.style;
|
505
|
-
|
506
|
-
|
507
|
-
dropdownStyle.position = '';
|
508
|
-
dropdownStyle.top = '';
|
509
|
-
}
|
510
|
-
|
507
|
+
dropdownStyle.position = 'absolute';
|
508
|
+
dropdownStyle.top = '';
|
511
509
|
this.htEditor.flipped = void 0;
|
512
510
|
}
|
513
511
|
/**
|
@@ -525,7 +523,8 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
525
523
|
height: this.getDropdownHeight(),
|
526
524
|
width: trimDropdown ? void 0 : currentDropdownWidth
|
527
525
|
});
|
528
|
-
|
526
|
+
|
527
|
+
this.htEditor.view._wt.wtTable.alignOverlaysWithTrimmingContainer();
|
529
528
|
}
|
530
529
|
/**
|
531
530
|
* Sets new height of the internal Handsontable's instance.
|
@@ -669,8 +668,6 @@ var AutocompleteEditor = /*#__PURE__*/function (_HandsontableEditor) {
|
|
669
668
|
}, timeOffset);
|
670
669
|
}
|
671
670
|
}
|
672
|
-
|
673
|
-
_get(_getPrototypeOf(AutocompleteEditor.prototype), "onBeforeKeyDown", this).call(this, event);
|
674
671
|
}
|
675
672
|
/**
|
676
673
|
* Filters and sorts by relevance.
|