handsontable 0.0.0-next-49293f5-20240205 → 0.0.0-next-7a416a0-20240206

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.

Files changed (54) hide show
  1. package/base.js +2 -2
  2. package/base.mjs +2 -2
  3. package/core/viewportScroll/index.js +4 -1
  4. package/core/viewportScroll/index.mjs +4 -1
  5. package/core/viewportScroll/scrollStrategies/focusScroll.js +15 -0
  6. package/core/viewportScroll/scrollStrategies/focusScroll.mjs +11 -0
  7. package/core.js +14 -0
  8. package/core.mjs +14 -0
  9. package/dist/handsontable.css +2 -2
  10. package/dist/handsontable.full.css +2 -2
  11. package/dist/handsontable.full.js +1261 -1010
  12. package/dist/handsontable.full.min.css +2 -2
  13. package/dist/handsontable.full.min.js +48 -48
  14. package/dist/handsontable.js +1263 -1012
  15. package/dist/handsontable.min.css +2 -2
  16. package/dist/handsontable.min.js +32 -32
  17. package/editors/autocompleteEditor/autocompleteEditor.js +1 -1
  18. package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -1
  19. package/helpers/mixed.js +1 -1
  20. package/helpers/mixed.mjs +1 -1
  21. package/package.json +1 -1
  22. package/pluginHooks.d.ts +1 -0
  23. package/pluginHooks.js +43 -1
  24. package/pluginHooks.mjs +43 -1
  25. package/plugins/collapsibleColumns/collapsibleColumns.js +7 -1
  26. package/plugins/collapsibleColumns/collapsibleColumns.mjs +7 -1
  27. package/plugins/columnSorting/columnSorting.js +6 -0
  28. package/plugins/columnSorting/columnSorting.mjs +6 -0
  29. package/plugins/contextMenu/menu/defaultShortcutsList.js +26 -10
  30. package/plugins/contextMenu/menu/defaultShortcutsList.mjs +26 -10
  31. package/plugins/mergeCells/mergeCells.js +3 -1
  32. package/plugins/mergeCells/mergeCells.mjs +3 -1
  33. package/plugins/multiColumnSorting/multiColumnSorting.js +6 -0
  34. package/plugins/multiColumnSorting/multiColumnSorting.mjs +6 -0
  35. package/plugins/nestedHeaders/nestedHeaders.js +1 -0
  36. package/plugins/nestedHeaders/nestedHeaders.mjs +1 -0
  37. package/plugins/nestedRows/nestedRows.js +7 -1
  38. package/plugins/nestedRows/nestedRows.mjs +7 -1
  39. package/renderers/checkboxRenderer/checkboxRenderer.js +4 -4
  40. package/renderers/checkboxRenderer/checkboxRenderer.mjs +4 -4
  41. package/selection/selection.js +144 -30
  42. package/selection/selection.mjs +143 -29
  43. package/selection/transformation.js +18 -27
  44. package/selection/transformation.mjs +18 -27
  45. package/shortcutContexts/commands/editor/open.js +14 -0
  46. package/shortcutContexts/commands/editor/open.mjs +14 -0
  47. package/shortcutContexts/commands/moveCellSelection/inlineEnd.js +5 -1
  48. package/shortcutContexts/commands/moveCellSelection/inlineEnd.mjs +5 -1
  49. package/shortcutContexts/commands/moveCellSelection/inlineStart.js +5 -1
  50. package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +5 -1
  51. package/shortcutContexts/grid.js +2 -2
  52. package/shortcutContexts/grid.mjs +2 -2
  53. package/shortcuts/context.js +2 -1
  54. package/shortcuts/context.mjs +2 -1
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "05/02/2024 15:48:22";
49
- Handsontable.version = "0.0.0-next-49293f5-20240205";
48
+ Handsontable.buildDate = "06/02/2024 09:23:30";
49
+ Handsontable.version = "0.0.0-next-7a416a0-20240206";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "05/02/2024 15:48:29";
39
- Handsontable.version = "0.0.0-next-49293f5-20240205";
38
+ Handsontable.buildDate = "06/02/2024 09:23:36";
39
+ Handsontable.version = "0.0.0-next-7a416a0-20240206";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
@@ -4,6 +4,7 @@ exports.__esModule = true;
4
4
  exports.createViewportScroller = createViewportScroller;
