handsontable 12.2.0 → 12.3.0-next-9dc4f5d-20221209
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/walkontable/src/border.js +13 -6
- package/3rdparty/walkontable/src/border.mjs +12 -5
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +10 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +10 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.js +10 -1
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +10 -1
- package/3rdparty/walkontable/src/cell/coords.d.ts +1 -1
- package/3rdparty/walkontable/src/cell/coords.js +64 -26
- package/3rdparty/walkontable/src/cell/coords.mjs +64 -26
- package/3rdparty/walkontable/src/cell/range.d.ts +19 -16
- package/3rdparty/walkontable/src/cell/range.js +199 -104
- package/3rdparty/walkontable/src/cell/range.mjs +201 -106
- package/3rdparty/walkontable/src/core/_base.js +17 -3
- package/3rdparty/walkontable/src/core/_base.mjs +20 -6
- package/3rdparty/walkontable/src/core/clone.js +13 -7
- package/3rdparty/walkontable/src/core/clone.mjs +15 -9
- package/3rdparty/walkontable/src/core/core.js +8 -2
- package/3rdparty/walkontable/src/core/core.mjs +10 -4
- package/3rdparty/walkontable/src/event.js +10 -1
- package/3rdparty/walkontable/src/event.mjs +10 -1
- package/3rdparty/walkontable/src/facade/core.js +16 -2
- package/3rdparty/walkontable/src/facade/core.mjs +22 -8
- package/3rdparty/walkontable/src/filter/column.js +16 -2
- package/3rdparty/walkontable/src/filter/column.mjs +16 -2
- package/3rdparty/walkontable/src/filter/row.js +16 -2
- package/3rdparty/walkontable/src/filter/row.mjs +16 -2
- package/3rdparty/walkontable/src/overlay/_base.js +17 -3
- package/3rdparty/walkontable/src/overlay/_base.mjs +24 -10
- package/3rdparty/walkontable/src/overlay/bottom.js +13 -7
- package/3rdparty/walkontable/src/overlay/bottom.mjs +15 -9
- package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.js +8 -2
- package/3rdparty/walkontable/src/overlay/bottomInlineStartCorner.mjs +10 -4
- package/3rdparty/walkontable/src/overlay/inlineStart.js +8 -2
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +10 -4
- package/3rdparty/walkontable/src/overlay/top.js +13 -7
- package/3rdparty/walkontable/src/overlay/top.mjs +15 -9
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +13 -7
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +15 -9
- package/3rdparty/walkontable/src/overlays.js +69 -19
- package/3rdparty/walkontable/src/overlays.mjs +71 -21
- package/3rdparty/walkontable/src/renderer/_base.js +16 -2
- package/3rdparty/walkontable/src/renderer/_base.mjs +20 -6
- package/3rdparty/walkontable/src/renderer/cells.js +8 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +20 -14
- package/3rdparty/walkontable/src/renderer/colGroup.js +8 -2
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +19 -13
- package/3rdparty/walkontable/src/renderer/columnHeaders.js +8 -2
- package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +19 -13
- package/3rdparty/walkontable/src/renderer/index.js +16 -2
- package/3rdparty/walkontable/src/renderer/index.mjs +20 -6
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +8 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +20 -14
- package/3rdparty/walkontable/src/renderer/rows.js +8 -3
- package/3rdparty/walkontable/src/renderer/rows.mjs +8 -3
- package/3rdparty/walkontable/src/renderer/table.js +16 -2
- package/3rdparty/walkontable/src/renderer/table.mjs +16 -2
- package/3rdparty/walkontable/src/scroll.js +16 -3
- package/3rdparty/walkontable/src/scroll.mjs +18 -5
- package/3rdparty/walkontable/src/selection.js +11 -5
- package/3rdparty/walkontable/src/selection.mjs +11 -5
- package/3rdparty/walkontable/src/settings.js +16 -2
- package/3rdparty/walkontable/src/settings.mjs +16 -2
- package/3rdparty/walkontable/src/table/bottom.js +8 -2
- package/3rdparty/walkontable/src/table/bottom.mjs +13 -7
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.js +8 -2
- package/3rdparty/walkontable/src/table/bottomInlineStartCorner.mjs +14 -8
- package/3rdparty/walkontable/src/table/inlineStart.js +8 -2
- package/3rdparty/walkontable/src/table/inlineStart.mjs +10 -4
- package/3rdparty/walkontable/src/table/master.js +8 -2
- package/3rdparty/walkontable/src/table/master.mjs +13 -7
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +12 -6
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +12 -6
- package/3rdparty/walkontable/src/table/top.js +8 -2
- package/3rdparty/walkontable/src/table/top.mjs +13 -7
- package/3rdparty/walkontable/src/table/topInlineStartCorner.js +8 -2
- package/3rdparty/walkontable/src/table/topInlineStartCorner.mjs +14 -8
- package/3rdparty/walkontable/src/table.js +13 -6
- package/3rdparty/walkontable/src/table.mjs +21 -14
- package/3rdparty/walkontable/src/utils/column.js +12 -2
- package/3rdparty/walkontable/src/utils/column.mjs +16 -6
- package/3rdparty/walkontable/src/utils/nodesPool.js +16 -2
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +16 -2
- package/3rdparty/walkontable/src/utils/orderView/sharedView.js +8 -2
- package/3rdparty/walkontable/src/utils/orderView/sharedView.mjs +12 -6
- package/3rdparty/walkontable/src/utils/orderView/view.js +16 -2
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +23 -9
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +16 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +16 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +16 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +31 -17
- package/3rdparty/walkontable/src/utils/row.js +16 -2
- package/3rdparty/walkontable/src/utils/row.mjs +16 -2
- package/3rdparty/walkontable/src/viewport.js +16 -2
- package/3rdparty/walkontable/src/viewport.mjs +18 -4
- package/CHANGELOG.md +23 -0
- package/base.d.ts +1 -0
- package/base.js +7 -2
- package/base.mjs +9 -4
- package/cellTypes/index.mjs +4 -3
- package/core.d.ts +1 -1
- package/core.js +234 -122
- package/core.mjs +231 -119
- package/dataMap/dataMap.js +98 -28
- package/dataMap/dataMap.mjs +97 -27
- package/dataMap/dataSource.js +14 -2
- package/dataMap/dataSource.mjs +17 -5
- package/dataMap/metaManager/index.js +15 -2
- package/dataMap/metaManager/index.mjs +41 -28
- package/dataMap/metaManager/lazyFactoryMap.js +7 -1
- package/dataMap/metaManager/lazyFactoryMap.mjs +7 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +13 -8
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +12 -7
- package/dataMap/metaManager/metaLayers/columnMeta.js +15 -2
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +23 -9
- package/dataMap/metaManager/metaLayers/globalMeta.js +26 -2
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +27 -3
- package/dataMap/metaManager/metaLayers/tableMeta.js +17 -3
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +41 -27
- package/dataMap/metaManager/metaSchema.js +119 -66
- package/dataMap/metaManager/metaSchema.mjs +119 -66
- package/dataMap/metaManager/mods/dynamicCellMeta.js +12 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +26 -16
- package/dataMap/metaManager/mods/extendMetaProperties.js +12 -2
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +10 -1
- package/dataMap/metaManager/utils.js +44 -14
- package/dataMap/metaManager/utils.mjs +51 -20
- package/dataMap/replaceData.js +2 -1
- package/dataMap/replaceData.mjs +24 -22
- package/dist/handsontable.css +9 -9
- package/dist/handsontable.full.css +9 -9
- package/dist/handsontable.full.js +7350 -10885
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +107 -113
- package/dist/handsontable.js +5800 -4499
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +3 -3
- package/dist/languages/all.js +111 -65
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.js +50 -4
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.js +52 -6
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.js +52 -6
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.js +53 -7
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.js +56 -10
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.js +56 -10
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.js +55 -9
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/it-IT.js +55 -9
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.js +83 -33
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.js +84 -33
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.js +85 -33
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.js +86 -33
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.js +87 -33
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.js +88 -33
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.js +68 -19
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.js +68 -19
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.js +55 -6
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.js +55 -6
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.js +55 -6
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +18 -9
- package/editorManager.mjs +15 -6
- package/editors/autocompleteEditor/autocompleteEditor.js +10 -5
- package/editors/autocompleteEditor/autocompleteEditor.mjs +9 -4
- package/editors/baseEditor/baseEditor.js +11 -6
- package/editors/baseEditor/baseEditor.mjs +10 -5
- package/editors/checkboxEditor/checkboxEditor.js +6 -1
- package/editors/checkboxEditor/checkboxEditor.mjs +6 -1
- package/editors/dateEditor/dateEditor.js +6 -1
- package/editors/dateEditor/dateEditor.mjs +6 -1
- package/editors/dropdownEditor/dropdownEditor.js +6 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +6 -1
- package/editors/handsontableEditor/handsontableEditor.js +6 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +6 -1
- package/editors/index.mjs +4 -3
- package/editors/numericEditor/numericEditor.js +6 -1
- package/editors/numericEditor/numericEditor.mjs +6 -1
- package/editors/passwordEditor/passwordEditor.js +6 -1
- package/editors/passwordEditor/passwordEditor.mjs +6 -1
- package/editors/registry.js +3 -0
- package/editors/registry.mjs +5 -1
- package/editors/selectEditor/selectEditor.js +6 -1
- package/editors/selectEditor/selectEditor.mjs +6 -1
- package/editors/textEditor/caretPositioner.mjs +11 -10
- package/editors/textEditor/textEditor.js +7 -2
- package/editors/textEditor/textEditor.mjs +7 -2
- package/editors/timeEditor/timeEditor.js +6 -1
- package/editors/timeEditor/timeEditor.mjs +6 -1
- package/eventManager.js +24 -9
- package/eventManager.mjs +26 -11
- package/helpers/console.mjs +6 -5
- package/helpers/data.d.ts +0 -1
- package/helpers/data.js +0 -49
- package/helpers/data.mjs +1 -49
- package/helpers/dom/element.js +23 -0
- package/helpers/dom/element.mjs +30 -7
- package/helpers/feature.js +9 -36
- package/helpers/feature.mjs +3 -30
- package/helpers/function.mjs +7 -6
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +9 -8
- package/helpers/object.js +15 -9
- package/helpers/object.mjs +17 -10
- package/helpers/string.mjs +7 -6
- package/helpers/templateLiteralTag.mjs +8 -7
- package/i18n/constants.js +49 -42
- package/i18n/constants.mjs +45 -41
- package/i18n/languages/ar-AR.js +12 -7
- package/i18n/languages/ar-AR.mjs +16 -2
- package/i18n/languages/cs-CZ.js +12 -7
- package/i18n/languages/cs-CZ.mjs +16 -2
- package/i18n/languages/de-CH.js +12 -7
- package/i18n/languages/de-CH.mjs +16 -2
- package/i18n/languages/de-DE.js +12 -7
- package/i18n/languages/de-DE.mjs +16 -2
- package/i18n/languages/en-US.js +13 -8
- package/i18n/languages/en-US.mjs +17 -3
- package/i18n/languages/es-MX.js +13 -8
- package/i18n/languages/es-MX.mjs +19 -4
- package/i18n/languages/fr-FR.js +12 -7
- package/i18n/languages/fr-FR.mjs +16 -2
- package/i18n/languages/it-IT.js +12 -7
- package/i18n/languages/it-IT.mjs +16 -2
- package/i18n/languages/ja-JP.js +12 -7
- package/i18n/languages/ja-JP.mjs +16 -2
- package/i18n/languages/ko-KR.js +12 -7
- package/i18n/languages/ko-KR.mjs +16 -2
- package/i18n/languages/lv-LV.js +13 -8
- package/i18n/languages/lv-LV.mjs +19 -5
- package/i18n/languages/nb-NO.js +12 -7
- package/i18n/languages/nb-NO.mjs +16 -2
- package/i18n/languages/nl-NL.js +13 -8
- package/i18n/languages/nl-NL.mjs +19 -5
- package/i18n/languages/pl-PL.js +13 -8
- package/i18n/languages/pl-PL.mjs +18 -4
- package/i18n/languages/pt-BR.js +12 -7
- package/i18n/languages/pt-BR.mjs +16 -2
- package/i18n/languages/ru-RU.js +12 -7
- package/i18n/languages/ru-RU.mjs +16 -2
- package/i18n/languages/sr-SP.js +12 -7
- package/i18n/languages/sr-SP.mjs +16 -2
- package/i18n/languages/zh-CN.js +12 -7
- package/i18n/languages/zh-CN.mjs +16 -2
- package/i18n/languages/zh-TW.js +12 -7
- package/i18n/languages/zh-TW.mjs +16 -2
- package/i18n/phraseFormatters/substituteVariables.mjs +9 -8
- package/i18n/utils.mjs +10 -9
- package/index.d.ts +9 -0
- package/index.js +4 -2
- package/index.mjs +2 -1
- package/languages/all.js +111 -65
- package/languages/ar-AR.js +50 -4
- package/languages/ar-AR.mjs +16 -2
- package/languages/cs-CZ.js +52 -6
- package/languages/cs-CZ.mjs +16 -2
- package/languages/de-CH.js +52 -6
- package/languages/de-CH.mjs +16 -2
- package/languages/de-DE.js +53 -7
- package/languages/de-DE.mjs +16 -2
- package/languages/en-US.js +56 -10
- package/languages/en-US.mjs +17 -3
- package/languages/es-MX.js +56 -10
- package/languages/es-MX.mjs +19 -4
- package/languages/fr-FR.js +55 -9
- package/languages/fr-FR.mjs +16 -2
- package/languages/index.js +111 -65
- package/languages/it-IT.js +55 -9
- package/languages/it-IT.mjs +16 -2
- package/languages/ja-JP.js +83 -33
- package/languages/ja-JP.mjs +16 -2
- package/languages/ko-KR.js +84 -33
- package/languages/ko-KR.mjs +16 -2
- package/languages/lv-LV.js +85 -33
- package/languages/lv-LV.mjs +19 -5
- package/languages/nb-NO.js +86 -33
- package/languages/nb-NO.mjs +16 -2
- package/languages/nl-NL.js +87 -33
- package/languages/nl-NL.mjs +19 -5
- package/languages/pl-PL.js +88 -33
- package/languages/pl-PL.mjs +18 -4
- package/languages/pt-BR.js +68 -19
- package/languages/pt-BR.mjs +16 -2
- package/languages/ru-RU.js +68 -19
- package/languages/ru-RU.mjs +16 -2
- package/languages/sr-SP.js +55 -6
- package/languages/sr-SP.mjs +16 -2
- package/languages/zh-CN.js +55 -6
- package/languages/zh-CN.mjs +16 -2
- package/languages/zh-TW.js +55 -6
- package/languages/zh-TW.mjs +16 -2
- package/mixins/hooksRefRegisterer.js +6 -3
- package/mixins/hooksRefRegisterer.mjs +6 -3
- package/mixins/localHooks.js +6 -3
- package/mixins/localHooks.mjs +6 -3
- package/package.json +2 -2
- package/pluginHooks.d.ts +7 -2
- package/pluginHooks.js +109 -24
- package/pluginHooks.mjs +109 -24
- package/plugins/autoColumnSize/autoColumnSize.js +7 -2
- package/plugins/autoColumnSize/autoColumnSize.mjs +7 -2
- package/plugins/autoRowSize/autoRowSize.js +16 -7
- package/plugins/autoRowSize/autoRowSize.mjs +16 -7
- package/plugins/autofill/autofill.js +7 -2
- package/plugins/autofill/autofill.mjs +7 -2
- package/plugins/base/base.js +8 -2
- package/plugins/base/base.mjs +8 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +6 -1
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +6 -1
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.js +6 -1
- package/plugins/bindRowsWithHeaders/maps/looseBindsMap.mjs +6 -1
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.js +6 -1
- package/plugins/bindRowsWithHeaders/maps/strictBindsMap.mjs +6 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +10 -5
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +9 -4
- package/plugins/columnSorting/columnSorting.js +8 -4
- package/plugins/columnSorting/columnSorting.mjs +8 -4
- package/plugins/columnSorting/columnStatesManager.js +12 -6
- package/plugins/columnSorting/columnStatesManager.mjs +9 -3
- package/plugins/columnSorting/rootComparator.mjs +8 -7
- package/plugins/columnSorting/sortFunction/checkbox.mjs +9 -8
- package/plugins/columnSorting/sortFunction/date.mjs +9 -8
- package/plugins/columnSorting/sortFunction/default.mjs +9 -8
- package/plugins/columnSorting/sortFunction/numeric.mjs +9 -8
- package/plugins/columnSummary/columnSummary.js +13 -8
- package/plugins/columnSummary/columnSummary.mjs +13 -8
- package/plugins/columnSummary/endpoints.js +17 -16
- package/plugins/columnSummary/endpoints.mjs +22 -21
- package/plugins/comments/commentEditor.js +16 -2
- package/plugins/comments/commentEditor.mjs +21 -7
- package/plugins/comments/comments.js +15 -4
- package/plugins/comments/comments.mjs +15 -4
- package/plugins/comments/displaySwitch.js +14 -1
- package/plugins/comments/displaySwitch.mjs +14 -1
- package/plugins/contextMenu/commandExecutor.js +22 -7
- package/plugins/contextMenu/commandExecutor.mjs +27 -12
- package/plugins/contextMenu/contextMenu.d.ts +4 -3
- package/plugins/contextMenu/contextMenu.js +7 -17
- package/plugins/contextMenu/contextMenu.mjs +7 -17
- package/plugins/contextMenu/cursor.js +16 -2
- package/plugins/contextMenu/cursor.mjs +21 -7
- package/plugins/contextMenu/itemsFactory.js +23 -8
- package/plugins/contextMenu/itemsFactory.mjs +28 -13
- package/plugins/contextMenu/menu.js +14 -3
- package/plugins/contextMenu/menu.mjs +13 -2
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +1 -1
- package/plugins/contextMenu/predefinedItems.js +12 -7
- package/plugins/contextMenu/predefinedItems.mjs +14 -1
- package/plugins/contextMenu/utils.mjs +5 -4
- package/plugins/copyPaste/clipboardData.js +16 -2
- package/plugins/copyPaste/clipboardData.mjs +16 -2
- package/plugins/copyPaste/contextMenuItem/copy.js +4 -16
- package/plugins/copyPaste/contextMenuItem/copy.mjs +8 -7
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +35 -0
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +31 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +5 -4
- package/plugins/copyPaste/copyPaste.d.ts +10 -2
- package/plugins/copyPaste/copyPaste.js +303 -202
- package/plugins/copyPaste/copyPaste.mjs +303 -202
- package/plugins/copyPaste/copyableRanges.js +269 -0
- package/plugins/copyPaste/copyableRanges.mjs +264 -0
- package/plugins/copyPaste/focusableElement.js +12 -2
- package/plugins/copyPaste/focusableElement.mjs +15 -5
- package/plugins/copyPaste/pasteEvent.js +16 -2
- package/plugins/copyPaste/pasteEvent.mjs +18 -4
- package/plugins/customBorders/contextMenuItem/bottom.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/left.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/noBorders.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/right.mjs +5 -4
- package/plugins/customBorders/contextMenuItem/top.mjs +5 -4
- package/plugins/customBorders/customBorders.js +12 -7
- package/plugins/customBorders/customBorders.mjs +11 -6
- package/plugins/customBorders/utils.mjs +8 -7
- package/plugins/dragToScroll/dragToScroll.js +6 -1
- package/plugins/dragToScroll/dragToScroll.mjs +6 -1
- package/plugins/dropdownMenu/dropdownMenu.js +6 -1
- package/plugins/dropdownMenu/dropdownMenu.mjs +6 -1
- package/plugins/exportFile/dataProvider.js +13 -6
- package/plugins/exportFile/dataProvider.mjs +12 -5
- package/plugins/exportFile/exportFile.js +8 -3
- package/plugins/exportFile/exportFile.mjs +6 -1
- package/plugins/exportFile/typeFactory.js +14 -1
- package/plugins/exportFile/typeFactory.mjs +14 -1
- package/plugins/exportFile/types/_base.js +16 -2
- package/plugins/exportFile/types/_base.mjs +18 -4
- package/plugins/exportFile/types/csv.js +6 -1
- package/plugins/exportFile/types/csv.mjs +6 -1
- package/plugins/filters/component/_base.js +16 -2
- package/plugins/filters/component/_base.mjs +19 -5
- package/plugins/filters/component/actionBar.js +10 -4
- package/plugins/filters/component/actionBar.mjs +11 -5
- package/plugins/filters/component/condition.js +10 -4
- package/plugins/filters/component/condition.mjs +11 -5
- package/plugins/filters/component/operators.js +8 -3
- package/plugins/filters/component/operators.mjs +8 -3
- package/plugins/filters/component/value.js +9 -3
- package/plugins/filters/component/value.mjs +12 -6
- package/plugins/filters/condition/beginsWith.js +1 -1
- package/plugins/filters/condition/beginsWith.mjs +1 -1
- package/plugins/filters/condition/between.js +1 -1
- package/plugins/filters/condition/between.mjs +1 -1
- package/plugins/filters/condition/byValue.js +1 -1
- package/plugins/filters/condition/byValue.mjs +1 -1
- package/plugins/filters/condition/contains.js +1 -1
- package/plugins/filters/condition/contains.mjs +1 -1
- package/plugins/filters/condition/date/after.js +1 -1
- package/plugins/filters/condition/date/after.mjs +1 -1
- package/plugins/filters/condition/date/before.js +1 -1
- package/plugins/filters/condition/date/before.mjs +1 -1
- package/plugins/filters/condition/endsWith.js +1 -1
- package/plugins/filters/condition/endsWith.mjs +1 -1
- package/plugins/filters/condition/equal.js +1 -1
- package/plugins/filters/condition/equal.mjs +1 -1
- package/plugins/filters/condition/greaterThan.js +1 -1
- package/plugins/filters/condition/greaterThan.mjs +1 -1
- package/plugins/filters/condition/greaterThanOrEqual.js +1 -1
- package/plugins/filters/condition/greaterThanOrEqual.mjs +1 -1
- package/plugins/filters/condition/lessThan.js +1 -1
- package/plugins/filters/condition/lessThan.mjs +1 -1
- package/plugins/filters/condition/lessThanOrEqual.js +1 -1
- package/plugins/filters/condition/lessThanOrEqual.mjs +1 -1
- package/plugins/filters/conditionCollection.js +10 -4
- package/plugins/filters/conditionCollection.mjs +18 -12
- package/plugins/filters/conditionUpdateObserver.js +15 -2
- package/plugins/filters/conditionUpdateObserver.mjs +23 -10
- package/plugins/filters/constants.js +14 -1
- package/plugins/filters/constants.mjs +14 -1
- package/plugins/filters/dataFilter.js +16 -2
- package/plugins/filters/dataFilter.mjs +19 -5
- package/plugins/filters/filters.js +7 -2
- package/plugins/filters/filters.mjs +7 -2
- package/plugins/filters/ui/_base.js +12 -7
- package/plugins/filters/ui/_base.mjs +14 -1
- package/plugins/filters/ui/input.js +6 -1
- package/plugins/filters/ui/input.mjs +6 -1
- package/plugins/filters/ui/link.js +6 -1
- package/plugins/filters/ui/link.mjs +6 -1
- package/plugins/filters/ui/multipleSelect.js +14 -8
- package/plugins/filters/ui/multipleSelect.mjs +6 -1
- package/plugins/filters/ui/radioInput.js +6 -1
- package/plugins/filters/ui/radioInput.mjs +6 -1
- package/plugins/filters/ui/select.js +6 -1
- package/plugins/filters/ui/select.mjs +6 -1
- package/plugins/formulas/engine/register.mjs +6 -5
- package/plugins/formulas/engine/settings.js +12 -1
- package/plugins/formulas/engine/settings.mjs +12 -1
- package/plugins/formulas/formulas.js +24 -11
- package/plugins/formulas/formulas.mjs +24 -11
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.mjs +6 -5
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +5 -4
- package/plugins/hiddenColumns/hiddenColumns.js +5 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +5 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/hideRow.mjs +6 -5
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +5 -4
- package/plugins/hiddenRows/hiddenRows.js +5 -1
- package/plugins/hiddenRows/hiddenRows.mjs +5 -1
- package/plugins/index.mjs +4 -3
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.mjs +6 -5
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.mjs +6 -5
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +6 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +6 -1
- package/plugins/manualColumnMove/manualColumnMove.js +6 -1
- package/plugins/manualColumnMove/manualColumnMove.mjs +6 -1
- package/plugins/manualColumnMove/ui/_base.js +14 -1
- package/plugins/manualColumnMove/ui/_base.mjs +14 -1
- package/plugins/manualColumnMove/ui/backlight.js +6 -1
- package/plugins/manualColumnMove/ui/backlight.mjs +6 -1
- package/plugins/manualColumnMove/ui/guideline.js +6 -1
- package/plugins/manualColumnMove/ui/guideline.mjs +6 -1
- package/plugins/manualColumnResize/manualColumnResize.js +6 -1
- package/plugins/manualColumnResize/manualColumnResize.mjs +6 -1
- package/plugins/manualRowMove/manualRowMove.js +6 -1
- package/plugins/manualRowMove/manualRowMove.mjs +6 -1
- package/plugins/manualRowMove/ui/_base.js +14 -1
- package/plugins/manualRowMove/ui/_base.mjs +14 -1
- package/plugins/manualRowMove/ui/backlight.js +6 -1
- package/plugins/manualRowMove/ui/backlight.mjs +6 -1
- package/plugins/manualRowMove/ui/guideline.js +6 -1
- package/plugins/manualRowMove/ui/guideline.mjs +6 -1
- package/plugins/manualRowResize/manualRowResize.js +6 -1
- package/plugins/manualRowResize/manualRowResize.mjs +6 -1
- package/plugins/mergeCells/calculations/autofill.js +13 -6
- package/plugins/mergeCells/calculations/autofill.mjs +15 -8
- package/plugins/mergeCells/calculations/selection.js +16 -2
- package/plugins/mergeCells/calculations/selection.mjs +16 -2
- package/plugins/mergeCells/cellCoords.js +16 -2
- package/plugins/mergeCells/cellCoords.mjs +21 -7
- package/plugins/mergeCells/cellsCollection.js +12 -5
- package/plugins/mergeCells/cellsCollection.mjs +14 -7
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +5 -4
- package/plugins/mergeCells/mergeCells.js +7 -2
- package/plugins/mergeCells/mergeCells.mjs +7 -2
- package/plugins/multiColumnSorting/multiColumnSorting.js +6 -1
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +6 -1
- package/plugins/multiColumnSorting/rootComparator.mjs +8 -7
- package/plugins/multiColumnSorting/utils.mjs +4 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +6 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +6 -1
- package/plugins/nestedHeaders/nestedHeaders.js +124 -16
- package/plugins/nestedHeaders/nestedHeaders.mjs +131 -23
- package/plugins/nestedHeaders/stateManager/headersTree.js +10 -3
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +10 -3
- package/plugins/nestedHeaders/stateManager/index.js +34 -14
- package/plugins/nestedHeaders/stateManager/index.mjs +67 -47
- package/plugins/nestedHeaders/stateManager/matrixGenerator.mjs +33 -31
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +18 -17
- package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +17 -16
- package/plugins/nestedHeaders/stateManager/nodeModifiers/hideColumn.mjs +7 -6
- package/plugins/nestedHeaders/stateManager/nodeModifiers/index.mjs +2 -1
- package/plugins/nestedHeaders/stateManager/nodeModifiers/showColumn.mjs +7 -6
- package/plugins/nestedHeaders/stateManager/settingsNormalizer.mjs +41 -39
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +11 -3
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +23 -14
- package/plugins/nestedHeaders/utils/ghostTable.js +17 -3
- package/plugins/nestedHeaders/utils/ghostTable.mjs +24 -10
- package/plugins/nestedRows/data/dataManager.js +10 -4
- package/plugins/nestedRows/data/dataManager.mjs +12 -6
- package/plugins/nestedRows/nestedRows.js +6 -1
- package/plugins/nestedRows/nestedRows.mjs +6 -1
- package/plugins/nestedRows/ui/_base.js +16 -2
- package/plugins/nestedRows/ui/_base.mjs +16 -2
- package/plugins/nestedRows/ui/collapsing.js +8 -2
- package/plugins/nestedRows/ui/collapsing.mjs +14 -8
- package/plugins/nestedRows/ui/contextMenu.js +7 -2
- package/plugins/nestedRows/ui/contextMenu.mjs +6 -1
- package/plugins/nestedRows/ui/headers.js +8 -2
- package/plugins/nestedRows/ui/headers.mjs +14 -8
- package/plugins/nestedRows/utils/rowMoveController.js +11 -4
- package/plugins/nestedRows/utils/rowMoveController.mjs +25 -18
- package/plugins/persistentState/persistentState.js +6 -1
- package/plugins/persistentState/persistentState.mjs +6 -1
- package/plugins/persistentState/storage.js +16 -2
- package/plugins/persistentState/storage.mjs +19 -5
- package/plugins/registry.js +1 -1
- package/plugins/registry.mjs +3 -2
- package/plugins/search/search.js +6 -1
- package/plugins/search/search.mjs +6 -1
- package/plugins/touchScroll/touchScroll.js +6 -1
- package/plugins/touchScroll/touchScroll.mjs +6 -1
- package/plugins/trimRows/trimRows.js +5 -1
- package/plugins/trimRows/trimRows.mjs +5 -1
- package/plugins/undoRedo/undoRedo.js +50 -32
- package/plugins/undoRedo/undoRedo.mjs +50 -32
- package/registry.mjs +2 -1
- package/renderers/baseRenderer/baseRenderer.mjs +2 -1
- package/renderers/index.mjs +4 -3
- package/selection/highlight/highlight.js +10 -3
- package/selection/highlight/highlight.mjs +24 -17
- package/selection/highlight/types/activeHeader.js +13 -2
- package/selection/highlight/types/activeHeader.mjs +19 -7
- package/selection/highlight/types/area.js +13 -2
- package/selection/highlight/types/area.mjs +22 -10
- package/selection/highlight/types/cell.js +13 -2
- package/selection/highlight/types/cell.mjs +22 -10
- package/selection/highlight/types/customSelection.js +13 -2
- package/selection/highlight/types/customSelection.mjs +23 -11
- package/selection/highlight/types/fill.js +14 -3
- package/selection/highlight/types/fill.mjs +22 -10
- package/selection/highlight/types/header.js +13 -2
- package/selection/highlight/types/header.mjs +24 -12
- package/selection/highlight/types/index.js +14 -3
- package/selection/highlight/types/index.mjs +14 -3
- package/selection/highlight/visualSelection.js +11 -6
- package/selection/highlight/visualSelection.mjs +11 -6
- package/selection/mouseEventHandler.mjs +14 -13
- package/selection/range.js +9 -2
- package/selection/range.mjs +9 -2
- package/selection/selection.js +13 -6
- package/selection/selection.mjs +21 -14
- package/selection/transformation.js +16 -2
- package/selection/transformation.mjs +24 -10
- package/selection/utils.js +1 -1
- package/selection/utils.mjs +1 -1
- package/shortcuts/context.js +1 -1
- package/shortcuts/context.mjs +1 -1
- package/shortcuts/keyObserver.js +8 -4
- package/shortcuts/keyObserver.mjs +8 -4
- package/shortcuts/manager.js +1 -1
- package/shortcuts/manager.mjs +1 -1
- package/tableView.js +147 -68
- package/tableView.mjs +147 -68
- package/translations/changesObservable/observable.js +12 -2
- package/translations/changesObservable/observable.mjs +19 -9
- package/translations/changesObservable/observer.js +12 -2
- package/translations/changesObservable/observer.mjs +17 -7
- package/translations/indexMapper.js +12 -6
- package/translations/indexMapper.mjs +17 -11
- package/translations/mapCollections/aggregatedCollection.js +8 -2
- package/translations/mapCollections/aggregatedCollection.mjs +11 -5
- package/translations/mapCollections/mapCollection.js +10 -1
- package/translations/mapCollections/mapCollection.mjs +10 -1
- package/translations/maps/hidingMap.js +8 -2
- package/translations/maps/hidingMap.mjs +13 -7
- package/translations/maps/indexMap.js +16 -2
- package/translations/maps/indexMap.mjs +20 -6
- package/translations/maps/indexesSequence.js +8 -2
- package/translations/maps/indexesSequence.mjs +14 -8
- package/translations/maps/linkedPhysicalIndexToValueMap.js +12 -6
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +18 -12
- package/translations/maps/physicalIndexToValueMap.js +8 -2
- package/translations/maps/physicalIndexToValueMap.mjs +14 -8
- package/translations/maps/trimmingMap.js +8 -2
- package/translations/maps/trimmingMap.mjs +13 -7
- package/translations/maps/utils/actionsOnIndexes.mjs +9 -8
- package/translations/maps/utils/indexesSequence.mjs +10 -9
- package/translations/maps/utils/physicallyIndexed.mjs +11 -10
- package/utils/dataStructures/linkedList.js +21 -7
- package/utils/dataStructures/linkedList.mjs +21 -7
- package/utils/dataStructures/priorityMap.js +1 -1
- package/utils/dataStructures/priorityMap.mjs +1 -1
- package/utils/dataStructures/queue.js +16 -2
- package/utils/dataStructures/queue.mjs +16 -2
- package/utils/dataStructures/stack.js +16 -2
- package/utils/dataStructures/stack.mjs +16 -2
- package/utils/dataStructures/tree.js +8 -2
- package/utils/dataStructures/tree.mjs +8 -2
- package/utils/dataStructures/uniqueMap.js +1 -1
- package/utils/dataStructures/uniqueMap.mjs +1 -1
- package/utils/ghostTable.js +12 -5
- package/utils/ghostTable.mjs +12 -5
- package/utils/interval.js +23 -8
- package/utils/interval.mjs +18 -4
- package/utils/samplesGenerator.js +13 -3
- package/utils/samplesGenerator.mjs +15 -5
- package/validators/index.mjs +4 -3
package/core.mjs
CHANGED
@@ -8,7 +8,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
8
8
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
9
9
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
10
10
|
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."); }
|
11
|
-
function _iterableToArrayLimit(arr, i) { var _i =
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
12
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
13
13
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
14
14
|
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,7 +39,7 @@ import "core-js/modules/web.dom-collections.for-each.js";
|
|
39
39
|
import "core-js/modules/web.timers.js";
|
40
40
|
import "core-js/modules/web.immediate.js";
|
41
41
|
import "core-js/modules/es.map.js";
|
42
|
-
import { addClass, empty, removeClass } from "./helpers/dom/element.mjs";
|
42
|
+
import { addClass, empty, observeVisibilityChangeOnce, removeClass } from "./helpers/dom/element.mjs";
|
43
43
|
import { isFunction } from "./helpers/function.mjs";
|
44
44
|
import { isDefined, isUndefined, isRegExp, _injectProductInfo, isEmpty } from "./helpers/mixed.mjs";
|
45
45
|
import { isMobileBrowser, isIpadOS } from "./helpers/browser.mjs";
|
@@ -52,12 +52,13 @@ import { arrayMap, arrayEach, arrayReduce, getDifferenceOfArrays, stringToArray,
|
|
52
52
|
import { instanceToHTML } from "./utils/parseTable.mjs";
|
53
53
|
import { getPlugin, getPluginsNames } from "./plugins/registry.mjs";
|
54
54
|
import { getRenderer } from "./renderers/registry.mjs";
|
55
|
+
import { getEditor } from "./editors/registry.mjs";
|
55
56
|
import { getValidator } from "./validators/registry.mjs";
|
56
57
|
import { randomString, toUpperCaseFirst } from "./helpers/string.mjs";
|
57
58
|
import { rangeEach, rangeEachReverse, isNumericLike } from "./helpers/number.mjs";
|
58
59
|
import TableView from "./tableView.mjs";
|
59
60
|
import DataSource from "./dataMap/dataSource.mjs";
|
60
|
-
import {
|
61
|
+
import { spreadsheetColumnLabel } from "./helpers/data.mjs";
|
61
62
|
import { IndexMapper } from "./translations/index.mjs";
|
62
63
|
import { registerAsRootInstance, hasValidParameter, isRootInstance } from "./utils/rootInstance.mjs";
|
63
64
|
import { ViewportColumnsCalculator } from "./3rdparty/walkontable/src/index.mjs";
|
@@ -80,37 +81,41 @@ var deprecationWarns = new Set();
|
|
80
81
|
* @class Core
|
81
82
|
* @description
|
82
83
|
*
|
83
|
-
* The `Handsontable` class
|
84
|
+
* The `Handsontable` class (known as the `Core`) lets you modify the grid's behavior by using Handsontable's public API methods.
|
85
|
+
*
|
86
|
+
* ::: only-for react
|
87
|
+
* To use these methods, associate a Handsontable instance with your instance
|
88
|
+
* of the [`HotTable` component](@/guides/getting-started/installation.md#use-the-hottable-component),
|
89
|
+
* by using React's `ref` feature (read more on the [Instance methods](@/guides/getting-started/react-methods.md) page).
|
90
|
+
* :::
|
84
91
|
*
|
85
92
|
* ## How to call a method
|
86
93
|
*
|
87
94
|
* ::: only-for javascript
|
88
95
|
* ```js
|
89
|
-
* //
|
96
|
+
* // create a Handsontable instance
|
90
97
|
* const hot = new Handsontable(document.getElementById('example'), options);
|
91
98
|
*
|
92
|
-
* //
|
99
|
+
* // call a method
|
93
100
|
* hot.setDataAtCell(0, 0, 'new value');
|
94
101
|
* ```
|
95
102
|
* :::
|
96
103
|
*
|
97
104
|
* ::: only-for react
|
98
|
-
* ```jsx
|
99
|
-
*
|
105
|
+
* ```jsx{3,7,13}
|
106
|
+
* import { useRef } from 'react';
|
100
107
|
*
|
101
|
-
*
|
108
|
+
* const hotTableComponent = useRef(null);
|
102
109
|
*
|
103
|
-
* // First, let's contruct Handsontable
|
104
110
|
* <HotTable
|
105
|
-
*
|
111
|
+
* // associate your `HotTable` component with a Handsontable instance
|
112
|
+
* ref={hotTableComponent}
|
106
113
|
* settings={options}
|
107
114
|
* />
|
108
115
|
*
|
109
|
-
*
|
110
|
-
*
|
111
|
-
*
|
112
|
-
* // Then, let's use the setDataAtCell method
|
113
|
-
* hot.setDataAtCell(0, 0, 'new value');
|
116
|
+
* // access the Handsontable instance, under the `.current.hotInstance` property
|
117
|
+
* // call a method
|
118
|
+
* hotTableComponent.current.hotInstance.setDataAtCell(0, 0, 'new value');
|
114
119
|
* ```
|
115
120
|
* :::
|
116
121
|
*
|
@@ -441,7 +446,8 @@ export default function Core(rootElement, userSettings) {
|
|
441
446
|
* @param {number} [amount=1] Amount of rows or columns to remove.
|
442
447
|
* @param {string} [source] Optional. Source of hook runner.
|
443
448
|
* @param {boolean} [keepEmptyRows] Optional. Flag for preventing deletion of empty rows.
|
444
|
-
*/
|
449
|
+
*/
|
450
|
+
alter: function alter(action, index) {
|
445
451
|
var _index, _index2;
|
446
452
|
var amount = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
447
453
|
var source = arguments.length > 3 ? arguments[3] : undefined;
|
@@ -516,7 +522,6 @@ export default function Core(rootElement, userSettings) {
|
|
516
522
|
rowDelta = _datamap$createRow.delta,
|
517
523
|
startRowPhysicalIndex = _datamap$createRow.startPhysicalIndex;
|
518
524
|
if (rowDelta) {
|
519
|
-
metaManager.createRow(startRowPhysicalIndex, amount);
|
520
525
|
var currentSelectedRange = selection.selectedRange.current();
|
521
526
|
var currentFromRange = currentSelectedRange === null || currentSelectedRange === void 0 ? void 0 : currentSelectedRange.from;
|
522
527
|
var currentFromRow = currentFromRange === null || currentFromRange === void 0 ? void 0 : currentFromRange.row;
|
@@ -572,7 +577,6 @@ export default function Core(rootElement, userSettings) {
|
|
572
577
|
colDelta = _datamap$createCol.delta,
|
573
578
|
startColumnPhysicalIndex = _datamap$createCol.startPhysicalIndex;
|
574
579
|
if (colDelta) {
|
575
|
-
metaManager.createColumn(startColumnPhysicalIndex, amount);
|
576
580
|
if (Array.isArray(tableMeta.colHeaders)) {
|
577
581
|
var spliceArray = [instance.toVisualColumn(startColumnPhysicalIndex), 0];
|
578
582
|
spliceArray.length += colDelta; // inserts empty (undefined) elements at the end of an array
|
@@ -635,7 +639,6 @@ export default function Core(rootElement, userSettings) {
|
|
635
639
|
if (!wasRemoved) {
|
636
640
|
return;
|
637
641
|
}
|
638
|
-
metaManager.removeRow(instance.toPhysicalRow(calcIndex), groupAmount);
|
639
642
|
var totalRows = instance.countRows();
|
640
643
|
var fixedRowsTop = tableMeta.fixedRowsTop;
|
641
644
|
if (fixedRowsTop >= calcIndex + 1) {
|
@@ -681,7 +684,6 @@ export default function Core(rootElement, userSettings) {
|
|
681
684
|
if (!wasRemoved) {
|
682
685
|
return;
|
683
686
|
}
|
684
|
-
metaManager.removeColumn(physicalColumnIndex, groupAmount);
|
685
687
|
var fixedColumnsStart = tableMeta.fixedColumnsStart;
|
686
688
|
if (fixedColumnsStart >= calcIndex + 1) {
|
687
689
|
tableMeta.fixedColumnsStart -= Math.min(groupAmount, fixedColumnsStart - calcIndex);
|
@@ -715,7 +717,8 @@ export default function Core(rootElement, userSettings) {
|
|
715
717
|
* Makes sure there are empty rows at the bottom of the table.
|
716
718
|
*
|
717
719
|
* @private
|
718
|
-
*/
|
720
|
+
*/
|
721
|
+
adjustRowsAndCols: function adjustRowsAndCols() {
|
719
722
|
var minRows = tableMeta.minRows;
|
720
723
|
var minSpareRows = tableMeta.minSpareRows;
|
721
724
|
var minCols = tableMeta.minCols;
|
@@ -841,7 +844,8 @@ export default function Core(rootElement, userSettings) {
|
|
841
844
|
* @param {Array} deltas The deltas array. A difference between values of adjacent cells.
|
842
845
|
* Useful **only** when the type of handled cells is `numeric`.
|
843
846
|
* @returns {object|undefined} Ending td in pasted area (only if any cell was changed).
|
844
|
-
*/
|
847
|
+
*/
|
848
|
+
populateFromArray: function populateFromArray(start, input, end, source, method, direction, deltas) {
|
845
849
|
// TODO: either remove or implement the `direction` argument. Currently it's not working at all.
|
846
850
|
var r;
|
847
851
|
var rlen;
|
@@ -1016,8 +1020,8 @@ export default function Core(rootElement, userSettings) {
|
|
1016
1020
|
var orgValueSchema = duckSchema(Array.isArray(orgValue) ? orgValue : orgValue[0] || orgValue);
|
1017
1021
|
var valueSchema = duckSchema(Array.isArray(value) ? value : value[0] || value);
|
1018
1022
|
|
1019
|
-
|
1020
|
-
if (isObjectEqual(orgValueSchema, valueSchema)) {
|
1023
|
+
// Allow overwriting values with the same object-based schema or any array-based schema.
|
1024
|
+
if (isObjectEqual(orgValueSchema, valueSchema) || Array.isArray(orgValueSchema) && Array.isArray(valueSchema)) {
|
1021
1025
|
value = deepClone(value);
|
1022
1026
|
} else {
|
1023
1027
|
pushData = false;
|
@@ -1101,6 +1105,16 @@ export default function Core(rootElement, userSettings) {
|
|
1101
1105
|
instance.runHooks('init');
|
1102
1106
|
this.forceFullRender = true; // used when data was changed
|
1103
1107
|
this.view.render();
|
1108
|
+
|
1109
|
+
// Run the logic only if it's the table's initialization and the root element is not visible.
|
1110
|
+
if (!!firstRun && instance.rootElement.offsetParent === null) {
|
1111
|
+
observeVisibilityChangeOnce(instance.rootElement, function () {
|
1112
|
+
// Update the spreader size cache before rendering.
|
1113
|
+
instance.view._wt.wtOverlays.updateLastSpreaderSize();
|
1114
|
+
instance.render();
|
1115
|
+
instance.view.adjustElementsSize();
|
1116
|
+
});
|
1117
|
+
}
|
1104
1118
|
if (_typeof(firstRun) === 'object') {
|
1105
1119
|
instance.runHooks('afterChange', firstRun[0], firstRun[1]);
|
1106
1120
|
firstRun = false;
|
@@ -1254,9 +1268,7 @@ export default function Core(rootElement, userSettings) {
|
|
1254
1268
|
source: source
|
1255
1269
|
}),
|
1256
1270
|
numberOfCreatedRows = _datamap$createRow2.delta;
|
1257
|
-
if (numberOfCreatedRows
|
1258
|
-
metaManager.createRow(null, numberOfCreatedRows);
|
1259
|
-
} else {
|
1271
|
+
if (numberOfCreatedRows === 0) {
|
1260
1272
|
skipThisChange = true;
|
1261
1273
|
break;
|
1262
1274
|
}
|
@@ -1268,9 +1280,7 @@ export default function Core(rootElement, userSettings) {
|
|
1268
1280
|
source: source
|
1269
1281
|
}),
|
1270
1282
|
numberOfCreatedColumns = _datamap$createCol2.delta;
|
1271
|
-
if (numberOfCreatedColumns
|
1272
|
-
metaManager.createColumn(null, numberOfCreatedColumns);
|
1273
|
-
} else {
|
1283
|
+
if (numberOfCreatedColumns === 0) {
|
1274
1284
|
skipThisChange = true;
|
1275
1285
|
break;
|
1276
1286
|
}
|
@@ -2095,6 +2105,7 @@ export default function Core(rootElement, userSettings) {
|
|
2095
2105
|
dataSource: dataSource,
|
2096
2106
|
internalSource: 'updateData',
|
2097
2107
|
source: source,
|
2108
|
+
metaManager: metaManager,
|
2098
2109
|
firstRun: firstRun
|
2099
2110
|
});
|
2100
2111
|
};
|
@@ -2137,6 +2148,7 @@ export default function Core(rootElement, userSettings) {
|
|
2137
2148
|
dataSource: dataSource,
|
2138
2149
|
internalSource: 'loadData',
|
2139
2150
|
source: source,
|
2151
|
+
metaManager: metaManager,
|
2140
2152
|
firstRun: firstRun
|
2141
2153
|
});
|
2142
2154
|
};
|
@@ -3119,16 +3131,15 @@ export default function Core(rootElement, userSettings) {
|
|
3119
3131
|
this.isColumnModificationAllowed = function () {
|
3120
3132
|
return !(instance.dataType === 'object' || tableMeta.columns);
|
3121
3133
|
};
|
3122
|
-
var rendererLookup = cellMethodLookupFactory('renderer');
|
3123
3134
|
|
3124
3135
|
/**
|
3125
3136
|
* Returns the cell renderer function by given `row` and `column` arguments.
|
3126
3137
|
*
|
3127
3138
|
* @memberof Core#
|
3128
3139
|
* @function getCellRenderer
|
3129
|
-
* @param {number|object}
|
3140
|
+
* @param {number|object} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3130
3141
|
* @param {number} column Visual column index.
|
3131
|
-
* @returns {Function}
|
3142
|
+
* @returns {Function} Returns the renderer function.
|
3132
3143
|
* @example
|
3133
3144
|
* ```js
|
3134
3145
|
* // Get cell renderer using `row` and `column` coordinates.
|
@@ -3137,8 +3148,12 @@ export default function Core(rootElement, userSettings) {
|
|
3137
3148
|
* hot.getCellRenderer(hot.getCellMeta(1, 1));
|
3138
3149
|
* ```
|
3139
3150
|
*/
|
3140
|
-
this.getCellRenderer = function (
|
3141
|
-
|
3151
|
+
this.getCellRenderer = function (rowOrMeta, column) {
|
3152
|
+
var cellRenderer = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).renderer : rowOrMeta.renderer;
|
3153
|
+
if (typeof cellRenderer === 'string') {
|
3154
|
+
return getRenderer(cellRenderer);
|
3155
|
+
}
|
3156
|
+
return isUndefined(cellRenderer) ? getRenderer('text') : cellRenderer;
|
3142
3157
|
};
|
3143
3158
|
|
3144
3159
|
/**
|
@@ -3146,9 +3161,9 @@ export default function Core(rootElement, userSettings) {
|
|
3146
3161
|
*
|
3147
3162
|
* @memberof Core#
|
3148
3163
|
* @function getCellEditor
|
3149
|
-
* @param {number}
|
3164
|
+
* @param {number} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3150
3165
|
* @param {number} column Visual column index.
|
3151
|
-
* @returns {Function}
|
3166
|
+
* @returns {Function|boolean} Returns the editor class or `false` is cell editor is disabled.
|
3152
3167
|
* @example
|
3153
3168
|
* ```js
|
3154
3169
|
* // Get cell editor class using `row` and `column` coordinates.
|
@@ -3157,31 +3172,36 @@ export default function Core(rootElement, userSettings) {
|
|
3157
3172
|
* hot.getCellEditor(hot.getCellMeta(1, 1));
|
3158
3173
|
* ```
|
3159
3174
|
*/
|
3160
|
-
this.getCellEditor =
|
3161
|
-
|
3175
|
+
this.getCellEditor = function (rowOrMeta, column) {
|
3176
|
+
var cellEditor = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).editor : rowOrMeta.editor;
|
3177
|
+
if (typeof cellEditor === 'string') {
|
3178
|
+
return getEditor(cellEditor);
|
3179
|
+
}
|
3180
|
+
return isUndefined(cellEditor) ? getEditor('text') : cellEditor;
|
3181
|
+
};
|
3162
3182
|
|
3163
3183
|
/**
|
3164
3184
|
* Returns the cell validator by `row` and `column`.
|
3165
3185
|
*
|
3166
3186
|
* @memberof Core#
|
3167
3187
|
* @function getCellValidator
|
3168
|
-
* @param {number|object}
|
3188
|
+
* @param {number|object} rowOrMeta Visual row index or cell meta object (see {@link Core#getCellMeta}).
|
3169
3189
|
* @param {number} column Visual column index.
|
3170
3190
|
* @returns {Function|RegExp|undefined} The validator function.
|
3171
3191
|
* @example
|
3172
3192
|
* ```js
|
3173
|
-
* // Get cell
|
3193
|
+
* // Get cell validator using `row` and `column` coordinates.
|
3174
3194
|
* hot.getCellValidator(1, 1);
|
3175
|
-
* // Get cell
|
3195
|
+
* // Get cell validator using cell meta object.
|
3176
3196
|
* hot.getCellValidator(hot.getCellMeta(1, 1));
|
3177
3197
|
* ```
|
3178
3198
|
*/
|
3179
|
-
this.getCellValidator = function (
|
3180
|
-
var
|
3181
|
-
if (typeof
|
3182
|
-
|
3199
|
+
this.getCellValidator = function (rowOrMeta, column) {
|
3200
|
+
var cellValidator = typeof rowOrMeta === 'number' ? instance.getCellMeta(rowOrMeta, column).validator : rowOrMeta.validator;
|
3201
|
+
if (typeof cellValidator === 'string') {
|
3202
|
+
return getValidator(cellValidator);
|
3183
3203
|
}
|
3184
|
-
return
|
3204
|
+
return cellValidator;
|
3185
3205
|
};
|
3186
3206
|
|
3187
3207
|
/**
|
@@ -3368,54 +3388,84 @@ export default function Core(rootElement, userSettings) {
|
|
3368
3388
|
};
|
3369
3389
|
|
3370
3390
|
/**
|
3371
|
-
*
|
3372
|
-
*
|
3391
|
+
* Gets the values of column headers (if column headers are [enabled](@/api/options.md#colheaders)).
|
3392
|
+
*
|
3393
|
+
* To get an array with the values of all
|
3394
|
+
* [bottom-most](@/guides/cell-features/clipboard.md#copy-with-headers) column headers,
|
3395
|
+
* call `getColHeader()` with no arguments.
|
3396
|
+
*
|
3397
|
+
* To get the value of the bottom-most header of a specific column, use the `column` parameter.
|
3398
|
+
*
|
3399
|
+
* To get the value of a [specific-level](@/guides/columns/column-groups.md) header
|
3400
|
+
* of a specific column, use the `column` and `headerLevel` parameters.
|
3401
|
+
*
|
3402
|
+
* Read more:
|
3403
|
+
* - [Guides: Column groups](@/guides/columns/column-groups.md)
|
3404
|
+
* - [Options: `colHeaders`](@/api/options.md#colheaders)
|
3405
|
+
* - [Guides: Copy with headers](@/guides/cell-features/clipboard.md#copy-with-headers)
|
3406
|
+
*
|
3407
|
+
* ```js
|
3408
|
+
* // get the contents of all bottom-most column headers
|
3409
|
+
* hot.getColHeader();
|
3410
|
+
*
|
3411
|
+
* // get the contents of the bottom-most header of a specific column
|
3412
|
+
* hot.getColHeader(5);
|
3413
|
+
*
|
3414
|
+
* // get the contents of a specific column header at a specific level
|
3415
|
+
* hot.getColHeader(5, -2);
|
3416
|
+
* ```
|
3373
3417
|
*
|
3374
3418
|
* @memberof Core#
|
3375
3419
|
* @function getColHeader
|
3376
|
-
* @param {number} [column]
|
3420
|
+
* @param {number} [column] A visual column index.
|
3421
|
+
* @param {number} [headerLevel=-1] (Since 12.3.0) Header level index. Accepts positive (0 to n)
|
3422
|
+
* and negative (-1 to -n) values. For positive values, 0 points to the
|
3423
|
+
* topmost header. For negative values, -1 points to the bottom-most
|
3424
|
+
* header (the header closest to the cells).
|
3377
3425
|
* @fires Hooks#modifyColHeader
|
3378
|
-
* @
|
3426
|
+
* @fires Hooks#modifyColumnHeaderValue
|
3427
|
+
* @returns {Array|string|number} Column header values.
|
3379
3428
|
*/
|
3380
3429
|
this.getColHeader = function (column) {
|
3430
|
+
var headerLevel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : -1;
|
3381
3431
|
var columnIndex = instance.runHooks('modifyColHeader', column);
|
3382
|
-
var result = tableMeta.colHeaders;
|
3383
3432
|
if (columnIndex === void 0) {
|
3384
3433
|
var out = [];
|
3385
3434
|
var ilen = instance.countCols();
|
3386
3435
|
for (var i = 0; i < ilen; i++) {
|
3387
3436
|
out.push(instance.getColHeader(i));
|
3388
3437
|
}
|
3389
|
-
|
3390
|
-
}
|
3391
|
-
|
3392
|
-
|
3393
|
-
|
3394
|
-
|
3395
|
-
|
3396
|
-
|
3397
|
-
|
3398
|
-
|
3438
|
+
return out;
|
3439
|
+
}
|
3440
|
+
var result = tableMeta.colHeaders;
|
3441
|
+
var translateVisualIndexToColumns = function translateVisualIndexToColumns(visualColumnIndex) {
|
3442
|
+
var arr = [];
|
3443
|
+
var columnsLen = instance.countCols();
|
3444
|
+
var index = 0;
|
3445
|
+
for (; index < columnsLen; index++) {
|
3446
|
+
if (isFunction(tableMeta.columns) && tableMeta.columns(index)) {
|
3447
|
+
arr.push(index);
|
3399
3448
|
}
|
3400
|
-
return arr[visualColumnIndex];
|
3401
|
-
};
|
3402
|
-
var physicalColumn = instance.toPhysicalColumn(columnIndex);
|
3403
|
-
var prop = translateVisualIndexToColumns(physicalColumn);
|
3404
|
-
if (tableMeta.colHeaders === false) {
|
3405
|
-
result = null;
|
3406
|
-
} else if (tableMeta.columns && isFunction(tableMeta.columns) && tableMeta.columns(prop) && tableMeta.columns(prop).title) {
|
3407
|
-
result = tableMeta.columns(prop).title;
|
3408
|
-
} else if (tableMeta.columns && tableMeta.columns[physicalColumn] && tableMeta.columns[physicalColumn].title) {
|
3409
|
-
result = tableMeta.columns[physicalColumn].title;
|
3410
|
-
} else if (Array.isArray(tableMeta.colHeaders) && tableMeta.colHeaders[physicalColumn] !== void 0) {
|
3411
|
-
result = tableMeta.colHeaders[physicalColumn];
|
3412
|
-
} else if (isFunction(tableMeta.colHeaders)) {
|
3413
|
-
result = tableMeta.colHeaders(physicalColumn);
|
3414
|
-
} else if (tableMeta.colHeaders && typeof tableMeta.colHeaders !== 'string' && typeof tableMeta.colHeaders !== 'number') {
|
3415
|
-
result = spreadsheetColumnLabel(columnIndex); // see #1458
|
3416
3449
|
}
|
3417
|
-
|
3418
|
-
|
3450
|
+
return arr[visualColumnIndex];
|
3451
|
+
};
|
3452
|
+
var physicalColumn = instance.toPhysicalColumn(columnIndex);
|
3453
|
+
var prop = translateVisualIndexToColumns(physicalColumn);
|
3454
|
+
if (tableMeta.colHeaders === false) {
|
3455
|
+
result = null;
|
3456
|
+
} else if (tableMeta.columns && isFunction(tableMeta.columns) && tableMeta.columns(prop) && tableMeta.columns(prop).title) {
|
3457
|
+
result = tableMeta.columns(prop).title;
|
3458
|
+
} else if (tableMeta.columns && tableMeta.columns[physicalColumn] && tableMeta.columns[physicalColumn].title) {
|
3459
|
+
result = tableMeta.columns[physicalColumn].title;
|
3460
|
+
} else if (Array.isArray(tableMeta.colHeaders) && tableMeta.colHeaders[physicalColumn] !== void 0) {
|
3461
|
+
result = tableMeta.colHeaders[physicalColumn];
|
3462
|
+
} else if (isFunction(tableMeta.colHeaders)) {
|
3463
|
+
result = tableMeta.colHeaders(physicalColumn);
|
3464
|
+
} else if (tableMeta.colHeaders && typeof tableMeta.colHeaders !== 'string' && typeof tableMeta.colHeaders !== 'number') {
|
3465
|
+
result = spreadsheetColumnLabel(columnIndex); // see #1458
|
3466
|
+
}
|
3467
|
+
|
3468
|
+
result = instance.runHooks('modifyColumnHeaderValue', result, column, headerLevel);
|
3419
3469
|
return result;
|
3420
3470
|
};
|
3421
3471
|
|
@@ -3513,14 +3563,29 @@ export default function Core(rootElement, userSettings) {
|
|
3513
3563
|
};
|
3514
3564
|
|
3515
3565
|
/**
|
3516
|
-
* Returns
|
3566
|
+
* Returns a row's height, as recognized by Handsontable.
|
3517
3567
|
*
|
3518
|
-
*
|
3568
|
+
* Depending on your configuration, the method returns (in order of priority):
|
3569
|
+
* 1. The row height set by the [`ManualRowResize`](@/api/manualRowResize.md) plugin
|
3570
|
+
* (if the plugin is enabled).
|
3571
|
+
* 2. The row height set by the [`rowHeights`](@/api/options.md#rowheights) configuration option
|
3572
|
+
* (if the option is set).
|
3573
|
+
* 3. The row height as measured in the DOM by the [`AutoRowSize`](@/api/autoRowSize.md) plugin
|
3574
|
+
* (if the plugin is enabled).
|
3575
|
+
* 4. `undefined`, if neither [`ManualRowResize`](@/api/manualRowResize.md),
|
3576
|
+
* nor [`rowHeights`](@/api/options.md#rowheights),
|
3577
|
+
* nor [`AutoRowSize`](@/api/autoRowSize.md) is used.
|
3578
|
+
*
|
3579
|
+
* The height returned includes 1 px of the row's bottom border.
|
3580
|
+
*
|
3581
|
+
* Mind that this method is different from the
|
3582
|
+
* [`getRowHeight()`](@/api/autoRowSize.md#getrowheight) method
|
3583
|
+
* of the [`AutoRowSize`](@/api/autoRowSize.md) plugin.
|
3519
3584
|
*
|
3520
3585
|
* @memberof Core#
|
3521
3586
|
* @function getRowHeight
|
3522
|
-
* @param {number} row
|
3523
|
-
* @returns {number} The
|
3587
|
+
* @param {number} row A visual row index.
|
3588
|
+
* @returns {number|undefined} The height of the specified row, in pixels.
|
3524
3589
|
* @fires Hooks#modifyRowHeight
|
3525
3590
|
*/
|
3526
3591
|
this.getRowHeight = function (row) {
|
@@ -3692,35 +3757,48 @@ export default function Core(rootElement, userSettings) {
|
|
3692
3757
|
};
|
3693
3758
|
|
3694
3759
|
/**
|
3695
|
-
* Select
|
3696
|
-
*
|
3760
|
+
* Select a single cell, or a single range of adjacent cells.
|
3761
|
+
*
|
3762
|
+
* To select a cell, pass its visual row and column indexes, for example: `selectCell(2, 4)`.
|
3697
3763
|
*
|
3698
|
-
*
|
3699
|
-
*
|
3764
|
+
* To select a range, pass the visual indexes of the first and last cell in the range, for example: `selectCell(2, 4, 3, 5)`.
|
3765
|
+
*
|
3766
|
+
* If your columns have properties, you can pass those properties' values instead of column indexes, for example: `selectCell(2, 'first_name')`.
|
3767
|
+
*
|
3768
|
+
* By default, `selectCell()` also:
|
3769
|
+
* - Scrolls the viewport to the newly-selected cells.
|
3770
|
+
* - Switches the keyboard focus to Handsontable (by calling Handsontable's [`listen()`](#listen) method).
|
3700
3771
|
*
|
3701
3772
|
* @example
|
3702
3773
|
* ```js
|
3703
3774
|
* // select a single cell
|
3704
3775
|
* hot.selectCell(2, 4);
|
3705
|
-
*
|
3706
|
-
* hot.selectCell(2, 'address');
|
3776
|
+
*
|
3707
3777
|
* // select a range of cells
|
3708
3778
|
* hot.selectCell(2, 4, 3, 5);
|
3709
|
-
*
|
3710
|
-
*
|
3711
|
-
*
|
3712
|
-
*
|
3779
|
+
*
|
3780
|
+
* // select a single cell, using a column property
|
3781
|
+
* hot.selectCell(2, 'first_name');
|
3782
|
+
*
|
3783
|
+
* // select a range of cells, using column properties
|
3784
|
+
* hot.selectCell(2, 'first_name', 3, 'last_name');
|
3785
|
+
*
|
3786
|
+
* // select a range of cells, without scrolling to them
|
3787
|
+
* hot.selectCell(2, 4, 3, 5, false);
|
3788
|
+
*
|
3789
|
+
* // select a range of cells, without switching the keyboard focus to Handsontable
|
3790
|
+
* hot.selectCell(2, 4, 3, 5, null, false);
|
3713
3791
|
* ```
|
3714
3792
|
*
|
3715
3793
|
* @memberof Core#
|
3716
3794
|
* @function selectCell
|
3717
|
-
* @param {number} row
|
3718
|
-
* @param {number|string} column
|
3719
|
-
* @param {number} [endRow]
|
3720
|
-
* @param {number|string} [endColumn]
|
3721
|
-
* @param {boolean} [scrollToCell=true]
|
3722
|
-
* @param {boolean} [changeListener=true]
|
3723
|
-
* @returns {boolean} `true
|
3795
|
+
* @param {number} row A visual row index.
|
3796
|
+
* @param {number|string} column A visual column index (`number`), or a column property's value (`string`).
|
3797
|
+
* @param {number} [endRow] If selecting a range: the visual row index of the last cell in the range.
|
3798
|
+
* @param {number|string} [endColumn] If selecting a range: the visual column index (or a column property's value) of the last cell in the range.
|
3799
|
+
* @param {boolean} [scrollToCell=true] `true`: scroll the viewport to the newly-selected cells. `false`: keep the previous viewport.
|
3800
|
+
* @param {boolean} [changeListener=true] `true`: switch the keyboard focus to Handsontable. `false`: keep the previous keyboard focus.
|
3801
|
+
* @returns {boolean} `true`: the selection was successful, `false`: the selection failed.
|
3724
3802
|
*/
|
3725
3803
|
this.selectCell = function (row, column, endRow, endColumn) {
|
3726
3804
|
var scrollToCell = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;
|
@@ -3732,24 +3810,48 @@ export default function Core(rootElement, userSettings) {
|
|
3732
3810
|
};
|
3733
3811
|
|
3734
3812
|
/**
|
3735
|
-
*
|
3736
|
-
*
|
3737
|
-
*
|
3813
|
+
* Select multiple cells or ranges of cells, adjacent or non-adjacent.
|
3814
|
+
*
|
3815
|
+
* You can pass one of the below:
|
3816
|
+
* - An array of arrays (which matches the output of Handsontable's [`getSelected()`](#getselected) method).
|
3817
|
+
* - An array of [`CellRange`](@/api/cellRange.md) objects (which matches the output of Handsontable's [`getSelectedRange()`](#getselectedrange) method).
|
3818
|
+
*
|
3819
|
+
* To select multiple cells, pass the visual row and column indexes of each cell, for example: `hot.selectCells([[1, 1], [5, 5]])`.
|
3820
|
+
*
|
3821
|
+
* To select multiple ranges, pass the visual indexes of the first and last cell in each range, for example: `hot.selectCells([[1, 1, 2, 2], [6, 2, 0, 2]])`.
|
3738
3822
|
*
|
3739
|
-
*
|
3740
|
-
*
|
3823
|
+
* If your columns have properties, you can pass those properties' values instead of column indexes, for example: `hot.selectCells([[1, 'first_name'], [5, 'last_name']])`.
|
3824
|
+
*
|
3825
|
+
* By default, `selectCell()` also:
|
3826
|
+
* - Scrolls the viewport to the newly-selected cells.
|
3827
|
+
* - Switches the keyboard focus to Handsontable (by calling Handsontable's [`listen()`](#listen) method).
|
3741
3828
|
*
|
3742
3829
|
* @example
|
3743
3830
|
* ```js
|
3744
|
-
* //
|
3831
|
+
* // select non-adjacent cells
|
3832
|
+
* hot.selectCells([[1, 1], [5, 5], [10, 10]]);
|
3833
|
+
*
|
3834
|
+
* // select non-adjacent ranges of cells
|
3835
|
+
* hot.selectCells([[1, 1, 2, 2], [10, 10, 20, 20]]);
|
3836
|
+
*
|
3837
|
+
* // select cells and ranges of cells
|
3745
3838
|
* hot.selectCells([[1, 1, 2, 2], [3, 3], [6, 2, 0, 2]]);
|
3746
|
-
*
|
3839
|
+
*
|
3840
|
+
* // select cells, using column properties
|
3747
3841
|
* hot.selectCells([[1, 'id', 2, 'first_name'], [3, 'full_name'], [6, 'last_name', 0, 'first_name']]);
|
3748
|
-
*
|
3842
|
+
*
|
3843
|
+
* // select multiple ranges, using an array of `CellRange` objects
|
3749
3844
|
* const selected = hot.getSelectedRange();
|
3750
3845
|
*
|
3751
3846
|
* selected[0].from.row = 0;
|
3752
3847
|
* selected[0].from.col = 0;
|
3848
|
+
* selected[0].to.row = 5;
|
3849
|
+
* selected[0].to.col = 5;
|
3850
|
+
*
|
3851
|
+
* selected[1].from.row = 10;
|
3852
|
+
* selected[1].from.col = 10;
|
3853
|
+
* selected[1].to.row = 20;
|
3854
|
+
* selected[1].to.col = 20;
|
3753
3855
|
*
|
3754
3856
|
* hot.selectCells(selected);
|
3755
3857
|
* ```
|
@@ -3757,12 +3859,12 @@ export default function Core(rootElement, userSettings) {
|
|
3757
3859
|
* @memberof Core#
|
3758
3860
|
* @since 0.38.0
|
3759
3861
|
* @function selectCells
|
3760
|
-
* @param {Array[]|CellRange[]} coords Visual
|
3761
|
-
*
|
3762
|
-
*
|
3763
|
-
* @param {boolean} [scrollToCell=true]
|
3764
|
-
* @param {boolean} [changeListener=true]
|
3765
|
-
* @returns {boolean} `true
|
3862
|
+
* @param {Array[]|CellRange[]} coords Visual coordinates,
|
3863
|
+
* passed either as an array of arrays (`[[rowStart, columnStart, rowEnd, columnEnd], ...]`)
|
3864
|
+
* or as an array of [`CellRange`](@/api/cellRange.md) objects.
|
3865
|
+
* @param {boolean} [scrollToCell=true] `true`: scroll the viewport to the newly-selected cells. `false`: keep the previous viewport.
|
3866
|
+
* @param {boolean} [changeListener=true] `true`: switch the keyboard focus to Handsontable. `false`: keep the previous keyboard focus.
|
3867
|
+
* @returns {boolean} `true`: the selection was successful, `false`: the selection failed.
|
3766
3868
|
*/
|
3767
3869
|
this.selectCells = function () {
|
3768
3870
|
var coords = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [[]];
|
@@ -3842,13 +3944,23 @@ export default function Core(rootElement, userSettings) {
|
|
3842
3944
|
};
|
3843
3945
|
|
3844
3946
|
/**
|
3845
|
-
* Select the whole table.
|
3947
|
+
* Select the whole table.
|
3948
|
+
*
|
3949
|
+
* The previous selection is overwritten.
|
3950
|
+
*
|
3951
|
+
* ```js
|
3952
|
+
* // select all cells in the table, including all headers
|
3953
|
+
* hot.selectAll();
|
3954
|
+
*
|
3955
|
+
* // select all cells in the table, without headers
|
3956
|
+
* hot.selectAll(false);
|
3957
|
+
* ```
|
3846
3958
|
*
|
3847
3959
|
* @since 0.38.2
|
3848
3960
|
* @memberof Core#
|
3849
3961
|
* @function selectAll
|
3850
|
-
* @param {boolean} [includeHeaders=true] `true
|
3851
|
-
* `false
|
3962
|
+
* @param {boolean} [includeHeaders=true] `true`: include all row, column and corner headers.
|
3963
|
+
* `false`: don't include any headers.
|
3852
3964
|
*/
|
3853
3965
|
this.selectAll = function () {
|
3854
3966
|
var includeHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|