handsontable 14.0.0 → 14.1.0-next-514dcd3-20240109
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/index.js +11 -6
- package/3rdparty/walkontable/src/calculator/index.mjs +5 -3
- package/3rdparty/walkontable/src/calculator/renderAllColumns.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllColumns.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.js +50 -0
- package/3rdparty/walkontable/src/calculator/renderAllRows.mjs +46 -0
- package/3rdparty/walkontable/src/calculator/viewportColumns.js +3 -124
- package/3rdparty/walkontable/src/calculator/viewportColumns.mjs +4 -126
- package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
- package/3rdparty/walkontable/src/calculator/viewportRows.mjs +4 -5
- package/3rdparty/walkontable/src/cell/coords.d.ts +5 -5
- package/3rdparty/walkontable/src/cell/coords.js +2 -2
- package/3rdparty/walkontable/src/cell/coords.mjs +2 -2
- package/3rdparty/walkontable/src/cell/range.d.ts +5 -5
- package/3rdparty/walkontable/src/cell/range.js +16 -41
- package/3rdparty/walkontable/src/cell/range.mjs +16 -41
- package/3rdparty/walkontable/src/core/_base.js +2 -14
- package/3rdparty/walkontable/src/core/_base.mjs +2 -14
- package/3rdparty/walkontable/src/core/clone.js +2 -2
- package/3rdparty/walkontable/src/core/clone.mjs +2 -2
- package/3rdparty/walkontable/src/core/core.js +0 -2
- package/3rdparty/walkontable/src/core/core.mjs +0 -2
- package/3rdparty/walkontable/src/facade/core.js +0 -9
- package/3rdparty/walkontable/src/facade/core.mjs +0 -9
- package/3rdparty/walkontable/src/filter/column.js +2 -2
- package/3rdparty/walkontable/src/filter/column.mjs +2 -2
- package/3rdparty/walkontable/src/filter/row.js +2 -2
- package/3rdparty/walkontable/src/filter/row.mjs +2 -2
- package/3rdparty/walkontable/src/index.js +3 -4
- package/3rdparty/walkontable/src/index.mjs +1 -2
- package/3rdparty/walkontable/src/overlay/_base.js +2 -2
- package/3rdparty/walkontable/src/overlay/_base.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
- package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/top.js +2 -2
- package/3rdparty/walkontable/src/overlay/top.mjs +2 -2
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.js +2 -2
- package/3rdparty/walkontable/src/overlay/topInlineStartCorner.mjs +2 -2
- package/3rdparty/walkontable/src/overlays.js +2 -5
- package/3rdparty/walkontable/src/overlays.mjs +2 -6
- package/3rdparty/walkontable/src/renderer/_base.js +2 -2
- package/3rdparty/walkontable/src/renderer/_base.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/cells.js +2 -2
- package/3rdparty/walkontable/src/renderer/cells.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/colGroup.js +10 -0
- package/3rdparty/walkontable/src/renderer/colGroup.mjs +10 -0
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +2 -2
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +2 -2
- package/3rdparty/walkontable/src/renderer/rows.js +6 -5
- package/3rdparty/walkontable/src/renderer/rows.mjs +6 -5
- package/3rdparty/walkontable/src/renderer/table.js +2 -2
- package/3rdparty/walkontable/src/renderer/table.mjs +2 -2
- package/3rdparty/walkontable/src/scroll.js +4 -60
- package/3rdparty/walkontable/src/scroll.mjs +4 -60
- package/3rdparty/walkontable/src/selection/manager.js +0 -1
- package/3rdparty/walkontable/src/selection/manager.mjs +0 -1
- package/3rdparty/walkontable/src/settings.js +5 -2
- package/3rdparty/walkontable/src/settings.mjs +4 -2
- package/3rdparty/walkontable/src/table.js +2 -3
- package/3rdparty/walkontable/src/table.mjs +2 -3
- package/3rdparty/walkontable/src/utils/column.js +29 -14
- package/3rdparty/walkontable/src/utils/column.mjs +29 -14
- package/3rdparty/walkontable/src/utils/columnStretching.js +219 -0
- package/3rdparty/walkontable/src/utils/columnStretching.mjs +215 -0
- package/3rdparty/walkontable/src/utils/nodesPool.js +2 -2
- package/3rdparty/walkontable/src/utils/nodesPool.mjs +2 -2
- 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 +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSize.mjs +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.js +2 -2
- package/3rdparty/walkontable/src/utils/orderView/viewSizeSet.mjs +2 -2
- package/3rdparty/walkontable/src/utils/row.js +2 -2
- package/3rdparty/walkontable/src/utils/row.mjs +2 -2
- package/3rdparty/walkontable/src/viewport.js +22 -17
- package/3rdparty/walkontable/src/viewport.mjs +23 -18
- package/CHANGELOG.md +36 -0
- package/base.js +4 -2
- package/base.mjs +2 -2
- package/cellTypes/dropdownType/dropdownType.d.ts +6 -6
- package/cellTypes/dropdownType/dropdownType.js +4 -4
- package/cellTypes/dropdownType/dropdownType.mjs +4 -4
- package/core/focusCatcher/index.js +44 -6
- package/core/focusCatcher/index.mjs +44 -6
- package/core.d.ts +19 -19
- package/core.js +7 -12
- package/core.mjs +7 -12
- package/dataMap/dataMap.js +3 -2
- package/dataMap/dataMap.mjs +2 -2
- package/dataMap/dataSource.js +2 -2
- package/dataMap/dataSource.mjs +2 -2
- package/dataMap/metaManager/lazyFactoryMap.js +2 -2
- package/dataMap/metaManager/lazyFactoryMap.mjs +2 -2
- package/dataMap/metaManager/metaLayers/cellMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/columnMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/columnMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/globalMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/globalMeta.mjs +2 -2
- package/dataMap/metaManager/metaLayers/tableMeta.js +2 -2
- package/dataMap/metaManager/metaLayers/tableMeta.mjs +2 -2
- package/dataMap/metaManager/metaSchema.js +40 -25
- package/dataMap/metaManager/metaSchema.mjs +40 -25
- package/dataMap/metaManager/mods/dynamicCellMeta.js +2 -2
- package/dataMap/metaManager/mods/dynamicCellMeta.mjs +2 -2
- package/dataMap/metaManager/mods/extendMetaProperties.js +14 -2
- package/dataMap/metaManager/mods/extendMetaProperties.mjs +14 -2
- package/dist/handsontable.css +5 -5
- package/dist/handsontable.full.css +6 -6
- package/dist/handsontable.full.js +4835 -4508
- package/dist/handsontable.full.min.css +4 -4
- package/dist/handsontable.full.min.js +156 -154
- package/dist/handsontable.js +3441 -2825
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +18 -15
- package/editorManager.js +5 -6
- package/editorManager.mjs +5 -6
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -4
- package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -4
- package/editors/baseEditor/baseEditor.d.ts +1 -1
- package/editors/baseEditor/baseEditor.js +2 -2
- package/editors/baseEditor/baseEditor.mjs +2 -2
- package/editors/dateEditor/dateEditor.d.ts +1 -1
- package/editors/dateEditor/dateEditor.js +29 -33
- package/editors/dateEditor/dateEditor.mjs +29 -33
- package/editors/handsontableEditor/handsontableEditor.js +0 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +0 -1
- package/editors/selectEditor/selectEditor.js +8 -2
- package/editors/selectEditor/selectEditor.mjs +8 -2
- package/editors/textEditor/textEditor.js +2 -6
- package/editors/textEditor/textEditor.mjs +2 -6
- package/eventManager.js +4 -3
- package/eventManager.mjs +4 -3
- package/helpers/browser.js +5 -2
- package/helpers/browser.mjs +5 -2
- package/helpers/feature.js +10 -0
- package/helpers/feature.mjs +9 -0
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/index.d.ts +12 -0
- package/package.json +13 -4
- package/pluginHooks.d.ts +10 -9
- package/pluginHooks.js +10 -8
- package/pluginHooks.mjs +7 -7
- package/plugins/autoColumnSize/autoColumnSize.d.ts +2 -2
- package/plugins/autoColumnSize/autoColumnSize.js +2 -2
- package/plugins/autoColumnSize/autoColumnSize.mjs +2 -2
- package/plugins/autoRowSize/autoRowSize.d.ts +3 -3
- package/plugins/autoRowSize/autoRowSize.js +2 -2
- package/plugins/autoRowSize/autoRowSize.mjs +2 -2
- package/plugins/autofill/autofill.js +2 -2
- package/plugins/autofill/autofill.mjs +2 -2
- package/plugins/base/base.js +2 -2
- package/plugins/base/base.mjs +2 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.d.ts +1 -1
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.js +2 -2
- package/plugins/bindRowsWithHeaders/bindRowsWithHeaders.mjs +2 -2
- package/plugins/collapsibleColumns/collapsibleColumns.js +2 -2
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +2 -2
- package/plugins/columnSorting/columnSorting.js +2 -2
- package/plugins/columnSorting/columnSorting.mjs +2 -2
- package/plugins/columnSorting/columnStatesManager.js +2 -2
- package/plugins/columnSorting/columnStatesManager.mjs +2 -2
- package/plugins/columnSummary/columnSummary.d.ts +11 -11
- package/plugins/columnSummary/columnSummary.js +20 -5
- package/plugins/columnSummary/columnSummary.mjs +20 -5
- package/plugins/columnSummary/endpoints.js +19 -5
- package/plugins/columnSummary/endpoints.mjs +19 -5
- package/plugins/comments/commentEditor.js +2 -2
- package/plugins/comments/commentEditor.mjs +2 -2
- package/plugins/comments/comments.js +2 -2
- package/plugins/comments/comments.mjs +2 -2
- package/plugins/comments/displaySwitch.js +2 -2
- package/plugins/comments/displaySwitch.mjs +2 -2
- package/plugins/contextMenu/commandExecutor.js +2 -2
- package/plugins/contextMenu/commandExecutor.mjs +2 -2
- package/plugins/contextMenu/contextMenu.js +2 -2
- package/plugins/contextMenu/contextMenu.mjs +2 -2
- package/plugins/contextMenu/itemsFactory.js +2 -2
- package/plugins/contextMenu/itemsFactory.mjs +2 -2
- package/plugins/contextMenu/menu/cursor.js +2 -2
- package/plugins/contextMenu/menu/cursor.mjs +2 -2
- package/plugins/contextMenu/menu/menu.js +2 -2
- package/plugins/contextMenu/menu/menu.mjs +2 -2
- package/plugins/copyPaste/copyPaste.js +40 -6
- package/plugins/copyPaste/copyPaste.mjs +40 -6
- package/plugins/customBorders/customBorders.d.ts +17 -8
- package/plugins/customBorders/customBorders.js +2 -7
- package/plugins/customBorders/customBorders.mjs +2 -7
- package/plugins/customBorders/utils.js +0 -1
- package/plugins/customBorders/utils.mjs +0 -1
- package/plugins/dragToScroll/dragToScroll.d.ts +8 -1
- package/plugins/dragToScroll/dragToScroll.js +18 -22
- package/plugins/dragToScroll/dragToScroll.mjs +18 -22
- package/plugins/dropdownMenu/dropdownMenu.js +2 -2
- package/plugins/dropdownMenu/dropdownMenu.mjs +2 -2
- package/plugins/exportFile/dataProvider.js +2 -2
- package/plugins/exportFile/dataProvider.mjs +2 -2
- package/plugins/exportFile/exportFile.d.ts +18 -3
- package/plugins/exportFile/types/_base.js +2 -2
- package/plugins/exportFile/types/_base.mjs +2 -2
- package/plugins/filters/component/_base.js +2 -2
- package/plugins/filters/component/_base.mjs +2 -2
- package/plugins/filters/component/actionBar.js +2 -2
- package/plugins/filters/component/actionBar.mjs +2 -2
- package/plugins/filters/component/condition.js +2 -2
- package/plugins/filters/component/condition.mjs +2 -2
- package/plugins/filters/component/operators.js +2 -2
- package/plugins/filters/component/operators.mjs +2 -2
- package/plugins/filters/component/value.js +2 -2
- package/plugins/filters/component/value.mjs +2 -2
- package/plugins/filters/conditionCollection.js +2 -2
- package/plugins/filters/conditionCollection.mjs +2 -2
- package/plugins/filters/conditionUpdateObserver.js +2 -2
- package/plugins/filters/conditionUpdateObserver.mjs +2 -2
- package/plugins/filters/dataFilter.js +2 -2
- package/plugins/filters/dataFilter.mjs +2 -2
- package/plugins/filters/filters.js +2 -2
- package/plugins/filters/filters.mjs +2 -2
- package/plugins/filters/ui/_base.js +2 -2
- package/plugins/filters/ui/_base.mjs +2 -2
- package/plugins/filters/ui/radioInput.js +1 -1
- package/plugins/filters/ui/radioInput.mjs +1 -1
- package/plugins/formulas/formulas.d.ts +1 -0
- package/plugins/formulas/formulas.js +2 -4
- package/plugins/formulas/formulas.mjs +2 -4
- package/plugins/formulas/indexSyncer/axisSyncer.js +0 -1
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +0 -1
- package/plugins/manualColumnMove/ui/_base.js +2 -2
- package/plugins/manualColumnMove/ui/_base.mjs +2 -2
- package/plugins/manualColumnResize/manualColumnResize.js +6 -2
- package/plugins/manualColumnResize/manualColumnResize.mjs +6 -2
- package/plugins/manualRowMove/ui/_base.js +2 -2
- package/plugins/manualRowMove/ui/_base.mjs +2 -2
- package/plugins/manualRowResize/manualRowResize.js +7 -3
- package/plugins/manualRowResize/manualRowResize.mjs +7 -3
- package/plugins/mergeCells/calculations/autofill.js +2 -2
- package/plugins/mergeCells/calculations/autofill.mjs +2 -2
- package/plugins/mergeCells/calculations/selection.js +2 -2
- package/plugins/mergeCells/calculations/selection.mjs +2 -2
- package/plugins/mergeCells/cellCoords.js +2 -2
- package/plugins/mergeCells/cellCoords.mjs +2 -2
- package/plugins/mergeCells/cellsCollection.js +2 -2
- package/plugins/mergeCells/cellsCollection.mjs +2 -2
- package/plugins/mergeCells/mergeCells.js +2 -4
- package/plugins/mergeCells/mergeCells.mjs +2 -4
- package/plugins/multiColumnSorting/multiColumnSorting.js +2 -2
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +2 -2
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.d.ts +8 -1
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.js +2 -2
- package/plugins/multipleSelectionHandles/multipleSelectionHandles.mjs +2 -2
- package/plugins/nestedHeaders/nestedHeaders.js +2 -3
- package/plugins/nestedHeaders/nestedHeaders.mjs +2 -3
- package/plugins/nestedHeaders/stateManager/headersTree.js +0 -1
- package/plugins/nestedHeaders/stateManager/headersTree.mjs +0 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.js +1 -1
- package/plugins/nestedHeaders/stateManager/sourceSettings.mjs +1 -1
- package/plugins/nestedHeaders/utils/ghostTable.js +2 -2
- package/plugins/nestedHeaders/utils/ghostTable.mjs +2 -2
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/nestedRows/nestedRows.js +2 -2
- package/plugins/nestedRows/nestedRows.mjs +2 -2
- package/plugins/nestedRows/ui/_base.js +2 -2
- package/plugins/nestedRows/ui/_base.mjs +2 -2
- package/plugins/nestedRows/ui/contextMenu.js +2 -2
- package/plugins/nestedRows/ui/contextMenu.mjs +2 -2
- package/plugins/nestedRows/utils/rowMoveController.js +2 -2
- package/plugins/nestedRows/utils/rowMoveController.mjs +2 -2
- package/plugins/persistentState/persistentState.d.ts +5 -2
- package/plugins/persistentState/persistentState.js +2 -2
- package/plugins/persistentState/persistentState.mjs +2 -2
- package/plugins/persistentState/storage.js +2 -2
- package/plugins/persistentState/storage.mjs +2 -2
- package/plugins/search/search.js +2 -2
- package/plugins/search/search.mjs +2 -2
- package/plugins/touchScroll/touchScroll.js +2 -2
- package/plugins/touchScroll/touchScroll.mjs +2 -2
- package/plugins/trimRows/trimRows.js +2 -2
- package/plugins/trimRows/trimRows.mjs +2 -2
- package/plugins/undoRedo/undoRedo.d.ts +3 -0
- package/plugins/undoRedo/undoRedo.js +64 -7
- package/plugins/undoRedo/undoRedo.mjs +64 -7
- package/renderers/autocompleteRenderer/autocompleteRenderer.d.ts +1 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +0 -1
- package/renderers/baseRenderer/baseRenderer.d.ts +1 -1
- package/renderers/checkboxRenderer/checkboxRenderer.d.ts +1 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +0 -2
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -2
- package/renderers/dateRenderer/dateRenderer.d.ts +1 -1
- package/renderers/dropdownRenderer/dropdownRenderer.d.ts +5 -0
- package/renderers/dropdownRenderer/dropdownRenderer.js +23 -0
- package/renderers/dropdownRenderer/dropdownRenderer.mjs +19 -0
- package/renderers/dropdownRenderer/index.d.ts +1 -0
- package/renderers/dropdownRenderer/index.js +6 -0
- package/renderers/dropdownRenderer/index.mjs +1 -0
- package/renderers/handsontableRenderer/handsontableRenderer.d.ts +1 -1
- package/renderers/htmlRenderer/htmlRenderer.d.ts +1 -1
- package/renderers/index.d.ts +3 -0
- package/renderers/index.js +12 -0
- package/renderers/index.mjs +7 -1
- package/renderers/numericRenderer/numericRenderer.d.ts +1 -1
- package/renderers/passwordRenderer/passwordRenderer.d.ts +1 -1
- package/renderers/selectRenderer/selectRenderer.d.ts +1 -1
- package/renderers/textRenderer/textRenderer.d.ts +1 -1
- package/renderers/timeRenderer/timeRenderer.d.ts +1 -1
- package/selection/highlight/highlight.js +2 -3
- package/selection/highlight/highlight.mjs +2 -3
- package/selection/highlight/visualSelection.js +2 -2
- package/selection/highlight/visualSelection.mjs +2 -2
- package/selection/range.js +2 -2
- package/selection/range.mjs +2 -2
- package/selection/selection.js +2 -2
- package/selection/selection.mjs +2 -2
- package/settings.d.ts +27 -14
- package/tableView.js +4 -5
- package/tableView.mjs +4 -5
- package/translations/indexMapper.d.ts +1 -1
- package/translations/indexMapper.js +4 -3
- package/translations/indexMapper.mjs +2 -2
- package/translations/mapCollections/aggregatedCollection.js +2 -2
- package/translations/mapCollections/aggregatedCollection.mjs +2 -2
- package/translations/mapCollections/mapCollection.js +2 -2
- package/translations/mapCollections/mapCollection.mjs +2 -2
- package/translations/maps/indexMap.js +2 -2
- package/translations/maps/indexMap.mjs +2 -2
- package/translations/maps/linkedPhysicalIndexToValueMap.js +2 -2
- package/translations/maps/linkedPhysicalIndexToValueMap.mjs +2 -2
- package/utils/dataStructures/linkedList.js +2 -2
- package/utils/dataStructures/linkedList.mjs +2 -2
- package/utils/dataStructures/tree.js +2 -2
- package/utils/dataStructures/tree.mjs +2 -2
- package/utils/ghostTable.js +2 -2
- package/utils/ghostTable.mjs +2 -2
- package/utils/interval.js +2 -2
- package/utils/interval.mjs +2 -2
- package/utils/samplesGenerator.js +2 -2
- package/utils/samplesGenerator.mjs +2 -2
- package/validators/dropdownValidator/dropdownValidator.d.ts +5 -0
- package/validators/dropdownValidator/dropdownValidator.js +18 -0
- package/validators/dropdownValidator/dropdownValidator.mjs +14 -0
- package/validators/dropdownValidator/index.d.ts +1 -0
- package/validators/dropdownValidator/index.js +6 -0
- package/validators/dropdownValidator/index.mjs +1 -0
- package/validators/index.d.ts +2 -0
- package/validators/index.js +4 -0
- package/validators/index.mjs +3 -1
- package/validators/timeValidator/timeValidator.js +0 -1
- package/validators/timeValidator/timeValidator.mjs +0 -1
@@ -1,8 +1,8 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
2
|
import "core-js/modules/es.error.cause.js";
|
3
3
|
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; }
|
4
|
-
function _toPropertyKey(
|
5
|
-
function _toPrimitive(
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
5
|
+
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); }
|
6
6
|
import { isUndefined } from "../../../helpers/mixed.mjs";
|
7
7
|
import { warn } from "../../../helpers/console.mjs";
|
8
8
|
import { toSingleLine } from "../../../helpers/templateLiteralTag.mjs";
|
@@ -2,12 +2,15 @@ import Core from '../../core';
|
|
2
2
|
import { CellValue } from '../../common';
|
3
3
|
import { BasePlugin } from '../base';
|
4
4
|
|
5
|
+
export interface ValueHolder {
|
6
|
+
value: any;
|
7
|
+
}
|
5
8
|
export type Settings = boolean;
|
6
9
|
|
7
10
|
export class PersistentState extends BasePlugin {
|
8
11
|
constructor(hotInstance: Core);
|
9
12
|
isEnabled(): boolean;
|
10
|
-
loadValue(key: string, saveTo:
|
13
|
+
loadValue(key: string, saveTo: ValueHolder): void;
|
11
14
|
saveValue(key: string, value: CellValue): void;
|
12
|
-
resetValue(key
|
15
|
+
resetValue(key?: string): void;
|
13
16
|
}
|
@@ -7,8 +7,8 @@ var _storage = _interopRequireDefault(require("./storage"));
|
|
7
7
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9
9
|
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; }
|
10
|
-
function _toPropertyKey(
|
11
|
-
function _toPrimitive(
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
11
|
+
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); }
|
12
12
|
_pluginHooks.default.getSingleton().register('persistentStateSave');
|
13
13
|
_pluginHooks.default.getSingleton().register('persistentStateLoad');
|
14
14
|
_pluginHooks.default.getSingleton().register('persistentStateReset');
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import "core-js/modules/es.error.cause.js";
|
2
2
|
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; }
|
3
|
-
function _toPropertyKey(
|
4
|
-
function _toPrimitive(
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
4
|
+
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); }
|
5
5
|
import { BasePlugin } from "../base/index.mjs";
|
6
6
|
import Storage from "./storage.mjs";
|
7
7
|
import Hooks from "../../pluginHooks.mjs";
|
@@ -6,8 +6,8 @@ require("core-js/modules/es.array.push.js");
|
|
6
6
|
require("core-js/modules/es.error.cause.js");
|
7
7
|
var _array = require("../../helpers/array");
|
8
8
|
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; }
|
9
|
-
function _toPropertyKey(
|
10
|
-
function _toPrimitive(
|
9
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
10
|
+
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); }
|
11
11
|
/**
|
12
12
|
* @private
|
13
13
|
* @class Storage
|
@@ -2,8 +2,8 @@ import "core-js/modules/es.json.stringify.js";
|
|
2
2
|
import "core-js/modules/es.array.push.js";
|
3
3
|
import "core-js/modules/es.error.cause.js";
|
4
4
|
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; }
|
5
|
-
function _toPropertyKey(
|
6
|
-
function _toPrimitive(
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
6
|
+
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); }
|
7
7
|
import { arrayEach } from "../../helpers/array.mjs";
|
8
8
|
/**
|
9
9
|
* @private
|
package/plugins/search/search.js
CHANGED
@@ -10,8 +10,8 @@ var _mixed = require("../../helpers/mixed");
|
|
10
10
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
11
11
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
12
12
|
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; }
|
13
|
-
function _toPropertyKey(
|
14
|
-
function _toPrimitive(
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
14
|
+
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); }
|
15
15
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
16
16
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'search';
|
17
17
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 190;
|
@@ -3,8 +3,8 @@ import "core-js/modules/es.error.cause.js";
|
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
5
|
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; }
|
6
|
-
function _toPropertyKey(
|
7
|
-
function _toPrimitive(
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
7
|
+
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); }
|
8
8
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
9
9
|
import { BasePlugin } from "../base/index.mjs";
|
10
10
|
import { isObject } from "../../helpers/object.mjs";
|
@@ -10,8 +10,8 @@ var _feature = require("../../helpers/feature");
|
|
10
10
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
11
11
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
12
12
|
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; }
|
13
|
-
function _toPropertyKey(
|
14
|
-
function _toPrimitive(
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
14
|
+
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); }
|
15
15
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
16
16
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'touchScroll';
|
17
17
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 200;
|
@@ -3,8 +3,8 @@ import "core-js/modules/es.error.cause.js";
|
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
5
|
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; }
|
6
|
-
function _toPropertyKey(
|
7
|
-
function _toPrimitive(
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
7
|
+
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); }
|
8
8
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
9
9
|
import { addClass, removeClass } from "../../helpers/dom/element.mjs";
|
10
10
|
import { arrayEach } from "../../helpers/array.mjs";
|
@@ -9,8 +9,8 @@ var _array = require("../../helpers/array");
|
|
9
9
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
10
10
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
11
11
|
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; }
|
12
|
-
function _toPropertyKey(
|
13
|
-
function _toPrimitive(
|
12
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
13
|
+
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); }
|
14
14
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
15
15
|
const PLUGIN_KEY = exports.PLUGIN_KEY = 'trimRows';
|
16
16
|
const PLUGIN_PRIORITY = exports.PLUGIN_PRIORITY = 330;
|
@@ -3,8 +3,8 @@ import "core-js/modules/es.error.cause.js";
|
|
3
3
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
4
4
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
5
5
|
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; }
|
6
|
-
function _toPropertyKey(
|
7
|
-
function _toPrimitive(
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
7
|
+
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); }
|
8
8
|
function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
|
9
9
|
import { BasePlugin } from "../base/index.mjs";
|
10
10
|
import { TrimmingMap } from "../../translations/index.mjs";
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
exports.__esModule = true;
|
4
4
|
require("core-js/modules/es.array.push.js");
|
5
|
+
require("core-js/modules/es.object.from-entries.js");
|
5
6
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
6
7
|
var _array = require("../../helpers/array");
|
7
8
|
var _number = require("../../helpers/number");
|
@@ -59,11 +60,30 @@ function UndoRedo(instance) {
|
|
59
60
|
instance.addHook('afterCreateRow', (index, amount, source) => {
|
60
61
|
plugin.done(() => new UndoRedo.CreateRowAction(index, amount), source);
|
61
62
|
});
|
63
|
+
const getCellMetas = (fromRow, toRow, fromColumn, toColumn) => {
|
64
|
+
const genericKeys = ['visualRow', 'visualCol', 'row', 'col', 'prop'];
|
65
|
+
const genericKeysLength = genericKeys.length;
|
66
|
+
const cellMetas = [];
|
67
|
+
(0, _number.rangeEach)(fromColumn, toColumn, columnIndex => {
|
68
|
+
(0, _number.rangeEach)(fromRow, toRow, rowIndex => {
|
69
|
+
const cellMeta = instance.getCellMeta(rowIndex, columnIndex);
|
70
|
+
if (Object.keys(cellMeta).length !== genericKeysLength) {
|
71
|
+
const uniqueMeta = Object.fromEntries(Object.entries(cellMeta).filter(_ref => {
|
72
|
+
let [key] = _ref;
|
73
|
+
return genericKeys.includes(key) === false;
|
74
|
+
}));
|
75
|
+
cellMetas.push([cellMeta.visualRow, cellMeta.visualCol, uniqueMeta]);
|
76
|
+
}
|
77
|
+
});
|
78
|
+
});
|
79
|
+
return cellMetas;
|
80
|
+
};
|
62
81
|
instance.addHook('beforeRemoveRow', (index, amount, logicRows, source) => {
|
63
82
|
const wrappedAction = () => {
|
64
83
|
const physicalRowIndex = instance.toPhysicalRow(index);
|
84
|
+
const lastRowIndex = physicalRowIndex + amount - 1;
|
65
85
|
const removedData = (0, _object.deepClone)(plugin.instance.getSourceData(physicalRowIndex, 0, physicalRowIndex + amount - 1, plugin.instance.countSourceCols() - 1));
|
66
|
-
return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence());
|
86
|
+
return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence(), getCellMetas(physicalRowIndex, lastRowIndex, 0, instance.countCols() - 1));
|
67
87
|
};
|
68
88
|
plugin.done(wrappedAction, source);
|
69
89
|
});
|
@@ -74,13 +94,14 @@ function UndoRedo(instance) {
|
|
74
94
|
const wrappedAction = () => {
|
75
95
|
const originalData = plugin.instance.getSourceDataArray();
|
76
96
|
const columnIndex = (plugin.instance.countCols() + index) % plugin.instance.countCols();
|
97
|
+
const lastColumnIndex = columnIndex + amount - 1;
|
77
98
|
const removedData = [];
|
78
99
|
const headers = [];
|
79
100
|
const indexes = [];
|
80
101
|
(0, _number.rangeEach)(originalData.length - 1, i => {
|
81
102
|
const column = [];
|
82
103
|
const origRow = originalData[i];
|
83
|
-
(0, _number.rangeEach)(columnIndex,
|
104
|
+
(0, _number.rangeEach)(columnIndex, lastColumnIndex, j => {
|
84
105
|
column.push(origRow[instance.toPhysicalColumn(j)]);
|
85
106
|
});
|
86
107
|
removedData.push(column);
|
@@ -95,7 +116,7 @@ function UndoRedo(instance) {
|
|
95
116
|
}
|
96
117
|
const columnsMap = instance.columnIndexMapper.getIndexesSequence();
|
97
118
|
const rowsMap = instance.rowIndexMapper.getIndexesSequence();
|
98
|
-
return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart);
|
119
|
+
return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart, getCellMetas(0, instance.countRows(), columnIndex, lastColumnIndex));
|
99
120
|
};
|
100
121
|
plugin.done(wrappedAction, source);
|
101
122
|
});
|
@@ -363,6 +384,32 @@ UndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) {
|
|
363
384
|
instance.undoRedo.doneActions.pop();
|
364
385
|
}
|
365
386
|
}
|
387
|
+
const selectedLast = instance.getSelectedLast();
|
388
|
+
if (selectedLast !== undefined) {
|
389
|
+
const [changedRow, changedColumn] = data[0];
|
390
|
+
const [selectedRow, selectedColumn] = selectedLast;
|
391
|
+
const firstFullyVisibleRow = instance.view.getFirstFullyVisibleRow();
|
392
|
+
const firstFullyVisibleColumn = instance.view.getFirstFullyVisibleColumn();
|
393
|
+
const isInVerticalViewPort = changedRow >= firstFullyVisibleRow;
|
394
|
+
const isInHorizontalViewPort = changedColumn >= firstFullyVisibleColumn;
|
395
|
+
const isInViewport = isInVerticalViewPort && isInHorizontalViewPort;
|
396
|
+
const isChangedSelection = selectedRow !== changedRow || selectedColumn !== changedColumn;
|
397
|
+
|
398
|
+
// Performing scroll only when selection has been changed right after editing a cell.
|
399
|
+
if (isInViewport === false && isChangedSelection === true) {
|
400
|
+
const scrollConfig = {
|
401
|
+
row: changedRow,
|
402
|
+
col: changedColumn
|
403
|
+
};
|
404
|
+
if (isInVerticalViewPort === false) {
|
405
|
+
scrollConfig.verticalSnap = 'top';
|
406
|
+
}
|
407
|
+
if (isInHorizontalViewPort === false) {
|
408
|
+
scrollConfig.horizontalSnap = 'start';
|
409
|
+
}
|
410
|
+
instance.scrollViewportTo(scrollConfig);
|
411
|
+
}
|
412
|
+
}
|
366
413
|
instance.selectCells(this.selected, false, false);
|
367
414
|
};
|
368
415
|
UndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) {
|
@@ -396,7 +443,6 @@ UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {
|
|
396
443
|
if (this.index >= rowCount && this.index - minSpareRows < rowCount) {
|
397
444
|
this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change
|
398
445
|
}
|
399
|
-
|
400
446
|
instance.addHookOnce('afterRemoveRow', undoneCallback);
|
401
447
|
instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');
|
402
448
|
};
|
@@ -414,14 +460,16 @@ UndoRedo.CreateRowAction.prototype.redo = function (instance, redoneCallback) {
|
|
414
460
|
* @param {number} fixedRowsBottom Number of fixed rows on the bottom. Remove row action change it sometimes.
|
415
461
|
* @param {number} fixedRowsTop Number of fixed rows on the top. Remove row action change it sometimes.
|
416
462
|
* @param {Array} rowIndexesSequence Row index sequence taken from the row index mapper.
|
463
|
+
* @param {Array} removedCellMetas List of removed cell metas.
|
417
464
|
*/
|
418
|
-
UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence) {
|
465
|
+
UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence, removedCellMetas) {
|
419
466
|
this.index = index;
|
420
467
|
this.data = data;
|
421
468
|
this.actionType = 'remove_row';
|
422
469
|
this.fixedRowsBottom = fixedRowsBottom;
|
423
470
|
this.fixedRowsTop = fixedRowsTop;
|
424
471
|
this.rowIndexesSequence = rowIndexesSequence;
|
472
|
+
this.removedCellMetas = removedCellMetas;
|
425
473
|
};
|
426
474
|
(0, _object.inherit)(UndoRedo.RemoveRowAction, UndoRedo.Action);
|
427
475
|
UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
|
@@ -440,6 +488,10 @@ UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
|
|
440
488
|
});
|
441
489
|
});
|
442
490
|
instance.alter('insert_row_above', this.index, this.data.length, 'UndoRedo.undo');
|
491
|
+
this.removedCellMetas.forEach(_ref2 => {
|
492
|
+
let [rowIndex, columnIndex, cellMeta] = _ref2;
|
493
|
+
instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
494
|
+
});
|
443
495
|
instance.addHookOnce('afterViewRender', undoneCallback);
|
444
496
|
instance.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
|
445
497
|
instance.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
@@ -482,8 +534,9 @@ UndoRedo.CreateColumnAction.prototype.redo = function (instance, redoneCallback)
|
|
482
534
|
* @param {number[]} columnPositions The column position.
|
483
535
|
* @param {number[]} rowPositions The row position.
|
484
536
|
* @param {number} fixedColumnsStart Number of fixed columns on the left. Remove column action change it sometimes.
|
537
|
+
* @param {Array} removedCellMetas List of removed cell metas.
|
485
538
|
*/
|
486
|
-
UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart) {
|
539
|
+
UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart, removedCellMetas) {
|
487
540
|
// eslint-disable-line max-len
|
488
541
|
this.index = index;
|
489
542
|
this.indexes = indexes;
|
@@ -494,6 +547,7 @@ UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPos
|
|
494
547
|
this.rowPositions = rowPositions.slice(0);
|
495
548
|
this.actionType = 'remove_col';
|
496
549
|
this.fixedColumnsStart = fixedColumnsStart;
|
550
|
+
this.removedCellMetas = removedCellMetas;
|
497
551
|
};
|
498
552
|
(0, _object.inherit)(UndoRedo.RemoveColumnAction, UndoRedo.Action);
|
499
553
|
UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) {
|
@@ -523,6 +577,10 @@ UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback)
|
|
523
577
|
instance.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData;
|
524
578
|
});
|
525
579
|
}
|
580
|
+
this.removedCellMetas.forEach(_ref3 => {
|
581
|
+
let [rowIndex, columnIndex, cellMeta] = _ref3;
|
582
|
+
instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
583
|
+
});
|
526
584
|
instance.batchExecution(() => {
|
527
585
|
// Restore row sequence in a case when all columns are removed. the original
|
528
586
|
// row sequence is lost in that case.
|
@@ -716,7 +774,6 @@ UndoRedo.prototype.registerShortcuts = function () {
|
|
716
774
|
const runOnlyIf = event => {
|
717
775
|
return !event.altKey; // right ALT in some systems triggers ALT+CTR
|
718
776
|
};
|
719
|
-
|
720
777
|
const config = {
|
721
778
|
runOnlyIf,
|
722
779
|
group: SHORTCUTS_GROUP
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import "core-js/modules/es.array.push.js";
|
2
|
+
import "core-js/modules/es.object.from-entries.js";
|
2
3
|
import Hooks from "../../pluginHooks.mjs";
|
3
4
|
import { arrayMap, arrayEach } from "../../helpers/array.mjs";
|
4
5
|
import { rangeEach } from "../../helpers/number.mjs";
|
@@ -55,11 +56,30 @@ function UndoRedo(instance) {
|
|
55
56
|
instance.addHook('afterCreateRow', (index, amount, source) => {
|
56
57
|
plugin.done(() => new UndoRedo.CreateRowAction(index, amount), source);
|
57
58
|
});
|
59
|
+
const getCellMetas = (fromRow, toRow, fromColumn, toColumn) => {
|
60
|
+
const genericKeys = ['visualRow', 'visualCol', 'row', 'col', 'prop'];
|
61
|
+
const genericKeysLength = genericKeys.length;
|
62
|
+
const cellMetas = [];
|
63
|
+
rangeEach(fromColumn, toColumn, columnIndex => {
|
64
|
+
rangeEach(fromRow, toRow, rowIndex => {
|
65
|
+
const cellMeta = instance.getCellMeta(rowIndex, columnIndex);
|
66
|
+
if (Object.keys(cellMeta).length !== genericKeysLength) {
|
67
|
+
const uniqueMeta = Object.fromEntries(Object.entries(cellMeta).filter(_ref => {
|
68
|
+
let [key] = _ref;
|
69
|
+
return genericKeys.includes(key) === false;
|
70
|
+
}));
|
71
|
+
cellMetas.push([cellMeta.visualRow, cellMeta.visualCol, uniqueMeta]);
|
72
|
+
}
|
73
|
+
});
|
74
|
+
});
|
75
|
+
return cellMetas;
|
76
|
+
};
|
58
77
|
instance.addHook('beforeRemoveRow', (index, amount, logicRows, source) => {
|
59
78
|
const wrappedAction = () => {
|
60
79
|
const physicalRowIndex = instance.toPhysicalRow(index);
|
80
|
+
const lastRowIndex = physicalRowIndex + amount - 1;
|
61
81
|
const removedData = deepClone(plugin.instance.getSourceData(physicalRowIndex, 0, physicalRowIndex + amount - 1, plugin.instance.countSourceCols() - 1));
|
62
|
-
return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence());
|
82
|
+
return new UndoRedo.RemoveRowAction(physicalRowIndex, removedData, instance.getSettings().fixedRowsBottom, instance.getSettings().fixedRowsTop, instance.rowIndexMapper.getIndexesSequence(), getCellMetas(physicalRowIndex, lastRowIndex, 0, instance.countCols() - 1));
|
63
83
|
};
|
64
84
|
plugin.done(wrappedAction, source);
|
65
85
|
});
|
@@ -70,13 +90,14 @@ function UndoRedo(instance) {
|
|
70
90
|
const wrappedAction = () => {
|
71
91
|
const originalData = plugin.instance.getSourceDataArray();
|
72
92
|
const columnIndex = (plugin.instance.countCols() + index) % plugin.instance.countCols();
|
93
|
+
const lastColumnIndex = columnIndex + amount - 1;
|
73
94
|
const removedData = [];
|
74
95
|
const headers = [];
|
75
96
|
const indexes = [];
|
76
97
|
rangeEach(originalData.length - 1, i => {
|
77
98
|
const column = [];
|
78
99
|
const origRow = originalData[i];
|
79
|
-
rangeEach(columnIndex,
|
100
|
+
rangeEach(columnIndex, lastColumnIndex, j => {
|
80
101
|
column.push(origRow[instance.toPhysicalColumn(j)]);
|
81
102
|
});
|
82
103
|
removedData.push(column);
|
@@ -91,7 +112,7 @@ function UndoRedo(instance) {
|
|
91
112
|
}
|
92
113
|
const columnsMap = instance.columnIndexMapper.getIndexesSequence();
|
93
114
|
const rowsMap = instance.rowIndexMapper.getIndexesSequence();
|
94
|
-
return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart);
|
115
|
+
return new UndoRedo.RemoveColumnAction(columnIndex, indexes, removedData, headers, columnsMap, rowsMap, instance.getSettings().fixedColumnsStart, getCellMetas(0, instance.countRows(), columnIndex, lastColumnIndex));
|
95
116
|
};
|
96
117
|
plugin.done(wrappedAction, source);
|
97
118
|
});
|
@@ -359,6 +380,32 @@ UndoRedo.ChangeAction.prototype.undo = function (instance, undoneCallback) {
|
|
359
380
|
instance.undoRedo.doneActions.pop();
|
360
381
|
}
|
361
382
|
}
|
383
|
+
const selectedLast = instance.getSelectedLast();
|
384
|
+
if (selectedLast !== undefined) {
|
385
|
+
const [changedRow, changedColumn] = data[0];
|
386
|
+
const [selectedRow, selectedColumn] = selectedLast;
|
387
|
+
const firstFullyVisibleRow = instance.view.getFirstFullyVisibleRow();
|
388
|
+
const firstFullyVisibleColumn = instance.view.getFirstFullyVisibleColumn();
|
389
|
+
const isInVerticalViewPort = changedRow >= firstFullyVisibleRow;
|
390
|
+
const isInHorizontalViewPort = changedColumn >= firstFullyVisibleColumn;
|
391
|
+
const isInViewport = isInVerticalViewPort && isInHorizontalViewPort;
|
392
|
+
const isChangedSelection = selectedRow !== changedRow || selectedColumn !== changedColumn;
|
393
|
+
|
394
|
+
// Performing scroll only when selection has been changed right after editing a cell.
|
395
|
+
if (isInViewport === false && isChangedSelection === true) {
|
396
|
+
const scrollConfig = {
|
397
|
+
row: changedRow,
|
398
|
+
col: changedColumn
|
399
|
+
};
|
400
|
+
if (isInVerticalViewPort === false) {
|
401
|
+
scrollConfig.verticalSnap = 'top';
|
402
|
+
}
|
403
|
+
if (isInHorizontalViewPort === false) {
|
404
|
+
scrollConfig.horizontalSnap = 'start';
|
405
|
+
}
|
406
|
+
instance.scrollViewportTo(scrollConfig);
|
407
|
+
}
|
408
|
+
}
|
362
409
|
instance.selectCells(this.selected, false, false);
|
363
410
|
};
|
364
411
|
UndoRedo.ChangeAction.prototype.redo = function (instance, onFinishCallback) {
|
@@ -392,7 +439,6 @@ UndoRedo.CreateRowAction.prototype.undo = function (instance, undoneCallback) {
|
|
392
439
|
if (this.index >= rowCount && this.index - minSpareRows < rowCount) {
|
393
440
|
this.index -= minSpareRows; // work around the situation where the needed row was removed due to an 'undo' of a made change
|
394
441
|
}
|
395
|
-
|
396
442
|
instance.addHookOnce('afterRemoveRow', undoneCallback);
|
397
443
|
instance.alter('remove_row', this.index, this.amount, 'UndoRedo.undo');
|
398
444
|
};
|
@@ -410,14 +456,16 @@ UndoRedo.CreateRowAction.prototype.redo = function (instance, redoneCallback) {
|
|
410
456
|
* @param {number} fixedRowsBottom Number of fixed rows on the bottom. Remove row action change it sometimes.
|
411
457
|
* @param {number} fixedRowsTop Number of fixed rows on the top. Remove row action change it sometimes.
|
412
458
|
* @param {Array} rowIndexesSequence Row index sequence taken from the row index mapper.
|
459
|
+
* @param {Array} removedCellMetas List of removed cell metas.
|
413
460
|
*/
|
414
|
-
UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence) {
|
461
|
+
UndoRedo.RemoveRowAction = function (index, data, fixedRowsBottom, fixedRowsTop, rowIndexesSequence, removedCellMetas) {
|
415
462
|
this.index = index;
|
416
463
|
this.data = data;
|
417
464
|
this.actionType = 'remove_row';
|
418
465
|
this.fixedRowsBottom = fixedRowsBottom;
|
419
466
|
this.fixedRowsTop = fixedRowsTop;
|
420
467
|
this.rowIndexesSequence = rowIndexesSequence;
|
468
|
+
this.removedCellMetas = removedCellMetas;
|
421
469
|
};
|
422
470
|
inherit(UndoRedo.RemoveRowAction, UndoRedo.Action);
|
423
471
|
UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
|
@@ -436,6 +484,10 @@ UndoRedo.RemoveRowAction.prototype.undo = function (instance, undoneCallback) {
|
|
436
484
|
});
|
437
485
|
});
|
438
486
|
instance.alter('insert_row_above', this.index, this.data.length, 'UndoRedo.undo');
|
487
|
+
this.removedCellMetas.forEach(_ref2 => {
|
488
|
+
let [rowIndex, columnIndex, cellMeta] = _ref2;
|
489
|
+
instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
490
|
+
});
|
439
491
|
instance.addHookOnce('afterViewRender', undoneCallback);
|
440
492
|
instance.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
|
441
493
|
instance.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
@@ -478,8 +530,9 @@ UndoRedo.CreateColumnAction.prototype.redo = function (instance, redoneCallback)
|
|
478
530
|
* @param {number[]} columnPositions The column position.
|
479
531
|
* @param {number[]} rowPositions The row position.
|
480
532
|
* @param {number} fixedColumnsStart Number of fixed columns on the left. Remove column action change it sometimes.
|
533
|
+
* @param {Array} removedCellMetas List of removed cell metas.
|
481
534
|
*/
|
482
|
-
UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart) {
|
535
|
+
UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPositions, rowPositions, fixedColumnsStart, removedCellMetas) {
|
483
536
|
// eslint-disable-line max-len
|
484
537
|
this.index = index;
|
485
538
|
this.indexes = indexes;
|
@@ -490,6 +543,7 @@ UndoRedo.RemoveColumnAction = function (index, indexes, data, headers, columnPos
|
|
490
543
|
this.rowPositions = rowPositions.slice(0);
|
491
544
|
this.actionType = 'remove_col';
|
492
545
|
this.fixedColumnsStart = fixedColumnsStart;
|
546
|
+
this.removedCellMetas = removedCellMetas;
|
493
547
|
};
|
494
548
|
inherit(UndoRedo.RemoveColumnAction, UndoRedo.Action);
|
495
549
|
UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback) {
|
@@ -519,6 +573,10 @@ UndoRedo.RemoveColumnAction.prototype.undo = function (instance, undoneCallback)
|
|
519
573
|
instance.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData;
|
520
574
|
});
|
521
575
|
}
|
576
|
+
this.removedCellMetas.forEach(_ref3 => {
|
577
|
+
let [rowIndex, columnIndex, cellMeta] = _ref3;
|
578
|
+
instance.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
579
|
+
});
|
522
580
|
instance.batchExecution(() => {
|
523
581
|
// Restore row sequence in a case when all columns are removed. the original
|
524
582
|
// row sequence is lost in that case.
|
@@ -712,7 +770,6 @@ UndoRedo.prototype.registerShortcuts = function () {
|
|
712
770
|
const runOnlyIf = event => {
|
713
771
|
return !event.altKey; // right ALT in some systems triggers ALT+CTR
|
714
772
|
};
|
715
|
-
|
716
773
|
const config = {
|
717
774
|
runOnlyIf,
|
718
775
|
group: SHORTCUTS_GROUP
|
@@ -2,4 +2,4 @@ import Core from '../../core';
|
|
2
2
|
import { CellProperties } from '../../settings';
|
3
3
|
|
4
4
|
export const RENDERER_TYPE: 'autocomplete';
|
5
|
-
export function autocompleteRenderer(instance: Core, TD: HTMLTableCellElement, row: number,
|
5
|
+
export function autocompleteRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
|
@@ -41,7 +41,6 @@ function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cellProper
|
|
41
41
|
TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946
|
42
42
|
// this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
|
43
43
|
}
|
44
|
-
|
45
44
|
TD.insertBefore(ARROW, TD.firstChild);
|
46
45
|
(0, _element.addClass)(TD, 'htAutocomplete');
|
47
46
|
if (!hotInstance.acArrowListener) {
|
@@ -36,7 +36,6 @@ export function autocompleteRenderer(hotInstance, TD, row, col, prop, value, cel
|
|
36
36
|
TD.appendChild(rootDocument.createTextNode(String.fromCharCode(160))); // workaround for https://github.com/handsontable/handsontable/issues/1946
|
37
37
|
// this is faster than innerHTML. See: https://github.com/handsontable/handsontable/wiki/JavaScript-&-DOM-performance-tips
|
38
38
|
}
|
39
|
-
|
40
39
|
TD.insertBefore(ARROW, TD.firstChild);
|
41
40
|
addClass(TD, 'htAutocomplete');
|
42
41
|
if (!hotInstance.acArrowListener) {
|
@@ -2,4 +2,4 @@ import Core from '../../core';
|
|
2
2
|
import { CellProperties } from '../../settings';
|
3
3
|
|
4
4
|
export const RENDERER_TYPE: 'base';
|
5
|
-
export function baseRenderer(instance: Core, TD: HTMLTableCellElement, row: number,
|
5
|
+
export function baseRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
|
@@ -2,4 +2,4 @@ import Core from '../../core';
|
|
2
2
|
import { CellProperties } from '../../settings';
|
3
3
|
|
4
4
|
export const RENDERER_TYPE: 'checkbox';
|
5
|
-
export function checkboxRenderer(instance: Core, TD: HTMLTableCellElement, row: number,
|
5
|
+
export function checkboxRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
|
@@ -153,7 +153,6 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
|
|
153
153
|
changeSelectedCheckboxesState();
|
154
154
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
155
155
|
},
|
156
|
-
|
157
156
|
runOnlyIf: () => hotInstance.getSettings().enterBeginsEditing
|
158
157
|
}, {
|
159
158
|
keys: [['delete'], ['backspace']],
|
@@ -161,7 +160,6 @@ function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellProperties
|
|
161
160
|
changeSelectedCheckboxesState(true);
|
162
161
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
163
162
|
},
|
164
|
-
|
165
163
|
relativeToGroup: _shortcutContexts.EDITOR_EDIT_GROUP,
|
166
164
|
position: 'before'
|
167
165
|
}], config);
|
@@ -148,7 +148,6 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
|
|
148
148
|
changeSelectedCheckboxesState();
|
149
149
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
150
150
|
},
|
151
|
-
|
152
151
|
runOnlyIf: () => hotInstance.getSettings().enterBeginsEditing
|
153
152
|
}, {
|
154
153
|
keys: [['delete'], ['backspace']],
|
@@ -156,7 +155,6 @@ export function checkboxRenderer(hotInstance, TD, row, col, prop, value, cellPro
|
|
156
155
|
changeSelectedCheckboxesState(true);
|
157
156
|
return !areSelectedCheckboxCells(); // False blocks next action associated with the keyboard shortcut.
|
158
157
|
},
|
159
|
-
|
160
158
|
relativeToGroup: SHORTCUTS_GROUP_EDITOR,
|
161
159
|
position: 'before'
|
162
160
|
}], config);
|
@@ -2,4 +2,4 @@ import Core from '../../core';
|
|
2
2
|
import { CellProperties } from '../../settings';
|
3
3
|
|
4
4
|
export const RENDERER_TYPE: 'date';
|
5
|
-
export function dateRenderer(instance: Core, TD: HTMLTableCellElement, row: number,
|
5
|
+
export function dateRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
|
@@ -0,0 +1,5 @@
|
|
1
|
+
import Core from '../../core';
|
2
|
+
import { CellProperties } from '../../settings';
|
3
|
+
|
4
|
+
export const RENDERER_TYPE: 'dropdown';
|
5
|
+
export function dropdownRenderer(instance: Core, TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: any, cellProperties: CellProperties): void;
|