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
package/dist/handsontable.js
CHANGED
@@ -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')
|
@@ -105,8 +105,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
105
105
|
Handsontable.CellCoords = _src.CellCoords;
|
106
106
|
Handsontable.CellRange = _src.CellRange;
|
107
107
|
Handsontable.packageName = 'handsontable';
|
108
|
-
Handsontable.buildDate = "
|
109
|
-
Handsontable.version = "14.0.0-next-
|
108
|
+
Handsontable.buildDate = "16/11/2023 08:19:27";
|
109
|
+
Handsontable.version = "14.0.0-next-ae5997a-20231116";
|
110
110
|
Handsontable.languages = {
|
111
111
|
dictionaryKeys: _registry.dictionaryKeys,
|
112
112
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
@@ -8542,7 +8542,7 @@ const domMessages = {
|
|
8542
8542
|
function _injectProductInfo(key, element) {
|
8543
8543
|
const hasValidType = !isEmpty(key);
|
8544
8544
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
8545
|
-
const hotVersion = "14.0.0-next-
|
8545
|
+
const hotVersion = "14.0.0-next-ae5997a-20231116";
|
8546
8546
|
let keyValidityDate;
|
8547
8547
|
let consoleMessageState = 'invalid';
|
8548
8548
|
let domMessageState = 'invalid';
|
@@ -8550,7 +8550,7 @@ function _injectProductInfo(key, element) {
|
|
8550
8550
|
const schemaValidity = _checkKeySchema(key);
|
8551
8551
|
if (hasValidType || isNonCommercial || schemaValidity) {
|
8552
8552
|
if (schemaValidity) {
|
8553
|
-
const releaseDate = (0, _moment.default)("
|
8553
|
+
const releaseDate = (0, _moment.default)("22/11/2023", 'DD/MM/YYYY');
|
8554
8554
|
const releaseDays = Math.floor(releaseDate.toDate().getTime() / 8.64e7);
|
8555
8555
|
const keyValidityDays = _extractTime(key);
|
8556
8556
|
keyValidityDate = (0, _moment.default)((keyValidityDays + 1) * 8.64e7, 'x').format('MMMM DD, YYYY');
|
@@ -33996,39 +33996,39 @@ class Transformation {
|
|
33996
33996
|
const autoWrapCol = (0, _classPrivateFieldGet2.default)(this, _options).autoWrapCol();
|
33997
33997
|
const zeroBasedCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(row + delta.row, col + delta.col);
|
33998
33998
|
if (zeroBasedCoords.row >= height) {
|
33999
|
-
const
|
34000
|
-
const isWrapEnabled = !autoInsertingMode && autoWrapCol;
|
33999
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareRows > 0 && fixedRowsBottom === 0);
|
34001
34000
|
const nextColumn = zeroBasedCoords.col + 1;
|
34002
34001
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(zeroBasedCoords.row - height, nextColumn >= width ? nextColumn - width : nextColumn);
|
34003
|
-
this.runLocalHooks('beforeColumnWrap',
|
34004
|
-
if (
|
34002
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextColumn >= width);
|
34003
|
+
if (isActionInterrupted.value) {
|
34005
34004
|
this.runLocalHooks('insertRowRequire', (0, _classPrivateFieldGet2.default)(this, _options).countRenderableRows());
|
34006
|
-
} else if (
|
34005
|
+
} else if (autoWrapCol) {
|
34007
34006
|
zeroBasedCoords.assign(newCoords);
|
34008
34007
|
}
|
34009
34008
|
} else if (zeroBasedCoords.row < 0) {
|
34009
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapCol);
|
34010
34010
|
const previousColumn = zeroBasedCoords.col - 1;
|
34011
34011
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(height + zeroBasedCoords.row, previousColumn < 0 ? width + previousColumn : previousColumn);
|
34012
|
-
this.runLocalHooks('beforeColumnWrap',
|
34012
|
+
this.runLocalHooks('beforeColumnWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousColumn < 0);
|
34013
34013
|
if (autoWrapCol) {
|
34014
34014
|
zeroBasedCoords.assign(newCoords);
|
34015
34015
|
}
|
34016
34016
|
}
|
34017
34017
|
if (zeroBasedCoords.col >= width) {
|
34018
|
-
const
|
34019
|
-
const isWrapEnabled = !autoInsertingMode && autoWrapRow;
|
34018
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(createMissingRecords && minSpareCols > 0);
|
34020
34019
|
const nextRow = zeroBasedCoords.row + 1;
|
34021
34020
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(nextRow >= height ? nextRow - height : nextRow, zeroBasedCoords.col - width);
|
34022
|
-
this.runLocalHooks('beforeRowWrap',
|
34023
|
-
if (
|
34021
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), nextRow >= height);
|
34022
|
+
if (isActionInterrupted.value) {
|
34024
34023
|
this.runLocalHooks('insertColRequire', (0, _classPrivateFieldGet2.default)(this, _options).countRenderableColumns());
|
34025
|
-
} else if (
|
34024
|
+
} else if (autoWrapRow) {
|
34026
34025
|
zeroBasedCoords.assign(newCoords);
|
34027
34026
|
}
|
34028
34027
|
} else if (zeroBasedCoords.col < 0) {
|
34028
|
+
const isActionInterrupted = (0, _object.createObjectPropListener)(autoWrapRow);
|
34029
34029
|
const previousRow = zeroBasedCoords.row - 1;
|
34030
34030
|
const newCoords = (0, _classPrivateFieldGet2.default)(this, _options).createCellCoords(previousRow < 0 ? height + previousRow : previousRow, width + zeroBasedCoords.col);
|
34031
|
-
this.runLocalHooks('beforeRowWrap',
|
34031
|
+
this.runLocalHooks('beforeRowWrap', isActionInterrupted, _classPrivateMethodGet(this, _zeroBasedToVisualCoords, _zeroBasedToVisualCoords2).call(this, newCoords), previousRow < 0);
|
34032
34032
|
if (autoWrapRow) {
|
34033
34033
|
zeroBasedCoords.assign(newCoords);
|
34034
34034
|
}
|
@@ -39203,7 +39203,7 @@ var _default = () => {
|
|
39203
39203
|
*/
|
39204
39204
|
multiColumnSorting: undefined,
|
39205
39205
|
/**
|
39206
|
-
* 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 [`
|
39206
|
+
* 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`).
|
39207
39207
|
*
|
39208
39208
|
* @since 14.0.0
|
39209
39209
|
* @memberof Options#
|
@@ -39222,27 +39222,27 @@ var _default = () => {
|
|
39222
39222
|
*/
|
39223
39223
|
navigableHeaders: false,
|
39224
39224
|
/**
|
39225
|
-
* When set to `
|
39225
|
+
* When set to `false`, the `tabNavigation` option changes the behavior of the
|
39226
39226
|
* <kbd>Tab</kbd> and <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts. The Handsontable
|
39227
|
-
* no more captures that shortcuts to make the grid navigation available (`
|
39227
|
+
* no more captures that shortcuts to make the grid navigation available (`tabNavigation: true`)
|
39228
39228
|
* but returns control to the browser so the native page navigation is possible.
|
39229
39229
|
*
|
39230
39230
|
* @since 14.0.0
|
39231
39231
|
* @memberof Options#
|
39232
39232
|
* @type {boolean}
|
39233
|
-
* @default
|
39233
|
+
* @default true
|
39234
39234
|
* @category Core
|
39235
39235
|
*
|
39236
39236
|
* @example
|
39237
39237
|
* ```js
|
39238
39238
|
* // you can't navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
|
39239
|
-
*
|
39239
|
+
* tabNavigation: false,
|
39240
39240
|
*
|
39241
39241
|
* // default behavior: you can navigate row and column headers using <kbd>Tab</kbd> or <kbd>Shift</kbd>+<kbd>Tab</kbd> keyboard shortcuts
|
39242
|
-
*
|
39242
|
+
* tabNavigation: true,
|
39243
39243
|
* ```
|
39244
39244
|
*/
|
39245
|
-
|
39245
|
+
tabNavigation: true,
|
39246
39246
|
/**
|
39247
39247
|
* @description
|
39248
39248
|
* The `nestedHeaders` option configures the [`NestedHeaders`](@/api/nestedHeaders.md) plugin.
|
@@ -41936,7 +41936,7 @@ function installFocusCatcher(hot) {
|
|
41936
41936
|
recentlyAddedFocusCoords = (_hot$getSelectedRange = hot.getSelectedRangeLast()) === null || _hot$getSelectedRange === void 0 ? void 0 : _hot$getSelectedRange.highlight;
|
41937
41937
|
}
|
41938
41938
|
});
|
41939
|
-
hot.addHook('beforeRowWrap', (
|
41939
|
+
hot.addHook('beforeRowWrap', (interruptedByAutoInsertMode, newCoords, isFlipped) => {
|
41940
41940
|
rowWrapState.wrapped = true;
|
41941
41941
|
rowWrapState.flipped = isFlipped;
|
41942
41942
|
});
|
@@ -41952,7 +41952,6 @@ function installFocusCatcher(hot) {
|
|
41952
41952
|
}
|
41953
41953
|
const shortcutOptions = {
|
41954
41954
|
keys: [['Tab'], ['Shift', 'Tab']],
|
41955
|
-
runOnlyIf: () => !hot.getSettings().minSpareCols,
|
41956
41955
|
preventDefault: false,
|
41957
41956
|
stopPropagation: false,
|
41958
41957
|
relativeToGroup: _shortcutContexts.GRID_GROUP,
|
@@ -41962,7 +41961,7 @@ function installFocusCatcher(hot) {
|
|
41962
41961
|
...shortcutOptions,
|
41963
41962
|
callback: () => {
|
41964
41963
|
isTabOrShiftTabPressed = true;
|
41965
|
-
if (hot.getSelectedRangeLast() && hot.getSettings().
|
41964
|
+
if (hot.getSelectedRangeLast() && !hot.getSettings().tabNavigation) {
|
41966
41965
|
isSavingCoordsEnabled = false;
|
41967
41966
|
}
|
41968
41967
|
},
|
@@ -41971,12 +41970,12 @@ function installFocusCatcher(hot) {
|
|
41971
41970
|
...shortcutOptions,
|
41972
41971
|
callback: event => {
|
41973
41972
|
const {
|
41974
|
-
|
41973
|
+
tabNavigation,
|
41975
41974
|
autoWrapRow
|
41976
41975
|
} = hot.getSettings();
|
41977
41976
|
isTabOrShiftTabPressed = false;
|
41978
41977
|
isSavingCoordsEnabled = true;
|
41979
|
-
if (
|
41978
|
+
if (!tabNavigation || !hot.selection.isSelected() || autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped || !autoWrapRow && rowWrapState.wrapped) {
|
41980
41979
|
if (autoWrapRow && rowWrapState.wrapped && rowWrapState.flipped) {
|
41981
41980
|
recentlyAddedFocusCoords = event.shiftKey ? getMostTopStartPosition(hot) : getMostBottomEndPosition(hot);
|
41982
41981
|
}
|
@@ -42803,7 +42802,7 @@ const command = exports.command = {
|
|
42803
42802
|
callback(hot, event) {
|
42804
42803
|
const settings = hot.getSettings();
|
42805
42804
|
const tabMoves = typeof settings.tabMoves === 'function' ? settings.tabMoves(event) : settings.tabMoves;
|
42806
|
-
hot.selection.transformStart(tabMoves.row, tabMoves.col
|
42805
|
+
hot.selection.transformStart(tabMoves.row, tabMoves.col);
|
42807
42806
|
}
|
42808
42807
|
};
|
42809
42808
|
|
@@ -44603,6 +44602,7 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
44603
44602
|
registerShortcuts() {
|
44604
44603
|
const shortcutManager = this.hot.getShortcutManager();
|
44605
44604
|
const editorContext = shortcutManager.getContext('editor');
|
44605
|
+
const gridContext = shortcutManager.getContext('grid');
|
44606
44606
|
const contextConfig = {
|
44607
44607
|
runOnlyIf: () => (0, _mixed.isDefined)(this.hot.getSelected()),
|
44608
44608
|
group: SHORTCUTS_GROUP
|
@@ -44611,21 +44611,9 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
44611
44611
|
this.hot.rootDocument.execCommand('insertText', false, '\n');
|
44612
44612
|
};
|
44613
44613
|
editorContext.addShortcuts([{
|
44614
|
-
keys: [['Tab']],
|
44615
|
-
|
44616
|
-
callback:
|
44617
|
-
const tableMeta = this.hot.getSettings();
|
44618
|
-
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
44619
|
-
this.hot.selection.transformStart(tabMoves.row, tabMoves.col, true);
|
44620
|
-
}
|
44621
|
-
}, {
|
44622
|
-
keys: [['Shift', 'Tab']],
|
44623
|
-
// TODO: Duplicated part of code (callback to shortcut).
|
44624
|
-
callback: event => {
|
44625
|
-
const tableMeta = this.hot.getSettings();
|
44626
|
-
const tabMoves = typeof tableMeta.tabMoves === 'function' ? tableMeta.tabMoves(event) : tableMeta.tabMoves;
|
44627
|
-
this.hot.selection.transformStart(-tabMoves.row, -tabMoves.col);
|
44628
|
-
}
|
44614
|
+
keys: [['Tab'], ['Shift', 'Tab'], ['PageUp'], ['PageDown']],
|
44615
|
+
forwardToContext: gridContext,
|
44616
|
+
callback: () => {}
|
44629
44617
|
}, {
|
44630
44618
|
keys: [['Control', 'Enter']],
|
44631
44619
|
callback: () => {
|
@@ -44651,18 +44639,6 @@ class TextEditor extends _baseEditor.BaseEditor {
|
|
44651
44639
|
insertNewLine();
|
44652
44640
|
return false; // Will block closing editor.
|
44653
44641
|
}
|
44654
|
-
}, {
|
44655
|
-
// TODO: Duplicated part of code (callback to shortcut)
|
44656
|
-
keys: [['PageUp']],
|
44657
|
-
callback: () => {
|
44658
|
-
this.hot.selection.transformStart(-this.hot.countVisibleRows(), 0);
|
44659
|
-
}
|
44660
|
-
}, {
|
44661
|
-
// TODO: Duplicated part of code (callback to shortcut)
|
44662
|
-
keys: [['PageDown']],
|
44663
|
-
callback: () => {
|
44664
|
-
this.hot.selection.transformStart(this.hot.countVisibleRows(), 0);
|
44665
|
-
}
|
44666
44642
|
}, {
|
44667
44643
|
keys: [['Home']],
|
44668
44644
|
callback: (event, _ref) => {
|
@@ -73771,7 +73747,6 @@ var _interopRequireDefault = __webpack_require__(1);
|
|
73771
73747
|
exports.__esModule = true;
|
73772
73748
|
__webpack_require__(8);
|
73773
73749
|
__webpack_require__(78);
|
73774
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(121));
|
73775
73750
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(136));
|
73776
73751
|
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(133));
|
73777
73752
|
var _base = __webpack_require__(423);
|
@@ -73780,8 +73755,8 @@ var _array = __webpack_require__(113);
|
|
73780
73755
|
var _element = __webpack_require__(107);
|
73781
73756
|
var _event = __webpack_require__(126);
|
73782
73757
|
var _number = __webpack_require__(141);
|
73783
|
-
var
|
73784
|
-
var
|
73758
|
+
var _backlight2 = _interopRequireDefault(__webpack_require__(599));
|
73759
|
+
var _guideline2 = _interopRequireDefault(__webpack_require__(601));
|
73785
73760
|
__webpack_require__(602);
|
73786
73761
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
73787
73762
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
@@ -73823,6 +73798,8 @@ const CSS_AFTER_SELECTION = 'after-selection--columns';
|
|
73823
73798
|
* @class ManualColumnMove
|
73824
73799
|
* @plugin ManualColumnMove
|
73825
73800
|
*/
|
73801
|
+
var _backlight = /*#__PURE__*/new WeakMap();
|
73802
|
+
var _guideline = /*#__PURE__*/new WeakMap();
|
73826
73803
|
var _columnsToMove = /*#__PURE__*/new WeakMap();
|
73827
73804
|
var _countCols = /*#__PURE__*/new WeakMap();
|
73828
73805
|
var _pressed = /*#__PURE__*/new WeakMap();
|
@@ -73884,17 +73861,21 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
73884
73861
|
/**
|
73885
73862
|
* Backlight UI object.
|
73886
73863
|
*
|
73887
|
-
* @private
|
73888
73864
|
* @type {object}
|
73889
73865
|
*/
|
73890
|
-
(
|
73866
|
+
_classPrivateFieldInitSpec(this, _backlight, {
|
73867
|
+
writable: true,
|
73868
|
+
value: new _backlight2.default(this.hot)
|
73869
|
+
});
|
73891
73870
|
/**
|
73892
73871
|
* Guideline UI object.
|
73893
73872
|
*
|
73894
|
-
* @private
|
73895
73873
|
* @type {object}
|
73896
73874
|
*/
|
73897
|
-
(
|
73875
|
+
_classPrivateFieldInitSpec(this, _guideline, {
|
73876
|
+
writable: true,
|
73877
|
+
value: new _guideline2.default(this.hot)
|
73878
|
+
});
|
73898
73879
|
/**
|
73899
73880
|
* @type {number[]}
|
73900
73881
|
*/
|
@@ -74029,8 +74010,8 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
74029
74010
|
disablePlugin() {
|
74030
74011
|
(0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);
|
74031
74012
|
this.unregisterEvents();
|
74032
|
-
this.
|
74033
|
-
this.
|
74013
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
74014
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
74034
74015
|
super.disablePlugin();
|
74035
74016
|
}
|
74036
74017
|
|
@@ -74267,8 +74248,8 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
74267
74248
|
let tdOffsetStart = this.hot.view.THEAD.offsetLeft + this.getColumnsWidth(0, (0, _classPrivateFieldGet2.default)(this, _hoveredColumn) - 1);
|
74268
74249
|
const hiderWidth = wtTable.hider.offsetWidth;
|
74269
74250
|
const tbodyOffsetLeft = wtTable.TBODY.offsetLeft;
|
74270
|
-
const backlightElemMarginStart = this.
|
74271
|
-
const backlightElemWidth = this.
|
74251
|
+
const backlightElemMarginStart = (0, _classPrivateFieldGet2.default)(this, _backlight).getOffset().start;
|
74252
|
+
const backlightElemWidth = (0, _classPrivateFieldGet2.default)(this, _backlight).getSize().width;
|
74272
74253
|
let rowHeaderWidth = 0;
|
74273
74254
|
let mouseOffsetStart = 0;
|
74274
74255
|
if (this.hot.isRtl()) {
|
@@ -74322,8 +74303,8 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
74322
74303
|
} else if (scrollableElement.scrollX !== undefined && (0, _classPrivateFieldGet2.default)(this, _hoveredColumn) < (0, _classPrivateFieldGet2.default)(this, _fixedColumnsStart)) {
|
74323
74304
|
guidelineStart -= (0, _classPrivateFieldGet2.default)(this, _rootElementOffset) <= scrollableElement.scrollX ? (0, _classPrivateFieldGet2.default)(this, _rootElementOffset) : 0;
|
74324
74305
|
}
|
74325
|
-
this.
|
74326
|
-
this.
|
74306
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(null, backlightStart);
|
74307
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).setPosition(null, guidelineStart);
|
74327
74308
|
}
|
74328
74309
|
|
74329
74310
|
/**
|
@@ -74353,15 +74334,15 @@ class ManualColumnMove extends _base.BasePlugin {
|
|
74353
74334
|
* @private
|
74354
74335
|
*/
|
74355
74336
|
buildPluginUI() {
|
74356
|
-
this.
|
74357
|
-
this.
|
74337
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).build();
|
74338
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).build();
|
74358
74339
|
}
|
74359
74340
|
/**
|
74360
74341
|
* Destroys the plugin instance.
|
74361
74342
|
*/
|
74362
74343
|
destroy() {
|
74363
|
-
this.
|
74364
|
-
this.
|
74344
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
74345
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
74365
74346
|
super.destroy();
|
74366
74347
|
}
|
74367
74348
|
}
|
@@ -74378,11 +74359,11 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
74378
74359
|
(0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);
|
74379
74360
|
return;
|
74380
74361
|
}
|
74381
|
-
const guidelineIsNotReady = this.
|
74382
|
-
const backlightIsNotReady = this.
|
74362
|
+
const guidelineIsNotReady = (0, _classPrivateFieldGet2.default)(this, _guideline).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _guideline).isAppended();
|
74363
|
+
const backlightIsNotReady = (0, _classPrivateFieldGet2.default)(this, _backlight).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _backlight).isAppended();
|
74383
74364
|
if (guidelineIsNotReady && backlightIsNotReady) {
|
74384
|
-
this.
|
74385
|
-
this.
|
74365
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).appendTo(wtTable.hider);
|
74366
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).appendTo(wtTable.hider);
|
74386
74367
|
}
|
74387
74368
|
const {
|
74388
74369
|
from,
|
@@ -74410,9 +74391,9 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
74410
74391
|
const offsetX = Math.abs(eventOffsetX - (this.hot.isRtl() ? TD.offsetWidth : 0));
|
74411
74392
|
const inlineOffset = this.getColumnsWidth(start, coords.col - 1) + offsetX;
|
74412
74393
|
const inlinePos = this.getColumnsWidth(countColumnsFrom, start - 1) + (fixedColumnsStart ? horizontalScrollPosition : 0) + inlineOffset;
|
74413
|
-
this.
|
74414
|
-
this.
|
74415
|
-
this.
|
74394
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(topPos, inlinePos);
|
74395
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(this.getColumnsWidth(start, end), wtTable.hider.offsetHeight - topPos);
|
74396
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setOffset(null, -inlineOffset);
|
74416
74397
|
(0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);
|
74417
74398
|
} else {
|
74418
74399
|
(0, _element.removeClass)(this.hot.rootElement, CSS_AFTER_SELECTION);
|
@@ -74473,8 +74454,8 @@ function _onAfterScrollVertically2() {
|
|
74473
74454
|
const headerHeight = wtTable.getColumnHeaderHeight(0) + 1;
|
74474
74455
|
const scrollTop = wtTable.holder.scrollTop;
|
74475
74456
|
const posTop = headerHeight + scrollTop;
|
74476
|
-
this.
|
74477
|
-
this.
|
74457
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(posTop);
|
74458
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(null, wtTable.hider.offsetHeight - posTop);
|
74478
74459
|
}
|
74479
74460
|
function _onAfterLoadData2() {
|
74480
74461
|
this.moveBySettingsOrLoad();
|
@@ -74754,13 +74735,12 @@ exports.ManualColumnResize = _manualColumnResize.ManualColumnResize;
|
|
74754
74735
|
"use strict";
|
74755
74736
|
|
74756
74737
|
|
74738
|
+
__webpack_require__(78);
|
74757
74739
|
var _interopRequireDefault = __webpack_require__(1);
|
74758
74740
|
exports.__esModule = true;
|
74759
74741
|
__webpack_require__(8);
|
74760
|
-
__webpack_require__(78);
|
74761
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(121));
|
74762
|
-
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(133));
|
74763
74742
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(136));
|
74743
|
+
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(133));
|
74764
74744
|
var _base = __webpack_require__(423);
|
74765
74745
|
var _element = __webpack_require__(107);
|
74766
74746
|
var _array = __webpack_require__(113);
|
@@ -74790,6 +74770,21 @@ const PERSISTENT_STATE_KEY = 'manualColumnWidths';
|
|
74790
74770
|
* - handle - the draggable element that sets the desired width of the column.
|
74791
74771
|
* - guide - the helper guide that shows the desired width as a vertical guide.
|
74792
74772
|
*/
|
74773
|
+
var _currentTH = /*#__PURE__*/new WeakMap();
|
74774
|
+
var _currentCol = /*#__PURE__*/new WeakMap();
|
74775
|
+
var _selectedCols = /*#__PURE__*/new WeakMap();
|
74776
|
+
var _currentWidth = /*#__PURE__*/new WeakMap();
|
74777
|
+
var _newSize = /*#__PURE__*/new WeakMap();
|
74778
|
+
var _startY = /*#__PURE__*/new WeakMap();
|
74779
|
+
var _startWidth = /*#__PURE__*/new WeakMap();
|
74780
|
+
var _startOffset = /*#__PURE__*/new WeakMap();
|
74781
|
+
var _handle = /*#__PURE__*/new WeakMap();
|
74782
|
+
var _guide = /*#__PURE__*/new WeakMap();
|
74783
|
+
var _pressed = /*#__PURE__*/new WeakMap();
|
74784
|
+
var _isTriggeredByRMB = /*#__PURE__*/new WeakMap();
|
74785
|
+
var _dblclick = /*#__PURE__*/new WeakMap();
|
74786
|
+
var _autoresizeTimeout = /*#__PURE__*/new WeakMap();
|
74787
|
+
var _columnWidthsMap = /*#__PURE__*/new WeakMap();
|
74793
74788
|
var _config = /*#__PURE__*/new WeakMap();
|
74794
74789
|
var _onMapInit = /*#__PURE__*/new WeakSet();
|
74795
74790
|
var _onMouseOver = /*#__PURE__*/new WeakSet();
|
@@ -74869,66 +74864,110 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
74869
74864
|
* @private
|
74870
74865
|
*/
|
74871
74866
|
_classPrivateMethodInitSpec(this, _onMapInit);
|
74872
|
-
(
|
74867
|
+
_classPrivateFieldInitSpec(this, _currentTH, {
|
74868
|
+
writable: true,
|
74869
|
+
value: null
|
74870
|
+
});
|
74873
74871
|
/**
|
74874
74872
|
* @type {number}
|
74875
74873
|
*/
|
74876
|
-
(
|
74874
|
+
_classPrivateFieldInitSpec(this, _currentCol, {
|
74875
|
+
writable: true,
|
74876
|
+
value: null
|
74877
|
+
});
|
74877
74878
|
/**
|
74878
74879
|
* @type {number[]}
|
74879
74880
|
*/
|
74880
|
-
(
|
74881
|
+
_classPrivateFieldInitSpec(this, _selectedCols, {
|
74882
|
+
writable: true,
|
74883
|
+
value: []
|
74884
|
+
});
|
74881
74885
|
/**
|
74882
74886
|
* @type {number}
|
74883
74887
|
*/
|
74884
|
-
(
|
74888
|
+
_classPrivateFieldInitSpec(this, _currentWidth, {
|
74889
|
+
writable: true,
|
74890
|
+
value: null
|
74891
|
+
});
|
74885
74892
|
/**
|
74886
74893
|
* @type {number}
|
74887
74894
|
*/
|
74888
|
-
(
|
74895
|
+
_classPrivateFieldInitSpec(this, _newSize, {
|
74896
|
+
writable: true,
|
74897
|
+
value: null
|
74898
|
+
});
|
74889
74899
|
/**
|
74890
74900
|
* @type {number}
|
74891
74901
|
*/
|
74892
|
-
(
|
74902
|
+
_classPrivateFieldInitSpec(this, _startY, {
|
74903
|
+
writable: true,
|
74904
|
+
value: null
|
74905
|
+
});
|
74893
74906
|
/**
|
74894
74907
|
* @type {number}
|
74895
74908
|
*/
|
74896
|
-
(
|
74909
|
+
_classPrivateFieldInitSpec(this, _startWidth, {
|
74910
|
+
writable: true,
|
74911
|
+
value: null
|
74912
|
+
});
|
74897
74913
|
/**
|
74898
74914
|
* @type {number}
|
74899
74915
|
*/
|
74900
|
-
(
|
74916
|
+
_classPrivateFieldInitSpec(this, _startOffset, {
|
74917
|
+
writable: true,
|
74918
|
+
value: null
|
74919
|
+
});
|
74901
74920
|
/**
|
74902
74921
|
* @type {HTMLElement}
|
74903
74922
|
*/
|
74904
|
-
(
|
74923
|
+
_classPrivateFieldInitSpec(this, _handle, {
|
74924
|
+
writable: true,
|
74925
|
+
value: this.hot.rootDocument.createElement('DIV')
|
74926
|
+
});
|
74905
74927
|
/**
|
74906
74928
|
* @type {HTMLElement}
|
74907
74929
|
*/
|
74908
|
-
(
|
74930
|
+
_classPrivateFieldInitSpec(this, _guide, {
|
74931
|
+
writable: true,
|
74932
|
+
value: this.hot.rootDocument.createElement('DIV')
|
74933
|
+
});
|
74909
74934
|
/**
|
74910
74935
|
* @type {boolean}
|
74911
74936
|
*/
|
74912
|
-
(
|
74937
|
+
_classPrivateFieldInitSpec(this, _pressed, {
|
74938
|
+
writable: true,
|
74939
|
+
value: null
|
74940
|
+
});
|
74913
74941
|
/**
|
74914
74942
|
* @type {boolean}
|
74915
74943
|
*/
|
74916
|
-
(
|
74944
|
+
_classPrivateFieldInitSpec(this, _isTriggeredByRMB, {
|
74945
|
+
writable: true,
|
74946
|
+
value: false
|
74947
|
+
});
|
74917
74948
|
/**
|
74918
74949
|
* @type {number}
|
74919
74950
|
*/
|
74920
|
-
(
|
74951
|
+
_classPrivateFieldInitSpec(this, _dblclick, {
|
74952
|
+
writable: true,
|
74953
|
+
value: 0
|
74954
|
+
});
|
74921
74955
|
/**
|
74922
74956
|
* @type {number}
|
74923
74957
|
*/
|
74924
|
-
(
|
74958
|
+
_classPrivateFieldInitSpec(this, _autoresizeTimeout, {
|
74959
|
+
writable: true,
|
74960
|
+
value: null
|
74961
|
+
});
|
74925
74962
|
/**
|
74926
74963
|
* PhysicalIndexToValueMap to keep and track widths for physical column indexes.
|
74927
74964
|
*
|
74928
|
-
* @private
|
74929
74965
|
* @type {PhysicalIndexToValueMap}
|
74930
74966
|
*/
|
74931
|
-
(
|
74967
|
+
_classPrivateFieldInitSpec(this, _columnWidthsMap, {
|
74968
|
+
writable: true,
|
74969
|
+
value: void 0
|
74970
|
+
});
|
74932
74971
|
/**
|
74933
74972
|
* Private pool to save configuration from updateSettings.
|
74934
74973
|
*
|
@@ -74938,8 +74977,8 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
74938
74977
|
writable: true,
|
74939
74978
|
value: void 0
|
74940
74979
|
});
|
74941
|
-
(0, _element.addClass)(this
|
74942
|
-
(0, _element.addClass)(this
|
74980
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'manualColumnResizer');
|
74981
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'manualColumnResizerGuide');
|
74943
74982
|
}
|
74944
74983
|
|
74945
74984
|
/**
|
@@ -74967,9 +75006,9 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
74967
75006
|
if (this.enabled) {
|
74968
75007
|
return;
|
74969
75008
|
}
|
74970
|
-
this
|
74971
|
-
this.
|
74972
|
-
this.hot.columnIndexMapper.registerMap(this.pluginName,
|
75009
|
+
(0, _classPrivateFieldSet2.default)(this, _columnWidthsMap, new _translations.PhysicalIndexToValueMap());
|
75010
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
|
75011
|
+
this.hot.columnIndexMapper.registerMap(this.pluginName, (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap));
|
74973
75012
|
this.addHook('modifyColWidth', (width, col) => _classPrivateMethodGet(this, _onModifyColWidth, _onModifyColWidth2).call(this, width, col));
|
74974
75013
|
this.addHook('beforeStretchingColumnWidth', (stretchedWidth, column) => _classPrivateMethodGet(this, _onBeforeStretchingColumnWidth, _onBeforeStretchingColumnWidth2).call(this, stretchedWidth, column));
|
74975
75014
|
this.addHook('beforeColumnResize', (newSize, column, isDoubleClick) => _classPrivateMethodGet(this, _onBeforeColumnResize, _onBeforeColumnResize2).call(this, newSize, column, isDoubleClick));
|
@@ -74993,7 +75032,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
74993
75032
|
* Disables the plugin functionality for this Handsontable instance.
|
74994
75033
|
*/
|
74995
75034
|
disablePlugin() {
|
74996
|
-
(0, _classPrivateFieldSet2.default)(this, _config, this.
|
75035
|
+
(0, _classPrivateFieldSet2.default)(this, _config, (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValues());
|
74997
75036
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
74998
75037
|
super.disablePlugin();
|
74999
75038
|
}
|
@@ -75004,7 +75043,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75004
75043
|
* @fires Hooks#persistentStateSave
|
75005
75044
|
*/
|
75006
75045
|
saveManualColumnWidths() {
|
75007
|
-
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.
|
75046
|
+
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValues());
|
75008
75047
|
}
|
75009
75048
|
|
75010
75049
|
/**
|
@@ -75029,7 +75068,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75029
75068
|
setManualSize(column, width) {
|
75030
75069
|
const newWidth = Math.max(width, 20);
|
75031
75070
|
const physicalColumn = this.hot.toPhysicalColumn(column);
|
75032
|
-
this.
|
75071
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalColumn, newWidth);
|
75033
75072
|
return newWidth;
|
75034
75073
|
}
|
75035
75074
|
|
@@ -75040,7 +75079,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75040
75079
|
*/
|
75041
75080
|
clearManualSize(column) {
|
75042
75081
|
const physicalColumn = this.hot.toPhysicalColumn(column);
|
75043
|
-
this.
|
75082
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalColumn, null);
|
75044
75083
|
}
|
75045
75084
|
/**
|
75046
75085
|
* Set the resize handle position.
|
@@ -75052,34 +75091,34 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75052
75091
|
if (!TH.parentNode) {
|
75053
75092
|
return;
|
75054
75093
|
}
|
75055
|
-
this
|
75094
|
+
(0, _classPrivateFieldSet2.default)(this, _currentTH, TH);
|
75056
75095
|
const {
|
75057
75096
|
_wt: wt
|
75058
75097
|
} = this.hot.view;
|
75059
|
-
const cellCoords = wt.wtTable.getCoords(
|
75098
|
+
const cellCoords = wt.wtTable.getCoords((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
75060
75099
|
const col = cellCoords.col;
|
75061
75100
|
|
75062
75101
|
// Ignore column headers.
|
75063
75102
|
if (col < 0) {
|
75064
75103
|
return;
|
75065
75104
|
}
|
75066
|
-
const headerHeight = (0, _element.outerHeight)(
|
75067
|
-
const box = this.
|
75105
|
+
const headerHeight = (0, _element.outerHeight)((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
75106
|
+
const box = (0, _classPrivateFieldGet2.default)(this, _currentTH).getBoundingClientRect();
|
75068
75107
|
// Read "fixedColumnsStart" through the Walkontable as in that context, the fixed columns
|
75069
75108
|
// are modified (reduced by the number of hidden columns) by TableView module.
|
75070
75109
|
const fixedColumn = col < wt.getSetting('fixedColumnsStart');
|
75071
75110
|
let relativeHeaderPosition;
|
75072
75111
|
if (fixedColumn) {
|
75073
|
-
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(this
|
75112
|
+
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
75074
75113
|
}
|
75075
75114
|
|
75076
75115
|
// If the TH is not a child of the top-left overlay, recalculate using
|
75077
75116
|
// the top overlay - as this overlay contains the rest of the headers.
|
75078
75117
|
if (!relativeHeaderPosition) {
|
75079
|
-
relativeHeaderPosition = wt.wtOverlays.topOverlay.getRelativeCellPosition(this
|
75118
|
+
relativeHeaderPosition = wt.wtOverlays.topOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
75080
75119
|
}
|
75081
|
-
this
|
75082
|
-
this
|
75120
|
+
(0, _classPrivateFieldSet2.default)(this, _currentCol, this.hot.columnIndexMapper.getVisualFromRenderableIndex(col));
|
75121
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedCols, []);
|
75083
75122
|
const isFullColumnSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByColumnHeader();
|
75084
75123
|
if (this.hot.selection.isSelected() && isFullColumnSelected) {
|
75085
75124
|
const selectionRanges = this.hot.getSelectedRange();
|
@@ -75089,23 +75128,23 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75089
75128
|
|
75090
75129
|
// Add every selected column for resize action.
|
75091
75130
|
(0, _number.rangeEach)(fromColumn, toColumn, columnIndex => {
|
75092
|
-
if (!this.
|
75093
|
-
this.
|
75131
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedCols).includes(columnIndex)) {
|
75132
|
+
(0, _classPrivateFieldGet2.default)(this, _selectedCols).push(columnIndex);
|
75094
75133
|
}
|
75095
75134
|
});
|
75096
75135
|
});
|
75097
75136
|
}
|
75098
75137
|
|
75099
75138
|
// Resizing element beyond the current selection (also when there is no selection).
|
75100
|
-
if (!this.
|
75101
|
-
this
|
75139
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedCols).includes((0, _classPrivateFieldGet2.default)(this, _currentCol))) {
|
75140
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedCols, [(0, _classPrivateFieldGet2.default)(this, _currentCol)]);
|
75102
75141
|
}
|
75103
|
-
this
|
75104
|
-
this
|
75105
|
-
this.
|
75106
|
-
this.
|
75107
|
-
this.
|
75108
|
-
this.hot.rootElement.appendChild(
|
75142
|
+
(0, _classPrivateFieldSet2.default)(this, _startOffset, relativeHeaderPosition.start - 6);
|
75143
|
+
(0, _classPrivateFieldSet2.default)(this, _startWidth, parseInt(box.width, 10));
|
75144
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.top = `${relativeHeaderPosition.top}px`;
|
75145
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir] = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _startWidth)}px`;
|
75146
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.height = `${headerHeight}px`;
|
75147
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
75109
75148
|
}
|
75110
75149
|
|
75111
75150
|
/**
|
@@ -75114,7 +75153,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75114
75153
|
* @private
|
75115
75154
|
*/
|
75116
75155
|
refreshHandlePosition() {
|
75117
|
-
this.
|
75156
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir] = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _currentWidth)}px`;
|
75118
75157
|
}
|
75119
75158
|
|
75120
75159
|
/**
|
@@ -75123,15 +75162,15 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75123
75162
|
* @private
|
75124
75163
|
*/
|
75125
75164
|
setupGuidePosition() {
|
75126
|
-
const handleHeight = parseInt((0, _element.outerHeight)(
|
75127
|
-
const handleBottomPosition = parseInt(this.
|
75165
|
+
const handleHeight = parseInt((0, _element.outerHeight)((0, _classPrivateFieldGet2.default)(this, _handle)), 10);
|
75166
|
+
const handleBottomPosition = parseInt((0, _classPrivateFieldGet2.default)(this, _handle).style.top, 10) + handleHeight;
|
75128
75167
|
const maximumVisibleElementHeight = parseInt(this.hot.view.maximumVisibleElementHeight(0), 10);
|
75129
|
-
(0, _element.addClass)(this
|
75130
|
-
(0, _element.addClass)(this
|
75131
|
-
this.
|
75168
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
75169
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
75170
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.top = `${handleBottomPosition}px`;
|
75132
75171
|
this.refreshGuidePosition();
|
75133
|
-
this.
|
75134
|
-
this.hot.rootElement.appendChild(
|
75172
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.height = `${maximumVisibleElementHeight - handleHeight}px`;
|
75173
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
75135
75174
|
}
|
75136
75175
|
|
75137
75176
|
/**
|
@@ -75140,7 +75179,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75140
75179
|
* @private
|
75141
75180
|
*/
|
75142
75181
|
refreshGuidePosition() {
|
75143
|
-
this.
|
75182
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style[this.inlineDir] = (0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir];
|
75144
75183
|
}
|
75145
75184
|
|
75146
75185
|
/**
|
@@ -75149,8 +75188,8 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75149
75188
|
* @private
|
75150
75189
|
*/
|
75151
75190
|
hideHandleAndGuide() {
|
75152
|
-
(0, _element.removeClass)(this
|
75153
|
-
(0, _element.removeClass)(this
|
75191
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
75192
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
75154
75193
|
}
|
75155
75194
|
|
75156
75195
|
/**
|
@@ -75194,37 +75233,37 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75194
75233
|
this.hot.view.adjustElementsSize(true);
|
75195
75234
|
};
|
75196
75235
|
const resize = (column, forceRender) => {
|
75197
|
-
const hookNewSize = this.hot.runHooks('beforeColumnResize', this
|
75236
|
+
const hookNewSize = this.hot.runHooks('beforeColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, true);
|
75198
75237
|
if (hookNewSize !== undefined) {
|
75199
|
-
this
|
75238
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, hookNewSize);
|
75200
75239
|
}
|
75201
75240
|
if (this.hot.getSettings().stretchH === 'all') {
|
75202
75241
|
this.clearManualSize(column);
|
75203
75242
|
} else {
|
75204
|
-
this.setManualSize(column,
|
75243
|
+
this.setManualSize(column, (0, _classPrivateFieldGet2.default)(this, _newSize)); // double click sets by auto row size plugin
|
75205
75244
|
}
|
75206
75245
|
|
75207
75246
|
this.saveManualColumnWidths();
|
75208
|
-
this.hot.runHooks('afterColumnResize', this
|
75247
|
+
this.hot.runHooks('afterColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, true);
|
75209
75248
|
if (forceRender) {
|
75210
75249
|
render();
|
75211
75250
|
}
|
75212
75251
|
};
|
75213
|
-
if (this
|
75214
|
-
const selectedColsLength = this.
|
75252
|
+
if ((0, _classPrivateFieldGet2.default)(this, _dblclick) >= 2) {
|
75253
|
+
const selectedColsLength = (0, _classPrivateFieldGet2.default)(this, _selectedCols).length;
|
75215
75254
|
if (selectedColsLength > 1) {
|
75216
|
-
(0, _array.arrayEach)(this
|
75255
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
75217
75256
|
resize(selectedCol);
|
75218
75257
|
});
|
75219
75258
|
render();
|
75220
75259
|
} else {
|
75221
|
-
(0, _array.arrayEach)(this
|
75260
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
75222
75261
|
resize(selectedCol, true);
|
75223
75262
|
});
|
75224
75263
|
}
|
75225
75264
|
}
|
75226
|
-
this
|
75227
|
-
this
|
75265
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, 0);
|
75266
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, null);
|
75228
75267
|
}
|
75229
75268
|
/**
|
75230
75269
|
* Binds the mouse events.
|
@@ -75240,7 +75279,7 @@ class ManualColumnResize extends _base.BasePlugin {
|
|
75240
75279
|
this.eventManager.addEventListener(rootElement, 'mousedown', e => _classPrivateMethodGet(this, _onMouseDown, _onMouseDown2).call(this, e));
|
75241
75280
|
this.eventManager.addEventListener(rootWindow, 'mousemove', e => _classPrivateMethodGet(this, _onMouseMove, _onMouseMove2).call(this, e));
|
75242
75281
|
this.eventManager.addEventListener(rootWindow, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
|
75243
|
-
this.eventManager.addEventListener(this
|
75282
|
+
this.eventManager.addEventListener((0, _classPrivateFieldGet2.default)(this, _handle), 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
|
75244
75283
|
}
|
75245
75284
|
/**
|
75246
75285
|
* Destroys the plugin instance.
|
@@ -75256,20 +75295,20 @@ function _onMapInit2() {
|
|
75256
75295
|
if (typeof loadedManualColumnWidths !== 'undefined') {
|
75257
75296
|
this.hot.batchExecution(() => {
|
75258
75297
|
loadedManualColumnWidths.forEach((width, physicalIndex) => {
|
75259
|
-
this.
|
75298
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
|
75260
75299
|
});
|
75261
75300
|
}, true);
|
75262
75301
|
} else if (Array.isArray(initialSetting)) {
|
75263
75302
|
this.hot.batchExecution(() => {
|
75264
75303
|
initialSetting.forEach((width, physicalIndex) => {
|
75265
|
-
this.
|
75304
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
|
75266
75305
|
});
|
75267
75306
|
}, true);
|
75268
75307
|
(0, _classPrivateFieldSet2.default)(this, _config, initialSetting);
|
75269
75308
|
} else if (initialSetting === true && Array.isArray((0, _classPrivateFieldGet2.default)(this, _config))) {
|
75270
75309
|
this.hot.batchExecution(() => {
|
75271
75310
|
(0, _classPrivateFieldGet2.default)(this, _config).forEach((width, physicalIndex) => {
|
75272
|
-
this.
|
75311
|
+
(0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).setValueAtIndex(physicalIndex, width);
|
75273
75312
|
});
|
75274
75313
|
}, true);
|
75275
75314
|
}
|
@@ -75282,7 +75321,7 @@ function _onMouseOver2(event) {
|
|
75282
75321
|
}
|
75283
75322
|
|
75284
75323
|
// A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
|
75285
|
-
if (this
|
75324
|
+
if ((0, _classPrivateFieldGet2.default)(this, _isTriggeredByRMB) === true) {
|
75286
75325
|
return;
|
75287
75326
|
}
|
75288
75327
|
if (this.checkIfColumnHeader(event.target)) {
|
@@ -75292,7 +75331,7 @@ function _onMouseOver2(event) {
|
|
75292
75331
|
}
|
75293
75332
|
const colspan = th.getAttribute('colspan');
|
75294
75333
|
if (th && (colspan === null || colspan === '1')) {
|
75295
|
-
if (!
|
75334
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
75296
75335
|
this.setupHandlePosition(th);
|
75297
75336
|
}
|
75298
75337
|
}
|
@@ -75300,24 +75339,24 @@ function _onMouseOver2(event) {
|
|
75300
75339
|
}
|
75301
75340
|
function _onMouseDown2(event) {
|
75302
75341
|
if ((0, _element.hasClass)(event.target, 'manualColumnResizer')) {
|
75303
|
-
this.setupHandlePosition(
|
75342
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
75304
75343
|
this.setupGuidePosition();
|
75305
|
-
this
|
75306
|
-
if (this
|
75307
|
-
this
|
75308
|
-
this.hot._registerTimeout(
|
75344
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, true);
|
75345
|
+
if ((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout) === null) {
|
75346
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, setTimeout(() => this.afterMouseDownTimeout(), 500));
|
75347
|
+
this.hot._registerTimeout((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout));
|
75309
75348
|
}
|
75310
|
-
this.
|
75349
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, (0, _classPrivateFieldGet2.default)(this, _dblclick) + 1);
|
75311
75350
|
this.startX = event.pageX;
|
75312
|
-
this
|
75351
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, (0, _classPrivateFieldGet2.default)(this, _startWidth));
|
75313
75352
|
}
|
75314
75353
|
}
|
75315
75354
|
function _onMouseMove2(event) {
|
75316
|
-
if (
|
75355
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
75317
75356
|
const change = (event.pageX - this.startX) * this.hot.getDirectionFactor();
|
75318
|
-
this
|
75319
|
-
(0, _array.arrayEach)(this
|
75320
|
-
this
|
75357
|
+
(0, _classPrivateFieldSet2.default)(this, _currentWidth, (0, _classPrivateFieldGet2.default)(this, _startWidth) + change);
|
75358
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
75359
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, this.setManualSize(selectedCol, (0, _classPrivateFieldGet2.default)(this, _currentWidth)));
|
75321
75360
|
});
|
75322
75361
|
this.refreshHandlePosition();
|
75323
75362
|
this.refreshGuidePosition();
|
@@ -75330,50 +75369,50 @@ function _onMouseUp2() {
|
|
75330
75369
|
this.hot.view.adjustElementsSize(true);
|
75331
75370
|
};
|
75332
75371
|
const resize = (column, forceRender) => {
|
75333
|
-
this.hot.runHooks('beforeColumnResize', this
|
75372
|
+
this.hot.runHooks('beforeColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, false);
|
75334
75373
|
if (forceRender) {
|
75335
75374
|
render();
|
75336
75375
|
}
|
75337
75376
|
this.saveManualColumnWidths();
|
75338
|
-
this.hot.runHooks('afterColumnResize', this
|
75377
|
+
this.hot.runHooks('afterColumnResize', (0, _classPrivateFieldGet2.default)(this, _newSize), column, false);
|
75339
75378
|
};
|
75340
|
-
if (
|
75379
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
75341
75380
|
this.hideHandleAndGuide();
|
75342
|
-
this
|
75343
|
-
if (this
|
75344
|
-
const selectedColsLength = this.
|
75381
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
75382
|
+
if ((0, _classPrivateFieldGet2.default)(this, _newSize) !== (0, _classPrivateFieldGet2.default)(this, _startWidth)) {
|
75383
|
+
const selectedColsLength = (0, _classPrivateFieldGet2.default)(this, _selectedCols).length;
|
75345
75384
|
if (selectedColsLength > 1) {
|
75346
|
-
(0, _array.arrayEach)(this
|
75385
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
75347
75386
|
resize(selectedCol);
|
75348
75387
|
});
|
75349
75388
|
render();
|
75350
75389
|
} else {
|
75351
|
-
(0, _array.arrayEach)(this
|
75390
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedCols), selectedCol => {
|
75352
75391
|
resize(selectedCol, true);
|
75353
75392
|
});
|
75354
75393
|
}
|
75355
75394
|
}
|
75356
|
-
this.setupHandlePosition(
|
75395
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
75357
75396
|
}
|
75358
75397
|
}
|
75359
75398
|
function _onContextMenu2() {
|
75360
75399
|
this.hideHandleAndGuide();
|
75361
|
-
this.hot.rootElement.removeChild(
|
75362
|
-
this.hot.rootElement.removeChild(
|
75363
|
-
this
|
75364
|
-
this
|
75400
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
75401
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
75402
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
75403
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, true);
|
75365
75404
|
|
75366
75405
|
// There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
|
75367
75406
|
// shouldn't be drawn just after removing it.
|
75368
75407
|
this.hot._registerImmediate(() => {
|
75369
|
-
this
|
75408
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, false);
|
75370
75409
|
});
|
75371
75410
|
}
|
75372
75411
|
function _onModifyColWidth2(width, column) {
|
75373
75412
|
let newWidth = width;
|
75374
75413
|
if (this.enabled) {
|
75375
75414
|
const physicalColumn = this.hot.toPhysicalColumn(column);
|
75376
|
-
const columnWidth = this.
|
75415
|
+
const columnWidth = (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValueAtIndex(physicalColumn);
|
75377
75416
|
if (this.hot.getSettings()[PLUGIN_KEY] && columnWidth) {
|
75378
75417
|
newWidth = columnWidth;
|
75379
75418
|
}
|
@@ -75381,7 +75420,7 @@ function _onModifyColWidth2(width, column) {
|
|
75381
75420
|
return newWidth;
|
75382
75421
|
}
|
75383
75422
|
function _onBeforeStretchingColumnWidth2(stretchedWidth, column) {
|
75384
|
-
let width = this.
|
75423
|
+
let width = (0, _classPrivateFieldGet2.default)(this, _columnWidthsMap).getValueAtIndex(column);
|
75385
75424
|
if (width === null) {
|
75386
75425
|
width = stretchedWidth;
|
75387
75426
|
}
|
@@ -75416,7 +75455,6 @@ var _interopRequireDefault = __webpack_require__(1);
|
|
75416
75455
|
exports.__esModule = true;
|
75417
75456
|
__webpack_require__(8);
|
75418
75457
|
__webpack_require__(78);
|
75419
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(121));
|
75420
75458
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(136));
|
75421
75459
|
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(133));
|
75422
75460
|
var _base = __webpack_require__(423);
|
@@ -75424,8 +75462,8 @@ var _pluginHooks = _interopRequireDefault(__webpack_require__(128));
|
|
75424
75462
|
var _array = __webpack_require__(113);
|
75425
75463
|
var _element = __webpack_require__(107);
|
75426
75464
|
var _number = __webpack_require__(141);
|
75427
|
-
var
|
75428
|
-
var
|
75465
|
+
var _backlight2 = _interopRequireDefault(__webpack_require__(607));
|
75466
|
+
var _guideline2 = _interopRequireDefault(__webpack_require__(609));
|
75429
75467
|
__webpack_require__(610);
|
75430
75468
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
75431
75469
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
@@ -75466,6 +75504,8 @@ const CSS_AFTER_SELECTION = 'after-selection--rows';
|
|
75466
75504
|
* @class ManualRowMove
|
75467
75505
|
* @plugin ManualRowMove
|
75468
75506
|
*/
|
75507
|
+
var _backlight = /*#__PURE__*/new WeakMap();
|
75508
|
+
var _guideline = /*#__PURE__*/new WeakMap();
|
75469
75509
|
var _rowsToMove = /*#__PURE__*/new WeakMap();
|
75470
75510
|
var _pressed = /*#__PURE__*/new WeakMap();
|
75471
75511
|
var _target = /*#__PURE__*/new WeakMap();
|
@@ -75520,17 +75560,21 @@ class ManualRowMove extends _base.BasePlugin {
|
|
75520
75560
|
/**
|
75521
75561
|
* Backlight UI object.
|
75522
75562
|
*
|
75523
|
-
* @private
|
75524
75563
|
* @type {object}
|
75525
75564
|
*/
|
75526
|
-
(
|
75565
|
+
_classPrivateFieldInitSpec(this, _backlight, {
|
75566
|
+
writable: true,
|
75567
|
+
value: new _backlight2.default(this.hot)
|
75568
|
+
});
|
75527
75569
|
/**
|
75528
75570
|
* Guideline UI object.
|
75529
75571
|
*
|
75530
|
-
* @private
|
75531
75572
|
* @type {object}
|
75532
75573
|
*/
|
75533
|
-
(
|
75574
|
+
_classPrivateFieldInitSpec(this, _guideline, {
|
75575
|
+
writable: true,
|
75576
|
+
value: new _guideline2.default(this.hot)
|
75577
|
+
});
|
75534
75578
|
/**
|
75535
75579
|
* @type {number[]}
|
75536
75580
|
*/
|
@@ -75630,8 +75674,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
75630
75674
|
disablePlugin() {
|
75631
75675
|
(0, _element.removeClass)(this.hot.rootElement, CSS_PLUGIN);
|
75632
75676
|
this.unregisterEvents();
|
75633
|
-
this.
|
75634
|
-
this.
|
75677
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
75678
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
75635
75679
|
super.disablePlugin();
|
75636
75680
|
}
|
75637
75681
|
|
@@ -75896,8 +75940,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
75896
75940
|
const pixelsRelToTableStart = (0, _classPrivateFieldGet2.default)(this, _target).eventPageY - pixelsAbove + tableScroll;
|
75897
75941
|
const hiderHeight = wtTable.hider.offsetHeight;
|
75898
75942
|
const tbodyOffsetTop = wtTable.TBODY.offsetTop;
|
75899
|
-
const backlightElemMarginTop = this.
|
75900
|
-
const backlightElemHeight = this.
|
75943
|
+
const backlightElemMarginTop = (0, _classPrivateFieldGet2.default)(this, _backlight).getOffset().top;
|
75944
|
+
const backlightElemHeight = (0, _classPrivateFieldGet2.default)(this, _backlight).getSize().height;
|
75901
75945
|
const tdMiddle = TD.offsetHeight / 2;
|
75902
75946
|
const tdHeight = TD.offsetHeight;
|
75903
75947
|
let tdStartPixel = this.hot.view.THEAD.offsetHeight + this.getRowsHeight(0, coords.row - 1);
|
@@ -75930,8 +75974,8 @@ class ManualRowMove extends _base.BasePlugin {
|
|
75930
75974
|
// prevent display guideline below table
|
75931
75975
|
guidelineTop = hiderHeight - 1;
|
75932
75976
|
}
|
75933
|
-
this.
|
75934
|
-
this.
|
75977
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(backlightTop);
|
75978
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).setPosition(guidelineTop);
|
75935
75979
|
}
|
75936
75980
|
|
75937
75981
|
/**
|
@@ -75961,15 +76005,15 @@ class ManualRowMove extends _base.BasePlugin {
|
|
75961
76005
|
* @private
|
75962
76006
|
*/
|
75963
76007
|
buildPluginUI() {
|
75964
|
-
this.
|
75965
|
-
this.
|
76008
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).build();
|
76009
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).build();
|
75966
76010
|
}
|
75967
76011
|
/**
|
75968
76012
|
* Destroys the plugin instance.
|
75969
76013
|
*/
|
75970
76014
|
destroy() {
|
75971
|
-
this.
|
75972
|
-
this.
|
76015
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).destroy();
|
76016
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).destroy();
|
75973
76017
|
super.destroy();
|
75974
76018
|
}
|
75975
76019
|
}
|
@@ -75987,11 +76031,11 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
75987
76031
|
(0, _element.removeClass)(this.hot.rootElement, [CSS_ON_MOVING, CSS_SHOW_UI]);
|
75988
76032
|
return;
|
75989
76033
|
}
|
75990
|
-
const guidelineIsNotReady = this.
|
75991
|
-
const backlightIsNotReady = this.
|
76034
|
+
const guidelineIsNotReady = (0, _classPrivateFieldGet2.default)(this, _guideline).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _guideline).isAppended();
|
76035
|
+
const backlightIsNotReady = (0, _classPrivateFieldGet2.default)(this, _backlight).isBuilt() && !(0, _classPrivateFieldGet2.default)(this, _backlight).isAppended();
|
75992
76036
|
if (guidelineIsNotReady && backlightIsNotReady) {
|
75993
|
-
this.
|
75994
|
-
this.
|
76037
|
+
(0, _classPrivateFieldGet2.default)(this, _guideline).appendTo(wtTable.hider);
|
76038
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).appendTo(wtTable.hider);
|
75995
76039
|
}
|
75996
76040
|
const {
|
75997
76041
|
from,
|
@@ -76008,9 +76052,9 @@ function _onBeforeOnCellMouseDown2(event, coords, TD, controller) {
|
|
76008
76052
|
(0, _classPrivateFieldSet2.default)(this, _rowsToMove, this.prepareRowsToMoving());
|
76009
76053
|
const leftPos = wtTable.holder.scrollLeft + wtViewport.getRowHeaderWidth();
|
76010
76054
|
const topOffset = this.getRowsHeight(start, coords.row - 1) + event.offsetY;
|
76011
|
-
this.
|
76012
|
-
this.
|
76013
|
-
this.
|
76055
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(null, leftPos);
|
76056
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(wtTable.hider.offsetWidth - leftPos, this.getRowsHeight(start, end));
|
76057
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setOffset(-topOffset, null);
|
76014
76058
|
(0, _element.addClass)(this.hot.rootElement, CSS_ON_MOVING);
|
76015
76059
|
this.refreshPositions();
|
76016
76060
|
} else {
|
@@ -76071,8 +76115,8 @@ function _onAfterScrollHorizontally2() {
|
|
76071
76115
|
const headerWidth = this.hot.view._wt.wtViewport.getRowHeaderWidth();
|
76072
76116
|
const scrollLeft = wtTable.holder.scrollLeft;
|
76073
76117
|
const posLeft = headerWidth + scrollLeft;
|
76074
|
-
this.
|
76075
|
-
this.
|
76118
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setPosition(null, posLeft);
|
76119
|
+
(0, _classPrivateFieldGet2.default)(this, _backlight).setSize(wtTable.hider.offsetWidth - posLeft);
|
76076
76120
|
}
|
76077
76121
|
function _onAfterLoadData2() {
|
76078
76122
|
this.moveBySettingsOrLoad();
|
@@ -76338,13 +76382,12 @@ exports.ManualRowResize = _manualRowResize.ManualRowResize;
|
|
76338
76382
|
"use strict";
|
76339
76383
|
|
76340
76384
|
|
76385
|
+
__webpack_require__(78);
|
76341
76386
|
var _interopRequireDefault = __webpack_require__(1);
|
76342
76387
|
exports.__esModule = true;
|
76343
76388
|
__webpack_require__(8);
|
76344
|
-
__webpack_require__(78);
|
76345
|
-
var _defineProperty2 = _interopRequireDefault(__webpack_require__(121));
|
76346
|
-
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(133));
|
76347
76389
|
var _classPrivateFieldSet2 = _interopRequireDefault(__webpack_require__(136));
|
76390
|
+
var _classPrivateFieldGet2 = _interopRequireDefault(__webpack_require__(133));
|
76348
76391
|
var _base = __webpack_require__(423);
|
76349
76392
|
var _element = __webpack_require__(107);
|
76350
76393
|
var _array = __webpack_require__(113);
|
@@ -76375,6 +76418,21 @@ const PERSISTENT_STATE_KEY = 'manualRowHeights';
|
|
76375
76418
|
* - handle - the draggable element that sets the desired height of the row.
|
76376
76419
|
* - guide - the helper guide that shows the desired height as a horizontal guide.
|
76377
76420
|
*/
|
76421
|
+
var _currentTH = /*#__PURE__*/new WeakMap();
|
76422
|
+
var _currentRow = /*#__PURE__*/new WeakMap();
|
76423
|
+
var _selectedRows = /*#__PURE__*/new WeakMap();
|
76424
|
+
var _currentHeight = /*#__PURE__*/new WeakMap();
|
76425
|
+
var _newSize = /*#__PURE__*/new WeakMap();
|
76426
|
+
var _startY = /*#__PURE__*/new WeakMap();
|
76427
|
+
var _startHeight = /*#__PURE__*/new WeakMap();
|
76428
|
+
var _startOffset = /*#__PURE__*/new WeakMap();
|
76429
|
+
var _handle = /*#__PURE__*/new WeakMap();
|
76430
|
+
var _guide = /*#__PURE__*/new WeakMap();
|
76431
|
+
var _pressed = /*#__PURE__*/new WeakMap();
|
76432
|
+
var _isTriggeredByRMB = /*#__PURE__*/new WeakMap();
|
76433
|
+
var _dblclick = /*#__PURE__*/new WeakMap();
|
76434
|
+
var _autoresizeTimeout = /*#__PURE__*/new WeakMap();
|
76435
|
+
var _rowHeightsMap = /*#__PURE__*/new WeakMap();
|
76378
76436
|
var _config = /*#__PURE__*/new WeakMap();
|
76379
76437
|
var _onMouseOver = /*#__PURE__*/new WeakSet();
|
76380
76438
|
var _onMouseDown = /*#__PURE__*/new WeakSet();
|
@@ -76438,66 +76496,110 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76438
76496
|
* @param {MouseEvent} event The mouse event.
|
76439
76497
|
*/
|
76440
76498
|
_classPrivateMethodInitSpec(this, _onMouseOver);
|
76441
|
-
(
|
76499
|
+
_classPrivateFieldInitSpec(this, _currentTH, {
|
76500
|
+
writable: true,
|
76501
|
+
value: null
|
76502
|
+
});
|
76442
76503
|
/**
|
76443
76504
|
* @type {number}
|
76444
76505
|
*/
|
76445
|
-
(
|
76506
|
+
_classPrivateFieldInitSpec(this, _currentRow, {
|
76507
|
+
writable: true,
|
76508
|
+
value: null
|
76509
|
+
});
|
76446
76510
|
/**
|
76447
76511
|
* @type {number[]}
|
76448
76512
|
*/
|
76449
|
-
(
|
76513
|
+
_classPrivateFieldInitSpec(this, _selectedRows, {
|
76514
|
+
writable: true,
|
76515
|
+
value: []
|
76516
|
+
});
|
76450
76517
|
/**
|
76451
76518
|
* @type {number}
|
76452
76519
|
*/
|
76453
|
-
(
|
76520
|
+
_classPrivateFieldInitSpec(this, _currentHeight, {
|
76521
|
+
writable: true,
|
76522
|
+
value: null
|
76523
|
+
});
|
76454
76524
|
/**
|
76455
76525
|
* @type {number}
|
76456
76526
|
*/
|
76457
|
-
(
|
76527
|
+
_classPrivateFieldInitSpec(this, _newSize, {
|
76528
|
+
writable: true,
|
76529
|
+
value: null
|
76530
|
+
});
|
76458
76531
|
/**
|
76459
76532
|
* @type {number}
|
76460
76533
|
*/
|
76461
|
-
(
|
76534
|
+
_classPrivateFieldInitSpec(this, _startY, {
|
76535
|
+
writable: true,
|
76536
|
+
value: null
|
76537
|
+
});
|
76462
76538
|
/**
|
76463
76539
|
* @type {number}
|
76464
76540
|
*/
|
76465
|
-
(
|
76541
|
+
_classPrivateFieldInitSpec(this, _startHeight, {
|
76542
|
+
writable: true,
|
76543
|
+
value: null
|
76544
|
+
});
|
76466
76545
|
/**
|
76467
76546
|
* @type {number}
|
76468
76547
|
*/
|
76469
|
-
(
|
76548
|
+
_classPrivateFieldInitSpec(this, _startOffset, {
|
76549
|
+
writable: true,
|
76550
|
+
value: null
|
76551
|
+
});
|
76470
76552
|
/**
|
76471
76553
|
* @type {HTMLElement}
|
76472
76554
|
*/
|
76473
|
-
(
|
76555
|
+
_classPrivateFieldInitSpec(this, _handle, {
|
76556
|
+
writable: true,
|
76557
|
+
value: this.hot.rootDocument.createElement('DIV')
|
76558
|
+
});
|
76474
76559
|
/**
|
76475
76560
|
* @type {HTMLElement}
|
76476
76561
|
*/
|
76477
|
-
(
|
76562
|
+
_classPrivateFieldInitSpec(this, _guide, {
|
76563
|
+
writable: true,
|
76564
|
+
value: this.hot.rootDocument.createElement('DIV')
|
76565
|
+
});
|
76478
76566
|
/**
|
76479
76567
|
* @type {boolean}
|
76480
76568
|
*/
|
76481
|
-
(
|
76569
|
+
_classPrivateFieldInitSpec(this, _pressed, {
|
76570
|
+
writable: true,
|
76571
|
+
value: false
|
76572
|
+
});
|
76482
76573
|
/**
|
76483
76574
|
* @type {boolean}
|
76484
76575
|
*/
|
76485
|
-
(
|
76576
|
+
_classPrivateFieldInitSpec(this, _isTriggeredByRMB, {
|
76577
|
+
writable: true,
|
76578
|
+
value: false
|
76579
|
+
});
|
76486
76580
|
/**
|
76487
76581
|
* @type {number}
|
76488
76582
|
*/
|
76489
|
-
(
|
76583
|
+
_classPrivateFieldInitSpec(this, _dblclick, {
|
76584
|
+
writable: true,
|
76585
|
+
value: 0
|
76586
|
+
});
|
76490
76587
|
/**
|
76491
76588
|
* @type {number}
|
76492
76589
|
*/
|
76493
|
-
(
|
76590
|
+
_classPrivateFieldInitSpec(this, _autoresizeTimeout, {
|
76591
|
+
writable: true,
|
76592
|
+
value: null
|
76593
|
+
});
|
76494
76594
|
/**
|
76495
76595
|
* PhysicalIndexToValueMap to keep and track widths for physical row indexes.
|
76496
76596
|
*
|
76497
|
-
* @private
|
76498
76597
|
* @type {PhysicalIndexToValueMap}
|
76499
76598
|
*/
|
76500
|
-
(
|
76599
|
+
_classPrivateFieldInitSpec(this, _rowHeightsMap, {
|
76600
|
+
writable: true,
|
76601
|
+
value: void 0
|
76602
|
+
});
|
76501
76603
|
/**
|
76502
76604
|
* Private pool to save configuration from updateSettings.
|
76503
76605
|
*
|
@@ -76507,8 +76609,8 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76507
76609
|
writable: true,
|
76508
76610
|
value: void 0
|
76509
76611
|
});
|
76510
|
-
(0, _element.addClass)(this
|
76511
|
-
(0, _element.addClass)(this
|
76612
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'manualRowResizer');
|
76613
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'manualRowResizerGuide');
|
76512
76614
|
}
|
76513
76615
|
|
76514
76616
|
/**
|
@@ -76536,9 +76638,9 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76536
76638
|
if (this.enabled) {
|
76537
76639
|
return;
|
76538
76640
|
}
|
76539
|
-
this
|
76540
|
-
this.
|
76541
|
-
this.hot.rowIndexMapper.registerMap(this.pluginName,
|
76641
|
+
(0, _classPrivateFieldSet2.default)(this, _rowHeightsMap, new _translations.PhysicalIndexToValueMap());
|
76642
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).addLocalHook('init', () => _classPrivateMethodGet(this, _onMapInit, _onMapInit2).call(this));
|
76643
|
+
this.hot.rowIndexMapper.registerMap(this.pluginName, (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap));
|
76542
76644
|
this.addHook('modifyRowHeight', (height, row) => _classPrivateMethodGet(this, _onModifyRowHeight, _onModifyRowHeight2).call(this, height, row));
|
76543
76645
|
this.bindEvents();
|
76544
76646
|
super.enablePlugin();
|
@@ -76560,7 +76662,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76560
76662
|
* Disables the plugin functionality for this Handsontable instance.
|
76561
76663
|
*/
|
76562
76664
|
disablePlugin() {
|
76563
|
-
(0, _classPrivateFieldSet2.default)(this, _config, this.
|
76665
|
+
(0, _classPrivateFieldSet2.default)(this, _config, (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).getValues());
|
76564
76666
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
76565
76667
|
super.disablePlugin();
|
76566
76668
|
}
|
@@ -76572,7 +76674,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76572
76674
|
* @fires Hooks#persistentStateSave
|
76573
76675
|
*/
|
76574
76676
|
saveManualRowHeights() {
|
76575
|
-
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, this.
|
76677
|
+
this.hot.runHooks('persistentStateSave', PERSISTENT_STATE_KEY, (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).getValues());
|
76576
76678
|
}
|
76577
76679
|
|
76578
76680
|
/**
|
@@ -76598,7 +76700,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76598
76700
|
setManualSize(row, height) {
|
76599
76701
|
const physicalRow = this.hot.toPhysicalRow(row);
|
76600
76702
|
const newHeight = Math.max(height, _src.ViewportRowsCalculator.DEFAULT_HEIGHT);
|
76601
|
-
this.
|
76703
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(physicalRow, newHeight);
|
76602
76704
|
return newHeight;
|
76603
76705
|
}
|
76604
76706
|
|
@@ -76609,40 +76711,40 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76609
76711
|
* @param {HTMLCellElement} TH TH HTML element.
|
76610
76712
|
*/
|
76611
76713
|
setupHandlePosition(TH) {
|
76612
|
-
this
|
76714
|
+
(0, _classPrivateFieldSet2.default)(this, _currentTH, TH);
|
76613
76715
|
const {
|
76614
76716
|
view
|
76615
76717
|
} = this.hot;
|
76616
76718
|
const {
|
76617
76719
|
_wt: wt
|
76618
76720
|
} = view;
|
76619
|
-
const cellCoords = wt.wtTable.getCoords(
|
76721
|
+
const cellCoords = wt.wtTable.getCoords((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
76620
76722
|
const row = cellCoords.row;
|
76621
76723
|
|
76622
76724
|
// Ignore row headers.
|
76623
76725
|
if (row < 0) {
|
76624
76726
|
return;
|
76625
76727
|
}
|
76626
|
-
const headerWidth = (0, _element.outerWidth)(
|
76627
|
-
const box = this.
|
76728
|
+
const headerWidth = (0, _element.outerWidth)((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
76729
|
+
const box = (0, _classPrivateFieldGet2.default)(this, _currentTH).getBoundingClientRect();
|
76628
76730
|
// Read "fixedRowsTop" and "fixedRowsBottom" through the Walkontable as in that context, the fixed
|
76629
76731
|
// rows are modified (reduced by the number of hidden rows) by TableView module.
|
76630
76732
|
const fixedRowTop = row < wt.getSetting('fixedRowsTop');
|
76631
76733
|
const fixedRowBottom = row >= view.countNotHiddenRowIndexes(0, 1) - wt.getSetting('fixedRowsBottom');
|
76632
76734
|
let relativeHeaderPosition;
|
76633
76735
|
if (fixedRowTop) {
|
76634
|
-
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition(this
|
76736
|
+
relativeHeaderPosition = wt.wtOverlays.topInlineStartCornerOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
76635
76737
|
} else if (fixedRowBottom) {
|
76636
|
-
relativeHeaderPosition = wt.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition(this
|
76738
|
+
relativeHeaderPosition = wt.wtOverlays.bottomInlineStartCornerOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
76637
76739
|
}
|
76638
76740
|
|
76639
76741
|
// If the TH is not a child of the top-left/bottom-left overlay, recalculate using
|
76640
76742
|
// the left overlay - as this overlay contains the rest of the headers.
|
76641
76743
|
if (!relativeHeaderPosition) {
|
76642
|
-
relativeHeaderPosition = wt.wtOverlays.inlineStartOverlay.getRelativeCellPosition(this
|
76744
|
+
relativeHeaderPosition = wt.wtOverlays.inlineStartOverlay.getRelativeCellPosition((0, _classPrivateFieldGet2.default)(this, _currentTH), cellCoords.row, cellCoords.col);
|
76643
76745
|
}
|
76644
|
-
this
|
76645
|
-
this
|
76746
|
+
(0, _classPrivateFieldSet2.default)(this, _currentRow, this.hot.rowIndexMapper.getVisualFromRenderableIndex(row));
|
76747
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedRows, []);
|
76646
76748
|
const isFullRowSelected = this.hot.selection.isSelectedByCorner() || this.hot.selection.isSelectedByRowHeader();
|
76647
76749
|
if (this.hot.selection.isSelected() && isFullRowSelected) {
|
76648
76750
|
const selectionRanges = this.hot.getSelectedRange();
|
@@ -76652,23 +76754,23 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76652
76754
|
|
76653
76755
|
// Add every selected row for resize action.
|
76654
76756
|
(0, _number.rangeEach)(fromRow, toRow, rowIndex => {
|
76655
|
-
if (!this.
|
76656
|
-
this.
|
76757
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedRows).includes(rowIndex)) {
|
76758
|
+
(0, _classPrivateFieldGet2.default)(this, _selectedRows).push(rowIndex);
|
76657
76759
|
}
|
76658
76760
|
});
|
76659
76761
|
});
|
76660
76762
|
}
|
76661
76763
|
|
76662
76764
|
// Resizing element beyond the current selection (also when there is no selection).
|
76663
|
-
if (!this.
|
76664
|
-
this
|
76765
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _selectedRows).includes((0, _classPrivateFieldGet2.default)(this, _currentRow))) {
|
76766
|
+
(0, _classPrivateFieldSet2.default)(this, _selectedRows, [(0, _classPrivateFieldGet2.default)(this, _currentRow)]);
|
76665
76767
|
}
|
76666
|
-
this
|
76667
|
-
this
|
76668
|
-
this.
|
76669
|
-
this.
|
76670
|
-
this.
|
76671
|
-
this.hot.rootElement.appendChild(
|
76768
|
+
(0, _classPrivateFieldSet2.default)(this, _startOffset, relativeHeaderPosition.top - 6);
|
76769
|
+
(0, _classPrivateFieldSet2.default)(this, _startHeight, parseInt(box.height, 10));
|
76770
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.top = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _startHeight)}px`;
|
76771
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir] = `${relativeHeaderPosition.start}px`;
|
76772
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.width = `${headerWidth}px`;
|
76773
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
76672
76774
|
}
|
76673
76775
|
|
76674
76776
|
/**
|
@@ -76677,7 +76779,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76677
76779
|
* @private
|
76678
76780
|
*/
|
76679
76781
|
refreshHandlePosition() {
|
76680
|
-
this.
|
76782
|
+
(0, _classPrivateFieldGet2.default)(this, _handle).style.top = `${(0, _classPrivateFieldGet2.default)(this, _startOffset) + (0, _classPrivateFieldGet2.default)(this, _currentHeight)}px`;
|
76681
76783
|
}
|
76682
76784
|
|
76683
76785
|
/**
|
@@ -76686,15 +76788,15 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76686
76788
|
* @private
|
76687
76789
|
*/
|
76688
76790
|
setupGuidePosition() {
|
76689
|
-
const handleWidth = parseInt((0, _element.outerWidth)(
|
76690
|
-
const handleEndPosition = parseInt(this.
|
76791
|
+
const handleWidth = parseInt((0, _element.outerWidth)((0, _classPrivateFieldGet2.default)(this, _handle)), 10);
|
76792
|
+
const handleEndPosition = parseInt((0, _classPrivateFieldGet2.default)(this, _handle).style[this.inlineDir], 10) + handleWidth;
|
76691
76793
|
const maximumVisibleElementWidth = parseInt(this.hot.view.maximumVisibleElementWidth(0), 10);
|
76692
|
-
(0, _element.addClass)(this
|
76693
|
-
(0, _element.addClass)(this
|
76694
|
-
this.
|
76695
|
-
this.
|
76696
|
-
this.
|
76697
|
-
this.hot.rootElement.appendChild(
|
76794
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
76795
|
+
(0, _element.addClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
76796
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.top = (0, _classPrivateFieldGet2.default)(this, _handle).style.top;
|
76797
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style[this.inlineDir] = `${handleEndPosition}px`;
|
76798
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.width = `${maximumVisibleElementWidth - handleWidth}px`;
|
76799
|
+
this.hot.rootElement.appendChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
76698
76800
|
}
|
76699
76801
|
|
76700
76802
|
/**
|
@@ -76703,7 +76805,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76703
76805
|
* @private
|
76704
76806
|
*/
|
76705
76807
|
refreshGuidePosition() {
|
76706
|
-
this.
|
76808
|
+
(0, _classPrivateFieldGet2.default)(this, _guide).style.top = (0, _classPrivateFieldGet2.default)(this, _handle).style.top;
|
76707
76809
|
}
|
76708
76810
|
|
76709
76811
|
/**
|
@@ -76712,8 +76814,8 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76712
76814
|
* @private
|
76713
76815
|
*/
|
76714
76816
|
hideHandleAndGuide() {
|
76715
|
-
(0, _element.removeClass)(this
|
76716
|
-
(0, _element.removeClass)(this
|
76817
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _handle), 'active');
|
76818
|
+
(0, _element.removeClass)((0, _classPrivateFieldGet2.default)(this, _guide), 'active');
|
76717
76819
|
}
|
76718
76820
|
|
76719
76821
|
/**
|
@@ -76756,10 +76858,10 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76756
76858
|
getActualRowHeight(row) {
|
76757
76859
|
// TODO: this should utilize `this.hot.getRowHeight` after it's fixed and working properly.
|
76758
76860
|
const walkontableHeight = this.hot.view._wt.wtTable.getRowHeight(row);
|
76759
|
-
if (walkontableHeight !== undefined && this
|
76861
|
+
if (walkontableHeight !== undefined && (0, _classPrivateFieldGet2.default)(this, _newSize) < walkontableHeight) {
|
76760
76862
|
return walkontableHeight;
|
76761
76863
|
}
|
76762
|
-
return this
|
76864
|
+
return (0, _classPrivateFieldGet2.default)(this, _newSize);
|
76763
76865
|
}
|
76764
76866
|
/**
|
76765
76867
|
* Auto-size row after doubleclick - callback.
|
@@ -76777,30 +76879,30 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76777
76879
|
const resize = (row, forceRender) => {
|
76778
76880
|
const hookNewSize = this.hot.runHooks('beforeRowResize', this.getActualRowHeight(row), row, true);
|
76779
76881
|
if (hookNewSize !== undefined) {
|
76780
|
-
this
|
76882
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, hookNewSize);
|
76781
76883
|
}
|
76782
|
-
this.setManualSize(row,
|
76884
|
+
this.setManualSize(row, (0, _classPrivateFieldGet2.default)(this, _newSize)); // double click sets auto row size
|
76783
76885
|
|
76784
76886
|
this.hot.runHooks('afterRowResize', this.getActualRowHeight(row), row, true);
|
76785
76887
|
if (forceRender) {
|
76786
76888
|
render();
|
76787
76889
|
}
|
76788
76890
|
};
|
76789
|
-
if (this
|
76790
|
-
const selectedRowsLength = this.
|
76891
|
+
if ((0, _classPrivateFieldGet2.default)(this, _dblclick) >= 2) {
|
76892
|
+
const selectedRowsLength = (0, _classPrivateFieldGet2.default)(this, _selectedRows).length;
|
76791
76893
|
if (selectedRowsLength > 1) {
|
76792
|
-
(0, _array.arrayEach)(this
|
76894
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
76793
76895
|
resize(selectedRow);
|
76794
76896
|
});
|
76795
76897
|
render();
|
76796
76898
|
} else {
|
76797
|
-
(0, _array.arrayEach)(this
|
76899
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
76798
76900
|
resize(selectedRow, true);
|
76799
76901
|
});
|
76800
76902
|
}
|
76801
76903
|
}
|
76802
|
-
this
|
76803
|
-
this
|
76904
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, 0);
|
76905
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, null);
|
76804
76906
|
}
|
76805
76907
|
/**
|
76806
76908
|
* Binds the mouse events.
|
@@ -76816,7 +76918,7 @@ class ManualRowResize extends _base.BasePlugin {
|
|
76816
76918
|
this.eventManager.addEventListener(rootElement, 'mousedown', e => _classPrivateMethodGet(this, _onMouseDown, _onMouseDown2).call(this, e));
|
76817
76919
|
this.eventManager.addEventListener(rootWindow, 'mousemove', e => _classPrivateMethodGet(this, _onMouseMove, _onMouseMove2).call(this, e));
|
76818
76920
|
this.eventManager.addEventListener(rootWindow, 'mouseup', () => _classPrivateMethodGet(this, _onMouseUp, _onMouseUp2).call(this));
|
76819
|
-
this.eventManager.addEventListener(this
|
76921
|
+
this.eventManager.addEventListener((0, _classPrivateFieldGet2.default)(this, _handle), 'contextmenu', () => _classPrivateMethodGet(this, _onContextMenu, _onContextMenu2).call(this));
|
76820
76922
|
}
|
76821
76923
|
/**
|
76822
76924
|
* Destroys the plugin instance.
|
@@ -76834,13 +76936,13 @@ function _onMouseOver2(event) {
|
|
76834
76936
|
}
|
76835
76937
|
|
76836
76938
|
// A "mouseover" action is triggered right after executing "contextmenu" event. It should be ignored.
|
76837
|
-
if (this
|
76939
|
+
if ((0, _classPrivateFieldGet2.default)(this, _isTriggeredByRMB) === true) {
|
76838
76940
|
return;
|
76839
76941
|
}
|
76840
76942
|
if (this.checkIfRowHeader(event.target)) {
|
76841
76943
|
const th = this.getClosestTHParent(event.target);
|
76842
76944
|
if (th) {
|
76843
|
-
if (!
|
76945
|
+
if (!(0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
76844
76946
|
this.setupHandlePosition(th);
|
76845
76947
|
}
|
76846
76948
|
}
|
@@ -76848,23 +76950,23 @@ function _onMouseOver2(event) {
|
|
76848
76950
|
}
|
76849
76951
|
function _onMouseDown2(event) {
|
76850
76952
|
if ((0, _element.hasClass)(event.target, 'manualRowResizer')) {
|
76851
|
-
this.setupHandlePosition(
|
76953
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
76852
76954
|
this.setupGuidePosition();
|
76853
|
-
this
|
76854
|
-
if (this
|
76855
|
-
this
|
76856
|
-
this.hot._registerTimeout(
|
76955
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, true);
|
76956
|
+
if ((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout) === null) {
|
76957
|
+
(0, _classPrivateFieldSet2.default)(this, _autoresizeTimeout, setTimeout(() => this.afterMouseDownTimeout(), 500));
|
76958
|
+
this.hot._registerTimeout((0, _classPrivateFieldGet2.default)(this, _autoresizeTimeout));
|
76857
76959
|
}
|
76858
|
-
this.
|
76859
|
-
this
|
76860
|
-
this
|
76960
|
+
(0, _classPrivateFieldSet2.default)(this, _dblclick, (0, _classPrivateFieldGet2.default)(this, _dblclick) + 1);
|
76961
|
+
(0, _classPrivateFieldSet2.default)(this, _startY, event.pageY);
|
76962
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, (0, _classPrivateFieldGet2.default)(this, _startHeight));
|
76861
76963
|
}
|
76862
76964
|
}
|
76863
76965
|
function _onMouseMove2(event) {
|
76864
|
-
if (
|
76865
|
-
this
|
76866
|
-
(0, _array.arrayEach)(this
|
76867
|
-
this
|
76966
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
76967
|
+
(0, _classPrivateFieldSet2.default)(this, _currentHeight, (0, _classPrivateFieldGet2.default)(this, _startHeight) + (event.pageY - (0, _classPrivateFieldGet2.default)(this, _startY)));
|
76968
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
76969
|
+
(0, _classPrivateFieldSet2.default)(this, _newSize, this.setManualSize(selectedRow, (0, _classPrivateFieldGet2.default)(this, _currentHeight)));
|
76868
76970
|
});
|
76869
76971
|
this.refreshHandlePosition();
|
76870
76972
|
this.refreshGuidePosition();
|
@@ -76884,43 +76986,43 @@ function _onMouseUp2() {
|
|
76884
76986
|
this.saveManualRowHeights();
|
76885
76987
|
this.hot.runHooks('afterRowResize', this.getActualRowHeight(row), row, false);
|
76886
76988
|
};
|
76887
|
-
if (
|
76989
|
+
if ((0, _classPrivateFieldGet2.default)(this, _pressed)) {
|
76888
76990
|
this.hideHandleAndGuide();
|
76889
|
-
this
|
76890
|
-
if (this
|
76891
|
-
const selectedRowsLength = this.
|
76991
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
76992
|
+
if ((0, _classPrivateFieldGet2.default)(this, _newSize) !== (0, _classPrivateFieldGet2.default)(this, _startHeight)) {
|
76993
|
+
const selectedRowsLength = (0, _classPrivateFieldGet2.default)(this, _selectedRows).length;
|
76892
76994
|
if (selectedRowsLength > 1) {
|
76893
|
-
(0, _array.arrayEach)(this
|
76995
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
76894
76996
|
runHooks(selectedRow);
|
76895
76997
|
});
|
76896
76998
|
render();
|
76897
76999
|
} else {
|
76898
|
-
(0, _array.arrayEach)(this
|
77000
|
+
(0, _array.arrayEach)((0, _classPrivateFieldGet2.default)(this, _selectedRows), selectedRow => {
|
76899
77001
|
runHooks(selectedRow, true);
|
76900
77002
|
});
|
76901
77003
|
}
|
76902
77004
|
}
|
76903
|
-
this.setupHandlePosition(
|
77005
|
+
this.setupHandlePosition((0, _classPrivateFieldGet2.default)(this, _currentTH));
|
76904
77006
|
}
|
76905
77007
|
}
|
76906
77008
|
function _onContextMenu2() {
|
76907
77009
|
this.hideHandleAndGuide();
|
76908
|
-
this.hot.rootElement.removeChild(
|
76909
|
-
this.hot.rootElement.removeChild(
|
76910
|
-
this
|
76911
|
-
this
|
77010
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _handle));
|
77011
|
+
this.hot.rootElement.removeChild((0, _classPrivateFieldGet2.default)(this, _guide));
|
77012
|
+
(0, _classPrivateFieldSet2.default)(this, _pressed, false);
|
77013
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, true);
|
76912
77014
|
|
76913
77015
|
// There is thrown "mouseover" event right after opening a context menu. This flag inform that handle
|
76914
77016
|
// shouldn't be drawn just after removing it.
|
76915
77017
|
this.hot._registerImmediate(() => {
|
76916
|
-
this
|
77018
|
+
(0, _classPrivateFieldSet2.default)(this, _isTriggeredByRMB, false);
|
76917
77019
|
});
|
76918
77020
|
}
|
76919
77021
|
function _onModifyRowHeight2(height, row) {
|
76920
77022
|
let newHeight = height;
|
76921
77023
|
if (this.enabled) {
|
76922
77024
|
const physicalRow = this.hot.toPhysicalRow(row);
|
76923
|
-
const rowHeight = this.
|
77025
|
+
const rowHeight = (0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).getValueAtIndex(physicalRow);
|
76924
77026
|
if (this.hot.getSettings()[PLUGIN_KEY] && rowHeight) {
|
76925
77027
|
newHeight = rowHeight;
|
76926
77028
|
}
|
@@ -76933,16 +77035,16 @@ function _onMapInit2() {
|
|
76933
77035
|
this.hot.batchExecution(() => {
|
76934
77036
|
if (typeof loadedManualRowHeights !== 'undefined') {
|
76935
77037
|
loadedManualRowHeights.forEach((height, index) => {
|
76936
|
-
this.
|
77038
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(index, height);
|
76937
77039
|
});
|
76938
77040
|
} else if (Array.isArray(initialSetting)) {
|
76939
77041
|
initialSetting.forEach((height, index) => {
|
76940
|
-
this.
|
77042
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(index, height);
|
76941
77043
|
});
|
76942
77044
|
(0, _classPrivateFieldSet2.default)(this, _config, initialSetting);
|
76943
77045
|
} else if (initialSetting === true && Array.isArray((0, _classPrivateFieldGet2.default)(this, _config))) {
|
76944
77046
|
(0, _classPrivateFieldGet2.default)(this, _config).forEach((height, index) => {
|
76945
|
-
this.
|
77047
|
+
(0, _classPrivateFieldGet2.default)(this, _rowHeightsMap).setValueAtIndex(index, height);
|
76946
77048
|
});
|
76947
77049
|
}
|
76948
77050
|
}, true);
|