handsontable 14.1.0 → 14.2.0-next-4873a35-20240228
Sign up to get free protection for your applications and to get access to all the features.
- package/3rdparty/walkontable/src/core/_base.js +12 -0
- package/3rdparty/walkontable/src/core/_base.mjs +12 -0
- package/3rdparty/walkontable/src/scroll.js +131 -98
- package/3rdparty/walkontable/src/scroll.mjs +133 -100
- package/3rdparty/walkontable/src/selection/border/border.js +3 -3
- package/3rdparty/walkontable/src/selection/border/border.mjs +3 -3
- 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/CHANGELOG.md +38 -0
- 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.d.ts +1 -1
- package/core.js +11 -52
- package/core.mjs +12 -53
- package/dataMap/metaManager/index.js +1 -1
- package/dataMap/metaManager/index.mjs +1 -1
- package/dataMap/metaManager/metaLayers/cellMeta.js +6 -1
- package/dataMap/metaManager/metaLayers/cellMeta.mjs +6 -1
- package/dataMap/metaManager/metaSchema.js +36 -12
- package/dataMap/metaManager/metaSchema.mjs +36 -12
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +2996 -1928
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +42 -42
- package/dist/handsontable.js +2998 -1930
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +25 -25
- package/dist/languages/all.js +130 -25
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/hr-HR.js +167 -0
- package/dist/languages/hr-HR.min.js +1 -0
- package/editorManager.js +15 -4
- package/editorManager.mjs +15 -4
- package/editors/autocompleteEditor/autocompleteEditor.js +2 -2
- package/editors/autocompleteEditor/autocompleteEditor.mjs +2 -2
- package/editors/baseEditor/baseEditor.js +1 -1
- package/editors/baseEditor/baseEditor.mjs +1 -1
- package/editors/checkboxEditor/checkboxEditor.js +5 -4
- package/editors/checkboxEditor/checkboxEditor.mjs +5 -4
- package/editors/dateEditor/dateEditor.js +1 -1
- package/editors/dateEditor/dateEditor.mjs +1 -1
- package/editors/dropdownEditor/dropdownEditor.js +1 -1
- package/editors/dropdownEditor/dropdownEditor.mjs +1 -1
- package/editors/handsontableEditor/handsontableEditor.js +1 -1
- package/editors/handsontableEditor/handsontableEditor.mjs +1 -1
- package/editors/selectEditor/selectEditor.js +1 -1
- package/editors/selectEditor/selectEditor.mjs +1 -1
- package/editors/textEditor/textEditor.js +1 -2
- package/editors/textEditor/textEditor.mjs +1 -2
- package/editors/timeEditor/timeEditor.js +1 -1
- package/editors/timeEditor/timeEditor.mjs +1 -1
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/helpers/moves.js +86 -0
- package/helpers/moves.mjs +82 -0
- package/i18n/languages/hr-HR.js +96 -0
- package/i18n/languages/hr-HR.mjs +90 -0
- package/i18n/languages/index.js +2 -0
- package/i18n/languages/index.mjs +2 -1
- package/languages/all.js +130 -25
- package/languages/hr-HR.js +167 -0
- package/languages/hr-HR.mjs +92 -0
- package/languages/index.js +130 -25
- package/languages/index.mjs +2 -1
- package/package.json +11 -1
- package/pluginHooks.d.ts +4 -2
- package/pluginHooks.js +33 -3
- package/pluginHooks.mjs +33 -3
- package/plugins/autoColumnSize/autoColumnSize.js +6 -1
- package/plugins/autoColumnSize/autoColumnSize.mjs +6 -1
- package/plugins/autoRowSize/autoRowSize.js +5 -0
- package/plugins/autoRowSize/autoRowSize.mjs +5 -0
- package/plugins/autofill/autofill.js +3 -2
- package/plugins/autofill/autofill.mjs +3 -2
- package/plugins/dropdownMenu/dropdownMenu.js +58 -4
- package/plugins/dropdownMenu/dropdownMenu.mjs +58 -4
- package/plugins/filters/component/value.js +51 -5
- package/plugins/filters/component/value.mjs +51 -5
- package/plugins/filters/utils.js +1 -1
- package/plugins/filters/utils.mjs +1 -1
- package/plugins/formulas/formulas.js +10 -1
- package/plugins/formulas/formulas.mjs +10 -1
- package/plugins/formulas/indexSyncer/axisSyncer.js +3 -75
- package/plugins/formulas/indexSyncer/axisSyncer.mjs +3 -75
- package/plugins/manualColumnResize/manualColumnResize.js +3 -0
- package/plugins/manualColumnResize/manualColumnResize.mjs +3 -0
- package/plugins/mergeCells/cellsCollection.js +1 -1
- package/plugins/mergeCells/cellsCollection.mjs +1 -1
- package/plugins/mergeCells/mergeCells.js +30 -0
- package/plugins/mergeCells/mergeCells.mjs +30 -0
- package/plugins/undoRedo/undoRedo.js +61 -14
- package/plugins/undoRedo/undoRedo.mjs +61 -14
- package/renderers/autocompleteRenderer/autocompleteRenderer.js +1 -1
- package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -1
- package/renderers/baseRenderer/baseRenderer.js +1 -1
- package/renderers/baseRenderer/baseRenderer.mjs +1 -1
- package/renderers/checkboxRenderer/checkboxRenderer.js +36 -8
- package/renderers/checkboxRenderer/checkboxRenderer.mjs +36 -8
- package/renderers/dateRenderer/dateRenderer.js +1 -1
- package/renderers/dateRenderer/dateRenderer.mjs +1 -1
- package/renderers/dropdownRenderer/dropdownRenderer.js +1 -1
- package/renderers/dropdownRenderer/dropdownRenderer.mjs +1 -1
- package/renderers/handsontableRenderer/handsontableRenderer.js +1 -1
- package/renderers/handsontableRenderer/handsontableRenderer.mjs +1 -1
- package/renderers/htmlRenderer/htmlRenderer.js +1 -1
- package/renderers/htmlRenderer/htmlRenderer.mjs +1 -1
- package/renderers/numericRenderer/index.js +2 -1
- package/renderers/numericRenderer/index.mjs +1 -1
- package/renderers/numericRenderer/numericRenderer.js +28 -13
- package/renderers/numericRenderer/numericRenderer.mjs +27 -13
- package/renderers/passwordRenderer/passwordRenderer.js +1 -1
- package/renderers/passwordRenderer/passwordRenderer.mjs +1 -1
- package/renderers/selectRenderer/selectRenderer.js +1 -1
- package/renderers/selectRenderer/selectRenderer.mjs +1 -1
- package/renderers/textRenderer/textRenderer.js +1 -1
- package/renderers/textRenderer/textRenderer.mjs +1 -1
- package/renderers/timeRenderer/timeRenderer.js +1 -1
- package/renderers/timeRenderer/timeRenderer.mjs +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/shortcuts/recorder.js +27 -8
- package/shortcuts/recorder.mjs +27 -8
- package/tableView.js +86 -5
- package/tableView.mjs +87 -6
- package/utils/autoResize.js +0 -1
- package/utils/autoResize.mjs +0 -1
- package/utils/ghostTable.js +6 -6
- package/utils/ghostTable.mjs +6 -6
- package/utils/parseTable.js +9 -1
- package/utils/parseTable.mjs +9 -1
package/core.js
CHANGED
@@ -110,7 +110,6 @@ function Core(rootElement, userSettings) {
|
|
110
110
|
var _userSettings$layoutD,
|
111
111
|
_this = this;
|
112
112
|
let rootInstanceSymbol = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
113
|
-
let preventScrollingToCell = false;
|
114
113
|
let instance = this;
|
115
114
|
const eventManager = new _eventManager.default(instance);
|
116
115
|
let datamap;
|
@@ -118,6 +117,7 @@ function Core(rootElement, userSettings) {
|
|
118
117
|
let grid;
|
119
118
|
let editorManager;
|
120
119
|
let focusManager;
|
120
|
+
let viewportScroller;
|
121
121
|
let firstRun = true;
|
122
122
|
if ((0, _rootInstance.hasValidParameter)(rootInstanceSymbol)) {
|
123
123
|
(0, _rootInstance.registerAsRootInstance)(this);
|
@@ -307,7 +307,7 @@ function Core(rootElement, userSettings) {
|
|
307
307
|
};
|
308
308
|
this.columnIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
309
309
|
this.rowIndexMapper.addLocalHook('cacheUpdated', onIndexMapperCacheUpdate);
|
310
|
-
this.selection.addLocalHook('afterSetRangeEnd', cellCoords => {
|
310
|
+
this.selection.addLocalHook('afterSetRangeEnd', (cellCoords, isLastSelectionLayer) => {
|
311
311
|
const preventScrolling = (0, _object.createObjectPropListener)(false);
|
312
312
|
const selectionRange = this.selection.getSelectedRange();
|
313
313
|
const {
|
@@ -316,53 +316,12 @@ function Core(rootElement, userSettings) {
|
|
316
316
|
} = selectionRange.current();
|
317
317
|
const selectionLayerLevel = selectionRange.size() - 1;
|
318
318
|
this.runHooks('afterSelection', from.row, from.col, to.row, to.col, preventScrolling, selectionLayerLevel);
|
319
|
-
this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel);
|
320
|
-
|
321
|
-
|
322
|
-
if (preventScrollingToCell) {
|
323
|
-
scrollToCell = false;
|
324
|
-
}
|
325
|
-
if (preventScrolling.isTouched()) {
|
326
|
-
scrollToCell = !preventScrolling.value;
|
327
|
-
}
|
328
|
-
const currentSelectedRange = this.selection.selectedRange.current();
|
329
|
-
const isSelectedByAnyHeader = this.selection.isSelectedByAnyHeader();
|
330
|
-
const isSelectedByRowHeader = this.selection.isSelectedByRowHeader();
|
331
|
-
const isSelectedByColumnHeader = this.selection.isSelectedByColumnHeader();
|
332
|
-
if (scrollToCell !== false) {
|
333
|
-
if (!isSelectedByAnyHeader) {
|
334
|
-
if (currentSelectedRange && !this.selection.isMultiple()) {
|
335
|
-
const {
|
336
|
-
row,
|
337
|
-
col
|
338
|
-
} = currentSelectedRange.from;
|
339
|
-
if (row < 0 && col >= 0) {
|
340
|
-
this.scrollViewportTo({
|
341
|
-
col
|
342
|
-
});
|
343
|
-
} else if (col < 0 && row >= 0) {
|
344
|
-
this.scrollViewportTo({
|
345
|
-
row
|
346
|
-
});
|
347
|
-
} else {
|
348
|
-
this.scrollViewportTo({
|
349
|
-
row,
|
350
|
-
col
|
351
|
-
});
|
352
|
-
}
|
353
|
-
} else {
|
354
|
-
this.scrollViewportTo(cellCoords.toObject());
|
355
|
-
}
|
356
|
-
} else if (isSelectedByRowHeader) {
|
357
|
-
this.scrollViewportTo({
|
358
|
-
row: cellCoords.row
|
359
|
-
});
|
360
|
-
} else if (isSelectedByColumnHeader) {
|
361
|
-
this.scrollViewportTo({
|
362
|
-
col: cellCoords.col
|
363
|
-
});
|
364
|
-
}
|
319
|
+
this.runHooks('afterSelectionByProp', from.row, instance.colToProp(from.col), to.row, instance.colToProp(to.col), preventScrolling, selectionLayerLevel);
|
320
|
+
if (isLastSelectionLayer && (!preventScrolling.isTouched() || preventScrolling.isTouched() && !preventScrolling.value)) {
|
321
|
+
viewportScroller.scrollTo(cellCoords);
|
365
322
|
}
|
323
|
+
const isSelectedByRowHeader = selection.isSelectedByRowHeader();
|
324
|
+
const isSelectedByColumnHeader = selection.isSelectedByColumnHeader();
|
366
325
|
|
367
326
|
// @TODO: These CSS classes are no longer needed anymore. They are used only as a indicator of the selected
|
368
327
|
// rows/columns in the MergedCells plugin (via border.js#L520 in the walkontable module). After fixing
|
@@ -1098,6 +1057,7 @@ function Core(rootElement, userSettings) {
|
|
1098
1057
|
this.updateSettings(tableMeta, true);
|
1099
1058
|
this.view = new _tableView.default(this);
|
1100
1059
|
editorManager = _editorManager.default.getInstance(instance, tableMeta, selection);
|
1060
|
+
viewportScroller = (0, _index3.createViewportScroller)(instance);
|
1101
1061
|
focusManager = new _focusManager.FocusManager(instance);
|
1102
1062
|
if ((0, _rootInstance.isRootInstance)(this)) {
|
1103
1063
|
(0, _index3.installFocusCatcher)(instance);
|
@@ -3915,13 +3875,13 @@ function Core(rootElement, userSettings) {
|
|
3915
3875
|
let scrollToCell = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
3916
3876
|
let changeListener = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
3917
3877
|
if (scrollToCell === false) {
|
3918
|
-
|
3878
|
+
viewportScroller.suspend();
|
3919
3879
|
}
|
3920
3880
|
const wasSelected = selection.selectCells(coords);
|
3921
3881
|
if (wasSelected && changeListener) {
|
3922
3882
|
instance.listen();
|
3923
3883
|
}
|
3924
|
-
|
3884
|
+
viewportScroller.resume();
|
3925
3885
|
return wasSelected;
|
3926
3886
|
};
|
3927
3887
|
|
@@ -4053,9 +4013,8 @@ function Core(rootElement, userSettings) {
|
|
4053
4013
|
let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
4054
4014
|
let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : includeRowHeaders;
|
4055
4015
|
let options = arguments.length > 2 ? arguments[2] : undefined;
|
4056
|
-
|
4016
|
+
viewportScroller.skipNextScrollCycle();
|
4057
4017
|
selection.selectAll(includeRowHeaders, includeColumnHeaders, options);
|
4058
|
-
preventScrollingToCell = false;
|
4059
4018
|
};
|
4060
4019
|
const getIndexToScroll = (indexMapper, visualIndex) => {
|
4061
4020
|
// Looking for a visual index on the right and then (when not found) on the left.
|
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.
|
@@ -218,7 +218,7 @@ class MetaManager {
|
|
218
218
|
|
219
219
|
/**
|
220
220
|
* Returns all cell meta objects that were created during the Handsontable operation but for
|
221
|
-
*
|
221
|
+
* specific row index.
|
222
222
|
*
|
223
223
|
* @param {number} physicalRow The physical row index.
|
224
224
|
* @returns {object[]}
|
@@ -214,7 +214,7 @@ export default class MetaManager {
|
|
214
214
|
|
215
215
|
/**
|
216
216
|
* Returns all cell meta objects that were created during the Handsontable operation but for
|
217
|
-
*
|
217
|
+
* specific row index.
|
218
218
|
*
|
219
219
|
* @param {number} physicalRow The physical row index.
|
220
220
|
* @returns {object[]}
|
@@ -6,6 +6,7 @@ require("core-js/modules/es.error.cause.js");
|
|
6
6
|
var _object = require("../../../helpers/object");
|
7
7
|
var _utils = require("../utils");
|
8
8
|
var _lazyFactoryMap = _interopRequireDefault(require("../lazyFactoryMap"));
|
9
|
+
var _mixed = require("../../../helpers/mixed");
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
10
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; }
|
11
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
@@ -171,7 +172,11 @@ class CellMeta {
|
|
171
172
|
const metas = [];
|
172
173
|
const rows = Array.from(this.metas.values());
|
173
174
|
for (let row = 0; row < rows.length; row++) {
|
174
|
-
|
175
|
+
// Getting a meta for already added row (new row already exist - it has been added using `createRow` method).
|
176
|
+
// However, is not ready until the first `getMeta` call (lazy loading).
|
177
|
+
if ((0, _mixed.isDefined)(rows[row])) {
|
178
|
+
metas.push(...rows[row].values());
|
179
|
+
}
|
175
180
|
}
|
176
181
|
return metas;
|
177
182
|
}
|
@@ -6,6 +6,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
|
|
6
6
|
import { extend } from "../../../helpers/object.mjs";
|
7
7
|
import { extendByMetaType, assert, isUnsignedNumber } from "../utils.mjs";
|
8
8
|
import LazyFactoryMap from "../lazyFactoryMap.mjs";
|
9
|
+
import { isDefined } from "../../../helpers/mixed.mjs";
|
9
10
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
10
11
|
/**
|
11
12
|
* @class CellMeta
|
@@ -167,7 +168,11 @@ export default class CellMeta {
|
|
167
168
|
const metas = [];
|
168
169
|
const rows = Array.from(this.metas.values());
|
169
170
|
for (let row = 0; row < rows.length; row++) {
|
170
|
-
|
171
|
+
// Getting a meta for already added row (new row already exist - it has been added using `createRow` method).
|
172
|
+
// However, is not ready until the first `getMeta` call (lazy loading).
|
173
|
+
if (isDefined(rows[row])) {
|
174
|
+
metas.push(...rows[row].values());
|
175
|
+
}
|
171
176
|
}
|
172
177
|
return metas;
|
173
178
|
}
|
@@ -1169,9 +1169,9 @@ var _default = () => {
|
|
1169
1169
|
* ]
|
1170
1170
|
*
|
1171
1171
|
* // enable copying for specific cells
|
1172
|
-
*
|
1172
|
+
* cell: [
|
1173
1173
|
* {
|
1174
|
-
*
|
1174
|
+
* coll: 0,
|
1175
1175
|
* row: 0,
|
1176
1176
|
* // disable copying for cell (0, 0)
|
1177
1177
|
* copyable: false,
|
@@ -2217,7 +2217,7 @@ var _default = () => {
|
|
2217
2217
|
*
|
2218
2218
|
* formulas: {
|
2219
2219
|
* // set `engine` to a HyperFormula instance
|
2220
|
-
* engine:
|
2220
|
+
* engine: hyperformulaInstance,
|
2221
2221
|
* sheetId: 1,
|
2222
2222
|
* sheetName: 'Sheet 1'
|
2223
2223
|
* }
|
@@ -2226,7 +2226,7 @@ var _default = () => {
|
|
2226
2226
|
* formulas: {
|
2227
2227
|
* // set `engine` to a HyperFormula configuration object
|
2228
2228
|
* engine: {
|
2229
|
-
* hyperformula: HyperFormula // or `engine:
|
2229
|
+
* hyperformula: HyperFormula // or `engine: hyperformulaInstance`
|
2230
2230
|
* leapYear1900: false, // this option comes from HyperFormula
|
2231
2231
|
* // add more HyperFormula configuration options
|
2232
2232
|
* },
|
@@ -2257,7 +2257,7 @@ var _default = () => {
|
|
2257
2257
|
*
|
2258
2258
|
* You can set the `fragmentSelection` option to one of the following:
|
2259
2259
|
*
|
2260
|
-
* | Setting |
|
2260
|
+
* | Setting | Description |
|
2261
2261
|
* | ----------------- | ------------------------------------------------- |
|
2262
2262
|
* | `false` (default) | Disable text selection |
|
2263
2263
|
* | `true` | Enable text selection in multiple cells at a time |
|
@@ -3209,7 +3209,7 @@ var _default = () => {
|
|
3209
3209
|
* | `true` | Enable the [`NestedRows`](@/api/nestedRows.md) plugin |
|
3210
3210
|
*
|
3211
3211
|
* Read more:
|
3212
|
-
* - [Plugins: `NestedRows`](@/
|
3212
|
+
* - [Plugins: `NestedRows`](@/guides/rows/row-parent-child.md)
|
3213
3213
|
*
|
3214
3214
|
* @example
|
3215
3215
|
* ```js
|
@@ -3493,11 +3493,11 @@ var _default = () => {
|
|
3493
3493
|
preventWheel: false,
|
3494
3494
|
/**
|
3495
3495
|
* @description
|
3496
|
-
* The `readOnly` option determines whether a cell,
|
3497
|
-
*
|
3498
|
-
*
|
3496
|
+
* The `readOnly` option determines whether a [cell](@/guides/cell-features/disabled-cells.md#read-only-specific-cells),
|
3497
|
+
* [comment](@/guides/cell-features/comments.md#make-a-comment-read-only), [column](@/guides/cell-features/disabled-cells.md#read-only-columns)
|
3498
|
+
* or the [entire grid](@/guides/cell-features/disabled-cells.md#read-only-grid) is editable or not. You can configure it as follows:
|
3499
3499
|
*
|
3500
|
-
* | Setting |
|
3500
|
+
* | Setting | Description |
|
3501
3501
|
* | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
3502
3502
|
* | `false` (default) | Set as editable |
|
3503
3503
|
* | `true` | - Set as read-only<br>- Add the [`readOnlyCellClassName`](#readOnlyCellClassName) CSS class name (by default: `htDimmed`) |
|
@@ -3505,6 +3505,7 @@ var _default = () => {
|
|
3505
3505
|
* `readOnly` cells can't be changed by the [`populateFromArray()`](@/api/core.md#populatefromarray) method.
|
3506
3506
|
*
|
3507
3507
|
* Read more:
|
3508
|
+
* - [Disabled cells](@/guides/cell-features/disabled-cells.md)
|
3508
3509
|
* - [Configuration options: Cascading configuration](@/guides/getting-started/configuration-options.md#cascading-configuration)
|
3509
3510
|
*
|
3510
3511
|
* @memberof Options#
|
@@ -3514,8 +3515,31 @@ var _default = () => {
|
|
3514
3515
|
*
|
3515
3516
|
* @example
|
3516
3517
|
* ```js
|
3517
|
-
* //
|
3518
|
-
*
|
3518
|
+
* // make the entire grid read-only
|
3519
|
+
* const configurationOptions = {
|
3520
|
+
* columnSorting: true,
|
3521
|
+
* };
|
3522
|
+
*
|
3523
|
+
* // make the third column read-only
|
3524
|
+
* const configurationOptions = {
|
3525
|
+
* columns: [
|
3526
|
+
* {},
|
3527
|
+
* {},
|
3528
|
+
* {
|
3529
|
+
* readOnly: true,
|
3530
|
+
* },
|
3531
|
+
* ],
|
3532
|
+
* };
|
3533
|
+
*
|
3534
|
+
* // make a specific cell read-only
|
3535
|
+
* const configurationOptions = {
|
3536
|
+
* cell: [
|
3537
|
+
* {
|
3538
|
+
* row: 0,
|
3539
|
+
* col: 0,
|
3540
|
+
* readOnly: true,
|
3541
|
+
* },
|
3542
|
+
* };
|
3519
3543
|
* ```
|
3520
3544
|
*/
|
3521
3545
|
readOnly: false,
|
@@ -1166,9 +1166,9 @@ export default (() => {
|
|
1166
1166
|
* ]
|
1167
1167
|
*
|
1168
1168
|
* // enable copying for specific cells
|
1169
|
-
*
|
1169
|
+
* cell: [
|
1170
1170
|
* {
|
1171
|
-
*
|
1171
|
+
* coll: 0,
|
1172
1172
|
* row: 0,
|
1173
1173
|
* // disable copying for cell (0, 0)
|
1174
1174
|
* copyable: false,
|
@@ -2214,7 +2214,7 @@ export default (() => {
|
|
2214
2214
|
*
|
2215
2215
|
* formulas: {
|
2216
2216
|
* // set `engine` to a HyperFormula instance
|
2217
|
-
* engine:
|
2217
|
+
* engine: hyperformulaInstance,
|
2218
2218
|
* sheetId: 1,
|
2219
2219
|
* sheetName: 'Sheet 1'
|
2220
2220
|
* }
|
@@ -2223,7 +2223,7 @@ export default (() => {
|
|
2223
2223
|
* formulas: {
|
2224
2224
|
* // set `engine` to a HyperFormula configuration object
|
2225
2225
|
* engine: {
|
2226
|
-
* hyperformula: HyperFormula // or `engine:
|
2226
|
+
* hyperformula: HyperFormula // or `engine: hyperformulaInstance`
|
2227
2227
|
* leapYear1900: false, // this option comes from HyperFormula
|
2228
2228
|
* // add more HyperFormula configuration options
|
2229
2229
|
* },
|
@@ -2254,7 +2254,7 @@ export default (() => {
|
|
2254
2254
|
*
|
2255
2255
|
* You can set the `fragmentSelection` option to one of the following:
|
2256
2256
|
*
|
2257
|
-
* | Setting |
|
2257
|
+
* | Setting | Description |
|
2258
2258
|
* | ----------------- | ------------------------------------------------- |
|
2259
2259
|
* | `false` (default) | Disable text selection |
|
2260
2260
|
* | `true` | Enable text selection in multiple cells at a time |
|
@@ -3206,7 +3206,7 @@ export default (() => {
|
|
3206
3206
|
* | `true` | Enable the [`NestedRows`](@/api/nestedRows.md) plugin |
|
3207
3207
|
*
|
3208
3208
|
* Read more:
|
3209
|
-
* - [Plugins: `NestedRows`](@/
|
3209
|
+
* - [Plugins: `NestedRows`](@/guides/rows/row-parent-child.md)
|
3210
3210
|
*
|
3211
3211
|
* @example
|
3212
3212
|
* ```js
|
@@ -3490,11 +3490,11 @@ export default (() => {
|
|
3490
3490
|
preventWheel: false,
|
3491
3491
|
/**
|
3492
3492
|
* @description
|
3493
|
-
* The `readOnly` option determines whether a cell,
|
3494
|
-
*
|
3495
|
-
*
|
3493
|
+
* The `readOnly` option determines whether a [cell](@/guides/cell-features/disabled-cells.md#read-only-specific-cells),
|
3494
|
+
* [comment](@/guides/cell-features/comments.md#make-a-comment-read-only), [column](@/guides/cell-features/disabled-cells.md#read-only-columns)
|
3495
|
+
* or the [entire grid](@/guides/cell-features/disabled-cells.md#read-only-grid) is editable or not. You can configure it as follows:
|
3496
3496
|
*
|
3497
|
-
* | Setting |
|
3497
|
+
* | Setting | Description |
|
3498
3498
|
* | ----------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
3499
3499
|
* | `false` (default) | Set as editable |
|
3500
3500
|
* | `true` | - Set as read-only<br>- Add the [`readOnlyCellClassName`](#readOnlyCellClassName) CSS class name (by default: `htDimmed`) |
|
@@ -3502,6 +3502,7 @@ export default (() => {
|
|
3502
3502
|
* `readOnly` cells can't be changed by the [`populateFromArray()`](@/api/core.md#populatefromarray) method.
|
3503
3503
|
*
|
3504
3504
|
* Read more:
|
3505
|
+
* - [Disabled cells](@/guides/cell-features/disabled-cells.md)
|
3505
3506
|
* - [Configuration options: Cascading configuration](@/guides/getting-started/configuration-options.md#cascading-configuration)
|
3506
3507
|
*
|
3507
3508
|
* @memberof Options#
|
@@ -3511,8 +3512,31 @@ export default (() => {
|
|
3511
3512
|
*
|
3512
3513
|
* @example
|
3513
3514
|
* ```js
|
3514
|
-
* //
|
3515
|
-
*
|
3515
|
+
* // make the entire grid read-only
|
3516
|
+
* const configurationOptions = {
|
3517
|
+
* columnSorting: true,
|
3518
|
+
* };
|
3519
|
+
*
|
3520
|
+
* // make the third column read-only
|
3521
|
+
* const configurationOptions = {
|
3522
|
+
* columns: [
|
3523
|
+
* {},
|
3524
|
+
* {},
|
3525
|
+
* {
|
3526
|
+
* readOnly: true,
|
3527
|
+
* },
|
3528
|
+
* ],
|
3529
|
+
* };
|
3530
|
+
*
|
3531
|
+
* // make a specific cell read-only
|
3532
|
+
* const configurationOptions = {
|
3533
|
+
* cell: [
|
3534
|
+
* {
|
3535
|
+
* row: 0,
|
3536
|
+
* col: 0,
|
3537
|
+
* readOnly: true,
|
3538
|
+
* },
|
3539
|
+
* };
|
3516
3540
|
* ```
|
3517
3541
|
*/
|
3518
3542
|
readOnly: false,
|
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: 14.
|
29
|
-
* Release date:
|
28
|
+
* Version: 14.2.0-next-4873a35-20240228
|
29
|
+
* Release date: 06/03/2024 (built at 28/02/2024 15:23:13)
|
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: 14.
|
29
|
-
* Release date:
|
28
|
+
* Version: 14.2.0-next-4873a35-20240228
|
29
|
+
* Release date: 06/03/2024 (built at 28/02/2024 15:23:13)
|
30
30
|
*/
|
31
31
|
/**
|
32
32
|
* Fix for bootstrap styles
|