handsontable 14.2.0 → 14.3.0-next-3fa6b18-20240410
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +1 -1
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +1 -1
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +1 -1
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +1 -1
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +13 -18
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +13 -18
- package/3rdparty/walkontable/src/calculator/viewportRows.js +11 -16
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +11 -16
- package/3rdparty/walkontable/src/cell/coords.js +13 -18
- package/3rdparty/walkontable/src/cell/coords.mjs +13 -18
- package/3rdparty/walkontable/src/cell/range.d.ts +2 -1
- package/3rdparty/walkontable/src/cell/range.js +42 -30
- package/3rdparty/walkontable/src/cell/range.mjs +42 -30
- package/3rdparty/walkontable/src/core/_base.js +2 -2
- package/3rdparty/walkontable/src/core/_base.mjs +2 -2
- package/3rdparty/walkontable/src/core/clone.js +1 -1
- package/3rdparty/walkontable/src/core/clone.mjs +1 -1
- package/3rdparty/walkontable/src/event.js +72 -104
- package/3rdparty/walkontable/src/event.mjs +72 -104
- package/3rdparty/walkontable/src/filter/column.js +1 -1
- package/3rdparty/walkontable/src/filter/column.mjs +1 -1
- package/3rdparty/walkontable/src/filter/row.js +1 -1
- package/3rdparty/walkontable/src/filter/row.mjs +1 -1
- package/3rdparty/walkontable/src/index.js +1 -1
- package/3rdparty/walkontable/src/overlay/_base.js +1 -1
- package/3rdparty/walkontable/src/overlay/_base.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/bottom.js +1 -1
- package/3rdparty/walkontable/src/overlay/bottom.mjs +1 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.js +15 -1
- package/3rdparty/walkontable/src/overlay/inlineStart.mjs +16 -2
- package/3rdparty/walkontable/src/overlay/top.js +12 -1
- package/3rdparty/walkontable/src/overlay/top.mjs +13 -2
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +1 -1
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +1 -1
- package/3rdparty/walkontable/src/overlays.js +47 -5
- package/3rdparty/walkontable/src/overlays.mjs +47 -5
- package/3rdparty/walkontable/src/renderer/_base.js +1 -1
- package/3rdparty/walkontable/src/renderer/_base.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/cells.js +1 -1
- package/3rdparty/walkontable/src/renderer/cells.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +1 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/rows.js +1 -1
- package/3rdparty/walkontable/src/renderer/rows.mjs +1 -1
- package/3rdparty/walkontable/src/renderer/table.js +1 -1
- package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
- package/3rdparty/walkontable/src/scroll.js +16 -18
- package/3rdparty/walkontable/src/scroll.mjs +16 -18
- package/3rdparty/walkontable/src/selection/manager.js +48 -69
- package/3rdparty/walkontable/src/selection/manager.mjs +48 -69
- package/3rdparty/walkontable/src/selection/scanner.js +33 -42
- package/3rdparty/walkontable/src/selection/scanner.mjs +33 -42
- package/3rdparty/walkontable/src/settings.js +1 -1
- package/3rdparty/walkontable/src/settings.mjs +1 -1
- package/3rdparty/walkontable/src/table.js +1 -1
- package/3rdparty/walkontable/src/table.mjs +1 -1
- package/3rdparty/walkontable/src/utils/column.js +1 -1
- package/3rdparty/walkontable/src/utils/column.mjs +1 -1
- package/3rdparty/walkontable/src/utils/columnStretching.js +28 -45
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +28 -45
- package/3rdparty/walkontable/src/utils/nodesPool.js +1 -1
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +1 -1
- package/3rdparty/walkontable/src/utils/orderView/view.js +2 -2
- package/3rdparty/walkontable/src/utils/orderView/view.mjs +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSize.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +1 -1
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +1 -1
- package/3rdparty/walkontable/src/utils/row.js +1 -1
- package/3rdparty/walkontable/src/utils/row.mjs +1 -1
- package/CHANGELOG.md +20 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/viewportScroll/index.js +4 -1
- package/core/viewportScroll/index.mjs +4 -1
- package/core/viewportScroll/scrollStrategies/focusScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/focusScroll.mjs +11 -0
- package/core.d.ts +4 -3
- package/core.js +98 -43
- package/core.mjs +98 -43
- package/dataMap/dataMap.js +1 -1
- package/dataMap/dataMap.mjs +1 -1
- package/dataMap/dataSource.js +2 -2
- package/dataMap/dataSource.mjs +2 -2
- package/dataMap/metaManager/lazyFactoryMap.js +3 -5
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -4
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/columnMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +1 -1
- package/dataMap/metaManager/metaLayers/globalMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +1 -1
- package/dataMap/metaManager/metaLayers/tableMeta.js +1 -1
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +1 -1
- package/dataMap/metaManager/metaSchema.js +272 -272
- package/dataMap/metaManager/metaSchema.mjs +272 -272
- package/dataMap/metaManager/mods/dynamicCellMeta.js +1 -1
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +1 -1
- package/dataMap/metaManager/mods/extendMetaProperties.js +1 -1
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +1 -1
- package/dataMap/replaceData.js +1 -1
- package/dataMap/replaceData.mjs +1 -1
- package/dist/handsontable.css +4 -4
- package/dist/handsontable.full.css +4 -4
- package/dist/handsontable.full.js +9814 -10020
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +292 -292
- package/dist/handsontable.js +7484 -7056
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/ar-AR.min.js +1 -1
- package/dist/languages/cs-CZ.min.js +1 -1
- package/dist/languages/de-CH.min.js +1 -1
- package/dist/languages/de-DE.min.js +1 -1
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/es-MX.min.js +1 -1
- package/dist/languages/fr-FR.min.js +1 -1
- package/dist/languages/hr-HR.min.js +1 -1
- package/dist/languages/it-IT.min.js +1 -1
- package/dist/languages/ja-JP.min.js +1 -1
- package/dist/languages/ko-KR.min.js +1 -1
- package/dist/languages/lv-LV.min.js +1 -1
- package/dist/languages/nb-NO.min.js +1 -1
- package/dist/languages/nl-NL.min.js +1 -1
- package/dist/languages/pl-PL.min.js +1 -1
- package/dist/languages/pt-BR.min.js +1 -1
- package/dist/languages/ru-RU.min.js +1 -1
- package/dist/languages/sr-SP.min.js +1 -1
- package/dist/languages/zh-CN.min.js +1 -1
- package/dist/languages/zh-TW.min.js +1 -1
- package/editorManager.js +26 -24
- package/editorManager.mjs +26 -24
- package/editors/autocompleteEditor/autocompleteEditor.js +7 -11
- package/editors/autocompleteEditor/autocompleteEditor.mjs +7 -11
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/dateEditor/dateEditor.js +49 -11
- package/editors/dateEditor/dateEditor.mjs +49 -11
- package/editors/selectEditor/selectEditor.js +20 -19
- package/editors/selectEditor/selectEditor.mjs +20 -19
- package/editors/textEditor/textEditor.js +1 -1
- package/editors/textEditor/textEditor.mjs +1 -1
- package/eventManager.js +2 -2
- package/eventManager.mjs +2 -2
- package/focusManager.js +64 -82
- package/focusManager.mjs +64 -82
- package/helpers/dom/element.js +23 -1
- package/helpers/dom/element.mjs +21 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/object.js +2 -2
- package/helpers/object.mjs +2 -2
- package/i18n/languages/ar-AR.d.ts +5 -0
- package/i18n/languages/ar-AR.js +1 -1
- package/i18n/languages/cs-CZ.d.ts +5 -0
- package/i18n/languages/cs-CZ.js +1 -1
- package/i18n/languages/de-CH.js +1 -1
- package/i18n/languages/de-DE.js +1 -1
- package/i18n/languages/en-US.js +1 -1
- package/i18n/languages/es-MX.js +1 -1
- package/i18n/languages/fr-FR.js +1 -1
- package/i18n/languages/hr-HR.d.ts +5 -0
- package/i18n/languages/hr-HR.js +1 -1
- package/i18n/languages/it-IT.js +1 -1
- package/i18n/languages/ja-JP.js +1 -1
- package/i18n/languages/ko-KR.js +1 -1
- package/i18n/languages/lv-LV.js +1 -1
- package/i18n/languages/nb-NO.js +1 -1
- package/i18n/languages/nl-NL.js +1 -1
- package/i18n/languages/pl-PL.js +1 -1
- package/i18n/languages/pt-BR.js +1 -1
- package/i18n/languages/ru-RU.js +1 -1
- package/i18n/languages/sr-SP.d.ts +5 -0
- package/i18n/languages/sr-SP.js +1 -1
- package/i18n/languages/zh-CN.js +1 -1
- package/i18n/languages/zh-TW.js +1 -1
- package/i18n/registry.js +1 -1
- package/index.d.ts +10 -0
- package/index.js +1 -1
- package/package.json +14 -10
- package/pluginHooks.d.ts +4 -3
- package/pluginHooks.js +143 -82
- package/pluginHooks.mjs +143 -82
- package/plugins/autoColumnSize/autoColumnSize.js +50 -66
- package/plugins/autoColumnSize/autoColumnSize.mjs +50 -66
- package/plugins/autoRowSize/autoRowSize.js +29 -35
- package/plugins/autoRowSize/autoRowSize.mjs +29 -35
- package/plugins/autofill/autofill.js +31 -39
- package/plugins/autofill/autofill.mjs +31 -39
- package/plugins/base/base.js +13 -18
- package/plugins/base/base.mjs +13 -18
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +6 -6
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +6 -6
- package/plugins/collapsibleColumns/collapsibleColumns.js +60 -51
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +60 -51
- package/plugins/columnSorting/columnSorting.js +50 -46
- package/plugins/columnSorting/columnSorting.mjs +50 -46
- package/plugins/columnSorting/columnStatesManager.js +1 -1
- package/plugins/columnSorting/columnStatesManager.mjs +1 -1
- package/plugins/columnSummary/columnSummary.js +36 -40
- package/plugins/columnSummary/columnSummary.mjs +36 -40
- package/plugins/columnSummary/endpoints.js +1 -1
- package/plugins/columnSummary/endpoints.mjs +1 -1
- package/plugins/comments/commentEditor.js +1 -1
- package/plugins/comments/commentEditor.mjs +1 -1
- package/plugins/comments/comments.js +117 -159
- package/plugins/comments/comments.mjs +117 -159
- package/plugins/comments/contextMenuItem/addEditComment.js +1 -1
- package/plugins/comments/contextMenuItem/readOnlyComment.js +1 -1
- package/plugins/comments/contextMenuItem/removeComment.js +1 -1
- package/plugins/comments/displaySwitch.js +1 -1
- package/plugins/comments/displaySwitch.mjs +1 -1
- package/plugins/contextMenu/commandExecutor.js +1 -1
- package/plugins/contextMenu/commandExecutor.mjs +1 -1
- package/plugins/contextMenu/contextMenu.js +24 -30
- package/plugins/contextMenu/contextMenu.mjs +24 -30
- package/plugins/contextMenu/itemsFactory.js +2 -2
- package/plugins/contextMenu/itemsFactory.mjs +2 -2
- package/plugins/contextMenu/menu/cursor.js +1 -1
- package/plugins/contextMenu/menu/cursor.mjs +1 -1
- package/plugins/contextMenu/menu/defaultShortcutsList.js +26 -10
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +26 -10
- package/plugins/contextMenu/menu/menu.js +14 -22
- package/plugins/contextMenu/menu/menu.mjs +14 -22
- package/plugins/contextMenu/menu/positioner.js +41 -58
- package/plugins/contextMenu/menu/positioner.mjs +41 -58
- package/plugins/contextMenu/predefinedItems/alignment.js +1 -1
- package/plugins/contextMenu/predefinedItems/clearColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/columnLeft.js +1 -1
- package/plugins/contextMenu/predefinedItems/columnRight.js +1 -1
- package/plugins/contextMenu/predefinedItems/index.js +1 -1
- package/plugins/contextMenu/predefinedItems/readOnly.js +1 -1
- package/plugins/contextMenu/predefinedItems/redo.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeColumn.js +1 -1
- package/plugins/contextMenu/predefinedItems/removeRow.js +1 -1
- package/plugins/contextMenu/predefinedItems/rowAbove.js +1 -1
- package/plugins/contextMenu/predefinedItems/rowBelow.js +1 -1
- package/plugins/contextMenu/predefinedItems/undo.js +1 -1
- package/plugins/copyPaste/contextMenuItem/cut.js +1 -1
- package/plugins/copyPaste/copyPaste.js +120 -161
- package/plugins/copyPaste/copyPaste.mjs +120 -161
- package/plugins/copyPaste/copyableRanges.js +43 -66
- package/plugins/copyPaste/copyableRanges.mjs +43 -66
- package/plugins/customBorders/contextMenuItem/bottom.js +1 -1
- package/plugins/customBorders/contextMenuItem/left.js +1 -1
- package/plugins/customBorders/contextMenuItem/noBorders.js +1 -1
- package/plugins/customBorders/contextMenuItem/right.js +1 -1
- package/plugins/customBorders/contextMenuItem/top.js +1 -1
- package/plugins/customBorders/customBorders.js +14 -16
- package/plugins/customBorders/customBorders.mjs +13 -15
- package/plugins/dragToScroll/dragToScroll.js +7 -7
- package/plugins/dragToScroll/dragToScroll.mjs +7 -7
- package/plugins/dropdownMenu/dropdownMenu.js +84 -110
- package/plugins/dropdownMenu/dropdownMenu.mjs +84 -110
- package/plugins/exportFile/dataProvider.js +2 -2
- package/plugins/exportFile/dataProvider.mjs +2 -2
- package/plugins/exportFile/exportFile.js +2 -2
- package/plugins/exportFile/exportFile.mjs +1 -1
- package/plugins/exportFile/types/_base.js +1 -1
- package/plugins/exportFile/types/_base.mjs +1 -1
- package/plugins/filters/component/_base.js +1 -1
- package/plugins/filters/component/_base.mjs +1 -1
- package/plugins/filters/component/actionBar.js +11 -11
- package/plugins/filters/component/actionBar.mjs +9 -9
- package/plugins/filters/component/condition.js +15 -17
- package/plugins/filters/component/condition.mjs +14 -16
- package/plugins/filters/component/operators.js +7 -7
- package/plugins/filters/component/operators.mjs +7 -7
- package/plugins/filters/component/value.js +26 -30
- package/plugins/filters/component/value.mjs +25 -29
- package/plugins/filters/condition/beginsWith.js +1 -1
- package/plugins/filters/condition/between.js +1 -1
- package/plugins/filters/condition/contains.js +1 -1
- package/plugins/filters/condition/date/after.js +1 -1
- package/plugins/filters/condition/date/before.js +1 -1
- package/plugins/filters/condition/date/today.js +1 -1
- package/plugins/filters/condition/date/tomorrow.js +1 -1
- package/plugins/filters/condition/date/yesterday.js +1 -1
- package/plugins/filters/condition/empty.js +1 -1
- package/plugins/filters/condition/endsWith.js +1 -1
- package/plugins/filters/condition/equal.js +1 -1
- package/plugins/filters/condition/greaterThan.js +1 -1
- package/plugins/filters/condition/greaterThanOrEqual.js +1 -1
- package/plugins/filters/condition/lessThan.js +1 -1
- package/plugins/filters/condition/lessThanOrEqual.js +1 -1
- package/plugins/filters/condition/none.js +1 -1
- package/plugins/filters/condition/notBetween.js +1 -1
- package/plugins/filters/condition/notContains.js +1 -1
- package/plugins/filters/condition/notEmpty.js +1 -1
- package/plugins/filters/condition/notEqual.js +1 -1
- package/plugins/filters/conditionCollection.js +1 -1
- package/plugins/filters/conditionCollection.mjs +1 -1
- package/plugins/filters/conditionUpdateObserver.js +23 -25
- package/plugins/filters/conditionUpdateObserver.mjs +23 -25
- package/plugins/filters/dataFilter.js +2 -2
- package/plugins/filters/dataFilter.mjs +2 -2
- package/plugins/filters/filters.js +84 -98
- package/plugins/filters/filters.mjs +83 -97
- package/plugins/filters/logicalOperations/conjunction.js +1 -1
- package/plugins/filters/logicalOperations/disjunction.js +1 -1
- package/plugins/filters/logicalOperations/disjunctionWithExtraCondition.js +1 -1
- package/plugins/filters/ui/_base.js +2 -2
- package/plugins/filters/ui/_base.mjs +1 -1
- package/plugins/filters/ui/input.js +13 -19
- package/plugins/filters/ui/input.mjs +13 -19
- package/plugins/filters/ui/link.js +8 -13
- package/plugins/filters/ui/link.mjs +8 -13
- package/plugins/filters/ui/multipleSelect.js +86 -113
- package/plugins/filters/ui/multipleSelect.mjs +85 -112
- package/plugins/filters/ui/radioInput.js +12 -20
- package/plugins/filters/ui/radioInput.mjs +12 -20
- package/plugins/filters/ui/select.js +51 -73
- package/plugins/filters/ui/select.mjs +49 -71
- package/plugins/formulas/formulas.js +270 -328
- package/plugins/formulas/formulas.mjs +271 -329
- package/plugins/formulas/indexSyncer/axisSyncer.js +38 -61
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +38 -61
- package/plugins/formulas/indexSyncer/index.js +25 -48
- package/plugins/formulas/indexSyncer/index.mjs +25 -48
- package/plugins/hiddenColumns/contextMenuItem/hideColumn.js +1 -1
- package/plugins/hiddenColumns/contextMenuItem/showColumn.js +1 -1
- package/plugins/hiddenColumns/hiddenColumns.js +68 -87
- package/plugins/hiddenColumns/hiddenColumns.mjs +68 -87
- package/plugins/hiddenRows/contextMenuItem/hideRow.js +1 -1
- package/plugins/hiddenRows/contextMenuItem/showRow.js +1 -1
- package/plugins/hiddenRows/hiddenRows.js +67 -86
- package/plugins/hiddenRows/hiddenRows.mjs +67 -86
- package/plugins/manualColumnFreeze/contextMenuItem/freezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/contextMenuItem/unfreezeColumn.js +1 -1
- package/plugins/manualColumnFreeze/manualColumnFreeze.js +24 -32
- package/plugins/manualColumnFreeze/manualColumnFreeze.mjs +25 -33
- package/plugins/manualColumnMove/manualColumnMove.js +133 -177
- package/plugins/manualColumnMove/manualColumnMove.mjs +133 -177
- package/plugins/manualColumnMove/ui/_base.js +1 -1
- package/plugins/manualColumnMove/ui/_base.mjs +1 -1
- package/plugins/manualColumnResize/manualColumnResize.js +169 -230
- package/plugins/manualColumnResize/manualColumnResize.mjs +169 -230
- package/plugins/manualRowMove/manualRowMove.js +106 -135
- package/plugins/manualRowMove/manualRowMove.mjs +106 -135
- package/plugins/manualRowMove/ui/_base.js +1 -1
- package/plugins/manualRowMove/ui/_base.mjs +1 -1
- package/plugins/manualRowResize/manualRowResize.js +150 -209
- package/plugins/manualRowResize/manualRowResize.mjs +150 -209
- package/plugins/mergeCells/calculations/autofill.js +1 -1
- package/plugins/mergeCells/calculations/autofill.mjs +1 -1
- package/plugins/mergeCells/calculations/selection.js +3 -72
- package/plugins/mergeCells/calculations/selection.mjs +3 -72
- package/plugins/mergeCells/cellCoords.js +1 -1
- package/plugins/mergeCells/cellCoords.mjs +1 -1
- package/plugins/mergeCells/cellsCollection.js +118 -2
- package/plugins/mergeCells/cellsCollection.mjs +118 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.js +12 -2
- package/plugins/mergeCells/contextMenuItem/toggleMerge.mjs +11 -1
- package/plugins/mergeCells/focusOrder.js +305 -0
- package/plugins/mergeCells/focusOrder.mjs +300 -0
- package/plugins/mergeCells/mergeCells.js +500 -398
- package/plugins/mergeCells/mergeCells.mjs +500 -398
- package/plugins/multiColumnSorting/multiColumnSorting.js +9 -3
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +9 -3
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +2 -2
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +2 -2
- package/plugins/nestedHeaders/nestedHeaders.js +206 -254
- package/plugins/nestedHeaders/nestedHeaders.mjs +207 -255
- package/plugins/nestedHeaders/stateManager/headersTree.js +21 -32
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +21 -32
- package/plugins/nestedHeaders/stateManager/index.js +30 -41
- package/plugins/nestedHeaders/stateManager/index.mjs +30 -41
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +19 -30
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +19 -30
- package/plugins/nestedHeaders/utils/ghostTable.js +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.mjs +1 -1
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/nestedRows/nestedRows.js +154 -185
- package/plugins/nestedRows/nestedRows.mjs +155 -186
- package/plugins/nestedRows/ui/_base.js +1 -1
- package/plugins/nestedRows/ui/_base.mjs +1 -1
- package/plugins/nestedRows/ui/contextMenu.js +13 -17
- package/plugins/nestedRows/ui/contextMenu.mjs +11 -15
- package/plugins/nestedRows/utils/rowMoveController.js +6 -6
- package/plugins/nestedRows/utils/rowMoveController.mjs +6 -6
- package/plugins/persistentState/persistentState.js +1 -1
- package/plugins/persistentState/persistentState.mjs +1 -1
- package/plugins/persistentState/storage.js +3 -3
- package/plugins/persistentState/storage.mjs +3 -3
- package/plugins/search/search.js +8 -8
- package/plugins/search/search.mjs +8 -8
- package/plugins/touchScroll/touchScroll.js +16 -20
- package/plugins/touchScroll/touchScroll.mjs +17 -21
- package/plugins/trimRows/trimRows.js +7 -7
- package/plugins/trimRows/trimRows.mjs +7 -7
- package/plugins/undoRedo/index.js +1 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +8 -5
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +8 -5
- package/selection/highlight/highlight.js +16 -18
- package/selection/highlight/highlight.mjs +15 -17
- package/selection/highlight/visualSelection.js +3 -1
- package/selection/highlight/visualSelection.mjs +3 -1
- package/selection/range.js +3 -5
- package/selection/range.mjs +2 -4
- package/selection/selection.js +227 -69
- package/selection/selection.mjs +225 -67
- package/selection/transformation.js +149 -118
- package/selection/transformation.mjs +149 -118
- package/shortcutContexts/commands/editor/closeAndSave.js +2 -2
- package/shortcutContexts/commands/editor/closeAndSave.mjs +2 -2
- package/shortcutContexts/commands/editor/open.js +18 -3
- package/shortcutContexts/commands/editor/open.mjs +18 -3
- package/shortcutContexts/commands/extendCellsSelection/down.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/down.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/left.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/right.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toColumns.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostBottom.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.js +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineEnd.mjs +9 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.js +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostInlineStart.mjs +10 -3
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostLeft.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostRight.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.js +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toMostTop.mjs +3 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/toRows.mjs +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.js +1 -1
- package/shortcutContexts/commands/extendCellsSelection/up.mjs +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +6 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +6 -1
- package/shortcutContexts/grid.js +9 -3
- package/shortcutContexts/grid.mjs +9 -3
- package/shortcuts/context.js +3 -2
- package/shortcuts/context.mjs +3 -2
- package/shortcuts/manager.js +2 -2
- package/shortcuts/manager.mjs +2 -2
- package/tableView.js +53 -79
- package/tableView.mjs +53 -79
- package/translations/changesObservable/observable.js +21 -38
- package/translations/changesObservable/observable.mjs +21 -38
- package/translations/changesObservable/observer.js +7 -12
- package/translations/changesObservable/observer.mjs +6 -11
- package/translations/indexMapper.js +1 -1
- package/translations/indexMapper.mjs +1 -1
- package/translations/mapCollections/aggregatedCollection.js +2 -2
- package/translations/mapCollections/aggregatedCollection.mjs +2 -2
- package/translations/mapCollections/mapCollection.js +1 -1
- package/translations/mapCollections/mapCollection.mjs +1 -1
- package/translations/maps/indexMap.js +2 -2
- package/translations/maps/indexMap.mjs +2 -2
- package/translations/maps/linkedPhysicalIndexToValueMap.js +1 -1
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +1 -1
- package/utils/dataStructures/linkedList.js +7 -2
- package/utils/dataStructures/linkedList.mjs +7 -2
- package/utils/dataStructures/tree.js +2 -2
- package/utils/dataStructures/tree.mjs +2 -2
- package/utils/ghostTable.js +1 -1
- package/utils/ghostTable.mjs +1 -1
- package/utils/interval.js +27 -45
- package/utils/interval.mjs +27 -45
- package/utils/samplesGenerator.js +1 -1
- package/utils/samplesGenerator.mjs +1 -1
@@ -1,9 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
|
-
require("core-js/modules/es.json.stringify.js");
|
5
4
|
require("core-js/modules/es.error.cause.js");
|
6
5
|
require("core-js/modules/es.array.push.js");
|
6
|
+
require("core-js/modules/es.json.stringify.js");
|
7
7
|
var _base = require("../base");
|
8
8
|
var _staticRegister = _interopRequireDefault(require("../../utils/staticRegister"));
|
9
9
|
var _console = require("../../helpers/console");
|
@@ -19,16 +19,13 @@ var _indexSyncer = _interopRequireDefault(require("./indexSyncer"));
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
20
20
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
21
21
|
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; }
|
22
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i :
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
23
23
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
24
24
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
25
25
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
26
|
-
function _classPrivateFieldSet(
|
27
|
-
function
|
28
|
-
function
|
29
|
-
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
30
|
-
function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
|
31
|
-
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
26
|
+
function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
|
27
|
+
function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
|
28
|
+
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
|
32
29
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'formulas';
|
33
30
|
const SETTING_KEYS = exports.SETTING_KEYS = ['maxRows', 'maxColumns', 'language'];
|
34
31
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 260;
|
@@ -50,7 +47,7 @@ const isBlockedSource = source => source === 'UndoRedo.undo' || source === 'Undo
|
|
50
47
|
* integration with our other product, [HyperFormula](https://github.com/handsontable/hyperformula/), which is a
|
51
48
|
* powerful calculation engine with an extensive number of features.
|
52
49
|
*
|
53
|
-
* To test out HyperFormula, see [this guide](@/guides/formulas/formula-calculation.md#available-functions).
|
50
|
+
* To test out HyperFormula, see [this guide](@/guides/formulas/formula-calculation/formula-calculation.md#available-functions).
|
54
51
|
*
|
55
52
|
* @plugin Formulas
|
56
53
|
* @class Formulas
|
@@ -58,228 +55,12 @@ const isBlockedSource = source => source === 'UndoRedo.undo' || source === 'Undo
|
|
58
55
|
var _internalOperationPending = /*#__PURE__*/new WeakMap();
|
59
56
|
var _hotWasInitializedWithEmptyData = /*#__PURE__*/new WeakMap();
|
60
57
|
var _engineListeners = /*#__PURE__*/new WeakMap();
|
61
|
-
var
|
62
|
-
var _onBeforeAutofill = /*#__PURE__*/new WeakSet();
|
63
|
-
var _onBeforeLoadData = /*#__PURE__*/new WeakSet();
|
64
|
-
var _onAfterCellMetaReset = /*#__PURE__*/new WeakSet();
|
65
|
-
var _onAfterLoadData = /*#__PURE__*/new WeakSet();
|
66
|
-
var _onModifyData = /*#__PURE__*/new WeakSet();
|
67
|
-
var _onModifySourceData = /*#__PURE__*/new WeakSet();
|
68
|
-
var _onAfterSetDataAtCell = /*#__PURE__*/new WeakSet();
|
69
|
-
var _onAfterSetSourceDataAtCell = /*#__PURE__*/new WeakSet();
|
70
|
-
var _onBeforeCreateRow = /*#__PURE__*/new WeakSet();
|
71
|
-
var _onBeforeCreateCol = /*#__PURE__*/new WeakSet();
|
72
|
-
var _onBeforeRemoveRow = /*#__PURE__*/new WeakSet();
|
73
|
-
var _onBeforeRemoveCol = /*#__PURE__*/new WeakSet();
|
74
|
-
var _onAfterCreateRow = /*#__PURE__*/new WeakSet();
|
75
|
-
var _onAfterCreateCol = /*#__PURE__*/new WeakSet();
|
76
|
-
var _onAfterRemoveRow = /*#__PURE__*/new WeakSet();
|
77
|
-
var _onAfterRemoveCol = /*#__PURE__*/new WeakSet();
|
78
|
-
var _onAfterDetachChild = /*#__PURE__*/new WeakSet();
|
79
|
-
var _onEngineValuesUpdated = /*#__PURE__*/new WeakSet();
|
80
|
-
var _onEngineNamedExpressionsAdded = /*#__PURE__*/new WeakSet();
|
81
|
-
var _onEngineNamedExpressionsRemoved = /*#__PURE__*/new WeakSet();
|
82
|
-
var _onEngineSheetAdded = /*#__PURE__*/new WeakSet();
|
83
|
-
var _onEngineSheetRenamed = /*#__PURE__*/new WeakSet();
|
84
|
-
var _onEngineSheetRemoved = /*#__PURE__*/new WeakSet();
|
58
|
+
var _Formulas_brand = /*#__PURE__*/new WeakSet();
|
85
59
|
class Formulas extends _base.BasePlugin {
|
86
60
|
constructor() {
|
87
61
|
var _this;
|
88
62
|
super(...arguments);
|
89
63
|
_this = this;
|
90
|
-
/**
|
91
|
-
* Called when a sheet is removed from the engine instance.
|
92
|
-
*
|
93
|
-
* @fires Hooks#afterSheetRemoved
|
94
|
-
* @param {string} removedSheetDisplayName The removed sheet name.
|
95
|
-
* @param {Array} changes The values and location of applied changes.
|
96
|
-
*/
|
97
|
-
_classPrivateMethodInitSpec(this, _onEngineSheetRemoved);
|
98
|
-
/**
|
99
|
-
* Called when a sheet in the engine instance is renamed.
|
100
|
-
*
|
101
|
-
* @fires Hooks#afterSheetRenamed
|
102
|
-
* @param {string} oldDisplayName The old name of the sheet.
|
103
|
-
* @param {string} newDisplayName The new name of the sheet.
|
104
|
-
*/
|
105
|
-
_classPrivateMethodInitSpec(this, _onEngineSheetRenamed);
|
106
|
-
/**
|
107
|
-
* Called when a new sheet is added to the engine instance.
|
108
|
-
*
|
109
|
-
* @fires Hooks#afterSheetAdded
|
110
|
-
* @param {string} addedSheetDisplayName The name of the added sheet.
|
111
|
-
*/
|
112
|
-
_classPrivateMethodInitSpec(this, _onEngineSheetAdded);
|
113
|
-
/**
|
114
|
-
* Called when a named expression is removed from the engine instance.
|
115
|
-
*
|
116
|
-
* @fires Hooks#afterNamedExpressionRemoved
|
117
|
-
* @param {string} namedExpressionName The name of the removed expression.
|
118
|
-
* @param {Array} changes The values and location of applied changes.
|
119
|
-
*/
|
120
|
-
_classPrivateMethodInitSpec(this, _onEngineNamedExpressionsRemoved);
|
121
|
-
/**
|
122
|
-
* Called when a named expression is added to the engine instance.
|
123
|
-
*
|
124
|
-
* @fires Hooks#afterNamedExpressionAdded
|
125
|
-
* @param {string} namedExpressionName The name of the added expression.
|
126
|
-
* @param {Array} changes The values and location of applied changes.
|
127
|
-
*/
|
128
|
-
_classPrivateMethodInitSpec(this, _onEngineNamedExpressionsAdded);
|
129
|
-
/**
|
130
|
-
* Called when a value is updated in the engine.
|
131
|
-
*
|
132
|
-
* @fires Hooks#afterFormulasValuesUpdate
|
133
|
-
* @param {Array} changes The values and location of applied changes.
|
134
|
-
*/
|
135
|
-
_classPrivateMethodInitSpec(this, _onEngineValuesUpdated);
|
136
|
-
/**
|
137
|
-
* `afterDetachChild` hook callback.
|
138
|
-
* Used to sync the data of the rows detached in the Nested Rows plugin with the engine's dataset.
|
139
|
-
*
|
140
|
-
* @param {object} parent An object representing the parent from which the element was detached.
|
141
|
-
* @param {object} element The detached element.
|
142
|
-
* @param {number} finalElementRowIndex The final row index of the detached element.
|
143
|
-
*/
|
144
|
-
_classPrivateMethodInitSpec(this, _onAfterDetachChild);
|
145
|
-
/**
|
146
|
-
* `afterRemoveCol` hook callback.
|
147
|
-
*
|
148
|
-
* @param {number} col Visual index of starter column.
|
149
|
-
* @param {number} amount An amount of removed columns.
|
150
|
-
* @param {number[]} physicalColumns An array of physical columns removed from the data source.
|
151
|
-
* @param {string} [source] String that identifies source of hook call
|
152
|
-
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
153
|
-
*/
|
154
|
-
_classPrivateMethodInitSpec(this, _onAfterRemoveCol);
|
155
|
-
/**
|
156
|
-
* `afterRemoveRow` hook callback.
|
157
|
-
*
|
158
|
-
* @param {number} row Visual index of starter row.
|
159
|
-
* @param {number} amount An amount of removed rows.
|
160
|
-
* @param {number[]} physicalRows An array of physical rows removed from the data source.
|
161
|
-
* @param {string} [source] String that identifies source of hook call
|
162
|
-
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
163
|
-
*/
|
164
|
-
_classPrivateMethodInitSpec(this, _onAfterRemoveRow);
|
165
|
-
/**
|
166
|
-
* `afterCreateCol` hook callback.
|
167
|
-
*
|
168
|
-
* @param {number} visualColumn Represents the visual index of first newly created column in the data source.
|
169
|
-
* @param {number} amount Number of newly created columns in the data source.
|
170
|
-
* @param {string} [source] String that identifies source of hook call
|
171
|
-
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
172
|
-
*/
|
173
|
-
_classPrivateMethodInitSpec(this, _onAfterCreateCol);
|
174
|
-
/**
|
175
|
-
* `afterCreateRow` hook callback.
|
176
|
-
*
|
177
|
-
* @param {number} visualRow Represents the visual index of first newly created row in the data source array.
|
178
|
-
* @param {number} amount Number of newly created rows in the data source array.
|
179
|
-
* @param {string} [source] String that identifies source of hook call
|
180
|
-
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
181
|
-
*/
|
182
|
-
_classPrivateMethodInitSpec(this, _onAfterCreateRow);
|
183
|
-
/**
|
184
|
-
* `beforeRemoveCol` hook callback.
|
185
|
-
*
|
186
|
-
* @param {number} col Visual index of starter column.
|
187
|
-
* @param {number} amount Amount of columns to be removed.
|
188
|
-
* @param {number[]} physicalColumns An array of physical columns removed from the data source.
|
189
|
-
* @returns {*|boolean} If false is returned the action is canceled.
|
190
|
-
*/
|
191
|
-
_classPrivateMethodInitSpec(this, _onBeforeRemoveCol);
|
192
|
-
/**
|
193
|
-
* `beforeRemoveRow` hook callback.
|
194
|
-
*
|
195
|
-
* @param {number} row Visual index of starter row.
|
196
|
-
* @param {number} amount Amount of rows to be removed.
|
197
|
-
* @param {number[]} physicalRows An array of physical rows removed from the data source.
|
198
|
-
* @returns {*|boolean} If false is returned the action is canceled.
|
199
|
-
*/
|
200
|
-
_classPrivateMethodInitSpec(this, _onBeforeRemoveRow);
|
201
|
-
/**
|
202
|
-
* `beforeCreateCol` hook callback.
|
203
|
-
*
|
204
|
-
* @param {number} visualColumn Represents the visual index of first newly created column in the data source.
|
205
|
-
* @param {number} amount Number of newly created columns in the data source.
|
206
|
-
* @returns {*|boolean} If false is returned the action is canceled.
|
207
|
-
*/
|
208
|
-
_classPrivateMethodInitSpec(this, _onBeforeCreateCol);
|
209
|
-
/**
|
210
|
-
* `beforeCreateRow` hook callback.
|
211
|
-
*
|
212
|
-
* @param {number} visualRow Represents the visual index of first newly created row in the data source array.
|
213
|
-
* @param {number} amount Number of newly created rows in the data source array.
|
214
|
-
* @returns {*|boolean} If false is returned the action is canceled.
|
215
|
-
*/
|
216
|
-
_classPrivateMethodInitSpec(this, _onBeforeCreateRow);
|
217
|
-
/**
|
218
|
-
* `onAfterSetSourceDataAtCell` hook callback.
|
219
|
-
*
|
220
|
-
* @param {Array[]} changes An array of changes in format [[row, column, oldValue, value], ...].
|
221
|
-
* @param {string} [source] String that identifies source of hook call
|
222
|
-
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
223
|
-
*/
|
224
|
-
_classPrivateMethodInitSpec(this, _onAfterSetSourceDataAtCell);
|
225
|
-
/**
|
226
|
-
* `onAfterSetDataAtCell` hook callback.
|
227
|
-
*
|
228
|
-
* @param {Array[]} changes An array of changes in format [[row, prop, oldValue, value], ...].
|
229
|
-
* @param {string} [source] String that identifies source of hook call
|
230
|
-
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
231
|
-
*/
|
232
|
-
_classPrivateMethodInitSpec(this, _onAfterSetDataAtCell);
|
233
|
-
/**
|
234
|
-
* `modifySourceData` hook callback.
|
235
|
-
*
|
236
|
-
* @param {number} row Physical row index.
|
237
|
-
* @param {number|string} columnOrProp Physical column index or prop.
|
238
|
-
* @param {object} valueHolder Object which contains original value which can be modified by overwriting `.value`
|
239
|
-
* property.
|
240
|
-
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
241
|
-
*/
|
242
|
-
_classPrivateMethodInitSpec(this, _onModifySourceData);
|
243
|
-
/**
|
244
|
-
* `modifyData` hook callback.
|
245
|
-
*
|
246
|
-
* @param {number} physicalRow Physical row index.
|
247
|
-
* @param {number} visualColumn Visual column index.
|
248
|
-
* @param {object} valueHolder Object which contains original value which can be modified by overwriting `.value`
|
249
|
-
* property.
|
250
|
-
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
251
|
-
*/
|
252
|
-
_classPrivateMethodInitSpec(this, _onModifyData);
|
253
|
-
/**
|
254
|
-
* `afterLoadData` hook callback.
|
255
|
-
*
|
256
|
-
* @param {Array} sourceData Array of arrays or array of objects containing data.
|
257
|
-
* @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
|
258
|
-
* @param {string} [source] Source of the call.
|
259
|
-
*/
|
260
|
-
_classPrivateMethodInitSpec(this, _onAfterLoadData);
|
261
|
-
/**
|
262
|
-
* Callback to `afterCellMetaReset` hook which is triggered after setting cell meta.
|
263
|
-
*/
|
264
|
-
_classPrivateMethodInitSpec(this, _onAfterCellMetaReset);
|
265
|
-
/**
|
266
|
-
* `beforeLoadData` hook callback.
|
267
|
-
*
|
268
|
-
* @param {Array} sourceData Array of arrays or array of objects containing data.
|
269
|
-
* @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
|
270
|
-
* @param {string} [source] Source of the call.
|
271
|
-
*/
|
272
|
-
_classPrivateMethodInitSpec(this, _onBeforeLoadData);
|
273
|
-
/**
|
274
|
-
* `onBeforeAutofill` hook callback.
|
275
|
-
*
|
276
|
-
* @param {Array[]} fillData The data that was used to fill the `targetRange`. If `beforeAutofill` was used
|
277
|
-
* and returned `[[]]`, this will be the same object that was returned from `beforeAutofill`.
|
278
|
-
* @param {CellRange} sourceRange The range values will be filled from.
|
279
|
-
* @param {CellRange} targetRange The range new values will be filled into.
|
280
|
-
* @returns {boolean|*}
|
281
|
-
*/
|
282
|
-
_classPrivateMethodInitSpec(this, _onBeforeAutofill);
|
283
64
|
/**
|
284
65
|
* The hook allows to translate the formula value to calculated value before it goes to the
|
285
66
|
* validator function.
|
@@ -289,66 +70,57 @@ class Formulas extends _base.BasePlugin {
|
|
289
70
|
* @param {number|string} prop The visual column index or property name of the column.
|
290
71
|
* @returns {*} Returns value to validate.
|
291
72
|
*/
|
292
|
-
_classPrivateMethodInitSpec(this,
|
73
|
+
_classPrivateMethodInitSpec(this, _Formulas_brand);
|
293
74
|
/**
|
294
75
|
* Flag used to bypass hooks in internal operations.
|
295
76
|
*
|
296
77
|
* @private
|
297
78
|
* @type {boolean}
|
298
79
|
*/
|
299
|
-
_classPrivateFieldInitSpec(this, _internalOperationPending,
|
300
|
-
writable: true,
|
301
|
-
value: false
|
302
|
-
});
|
80
|
+
_classPrivateFieldInitSpec(this, _internalOperationPending, false);
|
303
81
|
/**
|
304
82
|
* Flag needed to mark if Handsontable was initialized with no data.
|
305
83
|
* (Required to work around the fact, that Handsontable auto-generates sample data, when no data is provided).
|
306
84
|
*
|
307
85
|
* @type {boolean}
|
308
86
|
*/
|
309
|
-
_classPrivateFieldInitSpec(this, _hotWasInitializedWithEmptyData,
|
310
|
-
writable: true,
|
311
|
-
value: false
|
312
|
-
});
|
87
|
+
_classPrivateFieldInitSpec(this, _hotWasInitializedWithEmptyData, false);
|
313
88
|
/**
|
314
89
|
* The list of the HyperFormula listeners.
|
315
90
|
*
|
316
91
|
* @type {Array}
|
317
92
|
*/
|
318
|
-
_classPrivateFieldInitSpec(this, _engineListeners, {
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
return _classPrivateMethodGet(_this, _onEngineSheetRemoved, _onEngineSheetRemoved2).call(_this, ...args);
|
350
|
-
}]]
|
351
|
-
});
|
93
|
+
_classPrivateFieldInitSpec(this, _engineListeners, [['valuesUpdated', function () {
|
94
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
95
|
+
args[_key] = arguments[_key];
|
96
|
+
}
|
97
|
+
return _assertClassBrand(_Formulas_brand, _this, _onEngineValuesUpdated).call(_this, ...args);
|
98
|
+
}], ['namedExpressionAdded', function () {
|
99
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
100
|
+
args[_key2] = arguments[_key2];
|
101
|
+
}
|
102
|
+
return _assertClassBrand(_Formulas_brand, _this, _onEngineNamedExpressionsAdded).call(_this, ...args);
|
103
|
+
}], ['namedExpressionRemoved', function () {
|
104
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
105
|
+
args[_key3] = arguments[_key3];
|
106
|
+
}
|
107
|
+
return _assertClassBrand(_Formulas_brand, _this, _onEngineNamedExpressionsRemoved).call(_this, ...args);
|
108
|
+
}], ['sheetAdded', function () {
|
109
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
110
|
+
args[_key4] = arguments[_key4];
|
111
|
+
}
|
112
|
+
return _assertClassBrand(_Formulas_brand, _this, _onEngineSheetAdded).call(_this, ...args);
|
113
|
+
}], ['sheetRenamed', function () {
|
114
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
115
|
+
args[_key5] = arguments[_key5];
|
116
|
+
}
|
117
|
+
return _assertClassBrand(_Formulas_brand, _this, _onEngineSheetRenamed).call(_this, ...args);
|
118
|
+
}], ['sheetRemoved', function () {
|
119
|
+
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
120
|
+
args[_key6] = arguments[_key6];
|
121
|
+
}
|
122
|
+
return _assertClassBrand(_Formulas_brand, _this, _onEngineSheetRemoved).call(_this, ...args);
|
123
|
+
}]]);
|
352
124
|
/**
|
353
125
|
* Static register used to set up one global HyperFormula instance.
|
354
126
|
* TODO: currently used in tests, might be removed later.
|
@@ -443,13 +215,13 @@ class Formulas extends _base.BasePlugin {
|
|
443
215
|
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
444
216
|
args[_key7] = arguments[_key7];
|
445
217
|
}
|
446
|
-
return
|
218
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeLoadData).call(_this2, ...args);
|
447
219
|
});
|
448
220
|
this.addHook('afterLoadData', function () {
|
449
221
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
450
222
|
args[_key8] = arguments[_key8];
|
451
223
|
}
|
452
|
-
return
|
224
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterLoadData).call(_this2, ...args);
|
453
225
|
});
|
454
226
|
|
455
227
|
// The `updateData` hooks utilize the same logic as the `loadData` hooks.
|
@@ -457,97 +229,97 @@ class Formulas extends _base.BasePlugin {
|
|
457
229
|
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
458
230
|
args[_key9] = arguments[_key9];
|
459
231
|
}
|
460
|
-
return
|
232
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeLoadData).call(_this2, ...args);
|
461
233
|
});
|
462
234
|
this.addHook('afterUpdateData', function () {
|
463
235
|
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
464
236
|
args[_key10] = arguments[_key10];
|
465
237
|
}
|
466
|
-
return
|
238
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterLoadData).call(_this2, ...args);
|
467
239
|
});
|
468
240
|
this.addHook('modifyData', function () {
|
469
241
|
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
470
242
|
args[_key11] = arguments[_key11];
|
471
243
|
}
|
472
|
-
return
|
244
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onModifyData).call(_this2, ...args);
|
473
245
|
});
|
474
246
|
this.addHook('modifySourceData', function () {
|
475
247
|
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
476
248
|
args[_key12] = arguments[_key12];
|
477
249
|
}
|
478
|
-
return
|
250
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onModifySourceData).call(_this2, ...args);
|
479
251
|
});
|
480
252
|
this.addHook('beforeValidate', function () {
|
481
253
|
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
482
254
|
args[_key13] = arguments[_key13];
|
483
255
|
}
|
484
|
-
return
|
256
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeValidate).call(_this2, ...args);
|
485
257
|
});
|
486
258
|
this.addHook('afterSetSourceDataAtCell', function () {
|
487
259
|
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
488
260
|
args[_key14] = arguments[_key14];
|
489
261
|
}
|
490
|
-
return
|
262
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterSetSourceDataAtCell).call(_this2, ...args);
|
491
263
|
});
|
492
264
|
this.addHook('afterSetDataAtCell', function () {
|
493
265
|
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
494
266
|
args[_key15] = arguments[_key15];
|
495
267
|
}
|
496
|
-
return
|
268
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterSetDataAtCell).call(_this2, ...args);
|
497
269
|
});
|
498
270
|
this.addHook('afterSetDataAtRowProp', function () {
|
499
271
|
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
500
272
|
args[_key16] = arguments[_key16];
|
501
273
|
}
|
502
|
-
return
|
274
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterSetDataAtCell).call(_this2, ...args);
|
503
275
|
});
|
504
276
|
this.addHook('beforeCreateRow', function () {
|
505
277
|
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
506
278
|
args[_key17] = arguments[_key17];
|
507
279
|
}
|
508
|
-
return
|
280
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeCreateRow).call(_this2, ...args);
|
509
281
|
});
|
510
282
|
this.addHook('beforeCreateCol', function () {
|
511
283
|
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
512
284
|
args[_key18] = arguments[_key18];
|
513
285
|
}
|
514
|
-
return
|
286
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeCreateCol).call(_this2, ...args);
|
515
287
|
});
|
516
288
|
this.addHook('afterCreateRow', function () {
|
517
289
|
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
518
290
|
args[_key19] = arguments[_key19];
|
519
291
|
}
|
520
|
-
return
|
292
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterCreateRow).call(_this2, ...args);
|
521
293
|
});
|
522
294
|
this.addHook('afterCreateCol', function () {
|
523
295
|
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
524
296
|
args[_key20] = arguments[_key20];
|
525
297
|
}
|
526
|
-
return
|
298
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterCreateCol).call(_this2, ...args);
|
527
299
|
});
|
528
300
|
this.addHook('beforeRemoveRow', function () {
|
529
301
|
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
530
302
|
args[_key21] = arguments[_key21];
|
531
303
|
}
|
532
|
-
return
|
304
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeRemoveRow).call(_this2, ...args);
|
533
305
|
});
|
534
306
|
this.addHook('beforeRemoveCol', function () {
|
535
307
|
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
536
308
|
args[_key22] = arguments[_key22];
|
537
309
|
}
|
538
|
-
return
|
310
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeRemoveCol).call(_this2, ...args);
|
539
311
|
});
|
540
312
|
this.addHook('afterRemoveRow', function () {
|
541
313
|
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
542
314
|
args[_key23] = arguments[_key23];
|
543
315
|
}
|
544
|
-
return
|
316
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterRemoveRow).call(_this2, ...args);
|
545
317
|
});
|
546
318
|
this.addHook('afterRemoveCol', function () {
|
547
319
|
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
|
548
320
|
args[_key24] = arguments[_key24];
|
549
321
|
}
|
550
|
-
return
|
322
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterRemoveCol).call(_this2, ...args);
|
551
323
|
});
|
552
324
|
this.indexSyncer = new _indexSyncer.default(this.hot.rowIndexMapper, this.hot.columnIndexMapper, postponedAction => {
|
553
325
|
this.hot.addHookOnce('init', () => {
|
@@ -592,7 +364,7 @@ class Formulas extends _base.BasePlugin {
|
|
592
364
|
for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
|
593
365
|
args[_key25] = arguments[_key25];
|
594
366
|
}
|
595
|
-
return
|
367
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterCellMetaReset).call(_this2, ...args);
|
596
368
|
});
|
597
369
|
|
598
370
|
// Handling undo actions on data just using HyperFormula's UndoRedo mechanism
|
@@ -616,15 +388,15 @@ class Formulas extends _base.BasePlugin {
|
|
616
388
|
for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
|
617
389
|
args[_key26] = arguments[_key26];
|
618
390
|
}
|
619
|
-
return
|
391
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onAfterDetachChild).call(_this2, ...args);
|
620
392
|
});
|
621
393
|
this.addHook('beforeAutofill', function () {
|
622
394
|
for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {
|
623
395
|
args[_key27] = arguments[_key27];
|
624
396
|
}
|
625
|
-
return
|
397
|
+
return _assertClassBrand(_Formulas_brand, _this2, _onBeforeAutofill).call(_this2, ...args);
|
626
398
|
});
|
627
|
-
_classPrivateFieldGet(
|
399
|
+
_classPrivateFieldGet(_engineListeners, this).forEach(_ref => {
|
628
400
|
let [eventName, listener] = _ref;
|
629
401
|
return this.engine.on(eventName, listener);
|
630
402
|
});
|
@@ -635,7 +407,7 @@ class Formulas extends _base.BasePlugin {
|
|
635
407
|
* Disables the plugin functionality for this Handsontable instance.
|
636
408
|
*/
|
637
409
|
disablePlugin() {
|
638
|
-
_classPrivateFieldGet(
|
410
|
+
_classPrivateFieldGet(_engineListeners, this).forEach(_ref2 => {
|
639
411
|
let [eventName, listener] = _ref2;
|
640
412
|
return this.engine.off(eventName, listener);
|
641
413
|
});
|
@@ -677,12 +449,12 @@ class Formulas extends _base.BasePlugin {
|
|
677
449
|
* Destroys the plugin instance.
|
678
450
|
*/
|
679
451
|
destroy() {
|
680
|
-
_classPrivateFieldGet(
|
452
|
+
_classPrivateFieldGet(_engineListeners, this).forEach(_ref3 => {
|
681
453
|
var _this$engine;
|
682
454
|
let [eventName, listener] = _ref3;
|
683
455
|
return (_this$engine = this.engine) === null || _this$engine === void 0 ? void 0 : _this$engine.off(eventName, listener);
|
684
456
|
});
|
685
|
-
_classPrivateFieldSet(
|
457
|
+
_classPrivateFieldSet(_engineListeners, this, null);
|
686
458
|
(0, _register.unregisterEngine)(this.engine, this.hot);
|
687
459
|
this.engine = null;
|
688
460
|
super.destroy();
|
@@ -892,7 +664,7 @@ class Formulas extends _base.BasePlugin {
|
|
892
664
|
}
|
893
665
|
}
|
894
666
|
exports.Formulas = Formulas;
|
895
|
-
function
|
667
|
+
function _onBeforeValidate(value, visualRow, prop) {
|
896
668
|
const visualColumn = this.hot.propToCol(prop);
|
897
669
|
if (this.isFormulaCellType(visualRow, visualColumn)) {
|
898
670
|
const address = {
|
@@ -912,7 +684,16 @@ function _onBeforeValidate2(value, visualRow, prop) {
|
|
912
684
|
}
|
913
685
|
return value;
|
914
686
|
}
|
915
|
-
|
687
|
+
/**
|
688
|
+
* `onBeforeAutofill` hook callback.
|
689
|
+
*
|
690
|
+
* @param {Array[]} fillData The data that was used to fill the `targetRange`. If `beforeAutofill` was used
|
691
|
+
* and returned `[[]]`, this will be the same object that was returned from `beforeAutofill`.
|
692
|
+
* @param {CellRange} sourceRange The range values will be filled from.
|
693
|
+
* @param {CellRange} targetRange The range new values will be filled into.
|
694
|
+
* @returns {boolean|*}
|
695
|
+
*/
|
696
|
+
function _onBeforeAutofill(fillData, sourceRange, targetRange) {
|
916
697
|
const {
|
917
698
|
row: sourceTopStartRow,
|
918
699
|
col: sourceTopStartColumn
|
@@ -989,7 +770,14 @@ function _onBeforeAutofill2(fillData, sourceRange, targetRange) {
|
|
989
770
|
}
|
990
771
|
return fillRangeData;
|
991
772
|
}
|
992
|
-
|
773
|
+
/**
|
774
|
+
* `beforeLoadData` hook callback.
|
775
|
+
*
|
776
|
+
* @param {Array} sourceData Array of arrays or array of objects containing data.
|
777
|
+
* @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
|
778
|
+
* @param {string} [source] Source of the call.
|
779
|
+
*/
|
780
|
+
function _onBeforeLoadData(sourceData, initialLoad) {
|
993
781
|
let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
994
782
|
if (source.includes((0, _string.toUpperCaseFirst)(PLUGIN_KEY))) {
|
995
783
|
return;
|
@@ -997,9 +785,12 @@ function _onBeforeLoadData2(sourceData, initialLoad) {
|
|
997
785
|
|
998
786
|
// This flag needs to be defined, because not passing data to HOT results in HOT auto-generating a `null`-filled
|
999
787
|
// initial dataset.
|
1000
|
-
_classPrivateFieldSet(
|
788
|
+
_classPrivateFieldSet(_hotWasInitializedWithEmptyData, this, (0, _mixed.isUndefined)(this.hot.getSettings().data));
|
1001
789
|
}
|
1002
|
-
|
790
|
+
/**
|
791
|
+
* Callback to `afterCellMetaReset` hook which is triggered after setting cell meta.
|
792
|
+
*/
|
793
|
+
function _onAfterCellMetaReset() {
|
1003
794
|
const sourceDataArray = this.hot.getSourceDataArray();
|
1004
795
|
let valueChanged = false;
|
1005
796
|
sourceDataArray.forEach((rowData, rowIndex) => {
|
@@ -1019,32 +810,48 @@ function _onAfterCellMetaReset2() {
|
|
1019
810
|
});
|
1020
811
|
});
|
1021
812
|
if (valueChanged === true) {
|
1022
|
-
_classPrivateFieldSet(
|
813
|
+
_classPrivateFieldSet(_internalOperationPending, this, true);
|
1023
814
|
this.engine.setSheetContent(this.sheetId, sourceDataArray);
|
1024
|
-
_classPrivateFieldSet(
|
815
|
+
_classPrivateFieldSet(_internalOperationPending, this, false);
|
1025
816
|
}
|
1026
817
|
}
|
1027
|
-
|
818
|
+
/**
|
819
|
+
* `afterLoadData` hook callback.
|
820
|
+
*
|
821
|
+
* @param {Array} sourceData Array of arrays or array of objects containing data.
|
822
|
+
* @param {boolean} initialLoad Flag that determines whether the data has been loaded during the initialization.
|
823
|
+
* @param {string} [source] Source of the call.
|
824
|
+
*/
|
825
|
+
function _onAfterLoadData(sourceData, initialLoad) {
|
1028
826
|
let source = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
1029
827
|
if (source.includes((0, _string.toUpperCaseFirst)(PLUGIN_KEY))) {
|
1030
828
|
return;
|
1031
829
|
}
|
1032
830
|
this.sheetName = (0, _register.setupSheet)(this.engine, this.hot.getSettings()[PLUGIN_KEY].sheetName);
|
1033
|
-
if (!_classPrivateFieldGet(
|
831
|
+
if (!_classPrivateFieldGet(_hotWasInitializedWithEmptyData, this)) {
|
1034
832
|
const sourceDataArray = this.hot.getSourceDataArray();
|
1035
833
|
if (this.engine.isItPossibleToReplaceSheetContent(this.sheetId, sourceDataArray)) {
|
1036
|
-
_classPrivateFieldSet(
|
834
|
+
_classPrivateFieldSet(_internalOperationPending, this, true);
|
1037
835
|
const dependentCells = this.engine.setSheetContent(this.sheetId, sourceDataArray);
|
1038
836
|
this.indexSyncer.setupSyncEndpoint(this.engine, this.sheetId);
|
1039
837
|
this.renderDependentSheets(dependentCells);
|
1040
|
-
_classPrivateFieldSet(
|
838
|
+
_classPrivateFieldSet(_internalOperationPending, this, false);
|
1041
839
|
}
|
1042
840
|
} else {
|
1043
841
|
this.switchSheet(this.sheetName);
|
1044
842
|
}
|
1045
843
|
}
|
1046
|
-
|
1047
|
-
|
844
|
+
/**
|
845
|
+
* `modifyData` hook callback.
|
846
|
+
*
|
847
|
+
* @param {number} physicalRow Physical row index.
|
848
|
+
* @param {number} visualColumn Visual column index.
|
849
|
+
* @param {object} valueHolder Object which contains original value which can be modified by overwriting `.value`
|
850
|
+
* property.
|
851
|
+
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
852
|
+
*/
|
853
|
+
function _onModifyData(physicalRow, visualColumn, valueHolder, ioMode) {
|
854
|
+
if (ioMode !== 'get' || _classPrivateFieldGet(_internalOperationPending, this) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) {
|
1048
855
|
return;
|
1049
856
|
}
|
1050
857
|
const visualRow = this.hot.toVisualRow(physicalRow);
|
@@ -1086,8 +893,17 @@ function _onModifyData2(physicalRow, visualColumn, valueHolder, ioMode) {
|
|
1086
893
|
const value = typeof cellValue === 'object' && cellValue !== null ? cellValue.value : cellValue;
|
1087
894
|
valueHolder.value = value;
|
1088
895
|
}
|
1089
|
-
|
1090
|
-
|
896
|
+
/**
|
897
|
+
* `modifySourceData` hook callback.
|
898
|
+
*
|
899
|
+
* @param {number} row Physical row index.
|
900
|
+
* @param {number|string} columnOrProp Physical column index or prop.
|
901
|
+
* @param {object} valueHolder Object which contains original value which can be modified by overwriting `.value`
|
902
|
+
* property.
|
903
|
+
* @param {string} ioMode String which indicates for what operation hook is fired (`get` or `set`).
|
904
|
+
*/
|
905
|
+
function _onModifySourceData(row, columnOrProp, valueHolder, ioMode) {
|
906
|
+
if (ioMode !== 'get' || _classPrivateFieldGet(_internalOperationPending, this) || this.sheetName === null || !this.engine.doesSheetExist(this.sheetName)) {
|
1091
907
|
return;
|
1092
908
|
}
|
1093
909
|
const visualRow = this.hot.toVisualRow(row);
|
@@ -1120,7 +936,14 @@ function _onModifySourceData2(row, columnOrProp, valueHolder, ioMode) {
|
|
1120
936
|
};
|
1121
937
|
valueHolder.value = this.engine.getCellSerialized(address);
|
1122
938
|
}
|
1123
|
-
|
939
|
+
/**
|
940
|
+
* `onAfterSetDataAtCell` hook callback.
|
941
|
+
*
|
942
|
+
* @param {Array[]} changes An array of changes in format [[row, prop, oldValue, value], ...].
|
943
|
+
* @param {string} [source] String that identifies source of hook call
|
944
|
+
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
945
|
+
*/
|
946
|
+
function _onAfterSetDataAtCell(changes, source) {
|
1124
947
|
if (isBlockedSource(source)) {
|
1125
948
|
return;
|
1126
949
|
}
|
@@ -1163,7 +986,14 @@ function _onAfterSetDataAtCell2(changes, source) {
|
|
1163
986
|
this.renderDependentSheets(dependentCells);
|
1164
987
|
this.validateDependentCells(dependentCells, changedCells);
|
1165
988
|
}
|
1166
|
-
|
989
|
+
/**
|
990
|
+
* `onAfterSetSourceDataAtCell` hook callback.
|
991
|
+
*
|
992
|
+
* @param {Array[]} changes An array of changes in format [[row, column, oldValue, value], ...].
|
993
|
+
* @param {string} [source] String that identifies source of hook call
|
994
|
+
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
995
|
+
*/
|
996
|
+
function _onAfterSetSourceDataAtCell(changes, source) {
|
1167
997
|
if (isBlockedSource(source)) {
|
1168
998
|
return;
|
1169
999
|
}
|
@@ -1192,7 +1022,14 @@ function _onAfterSetSourceDataAtCell2(changes, source) {
|
|
1192
1022
|
this.renderDependentSheets(dependentCells);
|
1193
1023
|
this.validateDependentCells(dependentCells, changedCells);
|
1194
1024
|
}
|
1195
|
-
|
1025
|
+
/**
|
1026
|
+
* `beforeCreateRow` hook callback.
|
1027
|
+
*
|
1028
|
+
* @param {number} visualRow Represents the visual index of first newly created row in the data source array.
|
1029
|
+
* @param {number} amount Number of newly created rows in the data source array.
|
1030
|
+
* @returns {*|boolean} If false is returned the action is canceled.
|
1031
|
+
*/
|
1032
|
+
function _onBeforeCreateRow(visualRow, amount) {
|
1196
1033
|
let hfRowIndex = this.rowAxisSyncer.getHfIndexFromVisualIndex(visualRow);
|
1197
1034
|
if (visualRow >= this.hot.countRows()) {
|
1198
1035
|
hfRowIndex = visualRow; // Row beyond the table boundaries.
|
@@ -1201,7 +1038,14 @@ function _onBeforeCreateRow2(visualRow, amount) {
|
|
1201
1038
|
return false;
|
1202
1039
|
}
|
1203
1040
|
}
|
1204
|
-
|
1041
|
+
/**
|
1042
|
+
* `beforeCreateCol` hook callback.
|
1043
|
+
*
|
1044
|
+
* @param {number} visualColumn Represents the visual index of first newly created column in the data source.
|
1045
|
+
* @param {number} amount Number of newly created columns in the data source.
|
1046
|
+
* @returns {*|boolean} If false is returned the action is canceled.
|
1047
|
+
*/
|
1048
|
+
function _onBeforeCreateCol(visualColumn, amount) {
|
1205
1049
|
let hfColumnIndex = this.columnAxisSyncer.getHfIndexFromVisualIndex(visualColumn);
|
1206
1050
|
if (visualColumn >= this.hot.countCols()) {
|
1207
1051
|
hfColumnIndex = visualColumn; // Column beyond the table boundaries.
|
@@ -1210,35 +1054,76 @@ function _onBeforeCreateCol2(visualColumn, amount) {
|
|
1210
1054
|
return false;
|
1211
1055
|
}
|
1212
1056
|
}
|
1213
|
-
|
1057
|
+
/**
|
1058
|
+
* `beforeRemoveRow` hook callback.
|
1059
|
+
*
|
1060
|
+
* @param {number} row Visual index of starter row.
|
1061
|
+
* @param {number} amount Amount of rows to be removed.
|
1062
|
+
* @param {number[]} physicalRows An array of physical rows removed from the data source.
|
1063
|
+
* @returns {*|boolean} If false is returned the action is canceled.
|
1064
|
+
*/
|
1065
|
+
function _onBeforeRemoveRow(row, amount, physicalRows) {
|
1214
1066
|
const hfRows = this.rowAxisSyncer.setRemovedHfIndexes(physicalRows);
|
1215
1067
|
const possible = hfRows.every(hfRow => {
|
1216
1068
|
return this.engine.isItPossibleToRemoveRows(this.sheetId, [hfRow, 1]);
|
1217
1069
|
});
|
1218
1070
|
return possible === false ? false : undefined;
|
1219
1071
|
}
|
1220
|
-
|
1072
|
+
/**
|
1073
|
+
* `beforeRemoveCol` hook callback.
|
1074
|
+
*
|
1075
|
+
* @param {number} col Visual index of starter column.
|
1076
|
+
* @param {number} amount Amount of columns to be removed.
|
1077
|
+
* @param {number[]} physicalColumns An array of physical columns removed from the data source.
|
1078
|
+
* @returns {*|boolean} If false is returned the action is canceled.
|
1079
|
+
*/
|
1080
|
+
function _onBeforeRemoveCol(col, amount, physicalColumns) {
|
1221
1081
|
const hfColumns = this.columnAxisSyncer.setRemovedHfIndexes(physicalColumns);
|
1222
1082
|
const possible = hfColumns.every(hfColumn => {
|
1223
1083
|
return this.engine.isItPossibleToRemoveColumns(this.sheetId, [hfColumn, 1]);
|
1224
1084
|
});
|
1225
1085
|
return possible === false ? false : undefined;
|
1226
1086
|
}
|
1227
|
-
|
1087
|
+
/**
|
1088
|
+
* `afterCreateRow` hook callback.
|
1089
|
+
*
|
1090
|
+
* @param {number} visualRow Represents the visual index of first newly created row in the data source array.
|
1091
|
+
* @param {number} amount Number of newly created rows in the data source array.
|
1092
|
+
* @param {string} [source] String that identifies source of hook call
|
1093
|
+
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
1094
|
+
*/
|
1095
|
+
function _onAfterCreateRow(visualRow, amount, source) {
|
1228
1096
|
if (isBlockedSource(source)) {
|
1229
1097
|
return;
|
1230
1098
|
}
|
1231
1099
|
const changes = this.engine.addRows(this.sheetId, [this.rowAxisSyncer.getHfIndexFromVisualIndex(visualRow), amount]);
|
1232
1100
|
this.renderDependentSheets(changes);
|
1233
1101
|
}
|
1234
|
-
|
1102
|
+
/**
|
1103
|
+
* `afterCreateCol` hook callback.
|
1104
|
+
*
|
1105
|
+
* @param {number} visualColumn Represents the visual index of first newly created column in the data source.
|
1106
|
+
* @param {number} amount Number of newly created columns in the data source.
|
1107
|
+
* @param {string} [source] String that identifies source of hook call
|
1108
|
+
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
1109
|
+
*/
|
1110
|
+
function _onAfterCreateCol(visualColumn, amount, source) {
|
1235
1111
|
if (isBlockedSource(source)) {
|
1236
1112
|
return;
|
1237
1113
|
}
|
1238
1114
|
const changes = this.engine.addColumns(this.sheetId, [this.columnAxisSyncer.getHfIndexFromVisualIndex(visualColumn), amount]);
|
1239
1115
|
this.renderDependentSheets(changes);
|
1240
1116
|
}
|
1241
|
-
|
1117
|
+
/**
|
1118
|
+
* `afterRemoveRow` hook callback.
|
1119
|
+
*
|
1120
|
+
* @param {number} row Visual index of starter row.
|
1121
|
+
* @param {number} amount An amount of removed rows.
|
1122
|
+
* @param {number[]} physicalRows An array of physical rows removed from the data source.
|
1123
|
+
* @param {string} [source] String that identifies source of hook call
|
1124
|
+
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
1125
|
+
*/
|
1126
|
+
function _onAfterRemoveRow(row, amount, physicalRows, source) {
|
1242
1127
|
if (isBlockedSource(source)) {
|
1243
1128
|
return;
|
1244
1129
|
}
|
@@ -1250,7 +1135,16 @@ function _onAfterRemoveRow2(row, amount, physicalRows, source) {
|
|
1250
1135
|
});
|
1251
1136
|
this.renderDependentSheets(changes);
|
1252
1137
|
}
|
1253
|
-
|
1138
|
+
/**
|
1139
|
+
* `afterRemoveCol` hook callback.
|
1140
|
+
*
|
1141
|
+
* @param {number} col Visual index of starter column.
|
1142
|
+
* @param {number} amount An amount of removed columns.
|
1143
|
+
* @param {number[]} physicalColumns An array of physical columns removed from the data source.
|
1144
|
+
* @param {string} [source] String that identifies source of hook call
|
1145
|
+
* ([list of all available sources]{@link https://handsontable.com/docs/javascript-data-grid/events-and-hooks/#handsontable-hooks}).
|
1146
|
+
*/
|
1147
|
+
function _onAfterRemoveCol(col, amount, physicalColumns, source) {
|
1254
1148
|
if (isBlockedSource(source)) {
|
1255
1149
|
return;
|
1256
1150
|
}
|
@@ -1262,11 +1156,19 @@ function _onAfterRemoveCol2(col, amount, physicalColumns, source) {
|
|
1262
1156
|
});
|
1263
1157
|
this.renderDependentSheets(changes);
|
1264
1158
|
}
|
1265
|
-
|
1159
|
+
/**
|
1160
|
+
* `afterDetachChild` hook callback.
|
1161
|
+
* Used to sync the data of the rows detached in the Nested Rows plugin with the engine's dataset.
|
1162
|
+
*
|
1163
|
+
* @param {object} parent An object representing the parent from which the element was detached.
|
1164
|
+
* @param {object} element The detached element.
|
1165
|
+
* @param {number} finalElementRowIndex The final row index of the detached element.
|
1166
|
+
*/
|
1167
|
+
function _onAfterDetachChild(parent, element, finalElementRowIndex) {
|
1266
1168
|
var _element$__children;
|
1267
|
-
_classPrivateFieldSet(
|
1169
|
+
_classPrivateFieldSet(_internalOperationPending, this, true);
|
1268
1170
|
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());
|
1269
|
-
_classPrivateFieldSet(
|
1171
|
+
_classPrivateFieldSet(_internalOperationPending, this, false);
|
1270
1172
|
rowsData.forEach((row, relativeRowIndex) => {
|
1271
1173
|
row.forEach((value, colIndex) => {
|
1272
1174
|
this.engine.setCellContents({
|
@@ -1277,22 +1179,62 @@ function _onAfterDetachChild2(parent, element, finalElementRowIndex) {
|
|
1277
1179
|
});
|
1278
1180
|
});
|
1279
1181
|
}
|
1280
|
-
|
1182
|
+
/**
|
1183
|
+
* Called when a value is updated in the engine.
|
1184
|
+
*
|
1185
|
+
* @fires Hooks#afterFormulasValuesUpdate
|
1186
|
+
* @param {Array} changes The values and location of applied changes.
|
1187
|
+
*/
|
1188
|
+
function _onEngineValuesUpdated(changes) {
|
1281
1189
|
this.hot.runHooks('afterFormulasValuesUpdate', changes);
|
1282
1190
|
}
|
1283
|
-
|
1191
|
+
/**
|
1192
|
+
* Called when a named expression is added to the engine instance.
|
1193
|
+
*
|
1194
|
+
* @fires Hooks#afterNamedExpressionAdded
|
1195
|
+
* @param {string} namedExpressionName The name of the added expression.
|
1196
|
+
* @param {Array} changes The values and location of applied changes.
|
1197
|
+
*/
|
1198
|
+
function _onEngineNamedExpressionsAdded(namedExpressionName, changes) {
|
1284
1199
|
this.hot.runHooks('afterNamedExpressionAdded', namedExpressionName, changes);
|
1285
1200
|
}
|
1286
|
-
|
1201
|
+
/**
|
1202
|
+
* Called when a named expression is removed from the engine instance.
|
1203
|
+
*
|
1204
|
+
* @fires Hooks#afterNamedExpressionRemoved
|
1205
|
+
* @param {string} namedExpressionName The name of the removed expression.
|
1206
|
+
* @param {Array} changes The values and location of applied changes.
|
1207
|
+
*/
|
1208
|
+
function _onEngineNamedExpressionsRemoved(namedExpressionName, changes) {
|
1287
1209
|
this.hot.runHooks('afterNamedExpressionRemoved', namedExpressionName, changes);
|
1288
1210
|
}
|
1289
|
-
|
1211
|
+
/**
|
1212
|
+
* Called when a new sheet is added to the engine instance.
|
1213
|
+
*
|
1214
|
+
* @fires Hooks#afterSheetAdded
|
1215
|
+
* @param {string} addedSheetDisplayName The name of the added sheet.
|
1216
|
+
*/
|
1217
|
+
function _onEngineSheetAdded(addedSheetDisplayName) {
|
1290
1218
|
this.hot.runHooks('afterSheetAdded', addedSheetDisplayName);
|
1291
1219
|
}
|
1292
|
-
|
1220
|
+
/**
|
1221
|
+
* Called when a sheet in the engine instance is renamed.
|
1222
|
+
*
|
1223
|
+
* @fires Hooks#afterSheetRenamed
|
1224
|
+
* @param {string} oldDisplayName The old name of the sheet.
|
1225
|
+
* @param {string} newDisplayName The new name of the sheet.
|
1226
|
+
*/
|
1227
|
+
function _onEngineSheetRenamed(oldDisplayName, newDisplayName) {
|
1293
1228
|
this.sheetName = newDisplayName;
|
1294
1229
|
this.hot.runHooks('afterSheetRenamed', oldDisplayName, newDisplayName);
|
1295
1230
|
}
|
1296
|
-
|
1231
|
+
/**
|
1232
|
+
* Called when a sheet is removed from the engine instance.
|
1233
|
+
*
|
1234
|
+
* @fires Hooks#afterSheetRemoved
|
1235
|
+
* @param {string} removedSheetDisplayName The removed sheet name.
|
1236
|
+
* @param {Array} changes The values and location of applied changes.
|
1237
|
+
*/
|
1238
|
+
function _onEngineSheetRemoved(removedSheetDisplayName, changes) {
|
1297
1239
|
this.hot.runHooks('afterSheetRemoved', removedSheetDisplayName, changes);
|
1298
1240
|
}
|