handsontable 0.0.0-next-be16baf-20230809 → 0.0.0-next-08765b9-20230809

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/helpers/mixed.js CHANGED
@@ -134,7 +134,7 @@ const domMessages = {
134
134
  function _injectProductInfo(key, element) {
135
135
  const hasValidType = !isEmpty(key);
136
136
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
137
- const hotVersion = "0.0.0-next-be16baf-20230809";
137
+ const hotVersion = "0.0.0-next-08765b9-20230809";
138
138
  let keyValidityDate;
139
139
  let consoleMessageState = 'invalid';
140
140
  let domMessageState = 'invalid';
package/helpers/mixed.mjs CHANGED
@@ -124,7 +124,7 @@ const domMessages = {
124
124
  export function _injectProductInfo(key, element) {
125
125
  const hasValidType = !isEmpty(key);
126
126
  const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
127
- const hotVersion = "0.0.0-next-be16baf-20230809";
127
+ const hotVersion = "0.0.0-next-08765b9-20230809";
128
128
  let keyValidityDate;
129
129
  let consoleMessageState = 'invalid';
130
130
  let domMessageState = 'invalid';
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/handsontable/handsontable/issues"
11
11
  },
12
12
  "author": "Handsoncode <hello@handsontable.com>",
13
- "version": "0.0.0-next-be16baf-20230809",
13
+ "version": "0.0.0-next-08765b9-20230809",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
@@ -65,7 +65,7 @@ function mouseDown(_ref) {
65
65
  selection.setRangeStart(coords);
66
66
  }
67
67
  } else if (coords.col < 0 && coords.row < 0) {
68
- selection.selectAll(false, false, coords);
68
+ selection.selectAll(true, true, coords);
69
69
  }
70
70
  }
71
71
  }
@@ -59,7 +59,7 @@ export function mouseDown(_ref) {
59
59
  selection.setRangeStart(coords);
60
60
  }
61
61
  } else if (coords.col < 0 && coords.row < 0) {
62
- selection.selectAll(false, false, coords);
62
+ selection.selectAll(true, true, coords);
63
63
  }
64
64
  }
65
65
  }
