handsontable 14.0.0-next-1127661-20231114 → 14.0.0-next-bdc44e7-20231115

Sign up to get free protection for your applications and to get access to all the features.
@@ -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");
@@ -11,15 +11,12 @@ var _translations = require("../../translations");
11
11
  function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
12
12
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
13
13
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
14
- 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; }
15
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
16
- 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); }
17
- function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
18
- function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
14
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
19
15
  function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
20
- function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
21
16
  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; } }
22
- function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
17
+ function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
18
+ function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
19
+ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
23
20
  // Developer note! Whenever you make a change in this file, make an analogous change in manualRowResize.js
24
21
 
25
22
  const PLUGIN_KEY = exports.PLUGIN_KEY = 'manualColumnResize';
@@ -40,6 +37,21 @@ const PERSISTENT_STATE_KEY = 'manualColumnWidths';
40
37
  * - handle - the draggable element that sets the desired width of the column.
41
38
  * - guide - the helper guide that shows the desired width as a vertical guide.
42
39
  */
40
+ var _currentTH = /*#__PURE__*/new WeakMap();
41
+ var _currentCol = /*#__PURE__*/new WeakMap();
42
+ var _selectedCols = /*#__PURE__*/new WeakMap();
43
+ var _currentWidth = /*#__PURE__*/new WeakMap();
44
+ var _newSize = /*#__PURE__*/new WeakMap();
45
+ var _startY = /*#__PURE__*/new WeakMap();
46
+ var _startWidth = /*#__PURE__*/new WeakMap();
47
+ var _startOffset = /*#__PURE__*/new WeakMap();
48
+ var _handle = /*#__PURE__*/new WeakMap();
49
+ var _guide = /*#__PURE__*/new WeakMap();
50
+ var _pressed = /*#__PURE__*/new WeakMap();
51
+ var _isTriggeredByRMB = /*#__PURE__*/new WeakMap();
52
+ var _dblclick = /*#__PURE__*/new WeakMap();
53
+ var _autoresizeTimeout = /*#__PURE__*/new WeakMap();
54
+ var _columnWidthsMap = /*#__PURE__*/new WeakMap();
43
55
  var _config = /*#__PURE__*/new WeakMap();
44
56
  var _onMapInit = /*#__PURE__*/new WeakSet();
45
57
  var _onMouseOver = /*#__PURE__*/new WeakSet();
