handsontable 0.0.0-next-21d91d0-20231025 → 0.0.0-next-50e428d-20231026

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-21d91d0-20231025";
137
+ const hotVersion = "0.0.0-next-50e428d-20231026";
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-21d91d0-20231025";
127
+ const hotVersion = "0.0.0-next-50e428d-20231026";
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-21d91d0-20231025",
13
+ "version": "0.0.0-next-50e428d-20231026",
14
14
  "main": "index",
15
15
  "module": "index.mjs",
16
16
  "jsnext:main": "index.mjs",
package/pluginHooks.d.ts CHANGED
@@ -168,6 +168,7 @@ export interface Events {
168
168
  beforeColumnMove?: (movedColumns: number[], finalIndex: number, dropIndex: number | undefined, movePossible: boolean) => void | boolean;
169
169
  beforeColumnResize?: (newSize: number, column: number, isDoubleClick: boolean) => void | number;
170
170
  beforeColumnSort?: (currentSortConfig: ColumnSortingConfig[], destinationSortConfigs: ColumnSortingConfig[]) => void | boolean;
171
+ beforeColumnWrap?: (isAutoWrapEnabled: boolean, newCoords: CellCoords, isColumnFlipped: boolean) => void;
171
172
  beforeColumnUnfreeze?: (columnIndex: number, isUnfreezingPerformed: boolean) => void | boolean;
172
173
  beforeContextMenuSetItems?: (menuItems: ContextMenuMenuItemConfig[]) => void;
173
174
  beforeContextMenuShow?: (context: ContextMenu) => void;
@@ -208,6 +209,7 @@ export interface Events {
208
209
  beforeRenderer?: (TD: HTMLTableCellElement, row: number, column: number, prop: string | number, value: CellValue, cellProperties: CellProperties) => void;
209
210
  beforeRowMove?: (movedRows: number[], finalIndex: number, dropIndex: number | undefined, movePossible: boolean) => void;
210
211
  beforeRowResize?: (newSize: number, row: number, isDoubleClick: boolean) => number | void;
212
+ beforeRowWrap?: (isAutoWrapEnabled: boolean, newCoords: CellCoords, isRowFlipped: boolean) => void;
211
213
  beforeSelectColumns?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
212
214
  beforeSelectionHighlightSet?: () => void;
213
215
  beforeSelectRows?: (from: CellCoords, to: CellCoords, highlight: CellCoords) => void;
package/pluginHooks.js CHANGED
@@ -1202,6 +1202,38 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1202
1202
  * If set to `false`, the rendering gets triggered by scrolling or moving the selection.
1203
1203
  */
1204
1204
  'afterRender',
1205
+ /**
1206
+ * When the focus position is moved to the next or previous row caused by the {@link Options#autoWrapRow} option
1207
+ * the hook is triggered.
1208
+ *
1209
+ * @since 14.0.0
1210
+ * @event Hooks#beforeRowWrap
1211
+ * @param {boolean} isWrapEnabled Tells whether the row wrapping is going to happen.
1212
+ * There may be situations where the option does not work even though it is enabled.
1213
+ * This is due to the priority of other options that may block the feature.
1214
+ * For example, when the {@link Options#minSpareCols} is defined, the {@link Options#autoWrapRow} option is not checked.
1215
+ * Thus, row wrapping is off.
1216
+ * @param {CellCoords} newCoords The new focus position.
1217
+ * @param {boolean} isFlipped `true` if the row index was flipped, `false` otherwise.
1218
+ * Flipped index means that the user reached the last row and the focus is moved to the first row or vice versa.
1219
+ */
1220
+ 'beforeRowWrap',
1221
+ /**
1222
+ * When the focus position is moved to the next or previous column caused by the {@link Options#autoWrapCol} option
1223
+ * the hook is triggered.
1224
+ *
1225
+ * @since 14.0.0
1226
+ * @event Hooks#beforeColumnWrap
1227
+ * @param {boolean} isWrapEnabled Tells whether the column wrapping is going to happen.
1228
+ * There may be situations where the option does not work even though it is enabled.
1229
+ * This is due to the priority of other options that may block the feature.
1230
+ * For example, when the {@link Options#minSpareRows} is defined, the {@link Options#autoWrapCol} option is not checked.
1231
+ * Thus, column wrapping is off.
1232
+ * @param {CellCoords} newCoords The new focus position.
1233
+ * @param {boolean} isFlipped `true` if the column index was flipped, `false` otherwise.
1234
+ * Flipped index means that the user reached the last column and the focus is moved to the first column or vice versa.
1235
+ */
1236
+ 'beforeColumnWrap',
1205
1237
  /**
1206
1238
  * Fired before cell meta is changed.
1207
1239
  *
package/pluginHooks.mjs CHANGED
@@ -1200,6 +1200,38 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
1200
1200
  * If set to `false`, the rendering gets triggered by scrolling or moving the selection.
1201
1201
  */
1202
1202
  'afterRender',
1203
+ /**
1204
+ * When the focus position is moved to the next or previous row caused by the {@link Options#autoWrapRow} option
1205
+ * the hook is triggered.
1206
+ *
1207
+ * @since 14.0.0
1208
+ * @event Hooks#beforeRowWrap
1209
+ * @param {boolean} isWrapEnabled Tells whether the row wrapping is going to happen.
1210
+ * There may be situations where the option does not work even though it is enabled.
1211
+ * This is due to the priority of other options that may block the feature.
1212
+ * For example, when the {@link Options#minSpareCols} is defined, the {@link Options#autoWrapRow} option is not checked.
1213
+ * Thus, row wrapping is off.
1214
+ * @param {CellCoords} newCoords The new focus position.
1215
+ * @param {boolean} isFlipped `true` if the row index was flipped, `false` otherwise.
1216
+ * Flipped index means that the user reached the last row and the focus is moved to the first row or vice versa.
1217
+ */
1218
+ 'beforeRowWrap',
1219
+ /**
1220
+ * When the focus position is moved to the next or previous column caused by the {@link Options#autoWrapCol} option
1221
+ * the hook is triggered.
1222
+ *
1223
+ * @since 14.0.0
1224
+ * @event Hooks#beforeColumnWrap
1225
+ * @param {boolean} isWrapEnabled Tells whether the column wrapping is going to happen.
1226
+ * There may be situations where the option does not work even though it is enabled.
1227
+ * This is due to the priority of other options that may block the feature.
1228
+ * For example, when the {@link Options#minSpareRows} is defined, the {@link Options#autoWrapCol} option is not checked.
1229
+ * Thus, column wrapping is off.
1230
+ * @param {CellCoords} newCoords The new focus position.
1231
+ * @param {boolean} isFlipped `true` if the column index was flipped, `false` otherwise.
1232
+ * Flipped index means that the user reached the last column and the focus is moved to the first column or vice versa.
1233
+ */
1234
+ 'beforeColumnWrap',
1203
1235
  /**
1204
1236
  * Fired before cell meta is changed.
1205
1237
  *
@@ -153,7 +153,6 @@ class ContextMenu extends _base.BasePlugin {
153
153
  updatePlugin() {
154
154
  this.disablePlugin();
155
155
  this.enablePlugin();
156
- this.unregisterShortcuts();
157
156
  super.updatePlugin();
158
157
  }
159
158
 
@@ -166,6 +165,7 @@ class ContextMenu extends _base.BasePlugin {
166
165
  this.menu.destroy();
167
166
  this.menu = null;
168
167
  }
168
+ this.unregisterShortcuts();
169
169
  super.disablePlugin();
170
170
  }
171
171
 
@@ -147,7 +147,6 @@ export class ContextMenu extends BasePlugin {
147
147
  updatePlugin() {
148
148
  this.disablePlugin();
149
149
  this.enablePlugin();
150
- this.unregisterShortcuts();
151
150
  super.updatePlugin();
152
151
  }
153
152
 
@@ -160,6 +159,7 @@ export class ContextMenu extends BasePlugin {
160
159
  this.menu.destroy();
161
160
  this.menu = null;
162
161
  }
162
+ this.unregisterShortcuts();
163
163
  super.disablePlugin();
164
164
  }
165
165
 
@@ -172,6 +172,18 @@ class Selection {
172
172
  }
173
173
  return _this.runLocalHooks('insertColRequire', ...args);
174
174
  });
175
+ this.transformation.addLocalHook('beforeRowWrap', function () {
176
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
177
+ args[_key7] = arguments[_key7];
178
+ }
179
+ return _this.runLocalHooks('beforeRowWrap', ...args);
180
+ });
181
+ this.transformation.addLocalHook('beforeColumnWrap', function () {
182
+ for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
183
+ args[_key8] = arguments[_key8];
184
+ }
185
+ return _this.runLocalHooks('beforeColumnWrap', ...args);
186
+ });
175
187
  }
176
188
 
177
189
  /**
@@ -166,6 +166,18 @@ class Selection {
166
166
  }
167
167
  return _this.runLocalHooks('insertColRequire', ...args);
168
168
  });
169
+ this.transformation.addLocalHook('beforeRowWrap', function () {
170
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
171
+ args[_key7] = arguments[_key7];
172
+ }
173
+ return _this.runLocalHooks('beforeRowWrap', ...args);
174
+ });
175
+ this.transformation.addLocalHook('beforeColumnWrap', function () {
176
+ for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
177
+ args[_key8] = arguments[_key8];
178
+ }
179
+ return _this.runLocalHooks('beforeColumnWrap', ...args);
180
+ });
169
181
  }
170
182
 
171
183
  /**
@@ -50,7 +50,7 @@ class Transformation {
50
50
  * Translates the visual coordinates to zero-based ones.
51
51
  *
52
52
  * @param {CellCoords} visualCoords The visual coords to process.
53
- * @returns {{x: number, y: number}}
53
+ * @returns {CellCoords}
54
54
  */
55
55
  _classPrivateMethodInitSpec(this, _visualToZeroBasedCoords);
56
56
  /**
@@ -137,56 +137,60 @@ class Transformation {
137
137
  height
138
138
  } = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this);
139
139
  const {
140
- x,
141
- y
140
+ row,
141
+ col
142
142
  } = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, visualCoords);
143
143
  const fixedRowsBottom = _classPrivateFieldGet(this, _options).fixedRowsBottom();
144
144
  const minSpareRows = _classPrivateFieldGet(this, _options).minSpareRows();
145
145
  const minSpareCols = _classPrivateFieldGet(this, _options).minSpareCols();
146
146
  const autoWrapRow = _classPrivateFieldGet(this, _options).autoWrapRow();
147
147
  const autoWrapCol = _classPrivateFieldGet(this, _options).autoWrapCol();
148
- const rawCoords = {
149
- row: y + delta.row,
150
- col: x + delta.col
151
- };
152
- if (rawCoords.row >= height) {
153
- if (createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0) {
148
+ const zeroBasedCoords = _classPrivateFieldGet(this, _options).createCellCoords(row + delta.row, col + delta.col);
149
+ if (zeroBasedCoords.row >= height) {
150
+ const autoInsertingMode = createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0;
151
+ const isWrapEnabled = !autoInsertingMode && autoWrapCol;
152
+ const nextColumn = zeroBasedCoords.col + 1;
153
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
154
+ this.runLocalHooks('beforeColumnWrap', isWrapEnabled, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextColumn >= width);
155
+ if (autoInsertingMode) {
154
156
  this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(this, _options).countRenderableRows());
155
- } else if (autoWrapCol) {
156
- const nextColumn = rawCoords.col + 1;
157
- rawCoords.row = rawCoords.row - height;
158
- rawCoords.col = nextColumn >= width ? nextColumn - width : nextColumn;
157
+ } else if (isWrapEnabled) {
158
+ zeroBasedCoords.assign(newCoords);
159
159
  }
160
- } else if (rawCoords.row < 0) {
160
+ } else if (zeroBasedCoords.row < 0) {
161
+ const previousColumn = zeroBasedCoords.col - 1;
162
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
163
+ this.runLocalHooks('beforeColumnWrap', autoWrapCol, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousColumn < 0);
161
164
  if (autoWrapCol) {
162
- const previousColumn = rawCoords.col - 1;
163
- rawCoords.row = height + rawCoords.row;
164
- rawCoords.col = previousColumn < 0 ? width + previousColumn : previousColumn;
165
+ zeroBasedCoords.assign(newCoords);
165
166
  }
166
167
  }
167
- if (rawCoords.col >= width) {
168
- if (createMissingRecords && minSpareCols > 0) {
168
+ if (zeroBasedCoords.col >= width) {
169
+ const autoInsertingMode = createMissingRecords && minSpareCols > 0;
170
+ const isWrapEnabled = !autoInsertingMode && autoWrapRow;
171
+ const nextRow = zeroBasedCoords.row + 1;
172
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
173
+ this.runLocalHooks('beforeRowWrap', isWrapEnabled, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextRow >= height);
174
+ if (autoInsertingMode) {
169
175
  this.runLocalHooks('insertColRequire', _classPrivateFieldGet(this, _options).countRenderableColumns());
170
- } else if (autoWrapRow) {
171
- const nextRow = rawCoords.row + 1;
172
- rawCoords.row = nextRow >= height ? nextRow - height : nextRow;
173
- rawCoords.col = rawCoords.col - width;
176
+ } else if (isWrapEnabled) {
177
+ zeroBasedCoords.assign(newCoords);
174
178
  }
175
- } else if (rawCoords.col < 0) {
179
+ } else if (zeroBasedCoords.col < 0) {
180
+ const previousRow = zeroBasedCoords.row - 1;
181
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
182
+ this.runLocalHooks('beforeRowWrap', autoWrapRow, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousRow < 0);
176
183
  if (autoWrapRow) {
177
- const previousRow = rawCoords.row - 1;
178
- rawCoords.row = previousRow < 0 ? height + previousRow : previousRow;
179
- rawCoords.col = width + rawCoords.col;
184
+ zeroBasedCoords.assign(newCoords);
180
185
  }
181
186
  }
182
- const coords = _classPrivateFieldGet(this, _options).createCellCoords(rawCoords.row, rawCoords.col);
183
187
  const {
184
188
  rowDir,
185
189
  colDir
186
- } = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, coords);
190
+ } = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, zeroBasedCoords);
187
191
  rowTransformDir = rowDir;
188
192
  colTransformDir = colDir;
189
- visualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords);
193
+ visualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, zeroBasedCoords);
190
194
  }
191
195
  this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
192
196
  return visualCoords;
@@ -213,14 +217,10 @@ class Transformation {
213
217
  this.runLocalHooks('beforeTransformEnd', delta);
214
218
  if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
215
219
  const {
216
- x,
217
- y
220
+ row,
221
+ col
218
222
  } = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, cellRange.to);
219
- const rawCoords = {
220
- row: y + delta.row,
221
- col: x + delta.col
222
- };
223
- const coords = _classPrivateFieldGet(this, _options).createCellCoords(rawCoords.row, rawCoords.col);
223
+ const coords = _classPrivateFieldGet(this, _options).createCellCoords(row + delta.row, col + delta.col);
224
224
  const {
225
225
  rowDir,
226
226
  colDir
@@ -288,15 +288,13 @@ function _visualToZeroBasedCoords2(visualCoords) {
288
288
  row,
289
289
  col
290
290
  } = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
291
- return {
292
- x: _classPrivateFieldGet(this, _offset).x + col,
293
- y: _classPrivateFieldGet(this, _offset).y + row
294
- };
291
+ return _classPrivateFieldGet(this, _options).createCellCoords(_classPrivateFieldGet(this, _offset).y + row, _classPrivateFieldGet(this, _offset).x + col);
295
292
  }
296
293
  function _zeroBasedToVisualCoords2(zeroBasedCoords) {
297
- zeroBasedCoords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
298
- zeroBasedCoords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
299
- return _classPrivateFieldGet(this, _options).renderableToVisualCoords(zeroBasedCoords);
294
+ const coords = zeroBasedCoords.clone();
295
+ coords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
296
+ coords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
297
+ return _classPrivateFieldGet(this, _options).renderableToVisualCoords(coords);
300
298
  }
301
299
  (0, _object.mixin)(Transformation, _localHooks.default);
302
300
  var _default = Transformation;
@@ -46,7 +46,7 @@ class Transformation {
46
46
  * Translates the visual coordinates to zero-based ones.
47
47
  *
48
48
  * @param {CellCoords} visualCoords The visual coords to process.
49
- * @returns {{x: number, y: number}}
49
+ * @returns {CellCoords}
50
50
  */
51
51
  _classPrivateMethodInitSpec(this, _visualToZeroBasedCoords);
52
52
  /**
@@ -133,56 +133,60 @@ class Transformation {
133
133
  height
134
134
  } = _classPrivateMethodGet(this, _getTableSize, _getTableSize2).call(this);
135
135
  const {
136
- x,
137
- y
136
+ row,
137
+ col
138
138
  } = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, visualCoords);
139
139
  const fixedRowsBottom = _classPrivateFieldGet(this, _options).fixedRowsBottom();
140
140
  const minSpareRows = _classPrivateFieldGet(this, _options).minSpareRows();
141
141
  const minSpareCols = _classPrivateFieldGet(this, _options).minSpareCols();
142
142
  const autoWrapRow = _classPrivateFieldGet(this, _options).autoWrapRow();
143
143
  const autoWrapCol = _classPrivateFieldGet(this, _options).autoWrapCol();
144
- const rawCoords = {
145
- row: y + delta.row,
146
- col: x + delta.col
147
- };
148
- if (rawCoords.row >= height) {
149
- if (createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0) {
144
+ const zeroBasedCoords = _classPrivateFieldGet(this, _options).createCellCoords(row + delta.row, col + delta.col);
145
+ if (zeroBasedCoords.row >= height) {
146
+ const autoInsertingMode = createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0;
147
+ const isWrapEnabled = !autoInsertingMode && autoWrapCol;
148
+ const nextColumn = zeroBasedCoords.col + 1;
149
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
150
+ this.runLocalHooks('beforeColumnWrap', isWrapEnabled, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextColumn >= width);
151
+ if (autoInsertingMode) {
150
152
  this.runLocalHooks('insertRowRequire', _classPrivateFieldGet(this, _options).countRenderableRows());
151
- } else if (autoWrapCol) {
152
- const nextColumn = rawCoords.col + 1;
153
- rawCoords.row = rawCoords.row - height;
154
- rawCoords.col = nextColumn >= width ? nextColumn - width : nextColumn;
153
+ } else if (isWrapEnabled) {
154
+ zeroBasedCoords.assign(newCoords);
155
155
  }
156
- } else if (rawCoords.row < 0) {
156
+ } else if (zeroBasedCoords.row < 0) {
157
+ const previousColumn = zeroBasedCoords.col - 1;
158
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
159
+ this.runLocalHooks('beforeColumnWrap', autoWrapCol, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousColumn < 0);
157
160
  if (autoWrapCol) {
158
- const previousColumn = rawCoords.col - 1;
159
- rawCoords.row = height + rawCoords.row;
160
- rawCoords.col = previousColumn < 0 ? width + previousColumn : previousColumn;
161
+ zeroBasedCoords.assign(newCoords);
161
162
  }
162
163
  }
163
- if (rawCoords.col >= width) {
164
- if (createMissingRecords && minSpareCols > 0) {
164
+ if (zeroBasedCoords.col >= width) {
165
+ const autoInsertingMode = createMissingRecords && minSpareCols > 0;
166
+ const isWrapEnabled = !autoInsertingMode && autoWrapRow;
167
+ const nextRow = zeroBasedCoords.row + 1;
168
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
169
+ this.runLocalHooks('beforeRowWrap', isWrapEnabled, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextRow >= height);
170
+ if (autoInsertingMode) {
165
171
  this.runLocalHooks('insertColRequire', _classPrivateFieldGet(this, _options).countRenderableColumns());
166
- } else if (autoWrapRow) {
167
- const nextRow = rawCoords.row + 1;
168
- rawCoords.row = nextRow >= height ? nextRow - height : nextRow;
169
- rawCoords.col = rawCoords.col - width;
172
+ } else if (isWrapEnabled) {
173
+ zeroBasedCoords.assign(newCoords);
170
174
  }
171
- } else if (rawCoords.col < 0) {
175
+ } else if (zeroBasedCoords.col < 0) {
176
+ const previousRow = zeroBasedCoords.row - 1;
177
+ const newCoords = _classPrivateFieldGet(this, _options).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
178
+ this.runLocalHooks('beforeRowWrap', autoWrapRow, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousRow < 0);
172
179
  if (autoWrapRow) {
173
- const previousRow = rawCoords.row - 1;
174
- rawCoords.row = previousRow < 0 ? height + previousRow : previousRow;
175
- rawCoords.col = width + rawCoords.col;
180
+ zeroBasedCoords.assign(newCoords);
176
181
  }
177
182
  }
178
- const coords = _classPrivateFieldGet(this, _options).createCellCoords(rawCoords.row, rawCoords.col);
179
183
  const {
180
184
  rowDir,
181
185
  colDir
182
- } = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, coords);
186
+ } = _classPrivateMethodGet(this, _clampCoords, _clampCoords2).call(this, zeroBasedCoords);
183
187
  rowTransformDir = rowDir;
184
188
  colTransformDir = colDir;
185
- visualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, coords);
189
+ visualCoords = _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, zeroBasedCoords);
186
190
  }
187
191
  this.runLocalHooks('afterTransformStart', visualCoords, rowTransformDir, colTransformDir);
188
192
  return visualCoords;
@@ -209,14 +213,10 @@ class Transformation {
209
213
  this.runLocalHooks('beforeTransformEnd', delta);
210
214
  if (highlightRenderableCoords.row !== null && highlightRenderableCoords.col !== null) {
211
215
  const {
212
- x,
213
- y
216
+ row,
217
+ col
214
218
  } = _classPrivateMethodGet(this, _visualToZeroBasedCoords, _visualToZeroBasedCoords2).call(this, cellRange.to);
215
- const rawCoords = {
216
- row: y + delta.row,
217
- col: x + delta.col
218
- };
219
- const coords = _classPrivateFieldGet(this, _options).createCellCoords(rawCoords.row, rawCoords.col);
219
+ const coords = _classPrivateFieldGet(this, _options).createCellCoords(row + delta.row, col + delta.col);
220
220
  const {
221
221
  rowDir,
222
222
  colDir
@@ -284,15 +284,13 @@ function _visualToZeroBasedCoords2(visualCoords) {
284
284
  row,
285
285
  col
286
286
  } = _classPrivateFieldGet(this, _options).visualToRenderableCoords(visualCoords);
287
- return {
288
- x: _classPrivateFieldGet(this, _offset).x + col,
289
- y: _classPrivateFieldGet(this, _offset).y + row
290
- };
287
+ return _classPrivateFieldGet(this, _options).createCellCoords(_classPrivateFieldGet(this, _offset).y + row, _classPrivateFieldGet(this, _offset).x + col);
291
288
  }
292
289
  function _zeroBasedToVisualCoords2(zeroBasedCoords) {
293
- zeroBasedCoords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
294
- zeroBasedCoords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
295
- return _classPrivateFieldGet(this, _options).renderableToVisualCoords(zeroBasedCoords);
290
+ const coords = zeroBasedCoords.clone();
291
+ coords.col = zeroBasedCoords.col - _classPrivateFieldGet(this, _offset).x;
292
+ coords.row = zeroBasedCoords.row - _classPrivateFieldGet(this, _offset).y;
293
+ return _classPrivateFieldGet(this, _options).renderableToVisualCoords(coords);
296
294
  }
297
295
  mixin(Transformation, localHooks);
298
296
  export default Transformation;
@@ -152,9 +152,13 @@ function shortcutsGridContext(hot) {
152
152
  callback: () => commandsPool.extendCellsSelectionDownByViewportHeight()
153
153
  }, {
154
154
  keys: [['Tab']],
155
+ // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
156
+ preventDefault: false,
155
157
  callback: () => commandsPool.moveCellSelectionInlineStart()
156
158
  }, {
157
159
  keys: [['Shift', 'Tab']],
160
+ // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
161
+ preventDefault: false,
158
162
  callback: () => commandsPool.moveCellSelectionInlineEnd()
159
163
  }, {
160
164
  keys: [['Control/Meta', 'Backspace']],
@@ -148,9 +148,13 @@ export function shortcutsGridContext(hot) {
148
148
  callback: () => commandsPool.extendCellsSelectionDownByViewportHeight()
149
149
  }, {
150
150
  keys: [['Tab']],
151
+ // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
152
+ preventDefault: false,
151
153
  callback: () => commandsPool.moveCellSelectionInlineStart()
152
154
  }, {
153
155
  keys: [['Shift', 'Tab']],
156
+ // The property value is controlled by focusCatcher module (https://github.com/handsontable/handsontable/blob/master/handsontable/src/core/focusCatcher/index.js)
157
+ preventDefault: false,
154
158
  callback: () => commandsPool.moveCellSelectionInlineEnd()
155
159
  }, {
156
160
  keys: [['Control/Meta', 'Backspace']],
@@ -8,6 +8,7 @@ interface Shortcut {
8
8
  stopPropagation?: boolean;
9
9
  relativeToGroup?: string;
10
10
  position?: 'before' | 'after';
11
+ forwardToContext?: Context;
11
12
  }
12
13
 
13
14
  export interface Context {