handsontable 14.0.0-next-1127661-20231114 → 14.0.0-next-ae5997a-20231116
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.
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core/focusCatcher/index.js +4 -5
- package/core/focusCatcher/index.mjs +4 -5
- package/dataMap/metaManager/metaSchema.js +7 -7
- package/dataMap/metaManager/metaSchema.mjs +7 -7
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +411 -309
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +147 -147
- package/dist/handsontable.js +411 -309
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +22 -22
- package/editors/textEditor/textEditor.js +4 -27
- package/editors/textEditor/textEditor.mjs +4 -27
- package/helpers/mixed.js +2 -2
- package/helpers/mixed.mjs +2 -2
- package/package.json +1 -1
- package/pluginHooks.d.ts +2 -2
- package/plugins/manualColumnMove/manualColumnMove.js +31 -28
- package/plugins/manualColumnMove/manualColumnMove.mjs +29 -26
- package/plugins/manualColumnResize/manualColumnResize.js +161 -105
- package/plugins/manualColumnResize/manualColumnResize.mjs +160 -104
- package/plugins/manualRowMove/manualRowMove.js +31 -28
- package/plugins/manualRowMove/manualRowMove.mjs +29 -26
- package/plugins/manualRowResize/manualRowResize.js +160 -104
- package/plugins/manualRowResize/manualRowResize.mjs +159 -103
- package/selection/transformation.js +12 -12
- package/selection/transformation.mjs +13 -13
- package/settings.d.ts +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.js +1 -1
- package/shortcutContexts/commands/moveCellSelection/inlineStart.mjs +1 -1
@@ -25,8 +25,8 @@
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
27
27
|
*
|
28
|
-
* Version: 14.0.0-next-
|
29
|
-
* Release date:
|
28
|
+
* Version: 14.0.0-next-ae5997a-20231116
|
29
|
+
* Release date: 22/11/2023 (built at 16/11/2023 08:19:27)
|
30
30
|
*/
|
31
31
|
(function webpackUniversalModuleDefinition(root, factory) {
|
32
32
|
if(typeof exports === 'object' && typeof module === 'object')
|
@@ -43033,8 +43033,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
43033
43033
|
Handsontable.CellCoords = _src.CellCoords;
|
43034
43034
|
Handsontable.CellRange = _src.CellRange;
|
43035
43035
|
Handsontable.packageName = 'handsontable';
|
43036
|
-
Handsontable.buildDate = "
|
43037
|
-
Handsontable.version = "14.0.0-next-
|
43036
|
+
Handsontable.buildDate = "16/11/2023 08:19:27";
|
43037
|
+
Handsontable.version = "14.0.0-next-ae5997a-20231116";
|
43038
43038
|
Handsontable.languages = {
|
43039
43039
|
dictionaryKeys: _registry.dictionaryKeys,
|
43040
43040
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
@@ -53183,7 +53183,7 @@ const domMessages = {
|
|
53183
53183
|
function _injectProductInfo(key, element) {
|
53184
53184
|
const hasValidType = !isEmpty(key);
|
53185
53185
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
53186
|
-
const hotVersion = "14.0.0-next-
|
53186
|
+
const hotVersion = "14.0.0-next-ae5997a-20231116";
|
53187
53187
|
let keyValidityDate;
|
53188
53188
|
let consoleMessageState = 'invalid';
|
53189
53189
|
let domMessageState = 'invalid';
|
@@ -53191,7 +53191,7 @@ function _injectProductInfo(key, element) {
|
|
53191
53191
|
const schemaValidity = _checkKeySchema(key);
|
53192
53192
|
if (hasValidType || isNonCommercial || schemaValidity) {
|
53193
53193
|
if (schemaValidity) {
|
53194
|
-
const releaseDate = (0, _moment.default)("
|
53194
|
+
const releaseDate = (0, _moment.default)("22/11/2023", 'DD/MM/YYYY');
|
53195
53195
|
const releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
|
53196
53196
|
const keyValidityDays = _extractTime(key);
|
53197
53197
|
keyValidityDate = (0, _moment.default)((keyValidityDays + 1) * 8.64e7, 'x').format('MMMM DD, YYYY');
|
@@ -85431,39 +85431,39 @@ class Transformation {
|
|
85431
85431
|
const autoWrapCol = (0, _classPrivateFieldGet2.default)(this, _options).autoWrapCol();
|
85432
85432
|
const zeroBasedCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(row + delta.row, col + delta.col);
|
85433
85433
|
if (zeroBasedCoords.row >= height) {
|
85434
|
-
const
|
85435
|
-
const isWrapEnabled = !autoInsertingMode && autoWrapCol;
|
85434
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0);
|
85436
85435
|
const nextColumn = zeroBasedCoords.col + 1;
|
85437
85436
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
|
85438
|
-
this.runLocalHooks('beforeColumnWrap',
|
85439
|
-
if (
|
85437
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextColumn >= width);
|
85438
|
+
if (isActionInterrupted.value) {
|
85440
85439
|
this.runLocalHooks('insertRowRequire', (0, _classPrivateFieldGet2.default)(this, _options).countRenderableRows());
|
85441
|
-
} else if (
|
85440
|
+
} else if (autoWrapCol) {
|
85442
85441
|
zeroBasedCoords.assign(newCoords);
|
85443
85442
|
}
|
85444
85443
|
} else if (zeroBasedCoords.row < 0) {
|
85444
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapCol);
|
85445
85445
|
const previousColumn = zeroBasedCoords.col - 1;
|
85446
85446
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
|
85447
|
-
this.runLocalHooks('beforeColumnWrap',
|
85447
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousColumn < 0);
|
85448
85448
|
if (autoWrapCol) {
|
85449
85449
|
zeroBasedCoords.assign(newCoords);
|
85450
85450
|
}
|
85451
85451
|
}
|
85452
85452
|
if (zeroBasedCoords.col >= width) {
|
85453
|
-
const
|
85454
|
-
const isWrapEnabled = !autoInsertingMode && autoWrapRow;
|
85453
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareCols > 0);
|
85455
85454
|
const nextRow = zeroBasedCoords.row + 1;
|
85456
85455
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
|
85457
|
-
this.runLocalHooks('beforeRowWrap',
|
85458
|
-
if (
|
85456
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextRow >= height);
|
85457
|
+
if (isActionInterrupted.value) {
|
85459
85458
|
this.runLocalHooks('insertColRequire', (0, _classPrivateFieldGet2.default)(this, _options).countRenderableColumns());
|
85460
|
-
} else if (
|
85459
|
+
} else if (autoWrapRow) {
|
85461
85460
|
zeroBasedCoords.assign(newCoords);
|
85462
85461
|
}
|
85463
85462
|
} else if (zeroBasedCoords.col < 0) {
|
85463
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapRow);
|
85464
85464
|
const previousRow = zeroBasedCoords.row - 1;
|
85465
85465
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
|
85466
|
-
this.runLocalHooks('beforeRowWrap',
|
85466
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousRow < 0);
|
85467
85467
|
if (autoWrapRow) {
|
85468
85468
|
zeroBasedCoords.assign(newCoords);
|
85469
85469
|
}
|
@@ -90638,7 +90638,7 @@ var _default = () => {
|
|
90638
90638
|
*/
|
90639
90639
|
multiColumnSorting: undefined,
|
90640
90640
|
/**
|
90641
|
-
* When set to `true`, the `navigableHeaders` option lets you navigate [row headers](@/guides/rows/row-header.md) and [column headers](@/guides/columns/column-header.md), using the arrow keys or the <kbd>**Tab**</kbd> key (if the [`
|
90641
|
+
* When set to `true`, the `navigableHeaders` option lets you navigate [row headers](@/guides/rows/row-header.md) and [column headers](@/guides/columns/column-header.md), using the arrow keys or the <kbd>**Tab**</kbd> key (if the [`tabNavigation`](#tabNavigation) option is set to `true`).
|
90642
90642
|
*
|
90643
90643
|
* @since 14.0.0
|
90644
90644
|
* @memberof Options#
|
@@ -90657,27 +90657,27 @@ var _default = () => {
|
|
90657
90657
|
*/
|
90658
90658
|
navigableHeaders: false,
|
90659
90659
|
/**
|
90660
|
-
* When set to `
|
90660
|
+
* When set to `false`, the `tabNavigation` option changes the behavior of the
|
90661
90661
|
* <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts. The Handsontable
|
90662
|
-
* no more captures that shortcuts to make the grid navigation available (`
|
90662
|
+
* no more captures that shortcuts to make the grid navigation available (`tabNavigation: true`)
|
90663
90663
|
* but returns control to the browser so the native page navigation is possible.
|
90664
90664
|
*
|
90665
90665
|
* @since 14.0.0
|
90666
90666
|
* @memberof Options#
|
90667
90667
|
* @type {boolean}
|
90668
|
-
* @default
|
90668
|
+
* @default true
|
90669
90669
|
* @category Core
|
90670
90670
|
*
|
90671
90671
|
* @example
|
90672
90672
|
* ```js
|
90673
90673
|
* // you can't navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
|
90674
|
-
*
|
90674
|
+
* tabNavigation: false,
|
90675
90675
|
*
|
90676
90676
|
* // default behavior: you can navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
|
90677
|
-
*
|
90677
|
+
* tabNavigation: true,
|
90678
90678
|
* ```
|
90679
90679
|
*/
|
90680
|
-
|
90680
|
+
tabNavigation: true,
|
90681
90681
|
/**
|
90682
90682
|
* @description
|
90683
90683
|
* The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
|
@@ -93371,7 +93371,7 @@ function installFocusCatcher(hot) {
|
|
93371
93371
|
recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange === void 0 ? void 0 : _hot$getSelectedRange.highlight;
|
93372
93372
|
}
|
93373
93373
|
});
|
93374
|
-
hot.addHook('beforeRowWrap', (
|
93374
|
+
hot.addHook('beforeRowWrap', (interruptedByAutoInsertMode, newCoords, isFlipped) => {
|
93375
93375
|
rowWrapState.wrapped = true;
|
93376
93376
|
rowWrapState.flipped = isFlipped;
|
93377
93377
|
});
|
@@ -93387,7 +93387,6 @@ function installFocusCatcher(hot) {
|
|
93387
93387
|
}
|
93388
93388
|
const shortcutOptions = {
|
93389
93389
|
keys: [['Tab'], ['Shift', 'Tab']],
|
93390
|
-
runOnlyIf: () => !hot.getSettings().minSpareCols,
|
93391
93390
|
preventDefault: false,
|
93392
93391
|
stopPropagation: false,
|
93393
93392
|
relativeToGroup: _shortcutContexts.GRID_GROUP,
|
@@ -93397,7 +93396,7 @@ function installFocusCatcher(hot) {
|
|
93397
93396
|
...shortcutOptions,
|
93398
93397
|
callback: () => {
|
93399
93398
|
isTabOrShiftTabPressed = true;
|
93400
|
-
if (hot.getSelectedRangeLast() && hot.getSettings().
|
93399
|
+
if (hot.getSelectedRangeLast() && !hot.getSettings().tabNavigation) {
|
93401
93400
|
isSavingCoordsEnabled = false;
|
93402
93401
|
}
|
93403
93402
|
},
|
@@ -93406,12 +93405,12 @@ function installFocusCatcher(hot) {
|
|
93406
93405
|
...shortcutOptions,
|
93407
93406
|
callback: event => {
|
93408
93407
|
const {
|
93409
|
-
|
93408
|
+
tabNavigation,
|
93410
93409
|
autoWrapRow
|
93411
93410
|
} = hot.getSettings();
|
93412
93411
|
isTabOrShiftTabPressed = false;
|
93413
93412
|
isSavingCoordsEnabled = true;
|
93414
|
-
if (
|
93413
|
+
if (!tabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
|
93415
93414
|
if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
|
93416
93415
|
recentlyAddedFocusCoords = event.shiftKey ? getMostTopStartPosition(hot) : getMostBottomEndPosition(hot);
|
93417
93416
|
}
|
@@ -94238,7 +94237,7 @@ const command = exports.command = {
|
|
94238
94237
|
callback(hot, event) {
|
94239
94238
|
const settings = hot.getSettings();
|
94240
94239
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
94241
|
-
hot.selection.transformStart(tabMoves.row, tabMoves.col
|
94240
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
94242
94241
|
}
|
94243
94242
|
};
|
94244
94243
|
|
@@ -96038,6 +96037,7 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
96038
96037
|
registerShortcuts() {
|
96039
96038
|
const shortcutManager = this.hot.getShortcutManager();
|
96040
96039
|
const editorContext = shortcutManager.getContext('editor');
|
96040
|
+
const gridContext = shortcutManager.getContext('grid');
|
96041
96041
|
const contextConfig = {
|
96042
96042
|
runOnlyIf: () => (0, _mixed.isDefined)(this.hot.getSelected()),
|
96043
96043
|
group: SHORTCUTS_GROUP
|
@@ -96046,21 +96046,9 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
96046
96046
|
this.hot.rootDocument.execCommand('insertText', false, '\n');
|
96047
96047
|
};
|
96048
96048
|
editorContext.addShortcuts([{
|
96049
|
-
keys: [['Tab']],
|
96050
|
-
|
96051
|
-
callback:
|
96052
|
-
const tableMeta = this.hot.getSettings();
|
96053
|
-
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
96054
|
-
this.hot.selection.transformStart(tabMoves.row, tabMoves.col, true);
|
96055
|
-
}
|
96056
|
-
}, {
|
96057
|
-
keys: [['Shift', 'Tab']],
|
96058
|
-
// TODO: Duplicated part of code (callback to shortcut).
|
96059
|
-
callback: event => {
|
96060
|
-
const tableMeta = this.hot.getSettings();
|
96061
|
-
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
96062
|
-
this.hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
96063
|
-
}
|
96049
|
+
keys: [['Tab'], ['Shift', 'Tab'], ['PageUp'], ['PageDown']],
|
96050
|
+
forwardToContext: gridContext,
|
96051
|
+
callback: () => {}
|
96064
96052
|
}, {
|
96065
96053
|
keys: [['Control', 'Enter']],
|
96066
96054
|
callback: () => {
|
@@ -96086,18 +96074,6 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
96086
96074
|
insertNewLine();
|
96087
96075
|
return false; // Will block closing editor.
|
96088
96076
|
}
|
96089
|
-
}, {
|
96090
|
-
// TODO: Duplicated part of code (callback to shortcut)
|
96091
|
-
keys: [['PageUp']],
|
96092
|
-
callback: () => {
|
96093
|
-
this.hot.selection.transformStart(-this.hot.countVisibleRows(), 0);
|
96094
|
-
}
|
96095
|
-
}, {
|
96096
|
-
// TODO: Duplicated part of code (callback to shortcut)
|
96097
|
-
keys: [['PageDown']],
|
96098
|
-
callback: () => {
|
96099
|
-
this.hot.selection.transformStart(this.hot.countVisibleRows(), 0);
|
96100
|
-
}
|
96101
96077
|
}, {
|
96102
96078
|
keys: [['Home']],
|
96103
96079
|
callback: (event, _ref) => {
|
@@ -126499,7 +126475,6 @@ var _interopRequireDefault = __webpack_require__(198);
|
|
126499
126475
|
exports.__esModule = true;
|
126500
126476
|
__webpack_require__(205);
|
126501
126477
|
__webpack_require__(275);
|
126502
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(454));
|
126503
126478
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(469));
|
126504
126479
|
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(466));
|
126505
126480
|
var _base = __webpack_require__(756);
|
@@ -126508,8 +126483,8 @@ var _array = __webpack_require__(446);
|
|
126508
126483
|
var _element = __webpack_require__(304);
|
126509
126484
|
var _event = __webpack_require__(459);
|
126510
126485
|
var _number = __webpack_require__(474);
|
126511
|
-
var
|
126512
|
-
var
|
126486
|
+
var _backlight2 = _interopRequireDefault(__webpack_require__(932));
|
126487
|
+
var _guideline2 = _interopRequireDefault(__webpack_require__(934));
|
126513
126488
|
__webpack_require__(935);
|
126514
126489
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
126515
126490
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
@@ -126551,6 +126526,8 @@ const CSS_AFTER_SELECTION = 'after-selection--columns';
|
|
126551
126526
|
* @class ManualColumnMove
|
126552
126527
|
* @plugin ManualColumnMove
|
126553
126528
|
*/
|
126529
|
+
var _backlight = /*#__PURE__*/new WeakMap();
|
126530
|
+
var _guideline = /*#__PURE__*/new WeakMap();
|
126554
126531
|
var _columnsToMove = /*#__PURE__*/new WeakMap();
|
126555
126532
|
var _countCols = /*#__PURE__*/new WeakMap();
|
126556
126533
|
var _pressed = /*#__PURE__*/new WeakMap();
|
@@ -126612,17 +126589,21 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
126612
126589
|
/**
|
126613
126590
|
* Backlight UI object.
|
126614
126591
|
*
|
126615
|
-
* @private
|
126616
126592
|
* @type {object}
|
126617
126593
|
*/
|
126618
|
-
(
|
126594
|
+
_classPrivateFieldInitSpec(this, _backlight, {
|
126595
|
+
writable: true,
|
126596
|
+
value: new _backlight2.default(this.hot)
|
126597
|
+
});
|
126619
126598
|
/**
|
126620
126599
|
* Guideline UI object.
|
126621
126600
|
*
|
126622
|
-
* @private
|
126623
126601
|
* @type {object}
|
126624
126602
|
*/
|
126625
|
-
(
|
126603
|
+
_classPrivateFieldInitSpec(this, _guideline, {
|
126604
|
+
writable: true,
|
126605
|
+
value: new _guideline2.default(this.hot)
|
126606
|
+
});
|
126626
126607
|
/**
|
126627
126608
|
* @type {number[]}
|
126628
126609
|
*/
|
@@ -126757,8 +126738,8 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
126757
126738
|
disablePlugin() {
|
126758
126739
|
(0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);
|
126759
126740
|
this.unregisterEvents();
|
126760
|
-
this.
|
126761
|
-
this.
|
126741
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
126742
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
126762
126743
|
super.disablePlugin();
|
126763
126744
|
}
|
126764
126745
|
|
@@ -126995,8 +126976,8 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
126995
126976
|
let tdOffsetStart = this.hot.view.THEAD.offsetLeft + this.getColumnsWidth(0, (0, _classPrivateFieldGet2.default)(this, _hoveredColumn) - 1);
|
126996
126977
|
const hiderWidth = wtTable.hider.offsetWidth;
|
126997
126978
|
const tbodyOffsetLeft = wtTable.TBODY.offsetLeft;
|
126998
|
-
const backlightElemMarginStart = this.
|
126999
|
-
const backlightElemWidth = this.
|
126979
|
+
const backlightElemMarginStart = (0, _classPrivateFieldGet2.default)(this, _backlight).getOffset().start;
|
126980
|
+
const backlightElemWidth = (0, _classPrivateFieldGet2.default)(this, _backlight).getSize().width;
|
127000
126981
|
let rowHeaderWidth = 0;
|
127001
126982
|
let mouseOffsetStart = 0;
|
127002
126983
|
if (this.hot.isRtl()) {
|
@@ -127050,8 +127031,8 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
127050
127031
|
} else if (scrollableElement.scrollX !== undefined && (0, _classPrivateFieldGet2.default)(this, _hoveredColumn) < (0, _classPrivateFieldGet2.default)(this, _fixedColumnsStart)) {
|
127051
127032
|
guidelineStart -= (0, _classPrivateFieldGet2.default)(this, _rootElementOffset) <= scrollableElement.scrollX ? (0, _classPrivateFieldGet2.default)(this, _rootElementOffset) : 0;
|
127052
127033
|
}
|
127053
|
-
this.
|
127054
|
-
this.
|
127034
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(null, backlightStart);
|
127035
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).setPosition(null, guidelineStart);
|
127055
127036
|
}
|
127056
127037
|
|
127057
127038
|
/**
|
@@ -127081,15 +127062,15 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
127081
127062
|
* @private
|
127082
127063
|
*/
|
127083
127064
|
buildPluginUI() {
|
127084
|
-
this.
|
127085
|
-
this.
|
127065
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).build();
|
127066
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).build();
|
127086
127067
|
}
|
127087
127068
|
/**
|
127088
127069
|
* Destroys the plugin instance.
|
127089
127070
|
*/
|
127090
127071
|
destroy() {
|
127091
|
-
this.
|
127092
|
-
this.
|
127072
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
127073
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
127093
127074
|
super.destroy();
|
127094
127075
|
}
|
127095
127076
|
}
|
@@ -127106,11 +127087,11 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
127106
127087
|
(0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);
|
127107
127088
|
return;
|
127108
127089
|
}
|
127109
|
-
const guidelineIsNotReady = this.
|
127110
|
-
const backlightIsNotReady = this.
|
127090
|
+
const guidelineIsNotReady = (0, _classPrivateFieldGet2.default)(this, _guideline).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _guideline).isAppended();
|
127091
|
+
const backlightIsNotReady = (0, _classPrivateFieldGet2.default)(this, _backlight).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _backlight).isAppended();
|
127111
127092
|
if (guidelineIsNotReady && backlightIsNotReady) {
|
127112
|
-
this.
|
127113
|
-
this.
|
127093
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).appendTo(wtTable.hider);
|
127094
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).appendTo(wtTable.hider);
|
127114
127095
|
}
|
127115
127096
|
const {
|
127116
127097
|
from,
|
@@ -127138,9 +127119,9 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
127138
127119
|
const offsetX = Math.abs(eventOffsetX - (this.hot.isRtl() ? TD.offsetWidth : 0));
|
127139
127120
|
const inlineOffset = this.getColumnsWidth(start, coords.col - 1) + offsetX;
|
127140
127121
|
const inlinePos = this.getColumnsWidth(countColumnsFrom, start - 1) + (fixedColumnsStart ? horizontalScrollPosition : 0) + inlineOffset;
|
127141
|
-
this.
|
127142
|
-
this.
|
127143
|
-
this.
|
127122
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(topPos, inlinePos);
|
127123
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(this.getColumnsWidth(start, end), wtTable.hider.offsetHeight - topPos);
|
127124
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setOffset(null, -inlineOffset);
|
127144
127125
|
(0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);
|
127145
127126
|
} else {
|
127146
127127
|
(0, _element.removeClass)(this.hot.rootElement, CSS_AFTER_SELECTION);
|
@@ -127201,8 +127182,8 @@ function _onAfterScrollVertically2() {
|
|
127201
127182
|
const headerHeight = wtTable.getColumnHeaderHeight(0) + 1;
|
127202
127183
|
const scrollTop = wtTable.holder.scrollTop;
|
127203
127184
|
const posTop = headerHeight + scrollTop;
|
127204
|
-
this.
|
127205
|
-
this.
|
127185
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(posTop);
|
127186
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(null, wtTable.hider.offsetHeight - posTop);
|
127206
127187
|
}
|
127207
127188
|
function _onAfterLoadData2() {
|
127208
127189
|
this.moveBySettingsOrLoad();
|
@@ -127482,13 +127463,12 @@ exports.ManualColumnResize = _manualColumnResize.ManualColumnResize;
|
|
127482
127463
|
"use strict";
|
127483
127464
|
|
127484
127465
|
|
127466
|
+
__webpack_require__(275);
|
127485
127467
|
var _interopRequireDefault = __webpack_require__(198);
|
127486
127468
|
exports.__esModule = true;
|
127487
127469
|
__webpack_require__(205);
|
127488
|
-
__webpack_require__(275);
|
127489
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(454));
|
127490
|
-
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(466));
|
127491
127470
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(469));
|
127471
|
+
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(466));
|
127492
127472
|
var _base = __webpack_require__(756);
|
127493
127473
|
var _element = __webpack_require__(304);
|
127494
127474
|
var _array = __webpack_require__(446);
|
@@ -127518,6 +127498,21 @@ const PERSISTENT_STATE_KEY = 'manualColumnWidths';
|
|
127518
127498
|
* - handle - the draggable element that sets the desired width of the column.
|
127519
127499
|
* - guide - the helper guide that shows the desired width as a vertical guide.
|
127520
127500
|
*/
|
127501
|
+
var _currentTH = /*#__PURE__*/new WeakMap();
|
127502
|
+
var _currentCol = /*#__PURE__*/new WeakMap();
|
127503
|
+
var _selectedCols = /*#__PURE__*/new WeakMap();
|
127504
|
+
var _currentWidth = /*#__PURE__*/new WeakMap();
|
127505
|
+
var _newSize = /*#__PURE__*/new WeakMap();
|
127506
|
+
var _startY = /*#__PURE__*/new WeakMap();
|
127507
|
+
var _startWidth = /*#__PURE__*/new WeakMap();
|
127508
|
+
var _startOffset = /*#__PURE__*/new WeakMap();
|
127509
|
+
var _handle = /*#__PURE__*/new WeakMap();
|
127510
|
+
var _guide = /*#__PURE__*/new WeakMap();
|
127511
|
+
var _pressed = /*#__PURE__*/new WeakMap();
|
127512
|
+
var _isTriggeredByRMB = /*#__PURE__*/new WeakMap();
|
127513
|
+
var _dblclick = /*#__PURE__*/new WeakMap();
|
127514
|
+
var _autoresizeTimeout = /*#__PURE__*/new WeakMap();
|
127515
|
+
var _columnWidthsMap = /*#__PURE__*/new WeakMap();
|
127521
127516
|
var _config = /*#__PURE__*/new WeakMap();
|
127522
127517
|
var _onMapInit = /*#__PURE__*/new WeakSet();
|
127523
127518
|
var _onMouseOver = /*#__PURE__*/new WeakSet();
|
@@ -127597,66 +127592,110 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127597
127592
|
* @private
|
127598
127593
|
*/
|
127599
127594
|
_classPrivateMethodInitSpec(this, _onMapInit);
|
127600
|
-
(
|
127595
|
+
_classPrivateFieldInitSpec(this, _currentTH, {
|
127596
|
+
writable: true,
|
127597
|
+
value: null
|
127598
|
+
});
|
127601
127599
|
/**
|
127602
127600
|
* @type {number}
|
127603
127601
|
*/
|
127604
|
-
(
|
127602
|
+
_classPrivateFieldInitSpec(this, _currentCol, {
|
127603
|
+
writable: true,
|
127604
|
+
value: null
|
127605
|
+
});
|
127605
127606
|
/**
|
127606
127607
|
* @type {number[]}
|
127607
127608
|
*/
|
127608
|
-
(
|
127609
|
+
_classPrivateFieldInitSpec(this, _selectedCols, {
|
127610
|
+
writable: true,
|
127611
|
+
value: []
|
127612
|
+
});
|
127609
127613
|
/**
|
127610
127614
|
* @type {number}
|
127611
127615
|
*/
|
127612
|
-
(
|
127616
|
+
_classPrivateFieldInitSpec(this, _currentWidth, {
|
127617
|
+
writable: true,
|
127618
|
+
value: null
|
127619
|
+
});
|
127613
127620
|
/**
|
127614
127621
|
* @type {number}
|
127615
127622
|
*/
|
127616
|
-
(
|
127623
|
+
_classPrivateFieldInitSpec(this, _newSize, {
|
127624
|
+
writable: true,
|
127625
|
+
value: null
|
127626
|
+
});
|
127617
127627
|
/**
|
127618
127628
|
* @type {number}
|
127619
127629
|
*/
|
127620
|
-
(
|
127630
|
+
_classPrivateFieldInitSpec(this, _startY, {
|
127631
|
+
writable: true,
|
127632
|
+
value: null
|
127633
|
+
});
|
127621
127634
|
/**
|
127622
127635
|
* @type {number}
|
127623
127636
|
*/
|
127624
|
-
(
|
127637
|
+
_classPrivateFieldInitSpec(this, _startWidth, {
|
127638
|
+
writable: true,
|
127639
|
+
value: null
|
127640
|
+
});
|
127625
127641
|
/**
|
127626
127642
|
* @type {number}
|
127627
127643
|
*/
|
127628
|
-
(
|
127644
|
+
_classPrivateFieldInitSpec(this, _startOffset, {
|
127645
|
+
writable: true,
|
127646
|
+
value: null
|
127647
|
+
});
|
127629
127648
|
/**
|
127630
127649
|
* @type {HTMLElement}
|
127631
127650
|
*/
|
127632
|
-
(
|
127651
|
+
_classPrivateFieldInitSpec(this, _handle, {
|
127652
|
+
writable: true,
|
127653
|
+
value: this.hot.rootDocument.createElement('DIV')
|
127654
|
+
});
|
127633
127655
|
/**
|
127634
127656
|
* @type {HTMLElement}
|
127635
127657
|
*/
|
127636
|
-
(
|
127658
|
+
_classPrivateFieldInitSpec(this, _guide, {
|
127659
|
+
writable: true,
|
127660
|
+
value: this.hot.rootDocument.createElement('DIV')
|
127661
|
+
});
|
127637
127662
|
/**
|
127638
127663
|
* @type {boolean}
|
127639
127664
|
*/
|
127640
|
-
(
|
127665
|
+
_classPrivateFieldInitSpec(this, _pressed, {
|
127666
|
+
writable: true,
|
127667
|
+
value: null
|
127668
|
+
});
|
127641
127669
|
/**
|
127642
127670
|
* @type {boolean}
|
127643
127671
|
*/
|
127644
|
-
(
|
127672
|
+
_classPrivateFieldInitSpec(this, _isTriggeredByRMB, {
|
127673
|
+
writable: true,
|
127674
|
+
value: false
|
127675
|
+
});
|
127645
127676
|
/**
|
127646
127677
|
* @type {number}
|
127647
127678
|
*/
|
127648
|
-
(
|
127679
|
+
_classPrivateFieldInitSpec(this, _dblclick, {
|
127680
|
+
writable: true,
|
127681
|
+
value: 0
|
127682
|
+
});
|
127649
127683
|
/**
|
127650
127684
|
* @type {number}
|
127651
127685
|
*/
|
127652
|
-
(
|
127686
|
+
_classPrivateFieldInitSpec(this, _autoresizeTimeout, {
|
127687
|
+
writable: true,
|
127688
|
+
value: null
|
127689
|
+
});
|
127653
127690
|
/**
|
127654
127691
|
* PhysicalIndexToValueMap to keep and track widths for physical column indexes.
|
127655
127692
|
*
|
127656
|
-
* @private
|
127657
127693
|
* @type {PhysicalIndexToValueMap}
|
127658
127694
|
*/
|
127659
|
-
(
|
127695
|
+
_classPrivateFieldInitSpec(this, _columnWidthsMap, {
|
127696
|
+
writable: true,
|
127697
|
+
value: void 0
|
127698
|
+
});
|
127660
127699
|
/**
|
127661
127700
|
* Private pool to save configuration from updateSettings.
|
127662
127701
|
*
|
@@ -127666,8 +127705,8 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127666
127705
|
writable: true,
|
127667
127706
|
value: void 0
|
127668
127707
|
});
|
127669
|
-
(0, _element.addClass)(this
|
127670
|
-
(0, _element.addClass)(this
|
127708
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'manualColumnResizer');
|
127709
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'manualColumnResizerGuide');
|
127671
127710
|
}
|
127672
127711
|
|
127673
127712
|
/**
|
@@ -127695,9 +127734,9 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127695
127734
|
if (this.enabled) {
|
127696
127735
|
return;
|
127697
127736
|
}
|
127698
|
-
this
|
127699
|
-
this.
|
127700
|
-
this.hot.columnIndexMapper.registerMap(this.pluginName,
|
127737
|
+
(0, _classPrivateFieldSet2.default)(this, _columnWidthsMap, new _translations.PhysicalIndexToValueMap());
|
127738
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
|
127739
|
+
this.hot.columnIndexMapper.registerMap(this.pluginName, (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap));
|
127701
127740
|
this.addHook('modifyColWidth', (width, col) => _classPrivateMethodGet(this, _onModifyColWidth, _onModifyColWidth2).call(this, width, col));
|
127702
127741
|
this.addHook('beforeStretchingColumnWidth', (stretchedWidth, column) => _classPrivateMethodGet(this, _onBeforeStretchingColumnWidth, _onBeforeStretchingColumnWidth2).call(this, stretchedWidth, column));
|
127703
127742
|
this.addHook('beforeColumnResize', (newSize, column, isDoubleClick) => _classPrivateMethodGet(this, _onBeforeColumnResize, _onBeforeColumnResize2).call(this, newSize, column, isDoubleClick));
|
@@ -127721,7 +127760,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127721
127760
|
* Disables the plugin functionality for this Handsontable instance.
|
127722
127761
|
*/
|
127723
127762
|
disablePlugin() {
|
127724
|
-
(0, _classPrivateFieldSet2.default)(this, _config, this.
|
127763
|
+
(0, _classPrivateFieldSet2.default)(this, _config, (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValues());
|
127725
127764
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
127726
127765
|
super.disablePlugin();
|
127727
127766
|
}
|
@@ -127732,7 +127771,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127732
127771
|
* @fires Hooks#persistentStateSave
|
127733
127772
|
*/
|
127734
127773
|
saveManualColumnWidths() {
|
127735
|
-
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.
|
127774
|
+
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValues());
|
127736
127775
|
}
|
127737
127776
|
|
127738
127777
|
/**
|
@@ -127757,7 +127796,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127757
127796
|
setManualSize(column, width) {
|
127758
127797
|
const newWidth = Math.max(width, 20);
|
127759
127798
|
const physicalColumn = this.hot.toPhysicalColumn(column);
|
127760
|
-
this.
|
127799
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalColumn, newWidth);
|
127761
127800
|
return newWidth;
|
127762
127801
|
}
|
127763
127802
|
|
@@ -127768,7 +127807,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127768
127807
|
*/
|
127769
127808
|
clearManualSize(column) {
|
127770
127809
|
const physicalColumn = this.hot.toPhysicalColumn(column);
|
127771
|
-
this.
|
127810
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalColumn, null);
|
127772
127811
|
}
|
127773
127812
|
/**
|
127774
127813
|
* Set the resize handle position.
|
@@ -127780,34 +127819,34 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127780
127819
|
if (!TH.parentNode) {
|
127781
127820
|
return;
|
127782
127821
|
}
|
127783
|
-
this
|
127822
|
+
(0, _classPrivateFieldSet2.default)(this, _currentTH, TH);
|
127784
127823
|
const {
|
127785
127824
|
_wt: wt
|
127786
127825
|
} = this.hot.view;
|
127787
|
-
const cellCoords = wt.wtTable.getCoords(
|
127826
|
+
const cellCoords = wt.wtTable.getCoords((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
127788
127827
|
const col = cellCoords.col;
|
127789
127828
|
|
127790
127829
|
// Ignore column headers.
|
127791
127830
|
if (col < 0) {
|
127792
127831
|
return;
|
127793
127832
|
}
|
127794
|
-
const headerHeight = (0, _element.outerHeight)(
|
127795
|
-
const box = this.
|
127833
|
+
const headerHeight = (0, _element.outerHeight)((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
127834
|
+
const box = (0, _classPrivateFieldGet2.default)(this, _currentTH).getBoundingClientRect();
|
127796
127835
|
// Read "fixedColumnsStart" through the Walkontable as in that context, the fixed columns
|
127797
127836
|
// are modified (reduced by the number of hidden columns) by TableView module.
|
127798
127837
|
const fixedColumn = col < wt.getSetting('fixedColumnsStart');
|
127799
127838
|
let relativeHeaderPosition;
|
127800
127839
|
if (fixedColumn) {
|
127801
|
-
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(this
|
127840
|
+
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
127802
127841
|
}
|
127803
127842
|
|
127804
127843
|
// If the TH is not a child of the top-left overlay, recalculate using
|
127805
127844
|
// the top overlay - as this overlay contains the rest of the headers.
|
127806
127845
|
if (!relativeHeaderPosition) {
|
127807
|
-
relativeHeaderPosition = wt.wtOverlays.topOverlay.getRelativeCellPosition(this
|
127846
|
+
relativeHeaderPosition = wt.wtOverlays.topOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
127808
127847
|
}
|
127809
|
-
this
|
127810
|
-
this
|
127848
|
+
(0, _classPrivateFieldSet2.default)(this, _currentCol, this.hot.columnIndexMapper.getVisualFromRenderableIndex(col));
|
127849
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedCols, []);
|
127811
127850
|
const isFullColumnSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByColumnHeader();
|
127812
127851
|
if (this.hot.selection.isSelected() && isFullColumnSelected) {
|
127813
127852
|
const selectionRanges = this.hot.getSelectedRange();
|
@@ -127817,23 +127856,23 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127817
127856
|
|
127818
127857
|
// Add every selected column for resize action.
|
127819
127858
|
(0, _number.rangeEach)(fromColumn, toColumn, columnIndex => {
|
127820
|
-
if (!this.
|
127821
|
-
this.
|
127859
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedCols).includes(columnIndex)) {
|
127860
|
+
(0, _classPrivateFieldGet2.default)(this, _selectedCols).push(columnIndex);
|
127822
127861
|
}
|
127823
127862
|
});
|
127824
127863
|
});
|
127825
127864
|
}
|
127826
127865
|
|
127827
127866
|
// Resizing element beyond the current selection (also when there is no selection).
|
127828
|
-
if (!this.
|
127829
|
-
this
|
127867
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedCols).includes((0, _classPrivateFieldGet2.default)(this, _currentCol))) {
|
127868
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedCols, [(0, _classPrivateFieldGet2.default)(this, _currentCol)]);
|
127830
127869
|
}
|
127831
|
-
this
|
127832
|
-
this
|
127833
|
-
this.
|
127834
|
-
this.
|
127835
|
-
this.
|
127836
|
-
this.hot.rootElement.appendChild(
|
127870
|
+
(0, _classPrivateFieldSet2.default)(this, _startOffset, relativeHeaderPosition.start - 6);
|
127871
|
+
(0, _classPrivateFieldSet2.default)(this, _startWidth, parseInt(box.width, 10));
|
127872
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.top = `${relativeHeaderPosition.top}px`;
|
127873
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir] = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _startWidth)}px`;
|
127874
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.height = `${headerHeight}px`;
|
127875
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
127837
127876
|
}
|
127838
127877
|
|
127839
127878
|
/**
|
@@ -127842,7 +127881,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127842
127881
|
* @private
|
127843
127882
|
*/
|
127844
127883
|
refreshHandlePosition() {
|
127845
|
-
this.
|
127884
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir] = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _currentWidth)}px`;
|
127846
127885
|
}
|
127847
127886
|
|
127848
127887
|
/**
|
@@ -127851,15 +127890,15 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127851
127890
|
* @private
|
127852
127891
|
*/
|
127853
127892
|
setupGuidePosition() {
|
127854
|
-
const handleHeight = parseInt((0, _element.outerHeight)(
|
127855
|
-
const handleBottomPosition = parseInt(this.
|
127893
|
+
const handleHeight = parseInt((0, _element.outerHeight)((0, _classPrivateFieldGet2.default)(this, _handle)), 10);
|
127894
|
+
const handleBottomPosition = parseInt((0, _classPrivateFieldGet2.default)(this, _handle).style.top, 10) + handleHeight;
|
127856
127895
|
const maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);
|
127857
|
-
(0, _element.addClass)(this
|
127858
|
-
(0, _element.addClass)(this
|
127859
|
-
this.
|
127896
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
127897
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
127898
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.top = `${handleBottomPosition}px`;
|
127860
127899
|
this.refreshGuidePosition();
|
127861
|
-
this.
|
127862
|
-
this.hot.rootElement.appendChild(
|
127900
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.height = `${maximumVisibleElementHeight - handleHeight}px`;
|
127901
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
127863
127902
|
}
|
127864
127903
|
|
127865
127904
|
/**
|
@@ -127868,7 +127907,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127868
127907
|
* @private
|
127869
127908
|
*/
|
127870
127909
|
refreshGuidePosition() {
|
127871
|
-
this.
|
127910
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style[this.inlineDir] = (0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir];
|
127872
127911
|
}
|
127873
127912
|
|
127874
127913
|
/**
|
@@ -127877,8 +127916,8 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127877
127916
|
* @private
|
127878
127917
|
*/
|
127879
127918
|
hideHandleAndGuide() {
|
127880
|
-
(0, _element.removeClass)(this
|
127881
|
-
(0, _element.removeClass)(this
|
127919
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
127920
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
127882
127921
|
}
|
127883
127922
|
|
127884
127923
|
/**
|
@@ -127922,37 +127961,37 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127922
127961
|
this.hot.view.adjustElementsSize(true);
|
127923
127962
|
};
|
127924
127963
|
const resize = (column, forceRender) => {
|
127925
|
-
const hookNewSize = this.hot.runHooks('beforeColumnResize', this
|
127964
|
+
const hookNewSize = this.hot.runHooks('beforeColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, true);
|
127926
127965
|
if (hookNewSize !== undefined) {
|
127927
|
-
this
|
127966
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, hookNewSize);
|
127928
127967
|
}
|
127929
127968
|
if (this.hot.getSettings().stretchH === 'all') {
|
127930
127969
|
this.clearManualSize(column);
|
127931
127970
|
} else {
|
127932
|
-
this.setManualSize(column,
|
127971
|
+
this.setManualSize(column, (0, _classPrivateFieldGet2.default)(this, _newSize)); // double click sets by auto row size plugin
|
127933
127972
|
}
|
127934
127973
|
|
127935
127974
|
this.saveManualColumnWidths();
|
127936
|
-
this.hot.runHooks('afterColumnResize', this
|
127975
|
+
this.hot.runHooks('afterColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, true);
|
127937
127976
|
if (forceRender) {
|
127938
127977
|
render();
|
127939
127978
|
}
|
127940
127979
|
};
|
127941
|
-
if (this
|
127942
|
-
const selectedColsLength = this.
|
127980
|
+
if ((0, _classPrivateFieldGet2.default)(this, _dblclick) >= 2) {
|
127981
|
+
const selectedColsLength = (0, _classPrivateFieldGet2.default)(this, _selectedCols).length;
|
127943
127982
|
if (selectedColsLength > 1) {
|
127944
|
-
(0, _array.arrayEach)(this
|
127983
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
127945
127984
|
resize(selectedCol);
|
127946
127985
|
});
|
127947
127986
|
render();
|
127948
127987
|
} else {
|
127949
|
-
(0, _array.arrayEach)(this
|
127988
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
127950
127989
|
resize(selectedCol, true);
|
127951
127990
|
});
|
127952
127991
|
}
|
127953
127992
|
}
|
127954
|
-
this
|
127955
|
-
this
|
127993
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, 0);
|
127994
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, null);
|
127956
127995
|
}
|
127957
127996
|
/**
|
127958
127997
|
* Binds the mouse events.
|
@@ -127968,7 +128007,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
127968
128007
|
this.eventManager.addEventListener(rootElement, 'mousedown', e => _classPrivateMethodGet(this, _onMouseDown, _onMouseDown2).call(this, e));
|
127969
128008
|
this.eventManager.addEventListener(rootWindow, 'mousemove', e => _classPrivateMethodGet(this, _onMouseMove, _onMouseMove2).call(this, e));
|
127970
128009
|
this.eventManager.addEventListener(rootWindow, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
|
127971
|
-
this.eventManager.addEventListener(this
|
128010
|
+
this.eventManager.addEventListener((0, _classPrivateFieldGet2.default)(this, _handle), 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
|
127972
128011
|
}
|
127973
128012
|
/**
|
127974
128013
|
* Destroys the plugin instance.
|
@@ -127984,20 +128023,20 @@ function _onMapInit2() {
|
|
127984
128023
|
if (typeof loadedManualColumnWidths !== 'undefined') {
|
127985
128024
|
this.hot.batchExecution(() => {
|
127986
128025
|
loadedManualColumnWidths.forEach((width, physicalIndex) => {
|
127987
|
-
this.
|
128026
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
|
127988
128027
|
});
|
127989
128028
|
}, true);
|
127990
128029
|
} else if (Array.isArray(initialSetting)) {
|
127991
128030
|
this.hot.batchExecution(() => {
|
127992
128031
|
initialSetting.forEach((width, physicalIndex) => {
|
127993
|
-
this.
|
128032
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
|
127994
128033
|
});
|
127995
128034
|
}, true);
|
127996
128035
|
(0, _classPrivateFieldSet2.default)(this, _config, initialSetting);
|
127997
128036
|
} else if (initialSetting === true && Array.isArray((0, _classPrivateFieldGet2.default)(this, _config))) {
|
127998
128037
|
this.hot.batchExecution(() => {
|
127999
128038
|
(0, _classPrivateFieldGet2.default)(this, _config).forEach((width, physicalIndex) => {
|
128000
|
-
this.
|
128039
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
|
128001
128040
|
});
|
128002
128041
|
}, true);
|
128003
128042
|
}
|
@@ -128010,7 +128049,7 @@ function _onMouseOver2(event) {
|
|
128010
128049
|
}
|
128011
128050
|
|
128012
128051
|
// A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
|
128013
|
-
if (this
|
128052
|
+
if ((0, _classPrivateFieldGet2.default)(this, _isTriggeredByRMB) === true) {
|
128014
128053
|
return;
|
128015
128054
|
}
|
128016
128055
|
if (this.checkIfColumnHeader(event.target)) {
|
@@ -128020,7 +128059,7 @@ function _onMouseOver2(event) {
|
|
128020
128059
|
}
|
128021
128060
|
const colspan = th.getAttribute('colspan');
|
128022
128061
|
if (th && (colspan === null || colspan === '1')) {
|
128023
|
-
if (!
|
128062
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
128024
128063
|
this.setupHandlePosition(th);
|
128025
128064
|
}
|
128026
128065
|
}
|
@@ -128028,24 +128067,24 @@ function _onMouseOver2(event) {
|
|
128028
128067
|
}
|
128029
128068
|
function _onMouseDown2(event) {
|
128030
128069
|
if ((0, _element.hasClass)(event.target, 'manualColumnResizer')) {
|
128031
|
-
this.setupHandlePosition(
|
128070
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
128032
128071
|
this.setupGuidePosition();
|
128033
|
-
this
|
128034
|
-
if (this
|
128035
|
-
this
|
128036
|
-
this.hot._registerTimeout(
|
128072
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, true);
|
128073
|
+
if ((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout) === null) {
|
128074
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, setTimeout(() => this.afterMouseDownTimeout(), 500));
|
128075
|
+
this.hot._registerTimeout((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout));
|
128037
128076
|
}
|
128038
|
-
this.
|
128077
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, (0, _classPrivateFieldGet2.default)(this, _dblclick) + 1);
|
128039
128078
|
this.startX = event.pageX;
|
128040
|
-
this
|
128079
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, (0, _classPrivateFieldGet2.default)(this, _startWidth));
|
128041
128080
|
}
|
128042
128081
|
}
|
128043
128082
|
function _onMouseMove2(event) {
|
128044
|
-
if (
|
128083
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
128045
128084
|
const change = (event.pageX - this.startX) * this.hot.getDirectionFactor();
|
128046
|
-
this
|
128047
|
-
(0, _array.arrayEach)(this
|
128048
|
-
this
|
128085
|
+
(0, _classPrivateFieldSet2.default)(this, _currentWidth, (0, _classPrivateFieldGet2.default)(this, _startWidth) + change);
|
128086
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
128087
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, this.setManualSize(selectedCol, (0, _classPrivateFieldGet2.default)(this, _currentWidth)));
|
128049
128088
|
});
|
128050
128089
|
this.refreshHandlePosition();
|
128051
128090
|
this.refreshGuidePosition();
|
@@ -128058,50 +128097,50 @@ function _onMouseUp2() {
|
|
128058
128097
|
this.hot.view.adjustElementsSize(true);
|
128059
128098
|
};
|
128060
128099
|
const resize = (column, forceRender) => {
|
128061
|
-
this.hot.runHooks('beforeColumnResize', this
|
128100
|
+
this.hot.runHooks('beforeColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, false);
|
128062
128101
|
if (forceRender) {
|
128063
128102
|
render();
|
128064
128103
|
}
|
128065
128104
|
this.saveManualColumnWidths();
|
128066
|
-
this.hot.runHooks('afterColumnResize', this
|
128105
|
+
this.hot.runHooks('afterColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, false);
|
128067
128106
|
};
|
128068
|
-
if (
|
128107
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
128069
128108
|
this.hideHandleAndGuide();
|
128070
|
-
this
|
128071
|
-
if (this
|
128072
|
-
const selectedColsLength = this.
|
128109
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
128110
|
+
if ((0, _classPrivateFieldGet2.default)(this, _newSize) !== (0, _classPrivateFieldGet2.default)(this, _startWidth)) {
|
128111
|
+
const selectedColsLength = (0, _classPrivateFieldGet2.default)(this, _selectedCols).length;
|
128073
128112
|
if (selectedColsLength > 1) {
|
128074
|
-
(0, _array.arrayEach)(this
|
128113
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
128075
128114
|
resize(selectedCol);
|
128076
128115
|
});
|
128077
128116
|
render();
|
128078
128117
|
} else {
|
128079
|
-
(0, _array.arrayEach)(this
|
128118
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
128080
128119
|
resize(selectedCol, true);
|
128081
128120
|
});
|
128082
128121
|
}
|
128083
128122
|
}
|
128084
|
-
this.setupHandlePosition(
|
128123
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
128085
128124
|
}
|
128086
128125
|
}
|
128087
128126
|
function _onContextMenu2() {
|
128088
128127
|
this.hideHandleAndGuide();
|
128089
|
-
this.hot.rootElement.removeChild(
|
128090
|
-
this.hot.rootElement.removeChild(
|
128091
|
-
this
|
128092
|
-
this
|
128128
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
128129
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
128130
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
128131
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, true);
|
128093
128132
|
|
128094
128133
|
// There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
|
128095
128134
|
// shouldn't be drawn just after removing it.
|
128096
128135
|
this.hot._registerImmediate(() => {
|
128097
|
-
this
|
128136
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, false);
|
128098
128137
|
});
|
128099
128138
|
}
|
128100
128139
|
function _onModifyColWidth2(width, column) {
|
128101
128140
|
let newWidth = width;
|
128102
128141
|
if (this.enabled) {
|
128103
128142
|
const physicalColumn = this.hot.toPhysicalColumn(column);
|
128104
|
-
const columnWidth = this.
|
128143
|
+
const columnWidth = (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValueAtIndex(physicalColumn);
|
128105
128144
|
if (this.hot.getSettings()[PLUGIN_KEY] && columnWidth) {
|
128106
128145
|
newWidth = columnWidth;
|
128107
128146
|
}
|
@@ -128109,7 +128148,7 @@ function _onModifyColWidth2(width, column) {
|
|
128109
128148
|
return newWidth;
|
128110
128149
|
}
|
128111
128150
|
function _onBeforeStretchingColumnWidth2(stretchedWidth, column) {
|
128112
|
-
let width = this.
|
128151
|
+
let width = (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValueAtIndex(column);
|
128113
128152
|
if (width === null) {
|
128114
128153
|
width = stretchedWidth;
|
128115
128154
|
}
|
@@ -128144,7 +128183,6 @@ var _interopRequireDefault = __webpack_require__(198);
|
|
128144
128183
|
exports.__esModule = true;
|
128145
128184
|
__webpack_require__(205);
|
128146
128185
|
__webpack_require__(275);
|
128147
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(454));
|
128148
128186
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(469));
|
128149
128187
|
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(466));
|
128150
128188
|
var _base = __webpack_require__(756);
|
@@ -128152,8 +128190,8 @@ var _pluginHooks = _interopRequireDefault(__webpack_require__(461));
|
|
128152
128190
|
var _array = __webpack_require__(446);
|
128153
128191
|
var _element = __webpack_require__(304);
|
128154
128192
|
var _number = __webpack_require__(474);
|
128155
|
-
var
|
128156
|
-
var
|
128193
|
+
var _backlight2 = _interopRequireDefault(__webpack_require__(940));
|
128194
|
+
var _guideline2 = _interopRequireDefault(__webpack_require__(942));
|
128157
128195
|
__webpack_require__(943);
|
128158
128196
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
128159
128197
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
@@ -128194,6 +128232,8 @@ const CSS_AFTER_SELECTION = 'after-selection--rows';
|
|
128194
128232
|
* @class ManualRowMove
|
128195
128233
|
* @plugin ManualRowMove
|
128196
128234
|
*/
|
128235
|
+
var _backlight = /*#__PURE__*/new WeakMap();
|
128236
|
+
var _guideline = /*#__PURE__*/new WeakMap();
|
128197
128237
|
var _rowsToMove = /*#__PURE__*/new WeakMap();
|
128198
128238
|
var _pressed = /*#__PURE__*/new WeakMap();
|
128199
128239
|
var _target = /*#__PURE__*/new WeakMap();
|
@@ -128248,17 +128288,21 @@ class ManualRowMove extends _base.BasePlugin {
|
|
128248
128288
|
/**
|
128249
128289
|
* Backlight UI object.
|
128250
128290
|
*
|
128251
|
-
* @private
|
128252
128291
|
* @type {object}
|
128253
128292
|
*/
|
128254
|
-
(
|
128293
|
+
_classPrivateFieldInitSpec(this, _backlight, {
|
128294
|
+
writable: true,
|
128295
|
+
value: new _backlight2.default(this.hot)
|
128296
|
+
});
|
128255
128297
|
/**
|
128256
128298
|
* Guideline UI object.
|
128257
128299
|
*
|
128258
|
-
* @private
|
128259
128300
|
* @type {object}
|
128260
128301
|
*/
|
128261
|
-
(
|
128302
|
+
_classPrivateFieldInitSpec(this, _guideline, {
|
128303
|
+
writable: true,
|
128304
|
+
value: new _guideline2.default(this.hot)
|
128305
|
+
});
|
128262
128306
|
/**
|
128263
128307
|
* @type {number[]}
|
128264
128308
|
*/
|
@@ -128358,8 +128402,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
128358
128402
|
disablePlugin() {
|
128359
128403
|
(0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);
|
128360
128404
|
this.unregisterEvents();
|
128361
|
-
this.
|
128362
|
-
this.
|
128405
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
128406
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
128363
128407
|
super.disablePlugin();
|
128364
128408
|
}
|
128365
128409
|
|
@@ -128624,8 +128668,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
128624
128668
|
const pixelsRelToTableStart = (0, _classPrivateFieldGet2.default)(this, _target).eventPageY - pixelsAbove + tableScroll;
|
128625
128669
|
const hiderHeight = wtTable.hider.offsetHeight;
|
128626
128670
|
const tbodyOffsetTop = wtTable.TBODY.offsetTop;
|
128627
|
-
const backlightElemMarginTop = this.
|
128628
|
-
const backlightElemHeight = this.
|
128671
|
+
const backlightElemMarginTop = (0, _classPrivateFieldGet2.default)(this, _backlight).getOffset().top;
|
128672
|
+
const backlightElemHeight = (0, _classPrivateFieldGet2.default)(this, _backlight).getSize().height;
|
128629
128673
|
const tdMiddle = TD.offsetHeight / 2;
|
128630
128674
|
const tdHeight = TD.offsetHeight;
|
128631
128675
|
let tdStartPixel = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row - 1);
|
@@ -128658,8 +128702,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
128658
128702
|
// prevent display guideline below table
|
128659
128703
|
guidelineTop = hiderHeight - 1;
|
128660
128704
|
}
|
128661
|
-
this.
|
128662
|
-
this.
|
128705
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(backlightTop);
|
128706
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).setPosition(guidelineTop);
|
128663
128707
|
}
|
128664
128708
|
|
128665
128709
|
/**
|
@@ -128689,15 +128733,15 @@ class ManualRowMove extends _base.BasePlugin {
|
|
128689
128733
|
* @private
|
128690
128734
|
*/
|
128691
128735
|
buildPluginUI() {
|
128692
|
-
this.
|
128693
|
-
this.
|
128736
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).build();
|
128737
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).build();
|
128694
128738
|
}
|
128695
128739
|
/**
|
128696
128740
|
* Destroys the plugin instance.
|
128697
128741
|
*/
|
128698
128742
|
destroy() {
|
128699
|
-
this.
|
128700
|
-
this.
|
128743
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
128744
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
128701
128745
|
super.destroy();
|
128702
128746
|
}
|
128703
128747
|
}
|
@@ -128715,11 +128759,11 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
128715
128759
|
(0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);
|
128716
128760
|
return;
|
128717
128761
|
}
|
128718
|
-
const guidelineIsNotReady = this.
|
128719
|
-
const backlightIsNotReady = this.
|
128762
|
+
const guidelineIsNotReady = (0, _classPrivateFieldGet2.default)(this, _guideline).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _guideline).isAppended();
|
128763
|
+
const backlightIsNotReady = (0, _classPrivateFieldGet2.default)(this, _backlight).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _backlight).isAppended();
|
128720
128764
|
if (guidelineIsNotReady && backlightIsNotReady) {
|
128721
|
-
this.
|
128722
|
-
this.
|
128765
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).appendTo(wtTable.hider);
|
128766
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).appendTo(wtTable.hider);
|
128723
128767
|
}
|
128724
128768
|
const {
|
128725
128769
|
from,
|
@@ -128736,9 +128780,9 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
128736
128780
|
(0, _classPrivateFieldSet2.default)(this, _rowsToMove, this.prepareRowsToMoving());
|
128737
128781
|
const leftPos = wtTable.holder.scrollLeft + wtViewport.getRowHeaderWidth();
|
128738
128782
|
const topOffset = this.getRowsHeight(start, coords.row - 1) + event.offsetY;
|
128739
|
-
this.
|
128740
|
-
this.
|
128741
|
-
this.
|
128783
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(null, leftPos);
|
128784
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end));
|
128785
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setOffset(-topOffset, null);
|
128742
128786
|
(0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);
|
128743
128787
|
this.refreshPositions();
|
128744
128788
|
} else {
|
@@ -128799,8 +128843,8 @@ function _onAfterScrollHorizontally2() {
|
|
128799
128843
|
const headerWidth = this.hot.view._wt.wtViewport.getRowHeaderWidth();
|
128800
128844
|
const scrollLeft = wtTable.holder.scrollLeft;
|
128801
128845
|
const posLeft = headerWidth + scrollLeft;
|
128802
|
-
this.
|
128803
|
-
this.
|
128846
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(null, posLeft);
|
128847
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(wtTable.hider.offsetWidth - posLeft);
|
128804
128848
|
}
|
128805
128849
|
function _onAfterLoadData2() {
|
128806
128850
|
this.moveBySettingsOrLoad();
|
@@ -129066,13 +129110,12 @@ exports.ManualRowResize = _manualRowResize.ManualRowResize;
|
|
129066
129110
|
"use strict";
|
129067
129111
|
|
129068
129112
|
|
129113
|
+
__webpack_require__(275);
|
129069
129114
|
var _interopRequireDefault = __webpack_require__(198);
|
129070
129115
|
exports.__esModule = true;
|
129071
129116
|
__webpack_require__(205);
|
129072
|
-
__webpack_require__(275);
|
129073
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(454));
|
129074
|
-
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(466));
|
129075
129117
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(469));
|
129118
|
+
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(466));
|
129076
129119
|
var _base = __webpack_require__(756);
|
129077
129120
|
var _element = __webpack_require__(304);
|
129078
129121
|
var _array = __webpack_require__(446);
|
@@ -129103,6 +129146,21 @@ const PERSISTENT_STATE_KEY = 'manualRowHeights';
|
|
129103
129146
|
* - handle - the draggable element that sets the desired height of the row.
|
129104
129147
|
* - guide - the helper guide that shows the desired height as a horizontal guide.
|
129105
129148
|
*/
|
129149
|
+
var _currentTH = /*#__PURE__*/new WeakMap();
|
129150
|
+
var _currentRow = /*#__PURE__*/new WeakMap();
|
129151
|
+
var _selectedRows = /*#__PURE__*/new WeakMap();
|
129152
|
+
var _currentHeight = /*#__PURE__*/new WeakMap();
|
129153
|
+
var _newSize = /*#__PURE__*/new WeakMap();
|
129154
|
+
var _startY = /*#__PURE__*/new WeakMap();
|
129155
|
+
var _startHeight = /*#__PURE__*/new WeakMap();
|
129156
|
+
var _startOffset = /*#__PURE__*/new WeakMap();
|
129157
|
+
var _handle = /*#__PURE__*/new WeakMap();
|
129158
|
+
var _guide = /*#__PURE__*/new WeakMap();
|
129159
|
+
var _pressed = /*#__PURE__*/new WeakMap();
|
129160
|
+
var _isTriggeredByRMB = /*#__PURE__*/new WeakMap();
|
129161
|
+
var _dblclick = /*#__PURE__*/new WeakMap();
|
129162
|
+
var _autoresizeTimeout = /*#__PURE__*/new WeakMap();
|
129163
|
+
var _rowHeightsMap = /*#__PURE__*/new WeakMap();
|
129106
129164
|
var _config = /*#__PURE__*/new WeakMap();
|
129107
129165
|
var _onMouseOver = /*#__PURE__*/new WeakSet();
|
129108
129166
|
var _onMouseDown = /*#__PURE__*/new WeakSet();
|
@@ -129166,66 +129224,110 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129166
129224
|
* @param {MouseEvent} event The mouse event.
|
129167
129225
|
*/
|
129168
129226
|
_classPrivateMethodInitSpec(this, _onMouseOver);
|
129169
|
-
(
|
129227
|
+
_classPrivateFieldInitSpec(this, _currentTH, {
|
129228
|
+
writable: true,
|
129229
|
+
value: null
|
129230
|
+
});
|
129170
129231
|
/**
|
129171
129232
|
* @type {number}
|
129172
129233
|
*/
|
129173
|
-
(
|
129234
|
+
_classPrivateFieldInitSpec(this, _currentRow, {
|
129235
|
+
writable: true,
|
129236
|
+
value: null
|
129237
|
+
});
|
129174
129238
|
/**
|
129175
129239
|
* @type {number[]}
|
129176
129240
|
*/
|
129177
|
-
(
|
129241
|
+
_classPrivateFieldInitSpec(this, _selectedRows, {
|
129242
|
+
writable: true,
|
129243
|
+
value: []
|
129244
|
+
});
|
129178
129245
|
/**
|
129179
129246
|
* @type {number}
|
129180
129247
|
*/
|
129181
|
-
(
|
129248
|
+
_classPrivateFieldInitSpec(this, _currentHeight, {
|
129249
|
+
writable: true,
|
129250
|
+
value: null
|
129251
|
+
});
|
129182
129252
|
/**
|
129183
129253
|
* @type {number}
|
129184
129254
|
*/
|
129185
|
-
(
|
129255
|
+
_classPrivateFieldInitSpec(this, _newSize, {
|
129256
|
+
writable: true,
|
129257
|
+
value: null
|
129258
|
+
});
|
129186
129259
|
/**
|
129187
129260
|
* @type {number}
|
129188
129261
|
*/
|
129189
|
-
(
|
129262
|
+
_classPrivateFieldInitSpec(this, _startY, {
|
129263
|
+
writable: true,
|
129264
|
+
value: null
|
129265
|
+
});
|
129190
129266
|
/**
|
129191
129267
|
* @type {number}
|
129192
129268
|
*/
|
129193
|
-
(
|
129269
|
+
_classPrivateFieldInitSpec(this, _startHeight, {
|
129270
|
+
writable: true,
|
129271
|
+
value: null
|
129272
|
+
});
|
129194
129273
|
/**
|
129195
129274
|
* @type {number}
|
129196
129275
|
*/
|
129197
|
-
(
|
129276
|
+
_classPrivateFieldInitSpec(this, _startOffset, {
|
129277
|
+
writable: true,
|
129278
|
+
value: null
|
129279
|
+
});
|
129198
129280
|
/**
|
129199
129281
|
* @type {HTMLElement}
|
129200
129282
|
*/
|
129201
|
-
(
|
129283
|
+
_classPrivateFieldInitSpec(this, _handle, {
|
129284
|
+
writable: true,
|
129285
|
+
value: this.hot.rootDocument.createElement('DIV')
|
129286
|
+
});
|
129202
129287
|
/**
|
129203
129288
|
* @type {HTMLElement}
|
129204
129289
|
*/
|
129205
|
-
(
|
129290
|
+
_classPrivateFieldInitSpec(this, _guide, {
|
129291
|
+
writable: true,
|
129292
|
+
value: this.hot.rootDocument.createElement('DIV')
|
129293
|
+
});
|
129206
129294
|
/**
|
129207
129295
|
* @type {boolean}
|
129208
129296
|
*/
|
129209
|
-
(
|
129297
|
+
_classPrivateFieldInitSpec(this, _pressed, {
|
129298
|
+
writable: true,
|
129299
|
+
value: false
|
129300
|
+
});
|
129210
129301
|
/**
|
129211
129302
|
* @type {boolean}
|
129212
129303
|
*/
|
129213
|
-
(
|
129304
|
+
_classPrivateFieldInitSpec(this, _isTriggeredByRMB, {
|
129305
|
+
writable: true,
|
129306
|
+
value: false
|
129307
|
+
});
|
129214
129308
|
/**
|
129215
129309
|
* @type {number}
|
129216
129310
|
*/
|
129217
|
-
(
|
129311
|
+
_classPrivateFieldInitSpec(this, _dblclick, {
|
129312
|
+
writable: true,
|
129313
|
+
value: 0
|
129314
|
+
});
|
129218
129315
|
/**
|
129219
129316
|
* @type {number}
|
129220
129317
|
*/
|
129221
|
-
(
|
129318
|
+
_classPrivateFieldInitSpec(this, _autoresizeTimeout, {
|
129319
|
+
writable: true,
|
129320
|
+
value: null
|
129321
|
+
});
|
129222
129322
|
/**
|
129223
129323
|
* PhysicalIndexToValueMap to keep and track widths for physical row indexes.
|
129224
129324
|
*
|
129225
|
-
* @private
|
129226
129325
|
* @type {PhysicalIndexToValueMap}
|
129227
129326
|
*/
|
129228
|
-
(
|
129327
|
+
_classPrivateFieldInitSpec(this, _rowHeightsMap, {
|
129328
|
+
writable: true,
|
129329
|
+
value: void 0
|
129330
|
+
});
|
129229
129331
|
/**
|
129230
129332
|
* Private pool to save configuration from updateSettings.
|
129231
129333
|
*
|
@@ -129235,8 +129337,8 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129235
129337
|
writable: true,
|
129236
129338
|
value: void 0
|
129237
129339
|
});
|
129238
|
-
(0, _element.addClass)(this
|
129239
|
-
(0, _element.addClass)(this
|
129340
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'manualRowResizer');
|
129341
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'manualRowResizerGuide');
|
129240
129342
|
}
|
129241
129343
|
|
129242
129344
|
/**
|
@@ -129264,9 +129366,9 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129264
129366
|
if (this.enabled) {
|
129265
129367
|
return;
|
129266
129368
|
}
|
129267
|
-
this
|
129268
|
-
this.
|
129269
|
-
this.hot.rowIndexMapper.registerMap(this.pluginName,
|
129369
|
+
(0, _classPrivateFieldSet2.default)(this, _rowHeightsMap, new _translations.PhysicalIndexToValueMap());
|
129370
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
|
129371
|
+
this.hot.rowIndexMapper.registerMap(this.pluginName, (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap));
|
129270
129372
|
this.addHook('modifyRowHeight', (height, row) => _classPrivateMethodGet(this, _onModifyRowHeight, _onModifyRowHeight2).call(this, height, row));
|
129271
129373
|
this.bindEvents();
|
129272
129374
|
super.enablePlugin();
|
@@ -129288,7 +129390,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129288
129390
|
* Disables the plugin functionality for this Handsontable instance.
|
129289
129391
|
*/
|
129290
129392
|
disablePlugin() {
|
129291
|
-
(0, _classPrivateFieldSet2.default)(this, _config, this.
|
129393
|
+
(0, _classPrivateFieldSet2.default)(this, _config, (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).getValues());
|
129292
129394
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
129293
129395
|
super.disablePlugin();
|
129294
129396
|
}
|
@@ -129300,7 +129402,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129300
129402
|
* @fires Hooks#persistentStateSave
|
129301
129403
|
*/
|
129302
129404
|
saveManualRowHeights() {
|
129303
|
-
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.
|
129405
|
+
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).getValues());
|
129304
129406
|
}
|
129305
129407
|
|
129306
129408
|
/**
|
@@ -129326,7 +129428,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129326
129428
|
setManualSize(row, height) {
|
129327
129429
|
const physicalRow = this.hot.toPhysicalRow(row);
|
129328
129430
|
const newHeight = Math.max(height, _src.ViewportRowsCalculator.DEFAULT_HEIGHT);
|
129329
|
-
this.
|
129431
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(physicalRow, newHeight);
|
129330
129432
|
return newHeight;
|
129331
129433
|
}
|
129332
129434
|
|
@@ -129337,40 +129439,40 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129337
129439
|
* @param {HTMLCellElement} TH TH HTML element.
|
129338
129440
|
*/
|
129339
129441
|
setupHandlePosition(TH) {
|
129340
|
-
this
|
129442
|
+
(0, _classPrivateFieldSet2.default)(this, _currentTH, TH);
|
129341
129443
|
const {
|
129342
129444
|
view
|
129343
129445
|
} = this.hot;
|
129344
129446
|
const {
|
129345
129447
|
_wt: wt
|
129346
129448
|
} = view;
|
129347
|
-
const cellCoords = wt.wtTable.getCoords(
|
129449
|
+
const cellCoords = wt.wtTable.getCoords((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
129348
129450
|
const row = cellCoords.row;
|
129349
129451
|
|
129350
129452
|
// Ignore row headers.
|
129351
129453
|
if (row < 0) {
|
129352
129454
|
return;
|
129353
129455
|
}
|
129354
|
-
const headerWidth = (0, _element.outerWidth)(
|
129355
|
-
const box = this.
|
129456
|
+
const headerWidth = (0, _element.outerWidth)((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
129457
|
+
const box = (0, _classPrivateFieldGet2.default)(this, _currentTH).getBoundingClientRect();
|
129356
129458
|
// Read "fixedRowsTop" and "fixedRowsBottom" through the Walkontable as in that context, the fixed
|
129357
129459
|
// rows are modified (reduced by the number of hidden rows) by TableView module.
|
129358
129460
|
const fixedRowTop = row < wt.getSetting('fixedRowsTop');
|
129359
129461
|
const fixedRowBottom = row >= view.countNotHiddenRowIndexes(0, 1) - wt.getSetting('fixedRowsBottom');
|
129360
129462
|
let relativeHeaderPosition;
|
129361
129463
|
if (fixedRowTop) {
|
129362
|
-
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(this
|
129464
|
+
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
129363
129465
|
} else if (fixedRowBottom) {
|
129364
|
-
relativeHeaderPosition = wt.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(this
|
129466
|
+
relativeHeaderPosition = wt.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
129365
129467
|
}
|
129366
129468
|
|
129367
129469
|
// If the TH is not a child of the top-left/bottom-left overlay, recalculate using
|
129368
129470
|
// the left overlay - as this overlay contains the rest of the headers.
|
129369
129471
|
if (!relativeHeaderPosition) {
|
129370
|
-
relativeHeaderPosition = wt.wtOverlays.inlineStartOverlay.getRelativeCellPosition(this
|
129472
|
+
relativeHeaderPosition = wt.wtOverlays.inlineStartOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
129371
129473
|
}
|
129372
|
-
this
|
129373
|
-
this
|
129474
|
+
(0, _classPrivateFieldSet2.default)(this, _currentRow, this.hot.rowIndexMapper.getVisualFromRenderableIndex(row));
|
129475
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedRows, []);
|
129374
129476
|
const isFullRowSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByRowHeader();
|
129375
129477
|
if (this.hot.selection.isSelected() && isFullRowSelected) {
|
129376
129478
|
const selectionRanges = this.hot.getSelectedRange();
|
@@ -129380,23 +129482,23 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129380
129482
|
|
129381
129483
|
// Add every selected row for resize action.
|
129382
129484
|
(0, _number.rangeEach)(fromRow, toRow, rowIndex => {
|
129383
|
-
if (!this.
|
129384
|
-
this.
|
129485
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedRows).includes(rowIndex)) {
|
129486
|
+
(0, _classPrivateFieldGet2.default)(this, _selectedRows).push(rowIndex);
|
129385
129487
|
}
|
129386
129488
|
});
|
129387
129489
|
});
|
129388
129490
|
}
|
129389
129491
|
|
129390
129492
|
// Resizing element beyond the current selection (also when there is no selection).
|
129391
|
-
if (!this.
|
129392
|
-
this
|
129493
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedRows).includes((0, _classPrivateFieldGet2.default)(this, _currentRow))) {
|
129494
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedRows, [(0, _classPrivateFieldGet2.default)(this, _currentRow)]);
|
129393
129495
|
}
|
129394
|
-
this
|
129395
|
-
this
|
129396
|
-
this.
|
129397
|
-
this.
|
129398
|
-
this.
|
129399
|
-
this.hot.rootElement.appendChild(
|
129496
|
+
(0, _classPrivateFieldSet2.default)(this, _startOffset, relativeHeaderPosition.top - 6);
|
129497
|
+
(0, _classPrivateFieldSet2.default)(this, _startHeight, parseInt(box.height, 10));
|
129498
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.top = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _startHeight)}px`;
|
129499
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir] = `${relativeHeaderPosition.start}px`;
|
129500
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.width = `${headerWidth}px`;
|
129501
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
129400
129502
|
}
|
129401
129503
|
|
129402
129504
|
/**
|
@@ -129405,7 +129507,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129405
129507
|
* @private
|
129406
129508
|
*/
|
129407
129509
|
refreshHandlePosition() {
|
129408
|
-
this.
|
129510
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.top = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _currentHeight)}px`;
|
129409
129511
|
}
|
129410
129512
|
|
129411
129513
|
/**
|
@@ -129414,15 +129516,15 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129414
129516
|
* @private
|
129415
129517
|
*/
|
129416
129518
|
setupGuidePosition() {
|
129417
|
-
const handleWidth = parseInt((0, _element.outerWidth)(
|
129418
|
-
const handleEndPosition = parseInt(this.
|
129519
|
+
const handleWidth = parseInt((0, _element.outerWidth)((0, _classPrivateFieldGet2.default)(this, _handle)), 10);
|
129520
|
+
const handleEndPosition = parseInt((0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir], 10) + handleWidth;
|
129419
129521
|
const maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);
|
129420
|
-
(0, _element.addClass)(this
|
129421
|
-
(0, _element.addClass)(this
|
129422
|
-
this.
|
129423
|
-
this.
|
129424
|
-
this.
|
129425
|
-
this.hot.rootElement.appendChild(
|
129522
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
129523
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
129524
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.top = (0, _classPrivateFieldGet2.default)(this, _handle).style.top;
|
129525
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style[this.inlineDir] = `${handleEndPosition}px`;
|
129526
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.width = `${maximumVisibleElementWidth - handleWidth}px`;
|
129527
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
129426
129528
|
}
|
129427
129529
|
|
129428
129530
|
/**
|
@@ -129431,7 +129533,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129431
129533
|
* @private
|
129432
129534
|
*/
|
129433
129535
|
refreshGuidePosition() {
|
129434
|
-
this.
|
129536
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.top = (0, _classPrivateFieldGet2.default)(this, _handle).style.top;
|
129435
129537
|
}
|
129436
129538
|
|
129437
129539
|
/**
|
@@ -129440,8 +129542,8 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129440
129542
|
* @private
|
129441
129543
|
*/
|
129442
129544
|
hideHandleAndGuide() {
|
129443
|
-
(0, _element.removeClass)(this
|
129444
|
-
(0, _element.removeClass)(this
|
129545
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
129546
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
129445
129547
|
}
|
129446
129548
|
|
129447
129549
|
/**
|
@@ -129484,10 +129586,10 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129484
129586
|
getActualRowHeight(row) {
|
129485
129587
|
// TODO: this should utilize `this.hot.getRowHeight` after it's fixed and working properly.
|
129486
129588
|
const walkontableHeight = this.hot.view._wt.wtTable.getRowHeight(row);
|
129487
|
-
if (walkontableHeight !== undefined && this
|
129589
|
+
if (walkontableHeight !== undefined && (0, _classPrivateFieldGet2.default)(this, _newSize) < walkontableHeight) {
|
129488
129590
|
return walkontableHeight;
|
129489
129591
|
}
|
129490
|
-
return this
|
129592
|
+
return (0, _classPrivateFieldGet2.default)(this, _newSize);
|
129491
129593
|
}
|
129492
129594
|
/**
|
129493
129595
|
* Auto-size row after doubleclick - callback.
|
@@ -129505,30 +129607,30 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129505
129607
|
const resize = (row, forceRender) => {
|
129506
129608
|
const hookNewSize = this.hot.runHooks('beforeRowResize', this.getActualRowHeight(row), row, true);
|
129507
129609
|
if (hookNewSize !== undefined) {
|
129508
|
-
this
|
129610
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, hookNewSize);
|
129509
129611
|
}
|
129510
|
-
this.setManualSize(row,
|
129612
|
+
this.setManualSize(row, (0, _classPrivateFieldGet2.default)(this, _newSize)); // double click sets auto row size
|
129511
129613
|
|
129512
129614
|
this.hot.runHooks('afterRowResize', this.getActualRowHeight(row), row, true);
|
129513
129615
|
if (forceRender) {
|
129514
129616
|
render();
|
129515
129617
|
}
|
129516
129618
|
};
|
129517
|
-
if (this
|
129518
|
-
const selectedRowsLength = this.
|
129619
|
+
if ((0, _classPrivateFieldGet2.default)(this, _dblclick) >= 2) {
|
129620
|
+
const selectedRowsLength = (0, _classPrivateFieldGet2.default)(this, _selectedRows).length;
|
129519
129621
|
if (selectedRowsLength > 1) {
|
129520
|
-
(0, _array.arrayEach)(this
|
129622
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
129521
129623
|
resize(selectedRow);
|
129522
129624
|
});
|
129523
129625
|
render();
|
129524
129626
|
} else {
|
129525
|
-
(0, _array.arrayEach)(this
|
129627
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
129526
129628
|
resize(selectedRow, true);
|
129527
129629
|
});
|
129528
129630
|
}
|
129529
129631
|
}
|
129530
|
-
this
|
129531
|
-
this
|
129632
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, 0);
|
129633
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, null);
|
129532
129634
|
}
|
129533
129635
|
/**
|
129534
129636
|
* Binds the mouse events.
|
@@ -129544,7 +129646,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
129544
129646
|
this.eventManager.addEventListener(rootElement, 'mousedown', e => _classPrivateMethodGet(this, _onMouseDown, _onMouseDown2).call(this, e));
|
129545
129647
|
this.eventManager.addEventListener(rootWindow, 'mousemove', e => _classPrivateMethodGet(this, _onMouseMove, _onMouseMove2).call(this, e));
|
129546
129648
|
this.eventManager.addEventListener(rootWindow, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
|
129547
|
-
this.eventManager.addEventListener(this
|
129649
|
+
this.eventManager.addEventListener((0, _classPrivateFieldGet2.default)(this, _handle), 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
|
129548
129650
|
}
|
129549
129651
|
/**
|
129550
129652
|
* Destroys the plugin instance.
|
@@ -129562,13 +129664,13 @@ function _onMouseOver2(event) {
|
|
129562
129664
|
}
|
129563
129665
|
|
129564
129666
|
// A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
|
129565
|
-
if (this
|
129667
|
+
if ((0, _classPrivateFieldGet2.default)(this, _isTriggeredByRMB) === true) {
|
129566
129668
|
return;
|
129567
129669
|
}
|
129568
129670
|
if (this.checkIfRowHeader(event.target)) {
|
129569
129671
|
const th = this.getClosestTHParent(event.target);
|
129570
129672
|
if (th) {
|
129571
|
-
if (!
|
129673
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
129572
129674
|
this.setupHandlePosition(th);
|
129573
129675
|
}
|
129574
129676
|
}
|
@@ -129576,23 +129678,23 @@ function _onMouseOver2(event) {
|
|
129576
129678
|
}
|
129577
129679
|
function _onMouseDown2(event) {
|
129578
129680
|
if ((0, _element.hasClass)(event.target, 'manualRowResizer')) {
|
129579
|
-
this.setupHandlePosition(
|
129681
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
129580
129682
|
this.setupGuidePosition();
|
129581
|
-
this
|
129582
|
-
if (this
|
129583
|
-
this
|
129584
|
-
this.hot._registerTimeout(
|
129683
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, true);
|
129684
|
+
if ((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout) === null) {
|
129685
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, setTimeout(() => this.afterMouseDownTimeout(), 500));
|
129686
|
+
this.hot._registerTimeout((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout));
|
129585
129687
|
}
|
129586
|
-
this.
|
129587
|
-
this
|
129588
|
-
this
|
129688
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, (0, _classPrivateFieldGet2.default)(this, _dblclick) + 1);
|
129689
|
+
(0, _classPrivateFieldSet2.default)(this, _startY, event.pageY);
|
129690
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, (0, _classPrivateFieldGet2.default)(this, _startHeight));
|
129589
129691
|
}
|
129590
129692
|
}
|
129591
129693
|
function _onMouseMove2(event) {
|
129592
|
-
if (
|
129593
|
-
this
|
129594
|
-
(0, _array.arrayEach)(this
|
129595
|
-
this
|
129694
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
129695
|
+
(0, _classPrivateFieldSet2.default)(this, _currentHeight, (0, _classPrivateFieldGet2.default)(this, _startHeight) + (event.pageY - (0, _classPrivateFieldGet2.default)(this, _startY)));
|
129696
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
129697
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, this.setManualSize(selectedRow, (0, _classPrivateFieldGet2.default)(this, _currentHeight)));
|
129596
129698
|
});
|
129597
129699
|
this.refreshHandlePosition();
|
129598
129700
|
this.refreshGuidePosition();
|
@@ -129612,43 +129714,43 @@ function _onMouseUp2() {
|
|
129612
129714
|
this.saveManualRowHeights();
|
129613
129715
|
this.hot.runHooks('afterRowResize', this.getActualRowHeight(row), row, false);
|
129614
129716
|
};
|
129615
|
-
if (
|
129717
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
129616
129718
|
this.hideHandleAndGuide();
|
129617
|
-
this
|
129618
|
-
if (this
|
129619
|
-
const selectedRowsLength = this.
|
129719
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
129720
|
+
if ((0, _classPrivateFieldGet2.default)(this, _newSize) !== (0, _classPrivateFieldGet2.default)(this, _startHeight)) {
|
129721
|
+
const selectedRowsLength = (0, _classPrivateFieldGet2.default)(this, _selectedRows).length;
|
129620
129722
|
if (selectedRowsLength > 1) {
|
129621
|
-
(0, _array.arrayEach)(this
|
129723
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
129622
129724
|
runHooks(selectedRow);
|
129623
129725
|
});
|
129624
129726
|
render();
|
129625
129727
|
} else {
|
129626
|
-
(0, _array.arrayEach)(this
|
129728
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
129627
129729
|
runHooks(selectedRow, true);
|
129628
129730
|
});
|
129629
129731
|
}
|
129630
129732
|
}
|
129631
|
-
this.setupHandlePosition(
|
129733
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
129632
129734
|
}
|
129633
129735
|
}
|
129634
129736
|
function _onContextMenu2() {
|
129635
129737
|
this.hideHandleAndGuide();
|
129636
|
-
this.hot.rootElement.removeChild(
|
129637
|
-
this.hot.rootElement.removeChild(
|
129638
|
-
this
|
129639
|
-
this
|
129738
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
129739
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
129740
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
129741
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, true);
|
129640
129742
|
|
129641
129743
|
// There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
|
129642
129744
|
// shouldn't be drawn just after removing it.
|
129643
129745
|
this.hot._registerImmediate(() => {
|
129644
|
-
this
|
129746
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, false);
|
129645
129747
|
});
|
129646
129748
|
}
|
129647
129749
|
function _onModifyRowHeight2(height, row) {
|
129648
129750
|
let newHeight = height;
|
129649
129751
|
if (this.enabled) {
|
129650
129752
|
const physicalRow = this.hot.toPhysicalRow(row);
|
129651
|
-
const rowHeight = this.
|
129753
|
+
const rowHeight = (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).getValueAtIndex(physicalRow);
|
129652
129754
|
if (this.hot.getSettings()[PLUGIN_KEY] && rowHeight) {
|
129653
129755
|
newHeight = rowHeight;
|
129654
129756
|
}
|
@@ -129661,16 +129763,16 @@ function _onMapInit2() {
|
|
129661
129763
|
this.hot.batchExecution(() => {
|
129662
129764
|
if (typeof loadedManualRowHeights !== 'undefined') {
|
129663
129765
|
loadedManualRowHeights.forEach((height, index) => {
|
129664
|
-
this.
|
129766
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(index, height);
|
129665
129767
|
});
|
129666
129768
|
} else if (Array.isArray(initialSetting)) {
|
129667
129769
|
initialSetting.forEach((height, index) => {
|
129668
|
-
this.
|
129770
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(index, height);
|
129669
129771
|
});
|
129670
129772
|
(0, _classPrivateFieldSet2.default)(this, _config, initialSetting);
|
129671
129773
|
} else if (initialSetting === true && Array.isArray((0, _classPrivateFieldGet2.default)(this, _config))) {
|
129672
129774
|
(0, _classPrivateFieldGet2.default)(this, _config).forEach((height, index) => {
|
129673
|
-
this.
|
129775
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(index, height);
|
129674
129776
|
});
|
129675
129777
|
}
|
129676
129778
|
}, true);
|