@@ -119,66 +131,110 @@ class ManualColumnResize extends _base.BasePlugin {
119
131
  * @private
120
132
  */
121
133
  _classPrivateMethodInitSpec(this, _onMapInit);
122
- _defineProperty(this, "currentTH", null);
134
+ _classPrivateFieldInitSpec(this, _currentTH, {
135
+ writable: true,
136
+ value: null
137
+ });
123
138
  /**
124
139
  * @type {number}
125
140
  */
126
- _defineProperty(this, "currentCol", null);
141
+ _classPrivateFieldInitSpec(this, _currentCol, {
142
+ writable: true,
143
+ value: null
144
+ });
127
145
  /**
128
146
  * @type {number[]}
129
147
  */
130
- _defineProperty(this, "selectedCols", []);
148
+ _classPrivateFieldInitSpec(this, _selectedCols, {
149
+ writable: true,
150
+ value: []
151
+ });
131
152
  /**
132
153
  * @type {number}
133
154
  */
134
- _defineProperty(this, "currentWidth", null);
155
+ _classPrivateFieldInitSpec(this, _currentWidth, {
156
+ writable: true,
157
+ value: null
158
+ });
135
159
  /**
136
160
  * @type {number}
137
161
  */
138
- _defineProperty(this, "newSize", null);
162
+ _classPrivateFieldInitSpec(this, _newSize, {
163
+ writable: true,
164
+ value: null
165
+ });
139
166
  /**
140
167
  * @type {number}
141
168
  */
142
- _defineProperty(this, "startY", null);
169
+ _classPrivateFieldInitSpec(this, _startY, {
170
+ writable: true,
171
+ value: null
172
+ });
143
173
  /**
144
174
  * @type {number}
145
175
  */
146
- _defineProperty(this, "startWidth", null);
176
+ _classPrivateFieldInitSpec(this, _startWidth, {
177
+ writable: true,
178
+ value: null
179
+ });
147
180
  /**
148
181
  * @type {number}
149
182
  */
150
- _defineProperty(this, "startOffset", null);
183
+ _classPrivateFieldInitSpec(this, _startOffset, {
184
+ writable: true,
185
+ value: null
186
+ });
151
187
  /**
152
188
  * @type {HTMLElement}
153
189
  */
154
- _defineProperty(this, "handle", this.hot.rootDocument.createElement('DIV'));
190
+ _classPrivateFieldInitSpec(this, _handle, {
191
+ writable: true,
192
+ value: this.hot.rootDocument.createElement('DIV')
193
+ });
155
194
  /**
156
195
  * @type {HTMLElement}
157
196
  */
158
- _defineProperty(this, "guide", this.hot.rootDocument.createElement('DIV'));
197
+ _classPrivateFieldInitSpec(this, _guide, {
198
+ writable: true,
199
+ value: this.hot.rootDocument.createElement('DIV')
200
+ });
159
201
  /**
160
202
  * @type {boolean}
161
203
  */
162
- _defineProperty(this, "pressed", null);
204
+ _classPrivateFieldInitSpec(this, _pressed, {
205
+ writable: true,
206
+ value: null
207
+ });
163
208
  /**
164
209
  * @type {boolean}
165
210
  */
166
- _defineProperty(this, "isTriggeredByRMB", false);
211
+ _classPrivateFieldInitSpec(this, _isTriggeredByRMB, {
212
+ writable: true,
213
+ value: false
214
+ });
167
215
  /**
168
216
  * @type {number}
169
217
  */
170
- _defineProperty(this, "dblclick", 0);
218
+ _classPrivateFieldInitSpec(this, _dblclick, {
219
+ writable: true,
220
+ value: 0
221
+ });
171
222
  /**
172
223
  * @type {number}
173
224
  */
174
- _defineProperty(this, "autoresizeTimeout", null);
225
+ _classPrivateFieldInitSpec(this, _autoresizeTimeout, {
226
+ writable: true,
227
+ value: null
228
+ });
175
229
  /**
176
230
  * PhysicalIndexToValueMap to keep and track widths for physical column indexes.
177
231
  *
178
- * @private
179
232
  * @type {PhysicalIndexToValueMap}
180
233
  */
181
- _defineProperty(this, "columnWidthsMap", void 0);
234
+ _classPrivateFieldInitSpec(this, _columnWidthsMap, {
235
+ writable: true,
236
+ value: void 0
237
+ });
182
238
  /**
183
239
  * Private pool to save configuration from updateSettings.
184
240
  *
@@ -188,8 +244,8 @@ class ManualColumnResize extends _base.BasePlugin {
188
244
  writable: true,
189
245
  value: void 0
190
246
  });
191
- (0, _element.addClass)(this.handle, 'manualColumnResizer');
192
- (0, _element.addClass)(this.guide, 'manualColumnResizerGuide');
247
+ (0, _element.addClass)(_classPrivateFieldGet(this, _handle), 'manualColumnResizer');
248
+ (0, _element.addClass)(_classPrivateFieldGet(this, _guide), 'manualColumnResizerGuide');
193
249
  }
194
250
 
195
251
  /**
@@ -217,9 +273,9 @@ class ManualColumnResize extends _base.BasePlugin {
217
273
  if (this.enabled) {
218
274
  return;
219
275
  }
220
- this.columnWidthsMap = new _translations.PhysicalIndexToValueMap();
221
- this.columnWidthsMap.addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
222
- this.hot.columnIndexMapper.registerMap(this.pluginName, this.columnWidthsMap);
276
+ _classPrivateFieldSet(this, _columnWidthsMap, new _translations.PhysicalIndexToValueMap());
277
+ _classPrivateFieldGet(this, _columnWidthsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
278
+ this.hot.columnIndexMapper.registerMap(this.pluginName, _classPrivateFieldGet(this, _columnWidthsMap));
223
279
  this.addHook('modifyColWidth', (width, col) => _classPrivateMethodGet(this, _onModifyColWidth, _onModifyColWidth2).call(this, width, col));
224
280
  this.addHook('beforeStretchingColumnWidth', (stretchedWidth, column) => _classPrivateMethodGet(this, _onBeforeStretchingColumnWidth, _onBeforeStretchingColumnWidth2).call(this, stretchedWidth, column));
225
281
  this.addHook('beforeColumnResize', (newSize, column, isDoubleClick) => _classPrivateMethodGet(this, _onBeforeColumnResize, _onBeforeColumnResize2).call(this, newSize, column, isDoubleClick));
@@ -243,7 +299,7 @@ class ManualColumnResize extends _base.BasePlugin {
243
299
  * Disables the plugin functionality for this Handsontable instance.
244
300
  */
245
301
  disablePlugin() {
246
- _classPrivateFieldSet(this, _config, this.columnWidthsMap.getValues());
302
+ _classPrivateFieldSet(this, _config, _classPrivateFieldGet(this, _columnWidthsMap).getValues());
247
303
  this.hot.columnIndexMapper.unregisterMap(this.pluginName);
248
304
  super.disablePlugin();
249
305
  }
@@ -254,7 +310,7 @@ class ManualColumnResize extends _base.BasePlugin {
254
310
  * @fires Hooks#persistentStateSave
255
311
  */
256
312
  saveManualColumnWidths() {
257
- this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.columnWidthsMap.getValues());
313
+ this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, _classPrivateFieldGet(this, _columnWidthsMap).getValues());
258
314
  }
