handsontable 14.0.0-next-4fd76bc-20231114 → 14.0.0-next-bdc44e7-20231115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.error.cause.js");
3
4
  exports.__esModule = true;
4
5
  require("core-js/modules/es.array.push.js");
5
- require("core-js/modules/es.error.cause.js");
6
6
  var _base = require("../base");
7
7
  var _element = require("../../helpers/dom/element");
8
8
  var _array = require("../../helpers/array");
@@ -12,15 +12,12 @@ var _src = require("../../3rdparty/walkontable/src");
12
12
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
13
13
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
14
14
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
15
- 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; }
16
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
17
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
18
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
19
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
15
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
20
16
  function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
21
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
22
17
  function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
23
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
18
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
19
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
20
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
24
21
  // Developer note! Whenever you make a change in this file, make an analogous change in manualColumnResize.js
25
22
 
26
23
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'manualRowResize';
@@ -41,6 +38,21 @@ const PERSISTENT_STATE_KEY = 'manualRowHeights';
41
38
  * - handle - the draggable element that sets the desired height of the row.
42
39
  * - guide - the helper guide that shows the desired height as a horizontal guide.
43
40
  */
41
+ var _currentTH = /*#__PURE__*/new WeakMap();
42
+ var _currentRow = /*#__PURE__*/new WeakMap();
43
+ var _selectedRows = /*#__PURE__*/new WeakMap();
44
+ var _currentHeight = /*#__PURE__*/new WeakMap();
45
+ var _newSize = /*#__PURE__*/new WeakMap();
46
+ var _startY = /*#__PURE__*/new WeakMap();
47
+ var _startHeight = /*#__PURE__*/new WeakMap();
48
+ var _startOffset = /*#__PURE__*/new WeakMap();
49
+ var _handle = /*#__PURE__*/new WeakMap();
50
+ var _guide = /*#__PURE__*/new WeakMap();
51
+ var _pressed = /*#__PURE__*/new WeakMap();
52
+ var _isTriggeredByRMB = /*#__PURE__*/new WeakMap();
53
+ var _dblclick = /*#__PURE__*/new WeakMap();
54
+ var _autoresizeTimeout = /*#__PURE__*/new WeakMap();
55
+ var _rowHeightsMap = /*#__PURE__*/new WeakMap();
44
56
  var _config = /*#__PURE__*/new WeakMap();
45
57
  var _onMouseOver = /*#__PURE__*/new WeakSet();
46
58
  var _onMouseDown = /*#__PURE__*/new WeakSet();
