handsontable 19.0.0-rc8 → 19.0.0
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/overlay/scrollbarProxies.js +3 -1
- package/3rdparty/walkontable/src/overlay/scrollbarProxies.mjs +3 -1
- package/CHANGELOG.md +5 -4
- package/README.md +11 -4
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/hooks/constants.d.ts +2 -0
- package/core/hooks/constants.js +15 -6
- package/core/hooks/constants.mjs +15 -6
- package/core/license.js +2 -2
- package/core/license.mjs +2 -2
- package/core/types.d.ts +1 -0
- package/core.js +51 -4
- package/core.mjs +51 -4
- package/dataMap/metaManager/metaSchema.js +1 -0
- package/dataMap/metaManager/metaSchema.mjs +1 -0
- package/dist/handsontable.full.js +299 -121
- package/dist/handsontable.full.min.js +24 -24
- package/dist/handsontable.js +299 -121
- package/dist/handsontable.min.js +24 -24
- package/dist/handsontable.settings-schema.js +23 -13
- package/dist/handsontable.settings-schema.min.js +2 -2
- package/dist/manifest.json +1 -71
- package/dist/themes/classic.js +2 -2
- package/dist/themes/classic.min.js +2 -2
- package/dist/themes/horizon.js +2 -2
- package/dist/themes/horizon.min.js +2 -2
- package/dist/themes/main.js +2 -2
- package/dist/themes/main.min.js +2 -2
- package/dist/themes/static/variables/colors/ant.js +2 -2
- package/dist/themes/static/variables/colors/ant.min.js +2 -2
- package/dist/themes/static/variables/colors/classic.js +2 -2
- package/dist/themes/static/variables/colors/classic.min.js +2 -2
- package/dist/themes/static/variables/colors/horizon.js +2 -2
- package/dist/themes/static/variables/colors/horizon.min.js +2 -2
- package/dist/themes/static/variables/colors/main.js +2 -2
- package/dist/themes/static/variables/colors/main.min.js +2 -2
- package/dist/themes/static/variables/colors/material.js +2 -2
- package/dist/themes/static/variables/colors/material.min.js +2 -2
- package/dist/themes/static/variables/colors/shadcn.js +2 -2
- package/dist/themes/static/variables/colors/shadcn.min.js +2 -2
- package/dist/themes/static/variables/density.js +2 -2
- package/dist/themes/static/variables/density.min.js +2 -2
- package/dist/themes/static/variables/helpers/iconStyles.js +2 -2
- package/dist/themes/static/variables/helpers/iconStyles.min.js +2 -2
- package/dist/themes/static/variables/helpers/iconsMap.js +2 -2
- package/dist/themes/static/variables/helpers/iconsMap.min.js +2 -2
- package/dist/themes/static/variables/icons/horizon.js +2 -2
- package/dist/themes/static/variables/icons/horizon.min.js +2 -2
- package/dist/themes/static/variables/icons/main.js +2 -2
- package/dist/themes/static/variables/icons/main.min.js +2 -2
- package/dist/themes/static/variables/sizing.js +2 -2
- package/dist/themes/static/variables/sizing.min.js +2 -2
- package/dist/themes/static/variables/tokens/classic.js +2 -2
- package/dist/themes/static/variables/tokens/classic.min.js +2 -2
- package/dist/themes/static/variables/tokens/horizon.js +2 -2
- package/dist/themes/static/variables/tokens/horizon.min.js +2 -2
- package/dist/themes/static/variables/tokens/main.js +2 -2
- package/dist/themes/static/variables/tokens/main.min.js +2 -2
- package/helpers/mixed.js +5 -5
- package/helpers/mixed.mjs +5 -5
- package/package.json +1 -1
- package/plugins/asyncValues/feature.generated.js +0 -1
- package/plugins/asyncValues/feature.generated.mjs +0 -1
- package/plugins/autoColumnSize/autoColumnSize.js +3 -3
- package/plugins/autoColumnSize/autoColumnSize.mjs +3 -3
- package/plugins/autoColumnSize/feature.generated.js +0 -1
- package/plugins/autoColumnSize/feature.generated.mjs +0 -1
- package/plugins/autoLink/feature.generated.js +0 -1
- package/plugins/autoLink/feature.generated.mjs +0 -1
- package/plugins/autoRowHeaderSize/feature.generated.js +0 -1
- package/plugins/autoRowHeaderSize/feature.generated.mjs +0 -1
- package/plugins/autoRowSize/autoRowSize.js +5 -5
- package/plugins/autoRowSize/autoRowSize.mjs +5 -5
- package/plugins/autoRowSize/feature.generated.js +0 -1
- package/plugins/autoRowSize/feature.generated.mjs +0 -1
- package/plugins/autofill/feature.generated.js +0 -1
- package/plugins/autofill/feature.generated.mjs +0 -1
- package/plugins/base/base.d.ts +8 -1
- package/plugins/bindRowsWithHeaders/feature.generated.js +0 -1
- package/plugins/bindRowsWithHeaders/feature.generated.mjs +0 -1
- package/plugins/checkboxHeader/feature.generated.js +0 -1
- package/plugins/checkboxHeader/feature.generated.mjs +0 -1
- package/plugins/collapsibleColumns/feature.generated.js +0 -1
- package/plugins/collapsibleColumns/feature.generated.mjs +0 -1
- package/plugins/columnSorting/feature.generated.js +0 -1
- package/plugins/columnSorting/feature.generated.mjs +0 -1
- package/plugins/columnSummary/feature.generated.js +0 -1
- package/plugins/columnSummary/feature.generated.mjs +0 -1
- package/plugins/comments/feature.generated.js +0 -1
- package/plugins/comments/feature.generated.mjs +0 -1
- package/plugins/contextMenu/feature.generated.js +0 -1
- package/plugins/contextMenu/feature.generated.mjs +0 -1
- package/plugins/copyPaste/feature.generated.js +0 -1
- package/plugins/copyPaste/feature.generated.mjs +0 -1
- package/plugins/customBorders/feature.generated.js +0 -1
- package/plugins/customBorders/feature.generated.mjs +0 -1
- package/plugins/dataProvider/feature.generated.js +0 -1
- package/plugins/dataProvider/feature.generated.mjs +0 -1
- package/plugins/dialog/feature.generated.js +0 -1
- package/plugins/dialog/feature.generated.mjs +0 -1
- package/plugins/dragToScroll/feature.generated.js +0 -1
- package/plugins/dragToScroll/feature.generated.mjs +0 -1
- package/plugins/dropdownMenu/feature.generated.js +0 -1
- package/plugins/dropdownMenu/feature.generated.mjs +0 -1
- package/plugins/emptyDataState/feature.generated.js +0 -1
- package/plugins/emptyDataState/feature.generated.mjs +0 -1
- package/plugins/exportFile/feature.generated.js +0 -1
- package/plugins/exportFile/feature.generated.mjs +0 -1
- package/plugins/filters/feature.generated.js +0 -1
- package/plugins/filters/feature.generated.mjs +0 -1
- package/plugins/formulaBuilder/feature.generated.js +0 -1
- package/plugins/formulaBuilder/feature.generated.mjs +0 -1
- package/plugins/formulas/feature.generated.js +0 -1
- package/plugins/formulas/feature.generated.mjs +0 -1
- package/plugins/formulas/formulas.js +4 -4
- package/plugins/formulas/formulas.mjs +4 -4
- package/plugins/freezeBar/feature.generated.js +0 -1
- package/plugins/freezeBar/feature.generated.mjs +0 -1
- package/plugins/hiddenColumns/feature.generated.js +0 -1
- package/plugins/hiddenColumns/feature.generated.mjs +0 -1
- package/plugins/hiddenRows/feature.generated.js +0 -1
- package/plugins/hiddenRows/feature.generated.mjs +0 -1
- package/plugins/importFile/feature.generated.js +0 -1
- package/plugins/importFile/feature.generated.mjs +0 -1
- package/plugins/loading/feature.generated.js +0 -1
- package/plugins/loading/feature.generated.mjs +0 -1
- package/plugins/manualColumnFreeze/feature.generated.js +0 -1
- package/plugins/manualColumnFreeze/feature.generated.mjs +0 -1
- package/plugins/manualColumnMove/feature.generated.js +0 -1
- package/plugins/manualColumnMove/feature.generated.mjs +0 -1
- package/plugins/manualColumnResize/feature.generated.js +0 -1
- package/plugins/manualColumnResize/feature.generated.mjs +0 -1
- package/plugins/manualRowMove/feature.generated.js +0 -1
- package/plugins/manualRowMove/feature.generated.mjs +0 -1
- package/plugins/manualRowResize/feature.generated.js +0 -1
- package/plugins/manualRowResize/feature.generated.mjs +0 -1
- package/plugins/mergeCells/feature.generated.js +0 -1
- package/plugins/mergeCells/feature.generated.mjs +0 -1
- package/plugins/mergeCells/mergeCells.js +159 -16
- package/plugins/mergeCells/mergeCells.mjs +159 -16
- package/plugins/moveCells/feature.generated.js +0 -1
- package/plugins/moveCells/feature.generated.mjs +0 -1
- package/plugins/multiColumnSorting/feature.generated.js +0 -1
- package/plugins/multiColumnSorting/feature.generated.mjs +0 -1
- package/plugins/nestedHeaders/feature.generated.js +0 -1
- package/plugins/nestedHeaders/feature.generated.mjs +0 -1
- package/plugins/nestedRows/feature.generated.js +0 -1
- package/plugins/nestedRows/feature.generated.mjs +0 -1
- package/plugins/notification/feature.generated.js +0 -1
- package/plugins/notification/feature.generated.mjs +0 -1
- package/plugins/pagination/feature.generated.js +0 -1
- package/plugins/pagination/feature.generated.mjs +0 -1
- package/plugins/pagination/pagination.js +17 -4
- package/plugins/pagination/pagination.mjs +17 -4
- package/plugins/rowSelection/feature.generated.js +0 -1
- package/plugins/rowSelection/feature.generated.mjs +0 -1
- package/plugins/search/feature.generated.js +0 -1
- package/plugins/search/feature.generated.mjs +0 -1
- package/plugins/selectionHandles/feature.generated.js +0 -1
- package/plugins/selectionHandles/feature.generated.mjs +0 -1
- package/plugins/sheetsBar/feature.generated.js +0 -1
- package/plugins/sheetsBar/feature.generated.mjs +0 -1
- package/plugins/stretchColumns/feature.generated.js +0 -1
- package/plugins/stretchColumns/feature.generated.mjs +0 -1
- package/plugins/trimRows/feature.generated.js +0 -1
- package/plugins/trimRows/feature.generated.mjs +0 -1
- package/plugins/undoRedo/feature.generated.js +0 -1
- package/plugins/undoRedo/feature.generated.mjs +0 -1
- package/plugins/undoRedo/restore.js +20 -8
- package/plugins/undoRedo/restore.mjs +20 -8
- package/plugins/undoRedo/snapshot/gridState.d.ts +5 -1
- package/plugins/undoRedo/snapshot/gridState.js +5 -2
- package/plugins/undoRedo/snapshot/gridState.mjs +5 -2
- package/plugins/viewState/feature.generated.js +0 -1
- package/plugins/viewState/feature.generated.mjs +0 -1
- package/styles/handsontable.css +2 -2
- package/styles/handsontable.min.css +2 -2
- package/styles/handsontableStyles.d.ts +1 -1
- package/styles/handsontableStyles.js +1 -1
- package/styles/handsontableStyles.mjs +1 -1
- package/styles/ht-icons-horizon.min.css +2 -2
- package/styles/ht-icons-main.min.css +2 -2
- package/styles/ht-theme-classic-no-icons.min.css +2 -2
- package/styles/ht-theme-classic.min.css +2 -2
- package/styles/ht-theme-horizon-no-icons.min.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main-no-icons.min.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/utils/licenseBranding/index.js +5 -4
- package/utils/licenseBranding/index.mjs +5 -4
- package/utils/licenseNotification.js +2 -2
- package/utils/licenseNotification.mjs +2 -2
- package/utils/xlsxEngine/licenseCapabilities.generated.js +0 -4
- package/utils/xlsxEngine/licenseCapabilities.generated.mjs +0 -4
|
@@ -218,6 +218,9 @@ var /**
|
|
|
218
218
|
* Updates the visibility state of the pagination sections based on the current settings.
|
|
219
219
|
*/ _updateSectionsVisibilityState = /*#__PURE__*/ new WeakSet(), /**
|
|
220
220
|
* Applies the current pagination state to the internal index mapper and updates the UI.
|
|
221
|
+
*
|
|
222
|
+
* @param {boolean} [firesExecutionHooks=true] `false` for the recompute an `'auto'` page size does on each
|
|
223
|
+
* render, which stores the paged rows with no execution hooks fired.
|
|
221
224
|
*/ _computeAndApplyState = /*#__PURE__*/ new WeakSet(), /**
|
|
222
225
|
* Registers the focus scope for the pagination plugin.
|
|
223
226
|
*/ _registerFocusScope = /*#__PURE__*/ new WeakSet(), /**
|
|
@@ -991,7 +994,10 @@ class Pagination extends _base.BasePlugin {
|
|
|
991
994
|
return;
|
|
992
995
|
}
|
|
993
996
|
_class_private_field_set(this, _internalRenderCall, true);
|
|
994
|
-
|
|
997
|
+
// Only the recompute is silent. The render that follows runs listeners, and a page change one of them
|
|
998
|
+
// asks for fires the execution hooks.
|
|
999
|
+
_class_private_method_get(this, _computeAndApplyState, computeAndApplyState).call(this, false);
|
|
1000
|
+
this.hot.render();
|
|
995
1001
|
}), _class_private_field_set(this, _onAfterRender, ()=>{
|
|
996
1002
|
const holder = this.hot.view._wt.wtTable.holder;
|
|
997
1003
|
_class_private_field_get(this, _ui1)?.syncEmptyBodyReserve(holder, _class_private_method_get(this, _shouldReserveEmptyBody, shouldReserveEmptyBody).call(this, holder));
|
|
@@ -1067,7 +1073,7 @@ function updateSectionsVisibilityState() {
|
|
|
1067
1073
|
this.hidePageNavigationSection();
|
|
1068
1074
|
}
|
|
1069
1075
|
}
|
|
1070
|
-
function computeAndApplyState() {
|
|
1076
|
+
function computeAndApplyState(firesExecutionHooks = true) {
|
|
1071
1077
|
_class_private_field_set(this, _internalExecutionCall, true);
|
|
1072
1078
|
_class_private_field_get(this, _pagedRowsMap)?.clear();
|
|
1073
1079
|
const renderableIndexes = this.hot.rowIndexMapper.getRenderableIndexes();
|
|
@@ -1112,9 +1118,16 @@ function computeAndApplyState() {
|
|
|
1112
1118
|
}
|
|
1113
1119
|
}
|
|
1114
1120
|
if (!externalPagedMode && renderableIndexes.length > 0) {
|
|
1115
|
-
|
|
1121
|
+
const storePagedRows = ()=>{
|
|
1116
1122
|
renderableIndexes.forEach((index)=>_class_private_field_get(this, _pagedRowsMap)?.setValueAtIndex(index, true));
|
|
1117
|
-
}
|
|
1123
|
+
};
|
|
1124
|
+
// The recompute an `'auto'` page size does on each render is bookkeeping, like the sizes the auto-size
|
|
1125
|
+
// plugins store there, so it fires no execution hooks. A page change a caller asks for still does.
|
|
1126
|
+
if (firesExecutionHooks) {
|
|
1127
|
+
this.hot.batchExecution(storePagedRows, true);
|
|
1128
|
+
} else {
|
|
1129
|
+
this.hot._batchExecutionWithoutHooks(storePagedRows, true);
|
|
1130
|
+
}
|
|
1118
1131
|
} else if (!externalPagedMode) {
|
|
1119
1132
|
this.hot.rowIndexMapper.updateCache(true);
|
|
1120
1133
|
}
|
|
@@ -197,6 +197,9 @@ var /**
|
|
|
197
197
|
* Updates the visibility state of the pagination sections based on the current settings.
|
|
198
198
|
*/ _updateSectionsVisibilityState = /*#__PURE__*/ new WeakSet(), /**
|
|
199
199
|
* Applies the current pagination state to the internal index mapper and updates the UI.
|
|
200
|
+
*
|
|
201
|
+
* @param {boolean} [firesExecutionHooks=true] `false` for the recompute an `'auto'` page size does on each
|
|
202
|
+
* render, which stores the paged rows with no execution hooks fired.
|
|
200
203
|
*/ _computeAndApplyState = /*#__PURE__*/ new WeakSet(), /**
|
|
201
204
|
* Registers the focus scope for the pagination plugin.
|
|
202
205
|
*/ _registerFocusScope = /*#__PURE__*/ new WeakSet(), /**
|
|
@@ -1042,7 +1045,10 @@ var /**
|
|
|
1042
1045
|
return;
|
|
1043
1046
|
}
|
|
1044
1047
|
_class_private_field_set(this, _internalRenderCall, true);
|
|
1045
|
-
|
|
1048
|
+
// Only the recompute is silent. The render that follows runs listeners, and a page change one of them
|
|
1049
|
+
// asks for fires the execution hooks.
|
|
1050
|
+
_class_private_method_get(this, _computeAndApplyState, computeAndApplyState).call(this, false);
|
|
1051
|
+
this.hot.render();
|
|
1046
1052
|
}), _class_private_field_set(this, _onAfterRender, ()=>{
|
|
1047
1053
|
const holder = this.hot.view._wt.wtTable.holder;
|
|
1048
1054
|
_class_private_field_get(this, _ui)?.syncEmptyBodyReserve(holder, _class_private_method_get(this, _shouldReserveEmptyBody, shouldReserveEmptyBody).call(this, holder));
|
|
@@ -1118,7 +1124,7 @@ function updateSectionsVisibilityState() {
|
|
|
1118
1124
|
this.hidePageNavigationSection();
|
|
1119
1125
|
}
|
|
1120
1126
|
}
|
|
1121
|
-
function computeAndApplyState() {
|
|
1127
|
+
function computeAndApplyState(firesExecutionHooks = true) {
|
|
1122
1128
|
_class_private_field_set(this, _internalExecutionCall, true);
|
|
1123
1129
|
_class_private_field_get(this, _pagedRowsMap)?.clear();
|
|
1124
1130
|
const renderableIndexes = this.hot.rowIndexMapper.getRenderableIndexes();
|
|
@@ -1163,9 +1169,16 @@ function computeAndApplyState() {
|
|
|
1163
1169
|
}
|
|
1164
1170
|
}
|
|
1165
1171
|
if (!externalPagedMode && renderableIndexes.length > 0) {
|
|
1166
|
-
|
|
1172
|
+
const storePagedRows = ()=>{
|
|
1167
1173
|
renderableIndexes.forEach((index)=>_class_private_field_get(this, _pagedRowsMap)?.setValueAtIndex(index, true));
|
|
1168
|
-
}
|
|
1174
|
+
};
|
|
1175
|
+
// The recompute an `'auto'` page size does on each render is bookkeeping, like the sizes the auto-size
|
|
1176
|
+
// plugins store there, so it fires no execution hooks. A page change a caller asks for still does.
|
|
1177
|
+
if (firesExecutionHooks) {
|
|
1178
|
+
this.hot.batchExecution(storePagedRows, true);
|
|
1179
|
+
} else {
|
|
1180
|
+
this.hot._batchExecutionWithoutHooks(storePagedRows, true);
|
|
1181
|
+
}
|
|
1169
1182
|
} else if (!externalPagedMode) {
|
|
1170
1183
|
this.hot.rowIndexMapper.updateCache(true);
|
|
1171
1184
|
}
|
|
@@ -153,16 +153,26 @@ const _restoredCells = require("./restoredCells");
|
|
|
153
153
|
return kept;
|
|
154
154
|
}
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
157
|
-
*
|
|
156
|
+
* Returns a function that maps a physical index of the other side of a step to the grid the restore leaves
|
|
157
|
+
* behind, through the step's row and column changes. It answers `null` for a row or column that does not exist
|
|
158
|
+
* there.
|
|
158
159
|
*
|
|
159
|
-
* @param {HotInstance} hot The Handsontable instance.
|
|
160
|
-
* @param {KeptFlags[]} kept The flags.
|
|
161
160
|
* @param {JournalOp[]} journal The step journal.
|
|
162
161
|
* @param {RestoreDirection} direction The replay direction.
|
|
163
|
-
|
|
162
|
+
* @returns {Function}
|
|
163
|
+
*/ function createRestoredIndexMapper(journal, direction) {
|
|
164
164
|
// An undo leaves the grid as it was before the step, so every entry is reversed; a redo applies them all.
|
|
165
165
|
const fromEntry = direction === 'undo' ? journal.length : -1;
|
|
166
|
+
return (physicalIndex, axis)=>(0, _restoredCells.toFinalIndex)(journal, fromEntry, physicalIndex, axis, direction);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Puts back the flags `readKeptFlags()` read, moved through the step's row and column changes to the
|
|
170
|
+
* grid the restore leaves behind. A row the step inserted is never flagged by them.
|
|
171
|
+
*
|
|
172
|
+
* @param {HotInstance} hot The Handsontable instance.
|
|
173
|
+
* @param {KeptFlags[]} kept The flags.
|
|
174
|
+
* @param {Function} toRestoredIndex Maps a physical index to the restored grid (`createRestoredIndexMapper()`).
|
|
175
|
+
*/ function applyKeptFlags(hot, kept, toRestoredIndex) {
|
|
166
176
|
kept.forEach(({ axis, key, name, physicalIndexes, restoredIndexes })=>{
|
|
167
177
|
const mapper = axis === 'row' ? hot.rowIndexMapper : hot.columnIndexMapper;
|
|
168
178
|
const map = (key === 'trimming' ? mapper.trimmingMapsCollection : mapper.hidingMapsCollection).get(name);
|
|
@@ -172,7 +182,7 @@ const _restoredCells = require("./restoredCells");
|
|
|
172
182
|
const length = mapper.getNumberOfIndexes();
|
|
173
183
|
const values = new Array(length).fill(false);
|
|
174
184
|
physicalIndexes.forEach((physicalIndex)=>{
|
|
175
|
-
const finalIndex = (
|
|
185
|
+
const finalIndex = toRestoredIndex(physicalIndex, axis);
|
|
176
186
|
if (finalIndex !== null && finalIndex < length) {
|
|
177
187
|
values[finalIndex] = true;
|
|
178
188
|
}
|
|
@@ -673,14 +683,16 @@ function restoreStep(hot, tracker, record, direction) {
|
|
|
673
683
|
return false;
|
|
674
684
|
}
|
|
675
685
|
announceRowChanges(hot, rowChanges, source);
|
|
686
|
+
const toRestoredIndex = createRestoredIndexMapper(record.journal, direction);
|
|
676
687
|
// Only what the step changed is written back, so a change made outside any step since survives.
|
|
677
688
|
tracker.restore(target, {
|
|
678
689
|
changedFrom: other,
|
|
679
690
|
base: current,
|
|
680
691
|
forceOrder: reordersForReplay,
|
|
681
|
-
direction
|
|
692
|
+
direction,
|
|
693
|
+
toRestoredIndex: reordersForReplay ? toRestoredIndex : undefined
|
|
682
694
|
});
|
|
683
|
-
applyKeptFlags(hot, keptFlags,
|
|
695
|
+
applyKeptFlags(hot, keptFlags, toRestoredIndex);
|
|
684
696
|
// A full render when the batch ends. A step that changed only cell meta asks for none itself, and
|
|
685
697
|
// the fast draw the batch ends with would keep every cell as it was painted.
|
|
686
698
|
hot.render();
|
|
@@ -135,16 +135,26 @@ import { toFinalIndex } from './restoredCells.mjs';
|
|
|
135
135
|
return kept;
|
|
136
136
|
}
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
138
|
+
* Returns a function that maps a physical index of the other side of a step to the grid the restore leaves
|
|
139
|
+
* behind, through the step's row and column changes. It answers `null` for a row or column that does not exist
|
|
140
|
+
* there.
|
|
140
141
|
*
|
|
141
|
-
* @param {HotInstance} hot The Handsontable instance.
|
|
142
|
-
* @param {KeptFlags[]} kept The flags.
|
|
143
142
|
* @param {JournalOp[]} journal The step journal.
|
|
144
143
|
* @param {RestoreDirection} direction The replay direction.
|
|
145
|
-
|
|
144
|
+
* @returns {Function}
|
|
145
|
+
*/ function createRestoredIndexMapper(journal, direction) {
|
|
146
146
|
// An undo leaves the grid as it was before the step, so every entry is reversed; a redo applies them all.
|
|
147
147
|
const fromEntry = direction === 'undo' ? journal.length : -1;
|
|
148
|
+
return (physicalIndex, axis)=>toFinalIndex(journal, fromEntry, physicalIndex, axis, direction);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Puts back the flags `readKeptFlags()` read, moved through the step's row and column changes to the
|
|
152
|
+
* grid the restore leaves behind. A row the step inserted is never flagged by them.
|
|
153
|
+
*
|
|
154
|
+
* @param {HotInstance} hot The Handsontable instance.
|
|
155
|
+
* @param {KeptFlags[]} kept The flags.
|
|
156
|
+
* @param {Function} toRestoredIndex Maps a physical index to the restored grid (`createRestoredIndexMapper()`).
|
|
157
|
+
*/ function applyKeptFlags(hot, kept, toRestoredIndex) {
|
|
148
158
|
kept.forEach(({ axis, key, name, physicalIndexes, restoredIndexes })=>{
|
|
149
159
|
const mapper = axis === 'row' ? hot.rowIndexMapper : hot.columnIndexMapper;
|
|
150
160
|
const map = (key === 'trimming' ? mapper.trimmingMapsCollection : mapper.hidingMapsCollection).get(name);
|
|
@@ -154,7 +164,7 @@ import { toFinalIndex } from './restoredCells.mjs';
|
|
|
154
164
|
const length = mapper.getNumberOfIndexes();
|
|
155
165
|
const values = new Array(length).fill(false);
|
|
156
166
|
physicalIndexes.forEach((physicalIndex)=>{
|
|
157
|
-
const finalIndex =
|
|
167
|
+
const finalIndex = toRestoredIndex(physicalIndex, axis);
|
|
158
168
|
if (finalIndex !== null && finalIndex < length) {
|
|
159
169
|
values[finalIndex] = true;
|
|
160
170
|
}
|
|
@@ -687,14 +697,16 @@ import { toFinalIndex } from './restoredCells.mjs';
|
|
|
687
697
|
return false;
|
|
688
698
|
}
|
|
689
699
|
announceRowChanges(hot, rowChanges, source);
|
|
700
|
+
const toRestoredIndex = createRestoredIndexMapper(record.journal, direction);
|
|
690
701
|
// Only what the step changed is written back, so a change made outside any step since survives.
|
|
691
702
|
tracker.restore(target, {
|
|
692
703
|
changedFrom: other,
|
|
693
704
|
base: current,
|
|
694
705
|
forceOrder: reordersForReplay,
|
|
695
|
-
direction
|
|
706
|
+
direction,
|
|
707
|
+
toRestoredIndex: reordersForReplay ? toRestoredIndex : undefined
|
|
696
708
|
});
|
|
697
|
-
applyKeptFlags(hot, keptFlags,
|
|
709
|
+
applyKeptFlags(hot, keptFlags, toRestoredIndex);
|
|
698
710
|
// A full render when the batch ends. A step that changed only cell meta asks for none itself, and
|
|
699
711
|
// the fast draw the batch ends with would keep every cell as it was painted.
|
|
700
712
|
hot.render();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HotInstance } from '../../../core/types';
|
|
2
|
+
import type { PluginRestoreContext } from '../../base';
|
|
2
3
|
import { type IndexMapperSnapshot } from '../../../translations/indexMapperSnapshot';
|
|
3
4
|
/**
|
|
4
5
|
* The table settings an action can change without going through a plugin: `alter()` shifts the
|
|
@@ -84,12 +85,15 @@ export declare class GridStateTracker {
|
|
|
84
85
|
* @param {boolean} [options.forceOrder=false] Write the row and column order and the trimming maps back
|
|
85
86
|
* even when the step did not change them – a replay reset them to the physical order.
|
|
86
87
|
* @param {string} [options.direction] `'undo'` or `'redo'`, handed to the plugins with `changedFrom`.
|
|
88
|
+
* @param {Function} [options.toRestoredIndex] Maps a physical index of `changedFrom` to the restored grid,
|
|
89
|
+
* handed to the plugins with `changedFrom` when `forceOrder` is set.
|
|
87
90
|
*/
|
|
88
|
-
restore(snapshot: GridStateSnapshot, { changedFrom, base, forceOrder, direction }?: {
|
|
91
|
+
restore(snapshot: GridStateSnapshot, { changedFrom, base, forceOrder, direction, toRestoredIndex }?: {
|
|
89
92
|
changedFrom?: GridStateSnapshot;
|
|
90
93
|
base?: GridStateSnapshot;
|
|
91
94
|
forceOrder?: boolean;
|
|
92
95
|
direction?: 'undo' | 'redo';
|
|
96
|
+
toRestoredIndex?: PluginRestoreContext['toRestoredIndex'];
|
|
93
97
|
}): void;
|
|
94
98
|
/**
|
|
95
99
|
* Resets the row and column order to the identity and lifts every trim, so a visual index names
|
|
@@ -219,7 +219,9 @@ class GridStateTracker {
|
|
|
219
219
|
* @param {boolean} [options.forceOrder=false] Write the row and column order and the trimming maps back
|
|
220
220
|
* even when the step did not change them – a replay reset them to the physical order.
|
|
221
221
|
* @param {string} [options.direction] `'undo'` or `'redo'`, handed to the plugins with `changedFrom`.
|
|
222
|
-
|
|
222
|
+
* @param {Function} [options.toRestoredIndex] Maps a physical index of `changedFrom` to the restored grid,
|
|
223
|
+
* handed to the plugins with `changedFrom` when `forceOrder` is set.
|
|
224
|
+
*/ restore(snapshot, { changedFrom, base, forceOrder = false, direction, toRestoredIndex } = {}) {
|
|
223
225
|
// Each axis takes the length the data implies, the one `updateData()` fits it to. With no source
|
|
224
226
|
// rows the data implies no column count (plain arrays count the columns in the first row), while
|
|
225
227
|
// the grid keeps its columns – the replay left them where the step recorded them.
|
|
@@ -242,7 +244,8 @@ class GridStateTracker {
|
|
|
242
244
|
plugin.restoreState(state, changedFrom === undefined ? undefined : {
|
|
243
245
|
other: changedFrom.plugins.get(name),
|
|
244
246
|
direction,
|
|
245
|
-
reordered: forceOrder
|
|
247
|
+
reordered: forceOrder,
|
|
248
|
+
toRestoredIndex
|
|
246
249
|
});
|
|
247
250
|
} else if (forceOrder && base?.plugins.has(name)) {
|
|
248
251
|
// The step left this state alone, but the row and column replay may have moved it (a merge
|
|
@@ -211,7 +211,9 @@ var /**
|
|
|
211
211
|
* @param {boolean} [options.forceOrder=false] Write the row and column order and the trimming maps back
|
|
212
212
|
* even when the step did not change them – a replay reset them to the physical order.
|
|
213
213
|
* @param {string} [options.direction] `'undo'` or `'redo'`, handed to the plugins with `changedFrom`.
|
|
214
|
-
|
|
214
|
+
* @param {Function} [options.toRestoredIndex] Maps a physical index of `changedFrom` to the restored grid,
|
|
215
|
+
* handed to the plugins with `changedFrom` when `forceOrder` is set.
|
|
216
|
+
*/ restore(snapshot, { changedFrom, base, forceOrder = false, direction, toRestoredIndex } = {}) {
|
|
215
217
|
// Each axis takes the length the data implies, the one `updateData()` fits it to. With no source
|
|
216
218
|
// rows the data implies no column count (plain arrays count the columns in the first row), while
|
|
217
219
|
// the grid keeps its columns – the replay left them where the step recorded them.
|
|
@@ -234,7 +236,8 @@ var /**
|
|
|
234
236
|
plugin.restoreState(state, changedFrom === undefined ? undefined : {
|
|
235
237
|
other: changedFrom.plugins.get(name),
|
|
236
238
|
direction,
|
|
237
|
-
reordered: forceOrder
|
|
239
|
+
reordered: forceOrder,
|
|
240
|
+
toRestoredIndex
|
|
238
241
|
});
|
|
239
242
|
} else if (forceOrder && base?.plugins.has(name)) {
|
|
240
243
|
// The step left this state alone, but the row and column replay may have moved it (a merge
|
package/styles/handsontable.css
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
|
27
27
|
*
|
|
28
|
-
* Version: 19.0.0
|
|
29
|
-
* Release date:
|
|
28
|
+
* Version: 19.0.0
|
|
29
|
+
* Release date: 26/11/2026 (built at 26/11/2026 12:22:31)
|
|
30
30
|
*/
|
|
31
31
|
div:where(.handsontable):not(p):not(p) span:where(.colHeader), div:where(.handsontable):not(p):not(p) span:where(.rowHeader), div:where(.handsontable):not(p):not(p) span:where(.ht-page-size-section__label), div:where(.handsontable):not(p):not(p) span:where(.ht-page-navigation-section__label), div:where(.handsontable):not(p):not(p) span:where(.ht-multi-select-arrow), div:where(.handsontable):not(p):not(p) span:where(.ht-multi-select-chip), div:where(.handsontable):not(p):not(p) span:where(.ht-multi-select-chip-label), div:where(.handsontable):not(p):not(p) span:where(.ht-multi-select-chip-remove), div:where(.handsontable):not(p):not(p) span:where(.ht-multi-select-overflow), div:where(.handsontable):not(p):not(p) span:where(.htUISelectCaptionLabel), div:where(.handsontable):not(p):not(p) span:where(.htCheckboxRendererBox), div:where(.handsontable):not(p):not(p) input:where(.htCheckboxRendererInput), div:where(.handsontable):not(p):not(p) span:where(.htCheckboxRendererLabelText), div:where(.handsontable):not(p):not(p) span:where(.ht_nestingLevel_empty), div:where(.handsontable):not(p):not(p) :where(.htUIInput) > input:where([type="text"], [type="date"], [type="datetime-local"], [type="time"], [type="button"]), div:where(.handsontable):not(p):not(p) :where(.htUIRadio) > input:where([type="radio"]), div:where(.handsontable):not(p):not(p) :where(.htItemWrapper) > span:where(.selected, .htMixed) {
|
|
32
32
|
padding: revert;
|