259
315
 
260
316
  /**
@@ -279,7 +335,7 @@ class ManualColumnResize extends _base.BasePlugin {
279
335
  setManualSize(column, width) {
280
336
  const newWidth = Math.max(width, 20);
281
337
  const physicalColumn = this.hot.toPhysicalColumn(column);
282
- this.columnWidthsMap.setValueAtIndex(physicalColumn, newWidth);
338
+ _classPrivateFieldGet(this, _columnWidthsMap).setValueAtIndex(physicalColumn, newWidth);
283
339
  return newWidth;
284
340
  }
285
341
 
@@ -290,7 +346,7 @@ class ManualColumnResize extends _base.BasePlugin {
290
346
  */
291
347
  clearManualSize(column) {
292
348
  const physicalColumn = this.hot.toPhysicalColumn(column);
293
- this.columnWidthsMap.setValueAtIndex(physicalColumn, null);
349
+ _classPrivateFieldGet(this, _columnWidthsMap).setValueAtIndex(physicalColumn, null);
294
350
  }
295
351
  /**
296
352
  * Set the resize handle position.
@@ -302,34 +358,34 @@ class ManualColumnResize extends _base.BasePlugin {
302
358
  if (!TH.parentNode) {
303
359
  return;
304
360
  }
305
- this.currentTH = TH;
361
+ _classPrivateFieldSet(this, _currentTH, TH);
306
362
  const {
307
363
  _wt: wt
308
364
  } = this.hot.view;
309
- const cellCoords = wt.wtTable.getCoords(this.currentTH);
365
+ const cellCoords = wt.wtTable.getCoords(_classPrivateFieldGet(this, _currentTH));
310
366
  const col = cellCoords.col;
311
367
 
312
368
  // Ignore column headers.
313
369
  if (col < 0) {
314
370
  return;
315
371
  }
316
- const headerHeight = (0, _element.outerHeight)(this.currentTH);
317
- const box = this.currentTH.getBoundingClientRect();
372
+ const headerHeight = (0, _element.outerHeight)(_classPrivateFieldGet(this, _currentTH));
373
+ const box = _classPrivateFieldGet(this, _currentTH).getBoundingClientRect();
318
374
  // Read "fixedColumnsStart" through the Walkontable as in that context, the fixed columns
319
375
  // are modified (reduced by the number of hidden columns) by TableView module.
320
376
  const fixedColumn = col < wt.getSetting('fixedColumnsStart');
321
377
  let relativeHeaderPosition;
322
378
  if (fixedColumn) {
323
- relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col);
379
+ relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(_classPrivateFieldGet(this, _currentTH), cellCoords.row, cellCoords.col);
324
380
  }
325
381
 
326
382
  // If the TH is not a child of the top-left overlay, recalculate using
327
383
  // the top overlay - as this overlay contains the rest of the headers.
328
384
  if (!relativeHeaderPosition) {
329
- relativeHeaderPosition = wt.wtOverlays.topOverlay.getRelativeCellPosition(this.currentTH, cellCoords.row, cellCoords.col);
385
+ relativeHeaderPosition = wt.wtOverlays.topOverlay.getRelativeCellPosition(_classPrivateFieldGet(this, _currentTH), cellCoords.row, cellCoords.col);
330
386
  }
331
- this.currentCol = this.hot.columnIndexMapper.getVisualFromRenderableIndex(col);
332
- this.selectedCols = [];
387
+ _classPrivateFieldSet(this, _currentCol, this.hot.columnIndexMapper.getVisualFromRenderableIndex(col));
388
+ _classPrivateFieldSet(this, _selectedCols, []);
333
389
  const isFullColumnSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByColumnHeader();
334
390
  if (this.hot.selection.isSelected() && isFullColumnSelected) {
335
391
  const selectionRanges = this.hot.getSelectedRange();
@@ -339,23 +395,23 @@ class ManualColumnResize extends _base.BasePlugin {
339
395
 
340
396
  // Add every selected column for resize action.
341
397
  (0, _number.rangeEach)(fromColumn, toColumn, columnIndex => {
342
- if (!this.selectedCols.includes(columnIndex)) {
343
- this.selectedCols.push(columnIndex);
398
+ if (!_classPrivateFieldGet(this, _selectedCols).includes(columnIndex)) {
399
+ _classPrivateFieldGet(this, _selectedCols).push(columnIndex);
344
400
  }
345
401
  });
346
402
  });
347
403
  }
348
404
 
349
405
  // Resizing element beyond the current selection (also when there is no selection).
350
- if (!this.selectedCols.includes(this.currentCol)) {
351
- this.selectedCols = [this.currentCol];
406
+ if (!_classPrivateFieldGet(this, _selectedCols).includes(_classPrivateFieldGet(this, _currentCol))) {
407
+ _classPrivateFieldSet(this, _selectedCols, [_classPrivateFieldGet(this, _currentCol)]);
352
408
  }
353
- this.startOffset = relativeHeaderPosition.start - 6;
354
- this.startWidth = parseInt(box.width, 10);
355
- this.handle.style.top = `${relativeHeaderPosition.top}px`;
356
- this.handle.style[this.inlineDir] = `${this.startOffset + this.startWidth}px`;
357
- this.handle.style.height = `${headerHeight}px`;
358
- this.hot.rootElement.appendChild(this.handle);
409
+ _classPrivateFieldSet(this, _startOffset, relativeHeaderPosition.start - 6);
410
+ _classPrivateFieldSet(this, _startWidth, parseInt(box.width, 10));
411
+ _classPrivateFieldGet(this, _handle).style.top = `${relativeHeaderPosition.top}px`;
412
+ _classPrivateFieldGet(this, _handle).style[this.inlineDir] = `${_classPrivateFieldGet(this, _startOffset) + _classPrivateFieldGet(this, _startWidth)}px`;
413
+ _classPrivateFieldGet(this, _handle).style.height = `${headerHeight}px`;
414
+ this.hot.rootElement.appendChild(_classPrivateFieldGet(this, _handle));
359
415
  }
360
416
 
361
417
  /**
@@ -364,7 +420,7 @@ class ManualColumnResize extends _base.BasePlugin {
364
420
  * @private
365
421
  */