@@ -104,66 +116,110 @@ class ManualRowResize extends _base.BasePlugin {
104
116
  * @param {MouseEvent} event The mouse event.
105
117
  */
106
118
  _classPrivateMethodInitSpec(this, _onMouseOver);
107
- _defineProperty(this, "currentTH", null);
119
+ _classPrivateFieldInitSpec(this, _currentTH, {
120
+ writable: true,
121
+ value: null
122
+ });
108
123
  /**
109
124
  * @type {number}
110
125
  */
111
- _defineProperty(this, "currentRow", null);
126
+ _classPrivateFieldInitSpec(this, _currentRow, {
127
+ writable: true,
128
+ value: null
129
+ });
112
130
  /**
113
131
  * @type {number[]}
114
132
  */
115
- _defineProperty(this, "selectedRows", []);
133
+ _classPrivateFieldInitSpec(this, _selectedRows, {
134
+ writable: true,
135
+ value: []
136
+ });
116
137
  /**
117
138
  * @type {number}
118
139
  */
119
- _defineProperty(this, "currentHeight", null);
140
+ _classPrivateFieldInitSpec(this, _currentHeight, {
141
+ writable: true,
142
+ value: null
143
+ });
120
144
  /**
121
145
  * @type {number}
122
146
  */
123
- _defineProperty(this, "newSize", null);
147
+ _classPrivateFieldInitSpec(this, _newSize, {
148
+ writable: true,
149
+ value: null
150
+ });
124
151
  /**
125
152
  * @type {number}
126
153
  */
127
- _defineProperty(this, "startY", null);
154
+ _classPrivateFieldInitSpec(this, _startY, {
155
+ writable: true,
156
+ value: null
157
+ });
128
158
  /**
129
159
  * @type {number}
130
160
  */
131
- _defineProperty(this, "startHeight", null);
161
+ _classPrivateFieldInitSpec(this, _startHeight, {
162
+ writable: true,
163
+ value: null
164
+ });
132
165
  /**
133
166
  * @type {number}
134
167
  */
135
- _defineProperty(this, "startOffset", null);
168
+ _classPrivateFieldInitSpec(this, _startOffset, {
169
+ writable: true,
170
+ value: null
171
+ });
136
172
  /**
137
173
  * @type {HTMLElement}
138
174
  */
139
- _defineProperty(this, "handle", this.hot.rootDocument.createElement('DIV'));
175
+ _classPrivateFieldInitSpec(this, _handle, {
176
+ writable: true,
177
+ value: this.hot.rootDocument.createElement('DIV')
178
+ });
140
179
  /**
141
180
  * @type {HTMLElement}
142
181
  */
143
- _defineProperty(this, "guide", this.hot.rootDocument.createElement('DIV'));
182
+ _classPrivateFieldInitSpec(this, _guide, {
183
+ writable: true,
184
+ value: this.hot.rootDocument.createElement('DIV')
185
+ });
144
186
  /**
145
187
  * @type {boolean}
146
188
  */
147
- _defineProperty(this, "pressed", false);
189
+ _classPrivateFieldInitSpec(this, _pressed, {
190
+ writable: true,
191
+ value: false
192
+ });
148
193
  /**
149
194
  * @type {boolean}
150
195
  */
151
- _defineProperty(this, "isTriggeredByRMB", false);
196
+ _classPrivateFieldInitSpec(this, _isTriggeredByRMB, {
197
+ writable: true,
198
+ value: false
199
+ });
152
200
  /**
153
201
  * @type {number}
154
202
  */
155
- _defineProperty(this, "dblclick", 0);
203
+ _classPrivateFieldInitSpec(this, _dblclick, {
204
+ writable: true,
205
+ value: 0
206
+ });
156
207
  /**
157
208
  * @type {number}
158
209
  */
159
- _defineProperty(this, "autoresizeTimeout", null);
210
+ _classPrivateFieldInitSpec(this, _autoresizeTimeout, {
211
+ writable: true,
212
+ value: null
213
+ });
160
214
  /**
161
215
  * PhysicalIndexToValueMap to keep and track widths for physical row indexes.
162
216
  *
163
- * @private
164
217
  * @type {PhysicalIndexToValueMap}
165
218
  */
166
- _defineProperty(this, "rowHeightsMap", void 0);
219
+ _classPrivateFieldInitSpec(this, _rowHeightsMap, {
220
+ writable: true,
221
+ value: void 0
222
+ });
167
223
  /**
168
224
  * Private pool to save configuration from updateSettings.
169
225
  *
@@ -173,8 +229,8 @@ class ManualRowResize extends _base.BasePlugin {
173
229
  writable: true,
174
230
  value: void 0
175
231
  });
176
- (0, _element.addClass)(this.handle, 'manualRowResizer');
177
- (0, _element.addClass)(this.guide, 'manualRowResizerGuide');
232
+ (0, _element.addClass)(_classPrivateFieldGet(this, _handle), 'manualRowResizer');
233
+ (0, _element.addClass)(_classPrivateFieldGet(this, _guide), 'manualRowResizerGuide');
178
234
  }
179
235
 
180
236
  /**
@@ -202,9 +258,9 @@ class ManualRowResize extends _base.BasePlugin {
202
258
  if (this.enabled) {
203
259
  return;
204
260
  }
205
- this.rowHeightsMap = new _translations.PhysicalIndexToValueMap();
206
- this.rowHeightsMap.addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
207
- this.hot.rowIndexMapper.registerMap(this.pluginName, this.rowHeightsMap);
261
+ _classPrivateFieldSet(this, _rowHeightsMap, new _translations.PhysicalIndexToValueMap());
262
+ _classPrivateFieldGet(this, _rowHeightsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
263
+ this.hot.rowIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(this, _rowHeightsMap));
208
264
  this.addHook('modifyRowHeight', (height, row) => _classPrivateMethodGet(this, _onModifyRowHeight, _onModifyRowHeight2).call(this, height, row));
209
265
  this.bindEvents();
210
266
  super.enablePlugin();
@@ -226,7 +282,7 @@ class ManualRowResize extends _base.BasePlugin {
226
282
  * Disables the plugin functionality for this Handsontable instance.
227
283
  */
228
284
  disablePlugin() {
229
- _classPrivateFieldSet(this, _config, this.rowHeightsMap.getValues());
285
+ _classPrivateFieldSet(this, _config, _classPrivateFieldGet(this, _rowHeightsMap).getValues());
230
286
  this.hot.rowIndexMapper.unregisterMap(this.pluginName);
231
287
  super.disablePlugin();
232
288
  }
@@ -238,7 +294,7 @@ class ManualRowResize extends _base.BasePlugin {
238
294
  * @fires Hooks#persistentStateSave
239
295
  */
240
296
  saveManualRowHeights() {
241
- this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.rowHeightsMap.getValues());
297
+ this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, _classPrivateFieldGet(this, _rowHeightsMap).getValues());
242
298
  }
