@guiexpert/react-table 18.0.11 → 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 +536 -519
- 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
|
}
|
|
@@ -598,30 +606,30 @@ class de {
|
|
|
598
606
|
return this.tableScope.selectionModel();
|
|
599
607
|
}
|
|
600
608
|
}
|
|
601
|
-
class
|
|
609
|
+
class V {
|
|
602
610
|
constructor(e) {
|
|
603
611
|
this.getStorageKeyFn = e;
|
|
604
612
|
}
|
|
605
613
|
autoConvertMapToObject(e) {
|
|
606
614
|
const t = {};
|
|
607
615
|
if (e instanceof Map) {
|
|
608
|
-
const
|
|
609
|
-
for (const
|
|
616
|
+
const s = e;
|
|
617
|
+
for (const o of [...s]) {
|
|
610
618
|
const [
|
|
611
619
|
i,
|
|
612
620
|
r
|
|
613
|
-
] =
|
|
621
|
+
] = o;
|
|
614
622
|
t[i] = r;
|
|
615
623
|
}
|
|
616
624
|
}
|
|
617
625
|
return t;
|
|
618
626
|
}
|
|
619
627
|
checkAndPersistItem(e, t) {
|
|
620
|
-
const
|
|
621
|
-
if (
|
|
622
|
-
const
|
|
623
|
-
if (
|
|
624
|
-
const i =
|
|
628
|
+
const s = this.getStorageKeyFn;
|
|
629
|
+
if (s) {
|
|
630
|
+
const o = s();
|
|
631
|
+
if (o) {
|
|
632
|
+
const i = o + e;
|
|
625
633
|
if ((t + "").includes("Map")) {
|
|
626
634
|
const r = this.autoConvertMapToObject(t);
|
|
627
635
|
this.persistItem(i, r);
|
|
@@ -673,7 +681,7 @@ class z {
|
|
|
673
681
|
// }
|
|
674
682
|
// }
|
|
675
683
|
}
|
|
676
|
-
class
|
|
684
|
+
class ce extends V {
|
|
677
685
|
constructor(e) {
|
|
678
686
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
679
687
|
}
|
|
@@ -688,21 +696,21 @@ class he extends z {
|
|
|
688
696
|
if (e) {
|
|
689
697
|
const t = e();
|
|
690
698
|
if (t) {
|
|
691
|
-
const
|
|
692
|
-
let
|
|
693
|
-
this.scrollOffset =
|
|
699
|
+
const s = t + this.SCROLL_STATE;
|
|
700
|
+
let o = this.loadFromLocalStorage(s);
|
|
701
|
+
this.scrollOffset = o || [0, 0];
|
|
694
702
|
}
|
|
695
703
|
}
|
|
696
704
|
}
|
|
697
705
|
}
|
|
698
|
-
class
|
|
699
|
-
constructor(e = "collapsed", t = [],
|
|
700
|
-
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;
|
|
701
709
|
}
|
|
702
710
|
}
|
|
703
|
-
class
|
|
711
|
+
class pe extends V {
|
|
704
712
|
constructor(e) {
|
|
705
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
713
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new ge(), this.load();
|
|
706
714
|
}
|
|
707
715
|
collapsedExpandedStateGet() {
|
|
708
716
|
return this.collapsedExpandedState;
|
|
@@ -725,8 +733,8 @@ class ge extends z {
|
|
|
725
733
|
if (e) {
|
|
726
734
|
const t = e();
|
|
727
735
|
if (t) {
|
|
728
|
-
const
|
|
729
|
-
|
|
736
|
+
const s = t + this.COLLAPSED_EXPANDED_STATE, o = this.loadFromLocalStorage(s);
|
|
737
|
+
o && (this.collapsedExpandedState = o);
|
|
730
738
|
}
|
|
731
739
|
}
|
|
732
740
|
}
|
|
@@ -734,7 +742,7 @@ class ge extends z {
|
|
|
734
742
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
735
743
|
}
|
|
736
744
|
}
|
|
737
|
-
class
|
|
745
|
+
class be extends V {
|
|
738
746
|
constructor(e) {
|
|
739
747
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
740
748
|
}
|
|
@@ -749,89 +757,89 @@ class pe extends z {
|
|
|
749
757
|
if (e) {
|
|
750
758
|
const t = e();
|
|
751
759
|
if (t) {
|
|
752
|
-
const
|
|
753
|
-
this.sortItems =
|
|
760
|
+
const s = t + this.SORTING_STATE, o = this.loadFromLocalStorage(s);
|
|
761
|
+
this.sortItems = o || [];
|
|
754
762
|
}
|
|
755
763
|
}
|
|
756
764
|
}
|
|
757
765
|
}
|
|
758
766
|
class T {
|
|
759
|
-
constructor(e = 0, t = 0,
|
|
760
|
-
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;
|
|
761
769
|
}
|
|
762
770
|
}
|
|
763
|
-
class
|
|
764
|
-
constructor(e, t,
|
|
765
|
-
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();
|
|
766
774
|
const i = this.hostElement;
|
|
767
775
|
i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
|
|
768
776
|
this.dom.addClass("ge-table", i),
|
|
769
777
|
"position",
|
|
770
778
|
"relative"
|
|
771
|
-
), this.hoverRow =
|
|
772
|
-
|
|
773
|
-
), this.hoverColumn =
|
|
774
|
-
|
|
775
|
-
), this.draggingColumn =
|
|
776
|
-
|
|
777
|
-
), this.areaHeaderWest =
|
|
778
|
-
|
|
779
|
-
|
|
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")
|
|
780
788
|
)
|
|
781
|
-
), this.areaHeaderCenter =
|
|
782
|
-
|
|
783
|
-
|
|
789
|
+
), this.areaHeaderCenter = s.appendRelativeChildDiv(
|
|
790
|
+
s.applyStylePosistionAbsolute(
|
|
791
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
|
|
784
792
|
)
|
|
785
|
-
), this.areaHeaderEast =
|
|
786
|
-
|
|
787
|
-
|
|
793
|
+
), this.areaHeaderEast = s.appendRelativeChildDiv(
|
|
794
|
+
s.applyStylePosistionAbsolute(
|
|
795
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
|
|
788
796
|
)
|
|
789
|
-
), this.areaBodyWest =
|
|
790
|
-
|
|
791
|
-
|
|
797
|
+
), this.areaBodyWest = s.appendRelativeChildDiv(
|
|
798
|
+
s.applyStylePosistionAbsolute(
|
|
799
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
|
|
792
800
|
)
|
|
793
|
-
), this.areaBodyEast =
|
|
794
|
-
|
|
795
|
-
|
|
801
|
+
), this.areaBodyEast = s.appendRelativeChildDiv(
|
|
802
|
+
s.applyStylePosistionAbsolute(
|
|
803
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
|
|
796
804
|
)
|
|
797
|
-
), this.areaFooterWest =
|
|
798
|
-
|
|
799
|
-
|
|
805
|
+
), this.areaFooterWest = s.appendRelativeChildDiv(
|
|
806
|
+
s.applyStylePosistionAbsolute(
|
|
807
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
|
|
800
808
|
)
|
|
801
|
-
), this.areaFooterCenter =
|
|
802
|
-
|
|
803
|
-
|
|
809
|
+
), this.areaFooterCenter = s.appendRelativeChildDiv(
|
|
810
|
+
s.applyStylePosistionAbsolute(
|
|
811
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
|
|
804
812
|
)
|
|
805
|
-
), this.areaFooterEast =
|
|
806
|
-
|
|
807
|
-
|
|
813
|
+
), this.areaFooterEast = s.appendRelativeChildDiv(
|
|
814
|
+
s.applyStylePosistionAbsolute(
|
|
815
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
|
|
808
816
|
)
|
|
809
|
-
), this.scrollViewport =
|
|
817
|
+
), this.scrollViewport = s.applyStyleOverflowAuto(
|
|
810
818
|
this.tableOptions.overflowX ?? "auto",
|
|
811
819
|
this.tableOptions.overflowY ?? "auto",
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
820
|
+
s.applyStyleNoPadding(
|
|
821
|
+
s.applyStylePosistionAbsolute(
|
|
822
|
+
s.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
|
|
815
823
|
)
|
|
816
824
|
)
|
|
817
|
-
), this.contentWrapperDiv =
|
|
818
|
-
|
|
819
|
-
|
|
825
|
+
), this.contentWrapperDiv = s.applyStyleNoPadding(
|
|
826
|
+
s.applyStylePosistionRelative(
|
|
827
|
+
s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
820
828
|
)
|
|
821
|
-
), this.contentDiv =
|
|
822
|
-
|
|
823
|
-
|
|
829
|
+
), this.contentDiv = s.applyStyleNoPadding(
|
|
830
|
+
s.applyStylePosistionRelative(
|
|
831
|
+
s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
824
832
|
)
|
|
825
|
-
), this.areaBodyCenter =
|
|
826
|
-
|
|
827
|
-
), this.borderHeaderBottom =
|
|
828
|
-
|
|
829
|
-
), this.borderFixedWest =
|
|
830
|
-
|
|
831
|
-
), this.borderFixedEast =
|
|
832
|
-
|
|
833
|
-
), this.borderFooterTop =
|
|
834
|
-
|
|
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)
|
|
835
843
|
);
|
|
836
844
|
}
|
|
837
845
|
/**
|
|
@@ -840,10 +848,10 @@ class be {
|
|
|
840
848
|
* @return {void}
|
|
841
849
|
*/
|
|
842
850
|
adjustContainersAndRows() {
|
|
843
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
851
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
|
|
844
852
|
this.dom.applyStyle(this.scrollViewport, {
|
|
845
853
|
width: `${t - e.left}px`,
|
|
846
|
-
height: `${
|
|
854
|
+
height: `${s - e.top}px`,
|
|
847
855
|
top: `${e.top}px`,
|
|
848
856
|
left: `${e.left}px`
|
|
849
857
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -851,21 +859,21 @@ class be {
|
|
|
851
859
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
852
860
|
top: `${this.scrollTop}px`,
|
|
853
861
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
854
|
-
}), 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(
|
|
855
863
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
856
864
|
width: "1px",
|
|
857
865
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
858
866
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
859
867
|
left: `${this.areaBodyWestGeo.width}px`
|
|
860
868
|
})
|
|
861
|
-
) : 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(
|
|
862
870
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
863
871
|
width: "1px",
|
|
864
872
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
865
873
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
866
874
|
left: `${this.areaBodyEastGeo.left}px`
|
|
867
875
|
})
|
|
868
|
-
) : 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, {
|
|
869
877
|
width: `${t - e.left - e.right}px`,
|
|
870
878
|
height: `${e.top}px`,
|
|
871
879
|
top: "0",
|
|
@@ -890,23 +898,23 @@ class be {
|
|
|
890
898
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
891
899
|
width: `${e.left}px`,
|
|
892
900
|
height: `${e.bottom}px`,
|
|
893
|
-
top: `${
|
|
901
|
+
top: `${s - e.bottom}px`,
|
|
894
902
|
left: "0"
|
|
895
903
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
896
904
|
width: `${t - e.left - e.right}px`,
|
|
897
905
|
height: `${e.bottom}px`,
|
|
898
|
-
top: `${
|
|
906
|
+
top: `${s - e.bottom}px`,
|
|
899
907
|
left: `${e.left}px`
|
|
900
908
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
901
909
|
width: `${e.right}px`,
|
|
902
910
|
height: `${e.bottom}px`,
|
|
903
|
-
top: `${
|
|
911
|
+
top: `${s - e.bottom}px`,
|
|
904
912
|
left: `${t - e.right}px`
|
|
905
913
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
906
914
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
907
915
|
width: `${t}px`,
|
|
908
916
|
height: "1px",
|
|
909
|
-
top: `${
|
|
917
|
+
top: `${s - e.bottom}px`,
|
|
910
918
|
left: "0px"
|
|
911
919
|
})
|
|
912
920
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
@@ -941,8 +949,8 @@ class E {
|
|
|
941
949
|
* @param {number} c2 - The value for c2.
|
|
942
950
|
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
943
951
|
*/
|
|
944
|
-
constructor(e, t,
|
|
945
|
-
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;
|
|
946
954
|
}
|
|
947
955
|
static create(e) {
|
|
948
956
|
return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
|
|
@@ -966,7 +974,7 @@ class E {
|
|
|
966
974
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
967
975
|
}
|
|
968
976
|
}
|
|
969
|
-
class
|
|
977
|
+
class Se {
|
|
970
978
|
constructor(e, t) {
|
|
971
979
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
972
980
|
}
|
|
@@ -975,14 +983,14 @@ class ue {
|
|
|
975
983
|
return;
|
|
976
984
|
this.colAndRowspanRanges = [];
|
|
977
985
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
978
|
-
for (let
|
|
979
|
-
for (let
|
|
980
|
-
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);
|
|
981
989
|
if (i > 1 || r > 1) {
|
|
982
990
|
i === 0 && (i = 1), r === 0 && (r = 1);
|
|
983
991
|
const a = "gammaCells" in this.areaModel;
|
|
984
992
|
this.colAndRowspanRanges.push(
|
|
985
|
-
new E(o, s
|
|
993
|
+
new E(s, o, s + r - 1, o + i - 1, a)
|
|
986
994
|
);
|
|
987
995
|
}
|
|
988
996
|
}
|
|
@@ -992,29 +1000,29 @@ class ue {
|
|
|
992
1000
|
}
|
|
993
1001
|
isInRange(e, t) {
|
|
994
1002
|
if (this.colAndRowspanRanges) {
|
|
995
|
-
for (const
|
|
996
|
-
if (
|
|
1003
|
+
for (const s of this.colAndRowspanRanges)
|
|
1004
|
+
if (s.isInRange(e, t))
|
|
997
1005
|
return !0;
|
|
998
1006
|
}
|
|
999
1007
|
return !1;
|
|
1000
1008
|
}
|
|
1001
1009
|
}
|
|
1002
|
-
class
|
|
1003
|
-
constructor(e, t,
|
|
1004
|
-
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;
|
|
1005
1013
|
}
|
|
1006
1014
|
}
|
|
1007
|
-
class
|
|
1008
|
-
constructor(e, t,
|
|
1015
|
+
class me extends ue {
|
|
1016
|
+
constructor(e, t, s, o) {
|
|
1009
1017
|
var r, a;
|
|
1010
|
-
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 = {
|
|
1011
1019
|
header: [],
|
|
1012
1020
|
body: [],
|
|
1013
1021
|
footer: []
|
|
1014
|
-
}, 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(
|
|
1015
1023
|
(l) => {
|
|
1016
1024
|
var n;
|
|
1017
|
-
this.colAndRowspanModels[l] = new
|
|
1025
|
+
this.colAndRowspanModels[l] = new Se(t, t.getAreaModel(l)), (n = this.colAndRowspanModels[l]) == null || n.init();
|
|
1018
1026
|
}
|
|
1019
1027
|
);
|
|
1020
1028
|
}
|
|
@@ -1052,10 +1060,10 @@ class fe extends be {
|
|
|
1052
1060
|
* @param {number} colIdx - The index of the column.
|
|
1053
1061
|
*/
|
|
1054
1062
|
initRenderEditor(e, t) {
|
|
1055
|
-
var
|
|
1056
|
-
let
|
|
1057
|
-
if (
|
|
1058
|
-
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) {
|
|
1059
1067
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
1060
1068
|
const i = document.querySelector("input.ge-table-cell-editor-input");
|
|
1061
1069
|
i && i.focus();
|
|
@@ -1136,8 +1144,8 @@ class fe extends be {
|
|
|
1136
1144
|
*/
|
|
1137
1145
|
updateCells(e, t = !1) {
|
|
1138
1146
|
e.forEach(
|
|
1139
|
-
(
|
|
1140
|
-
this.tableModel.getAreaModel(
|
|
1147
|
+
(s) => {
|
|
1148
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
1141
1149
|
}
|
|
1142
1150
|
), t && this.repaint();
|
|
1143
1151
|
}
|
|
@@ -1150,20 +1158,20 @@ class fe extends be {
|
|
|
1150
1158
|
* @param {any} value - The new value to be displayed in the cell.
|
|
1151
1159
|
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1152
1160
|
*/
|
|
1153
|
-
rerenderCellContent({ area: e, rowIndex: t, columnIndex:
|
|
1154
|
-
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);
|
|
1155
1163
|
if (l) {
|
|
1156
1164
|
let n;
|
|
1157
|
-
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);
|
|
1158
1166
|
if (l.innerText = "", this.applyCssClasses(l, i), h)
|
|
1159
|
-
n = h.render(l, t,
|
|
1167
|
+
n = h.render(l, t, s, e, r, o, this.dom.domService), n && this.cleanupFunctions[e].push(n);
|
|
1160
1168
|
else {
|
|
1161
|
-
const u = `${
|
|
1162
|
-
this.dom.addLabelDiv(l, u, !1, t,
|
|
1169
|
+
const u = `${o}`;
|
|
1170
|
+
this.dom.addLabelDiv(l, u, !1, t, s, e);
|
|
1163
1171
|
}
|
|
1164
|
-
const c = r.getCustomClassesAt(t,
|
|
1172
|
+
const c = r.getCustomClassesAt(t, s);
|
|
1165
1173
|
c.length && this.dom.addClasses(c, l);
|
|
1166
|
-
const f = r.getCustomStyleAt(t,
|
|
1174
|
+
const f = r.getCustomStyleAt(t, s);
|
|
1167
1175
|
if (f)
|
|
1168
1176
|
for (const u in f)
|
|
1169
1177
|
this.dom.setStyle(l, u, f[u]);
|
|
@@ -1178,13 +1186,13 @@ class fe extends be {
|
|
|
1178
1186
|
*/
|
|
1179
1187
|
storeColumnWidths() {
|
|
1180
1188
|
const e = this.tableModel.getColumnDefs();
|
|
1181
|
-
e != null && e.length && (this.storedColumnWidths = e.map((t,
|
|
1189
|
+
e != null && e.length && (this.storedColumnWidths = e.map((t, s) => this.tableModel.getColumnWidth(s)));
|
|
1182
1190
|
}
|
|
1183
1191
|
getAreaAndSideIdentByAttr(e) {
|
|
1184
1192
|
if (e) {
|
|
1185
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
1186
|
-
if (
|
|
1187
|
-
return [t,
|
|
1193
|
+
const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
|
|
1194
|
+
if (s && t)
|
|
1195
|
+
return [t, s];
|
|
1188
1196
|
}
|
|
1189
1197
|
return [void 0, void 0];
|
|
1190
1198
|
}
|
|
@@ -1241,11 +1249,11 @@ class fe extends be {
|
|
|
1241
1249
|
* @protected
|
|
1242
1250
|
*/
|
|
1243
1251
|
getNumberByAttr(e, t) {
|
|
1244
|
-
var
|
|
1252
|
+
var s;
|
|
1245
1253
|
if (e) {
|
|
1246
|
-
const
|
|
1247
|
-
if (
|
|
1248
|
-
return Number(
|
|
1254
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1255
|
+
if (o)
|
|
1256
|
+
return Number(o);
|
|
1249
1257
|
}
|
|
1250
1258
|
return -1;
|
|
1251
1259
|
}
|
|
@@ -1258,11 +1266,11 @@ class fe extends be {
|
|
|
1258
1266
|
* @protected
|
|
1259
1267
|
*/
|
|
1260
1268
|
getStringByAttr(e, t) {
|
|
1261
|
-
var
|
|
1269
|
+
var s;
|
|
1262
1270
|
if (e) {
|
|
1263
|
-
const
|
|
1264
|
-
if (
|
|
1265
|
-
return
|
|
1271
|
+
const o = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
1272
|
+
if (o)
|
|
1273
|
+
return o;
|
|
1266
1274
|
}
|
|
1267
1275
|
return "";
|
|
1268
1276
|
}
|
|
@@ -1276,55 +1284,55 @@ class fe extends be {
|
|
|
1276
1284
|
*/
|
|
1277
1285
|
adjustArea(e, t = 0) {
|
|
1278
1286
|
var b;
|
|
1279
|
-
const
|
|
1280
|
-
|
|
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 = "";
|
|
1281
1289
|
const a = 0, l = this.areaBodyCenterGeo.width, n = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), h = d.getRowCount();
|
|
1282
1290
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1291
|
+
const p = this.cleanupFunctions[e].shift();
|
|
1292
|
+
p && p();
|
|
1285
1293
|
}
|
|
1286
1294
|
let c = t;
|
|
1287
1295
|
const f = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), S = this.tableModel.getFixedLeftColumnCount();
|
|
1288
|
-
for (let
|
|
1289
|
-
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);
|
|
1290
1298
|
if (v + x > 0) {
|
|
1291
|
-
this.firstVisibleRowIndex =
|
|
1292
|
-
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");
|
|
1293
1301
|
const R = S;
|
|
1294
1302
|
if (this.adjustColumnsToRowParent({
|
|
1295
1303
|
areaIdent: e,
|
|
1296
1304
|
sideIdent: "center",
|
|
1297
1305
|
areaModel: d,
|
|
1298
|
-
geo:
|
|
1306
|
+
geo: w,
|
|
1299
1307
|
parent: y,
|
|
1300
|
-
rowIndex:
|
|
1308
|
+
rowIndex: p,
|
|
1301
1309
|
columnIndexStart: R,
|
|
1302
1310
|
columnIndexEnd: f - u - 1,
|
|
1303
1311
|
verticalFixed: !1,
|
|
1304
1312
|
lastRowOfModel: m
|
|
1305
|
-
}), 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({
|
|
1306
1314
|
areaIdent: e,
|
|
1307
1315
|
sideIdent: "west",
|
|
1308
1316
|
areaModel: d,
|
|
1309
|
-
geo:
|
|
1317
|
+
geo: w,
|
|
1310
1318
|
parent: y,
|
|
1311
|
-
rowIndex:
|
|
1319
|
+
rowIndex: p,
|
|
1312
1320
|
columnIndexStart: 0,
|
|
1313
1321
|
columnIndexEnd: R - 1,
|
|
1314
1322
|
verticalFixed: !0,
|
|
1315
1323
|
lastRowOfModel: m
|
|
1316
|
-
})), 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({
|
|
1317
1325
|
areaIdent: e,
|
|
1318
1326
|
sideIdent: "east",
|
|
1319
1327
|
areaModel: d,
|
|
1320
|
-
geo:
|
|
1328
|
+
geo: w,
|
|
1321
1329
|
parent: y,
|
|
1322
|
-
rowIndex:
|
|
1330
|
+
rowIndex: p,
|
|
1323
1331
|
columnIndexStart: f - u,
|
|
1324
1332
|
columnIndexEnd: f - 1,
|
|
1325
1333
|
verticalFixed: !0,
|
|
1326
1334
|
lastRowOfModel: m
|
|
1327
|
-
})), e === "header" && this.tree &&
|
|
1335
|
+
})), e === "header" && this.tree && p === h - 1) {
|
|
1328
1336
|
const A = this.dom.applyStyle(
|
|
1329
1337
|
this.dom.setAttribute(
|
|
1330
1338
|
this.dom.addDiv(y, new T(16, 20, 20, 8)),
|
|
@@ -1334,8 +1342,8 @@ class fe extends be {
|
|
|
1334
1342
|
{ cursor: "pointer" }
|
|
1335
1343
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1336
1344
|
if (M) {
|
|
1337
|
-
const
|
|
1338
|
-
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);
|
|
1339
1347
|
}
|
|
1340
1348
|
}
|
|
1341
1349
|
}
|
|
@@ -1343,19 +1351,19 @@ class fe extends be {
|
|
|
1343
1351
|
break;
|
|
1344
1352
|
}
|
|
1345
1353
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1346
|
-
const
|
|
1347
|
-
if (
|
|
1348
|
-
for (const v of
|
|
1349
|
-
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";
|
|
1350
1358
|
if (v.c1 < S)
|
|
1351
|
-
x =
|
|
1359
|
+
x = s.child, w = "west";
|
|
1352
1360
|
else if (u > 0 && v.c1 >= f - u)
|
|
1353
|
-
x = i.child,
|
|
1361
|
+
x = i.child, w = "east";
|
|
1354
1362
|
else {
|
|
1355
1363
|
const y = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1356
|
-
m = this.scrollFactorX * y - this.areaBodyWestGeo.width,
|
|
1364
|
+
m = this.scrollFactorX * y - this.areaBodyWestGeo.width, w = "center";
|
|
1357
1365
|
}
|
|
1358
|
-
this.drawBigCell(v, m, t, d, x,
|
|
1366
|
+
this.drawBigCell(v, m, t, d, x, w);
|
|
1359
1367
|
}
|
|
1360
1368
|
}
|
|
1361
1369
|
}
|
|
@@ -1369,16 +1377,16 @@ class fe extends be {
|
|
|
1369
1377
|
* @param sideIdent SideIdent (west,center,east)
|
|
1370
1378
|
* @protected
|
|
1371
1379
|
*/
|
|
1372
|
-
drawBigCell(e, t,
|
|
1373
|
-
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();
|
|
1374
1382
|
let d = 0;
|
|
1375
1383
|
n > 0 && e.c1 >= l - n && (d = l - n);
|
|
1376
|
-
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);
|
|
1377
1385
|
let u = !1;
|
|
1378
1386
|
const S = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1379
1387
|
S && (u = S.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
1380
|
-
areaModel:
|
|
1381
|
-
areaIdent:
|
|
1388
|
+
areaModel: o,
|
|
1389
|
+
areaIdent: o.areaIdent,
|
|
1382
1390
|
sideIdent: r,
|
|
1383
1391
|
rowIndex: e.r1,
|
|
1384
1392
|
columnIndex: e.c1,
|
|
@@ -1391,8 +1399,8 @@ class fe extends be {
|
|
|
1391
1399
|
lastRowOfModel: !0,
|
|
1392
1400
|
gammaRange: e.gammaRange
|
|
1393
1401
|
}) : this.renderCell({
|
|
1394
|
-
areaModel:
|
|
1395
|
-
areaIdent:
|
|
1402
|
+
areaModel: o,
|
|
1403
|
+
areaIdent: o.areaIdent,
|
|
1396
1404
|
sideIdent: r,
|
|
1397
1405
|
rowIndex: e.r1,
|
|
1398
1406
|
columnIndex: e.c1,
|
|
@@ -1404,7 +1412,7 @@ class fe extends be {
|
|
|
1404
1412
|
cellSelected: u,
|
|
1405
1413
|
lastRowOfModel: !0,
|
|
1406
1414
|
gammaRange: e.gammaRange
|
|
1407
|
-
}),
|
|
1415
|
+
}), o.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1408
1416
|
rowIndex: e.r1,
|
|
1409
1417
|
columnIndex: e.c1,
|
|
1410
1418
|
cellLeft: h,
|
|
@@ -1423,13 +1431,13 @@ class fe extends be {
|
|
|
1423
1431
|
* @returns {number} - The row index of the important rowspan cell, or -1 if not found.
|
|
1424
1432
|
* @protected
|
|
1425
1433
|
*/
|
|
1426
|
-
findRowOfImportantRowspanCell(e, t,
|
|
1427
|
-
const
|
|
1434
|
+
findRowOfImportantRowspanCell(e, t, s) {
|
|
1435
|
+
const o = e.getMaxRowspan();
|
|
1428
1436
|
for (let i = t - 1; i > -1; i--) {
|
|
1429
|
-
const r = e.getRowspanAt(i,
|
|
1437
|
+
const r = e.getRowspanAt(i, s);
|
|
1430
1438
|
if (r > 1 && i + r + 1 >= t)
|
|
1431
1439
|
return i;
|
|
1432
|
-
if (t - i >
|
|
1440
|
+
if (t - i > o)
|
|
1433
1441
|
return -1;
|
|
1434
1442
|
}
|
|
1435
1443
|
return -1;
|
|
@@ -1444,8 +1452,8 @@ class fe extends be {
|
|
|
1444
1452
|
adjustColumnsToRowParent({
|
|
1445
1453
|
areaIdent: e,
|
|
1446
1454
|
sideIdent: t,
|
|
1447
|
-
areaModel:
|
|
1448
|
-
geo:
|
|
1455
|
+
areaModel: s,
|
|
1456
|
+
geo: o,
|
|
1449
1457
|
parent: i,
|
|
1450
1458
|
rowIndex: r,
|
|
1451
1459
|
columnIndexStart: a,
|
|
@@ -1463,27 +1471,27 @@ class fe extends be {
|
|
|
1463
1471
|
const c = 0, f = !!(e === "body" && t);
|
|
1464
1472
|
let u = h;
|
|
1465
1473
|
for (let b = a; b <= l; b++) {
|
|
1466
|
-
const
|
|
1467
|
-
if (v > 0 &&
|
|
1468
|
-
let m =
|
|
1469
|
-
const x =
|
|
1470
|
-
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));
|
|
1471
1479
|
let y = v;
|
|
1472
|
-
|
|
1480
|
+
w > 1 && (y = this.getColumnWidths(b, b + w - 1).reduce((A, M) => A + M, 0));
|
|
1473
1481
|
let R = !1;
|
|
1474
1482
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (S = this.colAndRowspanModels[e]) != null && S.isInRange(r, b) && (R = !0), this.draggingTargetColumnIndex === b && e !== "header") {
|
|
1475
|
-
this.renderDragTargetDiv(i,
|
|
1476
|
-
const A = { left:
|
|
1483
|
+
this.renderDragTargetDiv(i, p, c, y, m);
|
|
1484
|
+
const A = { left: p, top: c, width: y, height: m };
|
|
1477
1485
|
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
1478
1486
|
} else {
|
|
1479
|
-
const A = this.renderSelectedBackgroundDiv(R, f, t,
|
|
1480
|
-
"gammaCells" in
|
|
1481
|
-
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,
|
|
1482
1490
|
areaIdent: e,
|
|
1483
1491
|
sideIdent: t,
|
|
1484
1492
|
rowIndex: r,
|
|
1485
1493
|
columnIndex: b,
|
|
1486
|
-
left:
|
|
1494
|
+
left: p,
|
|
1487
1495
|
top: c,
|
|
1488
1496
|
width: y,
|
|
1489
1497
|
height: m,
|
|
@@ -1494,7 +1502,7 @@ class fe extends be {
|
|
|
1494
1502
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1495
1503
|
rowIndex: r,
|
|
1496
1504
|
columnIndex: b,
|
|
1497
|
-
cellLeft:
|
|
1505
|
+
cellLeft: p,
|
|
1498
1506
|
cellTop: c,
|
|
1499
1507
|
cellWidth: y,
|
|
1500
1508
|
cellHeight: m,
|
|
@@ -1505,7 +1513,7 @@ class fe extends be {
|
|
|
1505
1513
|
if (u = u + v, u > this.areaBodyCenterGeo.width)
|
|
1506
1514
|
break;
|
|
1507
1515
|
}
|
|
1508
|
-
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);
|
|
1509
1517
|
}
|
|
1510
1518
|
/**
|
|
1511
1519
|
* Retrieves the column index of the tree arrow column in the table.
|
|
@@ -1522,8 +1530,8 @@ class fe extends be {
|
|
|
1522
1530
|
addAndRenderCellDiv({
|
|
1523
1531
|
areaModel: e,
|
|
1524
1532
|
areaIdent: t,
|
|
1525
|
-
sideIdent:
|
|
1526
|
-
rowIndex:
|
|
1533
|
+
sideIdent: s,
|
|
1534
|
+
rowIndex: o,
|
|
1527
1535
|
index: i,
|
|
1528
1536
|
left: r,
|
|
1529
1537
|
width: a,
|
|
@@ -1533,47 +1541,47 @@ class fe extends be {
|
|
|
1533
1541
|
lastRowOfModel: h
|
|
1534
1542
|
}) {
|
|
1535
1543
|
var X;
|
|
1536
|
-
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);
|
|
1537
1545
|
let b = "none";
|
|
1538
|
-
if (i === this.getTreeArrowColumnIndex() &&
|
|
1539
|
-
const
|
|
1540
|
-
(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";
|
|
1541
1549
|
}
|
|
1542
1550
|
let v;
|
|
1543
1551
|
if (t === "header") {
|
|
1544
|
-
const
|
|
1545
|
-
(!(
|
|
1552
|
+
const C = this.tableModel.getColumnDef(i);
|
|
1553
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (v = C == null ? void 0 : C.sortState);
|
|
1546
1554
|
}
|
|
1547
|
-
const m = e.getValueAt(
|
|
1555
|
+
const m = e.getValueAt(o, i), x = f ? "" : `${m}`, w = e.isRowChecked(o), y = this.dom.addColumnDiv(
|
|
1548
1556
|
{
|
|
1549
1557
|
parent: d,
|
|
1550
1558
|
geo: u,
|
|
1551
|
-
rowIndex:
|
|
1559
|
+
rowIndex: o,
|
|
1552
1560
|
columnIndex: i,
|
|
1553
1561
|
areaIdent: t,
|
|
1554
|
-
sideIdent:
|
|
1562
|
+
sideIdent: s,
|
|
1555
1563
|
text: x,
|
|
1556
1564
|
treeArrow: b,
|
|
1557
1565
|
tableOptions: this.tableOptions,
|
|
1558
|
-
checkedType:
|
|
1566
|
+
checkedType: w,
|
|
1559
1567
|
sortState: v
|
|
1560
1568
|
}
|
|
1561
|
-
), R = e.getTooltipAt(
|
|
1569
|
+
), R = e.getTooltipAt(o, i);
|
|
1562
1570
|
R && this.dom.setAttribute(y, "title", R);
|
|
1563
1571
|
const A = this.tableModel.getColumnDef(i);
|
|
1564
1572
|
A && A.classes[t] && this.dom.addClasses(A.classes[t], y);
|
|
1565
1573
|
let M;
|
|
1566
|
-
f && (M = f.render(y,
|
|
1567
|
-
const
|
|
1568
|
-
if (
|
|
1569
|
-
const
|
|
1570
|
-
|
|
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, {});
|
|
1571
1579
|
}
|
|
1572
1580
|
t === "header" && this.dom.setAttribute(y, "data-ge-action", "drag-column");
|
|
1573
|
-
const W = e.getCustomStyleAt(
|
|
1581
|
+
const W = e.getCustomStyleAt(o, i);
|
|
1574
1582
|
if (W)
|
|
1575
|
-
for (const
|
|
1576
|
-
this.dom.setStyle(y,
|
|
1583
|
+
for (const C in W)
|
|
1584
|
+
this.dom.setStyle(y, C, W[C]);
|
|
1577
1585
|
return [y, M];
|
|
1578
1586
|
}
|
|
1579
1587
|
/**
|
|
@@ -1584,8 +1592,8 @@ class fe extends be {
|
|
|
1584
1592
|
* @protected
|
|
1585
1593
|
*/
|
|
1586
1594
|
applyCssClasses(e, t = {}) {
|
|
1587
|
-
e && Object.entries(t).forEach(([
|
|
1588
|
-
|
|
1595
|
+
e && Object.entries(t).forEach(([s, o]) => {
|
|
1596
|
+
o ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1589
1597
|
});
|
|
1590
1598
|
}
|
|
1591
1599
|
/**
|
|
@@ -1597,10 +1605,10 @@ class fe extends be {
|
|
|
1597
1605
|
* @return {number[]} An array containing the widths of the columns within the specified range.
|
|
1598
1606
|
*/
|
|
1599
1607
|
getColumnWidths(e, t) {
|
|
1600
|
-
const
|
|
1601
|
-
for (let
|
|
1602
|
-
|
|
1603
|
-
return
|
|
1608
|
+
const s = [];
|
|
1609
|
+
for (let o = e; o <= t; o++)
|
|
1610
|
+
s.push(this.tableModel.getColumnWidth(o));
|
|
1611
|
+
return s;
|
|
1604
1612
|
}
|
|
1605
1613
|
/**
|
|
1606
1614
|
* Retrieves the heights of rows within a specified range.
|
|
@@ -1610,11 +1618,11 @@ class fe extends be {
|
|
|
1610
1618
|
* @param {AreaModelIf} areaModel - The area model.
|
|
1611
1619
|
* @return {number[]} - An array containing the heights of the rows within the specified range.
|
|
1612
1620
|
*/
|
|
1613
|
-
getRowHeights(e, t,
|
|
1614
|
-
const
|
|
1621
|
+
getRowHeights(e, t, s) {
|
|
1622
|
+
const o = [];
|
|
1615
1623
|
for (let i = e; i <= t; i++)
|
|
1616
|
-
|
|
1617
|
-
return
|
|
1624
|
+
o.push(s.getRowHeight(i));
|
|
1625
|
+
return o;
|
|
1618
1626
|
}
|
|
1619
1627
|
/**
|
|
1620
1628
|
* Adjusts the position and size of the hover row based on the mouse move event.
|
|
@@ -1625,12 +1633,12 @@ class fe extends be {
|
|
|
1625
1633
|
*/
|
|
1626
1634
|
adjustHoverRows(e) {
|
|
1627
1635
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1628
|
-
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;
|
|
1629
1637
|
this.dom.applyStyle(this.hoverRow, {
|
|
1630
1638
|
left: "0",
|
|
1631
|
-
top:
|
|
1639
|
+
top: o + "px",
|
|
1632
1640
|
width: t + "px",
|
|
1633
|
-
height:
|
|
1641
|
+
height: s + "px",
|
|
1634
1642
|
display: "block"
|
|
1635
1643
|
});
|
|
1636
1644
|
} else
|
|
@@ -1658,11 +1666,11 @@ class fe extends be {
|
|
|
1658
1666
|
*/
|
|
1659
1667
|
adjustHoverColumns(e) {
|
|
1660
1668
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1661
|
-
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;
|
|
1662
1670
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1663
1671
|
left: i + "px",
|
|
1664
1672
|
top: "0px",
|
|
1665
|
-
width:
|
|
1673
|
+
width: s + "px",
|
|
1666
1674
|
height: t + "px",
|
|
1667
1675
|
display: "block"
|
|
1668
1676
|
});
|
|
@@ -1701,17 +1709,17 @@ class fe extends be {
|
|
|
1701
1709
|
* @param {number} sourceColumnIndex - The index of the source column.
|
|
1702
1710
|
* @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
|
|
1703
1711
|
*/
|
|
1704
|
-
adjustDraggingColumn(e, t,
|
|
1705
|
-
var
|
|
1712
|
+
adjustDraggingColumn(e, t, s) {
|
|
1713
|
+
var o, i;
|
|
1706
1714
|
if (this.dragging) {
|
|
1707
1715
|
const r = this.hostElement.clientHeight, a = this.storedColumnWidths[t];
|
|
1708
|
-
if ((
|
|
1716
|
+
if ((o = e.originalEvent) != null && o.clientX) {
|
|
1709
1717
|
const d = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - a / 2, width: a, height: r, top: 0, index: t };
|
|
1710
1718
|
this.dom.applyStyle(this.draggingColumn, {
|
|
1711
1719
|
background: "rgba(128,128,128,0.2)",
|
|
1712
1720
|
display: "block",
|
|
1713
1721
|
overfllow: "clip"
|
|
1714
|
-
}), this.dom.applyStyleInPx(this.draggingColumn, d),
|
|
1722
|
+
}), this.dom.applyStyleInPx(this.draggingColumn, d), s && this.renderContentOfDraggingColumn(d);
|
|
1715
1723
|
}
|
|
1716
1724
|
} else
|
|
1717
1725
|
this.hideDraggingColumn();
|
|
@@ -1735,34 +1743,34 @@ class fe extends be {
|
|
|
1735
1743
|
* @param {number} [y=0] - The starting y-position.
|
|
1736
1744
|
* @return {number} The final y-position after rendering all the content.
|
|
1737
1745
|
*/
|
|
1738
|
-
renderContentOfDraggingColumnForArea(e, t,
|
|
1739
|
-
const
|
|
1746
|
+
renderContentOfDraggingColumnForArea(e, t, s = 0) {
|
|
1747
|
+
const o = "center", i = this.tableModel.getAreaModel(t), r = i == null ? void 0 : i.getRowCount();
|
|
1740
1748
|
if (r) {
|
|
1741
1749
|
const a = e.index ?? 0, l = this.draggingColumn;
|
|
1742
1750
|
for (let n = 0; n < r; n++) {
|
|
1743
|
-
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 = {
|
|
1744
1752
|
parent: l,
|
|
1745
1753
|
geo: c,
|
|
1746
1754
|
rowIndex: n,
|
|
1747
1755
|
columnIndex: a,
|
|
1748
1756
|
areaIdent: t,
|
|
1749
|
-
sideIdent:
|
|
1757
|
+
sideIdent: o,
|
|
1750
1758
|
text: S
|
|
1751
|
-
},
|
|
1759
|
+
}, p = this.dom.addColumnDiv(b);
|
|
1752
1760
|
let v;
|
|
1753
|
-
u && (v = u.render(
|
|
1761
|
+
u && (v = u.render(p, n, a, t, i, f, this.dom.domService), v && this.cleanupFunctions[t].push(v));
|
|
1754
1762
|
const m = i.getCustomClassesAt(n, a);
|
|
1755
|
-
m.length && this.dom.addClasses(m,
|
|
1763
|
+
m.length && this.dom.addClasses(m, p);
|
|
1756
1764
|
const x = this.tableModel.getColumnDef(a);
|
|
1757
|
-
x && x.classes[t] && this.dom.addClasses(x.classes[t],
|
|
1758
|
-
const
|
|
1759
|
-
if (
|
|
1760
|
-
for (const y in
|
|
1761
|
-
this.dom.setStyle(
|
|
1762
|
-
|
|
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;
|
|
1763
1771
|
}
|
|
1764
1772
|
}
|
|
1765
|
-
return
|
|
1773
|
+
return s;
|
|
1766
1774
|
}
|
|
1767
1775
|
/**
|
|
1768
1776
|
* Hides the dragging column by applying a 'display: none' style to it.
|
|
@@ -1785,11 +1793,11 @@ class fe extends be {
|
|
|
1785
1793
|
* @param {number} height - The height of the target div in pixels.
|
|
1786
1794
|
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1787
1795
|
*/
|
|
1788
|
-
renderDragTargetDiv(e, t,
|
|
1796
|
+
renderDragTargetDiv(e, t, s, o, i) {
|
|
1789
1797
|
const r = this.dom.applyStylePosistionAbsolute(
|
|
1790
1798
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1791
1799
|
);
|
|
1792
|
-
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;
|
|
1793
1801
|
}
|
|
1794
1802
|
/**
|
|
1795
1803
|
* Render selected background div.
|
|
@@ -1808,9 +1816,9 @@ class fe extends be {
|
|
|
1808
1816
|
* @param {number} height - The height of the div.
|
|
1809
1817
|
* @returns {boolean} - Whether the cell is selected.
|
|
1810
1818
|
*/
|
|
1811
|
-
renderSelectedBackgroundDiv(e, t,
|
|
1819
|
+
renderSelectedBackgroundDiv(e, t, s, o, i, r, a, l, n, d, h) {
|
|
1812
1820
|
let c = !1;
|
|
1813
|
-
if (!e && t &&
|
|
1821
|
+
if (!e && t && o.isSelectable(i, r) && this.getSelectionModel) {
|
|
1814
1822
|
const f = this.getSelectionModel();
|
|
1815
1823
|
if (f) {
|
|
1816
1824
|
const u = f.getSelectionCount(i, r);
|
|
@@ -1818,7 +1826,7 @@ class fe extends be {
|
|
|
1818
1826
|
for (let S = 0; S < u; S++) {
|
|
1819
1827
|
const b = this.dom.applyStylePosistionAbsolute(
|
|
1820
1828
|
// ge-table-body-west-selected-range
|
|
1821
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
1829
|
+
this.dom.createDivWithClass(`ge-table-${o.areaIdent}-${s}-selected-range`, a)
|
|
1822
1830
|
);
|
|
1823
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`);
|
|
1824
1832
|
}
|
|
@@ -1848,8 +1856,8 @@ class fe extends be {
|
|
|
1848
1856
|
renderCell({
|
|
1849
1857
|
areaModel: e,
|
|
1850
1858
|
areaIdent: t,
|
|
1851
|
-
sideIdent:
|
|
1852
|
-
rowIndex:
|
|
1859
|
+
sideIdent: s,
|
|
1860
|
+
rowIndex: o,
|
|
1853
1861
|
columnIndex: i,
|
|
1854
1862
|
left: r,
|
|
1855
1863
|
top: a,
|
|
@@ -1862,8 +1870,8 @@ class fe extends be {
|
|
|
1862
1870
|
const [f, u] = this.addAndRenderCellDiv({
|
|
1863
1871
|
areaModel: e,
|
|
1864
1872
|
areaIdent: t,
|
|
1865
|
-
sideIdent:
|
|
1866
|
-
rowIndex:
|
|
1873
|
+
sideIdent: s,
|
|
1874
|
+
rowIndex: o,
|
|
1867
1875
|
index: i,
|
|
1868
1876
|
left: r,
|
|
1869
1877
|
width: l,
|
|
@@ -1872,7 +1880,7 @@ class fe extends be {
|
|
|
1872
1880
|
parent: d,
|
|
1873
1881
|
lastRowOfModel: c
|
|
1874
1882
|
});
|
|
1875
|
-
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);
|
|
1876
1884
|
}
|
|
1877
1885
|
/**
|
|
1878
1886
|
* Render the header cell resize handle.
|
|
@@ -1888,17 +1896,17 @@ class fe extends be {
|
|
|
1888
1896
|
*
|
|
1889
1897
|
* @return {void}
|
|
1890
1898
|
*/
|
|
1891
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft:
|
|
1899
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: o, cellWidth: i, cellHeight: r, parent: a }) {
|
|
1892
1900
|
const l = this.dom.domService, n = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = l.createElement("div");
|
|
1893
|
-
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);
|
|
1894
1902
|
}
|
|
1895
1903
|
}
|
|
1896
|
-
class
|
|
1904
|
+
class ye {
|
|
1897
1905
|
constructor(e, t) {
|
|
1898
1906
|
this.columnIndex = e, this.sortState = t;
|
|
1899
1907
|
}
|
|
1900
1908
|
}
|
|
1901
|
-
class
|
|
1909
|
+
class ve {
|
|
1902
1910
|
constructor(e) {
|
|
1903
1911
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1904
1912
|
}
|
|
@@ -1912,15 +1920,15 @@ class ye {
|
|
|
1912
1920
|
*/
|
|
1913
1921
|
onHostElementChanged(e) {
|
|
1914
1922
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1915
|
-
const t = e.target,
|
|
1916
|
-
if (
|
|
1917
|
-
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);
|
|
1918
1926
|
this.tableScope.updateModelValueAfterEdit(r, a, l, t.value);
|
|
1919
1927
|
}
|
|
1920
1928
|
}
|
|
1921
1929
|
}
|
|
1922
1930
|
}
|
|
1923
|
-
class
|
|
1931
|
+
class we {
|
|
1924
1932
|
constructor(e = -1, t = -1) {
|
|
1925
1933
|
this.rowIndex = e, this.columnIndex = t;
|
|
1926
1934
|
}
|
|
@@ -1930,34 +1938,34 @@ class N {
|
|
|
1930
1938
|
this.cells = e;
|
|
1931
1939
|
}
|
|
1932
1940
|
static createSingle(e, t) {
|
|
1933
|
-
return new N([new
|
|
1941
|
+
return new N([new we(e, t)]);
|
|
1934
1942
|
}
|
|
1935
1943
|
}
|
|
1936
1944
|
class Ce {
|
|
1937
1945
|
constructor(e) {
|
|
1938
|
-
var t,
|
|
1939
|
-
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);
|
|
1940
1948
|
}
|
|
1941
1949
|
onMouseClicked(e, t) {
|
|
1942
1950
|
var i, r, a, l, n, d, h;
|
|
1943
|
-
let
|
|
1951
|
+
let s = !1, o = !1;
|
|
1944
1952
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1945
1953
|
const c = this.getSelectionModel(), f = this.getFocusModel();
|
|
1946
|
-
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));
|
|
1947
1955
|
}
|
|
1948
|
-
return
|
|
1956
|
+
return o ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1949
1957
|
}
|
|
1950
1958
|
onActionTriggered(e) {
|
|
1951
1959
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1952
|
-
const t = this.getSelectionModel(),
|
|
1953
|
-
if (t &&
|
|
1960
|
+
const t = this.getSelectionModel(), s = this.getFocusModel();
|
|
1961
|
+
if (t && s) {
|
|
1954
1962
|
if (e === "SELECT_ALL")
|
|
1955
1963
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1956
1964
|
if (e === "DESELECT_ALL")
|
|
1957
1965
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
1958
1966
|
if (e === "TOGGLE_SELECTION") {
|
|
1959
|
-
const [
|
|
1960
|
-
return t.togglePoint(
|
|
1967
|
+
const [o, i] = s.getFocus();
|
|
1968
|
+
return t.togglePoint(o, i), this.tableScope.repaint(), !0;
|
|
1961
1969
|
}
|
|
1962
1970
|
}
|
|
1963
1971
|
}
|
|
@@ -1965,16 +1973,16 @@ class Ce {
|
|
|
1965
1973
|
}
|
|
1966
1974
|
createRangeByEvents(e, t) {
|
|
1967
1975
|
t || (t = e);
|
|
1968
|
-
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);
|
|
1969
1977
|
return E.create({
|
|
1970
|
-
rowIndex1:
|
|
1978
|
+
rowIndex1: s,
|
|
1971
1979
|
columnIndex1: i,
|
|
1972
|
-
rowIndex2:
|
|
1980
|
+
rowIndex2: o,
|
|
1973
1981
|
columnIndex2: r
|
|
1974
1982
|
});
|
|
1975
1983
|
}
|
|
1976
1984
|
}
|
|
1977
|
-
class
|
|
1985
|
+
class xe {
|
|
1978
1986
|
get() {
|
|
1979
1987
|
return {
|
|
1980
1988
|
f2: "START_EDITING",
|
|
@@ -1994,7 +2002,7 @@ class we {
|
|
|
1994
2002
|
};
|
|
1995
2003
|
}
|
|
1996
2004
|
}
|
|
1997
|
-
class
|
|
2005
|
+
class Ee {
|
|
1998
2006
|
get() {
|
|
1999
2007
|
return {
|
|
2000
2008
|
f2: "START_EDITING",
|
|
@@ -2016,7 +2024,7 @@ class xe {
|
|
|
2016
2024
|
};
|
|
2017
2025
|
}
|
|
2018
2026
|
}
|
|
2019
|
-
class
|
|
2027
|
+
class Ae {
|
|
2020
2028
|
constructor(e) {
|
|
2021
2029
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
2022
2030
|
}
|
|
@@ -2037,7 +2045,7 @@ class Ee {
|
|
|
2037
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));
|
|
2038
2046
|
}
|
|
2039
2047
|
assignPredefinedSystemShortcutMappings() {
|
|
2040
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
2048
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new Ee().get()) : Object.assign(this.shortcutActionIdMapping, new xe().get());
|
|
2041
2049
|
}
|
|
2042
2050
|
isMacintosh() {
|
|
2043
2051
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -2055,24 +2063,24 @@ class Ee {
|
|
|
2055
2063
|
emit(e) {
|
|
2056
2064
|
this.isDebug() && console.debug("ShortcutService emit :", e);
|
|
2057
2065
|
let t = !1;
|
|
2058
|
-
for (const
|
|
2059
|
-
|
|
2066
|
+
for (const s of this.listener)
|
|
2067
|
+
s.onActionTriggered(e) && (t = !0);
|
|
2060
2068
|
return t;
|
|
2061
2069
|
}
|
|
2062
2070
|
findEntity(e) {
|
|
2063
2071
|
const t = this.getTokenByEvent(e);
|
|
2064
2072
|
this.isDebug() && console.debug("ShortcutService tokens :", t);
|
|
2065
|
-
for (const
|
|
2066
|
-
const
|
|
2067
|
-
if (this.areTokensEquals(t,
|
|
2068
|
-
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];
|
|
2069
2077
|
}
|
|
2070
2078
|
}
|
|
2071
2079
|
areTokensEquals(e, t) {
|
|
2072
2080
|
if (e.length !== t.length || e.length === 0)
|
|
2073
2081
|
return !1;
|
|
2074
|
-
for (let
|
|
2075
|
-
if (e[
|
|
2082
|
+
for (let s = 0; s < e.length; s++)
|
|
2083
|
+
if (e[s] !== t[s])
|
|
2076
2084
|
return !1;
|
|
2077
2085
|
return !0;
|
|
2078
2086
|
}
|
|
@@ -2110,18 +2118,18 @@ class K {
|
|
|
2110
2118
|
}
|
|
2111
2119
|
}
|
|
2112
2120
|
class Z {
|
|
2113
|
-
setStyle(e, t,
|
|
2114
|
-
return e.style[t] =
|
|
2121
|
+
setStyle(e, t, s) {
|
|
2122
|
+
return e.style[t] = s, e;
|
|
2115
2123
|
}
|
|
2116
2124
|
appendText(e, t) {
|
|
2117
|
-
const
|
|
2118
|
-
return this.appendChild(e,
|
|
2125
|
+
const s = this.createText(t);
|
|
2126
|
+
return this.appendChild(e, s), s;
|
|
2119
2127
|
}
|
|
2120
2128
|
addClass(e, t) {
|
|
2121
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2129
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
2122
2130
|
}
|
|
2123
2131
|
removeClass(e, t) {
|
|
2124
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2132
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
2125
2133
|
}
|
|
2126
2134
|
appendChild(e, t) {
|
|
2127
2135
|
e.appendChild(t);
|
|
@@ -2132,15 +2140,15 @@ class Z {
|
|
|
2132
2140
|
createText(e) {
|
|
2133
2141
|
return document.createTextNode(e);
|
|
2134
2142
|
}
|
|
2135
|
-
setAttribute(e, t,
|
|
2136
|
-
e.setAttribute(t,
|
|
2143
|
+
setAttribute(e, t, s) {
|
|
2144
|
+
e.setAttribute(t, s);
|
|
2137
2145
|
}
|
|
2138
2146
|
}
|
|
2139
|
-
class
|
|
2140
|
-
render(e, t,
|
|
2141
|
-
if (i.isEditable(t,
|
|
2147
|
+
class Me {
|
|
2148
|
+
render(e, t, s, o, i, r, a) {
|
|
2149
|
+
if (i.isEditable(t, s)) {
|
|
2142
2150
|
a.addClass(e, "ge-table-row-input-div");
|
|
2143
|
-
const l = i.getValueAt(t,
|
|
2151
|
+
const l = i.getValueAt(t, s);
|
|
2144
2152
|
e.innerHTML = `
|
|
2145
2153
|
<input
|
|
2146
2154
|
type="text"
|
|
@@ -2148,16 +2156,16 @@ class Ae {
|
|
|
2148
2156
|
autofocus
|
|
2149
2157
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
2150
2158
|
data-listen="change"
|
|
2151
|
-
data-area="${
|
|
2159
|
+
data-area="${o}"
|
|
2152
2160
|
data-row-index="${t}"
|
|
2153
|
-
data-col-index="${
|
|
2161
|
+
data-col-index="${s}"
|
|
2154
2162
|
data-input-type="text"
|
|
2155
2163
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
2156
2164
|
class="ge-table-cell-editor-input">`;
|
|
2157
2165
|
}
|
|
2158
2166
|
}
|
|
2159
2167
|
}
|
|
2160
|
-
class
|
|
2168
|
+
class Re {
|
|
2161
2169
|
constructor(e = "none", t = "single") {
|
|
2162
2170
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1, this.silent = !1, this.listenerArr = [];
|
|
2163
2171
|
}
|
|
@@ -2179,14 +2187,14 @@ class Me {
|
|
|
2179
2187
|
this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
|
|
2180
2188
|
}
|
|
2181
2189
|
getSelectionCount(e, t) {
|
|
2182
|
-
let
|
|
2183
|
-
for (const
|
|
2184
|
-
|
|
2185
|
-
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;
|
|
2186
2194
|
}
|
|
2187
2195
|
isInNegativeRange(e, t) {
|
|
2188
|
-
for (const
|
|
2189
|
-
if (
|
|
2196
|
+
for (const s of this.negativeRanges)
|
|
2197
|
+
if (s.isInRange(e, t))
|
|
2190
2198
|
return !0;
|
|
2191
2199
|
return !1;
|
|
2192
2200
|
}
|
|
@@ -2210,8 +2218,8 @@ class Me {
|
|
|
2210
2218
|
getMergedRowIndices() {
|
|
2211
2219
|
const e = /* @__PURE__ */ new Set();
|
|
2212
2220
|
for (const t of this.ranges)
|
|
2213
|
-
for (let
|
|
2214
|
-
!e.has(
|
|
2221
|
+
for (let s = t.r1; s <= t.r2; s++)
|
|
2222
|
+
!e.has(s) && !this.isInNegativeRange(s, 0) && e.add(s);
|
|
2215
2223
|
return Array.from(e);
|
|
2216
2224
|
}
|
|
2217
2225
|
selectAll() {
|
|
@@ -2239,7 +2247,7 @@ class Me {
|
|
|
2239
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());
|
|
2240
2248
|
}
|
|
2241
2249
|
}
|
|
2242
|
-
class
|
|
2250
|
+
class Te {
|
|
2243
2251
|
constructor(e = "none") {
|
|
2244
2252
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1, this.listenerArr = [];
|
|
2245
2253
|
}
|
|
@@ -2290,14 +2298,14 @@ class ee {
|
|
|
2290
2298
|
}
|
|
2291
2299
|
// `⊖ `, `⊕ `;
|
|
2292
2300
|
}
|
|
2293
|
-
const
|
|
2301
|
+
const De = new Re(), ke = new Te("cell");
|
|
2294
2302
|
class te {
|
|
2295
2303
|
constructor() {
|
|
2296
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 = {
|
|
2297
2305
|
header: 34,
|
|
2298
2306
|
body: 34,
|
|
2299
2307
|
footer: 34
|
|
2300
|
-
}, 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;
|
|
2301
2309
|
}
|
|
2302
2310
|
}
|
|
2303
2311
|
const I = class I {
|
|
@@ -2310,8 +2318,8 @@ const I = class I {
|
|
|
2310
2318
|
* @return {Promise<string>} A promise that resolves to the copied content as a string.
|
|
2311
2319
|
* @throws {string} Throws an error if neither selection nor focus is defined.
|
|
2312
2320
|
*/
|
|
2313
|
-
createContent(e, t,
|
|
2314
|
-
return new Promise((
|
|
2321
|
+
createContent(e, t, s) {
|
|
2322
|
+
return new Promise((o, i) => {
|
|
2315
2323
|
if (t != null && t.hasSelection()) {
|
|
2316
2324
|
const r = this.mergeRanges(t.getRanges());
|
|
2317
2325
|
if (r) {
|
|
@@ -2325,12 +2333,12 @@ const I = class I {
|
|
|
2325
2333
|
}
|
|
2326
2334
|
a.push(n.join(I.columnSeparatorChar));
|
|
2327
2335
|
}
|
|
2328
|
-
return
|
|
2336
|
+
return o(a.join(I.rowSeparatorChar));
|
|
2329
2337
|
}
|
|
2330
2338
|
}
|
|
2331
|
-
if (
|
|
2332
|
-
const [r, a] =
|
|
2333
|
-
return
|
|
2339
|
+
if (s) {
|
|
2340
|
+
const [r, a] = s.getFocus(), l = e.getBodyModel().getTextValueAt(r, a);
|
|
2341
|
+
return o(l);
|
|
2334
2342
|
}
|
|
2335
2343
|
i("Cannot copy, neither selection nor focus defined.");
|
|
2336
2344
|
});
|
|
@@ -2352,15 +2360,15 @@ const I = class I {
|
|
|
2352
2360
|
* @param {FocusModelIf} focusModel - The focus model of the table.
|
|
2353
2361
|
* @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
|
|
2354
2362
|
*/
|
|
2355
|
-
copyToClipboard(e, t,
|
|
2356
|
-
return new Promise((
|
|
2363
|
+
copyToClipboard(e, t, s) {
|
|
2364
|
+
return new Promise((o, i) => {
|
|
2357
2365
|
this.createContent(
|
|
2358
2366
|
e,
|
|
2359
2367
|
t,
|
|
2360
|
-
|
|
2368
|
+
s
|
|
2361
2369
|
).then((r) => {
|
|
2362
2370
|
r && this.copyContent(r).then((a) => {
|
|
2363
|
-
|
|
2371
|
+
o(r);
|
|
2364
2372
|
}).catch((a) => {
|
|
2365
2373
|
i();
|
|
2366
2374
|
});
|
|
@@ -2377,22 +2385,31 @@ const I = class I {
|
|
|
2377
2385
|
*/
|
|
2378
2386
|
mergeRanges(e) {
|
|
2379
2387
|
let t;
|
|
2380
|
-
for (const
|
|
2381
|
-
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);
|
|
2382
2390
|
return t;
|
|
2383
2391
|
}
|
|
2384
2392
|
};
|
|
2385
2393
|
I.columnSeparatorChar = " ", I.rowSeparatorChar = `
|
|
2386
2394
|
`;
|
|
2387
2395
|
let L = I;
|
|
2388
|
-
class
|
|
2389
|
-
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()) {
|
|
2390
2407
|
var n;
|
|
2391
|
-
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) {
|
|
2392
2409
|
const d = this.tableOptions.autoRestoreOptions, h = d.getStorageKeyFn;
|
|
2393
|
-
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)));
|
|
2394
2411
|
}
|
|
2395
|
-
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);
|
|
2396
2413
|
const a = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
2397
2414
|
a && a.addEventSelectionChangedListener(this);
|
|
2398
2415
|
const l = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
@@ -2410,8 +2427,8 @@ class j extends fe {
|
|
|
2410
2427
|
*
|
|
2411
2428
|
* @return {TableScope} - The newly created TableScope instance.
|
|
2412
2429
|
*/
|
|
2413
|
-
static create(e, t,
|
|
2414
|
-
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);
|
|
2415
2432
|
}
|
|
2416
2433
|
/**
|
|
2417
2434
|
* Triggers an action based on the provided actionId.
|
|
@@ -2427,19 +2444,19 @@ class j extends fe {
|
|
|
2427
2444
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
2428
2445
|
const t = this.getFocusModel();
|
|
2429
2446
|
if (t) {
|
|
2430
|
-
const [
|
|
2431
|
-
this.tableModel.getBodyModel().isEditable(
|
|
2447
|
+
const [s, o] = t.getFocus();
|
|
2448
|
+
this.tableModel.getBodyModel().isEditable(s, o) && (this.clearSelection(), this.initRenderEditor(s, o));
|
|
2432
2449
|
}
|
|
2433
2450
|
return !0;
|
|
2434
2451
|
}
|
|
2435
2452
|
if (e === "COPY_2_CLIPBOARD") {
|
|
2436
|
-
const t = this.getSelectionModel ? this.getSelectionModel() : void 0,
|
|
2437
|
-
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));
|
|
2438
2455
|
}
|
|
2439
2456
|
return !1;
|
|
2440
2457
|
}
|
|
2441
|
-
updateModelValueAfterEdit(e, t,
|
|
2442
|
-
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());
|
|
2443
2460
|
}
|
|
2444
2461
|
/**
|
|
2445
2462
|
* Retrieves the TableApi object.
|
|
@@ -2468,16 +2485,16 @@ class j extends fe {
|
|
|
2468
2485
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
2469
2486
|
*/
|
|
2470
2487
|
createGeMouseEvent(e) {
|
|
2471
|
-
const t = new
|
|
2488
|
+
const t = new z();
|
|
2472
2489
|
if (t.originalEvent = e, e) {
|
|
2473
|
-
const
|
|
2474
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
2475
|
-
const
|
|
2476
|
-
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);
|
|
2477
2494
|
}
|
|
2478
2495
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
2479
|
-
const
|
|
2480
|
-
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);
|
|
2481
2498
|
}
|
|
2482
2499
|
}
|
|
2483
2500
|
return t;
|
|
@@ -2536,9 +2553,9 @@ class j extends fe {
|
|
|
2536
2553
|
* @return {void}
|
|
2537
2554
|
*/
|
|
2538
2555
|
toggleExpandCollapseAll(e = !0) {
|
|
2539
|
-
var
|
|
2556
|
+
var s;
|
|
2540
2557
|
const t = this.tableModel.getBodyModel();
|
|
2541
|
-
|
|
2558
|
+
P(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
2542
2559
|
}
|
|
2543
2560
|
/**
|
|
2544
2561
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -2549,11 +2566,11 @@ class j extends fe {
|
|
|
2549
2566
|
*
|
|
2550
2567
|
* @return {void} - This method does not return anything.
|
|
2551
2568
|
*/
|
|
2552
|
-
toggleRowCheckbox(e, t,
|
|
2569
|
+
toggleRowCheckbox(e, t, s) {
|
|
2553
2570
|
var l;
|
|
2554
|
-
const
|
|
2555
|
-
|
|
2556
|
-
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();
|
|
2557
2574
|
this.eventListener.onCheckboxChanged(a || []);
|
|
2558
2575
|
}
|
|
2559
2576
|
/**
|
|
@@ -2564,13 +2581,13 @@ class j extends fe {
|
|
|
2564
2581
|
* @returns {void}
|
|
2565
2582
|
*/
|
|
2566
2583
|
onMouseClicked(e, t) {
|
|
2567
|
-
let
|
|
2568
|
-
if (!
|
|
2584
|
+
let s = this.selectionService.onMouseClicked(e, t);
|
|
2585
|
+
if (!s && this.getFocusModel) {
|
|
2569
2586
|
this.resetEditorRenderer();
|
|
2570
|
-
const
|
|
2571
|
-
|
|
2587
|
+
const o = this.getFocusModel();
|
|
2588
|
+
o && (s = o.hasChanged(), o.clearChanged());
|
|
2572
2589
|
}
|
|
2573
|
-
return
|
|
2590
|
+
return s;
|
|
2574
2591
|
}
|
|
2575
2592
|
debounceRepaint() {
|
|
2576
2593
|
this.debounce(this.repaint.bind(this), 1);
|
|
@@ -2603,13 +2620,13 @@ class j extends fe {
|
|
|
2603
2620
|
*
|
|
2604
2621
|
* @return {void}
|
|
2605
2622
|
*/
|
|
2606
|
-
onHeaderDblClicked(e, t,
|
|
2623
|
+
onHeaderDblClicked(e, t, s) {
|
|
2607
2624
|
var i, r;
|
|
2608
|
-
const
|
|
2609
|
-
if (
|
|
2625
|
+
const o = this.tableModel.getColumnDef(s);
|
|
2626
|
+
if (o != null && o.sortable && o.sortable()) {
|
|
2610
2627
|
e.preventDefault(), e.stopPropagation();
|
|
2611
|
-
const a =
|
|
2612
|
-
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]);
|
|
2613
2630
|
}
|
|
2614
2631
|
}
|
|
2615
2632
|
/**
|
|
@@ -2631,8 +2648,8 @@ class j extends fe {
|
|
|
2631
2648
|
* @return {void}
|
|
2632
2649
|
*/
|
|
2633
2650
|
scrollToIndex(e, t) {
|
|
2634
|
-
const
|
|
2635
|
-
this.scrollToPixel(0,
|
|
2651
|
+
const o = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2652
|
+
this.scrollToPixel(0, o);
|
|
2636
2653
|
}
|
|
2637
2654
|
/**
|
|
2638
2655
|
* Sets the selection model for the table.
|
|
@@ -2643,8 +2660,8 @@ class j extends fe {
|
|
|
2643
2660
|
* @return {void} - This method does not return any value.
|
|
2644
2661
|
*/
|
|
2645
2662
|
setSelectionModel(e, t = !1) {
|
|
2646
|
-
const
|
|
2647
|
-
this.tableOptions.getSelectionModel =
|
|
2663
|
+
const s = () => e;
|
|
2664
|
+
this.tableOptions.getSelectionModel = s, this.getSelectionModel = s, this.selectionService.getSelectionModel = s, t && this.repaint();
|
|
2648
2665
|
}
|
|
2649
2666
|
toggleHeaderGroup(e) {
|
|
2650
2667
|
const t = this.tableModel.getAreaModel("header");
|
|
@@ -2679,10 +2696,10 @@ class j extends fe {
|
|
|
2679
2696
|
*/
|
|
2680
2697
|
changeFocusCell(e, t) {
|
|
2681
2698
|
if (!this.isEditing() && this.getFocusModel) {
|
|
2682
|
-
const
|
|
2683
|
-
if (
|
|
2684
|
-
const [
|
|
2685
|
-
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;
|
|
2686
2703
|
}
|
|
2687
2704
|
}
|
|
2688
2705
|
return !1;
|
|
@@ -2705,8 +2722,8 @@ class j extends fe {
|
|
|
2705
2722
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
2706
2723
|
}
|
|
2707
2724
|
debugOnce(e, t) {
|
|
2708
|
-
var
|
|
2709
|
-
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);
|
|
2710
2727
|
}
|
|
2711
2728
|
/**
|
|
2712
2729
|
* Restores the scroll position of the table if auto restore options are enabled.
|
|
@@ -2717,8 +2734,8 @@ class j extends fe {
|
|
|
2717
2734
|
autoRestoreScrollPosition() {
|
|
2718
2735
|
var e;
|
|
2719
2736
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
2720
|
-
const
|
|
2721
|
-
|
|
2737
|
+
const s = this.storeScrollPosStateService.getScrollOffset();
|
|
2738
|
+
s && this.scrollViewport.scrollTo(...s);
|
|
2722
2739
|
}
|
|
2723
2740
|
}
|
|
2724
2741
|
/**
|
|
@@ -2738,8 +2755,8 @@ class j extends fe {
|
|
|
2738
2755
|
autoRestoreSortingState() {
|
|
2739
2756
|
var e, t;
|
|
2740
2757
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2758
|
+
const s = this.storeSortingService.getSortItems();
|
|
2759
|
+
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
2743
2760
|
}
|
|
2744
2761
|
}
|
|
2745
2762
|
/**
|
|
@@ -2751,10 +2768,10 @@ class j extends fe {
|
|
|
2751
2768
|
autoRestoreCollapsedExpandedState() {
|
|
2752
2769
|
var e, t;
|
|
2753
2770
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2754
|
-
const
|
|
2755
|
-
if (
|
|
2771
|
+
const s = this.tableOptions.autoRestoreOptions, o = s.getRowId;
|
|
2772
|
+
if (s.autoRestoreCollapsedExpandedState && o) {
|
|
2756
2773
|
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
2757
|
-
if (
|
|
2774
|
+
if (P(r)) {
|
|
2758
2775
|
const a = r, l = r.getRowCount();
|
|
2759
2776
|
for (let n = 0; n < l; n++) {
|
|
2760
2777
|
const d = r.getRowByIndex(n);
|
|
@@ -2764,7 +2781,7 @@ class j extends fe {
|
|
|
2764
2781
|
else if (i.allCollapsed)
|
|
2765
2782
|
d.expanded = !1;
|
|
2766
2783
|
else {
|
|
2767
|
-
const h =
|
|
2784
|
+
const h = o(d.data);
|
|
2768
2785
|
i.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h) : i.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(h));
|
|
2769
2786
|
}
|
|
2770
2787
|
}
|
|
@@ -3015,36 +3032,36 @@ const B = class B {
|
|
|
3015
3032
|
constructor(e = new ee()) {
|
|
3016
3033
|
this.headerGroupOptions = e;
|
|
3017
3034
|
}
|
|
3018
|
-
render(e, t,
|
|
3035
|
+
render(e, t, s, o, i, r, a) {
|
|
3019
3036
|
const l = r != null && r.data ? r.data : "";
|
|
3020
3037
|
if (r) {
|
|
3021
3038
|
const { toggle: n, visibility: d, closed: h } = r, c = n ? B.toggleHeaderGroup : "";
|
|
3022
|
-
this.addText(e,
|
|
3039
|
+
this.addText(e, o, t, s, l, c), n && d !== "always" && this.addArrowDiv(a, e, !h, t, s, o, c);
|
|
3023
3040
|
} else
|
|
3024
|
-
this.addText(e,
|
|
3041
|
+
this.addText(e, o, t, s, l, "");
|
|
3025
3042
|
}
|
|
3026
|
-
addText(e, t,
|
|
3043
|
+
addText(e, t, s, o, i, r) {
|
|
3027
3044
|
e.innerHTML = `<span
|
|
3028
3045
|
data-ge-action="${r}"
|
|
3029
3046
|
data-area="${t}"
|
|
3030
|
-
data-row-index="${
|
|
3031
|
-
data-col-index="${
|
|
3047
|
+
data-row-index="${s}"
|
|
3048
|
+
data-col-index="${o}"
|
|
3032
3049
|
>${i}</span>`;
|
|
3033
3050
|
}
|
|
3034
|
-
addArrowDiv(e, t,
|
|
3051
|
+
addArrowDiv(e, t, s = !0, o = -1, i = -1, r = "header", a) {
|
|
3035
3052
|
const l = e.createElement("div");
|
|
3036
|
-
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}`);
|
|
3037
3054
|
let n;
|
|
3038
|
-
|
|
3055
|
+
s ? n = this.headerGroupOptions.iconExpanded : n = this.headerGroupOptions.iconCollapsed;
|
|
3039
3056
|
const d = n.content, h = e.createText(d);
|
|
3040
3057
|
e.appendChild(l, h), n.style && this.applyStyleString(e, l, n.style);
|
|
3041
3058
|
for (const c of n.classes)
|
|
3042
3059
|
e.addClass(l, c);
|
|
3043
3060
|
return e.appendChild(t, l), l;
|
|
3044
3061
|
}
|
|
3045
|
-
applyStyleString(e, t,
|
|
3046
|
-
const
|
|
3047
|
-
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) {
|
|
3048
3065
|
const [r, a] = i.split(":");
|
|
3049
3066
|
e.setStyle(t, r.trim(), a.trim());
|
|
3050
3067
|
}
|
|
@@ -3052,12 +3069,12 @@ const B = class B {
|
|
|
3052
3069
|
};
|
|
3053
3070
|
B.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3054
3071
|
let q = B;
|
|
3055
|
-
function
|
|
3056
|
-
tableModel:
|
|
3072
|
+
function $e({
|
|
3073
|
+
tableModel: g,
|
|
3057
3074
|
tableOptions: e = new te(),
|
|
3058
3075
|
mouseMoved: t,
|
|
3059
|
-
checkboxChanged:
|
|
3060
|
-
contextmenu:
|
|
3076
|
+
checkboxChanged: s,
|
|
3077
|
+
contextmenu: o,
|
|
3061
3078
|
modelChanged: i,
|
|
3062
3079
|
mouseClicked: r,
|
|
3063
3080
|
mouseDragging: a,
|
|
@@ -3067,13 +3084,13 @@ function Oe({
|
|
|
3067
3084
|
tableReady: h,
|
|
3068
3085
|
licenseKey: c
|
|
3069
3086
|
}) {
|
|
3070
|
-
const f =
|
|
3087
|
+
const f = oe(null);
|
|
3071
3088
|
let u = !1;
|
|
3072
3089
|
ie(() => {
|
|
3073
3090
|
f.current && !u && (S(f.current), u = !0);
|
|
3074
3091
|
});
|
|
3075
3092
|
const S = (b) => {
|
|
3076
|
-
const
|
|
3093
|
+
const p = {
|
|
3077
3094
|
onSelectionChanged(m) {
|
|
3078
3095
|
n && n(m);
|
|
3079
3096
|
},
|
|
@@ -3081,10 +3098,10 @@ function Oe({
|
|
|
3081
3098
|
d && d(m);
|
|
3082
3099
|
},
|
|
3083
3100
|
onCheckboxChanged: (m) => {
|
|
3084
|
-
|
|
3101
|
+
s && s(m);
|
|
3085
3102
|
},
|
|
3086
3103
|
onContextmenu: (m) => {
|
|
3087
|
-
|
|
3104
|
+
o && o(m);
|
|
3088
3105
|
},
|
|
3089
3106
|
onModelChanged: (m) => {
|
|
3090
3107
|
i && i(m);
|
|
@@ -3103,14 +3120,14 @@ function Oe({
|
|
|
3103
3120
|
}
|
|
3104
3121
|
}, v = new j(
|
|
3105
3122
|
b,
|
|
3106
|
-
|
|
3123
|
+
g,
|
|
3107
3124
|
new Z(),
|
|
3108
3125
|
e,
|
|
3109
|
-
|
|
3126
|
+
p
|
|
3110
3127
|
);
|
|
3111
3128
|
v.firstInit(), h && h(v.getApi()), c && k.getInstance().setLicenseKey(c);
|
|
3112
3129
|
};
|
|
3113
|
-
return /* @__PURE__ */
|
|
3130
|
+
return /* @__PURE__ */ se(
|
|
3114
3131
|
"div",
|
|
3115
3132
|
{
|
|
3116
3133
|
ref: f,
|
|
@@ -3125,30 +3142,30 @@ function Oe({
|
|
|
3125
3142
|
}
|
|
3126
3143
|
);
|
|
3127
3144
|
}
|
|
3128
|
-
var G,
|
|
3145
|
+
var G, F = re;
|
|
3129
3146
|
if (process.env.NODE_ENV === "production")
|
|
3130
|
-
G =
|
|
3147
|
+
G = F.createRoot, F.hydrateRoot;
|
|
3131
3148
|
else {
|
|
3132
|
-
var U =
|
|
3133
|
-
G = function(
|
|
3149
|
+
var U = F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
3150
|
+
G = function(g, e) {
|
|
3134
3151
|
U.usingClientEntryPoint = !0;
|
|
3135
3152
|
try {
|
|
3136
|
-
return
|
|
3153
|
+
return F.createRoot(g, e);
|
|
3137
3154
|
} finally {
|
|
3138
3155
|
U.usingClientEntryPoint = !1;
|
|
3139
3156
|
}
|
|
3140
3157
|
};
|
|
3141
3158
|
}
|
|
3142
|
-
class
|
|
3159
|
+
class Be {
|
|
3143
3160
|
constructor(e) {
|
|
3144
3161
|
this.Component = e, console.info(e);
|
|
3145
3162
|
}
|
|
3146
|
-
render(e, t,
|
|
3163
|
+
render(e, t, s, o, i, r, a) {
|
|
3147
3164
|
const l = {
|
|
3148
3165
|
cellDiv: e,
|
|
3149
3166
|
rowIndex: t,
|
|
3150
|
-
columnIndex:
|
|
3151
|
-
areaIdent:
|
|
3167
|
+
columnIndex: s,
|
|
3168
|
+
areaIdent: o,
|
|
3152
3169
|
areaModel: i,
|
|
3153
3170
|
cellValue: r
|
|
3154
3171
|
}, n = G(e, {});
|
|
@@ -3158,6 +3175,6 @@ class Le {
|
|
|
3158
3175
|
}
|
|
3159
3176
|
}
|
|
3160
3177
|
export {
|
|
3161
|
-
|
|
3162
|
-
|
|
3178
|
+
Be as ComponentRendererWrapper,
|
|
3179
|
+
$e as GuiexpertTable
|
|
3163
3180
|
};
|