366
422
  refreshHandlePosition() {
367
- this.handle.style[this.inlineDir] = `${this.startOffset + this.currentWidth}px`;
423
+ _classPrivateFieldGet(this, _handle).style[this.inlineDir] = `${_classPrivateFieldGet(this, _startOffset) + _classPrivateFieldGet(this, _currentWidth)}px`;
368
424
  }
369
425
 
370
426
  /**
@@ -373,15 +429,15 @@ class ManualColumnResize extends _base.BasePlugin {
373
429
  * @private
374
430
  */
375
431
  setupGuidePosition() {
376
- const handleHeight = parseInt((0, _element.outerHeight)(this.handle), 10);
377
- const handleBottomPosition = parseInt(this.handle.style.top, 10) + handleHeight;
432
+ const handleHeight = parseInt((0, _element.outerHeight)(_classPrivateFieldGet(this, _handle)), 10);
433
+ const handleBottomPosition = parseInt(_classPrivateFieldGet(this, _handle).style.top, 10) + handleHeight;
378
434
  const maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);
379
- (0, _element.addClass)(this.handle, 'active');
380
- (0, _element.addClass)(this.guide, 'active');
381
- this.guide.style.top = `${handleBottomPosition}px`;
435
+ (0, _element.addClass)(_classPrivateFieldGet(this, _handle), 'active');
436
+ (0, _element.addClass)(_classPrivateFieldGet(this, _guide), 'active');
437
+ _classPrivateFieldGet(this, _guide).style.top = `${handleBottomPosition}px`;
382
438
  this.refreshGuidePosition();