5
5
  var _columnHeaderScroll = require("./scrollStrategies/columnHeaderScroll");
6
6
  var _cornerHeaderScroll = require("./scrollStrategies/cornerHeaderScroll");
7
+ var _focusScroll = require("./scrollStrategies/focusScroll");
7
8
  var _multipleScroll = require("./scrollStrategies/multipleScroll");
8
9
  var _noncontiguousScroll = require("./scrollStrategies/noncontiguousScroll");
9
10
  var _rowHeaderScroll = require("./scrollStrategies/rowHeaderScroll");
@@ -46,7 +47,9 @@ function createViewportScroller(hot) {
46
47
  return;
47
48
  }
48
49
  let scrollStrategy;
49
- if (selection.isSelectedByCorner()) {
50
+ if (selection.isFocusSelectionChanged()) {
51
+ scrollStrategy = (0, _focusScroll.focusScrollStrategy)(hot);
52
+ } else if (selection.isSelectedByCorner()) {
50
53
  scrollStrategy = (0, _cornerHeaderScroll.cornerHeaderScrollStrategy)(hot);
51
54
  } else if (selection.isSelectedByRowHeader()) {
52
55
  scrollStrategy = (0, _rowHeaderScroll.rowHeaderScrollStrategy)(hot);
@@ -1,5 +1,6 @@
1
1
  import { columnHeaderScrollStrategy } from "./scrollStrategies/columnHeaderScroll.mjs";
2
2
  import { cornerHeaderScrollStrategy } from "./scrollStrategies/cornerHeaderScroll.mjs";
3
+ import { focusScrollStrategy } from "./scrollStrategies/focusScroll.mjs";
3
4
  import { multipleScrollStrategy } from "./scrollStrategies/multipleScroll.mjs";
4
5
  import { noncontiguousScrollStrategy } from "./scrollStrategies/noncontiguousScroll.mjs";
5
6
  import { rowHeaderScrollStrategy } from "./scrollStrategies/rowHeaderScroll.mjs";
@@ -42,7 +43,9 @@ export function createViewportScroller(hot) {
42
43
  return;
43
44
  }
44
45
  let scrollStrategy;
45
- if (selection.isSelectedByCorner()) {
46
+ if (selection.isFocusSelectionChanged()) {
47
+ scrollStrategy = focusScrollStrategy(hot);
48
+ } else if (selection.isSelectedByCorner()) {
46
49
  scrollStrategy = cornerHeaderScrollStrategy(hot);
47
50
  } else if (selection.isSelectedByRowHeader()) {
48
51
  scrollStrategy = rowHeaderScrollStrategy(hot);
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports.focusScrollStrategy = focusScrollStrategy;
5
+ /**
6
+ * Scroll strategy for changed the focus position of the selection.
7
+ *
8
+ * @param {Core} hot Handsontable instance.
9
+ * @returns {function(): function(CellCoords): void}
10
+ */
11
+ function focusScrollStrategy(hot) {
12
+ return cellCoords => {
13
+ hot.scrollViewportTo(cellCoords.toObject());
14
+ };
15
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Scroll strategy for changed the focus position of the selection.
3
+ *
4
+ * @param {Core} hot Handsontable instance.
5
+ * @returns {function(): function(CellCoords): void}
6
+ */
7
+ export function focusScrollStrategy(hot) {
8
+ return cellCoords => {
9
+ hot.scrollViewportTo(cellCoords.toObject());
10
+ };
11
+ }
package/core.js CHANGED
@@ -284,6 +284,12 @@ function Core(rootElement, userSettings) {
284
284
  countRenderableRows: () => this.view.countRenderableRows(),
285
285
  countRowHeaders: () => this.countRowHeaders(),
286
286
  countColHeaders: () => this.countColHeaders(),
287
+ countRenderableRowsInRange: function () {
288
+ return _this.view.countRenderableRowsInRange(...arguments);
289
+ },
290
+ countRenderableColumnsInRange: function () {
291
+ return _this.view.countRenderableColumnsInRange(...arguments);
292
+ },
287
293
  getShortcutManager: () => instance.getShortcutManager(),
288
294
  createCellCoords: (row, column) => instance._createCellCoords(row, column),
289
295
  createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
@@ -339,6 +345,14 @@ function Core(rootElement, userSettings) {
339
345
  }
340
346
  this._refreshBorders(null);
341
347
  });
348
+ this.selection.addLocalHook('afterSetFocus', cellCoords => {
349
+ const preventScrolling = (0, _object.createObjectPropListener)(false);
350
+ this.runHooks('afterSelectionFocusSet', cellCoords.row, cellCoords.col, preventScrolling);
351
+ if (!preventScrolling.isTouched() || preventScrolling.isTouched() && !preventScrolling.value) {
352
+ viewportScroller.scrollTo(cellCoords);
353
+ }
354
+ this._refreshBorders(null);
355
+ });
342
356
  this.selection.addLocalHook('afterSelectionFinished', cellRanges => {
343
357
  const selectionLayerLevel = cellRanges.length - 1;
344
358
  const {
package/core.mjs CHANGED
@@ -279,6 +279,12 @@ export default function Core(rootElement, userSettings) {
279
279
  countRenderableRows: () => this.view.countRenderableRows(),
280
280
  countRowHeaders: () => this.countRowHeaders(),
281
281
  countColHeaders: () => this.countColHeaders(),
282
+ countRenderableRowsInRange: function () {
283
+ return _this.view.countRenderableRowsInRange(...arguments);
284
+ },
285
+ countRenderableColumnsInRange: function () {
286
+ return _this.view.countRenderableColumnsInRange(...arguments);
287
+ },
282
288
  getShortcutManager: () => instance.getShortcutManager(),
283
289
  createCellCoords: (row, column) => instance._createCellCoords(row, column),
284
290
  createCellRange: (highlight, from, to) => instance._createCellRange(highlight, from, to),
@@ -334,6 +340,14 @@ export default function Core(rootElement, userSettings) {
334
340
  }
335
341
  this._refreshBorders(null);
336
342
  });
343
+ this.selection.addLocalHook('afterSetFocus', cellCoords => {
344
+ const preventScrolling = createObjectPropListener(false);
345
+ this.runHooks('afterSelectionFocusSet', cellCoords.row, cellCoords.col, preventScrolling);
346
+ if (!preventScrolling.isTouched() || preventScrolling.isTouched() && !preventScrolling.value) {
347
+ viewportScroller.scrollTo(cellCoords);
348
+ }
349
+ this._refreshBorders(null);
350
+ });
337
351
  this.selection.addLocalHook('afterSelectionFinished', cellRanges => {
338
352
  const selectionLayerLevel = cellRanges.length - 1;
339
353
  const {
@@ -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-49293f5-20240205
29
- * Release date: 16/01/2024 (built at 05/02/2024 15:48:34)
28
+ * Version: 0.0.0-next-7a416a0-20240206
29
+ * Release date: 16/01/2024 (built at 06/02/2024 09:23:41)
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-49293f5-20240205
29
- * Release date: 16/01/2024 (built at 05/02/2024 15:48:34)
28
+ * Version: 0.0.0-next-7a416a0-20240206
29
+ * Release date: 16/01/2024 (built at 06/02/2024 09:23:41)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles