handsontable 0.0.0-next-b66c79f-20230713 → 0.0.0-next-08765b9-20230714
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/coords.d.ts +6 -1
- package/3rdparty/walkontable/src/cell/coords.js +87 -33
- package/3rdparty/walkontable/src/cell/coords.mjs +87 -33
- package/3rdparty/walkontable/src/cell/range.d.ts +9 -2
- package/3rdparty/walkontable/src/cell/range.js +92 -46
- package/3rdparty/walkontable/src/cell/range.mjs +92 -46
- package/3rdparty/walkontable/src/core/_base.js +41 -33
- package/3rdparty/walkontable/src/core/_base.mjs +41 -33
- package/3rdparty/walkontable/src/core/clone.js +8 -5
- package/3rdparty/walkontable/src/core/clone.mjs +8 -5
- package/3rdparty/walkontable/src/core/core.js +3 -2
- package/3rdparty/walkontable/src/core/core.mjs +3 -2
- package/3rdparty/walkontable/src/event.js +9 -8
- package/3rdparty/walkontable/src/event.mjs +9 -8
- package/3rdparty/walkontable/src/facade/core.js +2 -2
- package/3rdparty/walkontable/src/facade/core.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +10 -2
- package/3rdparty/walkontable/src/index.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/_base.js +11 -9
- package/3rdparty/walkontable/src/overlay/_base.mjs +11 -9
- package/3rdparty/walkontable/src/overlay/bottom.js +10 -8
- package/3rdparty/walkontable/src/overlay/bottom.mjs +10 -8
- package/3rdparty/walkontable/src/overlay/inlineStart.js +2 -6
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +2 -6
- package/3rdparty/walkontable/src/overlay/top.js +12 -14
- package/3rdparty/walkontable/src/overlay/top.mjs +12 -14
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +16 -13
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +16 -13
- package/3rdparty/walkontable/src/overlays.js +75 -80
- package/3rdparty/walkontable/src/overlays.mjs +75 -80
- package/3rdparty/walkontable/src/scroll.js +27 -24
- package/3rdparty/walkontable/src/scroll.mjs +27 -24
- package/3rdparty/walkontable/src/{border.js → selection/border/border.js} +7 -12
- package/3rdparty/walkontable/src/{border.mjs → selection/border/border.mjs} +7 -12
- package/3rdparty/walkontable/src/selection/border/constants.js +16 -0
- package/3rdparty/walkontable/src/selection/border/constants.mjs +12 -0
- package/3rdparty/walkontable/src/selection/constants.js +62 -0
- package/3rdparty/walkontable/src/selection/constants.mjs +51 -0
- package/3rdparty/walkontable/src/selection/index.js +26 -0
- package/3rdparty/walkontable/src/selection/index.mjs +5 -0
- package/3rdparty/walkontable/src/selection/manager.js +259 -0
- package/3rdparty/walkontable/src/selection/manager.mjs +254 -0
- package/3rdparty/walkontable/src/selection/scanner.js +270 -0
- package/3rdparty/walkontable/src/selection/scanner.mjs +267 -0
- package/3rdparty/walkontable/src/selection/selection.js +101 -0
- package/3rdparty/walkontable/src/selection/selection.mjs +96 -0
- package/3rdparty/walkontable/src/settings.js +18 -17
- package/3rdparty/walkontable/src/settings.mjs +18 -17
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +9 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +9 -0
- package/3rdparty/walkontable/src/table.js +48 -115
- package/3rdparty/walkontable/src/table.mjs +49 -116
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +58 -0
- package/core/focusCatcher/focusDetector.mjs +54 -0
- package/core/focusCatcher/index.js +142 -0
- package/core/focusCatcher/index.mjs +138 -0
- package/core/index.js +9 -0
- package/core/index.mjs +1 -0
- package/core.d.ts +6 -3
- package/core.js +181 -298
- package/core.mjs +181 -298
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +41 -0
- package/dataMap/metaManager/metaSchema.mjs +41 -0
- package/dataMap/metaManager/mods/dynamicCellMeta.js +3 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +3 -2
- package/dataMap/metaManager/utils.js +4 -2
- package/dataMap/metaManager/utils.mjs +4 -2
- package/dist/handsontable.css +19 -3
- package/dist/handsontable.full.css +19 -3
- package/dist/handsontable.full.js +10739 -7037
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +25 -25
- package/dist/handsontable.js +24884 -21182
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +19 -19
- package/editorManager.js +11 -75
- package/editorManager.mjs +11 -74
- package/editors/autocompleteEditor/autocompleteEditor.js +70 -67
- package/editors/autocompleteEditor/autocompleteEditor.mjs +70 -67
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +2 -1
- package/editors/dateEditor/dateEditor.mjs +2 -1
- package/editors/textEditor/textEditor.js +3 -11
- package/editors/textEditor/textEditor.mjs +4 -12
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/helpers/number.d.ts +1 -0
- package/helpers/number.js +18 -0
- package/helpers/number.mjs +17 -0
- package/helpers/object.js +1 -0
- package/helpers/object.mjs +1 -0
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +1 -1
- package/pluginHooks.d.ts +7 -1
- package/pluginHooks.js +106 -1
- package/pluginHooks.mjs +106 -1
- package/plugins/autoColumnSize/autoColumnSize.js +4 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +4 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +110 -40
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +110 -40
- package/plugins/columnSorting/columnSorting.js +40 -1
- package/plugins/columnSorting/columnSorting.mjs +40 -3
- package/plugins/columnSorting/columnStatesManager.js +2 -1
- package/plugins/columnSorting/columnStatesManager.mjs +2 -1
- package/plugins/columnSorting/index.js +3 -1
- package/plugins/columnSorting/index.mjs +1 -1
- package/plugins/comments/commentEditor.js +1 -0
- package/plugins/comments/commentEditor.mjs +1 -0
- package/plugins/comments/comments.js +253 -191
- package/plugins/comments/comments.mjs +252 -192
- package/plugins/comments/contextMenuItem/addEditComment.js +41 -0
- package/plugins/comments/contextMenuItem/addEditComment.mjs +35 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.js +49 -0
- package/plugins/comments/contextMenuItem/readOnlyComment.mjs +43 -0
- package/plugins/comments/contextMenuItem/removeComment.js +38 -0
- package/plugins/comments/contextMenuItem/removeComment.mjs +32 -0
- package/plugins/contextMenu/contextMenu.d.ts +1 -1
- package/plugins/contextMenu/contextMenu.js +72 -30
- package/plugins/contextMenu/contextMenu.mjs +73 -31
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -0
- package/plugins/contextMenu/predefinedItems/alignment.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/clearColumn.js +5 -3
- package/plugins/contextMenu/predefinedItems/clearColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnLeft.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.js +5 -3
- package/plugins/contextMenu/predefinedItems/columnRight.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/readOnly.js +7 -0
- package/plugins/contextMenu/predefinedItems/readOnly.mjs +7 -0
- package/plugins/contextMenu/predefinedItems/removeColumn.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeColumn.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/removeRow.js +7 -5
- package/plugins/contextMenu/predefinedItems/removeRow.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowAbove.mjs +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.js +5 -3
- package/plugins/contextMenu/predefinedItems/rowBelow.mjs +5 -3
- package/plugins/contextMenu/utils.js +28 -16
- package/plugins/contextMenu/utils.mjs +27 -15
- package/plugins/copyPaste/contextMenuItem/copy.js +7 -0
- package/plugins/copyPaste/contextMenuItem/copy.mjs +7 -0
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyColumnHeadersOnly.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnGroupHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.js +9 -1
- package/plugins/copyPaste/contextMenuItem/copyWithColumnHeaders.mjs +9 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +7 -0
- package/plugins/copyPaste/contextMenuItem/cut.mjs +7 -0
- package/plugins/copyPaste/copyPaste.js +12 -6
- package/plugins/copyPaste/copyPaste.mjs +12 -6
- package/plugins/customBorders/customBorders.js +36 -29
- package/plugins/customBorders/customBorders.mjs +37 -30
- package/plugins/customBorders/utils.js +3 -3
- package/plugins/customBorders/utils.mjs +3 -3
- package/plugins/dropdownMenu/dropdownMenu.d.ts +1 -1
- package/plugins/dropdownMenu/dropdownMenu.js +89 -32
- package/plugins/dropdownMenu/dropdownMenu.mjs +89 -32
- package/plugins/filters/conditionCollection.js +6 -5
- package/plugins/filters/conditionCollection.mjs +6 -5
- package/plugins/filters/filters.js +44 -21
- package/plugins/filters/filters.mjs +43 -20
- package/plugins/formulas/engine/register.js +3 -3
- package/plugins/formulas/engine/register.mjs +3 -3
- package/plugins/formulas/engine/settings.js +6 -3
- package/plugins/formulas/engine/settings.mjs +6 -3
- package/plugins/formulas/formulas.js +151 -143
- package/plugins/formulas/formulas.mjs +151 -143
- package/plugins/formulas/indexSyncer/axisSyncer.js +115 -79
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +115 -79
- package/plugins/formulas/indexSyncer/index.js +100 -64
- package/plugins/formulas/indexSyncer/index.mjs +100 -64
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +2 -2
- package/plugins/hiddenColumns/contextMenuItem/showColumn.mjs +2 -2
- package/plugins/hiddenColumns/hiddenColumns.js +51 -34
- package/plugins/hiddenColumns/hiddenColumns.mjs +51 -34
- package/plugins/hiddenRows/contextMenuItem/showRow.js +2 -2
- package/plugins/hiddenRows/contextMenuItem/showRow.mjs +2 -2
- package/plugins/hiddenRows/hiddenRows.js +50 -33
- package/plugins/hiddenRows/hiddenRows.mjs +50 -33
- package/plugins/manualRowResize/manualRowResize.js +2 -1
- package/plugins/manualRowResize/manualRowResize.mjs +2 -1
- package/plugins/mergeCells/mergeCells.js +6 -17
- package/plugins/mergeCells/mergeCells.mjs +6 -17
- package/plugins/multiColumnSorting/multiColumnSorting.js +37 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +37 -2
- package/plugins/nestedHeaders/nestedHeaders.js +209 -75
- package/plugins/nestedHeaders/nestedHeaders.mjs +208 -74
- package/plugins/nestedHeaders/stateManager/headersTree.js +58 -38
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +58 -38
- package/plugins/nestedHeaders/stateManager/index.js +107 -49
- package/plugins/nestedHeaders/stateManager/index.mjs +105 -47
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +1 -1
- package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +1 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +57 -37
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +57 -37
- package/plugins/nestedHeaders/utils/ghostTable.js +39 -35
- package/plugins/nestedHeaders/utils/ghostTable.mjs +39 -35
- package/plugins/nestedRows/data/dataManager.js +4 -2
- package/plugins/nestedRows/data/dataManager.mjs +4 -2
- package/plugins/nestedRows/nestedRows.js +41 -0
- package/plugins/nestedRows/nestedRows.mjs +41 -0
- package/plugins/persistentState/storage.js +1 -0
- package/plugins/persistentState/storage.mjs +1 -0
- package/plugins/undoRedo/undoRedo.js +2 -1
- package/plugins/undoRedo/undoRedo.mjs +2 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +2 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +1 -1
- package/selection/highlight/highlight.js +256 -71
- package/selection/highlight/highlight.mjs +250 -71
- package/selection/highlight/types/activeHeader.js +10 -8
- package/selection/highlight/types/activeHeader.mjs +10 -8
- package/selection/highlight/types/area.js +6 -18
- package/selection/highlight/types/area.mjs +6 -18
- package/selection/highlight/types/areaLayered.js +31 -0
- package/selection/highlight/types/areaLayered.mjs +26 -0
- package/selection/highlight/types/column.js +27 -0
- package/selection/highlight/types/column.mjs +22 -0
- package/selection/highlight/types/customSelection.js +7 -9
- package/selection/highlight/types/customSelection.mjs +7 -9
- package/selection/highlight/types/fill.js +5 -7
- package/selection/highlight/types/fill.mjs +5 -7
- package/selection/highlight/types/{cell.js → focus.js} +5 -7
- package/selection/highlight/types/{cell.mjs → focus.mjs} +5 -7
- package/selection/highlight/types/header.js +9 -18
- package/selection/highlight/types/header.mjs +9 -18
- package/selection/highlight/types/row.js +27 -0
- package/selection/highlight/types/row.mjs +22 -0
- package/selection/highlight/visualSelection.js +41 -33
- package/selection/highlight/visualSelection.mjs +41 -33
- package/selection/index.js +4 -7
- package/selection/index.mjs +2 -3
- package/selection/mouseEventHandler.js +1 -1
- package/selection/mouseEventHandler.mjs +1 -1
- package/selection/range.js +8 -8
- package/selection/range.mjs +8 -8
- package/selection/selection.js +290 -154
- package/selection/selection.mjs +287 -153
- package/selection/transformation.js +232 -90
- package/selection/transformation.mjs +232 -90
- package/selection/utils.js +15 -21
- package/selection/utils.mjs +16 -21
- package/settings.d.ts +2 -0
- package/shortcutContexts/commands/editor/closeAndSave.js +12 -0
- package/shortcutContexts/commands/editor/closeAndSave.mjs +8 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.js +12 -0
- package/shortcutContexts/commands/editor/closeWithoutSaving.mjs +8 -0
- package/shortcutContexts/commands/editor/fastOpen.js +16 -0
- package/shortcutContexts/commands/editor/fastOpen.mjs +12 -0
- package/shortcutContexts/commands/editor/index.js +16 -0
- package/shortcutContexts/commands/editor/index.mjs +12 -0
- package/shortcutContexts/commands/editor/open.js +27 -0
- package/shortcutContexts/commands/editor/open.mjs +23 -0
- package/shortcutContexts/commands/emptySelectedCells.js +11 -0
- package/shortcutContexts/commands/emptySelectedCells.mjs +7 -0
- package/shortcutContexts/commands/extendCellsSelection/down.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/downByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/extendCellsSelection/index.js +26 -0
- package/shortcutContexts/commands/extendCellsSelection/index.mjs +22 -0
- package/shortcutContexts/commands/extendCellsSelection/left.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/right.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +29 -0
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +25 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +19 -0
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.js +15 -0
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +11 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.js +21 -0
- package/shortcutContexts/commands/extendCellsSelection/upByViewportHeight.mjs +17 -0
- package/shortcutContexts/commands/index.js +35 -0
- package/shortcutContexts/commands/index.mjs +31 -0
- package/shortcutContexts/commands/moveCellSelection/down.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/down.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/downByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/moveCellSelection/index.js +28 -0
- package/shortcutContexts/commands/moveCellSelection/index.mjs +24 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +12 -0
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +8 -0
- package/shortcutContexts/commands/moveCellSelection/left.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/left.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/right.js +10 -0
- package/shortcutContexts/commands/moveCellSelection/right.mjs +6 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottom.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.js +18 -0
- package/shortcutContexts/commands/moveCellSelection/toMostBottomInlineEnd.mjs +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.js +14 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineEnd.mjs +10 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostInlineStart.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostLeft.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.js +21 -0
- package/shortcutContexts/commands/moveCellSelection/toMostRight.mjs +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.js +17 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTop.mjs +13 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.js +19 -0
- package/shortcutContexts/commands/moveCellSelection/toMostTopInlineStart.mjs +15 -0
- package/shortcutContexts/commands/moveCellSelection/up.js +13 -0
- package/shortcutContexts/commands/moveCellSelection/up.mjs +9 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.js +31 -0
- package/shortcutContexts/commands/moveCellSelection/upByViewportHeight.mjs +27 -0
- package/shortcutContexts/commands/populateSelectedCellsData.js +29 -0
- package/shortcutContexts/commands/populateSelectedCellsData.mjs +25 -0
- package/shortcutContexts/commands/scrollToFocusedCell.js +36 -0
- package/shortcutContexts/commands/scrollToFocusedCell.mjs +32 -0
- package/shortcutContexts/commands/selectAll.js +10 -0
- package/shortcutContexts/commands/selectAll.mjs +6 -0
- package/shortcutContexts/constants.js +13 -0
- package/shortcutContexts/constants.mjs +8 -0
- package/shortcutContexts/editor.js +25 -0
- package/shortcutContexts/editor.mjs +21 -0
- package/shortcutContexts/grid.js +163 -0
- package/shortcutContexts/grid.mjs +159 -0
- package/shortcutContexts/index.js +24 -0
- package/shortcutContexts/index.mjs +11 -0
- package/shortcuts/manager.js +2 -0
- package/shortcuts/manager.mjs +2 -0
- package/shortcuts/recorder.js +2 -2
- package/shortcuts/recorder.mjs +2 -2
- package/shortcuts/utils.js +19 -5
- package/shortcuts/utils.mjs +18 -4
- package/tableView.js +163 -91
- package/tableView.mjs +163 -91
- package/translations/changesObservable/observable.js +82 -54
- package/translations/changesObservable/observable.mjs +82 -54
- package/translations/changesObservable/observer.js +24 -11
- package/translations/changesObservable/observer.mjs +24 -11
- package/translations/maps/linkedPhysicalIndexToValueMap.js +14 -8
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +14 -8
- package/utils/dataStructures/tree.js +21 -18
- package/utils/dataStructures/tree.mjs +21 -18
- package/3rdparty/walkontable/src/selection.js +0 -295
- package/3rdparty/walkontable/src/selection.mjs +0 -290
- package/selection/highlight/constants.js +0 -15
- package/selection/highlight/constants.mjs +0 -6
- package/selection/highlight/types/index.js +0 -35
- package/selection/highlight/types/index.mjs +0 -31
@@ -34,10 +34,11 @@ export const DEFAULT_SETTINGS = {
|
|
34
34
|
* @returns {object} Object containing the overriding options.
|
35
35
|
*/
|
36
36
|
export function getEngineSettingsOverrides(hotSettings) {
|
37
|
+
var _hotSettings$PLUGIN_K;
|
37
38
|
return {
|
38
39
|
maxColumns: hotSettings.maxColumns,
|
39
40
|
maxRows: hotSettings.maxRows,
|
40
|
-
language: hotSettings[PLUGIN_KEY]
|
41
|
+
language: (_hotSettings$PLUGIN_K = hotSettings[PLUGIN_KEY]) === null || _hotSettings$PLUGIN_K === void 0 || (_hotSettings$PLUGIN_K = _hotSettings$PLUGIN_K.language) === null || _hotSettings$PLUGIN_K === void 0 ? void 0 : _hotSettings$PLUGIN_K.langCode
|
41
42
|
};
|
42
43
|
}
|
43
44
|
|
@@ -73,8 +74,9 @@ function cleanEngineSettings(pluginSettings) {
|
|
73
74
|
* @returns {object} The final engine settings.
|
74
75
|
*/
|
75
76
|
export function getEngineSettingsWithDefaultsAndOverrides(hotSettings) {
|
77
|
+
var _pluginSettings$engin;
|
76
78
|
const pluginSettings = hotSettings[PLUGIN_KEY];
|
77
|
-
const userSettings = cleanEngineSettings(pluginSettings
|
79
|
+
const userSettings = cleanEngineSettings(pluginSettings !== null && pluginSettings !== void 0 && (_pluginSettings$engin = pluginSettings.engine) !== null && _pluginSettings$engin !== void 0 && _pluginSettings$engin.hyperformula ? pluginSettings.engine : {});
|
78
80
|
const overrides = getEngineSettingsOverrides(hotSettings);
|
79
81
|
return {
|
80
82
|
...DEFAULT_SETTINGS,
|
@@ -90,8 +92,9 @@ export function getEngineSettingsWithDefaultsAndOverrides(hotSettings) {
|
|
90
92
|
* @returns {object}
|
91
93
|
*/
|
92
94
|
export function getEngineSettingsWithOverrides(hotSettings) {
|
95
|
+
var _pluginSettings$engin2;
|
93
96
|
const pluginSettings = hotSettings[PLUGIN_KEY];
|
94
|
-
const userSettings = cleanEngineSettings(pluginSettings
|
97
|
+
const userSettings = cleanEngineSettings(pluginSettings !== null && pluginSettings !== void 0 && (_pluginSettings$engin2 = pluginSettings.engine) !== null && _pluginSettings$engin2 !== void 0 && _pluginSettings$engin2.hyperformula ? pluginSettings.engine : {});
|
95
98
|
const overrides = getEngineSettingsOverrides(hotSettings);
|
96
99
|
return {
|
97
100
|
...userSettings,
|
@@ -1,6 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
require("core-js/modules/es.error.cause.js");
|
3
4
|
exports.__esModule = true;
|
5
|
+
require("core-js/modules/es.json.stringify.js");
|
4
6
|
require("core-js/modules/es.array.push.js");
|
5
7
|
var _base = require("../base");
|
6
8
|
var _staticRegister = _interopRequireDefault(require("../../utils/staticRegister"));
|
@@ -15,6 +17,16 @@ var _string = require("../../helpers/string");
|
|
15
17
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
16
18
|
var _indexSyncer = _interopRequireDefault(require("./indexSyncer"));
|
17
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
20
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
22
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
23
|
+
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
24
|
+
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
25
|
+
function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
|
26
|
+
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
27
|
+
function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
|
28
|
+
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
29
|
+
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
18
30
|
const PLUGIN_KEY = 'formulas';
|
19
31
|
exports.PLUGIN_KEY = PLUGIN_KEY;
|
20
32
|
const SETTING_KEYS = ['maxRows', 'maxColumns', 'language'];
|
@@ -44,7 +56,94 @@ const isBlockedSource = source => source === 'UndoRedo.undo' || source === 'Undo
|
|
44
56
|
* @plugin Formulas
|
45
57
|
* @class Formulas
|
46
58
|
*/
|
59
|
+
var _internalOperationPending = /*#__PURE__*/new WeakMap();
|
60
|
+
var _hotWasInitializedWithEmptyData = /*#__PURE__*/new WeakMap();
|
61
|
+
var _engineListeners = /*#__PURE__*/new WeakMap();
|
47
62
|
class Formulas extends _base.BasePlugin {
|
63
|
+
constructor() {
|
64
|
+
var _this;
|
65
|
+
super(...arguments);
|
66
|
+
_this = this;
|
67
|
+
/**
|
68
|
+
* Flag used to bypass hooks in internal operations.
|
69
|
+
*
|
70
|
+
* @private
|
71
|
+
* @type {boolean}
|
72
|
+
*/
|
73
|
+
_classPrivateFieldInitSpec(this, _internalOperationPending, {
|
74
|
+
writable: true,
|
75
|
+
value: false
|
76
|
+
});
|
77
|
+
/**
|
78
|
+
* Flag needed to mark if Handsontable was initialized with no data.
|
79
|
+
* (Required to work around the fact, that Handsontable auto-generates sample data, when no data is provided).
|
80
|
+
*
|
81
|
+
* @type {boolean}
|
82
|
+
*/
|
83
|
+
_classPrivateFieldInitSpec(this, _hotWasInitializedWithEmptyData, {
|
84
|
+
writable: true,
|
85
|
+
value: false
|
86
|
+
});
|
87
|
+
/**
|
88
|
+
* The list of the HyperFormula listeners.
|
89
|
+
*
|
90
|
+
* @type {Array}
|
91
|
+
*/
|
92
|
+
_classPrivateFieldInitSpec(this, _engineListeners, {
|
93
|
+
writable: true,
|
94
|
+
value: [['valuesUpdated', function () {
|
95
|
+
return _this.onEngineValuesUpdated(...arguments);
|
96
|
+
}], ['namedExpressionAdded', function () {
|
97
|
+
return _this.onEngineNamedExpressionsAdded(...arguments);
|
98
|
+
}], ['namedExpressionRemoved', function () {
|
99
|
+
return _this.onEngineNamedExpressionsRemoved(...arguments);
|
100
|
+
}], ['sheetAdded', function () {
|
101
|
+
return _this.onEngineSheetAdded(...arguments);
|
102
|
+
}], ['sheetRenamed', function () {
|
103
|
+
return _this.onEngineSheetRenamed(...arguments);
|
104
|
+
}], ['sheetRemoved', function () {
|
105
|
+
return _this.onEngineSheetRemoved(...arguments);
|
106
|
+
}]]
|
107
|
+
});
|
108
|
+
/**
|
109
|
+
* Static register used to set up one global HyperFormula instance.
|
110
|
+
* TODO: currently used in tests, might be removed later.
|
111
|
+
*
|
112
|
+
* @private
|
113
|
+
* @type {object}
|
114
|
+
*/
|
115
|
+
_defineProperty(this, "staticRegister", (0, _staticRegister.default)('formulas'));
|
116
|
+
/**
|
117
|
+
* The engine instance that will be used for this instance of Handsontable.
|
118
|
+
*
|
119
|
+
* @type {HyperFormula|null}
|
120
|
+
*/
|
121
|
+
_defineProperty(this, "engine", null);
|
122
|
+
/**
|
123
|
+
* HyperFormula's sheet name.
|
124
|
+
*
|
125
|
+
* @type {string|null}
|
126
|
+
*/
|
127
|
+
_defineProperty(this, "sheetName", null);
|
128
|
+
/**
|
129
|
+
* Index synchronizer responsible for manipulating with some general options related to indexes synchronization.
|
130
|
+
*
|
131
|
+
* @type {IndexSyncer|null}
|
132
|
+
*/
|
133
|
+
_defineProperty(this, "indexSyncer", null);
|
134
|
+
/**
|
135
|
+
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the rows.
|
136
|
+
*
|
137
|
+
* @type {AxisSyncer|null}
|
138
|
+
*/
|
139
|
+
_defineProperty(this, "rowAxisSyncer", null);
|
140
|
+
/**
|
141
|
+
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the columns.
|
142
|
+
*
|
143
|
+
* @type {AxisSyncer|null}
|
144
|
+
*/
|
145
|
+
_defineProperty(this, "columnAxisSyncer", null);
|
146
|
+
}
|
48
147
|
static get PLUGIN_KEY() {
|
49
148
|
return PLUGIN_KEY;
|
50
149
|
}
|
@@ -54,101 +153,6 @@ class Formulas extends _base.BasePlugin {
|
|
54
153
|
static get SETTING_KEYS() {
|
55
154
|
return [PLUGIN_KEY, ...SETTING_KEYS];
|
56
155
|
}
|
57
|
-
|
58
|
-
/**
|
59
|
-
* Flag used to bypass hooks in internal operations.
|
60
|
-
*
|
61
|
-
* @private
|
62
|
-
* @type {boolean}
|
63
|
-
*/
|
64
|
-
#internalOperationPending = false;
|
65
|
-
|
66
|
-
/**
|
67
|
-
* Flag needed to mark if Handsontable was initialized with no data.
|
68
|
-
* (Required to work around the fact, that Handsontable auto-generates sample data, when no data is provided).
|
69
|
-
*
|
70
|
-
* @type {boolean}
|
71
|
-
*/
|
72
|
-
#hotWasInitializedWithEmptyData = false;
|
73
|
-
|
74
|
-
/**
|
75
|
-
* The list of the HyperFormula listeners.
|
76
|
-
*
|
77
|
-
* @type {Array}
|
78
|
-
*/
|
79
|
-
#engineListeners = [['valuesUpdated', (() => {
|
80
|
-
var _this = this;
|
81
|
-
return function () {
|
82
|
-
return _this.onEngineValuesUpdated(...arguments);
|
83
|
-
};
|
84
|
-
})()], ['namedExpressionAdded', (() => {
|
85
|
-
var _this2 = this;
|
86
|
-
return function () {
|
87
|
-
return _this2.onEngineNamedExpressionsAdded(...arguments);
|
88
|
-
};
|
89
|
-
})()], ['namedExpressionRemoved', (() => {
|
90
|
-
var _this3 = this;
|
91
|
-
return function () {
|
92
|
-
return _this3.onEngineNamedExpressionsRemoved(...arguments);
|
93
|
-
};
|
94
|
-
})()], ['sheetAdded', (() => {
|
95
|
-
var _this4 = this;
|
96
|
-
return function () {
|
97
|
-
return _this4.onEngineSheetAdded(...arguments);
|
98
|
-
};
|
99
|
-
})()], ['sheetRenamed', (() => {
|
100
|
-
var _this5 = this;
|
101
|
-
return function () {
|
102
|
-
return _this5.onEngineSheetRenamed(...arguments);
|
103
|
-
};
|
104
|
-
})()], ['sheetRemoved', (() => {
|
105
|
-
var _this6 = this;
|
106
|
-
return function () {
|
107
|
-
return _this6.onEngineSheetRemoved(...arguments);
|
108
|
-
};
|
109
|
-
})()]];
|
110
|
-
|
111
|
-
/**
|
112
|
-
* Static register used to set up one global HyperFormula instance.
|
113
|
-
* TODO: currently used in tests, might be removed later.
|
114
|
-
*
|
115
|
-
* @private
|
116
|
-
* @type {object}
|
117
|
-
*/
|
118
|
-
staticRegister = (0, _staticRegister.default)('formulas');
|
119
|
-
|
120
|
-
/**
|
121
|
-
* The engine instance that will be used for this instance of Handsontable.
|
122
|
-
*
|
123
|
-
* @type {HyperFormula|null}
|
124
|
-
*/
|
125
|
-
engine = null;
|
126
|
-
|
127
|
-
/**
|
128
|
-
* HyperFormula's sheet name.
|
129
|
-
*
|
130
|
-
* @type {string|null}
|
131
|
-
*/
|
132
|
-
sheetName = null;
|
133
|
-
/**
|
134
|
-
* Index synchronizer responsible for manipulating with some general options related to indexes synchronization.
|
135
|
-
*
|
136
|
-
* @type {IndexSyncer|null}
|
137
|
-
*/
|
138
|
-
indexSyncer = null;
|
139
|
-
/**
|
140
|
-
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the rows.
|
141
|
-
*
|
142
|
-
* @type {AxisSyncer|null}
|
143
|
-
*/
|
144
|
-
rowAxisSyncer = null;
|
145
|
-
/**
|
146
|
-
* Index synchronizer responsible for syncing the order of HOT and HF's data for the axis of the columns.
|
147
|
-
*
|
148
|
-
* @type {AxisSyncer|null}
|
149
|
-
*/
|
150
|
-
columnAxisSyncer = null;
|
151
|
-
|
152
156
|
/**
|
153
157
|
* HyperFormula's sheet id.
|
154
158
|
*
|
@@ -174,11 +178,11 @@ class Formulas extends _base.BasePlugin {
|
|
174
178
|
*/
|
175
179
|
enablePlugin() {
|
176
180
|
var _setupEngine,
|
177
|
-
|
181
|
+
_this2 = this;
|
178
182
|
if (this.enabled) {
|
179
183
|
return;
|
180
184
|
}
|
181
|
-
this.engine = (_setupEngine = (0, _register.setupEngine)(this.hot))
|
185
|
+
this.engine = (_setupEngine = (0, _register.setupEngine)(this.hot)) !== null && _setupEngine !== void 0 ? _setupEngine : this.engine;
|
182
186
|
if (!this.engine) {
|
183
187
|
(0, _console.warn)('Missing the required `engine` key in the Formulas settings. Please fill it with either an' + ' engine class or an engine instance.');
|
184
188
|
return;
|
@@ -192,60 +196,60 @@ class Formulas extends _base.BasePlugin {
|
|
192
196
|
}
|
193
197
|
}
|
194
198
|
this.addHook('beforeLoadData', function () {
|
195
|
-
return
|
199
|
+
return _this2.onBeforeLoadData(...arguments);
|
196
200
|
});
|
197
201
|
this.addHook('afterLoadData', function () {
|
198
|
-
return
|
202
|
+
return _this2.onAfterLoadData(...arguments);
|
199
203
|
});
|
200
204
|
|
201
205
|
// The `updateData` hooks utilize the same logic as the `loadData` hooks.
|
202
206
|
this.addHook('beforeUpdateData', function () {
|
203
|
-
return
|
207
|
+
return _this2.onBeforeLoadData(...arguments);
|
204
208
|
});
|
205
209
|
this.addHook('afterUpdateData', function () {
|
206
|
-
return
|
210
|
+
return _this2.onAfterLoadData(...arguments);
|
207
211
|
});
|
208
212
|
this.addHook('modifyData', function () {
|
209
|
-
return
|
213
|
+
return _this2.onModifyData(...arguments);
|
210
214
|
});
|
211
215
|
this.addHook('modifySourceData', function () {
|
212
|
-
return
|
216
|
+
return _this2.onModifySourceData(...arguments);
|
213
217
|
});
|
214
218
|
this.addHook('beforeValidate', function () {
|
215
|
-
return
|
219
|
+
return _this2.onBeforeValidate(...arguments);
|
216
220
|
});
|
217
221
|
this.addHook('afterSetSourceDataAtCell', function () {
|
218
|
-
return
|
222
|
+
return _this2.onAfterSetSourceDataAtCell(...arguments);
|
219
223
|
});
|
220
224
|
this.addHook('afterSetDataAtCell', function () {
|
221
|
-
return
|
225
|
+
return _this2.onAfterSetDataAtCell(...arguments);
|
222
226
|
});
|
223
227
|
this.addHook('afterSetDataAtRowProp', function () {
|
224
|
-
return
|
228
|
+
return _this2.onAfterSetDataAtCell(...arguments);
|
225
229
|
});
|
226
230
|
this.addHook('beforeCreateRow', function () {
|
227
|
-
return
|
231
|
+
return _this2.onBeforeCreateRow(...arguments);
|
228
232
|
});
|
229
233
|
this.addHook('beforeCreateCol', function () {
|
230
|
-
return
|
234
|
+
return _this2.onBeforeCreateCol(...arguments);
|
231
235
|
});
|
232
236
|
this.addHook('afterCreateRow', function () {
|
233
|
-
return
|
237
|
+
return _this2.onAfterCreateRow(...arguments);
|
234
238
|
});
|
235
239
|
this.addHook('afterCreateCol', function () {
|
236
|
-
return
|
240
|
+
return _this2.onAfterCreateCol(...arguments);
|
237
241
|
});
|
238
242
|
this.addHook('beforeRemoveRow', function () {
|
239
|
-
return
|
243
|
+
return _this2.onBeforeRemoveRow(...arguments);
|
240
244
|
});
|
241
245
|
this.addHook('beforeRemoveCol', function () {
|
242
|
-
return
|
246
|
+
return _this2.onBeforeRemoveCol(...arguments);
|
243
247
|
});
|
244
248
|
this.addHook('afterRemoveRow', function () {
|
245
|
-
return
|
249
|
+
return _this2.onAfterRemoveRow(...arguments);
|
246
250
|
});
|
247
251
|
this.addHook('afterRemoveCol', function () {
|
248
|
-
return
|
252
|
+
return _this2.onAfterRemoveCol(...arguments);
|
249
253
|
});
|
250
254
|
this.indexSyncer = new _indexSyncer.default(this.hot.rowIndexMapper, this.hot.columnIndexMapper, postponedAction => {
|
251
255
|
this.hot.addHookOnce('init', () => {
|
@@ -287,7 +291,7 @@ class Formulas extends _base.BasePlugin {
|
|
287
291
|
// hook, because some hooks, such as `afterLoadData` doesn't have information about composed cell properties.
|
288
292
|
// Another hooks are triggered to late for setting HF's engine data needed for some actions.
|
289
293
|
this.addHook('afterCellMetaReset', function () {
|
290
|
-
return
|
294
|
+
return _this2.onAfterCellMetaReset(...arguments);
|
291
295
|
});
|
292
296
|
|
293
297
|
// Handling undo actions on data just using HyperFormula's UndoRedo mechanism
|
@@ -308,12 +312,12 @@ class Formulas extends _base.BasePlugin {
|
|
308
312
|
this.indexSyncer.setPerformRedo(false);
|
309
313
|
});
|
310
314
|
this.addHook('afterDetachChild', function () {
|
311
|
-
return
|
315
|
+
return _this2.onAfterDetachChild(...arguments);
|
312
316
|
});
|
313
317
|
this.addHook('beforeAutofill', function () {
|
314
|
-
return
|
318
|
+
return _this2.onBeforeAutofill(...arguments);
|
315
319
|
});
|
316
|
-
this
|
320
|
+
_classPrivateFieldGet(this, _engineListeners).forEach(_ref => {
|
317
321
|
let [eventName, listener] = _ref;
|
318
322
|
return this.engine.on(eventName, listener);
|
319
323
|
});
|
@@ -324,7 +328,7 @@ class Formulas extends _base.BasePlugin {
|
|
324
328
|
* Disables the plugin functionality for this Handsontable instance.
|
325
329
|
*/
|
326
330
|
disablePlugin() {
|
327
|
-
this
|
331
|
+
_classPrivateFieldGet(this, _engineListeners).forEach(_ref2 => {
|
328
332
|
let [eventName, listener] = _ref2;
|
329
333
|
return this.engine.off(eventName, listener);
|
330
334
|
});
|
@@ -356,7 +360,7 @@ class Formulas extends _base.BasePlugin {
|
|
356
360
|
if (sheetName && this.engine.doesSheetExist(sheetName)) {
|
357
361
|
this.switchSheet(this.sheetName);
|
358
362
|
} else {
|
359
|
-
this.sheetName = this.addSheet(sheetName
|
363
|
+
this.sheetName = this.addSheet(sheetName !== null && sheetName !== void 0 ? sheetName : void 0, this.hot.getSourceDataArray());
|
360
364
|
}
|
361
365
|
}
|
362
366
|
super.updatePlugin(newSettings);
|
@@ -366,11 +370,12 @@ class Formulas extends _base.BasePlugin {
|
|
366
370
|
* Destroys the plugin instance.
|
367
371
|
*/
|
368
372
|
destroy() {
|
369
|
-
this
|
373
|
+
_classPrivateFieldGet(this, _engineListeners).forEach(_ref3 => {
|
374
|
+
var _this$engine;
|
370
375
|
let [eventName, listener] = _ref3;
|
371
|
-
return this.engine
|
376
|
+
return (_this$engine = this.engine) === null || _this$engine === void 0 ? void 0 : _this$engine.off(eventName, listener);
|
372
377
|
});
|
373
|
-
this
|
378
|
+
_classPrivateFieldSet(this, _engineListeners, null);
|
374
379
|
(0, _register.unregisterEngine)(this.engine, this.hot);
|
375
380
|
this.engine = null;
|
376
381
|
super.destroy();
|
@@ -396,7 +401,7 @@ class Formulas extends _base.BasePlugin {
|
|
396
401
|
return false;
|
397
402
|
}
|
398
403
|
try {
|
399
|
-
const actualSheetName = this.engine.addSheet(sheetName
|
404
|
+
const actualSheetName = this.engine.addSheet(sheetName !== null && sheetName !== void 0 ? sheetName : void 0);
|
400
405
|
if (sheetData) {
|
401
406
|
this.engine.setSheetContent(this.engine.getSheetId(actualSheetName), sheetData);
|
402
407
|
}
|
@@ -478,8 +483,9 @@ class Formulas extends _base.BasePlugin {
|
|
478
483
|
let renderSelf = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
479
484
|
const affectedSheetIds = new Set();
|
480
485
|
dependentCells.forEach(change => {
|
486
|
+
var _change$address;
|
481
487
|
// For the Named expression the address is empty, hence the `sheetId` is undefined.
|
482
|
-
const sheetId = change
|
488
|
+
const sheetId = change === null || change === void 0 || (_change$address = change.address) === null || _change$address === void 0 ? void 0 : _change$address.sheet;
|
483
489
|
if (sheetId !== void 0) {
|
484
490
|
if (!affectedSheetIds.has(sheetId)) {
|
485
491
|
affectedSheetIds.add(sheetId);
|
@@ -488,8 +494,9 @@ class Formulas extends _base.BasePlugin {
|
|
488
494
|
});
|
489
495
|
(0, _register.getRegisteredHotInstances)(this.engine).forEach((relatedHot, sheetId) => {
|
490
496
|
if ((renderSelf || sheetId !== this.sheetId) && affectedSheetIds.has(sheetId)) {
|
497
|
+
var _relatedHot$view;
|
491
498
|
relatedHot.render();
|
492
|
-
relatedHot.view
|
499
|
+
(_relatedHot$view = relatedHot.view) === null || _relatedHot$view === void 0 ? void 0 : _relatedHot$view.adjustElementsSize();
|
493
500
|
}
|
494
501
|
});
|
495
502
|
}
|
@@ -504,21 +511,21 @@ class Formulas extends _base.BasePlugin {
|
|
504
511
|
validateDependentCells(dependentCells) {
|
505
512
|
let changedCells = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
506
513
|
const stringifyAddress = change => {
|
507
|
-
var _change$
|
514
|
+
var _change$address2;
|
508
515
|
const {
|
509
516
|
row,
|
510
517
|
col,
|
511
518
|
sheet
|
512
|
-
} = (_change$
|
519
|
+
} = (_change$address2 = change === null || change === void 0 ? void 0 : change.address) !== null && _change$address2 !== void 0 ? _change$address2 : {};
|
513
520
|
return (0, _mixed.isDefined)(sheet) ? `${sheet}:${row}x${col}` : '';
|
514
521
|
};
|
515
522
|
const changedCellsSet = new Set(changedCells.map(change => stringifyAddress(change)));
|
516
523
|
dependentCells.forEach(change => {
|
517
|
-
var _change$
|
524
|
+
var _change$address3, _change$address4;
|
518
525
|
const {
|
519
526
|
row,
|
520
527
|
col
|
521
|
-
} = (_change$
|
528
|
+
} = (_change$address3 = change.address) !== null && _change$address3 !== void 0 ? _change$address3 : {};
|
522
529
|
|
523
530
|
// Don't try to validate cells outside of the visual part of the table.
|
524
531
|
if ((0, _mixed.isDefined)(row) === false || (0, _mixed.isDefined)(col) === false || row >= this.hot.countRows() || col >= this.hot.countCols()) {
|
@@ -526,7 +533,7 @@ class Formulas extends _base.BasePlugin {
|
|
526
533
|
}
|
527
534
|
|
528
535
|
// For the Named expression the address is empty, hence the `sheetId` is undefined.
|
529
|
-
const sheetId = change
|
536
|
+
const sheetId = change === null || change === void 0 || (_change$address4 = change.address) === null || _change$address4 === void 0 ? void 0 : _change$address4.sheet;
|
530
537
|
const addressId = stringifyAddress(change);
|
531
538
|
|
532
539
|
// Validate the cells that depend on the calculated formulas. Skip that cells
|
@@ -712,7 +719,7 @@ class Formulas extends _base.BasePlugin {
|
|
712
719
|
|
713
720
|
// This flag needs to be defined, because not passing data to HOT results in HOT auto-generating a `null`-filled
|
714
721
|
// initial dataset.
|
715
|
-
this
|
722
|
+
_classPrivateFieldSet(this, _hotWasInitializedWithEmptyData, (0, _mixed.isUndefined)(this.hot.getSettings().data));
|
716
723
|
}
|
717
724
|
|
718
725
|
/**
|
@@ -740,9 +747,9 @@ class Formulas extends _base.BasePlugin {
|
|
740
747
|
});
|
741
748
|
});
|
742
749
|
if (valueChanged === true) {
|
743
|
-
this
|
750
|
+
_classPrivateFieldSet(this, _internalOperationPending, true);
|
744
751
|
this.engine.setSheetContent(this.sheetId, sourceDataArray);
|
745
|
-
this
|
752
|
+
_classPrivateFieldSet(this, _internalOperationPending, false);
|
746
753
|
}
|
747
754
|
}
|
748
755
|
|
@@ -760,14 +767,14 @@ class Formulas extends _base.BasePlugin {
|
|
760
767
|
return;
|
761
768
|
}
|
762
769
|
this.sheetName = (0, _register.setupSheet)(this.engine, this.hot.getSettings()[PLUGIN_KEY].sheetName);
|
763
|
-
if (!this
|
770
|
+
if (!_classPrivateFieldGet(this, _hotWasInitializedWithEmptyData)) {
|
764
771
|
const sourceDataArray = this.hot.getSourceDataArray();
|
765
772
|
if (this.engine.isItPossibleToReplaceSheetContent(this.sheetId, sourceDataArray)) {
|
766
|
-
this
|
773
|
+
_classPrivateFieldSet(this, _internalOperationPending, true);
|
767
774
|
const dependentCells = this.engine.setSheetContent(this.sheetId, sourceDataArray);
|
768
775
|
this.indexSyncer.setupSyncEndpoint(this.engine, this.sheetId);
|
769
776
|
this.renderDependentSheets(dependentCells);
|
770
|
-
this
|
777
|
+
_classPrivateFieldSet(this, _internalOperationPending, false);
|
771
778
|
}
|
772
779
|
} else {
|
773
780
|
this.switchSheet(this.sheetName);
|
@@ -785,7 +792,7 @@ class Formulas extends _base.BasePlugin {
|
|
785
792
|
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
786
793
|
*/
|
787
794
|
onModifyData(physicalRow, visualColumn, valueHolder, ioMode) {
|
788
|
-
if (ioMode !== 'get' || this
|
795
|
+
if (ioMode !== 'get' || _classPrivateFieldGet(this, _internalOperationPending) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) {
|
789
796
|
return;
|
790
797
|
}
|
791
798
|
const visualRow = this.hot.toVisualRow(physicalRow);
|
@@ -831,7 +838,7 @@ class Formulas extends _base.BasePlugin {
|
|
831
838
|
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
832
839
|
*/
|
833
840
|
onModifySourceData(row, columnOrProp, valueHolder, ioMode) {
|
834
|
-
if (ioMode !== 'get' || this
|
841
|
+
if (ioMode !== 'get' || _classPrivateFieldGet(this, _internalOperationPending) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) {
|
835
842
|
return;
|
836
843
|
}
|
837
844
|
const visualRow = this.hot.toVisualRow(row);
|
@@ -1117,9 +1124,10 @@ class Formulas extends _base.BasePlugin {
|
|
1117
1124
|
* @param {number} finalElementRowIndex The final row index of the detached element.
|
1118
1125
|
*/
|
1119
1126
|
onAfterDetachChild(parent, element, finalElementRowIndex) {
|
1120
|
-
|
1121
|
-
|
1122
|
-
this
|
1127
|
+
var _element$__children;
|
1128
|
+
_classPrivateFieldSet(this, _internalOperationPending, true);
|
1129
|
+
const rowsData = this.hot.getSourceDataArray(finalElementRowIndex, 0, finalElementRowIndex + (((_element$__children = element.__children) === null || _element$__children === void 0 ? void 0 : _element$__children.length) || 0), this.hot.countSourceCols());
|
1130
|
+
_classPrivateFieldSet(this, _internalOperationPending, false);
|
1123
1131
|
rowsData.forEach((row, relativeRowIndex) => {
|
1124
1132
|
row.forEach((value, colIndex) => {
|
1125
1133
|
this.engine.setCellContents({
|