383
- this.guide.style.height = `${maximumVisibleElementHeight - handleHeight}px`;
384
- this.hot.rootElement.appendChild(this.guide);
439
+ _classPrivateFieldGet(this, _guide).style.height = `${maximumVisibleElementHeight - handleHeight}px`;
440
+ this.hot.rootElement.appendChild(_classPrivateFieldGet(this, _guide));
385
441
  }
386
442
 
387
443
  /**
@@ -390,7 +446,7 @@ class ManualColumnResize extends _base.BasePlugin {
390
446
  * @private
391
447
  */
392
448
  refreshGuidePosition() {
393
- this.guide.style[this.inlineDir] = this.handle.style[this.inlineDir];
449
+ _classPrivateFieldGet(this, _guide).style[this.inlineDir] = _classPrivateFieldGet(this, _handle).style[this.inlineDir];
394
450
  }
395
451
 
396
452
  /**
@@ -399,8 +455,8 @@ class ManualColumnResize extends _base.BasePlugin {
399
455
  * @private
400
456
  */
401
457
  hideHandleAndGuide() {
402
- (0, _element.removeClass)(this.handle, 'active');
403
- (0, _element.removeClass)(this.guide, 'active');
458
+ (0, _element.removeClass)(_classPrivateFieldGet(this, _handle), 'active');
459
+ (0, _element.removeClass)(_classPrivateFieldGet(this, _guide), 'active');
404
460
  }
405
461
 