243
299
 
244
300
  /**
@@ -264,7 +320,7 @@ class ManualRowResize extends _base.BasePlugin {
264
320
  setManualSize(row, height) {
265
321
  const physicalRow = this.hot.toPhysicalRow(row);
266
322
  const newHeight = Math.max(height, _src.ViewportRowsCalculator.DEFAULT_HEIGHT);
267
- this.rowHeightsMap.setValueAtIndex(physicalRow, newHeight);
323
+ _classPrivateFieldGet(this, _rowHeightsMap).setValueAtIndex(physicalRow, newHeight);
268
324
  return newHeight;
269
325
  }
270
326
 
@@ -275,40 +331,40 @@ class ManualRowResize extends _base.BasePlugin {
275
331
  * @param {HTMLCellElement} TH TH HTML element.
276
332
  */
277
333
  setupHandlePosition(TH) {
278
- this.currentTH = TH;
334
+ _classPrivateFieldSet(this, _currentTH, TH);
279
335
  const {
280
336
  view
281
337
  } = this.hot;
282
338
  const {
283
339
  _wt: wt
284
340
  } = view;
285
- const cellCoords = wt.wtTable.getCoords(this.currentTH);
341
+ const cellCoords = wt.wtTable.getCoords(_classPrivateFieldGet(this, _currentTH));
286
342
  const row = cellCoords.row;
287
343
 
288
344
  // Ignore row headers.
289
345
  if (row < 0) {
290
346
  return;
291
347
  }
292
- const headerWidth = (0, _element.outerWidth)(this.currentTH);
293
- const box = this.currentTH.getBoundingClientRect();
348
+ const headerWidth = (0, _element.outerWidth)(_classPrivateFieldGet(this, _currentTH));
349
+ const box = _classPrivateFieldGet(this, _currentTH).getBoundingClientRect();
294
350
  // Read "fixedRowsTop" and "fixedRowsBottom" through the Walkontable as in that context, the fixed
295
351
  // rows are modified (reduced by the number of hidden rows) by TableView module.
296
352
  const fixedRowTop = row < wt.getSetting('fixedRowsTop');
297
353
  const fixedRowBottom = row >= view.countNotHiddenRowIndexes(0, 1) - wt.getSetting('fixedRowsBottom');
298
354
  let relativeHeaderPosition;
299
355
  if (fixedRowTop) {
300
- relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col);
356
+ relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(_classPrivateFieldGet(this, _currentTH), cellCoords.row, cellCoords.col);
301
357
  } else if (fixedRowBottom) {
302
- relativeHeaderPosition = wt.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col);
358
+ relativeHeaderPosition = wt.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(_classPrivateFieldGet(this, _currentTH), cellCoords.row, cellCoords.col);
303
359
  }
304
360
 
305
361
  // If the TH is not a child of the top-left/bottom-left overlay, recalculate using
306
362
  // the left overlay - as this overlay contains the rest of the headers.
307
363
  if (!relativeHeaderPosition) {
308
- relativeHeaderPosition = wt.wtOverlays.inlineStartOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col);
364
+ relativeHeaderPosition = wt.wtOverlays.inlineStartOverlay.getRelativeCellPosition(_classPrivateFieldGet(this, _currentTH), cellCoords.row, cellCoords.col);
309
365
  }
