handsontable 0.0.0-next-d82e84a-20240117 → 0.0.0-next-4418964-20240119
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 +12 -0
- package/3rdparty/walkontable/src/core/_base.mjs +12 -0
- package/3rdparty/walkontable/src/scroll.js +125 -98
- package/3rdparty/walkontable/src/scroll.mjs +127 -100
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.js +26 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedColumns.mjs +26 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.js +26 -0
- package/3rdparty/walkontable/src/table/mixin/calculatedRows.mjs +26 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.js +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyColumnsStart.mjs +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.js +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsBottom.mjs +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.js +20 -0
- package/3rdparty/walkontable/src/table/mixin/stickyRowsTop.mjs +20 -0
- package/3rdparty/walkontable/src/table.js +2 -0
- package/3rdparty/walkontable/src/table.mjs +2 -0
- package/3rdparty/walkontable/src/viewport.js +9 -0
- package/3rdparty/walkontable/src/viewport.mjs +10 -1
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/index.js +6 -0
- package/core/index.mjs +2 -1
- package/core/viewportScroll/index.js +65 -0
- package/core/viewportScroll/index.mjs +61 -0
- package/core/viewportScroll/scrollStrategies/columnHeaderScroll.js +20 -0
- package/core/viewportScroll/scrollStrategies/columnHeaderScroll.mjs +16 -0
- package/core/viewportScroll/scrollStrategies/cornerHeaderScroll.js +14 -0
- package/core/viewportScroll/scrollStrategies/cornerHeaderScroll.mjs +10 -0
- package/core/viewportScroll/scrollStrategies/multipleScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/multipleScroll.mjs +11 -0
- package/core/viewportScroll/scrollStrategies/noncontiguousScroll.js +15 -0
- package/core/viewportScroll/scrollStrategies/noncontiguousScroll.mjs +11 -0
- package/core/viewportScroll/scrollStrategies/rowHeaderScroll.js +20 -0
- package/core/viewportScroll/scrollStrategies/rowHeaderScroll.mjs +16 -0
- package/core/viewportScroll/scrollStrategies/singleScroll.js +46 -0
- package/core/viewportScroll/scrollStrategies/singleScroll.mjs +42 -0
- package/core.js +11 -52
- package/core.mjs +12 -53
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +1578 -1074
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +41 -41
- package/dist/handsontable.js +1580 -1076
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +25 -25
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/selection/mouseEventHandler.js +4 -0
- package/selection/mouseEventHandler.mjs +4 -0
- package/selection/selection.js +64 -5
- package/selection/selection.mjs +64 -5
- package/tableView.js +76 -0
- package/tableView.mjs +76 -0
package/core.mjs
CHANGED
@@ -28,7 +28,7 @@ import { hasLanguageDictionary, getValidLanguageCode, getTranslatedPhrase } from
|
|
28
28
|
import { warnUserAboutLanguageRegistration, normalizeLanguageCode } from "./i18n/utils.mjs";
|
29
29
|
import { Selection } from "./selection/index.mjs";
|
30
30
|
import { MetaManager, DynamicCellMetaMod, ExtendMetaPropertiesMod, replaceData } from "./dataMap/index.mjs";
|
31
|
-
import { installFocusCatcher } from "./core/index.mjs";
|
31
|
+
import { installFocusCatcher, createViewportScroller } from "./core/index.mjs";
|
32
32
|
import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
|
33
33
|
import { createShortcutManager } from "./shortcuts/index.mjs";
|
34
34
|
import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
|
@@ -105,7 +105,6 @@ export default function Core(rootElement, userSettings) {
|
|
105
105
|
var _userSettings$layoutD,
|
106
106
|
_this = this;
|
107
107
|
let rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
108
|
-
let preventScrollingToCell = false;
|
109
108
|
let instance = this;
|
110
109
|
const eventManager = new EventManager(instance);
|
111
110
|
let datamap;
|
@@ -113,6 +112,7 @@ export default function Core(rootElement, userSettings) {
|
|
113
112
|
let grid;
|
114
113
|
let editorManager;
|
115
114
|
let focusManager;
|
115
|
+
let viewportScroller;
|
116
116
|
let firstRun = true;
|
117
117
|
if (hasValidParameter(rootInstanceSymbol)) {
|
118
118
|
registerAsRootInstance(this);
|
@@ -302,7 +302,7 @@ export default function Core(rootElement, userSettings) {
|
|
302
302
|
};
|
303
303
|
this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
304
304
|
this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
305
|
-
this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
|
305
|
+
this.selection.addLocalHook('afterSetRangeEnd', (cellCoords, isLastSelectionLayer) => {
|
306
306
|
const preventScrolling = createObjectPropListener(false);
|
307
307
|
const selectionRange = this.selection.getSelectedRange();
|
308
308
|
const {
|
@@ -311,53 +311,12 @@ export default function Core(rootElement, userSettings) {
|
|
311
311
|
} = selectionRange.current();
|
312
312
|
const selectionLayerLevel = selectionRange.size() - 1;
|
313
313
|
this.runHooks('afterSelection', from.row, from.col, to.row, to.col, preventScrolling, selectionLayerLevel);
|
314
|
-
this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel);
|
315
|
-
|
316
|
-
|
317
|
-
if (preventScrollingToCell) {
|
318
|
-
scrollToCell = false;
|
319
|
-
}
|
320
|
-
if (preventScrolling.isTouched()) {
|
321
|
-
scrollToCell = !preventScrolling.value;
|
322
|
-
}
|
323
|
-
const currentSelectedRange = this.selection.selectedRange.current();
|
324
|
-
const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
|
325
|
-
const isSelectedByRowHeader = this.selection.isSelectedByRowHeader();
|
326
|
-
const isSelectedByColumnHeader = this.selection.isSelectedByColumnHeader();
|
327
|
-
if (scrollToCell !== false) {
|
328
|
-
if (!isSelectedByAnyHeader) {
|
329
|
-
if (currentSelectedRange && !this.selection.isMultiple()) {
|
330
|
-
const {
|
331
|
-
row,
|
332
|
-
col
|
333
|
-
} = currentSelectedRange.from;
|
334
|
-
if (row < 0 && col >= 0) {
|
335
|
-
this.scrollViewportTo({
|
336
|
-
col
|
337
|
-
});
|
338
|
-
} else if (col < 0 && row >= 0) {
|
339
|
-
this.scrollViewportTo({
|
340
|
-
row
|
341
|
-
});
|
342
|
-
} else {
|
343
|
-
this.scrollViewportTo({
|
344
|
-
row,
|
345
|
-
col
|
346
|
-
});
|
347
|
-
}
|
348
|
-
} else {
|
349
|
-
this.scrollViewportTo(cellCoords.toObject());
|
350
|
-
}
|
351
|
-
} else if (isSelectedByRowHeader) {
|
352
|
-
this.scrollViewportTo({
|
353
|
-
row: cellCoords.row
|
354
|
-
});
|
355
|
-
} else if (isSelectedByColumnHeader) {
|
356
|
-
this.scrollViewportTo({
|
357
|
-
col: cellCoords.col
|
358
|
-
});
|
359
|
-
}
|
314
|
+
this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel);
|
315
|
+
if (isLastSelectionLayer && (!preventScrolling.isTouched() || preventScrolling.isTouched() && !preventScrolling.value)) {
|
316
|
+
viewportScroller.scrollTo(cellCoords);
|
360
317
|
}
|
318
|
+
const isSelectedByRowHeader = selection.isSelectedByRowHeader();
|
319
|
+
const isSelectedByColumnHeader = selection.isSelectedByColumnHeader();
|
361
320
|
|
362
321
|
// @TODO: These CSS classes are no longer needed anymore. They are used only as a indicator of the selected
|
363
322
|
// rows/columns in the MergedCells plugin (via border.js#L520 in the walkontable module). After fixing
|
@@ -1093,6 +1052,7 @@ export default function Core(rootElement, userSettings) {
|
|
1093
1052
|
this.updateSettings(tableMeta, true);
|
1094
1053
|
this.view = new TableView(this);
|
1095
1054
|
editorManager = EditorManager.getInstance(instance, tableMeta, selection);
|
1055
|
+
viewportScroller = createViewportScroller(instance);
|
1096
1056
|
focusManager = new FocusManager(instance);
|
1097
1057
|
if (isRootInstance(this)) {
|
1098
1058
|
installFocusCatcher(instance);
|
@@ -3910,13 +3870,13 @@ export default function Core(rootElement, userSettings) {
|
|
3910
3870
|
let scrollToCell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
3911
3871
|
let changeListener = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
3912
3872
|
if (scrollToCell === false) {
|
3913
|
-
|
3873
|
+
viewportScroller.suspend();
|
3914
3874
|
}
|
3915
3875
|
const wasSelected = selection.selectCells(coords);
|
3916
3876
|
if (wasSelected && changeListener) {
|
3917
3877
|
instance.listen();
|
3918
3878
|
}
|
3919
|
-
|
3879
|
+
viewportScroller.resume();
|
3920
3880
|
return wasSelected;
|
3921
3881
|
};
|
3922
3882
|
|
@@ -4048,9 +4008,8 @@ export default function Core(rootElement, userSettings) {
|
|
4048
4008
|
let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
4049
4009
|
let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
|
4050
4010
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
4051
|
-
|
4011
|
+
viewportScroller.skipNextScrollCycle();
|
4052
4012
|
selection.selectAll(includeRowHeaders, includeColumnHeaders, options);
|
4053
|
-
preventScrollingToCell = false;
|
4054
4013
|
};
|
4055
4014
|
const getIndexToScroll = (indexMapper, visualIndex) => {
|
4056
4015
|
// Looking for a visual index on the right and then (when not found) on the left.
|
package/dist/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: 16/01/2024 (built at
|
28
|
+
* Version: 0.0.0-next-4418964-20240119
|
29
|
+
* Release date: 16/01/2024 (built at 19/01/2024 10:19:40)
|
30
30
|
*/
|
31
31
|
/**
|
32
32
|
* Fix for bootstrap styles
|
@@ -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: 16/01/2024 (built at
|
28
|
+
* Version: 0.0.0-next-4418964-20240119
|
29
|
+
* Release date: 16/01/2024 (built at 19/01/2024 10:19:40)
|
30
30
|
*/
|
31
31
|
/**
|
32
32
|
* Fix for bootstrap styles
|