@guiexpert/table 1.1.13 → 1.1.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs +2 -2
- package/index.js +323 -0
- package/lib/table/ele-scope.d.ts +18 -0
- package/lib/table/render-scope.d.ts +265 -0
- package/lib/table/selection/selection-model.d.ts +7 -0
- package/lib/table/selection/selection-model.if.d.ts +21 -0
- package/lib/table/table-api.d.ts +23 -1
- package/lib/table/table-scope.d.ts +24 -6
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -516,6 +516,14 @@ class Ae {
|
|
|
516
516
|
repaint() {
|
|
517
517
|
this.tableScope.repaint();
|
|
518
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* Repaints the table scope with hard repaint.
|
|
521
|
+
* Repaints the UI by resetting the size of the wrapper div,
|
|
522
|
+
* adjusting the containers and rows, and performing additional adjustments
|
|
523
|
+
* after scrolling.
|
|
524
|
+
*
|
|
525
|
+
* @return {void}
|
|
526
|
+
*/
|
|
519
527
|
repaintHard() {
|
|
520
528
|
this.tableScope.repaintHard();
|
|
521
529
|
}
|
|
@@ -569,6 +577,23 @@ class Ae {
|
|
|
569
577
|
this.tableScope.focusModel()
|
|
570
578
|
);
|
|
571
579
|
}
|
|
580
|
+
/**
|
|
581
|
+
* Retrieves the current scope of the table.
|
|
582
|
+
*
|
|
583
|
+
* @returns {TableScope} The current scope of the table.
|
|
584
|
+
*/
|
|
585
|
+
getTableScope() {
|
|
586
|
+
return this.tableScope;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Retrieves the selection model of the table.
|
|
590
|
+
*
|
|
591
|
+
* @return {SelectionModelIf | undefined} The selection model of the table,
|
|
592
|
+
* or undefined if no selection model is available.
|
|
593
|
+
*/
|
|
594
|
+
getSelectionModel() {
|
|
595
|
+
return this.tableScope.selectionModel();
|
|
596
|
+
}
|
|
572
597
|
}
|
|
573
598
|
class q {
|
|
574
599
|
constructor(e) {
|
|
@@ -807,6 +832,11 @@ class Te {
|
|
|
807
832
|
o.createDivWithClass("ge-table-footer-border", i)
|
|
808
833
|
);
|
|
809
834
|
}
|
|
835
|
+
/**
|
|
836
|
+
* Adjusts the containers and rows of the table based on the current state.
|
|
837
|
+
*
|
|
838
|
+
* @return {void}
|
|
839
|
+
*/
|
|
810
840
|
adjustContainersAndRows() {
|
|
811
841
|
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, o = this.hostElement.clientHeight;
|
|
812
842
|
this.dom.applyStyle(this.scrollViewport, {
|
|
@@ -879,8 +909,21 @@ class Te {
|
|
|
879
909
|
})
|
|
880
910
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
881
911
|
}
|
|
912
|
+
/**
|
|
913
|
+
* Adjusts the position or appearance of elements after scrolling.
|
|
914
|
+
* This method must be overwritten in child classes.
|
|
915
|
+
*
|
|
916
|
+
* @return {void}
|
|
917
|
+
*/
|
|
882
918
|
adjustAfterScrolling() {
|
|
883
919
|
}
|
|
920
|
+
/**
|
|
921
|
+
* Resets the size of the wrapper div based on the content dimensions.
|
|
922
|
+
*
|
|
923
|
+
* @protected
|
|
924
|
+
*
|
|
925
|
+
* @returns {void} Returns nothing.
|
|
926
|
+
*/
|
|
884
927
|
resetSizeOfWrapperDiv() {
|
|
885
928
|
const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
|
|
886
929
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
@@ -976,6 +1019,14 @@ class _e extends Te {
|
|
|
976
1019
|
isEditing() {
|
|
977
1020
|
return this.editing;
|
|
978
1021
|
}
|
|
1022
|
+
/**
|
|
1023
|
+
* Resets the editor renderer by clearing its values and state.
|
|
1024
|
+
*
|
|
1025
|
+
* @function resetEditorRenderer
|
|
1026
|
+
* @memberof ClassName
|
|
1027
|
+
*
|
|
1028
|
+
* @returns {void}
|
|
1029
|
+
*/
|
|
979
1030
|
resetEditorRenderer() {
|
|
980
1031
|
this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
|
|
981
1032
|
}
|
|
@@ -992,6 +1043,12 @@ class _e extends Te {
|
|
|
992
1043
|
t == null || t.clear(), e && this.repaint();
|
|
993
1044
|
}
|
|
994
1045
|
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Initializes and renders the editor for a specified row and column index.
|
|
1048
|
+
*
|
|
1049
|
+
* @param {number} rowIdx - The index of the row.
|
|
1050
|
+
* @param {number} colIdx - The index of the column.
|
|
1051
|
+
*/
|
|
995
1052
|
initRenderEditor(e, t) {
|
|
996
1053
|
var s;
|
|
997
1054
|
let o = (s = this.tableModel.getColumnDef(t)) == null ? void 0 : s.getEditRenderer;
|
|
@@ -1003,12 +1060,28 @@ class _e extends Te {
|
|
|
1003
1060
|
} else
|
|
1004
1061
|
this.resetEditorRenderer();
|
|
1005
1062
|
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Adjusts the content after scrolling and initiates a repaint of the component.
|
|
1065
|
+
*
|
|
1066
|
+
* @return {void}
|
|
1067
|
+
*/
|
|
1006
1068
|
repaint() {
|
|
1007
1069
|
this.adjustAfterScrolling();
|
|
1008
1070
|
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Repaints the UI by resetting the size of the wrapper div,
|
|
1073
|
+
* adjusting the containers and rows, and performing additional adjustments
|
|
1074
|
+
* after scrolling.
|
|
1075
|
+
*
|
|
1076
|
+
* @return {void} This method does not return any value.
|
|
1077
|
+
*/
|
|
1009
1078
|
repaintHard() {
|
|
1010
1079
|
this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.adjustAfterScrolling();
|
|
1011
1080
|
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Adjusts the table after scrolling. This method performs various adjustments
|
|
1083
|
+
* to the table's appearance and behavior after a scroll event occurs.
|
|
1084
|
+
*/
|
|
1012
1085
|
adjustAfterScrolling() {
|
|
1013
1086
|
var e;
|
|
1014
1087
|
for (const t of this.removables)
|
|
@@ -1031,10 +1104,23 @@ class _e extends Te {
|
|
|
1031
1104
|
"ge-table-body-west-vertical-border"
|
|
1032
1105
|
));
|
|
1033
1106
|
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Checks if the scroll position should be saved and saves it.
|
|
1109
|
+
*
|
|
1110
|
+
* @return {void}
|
|
1111
|
+
*/
|
|
1034
1112
|
checkForScrollPosSaving() {
|
|
1035
1113
|
var e, t;
|
|
1036
1114
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
1037
1115
|
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Updates the cells in the table with the provided values and optionally repaints all cells.
|
|
1118
|
+
*
|
|
1119
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events containing information about the cells to update.
|
|
1120
|
+
* @param {boolean} repaintAll - Optional. If true, repaints all cells after updating. Defaults to false.
|
|
1121
|
+
*
|
|
1122
|
+
* @returns {void}
|
|
1123
|
+
*/
|
|
1038
1124
|
updateCells(e, t = !1) {
|
|
1039
1125
|
e.forEach(
|
|
1040
1126
|
(o) => {
|
|
@@ -1042,6 +1128,15 @@ class _e extends Te {
|
|
|
1042
1128
|
}
|
|
1043
1129
|
), t && this.repaint();
|
|
1044
1130
|
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Rerenders the content of a table cell based on the given parameters.
|
|
1133
|
+
*
|
|
1134
|
+
* @param {TableCellUpdateEventIf} area - The area of the table.
|
|
1135
|
+
* @param {number} rowIndex - The index of the row.
|
|
1136
|
+
* @param {number} columnIndex - The index of the column.
|
|
1137
|
+
* @param {any} value - The new value to be displayed in the cell.
|
|
1138
|
+
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1139
|
+
*/
|
|
1045
1140
|
rerenderCellContent({ area: e, rowIndex: t, columnIndex: o, value: s, cssClasses: i }) {
|
|
1046
1141
|
const r = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + o + '"][data-row-index="' + t + '"][data-area="' + e + '"]', l = document.querySelector(n);
|
|
1047
1142
|
if (l) {
|
|
@@ -1061,6 +1156,13 @@ class _e extends Te {
|
|
|
1061
1156
|
this.dom.setStyle(l, b, m[b]);
|
|
1062
1157
|
}
|
|
1063
1158
|
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Stores the widths of all columns in the table.
|
|
1161
|
+
*
|
|
1162
|
+
* @protected
|
|
1163
|
+
* @function storeColumnWidths
|
|
1164
|
+
* @returns {void}
|
|
1165
|
+
*/
|
|
1064
1166
|
storeColumnWidths() {
|
|
1065
1167
|
const e = this.tableModel.getColumnDefs();
|
|
1066
1168
|
e != null && e.length && (this.storedColumnWidths = e.map((t, o) => this.tableModel.getColumnWidth(o)));
|
|
@@ -1073,6 +1175,15 @@ class _e extends Te {
|
|
|
1073
1175
|
}
|
|
1074
1176
|
return [void 0, void 0];
|
|
1075
1177
|
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Retrieves the specified area from the grid layout.
|
|
1180
|
+
*
|
|
1181
|
+
* @param {string} areaIdent - The identifier for the area ('header', 'body', or 'footer').
|
|
1182
|
+
* @param {string} sideIdent - The identifier for the side of the area ('west', 'center', or 'east').
|
|
1183
|
+
* @protected
|
|
1184
|
+
* @returns {HTMLElement} - The requested area element.
|
|
1185
|
+
* @throws {Error} - If the area identifier or side identifier is incorrect.
|
|
1186
|
+
*/
|
|
1076
1187
|
getArea(e, t) {
|
|
1077
1188
|
if (e === "header") {
|
|
1078
1189
|
if (t === "west")
|
|
@@ -1098,10 +1209,24 @@ class _e extends Te {
|
|
|
1098
1209
|
}
|
|
1099
1210
|
throw Error(`Wrong area identifier: row:${e}, col:${t}`);
|
|
1100
1211
|
}
|
|
1212
|
+
/**
|
|
1213
|
+
* Adjusts the body of the table.
|
|
1214
|
+
*
|
|
1215
|
+
* @protected
|
|
1216
|
+
* @return {void}
|
|
1217
|
+
*/
|
|
1101
1218
|
adjustBody() {
|
|
1102
1219
|
const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
|
|
1103
1220
|
this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
|
|
1104
1221
|
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Returns a number value extracted from the specified attribute of the source element.
|
|
1224
|
+
*
|
|
1225
|
+
* @param {HTMLElement} srcElement - The source element from which to extract the attribute value.
|
|
1226
|
+
* @param {string} key - The attribute key to extract the value from.
|
|
1227
|
+
* @returns {number} - The extracted number value, or -1 if the attribute was not found or not a valid number.
|
|
1228
|
+
* @protected
|
|
1229
|
+
*/
|
|
1105
1230
|
getNumberByAttr(e, t) {
|
|
1106
1231
|
var o;
|
|
1107
1232
|
if (e) {
|
|
@@ -1111,6 +1236,14 @@ class _e extends Te {
|
|
|
1111
1236
|
}
|
|
1112
1237
|
return -1;
|
|
1113
1238
|
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Retrieves the value of the specified attribute from the nearest ancestor element that has the attribute.
|
|
1241
|
+
*
|
|
1242
|
+
* @param {HTMLElement} srcElement - The source element from which to start searching for the nearest ancestor element.
|
|
1243
|
+
* @param {string} key - The name of the attribute to retrieve.
|
|
1244
|
+
* @returns {string} The value of the specified attribute, or an empty string if the attribute is not found.
|
|
1245
|
+
* @protected
|
|
1246
|
+
*/
|
|
1114
1247
|
getStringByAttr(e, t) {
|
|
1115
1248
|
var o;
|
|
1116
1249
|
if (e) {
|
|
@@ -1120,6 +1253,14 @@ class _e extends Te {
|
|
|
1120
1253
|
}
|
|
1121
1254
|
return "";
|
|
1122
1255
|
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Adjusts the layout and positioning of the specified area in the table.
|
|
1258
|
+
* This method is used internally and should not be called directly.
|
|
1259
|
+
*
|
|
1260
|
+
* @param {AreaIdent} areaIdent - The identifier of the area to adjust (e.g. header, body, footer).
|
|
1261
|
+
* @param {number} [yStart=0] - The starting y-position for the layout adjustments.
|
|
1262
|
+
* @protected
|
|
1263
|
+
*/
|
|
1123
1264
|
adjustArea(e, t = 0) {
|
|
1124
1265
|
var g;
|
|
1125
1266
|
const o = this.getArea(e, "west"), s = this.getArea(e, "center"), i = this.getArea(e, "east"), r = s.child.clientHeight;
|
|
@@ -1260,6 +1401,15 @@ class _e extends Te {
|
|
|
1260
1401
|
parent: i
|
|
1261
1402
|
});
|
|
1262
1403
|
}
|
|
1404
|
+
/**
|
|
1405
|
+
* Finds the row index of an important rowspan cell in a given area model.
|
|
1406
|
+
*
|
|
1407
|
+
* @param {AreaModelIf} areaModel - The area model to search in.
|
|
1408
|
+
* @param {number} rowIndex - The current row index.
|
|
1409
|
+
* @param {number} colIndex - The current column index.
|
|
1410
|
+
* @returns {number} - The row index of the important rowspan cell, or -1 if not found.
|
|
1411
|
+
* @protected
|
|
1412
|
+
*/
|
|
1263
1413
|
findRowOfImportantRowspanCell(e, t, o) {
|
|
1264
1414
|
const s = e.getMaxRowspan();
|
|
1265
1415
|
for (let i = t - 1; i > -1; i--) {
|
|
@@ -1271,6 +1421,13 @@ class _e extends Te {
|
|
|
1271
1421
|
}
|
|
1272
1422
|
return -1;
|
|
1273
1423
|
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Adjusts the columns to fit the width of the row's parent element.
|
|
1426
|
+
*
|
|
1427
|
+
* @param {ArgsAdjustColumnsToRowParentParams} params - The parameters for adjusting the columns.
|
|
1428
|
+
* @protected
|
|
1429
|
+
* @return {void}
|
|
1430
|
+
*/
|
|
1274
1431
|
adjustColumnsToRowParent({
|
|
1275
1432
|
areaIdent: e,
|
|
1276
1433
|
sideIdent: t,
|
|
@@ -1337,6 +1494,15 @@ class _e extends Te {
|
|
|
1337
1494
|
}
|
|
1338
1495
|
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new $(b - 1, 1, s.height, 0), i);
|
|
1339
1496
|
}
|
|
1497
|
+
/**
|
|
1498
|
+
* Retrieves the column index of the tree arrow column in the table.
|
|
1499
|
+
*
|
|
1500
|
+
* @protected
|
|
1501
|
+
*
|
|
1502
|
+
* @returns {0 | 1} The column index of the tree arrow column.
|
|
1503
|
+
* Returns 0 if the checkbox is not visible,
|
|
1504
|
+
* otherwise returns 1.
|
|
1505
|
+
*/
|
|
1340
1506
|
getTreeArrowColumnIndex() {
|
|
1341
1507
|
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
1342
1508
|
}
|
|
@@ -1397,23 +1563,53 @@ class _e extends Te {
|
|
|
1397
1563
|
this.dom.setStyle(S, v, G[v]);
|
|
1398
1564
|
return [S, E];
|
|
1399
1565
|
}
|
|
1566
|
+
/**
|
|
1567
|
+
* Applies CSS classes to an HTML element.
|
|
1568
|
+
*
|
|
1569
|
+
* @param {HTMLDivElement} ele - The HTML element to which CSS classes will be applied.
|
|
1570
|
+
* @param {Object.<string, boolean>} cssClasses - An object containing CSS class names as keys and boolean values indicating whether to apply or remove the class.
|
|
1571
|
+
* @protected
|
|
1572
|
+
*/
|
|
1400
1573
|
applyCssClasses(e, t = {}) {
|
|
1401
1574
|
e && Object.entries(t).forEach(([o, s]) => {
|
|
1402
1575
|
s ? this.dom.addClass(o, e) : this.dom.removeClass(o, e);
|
|
1403
1576
|
});
|
|
1404
1577
|
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Retrieves the column widths of a table within a specified range.
|
|
1580
|
+
*
|
|
1581
|
+
* @param {number} startIndex - The index of the first column to retrieve the width of.
|
|
1582
|
+
* @param {number} endIndex - The index of the last column to retrieve the width of.
|
|
1583
|
+
*
|
|
1584
|
+
* @return {number[]} An array containing the widths of the columns within the specified range.
|
|
1585
|
+
*/
|
|
1405
1586
|
getColumnWidths(e, t) {
|
|
1406
1587
|
const o = [];
|
|
1407
1588
|
for (let s = e; s <= t; s++)
|
|
1408
1589
|
o.push(this.tableModel.getColumnWidth(s));
|
|
1409
1590
|
return o;
|
|
1410
1591
|
}
|
|
1592
|
+
/**
|
|
1593
|
+
* Retrieves the heights of rows within a specified range.
|
|
1594
|
+
*
|
|
1595
|
+
* @param {number} startIndex - The index of the first row in the range.
|
|
1596
|
+
* @param {number} endIndex - The index of the last row in the range.
|
|
1597
|
+
* @param {AreaModelIf} areaModel - The area model.
|
|
1598
|
+
* @return {number[]} - An array containing the heights of the rows within the specified range.
|
|
1599
|
+
*/
|
|
1411
1600
|
getRowHeights(e, t, o) {
|
|
1412
1601
|
const s = [];
|
|
1413
1602
|
for (let i = e; i <= t; i++)
|
|
1414
1603
|
s.push(o.getRowHeight(i));
|
|
1415
1604
|
return s;
|
|
1416
1605
|
}
|
|
1606
|
+
/**
|
|
1607
|
+
* Adjusts the position and size of the hover row based on the mouse move event.
|
|
1608
|
+
*
|
|
1609
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
|
|
1610
|
+
*
|
|
1611
|
+
* @return {void}
|
|
1612
|
+
*/
|
|
1417
1613
|
adjustHoverRows(e) {
|
|
1418
1614
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1419
1615
|
const t = this.hostElement.clientWidth, o = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), s = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
@@ -1427,11 +1623,26 @@ class _e extends Te {
|
|
|
1427
1623
|
} else
|
|
1428
1624
|
this.hideHoverRow();
|
|
1429
1625
|
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Hides the hover row by applying 'display: none' style to it.
|
|
1628
|
+
*
|
|
1629
|
+
* @protected
|
|
1630
|
+
* @function
|
|
1631
|
+
* @name hideHoverRow
|
|
1632
|
+
* @memberof ClassName
|
|
1633
|
+
*
|
|
1634
|
+
* @returns {void}
|
|
1635
|
+
*/
|
|
1430
1636
|
hideHoverRow() {
|
|
1431
1637
|
this.dom.applyStyle(this.hoverRow, {
|
|
1432
1638
|
display: "none"
|
|
1433
1639
|
});
|
|
1434
1640
|
}
|
|
1641
|
+
/**
|
|
1642
|
+
* Adjusts the position and size of the hover column based on the mouse move event.
|
|
1643
|
+
*
|
|
1644
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
1645
|
+
*/
|
|
1435
1646
|
adjustHoverColumns(e) {
|
|
1436
1647
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1437
1648
|
const t = this.hostElement.clientHeight, o = this.tableModel.getColumnWidth(e.columnIndex), s = this.areaBodyWestGeo.width, i = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - s;
|
|
@@ -1445,6 +1656,15 @@ class _e extends Te {
|
|
|
1445
1656
|
} else
|
|
1446
1657
|
this.hideHoverColumn();
|
|
1447
1658
|
}
|
|
1659
|
+
/**
|
|
1660
|
+
* Hide hover column.
|
|
1661
|
+
*
|
|
1662
|
+
* This method hides the hover column by applying a style of 'display: none'
|
|
1663
|
+
* to the element representing the hover column.
|
|
1664
|
+
*
|
|
1665
|
+
* @protected
|
|
1666
|
+
* @memberof ClassName
|
|
1667
|
+
*/
|
|
1448
1668
|
hideHoverColumn() {
|
|
1449
1669
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1450
1670
|
display: "none"
|
|
@@ -1461,6 +1681,13 @@ class _e extends Te {
|
|
|
1461
1681
|
debounce(e, t = 1e3) {
|
|
1462
1682
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1463
1683
|
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Adjusts the dragging column during a mouse move event.
|
|
1686
|
+
*
|
|
1687
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
|
|
1688
|
+
* @param {number} sourceColumnIndex - The index of the source column.
|
|
1689
|
+
* @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
|
|
1690
|
+
*/
|
|
1464
1691
|
adjustDraggingColumn(e, t, o) {
|
|
1465
1692
|
var s, i;
|
|
1466
1693
|
if (this.dragging) {
|
|
@@ -1476,10 +1703,25 @@ class _e extends Te {
|
|
|
1476
1703
|
} else
|
|
1477
1704
|
this.hideDraggingColumn();
|
|
1478
1705
|
}
|
|
1706
|
+
/**
|
|
1707
|
+
* Renders the content of a dragging column.
|
|
1708
|
+
*
|
|
1709
|
+
* @param {GeoData} columnGeo - The geographic data of the column.
|
|
1710
|
+
*
|
|
1711
|
+
* @returns {number} The y-coordinate of the rendered content.
|
|
1712
|
+
*/
|
|
1479
1713
|
renderContentOfDraggingColumn(e) {
|
|
1480
1714
|
const t = this.renderContentOfDraggingColumnForArea(e, "header", 0);
|
|
1481
1715
|
this.renderContentOfDraggingColumnForArea(e, "body", t);
|
|
1482
1716
|
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Renders the content of the dragging column for a specific area.
|
|
1719
|
+
*
|
|
1720
|
+
* @param {GeoData} columnGeo - The geometry data of the dragging column.
|
|
1721
|
+
* @param {AreaIdent} areaIdent - The identifier of the area.
|
|
1722
|
+
* @param {number} [y=0] - The starting y-position.
|
|
1723
|
+
* @return {number} The final y-position after rendering all the content.
|
|
1724
|
+
*/
|
|
1483
1725
|
renderContentOfDraggingColumnForArea(e, t, o = 0) {
|
|
1484
1726
|
const s = "center", i = this.tableModel.getAreaModel(t), r = i == null ? void 0 : i.getRowCount();
|
|
1485
1727
|
if (r) {
|
|
@@ -1509,17 +1751,50 @@ class _e extends Te {
|
|
|
1509
1751
|
}
|
|
1510
1752
|
return o;
|
|
1511
1753
|
}
|
|
1754
|
+
/**
|
|
1755
|
+
* Hides the dragging column by applying a 'display: none' style to it.
|
|
1756
|
+
* This method is protected and can only be accessed within the class.
|
|
1757
|
+
*
|
|
1758
|
+
* @return {void}
|
|
1759
|
+
*/
|
|
1512
1760
|
hideDraggingColumn() {
|
|
1513
1761
|
this.dom.applyStyle(this.draggingColumn, {
|
|
1514
1762
|
display: "none"
|
|
1515
1763
|
});
|
|
1516
1764
|
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Renders a draggable target div element.
|
|
1767
|
+
*
|
|
1768
|
+
* @param {HTMLDivElement} parent - The parent element where the target div will be appended to.
|
|
1769
|
+
* @param {number} left - The left position of the target div in pixels.
|
|
1770
|
+
* @param {number} top - The top position of the target div in pixels.
|
|
1771
|
+
* @param {number} width - The width of the target div in pixels.
|
|
1772
|
+
* @param {number} height - The height of the target div in pixels.
|
|
1773
|
+
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1774
|
+
*/
|
|
1517
1775
|
renderDragTargetDiv(e, t, o, s, i) {
|
|
1518
1776
|
const r = this.dom.applyStylePosistionAbsolute(
|
|
1519
1777
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1520
1778
|
);
|
|
1521
1779
|
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${o}px`), this.dom.setStyle(r, "width", `${s}px`), this.dom.setStyle(r, "height", `${i}px`), r;
|
|
1522
1780
|
}
|
|
1781
|
+
/**
|
|
1782
|
+
* Render selected background div.
|
|
1783
|
+
*
|
|
1784
|
+
* @private
|
|
1785
|
+
* @param {boolean} skip - Whether to skip rendering.
|
|
1786
|
+
* @param {boolean} renderSelection - Whether to render the selection.
|
|
1787
|
+
* @param {SideIdent} sideIdent - The side identifier.
|
|
1788
|
+
* @param {AreaModelIf} areaModel - The area model.
|
|
1789
|
+
* @param {number} rowIndex - The row index.
|
|
1790
|
+
* @param {number} index - The index.
|
|
1791
|
+
* @param {HTMLDivElement} parent - The parent div element.
|
|
1792
|
+
* @param {number} left - The left position.
|
|
1793
|
+
* @param {number} top - The top position.
|
|
1794
|
+
* @param {number} width - The width of the div.
|
|
1795
|
+
* @param {number} height - The height of the div.
|
|
1796
|
+
* @returns {boolean} - Whether the cell is selected.
|
|
1797
|
+
*/
|
|
1523
1798
|
renderSelectedBackgroundDiv(e, t, o, s, i, r, n, l, d, a, h) {
|
|
1524
1799
|
let u = !1;
|
|
1525
1800
|
if (!e && t && s.isSelectable(i, r) && this.getSelectionModel) {
|
|
@@ -1538,6 +1813,25 @@ class _e extends Te {
|
|
|
1538
1813
|
}
|
|
1539
1814
|
return u;
|
|
1540
1815
|
}
|
|
1816
|
+
/**
|
|
1817
|
+
* Renders a cell in the grid.
|
|
1818
|
+
*
|
|
1819
|
+
* @param {ArgsRenderCell} args - The arguments for rendering the cell.
|
|
1820
|
+
* @param {AreaModel} args.areaModel - The area model of the grid.
|
|
1821
|
+
* @param {string} args.areaIdent - The identifier of the area.
|
|
1822
|
+
* @param {string} args.sideIdent - The identifier of the side.
|
|
1823
|
+
* @param {number} args.rowIndex - The index of the row.
|
|
1824
|
+
* @param {number} args.columnIndex - The index of the column.
|
|
1825
|
+
* @param {number} args.left - The left position of the cell.
|
|
1826
|
+
* @param {number} args.top - The top position of the cell.
|
|
1827
|
+
* @param {number} args.width - The width of the cell.
|
|
1828
|
+
* @param {number} args.height - The height of the cell.
|
|
1829
|
+
* @param {HTMLElement} args.parent - The parent element of the cell.
|
|
1830
|
+
* @param {boolean} args.cellSelected - Indicates if the cell is selected.
|
|
1831
|
+
* @param {boolean} args.lastRowOfModel - Indicates if the cell is in the last row of the model.
|
|
1832
|
+
*
|
|
1833
|
+
* @returns {void}
|
|
1834
|
+
*/
|
|
1541
1835
|
renderCell({
|
|
1542
1836
|
areaModel: e,
|
|
1543
1837
|
areaIdent: t,
|
|
@@ -1567,6 +1861,20 @@ class _e extends Te {
|
|
|
1567
1861
|
});
|
|
1568
1862
|
h && this.dom.addClass(`ge-table-${t}-${o}-selected-range`, m), b && this.cleanupFunctions[t].push(b);
|
|
1569
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Render the header cell resize handle.
|
|
1866
|
+
*
|
|
1867
|
+
* @param {ArgsRenderHeaderCellResizeHandle} args - The arguments for rendering the handle.
|
|
1868
|
+
* @param {number} args.rowIndex - The index of the row.
|
|
1869
|
+
* @param {number} args.columnIndex - The index of the column.
|
|
1870
|
+
* @param {number} args.cellLeft - The left position of the cell.
|
|
1871
|
+
* @param {number} args.cellTop - The top position of the cell.
|
|
1872
|
+
* @param {number} args.cellWidth - The width of the cell.
|
|
1873
|
+
* @param {number} args.cellHeight - The height of the cell.
|
|
1874
|
+
* @param {HTMLElement} args.parent - The parent element to append the handle to.
|
|
1875
|
+
*
|
|
1876
|
+
* @return {void}
|
|
1877
|
+
*/
|
|
1570
1878
|
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: o, cellTop: s, cellWidth: i, cellHeight: r, parent: n }) {
|
|
1571
1879
|
const l = this.dom.domService, d = this.tableOptions.columnResizeHandleWidthInPx ?? 2, a = l.createElement("div");
|
|
1572
1880
|
l.setAttribute(a, "data-col-index", `${t}`), l.setAttribute(a, "data-row-index", `${e}`), l.setAttribute(a, "data-area", "header"), l.setAttribute(a, "data-ge-action", "resize-column"), l.addClass(a, "ge-table-column-resize-handle"), l.setStyle(a, "display", "clip"), l.setStyle(a, "position", "absolute"), l.setStyle(a, "cursor", "col-resize"), l.setStyle(a, "left", `${o + i - d}px`), l.setStyle(a, "top", `${s}px`), l.setStyle(a, "width", `${d}px`), l.setStyle(a, "height", `${r}px`), l.appendChild(n, a);
|
|
@@ -1863,6 +2171,9 @@ class Ge {
|
|
|
1863
2171
|
selectAll() {
|
|
1864
2172
|
this.allSelected = !0;
|
|
1865
2173
|
}
|
|
2174
|
+
isAllSelected() {
|
|
2175
|
+
return this.allSelected;
|
|
2176
|
+
}
|
|
1866
2177
|
addSelection(e) {
|
|
1867
2178
|
this.addRange(e);
|
|
1868
2179
|
}
|
|
@@ -1878,6 +2189,18 @@ class Ge {
|
|
|
1878
2189
|
isSelected(e, t) {
|
|
1879
2190
|
return this.getSelectionCount(e, t) > 0;
|
|
1880
2191
|
}
|
|
2192
|
+
/**
|
|
2193
|
+
* Retrieves the merged row indices from the given range selection.
|
|
2194
|
+
*
|
|
2195
|
+
* @returns {number[]} Array of merged row indices
|
|
2196
|
+
*/
|
|
2197
|
+
getMergedRowIndices() {
|
|
2198
|
+
const e = [];
|
|
2199
|
+
for (const t of this.ranges)
|
|
2200
|
+
for (let o = t.r1; o <= t.r2; o++)
|
|
2201
|
+
!e.includes(o) && !this.isInNegativeRange(o, 0) && e.push(o);
|
|
2202
|
+
return e;
|
|
2203
|
+
}
|
|
1881
2204
|
addRange(e) {
|
|
1882
2205
|
this.selectionType !== "none" && (this.allSelected = !1, this.selectionMode === "single" && (this.ranges = []), this.selectionType === "row" ? (e.c1 = 0, e.c2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "column" ? (e.r1 = 0, e.r2 = Number.MAX_SAFE_INTEGER) : this.selectionType === "cell" ? (e.r2 = e.r1, e.c2 = e.c1) : this.selectionType, this.ranges.push(e));
|
|
1883
2206
|
}
|
package/lib/table/ele-scope.d.ts
CHANGED
|
@@ -36,7 +36,25 @@ export declare class EleScope {
|
|
|
36
36
|
protected areaBodyCenterGeo: GeoData;
|
|
37
37
|
protected areaBodyEastGeo: GeoData;
|
|
38
38
|
constructor(hostElement: HTMLDivElement, tableModel: TableModelIf, dom: ConvenienceDomService, tableOptions: TableOptionsIf);
|
|
39
|
+
/**
|
|
40
|
+
* Adjusts the containers and rows of the table based on the current state.
|
|
41
|
+
*
|
|
42
|
+
* @return {void}
|
|
43
|
+
*/
|
|
39
44
|
adjustContainersAndRows(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Adjusts the position or appearance of elements after scrolling.
|
|
47
|
+
* This method must be overwritten in child classes.
|
|
48
|
+
*
|
|
49
|
+
* @return {void}
|
|
50
|
+
*/
|
|
40
51
|
adjustAfterScrolling(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Resets the size of the wrapper div based on the content dimensions.
|
|
54
|
+
*
|
|
55
|
+
* @protected
|
|
56
|
+
*
|
|
57
|
+
* @returns {void} Returns nothing.
|
|
58
|
+
*/
|
|
41
59
|
protected resetSizeOfWrapperDiv(): void;
|
|
42
60
|
}
|