310
- this.currentRow = this.hot.rowIndexMapper.getVisualFromRenderableIndex(row);
311
- this.selectedRows = [];
366
+ _classPrivateFieldSet(this, _currentRow, this.hot.rowIndexMapper.getVisualFromRenderableIndex(row));
367
+ _classPrivateFieldSet(this, _selectedRows, []);
312
368
  const isFullRowSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByRowHeader();
313
369
  if (this.hot.selection.isSelected() && isFullRowSelected) {
314
370
  const selectionRanges = this.hot.getSelectedRange();
@@ -318,23 +374,23 @@ class ManualRowResize extends _base.BasePlugin {
318
374
 
319
375
  // Add every selected row for resize action.
320
376
  (0, _number.rangeEach)(fromRow, toRow, rowIndex => {
321
- if (!this.selectedRows.includes(rowIndex)) {
322
- this.selectedRows.push(rowIndex);
377
+ if (!_classPrivateFieldGet(this, _selectedRows).includes(rowIndex)) {
378
+ _classPrivateFieldGet(this, _selectedRows).push(rowIndex);
323
379
  }
324
380
  });
325
381
  });
326
382
  }
327
383
 
328
384
  // Resizing element beyond the current selection (also when there is no selection).
329
- if (!this.selectedRows.includes(this.currentRow)) {
330
- this.selectedRows = [this.currentRow];
385
+ if (!_classPrivateFieldGet(this, _selectedRows).includes(_classPrivateFieldGet(this, _currentRow))) {
386
+ _classPrivateFieldSet(this, _selectedRows, [_classPrivateFieldGet(this, _currentRow)]);
331
387
  }
332
- this.startOffset = relativeHeaderPosition.top - 6;
333
- this.startHeight = parseInt(box.height, 10);
334
- this.handle.style.top = `${this.startOffset + this.startHeight}px`;
335
- this.handle.style[this.inlineDir] = `${relativeHeaderPosition.start}px`;
336
- this.handle.style.width = `${headerWidth}px`;
337
- this.hot.rootElement.appendChild(this.handle);
388
+ _classPrivateFieldSet(this, _startOffset, relativeHeaderPosition.top - 6);
389
+ _classPrivateFieldSet(this, _startHeight, parseInt(box.height, 10));
390
+ _classPrivateFieldGet(this, _handle).style.top = `${_classPrivateFieldGet(this, _startOffset) + _classPrivateFieldGet(this, _startHeight)}px`;
391
+ _classPrivateFieldGet(this, _handle).style[this.inlineDir] = `${relativeHeaderPosition.start}px`;
392
+ _classPrivateFieldGet(this, _handle).style.width = `${headerWidth}px`;
393
+ this.hot.rootElement.appendChild(_classPrivateFieldGet(this, _handle));
338
394
  }
339
395
 
340
396
  /**
@@ -343,7 +399,7 @@ class ManualRowResize extends _base.BasePlugin {
343
399
  * @private
344
400
  */
345
401
  refreshHandlePosition() {
346
- this.handle.style.top = `${this.startOffset + this.currentHeight}px`;
402
+ _classPrivateFieldGet(this, _handle).style.top = `${_classPrivateFieldGet(this, _startOffset) + _classPrivateFieldGet(this, _currentHeight)}px`;
347
403
  }
348
404
 
349
405
  /**
@@ -352,15 +408,15 @@ class ManualRowResize extends _base.BasePlugin {
352
408
  * @private
353
409
  */
354
410
  setupGuidePosition() {
355
- const handleWidth = parseInt((0, _element.outerWidth)(this.handle), 10);
356
- const handleEndPosition = parseInt(this.handle.style[this.inlineDir], 10) + handleWidth;
411
+ const handleWidth = parseInt((0, _element.outerWidth)(_classPrivateFieldGet(this, _handle)), 10);
412
+ const handleEndPosition = parseInt(_classPrivateFieldGet(this, _handle).style[this.inlineDir], 10) + handleWidth;
357
413
  const maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);
