handsontable 0.0.0-next-1af4e47-20241125 → 0.0.0-next-c3d40ad-20241127
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/core/_base.js +19 -23
- package/3rdparty/walkontable/src/core/_base.mjs +19 -23
- package/3rdparty/walkontable/src/facade/core.js +6 -6
- package/3rdparty/walkontable/src/facade/core.mjs +6 -6
- package/3rdparty/walkontable/src/scroll.js +46 -37
- package/3rdparty/walkontable/src/scroll.mjs +46 -37
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/hooks/constants.js +7 -0
- package/core/hooks/constants.mjs +7 -0
- package/core/hooks/index.d.ts +2 -2
- package/core.js +3 -17
- package/core.mjs +3 -17
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +181 -218
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +11 -11
- package/dist/handsontable.js +181 -218
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +33 -33
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/plugins/contextMenu/predefinedItems/alignment.js +7 -84
- package/plugins/contextMenu/predefinedItems/alignment.mjs +8 -85
- package/plugins/contextMenu/utils.js +0 -10
- package/plugins/contextMenu/utils.mjs +0 -9
- package/plugins/nestedHeaders/nestedHeaders.js +60 -15
- package/plugins/nestedHeaders/nestedHeaders.mjs +60 -15
- package/selection/selection.js +4 -2
- package/selection/selection.mjs +4 -2
- package/tableView.js +23 -18
- package/tableView.mjs +23 -18
package/selection/selection.mjs
CHANGED
@@ -1202,9 +1202,11 @@ class Selection {
|
|
1202
1202
|
if (!this.isSelected()) {
|
1203
1203
|
return;
|
1204
1204
|
}
|
1205
|
-
const focusHighlight = this.highlight.getFocus();
|
1206
1205
|
const currentLayer = this.getLayerLevel();
|
1207
|
-
|
1206
|
+
const cellRange = this.selectedRange.current();
|
1207
|
+
if (this.highlight.isEnabledFor(FOCUS_TYPE, cellRange.highlight)) {
|
1208
|
+
this.highlight.getFocus().commit().syncWith(cellRange);
|
1209
|
+
}
|
1208
1210
|
|
1209
1211
|
// Rewriting rendered ranges going through all layers.
|
1210
1212
|
for (let layerLevel = 0; layerLevel < this.selectedRange.size(); layerLevel += 1) {
|
package/tableView.js
CHANGED
@@ -198,38 +198,43 @@ class TableView {
|
|
198
198
|
* Scroll viewport to a cell.
|
199
199
|
*
|
200
200
|
* @param {CellCoords} coords Renderable cell coordinates.
|
201
|
-
* @param {
|
202
|
-
*
|
203
|
-
*
|
204
|
-
* @param {
|
201
|
+
* @param {'auto' | 'start' | 'end'} [horizontalSnap] If `'start'`, viewport is scrolled to show
|
202
|
+
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
203
|
+
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
204
|
+
* @param {'auto' | 'top' | 'bottom'} [verticalSnap] If `'top'`, viewport is scrolled to show
|
205
|
+
* the cell on the top of the table. If `'bottom'`, viewport is scrolled to show the cell on the bottom of
|
206
|
+
* the table. When `'auto'`, the viewport is scrolled only when the row is outside of the viewport.
|
205
207
|
* @returns {boolean}
|
206
208
|
*/
|
207
|
-
scrollViewport(coords,
|
208
|
-
return this._wt.scrollViewport(coords,
|
209
|
+
scrollViewport(coords, horizontalSnap, verticalSnap) {
|
210
|
+
return this._wt.scrollViewport(coords, horizontalSnap, verticalSnap);
|
209
211
|
}
|
210
212
|
|
211
213
|
/**
|
212
214
|
* Scroll viewport to a column.
|
213
215
|
*
|
214
216
|
* @param {number} column Renderable column index.
|
215
|
-
* @param {
|
216
|
-
*
|
217
|
+
* @param {'auto' | 'start' | 'end'} [snap] If `'start'`, viewport is scrolled to show
|
218
|
+
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
219
|
+
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
217
220
|
* @returns {boolean}
|
218
221
|
*/
|
219
|
-
scrollViewportHorizontally(column,
|
220
|
-
return this._wt.scrollViewportHorizontally(column,
|
222
|
+
scrollViewportHorizontally(column, snap) {
|
223
|
+
return this._wt.scrollViewportHorizontally(column, snap);
|
221
224
|
}
|
222
225
|
|
223
226
|
/**
|
224
227
|
* Scroll viewport to a row.
|
225
228
|
*
|
226
229
|
* @param {number} row Renderable row index.
|
227
|
-
* @param {
|
228
|
-
*
|
230
|
+
* @param {'auto' | 'top' | 'bottom'} [snap] If `'top'`, viewport is scrolled to show
|
231
|
+
* the cell on the top of the table. If `'bottom'`, viewport is scrolled to show the cell on
|
232
|
+
* the bottom of the table. When `'auto'`, the viewport is scrolled only when the row is outside of
|
233
|
+
* the viewport.
|
229
234
|
* @returns {boolean}
|
230
235
|
*/
|
231
|
-
scrollViewportVertically(row,
|
232
|
-
return this._wt.scrollViewportVertically(row,
|
236
|
+
scrollViewportVertically(row, snap) {
|
237
|
+
return this._wt.scrollViewportVertically(row, snap);
|
233
238
|
}
|
234
239
|
|
235
240
|
/**
|
@@ -820,7 +825,7 @@ class TableView {
|
|
820
825
|
},
|
821
826
|
beforeDraw: (force, skipRender) => this.beforeRender(force, skipRender),
|
822
827
|
onDraw: force => this.afterRender(force),
|
823
|
-
onBeforeViewportScrollVertically: renderableRow => {
|
828
|
+
onBeforeViewportScrollVertically: (renderableRow, snapping) => {
|
824
829
|
const rowMapper = this.hot.rowIndexMapper;
|
825
830
|
const areColumnHeadersSelected = renderableRow < 0;
|
826
831
|
let visualRow = renderableRow;
|
@@ -832,14 +837,14 @@ class TableView {
|
|
832
837
|
return renderableRow;
|
833
838
|
}
|
834
839
|
}
|
835
|
-
visualRow = this.hot.runHooks('beforeViewportScrollVertically', visualRow);
|
840
|
+
visualRow = this.hot.runHooks('beforeViewportScrollVertically', visualRow, snapping);
|
836
841
|
this.hot.runHooks('beforeViewportScroll');
|
837
842
|
if (!areColumnHeadersSelected) {
|
838
843
|
return rowMapper.getRenderableFromVisualIndex(visualRow);
|
839
844
|
}
|
840
845
|
return visualRow;
|
841
846
|
},
|
842
|
-
onBeforeViewportScrollHorizontally: renderableColumn => {
|
847
|
+
onBeforeViewportScrollHorizontally: (renderableColumn, snapping) => {
|
843
848
|
const columnMapper = this.hot.columnIndexMapper;
|
844
849
|
const areRowHeadersSelected = renderableColumn < 0;
|
845
850
|
let visualColumn = renderableColumn;
|
@@ -851,7 +856,7 @@ class TableView {
|
|
851
856
|
return renderableColumn;
|
852
857
|
}
|
853
858
|
}
|
854
|
-
visualColumn = this.hot.runHooks('beforeViewportScrollHorizontally', visualColumn);
|
859
|
+
visualColumn = this.hot.runHooks('beforeViewportScrollHorizontally', visualColumn, snapping);
|
855
860
|
this.hot.runHooks('beforeViewportScroll');
|
856
861
|
if (!areRowHeadersSelected) {
|
857
862
|
return columnMapper.getRenderableFromVisualIndex(visualColumn);
|
package/tableView.mjs
CHANGED
@@ -194,38 +194,43 @@ class TableView {
|
|
194
194
|
* Scroll viewport to a cell.
|
195
195
|
*
|
196
196
|
* @param {CellCoords} coords Renderable cell coordinates.
|
197
|
-
* @param {
|
198
|
-
*
|
199
|
-
*
|
200
|
-
* @param {
|
197
|
+
* @param {'auto' | 'start' | 'end'} [horizontalSnap] If `'start'`, viewport is scrolled to show
|
198
|
+
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
199
|
+
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
200
|
+
* @param {'auto' | 'top' | 'bottom'} [verticalSnap] If `'top'`, viewport is scrolled to show
|
201
|
+
* the cell on the top of the table. If `'bottom'`, viewport is scrolled to show the cell on the bottom of
|
202
|
+
* the table. When `'auto'`, the viewport is scrolled only when the row is outside of the viewport.
|
201
203
|
* @returns {boolean}
|
202
204
|
*/
|
203
|
-
scrollViewport(coords,
|
204
|
-
return this._wt.scrollViewport(coords,
|
205
|
+
scrollViewport(coords, horizontalSnap, verticalSnap) {
|
206
|
+
return this._wt.scrollViewport(coords, horizontalSnap, verticalSnap);
|
205
207
|
}
|
206
208
|
|
207
209
|
/**
|
208
210
|
* Scroll viewport to a column.
|
209
211
|
*
|
210
212
|
* @param {number} column Renderable column index.
|
211
|
-
* @param {
|
212
|
-
*
|
213
|
+
* @param {'auto' | 'start' | 'end'} [snap] If `'start'`, viewport is scrolled to show
|
214
|
+
* the cell on the left of the table. If `'end'`, viewport is scrolled to show the cell on the right of
|
215
|
+
* the table. When `'auto'`, the viewport is scrolled only when the column is outside of the viewport.
|
213
216
|
* @returns {boolean}
|
214
217
|
*/
|
215
|
-
scrollViewportHorizontally(column,
|
216
|
-
return this._wt.scrollViewportHorizontally(column,
|
218
|
+
scrollViewportHorizontally(column, snap) {
|
219
|
+
return this._wt.scrollViewportHorizontally(column, snap);
|
217
220
|
}
|
218
221
|
|
219
222
|
/**
|
220
223
|
* Scroll viewport to a row.
|
221
224
|
*
|
222
225
|
* @param {number} row Renderable row index.
|
223
|
-
* @param {
|
224
|
-
*
|
226
|
+
* @param {'auto' | 'top' | 'bottom'} [snap] If `'top'`, viewport is scrolled to show
|
227
|
+
* the cell on the top of the table. If `'bottom'`, viewport is scrolled to show the cell on
|
228
|
+
* the bottom of the table. When `'auto'`, the viewport is scrolled only when the row is outside of
|
229
|
+
* the viewport.
|
225
230
|
* @returns {boolean}
|
226
231
|
*/
|
227
|
-
scrollViewportVertically(row,
|
228
|
-
return this._wt.scrollViewportVertically(row,
|
232
|
+
scrollViewportVertically(row, snap) {
|
233
|
+
return this._wt.scrollViewportVertically(row, snap);
|
229
234
|
}
|
230
235
|
|
231
236
|
/**
|
@@ -816,7 +821,7 @@ class TableView {
|
|
816
821
|
},
|
817
822
|
beforeDraw: (force, skipRender) => this.beforeRender(force, skipRender),
|
818
823
|
onDraw: force => this.afterRender(force),
|
819
|
-
onBeforeViewportScrollVertically: renderableRow => {
|
824
|
+
onBeforeViewportScrollVertically: (renderableRow, snapping) => {
|
820
825
|
const rowMapper = this.hot.rowIndexMapper;
|
821
826
|
const areColumnHeadersSelected = renderableRow < 0;
|
822
827
|
let visualRow = renderableRow;
|
@@ -828,14 +833,14 @@ class TableView {
|
|
828
833
|
return renderableRow;
|
829
834
|
}
|
830
835
|
}
|
831
|
-
visualRow = this.hot.runHooks('beforeViewportScrollVertically', visualRow);
|
836
|
+
visualRow = this.hot.runHooks('beforeViewportScrollVertically', visualRow, snapping);
|
832
837
|
this.hot.runHooks('beforeViewportScroll');
|
833
838
|
if (!areColumnHeadersSelected) {
|
834
839
|
return rowMapper.getRenderableFromVisualIndex(visualRow);
|
835
840
|
}
|
836
841
|
return visualRow;
|
837
842
|
},
|
838
|
-
onBeforeViewportScrollHorizontally: renderableColumn => {
|
843
|
+
onBeforeViewportScrollHorizontally: (renderableColumn, snapping) => {
|
839
844
|
const columnMapper = this.hot.columnIndexMapper;
|
840
845
|
const areRowHeadersSelected = renderableColumn < 0;
|
841
846
|
let visualColumn = renderableColumn;
|
@@ -847,7 +852,7 @@ class TableView {
|
|
847
852
|
return renderableColumn;
|
848
853
|
}
|
849
854
|
}
|
850
|
-
visualColumn = this.hot.runHooks('beforeViewportScrollHorizontally', visualColumn);
|
855
|
+
visualColumn = this.hot.runHooks('beforeViewportScrollHorizontally', visualColumn, snapping);
|
851
856
|
this.hot.runHooks('beforeViewportScroll');
|
852
857
|
if (!areRowHeadersSelected) {
|
853
858
|
return columnMapper.getRenderableFromVisualIndex(visualColumn);
|