handsontable 0.0.0-next-2ae8e35-20240613 → 0.0.0-next-fd8b2aa-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
@@ -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-fd8b2aa-20240614
|
29
|
+
* Release date: 11/06/2024 (built at 14/06/2024 07:52:59)
|
30
30
|
*/
|
31
31
|
(function webpackUniversalModuleDefinition(root, factory) {
|
32
32
|
if(typeof exports === 'object' && typeof module === 'object')
|
@@ -42675,8 +42675,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
|
|
42675
42675
|
Handsontable.CellCoords = _src.CellCoords;
|
42676
42676
|
Handsontable.CellRange = _src.CellRange;
|
42677
42677
|
Handsontable.packageName = 'handsontable';
|
42678
|
-
Handsontable.buildDate = "
|
42679
|
-
Handsontable.version = "0.0.0-next-
|
42678
|
+
Handsontable.buildDate = "14/06/2024 07:52:59";
|
42679
|
+
Handsontable.version = "0.0.0-next-fd8b2aa-20240614";
|
42680
42680
|
Handsontable.languages = {
|
42681
42681
|
dictionaryKeys: _registry.dictionaryKeys,
|
42682
42682
|
getLanguageDictionary: _registry.getLanguageDictionary,
|
@@ -46234,12 +46234,6 @@ function Core(rootElement, userSettings) {
|
|
46234
46234
|
* @returns {number}
|
46235
46235
|
*/
|
46236
46236
|
this._getRowHeightFromSettings = function (row) {
|
46237
|
-
// let cellProperties = instance.getCellMeta(row, 0);
|
46238
|
-
// let height = cellProperties.height;
|
46239
|
-
//
|
46240
|
-
// if (height === undefined || height === tableMeta.height) {
|
46241
|
-
// height = cellProperties.rowHeights;
|
46242
|
-
// }
|
46243
46237
|
let height = tableMeta.rowHeights;
|
46244
46238
|
if (height !== undefined && height !== null) {
|
46245
46239
|
switch (typeof height) {
|
@@ -53294,7 +53288,7 @@ const domMessages = {
|
|
53294
53288
|
function _injectProductInfo(key, element) {
|
53295
53289
|
const hasValidType = !isEmpty(key);
|
53296
53290
|
const isNonCommercial = typeof key === 'string' && key.toLowerCase() === 'non-commercial-and-evaluation';
|
53297
|
-
const hotVersion = "0.0.0-next-
|
53291
|
+
const hotVersion = "0.0.0-next-fd8b2aa-20240614";
|
53298
53292
|
let keyValidityDate;
|
53299
53293
|
let consoleMessageState = 'invalid';
|
53300
53294
|
let domMessageState = 'invalid';
|
@@ -63895,6 +63889,17 @@ const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-complete-s
|
|
63895
63889
|
* @param {number} row Visual row index.
|
63896
63890
|
*/
|
63897
63891
|
'modifyRowHeight',
|
63892
|
+
/**
|
63893
|
+
* Fired when a row height is about to be modified by a callback function. The hook allows to change the row height
|
63894
|
+
* for the specified overlay type.
|
63895
|
+
*
|
63896
|
+
* @since 14.5.0
|
63897
|
+
* @event Hooks#modifyRowHeightByOverlayName
|
63898
|
+
* @param {number} height Row height.
|
63899
|
+
* @param {number} row Visual row index.
|
63900
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName Overlay name.
|
63901
|
+
*/
|
63902
|
+
'modifyRowHeightByOverlayName',
|
63898
63903
|
/**
|
63899
63904
|
* Fired when a data was retrieved or modified.
|
63900
63905
|
*
|
@@ -67916,7 +67921,7 @@ class TableView {
|
|
67916
67921
|
// immediate click on "holder" means click on the right side of vertical scrollbar
|
67917
67922
|
const {
|
67918
67923
|
holder
|
67919
|
-
} = this.
|
67924
|
+
} = this._wt.wtTable;
|
67920
67925
|
if (next === holder) {
|
67921
67926
|
const scrollbarWidth = (0, _element.getScrollbarWidth)(rootDocument);
|
67922
67927
|
if (rootDocument.elementFromPoint(eventX + scrollbarWidth, eventY) !== holder || rootDocument.elementFromPoint(eventX, eventY + scrollbarWidth) !== holder) {
|
@@ -68263,6 +68268,11 @@ class TableView {
|
|
68263
68268
|
const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
|
68264
68269
|
return this.hot.getRowHeight(visualIndex === null ? renderedRowIndex : visualIndex);
|
68265
68270
|
},
|
68271
|
+
rowHeightByOverlayName: (renderedRowIndex, overlayType) => {
|
68272
|
+
const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
|
68273
|
+
const visualRowIndex = visualIndex === null ? renderedRowIndex : visualIndex;
|
68274
|
+
return this.hot.runHooks('modifyRowHeightByOverlayName', this.hot.getRowHeight(visualRowIndex), visualRowIndex, overlayType);
|
68275
|
+
},
|
68266
68276
|
cellRenderer: (renderedRowIndex, renderedColumnIndex, TD) => {
|
68267
68277
|
const [visualRowIndex, visualColumnIndex] = this.translateFromRenderableToVisualIndex(renderedRowIndex, renderedColumnIndex);
|
68268
68278
|
|
@@ -68591,7 +68601,7 @@ class TableView {
|
|
68591
68601
|
if ((0, _element.isInput)(el)) {
|
68592
68602
|
return true;
|
68593
68603
|
}
|
68594
|
-
const isChildOfTableBody = (0, _element.isChildOf)(el, this.
|
68604
|
+
const isChildOfTableBody = (0, _element.isChildOf)(el, this._wt.wtTable.spreader);
|
68595
68605
|
if (this.settings.fragmentSelection === true && isChildOfTableBody) {
|
68596
68606
|
return true;
|
68597
68607
|
}
|
@@ -68822,75 +68832,119 @@ class TableView {
|
|
68822
68832
|
}
|
68823
68833
|
|
68824
68834
|
/**
|
68825
|
-
* Returns the first
|
68835
|
+
* Returns the first rendered row in the DOM (usually is not visible).
|
68836
|
+
*
|
68837
|
+
* @returns {number}
|
68838
|
+
*/
|
68839
|
+
getFirstRenderedVisibleRow() {
|
68840
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());
|
68841
|
+
}
|
68842
|
+
|
68843
|
+
/**
|
68844
|
+
* Returns the last rendered row in the DOM (usually is not visible).
|
68845
|
+
*
|
68846
|
+
* @returns {number}
|
68847
|
+
*/
|
68848
|
+
getLastRenderedVisibleRow() {
|
68849
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());
|
68850
|
+
}
|
68851
|
+
|
68852
|
+
/**
|
68853
|
+
* Returns the first rendered column in the DOM (usually is not visible).
|
68854
|
+
*
|
68855
|
+
* @returns {number}
|
68856
|
+
*/
|
68857
|
+
getFirstRenderedVisibleColumn() {
|
68858
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());
|
68859
|
+
}
|
68860
|
+
|
68861
|
+
/**
|
68862
|
+
* Returns the last rendered column in the DOM (usually is not visible).
|
68863
|
+
*
|
68864
|
+
* @returns {number}
|
68865
|
+
*/
|
68866
|
+
getLastRenderedVisibleColumn() {
|
68867
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());
|
68868
|
+
}
|
68869
|
+
|
68870
|
+
/**
|
68871
|
+
* Returns the first fully visible row in the table viewport. When the table has overlays the method returns
|
68872
|
+
* the first row of the master table that is not overlapped by overlay.
|
68826
68873
|
*
|
68827
68874
|
* @returns {number}
|
68828
68875
|
*/
|
68829
68876
|
getFirstFullyVisibleRow() {
|
68830
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
68877
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow());
|
68831
68878
|
}
|
68832
68879
|
|
68833
68880
|
/**
|
68834
|
-
* Returns the last fully visible row in the table viewport.
|
68881
|
+
* Returns the last fully visible row in the table viewport. When the table has overlays the method returns
|
68882
|
+
* the first row of the master table that is not overlapped by overlay.
|
68835
68883
|
*
|
68836
68884
|
* @returns {number}
|
68837
68885
|
*/
|
68838
68886
|
getLastFullyVisibleRow() {
|
68839
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
68887
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow());
|
68840
68888
|
}
|
68841
68889
|
|
68842
68890
|
/**
|
68843
|
-
* Returns the first fully visible column in the table viewport.
|
68891
|
+
* Returns the first fully visible column in the table viewport. When the table has overlays the method returns
|
68892
|
+
* the first row of the master table that is not overlapped by overlay.
|
68844
68893
|
*
|
68845
68894
|
* @returns {number}
|
68846
68895
|
*/
|
68847
68896
|
getFirstFullyVisibleColumn() {
|
68848
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
68897
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn());
|
68849
68898
|
}
|
68850
68899
|
|
68851
68900
|
/**
|
68852
|
-
* Returns the last fully visible column in the table viewport.
|
68901
|
+
* Returns the last fully visible column in the table viewport. When the table has overlays the method returns
|
68902
|
+
* the first row of the master table that is not overlapped by overlay.
|
68853
68903
|
*
|
68854
68904
|
* @returns {number}
|
68855
68905
|
*/
|
68856
68906
|
getLastFullyVisibleColumn() {
|
68857
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
68907
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn());
|
68858
68908
|
}
|
68859
68909
|
|
68860
68910
|
/**
|
68861
|
-
* Returns the first partially visible row in the table viewport.
|
68911
|
+
* Returns the first partially visible row in the table viewport. When the table has overlays the method returns
|
68912
|
+
* the first row of the master table that is not overlapped by overlay.
|
68862
68913
|
*
|
68863
68914
|
* @returns {number}
|
68864
68915
|
*/
|
68865
68916
|
getFirstPartiallyVisibleRow() {
|
68866
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
68917
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow());
|
68867
68918
|
}
|
68868
68919
|
|
68869
68920
|
/**
|
68870
|
-
* Returns the last partially visible row in the table viewport.
|
68921
|
+
* Returns the last partially visible row in the table viewport. When the table has overlays the method returns
|
68922
|
+
* the first row of the master table that is not overlapped by overlay.
|
68871
68923
|
*
|
68872
68924
|
* @returns {number}
|
68873
68925
|
*/
|
68874
68926
|
getLastPartiallyVisibleRow() {
|
68875
|
-
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.
|
68927
|
+
return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow());
|
68876
68928
|
}
|
68877
68929
|
|
68878
68930
|
/**
|
68879
|
-
* Returns the first partially visible column in the table viewport.
|
68931
|
+
* Returns the first partially visible column in the table viewport. When the table has overlays the method returns
|
68932
|
+
* the first row of the master table that is not overlapped by overlay.
|
68880
68933
|
*
|
68881
68934
|
* @returns {number}
|
68882
68935
|
*/
|
68883
68936
|
getFirstPartiallyVisibleColumn() {
|
68884
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
68937
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn());
|
68885
68938
|
}
|
68886
68939
|
|
68887
68940
|
/**
|
68888
|
-
* Returns the last partially visible column in the table viewport.
|
68941
|
+
* Returns the last partially visible column in the table viewport. When the table has overlays the method returns
|
68942
|
+
* the first row of the master table that is not overlapped by overlay.
|
68889
68943
|
*
|
68890
68944
|
* @returns {number}
|
68891
68945
|
*/
|
68892
68946
|
getLastPartiallyVisibleColumn() {
|
68893
|
-
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.
|
68947
|
+
return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn());
|
68894
68948
|
}
|
68895
68949
|
|
68896
68950
|
/**
|
@@ -68919,7 +68973,7 @@ class TableView {
|
|
68919
68973
|
* @returns {number}
|
68920
68974
|
*/
|
68921
68975
|
getViewportWidth() {
|
68922
|
-
return this.
|
68976
|
+
return this._wt.wtViewport.getViewportWidth();
|
68923
68977
|
}
|
68924
68978
|
|
68925
68979
|
/**
|
@@ -68928,7 +68982,7 @@ class TableView {
|
|
68928
68982
|
* @returns {number}
|
68929
68983
|
*/
|
68930
68984
|
getWorkspaceWidth() {
|
68931
|
-
return this.
|
68985
|
+
return this._wt.wtViewport.getWorkspaceWidth();
|
68932
68986
|
}
|
68933
68987
|
|
68934
68988
|
/**
|
@@ -68939,7 +68993,7 @@ class TableView {
|
|
68939
68993
|
* @returns {number}
|
68940
68994
|
*/
|
68941
68995
|
getViewportHeight() {
|
68942
|
-
return this.
|
68996
|
+
return this._wt.wtViewport.getViewportHeight();
|
68943
68997
|
}
|
68944
68998
|
|
68945
68999
|
/**
|
@@ -68948,7 +69002,28 @@ class TableView {
|
|
68948
69002
|
* @returns {number}
|
68949
69003
|
*/
|
68950
69004
|
getWorkspaceHeight() {
|
68951
|
-
return this.
|
69005
|
+
return this._wt.wtViewport.getWorkspaceHeight();
|
69006
|
+
}
|
69007
|
+
|
69008
|
+
/**
|
69009
|
+
* Checks to what overlay the provided element belongs.
|
69010
|
+
*
|
69011
|
+
* @param {HTMLElement} element The DOM element to check.
|
69012
|
+
* @returns {'master'|'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'}
|
69013
|
+
*/
|
69014
|
+
getElementOverlayName(element) {
|
69015
|
+
var _this$_wt$wtOverlays$;
|
69016
|
+
return ((_this$_wt$wtOverlays$ = this._wt.wtOverlays.getParentOverlay(element)) !== null && _this$_wt$wtOverlays$ !== void 0 ? _this$_wt$wtOverlays$ : this._wt).wtTable.name;
|
69017
|
+
}
|
69018
|
+
|
69019
|
+
/**
|
69020
|
+
* Gets the overlay instance by its name.
|
69021
|
+
*
|
69022
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
|
69023
|
+
* @returns {Overlay | null}
|
69024
|
+
*/
|
69025
|
+
getOverlayByName(overlayName) {
|
69026
|
+
return this._wt.getOverlayByName(overlayName);
|
68952
69027
|
}
|
68953
69028
|
/**
|
68954
69029
|
* Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
|
@@ -70858,6 +70933,9 @@ class WalkontableFacade {
|
|
70858
70933
|
getOverlayName() {
|
70859
70934
|
return this._wot.cloneOverlay ? this._wot.cloneOverlay.type : 'master';
|
70860
70935
|
}
|
70936
|
+
getOverlayByName(overlayName) {
|
70937
|
+
return this._wot.getOverlayByName(overlayName);
|
70938
|
+
}
|
70861
70939
|
exportSettingsAsClassNames() {
|
70862
70940
|
return this._wot.exportSettingsAsClassNames();
|
70863
70941
|
}
|
@@ -70889,6 +70967,7 @@ exports.__esModule = true;
|
|
70889
70967
|
__webpack_require__(286);
|
70890
70968
|
var _event = _interopRequireDefault(__webpack_require__(530));
|
70891
70969
|
var _overlays = _interopRequireDefault(__webpack_require__(531));
|
70970
|
+
var _overlay = __webpack_require__(532);
|
70892
70971
|
var _settings = _interopRequireDefault(__webpack_require__(583));
|
70893
70972
|
var _master = _interopRequireDefault(__webpack_require__(584));
|
70894
70973
|
var _viewport = _interopRequireDefault(__webpack_require__(585));
|
@@ -70939,6 +71018,21 @@ class Walkontable extends _base.default {
|
|
70939
71018
|
(0, _element.addClass)(this.wtTable.wtRootElement.parentNode, newClassNames);
|
70940
71019
|
}
|
70941
71020
|
|
71021
|
+
/**
|
71022
|
+
* Gets the overlay instance by its name.
|
71023
|
+
*
|
71024
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
|
71025
|
+
* @returns {Overlay | null}
|
71026
|
+
*/
|
71027
|
+
getOverlayByName(overlayName) {
|
71028
|
+
var _this$wtOverlays;
|
71029
|
+
if (!_overlay.CLONE_TYPES.includes(overlayName)) {
|
71030
|
+
return null;
|
71031
|
+
}
|
71032
|
+
const camelCaseOverlay = overlayName.replace(/_([a-z])/g, match => match[1].toUpperCase());
|
71033
|
+
return (_this$wtOverlays = this.wtOverlays[`${camelCaseOverlay}Overlay`]) !== null && _this$wtOverlays !== void 0 ? _this$wtOverlays : null;
|
71034
|
+
}
|
71035
|
+
|
70942
71036
|
/**
|
70943
71037
|
* @returns {ViewportDao}
|
70944
71038
|
*/
|
@@ -72595,7 +72689,7 @@ class Table {
|
|
72595
72689
|
this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);
|
72596
72690
|
}
|
72597
72691
|
this.resetOversizedRows();
|
72598
|
-
this.tableRenderer.setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
|
72692
|
+
this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
|
72599
72693
|
let workspaceWidth;
|
72600
72694
|
if (this.isMaster) {
|
72601
72695
|
workspaceWidth = this.dataAccessObject.workspaceWidth;
|
@@ -73582,6 +73676,17 @@ class Renderer {
|
|
73582
73676
|
this.renderer.setAxisUtils(rowUtils, columnUtils);
|
73583
73677
|
}
|
73584
73678
|
|
73679
|
+
/**
|
73680
|
+
* Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
|
73681
|
+
*
|
73682
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
|
73683
|
+
* @returns {Renderer}
|
73684
|
+
*/
|
73685
|
+
setActiveOverlayName(overlayName) {
|
73686
|
+
this.renderer.setActiveOverlayName(overlayName);
|
73687
|
+
return this;
|
73688
|
+
}
|
73689
|
+
|
73585
73690
|
/**
|
73586
73691
|
* Sets filter calculators for newly calculated row and column position. The filters are used to transform visual
|
73587
73692
|
* indexes (0 to N) to source indexes provided by Handsontable.
|
@@ -74912,11 +75017,26 @@ class TableRenderer {
|
|
74912
75017
|
* @type {Function}
|
74913
75018
|
*/
|
74914
75019
|
(0, _defineProperty2.default)(this, "cellRenderer", void 0);
|
75020
|
+
/**
|
75021
|
+
* Holds the name of the currently active overlay.
|
75022
|
+
*
|
75023
|
+
* @type {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'}
|
75024
|
+
*/
|
75025
|
+
(0, _defineProperty2.default)(this, "activeOverlayName", void 0);
|
74915
75026
|
this.rootNode = rootNode;
|
74916
75027
|
this.rootDocument = this.rootNode.ownerDocument;
|
74917
75028
|
this.cellRenderer = cellRenderer;
|
74918
75029
|
}
|
74919
75030
|
|
75031
|
+
/**
|
75032
|
+
* Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
|
75033
|
+
*
|
75034
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
|
75035
|
+
*/
|
75036
|
+
setActiveOverlayName(overlayName) {
|
75037
|
+
this.activeOverlayName = overlayName;
|
75038
|
+
}
|
75039
|
+
|
74920
75040
|
/**
|
74921
75041
|
* Set row and column util classes.
|
74922
75042
|
*
|
@@ -75050,7 +75170,7 @@ class TableRenderer {
|
|
75050
75170
|
const TR = rows.getRenderedNode(visibleRowIndex);
|
75051
75171
|
if (TR.firstChild) {
|
75052
75172
|
const sourceRowIndex = this.renderedRowToSource(visibleRowIndex);
|
75053
|
-
const rowHeight = this.rowUtils.
|
75173
|
+
const rowHeight = this.rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
|
75054
75174
|
if (rowHeight) {
|
75055
75175
|
// Decrease height. 1 pixel will be "replaced" by 1px border top
|
75056
75176
|
TR.firstChild.style.height = `${rowHeight - 1}px`;
|
@@ -75457,6 +75577,22 @@ class RowUtils {
|
|
75457
75577
|
}
|
75458
75578
|
return height;
|
75459
75579
|
}
|
75580
|
+
|
75581
|
+
/**
|
75582
|
+
* Returns row height based on passed source index for the specified overlay type.
|
75583
|
+
*
|
75584
|
+
* @param {number} sourceIndex Row source index.
|
75585
|
+
* @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
|
75586
|
+
* @returns {number}
|
75587
|
+
*/
|
75588
|
+
getHeightByOverlayName(sourceIndex, overlayName) {
|
75589
|
+
let height = this.wtSettings.getSetting('rowHeightByOverlayName', sourceIndex, overlayName);
|
75590
|
+
const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
|
75591
|
+
if (oversizedHeight !== undefined) {
|
75592
|
+
height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
|
75593
|
+
}
|
75594
|
+
return height;
|
75595
|
+
}
|
75460
75596
|
}
|
75461
75597
|
exports["default"] = RowUtils;
|
75462
75598
|
|
@@ -80087,7 +80223,8 @@ var _object = __webpack_require__(482);
|
|
80087
80223
|
* @property {Option} renderAllColumns Option `renderAllColumns`.
|
80088
80224
|
* @property {Option} renderAllRows Option `renderAllRows`.
|
80089
80225
|
* @property {Option} rowHeaders Option `rowHeaders`.
|
80090
|
-
* @property {Option} rowHeight
|
80226
|
+
* @property {Option} rowHeightOption `rowHeight`.
|
80227
|
+
* @property {Option} rowHeightByOverlayName Option `rowHeightByOverlayName`.
|
80091
80228
|
* @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
|
80092
80229
|
* @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
|
80093
80230
|
* @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
|
@@ -80231,6 +80368,9 @@ class Settings {
|
|
80231
80368
|
rowHeight() {
|
80232
80369
|
// return undefined means use default size for the rendered cell content
|
80233
80370
|
},
|
80371
|
+
rowHeightByOverlayName() {
|
80372
|
+
// return undefined means use default size for the rendered cell content
|
80373
|
+
},
|
80234
80374
|
defaultRowHeight: 23,
|
80235
80375
|
defaultColumnWidth: 50,
|
80236
80376
|
selections: null,
|
@@ -131261,18 +131401,18 @@ var _base = __webpack_require__(806);
|
|
131261
131401
|
var _pluginHooks = _interopRequireDefault(__webpack_require__(494));
|
131262
131402
|
var _cellsCollection = _interopRequireDefault(__webpack_require__(1000));
|
131263
131403
|
var _cellCoords = _interopRequireDefault(__webpack_require__(1001));
|
131264
|
-
var _autofill = _interopRequireDefault(__webpack_require__(
|
131265
|
-
var _selection = _interopRequireDefault(__webpack_require__(
|
131266
|
-
var _toggleMerge = _interopRequireDefault(__webpack_require__(
|
131404
|
+
var _autofill = _interopRequireDefault(__webpack_require__(1002));
|
131405
|
+
var _selection = _interopRequireDefault(__webpack_require__(1003));
|
131406
|
+
var _toggleMerge = _interopRequireDefault(__webpack_require__(1004));
|
131267
131407
|
var _array = __webpack_require__(478);
|
131268
131408
|
var _object = __webpack_require__(482);
|
131269
131409
|
var _console = __webpack_require__(500);
|
131270
131410
|
var _number = __webpack_require__(512);
|
131271
|
-
|
131272
|
-
__webpack_require__(1006);
|
131411
|
+
__webpack_require__(1005);
|
131273
131412
|
var _element = __webpack_require__(334);
|
131274
131413
|
var _browser = __webpack_require__(481);
|
131275
|
-
var _focusOrder2 = __webpack_require__(
|
131414
|
+
var _focusOrder2 = __webpack_require__(1006);
|
131415
|
+
var _renderer = __webpack_require__(1008);
|
131276
131416
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
131277
131417
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
131278
131418
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -131327,6 +131467,7 @@ const SHORTCUTS_GROUP = PLUGIN_KEY;
|
|
131327
131467
|
var _lastSelectedFocus = /*#__PURE__*/new WeakMap();
|
131328
131468
|
var _lastFocusDelta = /*#__PURE__*/new WeakMap();
|
131329
131469
|
var _focusOrder = /*#__PURE__*/new WeakMap();
|
131470
|
+
var _cellRenderer = /*#__PURE__*/new WeakMap();
|
131330
131471
|
var _MergeCells_brand = /*#__PURE__*/new WeakSet();
|
131331
131472
|
class MergeCells extends _base.BasePlugin {
|
131332
131473
|
constructor() {
|
@@ -131383,6 +131524,12 @@ class MergeCells extends _base.BasePlugin {
|
|
131383
131524
|
rowIndexMapper: this.hot.rowIndexMapper,
|
131384
131525
|
columnIndexMapper: this.hot.columnIndexMapper
|
131385
131526
|
}));
|
131527
|
+
/**
|
131528
|
+
* The cell renderer responsible for rendering the merged cells.
|
131529
|
+
*
|
131530
|
+
* @type {{before: Function, after: Function}}
|
131531
|
+
*/
|
131532
|
+
_classPrivateFieldInitSpec(this, _cellRenderer, (0, _renderer.createMergeCellRenderer)(this));
|
131386
131533
|
}
|
131387
131534
|
static get PLUGIN_KEY() {
|
131388
131535
|
return PLUGIN_KEY;
|
@@ -131484,94 +131631,97 @@ class MergeCells extends _base.BasePlugin {
|
|
131484
131631
|
return _assertClassBrand(_MergeCells_brand, _this, _onAfterIsMultipleSelection).call(_this, ...args);
|
131485
131632
|
});
|
131486
131633
|
this.addHook('afterRenderer', function () {
|
131634
|
+
return _classPrivateFieldGet(_cellRenderer, _this).after(...arguments);
|
131635
|
+
});
|
131636
|
+
this.addHook('afterContextMenuDefaultOptions', function () {
|
131487
131637
|
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
131488
131638
|
args[_key13] = arguments[_key13];
|
131489
131639
|
}
|
131490
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131640
|
+
return _assertClassBrand(_MergeCells_brand, _this, _addMergeActionsToContextMenu).call(_this, ...args);
|
131491
131641
|
});
|
131492
|
-
this.addHook('
|
131642
|
+
this.addHook('afterGetCellMeta', function () {
|
131493
131643
|
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
131494
131644
|
args[_key14] = arguments[_key14];
|
131495
131645
|
}
|
131496
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131646
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterGetCellMeta).call(_this, ...args);
|
131497
131647
|
});
|
131498
|
-
this.addHook('
|
131648
|
+
this.addHook('afterViewportRowCalculatorOverride', function () {
|
131499
131649
|
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
131500
131650
|
args[_key15] = arguments[_key15];
|
131501
131651
|
}
|
131502
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131652
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterViewportRowCalculatorOverride).call(_this, ...args);
|
131503
131653
|
});
|
131504
|
-
this.addHook('
|
131654
|
+
this.addHook('afterViewportColumnCalculatorOverride', function () {
|
131505
131655
|
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
131506
131656
|
args[_key16] = arguments[_key16];
|
131507
131657
|
}
|
131508
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131658
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterViewportColumnCalculatorOverride).call(_this, ...args);
|
131509
131659
|
});
|
131510
|
-
this.addHook('
|
131660
|
+
this.addHook('modifyAutofillRange', function () {
|
131511
131661
|
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
131512
131662
|
args[_key17] = arguments[_key17];
|
131513
131663
|
}
|
131514
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131664
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onModifyAutofillRange).call(_this, ...args);
|
131515
131665
|
});
|
131516
|
-
this.addHook('
|
131666
|
+
this.addHook('afterCreateCol', function () {
|
131517
131667
|
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
131518
131668
|
args[_key18] = arguments[_key18];
|
131519
131669
|
}
|
131520
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131670
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterCreateCol).call(_this, ...args);
|
131521
131671
|
});
|
131522
|
-
this.addHook('
|
131672
|
+
this.addHook('afterRemoveCol', function () {
|
131523
131673
|
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
131524
131674
|
args[_key19] = arguments[_key19];
|
131525
131675
|
}
|
131526
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131676
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterRemoveCol).call(_this, ...args);
|
131527
131677
|
});
|
131528
|
-
this.addHook('
|
131678
|
+
this.addHook('afterCreateRow', function () {
|
131529
131679
|
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
131530
131680
|
args[_key20] = arguments[_key20];
|
131531
131681
|
}
|
131532
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131682
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterCreateRow).call(_this, ...args);
|
131533
131683
|
});
|
131534
|
-
this.addHook('
|
131684
|
+
this.addHook('afterRemoveRow', function () {
|
131535
131685
|
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
131536
131686
|
args[_key21] = arguments[_key21];
|
131537
131687
|
}
|
131538
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131688
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterRemoveRow).call(_this, ...args);
|
131539
131689
|
});
|
131540
|
-
this.addHook('
|
131690
|
+
this.addHook('afterChange', function () {
|
131541
131691
|
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
131542
131692
|
args[_key22] = arguments[_key22];
|
131543
131693
|
}
|
131544
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131694
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterChange).call(_this, ...args);
|
131545
131695
|
});
|
131546
|
-
this.addHook('
|
131696
|
+
this.addHook('beforeDrawBorders', function () {
|
131547
131697
|
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
131548
131698
|
args[_key23] = arguments[_key23];
|
131549
131699
|
}
|
131550
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131700
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onBeforeDrawAreaBorders).call(_this, ...args);
|
131551
131701
|
});
|
131552
|
-
this.addHook('
|
131702
|
+
this.addHook('afterDrawSelection', function () {
|
131553
131703
|
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
|
131554
131704
|
args[_key24] = arguments[_key24];
|
131555
131705
|
}
|
131556
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131706
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onAfterDrawSelection).call(_this, ...args);
|
131557
131707
|
});
|
131558
|
-
this.addHook('
|
131708
|
+
this.addHook('beforeRemoveCellClassNames', function () {
|
131559
131709
|
for (var _len25 = arguments.length, args = new Array(_len25), _key25 = 0; _key25 < _len25; _key25++) {
|
131560
131710
|
args[_key25] = arguments[_key25];
|
131561
131711
|
}
|
131562
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131712
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onBeforeRemoveCellClassNames).call(_this, ...args);
|
131563
131713
|
});
|
131564
|
-
this.addHook('
|
131714
|
+
this.addHook('beforeBeginEditing', function () {
|
131565
131715
|
for (var _len26 = arguments.length, args = new Array(_len26), _key26 = 0; _key26 < _len26; _key26++) {
|
131566
131716
|
args[_key26] = arguments[_key26];
|
131567
131717
|
}
|
131568
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131718
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onBeforeBeginEditing).call(_this, ...args);
|
131569
131719
|
});
|
131570
|
-
this.addHook('
|
131720
|
+
this.addHook('modifyRowHeightByOverlayName', function () {
|
131571
131721
|
for (var _len27 = arguments.length, args = new Array(_len27), _key27 = 0; _key27 < _len27; _key27++) {
|
131572
131722
|
args[_key27] = arguments[_key27];
|
131573
131723
|
}
|
131574
|
-
return _assertClassBrand(_MergeCells_brand, _this,
|
131724
|
+
return _assertClassBrand(_MergeCells_brand, _this, _onModifyRowHeightByOverlayName).call(_this, ...args);
|
131575
131725
|
});
|
131576
131726
|
this.addHook('beforeUndoStackChange', (action, source) => {
|
131577
131727
|
if (source === 'MergeCells') {
|
@@ -131662,24 +131812,26 @@ class MergeCells extends _base.BasePlugin {
|
|
131662
131812
|
* @returns {boolean}
|
131663
131813
|
*/
|
131664
131814
|
validateSetting(setting) {
|
131665
|
-
let valid = true;
|
131666
131815
|
if (!setting) {
|
131667
131816
|
return false;
|
131668
131817
|
}
|
131669
131818
|
if (_cellCoords.default.containsNegativeValues(setting)) {
|
131670
131819
|
(0, _console.warn)(_cellCoords.default.NEGATIVE_VALUES_WARNING(setting));
|
131671
|
-
|
131672
|
-
}
|
131820
|
+
return false;
|
131821
|
+
}
|
131822
|
+
if (_cellCoords.default.isOutOfBounds(setting, this.hot.countRows(), this.hot.countCols())) {
|
131673
131823
|
(0, _console.warn)(_cellCoords.default.IS_OUT_OF_BOUNDS_WARNING(setting));
|
131674
|
-
|
131675
|
-
}
|
131824
|
+
return false;
|
131825
|
+
}
|
131826
|
+
if (_cellCoords.default.isSingleCell(setting)) {
|
131676
131827
|
(0, _console.warn)(_cellCoords.default.IS_SINGLE_CELL(setting));
|
131677
|
-
|
131678
|
-
}
|
131828
|
+
return false;
|
131829
|
+
}
|
131830
|
+
if (_cellCoords.default.containsZeroSpan(setting)) {
|
131679
131831
|
(0, _console.warn)(_cellCoords.default.ZERO_SPAN_WARNING(setting));
|
131680
|
-
|
131832
|
+
return false;
|
131681
131833
|
}
|
131682
|
-
return
|
131834
|
+
return true;
|
131683
131835
|
}
|
131684
131836
|
|
131685
131837
|
/**
|
@@ -131860,7 +132012,7 @@ class MergeCells extends _base.BasePlugin {
|
|
131860
132012
|
unmergeRange(cellRange) {
|
131861
132013
|
let auto = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
131862
132014
|
const mergedCells = this.mergedCellsCollection.getWithinRange(cellRange);
|
131863
|
-
if (
|
132015
|
+
if (mergedCells.length === 0) {
|
131864
132016
|
return;
|
131865
132017
|
}
|
131866
132018
|
this.hot.runHooks('beforeUnmergeCells', cellRange, auto);
|
@@ -132365,47 +132517,6 @@ function _addMergeActionsToContextMenu(defaultOptions) {
|
|
132365
132517
|
name: '---------'
|
132366
132518
|
}, (0, _toggleMerge.default)(this));
|
132367
132519
|
}
|
132368
|
-
/**
|
132369
|
-
* `afterRenderer` hook callback.
|
132370
|
-
*
|
132371
|
-
* @param {HTMLElement} TD The cell to be modified.
|
132372
|
-
* @param {number} row Row index.
|
132373
|
-
* @param {number} col Visual column index.
|
132374
|
-
*/
|
132375
|
-
function _onAfterRenderer(TD, row, col) {
|
132376
|
-
const mergedCell = this.mergedCellsCollection.get(row, col);
|
132377
|
-
if ((0, _object.isObject)(mergedCell)) {
|
132378
|
-
// We shouldn't override data in the collection.
|
132379
|
-
const mergedCellCopy = (0, _object.clone)(mergedCell);
|
132380
|
-
const {
|
132381
|
-
rowIndexMapper: rowMapper,
|
132382
|
-
columnIndexMapper: columnMapper
|
132383
|
-
} = this.hot;
|
132384
|
-
const {
|
132385
|
-
row: mergeRow,
|
132386
|
-
col: mergeColumn,
|
132387
|
-
colspan,
|
132388
|
-
rowspan
|
132389
|
-
} = mergedCellCopy;
|
132390
|
-
const [lastMergedRowIndex, lastMergedColumnIndex] = this.translateMergedCellToRenderable(mergeRow, rowspan, mergeColumn, colspan);
|
132391
|
-
const renderedRowIndex = rowMapper.getRenderableFromVisualIndex(row);
|
132392
|
-
const renderedColumnIndex = columnMapper.getRenderableFromVisualIndex(col);
|
132393
|
-
const maxRowSpan = lastMergedRowIndex - renderedRowIndex + 1; // Number of rendered columns.
|
132394
|
-
const maxColSpan = lastMergedColumnIndex - renderedColumnIndex + 1; // Number of rendered columns.
|
132395
|
-
|
132396
|
-
// We just try to determine some values basing on the actual number of rendered indexes (some columns may be hidden).
|
132397
|
-
mergedCellCopy.row = rowMapper.getNearestNotHiddenIndex(mergedCellCopy.row, 1);
|
132398
|
-
// We just try to determine some values basing on the actual number of rendered indexes (some columns may be hidden).
|
132399
|
-
mergedCellCopy.col = columnMapper.getNearestNotHiddenIndex(mergedCellCopy.col, 1);
|
132400
|
-
// The `rowSpan` property for a `TD` element should be at most equal to number of rendered rows in the merge area.
|
132401
|
-
mergedCellCopy.rowspan = Math.min(mergedCellCopy.rowspan, maxRowSpan);
|
132402
|
-
// The `colSpan` property for a `TD` element should be at most equal to number of rendered columns in the merge area.
|
132403
|
-
mergedCellCopy.colspan = Math.min(mergedCellCopy.colspan, maxColSpan);
|
132404
|
-
(0, _utils.applySpanProperties)(TD, mergedCellCopy, row, col);
|
132405
|
-
} else {
|
132406
|
-
(0, _utils.applySpanProperties)(TD, null, row, col);
|
132407
|
-
}
|
132408
|
-
}
|
132409
132520
|
/**
|
132410
132521
|
* Clears the last selected coordinates before setting a new selection range.
|
132411
132522
|
*/
|
@@ -132547,17 +132658,11 @@ function _onModifyAutofillRange(drag, select) {
|
|
132547
132658
|
dragArea = select;
|
132548
132659
|
return dragArea;
|
132549
132660
|
}
|
132550
|
-
const
|
132551
|
-
|
132552
|
-
|
132553
|
-
|
132554
|
-
|
132555
|
-
to: {
|
132556
|
-
row: select[2],
|
132557
|
-
col: select[3]
|
132558
|
-
}
|
132559
|
-
});
|
132560
|
-
if (!mergedCellsWithinSelectionArea) {
|
132661
|
+
const from = this.hot._createCellCoords(select[0], select[1]);
|
132662
|
+
const to = this.hot._createCellCoords(select[2], select[3]);
|
132663
|
+
const range = this.hot._createCellRange(from, from, to);
|
132664
|
+
const mergedCellsWithinSelectionArea = this.mergedCellsCollection.getWithinRange(range);
|
132665
|
+
if (mergedCellsWithinSelectionArea.length === 0) {
|
132561
132666
|
return dragArea;
|
132562
132667
|
}
|
132563
132668
|
dragArea = this.autofillCalculations.snapDragArea(select, dragArea, dragDirection, mergedCellsWithinSelectionArea);
|
@@ -132682,6 +132787,82 @@ function _onBeforeBeginEditing(row, column, initialValue, event) {
|
|
132682
132787
|
const to = this.hot._createCellCoords(mergeCell.row + mergeCell.rowspan - 1, mergeCell.col + mergeCell.colspan - 1);
|
132683
132788
|
return this.hot.selection.getLayerLevel() === 0 && selection.isEqual(this.hot._createCellRange(from, from, to));
|
132684
132789
|
}
|
132790
|
+
/**
|
132791
|
+
* Hook used to modify the row height depends on the merged cells in the row.
|
132792
|
+
*
|
132793
|
+
* @param {number} height The row height value provided by the Core.
|
132794
|
+
* @param {number} row The visual row index.
|
132795
|
+
* @param {string} overlayType The overlay type that is currently rendered.
|
132796
|
+
* @returns {number}
|
132797
|
+
*/
|
132798
|
+
function _onModifyRowHeightByOverlayName(height, row, overlayType) {
|
132799
|
+
if (this.hot.getSettings().rowHeaders ||
|
132800
|
+
// merged cells do not work with the bottom overlays
|
132801
|
+
overlayType === 'bottom' || overlayType === 'bottom_inline_start_corner') {
|
132802
|
+
return height;
|
132803
|
+
}
|
132804
|
+
let firstColumn;
|
132805
|
+
let lastColumn;
|
132806
|
+
if (overlayType === 'master') {
|
132807
|
+
firstColumn = this.hot.view.getFirstRenderedVisibleColumn();
|
132808
|
+
lastColumn = this.hot.view.getLastRenderedVisibleColumn();
|
132809
|
+
} else {
|
132810
|
+
const activeOverlay = this.hot.view.getOverlayByName(overlayType);
|
132811
|
+
firstColumn = this.hot.columnIndexMapper.getVisualFromRenderableIndex(activeOverlay.clone.wtTable.getFirstRenderedColumn());
|
132812
|
+
lastColumn = this.hot.columnIndexMapper.getVisualFromRenderableIndex(activeOverlay.clone.wtTable.getLastRenderedColumn());
|
132813
|
+
}
|
132814
|
+
const firstMergedCellInRow = this.mergedCellsCollection.get(row, firstColumn);
|
132815
|
+
if (!firstMergedCellInRow) {
|
132816
|
+
return height;
|
132817
|
+
}
|
132818
|
+
const from = this.hot._createCellCoords(row, firstColumn);
|
132819
|
+
const to = this.hot._createCellCoords(row, lastColumn);
|
132820
|
+
const viewportRange = this.hot._createCellRange(from, from, to);
|
132821
|
+
const mergedCellsWithinRange = this.mergedCellsCollection.getWithinRange(viewportRange);
|
132822
|
+
const maxRowspan = mergedCellsWithinRange.reduce((acc, _ref) => {
|
132823
|
+
let {
|
132824
|
+
rowspan
|
132825
|
+
} = _ref;
|
132826
|
+
return Math.max(acc, rowspan);
|
132827
|
+
}, 1);
|
132828
|
+
let rowspanCorrection = 0;
|
132829
|
+
if (mergedCellsWithinRange.length > 1 && mergedCellsWithinRange[0].rowspan < maxRowspan) {
|
132830
|
+
rowspanCorrection = maxRowspan - mergedCellsWithinRange[0].rowspan;
|
132831
|
+
}
|
132832
|
+
mergedCellsWithinRange.forEach(_ref2 => {
|
132833
|
+
var _height;
|
132834
|
+
let {
|
132835
|
+
rowspan
|
132836
|
+
} = _ref2;
|
132837
|
+
let rowspanAfterCorrection = 0;
|
132838
|
+
if (overlayType === 'top' || overlayType === 'top_inline_start_corner') {
|
132839
|
+
rowspanAfterCorrection = Math.min(maxRowspan, this.hot.view.countNotHiddenFixedRowsTop() - row);
|
132840
|
+
} else {
|
132841
|
+
rowspanAfterCorrection = rowspan - rowspanCorrection;
|
132842
|
+
}
|
132843
|
+
height = Math.max((_height = height) !== null && _height !== void 0 ? _height : 0, _assertClassBrand(_MergeCells_brand, this, _sumCellsHeights).call(this, row, rowspanAfterCorrection));
|
132844
|
+
});
|
132845
|
+
return height;
|
132846
|
+
}
|
132847
|
+
/**
|
132848
|
+
* Sums the heights of the all cells that the merge cell consists of.
|
132849
|
+
*
|
132850
|
+
* @param {number} row The visual row index of the merged cell.
|
132851
|
+
* @param {number} rowspan The rowspan value of the merged cell.
|
132852
|
+
* @returns {number}
|
132853
|
+
*/
|
132854
|
+
function _sumCellsHeights(row, rowspan) {
|
132855
|
+
const defaultHeight = this.hot.view._wt.wtSettings.getSettingPure('defaultRowHeight');
|
132856
|
+
const autoRowSizePlugin = this.hot.getPlugin('autoRowSize');
|
132857
|
+
let height = 0;
|
132858
|
+
for (let i = row; i < row + rowspan; i++) {
|
132859
|
+
if (!this.hot.rowIndexMapper.isHidden(i)) {
|
132860
|
+
var _autoRowSizePlugin$ge;
|
132861
|
+
height += (_autoRowSizePlugin$ge = autoRowSizePlugin === null || autoRowSizePlugin === void 0 ? void 0 : autoRowSizePlugin.getRowHeight(i)) !== null && _autoRowSizePlugin$ge !== void 0 ? _autoRowSizePlugin$ge : defaultHeight;
|
132862
|
+
}
|
132863
|
+
}
|
132864
|
+
return height;
|
132865
|
+
}
|
132685
132866
|
|
132686
132867
|
/***/ }),
|
132687
132868
|
/* 1000 */
|
@@ -132707,7 +132888,6 @@ var _cellCoords = _interopRequireDefault(__webpack_require__(1001));
|
|
132707
132888
|
var _number = __webpack_require__(512);
|
132708
132889
|
var _console = __webpack_require__(500);
|
132709
132890
|
var _array = __webpack_require__(478);
|
132710
|
-
var _utils = __webpack_require__(1002);
|
132711
132891
|
var _templateLiteralTag = __webpack_require__(477);
|
132712
132892
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
132713
132893
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -132761,11 +132941,16 @@ class MergedCellsCollection {
|
|
132761
132941
|
/**
|
132762
132942
|
* Get a warning message for when the declared merged cell data overlaps already existing merged cells.
|
132763
132943
|
*
|
132764
|
-
* @param {
|
132944
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
132945
|
+
* about the merged cells that was about to be added.
|
132765
132946
|
* @returns {string}
|
132766
132947
|
*/
|
132767
|
-
static IS_OVERLAPPING_WARNING(
|
132768
|
-
|
132948
|
+
static IS_OVERLAPPING_WARNING(_ref) {
|
132949
|
+
let {
|
132950
|
+
row,
|
132951
|
+
col
|
132952
|
+
} = _ref;
|
132953
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}], overlaps\x20
|
132769
132954
|
with the other declared merged cell. The overlapping merged cell was not added to the table, please\x20
|
132770
132955
|
fix your setup.`;
|
132771
132956
|
}
|
@@ -132860,32 +133045,30 @@ class MergedCellsCollection {
|
|
132860
133045
|
/**
|
132861
133046
|
* Get a merged cell contained in the provided range.
|
132862
133047
|
*
|
132863
|
-
* @param {CellRange
|
133048
|
+
* @param {CellRange} range The range to search merged cells in.
|
132864
133049
|
* @param {boolean} [countPartials=false] If set to `true`, all the merged cells overlapping the range will be taken into calculation.
|
132865
|
-
* @returns {
|
133050
|
+
* @returns {MergedCellCoords[]} Array of found merged cells.
|
132866
133051
|
*/
|
132867
133052
|
getWithinRange(range) {
|
132868
133053
|
let countPartials = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
132869
|
-
const
|
132870
|
-
|
132871
|
-
|
132872
|
-
|
132873
|
-
|
132874
|
-
|
132875
|
-
|
132876
|
-
|
132877
|
-
|
132878
|
-
|
132879
|
-
|
132880
|
-
|
132881
|
-
if (
|
132882
|
-
|
133054
|
+
const {
|
133055
|
+
row: rowStart,
|
133056
|
+
col: columnStart
|
133057
|
+
} = range.getTopStartCorner();
|
133058
|
+
const {
|
133059
|
+
row: rowEnd,
|
133060
|
+
col: columnEnd
|
133061
|
+
} = range.getBottomEndCorner();
|
133062
|
+
const result = [];
|
133063
|
+
for (let row = rowStart; row <= rowEnd; row++) {
|
133064
|
+
for (let column = columnStart; column <= columnEnd; column++) {
|
133065
|
+
const mergedCell = this.get(row, column);
|
133066
|
+
if (mergedCell && (countPartials || !countPartials && mergedCell.row === row && mergedCell.col === column)) {
|
133067
|
+
result.push(mergedCell);
|
132883
133068
|
}
|
132884
|
-
} else if (testedRange.includesRange(mergedCellRange)) {
|
132885
|
-
foundMergedCells.push(mergedCell);
|
132886
133069
|
}
|
132887
|
-
}
|
132888
|
-
return
|
133070
|
+
}
|
133071
|
+
return result;
|
132889
133072
|
}
|
132890
133073
|
|
132891
133074
|
/**
|
@@ -132939,35 +133122,26 @@ class MergedCellsCollection {
|
|
132939
133122
|
* Clear all the merged cells.
|
132940
133123
|
*/
|
132941
133124
|
clear() {
|
132942
|
-
|
132943
|
-
|
132944
|
-
|
132945
|
-
|
132946
|
-
|
132947
|
-
|
132948
|
-
}
|
132949
|
-
|
132950
|
-
|
132951
|
-
|
132952
|
-
|
132953
|
-
|
132954
|
-
|
132955
|
-
|
132956
|
-
const TD = this.hot.getCell(mergedCell.row + j, mergedCell.col + k);
|
132957
|
-
if (TD) {
|
132958
|
-
hiddenCollectionElements.push([TD, null, null, null]);
|
132959
|
-
}
|
133125
|
+
(0, _array.arrayEach)(this.mergedCells, _ref2 => {
|
133126
|
+
let {
|
133127
|
+
row,
|
133128
|
+
col,
|
133129
|
+
rowspan,
|
133130
|
+
colspan
|
133131
|
+
} = _ref2;
|
133132
|
+
(0, _number.rangeEach)(row, row + rowspan, r => {
|
133133
|
+
(0, _number.rangeEach)(col, col + colspan, c => {
|
133134
|
+
const TD = this.hot.getCell(r, c);
|
133135
|
+
if (TD) {
|
133136
|
+
TD.removeAttribute('rowspan');
|
133137
|
+
TD.removeAttribute('colspan');
|
133138
|
+
TD.style.display = '';
|
132960
133139
|
}
|
132961
133140
|
});
|
132962
133141
|
});
|
132963
|
-
mergedCellParentsToClear[i][1] = null;
|
132964
|
-
});
|
132965
|
-
(0, _array.arrayEach)(mergedCellParentsToClear, mergedCellParents => {
|
132966
|
-
(0, _utils.applySpanProperties)(...mergedCellParents);
|
132967
|
-
});
|
132968
|
-
(0, _array.arrayEach)(hiddenCollectionElements, hiddenCollectionElement => {
|
132969
|
-
(0, _utils.applySpanProperties)(...hiddenCollectionElement);
|
132970
133142
|
});
|
133143
|
+
this.mergedCells.length = 0;
|
133144
|
+
this.mergedCellsMatrix = new Map();
|
132971
133145
|
}
|
132972
133146
|
|
132973
133147
|
/**
|
@@ -133158,11 +133332,11 @@ function _getNonIntersectingIndexes(range, axis) {
|
|
133158
133332
|
indexes.get(index).add(lastIndex);
|
133159
133333
|
}
|
133160
133334
|
}
|
133161
|
-
return Array.from(new Set(Array.from(indexes.entries()).filter(
|
133162
|
-
let [, set] =
|
133335
|
+
return Array.from(new Set(Array.from(indexes.entries()).filter(_ref3 => {
|
133336
|
+
let [, set] = _ref3;
|
133163
133337
|
return set.size === 1;
|
133164
|
-
}).flatMap(
|
133165
|
-
let [, set] =
|
133338
|
+
}).flatMap(_ref4 => {
|
133339
|
+
let [, set] = _ref4;
|
133166
133340
|
return Array.from(set);
|
133167
133341
|
})));
|
133168
133342
|
}
|
@@ -133275,78 +133449,117 @@ class MergedCellCoords {
|
|
133275
133449
|
/**
|
133276
133450
|
* Get a warning message for when the declared merged cell data contains negative values.
|
133277
133451
|
*
|
133278
|
-
* @param {
|
133452
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
133453
|
+
* about the merged cells that was about to be added.
|
133279
133454
|
* @returns {string}
|
133280
133455
|
*/
|
133281
|
-
static NEGATIVE_VALUES_WARNING(
|
133282
|
-
|
133283
|
-
|
133456
|
+
static NEGATIVE_VALUES_WARNING(_ref) {
|
133457
|
+
let {
|
133458
|
+
row,
|
133459
|
+
col,
|
133460
|
+
rowspan,
|
133461
|
+
colspan
|
133462
|
+
} = _ref;
|
133463
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared with {row: ${row}, col: ${col},\x20
|
133464
|
+
rowspan: ${rowspan}, colspan: ${colspan}} contains negative values, which is\x20
|
133284
133465
|
not supported. It will not be added to the collection.`;
|
133285
133466
|
}
|
133286
133467
|
|
133287
133468
|
/**
|
133288
133469
|
* Get a warning message for when the declared merged cell data contains values exceeding the table limits.
|
133289
133470
|
*
|
133290
|
-
* @param {
|
133471
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
133472
|
+
* about the merged cells that was about to be added.
|
133291
133473
|
* @returns {string}
|
133292
133474
|
*/
|
133293
|
-
static IS_OUT_OF_BOUNDS_WARNING(
|
133294
|
-
|
133475
|
+
static IS_OUT_OF_BOUNDS_WARNING(_ref2) {
|
133476
|
+
let {
|
133477
|
+
row,
|
133478
|
+
col
|
133479
|
+
} = _ref2;
|
133480
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}] is positioned\x20
|
133295
133481
|
(or positioned partially) outside of the table range. It was not added to the table, please fix your setup.`;
|
133296
133482
|
}
|
133297
133483
|
|
133298
133484
|
/**
|
133299
133485
|
* Get a warning message for when the declared merged cell data represents a single cell.
|
133300
133486
|
*
|
133301
|
-
* @param {
|
133487
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
133488
|
+
* about the merged cells that was about to be added.
|
133302
133489
|
* @returns {string}
|
133303
133490
|
*/
|
133304
|
-
static IS_SINGLE_CELL(
|
133305
|
-
|
133491
|
+
static IS_SINGLE_CELL(_ref3) {
|
133492
|
+
let {
|
133493
|
+
row,
|
133494
|
+
col
|
133495
|
+
} = _ref3;
|
133496
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}] has both "rowspan"\x20
|
133306
133497
|
and "colspan" declared as "1", which makes it a single cell. It cannot be added to the collection.`;
|
133307
133498
|
}
|
133308
133499
|
|
133309
133500
|
/**
|
133310
133501
|
* Get a warning message for when the declared merged cell data contains "colspan" or "rowspan", that equals 0.
|
133311
133502
|
*
|
133312
|
-
* @param {
|
133503
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
133504
|
+
* about the merged cells that was about to be added.
|
133313
133505
|
* @returns {string}
|
133314
133506
|
*/
|
133315
|
-
static ZERO_SPAN_WARNING(
|
133316
|
-
|
133507
|
+
static ZERO_SPAN_WARNING(_ref4) {
|
133508
|
+
let {
|
133509
|
+
row,
|
133510
|
+
col
|
133511
|
+
} = _ref4;
|
133512
|
+
return (0, _templateLiteralTag.toSingleLine)`The merged cell declared at [${row}, ${col}] has "rowspan"\x20
|
133317
133513
|
or "colspan" declared as "0", which is not supported. It cannot be added to the collection.`;
|
133318
133514
|
}
|
133319
133515
|
|
133320
133516
|
/**
|
133321
133517
|
* Check whether the values provided for a merged cell contain any negative values.
|
133322
133518
|
*
|
133323
|
-
* @param {
|
133519
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
133520
|
+
* about the merged cells that was about to be added.
|
133324
133521
|
* @returns {boolean}
|
133325
133522
|
*/
|
133326
|
-
static containsNegativeValues(
|
133327
|
-
|
133523
|
+
static containsNegativeValues(_ref5) {
|
133524
|
+
let {
|
133525
|
+
row,
|
133526
|
+
col,
|
133527
|
+
rowspan,
|
133528
|
+
colspan
|
133529
|
+
} = _ref5;
|
133530
|
+
return row < 0 || col < 0 || rowspan < 0 || colspan < 0;
|
133328
133531
|
}
|
133329
133532
|
|
133330
133533
|
/**
|
133331
133534
|
* Check whether the provided merged cell information object represents a single cell.
|
133332
133535
|
*
|
133333
133536
|
* @private
|
133334
|
-
* @param {
|
133537
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
133538
|
+
* about the merged cells that was about to be added.
|
133335
133539
|
* @returns {boolean}
|
133336
133540
|
*/
|
133337
|
-
static isSingleCell(
|
133338
|
-
|
133541
|
+
static isSingleCell(_ref6) {
|
133542
|
+
let {
|
133543
|
+
rowspan,
|
133544
|
+
colspan
|
133545
|
+
} = _ref6;
|
133546
|
+
return colspan === 1 && rowspan === 1;
|
133339
133547
|
}
|
133340
133548
|
|
133341
133549
|
/**
|
133342
133550
|
* Check whether the provided merged cell information object contains a rowspan or colspan of 0.
|
133343
133551
|
*
|
133344
133552
|
* @private
|
133345
|
-
* @param {
|
133553
|
+
* @param {{ row: number, col: number, rowspan: number, colspan: number }} mergedCell Object containing information
|
133554
|
+
* about the merged cells that was about to be added.
|
133346
133555
|
* @returns {boolean}
|
133347
133556
|
*/
|
133348
|
-
static containsZeroSpan(
|
133349
|
-
|
133557
|
+
static containsZeroSpan(_ref7) {
|
133558
|
+
let {
|
133559
|
+
rowspan,
|
133560
|
+
colspan
|
133561
|
+
} = _ref7;
|
133562
|
+
return colspan === 0 || rowspan === 0;
|
133350
133563
|
}
|
133351
133564
|
|
133352
133565
|
/**
|
@@ -133531,40 +133744,6 @@ var _default = exports["default"] = MergedCellCoords;
|
|
133531
133744
|
|
133532
133745
|
/***/ }),
|
133533
133746
|
/* 1002 */
|
133534
|
-
/***/ ((__unused_webpack_module, exports) => {
|
133535
|
-
|
133536
|
-
"use strict";
|
133537
|
-
|
133538
|
-
|
133539
|
-
exports.__esModule = true;
|
133540
|
-
exports.applySpanProperties = applySpanProperties;
|
133541
|
-
/**
|
133542
|
-
* Apply the `colspan`/`rowspan` properties.
|
133543
|
-
*
|
133544
|
-
* @param {HTMLElement} TD The soon-to-be-modified cell.
|
133545
|
-
* @param {MergedCellCoords} mergedCellInfo The merged cell in question.
|
133546
|
-
* @param {number} row Row index.
|
133547
|
-
* @param {number} col Column index.
|
133548
|
-
*/
|
133549
|
-
function applySpanProperties(TD, mergedCellInfo, row, col) {
|
133550
|
-
if (mergedCellInfo) {
|
133551
|
-
if (mergedCellInfo.row === row && mergedCellInfo.col === col) {
|
133552
|
-
TD.setAttribute('rowspan', mergedCellInfo.rowspan.toString());
|
133553
|
-
TD.setAttribute('colspan', mergedCellInfo.colspan.toString());
|
133554
|
-
} else {
|
133555
|
-
TD.removeAttribute('rowspan');
|
133556
|
-
TD.removeAttribute('colspan');
|
133557
|
-
TD.style.display = 'none';
|
133558
|
-
}
|
133559
|
-
} else {
|
133560
|
-
TD.removeAttribute('rowspan');
|
133561
|
-
TD.removeAttribute('colspan');
|
133562
|
-
TD.style.display = '';
|
133563
|
-
}
|
133564
|
-
}
|
133565
|
-
|
133566
|
-
/***/ }),
|
133567
|
-
/* 1003 */
|
133568
133747
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
133569
133748
|
|
133570
133749
|
"use strict";
|
@@ -133960,13 +134139,13 @@ class AutofillCalculations {
|
|
133960
134139
|
const topLeft = this.plugin.hot._createCellCoords(dragAreaStartRow, dragAreaStartColumn);
|
133961
134140
|
const bottomRight = this.plugin.hot._createCellCoords(dragAreaEndRow, dragAreaEndColumn);
|
133962
134141
|
const dragRange = this.plugin.hot._createCellRange(topLeft, topLeft, bottomRight);
|
133963
|
-
return
|
134142
|
+
return this.mergedCellsCollection.getWithinRange(dragRange, true).length > 0;
|
133964
134143
|
}
|
133965
134144
|
}
|
133966
134145
|
var _default = exports["default"] = AutofillCalculations;
|
133967
134146
|
|
133968
134147
|
/***/ }),
|
133969
|
-
/*
|
134148
|
+
/* 1003 */
|
133970
134149
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
133971
134150
|
|
133972
134151
|
"use strict";
|
@@ -134089,7 +134268,7 @@ class SelectionCalculations {
|
|
134089
134268
|
var _default = exports["default"] = SelectionCalculations;
|
134090
134269
|
|
134091
134270
|
/***/ }),
|
134092
|
-
/*
|
134271
|
+
/* 1004 */
|
134093
134272
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
134094
134273
|
|
134095
134274
|
"use strict";
|
@@ -134150,7 +134329,7 @@ function toggleMergeItem(plugin) {
|
|
134150
134329
|
}
|
134151
134330
|
|
134152
134331
|
/***/ }),
|
134153
|
-
/*
|
134332
|
+
/* 1005 */
|
134154
134333
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
134155
134334
|
|
134156
134335
|
"use strict";
|
@@ -134159,7 +134338,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
134159
134338
|
|
134160
134339
|
|
134161
134340
|
/***/ }),
|
134162
|
-
/*
|
134341
|
+
/* 1006 */
|
134163
134342
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
134164
134343
|
|
134165
134344
|
"use strict";
|
@@ -134169,7 +134348,7 @@ var _interopRequireDefault = __webpack_require__(197);
|
|
134169
134348
|
exports.__esModule = true;
|
134170
134349
|
__webpack_require__(204);
|
134171
134350
|
__webpack_require__(286);
|
134172
|
-
var _linkedList = _interopRequireDefault(__webpack_require__(
|
134351
|
+
var _linkedList = _interopRequireDefault(__webpack_require__(1007));
|
134173
134352
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
134174
134353
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
134175
134354
|
function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
@@ -134470,7 +134649,7 @@ function _pushOrderNode(selectedRange, listOrder, mergeCellsVisitor, row, column
|
|
134470
134649
|
}
|
134471
134650
|
|
134472
134651
|
/***/ }),
|
134473
|
-
/*
|
134652
|
+
/* 1007 */
|
134474
134653
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
134475
134654
|
|
134476
134655
|
"use strict";
|
@@ -134722,6 +134901,82 @@ class LinkedList {
|
|
134722
134901
|
}
|
134723
134902
|
var _default = exports["default"] = LinkedList;
|
134724
134903
|
|
134904
|
+
/***/ }),
|
134905
|
+
/* 1008 */
|
134906
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
134907
|
+
|
134908
|
+
"use strict";
|
134909
|
+
|
134910
|
+
|
134911
|
+
exports.__esModule = true;
|
134912
|
+
exports.createMergeCellRenderer = createMergeCellRenderer;
|
134913
|
+
var _object = __webpack_require__(482);
|
134914
|
+
/**
|
134915
|
+
* Creates a renderer object for the `MergeCells` plugin.
|
134916
|
+
*
|
134917
|
+
* @param {MergeCells} plugin The `MergeCells` plugin instance.
|
134918
|
+
* @returns {{before: Function, after: Function}}
|
134919
|
+
*/
|
134920
|
+
function createMergeCellRenderer(plugin) {
|
134921
|
+
const {
|
134922
|
+
hot
|
134923
|
+
} = plugin;
|
134924
|
+
const {
|
134925
|
+
rowIndexMapper: rowMapper,
|
134926
|
+
columnIndexMapper: columnMapper
|
134927
|
+
} = hot;
|
134928
|
+
|
134929
|
+
/**
|
134930
|
+
* Runs before the cell is rendered.
|
134931
|
+
*/
|
134932
|
+
function before() {}
|
134933
|
+
|
134934
|
+
/**
|
134935
|
+
* Runs after the cell is rendered.
|
134936
|
+
*
|
134937
|
+
* @param {HTMLElement} TD The cell to be modified.
|
134938
|
+
* @param {number} row Row index.
|
134939
|
+
* @param {number} col Visual column index.
|
134940
|
+
*/
|
134941
|
+
function after(TD, row, col) {
|
134942
|
+
const mergedCell = plugin.mergedCellsCollection.get(row, col);
|
134943
|
+
if (!(0, _object.isObject)(mergedCell)) {
|
134944
|
+
TD.removeAttribute('rowspan');
|
134945
|
+
TD.removeAttribute('colspan');
|
134946
|
+
TD.style.display = '';
|
134947
|
+
return;
|
134948
|
+
}
|
134949
|
+
const {
|
134950
|
+
row: origRow,
|
134951
|
+
col: origColumn,
|
134952
|
+
colspan: origColspan,
|
134953
|
+
rowspan: origRowspan
|
134954
|
+
} = mergedCell;
|
134955
|
+
const [lastMergedRowIndex, lastMergedColumnIndex] = plugin.translateMergedCellToRenderable(origRow, origRowspan, origColumn, origColspan);
|
134956
|
+
const renderedRowIndex = rowMapper.getRenderableFromVisualIndex(row);
|
134957
|
+
const renderedColumnIndex = columnMapper.getRenderableFromVisualIndex(col);
|
134958
|
+
const maxRowSpan = lastMergedRowIndex - renderedRowIndex + 1; // Number of rendered columns.
|
134959
|
+
const maxColSpan = lastMergedColumnIndex - renderedColumnIndex + 1; // Number of rendered columns.
|
134960
|
+
|
134961
|
+
const notHiddenRow = rowMapper.getNearestNotHiddenIndex(origRow, 1);
|
134962
|
+
const notHiddenColumn = columnMapper.getNearestNotHiddenIndex(origColumn, 1);
|
134963
|
+
const notHiddenRowspan = Math.min(origRowspan, maxRowSpan);
|
134964
|
+
const notHiddenColspan = Math.min(origColspan, maxColSpan);
|
134965
|
+
if (notHiddenRow === row && notHiddenColumn === col) {
|
134966
|
+
TD.setAttribute('rowspan', notHiddenRowspan);
|
134967
|
+
TD.setAttribute('colspan', notHiddenColspan);
|
134968
|
+
} else {
|
134969
|
+
TD.removeAttribute('rowspan');
|
134970
|
+
TD.removeAttribute('colspan');
|
134971
|
+
TD.style.display = 'none';
|
134972
|
+
}
|
134973
|
+
}
|
134974
|
+
return {
|
134975
|
+
before,
|
134976
|
+
after
|
134977
|
+
};
|
134978
|
+
}
|
134979
|
+
|
134725
134980
|
/***/ }),
|
134726
134981
|
/* 1009 */
|
134727
134982
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|