358
- (0, _element.addClass)(this.handle, 'active');
359
- (0, _element.addClass)(this.guide, 'active');
360
- this.guide.style.top = this.handle.style.top;
361
- this.guide.style[this.inlineDir] = `${handleEndPosition}px`;
362
- this.guide.style.width = `${maximumVisibleElementWidth - handleWidth}px`;
363
- this.hot.rootElement.appendChild(this.guide);
414
+ (0, _element.addClass)(_classPrivateFieldGet(this, _handle), 'active');
415
+ (0, _element.addClass)(_classPrivateFieldGet(this, _guide), 'active');
416
+ _classPrivateFieldGet(this, _guide).style.top = _classPrivateFieldGet(this, _handle).style.top;
417
+ _classPrivateFieldGet(this, _guide).style[this.inlineDir] = `${handleEndPosition}px`;
418
+ _classPrivateFieldGet(this, _guide).style.width = `${maximumVisibleElementWidth - handleWidth}px`;
419
+ this.hot.rootElement.appendChild(_classPrivateFieldGet(this, _guide));
364
420
  }
365
421
 
366
422
  /**
@@ -369,7 +425,7 @@ class ManualRowResize extends _base.BasePlugin {
369
425
  * @private
370
426
  */
371
427
  refreshGuidePosition() {
372
- this.guide.style.top = this.handle.style.top;
428
+ _classPrivateFieldGet(this, _guide).style.top = _classPrivateFieldGet(this, _handle).style.top;
373
429
  }
374
430
 
375
431
  /**
@@ -378,8 +434,8 @@ class ManualRowResize extends _base.BasePlugin {
378
434
  * @private
379
435
  */
380
436
  hideHandleAndGuide() {
381
- (0, _element.removeClass)(this.handle, 'active');
382
- (0, _element.removeClass)(this.guide, 'active');
437
+ (0, _element.removeClass)(_classPrivateFieldGet(this, _handle), 'active');
438
+ (0, _element.removeClass)(_classPrivateFieldGet(this, _guide), 'active');
383
439
  }
384
440
 
