@guiexpert/react-table 18.1.78 → 18.1.79
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 +10 -7
- package/index.js +193 -165
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -9,14 +9,14 @@ function le(p, e = 500) {
|
|
|
9
9
|
}, e);
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
class
|
|
12
|
+
class I {
|
|
13
13
|
// The constructor is private to prevent direct construction calls
|
|
14
14
|
// with the `new` operator
|
|
15
15
|
constructor() {
|
|
16
16
|
this.alreadySet = !1;
|
|
17
17
|
}
|
|
18
18
|
static getInstance() {
|
|
19
|
-
return
|
|
19
|
+
return I.instance || (I.instance = new I()), I.instance;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Method to set the license key for the application.
|
|
@@ -37,7 +37,7 @@ class k {
|
|
|
37
37
|
function B(p) {
|
|
38
38
|
return p && p.type === "TreeRow";
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function $(p) {
|
|
41
41
|
return p && p.type === "AreaModelTree";
|
|
42
42
|
}
|
|
43
43
|
class _ {
|
|
@@ -60,25 +60,25 @@ class _ {
|
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
class
|
|
63
|
+
class F {
|
|
64
64
|
constructor(e = ">", t = "", s = []) {
|
|
65
65
|
this.content = e, this.style = t, this.classes = s;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
class Z {
|
|
69
|
-
constructor(e = new
|
|
69
|
+
constructor(e = new F(
|
|
70
70
|
">",
|
|
71
71
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
72
72
|
["gt-table-tree-arrow-expanded"]
|
|
73
|
-
), t = new
|
|
73
|
+
), t = new F(
|
|
74
74
|
">",
|
|
75
75
|
"",
|
|
76
76
|
["ge-table-tree-arrow-collapsed"]
|
|
77
|
-
), s = new
|
|
77
|
+
), s = new F(
|
|
78
78
|
">",
|
|
79
79
|
"color:transparent;",
|
|
80
80
|
["gt-table-tree-arrow-hidden"]
|
|
81
|
-
), o = new
|
|
81
|
+
), o = new F(
|
|
82
82
|
"↕",
|
|
83
83
|
"",
|
|
84
84
|
["gt-table-tree-arrow-expanded-all"]
|
|
@@ -87,7 +87,7 @@ class Z {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
class Q {
|
|
90
|
-
constructor(e = new
|
|
90
|
+
constructor(e = new F("↑", "", ["ge-header-sorted-asc"]), t = new F("↓", "", ["ge-header-sorted-desc"]), s = new F("↑", "color:transparent;", [])) {
|
|
91
91
|
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -177,12 +177,12 @@ class ne {
|
|
|
177
177
|
return this.domService.appendChild(e.child, a), a;
|
|
178
178
|
}
|
|
179
179
|
addColumnDiv(e) {
|
|
180
|
-
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: r, sideIdent: l, text: a = "", treeArrow: n, tableOptions: c, checkedType: h = void 0, sortState: d } = e,
|
|
180
|
+
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: r, sideIdent: l, text: a = "", treeArrow: n, tableOptions: c, checkedType: h = void 0, sortState: d } = e, m = c == null ? void 0 : c.treeOptions, g = c == null ? void 0 : c.showCheckboxWihoutExtraColumn, b = this.domService.createElement("div");
|
|
181
181
|
this.domService.addClass(b, "ge-table-col-div"), g && this.domService.addClass(b, "ge-with-checkbox"), this.domService.addClass(b, `ge-table-col-div-${s.index}`), this.domService.setAttribute(b, "data-col-index", `${s.index}`), this.domService.setAttribute(b, "data-row-index", `${o}`), this.domService.setAttribute(b, "data-area", `${r}`);
|
|
182
182
|
const f = ((s == null ? void 0 : s.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
183
|
-
if (r === "body" && l === "center" && this.domService.addClass(b, `ge-table-column-${f}`), this.domService.setStyle(b, "display", "clip"), this.domService.setStyle(b, "position", "absolute"), this.domService.setStyle(b, "left", `${s.left}px`), this.domService.setStyle(b, "top", `${s.top}px`), this.domService.setStyle(b, "width", `${s.width}px`), this.domService.setStyle(b, "height", `${s.height}px`), n && n !== "none" && (this.domService.addClass(b, "ge-table-col-tree"), this.addArrowDiv(b, n,
|
|
184
|
-
const
|
|
185
|
-
this.addLabelDiv(b, a,
|
|
183
|
+
if (r === "body" && l === "center" && this.domService.addClass(b, `ge-table-column-${f}`), this.domService.setStyle(b, "display", "clip"), this.domService.setStyle(b, "position", "absolute"), this.domService.setStyle(b, "left", `${s.left}px`), this.domService.setStyle(b, "top", `${s.top}px`), this.domService.setStyle(b, "width", `${s.width}px`), this.domService.setStyle(b, "height", `${s.height}px`), n && n !== "none" && (this.domService.addClass(b, "ge-table-col-tree"), this.addArrowDiv(b, n, m, o, i, r)), g && i === 0 && h && this.addCheckboxToDiv(b, h, r, o), a) {
|
|
184
|
+
const u = n !== "none" && i === 0;
|
|
185
|
+
this.addLabelDiv(b, a, u, o, i, r);
|
|
186
186
|
}
|
|
187
187
|
return d && this.addSortedIcon(b, d, c == null ? void 0 : c.sortedOptions, i), this.domService.appendChild(t, b), b;
|
|
188
188
|
}
|
|
@@ -536,7 +536,7 @@ class pe {
|
|
|
536
536
|
return s * ("" + e).localeCompare("" + t);
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
|
-
class
|
|
539
|
+
class D extends he {
|
|
540
540
|
constructor(e, t, s, o = [], i = "ge-selected-row", r = "ge-focused-row") {
|
|
541
541
|
super(e, o, s), this.areaIdent = e, this.rows = t, this.defaultRowHeight = s, this.columnDefs = o, this.selectedRowClass = i, this.focusedRowClass = r, this.sorterService = new pe(), this._focusedRowIndex = 0, this.filteredRows = [...t], this.properties = o.map((l) => l.property);
|
|
542
542
|
}
|
|
@@ -922,7 +922,7 @@ class ge {
|
|
|
922
922
|
*/
|
|
923
923
|
setRows(e) {
|
|
924
924
|
const t = this.getBodyModel();
|
|
925
|
-
t instanceof
|
|
925
|
+
t instanceof D ? t.setRows(e) : console.warn("setRows<T>(rows: T[]) only works with AreaModelObjectArray<T>, but this body area model is ", typeof t, t);
|
|
926
926
|
}
|
|
927
927
|
/**
|
|
928
928
|
* Adds new rows to the end of the table body.
|
|
@@ -940,7 +940,7 @@ class ge {
|
|
|
940
940
|
*/
|
|
941
941
|
addRows(e) {
|
|
942
942
|
const t = this.getBodyModel();
|
|
943
|
-
if (t instanceof
|
|
943
|
+
if (t instanceof D) {
|
|
944
944
|
const s = t;
|
|
945
945
|
let o = s.getAllRows();
|
|
946
946
|
s.setRows([...o, ...e]);
|
|
@@ -965,7 +965,7 @@ class ge {
|
|
|
965
965
|
*/
|
|
966
966
|
addRowsAt(e, t) {
|
|
967
967
|
const s = this.getBodyModel();
|
|
968
|
-
if (s instanceof
|
|
968
|
+
if (s instanceof D) {
|
|
969
969
|
const o = s;
|
|
970
970
|
let i = o.getAllRows();
|
|
971
971
|
o.setRows([...i.slice(0, t), ...e, ...i.slice(t)]);
|
|
@@ -991,7 +991,7 @@ class ge {
|
|
|
991
991
|
*/
|
|
992
992
|
removeRows(e, t = (s, o) => s === o) {
|
|
993
993
|
const s = this.getBodyModel();
|
|
994
|
-
if (s instanceof
|
|
994
|
+
if (s instanceof D) {
|
|
995
995
|
const o = s, i = o.getAllRows().filter((r) => !e.some((l) => t(r, l)));
|
|
996
996
|
o.setRows(i);
|
|
997
997
|
} else
|
|
@@ -1032,7 +1032,7 @@ class ge {
|
|
|
1032
1032
|
*/
|
|
1033
1033
|
findRows(e, t = (s, o) => s === o) {
|
|
1034
1034
|
const s = this.getBodyModel();
|
|
1035
|
-
return s instanceof
|
|
1035
|
+
return s instanceof D ? s.getAllRows().filter((i) => e.some((r) => t(i, r))) : (console.warn("findRows<T>(rows: T[], predicate: (a: T, b: T) => boolean) only works with AreaModelObjectArray<T>, but this body area model is ", typeof s, s), []);
|
|
1036
1036
|
}
|
|
1037
1037
|
/**
|
|
1038
1038
|
* Searches through the filtered rows of the table to find a row that matches specific criteria.
|
|
@@ -1089,7 +1089,7 @@ class ge {
|
|
|
1089
1089
|
*/
|
|
1090
1090
|
findRowFromFilteredRowsByAllCriteria(e, t) {
|
|
1091
1091
|
const s = this.getBodyModel();
|
|
1092
|
-
if (s instanceof
|
|
1092
|
+
if (s instanceof D)
|
|
1093
1093
|
return s.getFilteredRows().find((i) => t(e, i));
|
|
1094
1094
|
console.warn("findRowFromFilteredRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ", typeof s, s);
|
|
1095
1095
|
}
|
|
@@ -1136,7 +1136,7 @@ class ge {
|
|
|
1136
1136
|
*/
|
|
1137
1137
|
findRowFromAllRowsByAllCriteria(e, t) {
|
|
1138
1138
|
const s = this.getBodyModel();
|
|
1139
|
-
if (s instanceof
|
|
1139
|
+
if (s instanceof D)
|
|
1140
1140
|
return s.getAllRows().find((i) => t(e, i));
|
|
1141
1141
|
console.warn("findRowFromAllRowsByAllCriteria(...) only works with AreaModelObjectArray<T>, but this body area model is ", typeof s, s);
|
|
1142
1142
|
}
|
|
@@ -1161,7 +1161,7 @@ class ge {
|
|
|
1161
1161
|
*/
|
|
1162
1162
|
updateRows(e, t = (s, o) => s === o) {
|
|
1163
1163
|
const s = this.getBodyModel();
|
|
1164
|
-
if (s instanceof
|
|
1164
|
+
if (s instanceof D) {
|
|
1165
1165
|
let i = s.getAllRows();
|
|
1166
1166
|
for (const r of i)
|
|
1167
1167
|
for (const l of e)
|
|
@@ -1330,6 +1330,21 @@ class ge {
|
|
|
1330
1330
|
getFirstVisibleRowIndex() {
|
|
1331
1331
|
return this.tableScope.getFirstVisibleRowIndex();
|
|
1332
1332
|
}
|
|
1333
|
+
getFirstFullVisibleRowIndex() {
|
|
1334
|
+
return this.tableScope.getFirstFullVisibleRowIndex();
|
|
1335
|
+
}
|
|
1336
|
+
getLastVisibleRowIndex() {
|
|
1337
|
+
return this.tableScope.getLastVisibleRowIndex();
|
|
1338
|
+
}
|
|
1339
|
+
getLastFullVisibleRowIndex() {
|
|
1340
|
+
return this.tableScope.getLastFullVisibleRowIndex();
|
|
1341
|
+
}
|
|
1342
|
+
setLoggingActive(e) {
|
|
1343
|
+
this.tableScope.loggingActive = e;
|
|
1344
|
+
}
|
|
1345
|
+
isLoggingActive() {
|
|
1346
|
+
return this.tableScope.loggingActive;
|
|
1347
|
+
}
|
|
1333
1348
|
}
|
|
1334
1349
|
class z {
|
|
1335
1350
|
constructor(e) {
|
|
@@ -1656,7 +1671,7 @@ class Se {
|
|
|
1656
1671
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
1657
1672
|
}
|
|
1658
1673
|
}
|
|
1659
|
-
class
|
|
1674
|
+
class R {
|
|
1660
1675
|
/**
|
|
1661
1676
|
* Represents a constructor for a class.
|
|
1662
1677
|
* @constructor
|
|
@@ -1670,7 +1685,7 @@ class A {
|
|
|
1670
1685
|
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = o, this.gammaRange = i;
|
|
1671
1686
|
}
|
|
1672
1687
|
static create(e) {
|
|
1673
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
1688
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new R(
|
|
1674
1689
|
e.rowIndex1,
|
|
1675
1690
|
e.columnIndex1,
|
|
1676
1691
|
e.rowIndex2,
|
|
@@ -1679,13 +1694,13 @@ class A {
|
|
|
1679
1694
|
);
|
|
1680
1695
|
}
|
|
1681
1696
|
static singleCell(e, t) {
|
|
1682
|
-
return new
|
|
1697
|
+
return new R(e, t, e, t);
|
|
1683
1698
|
}
|
|
1684
1699
|
static singleRow(e) {
|
|
1685
|
-
return new
|
|
1700
|
+
return new R(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
1686
1701
|
}
|
|
1687
1702
|
static singleColumn(e) {
|
|
1688
|
-
return new
|
|
1703
|
+
return new R(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
1689
1704
|
}
|
|
1690
1705
|
isInRange(e, t) {
|
|
1691
1706
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
@@ -1707,7 +1722,7 @@ class ye {
|
|
|
1707
1722
|
i === 0 && (i = 1), r === 0 && (r = 1);
|
|
1708
1723
|
const l = "gammaCells" in this.areaModel;
|
|
1709
1724
|
this.colAndRowspanRanges.push(
|
|
1710
|
-
new
|
|
1725
|
+
new R(s, o, s + r - 1, o + i - 1, l)
|
|
1711
1726
|
);
|
|
1712
1727
|
}
|
|
1713
1728
|
}
|
|
@@ -1732,11 +1747,11 @@ class we {
|
|
|
1732
1747
|
class xe extends Se {
|
|
1733
1748
|
constructor(e, t, s, o) {
|
|
1734
1749
|
var r, l;
|
|
1735
|
-
super(e, t, s, o), this.dragging = !1, this.editing = !1, this.storedColumnWidths = [], this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1750
|
+
super(e, t, s, o), this.firstVisibleRowIndex = -1, this.lastVisibleRowIndex = -1, this.firstFullVisibleRowIndex = -1, this.lastFullVisibleRowIndex = -1, this.displayedRowCount = 0, this.pixelLimitForFullVisible = 5, this.loggingActive = !1, this.dragging = !1, this.editing = !1, this.storedColumnWidths = [], this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
1736
1751
|
header: [],
|
|
1737
1752
|
body: [],
|
|
1738
1753
|
footer: []
|
|
1739
|
-
}, this.tree = !1, this.colAndRowspanModels = new we(), this.
|
|
1754
|
+
}, this.tree = !1, this.colAndRowspanModels = new we(), this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (l = this.tableOptions) != null && l.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), $(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1740
1755
|
(a) => {
|
|
1741
1756
|
var n;
|
|
1742
1757
|
this.colAndRowspanModels[a] = new ye(t, t.getAreaModel(a)), (n = this.colAndRowspanModels[a]) == null || n.init();
|
|
@@ -1889,12 +1904,27 @@ class xe extends Se {
|
|
|
1889
1904
|
}
|
|
1890
1905
|
const d = r.getCustomClassesAt(t, s);
|
|
1891
1906
|
d.length && this.dom.addClasses(d, a);
|
|
1892
|
-
const
|
|
1893
|
-
if (
|
|
1894
|
-
for (const g in
|
|
1895
|
-
this.dom.setStyle(a, g,
|
|
1907
|
+
const m = r.getCustomStyleAt(t, s);
|
|
1908
|
+
if (m)
|
|
1909
|
+
for (const g in m)
|
|
1910
|
+
this.dom.setStyle(a, g, m[g]);
|
|
1896
1911
|
}
|
|
1897
1912
|
}
|
|
1913
|
+
getFirstVisibleRowIndex() {
|
|
1914
|
+
return this.firstVisibleRowIndex;
|
|
1915
|
+
}
|
|
1916
|
+
getLastVisibleRowIndex() {
|
|
1917
|
+
return this.lastVisibleRowIndex;
|
|
1918
|
+
}
|
|
1919
|
+
getFirstFullVisibleRowIndex() {
|
|
1920
|
+
return this.firstFullVisibleRowIndex;
|
|
1921
|
+
}
|
|
1922
|
+
getLastFullVisibleRowIndex() {
|
|
1923
|
+
return this.lastFullVisibleRowIndex;
|
|
1924
|
+
}
|
|
1925
|
+
getDisplayedRowCount() {
|
|
1926
|
+
return this.displayedRowCount;
|
|
1927
|
+
}
|
|
1898
1928
|
/**
|
|
1899
1929
|
* Stores the widths of all columns in the table.
|
|
1900
1930
|
*
|
|
@@ -1995,16 +2025,17 @@ class xe extends Se {
|
|
|
1995
2025
|
s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
|
|
1996
2026
|
const l = 0, a = this.areaBodyCenterGeo.width, n = this.tableModel.getPadding(), c = this.tableModel.getAreaModel(e), h = c.getRowCount();
|
|
1997
2027
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1998
|
-
const
|
|
1999
|
-
|
|
2028
|
+
const u = this.cleanupFunctions[e].shift();
|
|
2029
|
+
u && u();
|
|
2000
2030
|
}
|
|
2001
2031
|
let d = t;
|
|
2002
|
-
const
|
|
2003
|
-
|
|
2004
|
-
|
|
2032
|
+
const m = this.tableModel.getColumnCount(), g = this.tableModel.getFixedRightColumnCount(), b = this.tableModel.getFixedLeftColumnCount();
|
|
2033
|
+
e === "body" && (this.firstVisibleRowIndex = -1, this.firstFullVisibleRowIndex = -1, this.lastVisibleRowIndex = -1, this.lastFullVisibleRowIndex = -1);
|
|
2034
|
+
for (let u = 0; u < h; u++) {
|
|
2035
|
+
const w = d, S = u === h - 1, v = this.tableModel.getRowHeight(e, u);
|
|
2005
2036
|
if (w + v > 0) {
|
|
2006
|
-
this.firstVisibleRowIndex =
|
|
2007
|
-
let x = { left: l, width: a, height: v, top: w, index:
|
|
2037
|
+
e === "body" && this.firstVisibleRowIndex === -1 && (this.firstVisibleRowIndex = u, this.firstFullVisibleRowIndex = w < -this.pixelLimitForFullVisible ? this.firstVisibleRowIndex + 1 : this.firstVisibleRowIndex);
|
|
2038
|
+
let x = { left: l, width: a, height: v, top: w, index: u }, y = this.dom.addRowDiv(o, x, u, e, "center");
|
|
2008
2039
|
const M = b;
|
|
2009
2040
|
if (this.adjustColumnsToRowParent({
|
|
2010
2041
|
areaIdent: e,
|
|
@@ -2012,61 +2043,64 @@ class xe extends Se {
|
|
|
2012
2043
|
areaModel: c,
|
|
2013
2044
|
geo: x,
|
|
2014
2045
|
parent: y,
|
|
2015
|
-
rowIndex:
|
|
2046
|
+
rowIndex: u,
|
|
2016
2047
|
columnIndexStart: M,
|
|
2017
|
-
columnIndexEnd:
|
|
2048
|
+
columnIndexEnd: m - g - 1,
|
|
2018
2049
|
verticalFixed: !1,
|
|
2019
2050
|
lastRowOfModel: S
|
|
2020
|
-
}), n.left > 0 && (x = { left: l, width: this.areaBodyWestGeo.width, height: v, top: w, index:
|
|
2051
|
+
}), n.left > 0 && (x = { left: l, width: this.areaBodyWestGeo.width, height: v, top: w, index: u }, y = this.dom.addRowDiv(s, x, u, e, "west"), this.adjustColumnsToRowParent({
|
|
2021
2052
|
areaIdent: e,
|
|
2022
2053
|
sideIdent: "west",
|
|
2023
2054
|
areaModel: c,
|
|
2024
2055
|
geo: x,
|
|
2025
2056
|
parent: y,
|
|
2026
|
-
rowIndex:
|
|
2057
|
+
rowIndex: u,
|
|
2027
2058
|
columnIndexStart: 0,
|
|
2028
2059
|
columnIndexEnd: M - 1,
|
|
2029
2060
|
verticalFixed: !0,
|
|
2030
2061
|
lastRowOfModel: S
|
|
2031
|
-
})), n.right > 0 && (x = { left: l, width: this.areaBodyEastGeo.width, height: v, top: w, index:
|
|
2062
|
+
})), n.right > 0 && (x = { left: l, width: this.areaBodyEastGeo.width, height: v, top: w, index: u }, y = this.dom.addRowDiv(i, x, u, e, "east"), this.adjustColumnsToRowParent({
|
|
2032
2063
|
areaIdent: e,
|
|
2033
2064
|
sideIdent: "east",
|
|
2034
2065
|
areaModel: c,
|
|
2035
2066
|
geo: x,
|
|
2036
2067
|
parent: y,
|
|
2037
|
-
rowIndex:
|
|
2038
|
-
columnIndexStart:
|
|
2039
|
-
columnIndexEnd:
|
|
2068
|
+
rowIndex: u,
|
|
2069
|
+
columnIndexStart: m - g,
|
|
2070
|
+
columnIndexEnd: m - 1,
|
|
2040
2071
|
verticalFixed: !0,
|
|
2041
2072
|
lastRowOfModel: S
|
|
2042
|
-
})), e === "header" && this.tree &&
|
|
2043
|
-
const
|
|
2073
|
+
})), e === "header" && this.tree && u === h - 1) {
|
|
2074
|
+
const A = this.dom.applyStyle(
|
|
2044
2075
|
this.dom.setAttribute(
|
|
2045
2076
|
this.dom.addDiv(y, new T(16, 20, 20, 8)),
|
|
2046
2077
|
"data-ge-action",
|
|
2047
2078
|
"toggleExpandCollapseAll"
|
|
2048
2079
|
),
|
|
2049
2080
|
{ cursor: "pointer" }
|
|
2050
|
-
),
|
|
2051
|
-
if (
|
|
2052
|
-
const
|
|
2053
|
-
this.dom.domService.appendChild(
|
|
2081
|
+
), E = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
2082
|
+
if (E) {
|
|
2083
|
+
const O = this.dom.domService.createText(E.content);
|
|
2084
|
+
this.dom.domService.appendChild(A, O), E.style && this.dom.applyStyleString(A, E.style);
|
|
2054
2085
|
}
|
|
2055
2086
|
}
|
|
2056
2087
|
}
|
|
2057
2088
|
if (d = d + v, d > r) {
|
|
2058
|
-
e === "body" && (this.displayedRowCount = this.
|
|
2089
|
+
e === "body" && (this.lastVisibleRowIndex = u, this.lastFullVisibleRowIndex = r - d < -this.pixelLimitForFullVisible ? u - 1 : u, this.displayedRowCount = this.lastFullVisibleRowIndex - this.firstFullVisibleRowIndex + 1);
|
|
2059
2090
|
break;
|
|
2060
2091
|
}
|
|
2061
2092
|
}
|
|
2062
|
-
if (this.
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2093
|
+
if (this.loggingActive && e === "body" && console.log("render scope: this.firstVisibleRowIndex <- " + this.firstVisibleRowIndex + `
|
|
2094
|
+
render scope: this.firstFullVisibleRowIndex <- ` + this.firstFullVisibleRowIndex + `
|
|
2095
|
+
render scope: this.lastVisibleRowIndex <- ` + this.lastVisibleRowIndex + `
|
|
2096
|
+
render scope: this.lastFullVisibleRowIndex <- ` + this.lastFullVisibleRowIndex), this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
2097
|
+
const u = ((f = this.colAndRowspanModels[e]) == null ? void 0 : f.getRanges()) ?? [];
|
|
2098
|
+
if (u.length)
|
|
2099
|
+
for (const w of u) {
|
|
2066
2100
|
let S = 0, v = o.child, x = "center";
|
|
2067
2101
|
if (w.c1 < b)
|
|
2068
2102
|
v = s.child, x = "west";
|
|
2069
|
-
else if (g > 0 && w.c1 >=
|
|
2103
|
+
else if (g > 0 && w.c1 >= m - g)
|
|
2070
2104
|
v = i.child, x = "east";
|
|
2071
2105
|
else {
|
|
2072
2106
|
const y = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
@@ -2087,10 +2121,10 @@ class xe extends Se {
|
|
|
2087
2121
|
* @protected
|
|
2088
2122
|
*/
|
|
2089
2123
|
drawBigCell(e, t, s, o, i, r) {
|
|
2090
|
-
const l = s + this.getRowHeights(0, e.r1 - 1, o).reduce((f,
|
|
2124
|
+
const l = s + this.getRowHeights(0, e.r1 - 1, o).reduce((f, u) => f + u, 0), a = this.tableModel.getColumnCount(), n = this.tableModel.getFixedRightColumnCount();
|
|
2091
2125
|
let c = 0;
|
|
2092
2126
|
n > 0 && e.c1 >= a - n && (c = a - n);
|
|
2093
|
-
const h = t + this.getColumnWidths(c, e.c1 - 1).reduce((f,
|
|
2127
|
+
const h = t + this.getColumnWidths(c, e.c1 - 1).reduce((f, u) => f + u, 0), d = this.getRowHeights(e.r1, e.r2, o).reduce((f, u) => f + u, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((f, u) => f + u, 0);
|
|
2094
2128
|
let g = !1;
|
|
2095
2129
|
const b = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2096
2130
|
b && (g = b.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
@@ -2101,7 +2135,7 @@ class xe extends Se {
|
|
|
2101
2135
|
columnIndex: e.c1,
|
|
2102
2136
|
left: h,
|
|
2103
2137
|
top: l,
|
|
2104
|
-
width:
|
|
2138
|
+
width: m,
|
|
2105
2139
|
height: d,
|
|
2106
2140
|
parent: i,
|
|
2107
2141
|
cellSelected: g,
|
|
@@ -2115,7 +2149,7 @@ class xe extends Se {
|
|
|
2115
2149
|
columnIndex: e.c1,
|
|
2116
2150
|
left: h,
|
|
2117
2151
|
top: l,
|
|
2118
|
-
width:
|
|
2152
|
+
width: m,
|
|
2119
2153
|
height: d,
|
|
2120
2154
|
parent: i,
|
|
2121
2155
|
cellSelected: g,
|
|
@@ -2126,7 +2160,7 @@ class xe extends Se {
|
|
|
2126
2160
|
columnIndex: e.c1,
|
|
2127
2161
|
cellLeft: h,
|
|
2128
2162
|
cellTop: l,
|
|
2129
|
-
cellWidth:
|
|
2163
|
+
cellWidth: m,
|
|
2130
2164
|
cellHeight: d,
|
|
2131
2165
|
parent: i
|
|
2132
2166
|
});
|
|
@@ -2177,41 +2211,41 @@ class xe extends Se {
|
|
|
2177
2211
|
const f = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
2178
2212
|
h = this.scrollFactorX * f;
|
|
2179
2213
|
}
|
|
2180
|
-
const d = 0,
|
|
2214
|
+
const d = 0, m = !!(e === "body" && t);
|
|
2181
2215
|
let g = h;
|
|
2182
2216
|
for (let f = l; f <= a; f++) {
|
|
2183
|
-
const
|
|
2184
|
-
if (w > 0 &&
|
|
2217
|
+
const u = g, w = this.tableModel.getColumnWidth(f);
|
|
2218
|
+
if (w > 0 && u + w > 0) {
|
|
2185
2219
|
let S = o.height;
|
|
2186
2220
|
const v = s.getRowspanAt(r, f), x = s.getColspanAt(r, f);
|
|
2187
|
-
v > 1 && (S = this.getRowHeights(r, r + v - 1, s).reduce((
|
|
2221
|
+
v > 1 && (S = this.getRowHeights(r, r + v - 1, s).reduce((A, E) => A + E, 0));
|
|
2188
2222
|
let y = w;
|
|
2189
|
-
x > 1 && (y = this.getColumnWidths(f, f + x - 1).reduce((
|
|
2223
|
+
x > 1 && (y = this.getColumnWidths(f, f + x - 1).reduce((A, E) => A + E, 0));
|
|
2190
2224
|
let M = !1;
|
|
2191
2225
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (b = this.colAndRowspanModels[e]) != null && b.isInRange(r, f) && (M = !0), this.draggingTargetColumnIndex === f && e !== "header") {
|
|
2192
|
-
this.renderDragTargetDiv(i,
|
|
2193
|
-
const
|
|
2194
|
-
this.dom.addColumnBorderDivs(this.tableOptions, i,
|
|
2226
|
+
this.renderDragTargetDiv(i, u, d, y, S);
|
|
2227
|
+
const A = { left: u, top: d, width: y, height: S };
|
|
2228
|
+
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
2195
2229
|
} else {
|
|
2196
|
-
const
|
|
2230
|
+
const A = this.renderSelectedBackgroundDiv(M, m, t, s, r, f, i, u, d, y, S);
|
|
2197
2231
|
"gammaCells" in s && s.getValueAt(r, f) && (M = !1), M || this.renderCell({
|
|
2198
2232
|
areaModel: s,
|
|
2199
2233
|
areaIdent: e,
|
|
2200
2234
|
sideIdent: t,
|
|
2201
2235
|
rowIndex: r,
|
|
2202
2236
|
columnIndex: f,
|
|
2203
|
-
left:
|
|
2237
|
+
left: u,
|
|
2204
2238
|
top: d,
|
|
2205
2239
|
width: y,
|
|
2206
2240
|
height: S,
|
|
2207
2241
|
parent: i,
|
|
2208
|
-
cellSelected:
|
|
2242
|
+
cellSelected: A,
|
|
2209
2243
|
lastRowOfModel: c,
|
|
2210
2244
|
gammaRange: !0
|
|
2211
2245
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
2212
2246
|
rowIndex: r,
|
|
2213
2247
|
columnIndex: f,
|
|
2214
|
-
cellLeft:
|
|
2248
|
+
cellLeft: u,
|
|
2215
2249
|
cellTop: d,
|
|
2216
2250
|
cellWidth: y,
|
|
2217
2251
|
cellHeight: S,
|
|
@@ -2250,7 +2284,7 @@ class xe extends Se {
|
|
|
2250
2284
|
lastRowOfModel: h
|
|
2251
2285
|
}) {
|
|
2252
2286
|
var j;
|
|
2253
|
-
const
|
|
2287
|
+
const m = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), g = { left: r, width: l, height: a, top: n, index: i }, b = e.getRowByIndex(o);
|
|
2254
2288
|
let f = "none";
|
|
2255
2289
|
if (i === this.getTreeArrowColumnIndex() && B(b)) {
|
|
2256
2290
|
const C = b;
|
|
@@ -2261,7 +2295,7 @@ class xe extends Se {
|
|
|
2261
2295
|
const C = this.tableModel.getColumnDef(i);
|
|
2262
2296
|
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (w = C == null ? void 0 : C.sortState);
|
|
2263
2297
|
}
|
|
2264
|
-
const S = e.getValueAt(o, i), v =
|
|
2298
|
+
const S = e.getValueAt(o, i), v = m ? "" : `${S}`, x = e.isRowChecked(o), y = this.dom.addColumnDiv(
|
|
2265
2299
|
{
|
|
2266
2300
|
parent: c,
|
|
2267
2301
|
geo: g,
|
|
@@ -2277,21 +2311,21 @@ class xe extends Se {
|
|
|
2277
2311
|
}
|
|
2278
2312
|
), M = e.getTooltipAt(o, i);
|
|
2279
2313
|
M && this.dom.setAttribute(y, "title", M);
|
|
2280
|
-
const
|
|
2281
|
-
|
|
2282
|
-
let
|
|
2283
|
-
|
|
2284
|
-
const
|
|
2285
|
-
if (
|
|
2314
|
+
const A = this.tableModel.getColumnDef(i);
|
|
2315
|
+
A && A.classes[t] && this.dom.addClasses(A.classes[t], y);
|
|
2316
|
+
let E;
|
|
2317
|
+
m && (E = m.render(y, o, i, t, e, S, this.dom.domService));
|
|
2318
|
+
const O = e.getCustomClassesAt(o, i);
|
|
2319
|
+
if (O.length && this.dom.addClasses(O, y), this.dom.addColumnBorderDivs(this.tableOptions, c, g, t, s), h && this.dom.addHorizontalBorder({ left: r, width: l, height: a, top: n + a }, c), this.getFocusModel && t === "body") {
|
|
2286
2320
|
const C = this.getFocusModel();
|
|
2287
2321
|
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(c, g, {});
|
|
2288
2322
|
}
|
|
2289
2323
|
t === "header" && this.dom.setAttribute(y, "data-ge-action", "drag-column");
|
|
2290
|
-
const
|
|
2291
|
-
if (
|
|
2292
|
-
for (const C in
|
|
2293
|
-
this.dom.setStyle(y, C,
|
|
2294
|
-
return [y,
|
|
2324
|
+
const H = e.getCustomStyleAt(o, i);
|
|
2325
|
+
if (H)
|
|
2326
|
+
for (const C in H)
|
|
2327
|
+
this.dom.setStyle(y, C, H[C]);
|
|
2328
|
+
return [y, E];
|
|
2295
2329
|
}
|
|
2296
2330
|
/**
|
|
2297
2331
|
* Applies CSS classes to an HTML element.
|
|
@@ -2457,7 +2491,7 @@ class xe extends Se {
|
|
|
2457
2491
|
if (r) {
|
|
2458
2492
|
const l = e.index ?? 0, a = this.draggingColumn;
|
|
2459
2493
|
for (let n = 0; n < r; n++) {
|
|
2460
|
-
const c = s, h = i.getRowHeight(n), d = { left: 0, width: e.width, height: h, top: c, index: n },
|
|
2494
|
+
const c = s, h = i.getRowHeight(n), d = { left: 0, width: e.width, height: h, top: c, index: n }, m = i.getValueAt(n, l), g = i.getCellRenderer(n, l), b = g ? "" : `${m}`, f = {
|
|
2461
2495
|
parent: a,
|
|
2462
2496
|
geo: d,
|
|
2463
2497
|
rowIndex: n,
|
|
@@ -2465,17 +2499,17 @@ class xe extends Se {
|
|
|
2465
2499
|
areaIdent: t,
|
|
2466
2500
|
sideIdent: o,
|
|
2467
2501
|
text: b
|
|
2468
|
-
},
|
|
2502
|
+
}, u = this.dom.addColumnDiv(f);
|
|
2469
2503
|
let w;
|
|
2470
|
-
g && (w = g.render(
|
|
2504
|
+
g && (w = g.render(u, n, l, t, i, m, this.dom.domService), w && this.cleanupFunctions[t].push(w));
|
|
2471
2505
|
const S = i.getCustomClassesAt(n, l);
|
|
2472
|
-
S.length && this.dom.addClasses(S,
|
|
2506
|
+
S.length && this.dom.addClasses(S, u);
|
|
2473
2507
|
const v = this.tableModel.getColumnDef(l);
|
|
2474
|
-
v && v.classes[t] && this.dom.addClasses(v.classes[t],
|
|
2508
|
+
v && v.classes[t] && this.dom.addClasses(v.classes[t], u), this.dom.addColumnBorderDivs(this.tableOptions, a, d, t, o);
|
|
2475
2509
|
const x = i.getCustomStyleAt(n, l);
|
|
2476
2510
|
if (x)
|
|
2477
2511
|
for (const y in x)
|
|
2478
|
-
this.dom.setStyle(
|
|
2512
|
+
this.dom.setStyle(u, y, x[y]);
|
|
2479
2513
|
s = s + h;
|
|
2480
2514
|
}
|
|
2481
2515
|
}
|
|
@@ -2528,9 +2562,9 @@ class xe extends Se {
|
|
|
2528
2562
|
renderSelectedBackgroundDiv(e, t, s, o, i, r, l, a, n, c, h) {
|
|
2529
2563
|
let d = !1;
|
|
2530
2564
|
if (!e && t && o.isSelectable(i, r) && this.getSelectionModel) {
|
|
2531
|
-
const
|
|
2532
|
-
if (
|
|
2533
|
-
const g =
|
|
2565
|
+
const m = this.getSelectionModel();
|
|
2566
|
+
if (m) {
|
|
2567
|
+
const g = m.getSelectionCount(i, r);
|
|
2534
2568
|
d = g > 0;
|
|
2535
2569
|
for (let b = 0; b < g; b++) {
|
|
2536
2570
|
const f = this.dom.applyStylePosistionAbsolute(
|
|
@@ -2576,7 +2610,7 @@ class xe extends Se {
|
|
|
2576
2610
|
cellSelected: h,
|
|
2577
2611
|
lastRowOfModel: d
|
|
2578
2612
|
}) {
|
|
2579
|
-
const [
|
|
2613
|
+
const [m, g] = this.addAndRenderCellDiv({
|
|
2580
2614
|
areaModel: e,
|
|
2581
2615
|
areaIdent: t,
|
|
2582
2616
|
sideIdent: s,
|
|
@@ -2589,7 +2623,7 @@ class xe extends Se {
|
|
|
2589
2623
|
parent: c,
|
|
2590
2624
|
lastRowOfModel: d
|
|
2591
2625
|
});
|
|
2592
|
-
h && this.dom.addClass(`ge-table-${t}-${s}-selected-range`,
|
|
2626
|
+
h && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, m), g && this.cleanupFunctions[t].push(g);
|
|
2593
2627
|
}
|
|
2594
2628
|
/**
|
|
2595
2629
|
* Render the header cell resize handle.
|
|
@@ -2637,7 +2671,7 @@ class ve {
|
|
|
2637
2671
|
}
|
|
2638
2672
|
}
|
|
2639
2673
|
}
|
|
2640
|
-
class
|
|
2674
|
+
class Re {
|
|
2641
2675
|
constructor(e = -1, t = -1) {
|
|
2642
2676
|
this.rowIndex = e, this.columnIndex = t;
|
|
2643
2677
|
}
|
|
@@ -2647,10 +2681,10 @@ class G {
|
|
|
2647
2681
|
this.cells = e;
|
|
2648
2682
|
}
|
|
2649
2683
|
static createSingle(e, t) {
|
|
2650
|
-
return new G([new
|
|
2684
|
+
return new G([new Re(e, t)]);
|
|
2651
2685
|
}
|
|
2652
2686
|
}
|
|
2653
|
-
class
|
|
2687
|
+
class Ae {
|
|
2654
2688
|
constructor(e) {
|
|
2655
2689
|
var t, s;
|
|
2656
2690
|
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (s = this.tableScope.tableOptions) != null && s.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
|
|
@@ -2659,8 +2693,8 @@ class Ee {
|
|
|
2659
2693
|
var i, r, l, a, n, c, h;
|
|
2660
2694
|
let s = !1, o = !1;
|
|
2661
2695
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
2662
|
-
const d = this.getSelectionModel(),
|
|
2663
|
-
d &&
|
|
2696
|
+
const d = this.getSelectionModel(), m = this.getFocusModel();
|
|
2697
|
+
d && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(m), s = !0), (i = e.originalEvent) != null && i.shiftKey || d.hasSelection() && (d.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (d.addSelection(this.createRangeByEvents(e, this.previousEvt)), o = !0, s = !0) : (l = e.originalEvent) != null && l.altKey && ((a = e.originalEvent) != null && a.ctrlKey || (n = e.originalEvent) != null && n.metaKey) ? (d.removeSelection(R.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (c = e.originalEvent) != null && c.ctrlKey || (h = e.originalEvent) != null && h.metaKey ? (d.addSelection(R.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (d.firstClick(e.rowIndex, e.columnIndex), s = !0), this.tableScope.onSelectionChanged(d));
|
|
2664
2698
|
}
|
|
2665
2699
|
return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
2666
2700
|
}
|
|
@@ -2683,7 +2717,7 @@ class Ee {
|
|
|
2683
2717
|
createRangeByEvents(e, t) {
|
|
2684
2718
|
t || (t = e);
|
|
2685
2719
|
const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
2686
|
-
return
|
|
2720
|
+
return R.create({
|
|
2687
2721
|
rowIndex1: s,
|
|
2688
2722
|
columnIndex1: i,
|
|
2689
2723
|
rowIndex2: o,
|
|
@@ -2691,7 +2725,7 @@ class Ee {
|
|
|
2691
2725
|
});
|
|
2692
2726
|
}
|
|
2693
2727
|
}
|
|
2694
|
-
class
|
|
2728
|
+
class Ee {
|
|
2695
2729
|
get() {
|
|
2696
2730
|
return {
|
|
2697
2731
|
f2: "START_EDITING",
|
|
@@ -2749,7 +2783,7 @@ function X(p) {
|
|
|
2749
2783
|
let t = "";
|
|
2750
2784
|
return p.ctrlKey && (t += " ctrl"), p.altKey && (t += t + " alt"), p.shiftKey && (t += t + " shift"), p.metaKey && (t += t + " cmd"), Te(t + " " + e);
|
|
2751
2785
|
}
|
|
2752
|
-
class
|
|
2786
|
+
class Fe {
|
|
2753
2787
|
constructor(e) {
|
|
2754
2788
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
2755
2789
|
}
|
|
@@ -2771,7 +2805,7 @@ class De {
|
|
|
2771
2805
|
(t = (e = this.tableScope) == null ? void 0 : e.tableOptions) != null && t.shortcutActionsDisabled ? this.isDebug() && console.debug("ShortcutService skipped.") : (this.assignPredefinedSystemShortcutMappings(), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this)));
|
|
2772
2806
|
}
|
|
2773
2807
|
assignPredefinedSystemShortcutMappings() {
|
|
2774
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Me().get()) : Object.assign(this.shortcutActionIdMapping, new
|
|
2808
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Me().get()) : Object.assign(this.shortcutActionIdMapping, new Ee().get());
|
|
2775
2809
|
}
|
|
2776
2810
|
isMacintosh() {
|
|
2777
2811
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2891,7 +2925,7 @@ class ee {
|
|
|
2891
2925
|
e.setAttribute(t, s);
|
|
2892
2926
|
}
|
|
2893
2927
|
}
|
|
2894
|
-
class
|
|
2928
|
+
class De {
|
|
2895
2929
|
render(e, t, s, o, i, r, l) {
|
|
2896
2930
|
if (i.isEditable(t, s)) {
|
|
2897
2931
|
l.addClass(e, "ge-table-row-input-div");
|
|
@@ -2912,7 +2946,7 @@ class Fe {
|
|
|
2912
2946
|
}
|
|
2913
2947
|
}
|
|
2914
2948
|
}
|
|
2915
|
-
class
|
|
2949
|
+
class Ie {
|
|
2916
2950
|
constructor(e = "none", t = "single") {
|
|
2917
2951
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
|
|
2918
2952
|
}
|
|
@@ -2931,7 +2965,7 @@ class ke {
|
|
|
2931
2965
|
this.silent || this.listenerArr.forEach((e) => e.onSelectionChanged(this));
|
|
2932
2966
|
}
|
|
2933
2967
|
firstClick(e, t) {
|
|
2934
|
-
this.selectionType === "row" ? this.addRange(
|
|
2968
|
+
this.selectionType === "row" ? this.addRange(R.singleRow(e)) : this.selectionType === "column" && this.addRange(R.singleColumn(t));
|
|
2935
2969
|
}
|
|
2936
2970
|
getSelectionCount(e, t) {
|
|
2937
2971
|
let s = 0;
|
|
@@ -2982,10 +3016,10 @@ class ke {
|
|
|
2982
3016
|
if (this.selectionType === "none")
|
|
2983
3017
|
return;
|
|
2984
3018
|
let t = e;
|
|
2985
|
-
this.selectionType === "row" ? t =
|
|
3019
|
+
this.selectionType === "row" ? t = R.singleRow(e.r1) : this.selectionType === "column" && (t = R.singleColumn(e.c1)), this.negativeRanges.push(t), this.fireChangeEvent();
|
|
2986
3020
|
}
|
|
2987
3021
|
togglePoint(e, t) {
|
|
2988
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(
|
|
3022
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(R.singleCell(e, t)) : this.addSelection(R.singleCell(e, t));
|
|
2989
3023
|
}
|
|
2990
3024
|
isSelected(e, t) {
|
|
2991
3025
|
return this.getSelectionCount(e, t) > 0;
|
|
@@ -2994,7 +3028,7 @@ class ke {
|
|
|
2994
3028
|
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), this.fireChangeEvent());
|
|
2995
3029
|
}
|
|
2996
3030
|
}
|
|
2997
|
-
class
|
|
3031
|
+
class ke {
|
|
2998
3032
|
constructor(e = "none") {
|
|
2999
3033
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1, this.listenerArr = [];
|
|
3000
3034
|
}
|
|
@@ -3032,11 +3066,11 @@ class Ie {
|
|
|
3032
3066
|
}
|
|
3033
3067
|
}
|
|
3034
3068
|
class te {
|
|
3035
|
-
constructor(e = new
|
|
3069
|
+
constructor(e = new F(
|
|
3036
3070
|
"❯",
|
|
3037
3071
|
"",
|
|
3038
3072
|
["gt-table-icon-expanded"]
|
|
3039
|
-
), t = new
|
|
3073
|
+
), t = new F(
|
|
3040
3074
|
"❯",
|
|
3041
3075
|
"transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",
|
|
3042
3076
|
["ge-table-icon-collapsed"]
|
|
@@ -3045,17 +3079,17 @@ class te {
|
|
|
3045
3079
|
}
|
|
3046
3080
|
// `⊖ `, `⊕ `;
|
|
3047
3081
|
}
|
|
3048
|
-
const
|
|
3082
|
+
const Le = new Ie(), Oe = new ke("cell");
|
|
3049
3083
|
class se {
|
|
3050
3084
|
constructor() {
|
|
3051
3085
|
this.overflowX = "auto", this.overflowY = "auto", this.horizontalBorderVisible = !0, this.verticalBorderVisible = !0, this.footerSeparatorBorderVisible = !0, this.headerSeparatorBorderVisible = !0, this.fixedEastSeparatorBorderVisible = !0, this.fixedWestSeparatorBorderVisible = !0, this.tableTopBorderVisible = !0, this.tableBottomBorderVisible = !0, this.hoverRowVisible = !0, this.hoverColumnVisible = !0, this.columnsResizable = !0, this.columnsDraggable = !0, this.columnResizeHandleWidthInPx = 4, this.defaultRowHeights = {
|
|
3052
3086
|
header: 34,
|
|
3053
3087
|
body: 34,
|
|
3054
3088
|
footer: 34
|
|
3055
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new Z(), this.headerGroupOptions = new te(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Q(), this.sortOrder = ["asc", "desc"], this.shortcutActionsDisabled = !1, this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new
|
|
3089
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new Z(), this.headerGroupOptions = new te(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Q(), this.sortOrder = ["asc", "desc"], this.shortcutActionsDisabled = !1, this.resizeEventDebounceDelay = 500, this.getEditRenderer = (e, t) => new De(), this.getSelectionModel = () => Le, this.getFocusModel = () => Oe;
|
|
3056
3090
|
}
|
|
3057
3091
|
}
|
|
3058
|
-
const
|
|
3092
|
+
const L = class L {
|
|
3059
3093
|
/**
|
|
3060
3094
|
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
3061
3095
|
*
|
|
@@ -3078,9 +3112,9 @@ const O = class O {
|
|
|
3078
3112
|
const h = t.isSelected(a, c) ? e.getBodyModel().getTextValueAt(a, c) : "";
|
|
3079
3113
|
n.push(h);
|
|
3080
3114
|
}
|
|
3081
|
-
l.push(n.join(
|
|
3115
|
+
l.push(n.join(L.columnSeparatorChar));
|
|
3082
3116
|
}
|
|
3083
|
-
return o(l.join(
|
|
3117
|
+
return o(l.join(L.rowSeparatorChar));
|
|
3084
3118
|
}
|
|
3085
3119
|
}
|
|
3086
3120
|
if (s) {
|
|
@@ -3133,13 +3167,13 @@ const O = class O {
|
|
|
3133
3167
|
mergeRanges(e) {
|
|
3134
3168
|
let t;
|
|
3135
3169
|
for (const s of e)
|
|
3136
|
-
t ? (t.r1 = Math.min(t.r1, s.r1), t.c1 = Math.min(t.c1, s.c1), t.r2 = Math.max(t.r2, s.r2), t.c2 = Math.max(t.c2, s.c2)) : t = new
|
|
3170
|
+
t ? (t.r1 = Math.min(t.r1, s.r1), t.c1 = Math.min(t.c1, s.c1), t.r2 = Math.max(t.r2, s.r2), t.c2 = Math.max(t.c2, s.c2)) : t = new R(s.r1, s.c1, s.r2, s.c2);
|
|
3137
3171
|
return t;
|
|
3138
3172
|
}
|
|
3139
3173
|
};
|
|
3140
|
-
|
|
3174
|
+
L.columnSeparatorChar = " ", L.rowSeparatorChar = `
|
|
3141
3175
|
`;
|
|
3142
|
-
let P =
|
|
3176
|
+
let P = L;
|
|
3143
3177
|
class Be {
|
|
3144
3178
|
constructor(e, t = 500) {
|
|
3145
3179
|
this.tableScope = e, this.debounceDelay = t, new ResizeObserver(le(this.handleResize.bind(this), t)).observe(this.tableScope.hostElement);
|
|
@@ -3230,8 +3264,8 @@ class Pe {
|
|
|
3230
3264
|
let s = 0;
|
|
3231
3265
|
const o = [];
|
|
3232
3266
|
e.forEach((h, d) => {
|
|
3233
|
-
const
|
|
3234
|
-
b.set([80, 75, 3, 4], 0), f.setUint16(4, 20, !0), f.setUint16(6, 0, !0), f.setUint16(8, 0, !0), f.setUint16(10, 0, !0), f.setUint16(12, 0, !0), f.setUint32(14, 0, !0), f.setUint32(18, g.length, !0), f.setUint32(22, g.length, !0), f.setUint16(26,
|
|
3267
|
+
const m = new TextEncoder().encode(d), g = new TextEncoder().encode(h), b = new Uint8Array(30 + m.length), f = new DataView(b.buffer);
|
|
3268
|
+
b.set([80, 75, 3, 4], 0), f.setUint16(4, 20, !0), f.setUint16(6, 0, !0), f.setUint16(8, 0, !0), f.setUint16(10, 0, !0), f.setUint16(12, 0, !0), f.setUint32(14, 0, !0), f.setUint32(18, g.length, !0), f.setUint32(22, g.length, !0), f.setUint16(26, m.length, !0), f.setUint16(28, 0, !0), b.set(m, 30), t.push(b, g), o.push({
|
|
3235
3269
|
path: d,
|
|
3236
3270
|
offset: s,
|
|
3237
3271
|
contentSize: g.length
|
|
@@ -3239,8 +3273,8 @@ class Pe {
|
|
|
3239
3273
|
});
|
|
3240
3274
|
const i = s;
|
|
3241
3275
|
o.forEach((h) => {
|
|
3242
|
-
const d = new TextEncoder().encode(h.path),
|
|
3243
|
-
|
|
3276
|
+
const d = new TextEncoder().encode(h.path), m = new Uint8Array(46 + d.length), g = new DataView(m.buffer);
|
|
3277
|
+
m.set([80, 75, 1, 2], 0), g.setUint16(4, 20, !0), g.setUint16(6, 20, !0), g.setUint16(8, 0, !0), g.setUint16(10, 0, !0), g.setUint16(12, 0, !0), g.setUint16(14, 0, !0), g.setUint32(16, 0, !0), g.setUint32(20, h.contentSize, !0), g.setUint32(24, h.contentSize, !0), g.setUint16(28, d.length, !0), g.setUint16(30, 0, !0), g.setUint16(32, 0, !0), g.setUint16(34, 0, !0), g.setUint16(36, 0, !0), g.setUint32(38, 0, !0), g.setUint32(42, h.offset, !0), m.set(d, 46), t.push(m), s += m.length;
|
|
3244
3278
|
});
|
|
3245
3279
|
const r = new Uint8Array(22), l = new DataView(r.buffer);
|
|
3246
3280
|
r.set([80, 75, 5, 6], 0), l.setUint16(4, 0, !0), l.setUint16(6, 0, !0), l.setUint16(8, o.length, !0), l.setUint16(10, o.length, !0), l.setUint32(12, s - i, !0), l.setUint32(16, i, !0), l.setUint16(20, 0, !0), t.push(r);
|
|
@@ -3258,11 +3292,11 @@ class Pe {
|
|
|
3258
3292
|
class U extends xe {
|
|
3259
3293
|
constructor(e, t, s, o, i, r = new P(), l = new Pe()) {
|
|
3260
3294
|
var c;
|
|
3261
|
-
if (super(e, t, new ne(s), o), this.eventListener = i, this.copyService = r, this.excelService = l, this.licenseManager =
|
|
3295
|
+
if (super(e, t, new ne(s), o), this.eventListener = i, this.copyService = r, this.excelService = l, this.licenseManager = I.getInstance(), this.selectionService = new Ae(this), this.api = new ge(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.lastDragFrom = -1, this.lastDragTo = -1, this.firstDraggingRendering = !0, this.lastContextmenu = Date.now(), t.setTableScope(this), i || (this.eventListener = new K()), (c = this.tableOptions) != null && c.autoRestoreOptions) {
|
|
3262
3296
|
const h = this.tableOptions.autoRestoreOptions, d = h.getStorageKeyFn;
|
|
3263
3297
|
d && (h.autoRestoreScrollPosition && (this.storeScrollPosStateService = new fe(d)), h.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new me(d)), h.autoRestoreSortingState && (this.storeSortingService = new be(d)));
|
|
3264
3298
|
}
|
|
3265
|
-
this.mouseHandler = new de(this), this.inputHandler = new ve(this), this.resizeHandler = new Be(this, o.resizeEventDebounceDelay), this.shortcutService = new
|
|
3299
|
+
this.mouseHandler = new de(this), this.inputHandler = new ve(this), this.resizeHandler = new Be(this, o.resizeEventDebounceDelay), this.shortcutService = new Fe(this), this.shortcutService.addListener(this.selectionService);
|
|
3266
3300
|
const a = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
3267
3301
|
a && a.addEventSelectionChangedListener(this);
|
|
3268
3302
|
const n = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
@@ -3414,7 +3448,7 @@ class U extends xe {
|
|
|
3414
3448
|
toggleExpandCollapseAll(e = !0) {
|
|
3415
3449
|
var s;
|
|
3416
3450
|
const t = this.tableModel.getBodyModel();
|
|
3417
|
-
|
|
3451
|
+
$(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
3418
3452
|
}
|
|
3419
3453
|
/**
|
|
3420
3454
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -3630,7 +3664,7 @@ class U extends xe {
|
|
|
3630
3664
|
const s = this.tableOptions.autoRestoreOptions, o = s.getRowId;
|
|
3631
3665
|
if (s.autoRestoreCollapsedExpandedState && o) {
|
|
3632
3666
|
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
3633
|
-
if (
|
|
3667
|
+
if ($(r)) {
|
|
3634
3668
|
const l = r, a = r.getRowCount();
|
|
3635
3669
|
for (let n = 0; n < a; n++) {
|
|
3636
3670
|
const c = r.getRowByIndex(n);
|
|
@@ -3683,9 +3717,6 @@ class U extends xe {
|
|
|
3683
3717
|
sort(e) {
|
|
3684
3718
|
this.tableModel.sort(e);
|
|
3685
3719
|
}
|
|
3686
|
-
getDisplayedRowCount() {
|
|
3687
|
-
return this.displayedRowCount;
|
|
3688
|
-
}
|
|
3689
3720
|
/**
|
|
3690
3721
|
* Ensures that a specific row is visible in the viewport by scrolling if necessary.
|
|
3691
3722
|
* This method checks if the target row is within the currently visible range and
|
|
@@ -3738,16 +3769,13 @@ class U extends xe {
|
|
|
3738
3769
|
* @see {@link getDisplayedRowCount} - Related method for getting visible row count
|
|
3739
3770
|
*/
|
|
3740
3771
|
ensureRowIsVisible(e) {
|
|
3741
|
-
const t = this.
|
|
3742
|
-
return e < t ? (this.scrollToIndex(0, e
|
|
3743
|
-
}
|
|
3744
|
-
getFirstVisibleRowIndex() {
|
|
3745
|
-
return this.firstVisibleRowIndex;
|
|
3772
|
+
const t = this.getFirstFullVisibleRowIndex(), s = this.getLastFullVisibleRowIndex(), o = this.getDisplayedRowCount();
|
|
3773
|
+
return e < t ? (this.scrollToIndex(0, e), !0) : e > s ? (this.scrollToIndex(0, e - o + 1), !0) : !1;
|
|
3746
3774
|
}
|
|
3747
3775
|
}
|
|
3748
|
-
const
|
|
3776
|
+
const V = class V {
|
|
3749
3777
|
};
|
|
3750
|
-
|
|
3778
|
+
V.themes = ["light", "combat", "paper", "blackboard"], V.vars = {
|
|
3751
3779
|
light: `html[data-theme="light"] {
|
|
3752
3780
|
--ge-table-bg: rgba(255,255,255, 0.5);
|
|
3753
3781
|
--ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
|
|
@@ -3981,15 +4009,15 @@ W.themes = ["light", "combat", "paper", "blackboard"], W.vars = {
|
|
|
3981
4009
|
--ge-table-drop-zone-bg: #758129;
|
|
3982
4010
|
}`
|
|
3983
4011
|
};
|
|
3984
|
-
let Y =
|
|
3985
|
-
const
|
|
4012
|
+
let Y = V;
|
|
4013
|
+
const W = class W {
|
|
3986
4014
|
constructor(e = new te()) {
|
|
3987
4015
|
this.headerGroupOptions = e;
|
|
3988
4016
|
}
|
|
3989
4017
|
render(e, t, s, o, i, r, l) {
|
|
3990
4018
|
const a = r != null && r.data ? r.data : "";
|
|
3991
4019
|
if (r) {
|
|
3992
|
-
const { toggle: n, visibility: c, closed: h } = r, d = n ?
|
|
4020
|
+
const { toggle: n, visibility: c, closed: h } = r, d = n ? W.toggleHeaderGroup : "";
|
|
3993
4021
|
this.addText(e, o, t, s, a, d), n && c !== "always" && this.addArrowDiv(l, e, !h, t, s, o, d);
|
|
3994
4022
|
} else
|
|
3995
4023
|
this.addText(e, o, t, s, a, "");
|
|
@@ -4021,8 +4049,8 @@ const H = class H {
|
|
|
4021
4049
|
}
|
|
4022
4050
|
}
|
|
4023
4051
|
};
|
|
4024
|
-
|
|
4025
|
-
let q =
|
|
4052
|
+
W.toggleHeaderGroup = "toggleHeaderGroup";
|
|
4053
|
+
let q = W;
|
|
4026
4054
|
function Ne({
|
|
4027
4055
|
tableModel: p,
|
|
4028
4056
|
tableOptions: e = new se(),
|
|
@@ -4038,13 +4066,13 @@ function Ne({
|
|
|
4038
4066
|
tableReady: h,
|
|
4039
4067
|
licenseKey: d
|
|
4040
4068
|
}) {
|
|
4041
|
-
const
|
|
4069
|
+
const m = ie(null);
|
|
4042
4070
|
let g = !1;
|
|
4043
4071
|
re(() => {
|
|
4044
|
-
|
|
4072
|
+
m.current && !g && (b(m.current), g = !0);
|
|
4045
4073
|
});
|
|
4046
4074
|
const b = (f) => {
|
|
4047
|
-
const
|
|
4075
|
+
const u = {
|
|
4048
4076
|
onSelectionChanged(S) {
|
|
4049
4077
|
n && n(S);
|
|
4050
4078
|
},
|
|
@@ -4077,14 +4105,14 @@ function Ne({
|
|
|
4077
4105
|
p,
|
|
4078
4106
|
new ee(),
|
|
4079
4107
|
e,
|
|
4080
|
-
|
|
4108
|
+
u
|
|
4081
4109
|
);
|
|
4082
|
-
w.firstInit(), h && h(w.getApi()), d &&
|
|
4110
|
+
w.firstInit(), h && h(w.getApi()), d && I.getInstance().setLicenseKey(d);
|
|
4083
4111
|
};
|
|
4084
4112
|
return /* @__PURE__ */ oe(
|
|
4085
4113
|
"div",
|
|
4086
4114
|
{
|
|
4087
|
-
ref:
|
|
4115
|
+
ref: m,
|
|
4088
4116
|
className: "container-div",
|
|
4089
4117
|
style: {
|
|
4090
4118
|
width: "100%",
|
|
@@ -4096,23 +4124,23 @@ function Ne({
|
|
|
4096
4124
|
}
|
|
4097
4125
|
);
|
|
4098
4126
|
}
|
|
4099
|
-
var
|
|
4100
|
-
function
|
|
4101
|
-
if (J) return
|
|
4127
|
+
var k = {}, J;
|
|
4128
|
+
function Ve() {
|
|
4129
|
+
if (J) return k;
|
|
4102
4130
|
J = 1;
|
|
4103
4131
|
var p = ae;
|
|
4104
4132
|
if (process.env.NODE_ENV === "production")
|
|
4105
|
-
|
|
4133
|
+
k.createRoot = p.createRoot, k.hydrateRoot = p.hydrateRoot;
|
|
4106
4134
|
else {
|
|
4107
4135
|
var e = p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
4108
|
-
|
|
4136
|
+
k.createRoot = function(t, s) {
|
|
4109
4137
|
e.usingClientEntryPoint = !0;
|
|
4110
4138
|
try {
|
|
4111
4139
|
return p.createRoot(t, s);
|
|
4112
4140
|
} finally {
|
|
4113
4141
|
e.usingClientEntryPoint = !1;
|
|
4114
4142
|
}
|
|
4115
|
-
},
|
|
4143
|
+
}, k.hydrateRoot = function(t, s, o) {
|
|
4116
4144
|
e.usingClientEntryPoint = !0;
|
|
4117
4145
|
try {
|
|
4118
4146
|
return p.hydrateRoot(t, s, o);
|
|
@@ -4121,9 +4149,9 @@ function We() {
|
|
|
4121
4149
|
}
|
|
4122
4150
|
};
|
|
4123
4151
|
}
|
|
4124
|
-
return
|
|
4152
|
+
return k;
|
|
4125
4153
|
}
|
|
4126
|
-
var
|
|
4154
|
+
var We = Ve();
|
|
4127
4155
|
class ze {
|
|
4128
4156
|
constructor(e) {
|
|
4129
4157
|
this.Component = e, console.info(e);
|
|
@@ -4136,7 +4164,7 @@ class ze {
|
|
|
4136
4164
|
areaIdent: o,
|
|
4137
4165
|
areaModel: i,
|
|
4138
4166
|
cellValue: r
|
|
4139
|
-
}, n =
|
|
4167
|
+
}, n = We.createRoot(e, {});
|
|
4140
4168
|
return n.render(this.Component(a)), () => {
|
|
4141
4169
|
n.unmount();
|
|
4142
4170
|
};
|