@guiexpert/react-table 18.0.0 → 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 +1728 -735
- package/lib/guiexpert-table.d.ts +25 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,18 +1,43 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
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
|
+
// The constructor is private to prevent direct construction calls
|
|
6
|
+
// with the `new` operator
|
|
7
|
+
constructor() {
|
|
8
|
+
this.alreadySet = !1;
|
|
9
|
+
}
|
|
10
|
+
static getInstance() {
|
|
11
|
+
return k.instance || (k.instance = new k()), k.instance;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Method to set the license key for the application.
|
|
15
|
+
* A 'meta' element is created with content as 'guiexperttable=<license key>'
|
|
16
|
+
* and appended into the head section of the document
|
|
17
|
+
*
|
|
18
|
+
* @param {string} key - The license key to set for the application.
|
|
19
|
+
*
|
|
20
|
+
* @return {void} - This method does not return anything
|
|
21
|
+
*/
|
|
22
|
+
setLicenseKey(e) {
|
|
23
|
+
if (e && !this.alreadySet) {
|
|
24
|
+
const t = document.createElement("meta");
|
|
25
|
+
t.content = "license=" + e, t.name = "guiexperttable", document.getElementsByTagName("head")[0].appendChild(t), this.alreadySet = !0;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function P(p) {
|
|
5
30
|
return p && p.type === "TreeRow";
|
|
6
31
|
}
|
|
7
|
-
function
|
|
32
|
+
function W(p) {
|
|
8
33
|
return p && p.type === "AreaModelTree";
|
|
9
34
|
}
|
|
10
|
-
class
|
|
11
|
-
constructor(e = -1, t = -1,
|
|
12
|
-
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;
|
|
13
38
|
}
|
|
14
39
|
clone() {
|
|
15
|
-
return new
|
|
40
|
+
return new _(
|
|
16
41
|
this.rowIndex,
|
|
17
42
|
this.rowTop,
|
|
18
43
|
this.columnIndex,
|
|
@@ -28,11 +53,11 @@ class W {
|
|
|
28
53
|
}
|
|
29
54
|
}
|
|
30
55
|
class D {
|
|
31
|
-
constructor(e = ">", t = "",
|
|
32
|
-
this.content = e, this.style = t, this.classes =
|
|
56
|
+
constructor(e = ">", t = "", o = []) {
|
|
57
|
+
this.content = e, this.style = t, this.classes = o;
|
|
33
58
|
}
|
|
34
59
|
}
|
|
35
|
-
class
|
|
60
|
+
class J {
|
|
36
61
|
constructor(e = new D(
|
|
37
62
|
">",
|
|
38
63
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
@@ -41,33 +66,33 @@ class X {
|
|
|
41
66
|
">",
|
|
42
67
|
"",
|
|
43
68
|
["ge-table-tree-arrow-collapsed"]
|
|
44
|
-
),
|
|
69
|
+
), o = new D(
|
|
45
70
|
">",
|
|
46
71
|
"color:transparent;",
|
|
47
72
|
["gt-table-tree-arrow-hidden"]
|
|
48
|
-
),
|
|
73
|
+
), s = new D(
|
|
49
74
|
"↕",
|
|
50
75
|
"",
|
|
51
76
|
["gt-table-tree-arrow-expanded-all"]
|
|
52
77
|
)) {
|
|
53
|
-
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder =
|
|
78
|
+
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = o, this.arrowExpandCollapseAll = s;
|
|
54
79
|
}
|
|
55
80
|
}
|
|
56
|
-
class
|
|
57
|
-
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]),
|
|
58
|
-
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;
|
|
59
84
|
}
|
|
60
85
|
}
|
|
61
|
-
class
|
|
86
|
+
class le {
|
|
62
87
|
constructor(e) {
|
|
63
88
|
this.domService = e;
|
|
64
89
|
}
|
|
65
|
-
setStyle(e, t,
|
|
66
|
-
return this.domService.setStyle(e, t,
|
|
90
|
+
setStyle(e, t, o) {
|
|
91
|
+
return this.domService.setStyle(e, t, o), e;
|
|
67
92
|
}
|
|
68
93
|
applyStyle(e, t) {
|
|
69
|
-
for (const
|
|
70
|
-
this.domService.setStyle(e,
|
|
94
|
+
for (const o in t)
|
|
95
|
+
this.domService.setStyle(e, o, t[o]);
|
|
71
96
|
return e;
|
|
72
97
|
}
|
|
73
98
|
applyDisplayNoneStyle(e) {
|
|
@@ -77,7 +102,7 @@ class Z {
|
|
|
77
102
|
return this.domService.setStyle(e, "display", "block"), e;
|
|
78
103
|
}
|
|
79
104
|
applyStyleInPx(e, t) {
|
|
80
|
-
return Object.entries(t).forEach(([
|
|
105
|
+
return Object.entries(t).forEach(([o, s]) => this.domService.setStyle(e, o, s + "px")), e;
|
|
81
106
|
}
|
|
82
107
|
applyStylePosistionRelative(e) {
|
|
83
108
|
return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
|
|
@@ -88,8 +113,8 @@ class Z {
|
|
|
88
113
|
applyStyleFullSize(e) {
|
|
89
114
|
return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
|
|
90
115
|
}
|
|
91
|
-
applyStyleOverflowAuto(e = "auto", t = "auto",
|
|
92
|
-
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;
|
|
93
118
|
}
|
|
94
119
|
applyStyleNoPadding(e) {
|
|
95
120
|
return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
|
|
@@ -105,156 +130,157 @@ class Z {
|
|
|
105
130
|
return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
|
|
106
131
|
}
|
|
107
132
|
appendText(e, t) {
|
|
108
|
-
const
|
|
109
|
-
return this.domService.appendChild(e,
|
|
133
|
+
const o = this.domService.createText(t);
|
|
134
|
+
return this.domService.appendChild(e, o), o;
|
|
110
135
|
}
|
|
111
136
|
addClass(e, t) {
|
|
112
|
-
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;
|
|
113
138
|
}
|
|
114
139
|
removeClass(e, t) {
|
|
115
|
-
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;
|
|
116
141
|
}
|
|
117
142
|
addClasses(e, t) {
|
|
118
143
|
if (e)
|
|
119
|
-
for (const
|
|
120
|
-
this.domService.addClass(t,
|
|
144
|
+
for (const o of e)
|
|
145
|
+
this.domService.addClass(t, o);
|
|
121
146
|
return t;
|
|
122
147
|
}
|
|
123
|
-
setAttribute(e, t,
|
|
124
|
-
return t &&
|
|
148
|
+
setAttribute(e, t, o) {
|
|
149
|
+
return t && o && this.domService.setAttribute(e, t, o), e;
|
|
125
150
|
}
|
|
126
|
-
createAreaDivWithClass(e, t,
|
|
127
|
-
const
|
|
128
|
-
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;
|
|
129
154
|
}
|
|
130
155
|
createDivWithClass(e, t) {
|
|
131
|
-
const
|
|
132
|
-
return this.addClass(e,
|
|
156
|
+
const o = this.domService.createElement("div");
|
|
157
|
+
return this.addClass(e, o), this.domService.appendChild(t, o), o;
|
|
133
158
|
}
|
|
134
|
-
addRowDiv(e, t,
|
|
135
|
-
const
|
|
136
|
-
if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`),
|
|
137
|
-
const
|
|
138
|
-
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}`);
|
|
139
164
|
}
|
|
140
|
-
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", `${
|
|
141
|
-
const
|
|
142
|
-
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);
|
|
143
168
|
}
|
|
144
169
|
return this.domService.appendChild(e.child, l), l;
|
|
145
170
|
}
|
|
146
|
-
addColumnDiv(e
|
|
147
|
-
const
|
|
148
|
-
this.domService.addClass(
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
const
|
|
152
|
-
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);
|
|
153
178
|
}
|
|
154
|
-
return
|
|
179
|
+
return h && this.addSortedIcon(S, h, d == null ? void 0 : d.sortedOptions, i), this.domService.appendChild(t, S), S;
|
|
155
180
|
}
|
|
156
|
-
addCheckboxToDiv(e, t,
|
|
157
|
-
const
|
|
158
|
-
return
|
|
181
|
+
addCheckboxToDiv(e, t, o, s) {
|
|
182
|
+
const i = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
|
|
183
|
+
return i.innerHTML = `
|
|
159
184
|
<input
|
|
160
185
|
type="checkbox"
|
|
161
|
-
data-area="${
|
|
162
|
-
data-row-index="${
|
|
186
|
+
data-area="${o}"
|
|
187
|
+
data-row-index="${s}"
|
|
163
188
|
data-input-type="checkbox"
|
|
164
189
|
${r}
|
|
165
|
-
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;
|
|
166
191
|
}
|
|
167
|
-
addLabelDiv(e, t = "",
|
|
168
|
-
const
|
|
169
|
-
if (this.domService.addClass(
|
|
170
|
-
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) {
|
|
171
196
|
const l = this.domService.createText(t);
|
|
172
|
-
this.domService.appendChild(
|
|
197
|
+
this.domService.appendChild(a, l);
|
|
173
198
|
} else {
|
|
174
199
|
const l = this.domService.createElement("div");
|
|
175
|
-
this.domService.appendChild(
|
|
176
|
-
const
|
|
177
|
-
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}`);
|
|
178
203
|
}
|
|
179
|
-
return this.domService.appendChild(e,
|
|
204
|
+
return this.domService.appendChild(e, a), a;
|
|
180
205
|
}
|
|
181
|
-
addSortedIcon(e, t = "",
|
|
182
|
-
const
|
|
183
|
-
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");
|
|
184
209
|
let r;
|
|
185
|
-
t === "asc" ? r =
|
|
186
|
-
const
|
|
187
|
-
this.domService.appendChild(
|
|
188
|
-
for (const
|
|
189
|
-
this.domService.addClass(
|
|
190
|
-
return this.domService.appendChild(e,
|
|
191
|
-
}
|
|
192
|
-
addArrowDiv(e, t = "none",
|
|
193
|
-
const
|
|
194
|
-
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}`);
|
|
195
220
|
let l;
|
|
196
|
-
t === "expanded" ? l =
|
|
197
|
-
const
|
|
198
|
-
this.domService.appendChild(
|
|
199
|
-
for (const
|
|
200
|
-
this.domService.addClass(
|
|
201
|
-
return this.domService.appendChild(e,
|
|
202
|
-
}
|
|
203
|
-
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) {
|
|
204
229
|
if (e.verticalBorderVisible) {
|
|
205
|
-
const r = `ge-table-${
|
|
206
|
-
this.addVerticalBorder(
|
|
230
|
+
const r = `ge-table-${s}-${i}-vertical-border`;
|
|
231
|
+
this.addVerticalBorder(o, t, r);
|
|
207
232
|
}
|
|
208
233
|
if (e.horizontalBorderVisible) {
|
|
209
|
-
const r = `ge-table-${
|
|
210
|
-
this.addHorizontalBorder(
|
|
234
|
+
const r = `ge-table-${s}-${i}-horizontal-border`;
|
|
235
|
+
this.addHorizontalBorder(o, t, r);
|
|
211
236
|
}
|
|
212
237
|
return t;
|
|
213
238
|
}
|
|
214
|
-
addHorizontalBorder(e, t,
|
|
215
|
-
const
|
|
216
|
-
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;
|
|
217
242
|
}
|
|
218
|
-
addFocusBorderDivs(e, t,
|
|
219
|
-
|
|
220
|
-
|
|
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;
|
|
221
247
|
}
|
|
222
|
-
addVerticalBorder(e, t,
|
|
223
|
-
const
|
|
224
|
-
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;
|
|
225
251
|
}
|
|
226
|
-
addDiv(e, t,
|
|
227
|
-
const
|
|
228
|
-
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;
|
|
229
255
|
}
|
|
230
256
|
applyStyleString(e, t) {
|
|
231
|
-
const
|
|
232
|
-
for (const
|
|
233
|
-
const [
|
|
234
|
-
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());
|
|
235
261
|
}
|
|
236
262
|
}
|
|
237
263
|
getDivOrCreateDiv(e, t) {
|
|
238
|
-
let
|
|
239
|
-
return
|
|
264
|
+
let o = t.cache[e];
|
|
265
|
+
return o ? (o.innerText = "", o) : (o = this.domService.createElement("div"), t.cache[e] = o, o);
|
|
240
266
|
}
|
|
241
267
|
}
|
|
242
|
-
const
|
|
243
|
-
class
|
|
268
|
+
const V = (p) => p === "header" ? "header" : p === "footer" ? "footer" : "body";
|
|
269
|
+
class ae {
|
|
244
270
|
constructor(e, t) {
|
|
245
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)) {
|
|
246
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"));
|
|
247
|
-
const
|
|
248
|
-
if (
|
|
249
|
-
const
|
|
250
|
-
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;
|
|
251
277
|
}
|
|
252
278
|
}
|
|
253
279
|
}
|
|
254
280
|
}
|
|
255
|
-
class
|
|
281
|
+
class ne {
|
|
256
282
|
constructor(e) {
|
|
257
|
-
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(
|
|
258
284
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
259
285
|
);
|
|
260
286
|
}
|
|
@@ -278,22 +304,28 @@ class te {
|
|
|
278
304
|
* @return {void}
|
|
279
305
|
*/
|
|
280
306
|
onHostElementClicked(e) {
|
|
281
|
-
const t =
|
|
282
|
-
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")
|
|
283
313
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
284
|
-
else if (
|
|
285
|
-
this.tableScope.
|
|
286
|
-
else if (
|
|
287
|
-
|
|
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");
|
|
288
320
|
if (console.info(i, s), s || i) {
|
|
289
321
|
e.preventDefault(), e.stopPropagation();
|
|
290
|
-
const
|
|
291
|
-
|
|
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);
|
|
292
324
|
}
|
|
293
325
|
}
|
|
294
|
-
if (
|
|
326
|
+
if (o.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
295
327
|
const s = this.tableScope.tableOptions.getFocusModel();
|
|
296
|
-
s == null || s.clear(), s == null || s.setFocus(
|
|
328
|
+
s == null || s.clear(), s == null || s.setFocus(o.rowIdx, o.colIdx);
|
|
297
329
|
}
|
|
298
330
|
this.publishGeMouseEvent(e, 1);
|
|
299
331
|
}
|
|
@@ -304,16 +336,16 @@ class te {
|
|
|
304
336
|
* @param {MouseEvent} event - The double click event.
|
|
305
337
|
*/
|
|
306
338
|
onHostElementDblClicked(e) {
|
|
307
|
-
if (e.target instanceof HTMLElement) {
|
|
308
|
-
const t = e.target,
|
|
309
|
-
if (
|
|
310
|
-
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));
|
|
311
343
|
else if (t.getAttribute("data-row-index")) {
|
|
312
|
-
const l =
|
|
313
|
-
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()) {
|
|
314
346
|
e.preventDefault(), e.stopPropagation();
|
|
315
|
-
const
|
|
316
|
-
|
|
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);
|
|
317
349
|
}
|
|
318
350
|
}
|
|
319
351
|
}
|
|
@@ -328,8 +360,8 @@ class te {
|
|
|
328
360
|
* @return {void}
|
|
329
361
|
*/
|
|
330
362
|
publishGeMouseEvent(e, t) {
|
|
331
|
-
var
|
|
332
|
-
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();
|
|
333
365
|
}
|
|
334
366
|
/**
|
|
335
367
|
* Update the collapsed/expanded state of a tree row.
|
|
@@ -338,30 +370,30 @@ class te {
|
|
|
338
370
|
* @returns {void}
|
|
339
371
|
*/
|
|
340
372
|
updateCollapsedExpandedState(e) {
|
|
341
|
-
var s, i,
|
|
342
|
-
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;
|
|
343
375
|
if (t) {
|
|
344
|
-
const l = (
|
|
345
|
-
|
|
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));
|
|
346
378
|
}
|
|
347
379
|
}
|
|
348
380
|
getArrowColumnIndex() {
|
|
349
381
|
return this.tableScope.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
350
382
|
}
|
|
351
383
|
onMouseDown(e) {
|
|
352
|
-
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);
|
|
353
385
|
}
|
|
354
386
|
onMouseMove(e) {
|
|
355
|
-
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));
|
|
356
388
|
}
|
|
357
389
|
onMouseUp(e) {
|
|
358
|
-
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);
|
|
359
391
|
}
|
|
360
392
|
mouseDraggingOnFrame() {
|
|
361
393
|
var e;
|
|
362
394
|
if (this.mouseEvent) {
|
|
363
395
|
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
364
|
-
(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);
|
|
365
397
|
}
|
|
366
398
|
}
|
|
367
399
|
mouseDraggingEndOnFrame() {
|
|
@@ -378,7 +410,7 @@ class te {
|
|
|
378
410
|
}
|
|
379
411
|
}
|
|
380
412
|
}
|
|
381
|
-
class
|
|
413
|
+
class de {
|
|
382
414
|
constructor(e) {
|
|
383
415
|
this.tableScope = e;
|
|
384
416
|
}
|
|
@@ -404,21 +436,23 @@ class se {
|
|
|
404
436
|
/**
|
|
405
437
|
* Scrolls the table body to the specified pixel coordinates.
|
|
406
438
|
*
|
|
407
|
-
* @param {number}
|
|
408
|
-
* @param {number}
|
|
439
|
+
* @param {number} px - The horizontal pixel coordinate to scroll to. Defaults to 0.
|
|
440
|
+
* @param {number} py - The vertical pixel coordinate to scroll to. Defaults to 0.
|
|
409
441
|
* @return {void}
|
|
410
442
|
*/
|
|
411
443
|
scrollToPixel(e = 0, t = 0) {
|
|
444
|
+
this.tableScope.scrollToPixel(e, t);
|
|
412
445
|
}
|
|
413
446
|
/**
|
|
414
447
|
* Scrolls to the specified index in both horizontal and vertical directions.
|
|
415
448
|
*
|
|
416
|
-
* @param {number}
|
|
417
|
-
* @param {number}
|
|
449
|
+
* @param {number} indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
|
|
450
|
+
* @param {number} indexY - The index of the row to scroll to in the vertical direction. Default is 0.
|
|
418
451
|
*
|
|
419
452
|
* @return undefined
|
|
420
453
|
*/
|
|
421
454
|
scrollToIndex(e = 0, t = 0) {
|
|
455
|
+
this.tableScope.scrollToIndex(e, t);
|
|
422
456
|
}
|
|
423
457
|
/**
|
|
424
458
|
* Sets whether the header is visible or not.
|
|
@@ -482,36 +516,114 @@ class se {
|
|
|
482
516
|
repaint() {
|
|
483
517
|
this.tableScope.repaint();
|
|
484
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
|
+
}
|
|
485
597
|
}
|
|
486
|
-
class
|
|
598
|
+
class z {
|
|
487
599
|
constructor(e) {
|
|
488
600
|
this.getStorageKeyFn = e;
|
|
489
601
|
}
|
|
490
602
|
autoConvertMapToObject(e) {
|
|
491
603
|
const t = {};
|
|
492
604
|
if (e instanceof Map) {
|
|
493
|
-
const
|
|
494
|
-
for (const
|
|
605
|
+
const o = e;
|
|
606
|
+
for (const s of [...o]) {
|
|
495
607
|
const [
|
|
496
|
-
|
|
608
|
+
i,
|
|
497
609
|
r
|
|
498
|
-
] =
|
|
499
|
-
t[
|
|
610
|
+
] = s;
|
|
611
|
+
t[i] = r;
|
|
500
612
|
}
|
|
501
613
|
}
|
|
502
614
|
return t;
|
|
503
615
|
}
|
|
504
616
|
checkAndPersistItem(e, t) {
|
|
505
|
-
const
|
|
506
|
-
if (
|
|
507
|
-
const
|
|
508
|
-
if (
|
|
509
|
-
const
|
|
617
|
+
const o = this.getStorageKeyFn;
|
|
618
|
+
if (o) {
|
|
619
|
+
const s = o();
|
|
620
|
+
if (s) {
|
|
621
|
+
const i = s + e;
|
|
510
622
|
if ((t + "").includes("Map")) {
|
|
511
623
|
const r = this.autoConvertMapToObject(t);
|
|
512
|
-
this.persistItem(
|
|
624
|
+
this.persistItem(i, r);
|
|
513
625
|
} else
|
|
514
|
-
this.persistItem(
|
|
626
|
+
this.persistItem(i, t);
|
|
515
627
|
}
|
|
516
628
|
}
|
|
517
629
|
}
|
|
@@ -558,7 +670,7 @@ class P {
|
|
|
558
670
|
// }
|
|
559
671
|
// }
|
|
560
672
|
}
|
|
561
|
-
class
|
|
673
|
+
class ce extends z {
|
|
562
674
|
constructor(e) {
|
|
563
675
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
564
676
|
}
|
|
@@ -573,21 +685,21 @@ class ie extends P {
|
|
|
573
685
|
if (e) {
|
|
574
686
|
const t = e();
|
|
575
687
|
if (t) {
|
|
576
|
-
const
|
|
577
|
-
let
|
|
578
|
-
this.scrollOffset =
|
|
688
|
+
const o = t + this.SCROLL_STATE;
|
|
689
|
+
let s = this.loadFromLocalStorage(o);
|
|
690
|
+
this.scrollOffset = s || [0, 0];
|
|
579
691
|
}
|
|
580
692
|
}
|
|
581
693
|
}
|
|
582
694
|
}
|
|
583
|
-
class
|
|
584
|
-
constructor(e = "collapsed", t = [],
|
|
585
|
-
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;
|
|
586
698
|
}
|
|
587
699
|
}
|
|
588
|
-
class
|
|
700
|
+
class ge extends z {
|
|
589
701
|
constructor(e) {
|
|
590
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
702
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new he(), this.load();
|
|
591
703
|
}
|
|
592
704
|
collapsedExpandedStateGet() {
|
|
593
705
|
return this.collapsedExpandedState;
|
|
@@ -610,8 +722,8 @@ class le extends P {
|
|
|
610
722
|
if (e) {
|
|
611
723
|
const t = e();
|
|
612
724
|
if (t) {
|
|
613
|
-
const
|
|
614
|
-
|
|
725
|
+
const o = t + this.COLLAPSED_EXPANDED_STATE, s = this.loadFromLocalStorage(o);
|
|
726
|
+
s && (this.collapsedExpandedState = s);
|
|
615
727
|
}
|
|
616
728
|
}
|
|
617
729
|
}
|
|
@@ -619,7 +731,7 @@ class le extends P {
|
|
|
619
731
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
620
732
|
}
|
|
621
733
|
}
|
|
622
|
-
class
|
|
734
|
+
class pe extends z {
|
|
623
735
|
constructor(e) {
|
|
624
736
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
625
737
|
}
|
|
@@ -634,95 +746,101 @@ class re extends P {
|
|
|
634
746
|
if (e) {
|
|
635
747
|
const t = e();
|
|
636
748
|
if (t) {
|
|
637
|
-
const
|
|
638
|
-
|
|
639
|
-
this.sortItems = i || [];
|
|
749
|
+
const o = t + this.SORTING_STATE, s = this.loadFromLocalStorage(o);
|
|
750
|
+
this.sortItems = s || [];
|
|
640
751
|
}
|
|
641
752
|
}
|
|
642
753
|
}
|
|
643
754
|
}
|
|
644
755
|
class T {
|
|
645
|
-
constructor(e = 0, t = 0,
|
|
646
|
-
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;
|
|
647
758
|
}
|
|
648
759
|
}
|
|
649
|
-
class
|
|
650
|
-
constructor(e, t,
|
|
651
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
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),
|
|
655
766
|
"position",
|
|
656
767
|
"relative"
|
|
657
|
-
), this.hoverRow =
|
|
658
|
-
|
|
659
|
-
), this.hoverColumn =
|
|
660
|
-
|
|
661
|
-
), this.
|
|
662
|
-
|
|
663
|
-
|
|
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")
|
|
664
777
|
)
|
|
665
|
-
), this.areaHeaderCenter =
|
|
666
|
-
|
|
667
|
-
|
|
778
|
+
), this.areaHeaderCenter = o.appendRelativeChildDiv(
|
|
779
|
+
o.applyStylePosistionAbsolute(
|
|
780
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-center", i, "header", "center")
|
|
668
781
|
)
|
|
669
|
-
), this.areaHeaderEast =
|
|
670
|
-
|
|
671
|
-
|
|
782
|
+
), this.areaHeaderEast = o.appendRelativeChildDiv(
|
|
783
|
+
o.applyStylePosistionAbsolute(
|
|
784
|
+
o.createAreaDivWithClass("ge-table-header ge-table-header-east", i, "body", "east")
|
|
672
785
|
)
|
|
673
|
-
), this.areaBodyWest =
|
|
674
|
-
|
|
675
|
-
|
|
786
|
+
), this.areaBodyWest = o.appendRelativeChildDiv(
|
|
787
|
+
o.applyStylePosistionAbsolute(
|
|
788
|
+
o.createAreaDivWithClass("ge-table-body ge-table-body-west", i, "body", "west")
|
|
676
789
|
)
|
|
677
|
-
), this.areaBodyEast =
|
|
678
|
-
|
|
679
|
-
|
|
790
|
+
), this.areaBodyEast = o.appendRelativeChildDiv(
|
|
791
|
+
o.applyStylePosistionAbsolute(
|
|
792
|
+
o.createAreaDivWithClass("ge-table-body ge-table-body-east", i, "body", "east")
|
|
680
793
|
)
|
|
681
|
-
), this.areaFooterWest =
|
|
682
|
-
|
|
683
|
-
|
|
794
|
+
), this.areaFooterWest = o.appendRelativeChildDiv(
|
|
795
|
+
o.applyStylePosistionAbsolute(
|
|
796
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-west", i, "footer", "west")
|
|
684
797
|
)
|
|
685
|
-
), this.areaFooterCenter =
|
|
686
|
-
|
|
687
|
-
|
|
798
|
+
), this.areaFooterCenter = o.appendRelativeChildDiv(
|
|
799
|
+
o.applyStylePosistionAbsolute(
|
|
800
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-center", i, "footer", "center")
|
|
688
801
|
)
|
|
689
|
-
), this.areaFooterEast =
|
|
690
|
-
|
|
691
|
-
|
|
802
|
+
), this.areaFooterEast = o.appendRelativeChildDiv(
|
|
803
|
+
o.applyStylePosistionAbsolute(
|
|
804
|
+
o.createAreaDivWithClass("ge-table-footer ge-table-footer-east", i, "footer", "east")
|
|
692
805
|
)
|
|
693
|
-
), this.scrollViewport =
|
|
806
|
+
), this.scrollViewport = o.applyStyleOverflowAuto(
|
|
694
807
|
this.tableOptions.overflowX ?? "auto",
|
|
695
808
|
this.tableOptions.overflowY ?? "auto",
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
809
|
+
o.applyStyleNoPadding(
|
|
810
|
+
o.applyStylePosistionAbsolute(
|
|
811
|
+
o.createAreaDivWithClass("ge-table-scroll-viewport", i, "body", "center")
|
|
699
812
|
)
|
|
700
813
|
)
|
|
701
|
-
), this.contentWrapperDiv =
|
|
702
|
-
|
|
703
|
-
|
|
814
|
+
), this.contentWrapperDiv = o.applyStyleNoPadding(
|
|
815
|
+
o.applyStylePosistionRelative(
|
|
816
|
+
o.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
704
817
|
)
|
|
705
|
-
), this.contentDiv =
|
|
706
|
-
|
|
707
|
-
|
|
818
|
+
), this.contentDiv = o.applyStyleNoPadding(
|
|
819
|
+
o.applyStylePosistionRelative(
|
|
820
|
+
o.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
708
821
|
)
|
|
709
|
-
), this.areaBodyCenter =
|
|
710
|
-
|
|
711
|
-
), this.borderHeaderBottom =
|
|
712
|
-
|
|
713
|
-
), this.borderFixedWest =
|
|
714
|
-
|
|
715
|
-
), this.borderFixedEast =
|
|
716
|
-
|
|
717
|
-
), this.borderFooterTop =
|
|
718
|
-
|
|
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)
|
|
719
832
|
);
|
|
720
833
|
}
|
|
834
|
+
/**
|
|
835
|
+
* Adjusts the containers and rows of the table based on the current state.
|
|
836
|
+
*
|
|
837
|
+
* @return {void}
|
|
838
|
+
*/
|
|
721
839
|
adjustContainersAndRows() {
|
|
722
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
840
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, o = this.hostElement.clientHeight;
|
|
723
841
|
this.dom.applyStyle(this.scrollViewport, {
|
|
724
842
|
width: `${t - e.left}px`,
|
|
725
|
-
height: `${
|
|
843
|
+
height: `${o - e.top}px`,
|
|
726
844
|
top: `${e.top}px`,
|
|
727
845
|
left: `${e.left}px`
|
|
728
846
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -730,21 +848,21 @@ class ne {
|
|
|
730
848
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
731
849
|
top: `${this.scrollTop}px`,
|
|
732
850
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
733
|
-
}), 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(
|
|
734
852
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
735
853
|
width: "1px",
|
|
736
854
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
737
855
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
738
856
|
left: `${this.areaBodyWestGeo.width}px`
|
|
739
857
|
})
|
|
740
|
-
) : 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(
|
|
741
859
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
742
860
|
width: "1px",
|
|
743
861
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
744
862
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
745
863
|
left: `${this.areaBodyEastGeo.left}px`
|
|
746
864
|
})
|
|
747
|
-
) : 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, {
|
|
748
866
|
width: `${t - e.left - e.right}px`,
|
|
749
867
|
height: `${e.top}px`,
|
|
750
868
|
top: "0",
|
|
@@ -769,35 +887,48 @@ class ne {
|
|
|
769
887
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
770
888
|
width: `${e.left}px`,
|
|
771
889
|
height: `${e.bottom}px`,
|
|
772
|
-
top: `${
|
|
890
|
+
top: `${o - e.bottom}px`,
|
|
773
891
|
left: "0"
|
|
774
892
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
775
893
|
width: `${t - e.left - e.right}px`,
|
|
776
894
|
height: `${e.bottom}px`,
|
|
777
|
-
top: `${
|
|
895
|
+
top: `${o - e.bottom}px`,
|
|
778
896
|
left: `${e.left}px`
|
|
779
897
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
780
898
|
width: `${e.right}px`,
|
|
781
899
|
height: `${e.bottom}px`,
|
|
782
|
-
top: `${
|
|
900
|
+
top: `${o - e.bottom}px`,
|
|
783
901
|
left: `${t - e.right}px`
|
|
784
902
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
785
903
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
786
904
|
width: `${t}px`,
|
|
787
905
|
height: "1px",
|
|
788
|
-
top: `${
|
|
906
|
+
top: `${o - e.bottom}px`,
|
|
789
907
|
left: "0px"
|
|
790
908
|
})
|
|
791
909
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
792
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
|
+
*/
|
|
793
917
|
adjustAfterScrolling() {
|
|
794
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
|
+
*/
|
|
795
926
|
resetSizeOfWrapperDiv() {
|
|
796
927
|
const e = `${this.tableModel.getContentWidthInPixel()}px`, t = `${this.tableModel.getContentHeightInPixel() + 1}px`;
|
|
797
928
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
798
929
|
}
|
|
799
930
|
}
|
|
800
|
-
class
|
|
931
|
+
class E {
|
|
801
932
|
/**
|
|
802
933
|
* Represents a constructor for a class.
|
|
803
934
|
* @constructor
|
|
@@ -807,11 +938,11 @@ class R {
|
|
|
807
938
|
* @param {number} c2 - The value for c2.
|
|
808
939
|
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
809
940
|
*/
|
|
810
|
-
constructor(e, t, s, i
|
|
811
|
-
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;
|
|
812
943
|
}
|
|
813
944
|
static create(e) {
|
|
814
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
945
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new E(
|
|
815
946
|
e.rowIndex1,
|
|
816
947
|
e.columnIndex1,
|
|
817
948
|
e.rowIndex2,
|
|
@@ -820,19 +951,19 @@ class R {
|
|
|
820
951
|
);
|
|
821
952
|
}
|
|
822
953
|
static singleCell(e, t) {
|
|
823
|
-
return new
|
|
954
|
+
return new E(e, t, e, t);
|
|
824
955
|
}
|
|
825
956
|
static singleRow(e) {
|
|
826
|
-
return new
|
|
957
|
+
return new E(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
827
958
|
}
|
|
828
959
|
static singleColumn(e) {
|
|
829
|
-
return new
|
|
960
|
+
return new E(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
830
961
|
}
|
|
831
962
|
isInRange(e, t) {
|
|
832
963
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
833
964
|
}
|
|
834
965
|
}
|
|
835
|
-
class
|
|
966
|
+
class ue {
|
|
836
967
|
constructor(e, t) {
|
|
837
968
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
838
969
|
}
|
|
@@ -841,14 +972,14 @@ class ae {
|
|
|
841
972
|
return;
|
|
842
973
|
this.colAndRowspanRanges = [];
|
|
843
974
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
844
|
-
for (let
|
|
845
|
-
for (let
|
|
846
|
-
let
|
|
847
|
-
if (
|
|
848
|
-
|
|
849
|
-
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;
|
|
850
981
|
this.colAndRowspanRanges.push(
|
|
851
|
-
new
|
|
982
|
+
new E(o, s, o + r - 1, s + i - 1, a)
|
|
852
983
|
);
|
|
853
984
|
}
|
|
854
985
|
}
|
|
@@ -858,58 +989,98 @@ class ae {
|
|
|
858
989
|
}
|
|
859
990
|
isInRange(e, t) {
|
|
860
991
|
if (this.colAndRowspanRanges) {
|
|
861
|
-
for (const
|
|
862
|
-
if (
|
|
992
|
+
for (const o of this.colAndRowspanRanges)
|
|
993
|
+
if (o.isInRange(e, t))
|
|
863
994
|
return !0;
|
|
864
995
|
}
|
|
865
996
|
return !1;
|
|
866
997
|
}
|
|
867
998
|
}
|
|
868
|
-
class
|
|
869
|
-
constructor(e, t,
|
|
870
|
-
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;
|
|
871
1002
|
}
|
|
872
1003
|
}
|
|
873
|
-
class
|
|
874
|
-
constructor(e, t,
|
|
875
|
-
var r,
|
|
876
|
-
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 = {
|
|
877
1008
|
header: [],
|
|
878
1009
|
body: [],
|
|
879
1010
|
footer: []
|
|
880
|
-
}, 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(
|
|
881
1012
|
(l) => {
|
|
882
|
-
var
|
|
883
|
-
this.colAndRowspanModels[l] = new
|
|
1013
|
+
var n;
|
|
1014
|
+
this.colAndRowspanModels[l] = new ue(t, t.getAreaModel(l)), (n = this.colAndRowspanModels[l]) == null || n.init();
|
|
884
1015
|
}
|
|
885
1016
|
);
|
|
886
1017
|
}
|
|
887
1018
|
isEditing() {
|
|
888
1019
|
return this.editing;
|
|
889
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
|
+
*/
|
|
890
1029
|
resetEditorRenderer() {
|
|
891
1030
|
this.editorRenderer = void 0, this.editorRendererRow = -1, this.editorRendererColumn = -1, this.editing = !1;
|
|
892
1031
|
}
|
|
893
|
-
|
|
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) {
|
|
894
1040
|
if (this.getSelectionModel) {
|
|
895
|
-
const
|
|
896
|
-
|
|
1041
|
+
const t = this.getSelectionModel();
|
|
1042
|
+
t == null || t.clear(), e && this.repaint();
|
|
897
1043
|
}
|
|
898
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
|
+
*/
|
|
899
1051
|
initRenderEditor(e, t) {
|
|
900
|
-
var
|
|
901
|
-
let
|
|
902
|
-
if (
|
|
903
|
-
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) {
|
|
904
1056
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
905
|
-
const
|
|
906
|
-
|
|
1057
|
+
const i = document.querySelector("input.ge-table-cell-editor-input");
|
|
1058
|
+
i && i.focus();
|
|
907
1059
|
} else
|
|
908
1060
|
this.resetEditorRenderer();
|
|
909
1061
|
}
|
|
1062
|
+
/**
|
|
1063
|
+
* Adjusts the content after scrolling and initiates a repaint of the component.
|
|
1064
|
+
*
|
|
1065
|
+
* @return {void}
|
|
1066
|
+
*/
|
|
910
1067
|
repaint() {
|
|
911
1068
|
this.adjustAfterScrolling();
|
|
912
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
|
+
*/
|
|
913
1084
|
adjustAfterScrolling() {
|
|
914
1085
|
var e;
|
|
915
1086
|
for (const t of this.removables)
|
|
@@ -932,25 +1103,86 @@ class he extends ne {
|
|
|
932
1103
|
"ge-table-body-west-vertical-border"
|
|
933
1104
|
));
|
|
934
1105
|
}
|
|
1106
|
+
/**
|
|
1107
|
+
* Checks if the scroll position should be saved and saves it.
|
|
1108
|
+
*
|
|
1109
|
+
* @return {void}
|
|
1110
|
+
*/
|
|
935
1111
|
checkForScrollPosSaving() {
|
|
936
1112
|
var e, t;
|
|
937
1113
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
938
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
|
+
*/
|
|
939
1123
|
updateCells(e, t = !1) {
|
|
940
1124
|
e.forEach(
|
|
941
|
-
(
|
|
942
|
-
this.tableModel.getAreaModel(
|
|
1125
|
+
(o) => {
|
|
1126
|
+
this.tableModel.getAreaModel(o.area).setValue(o.rowIndex, o.columnIndex, o.value), t || this.rerenderCellContent(o);
|
|
943
1127
|
}
|
|
944
1128
|
), t && this.repaint();
|
|
945
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
|
+
}
|
|
946
1169
|
getAreaAndSideIdentByAttr(e) {
|
|
947
1170
|
if (e) {
|
|
948
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
949
|
-
if (
|
|
950
|
-
return [t,
|
|
1171
|
+
const t = this.getStringByAttr(e, "data-area"), o = this.getStringByAttr(e, "data-side");
|
|
1172
|
+
if (o && t)
|
|
1173
|
+
return [t, o];
|
|
951
1174
|
}
|
|
952
1175
|
return [void 0, void 0];
|
|
953
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
|
+
*/
|
|
954
1186
|
getArea(e, t) {
|
|
955
1187
|
if (e === "header") {
|
|
956
1188
|
if (t === "west")
|
|
@@ -976,110 +1208,140 @@ class he extends ne {
|
|
|
976
1208
|
}
|
|
977
1209
|
throw Error(`Wrong area identifier: row:${e}, col:${t}`);
|
|
978
1210
|
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Adjusts the body of the table.
|
|
1213
|
+
*
|
|
1214
|
+
* @protected
|
|
1215
|
+
* @return {void}
|
|
1216
|
+
*/
|
|
979
1217
|
adjustBody() {
|
|
980
1218
|
const e = this.areaBodyCenterGeo.height - this.tableModel.getContentHeightInPixel(), t = this.scrollFactorY * e;
|
|
981
1219
|
this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
|
|
982
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
|
+
*/
|
|
983
1229
|
getNumberByAttr(e, t) {
|
|
984
|
-
var
|
|
1230
|
+
var o;
|
|
985
1231
|
if (e) {
|
|
986
|
-
const
|
|
987
|
-
if (
|
|
988
|
-
return Number(
|
|
1232
|
+
const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
|
|
1233
|
+
if (s)
|
|
1234
|
+
return Number(s);
|
|
989
1235
|
}
|
|
990
1236
|
return -1;
|
|
991
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
|
+
*/
|
|
992
1246
|
getStringByAttr(e, t) {
|
|
993
|
-
var
|
|
1247
|
+
var o;
|
|
994
1248
|
if (e) {
|
|
995
|
-
const
|
|
996
|
-
if (
|
|
997
|
-
return
|
|
1249
|
+
const s = (o = e.closest("[" + t + "]")) == null ? void 0 : o.getAttribute(t);
|
|
1250
|
+
if (s)
|
|
1251
|
+
return s;
|
|
998
1252
|
}
|
|
999
1253
|
return "";
|
|
1000
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
|
+
*/
|
|
1001
1263
|
adjustArea(e, t = 0) {
|
|
1002
|
-
var
|
|
1003
|
-
const
|
|
1004
|
-
|
|
1005
|
-
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();
|
|
1006
1268
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1007
|
-
const
|
|
1008
|
-
|
|
1269
|
+
const g = this.cleanupFunctions[e].shift();
|
|
1270
|
+
g && g();
|
|
1009
1271
|
}
|
|
1010
|
-
let
|
|
1011
|
-
const
|
|
1012
|
-
for (let
|
|
1013
|
-
const
|
|
1014
|
-
if (
|
|
1015
|
-
this.firstVisibleRowIndex =
|
|
1016
|
-
let
|
|
1017
|
-
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;
|
|
1018
1280
|
if (this.adjustColumnsToRowParent({
|
|
1019
1281
|
areaIdent: e,
|
|
1020
1282
|
sideIdent: "center",
|
|
1021
1283
|
areaModel: d,
|
|
1022
|
-
geo:
|
|
1023
|
-
parent:
|
|
1024
|
-
rowIndex:
|
|
1025
|
-
columnIndexStart:
|
|
1026
|
-
columnIndexEnd:
|
|
1284
|
+
geo: w,
|
|
1285
|
+
parent: y,
|
|
1286
|
+
rowIndex: g,
|
|
1287
|
+
columnIndexStart: R,
|
|
1288
|
+
columnIndexEnd: f - u - 1,
|
|
1027
1289
|
verticalFixed: !1,
|
|
1028
|
-
lastRowOfModel:
|
|
1029
|
-
}),
|
|
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({
|
|
1030
1292
|
areaIdent: e,
|
|
1031
1293
|
sideIdent: "west",
|
|
1032
1294
|
areaModel: d,
|
|
1033
|
-
geo:
|
|
1034
|
-
parent:
|
|
1035
|
-
rowIndex:
|
|
1295
|
+
geo: w,
|
|
1296
|
+
parent: y,
|
|
1297
|
+
rowIndex: g,
|
|
1036
1298
|
columnIndexStart: 0,
|
|
1037
|
-
columnIndexEnd:
|
|
1299
|
+
columnIndexEnd: R - 1,
|
|
1038
1300
|
verticalFixed: !0,
|
|
1039
|
-
lastRowOfModel:
|
|
1040
|
-
})),
|
|
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({
|
|
1041
1303
|
areaIdent: e,
|
|
1042
1304
|
sideIdent: "east",
|
|
1043
1305
|
areaModel: d,
|
|
1044
|
-
geo:
|
|
1045
|
-
parent:
|
|
1046
|
-
rowIndex:
|
|
1047
|
-
columnIndexStart:
|
|
1048
|
-
columnIndexEnd:
|
|
1306
|
+
geo: w,
|
|
1307
|
+
parent: y,
|
|
1308
|
+
rowIndex: g,
|
|
1309
|
+
columnIndexStart: f - u,
|
|
1310
|
+
columnIndexEnd: f - 1,
|
|
1049
1311
|
verticalFixed: !0,
|
|
1050
|
-
lastRowOfModel:
|
|
1051
|
-
})), e === "header" && this.tree &&
|
|
1312
|
+
lastRowOfModel: m
|
|
1313
|
+
})), e === "header" && this.tree && g === c - 1) {
|
|
1052
1314
|
const A = this.dom.applyStyle(
|
|
1053
1315
|
this.dom.setAttribute(
|
|
1054
|
-
this.dom.addDiv(
|
|
1316
|
+
this.dom.addDiv(y, new T(16, 20, 20, 8)),
|
|
1055
1317
|
"data-ge-action",
|
|
1056
1318
|
"toggleExpandCollapseAll"
|
|
1057
1319
|
),
|
|
1058
1320
|
{ cursor: "pointer" }
|
|
1059
1321
|
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1060
1322
|
if (M) {
|
|
1061
|
-
const
|
|
1062
|
-
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);
|
|
1063
1325
|
}
|
|
1064
1326
|
}
|
|
1065
1327
|
}
|
|
1066
|
-
if (
|
|
1328
|
+
if (h = h + x, h > r)
|
|
1067
1329
|
break;
|
|
1068
1330
|
}
|
|
1069
1331
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1070
|
-
const
|
|
1071
|
-
if (
|
|
1072
|
-
for (const
|
|
1073
|
-
let
|
|
1074
|
-
if (
|
|
1075
|
-
x =
|
|
1076
|
-
else if (
|
|
1077
|
-
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";
|
|
1078
1340
|
else {
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1341
|
+
const y = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1342
|
+
m = this.scrollFactorX * y - this.areaBodyWestGeo.width, w = "center";
|
|
1081
1343
|
}
|
|
1082
|
-
this.drawBigCell(
|
|
1344
|
+
this.drawBigCell(v, m, t, d, x, w);
|
|
1083
1345
|
}
|
|
1084
1346
|
}
|
|
1085
1347
|
}
|
|
@@ -1093,328 +1355,536 @@ class he extends ne {
|
|
|
1093
1355
|
* @param sideIdent SideIdent (west,center,east)
|
|
1094
1356
|
* @protected
|
|
1095
1357
|
*/
|
|
1096
|
-
drawBigCell(e, t, s, i,
|
|
1097
|
-
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();
|
|
1098
1360
|
let d = 0;
|
|
1099
|
-
|
|
1100
|
-
const
|
|
1101
|
-
let
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
areaModel:
|
|
1105
|
-
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,
|
|
1106
1368
|
sideIdent: r,
|
|
1107
1369
|
rowIndex: e.r1,
|
|
1108
1370
|
columnIndex: e.c1,
|
|
1109
|
-
left:
|
|
1110
|
-
top:
|
|
1111
|
-
width:
|
|
1112
|
-
height:
|
|
1113
|
-
parent:
|
|
1114
|
-
cellSelected:
|
|
1371
|
+
left: c,
|
|
1372
|
+
top: a,
|
|
1373
|
+
width: f,
|
|
1374
|
+
height: h,
|
|
1375
|
+
parent: i,
|
|
1376
|
+
cellSelected: u,
|
|
1115
1377
|
lastRowOfModel: !0,
|
|
1116
1378
|
gammaRange: e.gammaRange
|
|
1117
|
-
})
|
|
1118
|
-
areaModel:
|
|
1119
|
-
areaIdent:
|
|
1379
|
+
}) : this.renderCell({
|
|
1380
|
+
areaModel: s,
|
|
1381
|
+
areaIdent: s.areaIdent,
|
|
1120
1382
|
sideIdent: r,
|
|
1121
1383
|
rowIndex: e.r1,
|
|
1122
1384
|
columnIndex: e.c1,
|
|
1123
|
-
left:
|
|
1124
|
-
top:
|
|
1125
|
-
width:
|
|
1126
|
-
height:
|
|
1127
|
-
parent:
|
|
1128
|
-
cellSelected:
|
|
1385
|
+
left: c,
|
|
1386
|
+
top: a,
|
|
1387
|
+
width: f,
|
|
1388
|
+
height: h,
|
|
1389
|
+
parent: i,
|
|
1390
|
+
cellSelected: u,
|
|
1129
1391
|
lastRowOfModel: !0,
|
|
1130
1392
|
gammaRange: e.gammaRange
|
|
1131
|
-
}),
|
|
1393
|
+
}), s.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1132
1394
|
rowIndex: e.r1,
|
|
1133
1395
|
columnIndex: e.c1,
|
|
1134
|
-
cellLeft:
|
|
1135
|
-
cellTop:
|
|
1136
|
-
cellWidth:
|
|
1137
|
-
cellHeight:
|
|
1138
|
-
parent:
|
|
1396
|
+
cellLeft: c,
|
|
1397
|
+
cellTop: a,
|
|
1398
|
+
cellWidth: f,
|
|
1399
|
+
cellHeight: h,
|
|
1400
|
+
parent: i
|
|
1139
1401
|
});
|
|
1140
1402
|
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
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)
|
|
1148
1419
|
return -1;
|
|
1149
1420
|
}
|
|
1150
1421
|
return -1;
|
|
1151
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
|
+
*/
|
|
1152
1430
|
adjustColumnsToRowParent({
|
|
1153
1431
|
areaIdent: e,
|
|
1154
1432
|
sideIdent: t,
|
|
1155
|
-
areaModel:
|
|
1156
|
-
geo:
|
|
1157
|
-
parent:
|
|
1433
|
+
areaModel: o,
|
|
1434
|
+
geo: s,
|
|
1435
|
+
parent: i,
|
|
1158
1436
|
rowIndex: r,
|
|
1159
|
-
columnIndexStart:
|
|
1437
|
+
columnIndexStart: a,
|
|
1160
1438
|
columnIndexEnd: l,
|
|
1161
|
-
verticalFixed:
|
|
1439
|
+
verticalFixed: n = !1,
|
|
1162
1440
|
lastRowOfModel: d = !1
|
|
1163
1441
|
}) {
|
|
1164
|
-
var
|
|
1442
|
+
var S;
|
|
1165
1443
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1166
|
-
let
|
|
1167
|
-
if (!
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1444
|
+
let c = 0;
|
|
1445
|
+
if (!n) {
|
|
1446
|
+
const b = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1447
|
+
c = this.scrollFactorX * b;
|
|
1170
1448
|
}
|
|
1171
|
-
const
|
|
1172
|
-
let
|
|
1173
|
-
for (let
|
|
1174
|
-
const
|
|
1175
|
-
if (
|
|
1176
|
-
let
|
|
1177
|
-
const x =
|
|
1178
|
-
x > 1 && (
|
|
1179
|
-
let
|
|
1180
|
-
|
|
1181
|
-
let
|
|
1182
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1183
|
-
this.renderDragTargetDiv(
|
|
1184
|
-
const A = { left:
|
|
1185
|
-
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);
|
|
1186
1464
|
} else {
|
|
1187
|
-
const A = this.renderSelectedBackgroundDiv(
|
|
1188
|
-
|
|
1189
|
-
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,
|
|
1190
1468
|
areaIdent: e,
|
|
1191
1469
|
sideIdent: t,
|
|
1192
1470
|
rowIndex: r,
|
|
1193
|
-
columnIndex:
|
|
1194
|
-
left:
|
|
1195
|
-
top:
|
|
1196
|
-
width:
|
|
1197
|
-
height:
|
|
1198
|
-
parent:
|
|
1471
|
+
columnIndex: b,
|
|
1472
|
+
left: g,
|
|
1473
|
+
top: h,
|
|
1474
|
+
width: y,
|
|
1475
|
+
height: m,
|
|
1476
|
+
parent: i,
|
|
1199
1477
|
cellSelected: A,
|
|
1200
1478
|
lastRowOfModel: d,
|
|
1201
1479
|
gammaRange: !0
|
|
1202
1480
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1203
1481
|
rowIndex: r,
|
|
1204
|
-
columnIndex:
|
|
1205
|
-
cellLeft:
|
|
1206
|
-
cellTop:
|
|
1207
|
-
cellWidth:
|
|
1208
|
-
cellHeight:
|
|
1209
|
-
parent:
|
|
1482
|
+
columnIndex: b,
|
|
1483
|
+
cellLeft: g,
|
|
1484
|
+
cellTop: h,
|
|
1485
|
+
cellWidth: y,
|
|
1486
|
+
cellHeight: m,
|
|
1487
|
+
parent: i
|
|
1210
1488
|
});
|
|
1211
1489
|
}
|
|
1212
1490
|
}
|
|
1213
|
-
if (
|
|
1491
|
+
if (u = u + v, u > this.areaBodyCenterGeo.width)
|
|
1214
1492
|
break;
|
|
1215
1493
|
}
|
|
1216
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(
|
|
1494
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(u - 1, 1, s.height, 0), i);
|
|
1217
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
|
+
*/
|
|
1218
1505
|
getTreeArrowColumnIndex() {
|
|
1219
1506
|
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
1220
1507
|
}
|
|
1221
1508
|
addAndRenderCellDiv({
|
|
1222
1509
|
areaModel: e,
|
|
1223
1510
|
areaIdent: t,
|
|
1224
|
-
sideIdent:
|
|
1225
|
-
rowIndex:
|
|
1226
|
-
index:
|
|
1511
|
+
sideIdent: o,
|
|
1512
|
+
rowIndex: s,
|
|
1513
|
+
index: i,
|
|
1227
1514
|
left: r,
|
|
1228
|
-
width:
|
|
1515
|
+
width: a,
|
|
1229
1516
|
height: l,
|
|
1230
|
-
top:
|
|
1517
|
+
top: n,
|
|
1231
1518
|
parent: d,
|
|
1232
|
-
lastRowOfModel:
|
|
1233
|
-
gammaRange: g
|
|
1519
|
+
lastRowOfModel: c
|
|
1234
1520
|
}) {
|
|
1235
|
-
var
|
|
1236
|
-
const
|
|
1237
|
-
let
|
|
1238
|
-
if (
|
|
1239
|
-
const
|
|
1240
|
-
(
|
|
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";
|
|
1241
1527
|
}
|
|
1242
|
-
let
|
|
1528
|
+
let v;
|
|
1243
1529
|
if (t === "header") {
|
|
1244
|
-
const
|
|
1245
|
-
(!(
|
|
1530
|
+
const C = this.tableModel.getColumnDef(i);
|
|
1531
|
+
(!(C != null && C.sortIconVisible) || C != null && C.sortIconVisible()) && (v = C == null ? void 0 : C.sortState);
|
|
1246
1532
|
}
|
|
1247
|
-
const
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
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, {});
|
|
1269
1557
|
}
|
|
1270
|
-
t === "header" && this.dom.setAttribute(
|
|
1271
|
-
const
|
|
1272
|
-
if (
|
|
1273
|
-
for (const
|
|
1274
|
-
this.dom.setStyle(
|
|
1275
|
-
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];
|
|
1276
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
|
+
*/
|
|
1277
1572
|
applyCssClasses(e, t = {}) {
|
|
1278
|
-
e && Object.entries(t).forEach(([
|
|
1279
|
-
|
|
1573
|
+
e && Object.entries(t).forEach(([o, s]) => {
|
|
1574
|
+
s ? this.dom.addClass(o, e) : this.dom.removeClass(o, e);
|
|
1280
1575
|
});
|
|
1281
1576
|
}
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
const h = `${i}`;
|
|
1291
|
-
this.dom.addLabelDiv(l, h, !1, t, s, e);
|
|
1292
|
-
}
|
|
1293
|
-
const g = r.getCustomClassesAt(t, s);
|
|
1294
|
-
g.length && this.dom.addClasses(g, l);
|
|
1295
|
-
const m = r.getCustomStyleAt(t, s);
|
|
1296
|
-
if (m)
|
|
1297
|
-
for (const h in m)
|
|
1298
|
-
this.dom.setStyle(l, h, m[h]);
|
|
1299
|
-
}
|
|
1300
|
-
}
|
|
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
|
+
*/
|
|
1301
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) {
|
|
1302
1600
|
const s = [];
|
|
1303
1601
|
for (let i = e; i <= t; i++)
|
|
1304
|
-
s.push(
|
|
1602
|
+
s.push(o.getRowHeight(i));
|
|
1305
1603
|
return s;
|
|
1306
1604
|
}
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
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
|
+
*/
|
|
1313
1612
|
adjustHoverRows(e) {
|
|
1314
1613
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1315
|
-
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;
|
|
1316
1615
|
this.dom.applyStyle(this.hoverRow, {
|
|
1317
1616
|
left: "0",
|
|
1318
|
-
top:
|
|
1617
|
+
top: s + "px",
|
|
1319
1618
|
width: t + "px",
|
|
1320
|
-
height:
|
|
1619
|
+
height: o + "px",
|
|
1321
1620
|
display: "block"
|
|
1322
1621
|
});
|
|
1323
1622
|
} else
|
|
1324
1623
|
this.hideHoverRow();
|
|
1325
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
|
+
*/
|
|
1326
1635
|
hideHoverRow() {
|
|
1327
1636
|
this.dom.applyStyle(this.hoverRow, {
|
|
1328
1637
|
display: "none"
|
|
1329
1638
|
});
|
|
1330
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
|
+
*/
|
|
1331
1645
|
adjustHoverColumns(e) {
|
|
1332
1646
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1333
|
-
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;
|
|
1334
1648
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1335
|
-
left:
|
|
1649
|
+
left: i + "px",
|
|
1336
1650
|
top: "0px",
|
|
1337
|
-
width:
|
|
1651
|
+
width: o + "px",
|
|
1338
1652
|
height: t + "px",
|
|
1339
1653
|
display: "block"
|
|
1340
1654
|
});
|
|
1341
1655
|
} else
|
|
1342
1656
|
this.hideHoverColumn();
|
|
1343
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
|
+
*/
|
|
1344
1667
|
hideHoverColumn() {
|
|
1345
1668
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1346
1669
|
display: "none"
|
|
1347
1670
|
});
|
|
1348
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
|
+
*/
|
|
1349
1680
|
debounce(e, t = 1e3) {
|
|
1350
1681
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1351
1682
|
}
|
|
1352
|
-
|
|
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) {
|
|
1353
1775
|
const r = this.dom.applyStylePosistionAbsolute(
|
|
1354
1776
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1355
1777
|
);
|
|
1356
|
-
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
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(
|
|
1367
1806
|
// ge-table-body-west-selected-range
|
|
1368
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
1807
|
+
this.dom.createDivWithClass(`ge-table-${s.areaIdent}-${o}-selected-range`, a)
|
|
1369
1808
|
);
|
|
1370
|
-
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`);
|
|
1371
1810
|
}
|
|
1372
1811
|
}
|
|
1373
1812
|
}
|
|
1374
|
-
return
|
|
1813
|
+
return h;
|
|
1375
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
|
+
*/
|
|
1376
1834
|
renderCell({
|
|
1377
1835
|
areaModel: e,
|
|
1378
1836
|
areaIdent: t,
|
|
1379
|
-
sideIdent:
|
|
1380
|
-
rowIndex:
|
|
1381
|
-
columnIndex:
|
|
1837
|
+
sideIdent: o,
|
|
1838
|
+
rowIndex: s,
|
|
1839
|
+
columnIndex: i,
|
|
1382
1840
|
left: r,
|
|
1383
|
-
top:
|
|
1841
|
+
top: a,
|
|
1384
1842
|
width: l,
|
|
1385
|
-
height:
|
|
1843
|
+
height: n,
|
|
1386
1844
|
parent: d,
|
|
1387
|
-
cellSelected:
|
|
1388
|
-
lastRowOfModel:
|
|
1389
|
-
gammaRange: m
|
|
1845
|
+
cellSelected: c,
|
|
1846
|
+
lastRowOfModel: h
|
|
1390
1847
|
}) {
|
|
1391
|
-
const [
|
|
1848
|
+
const [f, u] = this.addAndRenderCellDiv({
|
|
1392
1849
|
areaModel: e,
|
|
1393
1850
|
areaIdent: t,
|
|
1394
|
-
sideIdent:
|
|
1395
|
-
rowIndex:
|
|
1396
|
-
index:
|
|
1851
|
+
sideIdent: o,
|
|
1852
|
+
rowIndex: s,
|
|
1853
|
+
index: i,
|
|
1397
1854
|
left: r,
|
|
1398
1855
|
width: l,
|
|
1399
|
-
height:
|
|
1400
|
-
top:
|
|
1856
|
+
height: n,
|
|
1857
|
+
top: a,
|
|
1401
1858
|
parent: d,
|
|
1402
|
-
lastRowOfModel:
|
|
1403
|
-
gammaRange: m
|
|
1859
|
+
lastRowOfModel: h
|
|
1404
1860
|
});
|
|
1405
|
-
|
|
1861
|
+
c && this.dom.addClass(`ge-table-${t}-${o}-selected-range`, f), u && this.cleanupFunctions[t].push(u);
|
|
1406
1862
|
}
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
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);
|
|
1410
1880
|
}
|
|
1411
1881
|
}
|
|
1412
|
-
class
|
|
1882
|
+
class me {
|
|
1413
1883
|
constructor(e, t) {
|
|
1414
1884
|
this.columnIndex = e, this.sortState = t;
|
|
1415
1885
|
}
|
|
1416
1886
|
}
|
|
1417
|
-
class
|
|
1887
|
+
class ye {
|
|
1418
1888
|
constructor(e) {
|
|
1419
1889
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1420
1890
|
}
|
|
@@ -1428,52 +1898,52 @@ class pe {
|
|
|
1428
1898
|
*/
|
|
1429
1899
|
onHostElementChanged(e) {
|
|
1430
1900
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1431
|
-
const t = e.target,
|
|
1432
|
-
if (
|
|
1433
|
-
const r =
|
|
1434
|
-
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);
|
|
1435
1905
|
}
|
|
1436
1906
|
}
|
|
1437
1907
|
}
|
|
1438
1908
|
}
|
|
1439
|
-
class
|
|
1909
|
+
class ve {
|
|
1440
1910
|
constructor(e = -1, t = -1) {
|
|
1441
1911
|
this.rowIndex = e, this.columnIndex = t;
|
|
1442
1912
|
}
|
|
1443
1913
|
}
|
|
1444
|
-
class
|
|
1914
|
+
class N {
|
|
1445
1915
|
constructor(e) {
|
|
1446
1916
|
this.cells = e;
|
|
1447
1917
|
}
|
|
1448
1918
|
static createSingle(e, t) {
|
|
1449
|
-
return new
|
|
1919
|
+
return new N([new ve(e, t)]);
|
|
1450
1920
|
}
|
|
1451
1921
|
}
|
|
1452
|
-
class
|
|
1922
|
+
class we {
|
|
1453
1923
|
constructor(e) {
|
|
1454
|
-
var t,
|
|
1455
|
-
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);
|
|
1456
1926
|
}
|
|
1457
1927
|
onMouseClicked(e, t) {
|
|
1458
|
-
var
|
|
1459
|
-
let
|
|
1928
|
+
var i, r, a, l, n, d, c;
|
|
1929
|
+
let o = !1, s = !1;
|
|
1460
1930
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1461
|
-
const
|
|
1462
|
-
|
|
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));
|
|
1463
1933
|
}
|
|
1464
|
-
return
|
|
1934
|
+
return s ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), o;
|
|
1465
1935
|
}
|
|
1466
1936
|
onActionTriggered(e) {
|
|
1467
1937
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1468
|
-
const t = this.getSelectionModel(),
|
|
1469
|
-
if (t &&
|
|
1938
|
+
const t = this.getSelectionModel(), o = this.getFocusModel();
|
|
1939
|
+
if (t && o) {
|
|
1470
1940
|
if (e === "SELECT_ALL")
|
|
1471
1941
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1472
1942
|
if (e === "DESELECT_ALL")
|
|
1473
1943
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
1474
1944
|
if (e === "TOGGLE_SELECTION") {
|
|
1475
|
-
const [
|
|
1476
|
-
return t.togglePoint(
|
|
1945
|
+
const [s, i] = o.getFocus();
|
|
1946
|
+
return t.togglePoint(s, i), this.tableScope.repaint(), !0;
|
|
1477
1947
|
}
|
|
1478
1948
|
}
|
|
1479
1949
|
}
|
|
@@ -1481,16 +1951,16 @@ class Se {
|
|
|
1481
1951
|
}
|
|
1482
1952
|
createRangeByEvents(e, t) {
|
|
1483
1953
|
t || (t = e);
|
|
1484
|
-
const
|
|
1485
|
-
return
|
|
1486
|
-
rowIndex1:
|
|
1487
|
-
columnIndex1:
|
|
1488
|
-
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,
|
|
1489
1959
|
columnIndex2: r
|
|
1490
1960
|
});
|
|
1491
1961
|
}
|
|
1492
1962
|
}
|
|
1493
|
-
class
|
|
1963
|
+
class Ce {
|
|
1494
1964
|
get() {
|
|
1495
1965
|
return {
|
|
1496
1966
|
f2: "START_EDITING",
|
|
@@ -1500,43 +1970,60 @@ class ge {
|
|
|
1500
1970
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
1501
1971
|
"ctrl+x": "DESELECT_ALL",
|
|
1502
1972
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
1503
|
-
"
|
|
1973
|
+
"meta -": "DESELECT_ALL",
|
|
1504
1974
|
arrowup: "NAVIGATE_UP",
|
|
1505
1975
|
arrowdown: "NAVIGATE_DOWN",
|
|
1506
1976
|
arrowleft: "NAVIGATE_LEFT",
|
|
1507
|
-
arrowright: "NAVIGATE_RIGHT"
|
|
1977
|
+
arrowright: "NAVIGATE_RIGHT",
|
|
1978
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
1979
|
+
"ctrl+c": "COPY_2_CLIPBOARD"
|
|
1508
1980
|
};
|
|
1509
1981
|
}
|
|
1510
1982
|
}
|
|
1511
|
-
class
|
|
1983
|
+
class xe {
|
|
1512
1984
|
get() {
|
|
1513
1985
|
return {
|
|
1514
1986
|
f2: "START_EDITING",
|
|
1515
1987
|
space: "TOGGLE_SELECTION",
|
|
1516
1988
|
"ctrl+num_add": "SELECT_ALL",
|
|
1517
|
-
"
|
|
1989
|
+
"meta+a": "SELECT_ALL",
|
|
1518
1990
|
"ctrl+a": "SELECT_ALL",
|
|
1519
|
-
"
|
|
1520
|
-
"
|
|
1991
|
+
"meta+x": "DESELECT_ALL",
|
|
1992
|
+
"meta+shift+a": "DESELECT_ALL",
|
|
1521
1993
|
"ctrl+shift+a": "DESELECT_ALL",
|
|
1522
1994
|
"ctrl+num_subtract": "DESELECT_ALL",
|
|
1523
1995
|
"ctrl -": "DESELECT_ALL",
|
|
1524
1996
|
arrowup: "NAVIGATE_UP",
|
|
1525
1997
|
arrowdown: "NAVIGATE_DOWN",
|
|
1526
1998
|
arrowleft: "NAVIGATE_LEFT",
|
|
1527
|
-
arrowright: "NAVIGATE_RIGHT"
|
|
1999
|
+
arrowright: "NAVIGATE_RIGHT",
|
|
2000
|
+
"meta+c": "COPY_2_CLIPBOARD",
|
|
2001
|
+
"ctrl+c": "COPY_2_CLIPBOARD"
|
|
1528
2002
|
};
|
|
1529
2003
|
}
|
|
1530
2004
|
}
|
|
1531
|
-
class
|
|
2005
|
+
class Ee {
|
|
1532
2006
|
constructor(e) {
|
|
1533
2007
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1534
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
|
+
*/
|
|
1535
2015
|
addListener(e) {
|
|
1536
2016
|
this.listener.includes(e) || this.listener.push(e);
|
|
1537
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
|
+
*/
|
|
1538
2022
|
init() {
|
|
1539
|
-
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());
|
|
1540
2027
|
}
|
|
1541
2028
|
isMacintosh() {
|
|
1542
2029
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1548,30 +2035,30 @@ class fe {
|
|
|
1548
2035
|
return location.hostname === "localhost" || location.hostname === "127.0.0.1";
|
|
1549
2036
|
}
|
|
1550
2037
|
onKeyDown(e) {
|
|
1551
|
-
const t = this.
|
|
2038
|
+
const t = this.findEntity(e);
|
|
1552
2039
|
t && this.emit(t) && (e.preventDefault(), e.stopPropagation());
|
|
1553
2040
|
}
|
|
1554
2041
|
emit(e) {
|
|
1555
|
-
this.isDebug() && console.debug("ShortcutService emit:", e);
|
|
2042
|
+
this.isDebug() && console.debug("ShortcutService emit :", e);
|
|
1556
2043
|
let t = !1;
|
|
1557
|
-
for (const
|
|
1558
|
-
|
|
2044
|
+
for (const o of this.listener)
|
|
2045
|
+
o.onActionTriggered(e) && (t = !0);
|
|
1559
2046
|
return t;
|
|
1560
2047
|
}
|
|
1561
|
-
|
|
2048
|
+
findEntity(e) {
|
|
1562
2049
|
const t = this.getTokenByEvent(e);
|
|
1563
|
-
this.isDebug() && console.debug("ShortcutService tokens:", t);
|
|
1564
|
-
for (const
|
|
1565
|
-
const
|
|
1566
|
-
if (this.areTokensEquals(t,
|
|
1567
|
-
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];
|
|
1568
2055
|
}
|
|
1569
2056
|
}
|
|
1570
2057
|
areTokensEquals(e, t) {
|
|
1571
2058
|
if (e.length !== t.length || e.length === 0)
|
|
1572
2059
|
return !1;
|
|
1573
|
-
for (let
|
|
1574
|
-
if (e[
|
|
2060
|
+
for (let o = 0; o < e.length; o++)
|
|
2061
|
+
if (e[o] !== t[o])
|
|
1575
2062
|
return !1;
|
|
1576
2063
|
return !0;
|
|
1577
2064
|
}
|
|
@@ -1579,8 +2066,16 @@ class fe {
|
|
|
1579
2066
|
const t = [];
|
|
1580
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();
|
|
1581
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
|
+
}
|
|
1582
2077
|
}
|
|
1583
|
-
class
|
|
2078
|
+
class K {
|
|
1584
2079
|
onCheckboxChanged(e) {
|
|
1585
2080
|
}
|
|
1586
2081
|
onContextmenu(e) {
|
|
@@ -1595,20 +2090,24 @@ class N {
|
|
|
1595
2090
|
}
|
|
1596
2091
|
onMouseMoved(e) {
|
|
1597
2092
|
}
|
|
2093
|
+
onSelectionChanged(e) {
|
|
2094
|
+
}
|
|
2095
|
+
onFocusChanged(e) {
|
|
2096
|
+
}
|
|
1598
2097
|
}
|
|
1599
|
-
class
|
|
1600
|
-
setStyle(e, t,
|
|
1601
|
-
return e.style[t] =
|
|
2098
|
+
class Z {
|
|
2099
|
+
setStyle(e, t, o) {
|
|
2100
|
+
return e.style[t] = o, e;
|
|
1602
2101
|
}
|
|
1603
2102
|
appendText(e, t) {
|
|
1604
|
-
const
|
|
1605
|
-
return this.appendChild(e,
|
|
2103
|
+
const o = this.createText(t);
|
|
2104
|
+
return this.appendChild(e, o), o;
|
|
1606
2105
|
}
|
|
1607
2106
|
addClass(e, t) {
|
|
1608
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2107
|
+
return t.includes(" ") ? t.split(" ").forEach((o) => e.classList.add(o)) : e.classList.add(t), e;
|
|
1609
2108
|
}
|
|
1610
2109
|
removeClass(e, t) {
|
|
1611
|
-
return t.includes(" ") ? t.split(" ").forEach((
|
|
2110
|
+
return t.includes(" ") ? t.split(" ").forEach((o) => e.classList.remove(o)) : e.classList.remove(t), e;
|
|
1612
2111
|
}
|
|
1613
2112
|
appendChild(e, t) {
|
|
1614
2113
|
e.appendChild(t);
|
|
@@ -1619,15 +2118,15 @@ class K {
|
|
|
1619
2118
|
createText(e) {
|
|
1620
2119
|
return document.createTextNode(e);
|
|
1621
2120
|
}
|
|
1622
|
-
setAttribute(e, t,
|
|
1623
|
-
e.setAttribute(t,
|
|
2121
|
+
setAttribute(e, t, o) {
|
|
2122
|
+
e.setAttribute(t, o);
|
|
1624
2123
|
}
|
|
1625
2124
|
}
|
|
1626
|
-
class
|
|
1627
|
-
render(e, t, s, i,
|
|
1628
|
-
if (
|
|
1629
|
-
|
|
1630
|
-
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);
|
|
1631
2130
|
e.innerHTML = `
|
|
1632
2131
|
<input
|
|
1633
2132
|
type="text"
|
|
@@ -1635,28 +2134,31 @@ class be {
|
|
|
1635
2134
|
autofocus
|
|
1636
2135
|
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1637
2136
|
data-listen="change"
|
|
1638
|
-
data-area="${
|
|
2137
|
+
data-area="${s}"
|
|
1639
2138
|
data-row-index="${t}"
|
|
1640
|
-
data-col-index="${
|
|
2139
|
+
data-col-index="${o}"
|
|
1641
2140
|
data-input-type="text"
|
|
1642
2141
|
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1643
2142
|
class="ge-table-cell-editor-input">`;
|
|
1644
2143
|
}
|
|
1645
2144
|
}
|
|
1646
2145
|
}
|
|
1647
|
-
class
|
|
2146
|
+
class Me {
|
|
1648
2147
|
constructor(e = "none", t = "single") {
|
|
1649
2148
|
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1650
2149
|
}
|
|
2150
|
+
firstClick(e, t) {
|
|
2151
|
+
this.selectionType === "row" ? this.addRange(E.singleRow(e)) : this.selectionType === "column" && this.addRange(E.singleColumn(t));
|
|
2152
|
+
}
|
|
1651
2153
|
getSelectionCount(e, t) {
|
|
1652
|
-
let
|
|
1653
|
-
for (const
|
|
1654
|
-
|
|
1655
|
-
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;
|
|
1656
2158
|
}
|
|
1657
2159
|
isInNegativeRange(e, t) {
|
|
1658
|
-
for (const
|
|
1659
|
-
if (
|
|
2160
|
+
for (const o of this.negativeRanges)
|
|
2161
|
+
if (o.isInRange(e, t))
|
|
1660
2162
|
return !0;
|
|
1661
2163
|
return !1;
|
|
1662
2164
|
}
|
|
@@ -1667,11 +2169,29 @@ class ye {
|
|
|
1667
2169
|
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1668
2170
|
}
|
|
1669
2171
|
hasSelection() {
|
|
1670
|
-
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);
|
|
1671
2188
|
}
|
|
1672
2189
|
selectAll() {
|
|
1673
2190
|
this.allSelected = !0;
|
|
1674
2191
|
}
|
|
2192
|
+
isAllSelected() {
|
|
2193
|
+
return this.allSelected;
|
|
2194
|
+
}
|
|
1675
2195
|
addSelection(e) {
|
|
1676
2196
|
this.addRange(e);
|
|
1677
2197
|
}
|
|
@@ -1679,16 +2199,19 @@ class ye {
|
|
|
1679
2199
|
if (this.selectionType === "none")
|
|
1680
2200
|
return;
|
|
1681
2201
|
let t = e;
|
|
1682
|
-
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);
|
|
1683
2203
|
}
|
|
1684
2204
|
togglePoint(e, t) {
|
|
1685
|
-
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;
|
|
1686
2209
|
}
|
|
1687
2210
|
addRange(e) {
|
|
1688
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));
|
|
1689
2212
|
}
|
|
1690
2213
|
}
|
|
1691
|
-
class
|
|
2214
|
+
class Re {
|
|
1692
2215
|
constructor(e = "none") {
|
|
1693
2216
|
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1694
2217
|
}
|
|
@@ -1711,29 +2234,128 @@ class ve {
|
|
|
1711
2234
|
return [this.rowIndex, this.columnIndex];
|
|
1712
2235
|
}
|
|
1713
2236
|
}
|
|
1714
|
-
|
|
1715
|
-
|
|
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 {
|
|
1716
2253
|
constructor() {
|
|
1717
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 = {
|
|
1718
2255
|
header: 34,
|
|
1719
2256
|
body: 34,
|
|
1720
2257
|
footer: 34
|
|
1721
|
-
}, 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;
|
|
1722
2259
|
}
|
|
1723
2260
|
}
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
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;
|
|
1727
2349
|
if (super(
|
|
1728
2350
|
e,
|
|
1729
2351
|
t,
|
|
1730
|
-
new
|
|
1731
|
-
|
|
1732
|
-
), this.eventListener =
|
|
1733
|
-
const
|
|
1734
|
-
|
|
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)));
|
|
1735
2357
|
}
|
|
1736
|
-
this.mouseHandler = new
|
|
2358
|
+
this.mouseHandler = new ne(this), this.inputHandler = new ye(this), this.shortcutService = new Ee(this), this.shortcutService.addListener(this.selectionService);
|
|
1737
2359
|
}
|
|
1738
2360
|
/**
|
|
1739
2361
|
* Creates a TableScope instance.
|
|
@@ -1743,33 +2365,47 @@ class _ extends he {
|
|
|
1743
2365
|
* @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
|
|
1744
2366
|
* @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
|
|
1745
2367
|
* @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
|
|
2368
|
+
* @param {CopyServiceIf} [copyService=new CopyService()] - The optional copy service object.
|
|
1746
2369
|
*
|
|
1747
2370
|
* @return {TableScope} - The newly created TableScope instance.
|
|
1748
2371
|
*/
|
|
1749
|
-
static create(e, t, s = new
|
|
1750
|
-
return new
|
|
2372
|
+
static create(e, t, o = new te(), s = new K(), i = new Z(), r = new L()) {
|
|
2373
|
+
return new j(
|
|
1751
2374
|
e,
|
|
1752
2375
|
t,
|
|
2376
|
+
i,
|
|
1753
2377
|
o,
|
|
1754
2378
|
s,
|
|
1755
|
-
|
|
2379
|
+
r
|
|
1756
2380
|
);
|
|
1757
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
|
+
*/
|
|
1758
2390
|
onActionTriggered(e) {
|
|
1759
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))
|
|
1760
2392
|
return !0;
|
|
1761
2393
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
1762
2394
|
const t = this.getFocusModel();
|
|
1763
2395
|
if (t) {
|
|
1764
|
-
const [
|
|
1765
|
-
this.tableModel.getBodyModel().isEditable(
|
|
2396
|
+
const [o, s] = t.getFocus();
|
|
2397
|
+
this.tableModel.getBodyModel().isEditable(o, s) && (this.clearSelection(), this.initRenderEditor(o, s));
|
|
1766
2398
|
}
|
|
1767
2399
|
return !0;
|
|
1768
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
|
+
}
|
|
1769
2405
|
return !1;
|
|
1770
2406
|
}
|
|
1771
|
-
updateModelValueAfterEdit(e, t,
|
|
1772
|
-
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());
|
|
1773
2409
|
}
|
|
1774
2410
|
/**
|
|
1775
2411
|
* Retrieves the TableApi object.
|
|
@@ -1798,16 +2434,16 @@ class _ extends he {
|
|
|
1798
2434
|
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
1799
2435
|
*/
|
|
1800
2436
|
createGeMouseEvent(e) {
|
|
1801
|
-
const t = new
|
|
2437
|
+
const t = new _();
|
|
1802
2438
|
if (t.originalEvent = e, e) {
|
|
1803
|
-
const
|
|
1804
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
1805
|
-
const
|
|
1806
|
-
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);
|
|
1807
2443
|
}
|
|
1808
2444
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
1809
|
-
const
|
|
1810
|
-
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);
|
|
1811
2447
|
}
|
|
1812
2448
|
}
|
|
1813
2449
|
return t;
|
|
@@ -1819,15 +2455,16 @@ class _ extends he {
|
|
|
1819
2455
|
* @return {void}
|
|
1820
2456
|
*/
|
|
1821
2457
|
onMouseDown(e) {
|
|
1822
|
-
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));
|
|
1823
2459
|
}
|
|
1824
2460
|
/**
|
|
1825
2461
|
* Handles mouse dragging on the frame.
|
|
1826
2462
|
*
|
|
1827
2463
|
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
2464
|
+
* @param startMouseEvent
|
|
1828
2465
|
*/
|
|
1829
|
-
mouseDraggingOnFrame(e) {
|
|
1830
|
-
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());
|
|
1831
2468
|
}
|
|
1832
2469
|
/**
|
|
1833
2470
|
* Handles the end of mouse dragging event on a frame.
|
|
@@ -1837,7 +2474,7 @@ class _ extends he {
|
|
|
1837
2474
|
* @returns {void}
|
|
1838
2475
|
*/
|
|
1839
2476
|
mouseDraggingEndOnFrame(e) {
|
|
1840
|
-
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 = "";
|
|
1841
2478
|
}
|
|
1842
2479
|
/**
|
|
1843
2480
|
* Handles the mouse move event.
|
|
@@ -1865,9 +2502,9 @@ class _ extends he {
|
|
|
1865
2502
|
* @return {void}
|
|
1866
2503
|
*/
|
|
1867
2504
|
toggleExpandCollapseAll(e = !0) {
|
|
1868
|
-
var
|
|
2505
|
+
var o;
|
|
1869
2506
|
const t = this.tableModel.getBodyModel();
|
|
1870
|
-
|
|
2507
|
+
W(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (o = this.storeStateCollapsedExpandService) == null || o.collapsedStateAll(e));
|
|
1871
2508
|
}
|
|
1872
2509
|
/**
|
|
1873
2510
|
* Toggles the checkbox state of a specific row in a table.
|
|
@@ -1878,12 +2515,12 @@ class _ extends he {
|
|
|
1878
2515
|
*
|
|
1879
2516
|
* @return {void} - This method does not return anything.
|
|
1880
2517
|
*/
|
|
1881
|
-
toggleRowCheckbox(e, t,
|
|
2518
|
+
toggleRowCheckbox(e, t, o) {
|
|
1882
2519
|
var l;
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
-
const
|
|
1886
|
-
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 || []);
|
|
1887
2524
|
}
|
|
1888
2525
|
/**
|
|
1889
2526
|
* Handle mouse click events.
|
|
@@ -1893,12 +2530,25 @@ class _ extends he {
|
|
|
1893
2530
|
* @returns {void}
|
|
1894
2531
|
*/
|
|
1895
2532
|
onMouseClicked(e, t) {
|
|
1896
|
-
let
|
|
1897
|
-
if (!
|
|
1898
|
-
|
|
1899
|
-
|
|
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());
|
|
1900
2538
|
}
|
|
1901
|
-
|
|
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);
|
|
1902
2552
|
}
|
|
1903
2553
|
/**
|
|
1904
2554
|
* Updates the table (repaint) when an external filter is changed.
|
|
@@ -1919,15 +2569,73 @@ class _ extends he {
|
|
|
1919
2569
|
*
|
|
1920
2570
|
* @return {void}
|
|
1921
2571
|
*/
|
|
1922
|
-
onHeaderDblClicked(e, t,
|
|
1923
|
-
var
|
|
1924
|
-
const
|
|
1925
|
-
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()) {
|
|
1926
2576
|
e.preventDefault(), e.stopPropagation();
|
|
1927
|
-
const
|
|
1928
|
-
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]);
|
|
1929
2579
|
}
|
|
1930
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
|
+
}
|
|
1931
2639
|
/**
|
|
1932
2640
|
* Changes the focus cell using the specified deltas.
|
|
1933
2641
|
*
|
|
@@ -1937,10 +2645,10 @@ class _ extends he {
|
|
|
1937
2645
|
*/
|
|
1938
2646
|
changeFocusCell(e, t) {
|
|
1939
2647
|
if (!this.isEditing() && this.getFocusModel) {
|
|
1940
|
-
const
|
|
1941
|
-
if (
|
|
1942
|
-
const [
|
|
1943
|
-
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;
|
|
1944
2652
|
}
|
|
1945
2653
|
}
|
|
1946
2654
|
return !1;
|
|
@@ -1963,22 +2671,20 @@ class _ extends he {
|
|
|
1963
2671
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
1964
2672
|
}
|
|
1965
2673
|
debugOnce(e, t) {
|
|
1966
|
-
var
|
|
1967
|
-
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);
|
|
1968
2676
|
}
|
|
1969
2677
|
/**
|
|
1970
2678
|
* Restores the scroll position of the table if auto restore options are enabled.
|
|
1971
2679
|
*
|
|
1972
|
-
* @private
|
|
1973
|
-
* @memberof ClassName
|
|
1974
2680
|
*
|
|
1975
2681
|
* @returns {void}
|
|
1976
2682
|
*/
|
|
1977
2683
|
autoRestoreScrollPosition() {
|
|
1978
2684
|
var e;
|
|
1979
2685
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
1980
|
-
const
|
|
1981
|
-
|
|
2686
|
+
const o = this.storeScrollPosStateService.getScrollOffset();
|
|
2687
|
+
o && this.scrollViewport.scrollTo(...o);
|
|
1982
2688
|
}
|
|
1983
2689
|
}
|
|
1984
2690
|
/**
|
|
@@ -1998,8 +2704,8 @@ class _ extends he {
|
|
|
1998
2704
|
autoRestoreSortingState() {
|
|
1999
2705
|
var e, t;
|
|
2000
2706
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
2001
|
-
const
|
|
2002
|
-
|
|
2707
|
+
const o = this.storeSortingService.getSortItems();
|
|
2708
|
+
o != null && o.length && this.tableModel.getBodyModel().doSort(o);
|
|
2003
2709
|
}
|
|
2004
2710
|
}
|
|
2005
2711
|
/**
|
|
@@ -2011,82 +2717,369 @@ class _ extends he {
|
|
|
2011
2717
|
autoRestoreCollapsedExpandedState() {
|
|
2012
2718
|
var e, t;
|
|
2013
2719
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
2014
|
-
const
|
|
2015
|
-
if (
|
|
2016
|
-
const
|
|
2017
|
-
if (
|
|
2018
|
-
const
|
|
2019
|
-
for (let
|
|
2020
|
-
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);
|
|
2021
2727
|
if (d)
|
|
2022
|
-
if (
|
|
2728
|
+
if (i.allExpanded)
|
|
2023
2729
|
d.expanded = !0;
|
|
2024
|
-
else if (
|
|
2730
|
+
else if (i.allCollapsed)
|
|
2025
2731
|
d.expanded = !1;
|
|
2026
2732
|
else {
|
|
2027
|
-
const
|
|
2028
|
-
|
|
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));
|
|
2029
2735
|
}
|
|
2030
2736
|
}
|
|
2031
|
-
|
|
2737
|
+
a.recalcVisibleTreeRows();
|
|
2032
2738
|
}
|
|
2033
2739
|
}
|
|
2034
2740
|
}
|
|
2035
2741
|
}
|
|
2036
2742
|
}
|
|
2037
|
-
|
|
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, "");
|
|
2991
|
+
}
|
|
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
|
+
}
|
|
3017
|
+
}
|
|
3018
|
+
};
|
|
3019
|
+
B.toggleHeaderGroup = "toggleHeaderGroup";
|
|
3020
|
+
let q = B;
|
|
3021
|
+
function Fe({
|
|
2038
3022
|
tableModel: p,
|
|
2039
|
-
tableOptions: e = new
|
|
3023
|
+
tableOptions: e = new te(),
|
|
2040
3024
|
mouseMoved: t,
|
|
2041
|
-
checkboxChanged:
|
|
2042
|
-
contextmenu:
|
|
2043
|
-
modelChanged:
|
|
3025
|
+
checkboxChanged: o,
|
|
3026
|
+
contextmenu: s,
|
|
3027
|
+
modelChanged: i,
|
|
2044
3028
|
mouseClicked: r,
|
|
2045
|
-
mouseDragging:
|
|
3029
|
+
mouseDragging: a,
|
|
2046
3030
|
mouseDraggingEnd: l,
|
|
2047
|
-
|
|
3031
|
+
selectionChanged: n,
|
|
3032
|
+
focusChanged: d,
|
|
3033
|
+
tableReady: c,
|
|
3034
|
+
licenseKey: h
|
|
2048
3035
|
}) {
|
|
2049
|
-
const
|
|
2050
|
-
let
|
|
2051
|
-
|
|
2052
|
-
|
|
3036
|
+
const f = se(null);
|
|
3037
|
+
let u = !1;
|
|
3038
|
+
ie(() => {
|
|
3039
|
+
f.current && !u && (S(f.current), u = !0);
|
|
2053
3040
|
});
|
|
2054
|
-
const
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2057
|
-
|
|
3041
|
+
const S = (b) => {
|
|
3042
|
+
const g = {
|
|
3043
|
+
onSelectionChanged(m) {
|
|
3044
|
+
n && n(m);
|
|
3045
|
+
},
|
|
3046
|
+
onFocusChanged(m) {
|
|
3047
|
+
d && d(m);
|
|
2058
3048
|
},
|
|
2059
|
-
|
|
2060
|
-
|
|
3049
|
+
onCheckboxChanged: (m) => {
|
|
3050
|
+
o && o(m);
|
|
2061
3051
|
},
|
|
2062
|
-
|
|
2063
|
-
|
|
3052
|
+
onContextmenu: (m) => {
|
|
3053
|
+
s && s(m);
|
|
2064
3054
|
},
|
|
2065
|
-
|
|
2066
|
-
|
|
3055
|
+
onModelChanged: (m) => {
|
|
3056
|
+
i && i(m);
|
|
2067
3057
|
},
|
|
2068
|
-
|
|
2069
|
-
|
|
3058
|
+
onMouseClicked: (m) => {
|
|
3059
|
+
r && r(m);
|
|
2070
3060
|
},
|
|
2071
|
-
|
|
2072
|
-
|
|
3061
|
+
onMouseDragging: (m) => {
|
|
3062
|
+
a && a(m);
|
|
2073
3063
|
},
|
|
2074
|
-
|
|
2075
|
-
|
|
3064
|
+
onMouseDraggingEnd: (m) => {
|
|
3065
|
+
l && l(m);
|
|
3066
|
+
},
|
|
3067
|
+
onMouseMoved: (m) => {
|
|
3068
|
+
t && t(m);
|
|
2076
3069
|
}
|
|
2077
|
-
},
|
|
2078
|
-
|
|
3070
|
+
}, v = new j(
|
|
3071
|
+
b,
|
|
2079
3072
|
p,
|
|
2080
|
-
new
|
|
3073
|
+
new Z(),
|
|
2081
3074
|
e,
|
|
2082
|
-
|
|
3075
|
+
g
|
|
2083
3076
|
);
|
|
2084
|
-
|
|
3077
|
+
v.firstInit(), c && c(v.getApi()), h && k.getInstance().setLicenseKey(h);
|
|
2085
3078
|
};
|
|
2086
|
-
return /* @__PURE__ */
|
|
3079
|
+
return /* @__PURE__ */ oe(
|
|
2087
3080
|
"div",
|
|
2088
3081
|
{
|
|
2089
|
-
ref:
|
|
3082
|
+
ref: f,
|
|
2090
3083
|
className: "container-div",
|
|
2091
3084
|
style: {
|
|
2092
3085
|
width: "100%",
|
|
@@ -2098,39 +3091,39 @@ function Re({
|
|
|
2098
3091
|
}
|
|
2099
3092
|
);
|
|
2100
3093
|
}
|
|
2101
|
-
var
|
|
3094
|
+
var G, F = re;
|
|
2102
3095
|
if (process.env.NODE_ENV === "production")
|
|
2103
|
-
|
|
3096
|
+
G = F.createRoot, F.hydrateRoot;
|
|
2104
3097
|
else {
|
|
2105
|
-
var
|
|
2106
|
-
|
|
2107
|
-
|
|
3098
|
+
var U = F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
3099
|
+
G = function(p, e) {
|
|
3100
|
+
U.usingClientEntryPoint = !0;
|
|
2108
3101
|
try {
|
|
2109
3102
|
return F.createRoot(p, e);
|
|
2110
3103
|
} finally {
|
|
2111
|
-
|
|
3104
|
+
U.usingClientEntryPoint = !1;
|
|
2112
3105
|
}
|
|
2113
3106
|
};
|
|
2114
3107
|
}
|
|
2115
|
-
class
|
|
3108
|
+
class Le {
|
|
2116
3109
|
constructor(e) {
|
|
2117
3110
|
this.Component = e, console.info(e);
|
|
2118
3111
|
}
|
|
2119
|
-
render(e, t, s, i,
|
|
3112
|
+
render(e, t, o, s, i, r, a) {
|
|
2120
3113
|
const l = {
|
|
2121
3114
|
cellDiv: e,
|
|
2122
3115
|
rowIndex: t,
|
|
2123
|
-
columnIndex:
|
|
2124
|
-
areaIdent:
|
|
2125
|
-
areaModel:
|
|
3116
|
+
columnIndex: o,
|
|
3117
|
+
areaIdent: s,
|
|
3118
|
+
areaModel: i,
|
|
2126
3119
|
cellValue: r
|
|
2127
|
-
},
|
|
2128
|
-
return
|
|
2129
|
-
|
|
3120
|
+
}, n = G(e, {});
|
|
3121
|
+
return n.render(this.Component(l)), () => {
|
|
3122
|
+
n.unmount();
|
|
2130
3123
|
};
|
|
2131
3124
|
}
|
|
2132
3125
|
}
|
|
2133
3126
|
export {
|
|
2134
|
-
|
|
2135
|
-
|
|
3127
|
+
Le as ComponentRendererWrapper,
|
|
3128
|
+
Fe as GuiexpertTable
|
|
2136
3129
|
};
|