@@ -569,15 +569,17 @@ class Selection {
569
569
  * `false` otherwise.
570
570
  * @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
571
571
  * headers, `false` otherwise.
572
- * @param {{row: number, col: number} | false} [focusPosition] The argument allows changing the cell/header
572
+ * @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
573
573
  * focus position. The value takes an object with a `row` and `col` properties from -N to N, where
574
574
  * negative values point to the headers and positive values point to the cell range.
575
575
  */
576
576
  selectAll() {
577
- var _this$getSelectedRang;
578
577
  let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
579
578
  let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
580
- let focusPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
579
+ let focusPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
580
+ row: this.tableProps.countColHeaders() > 0 ? -this.tableProps.countColHeaders() : 0,
581
+ col: this.tableProps.countRowHeaders() > 0 ? -this.tableProps.countRowHeaders() : 0
582
+ };
581
583
  const nrOfRows = this.tableProps.countRows();
582
584
  const nrOfColumns = this.tableProps.countCols();
583
585
  const countRowHeaders = this.tableProps.countRowHeaders();
@@ -589,22 +591,17 @@ class Selection {
589
591
  if (rowFrom === 0 && columnFrom === 0 && (nrOfRows === 0 || nrOfColumns === 0)) {
590
592
  return;
591
593
  }
592
- let highlight = (_this$getSelectedRang = this.getSelectedRange().current()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
593
- let isSelectedByCorner = false;
594
- if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
595
- isSelectedByCorner = focusPosition.row < 0 && focusPosition.col < 0;
596
- highlight = this.tableProps.createCellCoords((0, _number.clamp)(focusPosition.row, rowFrom, nrOfRows - 1), (0, _number.clamp)(focusPosition.col, columnFrom, nrOfColumns - 1));
597
- }
594
+ const highlightRow = Number.isInteger(focusPosition.row) ? focusPosition.row : 0;
595
+ const highlightColumn = Number.isInteger(focusPosition.col) ? focusPosition.col : 0;
598
596
  const startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
597
+ const highlight = this.tableProps.createCellCoords((0, _number.clamp)(highlightRow, rowFrom, nrOfRows - 1), (0, _number.clamp)(highlightColumn, columnFrom, nrOfColumns - 1));
599
598
  const endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
600
599
  this.clear();
601
600
  this.setRangeStartOnly(startCoords, void 0, highlight);
602
- if (isSelectedByCorner) {
601
+ if (columnFrom < 0) {
603
602
  this.selectedByRowHeader.add(this.getLayerLevel());
604
- this.selectedByColumnHeader.add(this.getLayerLevel());
605
- } else if (columnFrom < 0) {
606
- this.selectedByRowHeader.add(this.getLayerLevel());
607
- } else if (rowFrom < 0) {
603
+ }
604
+ if (rowFrom < 0) {
608
605
  this.selectedByColumnHeader.add(this.getLayerLevel());
609
606
  }
610
607
  this.setRangeEnd(endCoords);
@@ -563,15 +563,17 @@ class Selection {
563
563
  * `false` otherwise.
564
564
  * @param {boolean} [includeColumnHeaders=false] `true` If the selection should include the column
565
565
  * headers, `false` otherwise.
566
- * @param {{row: number, col: number} | false} [focusPosition] The argument allows changing the cell/header
566
+ * @param {{row: number, col: number}} [focusPosition] The argument allows changing the cell/header
567
567
  * focus position. The value takes an object with a `row` and `col` properties from -N to N, where
568
568
  * negative values point to the headers and positive values point to the cell range.
569
569
  */
570
570
  selectAll() {
571
- var _this$getSelectedRang;
572
571
  let includeRowHeaders = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
573
572
  let includeColumnHeaders = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
574
- let focusPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
573
+ let focusPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
574
+ row: this.tableProps.countColHeaders() > 0 ? -this.tableProps.countColHeaders() : 0,
575
+ col: this.tableProps.countRowHeaders() > 0 ? -this.tableProps.countRowHeaders() : 0
576
+ };
575
577
  const nrOfRows = this.tableProps.countRows();
576
578
  const nrOfColumns = this.tableProps.countCols();
577
579
  const countRowHeaders = this.tableProps.countRowHeaders();
@@ -583,22 +585,17 @@ class Selection {
583
585
  if (rowFrom === 0 && columnFrom === 0 && (nrOfRows === 0 || nrOfColumns === 0)) {
584
586
  return;
585
587
  }
586
- let highlight = (_this$getSelectedRang = this.getSelectedRange().current()) === null || _this$getSelectedRang === void 0 ? void 0 : _this$getSelectedRang.highlight;
587
- let isSelectedByCorner = false;
588
- if (focusPosition && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.row) && Number.isInteger(focusPosition === null || focusPosition === void 0 ? void 0 : focusPosition.col)) {
589
- isSelectedByCorner = focusPosition.row < 0 && focusPosition.col < 0;
590
- highlight = this.tableProps.createCellCoords(clamp(focusPosition.row, rowFrom, nrOfRows - 1), clamp(focusPosition.col, columnFrom, nrOfColumns - 1));
591
- }
588
+ const highlightRow = Number.isInteger(focusPosition.row) ? focusPosition.row : 0;
589
+ const highlightColumn = Number.isInteger(focusPosition.col) ? focusPosition.col : 0;
592
590
  const startCoords = this.tableProps.createCellCoords(rowFrom, columnFrom);
591
+ const highlight = this.tableProps.createCellCoords(clamp(highlightRow, rowFrom, nrOfRows - 1), clamp(highlightColumn, columnFrom, nrOfColumns - 1));
593
592
  const endCoords = this.tableProps.createCellCoords(nrOfRows - 1, nrOfColumns - 1);
594
593
  this.clear();
595
594
  this.setRangeStartOnly(startCoords, void 0, highlight);
596
- if (isSelectedByCorner) {
595
+ if (columnFrom < 0) {
597
596
  this.selectedByRowHeader.add(this.getLayerLevel());
598
- this.selectedByColumnHeader.add(this.getLayerLevel());
599
- } else if (columnFrom < 0) {
600
- this.selectedByRowHeader.add(this.getLayerLevel());
601
- } else if (rowFrom < 0) {
597
+ }
598
+ if (rowFrom < 0) {
602
599
  this.selectedByColumnHeader.add(this.getLayerLevel());
603
600
  }
604
601
  this.setRangeEnd(endCoords);
@@ -4,7 +4,7 @@ exports.__esModule = true;
4
4
  const command = {
5
5
  name: 'selectAll',
6
6
  callback(hot) {
7
- hot.selectAll(false, false);
7
+ hot.selectAll();
8
8
  }
9
9
  };
10
10
  exports.command = command;
@@ -1,6 +1,6 @@
1
1
  export const command = {
2
2
  name: 'selectAll',
3
3
  callback(hot) {
4
- hot.selectAll(false, false);
4
+ hot.selectAll();
5
5
  }
6
6
  };