handsontable 0.0.0-next-2ae8e35-20240613 → 0.0.0-next-f0353d0-20240614
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/core/core.js +16 -0
- package/3rdparty/walkontable/src/core/core.mjs +16 -0
- package/3rdparty/walkontable/src/facade/core.js +3 -0
- package/3rdparty/walkontable/src/facade/core.mjs +3 -0
- package/3rdparty/walkontable/src/renderer/index.js +11 -0
- package/3rdparty/walkontable/src/renderer/index.mjs +11 -0
- package/3rdparty/walkontable/src/renderer/table.js +16 -1
- package/3rdparty/walkontable/src/renderer/table.mjs +16 -1
- package/3rdparty/walkontable/src/settings.js +5 -1
- package/3rdparty/walkontable/src/settings.mjs +5 -1
- package/3rdparty/walkontable/src/table.js +1 -1
- package/3rdparty/walkontable/src/table.mjs +1 -1
- package/3rdparty/walkontable/src/utils/row.js +16 -0
- package/3rdparty/walkontable/src/utils/row.mjs +16 -0
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/common.d.ts +3 -0
- package/core.js +0 -6
- package/core.mjs +0 -6
- package/dist/handsontable.css +2 -2
- package/dist/handsontable.full.css +2 -2
- package/dist/handsontable.full.js +504 -249
- package/dist/handsontable.full.min.css +2 -2
- package/dist/handsontable.full.min.js +80 -80
- package/dist/handsontable.js +504 -249
- package/dist/handsontable.min.css +2 -2
- package/dist/handsontable.min.js +14 -14
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/package.json +1 -1
- package/pluginHooks.d.ts +3 -1
- package/pluginHooks.js +11 -0
- package/pluginHooks.mjs +11 -0
- package/plugins/mergeCells/calculations/autofill.js +1 -1
- package/plugins/mergeCells/calculations/autofill.mjs +1 -1
- package/plugins/mergeCells/cellCoords.js +61 -22
- package/plugins/mergeCells/cellCoords.mjs +61 -22
- package/plugins/mergeCells/cellsCollection.js +46 -53
- package/plugins/mergeCells/cellsCollection.mjs +46 -53
- package/plugins/mergeCells/mergeCells.js +133 -92
- package/plugins/mergeCells/mergeCells.mjs +134 -93
- package/plugins/mergeCells/renderer.js +70 -0
- package/plugins/mergeCells/renderer.mjs +66 -0
- package/tableView.js +92 -22
- package/tableView.mjs +92 -22
- package/plugins/mergeCells/utils.js +0 -28
- package/plugins/mergeCells/utils.mjs +0 -24
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: 0.0.0-next-
|
29
|
-
* Release date: 11/06/2024 (built at
|
28
|
+
* Version: 0.0.0-next-f0353d0-20240614
|
29
|
+
* Release date: 11/06/2024 (built at 14/06/2024 06:27:14)
|
30
30
|
*/
|
31
31
|
(function webpackUniversalModuleDefinition(root, factory) {
|
32
32
|
if(typeof exports === 'object' && typeof module === 'object')
|
@@ -107,8 +107,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
107
107
|
Handsontable.CellCoords = _src.CellCoords;
|
108
108
|
Handsontable.CellRange = _src.CellRange;
|
109
109
|
Handsontable.packageName = 'handsontable';
|
110
|
-
Handsontable.buildDate = "
|
111
|
-
Handsontable.version = "0.0.0-next-
|
110
|
+
Handsontable.buildDate = "14/06/2024 06:27:14";
|
111
|
+
Handsontable.version = "0.0.0-next-f0353d0-20240614";
|
112
112
|
Handsontable.languages = {
|
113
113
|
dictionaryKeys: _registry.dictionaryKeys,
|
114
114
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
@@ -3666,12 +3666,6 @@ function Core(rootElement, userSettings) {
|
|
3666
3666
|
* @returns {number}
|
3667
3667
|
*/
|
3668
3668
|
this._getRowHeightFromSettings = function (row) {
|
3669
|
-
// let cellProperties = instance.getCellMeta(row, 0);
|
3670
|
-
// let height = cellProperties.height;
|
3671
|
-
//
|
3672
|
-
// if (height === undefined || height === tableMeta.height) {
|
3673
|
-
// height = cellProperties.rowHeights;
|
3674
|
-
// }
|
3675
3669
|
let height = tableMeta.rowHeights;
|
3676
3670
|
if (height !== undefined && height !== null) {
|
3677
3671
|
switch (typeof height) {
|
@@ -9129,7 +9123,7 @@ const domMessages = {
|
|
9129
9123
|
function _injectProductInfo(key, element) {
|
9130
9124
|
const hasValidType = !isEmpty(key);
|
9131
9125
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
9132
|
-
const hotVersion = "0.0.0-next-
|
9126
|
+
const hotVersion = "0.0.0-next-f0353d0-20240614";
|
9133
9127
|
let keyValidityDate;
|
9134
9128
|
let consoleMessageState = 'invalid';
|
9135
9129
|
let domMessageState = 'invalid';
|
@@ -12917,6 +12911,17 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
12917
12911
|
* @param {number} row Visual row index.
|
12918
12912
|
*/
|
12919
12913
|
'modifyRowHeight',
|
12914
|
+
/**
|
12915
|
+
* Fired when a row height is about to be modified by a callback function. The hook allows to change the row height
|
12916
|
+
* for the specified overlay type.
|
12917
|
+
*
|
12918
|
+
* @since 14.5.0
|
12919
|
+
* @event Hooks#modifyRowHeightByOverlayName
|
12920
|
+
* @param {number} height Row height.
|
12921
|
+
* @param {number} row Visual row index.
|
12922
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName Overlay name.
|
12923
|
+
*/
|
12924
|
+
'modifyRowHeightByOverlayName',
|
12920
12925
|
/**
|
12921
12926
|
* Fired when a data was retrieved or modified.
|
12922
12927
|
*
|
@@ -16938,7 +16943,7 @@ class TableView {
|
|
16938
16943
|
// immediate click on "holder" means click on the right side of vertical scrollbar
|
16939
16944
|
const {
|
16940
16945
|
holder
|
16941
|
-
} = this.
|
16946
|
+
} = this._wt.wtTable;
|
16942
16947
|
if (next === holder) {
|
16943
16948
|
const scrollbarWidth = (0, _element.getScrollbarWidth)(rootDocument);
|
16944
16949
|
if (rootDocument.elementFromPoint(eventX + scrollbarWidth, eventY) !== holder || rootDocument.elementFromPoint(eventX, eventY + scrollbarWidth) !== holder) {
|
@@ -17285,6 +17290,11 @@ class TableView {
|
|
17285
17290
|
const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
|
17286
17291
|
return this.hot.getRowHeight(visualIndex === null ? renderedRowIndex : visualIndex);
|
17287
17292
|
},
|
17293
|
+
rowHeightByOverlayName: (renderedRowIndex, overlayType) => {
|
17294
|
+
const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
|
17295
|
+
const visualRowIndex = visualIndex === null ? renderedRowIndex : visualIndex;
|
17296
|
+
return this.hot.runHooks('modifyRowHeightByOverlayName', this.hot.getRowHeight(visualRowIndex), visualRowIndex, overlayType);
|
17297
|
+
},
|
17288
17298
|
cellRenderer: (renderedRowIndex, renderedColumnIndex, TD) => {
|
17289
17299
|
const [visualRowIndex, visualColumnIndex] = this.translateFromRenderableToVisualIndex(renderedRowIndex, renderedColumnIndex);
|
17290
17300
|
|
@@ -17613,7 +17623,7 @@ class TableView {
|
|
17613
17623
|
if ((0, _element.isInput)(el)) {
|
17614
17624
|
return true;
|
17615
17625
|
}
|
17616
|
-
const isChildOfTableBody = (0, _element.isChildOf)(el, this.
|
17626
|
+
const isChildOfTableBody = (0, _element.isChildOf)(el, this._wt.wtTable.spreader);
|
17617
17627
|
if (this.settings.fragmentSelection === true && isChildOfTableBody) {
|
17618
17628
|
return true;
|
17619
17629
|
}
|
@@ -17844,75 +17854,119 @@ class TableView {
|
|
17844
17854
|
}
|
17845
17855
|
|
17846
17856
|
/**
|
17847
|
-
* Returns the first
|
17857
|
+
* Returns the first rendered row in the DOM (usually is not visible).
|
17858
|
+
*
|
17859
|
+
* @returns {number}
|
17860
|
+
*/
|
17861
|
+
getFirstRenderedVisibleRow() {
|
17862
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());
|
17863
|
+
}
|
17864
|
+
|
17865
|
+
/**
|
17866
|
+
* Returns the last rendered row in the DOM (usually is not visible).
|
17867
|
+
*
|
17868
|
+
* @returns {number}
|
17869
|
+
*/
|
17870
|
+
getLastRenderedVisibleRow() {
|
17871
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());
|
17872
|
+
}
|
17873
|
+
|
17874
|
+
/**
|
17875
|
+
* Returns the first rendered column in the DOM (usually is not visible).
|
17876
|
+
*
|
17877
|
+
* @returns {number}
|
17878
|
+
*/
|
17879
|
+
getFirstRenderedVisibleColumn() {
|
17880
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());
|
17881
|
+
}
|
17882
|
+
|
17883
|
+
/**
|
17884
|
+
* Returns the last rendered column in the DOM (usually is not visible).
|
17885
|
+
*
|
17886
|
+
* @returns {number}
|
17887
|
+
*/
|
17888
|
+
getLastRenderedVisibleColumn() {
|
17889
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());
|
17890
|
+
}
|
17891
|
+
|
17892
|
+
/**
|
17893
|
+
* Returns the first fully visible row in the table viewport. When the table has overlays the method returns
|
17894
|
+
* the first row of the master table that is not overlapped by overlay.
|
17848
17895
|
*
|
17849
17896
|
* @returns {number}
|
17850
17897
|
*/
|
17851
17898
|
getFirstFullyVisibleRow() {
|
17852
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
17899
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow());
|
17853
17900
|
}
|
17854
17901
|
|
17855
17902
|
/**
|
17856
|
-
* Returns the last fully visible row in the table viewport.
|
17903
|
+
* Returns the last fully visible row in the table viewport. When the table has overlays the method returns
|
17904
|
+
* the first row of the master table that is not overlapped by overlay.
|
17857
17905
|
*
|
17858
17906
|
* @returns {number}
|
17859
17907
|
*/
|
17860
17908
|
getLastFullyVisibleRow() {
|
17861
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
17909
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow());
|
17862
17910
|
}
|
17863
17911
|
|
17864
17912
|
/**
|
17865
|
-
* Returns the first fully visible column in the table viewport.
|
17913
|
+
* Returns the first fully visible column in the table viewport. When the table has overlays the method returns
|
17914
|
+
* the first row of the master table that is not overlapped by overlay.
|
17866
17915
|
*
|
17867
17916
|
* @returns {number}
|
17868
17917
|
*/
|
17869
17918
|
getFirstFullyVisibleColumn() {
|
17870
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
17919
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn());
|
17871
17920
|
}
|
17872
17921
|
|
17873
17922
|
/**
|
17874
|
-
* Returns the last fully visible column in the table viewport.
|
17923
|
+
* Returns the last fully visible column in the table viewport. When the table has overlays the method returns
|
17924
|
+
* the first row of the master table that is not overlapped by overlay.
|
17875
17925
|
*
|
17876
17926
|
* @returns {number}
|
17877
17927
|
*/
|
17878
17928
|
getLastFullyVisibleColumn() {
|
17879
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
17929
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn());
|
17880
17930
|
}
|
17881
17931
|
|
17882
17932
|
/**
|
17883
|
-
* Returns the first partially visible row in the table viewport.
|
17933
|
+
* Returns the first partially visible row in the table viewport. When the table has overlays the method returns
|
17934
|
+
* the first row of the master table that is not overlapped by overlay.
|
17884
17935
|
*
|
17885
17936
|
* @returns {number}
|
17886
17937
|
*/
|
17887
17938
|
getFirstPartiallyVisibleRow() {
|
17888
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
17939
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow());
|
17889
17940
|
}
|
17890
17941
|
|
17891
17942
|
/**
|
17892
|
-
* Returns the last partially visible row in the table viewport.
|
17943
|
+
* Returns the last partially visible row in the table viewport. When the table has overlays the method returns
|
17944
|
+
* the first row of the master table that is not overlapped by overlay.
|
17893
17945
|
*
|
17894
17946
|
* @returns {number}
|
17895
17947
|
*/
|
17896
17948
|
getLastPartiallyVisibleRow() {
|
17897
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
17949
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow());
|
17898
17950
|
}
|
17899
17951
|
|
17900
17952
|
/**
|
17901
|
-
* Returns the first partially visible column in the table viewport.
|
17953
|
+
* Returns the first partially visible column in the table viewport. When the table has overlays the method returns
|
17954
|
+
* the first row of the master table that is not overlapped by overlay.
|
17902
17955
|
*
|
17903
17956
|
* @returns {number}
|
17904
17957
|
*/
|
17905
17958
|
getFirstPartiallyVisibleColumn() {
|
17906
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
17959
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn());
|
17907
17960
|
}
|
17908
17961
|
|
17909
17962
|
/**
|
17910
|
-
* Returns the last partially visible column in the table viewport.
|
17963
|
+
* Returns the last partially visible column in the table viewport. When the table has overlays the method returns
|
17964
|
+
* the first row of the master table that is not overlapped by overlay.
|
17911
17965
|
*
|
17912
17966
|
* @returns {number}
|
17913
17967
|
*/
|
17914
17968
|
getLastPartiallyVisibleColumn() {
|
17915
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
17969
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn());
|
17916
17970
|
}
|
17917
17971
|
|
17918
17972
|
/**
|
@@ -17941,7 +17995,7 @@ class TableView {
|
|
17941
17995
|
* @returns {number}
|
17942
17996
|
*/
|
17943
17997
|
getViewportWidth() {
|
17944
|
-
return this.
|
17998
|
+
return this._wt.wtViewport.getViewportWidth();
|
17945
17999
|
}
|
17946
18000
|
|
17947
18001
|
/**
|
@@ -17950,7 +18004,7 @@ class TableView {
|
|
17950
18004
|
* @returns {number}
|
17951
18005
|
*/
|
17952
18006
|
getWorkspaceWidth() {
|
17953
|
-
return this.
|
18007
|
+
return this._wt.wtViewport.getWorkspaceWidth();
|
17954
18008
|
}
|
17955
18009
|
|
17956
18010
|
/**
|
@@ -17961,7 +18015,7 @@ class TableView {
|
|
17961
18015
|
* @returns {number}
|
17962
18016
|
*/
|
17963
18017
|
getViewportHeight() {
|
17964
|
-
return this.
|
18018
|
+
return this._wt.wtViewport.getViewportHeight();
|
17965
18019
|
}
|
17966
18020
|
|
17967
18021
|
/**
|
@@ -17970,7 +18024,28 @@ class TableView {
|
|
17970
18024
|
* @returns {number}
|
17971
18025
|
*/
|
17972
18026
|
getWorkspaceHeight() {
|
17973
|
-
return this.
|
18027
|
+
return this._wt.wtViewport.getWorkspaceHeight();
|
18028
|
+
}
|
18029
|
+
|
18030
|
+
/**
|
18031
|
+
* Checks to what overlay the provided element belongs.
|
18032
|
+
*
|
18033
|
+
* @param {HTMLElement} element The DOM element to check.
|
18034
|
+
* @returns {'master'|'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'}
|
18035
|
+
*/
|
18036
|
+
getElementOverlayName(element) {
|
18037
|
+
var _this$_wt$wtOverlays$;
|
18038
|
+
return ((_this$_wt$wtOverlays$ = this._wt.wtOverlays.getParentOverlay(element)) !== null && _this$_wt$wtOverlays$ !== void 0 ? _this$_wt$wtOverlays$ : this._wt).wtTable.name;
|
18039
|
+
}
|
18040
|
+
|
18041
|
+
/**
|
18042
|
+
* Gets the overlay instance by its name.
|
18043
|
+
*
|
18044
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
|
18045
|
+
* @returns {Overlay | null}
|
18046
|
+
*/
|
18047
|
+
getOverlayByName(overlayName) {
|
18048
|
+
return this._wt.getOverlayByName(overlayName);
|
17974
18049
|
}
|
17975
18050
|
/**
|
17976
18051
|
* Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
|
@@ -19880,6 +19955,9 @@ class WalkontableFacade {
|
|
19880
19955
|
getOverlayName() {
|
19881
19956
|
return this._wot.cloneOverlay ? this._wot.cloneOverlay.type : 'master';
|
19882
19957
|
}
|
19958
|
+
getOverlayByName(overlayName) {
|
19959
|
+
return this._wot.getOverlayByName(overlayName);
|
19960
|
+
}
|
19883
19961
|
exportSettingsAsClassNames() {
|
19884
19962
|
return this._wot.exportSettingsAsClassNames();
|
19885
19963
|
}
|
@@ -19911,6 +19989,7 @@ exports.__esModule = true;
|
|
19911
19989
|
__webpack_require__(90);
|
19912
19990
|
var _event = _interopRequireDefault(__webpack_require__(196));
|
19913
19991
|
var _overlays = _interopRequireDefault(__webpack_require__(197));
|
19992
|
+
var _overlay = __webpack_require__(198);
|
19914
19993
|
var _settings = _interopRequireDefault(__webpack_require__(249));
|
19915
19994
|
var _master = _interopRequireDefault(__webpack_require__(250));
|
19916
19995
|
var _viewport = _interopRequireDefault(__webpack_require__(251));
|
@@ -19961,6 +20040,21 @@ class Walkontable extends _base.default {
|
|
19961
20040
|
(0, _element.addClass)(this.wtTable.wtRootElement.parentNode, newClassNames);
|
19962
20041
|
}
|
19963
20042
|
|
20043
|
+
/**
|
20044
|
+
* Gets the overlay instance by its name.
|
20045
|
+
*
|
20046
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
|
20047
|
+
* @returns {Overlay | null}
|
20048
|
+
*/
|
20049
|
+
getOverlayByName(overlayName) {
|
20050
|
+
var _this$wtOverlays;
|
20051
|
+
if (!_overlay.CLONE_TYPES.includes(overlayName)) {
|
20052
|
+
return null;
|
20053
|
+
}
|
20054
|
+
const camelCaseOverlay = overlayName.replace(/_([a-z])/g, match => match[1].toUpperCase());
|
20055
|
+
return (_this$wtOverlays = this.wtOverlays[`${camelCaseOverlay}Overlay`]) !== null && _this$wtOverlays !== void 0 ? _this$wtOverlays : null;
|
20056
|
+
}
|
20057
|
+
|
19964
20058
|
/**
|
19965
20059
|
* @returns {ViewportDao}
|
19966
20060
|
*/
|
@@ -21617,7 +21711,7 @@ class Table {
|
|
21617
21711
|
this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);
|
21618
21712
|
}
|
21619
21713
|
this.resetOversizedRows();
|
21620
|
-
this.tableRenderer.setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
|
21714
|
+
this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
|
21621
21715
|
let workspaceWidth;
|
21622
21716
|
if (this.isMaster) {
|
21623
21717
|
workspaceWidth = this.dataAccessObject.workspaceWidth;
|
@@ -22604,6 +22698,17 @@ class Renderer {
|
|
22604
22698
|
this.renderer.setAxisUtils(rowUtils, columnUtils);
|
22605
22699
|
}
|
22606
22700
|
|
22701
|
+
/**
|
22702
|
+
* Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
|
22703
|
+
*
|
22704
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
|
22705
|
+
* @returns {Renderer}
|
22706
|
+
*/
|
22707
|
+
setActiveOverlayName(overlayName) {
|
22708
|
+
this.renderer.setActiveOverlayName(overlayName);
|
22709
|
+
return this;
|
22710
|
+
}
|
22711
|
+
|
22607
22712
|
/**
|
22608
22713
|
* Sets filter calculators for newly calculated row and column position. The filters are used to transform visual
|
22609
22714
|
* indexes (0 to N) to source indexes provided by Handsontable.
|
@@ -23934,11 +24039,26 @@ class TableRenderer {
|
|
23934
24039
|
* @type {Function}
|
23935
24040
|
*/
|
23936
24041
|
(0, _defineProperty2.default)(this, "cellRenderer", void 0);
|
24042
|
+
/**
|
24043
|
+
* Holds the name of the currently active overlay.
|
24044
|
+
*
|
24045
|
+
* @type {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'}
|
24046
|
+
*/
|
24047
|
+
(0, _defineProperty2.default)(this, "activeOverlayName", void 0);
|
23937
24048
|
this.rootNode = rootNode;
|
23938
24049
|
this.rootDocument = this.rootNode.ownerDocument;
|
23939
24050
|
this.cellRenderer = cellRenderer;
|
23940
24051
|
}
|
23941
24052
|
|
24053
|
+
/**
|
24054
|
+
* Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
|
24055
|
+
*
|
24056
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
|
24057
|
+
*/
|
24058
|
+
setActiveOverlayName(overlayName) {
|
24059
|
+
this.activeOverlayName = overlayName;
|
24060
|
+
}
|
24061
|
+
|
23942
24062
|
/**
|
23943
24063
|
* Set row and column util classes.
|
23944
24064
|
*
|
@@ -24072,7 +24192,7 @@ class TableRenderer {
|
|
24072
24192
|
const TR = rows.getRenderedNode(visibleRowIndex);
|
24073
24193
|
if (TR.firstChild) {
|
24074
24194
|
const sourceRowIndex = this.renderedRowToSource(visibleRowIndex);
|
24075
|
-
const rowHeight = this.rowUtils.
|
24195
|
+
const rowHeight = this.rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
|
24076
24196
|
if (rowHeight) {
|
24077
24197
|
// Decrease height. 1 pixel will be "replaced" by 1px border top
|
24078
24198
|
TR.firstChild.style.height = `${rowHeight - 1}px`;
|
@@ -24479,6 +24599,22 @@ class RowUtils {
|
|
24479
24599
|
}
|
24480
24600
|
return height;
|
24481
24601
|
}
|
24602
|
+
|
24603
|
+
/**
|
24604
|
+
* Returns row height based on passed source index for the specified overlay type.
|
24605
|
+
*
|
24606
|
+
* @param {number} sourceIndex Row source index.
|
24607
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
|
24608
|
+
* @returns {number}
|
24609
|
+
*/
|
24610
|
+
getHeightByOverlayName(sourceIndex, overlayName) {
|
24611
|
+
let height = this.wtSettings.getSetting('rowHeightByOverlayName', sourceIndex, overlayName);
|
24612
|
+
const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
|
24613
|
+
if (oversizedHeight !== undefined) {
|
24614
|
+
height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
|
24615
|
+
}
|
24616
|
+
return height;
|
24617
|
+
}
|
24482
24618
|
}
|
24483
24619
|
exports["default"] = RowUtils;
|
24484
24620
|
|
@@ -29109,7 +29245,8 @@ var _object = __webpack_require__(148);
|
|
29109
29245
|
* @property {Option} renderAllColumns Option `renderAllColumns`.
|
29110
29246
|
* @property {Option} renderAllRows Option `renderAllRows`.
|
29111
29247
|
* @property {Option} rowHeaders Option `rowHeaders`.
|
29112
|
-
* @property {Option} rowHeight
|
29248
|
+
* @property {Option} rowHeightOption `rowHeight`.
|
29249
|
+
* @property {Option} rowHeightByOverlayName Option `rowHeightByOverlayName`.
|
29113
29250
|
* @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
|
29114
29251
|
* @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
|
29115
29252
|
* @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
|
@@ -29253,6 +29390,9 @@ class Settings {
|
|
29253
29390
|
rowHeight() {
|
29254
29391
|
// return undefined means use default size for the rendered cell content
|
29255
29392
|
},
|
29393
|
+
rowHeightByOverlayName() {
|
29394
|
+
// return undefined means use default size for the rendered cell content
|
29395
|
+
},
|
29256
29396
|
defaultRowHeight: 23,
|
29257
29397
|
defaultColumnWidth: 50,
|
29258
29398
|
selections: null,
|
@@ -79341,18 +79481,18 @@ var _base = __webpack_require__(472);
|
|
79341
79481
|
var _pluginHooks = _interopRequireDefault(__webpack_require__(160));
|
79342
79482
|
var _cellsCollection = _interopRequireDefault(__webpack_require__(666));
|
79343
79483
|
var _cellCoords = _interopRequireDefault(__webpack_require__(667));
|
79344
|
-
var _autofill = _interopRequireDefault(__webpack_require__(
|
79345
|
-
var _selection = _interopRequireDefault(__webpack_require__(
|
79346
|
-
var _toggleMerge = _interopRequireDefault(__webpack_require__(
|
79484
|
+
var _autofill = _interopRequireDefault(__webpack_require__(668));
|
79485
|
+
var _selection = _interopRequireDefault(__webpack_require__(669));
|
79486
|
+
var _toggleMerge = _interopRequireDefault(__webpack_require__(670));
|
79347
79487
|
var _array = __webpack_require__(144);
|
79348
79488
|
var _object = __webpack_require__(148);
|
79349
79489
|
var _console = __webpack_require__(166);
|
79350
79490
|
var _number = __webpack_require__(178);
|
79351
|
-
|
79352
|
-
__webpack_require__(672);
|
79491
|
+
__webpack_require__(671);
|
79353
79492
|
var _element = __webpack_require__(138);
|
79354
79493
|
var _browser = __webpack_require__(147);
|
79355
|
-
var _focusOrder2 = __webpack_require__(
|
79494
|
+
var _focusOrder2 = __webpack_require__(672);
|
79495
|
+
var _renderer = __webpack_require__(674);
|
79356
79496
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
79357
79497
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
79358
79498
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -79407,6 +79547,7 @@ const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
79407
79547
|
var _lastSelectedFocus = /*#__PURE__*/new WeakMap();
|
79408
79548
|
var _lastFocusDelta = /*#__PURE__*/new WeakMap();
|
79409
79549
|
var _focusOrder = /*#__PURE__*/new WeakMap();
|
79550
|
+
var _cellRenderer = /*#__PURE__*/new WeakMap();
|
79410
79551
|
var _MergeCells_brand = /*#__PURE__*/new WeakSet();
|
79411
79552
|
class MergeCells extends _base.BasePlugin {
|
79412
79553
|
constructor() {
|
@@ -79463,6 +79604,12 @@ class MergeCells extends _base.BasePlugin {
|
|
79463
79604
|
rowIndexMapper: this.hot.rowIndexMapper,
|
79464
79605
|
columnIndexMapper: this.hot.columnIndexMapper
|
79465
79606
|
}));
|
79607
|
+
/**
|
79608
|
+
* The cell renderer responsible for rendering the merged cells.
|
79609
|
+
*
|
79610
|
+
* @type {{before: Function, after: Function}}
|
79611
|
+
*/
|
79612
|
+
_classPrivateFieldInitSpec(this, _cellRenderer, (0, _renderer.createMergeCellRenderer)(this));
|
79466
79613
|
}
|
79467
79614
|
static get PLUGIN_KEY() {
|
79468
79615
|
return PLUGIN_KEY;
|
@@ -79564,94 +79711,97 @@ class MergeCells extends _base.BasePlugin {
|
|
79564
79711
|
return _assertClassBrand(_MergeCells_brand, _this, _onAfterIsMultipleSelection).call(_this, ...args);
|
79565
79712
|
});
|
79566
79713
|
this.addHook('afterRenderer', function () {
|
79714
|
+
return _classPrivateFieldGet(_cellRenderer, _this).after(...arguments);
|
79715
|
+
});
|
79716
|
+
this.addHook('afterContextMenuDefaultOptions', function () {
|
79567
79717
|
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
79568
79718
|
args[_key13] = arguments[_key13];
|
79569
79719
|
}
|
79570
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79720
|
+
return _assertClassBrand(_MergeCells_brand, _this, _addMergeActionsToContextMenu).call(_this, ...args);
|
79571
79721
|
});
|
79572
|
-
this.addHook('
|
79722
|
+
this.addHook('afterGetCellMeta', function () {
|
79573
79723
|
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
79574
79724
|
args[_key14] = arguments[_key14];
|
79575
79725
|
}
|
79576
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79726
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterGetCellMeta).call(_this, ...args);
|
79577
79727
|
});
|
79578
|
-
this.addHook('
|
79728
|
+
this.addHook('afterViewportRowCalculatorOverride', function () {
|
79579
79729
|
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
79580
79730
|
args[_key15] = arguments[_key15];
|
79581
79731
|
}
|
79582
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79732
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterViewportRowCalculatorOverride).call(_this, ...args);
|
79583
79733
|
});
|
79584
|
-
this.addHook('
|
79734
|
+
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
79585
79735
|
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
79586
79736
|
args[_key16] = arguments[_key16];
|
79587
79737
|
}
|
79588
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79738
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterViewportColumnCalculatorOverride).call(_this, ...args);
|
79589
79739
|
});
|
79590
|
-
this.addHook('
|
79740
|
+
this.addHook('modifyAutofillRange', function () {
|
79591
79741
|
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
79592
79742
|
args[_key17] = arguments[_key17];
|
79593
79743
|
}
|
79594
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79744
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onModifyAutofillRange).call(_this, ...args);
|
79595
79745
|
});
|
79596
|
-
this.addHook('
|
79746
|
+
this.addHook('afterCreateCol', function () {
|
79597
79747
|
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
79598
79748
|
args[_key18] = arguments[_key18];
|
79599
79749
|
}
|
79600
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79750
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterCreateCol).call(_this, ...args);
|
79601
79751
|
});
|
79602
|
-
this.addHook('
|
79752
|
+
this.addHook('afterRemoveCol', function () {
|
79603
79753
|
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
79604
79754
|
args[_key19] = arguments[_key19];
|
79605
79755
|
}
|
79606
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79756
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterRemoveCol).call(_this, ...args);
|
79607
79757
|
});
|
79608
|
-
this.addHook('
|
79758
|
+
this.addHook('afterCreateRow', function () {
|
79609
79759
|
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
79610
79760
|
args[_key20] = arguments[_key20];
|
79611
79761
|
}
|
79612
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79762
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterCreateRow).call(_this, ...args);
|
79613
79763
|
});
|
79614
|
-
this.addHook('
|
79764
|
+
this.addHook('afterRemoveRow', function () {
|
79615
79765
|
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
79616
79766
|
args[_key21] = arguments[_key21];
|
79617
79767
|
}
|
79618
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79768
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterRemoveRow).call(_this, ...args);
|
79619
79769
|
});
|
79620
|
-
this.addHook('
|
79770
|
+
this.addHook('afterChange', function () {
|
79621
79771
|
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
79622
79772
|
args[_key22] = arguments[_key22];
|
79623
79773
|
}
|
79624
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79774
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterChange).call(_this, ...args);
|
79625
79775
|
});
|
79626
|
-
this.addHook('
|
79776
|
+
this.addHook('beforeDrawBorders', function () {
|
79627
79777
|
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
79628
79778
|
args[_key23] = arguments[_key23];
|
79629
79779
|
}
|
79630
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79780
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onBeforeDrawAreaBorders).call(_this, ...args);
|
79631
79781
|
});
|
79632
|
-
this.addHook('
|
79782
|
+
this.addHook('afterDrawSelection', function () {
|
79633
79783
|
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
|
79634
79784
|
args[_key24] = arguments[_key24];
|
79635
79785
|
}
|
79636
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79786
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterDrawSelection).call(_this, ...args);
|
79637
79787
|
});
|
79638
|
-
this.addHook('
|
79788
|
+
this.addHook('beforeRemoveCellClassNames', function () {
|
79639
79789
|
for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
|
79640
79790
|
args[_key25] = arguments[_key25];
|
79641
79791
|
}
|
79642
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79792
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onBeforeRemoveCellClassNames).call(_this, ...args);
|
79643
79793
|
});
|
79644
|
-
this.addHook('
|
79794
|
+
this.addHook('beforeBeginEditing', function () {
|
79645
79795
|
for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
|
79646
79796
|
args[_key26] = arguments[_key26];
|
79647
79797
|
}
|
79648
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79798
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onBeforeBeginEditing).call(_this, ...args);
|
79649
79799
|
});
|
79650
|
-
this.addHook('
|
79800
|
+
this.addHook('modifyRowHeightByOverlayName', function () {
|
79651
79801
|
for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {
|
79652
79802
|
args[_key27] = arguments[_key27];
|
79653
79803
|
}
|
79654
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
79804
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onModifyRowHeightByOverlayName).call(_this, ...args);
|
79655
79805
|
});
|
79656
79806
|
this.addHook('beforeUndoStackChange', (action, source) => {
|
79657
79807
|
if (source === 'MergeCells') {
|
@@ -79742,24 +79892,26 @@ class MergeCells extends _base.BasePlugin {
|
|
79742
79892
|
* @returns {boolean}
|
79743
79893
|
*/
|
79744
79894
|
validateSetting(setting) {
|
79745
|
-
let valid = true;
|
79746
79895
|
if (!setting) {
|
79747
79896
|
return false;
|
79748
79897
|
}
|
79749
79898
|
if (_cellCoords.default.containsNegativeValues(setting)) {
|
79750
79899
|
(0, _console.warn)(_cellCoords.default.NEGATIVE_VALUES_WARNING(setting));
|
79751
|
-
|
79752
|
-
}
|
79900
|
+
return false;
|
79901
|
+
}
|
79902
|
+
if (_cellCoords.default.isOutOfBounds(setting, this.hot.countRows(), this.hot.countCols())) {
|
79753
79903
|
(0, _console.warn)(_cellCoords.default.IS_OUT_OF_BOUNDS_WARNING(setting));
|
79754
|
-
|
79755
|
-
}
|
79904
|
+
return false;
|
79905
|
+
}
|
79906
|
+
if (_cellCoords.default.isSingleCell(setting)) {
|
79756
79907
|
(0, _console.warn)(_cellCoords.default.IS_SINGLE_CELL(setting));
|
79757
|
-
|
79758
|
-
}
|
79908
|
+
return false;
|
79909
|
+
}
|
79910
|
+
if (_cellCoords.default.containsZeroSpan(setting)) {
|
79759
79911
|
(0, _console.warn)(_cellCoords.default.ZERO_SPAN_WARNING(setting));
|
79760
|
-
|
79912
|
+
return false;
|
79761
79913
|
}
|
79762
|
-
return
|
79914
|
+
return true;
|
79763
79915
|
}
|
79764
79916
|
|
79765
79917
|
/**
|
@@ -79940,7 +80092,7 @@ class MergeCells extends _base.BasePlugin {
|
|
79940
80092
|
unmergeRange(cellRange) {
|
79941
80093
|
let auto = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
79942
80094
|
const mergedCells = this.mergedCellsCollection.getWithinRange(cellRange);
|
79943
|
-
if (
|
80095
|
+
if (mergedCells.length === 0) {
|
79944
80096
|
return;
|
79945
80097
|
}
|
79946
80098
|
this.hot.runHooks('beforeUnmergeCells', cellRange, auto);
|
@@ -80445,47 +80597,6 @@ function _addMergeActionsToContextMenu(defaultOptions) {
|
|
80445
80597
|
name: '---------'
|
80446
80598
|
}, (0, _toggleMerge.default)(this));
|
80447
80599
|
}
|
80448
|
-
/**
|
80449
|
-
* `afterRenderer` hook callback.
|
80450
|
-
*
|
80451
|
-
* @param {HTMLElement} TD The cell to be modified.
|
80452
|
-
* @param {number} row Row index.
|
80453
|
-
* @param {number} col Visual column index.
|
80454
|
-
*/
|
80455
|
-
function _onAfterRenderer(TD, row, col) {
|
80456
|
-
const mergedCell = this.mergedCellsCollection.get(row, col);
|
80457
|
-
if ((0, _object.isObject)(mergedCell)) {
|
80458
|
-
// We shouldn't override data in the collection.
|
80459
|
-
const mergedCellCopy = (0, _object.clone)(mergedCell);
|
80460
|
-
const {
|
80461
|
-
rowIndexMapper: rowMapper,
|
80462
|
-
columnIndexMapper: columnMapper
|
80463
|
-
} = this.hot;
|
80464
|
-
const {
|
80465
|
-
row: mergeRow,
|
80466
|
-
col: mergeColumn,
|
80467
|
-
colspan,
|
80468
|
-
rowspan
|
80469
|
-
} = mergedCellCopy;
|
80470
|
-
const [lastMergedRowIndex, lastMergedColumnIndex] = this.translateMergedCellToRenderable(mergeRow, rowspan, mergeColumn, colspan);
|
80471
|
-
const renderedRowIndex = rowMapper.getRenderableFromVisualIndex(row);
|
80472
|
-
const renderedColumnIndex = columnMapper.getRenderableFromVisualIndex(col);
|
80473
|
-
const maxRowSpan = lastMergedRowIndex - renderedRowIndex + 1; // Number of rendered columns.
|
80474
|
-
const maxColSpan = lastMergedColumnIndex - renderedColumnIndex + 1; // Number of rendered columns.
|
80475
|
-
|
80476
|
-
// We just try to determine some values basing on the actual number of rendered indexes (some columns may be hidden).
|
80477
|
-
mergedCellCopy.row = rowMapper.getNearestNotHiddenIndex(mergedCellCopy.row, 1);
|
80478
|
-
// We just try to determine some values basing on the actual number of rendered indexes (some columns may be hidden).
|
80479
|
-
mergedCellCopy.col = columnMapper.getNearestNotHiddenIndex(mergedCellCopy.col, 1);
|
80480
|
-
// The `rowSpan` property for a `TD` element should be at most equal to number of rendered rows in the merge area.
|
80481
|
-
mergedCellCopy.rowspan = Math.min(mergedCellCopy.rowspan, maxRowSpan);
|
80482
|
-
// The `colSpan` property for a `TD` element should be at most equal to number of rendered columns in the merge area.
|
80483
|
-
mergedCellCopy.colspan = Math.min(mergedCellCopy.colspan, maxColSpan);
|
80484
|
-
(0, _utils.applySpanProperties)(TD, mergedCellCopy, row, col);
|
80485
|
-
} else {
|
80486
|
-
(0, _utils.applySpanProperties)(TD, null, row, col);
|
80487
|
-
}
|
80488
|
-
}
|
80489
80600
|
/**
|
80490
80601
|
* Clears the last selected coordinates before setting a new selection range.
|
80491
80602
|
*/
|
@@ -80627,17 +80738,11 @@ function _onModifyAutofillRange(drag, select) {
|
|
80627
80738
|
dragArea = select;
|
80628
80739
|
return dragArea;
|
80629
80740
|
}
|
80630
|
-
const
|
80631
|
-
|
80632
|
-
|
80633
|
-
|
80634
|
-
|
80635
|
-
to: {
|
80636
|
-
row: select[2],
|
80637
|
-
col: select[3]
|
80638
|
-
}
|
80639
|
-
});
|
80640
|
-
if (!mergedCellsWithinSelectionArea) {
|
80741
|
+
const from = this.hot._createCellCoords(select[0], select[1]);
|
80742
|
+
const to = this.hot._createCellCoords(select[2], select[3]);
|
80743
|
+
const range = this.hot._createCellRange(from, from, to);
|
80744
|
+
const mergedCellsWithinSelectionArea = this.mergedCellsCollection.getWithinRange(range);
|
80745
|
+
if (mergedCellsWithinSelectionArea.length === 0) {
|
80641
80746
|
return dragArea;
|
80642
80747
|
}
|
80643
80748
|
dragArea = this.autofillCalculations.snapDragArea(select, dragArea, dragDirection, mergedCellsWithinSelectionArea);
|
@@ -80762,6 +80867,82 @@ function _onBeforeBeginEditing(row, column, initialValue, event) {
|
|
80762
80867
|
const to = this.hot._createCellCoords(mergeCell.row + mergeCell.rowspan - 1, mergeCell.col + mergeCell.colspan - 1);
|
80763
80868
|
return this.hot.selection.getLayerLevel() === 0 && selection.isEqual(this.hot._createCellRange(from, from, to));
|
80764
80869
|
}
|
80870
|
+
/**
|
80871
|
+
* Hook used to modify the row height depends on the merged cells in the row.
|
80872
|
+
*
|
80873
|
+
* @param {number} height The row height value provided by the Core.
|
80874
|
+
* @param {number} row The visual row index.
|
80875
|
+
* @param {string} overlayType The overlay type that is currently rendered.
|
80876
|
+
* @returns {number}
|
80877
|
+
*/
|
80878
|
+
function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
80879
|
+
if (this.hot.getSettings().rowHeaders ||
|
80880
|
+
// merged cells do not work with the bottom overlays
|
80881
|
+
overlayType === 'bottom' || overlayType === 'bottom_inline_start_corner') {
|
80882
|
+
return height;
|
80883
|
+
}
|
80884
|
+
let firstColumn;
|
80885
|
+
let lastColumn;
|
80886
|
+
if (overlayType === 'master') {
|
80887
|
+
firstColumn = this.hot.view.getFirstRenderedVisibleColumn();
|
80888
|
+
lastColumn = this.hot.view.getLastRenderedVisibleColumn();
|
80889
|
+
} else {
|
80890
|
+
const activeOverlay = this.hot.view.getOverlayByName(overlayType);
|
80891
|
+
firstColumn = this.hot.columnIndexMapper.getVisualFromRenderableIndex(activeOverlay.clone.wtTable.getFirstRenderedColumn());
|
80892
|
+
lastColumn = this.hot.columnIndexMapper.getVisualFromRenderableIndex(activeOverlay.clone.wtTable.getLastRenderedColumn());
|
80893
|
+
}
|
80894
|
+
const firstMergedCellInRow = this.mergedCellsCollection.get(row, firstColumn);
|
80895
|
+
if (!firstMergedCellInRow) {
|
80896
|
+
return height;
|
80897
|
+
}
|
80898
|
+
const from = this.hot._createCellCoords(row, firstColumn);
|
80899
|
+
const to = this.hot._createCellCoords(row, lastColumn);
|
80900
|
+
const viewportRange = this.hot._createCellRange(from, from, to);
|
80901
|
+
const mergedCellsWithinRange = this.mergedCellsCollection.getWithinRange(viewportRange);
|
80902
|
+
const maxRowspan = mergedCellsWithinRange.reduce((acc, _ref) => {
|
80903
|
+
let {
|
80904
|
+
rowspan
|
80905
|
+
} = _ref;
|
80906
|
+
return Math.max(acc, rowspan);
|
80907
|
+
}, 1);
|
80908
|
+
let rowspanCorrection = 0;
|
80909
|
+
if (mergedCellsWithinRange.length > 1 && mergedCellsWithinRange[0].rowspan < maxRowspan) {
|
80910
|
+
rowspanCorrection = maxRowspan - mergedCellsWithinRange[0].rowspan;
|
80911
|
+
}
|
80912
|
+
mergedCellsWithinRange.forEach(_ref2 => {
|
80913
|
+
var _height;
|
80914
|
+
let {
|
80915
|
+
rowspan
|
80916
|
+
} = _ref2;
|
80917
|
+
let rowspanAfterCorrection = 0;
|
80918
|
+
if (overlayType === 'top' || overlayType === 'top_inline_start_corner') {
|
80919
|
+
rowspanAfterCorrection = Math.min(maxRowspan, this.hot.view.countNotHiddenFixedRowsTop() - row);
|
80920
|
+
} else {
|
80921
|
+
rowspanAfterCorrection = rowspan - rowspanCorrection;
|
80922
|
+
}
|
80923
|
+
height = Math.max((_height = height) !== null && _height !== void 0 ? _height : 0, _assertClassBrand(_MergeCells_brand, this, _sumCellsHeights).call(this, row, rowspanAfterCorrection));
|
80924
|
+
});
|
80925
|
+
return height;
|
80926
|
+
}
|
80927
|
+
/**
|
80928
|
+
* Sums the heights of the all cells that the merge cell consists of.
|
80929
|
+
*
|
80930
|
+
* @param {number} row The visual row index of the merged cell.
|
80931
|
+
* @param {number} rowspan The rowspan value of the merged cell.
|
80932
|
+
* @returns {number}
|
80933
|
+
*/
|
80934
|
+
function _sumCellsHeights(row, rowspan) {
|
80935
|
+
const defaultHeight = this.hot.view._wt.wtSettings.getSettingPure('defaultRowHeight');
|
80936
|
+
const autoRowSizePlugin = this.hot.getPlugin('autoRowSize');
|
80937
|
+
let height = 0;
|
80938
|
+
for (let i = row; i < row + rowspan; i++) {
|
80939
|
+
if (!this.hot.rowIndexMapper.isHidden(i)) {
|
80940
|
+
var _autoRowSizePlugin$ge;
|
80941
|
+
height += (_autoRowSizePlugin$ge = autoRowSizePlugin === null || autoRowSizePlugin === void 0 ? void 0 : autoRowSizePlugin.getRowHeight(i)) !== null && _autoRowSizePlugin$ge !== void 0 ? _autoRowSizePlugin$ge : defaultHeight;
|
80942
|
+
}
|
80943
|
+
}
|
80944
|
+
return height;
|
80945
|
+
}
|
80765
80946
|
|
80766
80947
|
/***/ }),
|
80767
80948
|
/* 666 */
|
@@ -80787,7 +80968,6 @@ var _cellCoords = _interopRequireDefault(__webpack_require__(667));
|
|
80787
80968
|
var _number = __webpack_require__(178);
|
80788
80969
|
var _console = __webpack_require__(166);
|
80789
80970
|
var _array = __webpack_require__(144);
|
80790
|
-
var _utils = __webpack_require__(668);
|
80791
80971
|
var _templateLiteralTag = __webpack_require__(143);
|
80792
80972
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
80793
80973
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -80841,11 +81021,16 @@ class MergedCellsCollection {
|
|
80841
81021
|
/**
|
80842
81022
|
* Get a warning message for when the declared merged cell data overlaps already existing merged cells.
|
80843
81023
|
*
|
80844
|
-
* @param {
|
81024
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81025
|
+
* about the merged cells that was about to be added.
|
80845
81026
|
* @returns {string}
|
80846
81027
|
*/
|
80847
|
-
static IS_OVERLAPPING_WARNING(
|
80848
|
-
|
81028
|
+
static IS_OVERLAPPING_WARNING(_ref) {
|
81029
|
+
let {
|
81030
|
+
row,
|
81031
|
+
col
|
81032
|
+
} = _ref;
|
81033
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}], overlaps\x20
|
80849
81034
|
with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
|
80850
81035
|
fix your setup.`;
|
80851
81036
|
}
|
@@ -80940,32 +81125,30 @@ class MergedCellsCollection {
|
|
80940
81125
|
/**
|
80941
81126
|
* Get a merged cell contained in the provided range.
|
80942
81127
|
*
|
80943
|
-
* @param {CellRange
|
81128
|
+
* @param {CellRange} range The range to search merged cells in.
|
80944
81129
|
* @param {boolean} [countPartials=false] If set to `true`, all the merged cells overlapping the range will be taken into calculation.
|
80945
|
-
* @returns {
|
81130
|
+
* @returns {MergedCellCoords[]} Array of found merged cells.
|
80946
81131
|
*/
|
80947
81132
|
getWithinRange(range) {
|
80948
81133
|
let countPartials = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
80949
|
-
const
|
80950
|
-
|
80951
|
-
|
80952
|
-
|
80953
|
-
|
80954
|
-
|
80955
|
-
|
80956
|
-
|
80957
|
-
|
80958
|
-
|
80959
|
-
|
80960
|
-
|
80961
|
-
if (
|
80962
|
-
|
81134
|
+
const {
|
81135
|
+
row: rowStart,
|
81136
|
+
col: columnStart
|
81137
|
+
} = range.getTopStartCorner();
|
81138
|
+
const {
|
81139
|
+
row: rowEnd,
|
81140
|
+
col: columnEnd
|
81141
|
+
} = range.getBottomEndCorner();
|
81142
|
+
const result = [];
|
81143
|
+
for (let row = rowStart; row <= rowEnd; row++) {
|
81144
|
+
for (let column = columnStart; column <= columnEnd; column++) {
|
81145
|
+
const mergedCell = this.get(row, column);
|
81146
|
+
if (mergedCell && (countPartials || !countPartials && mergedCell.row === row && mergedCell.col === column)) {
|
81147
|
+
result.push(mergedCell);
|
80963
81148
|
}
|
80964
|
-
} else if (testedRange.includesRange(mergedCellRange)) {
|
80965
|
-
foundMergedCells.push(mergedCell);
|
80966
81149
|
}
|
80967
|
-
}
|
80968
|
-
return
|
81150
|
+
}
|
81151
|
+
return result;
|
80969
81152
|
}
|
80970
81153
|
|
80971
81154
|
/**
|
@@ -81019,35 +81202,26 @@ class MergedCellsCollection {
|
|
81019
81202
|
* Clear all the merged cells.
|
81020
81203
|
*/
|
81021
81204
|
clear() {
|
81022
|
-
|
81023
|
-
|
81024
|
-
|
81025
|
-
|
81026
|
-
|
81027
|
-
|
81028
|
-
}
|
81029
|
-
|
81030
|
-
|
81031
|
-
|
81032
|
-
|
81033
|
-
|
81034
|
-
|
81035
|
-
|
81036
|
-
const TD = this.hot.getCell(mergedCell.row + j, mergedCell.col + k);
|
81037
|
-
if (TD) {
|
81038
|
-
hiddenCollectionElements.push([TD, null, null, null]);
|
81039
|
-
}
|
81205
|
+
(0, _array.arrayEach)(this.mergedCells, _ref2 => {
|
81206
|
+
let {
|
81207
|
+
row,
|
81208
|
+
col,
|
81209
|
+
rowspan,
|
81210
|
+
colspan
|
81211
|
+
} = _ref2;
|
81212
|
+
(0, _number.rangeEach)(row, row + rowspan, r => {
|
81213
|
+
(0, _number.rangeEach)(col, col + colspan, c => {
|
81214
|
+
const TD = this.hot.getCell(r, c);
|
81215
|
+
if (TD) {
|
81216
|
+
TD.removeAttribute('rowspan');
|
81217
|
+
TD.removeAttribute('colspan');
|
81218
|
+
TD.style.display = '';
|
81040
81219
|
}
|
81041
81220
|
});
|
81042
81221
|
});
|
81043
|
-
mergedCellParentsToClear[i][1] = null;
|
81044
|
-
});
|
81045
|
-
(0, _array.arrayEach)(mergedCellParentsToClear, mergedCellParents => {
|
81046
|
-
(0, _utils.applySpanProperties)(...mergedCellParents);
|
81047
|
-
});
|
81048
|
-
(0, _array.arrayEach)(hiddenCollectionElements, hiddenCollectionElement => {
|
81049
|
-
(0, _utils.applySpanProperties)(...hiddenCollectionElement);
|
81050
81222
|
});
|
81223
|
+
this.mergedCells.length = 0;
|
81224
|
+
this.mergedCellsMatrix = new Map();
|
81051
81225
|
}
|
81052
81226
|
|
81053
81227
|
/**
|
@@ -81238,11 +81412,11 @@ function _getNonIntersectingIndexes(range, axis) {
|
|
81238
81412
|
indexes.get(index).add(lastIndex);
|
81239
81413
|
}
|
81240
81414
|
}
|
81241
|
-
return Array.from(new Set(Array.from(indexes.entries()).filter(
|
81242
|
-
let [, set] =
|
81415
|
+
return Array.from(new Set(Array.from(indexes.entries()).filter(_ref3 => {
|
81416
|
+
let [, set] = _ref3;
|
81243
81417
|
return set.size === 1;
|
81244
|
-
}).flatMap(
|
81245
|
-
let [, set] =
|
81418
|
+
}).flatMap(_ref4 => {
|
81419
|
+
let [, set] = _ref4;
|
81246
81420
|
return Array.from(set);
|
81247
81421
|
})));
|
81248
81422
|
}
|
@@ -81355,78 +81529,117 @@ class MergedCellCoords {
|
|
81355
81529
|
/**
|
81356
81530
|
* Get a warning message for when the declared merged cell data contains negative values.
|
81357
81531
|
*
|
81358
|
-
* @param {
|
81532
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81533
|
+
* about the merged cells that was about to be added.
|
81359
81534
|
* @returns {string}
|
81360
81535
|
*/
|
81361
|
-
static NEGATIVE_VALUES_WARNING(
|
81362
|
-
|
81363
|
-
|
81536
|
+
static NEGATIVE_VALUES_WARNING(_ref) {
|
81537
|
+
let {
|
81538
|
+
row,
|
81539
|
+
col,
|
81540
|
+
rowspan,
|
81541
|
+
colspan
|
81542
|
+
} = _ref;
|
81543
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared with {row: ${row}, col: ${col},\x20
|
81544
|
+
rowspan: ${rowspan}, colspan: ${colspan}} contains negative values, which is\x20
|
81364
81545
|
not supported. It will not be added to the collection.`;
|
81365
81546
|
}
|
81366
81547
|
|
81367
81548
|
/**
|
81368
81549
|
* Get a warning message for when the declared merged cell data contains values exceeding the table limits.
|
81369
81550
|
*
|
81370
|
-
* @param {
|
81551
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81552
|
+
* about the merged cells that was about to be added.
|
81371
81553
|
* @returns {string}
|
81372
81554
|
*/
|
81373
|
-
static IS_OUT_OF_BOUNDS_WARNING(
|
81374
|
-
|
81555
|
+
static IS_OUT_OF_BOUNDS_WARNING(_ref2) {
|
81556
|
+
let {
|
81557
|
+
row,
|
81558
|
+
col
|
81559
|
+
} = _ref2;
|
81560
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}] is positioned\x20
|
81375
81561
|
(or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`;
|
81376
81562
|
}
|
81377
81563
|
|
81378
81564
|
/**
|
81379
81565
|
* Get a warning message for when the declared merged cell data represents a single cell.
|
81380
81566
|
*
|
81381
|
-
* @param {
|
81567
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81568
|
+
* about the merged cells that was about to be added.
|
81382
81569
|
* @returns {string}
|
81383
81570
|
*/
|
81384
|
-
static IS_SINGLE_CELL(
|
81385
|
-
|
81571
|
+
static IS_SINGLE_CELL(_ref3) {
|
81572
|
+
let {
|
81573
|
+
row,
|
81574
|
+
col
|
81575
|
+
} = _ref3;
|
81576
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}] has both "rowspan"\x20
|
81386
81577
|
and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`;
|
81387
81578
|
}
|
81388
81579
|
|
81389
81580
|
/**
|
81390
81581
|
* Get a warning message for when the declared merged cell data contains "colspan" or "rowspan", that equals 0.
|
81391
81582
|
*
|
81392
|
-
* @param {
|
81583
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81584
|
+
* about the merged cells that was about to be added.
|
81393
81585
|
* @returns {string}
|
81394
81586
|
*/
|
81395
|
-
static ZERO_SPAN_WARNING(
|
81396
|
-
|
81587
|
+
static ZERO_SPAN_WARNING(_ref4) {
|
81588
|
+
let {
|
81589
|
+
row,
|
81590
|
+
col
|
81591
|
+
} = _ref4;
|
81592
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}] has "rowspan"\x20
|
81397
81593
|
or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`;
|
81398
81594
|
}
|
81399
81595
|
|
81400
81596
|
/**
|
81401
81597
|
* Check whether the values provided for a merged cell contain any negative values.
|
81402
81598
|
*
|
81403
|
-
* @param {
|
81599
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81600
|
+
* about the merged cells that was about to be added.
|
81404
81601
|
* @returns {boolean}
|
81405
81602
|
*/
|
81406
|
-
static containsNegativeValues(
|
81407
|
-
|
81603
|
+
static containsNegativeValues(_ref5) {
|
81604
|
+
let {
|
81605
|
+
row,
|
81606
|
+
col,
|
81607
|
+
rowspan,
|
81608
|
+
colspan
|
81609
|
+
} = _ref5;
|
81610
|
+
return row < 0 || col < 0 || rowspan < 0 || colspan < 0;
|
81408
81611
|
}
|
81409
81612
|
|
81410
81613
|
/**
|
81411
81614
|
* Check whether the provided merged cell information object represents a single cell.
|
81412
81615
|
*
|
81413
81616
|
* @private
|
81414
|
-
* @param {
|
81617
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81618
|
+
* about the merged cells that was about to be added.
|
81415
81619
|
* @returns {boolean}
|
81416
81620
|
*/
|
81417
|
-
static isSingleCell(
|
81418
|
-
|
81621
|
+
static isSingleCell(_ref6) {
|
81622
|
+
let {
|
81623
|
+
rowspan,
|
81624
|
+
colspan
|
81625
|
+
} = _ref6;
|
81626
|
+
return colspan === 1 && rowspan === 1;
|
81419
81627
|
}
|
81420
81628
|
|
81421
81629
|
/**
|
81422
81630
|
* Check whether the provided merged cell information object contains a rowspan or colspan of 0.
|
81423
81631
|
*
|
81424
81632
|
* @private
|
81425
|
-
* @param {
|
81633
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
81634
|
+
* about the merged cells that was about to be added.
|
81426
81635
|
* @returns {boolean}
|
81427
81636
|
*/
|
81428
|
-
static containsZeroSpan(
|
81429
|
-
|
81637
|
+
static containsZeroSpan(_ref7) {
|
81638
|
+
let {
|
81639
|
+
rowspan,
|
81640
|
+
colspan
|
81641
|
+
} = _ref7;
|
81642
|
+
return colspan === 0 || rowspan === 0;
|
81430
81643
|
}
|
81431
81644
|
|
81432
81645
|
/**
|
@@ -81611,40 +81824,6 @@ var _default = exports["default"] = MergedCellCoords;
|
|
81611
81824
|
|
81612
81825
|
/***/ }),
|
81613
81826
|
/* 668 */
|
81614
|
-
/***/ ((__unused_webpack_module, exports) => {
|
81615
|
-
|
81616
|
-
"use strict";
|
81617
|
-
|
81618
|
-
|
81619
|
-
exports.__esModule = true;
|
81620
|
-
exports.applySpanProperties = applySpanProperties;
|
81621
|
-
/**
|
81622
|
-
* Apply the `colspan`/`rowspan` properties.
|
81623
|
-
*
|
81624
|
-
* @param {HTMLElement} TD The soon-to-be-modified cell.
|
81625
|
-
* @param {MergedCellCoords} mergedCellInfo The merged cell in question.
|
81626
|
-
* @param {number} row Row index.
|
81627
|
-
* @param {number} col Column index.
|
81628
|
-
*/
|
81629
|
-
function applySpanProperties(TD, mergedCellInfo, row, col) {
|
81630
|
-
if (mergedCellInfo) {
|
81631
|
-
if (mergedCellInfo.row === row && mergedCellInfo.col === col) {
|
81632
|
-
TD.setAttribute('rowspan', mergedCellInfo.rowspan.toString());
|
81633
|
-
TD.setAttribute('colspan', mergedCellInfo.colspan.toString());
|
81634
|
-
} else {
|
81635
|
-
TD.removeAttribute('rowspan');
|
81636
|
-
TD.removeAttribute('colspan');
|
81637
|
-
TD.style.display = 'none';
|
81638
|
-
}
|
81639
|
-
} else {
|
81640
|
-
TD.removeAttribute('rowspan');
|
81641
|
-
TD.removeAttribute('colspan');
|
81642
|
-
TD.style.display = '';
|
81643
|
-
}
|
81644
|
-
}
|
81645
|
-
|
81646
|
-
/***/ }),
|
81647
|
-
/* 669 */
|
81648
81827
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
81649
81828
|
|
81650
81829
|
"use strict";
|
@@ -82040,13 +82219,13 @@ class AutofillCalculations {
|
|
82040
82219
|
const topLeft = this.plugin.hot._createCellCoords(dragAreaStartRow, dragAreaStartColumn);
|
82041
82220
|
const bottomRight = this.plugin.hot._createCellCoords(dragAreaEndRow, dragAreaEndColumn);
|
82042
82221
|
const dragRange = this.plugin.hot._createCellRange(topLeft, topLeft, bottomRight);
|
82043
|
-
return
|
82222
|
+
return this.mergedCellsCollection.getWithinRange(dragRange, true).length > 0;
|
82044
82223
|
}
|
82045
82224
|
}
|
82046
82225
|
var _default = exports["default"] = AutofillCalculations;
|
82047
82226
|
|
82048
82227
|
/***/ }),
|
82049
|
-
/*
|
82228
|
+
/* 669 */
|
82050
82229
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
82051
82230
|
|
82052
82231
|
"use strict";
|
@@ -82169,7 +82348,7 @@ class SelectionCalculations {
|
|
82169
82348
|
var _default = exports["default"] = SelectionCalculations;
|
82170
82349
|
|
82171
82350
|
/***/ }),
|
82172
|
-
/*
|
82351
|
+
/* 670 */
|
82173
82352
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
82174
82353
|
|
82175
82354
|
"use strict";
|
@@ -82230,7 +82409,7 @@ function toggleMergeItem(plugin) {
|
|
82230
82409
|
}
|
82231
82410
|
|
82232
82411
|
/***/ }),
|
82233
|
-
/*
|
82412
|
+
/* 671 */
|
82234
82413
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
82235
82414
|
|
82236
82415
|
"use strict";
|
@@ -82239,7 +82418,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
82239
82418
|
|
82240
82419
|
|
82241
82420
|
/***/ }),
|
82242
|
-
/*
|
82421
|
+
/* 672 */
|
82243
82422
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
82244
82423
|
|
82245
82424
|
"use strict";
|
@@ -82249,7 +82428,7 @@ var _interopRequireDefault = __webpack_require__(1);
|
|
82249
82428
|
exports.__esModule = true;
|
82250
82429
|
__webpack_require__(8);
|
82251
82430
|
__webpack_require__(90);
|
82252
|
-
var _linkedList = _interopRequireDefault(__webpack_require__(
|
82431
|
+
var _linkedList = _interopRequireDefault(__webpack_require__(673));
|
82253
82432
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
82254
82433
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
82255
82434
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -82550,7 +82729,7 @@ function _pushOrderNode(selectedRange, listOrder, mergeCellsVisitor, row, column
|
|
82550
82729
|
}
|
82551
82730
|
|
82552
82731
|
/***/ }),
|
82553
|
-
/*
|
82732
|
+
/* 673 */
|
82554
82733
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
82555
82734
|
|
82556
82735
|
"use strict";
|
@@ -82802,6 +82981,82 @@ class LinkedList {
|
|
82802
82981
|
}
|
82803
82982
|
var _default = exports["default"] = LinkedList;
|
82804
82983
|
|
82984
|
+
/***/ }),
|
82985
|
+
/* 674 */
|
82986
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
82987
|
+
|
82988
|
+
"use strict";
|
82989
|
+
|
82990
|
+
|
82991
|
+
exports.__esModule = true;
|
82992
|
+
exports.createMergeCellRenderer = createMergeCellRenderer;
|
82993
|
+
var _object = __webpack_require__(148);
|
82994
|
+
/**
|
82995
|
+
* Creates a renderer object for the `MergeCells` plugin.
|
82996
|
+
*
|
82997
|
+
* @param {MergeCells} plugin The `MergeCells` plugin instance.
|
82998
|
+
* @returns {{before: Function, after: Function}}
|
82999
|
+
*/
|
83000
|
+
function createMergeCellRenderer(plugin) {
|
83001
|
+
const {
|
83002
|
+
hot
|
83003
|
+
} = plugin;
|
83004
|
+
const {
|
83005
|
+
rowIndexMapper: rowMapper,
|
83006
|
+
columnIndexMapper: columnMapper
|
83007
|
+
} = hot;
|
83008
|
+
|
83009
|
+
/**
|
83010
|
+
* Runs before the cell is rendered.
|
83011
|
+
*/
|
83012
|
+
function before() {}
|
83013
|
+
|
83014
|
+
/**
|
83015
|
+
* Runs after the cell is rendered.
|
83016
|
+
*
|
83017
|
+
* @param {HTMLElement} TD The cell to be modified.
|
83018
|
+
* @param {number} row Row index.
|
83019
|
+
* @param {number} col Visual column index.
|
83020
|
+
*/
|
83021
|
+
function after(TD, row, col) {
|
83022
|
+
const mergedCell = plugin.mergedCellsCollection.get(row, col);
|
83023
|
+
if (!(0, _object.isObject)(mergedCell)) {
|
83024
|
+
TD.removeAttribute('rowspan');
|
83025
|
+
TD.removeAttribute('colspan');
|
83026
|
+
TD.style.display = '';
|
83027
|
+
return;
|
83028
|
+
}
|
83029
|
+
const {
|
83030
|
+
row: origRow,
|
83031
|
+
col: origColumn,
|
83032
|
+
colspan: origColspan,
|
83033
|
+
rowspan: origRowspan
|
83034
|
+
} = mergedCell;
|
83035
|
+
const [lastMergedRowIndex, lastMergedColumnIndex] = plugin.translateMergedCellToRenderable(origRow, origRowspan, origColumn, origColspan);
|
83036
|
+
const renderedRowIndex = rowMapper.getRenderableFromVisualIndex(row);
|
83037
|
+
const renderedColumnIndex = columnMapper.getRenderableFromVisualIndex(col);
|
83038
|
+
const maxRowSpan = lastMergedRowIndex - renderedRowIndex + 1; // Number of rendered columns.
|
83039
|
+
const maxColSpan = lastMergedColumnIndex - renderedColumnIndex + 1; // Number of rendered columns.
|
83040
|
+
|
83041
|
+
const notHiddenRow = rowMapper.getNearestNotHiddenIndex(origRow, 1);
|
83042
|
+
const notHiddenColumn = columnMapper.getNearestNotHiddenIndex(origColumn, 1);
|
83043
|
+
const notHiddenRowspan = Math.min(origRowspan, maxRowSpan);
|
83044
|
+
const notHiddenColspan = Math.min(origColspan, maxColSpan);
|
83045
|
+
if (notHiddenRow === row && notHiddenColumn === col) {
|
83046
|
+
TD.setAttribute('rowspan', notHiddenRowspan);
|
83047
|
+
TD.setAttribute('colspan', notHiddenColspan);
|
83048
|
+
} else {
|
83049
|
+
TD.removeAttribute('rowspan');
|
83050
|
+
TD.removeAttribute('colspan');
|
83051
|
+
TD.style.display = 'none';
|
83052
|
+
}
|
83053
|
+
}
|
83054
|
+
return {
|
83055
|
+
before,
|
83056
|
+
after
|
83057
|
+
};
|
83058
|
+
}
|
83059
|
+
|
82805
83060
|
/***/ }),
|
82806
83061
|
/* 675 */
|
82807
83062
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|