385
441
  /**
@@ -422,10 +478,10 @@ class ManualRowResize extends _base.BasePlugin {
422
478
  getActualRowHeight(row) {
423
479
  // TODO: this should utilize `this.hot.getRowHeight` after it's fixed and working properly.
424
480
  const walkontableHeight = this.hot.view._wt.wtTable.getRowHeight(row);
425
- if (walkontableHeight !== undefined && this.newSize < walkontableHeight) {
481
+ if (walkontableHeight !== undefined && _classPrivateFieldGet(this, _newSize) < walkontableHeight) {
426
482
  return walkontableHeight;
427
483
  }
428
- return this.newSize;
484
+ return _classPrivateFieldGet(this, _newSize);
429
485
  }
430
486
  /**
431
487
  * Auto-size row after doubleclick - callback.
@@ -443,30 +499,30 @@ class ManualRowResize extends _base.BasePlugin {
443
499
  const resize = (row, forceRender) => {
444
500
  const hookNewSize = this.hot.runHooks('beforeRowResize', this.getActualRowHeight(row), row, true);
445
501
  if (hookNewSize !== undefined) {
446
- this.newSize = hookNewSize;
502
+ _classPrivateFieldSet(this, _newSize, hookNewSize);
447
503
  }
448
- this.setManualSize(row, this.newSize); // double click sets auto row size
504
+ this.setManualSize(row, _classPrivateFieldGet(this, _newSize)); // double click sets auto row size
449
505
 
450
506
  this.hot.runHooks('afterRowResize', this.getActualRowHeight(row), row, true);
451
507
  if (forceRender) {
452
508
  render();
453
509
  }
454
510
  };
455
- if (this.dblclick >= 2) {
456
- const selectedRowsLength = this.selectedRows.length;
511
+ if (_classPrivateFieldGet(this, _dblclick) >= 2) {
512
+ const selectedRowsLength = _classPrivateFieldGet(this, _selectedRows).length;
457
513
  if (selectedRowsLength > 1) {
458
- (0, _array.arrayEach)(this.selectedRows, selectedRow => {
514
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedRows), selectedRow => {
459
515
  resize(selectedRow);
460
516
  });
461
517
  render();
462
518
  } else {
463
- (0, _array.arrayEach)(this.selectedRows, selectedRow => {
519
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedRows), selectedRow => {
464
520
  resize(selectedRow, true);
465
521
  });
466
522
  }
467
523
  }
468
- this.dblclick = 0;
469
- this.autoresizeTimeout = null;
524
+ _classPrivateFieldSet(this, _dblclick, 0);
525
+ _classPrivateFieldSet(this, _autoresizeTimeout, null);
470
526
  }
471
527
  /**
472
528
  * Binds the mouse events.
@@ -482,7 +538,7 @@ class ManualRowResize extends _base.BasePlugin {
482
538
  this.eventManager.addEventListener(rootElement, 'mousedown', e => _classPrivateMethodGet(this, _onMouseDown, _onMouseDown2).call(this, e));
483
539
  this.eventManager.addEventListener(rootWindow, 'mousemove', e => _classPrivateMethodGet(this, _onMouseMove, _onMouseMove2).call(this, e));
484
540
  this.eventManager.addEventListener(rootWindow, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
485
- this.eventManager.addEventListener(this.handle, 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
541
+ this.eventManager.addEventListener(_classPrivateFieldGet(this, _handle), 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
486
542
  }
487
543
  /**
488
544
  * Destroys the plugin instance.
@@ -500,13 +556,13 @@ function _onMouseOver2(event) {
500
556
  }
501
557
 
502
558
  // A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
503
- if (this.isTriggeredByRMB === true) {
559
+ if (_classPrivateFieldGet(this, _isTriggeredByRMB) === true) {
504
560
  return;
505
561
  }
506
562
  if (this.checkIfRowHeader(event.target)) {
507
563
  const th = this.getClosestTHParent(event.target);
508
564
  if (th) {
509
- if (!this.pressed) {
565
+ if (!_classPrivateFieldGet(this, _pressed)) {
510
566
  this.setupHandlePosition(th);
511
567
  }
512
568
  }
@@ -514,23 +570,23 @@ function _onMouseOver2(event) {
514
570
  }
515
571
  function _onMouseDown2(event) {
516
572
  if ((0, _element.hasClass)(event.target, 'manualRowResizer')) {
517
- this.setupHandlePosition(this.currentTH);
573
+ this.setupHandlePosition(_classPrivateFieldGet(this, _currentTH));
518
574
  this.setupGuidePosition();
519
- this.pressed = true;
520
- if (this.autoresizeTimeout === null) {
521
- this.autoresizeTimeout = setTimeout(() => this.afterMouseDownTimeout(), 500);
522
- this.hot._registerTimeout(this.autoresizeTimeout);
575
+ _classPrivateFieldSet(this, _pressed, true);
576
+ if (_classPrivateFieldGet(this, _autoresizeTimeout) === null) {
577
+ _classPrivateFieldSet(this, _autoresizeTimeout, setTimeout(() => this.afterMouseDownTimeout(), 500));
578
+ this.hot._registerTimeout(_classPrivateFieldGet(this, _autoresizeTimeout));
523
579
  }
524
- this.dblclick += 1;
525
- this.startY = event.pageY;
526
- this.newSize = this.startHeight;
580
+ _classPrivateFieldSet(this, _dblclick, _classPrivateFieldGet(this, _dblclick) + 1);
581
+ _classPrivateFieldSet(this, _startY, event.pageY);
582
+ _classPrivateFieldSet(this, _newSize, _classPrivateFieldGet(this, _startHeight));
527
583
  }
528
584
  }
529
585
  function _onMouseMove2(event) {
530
- if (this.pressed) {
531
- this.currentHeight = this.startHeight + (event.pageY - this.startY);
532
- (0, _array.arrayEach)(this.selectedRows, selectedRow => {
533
- this.newSize = this.setManualSize(selectedRow, this.currentHeight);
586
+ if (_classPrivateFieldGet(this, _pressed)) {
587
+ _classPrivateFieldSet(this, _currentHeight, _classPrivateFieldGet(this, _startHeight) + (event.pageY - _classPrivateFieldGet(this, _startY)));
588
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedRows), selectedRow => {
589
+ _classPrivateFieldSet(this, _newSize, this.setManualSize(selectedRow, _classPrivateFieldGet(this, _currentHeight)));
534
590
  });
535
591
  this.refreshHandlePosition();
536
592
  this.refreshGuidePosition();
@@ -550,43 +606,43 @@ function _onMouseUp2() {
550
606
  this.saveManualRowHeights();
551
607
  this.hot.runHooks('afterRowResize', this.getActualRowHeight(row), row, false);
552
608
  };
553
- if (this.pressed) {
609
+ if (_classPrivateFieldGet(this, _pressed)) {
554
610
  this.hideHandleAndGuide();
555
- this.pressed = false;
556
- if (this.newSize !== this.startHeight) {
557
- const selectedRowsLength = this.selectedRows.length;
611
+ _classPrivateFieldSet(this, _pressed, false);
612
+ if (_classPrivateFieldGet(this, _newSize) !== _classPrivateFieldGet(this, _startHeight)) {
613
+ const selectedRowsLength = _classPrivateFieldGet(this, _selectedRows).length;
558
614
  if (selectedRowsLength > 1) {
559
- (0, _array.arrayEach)(this.selectedRows, selectedRow => {
615
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedRows), selectedRow => {
560
616
  runHooks(selectedRow);
561
617
  });
562
618
  render();
563
619
  } else {
564
- (0, _array.arrayEach)(this.selectedRows, selectedRow => {
620
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedRows), selectedRow => {
565
621
  runHooks(selectedRow, true);
566
622
  });
567
623
  }
568
624
  }
569
- this.setupHandlePosition(this.currentTH);
625
+ this.setupHandlePosition(_classPrivateFieldGet(this, _currentTH));
570
626
  }
571
627
  }
572
628
  function _onContextMenu2() {
573
629
  this.hideHandleAndGuide();
574
- this.hot.rootElement.removeChild(this.handle);
575
- this.hot.rootElement.removeChild(this.guide);
576
- this.pressed = false;
577
- this.isTriggeredByRMB = true;
630
+ this.hot.rootElement.removeChild(_classPrivateFieldGet(this, _handle));
631
+ this.hot.rootElement.removeChild(_classPrivateFieldGet(this, _guide));
632
+ _classPrivateFieldSet(this, _pressed, false);
633
+ _classPrivateFieldSet(this, _isTriggeredByRMB, true);
578
634
 
579
635
  // There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
580
636
  // shouldn't be drawn just after removing it.
581
637
  this.hot._registerImmediate(() => {
582
- this.isTriggeredByRMB = false;
638
+ _classPrivateFieldSet(this, _isTriggeredByRMB, false);
583
639
  });
584
640
  }
585
641
  function _onModifyRowHeight2(height, row) {
586
642
  let newHeight = height;
587
643
  if (this.enabled) {
588
644
  const physicalRow = this.hot.toPhysicalRow(row);
589
- const rowHeight = this.rowHeightsMap.getValueAtIndex(physicalRow);
645
+ const rowHeight = _classPrivateFieldGet(this, _rowHeightsMap).getValueAtIndex(physicalRow);
590
646
  if (this.hot.getSettings()[PLUGIN_KEY] && rowHeight) {
591
647
  newHeight = rowHeight;
592
648
  }
@@ -599,16 +655,16 @@ function _onMapInit2() {
599
655
  this.hot.batchExecution(() => {
600
656
  if (typeof loadedManualRowHeights !== 'undefined') {
601
657
  loadedManualRowHeights.forEach((height, index) => {
602
- this.rowHeightsMap.setValueAtIndex(index, height);
658
+ _classPrivateFieldGet(this, _rowHeightsMap).setValueAtIndex(index, height);
603
659
  });
604
660
  } else if (Array.isArray(initialSetting)) {
605
661
  initialSetting.forEach((height, index) => {
606
- this.rowHeightsMap.setValueAtIndex(index, height);
662
+ _classPrivateFieldGet(this, _rowHeightsMap).setValueAtIndex(index, height);
607
663
  });
608
664
  _classPrivateFieldSet(this, _config, initialSetting);
609
665
  } else if (initialSetting === true && Array.isArray(_classPrivateFieldGet(this, _config))) {
610
666
  _classPrivateFieldGet(this, _config).forEach((height, index) => {
611
- this.rowHeightsMap.setValueAtIndex(index, height);
667
+ _classPrivateFieldGet(this, _rowHeightsMap).setValueAtIndex(index, height);
612
668
  });
613
669
  }
614
670
  }, true);