@guiexpert/react-table 18.0.1 → 18.0.2
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 +241 -7
- package/index.js +1702 -759
- package/lib/guiexpert-table.d.ts +6 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
class
|
|
1
|
+
import { jsx as oe } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as se, useEffect as ie } from "react";
|
|
3
|
+
import re from "react-dom";
|
|
4
|
+
class k {
|
|
5
5
|
// The constructor is private to prevent direct construction calls
|
|
6
6
|
// with the `new` operator
|
|
7
7
|
constructor() {
|
|
8
8
|
this.alreadySet = !1;
|
|
9
9
|
}
|
|
10
10
|
static getInstance() {
|
|
11
|
-
return
|
|
11
|
+
return k.instance || (k.instance = new k()), k.instance;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Method to set the license key for the application.
|
|
@@ -26,18 +26,18 @@ class D {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function P(p) {
|
|
30
30
|
return p && p.type === "TreeRow";
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function W(p) {
|
|
33
33
|
return p && p.type === "AreaModelTree";
|
|
34
34
|
}
|
|
35
|
-
class
|
|
36
|
-
constructor(e = -1, t = -1,
|
|
37
|
-
this.rowIndex = e, this.rowTop = t, this.columnIndex =
|
|
35
|
+
class _ {
|
|
36
|
+
constructor(e = -1, t = -1, o = -1, s = -1, i, r, a, l = 0, n = 0, d = 0, c = "") {
|
|
37
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = o, this.columnLeft = s, this.areaIdent = i, this.sideIdent = r, this.originalEvent = a, this.clickCount = l, this.draggingX = n, this.draggingY = d, this.action = c;
|
|
38
38
|
}
|
|
39
39
|
clone() {
|
|
40
|
-
return new
|
|
40
|
+
return new _(
|
|
41
41
|
this.rowIndex,
|
|
42
42
|
this.rowTop,
|
|
43
43
|
this.columnIndex,
|
|
@@ -52,47 +52,47 @@ class H {
|
|
|
52
52
|
);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
class
|
|
56
|
-
constructor(e = ">", t = "",
|
|
57
|
-
this.content = e, this.style = t, this.classes =
|
|
55
|
+
class D {
|
|
56
|
+
constructor(e = ">", t = "", o = []) {
|
|
57
|
+
this.content = e, this.style = t, this.classes = o;
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
class
|
|
61
|
-
constructor(e = new
|
|
60
|
+
class J {
|
|
61
|
+
constructor(e = new D(
|
|
62
62
|
">",
|
|
63
63
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
64
64
|
["gt-table-tree-arrow-expanded"]
|
|
65
|
-
), t = new
|
|
65
|
+
), t = new D(
|
|
66
66
|
">",
|
|
67
67
|
"",
|
|
68
68
|
["ge-table-tree-arrow-collapsed"]
|
|
69
|
-
),
|
|
69
|
+
), o = new D(
|
|
70
70
|
">",
|
|
71
71
|
"color:transparent;",
|
|
72
72
|
["gt-table-tree-arrow-hidden"]
|
|
73
|
-
),
|
|
73
|
+
), s = new D(
|
|
74
74
|
"↕",
|
|
75
75
|
"",
|
|
76
76
|
["gt-table-tree-arrow-expanded-all"]
|
|
77
77
|
)) {
|
|
78
|
-
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder =
|
|
78
|
+
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = o, this.arrowExpandCollapseAll = s;
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
class
|
|
82
|
-
constructor(e = new
|
|
83
|
-
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder =
|
|
81
|
+
class Q {
|
|
82
|
+
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), o = new D("↑", "color:transparent;", [])) {
|
|
83
|
+
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = o;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
class
|
|
86
|
+
class le {
|
|
87
87
|
constructor(e) {
|
|
88
88
|
this.domService = e;
|
|
89
89
|
}
|
|
90
|
-
setStyle(e, t,
|
|
91
|
-
return this.domService.setStyle(e, t,
|
|
90
|
+
setStyle(e, t, o) {
|
|
91
|
+
return this.domService.setStyle(e, t, o), e;
|
|
92
92
|
}
|
|
93
93
|
applyStyle(e, t) {
|
|
94
|
-
for (const
|
|
95
|
-
this.domService.setStyle(e,
|
|
94
|
+
for (const o in t)
|
|
95
|
+
this.domService.setStyle(e, o, t[o]);
|
|
96
96
|
return e;
|
|
97
97
|
}
|
|
98
98
|
applyDisplayNoneStyle(e) {
|
|
@@ -102,7 +102,7 @@ class ee {
|
|
|
102
102
|
return this.domService.setStyle(e, "display", "block"), e;
|
|
103
103
|
}
|
|
104
104
|
applyStyleInPx(e, t) {
|
|
105
|
-
return Object.entries(t).forEach(([
|
|
105
|
+
return Object.entries(t).forEach(([o, s]) => this.domService.setStyle(e, o, s + "px")), e;
|
|
106
106
|
}
|
|
107
107
|
applyStylePosistionRelative(e) {
|
|
108
108
|
return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
|
|
@@ -113,8 +113,8 @@ class ee {
|
|
|
113
113
|
applyStyleFullSize(e) {
|
|
114
114
|
return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
|
|
115
115
|
}
|
|
116
|
-
applyStyleOverflowAuto(e = "auto", t = "auto",
|
|
117
|
-
return this.domService.setStyle(
|
|
116
|
+
applyStyleOverflowAuto(e = "auto", t = "auto", o) {
|
|
117
|
+
return this.domService.setStyle(o, "overflow-x", e), this.domService.setStyle(o, "overflow-y", t), o;
|
|
118
118
|
}
|
|
119
119
|
applyStyleNoPadding(e) {
|
|
120
120
|
return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
|
|
@@ -130,156 +130,157 @@ class ee {
|
|
|
130
130
|
return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
|
|
131
131
|
}
|
|
132
132
|
appendText(e, t) {
|
|
133
|
-
const
|
|
134
|
-
return this.domService.appendChild(e,
|
|
133
|
+
const o = this.domService.createText(t);
|
|
134
|
+
return this.domService.appendChild(e, o), o;
|
|
135
135
|
}
|
|
136
136
|
addClass(e, t) {
|
|
137
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
137
|
+
return e.includes(" ") ? e.split(" ").forEach((o) => this.domService.addClass(t, o)) : this.domService.addClass(t, e), t;
|
|
138
138
|
}
|
|
139
139
|
removeClass(e, t) {
|
|
140
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
140
|
+
return e.includes(" ") ? e.split(" ").forEach((o) => this.domService.removeClass(t, o)) : this.domService.removeClass(t, e), t;
|
|
141
141
|
}
|
|
142
142
|
addClasses(e, t) {
|
|
143
143
|
if (e)
|
|
144
|
-
for (const
|
|
145
|
-
this.domService.addClass(t,
|
|
144
|
+
for (const o of e)
|
|
145
|
+
this.domService.addClass(t, o);
|
|
146
146
|
return t;
|
|
147
147
|
}
|
|
148
|
-
setAttribute(e, t,
|
|
149
|
-
return t &&
|
|
148
|
+
setAttribute(e, t, o) {
|
|
149
|
+
return t && o && this.domService.setAttribute(e, t, o), e;
|
|
150
150
|
}
|
|
151
|
-
createAreaDivWithClass(e, t,
|
|
152
|
-
const
|
|
153
|
-
return this.addClass(e,
|
|
151
|
+
createAreaDivWithClass(e, t, o, s) {
|
|
152
|
+
const i = this.domService.createElement("div");
|
|
153
|
+
return this.addClass(e, i), this.domService.setAttribute(i, "data-area", o), this.domService.setAttribute(i, "data-side", s), this.domService.appendChild(t, i), i;
|
|
154
154
|
}
|
|
155
155
|
createDivWithClass(e, t) {
|
|
156
|
-
const
|
|
157
|
-
return this.addClass(e,
|
|
156
|
+
const o = this.domService.createElement("div");
|
|
157
|
+
return this.addClass(e, o), this.domService.appendChild(t, o), o;
|
|
158
158
|
}
|
|
159
|
-
addRowDiv(e, t,
|
|
160
|
-
const
|
|
161
|
-
if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`),
|
|
162
|
-
const
|
|
163
|
-
this.domService.addClass(l, `ge-table-row-${
|
|
159
|
+
addRowDiv(e, t, o = -1, s, i, r = "") {
|
|
160
|
+
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}`), s === "body" && i === "center") {
|
|
162
|
+
const n = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
163
|
+
this.domService.addClass(l, `ge-table-row-${n}`);
|
|
164
164
|
}
|
|
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", `${
|
|
166
|
-
const
|
|
167
|
-
this.domService.appendChild(l,
|
|
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", `${o}`), this.domService.setAttribute(l, "data-area", `${s}`), r) {
|
|
166
|
+
const n = this.domService.createText(r);
|
|
167
|
+
this.domService.appendChild(l, n);
|
|
168
168
|
}
|
|
169
169
|
return this.domService.appendChild(e.child, l), l;
|
|
170
170
|
}
|
|
171
|
-
addColumnDiv(e
|
|
172
|
-
const
|
|
173
|
-
this.domService.addClass(
|
|
174
|
-
const
|
|
175
|
-
if (
|
|
176
|
-
const
|
|
177
|
-
this.addLabelDiv(
|
|
171
|
+
addColumnDiv(e) {
|
|
172
|
+
const { parent: t, geo: o, rowIndex: s = -1, columnIndex: i = -1, areaIdent: r, sideIdent: a, text: l = "", treeArrow: n, tableOptions: d, checkedType: c = void 0, sortState: h } = e, f = d == null ? void 0 : d.treeOptions, u = d == null ? void 0 : d.showCheckboxWihoutExtraColumn, S = this.domService.createElement("div");
|
|
173
|
+
this.domService.addClass(S, "ge-table-col-div"), this.domService.addClass(S, `ge-table-col-div-${o.index}`), this.domService.setAttribute(S, "data-col-index", `${o.index}`), this.domService.setAttribute(S, "data-row-index", `${s}`), this.domService.setAttribute(S, "data-area", `${r}`);
|
|
174
|
+
const b = ((o == null ? void 0 : o.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
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", `${o.left}px`), this.domService.setStyle(S, "top", `${o.top}px`), this.domService.setStyle(S, "width", `${o.width}px`), this.domService.setStyle(S, "height", `${o.height}px`), n && n !== "none" && (this.domService.addClass(S, "ge-table-col-tree"), this.addArrowDiv(S, n, f, s, i, r)), u && i === 0 && c && this.addCheckboxToDiv(S, c, r, s), l) {
|
|
176
|
+
const g = n !== "none" && i === 0;
|
|
177
|
+
this.addLabelDiv(S, l, g, s, i, r);
|
|
178
178
|
}
|
|
179
|
-
return
|
|
179
|
+
return h && this.addSortedIcon(S, h, d == null ? void 0 : d.sortedOptions, i), this.domService.appendChild(t, S), S;
|
|
180
180
|
}
|
|
181
|
-
addCheckboxToDiv(e, t,
|
|
182
|
-
const
|
|
183
|
-
return
|
|
181
|
+
addCheckboxToDiv(e, t, o, s) {
|
|
182
|
+
const i = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
|
|
183
|
+
return i.innerHTML = `
|
|
184
184
|
<input
|
|
185
185
|
type="checkbox"
|
|
186
|
-
data-area="${
|
|
187
|
-
data-row-index="${
|
|
186
|
+
data-area="${o}"
|
|
187
|
+
data-row-index="${s}"
|
|
188
188
|
data-input-type="checkbox"
|
|
189
189
|
${r}
|
|
190
|
-
class="ge-table-row-checkbox"> `, this.domService.setStyle(
|
|
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", `${s}`), this.domService.appendChild(e, i), i;
|
|
191
191
|
}
|
|
192
|
-
addLabelDiv(e, t = "",
|
|
193
|
-
const
|
|
194
|
-
if (this.domService.addClass(
|
|
195
|
-
if (
|
|
192
|
+
addLabelDiv(e, t = "", o = !1, s = -1, i = -1, r = "body") {
|
|
193
|
+
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", `${s}`), this.domService.setAttribute(a, "data-col-index", `${i}`), this.domService.setAttribute(a, "data-area", `${r}`), t)
|
|
195
|
+
if (o) {
|
|
196
196
|
const l = this.domService.createText(t);
|
|
197
|
-
this.domService.appendChild(
|
|
197
|
+
this.domService.appendChild(a, l);
|
|
198
198
|
} else {
|
|
199
199
|
const l = this.domService.createElement("div");
|
|
200
|
-
this.domService.appendChild(
|
|
201
|
-
const
|
|
202
|
-
this.domService.addClass(l, "ge-table-label"), this.domService.appendChild(l,
|
|
200
|
+
this.domService.appendChild(a, l);
|
|
201
|
+
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", `${s}`), this.domService.setAttribute(l, "data-col-index", `${i}`), this.domService.setAttribute(l, "data-area", `${r}`);
|
|
203
203
|
}
|
|
204
|
-
return this.domService.appendChild(e,
|
|
204
|
+
return this.domService.appendChild(e, a), a;
|
|
205
205
|
}
|
|
206
|
-
addSortedIcon(e, t = "",
|
|
207
|
-
const
|
|
208
|
-
this.domService.addClass(
|
|
206
|
+
addSortedIcon(e, t = "", o = new Q(), s = -1) {
|
|
207
|
+
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", `${s}`), this.domService.setAttribute(i, "data-area", "header");
|
|
209
209
|
let r;
|
|
210
|
-
t === "asc" ? r =
|
|
211
|
-
const
|
|
212
|
-
this.domService.appendChild(
|
|
213
|
-
for (const
|
|
214
|
-
this.domService.addClass(
|
|
215
|
-
return this.domService.appendChild(e,
|
|
216
|
-
}
|
|
217
|
-
addArrowDiv(e, t = "none",
|
|
218
|
-
const
|
|
219
|
-
this.domService.addClass(
|
|
210
|
+
t === "asc" ? r = o.iconAsc : t === "desc" ? r = o.iconDesc : r = o.iconPlaceholder;
|
|
211
|
+
const a = r.content, l = this.domService.createText(a);
|
|
212
|
+
this.domService.appendChild(i, l), r.style && this.applyStyleString(i, r.style);
|
|
213
|
+
for (const n of r.classes)
|
|
214
|
+
this.domService.addClass(i, n);
|
|
215
|
+
return this.domService.appendChild(e, i), i;
|
|
216
|
+
}
|
|
217
|
+
addArrowDiv(e, t = "none", o = new J(), s = -1, i = -1, r = "body") {
|
|
218
|
+
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", `${s}`), this.domService.setAttribute(a, "data-col-index", `${i}`), this.domService.setAttribute(a, "data-area", `${r}`);
|
|
220
220
|
let l;
|
|
221
|
-
t === "expanded" ? l =
|
|
222
|
-
const
|
|
223
|
-
this.domService.appendChild(
|
|
224
|
-
for (const
|
|
225
|
-
this.domService.addClass(
|
|
226
|
-
return this.domService.appendChild(e,
|
|
227
|
-
}
|
|
228
|
-
addColumnBorderDivs(e, t, s, i
|
|
221
|
+
t === "expanded" ? l = o.arrowExpanded : t === "collapsed" ? l = o.arrowCollapsed : l = o.arrowPlaceholder;
|
|
222
|
+
const n = l.content, d = this.domService.createText(n);
|
|
223
|
+
this.domService.appendChild(a, d), l.style && this.applyStyleString(a, l.style);
|
|
224
|
+
for (const c of l.classes)
|
|
225
|
+
this.domService.addClass(a, c);
|
|
226
|
+
return this.domService.appendChild(e, a), a;
|
|
227
|
+
}
|
|
228
|
+
addColumnBorderDivs(e, t, o, s, i) {
|
|
229
229
|
if (e.verticalBorderVisible) {
|
|
230
|
-
const r = `ge-table-${
|
|
231
|
-
this.addVerticalBorder(
|
|
230
|
+
const r = `ge-table-${s}-${i}-vertical-border`;
|
|
231
|
+
this.addVerticalBorder(o, t, r);
|
|
232
232
|
}
|
|
233
233
|
if (e.horizontalBorderVisible) {
|
|
234
|
-
const r = `ge-table-${
|
|
235
|
-
this.addHorizontalBorder(
|
|
234
|
+
const r = `ge-table-${s}-${i}-horizontal-border`;
|
|
235
|
+
this.addHorizontalBorder(o, t, r);
|
|
236
236
|
}
|
|
237
237
|
return t;
|
|
238
238
|
}
|
|
239
|
-
addHorizontalBorder(e, t,
|
|
240
|
-
const
|
|
241
|
-
return this.domService.addClass(
|
|
239
|
+
addHorizontalBorder(e, t, o = "ge-table-body-center-horizontal-border") {
|
|
240
|
+
const s = this.domService.createElement("div");
|
|
241
|
+
return this.domService.addClass(s, o), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${e.left}px`), this.domService.setStyle(s, "top", `${e.top}px`), this.domService.setStyle(s, "width", `${e.width}px`), this.domService.setStyle(s, "height", "1px"), this.domService.appendChild(t, s), s;
|
|
242
242
|
}
|
|
243
|
-
addFocusBorderDivs(e, t,
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
addFocusBorderDivs(e, t, o) {
|
|
244
|
+
t = { ...t, width: t.width + 1, height: t.height + 1 };
|
|
245
|
+
let s = this.domService.createElement("div");
|
|
246
|
+
return this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", "1px"), this.domService.setStyle(s, "height", `${t.height}px`), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), s = this.domService.createElement("div"), this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left + t.width - 1}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", "1px"), this.domService.setStyle(s, "height", `${t.height}px`), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), s = this.domService.createElement("div"), this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", `${t.width}px`), this.domService.setStyle(s, "height", "1px"), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), s = this.domService.createElement("div"), this.domService.addClass(s, "ge-table-focus-border"), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top + t.height - 1}px`), this.domService.setStyle(s, "width", `${t.width}px`), this.domService.setStyle(s, "height", "1px"), this.domService.setStyle(s, "z-index", "9999"), this.applyStyle(s, o), this.domService.appendChild(e, s), e;
|
|
246
247
|
}
|
|
247
|
-
addVerticalBorder(e, t,
|
|
248
|
-
const
|
|
249
|
-
return this.domService.addClass(
|
|
248
|
+
addVerticalBorder(e, t, o = "ge-table-body-center-vertical-border") {
|
|
249
|
+
const s = this.domService.createElement("div");
|
|
250
|
+
return this.domService.addClass(s, o), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${e.left}px`), this.domService.setStyle(s, "top", `${e.top}px`), this.domService.setStyle(s, "width", "1px"), this.domService.setStyle(s, "height", `${e.height}px`), this.domService.appendChild(t, s), s;
|
|
250
251
|
}
|
|
251
|
-
addDiv(e, t,
|
|
252
|
-
const
|
|
253
|
-
return
|
|
252
|
+
addDiv(e, t, o = "") {
|
|
253
|
+
const s = this.domService.createElement("div");
|
|
254
|
+
return o && this.domService.addClass(s, o), this.domService.setStyle(s, "display", "clip"), this.domService.setStyle(s, "position", "absolute"), this.domService.setStyle(s, "left", `${t.left}px`), this.domService.setStyle(s, "top", `${t.top}px`), this.domService.setStyle(s, "width", `${t.width}px`), this.domService.setStyle(s, "height", `${t.height}px`), this.domService.appendChild(e, s), s;
|
|
254
255
|
}
|
|
255
256
|
applyStyleString(e, t) {
|
|
256
|
-
const
|
|
257
|
-
for (const
|
|
258
|
-
const [
|
|
259
|
-
this.domService.setStyle(e,
|
|
257
|
+
const o = t.split(";").map((s) => s.trim()).filter((s) => s);
|
|
258
|
+
for (const s of o) {
|
|
259
|
+
const [i, r] = s.split(":");
|
|
260
|
+
this.domService.setStyle(e, i.trim(), r.trim());
|
|
260
261
|
}
|
|
261
262
|
}
|
|
262
263
|
getDivOrCreateDiv(e, t) {
|
|
263
|
-
let
|
|
264
|
-
return
|
|
264
|
+
let o = t.cache[e];
|
|
265
|
+
return o ? (o.innerText = "", o) : (o = this.domService.createElement("div"), t.cache[e] = o, o);
|
|
265
266
|
}
|
|
266
267
|
}
|
|
267
|
-
const
|
|
268
|
-
class
|
|
268
|
+
const V = (p) => p === "header" ? "header" : p === "footer" ? "footer" : "body";
|
|
269
|
+
class ae {
|
|
269
270
|
constructor(e, t) {
|
|
270
271
|
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)) {
|
|
271
272
|
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"));
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
const
|
|
275
|
-
this.value =
|
|
273
|
+
const o = e.getAttribute("data-area");
|
|
274
|
+
if (o && (this.areaIdent = V(o), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
275
|
+
const s = e;
|
|
276
|
+
this.value = s.value;
|
|
276
277
|
}
|
|
277
278
|
}
|
|
278
279
|
}
|
|
279
280
|
}
|
|
280
|
-
class
|
|
281
|
+
class ne {
|
|
281
282
|
constructor(e) {
|
|
282
|
-
this.tableScope = e, this.expandedAll = !0, this.mouseDown = !1, this.dragging = !1, 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(
|
|
283
|
+
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(
|
|
283
284
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
284
285
|
);
|
|
285
286
|
}
|
|
@@ -303,22 +304,28 @@ class se {
|
|
|
303
304
|
* @return {void}
|
|
304
305
|
*/
|
|
305
306
|
onHostElementClicked(e) {
|
|
306
|
-
const t =
|
|
307
|
-
if (t.
|
|
307
|
+
const t = Date.now();
|
|
308
|
+
if (t - this.lastClicked < this.doubleClickDelay)
|
|
309
|
+
return;
|
|
310
|
+
this.lastClicked = t;
|
|
311
|
+
const o = new ae(e.target, this.tableScope);
|
|
312
|
+
if (o.action === "toggleExpandCollapseAll")
|
|
308
313
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
309
|
-
else if (
|
|
310
|
-
this.tableScope.
|
|
311
|
-
else if (
|
|
312
|
-
|
|
314
|
+
else if (o.action === "toggleHeaderGroup")
|
|
315
|
+
this.tableScope.toggleHeaderGroup(o), e.preventDefault(), e.stopPropagation();
|
|
316
|
+
else if (o.inputType === "checkbox" && o.areaIdent)
|
|
317
|
+
this.tableScope.toggleRowCheckbox(o.rowIdx, o.colIdx, o.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
318
|
+
else if (P(o.row) && o.areaModel) {
|
|
319
|
+
const s = o.colIdx === this.getArrowColumnIndex() && e.altKey, i = o.className.includes("ge-table-tree-arrow-div");
|
|
313
320
|
if (console.info(i, s), s || i) {
|
|
314
321
|
e.preventDefault(), e.stopPropagation();
|
|
315
|
-
const
|
|
316
|
-
|
|
322
|
+
const r = o.row;
|
|
323
|
+
r.expanded = !r.expanded, "recalcVisibleTreeRows" in o.areaModel && o.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(r);
|
|
317
324
|
}
|
|
318
325
|
}
|
|
319
|
-
if (
|
|
326
|
+
if (o.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
320
327
|
const s = this.tableScope.tableOptions.getFocusModel();
|
|
321
|
-
s == null || s.clear(), s == null || s.setFocus(
|
|
328
|
+
s == null || s.clear(), s == null || s.setFocus(o.rowIdx, o.colIdx);
|
|
322
329
|
}
|
|
323
330
|
this.publishGeMouseEvent(e, 1);
|
|
324
331
|
}
|
|
@@ -329,16 +336,16 @@ class se {
|
|
|
329
336
|
* @param {MouseEvent} event - The double click event.
|
|
330
337
|
*/
|
|
331
338
|
onHostElementDblClicked(e) {
|
|
332
|
-
if (e.target instanceof HTMLElement) {
|
|
333
|
-
const t = e.target,
|
|
334
|
-
if (
|
|
335
|
-
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e,
|
|
339
|
+
if (this.lastClicked = Date.now(), e.target instanceof HTMLElement) {
|
|
340
|
+
const t = e.target, o = t.getAttribute("data-area"), s = V(o), i = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), a = this.tableScope.tableModel.getAreaModel(s);
|
|
341
|
+
if (o && s === "header")
|
|
342
|
+
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, i, r));
|
|
336
343
|
else if (t.getAttribute("data-row-index")) {
|
|
337
|
-
const l =
|
|
338
|
-
if (
|
|
344
|
+
const l = a.getRowByIndex(i);
|
|
345
|
+
if (o && s === "body" && a.isEditable(i, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(i, r)), P(l) && r === this.getArrowColumnIndex()) {
|
|
339
346
|
e.preventDefault(), e.stopPropagation();
|
|
340
|
-
const
|
|
341
|
-
|
|
347
|
+
const n = l;
|
|
348
|
+
n.expanded = !n.expanded, "recalcVisibleTreeRows" in a && a.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(n);
|
|
342
349
|
}
|
|
343
350
|
}
|
|
344
351
|
}
|
|
@@ -353,8 +360,8 @@ class se {
|
|
|
353
360
|
* @return {void}
|
|
354
361
|
*/
|
|
355
362
|
publishGeMouseEvent(e, t) {
|
|
356
|
-
var
|
|
357
|
-
this.mouseEvent = e, this.geMouseEventOld = (
|
|
363
|
+
var o;
|
|
364
|
+
this.mouseEvent = e, this.geMouseEventOld = (o = this.geMouseEvent) == null ? void 0 : o.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();
|
|
358
365
|
}
|
|
359
366
|
/**
|
|
360
367
|
* Update the collapsed/expanded state of a tree row.
|
|
@@ -363,30 +370,30 @@ class se {
|
|
|
363
370
|
* @returns {void}
|
|
364
371
|
*/
|
|
365
372
|
updateCollapsedExpandedState(e) {
|
|
366
|
-
var s, i,
|
|
367
|
-
const t = (
|
|
373
|
+
var o, s, i, r, a;
|
|
374
|
+
const t = (s = (o = this.tableScope.tableOptions) == null ? void 0 : o.autoRestoreOptions) == null ? void 0 : s.getRowId;
|
|
368
375
|
if (t) {
|
|
369
|
-
const l = (
|
|
370
|
-
|
|
376
|
+
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, c = t(e.data);
|
|
377
|
+
n ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(c) : d && ((a = this.tableScope.storeStateCollapsedExpandService) == null || a.collapsedStateIdsRemove(c));
|
|
371
378
|
}
|
|
372
379
|
}
|
|
373
380
|
getArrowColumnIndex() {
|
|
374
381
|
return this.tableScope.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
375
382
|
}
|
|
376
383
|
onMouseDown(e) {
|
|
377
|
-
this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0;
|
|
384
|
+
this.dragging || (this.mouseEvent = e, this.startMouseEvent = this.tableScope.createGeMouseEvent(this.mouseEvent), this.tableScope.onMouseDown(this.startMouseEvent), this.mouseDown = !0);
|
|
378
385
|
}
|
|
379
386
|
onMouseMove(e) {
|
|
380
|
-
this.mouseEvent = e, this.mouseDown ? (this.dragging = !0, requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
|
|
387
|
+
this.mouseEvent = e, this.mouseDown ? (this.dragging || (this.dragging = !0, this.tableScope.setDragging(!0)), requestAnimationFrame(this.mouseDraggingOnFrame.bind(this))) : requestAnimationFrame(this.mouseMoveOnFrame.bind(this));
|
|
381
388
|
}
|
|
382
389
|
onMouseUp(e) {
|
|
383
|
-
this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1;
|
|
390
|
+
this.mouseEvent = e, this.dragging && requestAnimationFrame(this.mouseDraggingEndOnFrame.bind(this)), this.mouseDown = !1, this.dragging = !1, this.tableScope.setDragging(!1);
|
|
384
391
|
}
|
|
385
392
|
mouseDraggingOnFrame() {
|
|
386
393
|
var e;
|
|
387
394
|
if (this.mouseEvent) {
|
|
388
395
|
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
389
|
-
(e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t);
|
|
396
|
+
(e = this.startMouseEvent) != null && e.originalEvent && (t.draggingX = this.mouseEvent.clientX - this.startMouseEvent.originalEvent.clientX, t.draggingY = this.mouseEvent.clientY - this.startMouseEvent.originalEvent.clientY), this.tableScope.mouseDraggingOnFrame(t, this.startMouseEvent);
|
|
390
397
|
}
|
|
391
398
|
}
|
|
392
399
|
mouseDraggingEndOnFrame() {
|
|
@@ -403,7 +410,7 @@ class se {
|
|
|
403
410
|
}
|
|
404
411
|
}
|
|
405
412
|
}
|
|
406
|
-
class
|
|
413
|
+
class de {
|
|
407
414
|
constructor(e) {
|
|
408
415
|
this.tableScope = e;
|
|
409
416
|
}
|
|
@@ -509,36 +516,114 @@ class ie {
|
|
|
509
516
|
repaint() {
|
|
510
517
|
this.tableScope.repaint();
|
|
511
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* Repaints the table scope with hard repaint.
|
|
521
|
+
* Repaints the UI by resetting the size of the wrapper div,
|
|
522
|
+
* adjusting the containers and rows, and performing additional adjustments
|
|
523
|
+
* after scrolling.
|
|
524
|
+
*
|
|
525
|
+
* @return {void}
|
|
526
|
+
*/
|
|
527
|
+
repaintHard() {
|
|
528
|
+
this.tableScope.repaintHard();
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Clears the current selection of the table.
|
|
532
|
+
* The table will be rendered automatically.
|
|
533
|
+
*
|
|
534
|
+
* @returns {void}
|
|
535
|
+
*/
|
|
536
|
+
clearSelection() {
|
|
537
|
+
this.tableScope.clearSelection(!0);
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* Sets the selection model for the table scope.
|
|
541
|
+
*
|
|
542
|
+
* @param {SelectionModel} sm - The selection model to be set.
|
|
543
|
+
* @param {boolean} [repaint=true] - Indicates whether the table should be repainted after setting the selection model. Default value is true.
|
|
544
|
+
*
|
|
545
|
+
* @return {void}
|
|
546
|
+
*/
|
|
547
|
+
setSelectionModel(e, t = !0) {
|
|
548
|
+
this.tableScope.setSelectionModel(e, t);
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Triggers the action with the given action ID.
|
|
552
|
+
* This function can be invoked programmatically.
|
|
553
|
+
*
|
|
554
|
+
* @param {ActionId} actionId - The ID of the action to trigger.
|
|
555
|
+
* @return {void}
|
|
556
|
+
*/
|
|
557
|
+
triggerAction(e) {
|
|
558
|
+
this.tableScope.onActionTriggered(e);
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Retrieves the mapping of shortcuts to corresponding action in the current table scope.
|
|
562
|
+
*
|
|
563
|
+
* @return {ShortcutActionIdMapping} The mapping of shortcuts to corresponding action.
|
|
564
|
+
*/
|
|
565
|
+
getShortcutActionMapping() {
|
|
566
|
+
return this.tableScope.shortcutService.getShortcutActionMapping();
|
|
567
|
+
}
|
|
568
|
+
/**
|
|
569
|
+
* Copies the selected data from the table to the clipboard.
|
|
570
|
+
*
|
|
571
|
+
* @return {Promise<string>} - A promise that resolves with the copied data as a string.
|
|
572
|
+
*/
|
|
573
|
+
copyToClipboard() {
|
|
574
|
+
return this.tableScope.copyService.copyToClipboard(
|
|
575
|
+
this.tableScope.tableModel,
|
|
576
|
+
this.tableScope.selectionModel(),
|
|
577
|
+
this.tableScope.focusModel()
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Retrieves the current scope of the table.
|
|
582
|
+
*
|
|
583
|
+
* @returns {TableScope} The current scope of the table.
|
|
584
|
+
*/
|
|
585
|
+
getTableScope() {
|
|
586
|
+
return this.tableScope;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Retrieves the selection model of the table.
|
|
590
|
+
*
|
|
591
|
+
* @return {SelectionModelIf | undefined} The selection model of the table,
|
|
592
|
+
* or undefined if no selection model is available.
|
|
593
|
+
*/
|
|
594
|
+
getSelectionModel() {
|
|
595
|
+
return this.tableScope.selectionModel();
|
|
596
|
+
}
|
|
512
597
|
}
|
|
513
|
-
class
|
|
598
|
+
class z {
|
|
514
599
|
constructor(e) {
|
|
515
600
|
this.getStorageKeyFn = e;
|
|
516
601
|
}
|
|
517
602
|
autoConvertMapToObject(e) {
|
|
518
603
|
const t = {};
|
|
519
604
|
if (e instanceof Map) {
|
|
520
|
-
const
|
|
521
|
-
for (const
|
|
605
|
+
const o = e;
|
|
606
|
+
for (const s of [...o]) {
|
|
522
607
|
const [
|
|
523
|
-
|
|
608
|
+
i,
|
|
524
609
|
r
|
|
525
|
-
] =
|
|
526
|
-
t[
|
|
610
|
+
] = s;
|
|
611
|
+
t[i] = r;
|
|
527
612
|
}
|
|
528
613
|
}
|
|
529
614
|
return t;
|
|
530
615
|
}
|
|
531
616
|
checkAndPersistItem(e, t) {
|
|
532
|
-
const
|
|
533
|
-
if (
|
|
534
|
-
const
|
|
535
|
-
if (
|
|
536
|
-
const
|
|
617
|
+
const o = this.getStorageKeyFn;
|
|
618
|
+
if (o) {
|
|
619
|
+
const s = o();
|
|
620
|
+
if (s) {
|
|
621
|
+
const i = s + e;
|
|
537
622
|
if ((t + "").includes("Map")) {
|
|
538
623
|
const r = this.autoConvertMapToObject(t);
|
|
539
|
-
this.persistItem(
|
|
624
|
+
this.persistItem(i, r);
|
|
540
625
|
} else
|
|
541
|
-
this.persistItem(
|
|
626
|
+
this.persistItem(i, t);
|
|
542
627
|
}
|
|
543
628
|
}
|
|
544
629
|
}
|
|
@@ -585,7 +670,7 @@ class V {
|
|
|
585
670
|
// }
|
|
586
671
|
// }
|
|
587
672
|
}
|
|
588
|
-
class
|
|
673
|
+
class ce extends z {
|
|
589
674
|
constructor(e) {
|
|
590
675
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
591
676
|
}
|
|
@@ -600,21 +685,21 @@ class oe extends V {
|
|
|
600
685
|
if (e) {
|
|
601
686
|
const t = e();
|
|
602
687
|
if (t) {
|
|
603
|
-
const
|
|
604
|
-
let
|
|
605
|
-
this.scrollOffset =
|
|
688
|
+
const o = t + this.SCROLL_STATE;
|
|
689
|
+
let s = this.loadFromLocalStorage(o);
|
|
690
|
+
this.scrollOffset = s || [0, 0];
|
|
606
691
|
}
|
|
607
692
|
}
|
|
608
693
|
}
|
|
609
694
|
}
|
|
610
|
-
class
|
|
611
|
-
constructor(e = "collapsed", t = [],
|
|
612
|
-
this.mode = e, this.rowIds = t, this.allCollapsed =
|
|
695
|
+
class he {
|
|
696
|
+
constructor(e = "collapsed", t = [], o = !1, s = !1) {
|
|
697
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = o, this.allExpanded = s;
|
|
613
698
|
}
|
|
614
699
|
}
|
|
615
|
-
class
|
|
700
|
+
class ge extends z {
|
|
616
701
|
constructor(e) {
|
|
617
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
702
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new he(), this.load();
|
|
618
703
|
}
|
|
619
704
|
collapsedExpandedStateGet() {
|
|
620
705
|
return this.collapsedExpandedState;
|
|
@@ -637,8 +722,8 @@ class re extends V {
|
|
|
637
722
|
if (e) {
|
|
638
723
|
const t = e();
|
|
639
724
|
if (t) {
|
|
640
|
-
const
|
|
641
|
-
|
|
725
|
+
const o = t + this.COLLAPSED_EXPANDED_STATE, s = this.loadFromLocalStorage(o);
|
|
726
|
+
s && (this.collapsedExpandedState = s);
|
|
642
727
|
}
|
|
643
728
|
}
|
|
644
729
|
}
|
|
@@ -646,7 +731,7 @@ class re extends V {
|
|
|
646
731
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
647
732
|
}
|
|
648
733
|
}
|
|
649
|
-
class
|
|
734
|
+
class pe extends z {
|
|
650
735
|
constructor(e) {
|
|
651
736
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
652
737
|
}
|
|
@@ -661,95 +746,101 @@ class ne extends V {
|
|
|
661
746
|
if (e) {
|
|
662
747
|
const t = e();
|
|
663
748
|
if (t) {
|
|
664
|
-
const
|
|
665
|
-
|
|
666
|
-
this.sortItems = i || [];
|
|
749
|
+
const o = t + this.SORTING_STATE, s = this.loadFromLocalStorage(o);
|
|
750
|
+
this.sortItems = s || [];
|
|
667
751
|
}
|
|
668
752
|
}
|
|
669
753
|
}
|
|
670
754
|
}
|
|
671
755
|
class T {
|
|
672
|
-
constructor(e = 0, t = 0,
|
|
673
|
-
this.left = e, this.width = t, this.height =
|
|
756
|
+
constructor(e = 0, t = 0, o = 0, s = 0, i) {
|
|
757
|
+
this.left = e, this.width = t, this.height = o, this.top = s, this.index = i;
|
|
674
758
|
}
|
|
675
759
|
}
|
|
676
|
-
class
|
|
677
|
-
constructor(e, t,
|
|
678
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
679
|
-
const
|
|
680
|
-
|
|
681
|
-
this.dom.addClass("ge-table",
|
|
760
|
+
class be {
|
|
761
|
+
constructor(e, t, o, s) {
|
|
762
|
+
this.hostElement = e, this.tableModel = t, this.dom = o, this.tableOptions = s, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
|
|
763
|
+
const i = this.hostElement;
|
|
764
|
+
i.innerText = "", this.dom.setAttribute(i, "tabindex", "0"), this.dom.setStyle(
|
|
765
|
+
this.dom.addClass("ge-table", i),
|
|
682
766
|
"position",
|
|
683
767
|
"relative"
|
|
684
|
-
), this.hoverRow =
|
|
685
|
-
|
|
686
|
-
), this.hoverColumn =
|
|
687
|
-
|
|
688
|
-
), this.
|
|
689
|
-
|
|
690
|
-
|
|
768
|
+
), this.hoverRow = o.applyStylePosistionAbsolute(
|
|
769
|
+
o.createDivWithClass("ge-table-hover-row", i)
|
|
770
|
+
), this.hoverColumn = o.applyStylePosistionAbsolute(
|
|
771
|
+
o.createDivWithClass("ge-table-hover-column", i)
|
|
772
|
+
), this.draggingColumn = o.applyStylePosistionAbsolute(
|
|
773
|
+
o.createDivWithClass("ge-table-dragging-column", i)
|
|
774
|
+
), this.areaHeaderWest = o.appendRelativeChildDiv(
|
|
775
|
+
o.applyStylePosistionAbsolute(
|
|
776
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-west", i, "header", "west")
|
|
691
777
|
)
|
|
692
|
-
), this.areaHeaderCenter =
|
|
693
|
-
|
|
694
|
-
|
|
778
|
+
), this.areaHeaderCenter = o.appendRelativeChildDiv(
|
|
779
|
+
o.applyStylePosistionAbsolute(
|
|
780
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
|
|
695
781
|
)
|
|
696
|
-
), this.areaHeaderEast =
|
|
697
|
-
|
|
698
|
-
|
|
782
|
+
), this.areaHeaderEast = o.appendRelativeChildDiv(
|
|
783
|
+
o.applyStylePosistionAbsolute(
|
|
784
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
|
|
699
785
|
)
|
|
700
|
-
), this.areaBodyWest =
|
|
701
|
-
|
|
702
|
-
|
|
786
|
+
), this.areaBodyWest = o.appendRelativeChildDiv(
|
|
787
|
+
o.applyStylePosistionAbsolute(
|
|
788
|
+
o.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
|
|
703
789
|
)
|
|
704
|
-
), this.areaBodyEast =
|
|
705
|
-
|
|
706
|
-
|
|
790
|
+
), this.areaBodyEast = o.appendRelativeChildDiv(
|
|
791
|
+
o.applyStylePosistionAbsolute(
|
|
792
|
+
o.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
|
|
707
793
|
)
|
|
708
|
-
), this.areaFooterWest =
|
|
709
|
-
|
|
710
|
-
|
|
794
|
+
), this.areaFooterWest = o.appendRelativeChildDiv(
|
|
795
|
+
o.applyStylePosistionAbsolute(
|
|
796
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
|
|
711
797
|
)
|
|
712
|
-
), this.areaFooterCenter =
|
|
713
|
-
|
|
714
|
-
|
|
798
|
+
), this.areaFooterCenter = o.appendRelativeChildDiv(
|
|
799
|
+
o.applyStylePosistionAbsolute(
|
|
800
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
|
|
715
801
|
)
|
|
716
|
-
), this.areaFooterEast =
|
|
717
|
-
|
|
718
|
-
|
|
802
|
+
), this.areaFooterEast = o.appendRelativeChildDiv(
|
|
803
|
+
o.applyStylePosistionAbsolute(
|
|
804
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
|
|
719
805
|
)
|
|
720
|
-
), this.scrollViewport =
|
|
806
|
+
), this.scrollViewport = o.applyStyleOverflowAuto(
|
|
721
807
|
this.tableOptions.overflowX ?? "auto",
|
|
722
808
|
this.tableOptions.overflowY ?? "auto",
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
809
|
+
o.applyStyleNoPadding(
|
|
810
|
+
o.applyStylePosistionAbsolute(
|
|
811
|
+
o.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
|
|
726
812
|
)
|
|
727
813
|
)
|
|
728
|
-
), this.contentWrapperDiv =
|
|
729
|
-
|
|
730
|
-
|
|
814
|
+
), this.contentWrapperDiv = o.applyStyleNoPadding(
|
|
815
|
+
o.applyStylePosistionRelative(
|
|
816
|
+
o.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
731
817
|
)
|
|
732
|
-
), this.contentDiv =
|
|
733
|
-
|
|
734
|
-
|
|
818
|
+
), this.contentDiv = o.applyStyleNoPadding(
|
|
819
|
+
o.applyStylePosistionRelative(
|
|
820
|
+
o.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
735
821
|
)
|
|
736
|
-
), this.areaBodyCenter =
|
|
737
|
-
|
|
738
|
-
), this.borderHeaderBottom =
|
|
739
|
-
|
|
740
|
-
), this.borderFixedWest =
|
|
741
|
-
|
|
742
|
-
), this.borderFixedEast =
|
|
743
|
-
|
|
744
|
-
), this.borderFooterTop =
|
|
745
|
-
|
|
822
|
+
), this.areaBodyCenter = o.appendRelativeChildDiv(
|
|
823
|
+
o.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
824
|
+
), this.borderHeaderBottom = o.applyStylePosistionAbsolute(
|
|
825
|
+
o.createDivWithClass("ge-table-header-border", i)
|
|
826
|
+
), this.borderFixedWest = o.applyStylePosistionAbsolute(
|
|
827
|
+
o.createDivWithClass("ge-table-west-fixed-column-border", i)
|
|
828
|
+
), this.borderFixedEast = o.applyStylePosistionAbsolute(
|
|
829
|
+
o.createDivWithClass("ge-table-east-fixed-column-border", i)
|
|
830
|
+
), this.borderFooterTop = o.applyStylePosistionAbsolute(
|
|
831
|
+
o.createDivWithClass("ge-table-footer-border", i)
|
|
746
832
|
);
|
|
747
833
|
}
|
|
834
|
+
/**
|
|
835
|
+
* Adjusts the containers and rows of the table based on the current state.
|
|
836
|
+
*
|
|
837
|
+
* @return {void}
|
|
838
|
+
*/
|
|
748
839
|
adjustContainersAndRows() {
|
|
749
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
840
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, o = this.hostElement.clientHeight;
|
|
750
841
|
this.dom.applyStyle(this.scrollViewport, {
|
|
751
842
|
width: `${t - e.left}px`,
|
|
752
|
-
height: `${
|
|
843
|
+
height: `${o - e.top}px`,
|
|
753
844
|
top: `${e.top}px`,
|
|
754
845
|
left: `${e.left}px`
|
|
755
846
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -757,21 +848,21 @@ class ae {
|
|
|
757
848
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
758
849
|
top: `${this.scrollTop}px`,
|
|
759
850
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
760
|
-
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height =
|
|
851
|
+
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = o - 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(
|
|
761
852
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
762
853
|
width: "1px",
|
|
763
854
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
764
855
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
765
856
|
left: `${this.areaBodyWestGeo.width}px`
|
|
766
857
|
})
|
|
767
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height =
|
|
858
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = o - 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(
|
|
768
859
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
769
860
|
width: "1px",
|
|
770
861
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
771
862
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
772
863
|
left: `${this.areaBodyEastGeo.left}px`
|
|
773
864
|
})
|
|
774
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height =
|
|
865
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = o - 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, {
|
|
775
866
|
width: `${t - e.left - e.right}px`,
|
|
776
867
|
height: `${e.top}px`,
|
|
777
868
|
top: "0",
|
|
@@ -796,35 +887,48 @@ class ae {
|
|
|
796
887
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
797
888
|
width: `${e.left}px`,
|
|
798
889
|
height: `${e.bottom}px`,
|
|
799
|
-
top: `${
|
|
890
|
+
top: `${o - e.bottom}px`,
|
|
800
891
|
left: "0"
|
|
801
892
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
802
893
|
width: `${t - e.left - e.right}px`,
|
|
803
894
|
height: `${e.bottom}px`,
|
|
804
|
-
top: `${
|
|
895
|
+
top: `${o - e.bottom}px`,
|
|
805
896
|
left: `${e.left}px`
|
|
806
897
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
807
898
|
width: `${e.right}px`,
|
|
808
899
|
height: `${e.bottom}px`,
|
|
809
|
-
top: `${
|
|
900
|
+
top: `${o - e.bottom}px`,
|
|
810
901
|
left: `${t - e.right}px`
|
|
811
902
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
812
903
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
813
904
|
width: `${t}px`,
|
|
814
905
|
height: "1px",
|
|
815
|
-
top: `${
|
|
906
|
+
top: `${o - e.bottom}px`,
|
|
816
907
|
left: "0px"
|
|
817
908
|
})
|
|
818
909
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
819
910
|
}
|
|
911
|
+
/**
|
|
912
|
+
* Adjusts the position or appearance of elements after scrolling.
|
|
913
|
+
* This method must be overwritten in child classes.
|
|
914
|
+
*
|
|
915
|
+
* @return {void}
|
|
916
|
+
*/
|
|
820
917
|
adjustAfterScrolling() {
|
|
821
918
|
}
|
|
919
|
+
/**
|
|
920
|
+
* Resets the size of the wrapper div based on the content dimensions.
|
|
921
|
+
*
|
|
922
|
+
* @protected
|
|
923
|
+
*
|
|
924
|
+
* @returns {void} Returns nothing.
|
|
925
|
+
*/
|
|
822
926
|
resetSizeOfWrapperDiv() {
|
|
823
927
|
const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
|
|
824
928
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
825
929
|
}
|
|
826
930
|
}
|
|
827
|
-
class
|
|
931
|
+
class E {
|
|
828
932
|
/**
|
|
829
933
|
* Represents a constructor for a class.
|
|
830
934
|
* @constructor
|
|
@@ -834,11 +938,11 @@ class R {
|
|
|
834
938
|
* @param {number} c2 - The value for c2.
|
|
835
939
|
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
836
940
|
*/
|
|
837
|
-
constructor(e, t, s, i
|
|
838
|
-
this.r1 = e, this.c1 = t, this.r2 =
|
|
941
|
+
constructor(e, t, o, s, i = !1) {
|
|
942
|
+
this.r1 = e, this.c1 = t, this.r2 = o, this.c2 = s, this.gammaRange = i;
|
|
839
943
|
}
|
|
840
944
|
static create(e) {
|
|
841
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
945
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
|
|
842
946
|
e.rowIndex1,
|
|
843
947
|
e.columnIndex1,
|
|
844
948
|
e.rowIndex2,
|
|
@@ -847,19 +951,19 @@ class R {
|
|
|
847
951
|
);
|
|
848
952
|
}
|
|
849
953
|
static singleCell(e, t) {
|
|
850
|
-
return new
|
|
954
|
+
return new E(e, t, e, t);
|
|
851
955
|
}
|
|
852
956
|
static singleRow(e) {
|
|
853
|
-
return new
|
|
957
|
+
return new E(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
854
958
|
}
|
|
855
959
|
static singleColumn(e) {
|
|
856
|
-
return new
|
|
960
|
+
return new E(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
857
961
|
}
|
|
858
962
|
isInRange(e, t) {
|
|
859
963
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
860
964
|
}
|
|
861
965
|
}
|
|
862
|
-
class
|
|
966
|
+
class ue {
|
|
863
967
|
constructor(e, t) {
|
|
864
968
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
865
969
|
}
|
|
@@ -868,14 +972,14 @@ class de {
|
|
|
868
972
|
return;
|
|
869
973
|
this.colAndRowspanRanges = [];
|
|
870
974
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
871
|
-
for (let
|
|
872
|
-
for (let
|
|
873
|
-
let
|
|
874
|
-
if (
|
|
875
|
-
|
|
876
|
-
const
|
|
975
|
+
for (let o = 0; o < e; o++)
|
|
976
|
+
for (let s = 0; s < t; s++) {
|
|
977
|
+
let i = this.areaModel.getColspanAt(o, s), r = this.areaModel.getRowspanAt(o, s);
|
|
978
|
+
if (i > 1 || r > 1) {
|
|
979
|
+
i === 0 && (i = 1), r === 0 && (r = 1);
|
|
980
|
+
const a = "gammaCells" in this.areaModel;
|
|
877
981
|
this.colAndRowspanRanges.push(
|
|
878
|
-
new
|
|
982
|
+
new E(o, s, o + r - 1, s + i - 1, a)
|
|
879
983
|
);
|
|
880
984
|
}
|
|
881
985
|
}
|
|
@@ -885,58 +989,98 @@ class de {
|
|
|
885
989
|
}
|
|
886
990
|
isInRange(e, t) {
|
|
887
991
|
if (this.colAndRowspanRanges) {
|
|
888
|
-
for (const
|
|
889
|
-
if (
|
|
992
|
+
for (const o of this.colAndRowspanRanges)
|
|
993
|
+
if (o.isInRange(e, t))
|
|
890
994
|
return !0;
|
|
891
995
|
}
|
|
892
996
|
return !1;
|
|
893
997
|
}
|
|
894
998
|
}
|
|
895
|
-
class
|
|
896
|
-
constructor(e, t,
|
|
897
|
-
this.header = e, this.body = t, this.footer =
|
|
999
|
+
class Se {
|
|
1000
|
+
constructor(e, t, o) {
|
|
1001
|
+
this.header = e, this.body = t, this.footer = o;
|
|
898
1002
|
}
|
|
899
1003
|
}
|
|
900
|
-
class
|
|
901
|
-
constructor(e, t,
|
|
902
|
-
var r,
|
|
903
|
-
super(e, t,
|
|
1004
|
+
class fe extends be {
|
|
1005
|
+
constructor(e, t, o, s) {
|
|
1006
|
+
var r, a;
|
|
1007
|
+
super(e, t, o, s), this.dragging = !1, this.editing = !1, this.storedColumnWidths = [], this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
904
1008
|
header: [],
|
|
905
1009
|
body: [],
|
|
906
1010
|
footer: []
|
|
907
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
1011
|
+
}, this.tree = !1, this.colAndRowspanModels = new Se(), 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), W(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
908
1012
|
(l) => {
|
|
909
|
-
var
|
|
910
|
-
this.colAndRowspanModels[l] = new
|
|
1013
|
+
var n;
|
|
1014
|
+
this.colAndRowspanModels[l] = new ue(t, t.getAreaModel(l)), (n = this.colAndRowspanModels[l]) == null || n.init();
|
|
911
1015
|
}
|
|
912
1016
|
);
|
|
913
1017
|
}
|
|
914
1018
|
isEditing() {
|
|
915
1019
|
return this.editing;
|
|
916
1020
|
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Resets the editor renderer by clearing its values and state.
|
|
1023
|
+
*
|
|
1024
|
+
* @function resetEditorRenderer
|
|
1025
|
+
* @memberof ClassName
|
|
1026
|
+
*
|
|
1027
|
+
* @returns {void}
|
|
1028
|
+
*/
|
|
917
1029
|
resetEditorRenderer() {
|
|
918
1030
|
this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
|
|
919
1031
|
}
|
|
920
|
-
|
|
1032
|
+
/**
|
|
1033
|
+
* Clears the selection in the component.
|
|
1034
|
+
*
|
|
1035
|
+
* @param {boolean} rerender - Indicates whether to rerender the component after clearing the selection. Default value is false.
|
|
1036
|
+
*
|
|
1037
|
+
* @return {void}
|
|
1038
|
+
*/
|
|
1039
|
+
clearSelection(e = !1) {
|
|
921
1040
|
if (this.getSelectionModel) {
|
|
922
|
-
const
|
|
923
|
-
|
|
1041
|
+
const t = this.getSelectionModel();
|
|
1042
|
+
t == null || t.clear(), e && this.repaint();
|
|
924
1043
|
}
|
|
925
1044
|
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Initializes and renders the editor for a specified row and column index.
|
|
1047
|
+
*
|
|
1048
|
+
* @param {number} rowIdx - The index of the row.
|
|
1049
|
+
* @param {number} colIdx - The index of the column.
|
|
1050
|
+
*/
|
|
926
1051
|
initRenderEditor(e, t) {
|
|
927
|
-
var
|
|
928
|
-
let
|
|
929
|
-
if (
|
|
930
|
-
if (this.editorRenderer =
|
|
1052
|
+
var s;
|
|
1053
|
+
let o = (s = this.tableModel.getColumnDef(t)) == null ? void 0 : s.getEditRenderer;
|
|
1054
|
+
if (o || (o = this.tableOptions.getEditRenderer), o)
|
|
1055
|
+
if (this.editorRenderer = o(e, t), this.editorRenderer) {
|
|
931
1056
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
932
|
-
const
|
|
933
|
-
|
|
1057
|
+
const i = document.querySelector("input.ge-table-cell-editor-input");
|
|
1058
|
+
i && i.focus();
|
|
934
1059
|
} else
|
|
935
1060
|
this.resetEditorRenderer();
|
|
936
1061
|
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Adjusts the content after scrolling and initiates a repaint of the component.
|
|
1064
|
+
*
|
|
1065
|
+
* @return {void}
|
|
1066
|
+
*/
|
|
937
1067
|
repaint() {
|
|
938
1068
|
this.adjustAfterScrolling();
|
|
939
1069
|
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Repaints the UI by resetting the size of the wrapper div,
|
|
1072
|
+
* adjusting the containers and rows, and performing additional adjustments
|
|
1073
|
+
* after scrolling.
|
|
1074
|
+
*
|
|
1075
|
+
* @return {void} This method does not return any value.
|
|
1076
|
+
*/
|
|
1077
|
+
repaintHard() {
|
|
1078
|
+
this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.adjustAfterScrolling();
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Adjusts the table after scrolling. This method performs various adjustments
|
|
1082
|
+
* to the table's appearance and behavior after a scroll event occurs.
|
|
1083
|
+
*/
|
|
940
1084
|
adjustAfterScrolling() {
|
|
941
1085
|
var e;
|
|
942
1086
|
for (const t of this.removables)
|
|
@@ -959,25 +1103,86 @@ class ce extends ae {
|
|
|
959
1103
|
"ge-table-body-west-vertical-border"
|
|
960
1104
|
));
|
|
961
1105
|
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Checks if the scroll position should be saved and saves it.
|
|
1108
|
+
*
|
|
1109
|
+
* @return {void}
|
|
1110
|
+
*/
|
|
962
1111
|
checkForScrollPosSaving() {
|
|
963
1112
|
var e, t;
|
|
964
1113
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
965
1114
|
}
|
|
1115
|
+
/**
|
|
1116
|
+
* Updates the cells in the table with the provided values and optionally repaints all cells.
|
|
1117
|
+
*
|
|
1118
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events containing information about the cells to update.
|
|
1119
|
+
* @param {boolean} repaintAll - Optional. If true, repaints all cells after updating. Defaults to false.
|
|
1120
|
+
*
|
|
1121
|
+
* @returns {void}
|
|
1122
|
+
*/
|
|
966
1123
|
updateCells(e, t = !1) {
|
|
967
1124
|
e.forEach(
|
|
968
|
-
(
|
|
969
|
-
this.tableModel.getAreaModel(
|
|
1125
|
+
(o) => {
|
|
1126
|
+
this.tableModel.getAreaModel(o.area).setValue(o.rowIndex, o.columnIndex, o.value), t || this.rerenderCellContent(o);
|
|
970
1127
|
}
|
|
971
1128
|
), t && this.repaint();
|
|
972
1129
|
}
|
|
1130
|
+
/**
|
|
1131
|
+
* Rerenders the content of a table cell based on the given parameters.
|
|
1132
|
+
*
|
|
1133
|
+
* @param {TableCellUpdateEventIf} area - The area of the table.
|
|
1134
|
+
* @param {number} rowIndex - The index of the row.
|
|
1135
|
+
* @param {number} columnIndex - The index of the column.
|
|
1136
|
+
* @param {any} value - The new value to be displayed in the cell.
|
|
1137
|
+
* @param {string[]} cssClasses - An array of CSS classes to be applied to the cell.
|
|
1138
|
+
*/
|
|
1139
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: o, value: s, cssClasses: i }) {
|
|
1140
|
+
const r = this.tableModel.getAreaModel(e), a = 'div[data-col-index="' + o + '"][data-row-index="' + t + '"][data-area="' + e + '"]', l = document.querySelector(a);
|
|
1141
|
+
if (l) {
|
|
1142
|
+
let n;
|
|
1143
|
+
const c = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === o ? this.editorRenderer : r.getCellRenderer(t, o);
|
|
1144
|
+
if (l.innerText = "", this.applyCssClasses(l, i), c)
|
|
1145
|
+
n = c.render(l, t, o, e, r, s, this.dom.domService), n && this.cleanupFunctions[e].push(n);
|
|
1146
|
+
else {
|
|
1147
|
+
const u = `${s}`;
|
|
1148
|
+
this.dom.addLabelDiv(l, u, !1, t, o, e);
|
|
1149
|
+
}
|
|
1150
|
+
const h = r.getCustomClassesAt(t, o);
|
|
1151
|
+
h.length && this.dom.addClasses(h, l);
|
|
1152
|
+
const f = r.getCustomStyleAt(t, o);
|
|
1153
|
+
if (f)
|
|
1154
|
+
for (const u in f)
|
|
1155
|
+
this.dom.setStyle(l, u, f[u]);
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Stores the widths of all columns in the table.
|
|
1160
|
+
*
|
|
1161
|
+
* @protected
|
|
1162
|
+
* @function storeColumnWidths
|
|
1163
|
+
* @returns {void}
|
|
1164
|
+
*/
|
|
1165
|
+
storeColumnWidths() {
|
|
1166
|
+
const e = this.tableModel.getColumnDefs();
|
|
1167
|
+
e != null && e.length && (this.storedColumnWidths = e.map((t, o) => this.tableModel.getColumnWidth(o)));
|
|
1168
|
+
}
|
|
973
1169
|
getAreaAndSideIdentByAttr(e) {
|
|
974
1170
|
if (e) {
|
|
975
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
976
|
-
if (
|
|
977
|
-
return [t,
|
|
1171
|
+
const t = this.getStringByAttr(e, "data-area"), o = this.getStringByAttr(e, "data-side");
|
|
1172
|
+
if (o && t)
|
|
1173
|
+
return [t, o];
|
|
978
1174
|
}
|
|
979
1175
|
return [void 0, void 0];
|
|
980
1176
|
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Retrieves the specified area from the grid layout.
|
|
1179
|
+
*
|
|
1180
|
+
* @param {string} areaIdent - The identifier for the area ('header', 'body', or 'footer').
|
|
1181
|
+
* @param {string} sideIdent - The identifier for the side of the area ('west', 'center', or 'east').
|
|
1182
|
+
* @protected
|
|
1183
|
+
* @returns {HTMLElement} - The requested area element.
|
|
1184
|
+
* @throws {Error} - If the area identifier or side identifier is incorrect.
|
|
1185
|
+
*/
|
|
981
1186
|
getArea(e, t) {
|
|
982
1187
|
if (e === "header") {
|
|
983
1188
|
if (t === "west")
|
|
@@ -1003,110 +1208,140 @@ class ce extends ae {
|
|
|
1003
1208
|
}
|
|
1004
1209
|
throw Error(`Wrong area identifier: row:${e}, col:${t}`);
|
|
1005
1210
|
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Adjusts the body of the table.
|
|
1213
|
+
*
|
|
1214
|
+
* @protected
|
|
1215
|
+
* @return {void}
|
|
1216
|
+
*/
|
|
1006
1217
|
adjustBody() {
|
|
1007
1218
|
const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
|
|
1008
1219
|
this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
|
|
1009
1220
|
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Returns a number value extracted from the specified attribute of the source element.
|
|
1223
|
+
*
|
|
1224
|
+
* @param {HTMLElement} srcElement - The source element from which to extract the attribute value.
|
|
1225
|
+
* @param {string} key - The attribute key to extract the value from.
|
|
1226
|
+
* @returns {number} - The extracted number value, or -1 if the attribute was not found or not a valid number.
|
|
1227
|
+
* @protected
|
|
1228
|
+
*/
|
|
1010
1229
|
getNumberByAttr(e, t) {
|
|
1011
|
-
var
|
|
1230
|
+
var o;
|
|
1012
1231
|
if (e) {
|
|
1013
|
-
const
|
|
1014
|
-
if (
|
|
1015
|
-
return Number(
|
|
1232
|
+
const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
|
|
1233
|
+
if (s)
|
|
1234
|
+
return Number(s);
|
|
1016
1235
|
}
|
|
1017
1236
|
return -1;
|
|
1018
1237
|
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Retrieves the value of the specified attribute from the nearest ancestor element that has the attribute.
|
|
1240
|
+
*
|
|
1241
|
+
* @param {HTMLElement} srcElement - The source element from which to start searching for the nearest ancestor element.
|
|
1242
|
+
* @param {string} key - The name of the attribute to retrieve.
|
|
1243
|
+
* @returns {string} The value of the specified attribute, or an empty string if the attribute is not found.
|
|
1244
|
+
* @protected
|
|
1245
|
+
*/
|
|
1019
1246
|
getStringByAttr(e, t) {
|
|
1020
|
-
var
|
|
1247
|
+
var o;
|
|
1021
1248
|
if (e) {
|
|
1022
|
-
const
|
|
1023
|
-
if (
|
|
1024
|
-
return
|
|
1249
|
+
const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
|
|
1250
|
+
if (s)
|
|
1251
|
+
return s;
|
|
1025
1252
|
}
|
|
1026
1253
|
return "";
|
|
1027
1254
|
}
|
|
1255
|
+
/**
|
|
1256
|
+
* Adjusts the layout and positioning of the specified area in the table.
|
|
1257
|
+
* This method is used internally and should not be called directly.
|
|
1258
|
+
*
|
|
1259
|
+
* @param {AreaIdent} areaIdent - The identifier of the area to adjust (e.g. header, body, footer).
|
|
1260
|
+
* @param {number} [yStart=0] - The starting y-position for the layout adjustments.
|
|
1261
|
+
* @protected
|
|
1262
|
+
*/
|
|
1028
1263
|
adjustArea(e, t = 0) {
|
|
1029
|
-
var
|
|
1030
|
-
const
|
|
1031
|
-
|
|
1032
|
-
const
|
|
1264
|
+
var b;
|
|
1265
|
+
const o = this.getArea(e, "west"), s = this.getArea(e, "center"), i = this.getArea(e, "east"), r = s.child.clientHeight;
|
|
1266
|
+
o.child.innerText = "", s.child.innerText = "", i.child.innerText = "";
|
|
1267
|
+
const a = 0, l = this.areaBodyCenterGeo.width, n = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), c = d.getRowCount();
|
|
1033
1268
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1269
|
+
const g = this.cleanupFunctions[e].shift();
|
|
1270
|
+
g && g();
|
|
1036
1271
|
}
|
|
1037
|
-
let
|
|
1038
|
-
const
|
|
1039
|
-
for (let
|
|
1040
|
-
const
|
|
1041
|
-
if (
|
|
1042
|
-
this.firstVisibleRowIndex =
|
|
1043
|
-
let
|
|
1044
|
-
const
|
|
1272
|
+
let h = t;
|
|
1273
|
+
const f = this.tableModel.getColumnCount(), u = this.tableModel.getFixedRightColumnCount(), S = this.tableModel.getFixedLeftColumnCount();
|
|
1274
|
+
for (let g = 0; g < c; g++) {
|
|
1275
|
+
const v = h, m = g === c - 1, x = this.tableModel.getRowHeight(e, g);
|
|
1276
|
+
if (v + x > 0) {
|
|
1277
|
+
this.firstVisibleRowIndex = g;
|
|
1278
|
+
let w = { left: a, width: l, height: x, top: v, index: g }, y = this.dom.addRowDiv(s, w, g, e, "center");
|
|
1279
|
+
const R = S;
|
|
1045
1280
|
if (this.adjustColumnsToRowParent({
|
|
1046
1281
|
areaIdent: e,
|
|
1047
1282
|
sideIdent: "center",
|
|
1048
1283
|
areaModel: d,
|
|
1049
|
-
geo:
|
|
1050
|
-
parent:
|
|
1051
|
-
rowIndex:
|
|
1052
|
-
columnIndexStart:
|
|
1053
|
-
columnIndexEnd:
|
|
1284
|
+
geo: w,
|
|
1285
|
+
parent: y,
|
|
1286
|
+
rowIndex: g,
|
|
1287
|
+
columnIndexStart: R,
|
|
1288
|
+
columnIndexEnd: f - u - 1,
|
|
1054
1289
|
verticalFixed: !1,
|
|
1055
|
-
lastRowOfModel:
|
|
1056
|
-
}),
|
|
1290
|
+
lastRowOfModel: m
|
|
1291
|
+
}), n.left > 0 && (w = { left: a, width: this.areaBodyWestGeo.width, height: x, top: v, index: g }, y = this.dom.addRowDiv(o, w, g, e, "west"), this.adjustColumnsToRowParent({
|
|
1057
1292
|
areaIdent: e,
|
|
1058
1293
|
sideIdent: "west",
|
|
1059
1294
|
areaModel: d,
|
|
1060
|
-
geo:
|
|
1061
|
-
parent:
|
|
1062
|
-
rowIndex:
|
|
1295
|
+
geo: w,
|
|
1296
|
+
parent: y,
|
|
1297
|
+
rowIndex: g,
|
|
1063
1298
|
columnIndexStart: 0,
|
|
1064
|
-
columnIndexEnd:
|
|
1299
|
+
columnIndexEnd: R - 1,
|
|
1065
1300
|
verticalFixed: !0,
|
|
1066
|
-
lastRowOfModel:
|
|
1067
|
-
})),
|
|
1301
|
+
lastRowOfModel: m
|
|
1302
|
+
})), n.right > 0 && (w = { left: a, width: this.areaBodyEastGeo.width, height: x, top: v, index: g }, y = this.dom.addRowDiv(i, w, g, e, "east"), this.adjustColumnsToRowParent({
|
|
1068
1303
|
areaIdent: e,
|
|
1069
1304
|
sideIdent: "east",
|
|
1070
1305
|
areaModel: d,
|
|
1071
|
-
geo:
|
|
1072
|
-
parent:
|
|
1073
|
-
rowIndex:
|
|
1074
|
-
columnIndexStart:
|
|
1075
|
-
columnIndexEnd:
|
|
1306
|
+
geo: w,
|
|
1307
|
+
parent: y,
|
|
1308
|
+
rowIndex: g,
|
|
1309
|
+
columnIndexStart: f - u,
|
|
1310
|
+
columnIndexEnd: f - 1,
|
|
1076
1311
|
verticalFixed: !0,
|
|
1077
|
-
lastRowOfModel:
|
|
1078
|
-
})), e === "header" && this.tree &&
|
|
1312
|
+
lastRowOfModel: m
|
|
1313
|
+
})), e === "header" && this.tree && g === c - 1) {
|
|
1079
1314
|
const A = this.dom.applyStyle(
|
|
1080
1315
|
this.dom.setAttribute(
|
|
1081
|
-
this.dom.addDiv(
|
|
1316
|
+
this.dom.addDiv(y, new T(16, 20, 20, 8)),
|
|
1082
1317
|
"data-ge-action",
|
|
1083
1318
|
"toggleExpandCollapseAll"
|
|
1084
1319
|
),
|
|
1085
1320
|
{ cursor: "pointer" }
|
|
1086
1321
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1087
1322
|
if (M) {
|
|
1088
|
-
const
|
|
1089
|
-
this.dom.domService.appendChild(A,
|
|
1323
|
+
const O = this.dom.domService.createText(M.content);
|
|
1324
|
+
this.dom.domService.appendChild(A, O), M.style && this.dom.applyStyleString(A, M.style);
|
|
1090
1325
|
}
|
|
1091
1326
|
}
|
|
1092
1327
|
}
|
|
1093
|
-
if (
|
|
1328
|
+
if (h = h + x, h > r)
|
|
1094
1329
|
break;
|
|
1095
1330
|
}
|
|
1096
1331
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1097
|
-
const
|
|
1098
|
-
if (
|
|
1099
|
-
for (const
|
|
1100
|
-
let
|
|
1101
|
-
if (
|
|
1102
|
-
x =
|
|
1103
|
-
else if (
|
|
1104
|
-
x =
|
|
1332
|
+
const g = ((b = this.colAndRowspanModels[e]) == null ? void 0 : b.getRanges()) ?? [];
|
|
1333
|
+
if (g.length)
|
|
1334
|
+
for (const v of g) {
|
|
1335
|
+
let m = 0, x = s.child, w = "center";
|
|
1336
|
+
if (v.c1 < S)
|
|
1337
|
+
x = o.child, w = "west";
|
|
1338
|
+
else if (u > 0 && v.c1 >= f - u)
|
|
1339
|
+
x = i.child, w = "east";
|
|
1105
1340
|
else {
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1341
|
+
const y = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1342
|
+
m = this.scrollFactorX * y - this.areaBodyWestGeo.width, w = "center";
|
|
1108
1343
|
}
|
|
1109
|
-
this.drawBigCell(
|
|
1344
|
+
this.drawBigCell(v, m, t, d, x, w);
|
|
1110
1345
|
}
|
|
1111
1346
|
}
|
|
1112
1347
|
}
|
|
@@ -1120,328 +1355,536 @@ class ce extends ae {
|
|
|
1120
1355
|
* @param sideIdent SideIdent (west,center,east)
|
|
1121
1356
|
* @protected
|
|
1122
1357
|
*/
|
|
1123
|
-
drawBigCell(e, t, s, i,
|
|
1124
|
-
const
|
|
1358
|
+
drawBigCell(e, t, o, s, i, r) {
|
|
1359
|
+
const a = o + this.getRowHeights(0, e.r1 - 1, s).reduce((b, g) => b + g, 0), l = this.tableModel.getColumnCount(), n = this.tableModel.getFixedRightColumnCount();
|
|
1125
1360
|
let d = 0;
|
|
1126
|
-
|
|
1127
|
-
const
|
|
1128
|
-
let
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1131
|
-
areaModel:
|
|
1132
|
-
areaIdent:
|
|
1361
|
+
n > 0 && e.c1 >= l - n && (d = l - n);
|
|
1362
|
+
const c = t + this.getColumnWidths(d, e.c1 - 1).reduce((b, g) => b + g, 0), h = this.getRowHeights(e.r1, e.r2, s).reduce((b, g) => b + g, 0), f = this.getColumnWidths(e.c1, e.c2).reduce((b, g) => b + g, 0);
|
|
1363
|
+
let u = !1;
|
|
1364
|
+
const S = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1365
|
+
S && (u = S.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? this.renderCell({
|
|
1366
|
+
areaModel: s,
|
|
1367
|
+
areaIdent: s.areaIdent,
|
|
1133
1368
|
sideIdent: r,
|
|
1134
1369
|
rowIndex: e.r1,
|
|
1135
1370
|
columnIndex: e.c1,
|
|
1136
|
-
left:
|
|
1137
|
-
top:
|
|
1138
|
-
width:
|
|
1139
|
-
height:
|
|
1140
|
-
parent:
|
|
1141
|
-
cellSelected:
|
|
1371
|
+
left: c,
|
|
1372
|
+
top: a,
|
|
1373
|
+
width: f,
|
|
1374
|
+
height: h,
|
|
1375
|
+
parent: i,
|
|
1376
|
+
cellSelected: u,
|
|
1142
1377
|
lastRowOfModel: !0,
|
|
1143
1378
|
gammaRange: e.gammaRange
|
|
1144
|
-
})
|
|
1145
|
-
areaModel:
|
|
1146
|
-
areaIdent:
|
|
1379
|
+
}) : this.renderCell({
|
|
1380
|
+
areaModel: s,
|
|
1381
|
+
areaIdent: s.areaIdent,
|
|
1147
1382
|
sideIdent: r,
|
|
1148
1383
|
rowIndex: e.r1,
|
|
1149
1384
|
columnIndex: e.c1,
|
|
1150
|
-
left:
|
|
1151
|
-
top:
|
|
1152
|
-
width:
|
|
1153
|
-
height:
|
|
1154
|
-
parent:
|
|
1155
|
-
cellSelected:
|
|
1385
|
+
left: c,
|
|
1386
|
+
top: a,
|
|
1387
|
+
width: f,
|
|
1388
|
+
height: h,
|
|
1389
|
+
parent: i,
|
|
1390
|
+
cellSelected: u,
|
|
1156
1391
|
lastRowOfModel: !0,
|
|
1157
1392
|
gammaRange: e.gammaRange
|
|
1158
|
-
}),
|
|
1393
|
+
}), s.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1159
1394
|
rowIndex: e.r1,
|
|
1160
1395
|
columnIndex: e.c1,
|
|
1161
|
-
cellLeft:
|
|
1162
|
-
cellTop:
|
|
1163
|
-
cellWidth:
|
|
1164
|
-
cellHeight:
|
|
1165
|
-
parent:
|
|
1396
|
+
cellLeft: c,
|
|
1397
|
+
cellTop: a,
|
|
1398
|
+
cellWidth: f,
|
|
1399
|
+
cellHeight: h,
|
|
1400
|
+
parent: i
|
|
1166
1401
|
});
|
|
1167
1402
|
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1403
|
+
/**
|
|
1404
|
+
* Finds the row index of an important rowspan cell in a given area model.
|
|
1405
|
+
*
|
|
1406
|
+
* @param {AreaModelIf} areaModel - The area model to search in.
|
|
1407
|
+
* @param {number} rowIndex - The current row index.
|
|
1408
|
+
* @param {number} colIndex - The current column index.
|
|
1409
|
+
* @returns {number} - The row index of the important rowspan cell, or -1 if not found.
|
|
1410
|
+
* @protected
|
|
1411
|
+
*/
|
|
1412
|
+
findRowOfImportantRowspanCell(e, t, o) {
|
|
1413
|
+
const s = e.getMaxRowspan();
|
|
1414
|
+
for (let i = t - 1; i > -1; i--) {
|
|
1415
|
+
const r = e.getRowspanAt(i, o);
|
|
1416
|
+
if (r > 1 && i + r + 1 >= t)
|
|
1417
|
+
return i;
|
|
1418
|
+
if (t - i > s)
|
|
1175
1419
|
return -1;
|
|
1176
1420
|
}
|
|
1177
1421
|
return -1;
|
|
1178
1422
|
}
|
|
1423
|
+
/**
|
|
1424
|
+
* Adjusts the columns to fit the width of the row's parent element.
|
|
1425
|
+
*
|
|
1426
|
+
* @param {ArgsAdjustColumnsToRowParentParams} params - The parameters for adjusting the columns.
|
|
1427
|
+
* @protected
|
|
1428
|
+
* @return {void}
|
|
1429
|
+
*/
|
|
1179
1430
|
adjustColumnsToRowParent({
|
|
1180
1431
|
areaIdent: e,
|
|
1181
1432
|
sideIdent: t,
|
|
1182
|
-
areaModel:
|
|
1183
|
-
geo:
|
|
1184
|
-
parent:
|
|
1433
|
+
areaModel: o,
|
|
1434
|
+
geo: s,
|
|
1435
|
+
parent: i,
|
|
1185
1436
|
rowIndex: r,
|
|
1186
|
-
columnIndexStart:
|
|
1437
|
+
columnIndexStart: a,
|
|
1187
1438
|
columnIndexEnd: l,
|
|
1188
|
-
verticalFixed:
|
|
1439
|
+
verticalFixed: n = !1,
|
|
1189
1440
|
lastRowOfModel: d = !1
|
|
1190
1441
|
}) {
|
|
1191
|
-
var
|
|
1442
|
+
var S;
|
|
1192
1443
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1193
|
-
let
|
|
1194
|
-
if (!
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1444
|
+
let c = 0;
|
|
1445
|
+
if (!n) {
|
|
1446
|
+
const b = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1447
|
+
c = this.scrollFactorX * b;
|
|
1197
1448
|
}
|
|
1198
|
-
const
|
|
1199
|
-
let
|
|
1200
|
-
for (let
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1203
|
-
let
|
|
1204
|
-
const x =
|
|
1205
|
-
x > 1 && (
|
|
1206
|
-
let
|
|
1207
|
-
|
|
1208
|
-
let
|
|
1209
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1210
|
-
this.renderDragTargetDiv(
|
|
1211
|
-
const A = { left:
|
|
1212
|
-
this.dom.addColumnBorderDivs(this.tableOptions,
|
|
1449
|
+
const h = 0, f = !!(e === "body" && t);
|
|
1450
|
+
let u = c;
|
|
1451
|
+
for (let b = a; b <= l; b++) {
|
|
1452
|
+
const g = u, v = this.tableModel.getColumnWidth(b);
|
|
1453
|
+
if (v > 0 && g + v > 0) {
|
|
1454
|
+
let m = s.height;
|
|
1455
|
+
const x = o.getRowspanAt(r, b), w = o.getColspanAt(r, b);
|
|
1456
|
+
x > 1 && (m = this.getRowHeights(r, r + x - 1, o).reduce((A, M) => A + M, 0));
|
|
1457
|
+
let y = v;
|
|
1458
|
+
w > 1 && (y = this.getColumnWidths(b, b + w - 1).reduce((A, M) => A + M, 0));
|
|
1459
|
+
let R = !1;
|
|
1460
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (S = this.colAndRowspanModels[e]) != null && S.isInRange(r, b) && (R = !0), this.draggingTargetColumnIndex === b && e !== "header") {
|
|
1461
|
+
this.renderDragTargetDiv(i, g, h, y, m);
|
|
1462
|
+
const A = { left: g, top: h, width: y, height: m };
|
|
1463
|
+
this.dom.addColumnBorderDivs(this.tableOptions, i, A, e, t);
|
|
1213
1464
|
} else {
|
|
1214
|
-
const A = this.renderSelectedBackgroundDiv(
|
|
1215
|
-
|
|
1216
|
-
areaModel:
|
|
1465
|
+
const A = this.renderSelectedBackgroundDiv(R, f, t, o, r, b, i, g, h, y, m);
|
|
1466
|
+
"gammaCells" in o && o.getValueAt(r, b) && (R = !1), R || this.renderCell({
|
|
1467
|
+
areaModel: o,
|
|
1217
1468
|
areaIdent: e,
|
|
1218
1469
|
sideIdent: t,
|
|
1219
1470
|
rowIndex: r,
|
|
1220
|
-
columnIndex:
|
|
1221
|
-
left:
|
|
1222
|
-
top:
|
|
1223
|
-
width:
|
|
1224
|
-
height:
|
|
1225
|
-
parent:
|
|
1471
|
+
columnIndex: b,
|
|
1472
|
+
left: g,
|
|
1473
|
+
top: h,
|
|
1474
|
+
width: y,
|
|
1475
|
+
height: m,
|
|
1476
|
+
parent: i,
|
|
1226
1477
|
cellSelected: A,
|
|
1227
1478
|
lastRowOfModel: d,
|
|
1228
1479
|
gammaRange: !0
|
|
1229
1480
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1230
1481
|
rowIndex: r,
|
|
1231
|
-
columnIndex:
|
|
1232
|
-
cellLeft:
|
|
1233
|
-
cellTop:
|
|
1234
|
-
cellWidth:
|
|
1235
|
-
cellHeight:
|
|
1236
|
-
parent:
|
|
1482
|
+
columnIndex: b,
|
|
1483
|
+
cellLeft: g,
|
|
1484
|
+
cellTop: h,
|
|
1485
|
+
cellWidth: y,
|
|
1486
|
+
cellHeight: m,
|
|
1487
|
+
parent: i
|
|
1237
1488
|
});
|
|
1238
1489
|
}
|
|
1239
1490
|
}
|
|
1240
|
-
if (
|
|
1491
|
+
if (u = u + v, u > this.areaBodyCenterGeo.width)
|
|
1241
1492
|
break;
|
|
1242
1493
|
}
|
|
1243
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(
|
|
1494
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(u - 1, 1, s.height, 0), i);
|
|
1244
1495
|
}
|
|
1496
|
+
/**
|
|
1497
|
+
* Retrieves the column index of the tree arrow column in the table.
|
|
1498
|
+
*
|
|
1499
|
+
* @protected
|
|
1500
|
+
*
|
|
1501
|
+
* @returns {0 | 1} The column index of the tree arrow column.
|
|
1502
|
+
* Returns 0 if the checkbox is not visible,
|
|
1503
|
+
* otherwise returns 1.
|
|
1504
|
+
*/
|
|
1245
1505
|
getTreeArrowColumnIndex() {
|
|
1246
1506
|
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
1247
1507
|
}
|
|
1248
1508
|
addAndRenderCellDiv({
|
|
1249
1509
|
areaModel: e,
|
|
1250
1510
|
areaIdent: t,
|
|
1251
|
-
sideIdent:
|
|
1252
|
-
rowIndex:
|
|
1253
|
-
index:
|
|
1511
|
+
sideIdent: o,
|
|
1512
|
+
rowIndex: s,
|
|
1513
|
+
index: i,
|
|
1254
1514
|
left: r,
|
|
1255
|
-
width:
|
|
1515
|
+
width: a,
|
|
1256
1516
|
height: l,
|
|
1257
|
-
top:
|
|
1517
|
+
top: n,
|
|
1258
1518
|
parent: d,
|
|
1259
|
-
lastRowOfModel:
|
|
1260
|
-
gammaRange: g
|
|
1519
|
+
lastRowOfModel: c
|
|
1261
1520
|
}) {
|
|
1262
|
-
var
|
|
1263
|
-
const
|
|
1264
|
-
let
|
|
1265
|
-
if (
|
|
1266
|
-
const
|
|
1267
|
-
(
|
|
1521
|
+
var X;
|
|
1522
|
+
const f = this.editorRenderer && this.editorRendererRow === s && this.editorRendererColumn === i ? this.editorRenderer : e.getCellRenderer(s, i), u = { left: r, width: a, height: l, top: n, index: i }, S = e.getRowByIndex(s);
|
|
1523
|
+
let b = "none";
|
|
1524
|
+
if (i === this.getTreeArrowColumnIndex() && P(S)) {
|
|
1525
|
+
const C = S;
|
|
1526
|
+
(X = C.children) != null && X.length ? C.expanded ? b = "expanded" : b = "collapsed" : b = "hidden";
|
|
1268
1527
|
}
|
|
1269
|
-
let
|
|
1528
|
+
let v;
|
|
1270
1529
|
if (t === "header") {
|
|
1271
|
-
const
|
|
1272
|
-
(!(
|
|
1530
|
+
const C = this.tableModel.getColumnDef(i);
|
|
1531
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (v = C == null ? void 0 : C.sortState);
|
|
1273
1532
|
}
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1533
|
+
const m = e.getValueAt(s, i), x = f ? "" : `${m}`, w = e.isRowChecked(s), y = this.dom.addColumnDiv(
|
|
1534
|
+
{
|
|
1535
|
+
parent: d,
|
|
1536
|
+
geo: u,
|
|
1537
|
+
rowIndex: s,
|
|
1538
|
+
columnIndex: i,
|
|
1539
|
+
areaIdent: t,
|
|
1540
|
+
sideIdent: o,
|
|
1541
|
+
text: x,
|
|
1542
|
+
treeArrow: b,
|
|
1543
|
+
tableOptions: this.tableOptions,
|
|
1544
|
+
checkedType: w,
|
|
1545
|
+
sortState: v
|
|
1546
|
+
}
|
|
1547
|
+
), R = e.getTooltipAt(s, i);
|
|
1548
|
+
R && this.dom.setAttribute(y, "title", R);
|
|
1549
|
+
const A = this.tableModel.getColumnDef(i);
|
|
1550
|
+
A && A.classes[t] && this.dom.addClasses(A.classes[t], y);
|
|
1551
|
+
let M;
|
|
1552
|
+
f && (M = f.render(y, s, i, t, e, m, this.dom.domService));
|
|
1553
|
+
const O = e.getCustomClassesAt(s, i);
|
|
1554
|
+
if (O.length && this.dom.addClasses(O, y), this.dom.addColumnBorderDivs(this.tableOptions, d, u, t, o), c && this.dom.addHorizontalBorder({ left: r, width: a, height: l, top: n + l }, d), this.getFocusModel && t === "body") {
|
|
1555
|
+
const C = this.getFocusModel();
|
|
1556
|
+
C != null && C.hasFocus(s, i) && this.dom.addFocusBorderDivs(d, u, {});
|
|
1296
1557
|
}
|
|
1297
|
-
t === "header" && this.dom.setAttribute(
|
|
1298
|
-
const
|
|
1299
|
-
if (
|
|
1300
|
-
for (const
|
|
1301
|
-
this.dom.setStyle(
|
|
1302
|
-
return [
|
|
1558
|
+
t === "header" && this.dom.setAttribute(y, "data-ge-action", "drag-column");
|
|
1559
|
+
const H = e.getCustomStyleAt(s, i);
|
|
1560
|
+
if (H)
|
|
1561
|
+
for (const C in H)
|
|
1562
|
+
this.dom.setStyle(y, C, H[C]);
|
|
1563
|
+
return [y, M];
|
|
1303
1564
|
}
|
|
1565
|
+
/**
|
|
1566
|
+
* Applies CSS classes to an HTML element.
|
|
1567
|
+
*
|
|
1568
|
+
* @param {HTMLDivElement} ele - The HTML element to which CSS classes will be applied.
|
|
1569
|
+
* @param {Object.<string, boolean>} cssClasses - An object containing CSS class names as keys and boolean values indicating whether to apply or remove the class.
|
|
1570
|
+
* @protected
|
|
1571
|
+
*/
|
|
1304
1572
|
applyCssClasses(e, t = {}) {
|
|
1305
|
-
e && Object.entries(t).forEach(([
|
|
1306
|
-
|
|
1573
|
+
e && Object.entries(t).forEach(([o, s]) => {
|
|
1574
|
+
s ? this.dom.addClass(o, e) : this.dom.removeClass(o, e);
|
|
1307
1575
|
});
|
|
1308
1576
|
}
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
const c = `${i}`;
|
|
1318
|
-
this.dom.addLabelDiv(l, c, !1, t, s, e);
|
|
1319
|
-
}
|
|
1320
|
-
const g = r.getCustomClassesAt(t, s);
|
|
1321
|
-
g.length && this.dom.addClasses(g, l);
|
|
1322
|
-
const m = r.getCustomStyleAt(t, s);
|
|
1323
|
-
if (m)
|
|
1324
|
-
for (const c in m)
|
|
1325
|
-
this.dom.setStyle(l, c, m[c]);
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1577
|
+
/**
|
|
1578
|
+
* Retrieves the column widths of a table within a specified range.
|
|
1579
|
+
*
|
|
1580
|
+
* @param {number} startIndex - The index of the first column to retrieve the width of.
|
|
1581
|
+
* @param {number} endIndex - The index of the last column to retrieve the width of.
|
|
1582
|
+
*
|
|
1583
|
+
* @return {number[]} An array containing the widths of the columns within the specified range.
|
|
1584
|
+
*/
|
|
1328
1585
|
getColumnWidths(e, t) {
|
|
1586
|
+
const o = [];
|
|
1587
|
+
for (let s = e; s <= t; s++)
|
|
1588
|
+
o.push(this.tableModel.getColumnWidth(s));
|
|
1589
|
+
return o;
|
|
1590
|
+
}
|
|
1591
|
+
/**
|
|
1592
|
+
* Retrieves the heights of rows within a specified range.
|
|
1593
|
+
*
|
|
1594
|
+
* @param {number} startIndex - The index of the first row in the range.
|
|
1595
|
+
* @param {number} endIndex - The index of the last row in the range.
|
|
1596
|
+
* @param {AreaModelIf} areaModel - The area model.
|
|
1597
|
+
* @return {number[]} - An array containing the heights of the rows within the specified range.
|
|
1598
|
+
*/
|
|
1599
|
+
getRowHeights(e, t, o) {
|
|
1329
1600
|
const s = [];
|
|
1330
1601
|
for (let i = e; i <= t; i++)
|
|
1331
|
-
s.push(
|
|
1602
|
+
s.push(o.getRowHeight(i));
|
|
1332
1603
|
return s;
|
|
1333
1604
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1605
|
+
/**
|
|
1606
|
+
* Adjusts the position and size of the hover row based on the mouse move event.
|
|
1607
|
+
*
|
|
1608
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
|
|
1609
|
+
*
|
|
1610
|
+
* @return {void}
|
|
1611
|
+
*/
|
|
1340
1612
|
adjustHoverRows(e) {
|
|
1341
1613
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1342
|
-
const t = this.hostElement.clientWidth,
|
|
1614
|
+
const t = this.hostElement.clientWidth, o = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), s = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1343
1615
|
this.dom.applyStyle(this.hoverRow, {
|
|
1344
1616
|
left: "0",
|
|
1345
|
-
top:
|
|
1617
|
+
top: s + "px",
|
|
1346
1618
|
width: t + "px",
|
|
1347
|
-
height:
|
|
1619
|
+
height: o + "px",
|
|
1348
1620
|
display: "block"
|
|
1349
1621
|
});
|
|
1350
1622
|
} else
|
|
1351
1623
|
this.hideHoverRow();
|
|
1352
1624
|
}
|
|
1625
|
+
/**
|
|
1626
|
+
* Hides the hover row by applying 'display: none' style to it.
|
|
1627
|
+
*
|
|
1628
|
+
* @protected
|
|
1629
|
+
* @function
|
|
1630
|
+
* @name hideHoverRow
|
|
1631
|
+
* @memberof ClassName
|
|
1632
|
+
*
|
|
1633
|
+
* @returns {void}
|
|
1634
|
+
*/
|
|
1353
1635
|
hideHoverRow() {
|
|
1354
1636
|
this.dom.applyStyle(this.hoverRow, {
|
|
1355
1637
|
display: "none"
|
|
1356
1638
|
});
|
|
1357
1639
|
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Adjusts the position and size of the hover column based on the mouse move event.
|
|
1642
|
+
*
|
|
1643
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
1644
|
+
*/
|
|
1358
1645
|
adjustHoverColumns(e) {
|
|
1359
1646
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1360
|
-
const t = this.hostElement.clientHeight,
|
|
1647
|
+
const t = this.hostElement.clientHeight, o = this.tableModel.getColumnWidth(e.columnIndex), s = this.areaBodyWestGeo.width, i = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - s;
|
|
1361
1648
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1362
|
-
left:
|
|
1649
|
+
left: i + "px",
|
|
1363
1650
|
top: "0px",
|
|
1364
|
-
width:
|
|
1651
|
+
width: o + "px",
|
|
1365
1652
|
height: t + "px",
|
|
1366
1653
|
display: "block"
|
|
1367
1654
|
});
|
|
1368
1655
|
} else
|
|
1369
1656
|
this.hideHoverColumn();
|
|
1370
1657
|
}
|
|
1658
|
+
/**
|
|
1659
|
+
* Hide hover column.
|
|
1660
|
+
*
|
|
1661
|
+
* This method hides the hover column by applying a style of 'display: none'
|
|
1662
|
+
* to the element representing the hover column.
|
|
1663
|
+
*
|
|
1664
|
+
* @protected
|
|
1665
|
+
* @memberof ClassName
|
|
1666
|
+
*/
|
|
1371
1667
|
hideHoverColumn() {
|
|
1372
1668
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1373
1669
|
display: "none"
|
|
1374
1670
|
});
|
|
1375
1671
|
}
|
|
1672
|
+
/**
|
|
1673
|
+
* Executes a function after a specified delay, ensuring that the function is called only once within that delay period.
|
|
1674
|
+
*
|
|
1675
|
+
* @param {() => void} fn - The function to be executed.
|
|
1676
|
+
* @param {number} [delay=1000] - The delay in milliseconds before executing the function.
|
|
1677
|
+
*
|
|
1678
|
+
* @return {undefined}
|
|
1679
|
+
*/
|
|
1376
1680
|
debounce(e, t = 1e3) {
|
|
1377
1681
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1378
1682
|
}
|
|
1379
|
-
|
|
1683
|
+
/**
|
|
1684
|
+
* Adjusts the dragging column during a mouse move event.
|
|
1685
|
+
*
|
|
1686
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event.
|
|
1687
|
+
* @param {number} sourceColumnIndex - The index of the source column.
|
|
1688
|
+
* @param {boolean} firstDraggingRendering - Indicates if it's the first rendering of the dragging column.
|
|
1689
|
+
*/
|
|
1690
|
+
adjustDraggingColumn(e, t, o) {
|
|
1691
|
+
var s, i;
|
|
1692
|
+
if (this.dragging) {
|
|
1693
|
+
const r = this.hostElement.clientHeight, a = this.storedColumnWidths[t];
|
|
1694
|
+
if ((s = e.originalEvent) != null && s.clientX) {
|
|
1695
|
+
const d = { left: ((i = e.originalEvent) == null ? void 0 : i.clientX) - a / 2, width: a, height: r, top: 0, index: t };
|
|
1696
|
+
this.dom.applyStyle(this.draggingColumn, {
|
|
1697
|
+
background: "rgba(128,128,128,0.2)",
|
|
1698
|
+
display: "block",
|
|
1699
|
+
overfllow: "clip"
|
|
1700
|
+
}), this.dom.applyStyleInPx(this.draggingColumn, d), o && this.renderContentOfDraggingColumn(d);
|
|
1701
|
+
}
|
|
1702
|
+
} else
|
|
1703
|
+
this.hideDraggingColumn();
|
|
1704
|
+
}
|
|
1705
|
+
/**
|
|
1706
|
+
* Renders the content of a dragging column.
|
|
1707
|
+
*
|
|
1708
|
+
* @param {GeoData} columnGeo - The geographic data of the column.
|
|
1709
|
+
*
|
|
1710
|
+
* @returns {number} The y-coordinate of the rendered content.
|
|
1711
|
+
*/
|
|
1712
|
+
renderContentOfDraggingColumn(e) {
|
|
1713
|
+
const t = this.renderContentOfDraggingColumnForArea(e, "header", 0);
|
|
1714
|
+
this.renderContentOfDraggingColumnForArea(e, "body", t);
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* Renders the content of the dragging column for a specific area.
|
|
1718
|
+
*
|
|
1719
|
+
* @param {GeoData} columnGeo - The geometry data of the dragging column.
|
|
1720
|
+
* @param {AreaIdent} areaIdent - The identifier of the area.
|
|
1721
|
+
* @param {number} [y=0] - The starting y-position.
|
|
1722
|
+
* @return {number} The final y-position after rendering all the content.
|
|
1723
|
+
*/
|
|
1724
|
+
renderContentOfDraggingColumnForArea(e, t, o = 0) {
|
|
1725
|
+
const s = "center", i = this.tableModel.getAreaModel(t), r = i == null ? void 0 : i.getRowCount();
|
|
1726
|
+
if (r) {
|
|
1727
|
+
const a = e.index ?? 0, l = this.draggingColumn;
|
|
1728
|
+
for (let n = 0; n < r; n++) {
|
|
1729
|
+
const d = o, c = i.getRowHeight(n), h = { left: 0, width: e.width, height: c, top: d, index: n }, f = i.getValueAt(n, a), u = i.getCellRenderer(n, a), S = u ? "" : `${f}`, b = {
|
|
1730
|
+
parent: l,
|
|
1731
|
+
geo: h,
|
|
1732
|
+
rowIndex: n,
|
|
1733
|
+
columnIndex: a,
|
|
1734
|
+
areaIdent: t,
|
|
1735
|
+
sideIdent: s,
|
|
1736
|
+
text: S
|
|
1737
|
+
}, g = this.dom.addColumnDiv(b);
|
|
1738
|
+
let v;
|
|
1739
|
+
u && (v = u.render(g, n, a, t, i, f, this.dom.domService), v && this.cleanupFunctions[t].push(v));
|
|
1740
|
+
const m = i.getCustomClassesAt(n, a);
|
|
1741
|
+
m.length && this.dom.addClasses(m, g);
|
|
1742
|
+
const x = this.tableModel.getColumnDef(a);
|
|
1743
|
+
x && x.classes[t] && this.dom.addClasses(x.classes[t], g), this.dom.addColumnBorderDivs(this.tableOptions, l, h, t, s);
|
|
1744
|
+
const w = i.getCustomStyleAt(n, a);
|
|
1745
|
+
if (w)
|
|
1746
|
+
for (const y in w)
|
|
1747
|
+
this.dom.setStyle(g, y, w[y]);
|
|
1748
|
+
o = o + c;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
return o;
|
|
1752
|
+
}
|
|
1753
|
+
/**
|
|
1754
|
+
* Hides the dragging column by applying a 'display: none' style to it.
|
|
1755
|
+
* This method is protected and can only be accessed within the class.
|
|
1756
|
+
*
|
|
1757
|
+
* @return {void}
|
|
1758
|
+
*/
|
|
1759
|
+
hideDraggingColumn() {
|
|
1760
|
+
this.dom.applyStyle(this.draggingColumn, {
|
|
1761
|
+
display: "none"
|
|
1762
|
+
});
|
|
1763
|
+
}
|
|
1764
|
+
/**
|
|
1765
|
+
* Renders a draggable target div element.
|
|
1766
|
+
*
|
|
1767
|
+
* @param {HTMLDivElement} parent - The parent element where the target div will be appended to.
|
|
1768
|
+
* @param {number} left - The left position of the target div in pixels.
|
|
1769
|
+
* @param {number} top - The top position of the target div in pixels.
|
|
1770
|
+
* @param {number} width - The width of the target div in pixels.
|
|
1771
|
+
* @param {number} height - The height of the target div in pixels.
|
|
1772
|
+
* @return {HTMLDivElement} - The rendered draggable target div element.
|
|
1773
|
+
*/
|
|
1774
|
+
renderDragTargetDiv(e, t, o, s, i) {
|
|
1380
1775
|
const r = this.dom.applyStylePosistionAbsolute(
|
|
1381
1776
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1382
1777
|
);
|
|
1383
|
-
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${
|
|
1384
|
-
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1778
|
+
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${o}px`), this.dom.setStyle(r, "width", `${s}px`), this.dom.setStyle(r, "height", `${i}px`), r;
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Render selected background div.
|
|
1782
|
+
*
|
|
1783
|
+
* @private
|
|
1784
|
+
* @param {boolean} skip - Whether to skip rendering.
|
|
1785
|
+
* @param {boolean} renderSelection - Whether to render the selection.
|
|
1786
|
+
* @param {SideIdent} sideIdent - The side identifier.
|
|
1787
|
+
* @param {AreaModelIf} areaModel - The area model.
|
|
1788
|
+
* @param {number} rowIndex - The row index.
|
|
1789
|
+
* @param {number} index - The index.
|
|
1790
|
+
* @param {HTMLDivElement} parent - The parent div element.
|
|
1791
|
+
* @param {number} left - The left position.
|
|
1792
|
+
* @param {number} top - The top position.
|
|
1793
|
+
* @param {number} width - The width of the div.
|
|
1794
|
+
* @param {number} height - The height of the div.
|
|
1795
|
+
* @returns {boolean} - Whether the cell is selected.
|
|
1796
|
+
*/
|
|
1797
|
+
renderSelectedBackgroundDiv(e, t, o, s, i, r, a, l, n, d, c) {
|
|
1798
|
+
let h = !1;
|
|
1799
|
+
if (!e && t && s.isSelectable(i, r) && this.getSelectionModel) {
|
|
1800
|
+
const f = this.getSelectionModel();
|
|
1801
|
+
if (f) {
|
|
1802
|
+
const u = f.getSelectionCount(i, r);
|
|
1803
|
+
h = u > 0;
|
|
1804
|
+
for (let S = 0; S < u; S++) {
|
|
1805
|
+
const b = this.dom.applyStylePosistionAbsolute(
|
|
1394
1806
|
// ge-table-body-west-selected-range
|
|
1395
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
1807
|
+
this.dom.createDivWithClass(`ge-table-${s.areaIdent}-${o}-selected-range`, a)
|
|
1396
1808
|
);
|
|
1397
|
-
this.dom.setStyle(
|
|
1809
|
+
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", `${c}px`);
|
|
1398
1810
|
}
|
|
1399
1811
|
}
|
|
1400
1812
|
}
|
|
1401
|
-
return
|
|
1813
|
+
return h;
|
|
1402
1814
|
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Renders a cell in the grid.
|
|
1817
|
+
*
|
|
1818
|
+
* @param {ArgsRenderCell} args - The arguments for rendering the cell.
|
|
1819
|
+
* @param {AreaModel} args.areaModel - The area model of the grid.
|
|
1820
|
+
* @param {string} args.areaIdent - The identifier of the area.
|
|
1821
|
+
* @param {string} args.sideIdent - The identifier of the side.
|
|
1822
|
+
* @param {number} args.rowIndex - The index of the row.
|
|
1823
|
+
* @param {number} args.columnIndex - The index of the column.
|
|
1824
|
+
* @param {number} args.left - The left position of the cell.
|
|
1825
|
+
* @param {number} args.top - The top position of the cell.
|
|
1826
|
+
* @param {number} args.width - The width of the cell.
|
|
1827
|
+
* @param {number} args.height - The height of the cell.
|
|
1828
|
+
* @param {HTMLElement} args.parent - The parent element of the cell.
|
|
1829
|
+
* @param {boolean} args.cellSelected - Indicates if the cell is selected.
|
|
1830
|
+
* @param {boolean} args.lastRowOfModel - Indicates if the cell is in the last row of the model.
|
|
1831
|
+
*
|
|
1832
|
+
* @returns {void}
|
|
1833
|
+
*/
|
|
1403
1834
|
renderCell({
|
|
1404
1835
|
areaModel: e,
|
|
1405
1836
|
areaIdent: t,
|
|
1406
|
-
sideIdent:
|
|
1407
|
-
rowIndex:
|
|
1408
|
-
columnIndex:
|
|
1837
|
+
sideIdent: o,
|
|
1838
|
+
rowIndex: s,
|
|
1839
|
+
columnIndex: i,
|
|
1409
1840
|
left: r,
|
|
1410
|
-
top:
|
|
1841
|
+
top: a,
|
|
1411
1842
|
width: l,
|
|
1412
|
-
height:
|
|
1843
|
+
height: n,
|
|
1413
1844
|
parent: d,
|
|
1414
|
-
cellSelected:
|
|
1415
|
-
lastRowOfModel:
|
|
1416
|
-
gammaRange: m
|
|
1845
|
+
cellSelected: c,
|
|
1846
|
+
lastRowOfModel: h
|
|
1417
1847
|
}) {
|
|
1418
|
-
const [
|
|
1848
|
+
const [f, u] = this.addAndRenderCellDiv({
|
|
1419
1849
|
areaModel: e,
|
|
1420
1850
|
areaIdent: t,
|
|
1421
|
-
sideIdent:
|
|
1422
|
-
rowIndex:
|
|
1423
|
-
index:
|
|
1851
|
+
sideIdent: o,
|
|
1852
|
+
rowIndex: s,
|
|
1853
|
+
index: i,
|
|
1424
1854
|
left: r,
|
|
1425
1855
|
width: l,
|
|
1426
|
-
height:
|
|
1427
|
-
top:
|
|
1856
|
+
height: n,
|
|
1857
|
+
top: a,
|
|
1428
1858
|
parent: d,
|
|
1429
|
-
lastRowOfModel:
|
|
1430
|
-
gammaRange: m
|
|
1859
|
+
lastRowOfModel: h
|
|
1431
1860
|
});
|
|
1432
|
-
|
|
1861
|
+
c && this.dom.addClass(`ge-table-${t}-${o}-selected-range`, f), u && this.cleanupFunctions[t].push(u);
|
|
1433
1862
|
}
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1863
|
+
/**
|
|
1864
|
+
* Render the header cell resize handle.
|
|
1865
|
+
*
|
|
1866
|
+
* @param {ArgsRenderHeaderCellResizeHandle} args - The arguments for rendering the handle.
|
|
1867
|
+
* @param {number} args.rowIndex - The index of the row.
|
|
1868
|
+
* @param {number} args.columnIndex - The index of the column.
|
|
1869
|
+
* @param {number} args.cellLeft - The left position of the cell.
|
|
1870
|
+
* @param {number} args.cellTop - The top position of the cell.
|
|
1871
|
+
* @param {number} args.cellWidth - The width of the cell.
|
|
1872
|
+
* @param {number} args.cellHeight - The height of the cell.
|
|
1873
|
+
* @param {HTMLElement} args.parent - The parent element to append the handle to.
|
|
1874
|
+
*
|
|
1875
|
+
* @return {void}
|
|
1876
|
+
*/
|
|
1877
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: o, cellTop: s, cellWidth: i, cellHeight: r, parent: a }) {
|
|
1878
|
+
const l = this.dom.domService, n = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = l.createElement("div");
|
|
1879
|
+
l.setAttribute(d, "data-col-index", `${t}`), l.setAttribute(d, "data-row-index", `${e}`), l.setAttribute(d, "data-area", "header"), l.setAttribute(d, "data-ge-action", "resize-column"), l.addClass(d, "ge-table-column-resize-handle"), l.setStyle(d, "display", "clip"), l.setStyle(d, "position", "absolute"), l.setStyle(d, "cursor", "col-resize"), l.setStyle(d, "left", `${o + i - n}px`), l.setStyle(d, "top", `${s}px`), l.setStyle(d, "width", `${n}px`), l.setStyle(d, "height", `${r}px`), l.appendChild(a, d);
|
|
1437
1880
|
}
|
|
1438
1881
|
}
|
|
1439
|
-
class
|
|
1882
|
+
class me {
|
|
1440
1883
|
constructor(e, t) {
|
|
1441
1884
|
this.columnIndex = e, this.sortState = t;
|
|
1442
1885
|
}
|
|
1443
1886
|
}
|
|
1444
|
-
class
|
|
1887
|
+
class ye {
|
|
1445
1888
|
constructor(e) {
|
|
1446
1889
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1447
1890
|
}
|
|
@@ -1455,52 +1898,52 @@ class ue {
|
|
|
1455
1898
|
*/
|
|
1456
1899
|
onHostElementChanged(e) {
|
|
1457
1900
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1458
|
-
const t = e.target,
|
|
1459
|
-
if (
|
|
1460
|
-
const r =
|
|
1461
|
-
this.tableScope.updateModelValueAfterEdit(r,
|
|
1901
|
+
const t = e.target, o = t.getAttribute("data-area"), s = t.getAttribute("data-row-index"), i = t.getAttribute("data-col-index");
|
|
1902
|
+
if (o && s && i) {
|
|
1903
|
+
const r = V(o), a = Number(s), l = Number(i);
|
|
1904
|
+
this.tableScope.updateModelValueAfterEdit(r, a, l, t.value);
|
|
1462
1905
|
}
|
|
1463
1906
|
}
|
|
1464
1907
|
}
|
|
1465
1908
|
}
|
|
1466
|
-
class
|
|
1909
|
+
class ve {
|
|
1467
1910
|
constructor(e = -1, t = -1) {
|
|
1468
1911
|
this.rowIndex = e, this.columnIndex = t;
|
|
1469
1912
|
}
|
|
1470
1913
|
}
|
|
1471
|
-
class
|
|
1914
|
+
class N {
|
|
1472
1915
|
constructor(e) {
|
|
1473
1916
|
this.cells = e;
|
|
1474
1917
|
}
|
|
1475
1918
|
static createSingle(e, t) {
|
|
1476
|
-
return new
|
|
1919
|
+
return new N([new ve(e, t)]);
|
|
1477
1920
|
}
|
|
1478
1921
|
}
|
|
1479
|
-
class
|
|
1922
|
+
class we {
|
|
1480
1923
|
constructor(e) {
|
|
1481
|
-
var t,
|
|
1482
|
-
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (
|
|
1924
|
+
var t, o;
|
|
1925
|
+
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (o = this.tableScope.tableOptions) != null && o.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
|
|
1483
1926
|
}
|
|
1484
1927
|
onMouseClicked(e, t) {
|
|
1485
|
-
var
|
|
1486
|
-
let
|
|
1928
|
+
var i, r, a, l, n, d, c;
|
|
1929
|
+
let o = !1, s = !1;
|
|
1487
1930
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1488
|
-
const
|
|
1489
|
-
|
|
1931
|
+
const h = this.getSelectionModel(), f = this.getFocusModel();
|
|
1932
|
+
h && f && (f.hasFocus(e.rowIndex, e.columnIndex) || (f.setFocus(e.rowIndex, e.columnIndex), this.tableScope.onFocusChanged(f), o = !0), (i = e.originalEvent) != null && i.shiftKey || h.hasSelection() && (h.clear(), o = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (h.addSelection(this.createRangeByEvents(e, this.previousEvt)), s = !0, o = !0) : (a = e.originalEvent) != null && a.altKey && ((l = e.originalEvent) != null && l.ctrlKey || (n = e.originalEvent) != null && n.metaKey) ? (h.removeSelection(E.singleCell(e.rowIndex, e.columnIndex)), s = !0, o = !0) : (d = e.originalEvent) != null && d.ctrlKey || (c = e.originalEvent) != null && c.metaKey ? (h.addSelection(E.singleCell(e.rowIndex, e.columnIndex)), s = !0, o = !0) : (h.firstClick(e.rowIndex, e.columnIndex), o = !0), this.tableScope.onSelectionChanged(h));
|
|
1490
1933
|
}
|
|
1491
|
-
return
|
|
1934
|
+
return s ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), o;
|
|
1492
1935
|
}
|
|
1493
1936
|
onActionTriggered(e) {
|
|
1494
1937
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1495
|
-
const t = this.getSelectionModel(),
|
|
1496
|
-
if (t &&
|
|
1938
|
+
const t = this.getSelectionModel(), o = this.getFocusModel();
|
|
1939
|
+
if (t && o) {
|
|
1497
1940
|
if (e === "SELECT_ALL")
|
|
1498
1941
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1499
1942
|
if (e === "DESELECT_ALL")
|
|
1500
1943
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
1501
1944
|
if (e === "TOGGLE_SELECTION") {
|
|
1502
|
-
const [
|
|
1503
|
-
return t.togglePoint(
|
|
1945
|
+
const [s, i] = o.getFocus();
|
|
1946
|
+
return t.togglePoint(s, i), this.tableScope.repaint(), !0;
|
|
1504
1947
|
}
|
|
1505
1948
|
}
|
|
1506
1949
|
}
|
|
@@ -1508,16 +1951,16 @@ class ge {
|
|
|
1508
1951
|
}
|
|
1509
1952
|
createRangeByEvents(e, t) {
|
|
1510
1953
|
t || (t = e);
|
|
1511
|
-
const
|
|
1512
|
-
return
|
|
1513
|
-
rowIndex1:
|
|
1514
|
-
columnIndex1:
|
|
1515
|
-
rowIndex2:
|
|
1954
|
+
const o = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), s = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
1955
|
+
return E.create({
|
|
1956
|
+
rowIndex1: o,
|
|
1957
|
+
columnIndex1: i,
|
|
1958
|
+
rowIndex2: s,
|
|
1516
1959
|
columnIndex2: r
|
|
1517
1960
|
});
|
|
1518
1961
|
}
|
|
1519
1962
|
}
|
|
1520
|
-
class
|
|
1963
|
+
class Ce {
|
|
1521
1964
|
get() {
|
|
1522
1965
|
return {
|
|
1523
1966
|
f2: "START_EDITING",
|
|
@@ -1527,43 +1970,60 @@ class me {
|
|
|
1527
1970
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
1528
1971
|
"ctrl+x": "DESELECT_ALL",
|
|
1529
1972
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
1530
|
-
"
|
|
1973
|
+
"meta -": "DESELECT_ALL",
|
|
1531
1974
|
arrowup: "NAVIGATE_UP",
|
|
1532
1975
|
arrowdown: "NAVIGATE_DOWN",
|
|
1533
1976
|
arrowleft: "NAVIGATE_LEFT",
|
|
1534
|
-
arrowright: "NAVIGATE_RIGHT"
|
|
1977
|
+
arrowright: "NAVIGATE_RIGHT",
|
|
1978
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
1979
|
+
"ctrl+c": "COPY_2_CLIPBOARD"
|
|
1535
1980
|
};
|
|
1536
1981
|
}
|
|
1537
1982
|
}
|
|
1538
|
-
class
|
|
1983
|
+
class xe {
|
|
1539
1984
|
get() {
|
|
1540
1985
|
return {
|
|
1541
1986
|
f2: "START_EDITING",
|
|
1542
1987
|
space: "TOGGLE_SELECTION",
|
|
1543
1988
|
"ctrl+num_add": "SELECT_ALL",
|
|
1544
|
-
"
|
|
1989
|
+
"meta+a": "SELECT_ALL",
|
|
1545
1990
|
"ctrl+a": "SELECT_ALL",
|
|
1546
|
-
"
|
|
1547
|
-
"
|
|
1991
|
+
"meta+x": "DESELECT_ALL",
|
|
1992
|
+
"meta+shift+a": "DESELECT_ALL",
|
|
1548
1993
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
1549
1994
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
1550
1995
|
"ctrl -": "DESELECT_ALL",
|
|
1551
1996
|
arrowup: "NAVIGATE_UP",
|
|
1552
1997
|
arrowdown: "NAVIGATE_DOWN",
|
|
1553
1998
|
arrowleft: "NAVIGATE_LEFT",
|
|
1554
|
-
arrowright: "NAVIGATE_RIGHT"
|
|
1999
|
+
arrowright: "NAVIGATE_RIGHT",
|
|
2000
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
2001
|
+
"ctrl+c": "COPY_2_CLIPBOARD"
|
|
1555
2002
|
};
|
|
1556
2003
|
}
|
|
1557
2004
|
}
|
|
1558
|
-
class
|
|
2005
|
+
class Ee {
|
|
1559
2006
|
constructor(e) {
|
|
1560
2007
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1561
2008
|
}
|
|
2009
|
+
/**
|
|
2010
|
+
* Adds a listener to the list of listeners.
|
|
2011
|
+
*
|
|
2012
|
+
* @param {OnActionTriggeredIf} listener - The listener to be added.
|
|
2013
|
+
* @returns {void}
|
|
2014
|
+
*/
|
|
1562
2015
|
addListener(e) {
|
|
1563
2016
|
this.listener.includes(e) || this.listener.push(e);
|
|
1564
2017
|
}
|
|
2018
|
+
/**
|
|
2019
|
+
* Initializes the ShortcutService by assigning shortcut action id mappings based on the current operating system.
|
|
2020
|
+
* Also adds key down event listener to the table host element.
|
|
2021
|
+
*/
|
|
1565
2022
|
init() {
|
|
1566
|
-
this.
|
|
2023
|
+
this.assignPredefinedSystemShortcutMappings(), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
2024
|
+
}
|
|
2025
|
+
assignPredefinedSystemShortcutMappings() {
|
|
2026
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new xe().get()) : Object.assign(this.shortcutActionIdMapping, new Ce().get());
|
|
1567
2027
|
}
|
|
1568
2028
|
isMacintosh() {
|
|
1569
2029
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1575,30 +2035,30 @@ class be {
|
|
|
1575
2035
|
return location.hostname === "localhost" || location.hostname === "127.0.0.1";
|
|
1576
2036
|
}
|
|
1577
2037
|
onKeyDown(e) {
|
|
1578
|
-
const t = this.
|
|
2038
|
+
const t = this.findEntity(e);
|
|
1579
2039
|
t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
|
|
1580
2040
|
}
|
|
1581
2041
|
emit(e) {
|
|
1582
|
-
this.isDebug() && console.debug("ShortcutService emit:", e);
|
|
2042
|
+
this.isDebug() && console.debug("ShortcutService emit :", e);
|
|
1583
2043
|
let t = !1;
|
|
1584
|
-
for (const
|
|
1585
|
-
|
|
2044
|
+
for (const o of this.listener)
|
|
2045
|
+
o.onActionTriggered(e) && (t = !0);
|
|
1586
2046
|
return t;
|
|
1587
2047
|
}
|
|
1588
|
-
|
|
2048
|
+
findEntity(e) {
|
|
1589
2049
|
const t = this.getTokenByEvent(e);
|
|
1590
|
-
this.isDebug() && console.debug("ShortcutService tokens:", t);
|
|
1591
|
-
for (const
|
|
1592
|
-
const
|
|
1593
|
-
if (this.areTokensEquals(t,
|
|
1594
|
-
return this.shortcutActionIdMapping[
|
|
2050
|
+
this.isDebug() && console.debug("ShortcutService tokens :", t);
|
|
2051
|
+
for (const o in this.shortcutActionIdMapping) {
|
|
2052
|
+
const s = o.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[+ ]/g).sort();
|
|
2053
|
+
if (this.areTokensEquals(t, s))
|
|
2054
|
+
return this.shortcutActionIdMapping[o];
|
|
1595
2055
|
}
|
|
1596
2056
|
}
|
|
1597
2057
|
areTokensEquals(e, t) {
|
|
1598
2058
|
if (e.length !== t.length || e.length === 0)
|
|
1599
2059
|
return !1;
|
|
1600
|
-
for (let
|
|
1601
|
-
if (e[
|
|
2060
|
+
for (let o = 0; o < e.length; o++)
|
|
2061
|
+
if (e[o] !== t[o])
|
|
1602
2062
|
return !1;
|
|
1603
2063
|
return !0;
|
|
1604
2064
|
}
|
|
@@ -1606,8 +2066,16 @@ class be {
|
|
|
1606
2066
|
const t = [];
|
|
1607
2067
|
return e.altKey && t.push("alt"), e.shiftKey && t.push("shift"), e.ctrlKey && t.push("ctrl"), e.metaKey && t.push("meta"), e.code && t.push(e.code.toLowerCase().replace(/key/g, "")), t.sort();
|
|
1608
2068
|
}
|
|
2069
|
+
/**
|
|
2070
|
+
* Retrieves the shortcut action mapping object.
|
|
2071
|
+
*
|
|
2072
|
+
* @returns {ShortcutActionIdMapping} - The shortcut action mapping object.
|
|
2073
|
+
*/
|
|
2074
|
+
getShortcutActionMapping() {
|
|
2075
|
+
return this.shortcutActionIdMapping;
|
|
2076
|
+
}
|
|
1609
2077
|
}
|
|
1610
|
-
class
|
|
2078
|
+
class K {
|
|
1611
2079
|
onCheckboxChanged(e) {
|
|
1612
2080
|
}
|
|
1613
2081
|
onContextmenu(e) {
|
|
@@ -1622,20 +2090,24 @@ class j {
|
|
|
1622
2090
|
}
|
|
1623
2091
|
onMouseMoved(e) {
|
|
1624
2092
|
}
|
|
2093
|
+
onSelectionChanged(e) {
|
|
2094
|
+
}
|
|
2095
|
+
onFocusChanged(e) {
|
|
2096
|
+
}
|
|
1625
2097
|
}
|
|
1626
|
-
class
|
|
1627
|
-
setStyle(e, t,
|
|
1628
|
-
return e.style[t] =
|
|
2098
|
+
class Z {
|
|
2099
|
+
setStyle(e, t, o) {
|
|
2100
|
+
return e.style[t] = o, e;
|
|
1629
2101
|
}
|
|
1630
2102
|
appendText(e, t) {
|
|
1631
|
-
const
|
|
1632
|
-
return this.appendChild(e,
|
|
2103
|
+
const o = this.createText(t);
|
|
2104
|
+
return this.appendChild(e, o), o;
|
|
1633
2105
|
}
|
|
1634
2106
|
addClass(e, t) {
|
|
1635
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2107
|
+
return t.includes(" ") ? t.split(" ").forEach((o) => e.classList.add(o)) : e.classList.add(t), e;
|
|
1636
2108
|
}
|
|
1637
2109
|
removeClass(e, t) {
|
|
1638
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2110
|
+
return t.includes(" ") ? t.split(" ").forEach((o) => e.classList.remove(o)) : e.classList.remove(t), e;
|
|
1639
2111
|
}
|
|
1640
2112
|
appendChild(e, t) {
|
|
1641
2113
|
e.appendChild(t);
|
|
@@ -1646,15 +2118,15 @@ class Y {
|
|
|
1646
2118
|
createText(e) {
|
|
1647
2119
|
return document.createTextNode(e);
|
|
1648
2120
|
}
|
|
1649
|
-
setAttribute(e, t,
|
|
1650
|
-
e.setAttribute(t,
|
|
2121
|
+
setAttribute(e, t, o) {
|
|
2122
|
+
e.setAttribute(t, o);
|
|
1651
2123
|
}
|
|
1652
2124
|
}
|
|
1653
|
-
class
|
|
1654
|
-
render(e, t, s, i,
|
|
1655
|
-
if (
|
|
1656
|
-
|
|
1657
|
-
const l =
|
|
2125
|
+
class Ae {
|
|
2126
|
+
render(e, t, o, s, i, r, a) {
|
|
2127
|
+
if (i.isEditable(t, o)) {
|
|
2128
|
+
a.addClass(e, "ge-table-row-input-div");
|
|
2129
|
+
const l = i.getValueAt(t, o);
|
|
1658
2130
|
e.innerHTML = `
|
|
1659
2131
|
<input
|
|
1660
2132
|
type="text"
|
|
@@ -1662,28 +2134,31 @@ class ye {
|
|
|
1662
2134
|
autofocus
|
|
1663
2135
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1664
2136
|
data-listen="change"
|
|
1665
|
-
data-area="${
|
|
2137
|
+
data-area="${s}"
|
|
1666
2138
|
data-row-index="${t}"
|
|
1667
|
-
data-col-index="${
|
|
2139
|
+
data-col-index="${o}"
|
|
1668
2140
|
data-input-type="text"
|
|
1669
2141
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1670
2142
|
class="ge-table-cell-editor-input">`;
|
|
1671
2143
|
}
|
|
1672
2144
|
}
|
|
1673
2145
|
}
|
|
1674
|
-
class
|
|
2146
|
+
class Me {
|
|
1675
2147
|
constructor(e = "none", t = "single") {
|
|
1676
2148
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1677
2149
|
}
|
|
2150
|
+
firstClick(e, t) {
|
|
2151
|
+
this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
|
|
2152
|
+
}
|
|
1678
2153
|
getSelectionCount(e, t) {
|
|
1679
|
-
let
|
|
1680
|
-
for (const
|
|
1681
|
-
|
|
1682
|
-
return this.allSelected &&
|
|
2154
|
+
let o = 0;
|
|
2155
|
+
for (const s of this.ranges)
|
|
2156
|
+
s.isInRange(e, t) && o++;
|
|
2157
|
+
return this.allSelected && o++, this.isInNegativeRange(e, t) && (o = 0), o;
|
|
1683
2158
|
}
|
|
1684
2159
|
isInNegativeRange(e, t) {
|
|
1685
|
-
for (const
|
|
1686
|
-
if (
|
|
2160
|
+
for (const o of this.negativeRanges)
|
|
2161
|
+
if (o.isInRange(e, t))
|
|
1687
2162
|
return !0;
|
|
1688
2163
|
return !1;
|
|
1689
2164
|
}
|
|
@@ -1694,11 +2169,29 @@ class ve {
|
|
|
1694
2169
|
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1695
2170
|
}
|
|
1696
2171
|
hasSelection() {
|
|
1697
|
-
return !!this.ranges.length;
|
|
2172
|
+
return this.allSelected || !!this.ranges.length;
|
|
2173
|
+
}
|
|
2174
|
+
hasNoSelection() {
|
|
2175
|
+
return !this.hasSelection();
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2178
|
+
* Retrieves the merged row indices from the given range selection.
|
|
2179
|
+
*
|
|
2180
|
+
* @returns {number[]} Array of merged row indices
|
|
2181
|
+
*/
|
|
2182
|
+
getMergedRowIndices() {
|
|
2183
|
+
const e = /* @__PURE__ */ new Set();
|
|
2184
|
+
for (const t of this.ranges)
|
|
2185
|
+
for (let o = t.r1; o <= t.r2; o++)
|
|
2186
|
+
!e.has(o) && !this.isInNegativeRange(o, 0) && e.add(o);
|
|
2187
|
+
return Array.from(e);
|
|
1698
2188
|
}
|
|
1699
2189
|
selectAll() {
|
|
1700
2190
|
this.allSelected = !0;
|
|
1701
2191
|
}
|
|
2192
|
+
isAllSelected() {
|
|
2193
|
+
return this.allSelected;
|
|
2194
|
+
}
|
|
1702
2195
|
addSelection(e) {
|
|
1703
2196
|
this.addRange(e);
|
|
1704
2197
|
}
|
|
@@ -1706,16 +2199,19 @@ class ve {
|
|
|
1706
2199
|
if (this.selectionType === "none")
|
|
1707
2200
|
return;
|
|
1708
2201
|
let t = e;
|
|
1709
|
-
this.selectionType === "row" ? t =
|
|
2202
|
+
this.selectionType === "row" ? t = E.singleRow(e.r1) : this.selectionType === "column" && (t = E.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1710
2203
|
}
|
|
1711
2204
|
togglePoint(e, t) {
|
|
1712
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(
|
|
2205
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(E.singleCell(e, t)) : this.addSelection(E.singleCell(e, t));
|
|
2206
|
+
}
|
|
2207
|
+
isSelected(e, t) {
|
|
2208
|
+
return this.getSelectionCount(e, t) > 0;
|
|
1713
2209
|
}
|
|
1714
2210
|
addRange(e) {
|
|
1715
2211
|
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));
|
|
1716
2212
|
}
|
|
1717
2213
|
}
|
|
1718
|
-
class
|
|
2214
|
+
class Re {
|
|
1719
2215
|
constructor(e = "none") {
|
|
1720
2216
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1721
2217
|
}
|
|
@@ -1738,29 +2234,128 @@ class Ce {
|
|
|
1738
2234
|
return [this.rowIndex, this.columnIndex];
|
|
1739
2235
|
}
|
|
1740
2236
|
}
|
|
1741
|
-
|
|
1742
|
-
|
|
2237
|
+
class ee {
|
|
2238
|
+
constructor(e = new D(
|
|
2239
|
+
"❯",
|
|
2240
|
+
"",
|
|
2241
|
+
["gt-table-icon-expanded"]
|
|
2242
|
+
), t = new D(
|
|
2243
|
+
"❯",
|
|
2244
|
+
"transform: rotate(180deg) translate(-100%, -100%); transform-origin: 0 0;",
|
|
2245
|
+
["ge-table-icon-collapsed"]
|
|
2246
|
+
)) {
|
|
2247
|
+
this.iconExpanded = e, this.iconCollapsed = t;
|
|
2248
|
+
}
|
|
2249
|
+
// `⊖ `, `⊕ `;
|
|
2250
|
+
}
|
|
2251
|
+
const Te = new Me(), De = new Re("cell");
|
|
2252
|
+
class te {
|
|
1743
2253
|
constructor() {
|
|
1744
2254
|
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 = {
|
|
1745
2255
|
header: 34,
|
|
1746
2256
|
body: 34,
|
|
1747
2257
|
footer: 34
|
|
1748
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new
|
|
2258
|
+
}, 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 Ae(), this.getSelectionModel = () => Te, this.getFocusModel = () => De;
|
|
1749
2259
|
}
|
|
1750
2260
|
}
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
2261
|
+
const I = class I {
|
|
2262
|
+
/**
|
|
2263
|
+
* Returns the content to be copied based on the provided table model, selection model, and focus model.
|
|
2264
|
+
*
|
|
2265
|
+
* @param {TableModelIf} tableModel - The table model for data retrieval.
|
|
2266
|
+
* @param {SelectionModelIf} selectionModel - The selection model to determine the selected range.
|
|
2267
|
+
* @param {FocusModelIf} focusModel - The focus model to determine the focused cell.
|
|
2268
|
+
* @return {Promise<string>} A promise that resolves to the copied content as a string.
|
|
2269
|
+
* @throws {string} Throws an error if neither selection nor focus is defined.
|
|
2270
|
+
*/
|
|
2271
|
+
createContent(e, t, o) {
|
|
2272
|
+
return new Promise((s, i) => {
|
|
2273
|
+
if (t != null && t.hasSelection()) {
|
|
2274
|
+
const r = this.mergeRanges(t.getRanges());
|
|
2275
|
+
if (r) {
|
|
2276
|
+
r.c2 = Math.min(r.c2, e.getColumnCount() - 1), r.r2 = Math.min(r.r2, e.getBodyModel().getRowCount() - 1);
|
|
2277
|
+
const a = [];
|
|
2278
|
+
for (let l = r.r1; l <= r.r2; l++) {
|
|
2279
|
+
const n = [];
|
|
2280
|
+
for (let d = r.c1; d <= r.c2; d++) {
|
|
2281
|
+
const c = t.isSelected(l, d) ? e.getBodyModel().getTextValueAt(l, d) : "";
|
|
2282
|
+
n.push(c);
|
|
2283
|
+
}
|
|
2284
|
+
a.push(n.join(I.columnSeparatorChar));
|
|
2285
|
+
}
|
|
2286
|
+
return s(a.join(I.rowSeparatorChar));
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
if (o) {
|
|
2290
|
+
const [r, a] = o.getFocus(), l = e.getBodyModel().getTextValueAt(r, a);
|
|
2291
|
+
return s(l);
|
|
2292
|
+
}
|
|
2293
|
+
i("Cannot copy, neither selection nor focus defined.");
|
|
2294
|
+
});
|
|
2295
|
+
}
|
|
2296
|
+
/**
|
|
2297
|
+
* Copy the provided content to the clipboard.
|
|
2298
|
+
*
|
|
2299
|
+
* @param {string} content - The content to be copied.
|
|
2300
|
+
* @return {Promise<void>} A promise that resolves when the content has been successfully copied to the clipboard.
|
|
2301
|
+
*/
|
|
2302
|
+
copyContent(e) {
|
|
2303
|
+
return navigator.clipboard.writeText(e);
|
|
2304
|
+
}
|
|
2305
|
+
/**
|
|
2306
|
+
* Asynchronously copies the content of a table to the clipboard.
|
|
2307
|
+
*
|
|
2308
|
+
* @param {TableModelIf} tableModel - The table model to copy from.
|
|
2309
|
+
* @param {SelectionModelIf} selectionModel - The selection model of the table.
|
|
2310
|
+
* @param {FocusModelIf} focusModel - The focus model of the table.
|
|
2311
|
+
* @returns {Promise<string>} A promise that resolves with the copied text if successful, or rejects if an error occurs.
|
|
2312
|
+
*/
|
|
2313
|
+
copyToClipboard(e, t, o) {
|
|
2314
|
+
return new Promise((s, i) => {
|
|
2315
|
+
this.createContent(
|
|
2316
|
+
e,
|
|
2317
|
+
t,
|
|
2318
|
+
o
|
|
2319
|
+
).then((r) => {
|
|
2320
|
+
r && this.copyContent(r).then((a) => {
|
|
2321
|
+
s(r);
|
|
2322
|
+
}).catch((a) => {
|
|
2323
|
+
i();
|
|
2324
|
+
});
|
|
2325
|
+
}).catch((r) => {
|
|
2326
|
+
i();
|
|
2327
|
+
});
|
|
2328
|
+
});
|
|
2329
|
+
}
|
|
2330
|
+
/**
|
|
2331
|
+
* Merges an array of CellRanges into a single merged CellRange.
|
|
2332
|
+
*
|
|
2333
|
+
* @param {CellRange[]} ranges - The array of CellRanges to be merged.
|
|
2334
|
+
* @return {CellRange | undefined} - The merged CellRange, or undefined if the ranges array is empty.
|
|
2335
|
+
*/
|
|
2336
|
+
mergeRanges(e) {
|
|
2337
|
+
let t;
|
|
2338
|
+
for (const o of e)
|
|
2339
|
+
t ? (t.r1 = Math.min(t.r1, o.r1), t.c1 = Math.min(t.c1, o.c1), t.r2 = Math.max(t.r2, o.r2), t.c2 = Math.max(t.c2, o.c2)) : t = new E(o.r1, o.c1, o.r2, o.c2);
|
|
2340
|
+
return t;
|
|
2341
|
+
}
|
|
2342
|
+
};
|
|
2343
|
+
I.columnSeparatorChar = " ", I.rowSeparatorChar = `
|
|
2344
|
+
`;
|
|
2345
|
+
let L = I;
|
|
2346
|
+
class j extends fe {
|
|
2347
|
+
constructor(e, t, o, s, i, r = new L()) {
|
|
2348
|
+
var a;
|
|
1754
2349
|
if (super(
|
|
1755
2350
|
e,
|
|
1756
2351
|
t,
|
|
1757
|
-
new
|
|
1758
|
-
|
|
1759
|
-
), this.eventListener =
|
|
1760
|
-
const
|
|
1761
|
-
|
|
2352
|
+
new le(o),
|
|
2353
|
+
s
|
|
2354
|
+
), this.eventListener = i, this.copyService = r, this.licenseManager = k.getInstance(), this.selectionService = new we(this), this.api = new de(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()), (a = this.tableOptions) != null && a.autoRestoreOptions) {
|
|
2355
|
+
const l = this.tableOptions.autoRestoreOptions, n = l.getStorageKeyFn;
|
|
2356
|
+
n && (l.autoRestoreScrollPosition && (this.storeScrollPosStateService = new ce(n)), l.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new ge(n)), l.autoRestoreSortingState && (this.storeSortingService = new pe(n)));
|
|
1762
2357
|
}
|
|
1763
|
-
this.mouseHandler = new
|
|
2358
|
+
this.mouseHandler = new ne(this), this.inputHandler = new ye(this), this.shortcutService = new Ee(this), this.shortcutService.addListener(this.selectionService);
|
|
1764
2359
|
}
|
|
1765
2360
|
/**
|
|
1766
2361
|
* Creates a TableScope instance.
|
|
@@ -1770,33 +2365,47 @@ class k extends ce {
|
|
|
1770
2365
|
* @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
|
|
1771
2366
|
* @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
|
|
1772
2367
|
* @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
|
|
2368
|
+
* @param {CopyServiceIf} [copyService=new CopyService()] - The optional copy service object.
|
|
1773
2369
|
*
|
|
1774
2370
|
* @return {TableScope} - The newly created TableScope instance.
|
|
1775
2371
|
*/
|
|
1776
|
-
static create(e, t, s = new
|
|
1777
|
-
return new
|
|
2372
|
+
static create(e, t, o = new te(), s = new K(), i = new Z(), r = new L()) {
|
|
2373
|
+
return new j(
|
|
1778
2374
|
e,
|
|
1779
2375
|
t,
|
|
2376
|
+
i,
|
|
1780
2377
|
o,
|
|
1781
2378
|
s,
|
|
1782
|
-
|
|
2379
|
+
r
|
|
1783
2380
|
);
|
|
1784
2381
|
}
|
|
2382
|
+
/**
|
|
2383
|
+
* Triggers an action based on the provided actionId.
|
|
2384
|
+
*
|
|
2385
|
+
* This function can be invoked manually via the table API or by keyboard shortcuts.
|
|
2386
|
+
*
|
|
2387
|
+
* @param {ActionId} actionId - The identifier of the action to be triggered.
|
|
2388
|
+
* @return {boolean} - Returns true if the action was triggered successfully, false otherwise.
|
|
2389
|
+
*/
|
|
1785
2390
|
onActionTriggered(e) {
|
|
1786
2391
|
if (e === "NAVIGATE_DOWN" && this.changeFocusCell(0, 1) || e === "NAVIGATE_UP" && this.changeFocusCell(0, -1) || e === "NAVIGATE_LEFT" && this.changeFocusCell(-1, 0) || e === "NAVIGATE_RIGHT" && this.changeFocusCell(1, 0))
|
|
1787
2392
|
return !0;
|
|
1788
2393
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
1789
2394
|
const t = this.getFocusModel();
|
|
1790
2395
|
if (t) {
|
|
1791
|
-
const [
|
|
1792
|
-
this.tableModel.getBodyModel().isEditable(
|
|
2396
|
+
const [o, s] = t.getFocus();
|
|
2397
|
+
this.tableModel.getBodyModel().isEditable(o, s) && (this.clearSelection(), this.initRenderEditor(o, s));
|
|
1793
2398
|
}
|
|
1794
2399
|
return !0;
|
|
1795
2400
|
}
|
|
2401
|
+
if (e === "COPY_2_CLIPBOARD") {
|
|
2402
|
+
const t = this.getSelectionModel ? this.getSelectionModel() : void 0, o = this.getFocusModel ? this.getFocusModel() : void 0;
|
|
2403
|
+
this.copyService.createContent(this.tableModel, t, o).then((s) => this.copyService.copyContent(s));
|
|
2404
|
+
}
|
|
1796
2405
|
return !1;
|
|
1797
2406
|
}
|
|
1798
|
-
updateModelValueAfterEdit(e, t,
|
|
1799
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t,
|
|
2407
|
+
updateModelValueAfterEdit(e, t, o, s) {
|
|
2408
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, o, s) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(N.createSingle(t, o)), this.hostElement.focus());
|
|
1800
2409
|
}
|
|
1801
2410
|
/**
|
|
1802
2411
|
* Retrieves the TableApi object.
|
|
@@ -1825,16 +2434,16 @@ class k extends ce {
|
|
|
1825
2434
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
1826
2435
|
*/
|
|
1827
2436
|
createGeMouseEvent(e) {
|
|
1828
|
-
const t = new
|
|
2437
|
+
const t = new _();
|
|
1829
2438
|
if (t.originalEvent = e, e) {
|
|
1830
|
-
const
|
|
1831
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
1832
|
-
const
|
|
1833
|
-
t.rowTop =
|
|
2439
|
+
const o = e.target;
|
|
2440
|
+
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(o), t.rowIndex = this.getNumberByAttr(o, "data-row-index"), t.columnIndex = this.getNumberByAttr(o, "data-col-index"), t.action = this.getStringByAttr(o, "data-ge-action"), t.areaIdent) {
|
|
2441
|
+
const s = this.tableModel.getAreaModel(t.areaIdent);
|
|
2442
|
+
t.rowTop = s.getYPosByRowIndex(t.rowIndex);
|
|
1834
2443
|
}
|
|
1835
2444
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
1836
|
-
const
|
|
1837
|
-
this.debugOnce(
|
|
2445
|
+
const s = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, i = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
2446
|
+
this.debugOnce(i, s);
|
|
1838
2447
|
}
|
|
1839
2448
|
}
|
|
1840
2449
|
return t;
|
|
@@ -1846,15 +2455,16 @@ class k extends ce {
|
|
|
1846
2455
|
* @return {void}
|
|
1847
2456
|
*/
|
|
1848
2457
|
onMouseDown(e) {
|
|
1849
|
-
e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.dragFrom = this.mouseStartColumnIndex));
|
|
2458
|
+
e.columnIndex > -1 && e.action && ["resize-column", "drag-column"].includes(e.action) && (this.mouseStartWidth = this.tableModel.getColumnWidth(e.columnIndex), this.mouseStartAction = e.action, this.mouseStartColumnIndex = e.columnIndex, this.mouseStartAction === "drag-column" && (this.firstDraggingRendering = !0, this.dragFrom = this.mouseStartColumnIndex));
|
|
1850
2459
|
}
|
|
1851
2460
|
/**
|
|
1852
2461
|
* Handles mouse dragging on the frame.
|
|
1853
2462
|
*
|
|
1854
2463
|
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2464
|
+
* @param startMouseEvent
|
|
1855
2465
|
*/
|
|
1856
|
-
mouseDraggingOnFrame(e) {
|
|
1857
|
-
this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows()), this.repaint());
|
|
2466
|
+
mouseDraggingOnFrame(e, t) {
|
|
2467
|
+
this.eventListener.onMouseDragging(e), this.mouseEvent = e, this.mouseStartColumnIndex > -1 && this.mouseStartAction === "resize-column" && this.tableOptions.columnsResizable ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && e.columnIndex > -1 && this.tableOptions.columnsDraggable && (this.draggingTargetColumnIndex = e.columnIndex, this.dragTo = this.draggingTargetColumnIndex, this.dragFrom > -1 && this.dragTo > -1 && this.dragFrom !== this.dragTo && (this.lastDragFrom === this.dragTo && this.lastDragTo === this.dragFrom || (this.tableModel.changeColumnOrder(this.dragFrom, this.dragTo), this.lastDragFrom = this.dragFrom, this.lastDragTo = this.dragTo, this.dragFrom = this.dragTo, this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows())), t && (this.adjustDraggingColumn(e, t.columnIndex, this.firstDraggingRendering), this.firstDraggingRendering = !1), this.repaint());
|
|
1858
2468
|
}
|
|
1859
2469
|
/**
|
|
1860
2470
|
* Handles the end of mouse dragging event on a frame.
|
|
@@ -1864,7 +2474,7 @@ class k extends ce {
|
|
|
1864
2474
|
* @returns {void}
|
|
1865
2475
|
*/
|
|
1866
2476
|
mouseDraggingEndOnFrame(e) {
|
|
1867
|
-
this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && this.repaint(), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.mouseStartAction = "";
|
|
2477
|
+
this.eventListener.onMouseDraggingEnd(e), this.draggingTargetColumnIndex = -1, this.mouseStartAction === "resize-column" ? this.resizeColumn(e) : this.mouseStartAction === "drag-column" && (this.hideDraggingColumn(), this.repaint()), this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, this.firstDraggingRendering = !0, this.mouseStartAction = "";
|
|
1868
2478
|
}
|
|
1869
2479
|
/**
|
|
1870
2480
|
* Handles the mouse move event.
|
|
@@ -1892,9 +2502,9 @@ class k extends ce {
|
|
|
1892
2502
|
* @return {void}
|
|
1893
2503
|
*/
|
|
1894
2504
|
toggleExpandCollapseAll(e = !0) {
|
|
1895
|
-
var
|
|
2505
|
+
var o;
|
|
1896
2506
|
const t = this.tableModel.getBodyModel();
|
|
1897
|
-
|
|
2507
|
+
W(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (o = this.storeStateCollapsedExpandService) == null || o.collapsedStateAll(e));
|
|
1898
2508
|
}
|
|
1899
2509
|
/**
|
|
1900
2510
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -1905,12 +2515,12 @@ class k extends ce {
|
|
|
1905
2515
|
*
|
|
1906
2516
|
* @return {void} - This method does not return anything.
|
|
1907
2517
|
*/
|
|
1908
|
-
toggleRowCheckbox(e, t,
|
|
2518
|
+
toggleRowCheckbox(e, t, o) {
|
|
1909
2519
|
var l;
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1912
|
-
const
|
|
1913
|
-
this.eventListener.onCheckboxChanged(
|
|
2520
|
+
const s = this.tableModel.getAreaModel(o), i = s.isRowChecked(e), r = i === void 0 || i === "semi" || i === "none";
|
|
2521
|
+
s.setRowChecked(e, r), this.repaint();
|
|
2522
|
+
const a = (l = s.rowSelectionModel) == null ? void 0 : l.getCheckedRows();
|
|
2523
|
+
this.eventListener.onCheckboxChanged(a || []);
|
|
1914
2524
|
}
|
|
1915
2525
|
/**
|
|
1916
2526
|
* Handle mouse click events.
|
|
@@ -1920,12 +2530,25 @@ class k extends ce {
|
|
|
1920
2530
|
* @returns {void}
|
|
1921
2531
|
*/
|
|
1922
2532
|
onMouseClicked(e, t) {
|
|
1923
|
-
let
|
|
1924
|
-
if (!
|
|
1925
|
-
|
|
1926
|
-
|
|
2533
|
+
let o = this.selectionService.onMouseClicked(e, t);
|
|
2534
|
+
if (!o && this.getFocusModel) {
|
|
2535
|
+
this.resetEditorRenderer();
|
|
2536
|
+
const s = this.getFocusModel();
|
|
2537
|
+
s && (o = s.hasChanged(), s.clearChanged());
|
|
1927
2538
|
}
|
|
1928
|
-
|
|
2539
|
+
return o;
|
|
2540
|
+
}
|
|
2541
|
+
debounceRepaint() {
|
|
2542
|
+
this.debounce(this.repaint.bind(this), 1);
|
|
2543
|
+
}
|
|
2544
|
+
publishGeMouseEvent(e) {
|
|
2545
|
+
this.eventListener.onMouseClicked(e);
|
|
2546
|
+
}
|
|
2547
|
+
onFocusChanged(e) {
|
|
2548
|
+
this.eventListener.onFocusChanged(e);
|
|
2549
|
+
}
|
|
2550
|
+
onSelectionChanged(e) {
|
|
2551
|
+
this.eventListener.onSelectionChanged(e);
|
|
1929
2552
|
}
|
|
1930
2553
|
/**
|
|
1931
2554
|
* Updates the table (repaint) when an external filter is changed.
|
|
@@ -1946,15 +2569,73 @@ class k extends ce {
|
|
|
1946
2569
|
*
|
|
1947
2570
|
* @return {void}
|
|
1948
2571
|
*/
|
|
1949
|
-
onHeaderDblClicked(e, t,
|
|
1950
|
-
var
|
|
1951
|
-
const
|
|
1952
|
-
if (
|
|
2572
|
+
onHeaderDblClicked(e, t, o) {
|
|
2573
|
+
var i, r;
|
|
2574
|
+
const s = this.tableModel.getColumnDef(o);
|
|
2575
|
+
if (s != null && s.sortable && s.sortable()) {
|
|
1953
2576
|
e.preventDefault(), e.stopPropagation();
|
|
1954
|
-
const
|
|
1955
|
-
this.tableModel.doSort([d]) && ((
|
|
2577
|
+
const a = s.sortStatesOrder ? s.sortStatesOrder : this.tableOptions.sortOrder, l = s.sortState ?? "", n = a[(a.indexOf(l) + 1) % a.length], d = new me(o, n);
|
|
2578
|
+
this.tableModel.doSort([d]) && ((i = this.tableModel.getColumnDefs()) == null || i.forEach((h) => h.sortState = ""), s.sortState = n), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
|
|
1956
2579
|
}
|
|
1957
2580
|
}
|
|
2581
|
+
/**
|
|
2582
|
+
* Scrolls the viewport to the specified pixel coordinates.
|
|
2583
|
+
*
|
|
2584
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to.
|
|
2585
|
+
* @param {number} py - The vertical pixel coordinate to scroll to.
|
|
2586
|
+
*
|
|
2587
|
+
* @return {void}
|
|
2588
|
+
*/
|
|
2589
|
+
scrollToPixel(e, t) {
|
|
2590
|
+
this.scrollViewport.scrollTo(e, t);
|
|
2591
|
+
}
|
|
2592
|
+
/**
|
|
2593
|
+
* Scrolls to the specified index in the table.
|
|
2594
|
+
*
|
|
2595
|
+
* @param {number} _indexX - The horizontal index of the table where scrolling is needed.
|
|
2596
|
+
* @param {number} indexY - The vertical index of the table where scrolling is needed.
|
|
2597
|
+
* @return {void}
|
|
2598
|
+
*/
|
|
2599
|
+
scrollToIndex(e, t) {
|
|
2600
|
+
const s = this.tableModel.getAreaModel("body").getYPosByRowIndex(t);
|
|
2601
|
+
this.scrollToPixel(0, s);
|
|
2602
|
+
}
|
|
2603
|
+
/**
|
|
2604
|
+
* Sets the selection model for the table.
|
|
2605
|
+
*
|
|
2606
|
+
* @param {SelectionModel} sm - The selection model to be set.
|
|
2607
|
+
* @param {boolean} rerender - Optional parameter indicating whether to rerender the table after setting the selection model. Default value is false.
|
|
2608
|
+
*
|
|
2609
|
+
* @return {void} - This method does not return any value.
|
|
2610
|
+
*/
|
|
2611
|
+
setSelectionModel(e, t = !1) {
|
|
2612
|
+
const o = () => e;
|
|
2613
|
+
this.tableOptions.getSelectionModel = o, this.getSelectionModel = o, this.selectionService.getSelectionModel = o, t && this.repaint();
|
|
2614
|
+
}
|
|
2615
|
+
toggleHeaderGroup(e) {
|
|
2616
|
+
const t = this.tableModel.getAreaModel("header");
|
|
2617
|
+
"columnDefs" in this.tableModel && (this.tableModel.columnDefs = t.toggleHeaderGroup(e), console.info("####### !!!!!! *******, this.tableModel.columnDefs")), this.firstInit();
|
|
2618
|
+
}
|
|
2619
|
+
/**
|
|
2620
|
+
* Retrieves the selection model.
|
|
2621
|
+
* @returns {SelectionModelIf | undefined} The selection model if available, otherwise undefined.
|
|
2622
|
+
*/
|
|
2623
|
+
selectionModel() {
|
|
2624
|
+
if (this != null && this.getSelectionModel)
|
|
2625
|
+
return this.getSelectionModel();
|
|
2626
|
+
}
|
|
2627
|
+
/**
|
|
2628
|
+
* Retrieves the focus model.
|
|
2629
|
+
*
|
|
2630
|
+
* @returns {FocusModelIf | undefined} The focus model if it exists, or undefined otherwise.
|
|
2631
|
+
*/
|
|
2632
|
+
focusModel() {
|
|
2633
|
+
if (this != null && this.getFocusModel)
|
|
2634
|
+
return this.getFocusModel();
|
|
2635
|
+
}
|
|
2636
|
+
setDragging(e) {
|
|
2637
|
+
this.dragging = e, this.dragging ? (this.storeColumnWidths(), this.lastDragFrom = -1, this.lastDragTo = -1) : this.storedColumnWidths = [];
|
|
2638
|
+
}
|
|
1958
2639
|
/**
|
|
1959
2640
|
* Changes the focus cell using the specified deltas.
|
|
1960
2641
|
*
|
|
@@ -1964,10 +2645,10 @@ class k extends ce {
|
|
|
1964
2645
|
*/
|
|
1965
2646
|
changeFocusCell(e, t) {
|
|
1966
2647
|
if (!this.isEditing() && this.getFocusModel) {
|
|
1967
|
-
const
|
|
1968
|
-
if (
|
|
1969
|
-
const [
|
|
1970
|
-
return
|
|
2648
|
+
const o = this.getFocusModel();
|
|
2649
|
+
if (o) {
|
|
2650
|
+
const [s, i] = o.getFocus();
|
|
2651
|
+
return o.setFocus(s + t, i + e), this.repaint(), !0;
|
|
1971
2652
|
}
|
|
1972
2653
|
}
|
|
1973
2654
|
return !1;
|
|
@@ -1990,22 +2671,20 @@ class k extends ce {
|
|
|
1990
2671
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
1991
2672
|
}
|
|
1992
2673
|
debugOnce(e, t) {
|
|
1993
|
-
var
|
|
1994
|
-
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", (
|
|
2674
|
+
var o;
|
|
2675
|
+
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", (o = this.mouseHandler.mouseEvent) == null ? void 0 : o.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
|
|
1995
2676
|
}
|
|
1996
2677
|
/**
|
|
1997
2678
|
* Restores the scroll position of the table if auto restore options are enabled.
|
|
1998
2679
|
*
|
|
1999
|
-
* @private
|
|
2000
|
-
* @memberof ClassName
|
|
2001
2680
|
*
|
|
2002
2681
|
* @returns {void}
|
|
2003
2682
|
*/
|
|
2004
2683
|
autoRestoreScrollPosition() {
|
|
2005
2684
|
var e;
|
|
2006
2685
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
2007
|
-
const
|
|
2008
|
-
|
|
2686
|
+
const o = this.storeScrollPosStateService.getScrollOffset();
|
|
2687
|
+
o && this.scrollViewport.scrollTo(...o);
|
|
2009
2688
|
}
|
|
2010
2689
|
}
|
|
2011
2690
|
/**
|
|
@@ -2025,8 +2704,8 @@ class k extends ce {
|
|
|
2025
2704
|
autoRestoreSortingState() {
|
|
2026
2705
|
var e, t;
|
|
2027
2706
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
2028
|
-
const
|
|
2029
|
-
|
|
2707
|
+
const o = this.storeSortingService.getSortItems();
|
|
2708
|
+
o != null && o.length && this.tableModel.getBodyModel().doSort(o);
|
|
2030
2709
|
}
|
|
2031
2710
|
}
|
|
2032
2711
|
/**
|
|
@@ -2038,105 +2717,369 @@ class k extends ce {
|
|
|
2038
2717
|
autoRestoreCollapsedExpandedState() {
|
|
2039
2718
|
var e, t;
|
|
2040
2719
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2041
|
-
const
|
|
2042
|
-
if (
|
|
2043
|
-
const
|
|
2044
|
-
if (
|
|
2045
|
-
const
|
|
2046
|
-
for (let
|
|
2047
|
-
const d = r.getRowByIndex(
|
|
2720
|
+
const o = this.tableOptions.autoRestoreOptions, s = o.getRowId;
|
|
2721
|
+
if (o.autoRestoreCollapsedExpandedState && s) {
|
|
2722
|
+
const i = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
2723
|
+
if (W(r)) {
|
|
2724
|
+
const a = r, l = r.getRowCount();
|
|
2725
|
+
for (let n = 0; n < l; n++) {
|
|
2726
|
+
const d = r.getRowByIndex(n);
|
|
2048
2727
|
if (d)
|
|
2049
|
-
if (
|
|
2728
|
+
if (i.allExpanded)
|
|
2050
2729
|
d.expanded = !0;
|
|
2051
|
-
else if (
|
|
2730
|
+
else if (i.allCollapsed)
|
|
2052
2731
|
d.expanded = !1;
|
|
2053
2732
|
else {
|
|
2054
|
-
const
|
|
2055
|
-
|
|
2733
|
+
const c = s(d.data);
|
|
2734
|
+
i.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c) : i.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(c));
|
|
2056
2735
|
}
|
|
2057
2736
|
}
|
|
2058
|
-
|
|
2737
|
+
a.recalcVisibleTreeRows();
|
|
2059
2738
|
}
|
|
2060
2739
|
}
|
|
2061
2740
|
}
|
|
2062
2741
|
}
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2742
|
+
}
|
|
2743
|
+
const $ = class $ {
|
|
2744
|
+
};
|
|
2745
|
+
$.themes = ["light", "combat", "paper", "blackboard"], $.vars = {
|
|
2746
|
+
light: `html[data-theme="light"] {
|
|
2747
|
+
--ge-table-bg: rgba(255,255,255, 0.5);
|
|
2748
|
+
--ge-table-header-west-bg: rgba(233, 233, 233, 0.5);
|
|
2749
|
+
--ge-table-header-center-bg: rgba(233, 233, 233, 0.5);
|
|
2750
|
+
--ge-table-header-east-bg: rgba(233, 233, 233, 0.5);
|
|
2751
|
+
--ge-table-header-west-text: #000;
|
|
2752
|
+
--ge-table-header-center-text: #000;
|
|
2753
|
+
--ge-table-header-east-text: #000;
|
|
2754
|
+
--ge-table-header-west-horizontal-border: #ddd;
|
|
2755
|
+
--ge-table-header-west-vertical-border: #ccc;
|
|
2756
|
+
--ge-table-header-center-horizontal-border: #ddd;
|
|
2757
|
+
--ge-table-header-center-vertical-border: #ccc;
|
|
2758
|
+
--ge-table-header-east-horizontal-border: #ddd;
|
|
2759
|
+
--ge-table-header-east-vertical-border: #ccc;
|
|
2760
|
+
--ge-table-body-west-bg: rgba(233, 233, 233, 0.5);
|
|
2761
|
+
--ge-table-body-center-bg: rgba(255,255,255, 0.5);
|
|
2762
|
+
--ge-table-body-east-bg: rgba(233, 233, 233, 0.5);
|
|
2763
|
+
--ge-table-body-west-text: #000;
|
|
2764
|
+
--ge-table-body-center-text: #000;
|
|
2765
|
+
--ge-table-body-east-text: #000;
|
|
2766
|
+
--ge-table-body-west-horizontal-border: #ddd;
|
|
2767
|
+
--ge-table-body-west-vertical-border: #ccc;
|
|
2768
|
+
--ge-table-body-center-horizontal-border: #bbb;
|
|
2769
|
+
--ge-table-body-center-vertical-border: #ddd;
|
|
2770
|
+
--ge-table-body-east-horizontal-border: #ddd;
|
|
2771
|
+
--ge-table-body-east-vertical-border: #ccc;
|
|
2772
|
+
--ge-table-body-west-selected-range-bg: rgba(0, 152, 219, 0.4);
|
|
2773
|
+
--ge-table-body-center-selected-range-bg: rgba(0, 152, 219, 0.4);
|
|
2774
|
+
--ge-table-body-east-selected-range-bg: rgba(0, 152, 219, 0.4);
|
|
2775
|
+
--ge-table-body-west-selected-range-text: #000;
|
|
2776
|
+
--ge-table-body-center-selected-range-text: #000;
|
|
2777
|
+
--ge-table-body-east-selected-range-text: #000;
|
|
2778
|
+
--ge-table-footer-west-bg: rgba(233, 233, 233, 0.5);
|
|
2779
|
+
--ge-table-footer-center-bg: rgba(233, 233, 233, 0.5);
|
|
2780
|
+
--ge-table-footer-east-bg: rgba(233, 233, 233, 0.5);
|
|
2781
|
+
--ge-table-footer-west-text: #000;
|
|
2782
|
+
--ge-table-footer-center-text: #000;
|
|
2783
|
+
--ge-table-footer-east-text: #000;
|
|
2784
|
+
--ge-table-footer-west-horizontal-border: #ddd;
|
|
2785
|
+
--ge-table-footer-west-vertical-border: #ccc;
|
|
2786
|
+
--ge-table-footer-center-horizontal-border: #ddd;
|
|
2787
|
+
--ge-table-footer-center-vertical-border: #ccc;
|
|
2788
|
+
--ge-table-footer-east-horizontal-border: #ddd;
|
|
2789
|
+
--ge-table-footer-east-vertical-border: #ccc;
|
|
2790
|
+
--ge-table-border: #ccc;
|
|
2791
|
+
--ge-table-row-odd-bg: transparent;
|
|
2792
|
+
--ge-table-row-even-bg: transparent;
|
|
2793
|
+
--ge-table-column-odd-bg: transparent;
|
|
2794
|
+
--ge-table-column-even-bg: transparent;
|
|
2795
|
+
--ge-table-hover-column-bg: rgba(0, 224, 255, 0.27);
|
|
2796
|
+
--ge-table-hover-row-bg: rgba(0, 224, 255, 0.27);
|
|
2797
|
+
--ge-table-focus-border: rgb(0, 255, 255);
|
|
2798
|
+
--ge-table-color-error-text: #e00034;
|
|
2799
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2800
|
+
--ge-table-column-resize-handle-border: rgb(0, 255, 255);
|
|
2801
|
+
--ge-table-dragged-col-div-bg: lightcyan;
|
|
2802
|
+
--ge-table-drop-zone-bg: rgba(244, 255, 242, 0.6);
|
|
2803
|
+
}`,
|
|
2804
|
+
combat: `html[data-theme="combat"] {
|
|
2805
|
+
--ge-table-bg: #101010;
|
|
2806
|
+
--ge-table-header-west-bg: #101010;
|
|
2807
|
+
--ge-table-header-center-bg: #101010;
|
|
2808
|
+
--ge-table-header-east-bg: #101010;
|
|
2809
|
+
--ge-table-header-west-text: oklch(100% 0 0);
|
|
2810
|
+
--ge-table-header-center-text: oklch(100% 0 0);
|
|
2811
|
+
--ge-table-header-east-text: oklch(100% 0 0);
|
|
2812
|
+
--ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2813
|
+
--ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2814
|
+
--ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2815
|
+
--ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2816
|
+
--ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2817
|
+
--ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2818
|
+
--ge-table-body-west-bg: #101010;
|
|
2819
|
+
--ge-table-body-center-bg: #101010;
|
|
2820
|
+
--ge-table-body-east-bg: #101010;
|
|
2821
|
+
--ge-table-body-west-text: #b6b4b4;
|
|
2822
|
+
--ge-table-body-center-text: #b6b4b4;
|
|
2823
|
+
--ge-table-body-east-text: #b6b4b4;
|
|
2824
|
+
--ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2825
|
+
--ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2826
|
+
--ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2827
|
+
--ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2828
|
+
--ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2829
|
+
--ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2830
|
+
--ge-table-body-west-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
|
|
2831
|
+
--ge-table-body-center-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
|
|
2832
|
+
--ge-table-body-east-selected-range-bg: oklch(20% 0.2 39.6 / 37%);
|
|
2833
|
+
--ge-table-body-west-selected-range-text: #f00032;
|
|
2834
|
+
--ge-table-body-center-selected-range-text: #f00032;
|
|
2835
|
+
--ge-table-body-east-selected-range-text: #f00032;
|
|
2836
|
+
--ge-table-footer-west-bg: #101010;
|
|
2837
|
+
--ge-table-footer-center-bg: #101010;
|
|
2838
|
+
--ge-table-footer-east-bg: #101010;
|
|
2839
|
+
--ge-table-footer-west-text: oklch(100% 0 0);
|
|
2840
|
+
--ge-table-footer-center-text: oklch(100% 0 0);
|
|
2841
|
+
--ge-table-footer-east-text: oklch(100% 0 0);
|
|
2842
|
+
--ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2843
|
+
--ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2844
|
+
--ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2845
|
+
--ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2846
|
+
--ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2847
|
+
--ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2848
|
+
--ge-table-border: oklch(100% 0 0 / 0%);
|
|
2849
|
+
--ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
|
|
2850
|
+
--ge-table-row-even-bg: oklch(100% 0 0 / 0%);
|
|
2851
|
+
--ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
|
|
2852
|
+
--ge-table-column-even-bg: oklch(100% 0 0 / 0%);
|
|
2853
|
+
--ge-table-hover-column-bg: oklch(34% 0.25 3.6 / 27%);
|
|
2854
|
+
--ge-table-hover-row-bg: oklch(34% 0.25 3.6 / 27%);
|
|
2855
|
+
--ge-table-focus-border: oklch(40% 0.25 3.6);
|
|
2856
|
+
--ge-table-color-error-text: oklch(65% 0.31 43.2);
|
|
2857
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2858
|
+
--ge-table-column-resize-handle-border: oklch(63% 0.31 43.2);
|
|
2859
|
+
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
2860
|
+
--ge-table-drop-zone-bg: #101010;
|
|
2861
|
+
}`,
|
|
2862
|
+
paper: `html[data-theme="paper"] {
|
|
2863
|
+
--ge-table-bg: #e7e5df;
|
|
2864
|
+
--ge-table-header-west-bg: oklch(80% 0.02 99 / 48%);
|
|
2865
|
+
--ge-table-header-center-bg: oklch(80% 0.02 99 / 48%);
|
|
2866
|
+
--ge-table-header-east-bg: oklch(80% 0.02 99 / 48%);
|
|
2867
|
+
--ge-table-header-west-text: #111;
|
|
2868
|
+
--ge-table-header-center-text: #111;
|
|
2869
|
+
--ge-table-header-east-text: #111;
|
|
2870
|
+
--ge-table-header-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2871
|
+
--ge-table-header-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2872
|
+
--ge-table-header-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2873
|
+
--ge-table-header-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2874
|
+
--ge-table-header-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2875
|
+
--ge-table-header-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2876
|
+
--ge-table-body-west-bg: oklch(80% 0.02 99 / 48%);
|
|
2877
|
+
--ge-table-body-center-bg: #e7e5df;
|
|
2878
|
+
--ge-table-body-east-bg: oklch(80% 0.02 99 / 48%);
|
|
2879
|
+
--ge-table-body-west-text: #000;
|
|
2880
|
+
--ge-table-body-center-text: #000;
|
|
2881
|
+
--ge-table-body-east-text: #000;
|
|
2882
|
+
--ge-table-body-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2883
|
+
--ge-table-body-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2884
|
+
--ge-table-body-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2885
|
+
--ge-table-body-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2886
|
+
--ge-table-body-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2887
|
+
--ge-table-body-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2888
|
+
--ge-table-body-west-selected-range-bg: #cfcdc2;
|
|
2889
|
+
--ge-table-body-center-selected-range-bg: #cfcdc2;
|
|
2890
|
+
--ge-table-body-east-selected-range-bg: #cfcdc2;
|
|
2891
|
+
--ge-table-body-west-selected-range-text: #000;
|
|
2892
|
+
--ge-table-body-center-selected-range-text: #000;
|
|
2893
|
+
--ge-table-body-east-selected-range-text: #000;
|
|
2894
|
+
--ge-table-footer-west-bg: oklch(80% 0.02 99 / 48%);
|
|
2895
|
+
--ge-table-footer-center-bg: oklch(80% 0.02 99 / 48%);
|
|
2896
|
+
--ge-table-footer-east-bg: oklch(80% 0.02 99 / 48%);
|
|
2897
|
+
--ge-table-footer-west-text: #111;
|
|
2898
|
+
--ge-table-footer-center-text: #111;
|
|
2899
|
+
--ge-table-footer-east-text: #111;
|
|
2900
|
+
--ge-table-footer-west-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2901
|
+
--ge-table-footer-west-vertical-border: oklch(100% 0 0 / 0%);
|
|
2902
|
+
--ge-table-footer-center-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2903
|
+
--ge-table-footer-center-vertical-border: oklch(100% 0 0 / 0%);
|
|
2904
|
+
--ge-table-footer-east-horizontal-border: oklch(100% 0 0 / 0%);
|
|
2905
|
+
--ge-table-footer-east-vertical-border: oklch(100% 0 0 / 0%);
|
|
2906
|
+
--ge-table-border: oklch(100% 0 0 / 0%);
|
|
2907
|
+
--ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
|
|
2908
|
+
--ge-table-row-even-bg: oklch(100% 0 0 / 0%);
|
|
2909
|
+
--ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
|
|
2910
|
+
--ge-table-column-even-bg: oklch(100% 0 0 / 0%);
|
|
2911
|
+
--ge-table-hover-column-bg: oklch(5% 0.2 266.40000000000003 / 9%);
|
|
2912
|
+
--ge-table-hover-row-bg: oklch(5% 0.2 266.40000000000003 / 9%);
|
|
2913
|
+
--ge-table-focus-border: oklch(100% 0.19 205.20000000000002);
|
|
2914
|
+
--ge-table-color-error-text: oklch(45% 0.25 43.2);
|
|
2915
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2916
|
+
--ge-table-column-resize-handle-border: oklch(100% 0.19 205.20000000000002 / 71%);
|
|
2917
|
+
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
2918
|
+
--ge-table-drop-zone-bg: #e7e5df;
|
|
2919
|
+
}`,
|
|
2920
|
+
blackboard: `html[data-theme="dark"] {
|
|
2921
|
+
--ge-table-bg: #0c1021;
|
|
2922
|
+
--ge-table-header-west-bg: #0c1021;
|
|
2923
|
+
--ge-table-header-center-bg: #0c1021;
|
|
2924
|
+
--ge-table-header-east-bg: #0c1021;
|
|
2925
|
+
--ge-table-header-west-text: #e0df85;
|
|
2926
|
+
--ge-table-header-center-text: #e0df85;
|
|
2927
|
+
--ge-table-header-east-text: #e0df85;
|
|
2928
|
+
--ge-table-header-west-horizontal-border: transparent;
|
|
2929
|
+
--ge-table-header-west-vertical-border: transparent;
|
|
2930
|
+
--ge-table-header-center-horizontal-border: transparent;
|
|
2931
|
+
--ge-table-header-center-vertical-border: transparent;
|
|
2932
|
+
--ge-table-header-east-horizontal-border: transparent;
|
|
2933
|
+
--ge-table-header-east-vertical-border: transparent;
|
|
2934
|
+
--ge-table-body-west-bg: #0c1021;
|
|
2935
|
+
--ge-table-body-center-bg: #0c1021;
|
|
2936
|
+
--ge-table-body-east-bg: #0c1021;
|
|
2937
|
+
--ge-table-body-west-text: #a7a7a7;
|
|
2938
|
+
--ge-table-body-center-text: #a7a7a7;
|
|
2939
|
+
--ge-table-body-east-text: #a7a7a7;
|
|
2940
|
+
--ge-table-body-west-horizontal-border: transparent;
|
|
2941
|
+
--ge-table-body-west-vertical-border: transparent;
|
|
2942
|
+
--ge-table-body-center-horizontal-border: transparent;
|
|
2943
|
+
--ge-table-body-center-vertical-border: transparent;
|
|
2944
|
+
--ge-table-body-east-horizontal-border: transparent;
|
|
2945
|
+
--ge-table-body-east-vertical-border: transparent;
|
|
2946
|
+
--ge-table-body-west-selected-range-bg: #758129;
|
|
2947
|
+
--ge-table-body-center-selected-range-bg: #758129;
|
|
2948
|
+
--ge-table-body-east-selected-range-bg: #758129;
|
|
2949
|
+
--ge-table-body-west-selected-range-text: oklch(100% 0 0);
|
|
2950
|
+
--ge-table-body-center-selected-range-text: oklch(100% 0 0);
|
|
2951
|
+
--ge-table-body-east-selected-range-text: oklch(100% 0 0);
|
|
2952
|
+
--ge-table-footer-west-bg: #0c1021;
|
|
2953
|
+
--ge-table-footer-center-bg: #0c1021;
|
|
2954
|
+
--ge-table-footer-east-bg: #0c1021;
|
|
2955
|
+
--ge-table-footer-west-text: #e0df85;
|
|
2956
|
+
--ge-table-footer-center-text: #e0df85;
|
|
2957
|
+
--ge-table-footer-east-text: #e0df85;
|
|
2958
|
+
--ge-table-footer-west-horizontal-border: transparent;
|
|
2959
|
+
--ge-table-footer-west-vertical-border: transparent;
|
|
2960
|
+
--ge-table-footer-center-horizontal-border: transparent;
|
|
2961
|
+
--ge-table-footer-center-vertical-border: otransparent;
|
|
2962
|
+
--ge-table-footer-east-horizontal-border: transparent;
|
|
2963
|
+
--ge-table-footer-east-vertical-border: transparent;
|
|
2964
|
+
--ge-table-border: oklch(0% 0 0);
|
|
2965
|
+
--ge-table-row-odd-bg: oklch(100% 0 0 / 0%);
|
|
2966
|
+
--ge-table-row-even-bg: oklch(100% 0 0 / 0%);
|
|
2967
|
+
--ge-table-column-odd-bg: oklch(100% 0 0 / 0%);
|
|
2968
|
+
--ge-table-column-even-bg: oklch(100% 0 0 / 0%);
|
|
2969
|
+
--ge-table-hover-column-bg: #a9a9a9;
|
|
2970
|
+
--ge-table-hover-row-bg: #a9a9a9;
|
|
2971
|
+
--ge-table-focus-border: #e1ff00;
|
|
2972
|
+
--ge-table-color-error-text: #ff0040;
|
|
2973
|
+
--ge-table-tree-arrow-collapsed-color: #e00034;
|
|
2974
|
+
--ge-table-column-resize-handle-border: oklch(0% 0 0);
|
|
2975
|
+
--ge-table-dragged-col-div-bg: #2c2e33;
|
|
2976
|
+
--ge-table-drop-zone-bg: #758129;
|
|
2977
|
+
}`
|
|
2978
|
+
};
|
|
2979
|
+
let Y = $;
|
|
2980
|
+
const B = class B {
|
|
2981
|
+
constructor(e = new ee()) {
|
|
2982
|
+
this.headerGroupOptions = e;
|
|
2983
|
+
}
|
|
2984
|
+
render(e, t, o, s, i, r, a) {
|
|
2985
|
+
const l = r != null && r.data ? r.data : "";
|
|
2986
|
+
if (r) {
|
|
2987
|
+
const { toggle: n, visibility: d, closed: c } = r, h = n ? B.toggleHeaderGroup : "";
|
|
2988
|
+
this.addText(e, s, t, o, l, h), n && d !== "always" && this.addArrowDiv(a, e, !c, t, o, s, h);
|
|
2989
|
+
} else
|
|
2990
|
+
this.addText(e, s, t, o, l, "");
|
|
2073
2991
|
}
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2992
|
+
addText(e, t, o, s, i, r) {
|
|
2993
|
+
e.innerHTML = `<span
|
|
2994
|
+
data-ge-action="${r}"
|
|
2995
|
+
data-area="${t}"
|
|
2996
|
+
data-row-index="${o}"
|
|
2997
|
+
data-col-index="${s}"
|
|
2998
|
+
>${i}</span>`;
|
|
2999
|
+
}
|
|
3000
|
+
addArrowDiv(e, t, o = !0, s = -1, i = -1, r = "header", a) {
|
|
3001
|
+
const l = e.createElement("div");
|
|
3002
|
+
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", `${s}`), e.setAttribute(l, "data-col-index", `${i}`), e.setAttribute(l, "data-area", `${r}`), e.setAttribute(l, "data-ge-action", `${a}`);
|
|
3003
|
+
let n;
|
|
3004
|
+
o ? n = this.headerGroupOptions.iconExpanded : n = this.headerGroupOptions.iconCollapsed;
|
|
3005
|
+
const d = n.content, c = e.createText(d);
|
|
3006
|
+
e.appendChild(l, c), n.style && this.applyStyleString(e, l, n.style);
|
|
3007
|
+
for (const h of n.classes)
|
|
3008
|
+
e.addClass(l, h);
|
|
3009
|
+
return e.appendChild(t, l), l;
|
|
3010
|
+
}
|
|
3011
|
+
applyStyleString(e, t, o) {
|
|
3012
|
+
const s = o.split(";").map((i) => i.trim()).filter((i) => i);
|
|
3013
|
+
for (const i of s) {
|
|
3014
|
+
const [r, a] = i.split(":");
|
|
3015
|
+
e.setStyle(t, r.trim(), a.trim());
|
|
3016
|
+
}
|
|
2084
3017
|
}
|
|
2085
|
-
}
|
|
2086
|
-
|
|
3018
|
+
};
|
|
3019
|
+
B.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3020
|
+
let q = B;
|
|
3021
|
+
function Fe({
|
|
2087
3022
|
tableModel: p,
|
|
2088
|
-
tableOptions: e = new
|
|
3023
|
+
tableOptions: e = new te(),
|
|
2089
3024
|
mouseMoved: t,
|
|
2090
|
-
checkboxChanged:
|
|
2091
|
-
contextmenu:
|
|
2092
|
-
modelChanged:
|
|
3025
|
+
checkboxChanged: o,
|
|
3026
|
+
contextmenu: s,
|
|
3027
|
+
modelChanged: i,
|
|
2093
3028
|
mouseClicked: r,
|
|
2094
|
-
mouseDragging:
|
|
3029
|
+
mouseDragging: a,
|
|
2095
3030
|
mouseDraggingEnd: l,
|
|
2096
|
-
|
|
2097
|
-
|
|
3031
|
+
selectionChanged: n,
|
|
3032
|
+
focusChanged: d,
|
|
3033
|
+
tableReady: c,
|
|
3034
|
+
licenseKey: h
|
|
2098
3035
|
}) {
|
|
2099
|
-
const
|
|
2100
|
-
let
|
|
2101
|
-
|
|
2102
|
-
|
|
3036
|
+
const f = se(null);
|
|
3037
|
+
let u = !1;
|
|
3038
|
+
ie(() => {
|
|
3039
|
+
f.current && !u && (S(f.current), u = !0);
|
|
2103
3040
|
});
|
|
2104
|
-
const
|
|
2105
|
-
const
|
|
2106
|
-
|
|
2107
|
-
|
|
3041
|
+
const S = (b) => {
|
|
3042
|
+
const g = {
|
|
3043
|
+
onSelectionChanged(m) {
|
|
3044
|
+
n && n(m);
|
|
2108
3045
|
},
|
|
2109
|
-
|
|
2110
|
-
|
|
3046
|
+
onFocusChanged(m) {
|
|
3047
|
+
d && d(m);
|
|
2111
3048
|
},
|
|
2112
|
-
|
|
2113
|
-
o && o(
|
|
3049
|
+
onCheckboxChanged: (m) => {
|
|
3050
|
+
o && o(m);
|
|
2114
3051
|
},
|
|
2115
|
-
|
|
2116
|
-
|
|
3052
|
+
onContextmenu: (m) => {
|
|
3053
|
+
s && s(m);
|
|
2117
3054
|
},
|
|
2118
|
-
|
|
2119
|
-
|
|
3055
|
+
onModelChanged: (m) => {
|
|
3056
|
+
i && i(m);
|
|
2120
3057
|
},
|
|
2121
|
-
|
|
2122
|
-
|
|
3058
|
+
onMouseClicked: (m) => {
|
|
3059
|
+
r && r(m);
|
|
2123
3060
|
},
|
|
2124
|
-
|
|
2125
|
-
|
|
3061
|
+
onMouseDragging: (m) => {
|
|
3062
|
+
a && a(m);
|
|
3063
|
+
},
|
|
3064
|
+
onMouseDraggingEnd: (m) => {
|
|
3065
|
+
l && l(m);
|
|
3066
|
+
},
|
|
3067
|
+
onMouseMoved: (m) => {
|
|
3068
|
+
t && t(m);
|
|
2126
3069
|
}
|
|
2127
|
-
},
|
|
2128
|
-
|
|
3070
|
+
}, v = new j(
|
|
3071
|
+
b,
|
|
2129
3072
|
p,
|
|
2130
|
-
new
|
|
3073
|
+
new Z(),
|
|
2131
3074
|
e,
|
|
2132
|
-
|
|
3075
|
+
g
|
|
2133
3076
|
);
|
|
2134
|
-
|
|
3077
|
+
v.firstInit(), c && c(v.getApi()), h && k.getInstance().setLicenseKey(h);
|
|
2135
3078
|
};
|
|
2136
|
-
return /* @__PURE__ */
|
|
3079
|
+
return /* @__PURE__ */ oe(
|
|
2137
3080
|
"div",
|
|
2138
3081
|
{
|
|
2139
|
-
ref:
|
|
3082
|
+
ref: f,
|
|
2140
3083
|
className: "container-div",
|
|
2141
3084
|
style: {
|
|
2142
3085
|
width: "100%",
|
|
@@ -2148,39 +3091,39 @@ function Me({
|
|
|
2148
3091
|
}
|
|
2149
3092
|
);
|
|
2150
3093
|
}
|
|
2151
|
-
var
|
|
3094
|
+
var G, F = re;
|
|
2152
3095
|
if (process.env.NODE_ENV === "production")
|
|
2153
|
-
|
|
3096
|
+
G = F.createRoot, F.hydrateRoot;
|
|
2154
3097
|
else {
|
|
2155
|
-
var
|
|
2156
|
-
|
|
2157
|
-
|
|
3098
|
+
var U = F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
3099
|
+
G = function(p, e) {
|
|
3100
|
+
U.usingClientEntryPoint = !0;
|
|
2158
3101
|
try {
|
|
2159
|
-
return
|
|
3102
|
+
return F.createRoot(p, e);
|
|
2160
3103
|
} finally {
|
|
2161
|
-
|
|
3104
|
+
U.usingClientEntryPoint = !1;
|
|
2162
3105
|
}
|
|
2163
3106
|
};
|
|
2164
3107
|
}
|
|
2165
|
-
class
|
|
3108
|
+
class Le {
|
|
2166
3109
|
constructor(e) {
|
|
2167
3110
|
this.Component = e, console.info(e);
|
|
2168
3111
|
}
|
|
2169
|
-
render(e, t, s, i,
|
|
3112
|
+
render(e, t, o, s, i, r, a) {
|
|
2170
3113
|
const l = {
|
|
2171
3114
|
cellDiv: e,
|
|
2172
3115
|
rowIndex: t,
|
|
2173
|
-
columnIndex:
|
|
2174
|
-
areaIdent:
|
|
2175
|
-
areaModel:
|
|
3116
|
+
columnIndex: o,
|
|
3117
|
+
areaIdent: s,
|
|
3118
|
+
areaModel: i,
|
|
2176
3119
|
cellValue: r
|
|
2177
|
-
},
|
|
2178
|
-
return
|
|
2179
|
-
|
|
3120
|
+
}, n = G(e, {});
|
|
3121
|
+
return n.render(this.Component(l)), () => {
|
|
3122
|
+
n.unmount();
|
|
2180
3123
|
};
|
|
2181
3124
|
}
|
|
2182
3125
|
}
|
|
2183
3126
|
export {
|
|
2184
|
-
|
|
2185
|
-
|
|
3127
|
+
Le as ComponentRendererWrapper,
|
|
3128
|
+
Fe as GuiexpertTable
|
|
2186
3129
|
};
|