406
462
  /**
@@ -444,37 +500,37 @@ class ManualColumnResize extends _base.BasePlugin {
444
500
  this.hot.view.adjustElementsSize(true);
445
501
  };
446
502
  const resize = (column, forceRender) => {
447
- const hookNewSize = this.hot.runHooks('beforeColumnResize', this.newSize, column, true);
503
+ const hookNewSize = this.hot.runHooks('beforeColumnResize', _classPrivateFieldGet(this, _newSize), column, true);
448
504
  if (hookNewSize !== undefined) {
449
- this.newSize = hookNewSize;
505
+ _classPrivateFieldSet(this, _newSize, hookNewSize);
450
506
  }
451
507
  if (this.hot.getSettings().stretchH === 'all') {
452
508
  this.clearManualSize(column);
453
509
  } else {
454
- this.setManualSize(column, this.newSize); // double click sets by auto row size plugin
510
+ this.setManualSize(column, _classPrivateFieldGet(this, _newSize)); // double click sets by auto row size plugin
455
511
  }
456
512
 
457
513
  this.saveManualColumnWidths();
458
- this.hot.runHooks('afterColumnResize', this.newSize, column, true);
514
+ this.hot.runHooks('afterColumnResize', _classPrivateFieldGet(this, _newSize), column, true);
459
515
  if (forceRender) {
460
516
  render();
461
517
  }
462
518
  };
463
- if (this.dblclick >= 2) {
464
- const selectedColsLength = this.selectedCols.length;
519
+ if (_classPrivateFieldGet(this, _dblclick) >= 2) {
520
+ const selectedColsLength = _classPrivateFieldGet(this, _selectedCols).length;
465
521
  if (selectedColsLength > 1) {
466
- (0, _array.arrayEach)(this.selectedCols, selectedCol => {
522
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedCols), selectedCol => {
467
523
  resize(selectedCol);
468
524
  });
469
525
  render();
470
526
  } else {
471
- (0, _array.arrayEach)(this.selectedCols, selectedCol => {
527
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedCols), selectedCol => {
472
528
  resize(selectedCol, true);
473
529
  });
474
530
  }
475
531
  }
476
- this.dblclick = 0;
477
- this.autoresizeTimeout = null;
532
+ _classPrivateFieldSet(this, _dblclick, 0);
533
+ _classPrivateFieldSet(this, _autoresizeTimeout, null);
478
534
  }
479
535
  /**
480
536
  * Binds the mouse events.
@@ -490,7 +546,7 @@ class ManualColumnResize extends _base.BasePlugin {
490
546
  this.eventManager.addEventListener(rootElement, 'mousedown', e => _classPrivateMethodGet(this, _onMouseDown, _onMouseDown2).call(this, e));
491
547
  this.eventManager.addEventListener(rootWindow, 'mousemove', e => _classPrivateMethodGet(this, _onMouseMove, _onMouseMove2).call(this, e));
492
548
  this.eventManager.addEventListener(rootWindow, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
493
- this.eventManager.addEventListener(this.handle, 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
549
+ this.eventManager.addEventListener(_classPrivateFieldGet(this, _handle), 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
494
550
  }
495
551
  /**
496
552
  * Destroys the plugin instance.
@@ -506,20 +562,20 @@ function _onMapInit2() {
506
562
  if (typeof loadedManualColumnWidths !== 'undefined') {
507
563
  this.hot.batchExecution(() => {
508
564
  loadedManualColumnWidths.forEach((width, physicalIndex) => {
509
- this.columnWidthsMap.setValueAtIndex(physicalIndex, width);
565
+ _classPrivateFieldGet(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
510
566
  });
511
567
  }, true);
512
568
  } else if (Array.isArray(initialSetting)) {
513
569
  this.hot.batchExecution(() => {
514
570
  initialSetting.forEach((width, physicalIndex) => {
515
- this.columnWidthsMap.setValueAtIndex(physicalIndex, width);
571
+ _classPrivateFieldGet(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
516
572
  });
517
573
  }, true);
518
574
  _classPrivateFieldSet(this, _config, initialSetting);
519
575
  } else if (initialSetting === true && Array.isArray(_classPrivateFieldGet(this, _config))) {
520
576
  this.hot.batchExecution(() => {
521
577
  _classPrivateFieldGet(this, _config).forEach((width, physicalIndex) => {
522
- this.columnWidthsMap.setValueAtIndex(physicalIndex, width);
578
+ _classPrivateFieldGet(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
523
579
  });
524
580
  }, true);
525
581
  }
@@ -532,7 +588,7 @@ function _onMouseOver2(event) {
532
588
  }
533
589
 
534
590
  // A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
535
- if (this.isTriggeredByRMB === true) {
591
+ if (_classPrivateFieldGet(this, _isTriggeredByRMB) === true) {
536
592
  return;
537
593
  }
538
594
  if (this.checkIfColumnHeader(event.target)) {
@@ -542,7 +598,7 @@ function _onMouseOver2(event) {
542
598
  }
543
599
  const colspan = th.getAttribute('colspan');
544
600
  if (th && (colspan === null || colspan === '1')) {
545
- if (!this.pressed) {
601
+ if (!_classPrivateFieldGet(this, _pressed)) {
546
602
  this.setupHandlePosition(th);
547
603
  }
548
604
  }
@@ -550,24 +606,24 @@ function _onMouseOver2(event) {
550
606
  }
551
607
  function _onMouseDown2(event) {
552
608
  if ((0, _element.hasClass)(event.target, 'manualColumnResizer')) {
553
- this.setupHandlePosition(this.currentTH);
609
+ this.setupHandlePosition(_classPrivateFieldGet(this, _currentTH));
554
610
  this.setupGuidePosition();
555
- this.pressed = true;
556
- if (this.autoresizeTimeout === null) {
557
- this.autoresizeTimeout = setTimeout(() => this.afterMouseDownTimeout(), 500);
558
- this.hot._registerTimeout(this.autoresizeTimeout);
611
+ _classPrivateFieldSet(this, _pressed, true);
612
+ if (_classPrivateFieldGet(this, _autoresizeTimeout) === null) {
613
+ _classPrivateFieldSet(this, _autoresizeTimeout, setTimeout(() => this.afterMouseDownTimeout(), 500));
614
+ this.hot._registerTimeout(_classPrivateFieldGet(this, _autoresizeTimeout));
559
615
  }
560
- this.dblclick += 1;
616
+ _classPrivateFieldSet(this, _dblclick, _classPrivateFieldGet(this, _dblclick) + 1);
561
617
  this.startX = event.pageX;
562
- this.newSize = this.startWidth;
618
+ _classPrivateFieldSet(this, _newSize, _classPrivateFieldGet(this, _startWidth));
563
619
  }
564
620
  }
565
621
  function _onMouseMove2(event) {
566
- if (this.pressed) {
622
+ if (_classPrivateFieldGet(this, _pressed)) {
567
623
  const change = (event.pageX - this.startX) * this.hot.getDirectionFactor();
568
- this.currentWidth = this.startWidth + change;
569
- (0, _array.arrayEach)(this.selectedCols, selectedCol => {
570
- this.newSize = this.setManualSize(selectedCol, this.currentWidth);
624
+ _classPrivateFieldSet(this, _currentWidth, _classPrivateFieldGet(this, _startWidth) + change);
625
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedCols), selectedCol => {
626
+ _classPrivateFieldSet(this, _newSize, this.setManualSize(selectedCol, _classPrivateFieldGet(this, _currentWidth)));
571
627
  });
572
628
  this.refreshHandlePosition();
573
629
  this.refreshGuidePosition();
@@ -580,50 +636,50 @@ function _onMouseUp2() {
580
636
  this.hot.view.adjustElementsSize(true);
581
637
  };
582
638
  const resize = (column, forceRender) => {
583
- this.hot.runHooks('beforeColumnResize', this.newSize, column, false);
639
+ this.hot.runHooks('beforeColumnResize', _classPrivateFieldGet(this, _newSize), column, false);
584
640
  if (forceRender) {
585
641
  render();
586
642
  }
587
643
  this.saveManualColumnWidths();
588
- this.hot.runHooks('afterColumnResize', this.newSize, column, false);
644
+ this.hot.runHooks('afterColumnResize', _classPrivateFieldGet(this, _newSize), column, false);
589
645
  };
590
- if (this.pressed) {
646
+ if (_classPrivateFieldGet(this, _pressed)) {
591
647
  this.hideHandleAndGuide();
592
- this.pressed = false;
593
- if (this.newSize !== this.startWidth) {
594
- const selectedColsLength = this.selectedCols.length;
648
+ _classPrivateFieldSet(this, _pressed, false);
649
+ if (_classPrivateFieldGet(this, _newSize) !== _classPrivateFieldGet(this, _startWidth)) {
650
+ const selectedColsLength = _classPrivateFieldGet(this, _selectedCols).length;
595
651
  if (selectedColsLength > 1) {
596
- (0, _array.arrayEach)(this.selectedCols, selectedCol => {
652
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedCols), selectedCol => {
597
653
  resize(selectedCol);
598
654
  });
599
655
  render();
600
656
  } else {
601
- (0, _array.arrayEach)(this.selectedCols, selectedCol => {
657
+ (0, _array.arrayEach)(_classPrivateFieldGet(this, _selectedCols), selectedCol => {
602
658
  resize(selectedCol, true);
603
659
  });
604
660
  }
605
661
  }
606
- this.setupHandlePosition(this.currentTH);
662
+ this.setupHandlePosition(_classPrivateFieldGet(this, _currentTH));
607
663
  }
608
664
  }
609
665
  function _onContextMenu2() {
610
666
  this.hideHandleAndGuide();
611
- this.hot.rootElement.removeChild(this.handle);
612
- this.hot.rootElement.removeChild(this.guide);
613
- this.pressed = false;
614
- this.isTriggeredByRMB = true;
667
+ this.hot.rootElement.removeChild(_classPrivateFieldGet(this, _handle));
668
+ this.hot.rootElement.removeChild(_classPrivateFieldGet(this, _guide));
669
+ _classPrivateFieldSet(this, _pressed, false);
670
+ _classPrivateFieldSet(this, _isTriggeredByRMB, true);
615
671
 
616
672
  // There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
617
673
  // shouldn't be drawn just after removing it.
618
674
  this.hot._registerImmediate(() => {
619
- this.isTriggeredByRMB = false;
675
+ _classPrivateFieldSet(this, _isTriggeredByRMB, false);
620
676
  });
621
677
  }
622
678
  function _onModifyColWidth2(width, column) {
623
679
  let newWidth = width;
624
680
  if (this.enabled) {
625
681
  const physicalColumn = this.hot.toPhysicalColumn(column);
626
- const columnWidth = this.columnWidthsMap.getValueAtIndex(physicalColumn);
682
+ const columnWidth = _classPrivateFieldGet(this, _columnWidthsMap).getValueAtIndex(physicalColumn);
627
683
  if (this.hot.getSettings()[PLUGIN_KEY] && columnWidth) {
628
684
  newWidth = columnWidth;
629
685
  }
@@ -631,7 +687,7 @@ function _onModifyColWidth2(width, column) {
631
687
  return newWidth;
632
688
  }
633
689
  function _onBeforeStretchingColumnWidth2(stretchedWidth, column) {
634
- let width = this.columnWidthsMap.getValueAtIndex(column);
690
+ let width = _classPrivateFieldGet(this, _columnWidthsMap).getValueAtIndex(column);
635
691
  if (width === null) {
636
692
  width = stretchedWidth;
637
693
  }