@guiexpert/react-table 18.0.10 → 18.0.12
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 +12 -12
- package/index.js +551 -520
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsx as se } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as oe, useEffect as ie } from "react";
|
|
3
3
|
import re from "react-dom";
|
|
4
|
+
function le(g, e = 500) {
|
|
5
|
+
let t = null;
|
|
6
|
+
return function(...s) {
|
|
7
|
+
t && window.clearTimeout(t), t = window.setTimeout(() => {
|
|
8
|
+
g.apply(this, s), t = null;
|
|
9
|
+
}, e);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
4
12
|
class k {
|
|
5
13
|
// The constructor is private to prevent direct construction calls
|
|
6
14
|
// with the `new` operator
|
|
@@ -26,18 +34,18 @@ class k {
|
|
|
26
34
|
}
|
|
27
35
|
}
|
|
28
36
|
}
|
|
29
|
-
function
|
|
30
|
-
return
|
|
37
|
+
function H(g) {
|
|
38
|
+
return g && g.type === "TreeRow";
|
|
31
39
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
40
|
+
function P(g) {
|
|
41
|
+
return g && g.type === "AreaModelTree";
|
|
34
42
|
}
|
|
35
|
-
class
|
|
36
|
-
constructor(e = -1, t = -1,
|
|
37
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex =
|
|
43
|
+
class z {
|
|
44
|
+
constructor(e = -1, t = -1, s = -1, o = -1, i, r, a, l = 0, n = 0, d = 0, h = "") {
|
|
45
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = o, this.areaIdent = i, this.sideIdent = r, this.originalEvent = a, this.clickCount = l, this.draggingX = n, this.draggingY = d, this.action = h;
|
|
38
46
|
}
|
|
39
47
|
clone() {
|
|
40
|
-
return new
|
|
48
|
+
return new z(
|
|
41
49
|
this.rowIndex,
|
|
42
50
|
this.rowTop,
|
|
43
51
|
this.columnIndex,
|
|
@@ -53,8 +61,8 @@ class _ {
|
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
class D {
|
|
56
|
-
constructor(e = ">", t = "",
|
|
57
|
-
this.content = e, this.style = t, this.classes =
|
|
64
|
+
constructor(e = ">", t = "", s = []) {
|
|
65
|
+
this.content = e, this.style = t, this.classes = s;
|
|
58
66
|
}
|
|
59
67
|
}
|
|
60
68
|
class J {
|
|
@@ -66,33 +74,33 @@ class J {
|
|
|
66
74
|
">",
|
|
67
75
|
"",
|
|
68
76
|
["ge-table-tree-arrow-collapsed"]
|
|
69
|
-
),
|
|
77
|
+
), s = new D(
|
|
70
78
|
">",
|
|
71
79
|
"color:transparent;",
|
|
72
80
|
["gt-table-tree-arrow-hidden"]
|
|
73
|
-
),
|
|
81
|
+
), o = new D(
|
|
74
82
|
"↕",
|
|
75
83
|
"",
|
|
76
84
|
["gt-table-tree-arrow-expanded-all"]
|
|
77
85
|
)) {
|
|
78
|
-
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder =
|
|
86
|
+
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = o;
|
|
79
87
|
}
|
|
80
88
|
}
|
|
81
89
|
class Q {
|
|
82
|
-
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]),
|
|
83
|
-
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder =
|
|
90
|
+
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), s = new D("↑", "color:transparent;", [])) {
|
|
91
|
+
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
84
92
|
}
|
|
85
93
|
}
|
|
86
|
-
class
|
|
94
|
+
class ae {
|
|
87
95
|
constructor(e) {
|
|
88
96
|
this.domService = e;
|
|
89
97
|
}
|
|
90
|
-
setStyle(e, t,
|
|
91
|
-
return this.domService.setStyle(e, t,
|
|
98
|
+
setStyle(e, t, s) {
|
|
99
|
+
return this.domService.setStyle(e, t, s), e;
|
|
92
100
|
}
|
|
93
101
|
applyStyle(e, t) {
|
|
94
|
-
for (const
|
|
95
|
-
this.domService.setStyle(e,
|
|
102
|
+
for (const s in t)
|
|
103
|
+
this.domService.setStyle(e, s, t[s]);
|
|
96
104
|
return e;
|
|
97
105
|
}
|
|
98
106
|
applyDisplayNoneStyle(e) {
|
|
@@ -102,7 +110,7 @@ class le {
|
|
|
102
110
|
return this.domService.setStyle(e, "display", "block"), e;
|
|
103
111
|
}
|
|
104
112
|
applyStyleInPx(e, t) {
|
|
105
|
-
return Object.entries(t).forEach(([
|
|
113
|
+
return Object.entries(t).forEach(([s, o]) => this.domService.setStyle(e, s, o + "px")), e;
|
|
106
114
|
}
|
|
107
115
|
applyStylePosistionRelative(e) {
|
|
108
116
|
return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
|
|
@@ -113,8 +121,8 @@ class le {
|
|
|
113
121
|
applyStyleFullSize(e) {
|
|
114
122
|
return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
|
|
115
123
|
}
|
|
116
|
-
applyStyleOverflowAuto(e = "auto", t = "auto",
|
|
117
|
-
return this.domService.setStyle(
|
|
124
|
+
applyStyleOverflowAuto(e = "auto", t = "auto", s) {
|
|
125
|
+
return this.domService.setStyle(s, "overflow-x", e), this.domService.setStyle(s, "overflow-y", t), s;
|
|
118
126
|
}
|
|
119
127
|
applyStyleNoPadding(e) {
|
|
120
128
|
return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
|
|
@@ -130,155 +138,155 @@ class le {
|
|
|
130
138
|
return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
|
|
131
139
|
}
|
|
132
140
|
appendText(e, t) {
|
|
133
|
-
const
|
|
134
|
-
return this.domService.appendChild(e,
|
|
141
|
+
const s = this.domService.createText(t);
|
|
142
|
+
return this.domService.appendChild(e, s), s;
|
|
135
143
|
}
|
|
136
144
|
addClass(e, t) {
|
|
137
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
145
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
|
|
138
146
|
}
|
|
139
147
|
removeClass(e, t) {
|
|
140
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
148
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.removeClass(t, s)) : this.domService.removeClass(t, e), t;
|
|
141
149
|
}
|
|
142
150
|
addClasses(e, t) {
|
|
143
151
|
if (e)
|
|
144
|
-
for (const
|
|
145
|
-
this.domService.addClass(t,
|
|
152
|
+
for (const s of e)
|
|
153
|
+
this.domService.addClass(t, s);
|
|
146
154
|
return t;
|
|
147
155
|
}
|
|
148
|
-
setAttribute(e, t,
|
|
149
|
-
return t &&
|
|
156
|
+
setAttribute(e, t, s) {
|
|
157
|
+
return t && s && this.domService.setAttribute(e, t, s), e;
|
|
150
158
|
}
|
|
151
|
-
createAreaDivWithClass(e, t,
|
|
159
|
+
createAreaDivWithClass(e, t, s, o) {
|
|
152
160
|
const i = this.domService.createElement("div");
|
|
153
|
-
return this.addClass(e, i), this.domService.setAttribute(i, "data-area",
|
|
161
|
+
return this.addClass(e, i), this.domService.setAttribute(i, "data-area", s), this.domService.setAttribute(i, "data-side", o), this.domService.appendChild(t, i), i;
|
|
154
162
|
}
|
|
155
163
|
createDivWithClass(e, t) {
|
|
156
|
-
const
|
|
157
|
-
return this.addClass(e,
|
|
164
|
+
const s = this.domService.createElement("div");
|
|
165
|
+
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
158
166
|
}
|
|
159
|
-
addRowDiv(e, t,
|
|
167
|
+
addRowDiv(e, t, s = -1, o, i, r = "") {
|
|
160
168
|
const a = t.index ?? -1, l = this.getDivOrCreateDiv(a, e);
|
|
161
|
-
if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`),
|
|
169
|
+
if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`), o === "body" && i === "center") {
|
|
162
170
|
const n = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
163
171
|
this.domService.addClass(l, `ge-table-row-${n}`);
|
|
164
172
|
}
|
|
165
|
-
if (this.domService.setStyle(l, "display", "clip"), this.domService.setStyle(l, "position", "absolute"), this.domService.setStyle(l, "left", `${t.left}px`), this.domService.setStyle(l, "top", `${t.top}px`), this.domService.setStyle(l, "width", `${t.width}px`), this.domService.setStyle(l, "height", `${t.height}px`), this.domService.setAttribute(l, "data-row-index", `${
|
|
173
|
+
if (this.domService.setStyle(l, "display", "clip"), this.domService.setStyle(l, "position", "absolute"), this.domService.setStyle(l, "left", `${t.left}px`), this.domService.setStyle(l, "top", `${t.top}px`), this.domService.setStyle(l, "width", `${t.width}px`), this.domService.setStyle(l, "height", `${t.height}px`), this.domService.setAttribute(l, "data-row-index", `${s}`), this.domService.setAttribute(l, "data-area", `${o}`), r) {
|
|
166
174
|
const n = this.domService.createText(r);
|
|
167
175
|
this.domService.appendChild(l, n);
|
|
168
176
|
}
|
|
169
177
|
return this.domService.appendChild(e.child, l), l;
|
|
170
178
|
}
|
|
171
179
|
addColumnDiv(e) {
|
|
172
|
-
const { parent: t, geo:
|
|
173
|
-
this.domService.addClass(S, "ge-table-col-div"), u && this.domService.addClass(S, "ge-with-checkbox"), this.domService.addClass(S, `ge-table-col-div-${
|
|
174
|
-
const b = ((
|
|
175
|
-
if (r === "body" && a === "center" && this.domService.addClass(S, `ge-table-column-${b}`), this.domService.setStyle(S, "display", "clip"), this.domService.setStyle(S, "position", "absolute"), this.domService.setStyle(S, "left", `${
|
|
176
|
-
const
|
|
177
|
-
this.addLabelDiv(S, l,
|
|
180
|
+
const { parent: t, geo: s, rowIndex: o = -1, columnIndex: i = -1, areaIdent: r, sideIdent: a, text: l = "", treeArrow: n, tableOptions: d, checkedType: h = void 0, sortState: c } = e, f = d == null ? void 0 : d.treeOptions, u = d == null ? void 0 : d.showCheckboxWihoutExtraColumn, S = this.domService.createElement("div");
|
|
181
|
+
this.domService.addClass(S, "ge-table-col-div"), u && this.domService.addClass(S, "ge-with-checkbox"), this.domService.addClass(S, `ge-table-col-div-${s.index}`), this.domService.setAttribute(S, "data-col-index", `${s.index}`), this.domService.setAttribute(S, "data-row-index", `${o}`), this.domService.setAttribute(S, "data-area", `${r}`);
|
|
182
|
+
const b = ((s == null ? void 0 : s.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
183
|
+
if (r === "body" && a === "center" && this.domService.addClass(S, `ge-table-column-${b}`), this.domService.setStyle(S, "display", "clip"), this.domService.setStyle(S, "position", "absolute"), this.domService.setStyle(S, "left", `${s.left}px`), this.domService.setStyle(S, "top", `${s.top}px`), this.domService.setStyle(S, "width", `${s.width}px`), this.domService.setStyle(S, "height", `${s.height}px`), n && n !== "none" && (this.domService.addClass(S, "ge-table-col-tree"), this.addArrowDiv(S, n, f, o, i, r)), u && i === 0 && h && this.addCheckboxToDiv(S, h, r, o), l) {
|
|
184
|
+
const p = n !== "none" && i === 0;
|
|
185
|
+
this.addLabelDiv(S, l, p, o, i, r);
|
|
178
186
|
}
|
|
179
187
|
return c && this.addSortedIcon(S, c, d == null ? void 0 : d.sortedOptions, i), this.domService.appendChild(t, S), S;
|
|
180
188
|
}
|
|
181
|
-
addCheckboxToDiv(e, t,
|
|
189
|
+
addCheckboxToDiv(e, t, s, o) {
|
|
182
190
|
const i = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
|
|
183
191
|
return i.innerHTML = `
|
|
184
192
|
<input
|
|
185
193
|
type="checkbox"
|
|
186
|
-
data-area="${
|
|
187
|
-
data-row-index="${
|
|
194
|
+
data-area="${s}"
|
|
195
|
+
data-row-index="${o}"
|
|
188
196
|
data-input-type="checkbox"
|
|
189
197
|
${r}
|
|
190
|
-
class="ge-table-row-checkbox"> `, this.domService.setStyle(i, "display", "inline"), this.domService.setStyle(i, "width", "inherit"), this.domService.setAttribute(i, "data-row-index", `${
|
|
198
|
+
class="ge-table-row-checkbox"> `, this.domService.setStyle(i, "display", "inline"), this.domService.setStyle(i, "width", "inherit"), this.domService.setAttribute(i, "data-row-index", `${o}`), this.domService.appendChild(e, i), i;
|
|
191
199
|
}
|
|
192
|
-
addLabelDiv(e, t = "",
|
|
200
|
+
addLabelDiv(e, t = "", s = !1, o = -1, i = -1, r = "body") {
|
|
193
201
|
const a = this.domService.createElement("div");
|
|
194
|
-
if (this.domService.addClass(a, "ge-table-label-div"), this.domService.setStyle(a, "position", "relative"), this.domService.setStyle(a, "background", "transparent"), this.domService.setStyle(a, "width", "100%"), this.domService.setStyle(a, "height", "100%"), this.domService.setAttribute(a, "data-row-index", `${
|
|
195
|
-
if (
|
|
202
|
+
if (this.domService.addClass(a, "ge-table-label-div"), this.domService.setStyle(a, "position", "relative"), this.domService.setStyle(a, "background", "transparent"), this.domService.setStyle(a, "width", "100%"), this.domService.setStyle(a, "height", "100%"), this.domService.setAttribute(a, "data-row-index", `${o}`), this.domService.setAttribute(a, "data-col-index", `${i}`), this.domService.setAttribute(a, "data-area", `${r}`), t)
|
|
203
|
+
if (s) {
|
|
196
204
|
const l = this.domService.createText(t);
|
|
197
205
|
this.domService.appendChild(a, l);
|
|
198
206
|
} else {
|
|
199
207
|
const l = this.domService.createElement("div");
|
|
200
208
|
this.domService.appendChild(a, l);
|
|
201
209
|
const n = this.domService.createText(t);
|
|
202
|
-
this.domService.addClass(l, "ge-table-label"), this.domService.appendChild(l, n), this.domService.setAttribute(l, "data-row-index", `${
|
|
210
|
+
this.domService.addClass(l, "ge-table-label"), this.domService.appendChild(l, n), this.domService.setAttribute(l, "data-row-index", `${o}`), this.domService.setAttribute(l, "data-col-index", `${i}`), this.domService.setAttribute(l, "data-area", `${r}`);
|
|
203
211
|
}
|
|
204
212
|
return this.domService.appendChild(e, a), a;
|
|
205
213
|
}
|
|
206
|
-
addSortedIcon(e, t = "",
|
|
214
|
+
addSortedIcon(e, t = "", s = new Q(), o = -1) {
|
|
207
215
|
const i = this.domService.createElement("div");
|
|
208
|
-
this.domService.addClass(i, "ge-table-sorted-icon-div"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "top", "0"), this.domService.setStyle(i, "right", "0"), this.domService.setStyle(i, "width", "20px"), this.domService.setStyle(i, "background", "transparent"), this.domService.setStyle(i, "cursor", "pointer"), this.domService.setAttribute(i, "data-col-index", `${
|
|
216
|
+
this.domService.addClass(i, "ge-table-sorted-icon-div"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "top", "0"), this.domService.setStyle(i, "right", "0"), this.domService.setStyle(i, "width", "20px"), this.domService.setStyle(i, "background", "transparent"), this.domService.setStyle(i, "cursor", "pointer"), this.domService.setAttribute(i, "data-col-index", `${o}`), this.domService.setAttribute(i, "data-area", "header");
|
|
209
217
|
let r;
|
|
210
|
-
t === "asc" ? r =
|
|
218
|
+
t === "asc" ? r = s.iconAsc : t === "desc" ? r = s.iconDesc : r = s.iconPlaceholder;
|
|
211
219
|
const a = r.content, l = this.domService.createText(a);
|
|
212
220
|
this.domService.appendChild(i, l), r.style && this.applyStyleString(i, r.style);
|
|
213
221
|
for (const n of r.classes)
|
|
214
222
|
this.domService.addClass(i, n);
|
|
215
223
|
return this.domService.appendChild(e, i), i;
|
|
216
224
|
}
|
|
217
|
-
addArrowDiv(e, t = "none",
|
|
225
|
+
addArrowDiv(e, t = "none", s = new J(), o = -1, i = -1, r = "body") {
|
|
218
226
|
const a = this.domService.createElement("div");
|
|
219
|
-
this.domService.addClass(a, "ge-table-tree-arrow-div"), this.domService.setStyle(a, "display", "inline-block"), this.domService.setStyle(a, "position", ""), this.domService.setStyle(a, "width", "20px"), this.domService.setStyle(a, "background", "transparent"), this.domService.setStyle(a, "cursor", "pointer"), this.domService.setAttribute(a, "data-row-index", `${
|
|
227
|
+
this.domService.addClass(a, "ge-table-tree-arrow-div"), this.domService.setStyle(a, "display", "inline-block"), this.domService.setStyle(a, "position", ""), this.domService.setStyle(a, "width", "20px"), this.domService.setStyle(a, "background", "transparent"), this.domService.setStyle(a, "cursor", "pointer"), this.domService.setAttribute(a, "data-row-index", `${o}`), this.domService.setAttribute(a, "data-col-index", `${i}`), this.domService.setAttribute(a, "data-area", `${r}`);
|
|
220
228
|
let l;
|
|
221
|
-
t === "expanded" ? l =
|
|
229
|
+
t === "expanded" ? l = s.arrowExpanded : t === "collapsed" ? l = s.arrowCollapsed : l = s.arrowPlaceholder;
|
|
222
230
|
const n = l.content, d = this.domService.createText(n);
|
|
223
231
|
this.domService.appendChild(a, d), l.style && this.applyStyleString(a, l.style);
|
|
224
232
|
for (const h of l.classes)
|
|
225
233
|
this.domService.addClass(a, h);
|
|
226
234
|
return this.domService.appendChild(e, a), a;
|
|
227
235
|
}
|
|
228
|
-
addColumnBorderDivs(e, t,
|
|
236
|
+
addColumnBorderDivs(e, t, s, o, i) {
|
|
229
237
|
if (e.verticalBorderVisible) {
|
|
230
|
-
const r = `ge-table-${
|
|
231
|
-
this.addVerticalBorder(
|
|
238
|
+
const r = `ge-table-${o}-${i}-vertical-border`;
|
|
239
|
+
this.addVerticalBorder(s, t, r);
|
|
232
240
|
}
|
|
233
241
|
if (e.horizontalBorderVisible) {
|
|
234
|
-
const r = `ge-table-${
|
|
235
|
-
this.addHorizontalBorder(
|
|
242
|
+
const r = `ge-table-${o}-${i}-horizontal-border`;
|
|
243
|
+
this.addHorizontalBorder(s, t, r);
|
|
236
244
|
}
|
|
237
245
|
return t;
|
|
238
246
|
}
|
|
239
|
-
addHorizontalBorder(e, t,
|
|
240
|
-
const
|
|
241
|
-
return this.domService.addClass(
|
|
247
|
+
addHorizontalBorder(e, t, s = "ge-table-body-center-horizontal-border") {
|
|
248
|
+
const o = this.domService.createElement("div");
|
|
249
|
+
return this.domService.addClass(o, s), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${e.left}px`), this.domService.setStyle(o, "top", `${e.top}px`), this.domService.setStyle(o, "width", `${e.width}px`), this.domService.setStyle(o, "height", "1px"), this.domService.appendChild(t, o), o;
|
|
242
250
|
}
|
|
243
|
-
addFocusBorderDivs(e, t,
|
|
251
|
+
addFocusBorderDivs(e, t, s) {
|
|
244
252
|
t = { ...t, width: t.width + 1, height: t.height + 1 };
|
|
245
|
-
let
|
|
246
|
-
return this.domService.addClass(
|
|
253
|
+
let o = this.domService.createElement("div");
|
|
254
|
+
return this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", "1px"), this.domService.setStyle(o, "height", `${t.height}px`), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), o = this.domService.createElement("div"), this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left + t.width - 1}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", "1px"), this.domService.setStyle(o, "height", `${t.height}px`), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), o = this.domService.createElement("div"), this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", `${t.width}px`), this.domService.setStyle(o, "height", "1px"), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), o = this.domService.createElement("div"), this.domService.addClass(o, "ge-table-focus-border"), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top + t.height - 1}px`), this.domService.setStyle(o, "width", `${t.width}px`), this.domService.setStyle(o, "height", "1px"), this.domService.setStyle(o, "z-index", "9999"), this.applyStyle(o, s), this.domService.appendChild(e, o), e;
|
|
247
255
|
}
|
|
248
|
-
addVerticalBorder(e, t,
|
|
249
|
-
const
|
|
250
|
-
return this.domService.addClass(
|
|
256
|
+
addVerticalBorder(e, t, s = "ge-table-body-center-vertical-border") {
|
|
257
|
+
const o = this.domService.createElement("div");
|
|
258
|
+
return this.domService.addClass(o, s), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${e.left}px`), this.domService.setStyle(o, "top", `${e.top}px`), this.domService.setStyle(o, "width", "1px"), this.domService.setStyle(o, "height", `${e.height}px`), this.domService.appendChild(t, o), o;
|
|
251
259
|
}
|
|
252
|
-
addDiv(e, t,
|
|
253
|
-
const
|
|
254
|
-
return
|
|
260
|
+
addDiv(e, t, s = "") {
|
|
261
|
+
const o = this.domService.createElement("div");
|
|
262
|
+
return s && this.domService.addClass(o, s), this.domService.setStyle(o, "display", "clip"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "left", `${t.left}px`), this.domService.setStyle(o, "top", `${t.top}px`), this.domService.setStyle(o, "width", `${t.width}px`), this.domService.setStyle(o, "height", `${t.height}px`), this.domService.appendChild(e, o), o;
|
|
255
263
|
}
|
|
256
264
|
applyStyleString(e, t) {
|
|
257
|
-
const
|
|
258
|
-
for (const
|
|
259
|
-
const [i, r] =
|
|
265
|
+
const s = t.split(";").map((o) => o.trim()).filter((o) => o);
|
|
266
|
+
for (const o of s) {
|
|
267
|
+
const [i, r] = o.split(":");
|
|
260
268
|
this.domService.setStyle(e, i.trim(), r.trim());
|
|
261
269
|
}
|
|
262
270
|
}
|
|
263
271
|
getDivOrCreateDiv(e, t) {
|
|
264
|
-
let
|
|
265
|
-
return
|
|
272
|
+
let s = t.cache[e];
|
|
273
|
+
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
266
274
|
}
|
|
267
275
|
}
|
|
268
|
-
const
|
|
269
|
-
class
|
|
276
|
+
const _ = (g) => g === "header" ? "header" : g === "footer" ? "footer" : "body";
|
|
277
|
+
class ne {
|
|
270
278
|
constructor(e, t) {
|
|
271
279
|
if (this.rowIdx = -1, this.colIdx = -1, this.action = null, this.inputType = null, this.className = "", e !== null && (e instanceof HTMLDivElement || e instanceof HTMLSpanElement || e instanceof HTMLInputElement)) {
|
|
272
280
|
this.className = e.className, this.action = e.getAttribute("data-ge-action"), this.inputType = e.getAttribute("data-input-type"), this.rowIdx = Number(e.getAttribute("data-row-index")), this.colIdx = Number(e.getAttribute("data-col-index"));
|
|
273
|
-
const
|
|
274
|
-
if (
|
|
275
|
-
const
|
|
276
|
-
this.value =
|
|
281
|
+
const s = e.getAttribute("data-area");
|
|
282
|
+
if (s && (this.areaIdent = _(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
283
|
+
const o = e;
|
|
284
|
+
this.value = o.value;
|
|
277
285
|
}
|
|
278
286
|
}
|
|
279
287
|
}
|
|
280
288
|
}
|
|
281
|
-
class
|
|
289
|
+
class de {
|
|
282
290
|
constructor(e) {
|
|
283
291
|
this.tableScope = e, this.doubleClickDelay = 500, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, this.lastClicked = 0, this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this)), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this)), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this)), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this)), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this)), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", this.tableScope.adjustAfterScrolling.bind(this.tableScope)), [window, this.tableScope.hostElement].forEach(
|
|
284
292
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
@@ -308,24 +316,24 @@ class ne {
|
|
|
308
316
|
if (t - this.lastClicked < this.doubleClickDelay)
|
|
309
317
|
return;
|
|
310
318
|
this.lastClicked = t;
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
319
|
+
const s = new ne(e.target, this.tableScope);
|
|
320
|
+
if (s.action === "toggleExpandCollapseAll")
|
|
313
321
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
314
|
-
else if (
|
|
315
|
-
this.tableScope.toggleHeaderGroup(
|
|
316
|
-
else if (
|
|
317
|
-
this.tableScope.toggleRowCheckbox(
|
|
318
|
-
else if (
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
322
|
+
else if (s.action === "toggleHeaderGroup")
|
|
323
|
+
this.tableScope.toggleHeaderGroup(s), e.preventDefault(), e.stopPropagation();
|
|
324
|
+
else if (s.inputType === "checkbox" && s.areaIdent)
|
|
325
|
+
this.tableScope.toggleRowCheckbox(s.rowIdx, s.colIdx, s.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
326
|
+
else if (H(s.row) && s.areaModel) {
|
|
327
|
+
const o = s.colIdx === this.getArrowColumnIndex() && e.altKey, i = s.className.includes("ge-table-tree-arrow-div");
|
|
328
|
+
if (o || i) {
|
|
321
329
|
e.preventDefault(), e.stopPropagation();
|
|
322
|
-
const r =
|
|
323
|
-
r.expanded = !r.expanded, "recalcVisibleTreeRows" in
|
|
330
|
+
const r = s.row;
|
|
331
|
+
r.expanded = !r.expanded, "recalcVisibleTreeRows" in s.areaModel && s.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(r);
|
|
324
332
|
}
|
|
325
333
|
}
|
|
326
|
-
if (
|
|
327
|
-
const
|
|
328
|
-
|
|
334
|
+
if (s.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
335
|
+
const o = this.tableScope.tableOptions.getFocusModel();
|
|
336
|
+
o == null || o.clear(), o == null || o.setFocus(s.rowIdx, s.colIdx);
|
|
329
337
|
}
|
|
330
338
|
this.publishGeMouseEvent(e, 1);
|
|
331
339
|
}
|
|
@@ -337,12 +345,12 @@ class ne {
|
|
|
337
345
|
*/
|
|
338
346
|
onHostElementDblClicked(e) {
|
|
339
347
|
if (this.lastClicked = Date.now(), e.target instanceof HTMLElement) {
|
|
340
|
-
const t = e.target,
|
|
341
|
-
if (
|
|
348
|
+
const t = e.target, s = t.getAttribute("data-area"), o = _(s), i = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), a = this.tableScope.tableModel.getAreaModel(o);
|
|
349
|
+
if (s && o === "header")
|
|
342
350
|
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, i, r));
|
|
343
351
|
else if (t.getAttribute("data-row-index")) {
|
|
344
352
|
const l = a.getRowByIndex(i);
|
|
345
|
-
if (
|
|
353
|
+
if (s && o === "body" && a.isEditable(i, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, r)), H(l) && r === this.getArrowColumnIndex()) {
|
|
346
354
|
e.preventDefault(), e.stopPropagation();
|
|
347
355
|
const n = l;
|
|
348
356
|
n.expanded = !n.expanded, "recalcVisibleTreeRows" in a && a.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(n);
|
|
@@ -360,8 +368,8 @@ class ne {
|
|
|
360
368
|
* @return {void}
|
|
361
369
|
*/
|
|
362
370
|
publishGeMouseEvent(e, t) {
|
|
363
|
-
var
|
|
364
|
-
this.mouseEvent = e, this.geMouseEventOld = (
|
|
371
|
+
var s;
|
|
372
|
+
this.mouseEvent = e, this.geMouseEventOld = (s = this.geMouseEvent) == null ? void 0 : s.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld), this.tableScope.publishGeMouseEvent(this.geMouseEvent), t === 1 && this.tableScope.debounceRepaint();
|
|
365
373
|
}
|
|
366
374
|
/**
|
|
367
375
|
* Update the collapsed/expanded state of a tree row.
|
|
@@ -370,8 +378,8 @@ class ne {
|
|
|
370
378
|
* @returns {void}
|
|
371
379
|
*/
|
|
372
380
|
updateCollapsedExpandedState(e) {
|
|
373
|
-
var
|
|
374
|
-
const t = (
|
|
381
|
+
var s, o, i, r, a;
|
|
382
|
+
const t = (o = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : o.getRowId;
|
|
375
383
|
if (t) {
|
|
376
384
|
const l = (i = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : i.collapsedExpandedStateGet().mode, n = l === "collapsed" && !e.expanded || l === "expanded" && e.expanded, d = l === "collapsed" && e.expanded || l === "expanded" && !e.expanded, h = t(e.data);
|
|
377
385
|
n ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(h) : d && ((a = this.tableScope.storeStateCollapsedExpandService) == null || a.collapsedStateIdsRemove(h));
|
|
@@ -410,7 +418,7 @@ class ne {
|
|
|
410
418
|
}
|
|
411
419
|
}
|
|
412
420
|
}
|
|
413
|
-
class
|
|
421
|
+
class he {
|
|
414
422
|
constructor(e) {
|
|
415
423
|
this.tableScope = e;
|
|
416
424
|
}
|
|
@@ -527,6 +535,9 @@ class de {
|
|
|
527
535
|
repaintHard() {
|
|
528
536
|
this.tableScope.repaintHard();
|
|
529
537
|
}
|
|
538
|
+
recalcColumnWidths(e) {
|
|
539
|
+
this.tableScope.recalcColumnWidths(e);
|
|
540
|
+
}
|
|
530
541
|
/**
|
|
531
542
|
* Clears the current selection of the table.
|
|
532
543
|
* The table will be rendered automatically.
|
|
@@ -595,30 +606,30 @@ class de {
|
|
|
595
606
|
return this.tableScope.selectionModel();
|
|
596
607
|
}
|
|
597
608
|
}
|
|
598
|
-
class
|
|
609
|
+
class V {
|
|
599
610
|
constructor(e) {
|
|
600
611
|
this.getStorageKeyFn = e;
|
|
601
612
|
}
|
|
602
613
|
autoConvertMapToObject(e) {
|
|
603
614
|
const t = {};
|
|
604
615
|
if (e instanceof Map) {
|
|
605
|
-
const
|
|
606
|
-
for (const
|
|
616
|
+
const s = e;
|
|
617
|
+
for (const o of [...s]) {
|
|
607
618
|
const [
|
|
608
619
|
i,
|
|
609
620
|
r
|
|
610
|
-
] =
|
|
621
|
+
] = o;
|
|
611
622
|
t[i] = r;
|
|
612
623
|
}
|
|
613
624
|
}
|
|
614
625
|
return t;
|
|
615
626
|
}
|
|
616
627
|
checkAndPersistItem(e, t) {
|
|
617
|
-
const
|
|
618
|
-
if (
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
621
|
-
const i =
|
|
628
|
+
const s = this.getStorageKeyFn;
|
|
629
|
+
if (s) {
|
|
630
|
+
const o = s();
|
|
631
|
+
if (o) {
|
|
632
|
+
const i = o + e;
|
|
622
633
|
if ((t + "").includes("Map")) {
|
|
623
634
|
const r = this.autoConvertMapToObject(t);
|
|
624
635
|
this.persistItem(i, r);
|
|
@@ -670,7 +681,7 @@ class z {
|
|
|
670
681
|
// }
|
|
671
682
|
// }
|
|
672
683
|
}
|
|
673
|
-
class
|
|
684
|
+
class ce extends V {
|
|
674
685
|
constructor(e) {
|
|
675
686
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
676
687
|
}
|
|
@@ -685,21 +696,21 @@ class he extends z {
|
|
|
685
696
|
if (e) {
|
|
686
697
|
const t = e();
|
|
687
698
|
if (t) {
|
|
688
|
-
const
|
|
689
|
-
let
|
|
690
|
-
this.scrollOffset =
|
|
699
|
+
const s = t + this.SCROLL_STATE;
|
|
700
|
+
let o = this.loadFromLocalStorage(s);
|
|
701
|
+
this.scrollOffset = o || [0, 0];
|
|
691
702
|
}
|
|
692
703
|
}
|
|
693
704
|
}
|
|
694
705
|
}
|
|
695
|
-
class
|
|
696
|
-
constructor(e = "collapsed", t = [],
|
|
697
|
-
this.mode = e, this.rowIds = t, this.allCollapsed =
|
|
706
|
+
class ge {
|
|
707
|
+
constructor(e = "collapsed", t = [], s = !1, o = !1) {
|
|
708
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = o;
|
|
698
709
|
}
|
|
699
710
|
}
|
|
700
|
-
class
|
|
711
|
+
class pe extends V {
|
|
701
712
|
constructor(e) {
|
|
702
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
713
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new ge(), this.load();
|
|
703
714
|
}
|
|
704
715
|
collapsedExpandedStateGet() {
|
|
705
716
|
return this.collapsedExpandedState;
|
|
@@ -722,8 +733,8 @@ class ge extends z {
|
|
|
722
733
|
if (e) {
|
|
723
734
|
const t = e();
|
|
724
735
|
if (t) {
|
|
725
|
-
const
|
|
726
|
-
|
|
736
|
+
const s = t + this.COLLAPSED_EXPANDED_STATE, o = this.loadFromLocalStorage(s);
|
|
737
|
+
o && (this.collapsedExpandedState = o);
|
|
727
738
|
}
|
|
728
739
|
}
|
|
729
740
|
}
|
|
@@ -731,7 +742,7 @@ class ge extends z {
|
|
|
731
742
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
732
743
|
}
|
|
733
744
|
}
|
|
734
|
-
class
|
|
745
|
+
class be extends V {
|
|
735
746
|
constructor(e) {
|
|
736
747
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
737
748
|
}
|
|
@@ -746,89 +757,89 @@ class pe extends z {
|
|
|
746
757
|
if (e) {
|
|
747
758
|
const t = e();
|
|
748
759
|
if (t) {
|
|
749
|
-
const
|
|
750
|
-
this.sortItems =
|
|
760
|
+
const s = t + this.SORTING_STATE, o = this.loadFromLocalStorage(s);
|
|
761
|
+
this.sortItems = o || [];
|
|
751
762
|
}
|
|
752
763
|
}
|
|
753
764
|
}
|
|
754
765
|
}
|
|
755
766
|
class T {
|
|
756
|
-
constructor(e = 0, t = 0,
|
|
757
|
-
this.left = e, this.width = t, this.height =
|
|
767
|
+
constructor(e = 0, t = 0, s = 0, o = 0, i) {
|
|
768
|
+
this.left = e, this.width = t, this.height = s, this.top = o, this.index = i;
|
|
758
769
|
}
|
|
759
770
|
}
|
|
760
|
-
class
|
|
761
|
-
constructor(e, t,
|
|
762
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
771
|
+
class ue {
|
|
772
|
+
constructor(e, t, s, o) {
|
|
773
|
+
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = o, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
|
|
763
774
|
const i = this.hostElement;
|
|
764
775
|
i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
|
|
765
776
|
this.dom.addClass("ge-table", i),
|
|
766
777
|
"position",
|
|
767
778
|
"relative"
|
|
768
|
-
), this.hoverRow =
|
|
769
|
-
|
|
770
|
-
), this.hoverColumn =
|
|
771
|
-
|
|
772
|
-
), this.draggingColumn =
|
|
773
|
-
|
|
774
|
-
), this.areaHeaderWest =
|
|
775
|
-
|
|
776
|
-
|
|
779
|
+
), this.hoverRow = s.applyStylePosistionAbsolute(
|
|
780
|
+
s.createDivWithClass("ge-table-hover-row", i)
|
|
781
|
+
), this.hoverColumn = s.applyStylePosistionAbsolute(
|
|
782
|
+
s.createDivWithClass("ge-table-hover-column", i)
|
|
783
|
+
), this.draggingColumn = s.applyStylePosistionAbsolute(
|
|
784
|
+
s.createDivWithClass("ge-table-dragging-column", i)
|
|
785
|
+
), this.areaHeaderWest = s.appendRelativeChildDiv(
|
|
786
|
+
s.applyStylePosistionAbsolute(
|
|
787
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-west", i, "header", "west")
|
|
777
788
|
)
|
|
778
|
-
), this.areaHeaderCenter =
|
|
779
|
-
|
|
780
|
-
|
|
789
|
+
), this.areaHeaderCenter = s.appendRelativeChildDiv(
|
|
790
|
+
s.applyStylePosistionAbsolute(
|
|
791
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
|
|
781
792
|
)
|
|
782
|
-
), this.areaHeaderEast =
|
|
783
|
-
|
|
784
|
-
|
|
793
|
+
), this.areaHeaderEast = s.appendRelativeChildDiv(
|
|
794
|
+
s.applyStylePosistionAbsolute(
|
|
795
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
|
|
785
796
|
)
|
|
786
|
-
), this.areaBodyWest =
|
|
787
|
-
|
|
788
|
-
|
|
797
|
+
), this.areaBodyWest = s.appendRelativeChildDiv(
|
|
798
|
+
s.applyStylePosistionAbsolute(
|
|
799
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
|
|
789
800
|
)
|
|
790
|
-
), this.areaBodyEast =
|
|
791
|
-
|
|
792
|
-
|
|
801
|
+
), this.areaBodyEast = s.appendRelativeChildDiv(
|
|
802
|
+
s.applyStylePosistionAbsolute(
|
|
803
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
|
|
793
804
|
)
|
|
794
|
-
), this.areaFooterWest =
|
|
795
|
-
|
|
796
|
-
|
|
805
|
+
), this.areaFooterWest = s.appendRelativeChildDiv(
|
|
806
|
+
s.applyStylePosistionAbsolute(
|
|
807
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
|
|
797
808
|
)
|
|
798
|
-
), this.areaFooterCenter =
|
|
799
|
-
|
|
800
|
-
|
|
809
|
+
), this.areaFooterCenter = s.appendRelativeChildDiv(
|
|
810
|
+
s.applyStylePosistionAbsolute(
|
|
811
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
|
|
801
812
|
)
|
|
802
|
-
), this.areaFooterEast =
|
|
803
|
-
|
|
804
|
-
|
|
813
|
+
), this.areaFooterEast = s.appendRelativeChildDiv(
|
|
814
|
+
s.applyStylePosistionAbsolute(
|
|
815
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
|
|
805
816
|
)
|
|
806
|
-
), this.scrollViewport =
|
|
817
|
+
), this.scrollViewport = s.applyStyleOverflowAuto(
|
|
807
818
|
this.tableOptions.overflowX ?? "auto",
|
|
808
819
|
this.tableOptions.overflowY ?? "auto",
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
820
|
+
s.applyStyleNoPadding(
|
|
821
|
+
s.applyStylePosistionAbsolute(
|
|
822
|
+
s.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
|
|
812
823
|
)
|
|
813
824
|
)
|
|
814
|
-
), this.contentWrapperDiv =
|
|
815
|
-
|
|
816
|
-
|
|
825
|
+
), this.contentWrapperDiv = s.applyStyleNoPadding(
|
|
826
|
+
s.applyStylePosistionRelative(
|
|
827
|
+
s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
817
828
|
)
|
|
818
|
-
), this.contentDiv =
|
|
819
|
-
|
|
820
|
-
|
|
829
|
+
), this.contentDiv = s.applyStyleNoPadding(
|
|
830
|
+
s.applyStylePosistionRelative(
|
|
831
|
+
s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
821
832
|
)
|
|
822
|
-
), this.areaBodyCenter =
|
|
823
|
-
|
|
824
|
-
), this.borderHeaderBottom =
|
|
825
|
-
|
|
826
|
-
), this.borderFixedWest =
|
|
827
|
-
|
|
828
|
-
), this.borderFixedEast =
|
|
829
|
-
|
|
830
|
-
), this.borderFooterTop =
|
|
831
|
-
|
|
833
|
+
), this.areaBodyCenter = s.appendRelativeChildDiv(
|
|
834
|
+
s.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
835
|
+
), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
|
|
836
|
+
s.createDivWithClass("ge-table-header-border", i)
|
|
837
|
+
), this.borderFixedWest = s.applyStylePosistionAbsolute(
|
|
838
|
+
s.createDivWithClass("ge-table-west-fixed-column-border", i)
|
|
839
|
+
), this.borderFixedEast = s.applyStylePosistionAbsolute(
|
|
840
|
+
s.createDivWithClass("ge-table-east-fixed-column-border", i)
|
|
841
|
+
), this.borderFooterTop = s.applyStylePosistionAbsolute(
|
|
842
|
+
s.createDivWithClass("ge-table-footer-border", i)
|
|
832
843
|
);
|
|
833
844
|
}
|
|
834
845
|
/**
|
|
@@ -837,10 +848,10 @@ class be {
|
|
|
837
848
|
* @return {void}
|
|
838
849
|
*/
|
|
839
850
|
adjustContainersAndRows() {
|
|
840
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
851
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
|
|
841
852
|
this.dom.applyStyle(this.scrollViewport, {
|
|
842
853
|
width: `${t - e.left}px`,
|
|
843
|
-
height: `${
|
|
854
|
+
height: `${s - e.top}px`,
|
|
844
855
|
top: `${e.top}px`,
|
|
845
856
|
left: `${e.left}px`
|
|
846
857
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -848,21 +859,21 @@ class be {
|
|
|
848
859
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
849
860
|
top: `${this.scrollTop}px`,
|
|
850
861
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
851
|
-
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height =
|
|
862
|
+
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = s - e.top - e.bottom, this.areaBodyWestGeo.top = e.top, this.areaBodyWestGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo), this.tableOptions.fixedWestSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
852
863
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
853
864
|
width: "1px",
|
|
854
865
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
855
866
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
856
867
|
left: `${this.areaBodyWestGeo.width}px`
|
|
857
868
|
})
|
|
858
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height =
|
|
869
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = s - e.top - e.bottom, this.areaBodyEastGeo.top = e.top, this.areaBodyEastGeo.left = t - e.right, this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo), this.tableOptions.fixedEastSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
859
870
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
860
871
|
width: "1px",
|
|
861
872
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
862
873
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
863
874
|
left: `${this.areaBodyEastGeo.left}px`
|
|
864
875
|
})
|
|
865
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height =
|
|
876
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = s - e.top - e.bottom, this.areaBodyCenterGeo.top = 0, this.areaBodyCenterGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo), this.dom.applyStyle(this.areaHeaderCenter.parent, {
|
|
866
877
|
width: `${t - e.left - e.right}px`,
|
|
867
878
|
height: `${e.top}px`,
|
|
868
879
|
top: "0",
|
|
@@ -887,23 +898,23 @@ class be {
|
|
|
887
898
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
888
899
|
width: `${e.left}px`,
|
|
889
900
|
height: `${e.bottom}px`,
|
|
890
|
-
top: `${
|
|
901
|
+
top: `${s - e.bottom}px`,
|
|
891
902
|
left: "0"
|
|
892
903
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
893
904
|
width: `${t - e.left - e.right}px`,
|
|
894
905
|
height: `${e.bottom}px`,
|
|
895
|
-
top: `${
|
|
906
|
+
top: `${s - e.bottom}px`,
|
|
896
907
|
left: `${e.left}px`
|
|
897
908
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
898
909
|
width: `${e.right}px`,
|
|
899
910
|
height: `${e.bottom}px`,
|
|
900
|
-
top: `${
|
|
911
|
+
top: `${s - e.bottom}px`,
|
|
901
912
|
left: `${t - e.right}px`
|
|
902
913
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
903
914
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
904
915
|
width: `${t}px`,
|
|
905
916
|
height: "1px",
|
|
906
|
-
top: `${
|
|
917
|
+
top: `${s - e.bottom}px`,
|
|
907
918
|
left: "0px"
|
|
908
919
|
})
|
|
909
920
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
@@ -938,8 +949,8 @@ class E {
|
|
|
938
949
|
* @param {number} c2 - The value for c2.
|
|
939
950
|
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
940
951
|
*/
|
|
941
|
-
constructor(e, t,
|
|
942
|
-
this.r1 = e, this.c1 = t, this.r2 =
|
|
952
|
+
constructor(e, t, s, o, i = !1) {
|
|
953
|
+
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = o, this.gammaRange = i;
|
|
943
954
|
}
|
|
944
955
|
static create(e) {
|
|
945
956
|
return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
|
|
@@ -963,7 +974,7 @@ class E {
|
|
|
963
974
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
964
975
|
}
|
|
965
976
|
}
|
|
966
|
-
class
|
|
977
|
+
class Se {
|
|
967
978
|
constructor(e, t) {
|
|
968
979
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
969
980
|
}
|
|
@@ -972,14 +983,14 @@ class ue {
|
|
|
972
983
|
return;
|
|
973
984
|
this.colAndRowspanRanges = [];
|
|
974
985
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
975
|
-
for (let
|
|
976
|
-
for (let
|
|
977
|
-
let i = this.areaModel.getColspanAt(
|
|
986
|
+
for (let s = 0; s < e; s++)
|
|
987
|
+
for (let o = 0; o < t; o++) {
|
|
988
|
+
let i = this.areaModel.getColspanAt(s, o), r = this.areaModel.getRowspanAt(s, o);
|
|
978
989
|
if (i > 1 || r > 1) {
|
|
979
990
|
i === 0 && (i = 1), r === 0 && (r = 1);
|
|
980
991
|
const a = "gammaCells" in this.areaModel;
|
|
981
992
|
this.colAndRowspanRanges.push(
|
|
982
|
-
new E(o, s
|
|
993
|
+
new E(s, o, s + r - 1, o + i - 1, a)
|
|
983
994
|
);
|
|
984
995
|
}
|
|
985
996
|
}
|
|
@@ -989,29 +1000,29 @@ class ue {
|
|
|
989
1000
|
}
|
|
990
1001
|
isInRange(e, t) {
|
|
991
1002
|
if (this.colAndRowspanRanges) {
|
|
992
|
-
for (const
|
|
993
|
-
if (
|
|
1003
|
+
for (const s of this.colAndRowspanRanges)
|
|
1004
|
+
if (s.isInRange(e, t))
|
|
994
1005
|
return !0;
|
|
995
1006
|
}
|
|
996
1007
|
return !1;
|
|
997
1008
|
}
|
|
998
1009
|
}
|
|
999
|
-
class
|
|
1000
|
-
constructor(e, t,
|
|
1001
|
-
this.header = e, this.body = t, this.footer =
|
|
1010
|
+
class fe {
|
|
1011
|
+
constructor(e, t, s) {
|
|
1012
|
+
this.header = e, this.body = t, this.footer = s;
|
|
1002
1013
|
}
|
|
1003
1014
|
}
|
|
1004
|
-
class
|
|
1005
|
-
constructor(e, t,
|
|
1015
|
+
class me extends ue {
|
|
1016
|
+
constructor(e, t, s, o) {
|
|
1006
1017
|
var r, a;
|
|
1007
|
-
super(e, t,
|
|
1018
|
+
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 = {
|
|
1008
1019
|
header: [],
|
|
1009
1020
|
body: [],
|
|
1010
1021
|
footer: []
|
|
1011
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1022
|
+
}, this.tree = !1, this.colAndRowspanModels = new fe(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (a = this.tableOptions) != null && a.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), P(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
1012
1023
|
(l) => {
|
|
1013
1024
|
var n;
|
|
1014
|
-
this.colAndRowspanModels[l] = new
|
|
1025
|
+
this.colAndRowspanModels[l] = new Se(t, t.getAreaModel(l)), (n = this.colAndRowspanModels[l]) == null || n.init();
|
|
1015
1026
|
}
|
|
1016
1027
|
);
|
|
1017
1028
|
}
|
|
@@ -1049,10 +1060,10 @@ class fe extends be {
|
|
|
1049
1060
|
* @param {number} colIdx - The index of the column.
|
|
1050
1061
|
*/
|
|
1051
1062
|
initRenderEditor(e, t) {
|
|
1052
|
-
var
|
|
1053
|
-
let
|
|
1054
|
-
if (
|
|
1055
|
-
if (this.editorRenderer =
|
|
1063
|
+
var o;
|
|
1064
|
+
let s = (o = this.tableModel.getColumnDef(t)) == null ? void 0 : o.getEditRenderer;
|
|
1065
|
+
if (s || (s = this.tableOptions.getEditRenderer), s)
|
|
1066
|
+
if (this.editorRenderer = s(e, t), this.editorRenderer) {
|
|
1056
1067
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
1057
1068
|
const i = document.querySelector("input.ge-table-cell-editor-input");
|
|
1058
1069
|
i && i.focus();
|
|
@@ -1077,6 +1088,17 @@ class fe extends be {
|
|
|
1077
1088
|
repaintHard() {
|
|
1078
1089
|
this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.adjustAfterScrolling();
|
|
1079
1090
|
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Recalculates the column widths of the table.
|
|
1093
|
+
*
|
|
1094
|
+
* @param {number} [clientWidth] - The client width of the table. If not provided, the client width of the scroll viewport will be used.
|
|
1095
|
+
*
|
|
1096
|
+
* @return {undefined}
|
|
1097
|
+
*/
|
|
1098
|
+
recalcColumnWidths(e) {
|
|
1099
|
+
let t = e || this.scrollViewport.clientWidth;
|
|
1100
|
+
this.tableModel.setParentWidth(t), this.tableModel.init(), this.repaintHard();
|
|
1101
|
+
}
|
|
1080
1102
|
/**
|
|
1081
1103
|
* Adjusts the table after scrolling. This method performs various adjustments
|
|
1082
1104
|
* to the table's appearance and behavior after a scroll event occurs.
|
|
@@ -1122,8 +1144,8 @@ class fe extends be {
|
|
|
1122
1144
|
*/
|
|
1123
1145
|
updateCells(e, t = !1) {
|
|
1124
1146
|
e.forEach(
|
|
1125
|
-
(
|
|
1126
|
-
this.tableModel.getAreaModel(
|
|
1147
|
+
(s) => {
|
|
1148
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
1127
1149
|
}
|
|
1128
1150
|
), t && this.repaint();
|
|
1129
1151
|
}
|
|
@@ -1136,20 +1158,20 @@ class fe extends be {
|
|
|
1136
1158
|
* @param {any} value - The new value to be displayed in the cell.
|
|
1137
1159
|
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1138
1160
|
*/
|
|
1139
|
-
rerenderCellContent({ area: e, rowIndex: t, columnIndex:
|
|
1140
|
-
const r = this.tableModel.getAreaModel(e), a = 'div[data-col-index="' +
|
|
1161
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: o, cssClasses: i }) {
|
|
1162
|
+
const r = this.tableModel.getAreaModel(e), a = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', l = document.querySelector(a);
|
|
1141
1163
|
if (l) {
|
|
1142
1164
|
let n;
|
|
1143
|
-
const h = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn ===
|
|
1165
|
+
const h = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : r.getCellRenderer(t, s);
|
|
1144
1166
|
if (l.innerText = "", this.applyCssClasses(l, i), h)
|
|
1145
|
-
n = h.render(l, t,
|
|
1167
|
+
n = h.render(l, t, s, e, r, o, this.dom.domService), n && this.cleanupFunctions[e].push(n);
|
|
1146
1168
|
else {
|
|
1147
|
-
const u = `${
|
|
1148
|
-
this.dom.addLabelDiv(l, u, !1, t,
|
|
1169
|
+
const u = `${o}`;
|
|
1170
|
+
this.dom.addLabelDiv(l, u, !1, t, s, e);
|
|
1149
1171
|
}
|
|
1150
|
-
const c = r.getCustomClassesAt(t,
|
|
1172
|
+
const c = r.getCustomClassesAt(t, s);
|
|
1151
1173
|
c.length && this.dom.addClasses(c, l);
|
|
1152
|
-
const f = r.getCustomStyleAt(t,
|
|
1174
|
+
const f = r.getCustomStyleAt(t, s);
|
|
1153
1175
|
if (f)
|
|
1154
1176
|
for (const u in f)
|
|
1155
1177
|
this.dom.setStyle(l, u, f[u]);
|
|
@@ -1164,13 +1186,13 @@ class fe extends be {
|
|
|
1164
1186
|
*/
|
|
1165
1187
|
storeColumnWidths() {
|
|
1166
1188
|
const e = this.tableModel.getColumnDefs();
|
|
1167
|
-
e != null && e.length && (this.storedColumnWidths = e.map((t,
|
|
1189
|
+
e != null && e.length && (this.storedColumnWidths = e.map((t, s) => this.tableModel.getColumnWidth(s)));
|
|
1168
1190
|
}
|
|
1169
1191
|
getAreaAndSideIdentByAttr(e) {
|
|
1170
1192
|
if (e) {
|
|
1171
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
1172
|
-
if (
|
|
1173
|
-
return [t,
|
|
1193
|
+
const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
|
|
1194
|
+
if (s && t)
|
|
1195
|
+
return [t, s];
|
|
1174
1196
|
}
|
|
1175
1197
|
return [void 0, void 0];
|
|
1176
1198
|
}
|
|
@@ -1227,11 +1249,11 @@ class fe extends be {
|
|
|
1227
1249
|
* @protected
|
|
1228
1250
|
*/
|
|
1229
1251
|
getNumberByAttr(e, t) {
|
|
1230
|
-
var
|
|
1252
|
+
var s;
|
|
1231
1253
|
if (e) {
|
|
1232
|
-
const
|
|
1233
|
-
if (
|
|
1234
|
-
return Number(
|
|
1254
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1255
|
+
if (o)
|
|
1256
|
+
return Number(o);
|
|
1235
1257
|
}
|
|
1236
1258
|
return -1;
|
|
1237
1259
|
}
|
|
@@ -1244,11 +1266,11 @@ class fe extends be {
|
|
|
1244
1266
|
* @protected
|
|
1245
1267
|
*/
|
|
1246
1268
|
getStringByAttr(e, t) {
|
|
1247
|
-
var
|
|
1269
|
+
var s;
|
|
1248
1270
|
if (e) {
|
|
1249
|
-
const
|
|
1250
|
-
if (
|
|
1251
|
-
return
|
|
1271
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1272
|
+
if (o)
|
|
1273
|
+
return o;
|
|
1252
1274
|
}
|
|
1253
1275
|
return "";
|
|
1254
1276
|
}
|
|
@@ -1262,55 +1284,55 @@ class fe extends be {
|
|
|
1262
1284
|
*/
|
|
1263
1285
|
adjustArea(e, t = 0) {
|
|
1264
1286
|
var b;
|
|
1265
|
-
const
|
|
1266
|
-
|
|
1287
|
+
const s = this.getArea(e, "west"), o = this.getArea(e, "center"), i = this.getArea(e, "east"), r = o.child.clientHeight;
|
|
1288
|
+
s.child.innerText = "", o.child.innerText = "", i.child.innerText = "";
|
|
1267
1289
|
const a = 0, l = this.areaBodyCenterGeo.width, n = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), h = d.getRowCount();
|
|
1268
1290
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1269
|
-
const
|
|
1270
|
-
|
|
1291
|
+
const p = this.cleanupFunctions[e].shift();
|
|
1292
|
+
p && p();
|
|
1271
1293
|
}
|
|
1272
1294
|
let c = t;
|
|
1273
1295
|
const f = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), S = this.tableModel.getFixedLeftColumnCount();
|
|
1274
|
-
for (let
|
|
1275
|
-
const v = c, m =
|
|
1296
|
+
for (let p = 0; p < h; p++) {
|
|
1297
|
+
const v = c, m = p === h - 1, x = this.tableModel.getRowHeight(e, p);
|
|
1276
1298
|
if (v + x > 0) {
|
|
1277
|
-
this.firstVisibleRowIndex =
|
|
1278
|
-
let
|
|
1299
|
+
this.firstVisibleRowIndex = p;
|
|
1300
|
+
let w = { left: a, width: l, height: x, top: v, index: p }, y = this.dom.addRowDiv(o, w, p, e, "center");
|
|
1279
1301
|
const R = S;
|
|
1280
1302
|
if (this.adjustColumnsToRowParent({
|
|
1281
1303
|
areaIdent: e,
|
|
1282
1304
|
sideIdent: "center",
|
|
1283
1305
|
areaModel: d,
|
|
1284
|
-
geo:
|
|
1306
|
+
geo: w,
|
|
1285
1307
|
parent: y,
|
|
1286
|
-
rowIndex:
|
|
1308
|
+
rowIndex: p,
|
|
1287
1309
|
columnIndexStart: R,
|
|
1288
1310
|
columnIndexEnd: f - u - 1,
|
|
1289
1311
|
verticalFixed: !1,
|
|
1290
1312
|
lastRowOfModel: m
|
|
1291
|
-
}), n.left > 0 && (
|
|
1313
|
+
}), n.left > 0 && (w = { left: a, width: this.areaBodyWestGeo.width, height: x, top: v, index: p }, y = this.dom.addRowDiv(s, w, p, e, "west"), this.adjustColumnsToRowParent({
|
|
1292
1314
|
areaIdent: e,
|
|
1293
1315
|
sideIdent: "west",
|
|
1294
1316
|
areaModel: d,
|
|
1295
|
-
geo:
|
|
1317
|
+
geo: w,
|
|
1296
1318
|
parent: y,
|
|
1297
|
-
rowIndex:
|
|
1319
|
+
rowIndex: p,
|
|
1298
1320
|
columnIndexStart: 0,
|
|
1299
1321
|
columnIndexEnd: R - 1,
|
|
1300
1322
|
verticalFixed: !0,
|
|
1301
1323
|
lastRowOfModel: m
|
|
1302
|
-
})), n.right > 0 && (
|
|
1324
|
+
})), n.right > 0 && (w = { left: a, width: this.areaBodyEastGeo.width, height: x, top: v, index: p }, y = this.dom.addRowDiv(i, w, p, e, "east"), this.adjustColumnsToRowParent({
|
|
1303
1325
|
areaIdent: e,
|
|
1304
1326
|
sideIdent: "east",
|
|
1305
1327
|
areaModel: d,
|
|
1306
|
-
geo:
|
|
1328
|
+
geo: w,
|
|
1307
1329
|
parent: y,
|
|
1308
|
-
rowIndex:
|
|
1330
|
+
rowIndex: p,
|
|
1309
1331
|
columnIndexStart: f - u,
|
|
1310
1332
|
columnIndexEnd: f - 1,
|
|
1311
1333
|
verticalFixed: !0,
|
|
1312
1334
|
lastRowOfModel: m
|
|
1313
|
-
})), e === "header" && this.tree &&
|
|
1335
|
+
})), e === "header" && this.tree && p === h - 1) {
|
|
1314
1336
|
const A = this.dom.applyStyle(
|
|
1315
1337
|
this.dom.setAttribute(
|
|
1316
1338
|
this.dom.addDiv(y, new T(16, 20, 20, 8)),
|
|
@@ -1320,8 +1342,8 @@ class fe extends be {
|
|
|
1320
1342
|
{ cursor: "pointer" }
|
|
1321
1343
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1322
1344
|
if (M) {
|
|
1323
|
-
const
|
|
1324
|
-
this.dom.domService.appendChild(A,
|
|
1345
|
+
const O = this.dom.domService.createText(M.content);
|
|
1346
|
+
this.dom.domService.appendChild(A, O), M.style && this.dom.applyStyleString(A, M.style);
|
|
1325
1347
|
}
|
|
1326
1348
|
}
|
|
1327
1349
|
}
|
|
@@ -1329,19 +1351,19 @@ class fe extends be {
|
|
|
1329
1351
|
break;
|
|
1330
1352
|
}
|
|
1331
1353
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1332
|
-
const
|
|
1333
|
-
if (
|
|
1334
|
-
for (const v of
|
|
1335
|
-
let m = 0, x =
|
|
1354
|
+
const p = ((b = this.colAndRowspanModels[e]) == null ? void 0 : b.getRanges()) ?? [];
|
|
1355
|
+
if (p.length)
|
|
1356
|
+
for (const v of p) {
|
|
1357
|
+
let m = 0, x = o.child, w = "center";
|
|
1336
1358
|
if (v.c1 < S)
|
|
1337
|
-
x =
|
|
1359
|
+
x = s.child, w = "west";
|
|
1338
1360
|
else if (u > 0 && v.c1 >= f - u)
|
|
1339
|
-
x = i.child,
|
|
1361
|
+
x = i.child, w = "east";
|
|
1340
1362
|
else {
|
|
1341
1363
|
const y = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1342
|
-
m = this.scrollFactorX * y - this.areaBodyWestGeo.width,
|
|
1364
|
+
m = this.scrollFactorX * y - this.areaBodyWestGeo.width, w = "center";
|
|
1343
1365
|
}
|
|
1344
|
-
this.drawBigCell(v, m, t, d, x,
|
|
1366
|
+
this.drawBigCell(v, m, t, d, x, w);
|
|
1345
1367
|
}
|
|
1346
1368
|
}
|
|
1347
1369
|
}
|
|
@@ -1355,16 +1377,16 @@ class fe extends be {
|
|
|
1355
1377
|
* @param sideIdent SideIdent (west,center,east)
|
|
1356
1378
|
* @protected
|
|
1357
1379
|
*/
|
|
1358
|
-
drawBigCell(e, t,
|
|
1359
|
-
const a =
|
|
1380
|
+
drawBigCell(e, t, s, o, i, r) {
|
|
1381
|
+
const a = s + this.getRowHeights(0, e.r1 - 1, o).reduce((b, p) => b + p, 0), l = this.tableModel.getColumnCount(), n = this.tableModel.getFixedRightColumnCount();
|
|
1360
1382
|
let d = 0;
|
|
1361
1383
|
n > 0 && e.c1 >= l - n && (d = l - n);
|
|
1362
|
-
const h = t + this.getColumnWidths(d, e.c1 - 1).reduce((b,
|
|
1384
|
+
const h = t + this.getColumnWidths(d, e.c1 - 1).reduce((b, p) => b + p, 0), c = this.getRowHeights(e.r1, e.r2, o).reduce((b, p) => b + p, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((b, p) => b + p, 0);
|
|
1363
1385
|
let u = !1;
|
|
1364
1386
|
const S = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1365
1387
|
S && (u = S.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
1366
|
-
areaModel:
|
|
1367
|
-
areaIdent:
|
|
1388
|
+
areaModel: o,
|
|
1389
|
+
areaIdent: o.areaIdent,
|
|
1368
1390
|
sideIdent: r,
|
|
1369
1391
|
rowIndex: e.r1,
|
|
1370
1392
|
columnIndex: e.c1,
|
|
@@ -1377,8 +1399,8 @@ class fe extends be {
|
|
|
1377
1399
|
lastRowOfModel: !0,
|
|
1378
1400
|
gammaRange: e.gammaRange
|
|
1379
1401
|
}) : this.renderCell({
|
|
1380
|
-
areaModel:
|
|
1381
|
-
areaIdent:
|
|
1402
|
+
areaModel: o,
|
|
1403
|
+
areaIdent: o.areaIdent,
|
|
1382
1404
|
sideIdent: r,
|
|
1383
1405
|
rowIndex: e.r1,
|
|
1384
1406
|
columnIndex: e.c1,
|
|
@@ -1390,7 +1412,7 @@ class fe extends be {
|
|
|
1390
1412
|
cellSelected: u,
|
|
1391
1413
|
lastRowOfModel: !0,
|
|
1392
1414
|
gammaRange: e.gammaRange
|
|
1393
|
-
}),
|
|
1415
|
+
}), o.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1394
1416
|
rowIndex: e.r1,
|
|
1395
1417
|
columnIndex: e.c1,
|
|
1396
1418
|
cellLeft: h,
|
|
@@ -1409,13 +1431,13 @@ class fe extends be {
|
|
|
1409
1431
|
* @returns {number} - The row index of the important rowspan cell, or -1 if not found.
|
|
1410
1432
|
* @protected
|
|
1411
1433
|
*/
|
|
1412
|
-
findRowOfImportantRowspanCell(e, t,
|
|
1413
|
-
const
|
|
1434
|
+
findRowOfImportantRowspanCell(e, t, s) {
|
|
1435
|
+
const o = e.getMaxRowspan();
|
|
1414
1436
|
for (let i = t - 1; i > -1; i--) {
|
|
1415
|
-
const r = e.getRowspanAt(i,
|
|
1437
|
+
const r = e.getRowspanAt(i, s);
|
|
1416
1438
|
if (r > 1 && i + r + 1 >= t)
|
|
1417
1439
|
return i;
|
|
1418
|
-
if (t - i >
|
|
1440
|
+
if (t - i > o)
|
|
1419
1441
|
return -1;
|
|
1420
1442
|
}
|
|
1421
1443
|
return -1;
|
|
@@ -1430,8 +1452,8 @@ class fe extends be {
|
|
|
1430
1452
|
adjustColumnsToRowParent({
|
|
1431
1453
|
areaIdent: e,
|
|
1432
1454
|
sideIdent: t,
|
|
1433
|
-
areaModel:
|
|
1434
|
-
geo:
|
|
1455
|
+
areaModel: s,
|
|
1456
|
+
geo: o,
|
|
1435
1457
|
parent: i,
|
|
1436
1458
|
rowIndex: r,
|
|
1437
1459
|
columnIndexStart: a,
|
|
@@ -1449,27 +1471,27 @@ class fe extends be {
|
|
|
1449
1471
|
const c = 0, f = !!(e === "body" && t);
|
|
1450
1472
|
let u = h;
|
|
1451
1473
|
for (let b = a; b <= l; b++) {
|
|
1452
|
-
const
|
|
1453
|
-
if (v > 0 &&
|
|
1454
|
-
let m =
|
|
1455
|
-
const x =
|
|
1456
|
-
x > 1 && (m = this.getRowHeights(r, r + x - 1,
|
|
1474
|
+
const p = u, v = this.tableModel.getColumnWidth(b);
|
|
1475
|
+
if (v > 0 && p + v > 0) {
|
|
1476
|
+
let m = o.height;
|
|
1477
|
+
const x = s.getRowspanAt(r, b), w = s.getColspanAt(r, b);
|
|
1478
|
+
x > 1 && (m = this.getRowHeights(r, r + x - 1, s).reduce((A, M) => A + M, 0));
|
|
1457
1479
|
let y = v;
|
|
1458
|
-
|
|
1480
|
+
w > 1 && (y = this.getColumnWidths(b, b + w - 1).reduce((A, M) => A + M, 0));
|
|
1459
1481
|
let R = !1;
|
|
1460
1482
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (S = this.colAndRowspanModels[e]) != null && S.isInRange(r, b) && (R = !0), this.draggingTargetColumnIndex === b && e !== "header") {
|
|
1461
|
-
this.renderDragTargetDiv(i,
|
|
1462
|
-
const A = { left:
|
|
1483
|
+
this.renderDragTargetDiv(i, p, c, y, m);
|
|
1484
|
+
const A = { left: p, top: c, width: y, height: m };
|
|
1463
1485
|
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
1464
1486
|
} else {
|
|
1465
|
-
const A = this.renderSelectedBackgroundDiv(R, f, t,
|
|
1466
|
-
"gammaCells" in
|
|
1467
|
-
areaModel:
|
|
1487
|
+
const A = this.renderSelectedBackgroundDiv(R, f, t, s, r, b, i, p, c, y, m);
|
|
1488
|
+
"gammaCells" in s && s.getValueAt(r, b) && (R = !1), R || this.renderCell({
|
|
1489
|
+
areaModel: s,
|
|
1468
1490
|
areaIdent: e,
|
|
1469
1491
|
sideIdent: t,
|
|
1470
1492
|
rowIndex: r,
|
|
1471
1493
|
columnIndex: b,
|
|
1472
|
-
left:
|
|
1494
|
+
left: p,
|
|
1473
1495
|
top: c,
|
|
1474
1496
|
width: y,
|
|
1475
1497
|
height: m,
|
|
@@ -1480,7 +1502,7 @@ class fe extends be {
|
|
|
1480
1502
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1481
1503
|
rowIndex: r,
|
|
1482
1504
|
columnIndex: b,
|
|
1483
|
-
cellLeft:
|
|
1505
|
+
cellLeft: p,
|
|
1484
1506
|
cellTop: c,
|
|
1485
1507
|
cellWidth: y,
|
|
1486
1508
|
cellHeight: m,
|
|
@@ -1491,7 +1513,7 @@ class fe extends be {
|
|
|
1491
1513
|
if (u = u + v, u > this.areaBodyCenterGeo.width)
|
|
1492
1514
|
break;
|
|
1493
1515
|
}
|
|
1494
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(u - 1, 1,
|
|
1516
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(u - 1, 1, o.height, 0), i);
|
|
1495
1517
|
}
|
|
1496
1518
|
/**
|
|
1497
1519
|
* Retrieves the column index of the tree arrow column in the table.
|
|
@@ -1508,8 +1530,8 @@ class fe extends be {
|
|
|
1508
1530
|
addAndRenderCellDiv({
|
|
1509
1531
|
areaModel: e,
|
|
1510
1532
|
areaIdent: t,
|
|
1511
|
-
sideIdent:
|
|
1512
|
-
rowIndex:
|
|
1533
|
+
sideIdent: s,
|
|
1534
|
+
rowIndex: o,
|
|
1513
1535
|
index: i,
|
|
1514
1536
|
left: r,
|
|
1515
1537
|
width: a,
|
|
@@ -1519,47 +1541,47 @@ class fe extends be {
|
|
|
1519
1541
|
lastRowOfModel: h
|
|
1520
1542
|
}) {
|
|
1521
1543
|
var X;
|
|
1522
|
-
const f = this.editorRenderer && this.editorRendererRow ===
|
|
1544
|
+
const f = this.editorRenderer && this.editorRendererRow === o && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(o, i), u = { left: r, width: a, height: l, top: n, index: i }, S = e.getRowByIndex(o);
|
|
1523
1545
|
let b = "none";
|
|
1524
|
-
if (i === this.getTreeArrowColumnIndex() &&
|
|
1525
|
-
const
|
|
1526
|
-
(X =
|
|
1546
|
+
if (i === this.getTreeArrowColumnIndex() && H(S)) {
|
|
1547
|
+
const C = S;
|
|
1548
|
+
(X = C.children) != null && X.length ? C.expanded ? b = "expanded" : b = "collapsed" : b = "hidden";
|
|
1527
1549
|
}
|
|
1528
1550
|
let v;
|
|
1529
1551
|
if (t === "header") {
|
|
1530
|
-
const
|
|
1531
|
-
(!(
|
|
1552
|
+
const C = this.tableModel.getColumnDef(i);
|
|
1553
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (v = C == null ? void 0 : C.sortState);
|
|
1532
1554
|
}
|
|
1533
|
-
const m = e.getValueAt(
|
|
1555
|
+
const m = e.getValueAt(o, i), x = f ? "" : `${m}`, w = e.isRowChecked(o), y = this.dom.addColumnDiv(
|
|
1534
1556
|
{
|
|
1535
1557
|
parent: d,
|
|
1536
1558
|
geo: u,
|
|
1537
|
-
rowIndex:
|
|
1559
|
+
rowIndex: o,
|
|
1538
1560
|
columnIndex: i,
|
|
1539
1561
|
areaIdent: t,
|
|
1540
|
-
sideIdent:
|
|
1562
|
+
sideIdent: s,
|
|
1541
1563
|
text: x,
|
|
1542
1564
|
treeArrow: b,
|
|
1543
1565
|
tableOptions: this.tableOptions,
|
|
1544
|
-
checkedType:
|
|
1566
|
+
checkedType: w,
|
|
1545
1567
|
sortState: v
|
|
1546
1568
|
}
|
|
1547
|
-
), R = e.getTooltipAt(
|
|
1569
|
+
), R = e.getTooltipAt(o, i);
|
|
1548
1570
|
R && this.dom.setAttribute(y, "title", R);
|
|
1549
1571
|
const A = this.tableModel.getColumnDef(i);
|
|
1550
1572
|
A && A.classes[t] && this.dom.addClasses(A.classes[t], y);
|
|
1551
1573
|
let M;
|
|
1552
|
-
f && (M = f.render(y,
|
|
1553
|
-
const
|
|
1554
|
-
if (
|
|
1555
|
-
const
|
|
1556
|
-
|
|
1574
|
+
f && (M = f.render(y, o, i, t, e, m, this.dom.domService));
|
|
1575
|
+
const O = e.getCustomClassesAt(o, i);
|
|
1576
|
+
if (O.length && this.dom.addClasses(O, y), this.dom.addColumnBorderDivs(this.tableOptions, d, u, t, s), h && this.dom.addHorizontalBorder({ left: r, width: a, height: l, top: n + l }, d), this.getFocusModel && t === "body") {
|
|
1577
|
+
const C = this.getFocusModel();
|
|
1578
|
+
C != null && C.hasFocus(o, i) && this.dom.addFocusBorderDivs(d, u, {});
|
|
1557
1579
|
}
|
|
1558
1580
|
t === "header" && this.dom.setAttribute(y, "data-ge-action", "drag-column");
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1561
|
-
for (const
|
|
1562
|
-
this.dom.setStyle(y,
|
|
1581
|
+
const W = e.getCustomStyleAt(o, i);
|
|
1582
|
+
if (W)
|
|
1583
|
+
for (const C in W)
|
|
1584
|
+
this.dom.setStyle(y, C, W[C]);
|
|
1563
1585
|
return [y, M];
|
|
1564
1586
|
}
|
|
1565
1587
|
/**
|
|
@@ -1570,8 +1592,8 @@ class fe extends be {
|
|
|
1570
1592
|
* @protected
|
|
1571
1593
|
*/
|
|
1572
1594
|
applyCssClasses(e, t = {}) {
|
|
1573
|
-
e && Object.entries(t).forEach(([
|
|
1574
|
-
|
|
1595
|
+
e && Object.entries(t).forEach(([s, o]) => {
|
|
1596
|
+
o ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1575
1597
|
});
|
|
1576
1598
|
}
|
|
1577
1599
|
/**
|
|
@@ -1583,10 +1605,10 @@ class fe extends be {
|
|
|
1583
1605
|
* @return {number[]} An array containing the widths of the columns within the specified range.
|
|
1584
1606
|
*/
|
|
1585
1607
|
getColumnWidths(e, t) {
|
|
1586
|
-
const
|
|
1587
|
-
for (let
|
|
1588
|
-
|
|
1589
|
-
return
|
|
1608
|
+
const s = [];
|
|
1609
|
+
for (let o = e; o <= t; o++)
|
|
1610
|
+
s.push(this.tableModel.getColumnWidth(o));
|
|
1611
|
+
return s;
|
|
1590
1612
|
}
|
|
1591
1613
|
/**
|
|
1592
1614
|
* Retrieves the heights of rows within a specified range.
|
|
@@ -1596,11 +1618,11 @@ class fe extends be {
|
|
|
1596
1618
|
* @param {AreaModelIf} areaModel - The area model.
|
|
1597
1619
|
* @return {number[]} - An array containing the heights of the rows within the specified range.
|
|
1598
1620
|
*/
|
|
1599
|
-
getRowHeights(e, t,
|
|
1600
|
-
const
|
|
1621
|
+
getRowHeights(e, t, s) {
|
|
1622
|
+
const o = [];
|
|
1601
1623
|
for (let i = e; i <= t; i++)
|
|
1602
|
-
|
|
1603
|
-
return
|
|
1624
|
+
o.push(s.getRowHeight(i));
|
|
1625
|
+
return o;
|
|
1604
1626
|
}
|
|
1605
1627
|
/**
|
|
1606
1628
|
* Adjusts the position and size of the hover row based on the mouse move event.
|
|
@@ -1611,12 +1633,12 @@ class fe extends be {
|
|
|
1611
1633
|
*/
|
|
1612
1634
|
adjustHoverRows(e) {
|
|
1613
1635
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1614
|
-
const t = this.hostElement.clientWidth,
|
|
1636
|
+
const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), o = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1615
1637
|
this.dom.applyStyle(this.hoverRow, {
|
|
1616
1638
|
left: "0",
|
|
1617
|
-
top:
|
|
1639
|
+
top: o + "px",
|
|
1618
1640
|
width: t + "px",
|
|
1619
|
-
height:
|
|
1641
|
+
height: s + "px",
|
|
1620
1642
|
display: "block"
|
|
1621
1643
|
});
|
|
1622
1644
|
} else
|
|
@@ -1644,11 +1666,11 @@ class fe extends be {
|
|
|
1644
1666
|
*/
|
|
1645
1667
|
adjustHoverColumns(e) {
|
|
1646
1668
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1647
|
-
const t = this.hostElement.clientHeight,
|
|
1669
|
+
const t = this.hostElement.clientHeight, s = this.tableModel.getColumnWidth(e.columnIndex), o = this.areaBodyWestGeo.width, i = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - o;
|
|
1648
1670
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1649
1671
|
left: i + "px",
|
|
1650
1672
|
top: "0px",
|
|
1651
|
-
width:
|
|
1673
|
+
width: s + "px",
|
|
1652
1674
|
height: t + "px",
|
|
1653
1675
|
display: "block"
|
|
1654
1676
|
});
|
|
@@ -1687,17 +1709,17 @@ class fe extends be {
|
|
|
1687
1709
|
* @param {number} sourceColumnIndex - The index of the source column.
|
|
1688
1710
|
* @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
|
|
1689
1711
|
*/
|
|
1690
|
-
adjustDraggingColumn(e, t,
|
|
1691
|
-
var
|
|
1712
|
+
adjustDraggingColumn(e, t, s) {
|
|
1713
|
+
var o, i;
|
|
1692
1714
|
if (this.dragging) {
|
|
1693
1715
|
const r = this.hostElement.clientHeight, a = this.storedColumnWidths[t];
|
|
1694
|
-
if ((
|
|
1716
|
+
if ((o = e.originalEvent) != null && o.clientX) {
|
|
1695
1717
|
const d = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - a / 2, width: a, height: r, top: 0, index: t };
|
|
1696
1718
|
this.dom.applyStyle(this.draggingColumn, {
|
|
1697
1719
|
background: "rgba(128,128,128,0.2)",
|
|
1698
1720
|
display: "block",
|
|
1699
1721
|
overfllow: "clip"
|
|
1700
|
-
}), this.dom.applyStyleInPx(this.draggingColumn, d),
|
|
1722
|
+
}), this.dom.applyStyleInPx(this.draggingColumn, d), s && this.renderContentOfDraggingColumn(d);
|
|
1701
1723
|
}
|
|
1702
1724
|
} else
|
|
1703
1725
|
this.hideDraggingColumn();
|
|
@@ -1721,34 +1743,34 @@ class fe extends be {
|
|
|
1721
1743
|
* @param {number} [y=0] - The starting y-position.
|
|
1722
1744
|
* @return {number} The final y-position after rendering all the content.
|
|
1723
1745
|
*/
|
|
1724
|
-
renderContentOfDraggingColumnForArea(e, t,
|
|
1725
|
-
const
|
|
1746
|
+
renderContentOfDraggingColumnForArea(e, t, s = 0) {
|
|
1747
|
+
const o = "center", i = this.tableModel.getAreaModel(t), r = i == null ? void 0 : i.getRowCount();
|
|
1726
1748
|
if (r) {
|
|
1727
1749
|
const a = e.index ?? 0, l = this.draggingColumn;
|
|
1728
1750
|
for (let n = 0; n < r; n++) {
|
|
1729
|
-
const d =
|
|
1751
|
+
const d = s, h = i.getRowHeight(n), c = { left: 0, width: e.width, height: h, top: d, index: n }, f = i.getValueAt(n, a), u = i.getCellRenderer(n, a), S = u ? "" : `${f}`, b = {
|
|
1730
1752
|
parent: l,
|
|
1731
1753
|
geo: c,
|
|
1732
1754
|
rowIndex: n,
|
|
1733
1755
|
columnIndex: a,
|
|
1734
1756
|
areaIdent: t,
|
|
1735
|
-
sideIdent:
|
|
1757
|
+
sideIdent: o,
|
|
1736
1758
|
text: S
|
|
1737
|
-
},
|
|
1759
|
+
}, p = this.dom.addColumnDiv(b);
|
|
1738
1760
|
let v;
|
|
1739
|
-
u && (v = u.render(
|
|
1761
|
+
u && (v = u.render(p, n, a, t, i, f, this.dom.domService), v && this.cleanupFunctions[t].push(v));
|
|
1740
1762
|
const m = i.getCustomClassesAt(n, a);
|
|
1741
|
-
m.length && this.dom.addClasses(m,
|
|
1763
|
+
m.length && this.dom.addClasses(m, p);
|
|
1742
1764
|
const x = this.tableModel.getColumnDef(a);
|
|
1743
|
-
x && x.classes[t] && this.dom.addClasses(x.classes[t],
|
|
1744
|
-
const
|
|
1745
|
-
if (
|
|
1746
|
-
for (const y in
|
|
1747
|
-
this.dom.setStyle(
|
|
1748
|
-
|
|
1765
|
+
x && x.classes[t] && this.dom.addClasses(x.classes[t], p), this.dom.addColumnBorderDivs(this.tableOptions, l, c, t, o);
|
|
1766
|
+
const w = i.getCustomStyleAt(n, a);
|
|
1767
|
+
if (w)
|
|
1768
|
+
for (const y in w)
|
|
1769
|
+
this.dom.setStyle(p, y, w[y]);
|
|
1770
|
+
s = s + h;
|
|
1749
1771
|
}
|
|
1750
1772
|
}
|
|
1751
|
-
return
|
|
1773
|
+
return s;
|
|
1752
1774
|
}
|
|
1753
1775
|
/**
|
|
1754
1776
|
* Hides the dragging column by applying a 'display: none' style to it.
|
|
@@ -1771,11 +1793,11 @@ class fe extends be {
|
|
|
1771
1793
|
* @param {number} height - The height of the target div in pixels.
|
|
1772
1794
|
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1773
1795
|
*/
|
|
1774
|
-
renderDragTargetDiv(e, t,
|
|
1796
|
+
renderDragTargetDiv(e, t, s, o, i) {
|
|
1775
1797
|
const r = this.dom.applyStylePosistionAbsolute(
|
|
1776
1798
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1777
1799
|
);
|
|
1778
|
-
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${
|
|
1800
|
+
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${s}px`), this.dom.setStyle(r, "width", `${o}px`), this.dom.setStyle(r, "height", `${i}px`), r;
|
|
1779
1801
|
}
|
|
1780
1802
|
/**
|
|
1781
1803
|
* Render selected background div.
|
|
@@ -1794,9 +1816,9 @@ class fe extends be {
|
|
|
1794
1816
|
* @param {number} height - The height of the div.
|
|
1795
1817
|
* @returns {boolean} - Whether the cell is selected.
|
|
1796
1818
|
*/
|
|
1797
|
-
renderSelectedBackgroundDiv(e, t,
|
|
1819
|
+
renderSelectedBackgroundDiv(e, t, s, o, i, r, a, l, n, d, h) {
|
|
1798
1820
|
let c = !1;
|
|
1799
|
-
if (!e && t &&
|
|
1821
|
+
if (!e && t && o.isSelectable(i, r) && this.getSelectionModel) {
|
|
1800
1822
|
const f = this.getSelectionModel();
|
|
1801
1823
|
if (f) {
|
|
1802
1824
|
const u = f.getSelectionCount(i, r);
|
|
@@ -1804,7 +1826,7 @@ class fe extends be {
|
|
|
1804
1826
|
for (let S = 0; S < u; S++) {
|
|
1805
1827
|
const b = this.dom.applyStylePosistionAbsolute(
|
|
1806
1828
|
// ge-table-body-west-selected-range
|
|
1807
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
1829
|
+
this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`, a)
|
|
1808
1830
|
);
|
|
1809
1831
|
this.dom.setStyle(b, "left", `${l}px`), this.dom.setStyle(b, "top", `${n}px`), this.dom.setStyle(b, "width", `${d}px`), this.dom.setStyle(b, "height", `${h}px`);
|
|
1810
1832
|
}
|
|
@@ -1834,8 +1856,8 @@ class fe extends be {
|
|
|
1834
1856
|
renderCell({
|
|
1835
1857
|
areaModel: e,
|
|
1836
1858
|
areaIdent: t,
|
|
1837
|
-
sideIdent:
|
|
1838
|
-
rowIndex:
|
|
1859
|
+
sideIdent: s,
|
|
1860
|
+
rowIndex: o,
|
|
1839
1861
|
columnIndex: i,
|
|
1840
1862
|
left: r,
|
|
1841
1863
|
top: a,
|
|
@@ -1848,8 +1870,8 @@ class fe extends be {
|
|
|
1848
1870
|
const [f, u] = this.addAndRenderCellDiv({
|
|
1849
1871
|
areaModel: e,
|
|
1850
1872
|
areaIdent: t,
|
|
1851
|
-
sideIdent:
|
|
1852
|
-
rowIndex:
|
|
1873
|
+
sideIdent: s,
|
|
1874
|
+
rowIndex: o,
|
|
1853
1875
|
index: i,
|
|
1854
1876
|
left: r,
|
|
1855
1877
|
width: l,
|
|
@@ -1858,7 +1880,7 @@ class fe extends be {
|
|
|
1858
1880
|
parent: d,
|
|
1859
1881
|
lastRowOfModel: c
|
|
1860
1882
|
});
|
|
1861
|
-
h && this.dom.addClass(`ge-table-${t}-${
|
|
1883
|
+
h && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, f), u && this.cleanupFunctions[t].push(u);
|
|
1862
1884
|
}
|
|
1863
1885
|
/**
|
|
1864
1886
|
* Render the header cell resize handle.
|
|
@@ -1874,17 +1896,17 @@ class fe extends be {
|
|
|
1874
1896
|
*
|
|
1875
1897
|
* @return {void}
|
|
1876
1898
|
*/
|
|
1877
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft:
|
|
1899
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: o, cellWidth: i, cellHeight: r, parent: a }) {
|
|
1878
1900
|
const l = this.dom.domService, n = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = l.createElement("div");
|
|
1879
|
-
l.setAttribute(d, "data-col-index", `${t}`), l.setAttribute(d, "data-row-index", `${e}`), l.setAttribute(d, "data-area", "header"), l.setAttribute(d, "data-ge-action", "resize-column"), l.addClass(d, "ge-table-column-resize-handle"), l.setStyle(d, "display", "clip"), l.setStyle(d, "position", "absolute"), l.setStyle(d, "cursor", "col-resize"), l.setStyle(d, "left", `${
|
|
1901
|
+
l.setAttribute(d, "data-col-index", `${t}`), l.setAttribute(d, "data-row-index", `${e}`), l.setAttribute(d, "data-area", "header"), l.setAttribute(d, "data-ge-action", "resize-column"), l.addClass(d, "ge-table-column-resize-handle"), l.setStyle(d, "display", "clip"), l.setStyle(d, "position", "absolute"), l.setStyle(d, "cursor", "col-resize"), l.setStyle(d, "left", `${s + i - n}px`), l.setStyle(d, "top", `${o}px`), l.setStyle(d, "width", `${n}px`), l.setStyle(d, "height", `${r}px`), l.appendChild(a, d);
|
|
1880
1902
|
}
|
|
1881
1903
|
}
|
|
1882
|
-
class
|
|
1904
|
+
class ye {
|
|
1883
1905
|
constructor(e, t) {
|
|
1884
1906
|
this.columnIndex = e, this.sortState = t;
|
|
1885
1907
|
}
|
|
1886
1908
|
}
|
|
1887
|
-
class
|
|
1909
|
+
class ve {
|
|
1888
1910
|
constructor(e) {
|
|
1889
1911
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1890
1912
|
}
|
|
@@ -1898,15 +1920,15 @@ class ye {
|
|
|
1898
1920
|
*/
|
|
1899
1921
|
onHostElementChanged(e) {
|
|
1900
1922
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1901
|
-
const t = e.target,
|
|
1902
|
-
if (
|
|
1903
|
-
const r =
|
|
1923
|
+
const t = e.target, s = t.getAttribute("data-area"), o = t.getAttribute("data-row-index"), i = t.getAttribute("data-col-index");
|
|
1924
|
+
if (s && o && i) {
|
|
1925
|
+
const r = _(s), a = Number(o), l = Number(i);
|
|
1904
1926
|
this.tableScope.updateModelValueAfterEdit(r, a, l, t.value);
|
|
1905
1927
|
}
|
|
1906
1928
|
}
|
|
1907
1929
|
}
|
|
1908
1930
|
}
|
|
1909
|
-
class
|
|
1931
|
+
class we {
|
|
1910
1932
|
constructor(e = -1, t = -1) {
|
|
1911
1933
|
this.rowIndex = e, this.columnIndex = t;
|
|
1912
1934
|
}
|
|
@@ -1916,34 +1938,34 @@ class N {
|
|
|
1916
1938
|
this.cells = e;
|
|
1917
1939
|
}
|
|
1918
1940
|
static createSingle(e, t) {
|
|
1919
|
-
return new N([new
|
|
1941
|
+
return new N([new we(e, t)]);
|
|
1920
1942
|
}
|
|
1921
1943
|
}
|
|
1922
1944
|
class Ce {
|
|
1923
1945
|
constructor(e) {
|
|
1924
|
-
var t,
|
|
1925
|
-
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (
|
|
1946
|
+
var t, s;
|
|
1947
|
+
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);
|
|
1926
1948
|
}
|
|
1927
1949
|
onMouseClicked(e, t) {
|
|
1928
1950
|
var i, r, a, l, n, d, h;
|
|
1929
|
-
let
|
|
1951
|
+
let s = !1, o = !1;
|
|
1930
1952
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1931
1953
|
const c = this.getSelectionModel(), f = this.getFocusModel();
|
|
1932
|
-
c && f && (f.hasFocus(e.rowIndex, e.columnIndex) || (f.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(f),
|
|
1954
|
+
c && f && (f.hasFocus(e.rowIndex, e.columnIndex) || (f.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(f), s = !0), (i = e.originalEvent) != null && i.shiftKey || c.hasSelection() && (c.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (c.addSelection(this.createRangeByEvents(e, this.previousEvt)), o = !0, s = !0) : (a = e.originalEvent) != null && a.altKey && ((l = e.originalEvent) != null && l.ctrlKey || (n = e.originalEvent) != null && n.metaKey) ? (c.removeSelection(E.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (d = e.originalEvent) != null && d.ctrlKey || (h = e.originalEvent) != null && h.metaKey ? (c.addSelection(E.singleCell(e.rowIndex, e.columnIndex)), o = !0, s = !0) : (c.firstClick(e.rowIndex, e.columnIndex), s = !0), this.tableScope.onSelectionChanged(c));
|
|
1933
1955
|
}
|
|
1934
|
-
return
|
|
1956
|
+
return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1935
1957
|
}
|
|
1936
1958
|
onActionTriggered(e) {
|
|
1937
1959
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1938
|
-
const t = this.getSelectionModel(),
|
|
1939
|
-
if (t &&
|
|
1960
|
+
const t = this.getSelectionModel(), s = this.getFocusModel();
|
|
1961
|
+
if (t && s) {
|
|
1940
1962
|
if (e === "SELECT_ALL")
|
|
1941
1963
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1942
1964
|
if (e === "DESELECT_ALL")
|
|
1943
1965
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
1944
1966
|
if (e === "TOGGLE_SELECTION") {
|
|
1945
|
-
const [
|
|
1946
|
-
return t.togglePoint(
|
|
1967
|
+
const [o, i] = s.getFocus();
|
|
1968
|
+
return t.togglePoint(o, i), this.tableScope.repaint(), !0;
|
|
1947
1969
|
}
|
|
1948
1970
|
}
|
|
1949
1971
|
}
|
|
@@ -1951,16 +1973,16 @@ class Ce {
|
|
|
1951
1973
|
}
|
|
1952
1974
|
createRangeByEvents(e, t) {
|
|
1953
1975
|
t || (t = e);
|
|
1954
|
-
const
|
|
1976
|
+
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);
|
|
1955
1977
|
return E.create({
|
|
1956
|
-
rowIndex1:
|
|
1978
|
+
rowIndex1: s,
|
|
1957
1979
|
columnIndex1: i,
|
|
1958
|
-
rowIndex2:
|
|
1980
|
+
rowIndex2: o,
|
|
1959
1981
|
columnIndex2: r
|
|
1960
1982
|
});
|
|
1961
1983
|
}
|
|
1962
1984
|
}
|
|
1963
|
-
class
|
|
1985
|
+
class xe {
|
|
1964
1986
|
get() {
|
|
1965
1987
|
return {
|
|
1966
1988
|
f2: "START_EDITING",
|
|
@@ -1980,7 +2002,7 @@ class we {
|
|
|
1980
2002
|
};
|
|
1981
2003
|
}
|
|
1982
2004
|
}
|
|
1983
|
-
class
|
|
2005
|
+
class Ee {
|
|
1984
2006
|
get() {
|
|
1985
2007
|
return {
|
|
1986
2008
|
f2: "START_EDITING",
|
|
@@ -2002,7 +2024,7 @@ class xe {
|
|
|
2002
2024
|
};
|
|
2003
2025
|
}
|
|
2004
2026
|
}
|
|
2005
|
-
class
|
|
2027
|
+
class Ae {
|
|
2006
2028
|
constructor(e) {
|
|
2007
2029
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
2008
2030
|
}
|
|
@@ -2023,7 +2045,7 @@ class Ee {
|
|
|
2023
2045
|
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));
|
|
2024
2046
|
}
|
|
2025
2047
|
assignPredefinedSystemShortcutMappings() {
|
|
2026
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
2048
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Ee().get()) : Object.assign(this.shortcutActionIdMapping, new xe().get());
|
|
2027
2049
|
}
|
|
2028
2050
|
isMacintosh() {
|
|
2029
2051
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2041,24 +2063,24 @@ class Ee {
|
|
|
2041
2063
|
emit(e) {
|
|
2042
2064
|
this.isDebug() && console.debug("ShortcutService emit :", e);
|
|
2043
2065
|
let t = !1;
|
|
2044
|
-
for (const
|
|
2045
|
-
|
|
2066
|
+
for (const s of this.listener)
|
|
2067
|
+
s.onActionTriggered(e) && (t = !0);
|
|
2046
2068
|
return t;
|
|
2047
2069
|
}
|
|
2048
2070
|
findEntity(e) {
|
|
2049
2071
|
const t = this.getTokenByEvent(e);
|
|
2050
2072
|
this.isDebug() && console.debug("ShortcutService tokens :", t);
|
|
2051
|
-
for (const
|
|
2052
|
-
const
|
|
2053
|
-
if (this.areTokensEquals(t,
|
|
2054
|
-
return this.shortcutActionIdMapping[
|
|
2073
|
+
for (const s in this.shortcutActionIdMapping) {
|
|
2074
|
+
const o = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[+ ]/g).sort();
|
|
2075
|
+
if (this.areTokensEquals(t, o))
|
|
2076
|
+
return this.shortcutActionIdMapping[s];
|
|
2055
2077
|
}
|
|
2056
2078
|
}
|
|
2057
2079
|
areTokensEquals(e, t) {
|
|
2058
2080
|
if (e.length !== t.length || e.length === 0)
|
|
2059
2081
|
return !1;
|
|
2060
|
-
for (let
|
|
2061
|
-
if (e[
|
|
2082
|
+
for (let s = 0; s < e.length; s++)
|
|
2083
|
+
if (e[s] !== t[s])
|
|
2062
2084
|
return !1;
|
|
2063
2085
|
return !0;
|
|
2064
2086
|
}
|
|
@@ -2096,18 +2118,18 @@ class K {
|
|
|
2096
2118
|
}
|
|
2097
2119
|
}
|
|
2098
2120
|
class Z {
|
|
2099
|
-
setStyle(e, t,
|
|
2100
|
-
return e.style[t] =
|
|
2121
|
+
setStyle(e, t, s) {
|
|
2122
|
+
return e.style[t] = s, e;
|
|
2101
2123
|
}
|
|
2102
2124
|
appendText(e, t) {
|
|
2103
|
-
const
|
|
2104
|
-
return this.appendChild(e,
|
|
2125
|
+
const s = this.createText(t);
|
|
2126
|
+
return this.appendChild(e, s), s;
|
|
2105
2127
|
}
|
|
2106
2128
|
addClass(e, t) {
|
|
2107
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2129
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
2108
2130
|
}
|
|
2109
2131
|
removeClass(e, t) {
|
|
2110
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2132
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
2111
2133
|
}
|
|
2112
2134
|
appendChild(e, t) {
|
|
2113
2135
|
e.appendChild(t);
|
|
@@ -2118,15 +2140,15 @@ class Z {
|
|
|
2118
2140
|
createText(e) {
|
|
2119
2141
|
return document.createTextNode(e);
|
|
2120
2142
|
}
|
|
2121
|
-
setAttribute(e, t,
|
|
2122
|
-
e.setAttribute(t,
|
|
2143
|
+
setAttribute(e, t, s) {
|
|
2144
|
+
e.setAttribute(t, s);
|
|
2123
2145
|
}
|
|
2124
2146
|
}
|
|
2125
|
-
class
|
|
2126
|
-
render(e, t,
|
|
2127
|
-
if (i.isEditable(t,
|
|
2147
|
+
class Me {
|
|
2148
|
+
render(e, t, s, o, i, r, a) {
|
|
2149
|
+
if (i.isEditable(t, s)) {
|
|
2128
2150
|
a.addClass(e, "ge-table-row-input-div");
|
|
2129
|
-
const l = i.getValueAt(t,
|
|
2151
|
+
const l = i.getValueAt(t, s);
|
|
2130
2152
|
e.innerHTML = `
|
|
2131
2153
|
<input
|
|
2132
2154
|
type="text"
|
|
@@ -2134,16 +2156,16 @@ class Ae {
|
|
|
2134
2156
|
autofocus
|
|
2135
2157
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
2136
2158
|
data-listen="change"
|
|
2137
|
-
data-area="${
|
|
2159
|
+
data-area="${o}"
|
|
2138
2160
|
data-row-index="${t}"
|
|
2139
|
-
data-col-index="${
|
|
2161
|
+
data-col-index="${s}"
|
|
2140
2162
|
data-input-type="text"
|
|
2141
2163
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
2142
2164
|
class="ge-table-cell-editor-input">`;
|
|
2143
2165
|
}
|
|
2144
2166
|
}
|
|
2145
2167
|
}
|
|
2146
|
-
class
|
|
2168
|
+
class Re {
|
|
2147
2169
|
constructor(e = "none", t = "single") {
|
|
2148
2170
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
|
|
2149
2171
|
}
|
|
@@ -2165,14 +2187,14 @@ class Me {
|
|
|
2165
2187
|
this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
|
|
2166
2188
|
}
|
|
2167
2189
|
getSelectionCount(e, t) {
|
|
2168
|
-
let
|
|
2169
|
-
for (const
|
|
2170
|
-
|
|
2171
|
-
return this.allSelected &&
|
|
2190
|
+
let s = 0;
|
|
2191
|
+
for (const o of this.ranges)
|
|
2192
|
+
o.isInRange(e, t) && s++;
|
|
2193
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
2172
2194
|
}
|
|
2173
2195
|
isInNegativeRange(e, t) {
|
|
2174
|
-
for (const
|
|
2175
|
-
if (
|
|
2196
|
+
for (const s of this.negativeRanges)
|
|
2197
|
+
if (s.isInRange(e, t))
|
|
2176
2198
|
return !0;
|
|
2177
2199
|
return !1;
|
|
2178
2200
|
}
|
|
@@ -2196,8 +2218,8 @@ class Me {
|
|
|
2196
2218
|
getMergedRowIndices() {
|
|
2197
2219
|
const e = /* @__PURE__ */ new Set();
|
|
2198
2220
|
for (const t of this.ranges)
|
|
2199
|
-
for (let
|
|
2200
|
-
!e.has(
|
|
2221
|
+
for (let s = t.r1; s <= t.r2; s++)
|
|
2222
|
+
!e.has(s) && !this.isInNegativeRange(s, 0) && e.add(s);
|
|
2201
2223
|
return Array.from(e);
|
|
2202
2224
|
}
|
|
2203
2225
|
selectAll() {
|
|
@@ -2225,7 +2247,7 @@ class Me {
|
|
|
2225
2247
|
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());
|
|
2226
2248
|
}
|
|
2227
2249
|
}
|
|
2228
|
-
class
|
|
2250
|
+
class Te {
|
|
2229
2251
|
constructor(e = "none") {
|
|
2230
2252
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1, this.listenerArr = [];
|
|
2231
2253
|
}
|
|
@@ -2276,14 +2298,14 @@ class ee {
|
|
|
2276
2298
|
}
|
|
2277
2299
|
// `⊖ `, `⊕ `;
|
|
2278
2300
|
}
|
|
2279
|
-
const
|
|
2301
|
+
const De = new Re(), ke = new Te("cell");
|
|
2280
2302
|
class te {
|
|
2281
2303
|
constructor() {
|
|
2282
2304
|
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 = {
|
|
2283
2305
|
header: 34,
|
|
2284
2306
|
body: 34,
|
|
2285
2307
|
footer: 34
|
|
2286
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new J(), this.headerGroupOptions = new ee(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Q(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new
|
|
2308
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new J(), this.headerGroupOptions = new ee(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new Q(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new Me(), this.getSelectionModel = () => De, this.getFocusModel = () => ke;
|
|
2287
2309
|
}
|
|
2288
2310
|
}
|
|
2289
2311
|
const I = class I {
|
|
@@ -2296,8 +2318,8 @@ const I = class I {
|
|
|
2296
2318
|
* @return {Promise<string>} A promise that resolves to the copied content as a string.
|
|
2297
2319
|
* @throws {string} Throws an error if neither selection nor focus is defined.
|
|
2298
2320
|
*/
|
|
2299
|
-
createContent(e, t,
|
|
2300
|
-
return new Promise((
|
|
2321
|
+
createContent(e, t, s) {
|
|
2322
|
+
return new Promise((o, i) => {
|
|
2301
2323
|
if (t != null && t.hasSelection()) {
|
|
2302
2324
|
const r = this.mergeRanges(t.getRanges());
|
|
2303
2325
|
if (r) {
|
|
@@ -2311,12 +2333,12 @@ const I = class I {
|
|
|
2311
2333
|
}
|
|
2312
2334
|
a.push(n.join(I.columnSeparatorChar));
|
|
2313
2335
|
}
|
|
2314
|
-
return
|
|
2336
|
+
return o(a.join(I.rowSeparatorChar));
|
|
2315
2337
|
}
|
|
2316
2338
|
}
|
|
2317
|
-
if (
|
|
2318
|
-
const [r, a] =
|
|
2319
|
-
return
|
|
2339
|
+
if (s) {
|
|
2340
|
+
const [r, a] = s.getFocus(), l = e.getBodyModel().getTextValueAt(r, a);
|
|
2341
|
+
return o(l);
|
|
2320
2342
|
}
|
|
2321
2343
|
i("Cannot copy, neither selection nor focus defined.");
|
|
2322
2344
|
});
|
|
@@ -2338,15 +2360,15 @@ const I = class I {
|
|
|
2338
2360
|
* @param {FocusModelIf} focusModel - The focus model of the table.
|
|
2339
2361
|
* @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
|
|
2340
2362
|
*/
|
|
2341
|
-
copyToClipboard(e, t,
|
|
2342
|
-
return new Promise((
|
|
2363
|
+
copyToClipboard(e, t, s) {
|
|
2364
|
+
return new Promise((o, i) => {
|
|
2343
2365
|
this.createContent(
|
|
2344
2366
|
e,
|
|
2345
2367
|
t,
|
|
2346
|
-
|
|
2368
|
+
s
|
|
2347
2369
|
).then((r) => {
|
|
2348
2370
|
r && this.copyContent(r).then((a) => {
|
|
2349
|
-
|
|
2371
|
+
o(r);
|
|
2350
2372
|
}).catch((a) => {
|
|
2351
2373
|
i();
|
|
2352
2374
|
});
|
|
@@ -2363,22 +2385,31 @@ const I = class I {
|
|
|
2363
2385
|
*/
|
|
2364
2386
|
mergeRanges(e) {
|
|
2365
2387
|
let t;
|
|
2366
|
-
for (const
|
|
2367
|
-
t ? (t.r1 = Math.min(t.r1,
|
|
2388
|
+
for (const s of e)
|
|
2389
|
+
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 E(s.r1, s.c1, s.r2, s.c2);
|
|
2368
2390
|
return t;
|
|
2369
2391
|
}
|
|
2370
2392
|
};
|
|
2371
2393
|
I.columnSeparatorChar = " ", I.rowSeparatorChar = `
|
|
2372
2394
|
`;
|
|
2373
2395
|
let L = I;
|
|
2374
|
-
class
|
|
2375
|
-
constructor(e
|
|
2396
|
+
class Ie {
|
|
2397
|
+
constructor(e) {
|
|
2398
|
+
this.tableScope = e, new ResizeObserver(le(this.handleResize.bind(this), 500)).observe(this.tableScope.hostElement);
|
|
2399
|
+
}
|
|
2400
|
+
handleResize(e) {
|
|
2401
|
+
const t = e[0], { width: s } = t.contentRect;
|
|
2402
|
+
this.tableScope.recalcColumnWidths(s);
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
class j extends me {
|
|
2406
|
+
constructor(e, t, s, o, i, r = new L()) {
|
|
2376
2407
|
var n;
|
|
2377
|
-
if (super(e, t, new
|
|
2408
|
+
if (super(e, t, new ae(s), o), this.eventListener = i, this.copyService = r, this.licenseManager = k.getInstance(), this.selectionService = new Ce(this), this.api = new he(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.lastDragFrom = -1, this.lastDragTo = -1, this.firstDraggingRendering = !0, i || (this.eventListener = new K()), (n = this.tableOptions) != null && n.autoRestoreOptions) {
|
|
2378
2409
|
const d = this.tableOptions.autoRestoreOptions, h = d.getStorageKeyFn;
|
|
2379
|
-
h && (d.autoRestoreScrollPosition && (this.storeScrollPosStateService = new
|
|
2410
|
+
h && (d.autoRestoreScrollPosition && (this.storeScrollPosStateService = new ce(h)), d.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new pe(h)), d.autoRestoreSortingState && (this.storeSortingService = new be(h)));
|
|
2380
2411
|
}
|
|
2381
|
-
this.mouseHandler = new
|
|
2412
|
+
this.mouseHandler = new de(this), this.inputHandler = new ve(this), this.resizeHandler = new Ie(this), this.shortcutService = new Ae(this), this.shortcutService.addListener(this.selectionService);
|
|
2382
2413
|
const a = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2383
2414
|
a && a.addEventSelectionChangedListener(this);
|
|
2384
2415
|
const l = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
@@ -2396,8 +2427,8 @@ class j extends fe {
|
|
|
2396
2427
|
*
|
|
2397
2428
|
* @return {TableScope} - The newly created TableScope instance.
|
|
2398
2429
|
*/
|
|
2399
|
-
static create(e, t,
|
|
2400
|
-
return new j(e, t, i,
|
|
2430
|
+
static create(e, t, s = new te(), o = new K(), i = new Z(), r = new L()) {
|
|
2431
|
+
return new j(e, t, i, s, o, r);
|
|
2401
2432
|
}
|
|
2402
2433
|
/**
|
|
2403
2434
|
* Triggers an action based on the provided actionId.
|
|
@@ -2413,19 +2444,19 @@ class j extends fe {
|
|
|
2413
2444
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
2414
2445
|
const t = this.getFocusModel();
|
|
2415
2446
|
if (t) {
|
|
2416
|
-
const [
|
|
2417
|
-
this.tableModel.getBodyModel().isEditable(
|
|
2447
|
+
const [s, o] = t.getFocus();
|
|
2448
|
+
this.tableModel.getBodyModel().isEditable(s, o) && (this.clearSelection(), this.initRenderEditor(s, o));
|
|
2418
2449
|
}
|
|
2419
2450
|
return !0;
|
|
2420
2451
|
}
|
|
2421
2452
|
if (e === "COPY_2_CLIPBOARD") {
|
|
2422
|
-
const t = this.getSelectionModel ? this.getSelectionModel() : void 0,
|
|
2423
|
-
this.copyService.createContent(this.tableModel, t,
|
|
2453
|
+
const t = this.getSelectionModel ? this.getSelectionModel() : void 0, s = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2454
|
+
this.copyService.createContent(this.tableModel, t, s).then((o) => this.copyService.copyContent(o));
|
|
2424
2455
|
}
|
|
2425
2456
|
return !1;
|
|
2426
2457
|
}
|
|
2427
|
-
updateModelValueAfterEdit(e, t,
|
|
2428
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t,
|
|
2458
|
+
updateModelValueAfterEdit(e, t, s, o) {
|
|
2459
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, o) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(N.createSingle(t, s)), this.hostElement.focus());
|
|
2429
2460
|
}
|
|
2430
2461
|
/**
|
|
2431
2462
|
* Retrieves the TableApi object.
|
|
@@ -2454,16 +2485,16 @@ class j extends fe {
|
|
|
2454
2485
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
2455
2486
|
*/
|
|
2456
2487
|
createGeMouseEvent(e) {
|
|
2457
|
-
const t = new
|
|
2488
|
+
const t = new z();
|
|
2458
2489
|
if (t.originalEvent = e, e) {
|
|
2459
|
-
const
|
|
2460
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
2461
|
-
const
|
|
2462
|
-
t.rowTop =
|
|
2490
|
+
const s = e.target;
|
|
2491
|
+
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(s), t.rowIndex = this.getNumberByAttr(s, "data-row-index"), t.columnIndex = this.getNumberByAttr(s, "data-col-index"), t.action = this.getStringByAttr(s, "data-ge-action"), t.areaIdent) {
|
|
2492
|
+
const o = this.tableModel.getAreaModel(t.areaIdent);
|
|
2493
|
+
t.rowTop = o.getYPosByRowIndex(t.rowIndex);
|
|
2463
2494
|
}
|
|
2464
2495
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
2465
|
-
const
|
|
2466
|
-
this.debugOnce(i,
|
|
2496
|
+
const o = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, i = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
2497
|
+
this.debugOnce(i, o);
|
|
2467
2498
|
}
|
|
2468
2499
|
}
|
|
2469
2500
|
return t;
|
|
@@ -2522,9 +2553,9 @@ class j extends fe {
|
|
|
2522
2553
|
* @return {void}
|
|
2523
2554
|
*/
|
|
2524
2555
|
toggleExpandCollapseAll(e = !0) {
|
|
2525
|
-
var
|
|
2556
|
+
var s;
|
|
2526
2557
|
const t = this.tableModel.getBodyModel();
|
|
2527
|
-
|
|
2558
|
+
P(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2528
2559
|
}
|
|
2529
2560
|
/**
|
|
2530
2561
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -2535,11 +2566,11 @@ class j extends fe {
|
|
|
2535
2566
|
*
|
|
2536
2567
|
* @return {void} - This method does not return anything.
|
|
2537
2568
|
*/
|
|
2538
|
-
toggleRowCheckbox(e, t,
|
|
2569
|
+
toggleRowCheckbox(e, t, s) {
|
|
2539
2570
|
var l;
|
|
2540
|
-
const
|
|
2541
|
-
|
|
2542
|
-
const a = (l =
|
|
2571
|
+
const o = this.tableModel.getAreaModel(s), i = o.isRowChecked(e), r = i === void 0 || i === "semi" || i === "none";
|
|
2572
|
+
o.setRowChecked(e, r), this.repaint();
|
|
2573
|
+
const a = (l = o.rowSelectionModel) == null ? void 0 : l.getCheckedRows();
|
|
2543
2574
|
this.eventListener.onCheckboxChanged(a || []);
|
|
2544
2575
|
}
|
|
2545
2576
|
/**
|
|
@@ -2550,13 +2581,13 @@ class j extends fe {
|
|
|
2550
2581
|
* @returns {void}
|
|
2551
2582
|
*/
|
|
2552
2583
|
onMouseClicked(e, t) {
|
|
2553
|
-
let
|
|
2554
|
-
if (!
|
|
2584
|
+
let s = this.selectionService.onMouseClicked(e, t);
|
|
2585
|
+
if (!s && this.getFocusModel) {
|
|
2555
2586
|
this.resetEditorRenderer();
|
|
2556
|
-
const
|
|
2557
|
-
|
|
2587
|
+
const o = this.getFocusModel();
|
|
2588
|
+
o && (s = o.hasChanged(), o.clearChanged());
|
|
2558
2589
|
}
|
|
2559
|
-
return
|
|
2590
|
+
return s;
|
|
2560
2591
|
}
|
|
2561
2592
|
debounceRepaint() {
|
|
2562
2593
|
this.debounce(this.repaint.bind(this), 1);
|
|
@@ -2589,13 +2620,13 @@ class j extends fe {
|
|
|
2589
2620
|
*
|
|
2590
2621
|
* @return {void}
|
|
2591
2622
|
*/
|
|
2592
|
-
onHeaderDblClicked(e, t,
|
|
2623
|
+
onHeaderDblClicked(e, t, s) {
|
|
2593
2624
|
var i, r;
|
|
2594
|
-
const
|
|
2595
|
-
if (
|
|
2625
|
+
const o = this.tableModel.getColumnDef(s);
|
|
2626
|
+
if (o != null && o.sortable && o.sortable()) {
|
|
2596
2627
|
e.preventDefault(), e.stopPropagation();
|
|
2597
|
-
const a =
|
|
2598
|
-
this.tableModel.doSort([d]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((c) => c.sortState = ""),
|
|
2628
|
+
const a = o.sortStatesOrder ? o.sortStatesOrder : this.tableOptions.sortOrder, l = o.sortState ?? "", n = a[(a.indexOf(l) + 1) % a.length], d = new ye(s, n);
|
|
2629
|
+
this.tableModel.doSort([d]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((c) => c.sortState = ""), o.sortState = n), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
|
|
2599
2630
|
}
|
|
2600
2631
|
}
|
|
2601
2632
|
/**
|
|
@@ -2617,8 +2648,8 @@ class j extends fe {
|
|
|
2617
2648
|
* @return {void}
|
|
2618
2649
|
*/
|
|
2619
2650
|
scrollToIndex(e, t) {
|
|
2620
|
-
const
|
|
2621
|
-
this.scrollToPixel(0,
|
|
2651
|
+
const o = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2652
|
+
this.scrollToPixel(0, o);
|
|
2622
2653
|
}
|
|
2623
2654
|
/**
|
|
2624
2655
|
* Sets the selection model for the table.
|
|
@@ -2629,8 +2660,8 @@ class j extends fe {
|
|
|
2629
2660
|
* @return {void} - This method does not return any value.
|
|
2630
2661
|
*/
|
|
2631
2662
|
setSelectionModel(e, t = !1) {
|
|
2632
|
-
const
|
|
2633
|
-
this.tableOptions.getSelectionModel =
|
|
2663
|
+
const s = () => e;
|
|
2664
|
+
this.tableOptions.getSelectionModel = s, this.getSelectionModel = s, this.selectionService.getSelectionModel = s, t && this.repaint();
|
|
2634
2665
|
}
|
|
2635
2666
|
toggleHeaderGroup(e) {
|
|
2636
2667
|
const t = this.tableModel.getAreaModel("header");
|
|
@@ -2665,10 +2696,10 @@ class j extends fe {
|
|
|
2665
2696
|
*/
|
|
2666
2697
|
changeFocusCell(e, t) {
|
|
2667
2698
|
if (!this.isEditing() && this.getFocusModel) {
|
|
2668
|
-
const
|
|
2669
|
-
if (
|
|
2670
|
-
const [
|
|
2671
|
-
return
|
|
2699
|
+
const s = this.getFocusModel();
|
|
2700
|
+
if (s) {
|
|
2701
|
+
const [o, i] = s.getFocus();
|
|
2702
|
+
return s.setFocus(o + t, i + e), this.repaint(), !0;
|
|
2672
2703
|
}
|
|
2673
2704
|
}
|
|
2674
2705
|
return !1;
|
|
@@ -2691,8 +2722,8 @@ class j extends fe {
|
|
|
2691
2722
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
2692
2723
|
}
|
|
2693
2724
|
debugOnce(e, t) {
|
|
2694
|
-
var
|
|
2695
|
-
console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (
|
|
2725
|
+
var s;
|
|
2726
|
+
console.clear(), console.info("this.hostElement.offsetTop", this.hostElement.offsetTop), console.info("this.hostElement.scrollHeight", this.hostElement.scrollHeight), console.info("this.scrollViewportTop", this.scrollTop), console.info("this.areaHeaderCenter.parent.clientHeight", this.areaHeaderCenter.parent.clientHeight), console.info("bodyY", t), console.info("bodyX", e), console.info("rows", this.firstVisibleRowIndex), console.info(""), console.info("this.tableModel", this.tableModel), console.info(""), console.info("this.mouseMoveEvent.clientX", (s = this.mouseHandler.mouseEvent) == null ? void 0 : s.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
|
|
2696
2727
|
}
|
|
2697
2728
|
/**
|
|
2698
2729
|
* Restores the scroll position of the table if auto restore options are enabled.
|
|
@@ -2703,8 +2734,8 @@ class j extends fe {
|
|
|
2703
2734
|
autoRestoreScrollPosition() {
|
|
2704
2735
|
var e;
|
|
2705
2736
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
2706
|
-
const
|
|
2707
|
-
|
|
2737
|
+
const s = this.storeScrollPosStateService.getScrollOffset();
|
|
2738
|
+
s && this.scrollViewport.scrollTo(...s);
|
|
2708
2739
|
}
|
|
2709
2740
|
}
|
|
2710
2741
|
/**
|
|
@@ -2724,8 +2755,8 @@ class j extends fe {
|
|
|
2724
2755
|
autoRestoreSortingState() {
|
|
2725
2756
|
var e, t;
|
|
2726
2757
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
2727
|
-
const
|
|
2728
|
-
|
|
2758
|
+
const s = this.storeSortingService.getSortItems();
|
|
2759
|
+
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
2729
2760
|
}
|
|
2730
2761
|
}
|
|
2731
2762
|
/**
|
|
@@ -2737,10 +2768,10 @@ class j extends fe {
|
|
|
2737
2768
|
autoRestoreCollapsedExpandedState() {
|
|
2738
2769
|
var e, t;
|
|
2739
2770
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2740
|
-
const
|
|
2741
|
-
if (
|
|
2771
|
+
const s = this.tableOptions.autoRestoreOptions, o = s.getRowId;
|
|
2772
|
+
if (s.autoRestoreCollapsedExpandedState && o) {
|
|
2742
2773
|
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
2743
|
-
if (
|
|
2774
|
+
if (P(r)) {
|
|
2744
2775
|
const a = r, l = r.getRowCount();
|
|
2745
2776
|
for (let n = 0; n < l; n++) {
|
|
2746
2777
|
const d = r.getRowByIndex(n);
|
|
@@ -2750,7 +2781,7 @@ class j extends fe {
|
|
|
2750
2781
|
else if (i.allCollapsed)
|
|
2751
2782
|
d.expanded = !1;
|
|
2752
2783
|
else {
|
|
2753
|
-
const h =
|
|
2784
|
+
const h = o(d.data);
|
|
2754
2785
|
i.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h) : i.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h));
|
|
2755
2786
|
}
|
|
2756
2787
|
}
|
|
@@ -3001,36 +3032,36 @@ const B = class B {
|
|
|
3001
3032
|
constructor(e = new ee()) {
|
|
3002
3033
|
this.headerGroupOptions = e;
|
|
3003
3034
|
}
|
|
3004
|
-
render(e, t,
|
|
3035
|
+
render(e, t, s, o, i, r, a) {
|
|
3005
3036
|
const l = r != null && r.data ? r.data : "";
|
|
3006
3037
|
if (r) {
|
|
3007
3038
|
const { toggle: n, visibility: d, closed: h } = r, c = n ? B.toggleHeaderGroup : "";
|
|
3008
|
-
this.addText(e,
|
|
3039
|
+
this.addText(e, o, t, s, l, c), n && d !== "always" && this.addArrowDiv(a, e, !h, t, s, o, c);
|
|
3009
3040
|
} else
|
|
3010
|
-
this.addText(e,
|
|
3041
|
+
this.addText(e, o, t, s, l, "");
|
|
3011
3042
|
}
|
|
3012
|
-
addText(e, t,
|
|
3043
|
+
addText(e, t, s, o, i, r) {
|
|
3013
3044
|
e.innerHTML = `<span
|
|
3014
3045
|
data-ge-action="${r}"
|
|
3015
3046
|
data-area="${t}"
|
|
3016
|
-
data-row-index="${
|
|
3017
|
-
data-col-index="${
|
|
3047
|
+
data-row-index="${s}"
|
|
3048
|
+
data-col-index="${o}"
|
|
3018
3049
|
>${i}</span>`;
|
|
3019
3050
|
}
|
|
3020
|
-
addArrowDiv(e, t,
|
|
3051
|
+
addArrowDiv(e, t, s = !0, o = -1, i = -1, r = "header", a) {
|
|
3021
3052
|
const l = e.createElement("div");
|
|
3022
|
-
e.addClass(l, "ge-table-toggle-icon-div"), e.setStyle(l, "display", "inline-block"), e.setStyle(l, "position", ""), e.setStyle(l, "width", "20px"), e.setStyle(l, "background", "transparent"), e.setStyle(l, "cursor", "pointer"), e.setAttribute(l, "data-row-index", `${
|
|
3053
|
+
e.addClass(l, "ge-table-toggle-icon-div"), e.setStyle(l, "display", "inline-block"), e.setStyle(l, "position", ""), e.setStyle(l, "width", "20px"), e.setStyle(l, "background", "transparent"), e.setStyle(l, "cursor", "pointer"), e.setAttribute(l, "data-row-index", `${o}`), e.setAttribute(l, "data-col-index", `${i}`), e.setAttribute(l, "data-area", `${r}`), e.setAttribute(l, "data-ge-action", `${a}`);
|
|
3023
3054
|
let n;
|
|
3024
|
-
|
|
3055
|
+
s ? n = this.headerGroupOptions.iconExpanded : n = this.headerGroupOptions.iconCollapsed;
|
|
3025
3056
|
const d = n.content, h = e.createText(d);
|
|
3026
3057
|
e.appendChild(l, h), n.style && this.applyStyleString(e, l, n.style);
|
|
3027
3058
|
for (const c of n.classes)
|
|
3028
3059
|
e.addClass(l, c);
|
|
3029
3060
|
return e.appendChild(t, l), l;
|
|
3030
3061
|
}
|
|
3031
|
-
applyStyleString(e, t,
|
|
3032
|
-
const
|
|
3033
|
-
for (const i of
|
|
3062
|
+
applyStyleString(e, t, s) {
|
|
3063
|
+
const o = s.split(";").map((i) => i.trim()).filter((i) => i);
|
|
3064
|
+
for (const i of o) {
|
|
3034
3065
|
const [r, a] = i.split(":");
|
|
3035
3066
|
e.setStyle(t, r.trim(), a.trim());
|
|
3036
3067
|
}
|
|
@@ -3038,12 +3069,12 @@ const B = class B {
|
|
|
3038
3069
|
};
|
|
3039
3070
|
B.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3040
3071
|
let q = B;
|
|
3041
|
-
function
|
|
3042
|
-
tableModel:
|
|
3072
|
+
function $e({
|
|
3073
|
+
tableModel: g,
|
|
3043
3074
|
tableOptions: e = new te(),
|
|
3044
3075
|
mouseMoved: t,
|
|
3045
|
-
checkboxChanged:
|
|
3046
|
-
contextmenu:
|
|
3076
|
+
checkboxChanged: s,
|
|
3077
|
+
contextmenu: o,
|
|
3047
3078
|
modelChanged: i,
|
|
3048
3079
|
mouseClicked: r,
|
|
3049
3080
|
mouseDragging: a,
|
|
@@ -3053,13 +3084,13 @@ function Oe({
|
|
|
3053
3084
|
tableReady: h,
|
|
3054
3085
|
licenseKey: c
|
|
3055
3086
|
}) {
|
|
3056
|
-
const f =
|
|
3087
|
+
const f = oe(null);
|
|
3057
3088
|
let u = !1;
|
|
3058
3089
|
ie(() => {
|
|
3059
3090
|
f.current && !u && (S(f.current), u = !0);
|
|
3060
3091
|
});
|
|
3061
3092
|
const S = (b) => {
|
|
3062
|
-
const
|
|
3093
|
+
const p = {
|
|
3063
3094
|
onSelectionChanged(m) {
|
|
3064
3095
|
n && n(m);
|
|
3065
3096
|
},
|
|
@@ -3067,10 +3098,10 @@ function Oe({
|
|
|
3067
3098
|
d && d(m);
|
|
3068
3099
|
},
|
|
3069
3100
|
onCheckboxChanged: (m) => {
|
|
3070
|
-
|
|
3101
|
+
s && s(m);
|
|
3071
3102
|
},
|
|
3072
3103
|
onContextmenu: (m) => {
|
|
3073
|
-
|
|
3104
|
+
o && o(m);
|
|
3074
3105
|
},
|
|
3075
3106
|
onModelChanged: (m) => {
|
|
3076
3107
|
i && i(m);
|
|
@@ -3089,14 +3120,14 @@ function Oe({
|
|
|
3089
3120
|
}
|
|
3090
3121
|
}, v = new j(
|
|
3091
3122
|
b,
|
|
3092
|
-
|
|
3123
|
+
g,
|
|
3093
3124
|
new Z(),
|
|
3094
3125
|
e,
|
|
3095
|
-
|
|
3126
|
+
p
|
|
3096
3127
|
);
|
|
3097
3128
|
v.firstInit(), h && h(v.getApi()), c && k.getInstance().setLicenseKey(c);
|
|
3098
3129
|
};
|
|
3099
|
-
return /* @__PURE__ */
|
|
3130
|
+
return /* @__PURE__ */ se(
|
|
3100
3131
|
"div",
|
|
3101
3132
|
{
|
|
3102
3133
|
ref: f,
|
|
@@ -3111,30 +3142,30 @@ function Oe({
|
|
|
3111
3142
|
}
|
|
3112
3143
|
);
|
|
3113
3144
|
}
|
|
3114
|
-
var G,
|
|
3145
|
+
var G, F = re;
|
|
3115
3146
|
if (process.env.NODE_ENV === "production")
|
|
3116
|
-
G =
|
|
3147
|
+
G = F.createRoot, F.hydrateRoot;
|
|
3117
3148
|
else {
|
|
3118
|
-
var U =
|
|
3119
|
-
G = function(
|
|
3149
|
+
var U = F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
3150
|
+
G = function(g, e) {
|
|
3120
3151
|
U.usingClientEntryPoint = !0;
|
|
3121
3152
|
try {
|
|
3122
|
-
return
|
|
3153
|
+
return F.createRoot(g, e);
|
|
3123
3154
|
} finally {
|
|
3124
3155
|
U.usingClientEntryPoint = !1;
|
|
3125
3156
|
}
|
|
3126
3157
|
};
|
|
3127
3158
|
}
|
|
3128
|
-
class
|
|
3159
|
+
class Be {
|
|
3129
3160
|
constructor(e) {
|
|
3130
3161
|
this.Component = e, console.info(e);
|
|
3131
3162
|
}
|
|
3132
|
-
render(e, t,
|
|
3163
|
+
render(e, t, s, o, i, r, a) {
|
|
3133
3164
|
const l = {
|
|
3134
3165
|
cellDiv: e,
|
|
3135
3166
|
rowIndex: t,
|
|
3136
|
-
columnIndex:
|
|
3137
|
-
areaIdent:
|
|
3167
|
+
columnIndex: s,
|
|
3168
|
+
areaIdent: o,
|
|
3138
3169
|
areaModel: i,
|
|
3139
3170
|
cellValue: r
|
|
3140
3171
|
}, n = G(e, {});
|
|
@@ -3144,6 +3175,6 @@ class Le {
|
|
|
3144
3175
|
}
|
|
3145
3176
|
}
|
|
3146
3177
|
export {
|
|
3147
|
-
|
|
3148
|
-
|
|
3178
|
+
Be as ComponentRendererWrapper,
|
|
3179
|
+
$e as GuiexpertTable
|
|
3149
3180
|
};
|