handsontable 0.0.0-next-ff10728-20250410 → 0.0.0-next-9410a76-20250416
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.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/cell/range.js +14 -0
- package/3rdparty/walkontable/src/cell/range.mjs +14 -0
- package/3rdparty/walkontable/src/renderer/rowHeaders.js +4 -1
- package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
- package/3rdparty/walkontable/src/selection/border/border.js +5 -0
- package/3rdparty/walkontable/src/selection/border/border.mjs +5 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +8 -10
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +8 -10
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +3 -4
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +3 -4
- package/3rdparty/walkontable/src/table.js +5 -2
- package/3rdparty/walkontable/src/table.mjs +5 -2
- package/CHANGELOG.md +39 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/focusDetector.js +1 -1
- package/core/focusCatcher/focusDetector.mjs +2 -2
- package/core/hooks/constants.js +8 -0
- package/core/hooks/constants.mjs +8 -0
- package/core/hooks/index.d.ts +1 -0
- package/core.d.ts +0 -1
- package/core.js +32 -25
- package/core.mjs +33 -26
- package/dataMap/dataMap.js +0 -7
- package/dataMap/dataMap.mjs +0 -7
- package/dataMap/metaManager/metaSchema.js +1 -0
- package/dataMap/metaManager/metaSchema.mjs +1 -0
- package/dist/handsontable.css +3 -3
- package/dist/handsontable.full.css +3 -3
- package/dist/handsontable.full.js +437 -350
- package/dist/handsontable.full.min.css +3 -3
- package/dist/handsontable.full.min.js +17 -17
- package/dist/handsontable.js +437 -350
- package/dist/handsontable.min.css +3 -3
- package/dist/handsontable.min.js +18 -18
- package/editorManager.js +1 -7
- package/editorManager.mjs +1 -7
- package/editors/autocompleteEditor/autocompleteEditor.js +14 -4
- package/editors/autocompleteEditor/autocompleteEditor.mjs +14 -4
- package/editors/textEditor/textEditor.js +1 -1
- package/editors/textEditor/textEditor.mjs +2 -2
- package/helpers/browser.js +1 -1
- package/helpers/browser.mjs +1 -1
- package/helpers/dom/element.js +2 -2
- package/helpers/dom/element.mjs +1 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/object.js +3 -0
- package/helpers/object.mjs +3 -0
- package/package.json +1 -1
- package/plugins/autoColumnSize/autoColumnSize.js +1 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +1 -1
- package/plugins/autoRowSize/autoRowSize.js +1 -6
- package/plugins/autoRowSize/autoRowSize.mjs +1 -6
- package/plugins/columnSorting/columnSorting.js +0 -4
- package/plugins/columnSorting/columnSorting.mjs +0 -4
- package/plugins/comments/comments.js +1 -0
- package/plugins/comments/comments.mjs +1 -0
- package/plugins/contextMenu/menu/defaultShortcutsList.js +2 -2
- package/plugins/contextMenu/menu/defaultShortcutsList.mjs +2 -2
- package/plugins/contextMenu/menu/menu.js +1 -0
- package/plugins/contextMenu/menu/menu.mjs +1 -0
- package/plugins/contextMenu/menu/positioner.js +10 -2
- package/plugins/contextMenu/menu/positioner.mjs +10 -2
- package/plugins/copyPaste/copyPaste.js +12 -15
- package/plugins/copyPaste/copyPaste.mjs +13 -16
- package/plugins/copyPaste/pasteEvent.js +3 -0
- package/plugins/copyPaste/pasteEvent.mjs +3 -0
- package/plugins/filters/filters.js +25 -24
- package/plugins/filters/filters.mjs +25 -24
- package/plugins/filters/ui/multipleSelect.js +7 -1
- package/plugins/filters/ui/multipleSelect.mjs +7 -1
- package/plugins/hiddenColumns/hiddenColumns.js +1 -1
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -1
- package/plugins/hiddenRows/hiddenRows.js +1 -1
- package/plugins/hiddenRows/hiddenRows.mjs +1 -1
- package/plugins/manualColumnResize/manualColumnResize.js +4 -6
- package/plugins/manualColumnResize/manualColumnResize.mjs +4 -6
- package/plugins/manualRowResize/manualRowResize.js +4 -6
- package/plugins/manualRowResize/manualRowResize.mjs +4 -6
- package/plugins/mergeCells/mergeCells.js +8 -29
- package/plugins/mergeCells/mergeCells.mjs +8 -29
- package/plugins/mergeCells/renderer.js +15 -0
- package/plugins/mergeCells/renderer.mjs +15 -0
- package/plugins/mergeCells/utils.js +31 -0
- package/plugins/mergeCells/utils.mjs +27 -0
- package/plugins/nestedRows/data/dataManager.js +2 -2
- package/plugins/nestedRows/data/dataManager.mjs +2 -2
- package/plugins/undoRedo/actions/removeColumn.js +19 -14
- package/plugins/undoRedo/actions/removeColumn.mjs +19 -14
- package/plugins/undoRedo/actions/removeRow.js +12 -4
- package/plugins/undoRedo/actions/removeRow.mjs +12 -4
- package/selection/selection.js +3 -1
- package/selection/selection.mjs +3 -1
- package/styles/handsontable.css +14 -15
- package/styles/handsontable.min.css +3 -3
- package/styles/ht-theme-horizon.css +2 -2
- package/styles/ht-theme-horizon.min.css +2 -2
- package/styles/ht-theme-main.css +2 -2
- package/styles/ht-theme-main.min.css +2 -2
- package/tableView.js +5 -8
- package/tableView.mjs +5 -8
- package/utils/ghostTable.js +3 -0
- package/utils/ghostTable.mjs +3 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { isObject } from "../../helpers/object.mjs";
|
|
2
|
+
import { isSafari } from "../../helpers/browser.mjs";
|
|
3
|
+
import { sumCellsHeights } from "./utils.mjs";
|
|
2
4
|
/**
|
|
3
5
|
* Creates a renderer object for the `MergeCells` plugin.
|
|
4
6
|
*
|
|
@@ -14,6 +16,7 @@ export function createMergeCellRenderer(plugin) {
|
|
|
14
16
|
rowIndexMapper: rowMapper,
|
|
15
17
|
columnIndexMapper: columnMapper
|
|
16
18
|
} = hot;
|
|
19
|
+
const updateNextCellsHeight = new Map();
|
|
17
20
|
|
|
18
21
|
/**
|
|
19
22
|
* Runs before the cell is rendered.
|
|
@@ -35,6 +38,10 @@ export function createMergeCellRenderer(plugin) {
|
|
|
35
38
|
if (!isObject(mergedCell)) {
|
|
36
39
|
TD.removeAttribute('rowspan');
|
|
37
40
|
TD.removeAttribute('colspan');
|
|
41
|
+
if (isSafari() && updateNextCellsHeight.has(row) && !hot.getSettings().rowHeaders) {
|
|
42
|
+
TD.style.height = `${updateNextCellsHeight.get(row)}px`;
|
|
43
|
+
updateNextCellsHeight.delete(row);
|
|
44
|
+
}
|
|
38
45
|
TD.style.display = '';
|
|
39
46
|
return;
|
|
40
47
|
}
|
|
@@ -46,6 +53,14 @@ export function createMergeCellRenderer(plugin) {
|
|
|
46
53
|
} = mergedCell;
|
|
47
54
|
const [lastMergedRowIndex, lastMergedColumnIndex] = plugin.translateMergedCellToRenderable(origRow, origRowspan, origColumn, origColspan);
|
|
48
55
|
const isVirtualRenderingEnabled = plugin.getSetting('virtualized');
|
|
56
|
+
|
|
57
|
+
// Safari bug fix - the height of the cells next to the merged cell must be defined
|
|
58
|
+
// so that their height is proportional to the height of the merged cell
|
|
59
|
+
// (this emulates default behavior in Chrome, FF etc.)
|
|
60
|
+
if (isSafari() && origColumn === 0 && !hot.getSettings().rowHeaders) {
|
|
61
|
+
const height = sumCellsHeights(hot, origRow, origRowspan);
|
|
62
|
+
updateNextCellsHeight.set(row, height / origRowspan);
|
|
63
|
+
}
|
|
49
64
|
const renderedRowIndex = rowMapper.getRenderableFromVisualIndex(row);
|
|
50
65
|
const renderedColumnIndex = columnMapper.getRenderableFromVisualIndex(col);
|
|
51
66
|
const maxRowSpan = lastMergedRowIndex - renderedRowIndex + 1; // Number of rendered columns.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.sumCellsHeights = sumCellsHeights;
|
|
5
|
+
/**
|
|
6
|
+
* Calculates the total height of the merged cell.
|
|
7
|
+
*
|
|
8
|
+
* @param {Core} hotInstance The Handsontable instance.
|
|
9
|
+
* @param {*} row The merged cell's row index.
|
|
10
|
+
* @param {*} rowspan The merged cell height.
|
|
11
|
+
* @returns {number}
|
|
12
|
+
*/
|
|
13
|
+
function sumCellsHeights(hotInstance, row, rowspan) {
|
|
14
|
+
const {
|
|
15
|
+
view,
|
|
16
|
+
rowIndexMapper
|
|
17
|
+
} = hotInstance;
|
|
18
|
+
const stylesHandler = view.getStylesHandler();
|
|
19
|
+
const defaultHeight = view.getDefaultRowHeight();
|
|
20
|
+
let height = 0;
|
|
21
|
+
for (let i = row; i < row + rowspan; i++) {
|
|
22
|
+
if (!rowIndexMapper.isHidden(i)) {
|
|
23
|
+
var _hotInstance$getRowHe;
|
|
24
|
+
height += (_hotInstance$getRowHe = hotInstance.getRowHeight(i)) !== null && _hotInstance$getRowHe !== void 0 ? _hotInstance$getRowHe : defaultHeight;
|
|
25
|
+
if (i === 0 && !stylesHandler.isClassicTheme()) {
|
|
26
|
+
height += 1; // border-top-width
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return height;
|
|
31
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calculates the total height of the merged cell.
|
|
3
|
+
*
|
|
4
|
+
* @param {Core} hotInstance The Handsontable instance.
|
|
5
|
+
* @param {*} row The merged cell's row index.
|
|
6
|
+
* @param {*} rowspan The merged cell height.
|
|
7
|
+
* @returns {number}
|
|
8
|
+
*/
|
|
9
|
+
export function sumCellsHeights(hotInstance, row, rowspan) {
|
|
10
|
+
const {
|
|
11
|
+
view,
|
|
12
|
+
rowIndexMapper
|
|
13
|
+
} = hotInstance;
|
|
14
|
+
const stylesHandler = view.getStylesHandler();
|
|
15
|
+
const defaultHeight = view.getDefaultRowHeight();
|
|
16
|
+
let height = 0;
|
|
17
|
+
for (let i = row; i < row + rowspan; i++) {
|
|
18
|
+
if (!rowIndexMapper.isHidden(i)) {
|
|
19
|
+
var _hotInstance$getRowHe;
|
|
20
|
+
height += (_hotInstance$getRowHe = hotInstance.getRowHeight(i)) !== null && _hotInstance$getRowHe !== void 0 ? _hotInstance$getRowHe : defaultHeight;
|
|
21
|
+
if (i === 0 && !stylesHandler.isClassicTheme()) {
|
|
22
|
+
height += 1; // border-top-width
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return height;
|
|
27
|
+
}
|
|
@@ -627,7 +627,7 @@ class DataManager {
|
|
|
627
627
|
*/
|
|
628
628
|
syncRowWithRawSource(rowElement) {
|
|
629
629
|
let upmostParent = rowElement;
|
|
630
|
-
let tempParent =
|
|
630
|
+
let tempParent = upmostParent;
|
|
631
631
|
do {
|
|
632
632
|
tempParent = this.getRowParent(tempParent);
|
|
633
633
|
if (tempParent !== null) {
|
|
@@ -635,7 +635,7 @@ class DataManager {
|
|
|
635
635
|
}
|
|
636
636
|
} while (tempParent !== null);
|
|
637
637
|
this.plugin.disableCoreAPIModifiers();
|
|
638
|
-
this.hot.setSourceDataAtCell(this.
|
|
638
|
+
this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(upmostParent), '__children', upmostParent.__children, 'NestedRows.syncRowWithRawSource');
|
|
639
639
|
this.plugin.enableCoreAPIModifiers();
|
|
640
640
|
}
|
|
641
641
|
|
|
@@ -624,7 +624,7 @@ class DataManager {
|
|
|
624
624
|
*/
|
|
625
625
|
syncRowWithRawSource(rowElement) {
|
|
626
626
|
let upmostParent = rowElement;
|
|
627
|
-
let tempParent =
|
|
627
|
+
let tempParent = upmostParent;
|
|
628
628
|
do {
|
|
629
629
|
tempParent = this.getRowParent(tempParent);
|
|
630
630
|
if (tempParent !== null) {
|
|
@@ -632,7 +632,7 @@ class DataManager {
|
|
|
632
632
|
}
|
|
633
633
|
} while (tempParent !== null);
|
|
634
634
|
this.plugin.disableCoreAPIModifiers();
|
|
635
|
-
this.hot.setSourceDataAtCell(this.
|
|
635
|
+
this.hot.setSourceDataAtCell(this.getRowIndexWithinParent(upmostParent), '__children', upmostParent.__children, 'NestedRows.syncRowWithRawSource');
|
|
636
636
|
this.plugin.enableCoreAPIModifiers();
|
|
637
637
|
}
|
|
638
638
|
|
|
@@ -37,7 +37,7 @@ class RemoveColumnAction extends _base.BaseAction {
|
|
|
37
37
|
*/
|
|
38
38
|
_defineProperty(this, "index", void 0);
|
|
39
39
|
/**
|
|
40
|
-
* @param {number[]} indexes The
|
|
40
|
+
* @param {number[]} indexes The physical column indexes.
|
|
41
41
|
*/
|
|
42
42
|
_defineProperty(this, "indexes", void 0);
|
|
43
43
|
/**
|
|
@@ -103,16 +103,14 @@ class RemoveColumnAction extends _base.BaseAction {
|
|
|
103
103
|
headers.push(hot.getSettings().colHeaders[hot.toPhysicalColumn(columnIndex + i)] || null);
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
const columnsMap = hot.columnIndexMapper.getIndexesSequence();
|
|
107
|
-
const rowsMap = hot.rowIndexMapper.getIndexesSequence();
|
|
108
106
|
return new RemoveColumnAction({
|
|
109
107
|
index: columnIndex,
|
|
110
108
|
indexes,
|
|
111
109
|
data: removedData,
|
|
112
110
|
amount,
|
|
113
111
|
headers,
|
|
114
|
-
columnPositions:
|
|
115
|
-
rowPositions:
|
|
112
|
+
columnPositions: hot.columnIndexMapper.getIndexesSequence(),
|
|
113
|
+
rowPositions: hot.rowIndexMapper.getIndexesSequence(),
|
|
116
114
|
fixedColumnsStart: hot.getSettings().fixedColumnsStart,
|
|
117
115
|
removedCellMetas: (0, _utils.getCellMetas)(hot, 0, hot.countRows(), columnIndex, lastColumnIndex)
|
|
118
116
|
});
|
|
@@ -139,14 +137,27 @@ class RemoveColumnAction extends _base.BaseAction {
|
|
|
139
137
|
}
|
|
140
138
|
const sortedHeaders = (0, _array.arrayMap)(this.headers, sortByIndexes);
|
|
141
139
|
const changes = [];
|
|
142
|
-
|
|
140
|
+
|
|
141
|
+
// The indexes sequence have to be applied twice.
|
|
142
|
+
// * First for proper index translation. The alter method accepts a visual index
|
|
143
|
+
// and we are able to retrieve the correct index indicating where to add a new row based
|
|
144
|
+
// only on the previous order state of the columns;
|
|
145
|
+
// * The alter method shifts the indexes (a side-effect), so we need to reapply the indexes sequence
|
|
146
|
+
// the same as it was in the previous state;
|
|
147
|
+
hot.columnIndexMapper.setIndexesSequence(this.columnPositions);
|
|
148
|
+
hot.alter('insert_col_start', hot.toVisualColumn(this.indexes[0]), this.indexes.length, 'UndoRedo.undo');
|
|
149
|
+
hot.batchExecution(() => {
|
|
150
|
+
// Restore row sequence in a case when all columns are removed. the original
|
|
151
|
+
// row sequence is lost in that case.
|
|
152
|
+
hot.rowIndexMapper.setIndexesSequence(this.rowPositions);
|
|
153
|
+
hot.columnIndexMapper.setIndexesSequence(this.columnPositions);
|
|
154
|
+
}, true);
|
|
143
155
|
(0, _array.arrayEach)(hot.getSourceDataArray(), (rowData, rowIndex) => {
|
|
144
156
|
(0, _array.arrayEach)(ascendingIndexes, (changedIndex, contiquesIndex) => {
|
|
145
157
|
rowData[changedIndex] = sortedData[rowIndex][contiquesIndex];
|
|
146
158
|
changes.push([rowIndex, changedIndex, rowData[changedIndex]]);
|
|
147
159
|
});
|
|
148
160
|
});
|
|
149
|
-
hot.setSourceDataAtCell(changes, undefined, undefined, 'UndoRedo.undo');
|
|
150
161
|
if (typeof this.headers !== 'undefined') {
|
|
151
162
|
(0, _array.arrayEach)(sortedHeaders, (headerData, columnIndex) => {
|
|
152
163
|
hot.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData;
|
|
@@ -156,14 +167,8 @@ class RemoveColumnAction extends _base.BaseAction {
|
|
|
156
167
|
let [rowIndex, columnIndex, cellMeta] = _ref2;
|
|
157
168
|
hot.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
|
158
169
|
});
|
|
159
|
-
hot.batchExecution(() => {
|
|
160
|
-
// Restore row sequence in a case when all columns are removed. the original
|
|
161
|
-
// row sequence is lost in that case.
|
|
162
|
-
hot.rowIndexMapper.setIndexesSequence(this.rowPositions);
|
|
163
|
-
hot.columnIndexMapper.setIndexesSequence(this.columnPositions);
|
|
164
|
-
}, true);
|
|
165
170
|
hot.addHookOnce('afterViewRender', undoneCallback);
|
|
166
|
-
hot.
|
|
171
|
+
hot.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
/**
|
|
@@ -34,7 +34,7 @@ export class RemoveColumnAction extends BaseAction {
|
|
|
34
34
|
*/
|
|
35
35
|
_defineProperty(this, "index", void 0);
|
|
36
36
|
/**
|
|
37
|
-
* @param {number[]} indexes The
|
|
37
|
+
* @param {number[]} indexes The physical column indexes.
|
|
38
38
|
*/
|
|
39
39
|
_defineProperty(this, "indexes", void 0);
|
|
40
40
|
/**
|
|
@@ -100,16 +100,14 @@ export class RemoveColumnAction extends BaseAction {
|
|
|
100
100
|
headers.push(hot.getSettings().colHeaders[hot.toPhysicalColumn(columnIndex + i)] || null);
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
|
-
const columnsMap = hot.columnIndexMapper.getIndexesSequence();
|
|
104
|
-
const rowsMap = hot.rowIndexMapper.getIndexesSequence();
|
|
105
103
|
return new RemoveColumnAction({
|
|
106
104
|
index: columnIndex,
|
|
107
105
|
indexes,
|
|
108
106
|
data: removedData,
|
|
109
107
|
amount,
|
|
110
108
|
headers,
|
|
111
|
-
columnPositions:
|
|
112
|
-
rowPositions:
|
|
109
|
+
columnPositions: hot.columnIndexMapper.getIndexesSequence(),
|
|
110
|
+
rowPositions: hot.rowIndexMapper.getIndexesSequence(),
|
|
113
111
|
fixedColumnsStart: hot.getSettings().fixedColumnsStart,
|
|
114
112
|
removedCellMetas: getCellMetas(hot, 0, hot.countRows(), columnIndex, lastColumnIndex)
|
|
115
113
|
});
|
|
@@ -136,14 +134,27 @@ export class RemoveColumnAction extends BaseAction {
|
|
|
136
134
|
}
|
|
137
135
|
const sortedHeaders = arrayMap(this.headers, sortByIndexes);
|
|
138
136
|
const changes = [];
|
|
139
|
-
|
|
137
|
+
|
|
138
|
+
// The indexes sequence have to be applied twice.
|
|
139
|
+
// * First for proper index translation. The alter method accepts a visual index
|
|
140
|
+
// and we are able to retrieve the correct index indicating where to add a new row based
|
|
141
|
+
// only on the previous order state of the columns;
|
|
142
|
+
// * The alter method shifts the indexes (a side-effect), so we need to reapply the indexes sequence
|
|
143
|
+
// the same as it was in the previous state;
|
|
144
|
+
hot.columnIndexMapper.setIndexesSequence(this.columnPositions);
|
|
145
|
+
hot.alter('insert_col_start', hot.toVisualColumn(this.indexes[0]), this.indexes.length, 'UndoRedo.undo');
|
|
146
|
+
hot.batchExecution(() => {
|
|
147
|
+
// Restore row sequence in a case when all columns are removed. the original
|
|
148
|
+
// row sequence is lost in that case.
|
|
149
|
+
hot.rowIndexMapper.setIndexesSequence(this.rowPositions);
|
|
150
|
+
hot.columnIndexMapper.setIndexesSequence(this.columnPositions);
|
|
151
|
+
}, true);
|
|
140
152
|
arrayEach(hot.getSourceDataArray(), (rowData, rowIndex) => {
|
|
141
153
|
arrayEach(ascendingIndexes, (changedIndex, contiquesIndex) => {
|
|
142
154
|
rowData[changedIndex] = sortedData[rowIndex][contiquesIndex];
|
|
143
155
|
changes.push([rowIndex, changedIndex, rowData[changedIndex]]);
|
|
144
156
|
});
|
|
145
157
|
});
|
|
146
|
-
hot.setSourceDataAtCell(changes, undefined, undefined, 'UndoRedo.undo');
|
|
147
158
|
if (typeof this.headers !== 'undefined') {
|
|
148
159
|
arrayEach(sortedHeaders, (headerData, columnIndex) => {
|
|
149
160
|
hot.getSettings().colHeaders[ascendingIndexes[columnIndex]] = headerData;
|
|
@@ -153,14 +164,8 @@ export class RemoveColumnAction extends BaseAction {
|
|
|
153
164
|
let [rowIndex, columnIndex, cellMeta] = _ref2;
|
|
154
165
|
hot.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
|
155
166
|
});
|
|
156
|
-
hot.batchExecution(() => {
|
|
157
|
-
// Restore row sequence in a case when all columns are removed. the original
|
|
158
|
-
// row sequence is lost in that case.
|
|
159
|
-
hot.rowIndexMapper.setIndexesSequence(this.rowPositions);
|
|
160
|
-
hot.columnIndexMapper.setIndexesSequence(this.columnPositions);
|
|
161
|
-
}, true);
|
|
162
167
|
hot.addHookOnce('afterViewRender', undoneCallback);
|
|
163
|
-
hot.
|
|
168
|
+
hot.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
|
|
164
169
|
}
|
|
165
170
|
|
|
166
171
|
/**
|
|
@@ -29,7 +29,7 @@ class RemoveRowAction extends _base.BaseAction {
|
|
|
29
29
|
} = _ref;
|
|
30
30
|
super('remove_row');
|
|
31
31
|
/**
|
|
32
|
-
* @param {number} index The
|
|
32
|
+
* @param {number} index The physical row index.
|
|
33
33
|
*/
|
|
34
34
|
_defineProperty(this, "index", void 0);
|
|
35
35
|
/**
|
|
@@ -97,14 +97,22 @@ class RemoveRowAction extends _base.BaseAction {
|
|
|
97
97
|
changes.push([this.index + rowIndexDelta, isNaN(columnIndex) ? columnProp : columnIndex, dataRow[columnProp]]);
|
|
98
98
|
});
|
|
99
99
|
});
|
|
100
|
-
|
|
100
|
+
|
|
101
|
+
// The indexes sequence have to be applied twice.
|
|
102
|
+
// * First for proper index translation. The alter method accepts a visual index
|
|
103
|
+
// and we are able to retrieve the correct index indicating where to add a new row based
|
|
104
|
+
// only on the previous order state of the rows;
|
|
105
|
+
// * The alter method shifts the indexes (a side-effect), so we need to reapply the indexes sequence
|
|
106
|
+
// the same as it was in the previous state;
|
|
107
|
+
hot.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
|
108
|
+
hot.alter('insert_row_above', hot.toVisualRow(this.index), this.data.length, 'UndoRedo.undo');
|
|
109
|
+
hot.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
|
101
110
|
this.removedCellMetas.forEach(_ref2 => {
|
|
102
111
|
let [rowIndex, columnIndex, cellMeta] = _ref2;
|
|
103
112
|
hot.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
|
104
113
|
});
|
|
105
114
|
hot.addHookOnce('afterViewRender', undoneCallback);
|
|
106
115
|
hot.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
|
|
107
|
-
hot.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
|
108
116
|
}
|
|
109
117
|
|
|
110
118
|
/**
|
|
@@ -113,7 +121,7 @@ class RemoveRowAction extends _base.BaseAction {
|
|
|
113
121
|
*/
|
|
114
122
|
redo(hot, redoneCallback) {
|
|
115
123
|
hot.addHookOnce('afterRemoveRow', redoneCallback);
|
|
116
|
-
hot.alter('remove_row', this.index, this.data.length, 'UndoRedo.redo');
|
|
124
|
+
hot.alter('remove_row', hot.toVisualRow(this.index), this.data.length, 'UndoRedo.redo');
|
|
117
125
|
}
|
|
118
126
|
}
|
|
119
127
|
exports.RemoveRowAction = RemoveRowAction;
|
|
@@ -26,7 +26,7 @@ export class RemoveRowAction extends BaseAction {
|
|
|
26
26
|
} = _ref;
|
|
27
27
|
super('remove_row');
|
|
28
28
|
/**
|
|
29
|
-
* @param {number} index The
|
|
29
|
+
* @param {number} index The physical row index.
|
|
30
30
|
*/
|
|
31
31
|
_defineProperty(this, "index", void 0);
|
|
32
32
|
/**
|
|
@@ -94,14 +94,22 @@ export class RemoveRowAction extends BaseAction {
|
|
|
94
94
|
changes.push([this.index + rowIndexDelta, isNaN(columnIndex) ? columnProp : columnIndex, dataRow[columnProp]]);
|
|
95
95
|
});
|
|
96
96
|
});
|
|
97
|
-
|
|
97
|
+
|
|
98
|
+
// The indexes sequence have to be applied twice.
|
|
99
|
+
// * First for proper index translation. The alter method accepts a visual index
|
|
100
|
+
// and we are able to retrieve the correct index indicating where to add a new row based
|
|
101
|
+
// only on the previous order state of the rows;
|
|
102
|
+
// * The alter method shifts the indexes (a side-effect), so we need to reapply the indexes sequence
|
|
103
|
+
// the same as it was in the previous state;
|
|
104
|
+
hot.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
|
105
|
+
hot.alter('insert_row_above', hot.toVisualRow(this.index), this.data.length, 'UndoRedo.undo');
|
|
106
|
+
hot.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
|
98
107
|
this.removedCellMetas.forEach(_ref2 => {
|
|
99
108
|
let [rowIndex, columnIndex, cellMeta] = _ref2;
|
|
100
109
|
hot.setCellMetaObject(rowIndex, columnIndex, cellMeta);
|
|
101
110
|
});
|
|
102
111
|
hot.addHookOnce('afterViewRender', undoneCallback);
|
|
103
112
|
hot.setSourceDataAtCell(changes, null, null, 'UndoRedo.undo');
|
|
104
|
-
hot.rowIndexMapper.setIndexesSequence(this.rowIndexesSequence);
|
|
105
113
|
}
|
|
106
114
|
|
|
107
115
|
/**
|
|
@@ -110,6 +118,6 @@ export class RemoveRowAction extends BaseAction {
|
|
|
110
118
|
*/
|
|
111
119
|
redo(hot, redoneCallback) {
|
|
112
120
|
hot.addHookOnce('afterRemoveRow', redoneCallback);
|
|
113
|
-
hot.alter('remove_row', this.index, this.data.length, 'UndoRedo.redo');
|
|
121
|
+
hot.alter('remove_row', hot.toVisualRow(this.index), this.data.length, 'UndoRedo.redo');
|
|
114
122
|
}
|
|
115
123
|
}
|
package/selection/selection.js
CHANGED
|
@@ -1192,7 +1192,9 @@ class Selection {
|
|
|
1192
1192
|
col: (0, _number.clamp)(to.col, 0, countColumns - 1)
|
|
1193
1193
|
});
|
|
1194
1194
|
this.selectedRange.ranges.push(range);
|
|
1195
|
-
this.highlight.
|
|
1195
|
+
if (this.highlight.isEnabledFor(_highlight.FOCUS_TYPE, this.selectedRange.current().highlight)) {
|
|
1196
|
+
this.highlight.getFocus().add(highlight).commit().syncWith(range);
|
|
1197
|
+
}
|
|
1196
1198
|
this.applyAndCommit(range);
|
|
1197
1199
|
}
|
|
1198
1200
|
|
package/selection/selection.mjs
CHANGED
|
@@ -1186,7 +1186,9 @@ class Selection {
|
|
|
1186
1186
|
col: clamp(to.col, 0, countColumns - 1)
|
|
1187
1187
|
});
|
|
1188
1188
|
this.selectedRange.ranges.push(range);
|
|
1189
|
-
this.highlight.
|
|
1189
|
+
if (this.highlight.isEnabledFor(FOCUS_TYPE, this.selectedRange.current().highlight)) {
|
|
1190
|
+
this.highlight.getFocus().add(highlight).commit().syncWith(range);
|
|
1191
|
+
}
|
|
1190
1192
|
this.applyAndCommit(range);
|
|
1191
1193
|
}
|
|
1192
1194
|
|
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: 0.0.0-next-
|
|
29
|
-
* Release date:
|
|
28
|
+
* Version: 0.0.0-next-9410a76-20250416
|
|
29
|
+
* Release date: 19/03/2025 (built at 16/04/2025 06:18:15)
|
|
30
30
|
*/
|
|
31
31
|
.ht-wrapper:not([class*=ht-theme]) {
|
|
32
32
|
--ht-gap-size: 4px;
|
|
@@ -85,14 +85,16 @@
|
|
|
85
85
|
.handsontable.htGhostTable table thead th {
|
|
86
86
|
border-bottom-width: 0;
|
|
87
87
|
}
|
|
88
|
-
.handsontable.htGhostTable table tbody tr
|
|
89
|
-
.handsontable.htGhostTable table tbody tr
|
|
88
|
+
.handsontable.htGhostTable table tbody tr th,
|
|
89
|
+
.handsontable.htGhostTable table tbody tr td {
|
|
90
90
|
border-top-width: 0;
|
|
91
|
-
}
|
|
92
|
-
.handsontable.htGhostTable table tbody tr:first-of-type th,
|
|
93
|
-
.handsontable.htGhostTable table tbody tr:first-of-type td {
|
|
94
91
|
height: calc(var(--ht-cell-vertical-padding) * 2 + var(--ht-line-height) + 1px);
|
|
95
92
|
}
|
|
93
|
+
.handsontable.htGhostTable table.htGhostTableFirstRow tbody tr th,
|
|
94
|
+
.handsontable.htGhostTable table.htGhostTableFirstRow tbody tr td {
|
|
95
|
+
border-top-width: 1px;
|
|
96
|
+
height: calc(var(--ht-cell-vertical-padding) * 2 + var(--ht-line-height) + 2px);
|
|
97
|
+
}
|
|
96
98
|
.handsontable.htHasScrollX .ht_master .wtHolder, .handsontable.htHasScrollY .ht_master .wtHolder {
|
|
97
99
|
background-color: var(--ht-background-color);
|
|
98
100
|
border-radius: var(--ht-wrapper-border-radius, 0);
|
|
@@ -1785,9 +1787,6 @@
|
|
|
1785
1787
|
.handsontable.htDropdownMenu table tbody tr td .htUIButton input, .handsontable.htContextMenu table tbody tr td .htUIButton input, .handsontable.htFiltersConditionsMenu table tbody tr td .htUIButton input {
|
|
1786
1788
|
width: 100%;
|
|
1787
1789
|
}
|
|
1788
|
-
.handsontable.htContextMenuSub_Alignment, .handsontable.htDropdownMenuSub_Alignment {
|
|
1789
|
-
margin-top: calc(var(--ht-menu-vertical-padding) * -1);
|
|
1790
|
-
}
|
|
1791
1790
|
.handsontable .htUIClearAll a,
|
|
1792
1791
|
.handsontable .htUISelectAll a {
|
|
1793
1792
|
padding: var(--ht-gap-size);
|
|
@@ -1909,7 +1908,7 @@
|
|
|
1909
1908
|
outline: 1px solid var(--ht-link-hover-color);
|
|
1910
1909
|
}
|
|
1911
1910
|
.handsontable .htUIMultipleSelect .ht_master .wtHolder {
|
|
1912
|
-
overflow
|
|
1911
|
+
overflow: auto;
|
|
1913
1912
|
}
|
|
1914
1913
|
.handsontable .htUIMultipleSelect .ht_master .wtHolder .wtHider,
|
|
1915
1914
|
.handsontable .htUIMultipleSelect .ht_master .wtHolder .htCore,
|
|
@@ -1962,20 +1961,20 @@
|
|
|
1962
1961
|
background-color: var(--ht-comments-textarea-focus-background-color, #ffffff);
|
|
1963
1962
|
}
|
|
1964
1963
|
|
|
1965
|
-
.handsontable .columnSorting {
|
|
1964
|
+
.handsontable .columnSorting:not(.indicatorDisabled) {
|
|
1966
1965
|
position: relative;
|
|
1967
1966
|
}
|
|
1968
|
-
.handsontable .columnSorting.sortAction {
|
|
1967
|
+
.handsontable .columnSorting:not(.indicatorDisabled).sortAction {
|
|
1969
1968
|
padding-inline-start: calc(var(--ht-icon-size, 16px) + 2px);
|
|
1970
1969
|
padding-inline-end: calc(var(--ht-icon-size, 16px) + 2px);
|
|
1971
1970
|
min-width: calc(var(--ht-icon-size, 16px) + 8px);
|
|
1972
1971
|
max-width: calc(100% - var(--ht-icon-size, 16px) * 2 - 4px);
|
|
1973
1972
|
}
|
|
1974
|
-
.handsontable .columnSorting.sortAction:hover {
|
|
1973
|
+
.handsontable .columnSorting:not(.indicatorDisabled).sortAction:hover {
|
|
1975
1974
|
text-decoration: none;
|
|
1976
1975
|
cursor: pointer;
|
|
1977
1976
|
}
|
|
1978
|
-
.handsontable .columnSorting.sortAction::before {
|
|
1977
|
+
.handsontable .columnSorting:not(.indicatorDisabled).sortAction::before {
|
|
1979
1978
|
content: "";
|
|
1980
1979
|
display: block;
|
|
1981
1980
|
width: var(--ht-icon-size, 16px);
|