@guiexpert/react-table 1.0.4 → 1.0.6
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/README.md +14 -15
- package/index.cjs +7 -7
- package/index.js +960 -878
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx as q } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as U, useEffect as J } from "react";
|
|
3
|
+
import Q from "react-dom";
|
|
4
|
+
function O(p) {
|
|
5
|
+
return p && p.type === "TreeRow";
|
|
6
|
+
}
|
|
7
|
+
function $(p) {
|
|
8
|
+
return p && p.type === "AreaModelTree";
|
|
9
|
+
}
|
|
10
|
+
class W {
|
|
11
|
+
constructor(e = -1, t = -1, s = -1, i = -1, o, r, n, l = 0, a = 0, d = 0, S = "") {
|
|
12
|
+
this.rowIndex = e, this.rowTop = t, this.columnIndex = s, this.columnLeft = i, this.areaIdent = o, this.sideIdent = r, this.originalEvent = n, this.clickCount = l, this.draggingX = a, this.draggingY = d, this.action = S;
|
|
7
13
|
}
|
|
8
14
|
clone() {
|
|
9
|
-
return new
|
|
15
|
+
return new W(
|
|
10
16
|
this.rowIndex,
|
|
11
17
|
this.rowTop,
|
|
12
18
|
this.columnIndex,
|
|
@@ -21,47 +27,47 @@ class P {
|
|
|
21
27
|
);
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
|
-
class
|
|
25
|
-
constructor(e = ">", t = "",
|
|
26
|
-
this.content = e, this.style = t, this.classes =
|
|
30
|
+
class D {
|
|
31
|
+
constructor(e = ">", t = "", s = []) {
|
|
32
|
+
this.content = e, this.style = t, this.classes = s;
|
|
27
33
|
}
|
|
28
34
|
}
|
|
29
|
-
class
|
|
30
|
-
constructor(e = new
|
|
35
|
+
class X {
|
|
36
|
+
constructor(e = new D(
|
|
31
37
|
">",
|
|
32
38
|
"transform: rotate(90deg) translate(66%, -66%); transform-origin: 0 0;",
|
|
33
39
|
["gt-table-tree-arrow-expanded"]
|
|
34
|
-
), t = new
|
|
40
|
+
), t = new D(
|
|
35
41
|
">",
|
|
36
42
|
"",
|
|
37
43
|
["ge-table-tree-arrow-collapsed"]
|
|
38
|
-
),
|
|
44
|
+
), s = new D(
|
|
39
45
|
">",
|
|
40
46
|
"color:transparent;",
|
|
41
47
|
["gt-table-tree-arrow-hidden"]
|
|
42
|
-
),
|
|
48
|
+
), i = new D(
|
|
43
49
|
"↕",
|
|
44
50
|
"",
|
|
45
51
|
["gt-table-tree-arrow-expanded-all"]
|
|
46
52
|
)) {
|
|
47
|
-
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder =
|
|
53
|
+
this.arrowExpanded = e, this.arrowCollapsed = t, this.arrowPlaceholder = s, this.arrowExpandCollapseAll = i;
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
|
-
class
|
|
51
|
-
constructor(e = new
|
|
52
|
-
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder =
|
|
56
|
+
class z {
|
|
57
|
+
constructor(e = new D("↑", "", ["ge-header-sorted-asc"]), t = new D("↓", "", ["ge-header-sorted-desc"]), s = new D("↑", "color:transparent;", [])) {
|
|
58
|
+
this.iconAsc = e, this.iconDesc = t, this.iconPlaceholder = s;
|
|
53
59
|
}
|
|
54
60
|
}
|
|
55
|
-
class
|
|
61
|
+
class Z {
|
|
56
62
|
constructor(e) {
|
|
57
63
|
this.domService = e;
|
|
58
64
|
}
|
|
59
|
-
setStyle(e, t,
|
|
60
|
-
return this.domService.setStyle(e, t,
|
|
65
|
+
setStyle(e, t, s) {
|
|
66
|
+
return this.domService.setStyle(e, t, s), e;
|
|
61
67
|
}
|
|
62
68
|
applyStyle(e, t) {
|
|
63
|
-
for (const
|
|
64
|
-
this.domService.setStyle(e,
|
|
69
|
+
for (const s in t)
|
|
70
|
+
this.domService.setStyle(e, s, t[s]);
|
|
65
71
|
return e;
|
|
66
72
|
}
|
|
67
73
|
applyDisplayNoneStyle(e) {
|
|
@@ -71,7 +77,7 @@ class Y {
|
|
|
71
77
|
return this.domService.setStyle(e, "display", "block"), e;
|
|
72
78
|
}
|
|
73
79
|
applyStyleInPx(e, t) {
|
|
74
|
-
return Object.entries(t).forEach(([
|
|
80
|
+
return Object.entries(t).forEach(([s, i]) => this.domService.setStyle(e, s, i + "px")), e;
|
|
75
81
|
}
|
|
76
82
|
applyStylePosistionRelative(e) {
|
|
77
83
|
return this.domService.setStyle(e, "position", "relative"), this.domService.setStyle(e, "overflow", "clip"), e;
|
|
@@ -82,8 +88,8 @@ class Y {
|
|
|
82
88
|
applyStyleFullSize(e) {
|
|
83
89
|
return this.domService.setStyle(e, "width", "100%"), this.domService.setStyle(e, "height", "100%"), e;
|
|
84
90
|
}
|
|
85
|
-
applyStyleOverflowAuto(e = "auto", t = "auto",
|
|
86
|
-
return this.domService.setStyle(
|
|
91
|
+
applyStyleOverflowAuto(e = "auto", t = "auto", s) {
|
|
92
|
+
return this.domService.setStyle(s, "overflow-x", e), this.domService.setStyle(s, "overflow-y", t), s;
|
|
87
93
|
}
|
|
88
94
|
applyStyleNoPadding(e) {
|
|
89
95
|
return this.domService.setStyle(e, "padding", "0"), this.domService.setStyle(e, "margin", "0"), this.domService.setStyle(e, "border", "0"), e;
|
|
@@ -99,194 +105,212 @@ class Y {
|
|
|
99
105
|
return this.domService.appendChild(e, t), this.applyStylePosistionAbsolute(e), { parent: e, child: t, cache: {} };
|
|
100
106
|
}
|
|
101
107
|
appendText(e, t) {
|
|
102
|
-
const
|
|
103
|
-
return this.domService.appendChild(e,
|
|
108
|
+
const s = this.domService.createText(t);
|
|
109
|
+
return this.domService.appendChild(e, s), s;
|
|
104
110
|
}
|
|
105
111
|
addClass(e, t) {
|
|
106
|
-
return e.includes(" ") ? e.split(" ").forEach((
|
|
112
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.addClass(t, s)) : this.domService.addClass(t, e), t;
|
|
113
|
+
}
|
|
114
|
+
removeClass(e, t) {
|
|
115
|
+
return e.includes(" ") ? e.split(" ").forEach((s) => this.domService.removeClass(t, s)) : this.domService.removeClass(t, e), t;
|
|
107
116
|
}
|
|
108
117
|
addClasses(e, t) {
|
|
109
118
|
if (e)
|
|
110
|
-
for (const
|
|
111
|
-
this.domService.addClass(t,
|
|
119
|
+
for (const s of e)
|
|
120
|
+
this.domService.addClass(t, s);
|
|
112
121
|
return t;
|
|
113
122
|
}
|
|
114
|
-
setAttribute(e, t,
|
|
115
|
-
return t &&
|
|
123
|
+
setAttribute(e, t, s) {
|
|
124
|
+
return t && s && this.domService.setAttribute(e, t, s), e;
|
|
116
125
|
}
|
|
117
|
-
createAreaDivWithClass(e, t,
|
|
126
|
+
createAreaDivWithClass(e, t, s, i) {
|
|
118
127
|
const o = this.domService.createElement("div");
|
|
119
|
-
return this.addClass(e, o), this.domService.setAttribute(o, "data-area",
|
|
128
|
+
return this.addClass(e, o), this.domService.setAttribute(o, "data-area", s), this.domService.setAttribute(o, "data-side", i), this.domService.appendChild(t, o), o;
|
|
120
129
|
}
|
|
121
130
|
createDivWithClass(e, t) {
|
|
122
|
-
const
|
|
123
|
-
return this.addClass(e,
|
|
131
|
+
const s = this.domService.createElement("div");
|
|
132
|
+
return this.addClass(e, s), this.domService.appendChild(t, s), s;
|
|
124
133
|
}
|
|
125
|
-
addRowDiv(e, t,
|
|
134
|
+
addRowDiv(e, t, s = -1, i, o, r = "") {
|
|
126
135
|
const n = t.index ?? -1, l = this.getDivOrCreateDiv(n, e);
|
|
127
|
-
if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`),
|
|
136
|
+
if (this.domService.addClass(l, "ge-table-row-div"), this.domService.addClass(l, `ge-table-row-div-${t.index}`), i === "body" && o === "center") {
|
|
128
137
|
const a = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
129
138
|
this.domService.addClass(l, `ge-table-row-${a}`);
|
|
130
139
|
}
|
|
131
|
-
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", `${
|
|
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", `${s}`), this.domService.setAttribute(l, "data-area", `${i}`), r) {
|
|
132
141
|
const a = this.domService.createText(r);
|
|
133
142
|
this.domService.appendChild(l, a);
|
|
134
143
|
}
|
|
135
144
|
return this.domService.appendChild(e.child, l), l;
|
|
136
145
|
}
|
|
137
|
-
addColumnDiv(e, t,
|
|
138
|
-
const g = a == null ? void 0 : a.treeOptions,
|
|
139
|
-
this.domService.addClass(
|
|
140
|
-
const
|
|
141
|
-
if (o === "body" && r === "center" && this.domService.addClass(
|
|
142
|
-
const
|
|
143
|
-
this.addLabelDiv(
|
|
146
|
+
addColumnDiv(e, t, s = -1, i = -1, o, r, n = "", l, a, d = void 0, S) {
|
|
147
|
+
const g = a == null ? void 0 : a.treeOptions, m = a == null ? void 0 : a.showCheckboxWihoutExtraColumn, h = this.domService.createElement("div");
|
|
148
|
+
this.domService.addClass(h, "ge-table-col-div"), this.domService.addClass(h, `ge-table-col-div-${t.index}`), this.domService.setAttribute(h, "data-col-index", `${t.index}`), this.domService.setAttribute(h, "data-row-index", `${s}`), this.domService.setAttribute(h, "data-area", `${o}`);
|
|
149
|
+
const f = ((t == null ? void 0 : t.index) ?? 0) % 2 === 0 ? "even" : "odd";
|
|
150
|
+
if (o === "body" && r === "center" && this.domService.addClass(h, `ge-table-column-${f}`), this.domService.setStyle(h, "display", "clip"), this.domService.setStyle(h, "position", "absolute"), this.domService.setStyle(h, "left", `${t.left}px`), this.domService.setStyle(h, "top", `${t.top}px`), this.domService.setStyle(h, "width", `${t.width}px`), this.domService.setStyle(h, "height", `${t.height}px`), l && l !== "none" && (this.domService.addClass(h, "ge-table-col-tree"), this.addArrowDiv(h, l, g, s, i, o)), m && i === 0 && d && this.addCheckboxToDiv(h, d, o, s), n) {
|
|
151
|
+
const c = l !== "none" && i === 0;
|
|
152
|
+
this.addLabelDiv(h, n, c, s, i, o);
|
|
144
153
|
}
|
|
145
|
-
return S && this.addSortedIcon(
|
|
154
|
+
return S && this.addSortedIcon(h, S, a == null ? void 0 : a.sortedOptions, i), this.domService.appendChild(e, h), h;
|
|
146
155
|
}
|
|
147
|
-
addCheckboxToDiv(e, t,
|
|
156
|
+
addCheckboxToDiv(e, t, s, i) {
|
|
148
157
|
const o = this.domService.createElement("div"), r = t === "full" ? "checked" : "";
|
|
149
158
|
return o.innerHTML = `
|
|
150
159
|
<input
|
|
151
160
|
type="checkbox"
|
|
152
|
-
data-area="${
|
|
153
|
-
data-row-index="${
|
|
161
|
+
data-area="${s}"
|
|
162
|
+
data-row-index="${i}"
|
|
154
163
|
data-input-type="checkbox"
|
|
155
164
|
${r}
|
|
156
|
-
class="ge-table-row-checkbox"> `, this.domService.setStyle(o, "display", "inline"), this.domService.setStyle(o, "width", "inherit"), this.domService.setAttribute(o, "data-row-index", `${
|
|
165
|
+
class="ge-table-row-checkbox"> `, this.domService.setStyle(o, "display", "inline"), this.domService.setStyle(o, "width", "inherit"), this.domService.setAttribute(o, "data-row-index", `${i}`), this.domService.appendChild(e, o), o;
|
|
157
166
|
}
|
|
158
|
-
addLabelDiv(e, t = "",
|
|
167
|
+
addLabelDiv(e, t = "", s = !1, i = -1, o = -1, r = "body") {
|
|
159
168
|
const n = this.domService.createElement("div");
|
|
160
|
-
if (this.domService.addClass(n, "ge-table-label-div"), this.domService.setStyle(n, "position", "relative"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "width", "100%"), this.domService.setStyle(n, "height", "100%"), this.domService.setAttribute(n, "data-row-index", `${
|
|
161
|
-
if (
|
|
169
|
+
if (this.domService.addClass(n, "ge-table-label-div"), this.domService.setStyle(n, "position", "relative"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "width", "100%"), this.domService.setStyle(n, "height", "100%"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`), t)
|
|
170
|
+
if (s) {
|
|
162
171
|
const l = this.domService.createText(t);
|
|
163
172
|
this.domService.appendChild(n, l);
|
|
164
173
|
} else {
|
|
165
174
|
const l = this.domService.createElement("div");
|
|
166
175
|
this.domService.appendChild(n, l);
|
|
167
176
|
const a = this.domService.createText(t);
|
|
168
|
-
this.domService.addClass(l, "ge-table-label"), this.domService.appendChild(l, a), this.domService.setAttribute(l, "data-row-index", `${
|
|
177
|
+
this.domService.addClass(l, "ge-table-label"), this.domService.appendChild(l, a), this.domService.setAttribute(l, "data-row-index", `${i}`), this.domService.setAttribute(l, "data-col-index", `${o}`), this.domService.setAttribute(l, "data-area", `${r}`);
|
|
169
178
|
}
|
|
170
179
|
return this.domService.appendChild(e, n), n;
|
|
171
180
|
}
|
|
172
|
-
addSortedIcon(e, t = "",
|
|
181
|
+
addSortedIcon(e, t = "", s = new z(), i = -1) {
|
|
173
182
|
const o = this.domService.createElement("div");
|
|
174
|
-
this.domService.addClass(o, "ge-table-sorted-icon-div"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "top", "0"), this.domService.setStyle(o, "right", "0"), this.domService.setStyle(o, "width", "20px"), this.domService.setStyle(o, "background", "transparent"), this.domService.setStyle(o, "cursor", "pointer"), this.domService.setAttribute(o, "data-col-index", `${
|
|
183
|
+
this.domService.addClass(o, "ge-table-sorted-icon-div"), this.domService.setStyle(o, "position", "absolute"), this.domService.setStyle(o, "top", "0"), this.domService.setStyle(o, "right", "0"), this.domService.setStyle(o, "width", "20px"), this.domService.setStyle(o, "background", "transparent"), this.domService.setStyle(o, "cursor", "pointer"), this.domService.setAttribute(o, "data-col-index", `${i}`), this.domService.setAttribute(o, "data-area", "header");
|
|
175
184
|
let r;
|
|
176
|
-
t === "asc" ? r =
|
|
185
|
+
t === "asc" ? r = s.iconAsc : t === "desc" ? r = s.iconDesc : r = s.iconPlaceholder;
|
|
177
186
|
const n = r.content, l = this.domService.createText(n);
|
|
178
187
|
this.domService.appendChild(o, l), r.style && this.applyStyleString(o, r.style);
|
|
179
188
|
for (const a of r.classes)
|
|
180
189
|
this.domService.addClass(o, a);
|
|
181
190
|
return this.domService.appendChild(e, o), o;
|
|
182
191
|
}
|
|
183
|
-
addArrowDiv(e, t = "none",
|
|
192
|
+
addArrowDiv(e, t = "none", s = new X(), i = -1, o = -1, r = "body") {
|
|
184
193
|
const n = this.domService.createElement("div");
|
|
185
|
-
this.domService.addClass(n, "ge-table-tree-arrow-div"), this.domService.setStyle(n, "display", "inline-block"), this.domService.setStyle(n, "position", ""), this.domService.setStyle(n, "width", "20px"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "cursor", "pointer"), this.domService.setAttribute(n, "data-row-index", `${
|
|
194
|
+
this.domService.addClass(n, "ge-table-tree-arrow-div"), this.domService.setStyle(n, "display", "inline-block"), this.domService.setStyle(n, "position", ""), this.domService.setStyle(n, "width", "20px"), this.domService.setStyle(n, "background", "transparent"), this.domService.setStyle(n, "cursor", "pointer"), this.domService.setAttribute(n, "data-row-index", `${i}`), this.domService.setAttribute(n, "data-col-index", `${o}`), this.domService.setAttribute(n, "data-area", `${r}`);
|
|
186
195
|
let l;
|
|
187
|
-
t === "expanded" ? l =
|
|
196
|
+
t === "expanded" ? l = s.arrowExpanded : t === "collapsed" ? l = s.arrowCollapsed : l = s.arrowPlaceholder;
|
|
188
197
|
const a = l.content, d = this.domService.createText(a);
|
|
189
198
|
this.domService.appendChild(n, d), l.style && this.applyStyleString(n, l.style);
|
|
190
199
|
for (const S of l.classes)
|
|
191
200
|
this.domService.addClass(n, S);
|
|
192
201
|
return this.domService.appendChild(e, n), n;
|
|
193
202
|
}
|
|
194
|
-
addColumnBorderDivs(e, t,
|
|
203
|
+
addColumnBorderDivs(e, t, s, i, o) {
|
|
195
204
|
if (e.verticalBorderVisible) {
|
|
196
|
-
const r = `ge-table-${
|
|
197
|
-
this.addVerticalBorder(
|
|
205
|
+
const r = `ge-table-${i}-${o}-vertical-border`;
|
|
206
|
+
this.addVerticalBorder(s, t, r);
|
|
198
207
|
}
|
|
199
208
|
if (e.horizontalBorderVisible) {
|
|
200
|
-
const r = `ge-table-${
|
|
201
|
-
this.addHorizontalBorder(
|
|
209
|
+
const r = `ge-table-${i}-${o}-horizontal-border`;
|
|
210
|
+
this.addHorizontalBorder(s, t, r);
|
|
202
211
|
}
|
|
203
212
|
return t;
|
|
204
213
|
}
|
|
205
|
-
addHorizontalBorder(e, t,
|
|
206
|
-
const
|
|
207
|
-
return this.domService.addClass(
|
|
214
|
+
addHorizontalBorder(e, t, s = "ge-table-body-center-horizontal-border") {
|
|
215
|
+
const i = this.domService.createElement("div");
|
|
216
|
+
return this.domService.addClass(i, s), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${e.left}px`), this.domService.setStyle(i, "top", `${e.top}px`), this.domService.setStyle(i, "width", `${e.width}px`), this.domService.setStyle(i, "height", "1px"), this.domService.appendChild(t, i), i;
|
|
208
217
|
}
|
|
209
|
-
addFocusBorderDivs(e, t,
|
|
210
|
-
let
|
|
211
|
-
return this.domService.addClass(
|
|
218
|
+
addFocusBorderDivs(e, t, s) {
|
|
219
|
+
let i = this.domService.createElement("div");
|
|
220
|
+
return this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", "1px"), this.domService.setStyle(i, "height", `${t.height}px`), this.applyStyle(i, s), this.domService.appendChild(e, i), i = this.domService.createElement("div"), this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left + t.width - 1}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", "1px"), this.domService.setStyle(i, "height", `${t.height}px`), this.applyStyle(i, s), this.domService.appendChild(e, i), i = this.domService.createElement("div"), this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", `${t.width}px`), this.domService.setStyle(i, "height", "1px"), this.applyStyle(i, s), this.domService.appendChild(e, i), i = this.domService.createElement("div"), this.domService.addClass(i, "ge-table-focus-border"), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top + t.height - 1}px`), this.domService.setStyle(i, "width", `${t.width}px`), this.domService.setStyle(i, "height", "1px"), this.applyStyle(i, s), this.domService.appendChild(e, i), e;
|
|
212
221
|
}
|
|
213
|
-
addVerticalBorder(e, t,
|
|
214
|
-
const
|
|
215
|
-
return this.domService.addClass(
|
|
222
|
+
addVerticalBorder(e, t, s = "ge-table-body-center-vertical-border") {
|
|
223
|
+
const i = this.domService.createElement("div");
|
|
224
|
+
return this.domService.addClass(i, s), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${e.left}px`), this.domService.setStyle(i, "top", `${e.top}px`), this.domService.setStyle(i, "width", "1px"), this.domService.setStyle(i, "height", `${e.height}px`), this.domService.appendChild(t, i), i;
|
|
216
225
|
}
|
|
217
|
-
addDiv(e, t,
|
|
218
|
-
const
|
|
219
|
-
return
|
|
226
|
+
addDiv(e, t, s = "") {
|
|
227
|
+
const i = this.domService.createElement("div");
|
|
228
|
+
return s && this.domService.addClass(i, s), this.domService.setStyle(i, "display", "clip"), this.domService.setStyle(i, "position", "absolute"), this.domService.setStyle(i, "left", `${t.left}px`), this.domService.setStyle(i, "top", `${t.top}px`), this.domService.setStyle(i, "width", `${t.width}px`), this.domService.setStyle(i, "height", `${t.height}px`), this.domService.appendChild(e, i), i;
|
|
220
229
|
}
|
|
221
230
|
applyStyleString(e, t) {
|
|
222
|
-
const
|
|
223
|
-
for (const
|
|
224
|
-
const [o, r] =
|
|
231
|
+
const s = t.split(";").map((i) => i.trim()).filter((i) => i);
|
|
232
|
+
for (const i of s) {
|
|
233
|
+
const [o, r] = i.split(":");
|
|
225
234
|
this.domService.setStyle(e, o.trim(), r.trim());
|
|
226
235
|
}
|
|
227
236
|
}
|
|
228
237
|
getDivOrCreateDiv(e, t) {
|
|
229
|
-
let
|
|
230
|
-
return
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
class L {
|
|
234
|
-
constructor(e, t = !0, i, s, o = 0, r = !1, n = !1) {
|
|
235
|
-
this.data = e, this.expanded = t, this.children = i, this.parent = s, this.deep = o, this.checked = r, this.keep = n;
|
|
238
|
+
let s = t.cache[e];
|
|
239
|
+
return s ? (s.innerText = "", s) : (s = this.domService.createElement("div"), t.cache[e] = s, s);
|
|
236
240
|
}
|
|
237
241
|
}
|
|
238
|
-
const
|
|
239
|
-
class
|
|
242
|
+
const H = (p) => p === "header" ? "header" : p === "footer" ? "footer" : "body";
|
|
243
|
+
class ee {
|
|
240
244
|
constructor(e, t) {
|
|
241
245
|
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)) {
|
|
242
246
|
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"));
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
const
|
|
246
|
-
this.value =
|
|
247
|
+
const s = e.getAttribute("data-area");
|
|
248
|
+
if (s && (this.areaIdent = H(s), this.areaModel = t.tableModel.getAreaModel(this.areaIdent), this.row = this.areaModel.getRowByIndex(this.rowIdx)), e instanceof HTMLInputElement) {
|
|
249
|
+
const i = e;
|
|
250
|
+
this.value = i.value;
|
|
247
251
|
}
|
|
248
252
|
}
|
|
249
253
|
}
|
|
250
254
|
}
|
|
251
|
-
class
|
|
255
|
+
class te {
|
|
252
256
|
constructor(e) {
|
|
253
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(
|
|
254
258
|
(t) => t.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope))
|
|
255
259
|
);
|
|
256
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* Handles the "contextmenu" event.
|
|
263
|
+
*
|
|
264
|
+
* @private
|
|
265
|
+
* @param {MouseEvent} evt - The mouse event object.
|
|
266
|
+
* @return {void}
|
|
267
|
+
*/
|
|
257
268
|
onContextmenu(e) {
|
|
258
269
|
this.mouseEvent = e;
|
|
259
270
|
const t = this.tableScope.createGeMouseEvent(this.mouseEvent);
|
|
260
271
|
this.tableScope.contextmenu(t);
|
|
261
272
|
}
|
|
273
|
+
/**
|
|
274
|
+
* Handles the click event on the host element.
|
|
275
|
+
*
|
|
276
|
+
* @param {MouseEvent} event - The click event.
|
|
277
|
+
*
|
|
278
|
+
* @return {void}
|
|
279
|
+
*/
|
|
262
280
|
onHostElementClicked(e) {
|
|
263
|
-
const t = new
|
|
281
|
+
const t = new ee(e.target, this.tableScope);
|
|
264
282
|
if (t.action === "toggleExpandCollapseAll")
|
|
265
283
|
this.expandedAll = !this.expandedAll, this.tableScope.toggleExpandCollapseAll(this.expandedAll), e.preventDefault(), e.stopPropagation();
|
|
266
284
|
else if (t.inputType === "checkbox" && t.areaIdent)
|
|
267
285
|
this.tableScope.toggleRowCheckbox(t.rowIdx, t.colIdx, t.areaIdent), e.preventDefault(), e.stopPropagation();
|
|
268
|
-
else if (t.row
|
|
269
|
-
const
|
|
270
|
-
if (console.info(
|
|
286
|
+
else if (O(t.row) && t.areaModel) {
|
|
287
|
+
const s = t.colIdx === this.getArrowColumnIndex() && e.altKey, i = t.className.includes("ge-table-tree-arrow-div");
|
|
288
|
+
if (console.info(i, s), s || i) {
|
|
271
289
|
e.preventDefault(), e.stopPropagation();
|
|
272
290
|
const o = t.row;
|
|
273
291
|
o.expanded = !o.expanded, "recalcVisibleTreeRows" in t.areaModel && t.areaModel.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(o);
|
|
274
292
|
}
|
|
275
293
|
}
|
|
276
294
|
if (t.areaIdent === "body" && this.tableScope.tableOptions.getFocusModel) {
|
|
277
|
-
const
|
|
278
|
-
|
|
295
|
+
const s = this.tableScope.tableOptions.getFocusModel();
|
|
296
|
+
s == null || s.clear(), s == null || s.setFocus(t.rowIdx, t.colIdx);
|
|
279
297
|
}
|
|
280
298
|
this.publishGeMouseEvent(e, 1);
|
|
281
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* Handles the double click event on the host element.
|
|
302
|
+
* This method is private.
|
|
303
|
+
*
|
|
304
|
+
* @param {MouseEvent} event - The double click event.
|
|
305
|
+
*/
|
|
282
306
|
onHostElementDblClicked(e) {
|
|
283
307
|
if (e.target instanceof HTMLElement) {
|
|
284
|
-
const t = e.target,
|
|
285
|
-
if (
|
|
308
|
+
const t = e.target, s = t.getAttribute("data-area"), i = H(s), o = Number(t.getAttribute("data-row-index")), r = Number(t.getAttribute("data-col-index")), n = this.tableScope.tableModel.getAreaModel(i);
|
|
309
|
+
if (s && i === "header")
|
|
286
310
|
this.tableScope.tableModel.isSortable(r) && (this.tableScope.clearSelection(), this.tableScope.onHeaderDblClicked(e, o, r));
|
|
287
311
|
else if (t.getAttribute("data-row-index")) {
|
|
288
312
|
const l = n.getRowByIndex(o);
|
|
289
|
-
if (
|
|
313
|
+
if (s && i === "body" && n.isEditable(o, r) && (this.tableScope.clearSelection(), this.tableScope.initRenderEditor(o, r)), O(l) && r === this.getArrowColumnIndex()) {
|
|
290
314
|
e.preventDefault(), e.stopPropagation();
|
|
291
315
|
const a = l;
|
|
292
316
|
a.expanded = !a.expanded, "recalcVisibleTreeRows" in n && n.recalcVisibleTreeRows(), this.tableScope.tableModel.recalcSize(this.tableScope.hostElement.clientWidth), this.tableScope.adjustContainersAndRows(), this.updateCollapsedExpandedState(a);
|
|
@@ -295,13 +319,27 @@ class U {
|
|
|
295
319
|
}
|
|
296
320
|
this.publishGeMouseEvent(e, 2);
|
|
297
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Publishes a GeMouseEvent.
|
|
324
|
+
*
|
|
325
|
+
* @param {MouseEvent} event - The MouseEvent to publish.
|
|
326
|
+
* @param {number} clickCount - The number of clicks for the GeMouseEvent.
|
|
327
|
+
*
|
|
328
|
+
* @return {void}
|
|
329
|
+
*/
|
|
298
330
|
publishGeMouseEvent(e, t) {
|
|
299
|
-
var
|
|
300
|
-
this.mouseEvent = e, this.geMouseEventOld = (
|
|
331
|
+
var s;
|
|
332
|
+
this.mouseEvent = e, this.geMouseEventOld = (s = this.geMouseEvent) == null ? void 0 : s.clone(), this.geMouseEvent = this.tableScope.createGeMouseEvent(e), this.geMouseEvent && (this.geMouseEvent.clickCount = t), this.tableScope.onMouseClicked(this.geMouseEvent, this.geMouseEventOld);
|
|
301
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* Update the collapsed/expanded state of a tree row.
|
|
336
|
+
*
|
|
337
|
+
* @param {TreeRowIf<any>} tr - The tree row object.
|
|
338
|
+
* @returns {void}
|
|
339
|
+
*/
|
|
302
340
|
updateCollapsedExpandedState(e) {
|
|
303
|
-
var
|
|
304
|
-
const t = (
|
|
341
|
+
var s, i, o, r, n;
|
|
342
|
+
const t = (i = (s = this.tableScope.tableOptions) == null ? void 0 : s.autoRestoreOptions) == null ? void 0 : i.getRowId;
|
|
305
343
|
if (t) {
|
|
306
344
|
const l = (o = this.tableScope.storeStateCollapsedExpandService) == null ? void 0 : o.collapsedExpandedStateGet().mode, a = l === "collapsed" && !e.expanded || l === "expanded" && e.expanded, d = l === "collapsed" && e.expanded || l === "expanded" && !e.expanded, S = t(e.data);
|
|
307
345
|
a ? (r = this.tableScope.storeStateCollapsedExpandService) == null || r.collapsedStateIdsPush(S) : d && ((n = this.tableScope.storeStateCollapsedExpandService) == null || n.collapsedStateIdsRemove(S));
|
|
@@ -340,287 +378,135 @@ class U {
|
|
|
340
378
|
}
|
|
341
379
|
}
|
|
342
380
|
}
|
|
343
|
-
class
|
|
381
|
+
class se {
|
|
344
382
|
constructor(e) {
|
|
345
383
|
this.tableScope = e;
|
|
346
384
|
}
|
|
347
|
-
|
|
348
|
-
|
|
385
|
+
/**
|
|
386
|
+
* Updates the cells in the table based on the provided events.
|
|
387
|
+
*
|
|
388
|
+
* @param {TableCellUpdateEventIf[]} events - The array of events representing the updates to perform on the cells.
|
|
389
|
+
* @param {boolean} [repaintAll=false] - Optional parameter indicating whether to repaint all cells or not. Default value is false. If true, the full table will be rendered. If false, the table cell will be rendered immediately.
|
|
390
|
+
*
|
|
391
|
+
* @return {void} - This method doesn't return anything.
|
|
392
|
+
*/
|
|
393
|
+
updateCells(e, t = !1) {
|
|
394
|
+
this.tableScope.updateCells(e, t);
|
|
349
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* Notifies that the external filter has changed.
|
|
398
|
+
*
|
|
399
|
+
* @return {void}
|
|
400
|
+
*/
|
|
350
401
|
externalFilterChanged() {
|
|
351
402
|
this.tableScope.externalFilterChanged();
|
|
352
403
|
}
|
|
404
|
+
/**
|
|
405
|
+
* Scrolls the table body to the specified pixel coordinates.
|
|
406
|
+
*
|
|
407
|
+
* @param {number} _px - The horizontal pixel coordinate to scroll to. Defaults to 0.
|
|
408
|
+
* @param {number} _py - The vertical pixel coordinate to scroll to. Defaults to 0.
|
|
409
|
+
* @return {void}
|
|
410
|
+
*/
|
|
353
411
|
scrollToPixel(e = 0, t = 0) {
|
|
354
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* Scrolls to the specified index in both horizontal and vertical directions.
|
|
415
|
+
*
|
|
416
|
+
* @param {number} _indexX - The index of the column to scroll to in the horizontal direction. Default is 0.
|
|
417
|
+
* @param {number} _indexY - The index of the row to scroll to in the vertical direction. Default is 0.
|
|
418
|
+
*
|
|
419
|
+
* @return undefined
|
|
420
|
+
*/
|
|
355
421
|
scrollToIndex(e = 0, t = 0) {
|
|
356
422
|
}
|
|
423
|
+
/**
|
|
424
|
+
* Sets whether the header is visible or not.
|
|
425
|
+
*
|
|
426
|
+
* @param _visible - A boolean value indicating whether the header should be visible. Default value is true.
|
|
427
|
+
*
|
|
428
|
+
* @return undefined
|
|
429
|
+
*/
|
|
357
430
|
setHeaderVisible(e = !0) {
|
|
358
431
|
}
|
|
432
|
+
/**
|
|
433
|
+
* Sets the visibility of a column in the table.
|
|
434
|
+
*
|
|
435
|
+
* @param {_column} - The column index or column definition to set visibility for.
|
|
436
|
+
* @param {_visible=true} - The flag to set visibility to. true for visible, false for hidden.
|
|
437
|
+
*
|
|
438
|
+
* @return {void} - There is no return value.
|
|
439
|
+
*/
|
|
359
440
|
setColumnVisible(e, t = !0) {
|
|
360
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* Returns whether a column is visible or not.
|
|
444
|
+
*
|
|
445
|
+
* @param {number | ColumnDefIf} _column - The column index or the column definition.
|
|
446
|
+
* @return {boolean} - True if the column is visible, false otherwise.
|
|
447
|
+
*/
|
|
361
448
|
isColumnVisible(e) {
|
|
362
449
|
return !0;
|
|
363
450
|
}
|
|
451
|
+
/**
|
|
452
|
+
* Checks if the header is visible.
|
|
453
|
+
*
|
|
454
|
+
* @return {boolean} - Returns true if the header is visible, otherwise returns false.
|
|
455
|
+
*/
|
|
364
456
|
isHeaderVisible() {
|
|
365
457
|
return !0;
|
|
366
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* Sets the visibility of the footer.
|
|
461
|
+
*
|
|
462
|
+
* @param {boolean} _visible - Indicates whether the footer should be visible or not. Default value is true.
|
|
463
|
+
*
|
|
464
|
+
* @return {void} - This method does not return any value.
|
|
465
|
+
*/
|
|
367
466
|
setFooterVisible(e = !0) {
|
|
368
467
|
}
|
|
468
|
+
/**
|
|
469
|
+
* Determines if the footer is visible.
|
|
470
|
+
*
|
|
471
|
+
* @returns {boolean} True if the footer is visible, false otherwise.
|
|
472
|
+
*/
|
|
369
473
|
isFooterVisible() {
|
|
370
474
|
return !0;
|
|
371
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* Repaints the table.
|
|
478
|
+
*
|
|
479
|
+
* This method calls the repaint method of the tableScope object
|
|
480
|
+
* to update and redraw the table based on the latest data.
|
|
481
|
+
*/
|
|
372
482
|
repaint() {
|
|
373
483
|
this.tableScope.repaint();
|
|
374
484
|
}
|
|
375
485
|
}
|
|
376
|
-
class
|
|
377
|
-
flattenTree(e, t = []) {
|
|
378
|
-
var i;
|
|
379
|
-
for (const s of e)
|
|
380
|
-
this.isVisible(s) && t.push(s), (i = s.children) != null && i.length && this.flattenTree(s.children, t);
|
|
381
|
-
return t;
|
|
382
|
-
}
|
|
383
|
-
isVisible(e) {
|
|
384
|
-
return e.parent ? e.parent.expanded ? this.isVisible(e.parent) : !1 : !0;
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
class Z {
|
|
388
|
-
constructor(e, t = [], i = -1) {
|
|
389
|
-
this.areaIdent = e, this.columnDefs = t, this.defaultRowHeight = i, this.rowSelectionModel = void 0, this.yPositions = [], this.cellRenderers = t.map((s) => s.rendererMap[e]);
|
|
390
|
-
}
|
|
391
|
-
getTooltipAt(e, t) {
|
|
392
|
-
return "";
|
|
393
|
-
}
|
|
394
|
-
getCellRenderer(e, t) {
|
|
395
|
-
if (t < this.cellRenderers.length)
|
|
396
|
-
return this.cellRenderers[t];
|
|
397
|
-
}
|
|
398
|
-
getColspanAt(e, t) {
|
|
399
|
-
return 0;
|
|
400
|
-
}
|
|
401
|
-
getCustomClassesAt(e, t) {
|
|
402
|
-
return [];
|
|
403
|
-
}
|
|
404
|
-
getCustomStyleAt(e, t) {
|
|
405
|
-
}
|
|
406
|
-
getRowspanAt(e, t) {
|
|
407
|
-
return 0;
|
|
408
|
-
}
|
|
409
|
-
getRowByIndex(e) {
|
|
410
|
-
}
|
|
411
|
-
isRowCheckable(e) {
|
|
412
|
-
return !0;
|
|
413
|
-
}
|
|
414
|
-
isRowChecked(e) {
|
|
415
|
-
var i;
|
|
416
|
-
const t = this.getRowByIndex(e);
|
|
417
|
-
return (i = this.rowSelectionModel) == null ? void 0 : i.isRowChecked(t);
|
|
418
|
-
}
|
|
419
|
-
setRowChecked(e, t) {
|
|
420
|
-
if (this.rowSelectionModel) {
|
|
421
|
-
const i = this.getRowByIndex(e);
|
|
422
|
-
this.rowSelectionModel.checkRow(i, t);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
getMaxColspan() {
|
|
426
|
-
return 31;
|
|
427
|
-
}
|
|
428
|
-
getMaxRowspan() {
|
|
429
|
-
return 31;
|
|
430
|
-
}
|
|
431
|
-
getYPosByRowIndex(e) {
|
|
432
|
-
return this.defaultRowHeight > 0 ? this.defaultRowHeight * e : this.yPositions[e];
|
|
433
|
-
}
|
|
434
|
-
init() {
|
|
435
|
-
!this.yPositions.length && this.getRowCount() !== void 0 && this.defaultRowHeight === -1 && this.calcYPositions();
|
|
436
|
-
}
|
|
437
|
-
isFilterable() {
|
|
438
|
-
return this.areaIdent === "body";
|
|
439
|
-
}
|
|
440
|
-
doSort(e) {
|
|
441
|
-
return !1;
|
|
442
|
-
}
|
|
443
|
-
isEditable(e, t) {
|
|
444
|
-
return this.columnDefs && t < this.columnDefs.length && this.columnDefs[t].editable ? this.columnDefs[t].editable() : !1;
|
|
445
|
-
}
|
|
446
|
-
setValue(e, t, i) {
|
|
447
|
-
var n;
|
|
448
|
-
const s = (n = this.columnDefs[t]) == null ? void 0 : n.editInputPipe;
|
|
449
|
-
s && (i = s(i, e, t));
|
|
450
|
-
const o = this.getRowByIndex(e), r = this.columnDefs[t].property;
|
|
451
|
-
return r.includes(".") ? this.setPropertyValue(o, r.split("."), i) : (o[r] = i, !0);
|
|
452
|
-
}
|
|
453
|
-
isSelectable(e, t) {
|
|
454
|
-
return !0;
|
|
455
|
-
}
|
|
456
|
-
changeColumnOrder(e, t) {
|
|
457
|
-
this.arrayMove(this.cellRenderers, e, t);
|
|
458
|
-
}
|
|
459
|
-
setPropertyValue(e, t, i) {
|
|
460
|
-
const s = t.shift();
|
|
461
|
-
if (s) {
|
|
462
|
-
let o = e[s];
|
|
463
|
-
return o && t.length ? this.setPropertyValue(o, t, i) : (e[s] = i, !0);
|
|
464
|
-
}
|
|
465
|
-
return !1;
|
|
466
|
-
}
|
|
467
|
-
arrayMove(e, t, i) {
|
|
468
|
-
const s = e.splice(t, 1)[0];
|
|
469
|
-
return e.splice(i, 0, s), e;
|
|
470
|
-
}
|
|
471
|
-
calcYPositions() {
|
|
472
|
-
const e = this.getRowCount();
|
|
473
|
-
this.yPositions = new Array(e + 1), this.yPositions[0] = 0;
|
|
474
|
-
for (let t = 0; t < e; t++)
|
|
475
|
-
this.yPositions[t + 1] = this.getRowHeight(t) + this.yPositions[t];
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
class ee {
|
|
479
|
-
genericSortComparator(e, t, i) {
|
|
480
|
-
if (typeof e == "number" && typeof t == "number")
|
|
481
|
-
return i * (e - t);
|
|
482
|
-
if (typeof e == "string" && typeof t == "string")
|
|
483
|
-
return i * e.localeCompare(t);
|
|
484
|
-
if (typeof e == "boolean" && typeof t == "boolean")
|
|
485
|
-
return i * ((e ? -1 : 1) - (t ? -1 : 1));
|
|
486
|
-
if (e instanceof Date && t instanceof Date)
|
|
487
|
-
return i * (e.getTime() - t.getTime());
|
|
488
|
-
if (e instanceof Array && t instanceof Array) {
|
|
489
|
-
const s = e, o = t;
|
|
490
|
-
if (s.length && o.length)
|
|
491
|
-
return this.genericSortComparator(s[0], o[0], i);
|
|
492
|
-
}
|
|
493
|
-
return i * ("" + e).localeCompare("" + t);
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
class B extends Z {
|
|
497
|
-
constructor(e, t, i, s = []) {
|
|
498
|
-
super(e, s, i), this.areaIdent = e, this.rows = t, this.defaultRowHeight = i, this.columnDefs = s, this.sorterService = new ee(), this.service = new Q(), this.properties = s.map((o) => o.property), this.flattenRows = this.service.flattenTree(t), this.filteredFlattenRows = [...this.flattenRows];
|
|
499
|
-
}
|
|
500
|
-
changeColumnOrder(e, t) {
|
|
501
|
-
this.arrayMove(this.properties, e, t), super.changeColumnOrder(e, t);
|
|
502
|
-
}
|
|
503
|
-
recalcVisibleTreeRows() {
|
|
504
|
-
this.filteredFlattenRows = this.service.flattenTree(this.rows);
|
|
505
|
-
}
|
|
506
|
-
getFilteredFlattenRows() {
|
|
507
|
-
return this.filteredFlattenRows;
|
|
508
|
-
}
|
|
509
|
-
getRowCount() {
|
|
510
|
-
let e = 0;
|
|
511
|
-
for (const t of this.filteredFlattenRows)
|
|
512
|
-
this.service.isVisible(t) && e++;
|
|
513
|
-
return e;
|
|
514
|
-
}
|
|
515
|
-
getValueAt(e, t) {
|
|
516
|
-
const i = this.getRowByIndex(e);
|
|
517
|
-
if (i) {
|
|
518
|
-
const s = this.properties[t];
|
|
519
|
-
if (s)
|
|
520
|
-
return s.includes(".") ? this.getPropertyValue(i.data, s.split(".")) : i.data[s];
|
|
521
|
-
}
|
|
522
|
-
return "";
|
|
523
|
-
}
|
|
524
|
-
getRowHeight(e) {
|
|
525
|
-
return this.defaultRowHeight;
|
|
526
|
-
}
|
|
527
|
-
getCustomClassesAt(e, t) {
|
|
528
|
-
return ["ge-table-tree-cell", "ge-table-tree-deep-" + this.filteredFlattenRows[e].deep];
|
|
529
|
-
}
|
|
530
|
-
getRowByIndex(e) {
|
|
531
|
-
return this.filteredFlattenRows[e];
|
|
532
|
-
}
|
|
533
|
-
getValueByT(e, t) {
|
|
534
|
-
return t.includes(".") ? this.getPropertyValue(e, t.split(".")) : e[t];
|
|
535
|
-
}
|
|
536
|
-
externalFilterChanged(e) {
|
|
537
|
-
this.lastPredictFn = e, this.doFiltering();
|
|
538
|
-
}
|
|
539
|
-
doSort(e) {
|
|
540
|
-
const { columnIndex: t, sortState: i } = e[e.length - 1], s = i === "asc" ? 1 : i === "desc" ? -1 : 0, o = this.properties[t];
|
|
541
|
-
return this.treeSort(this.rows, o, s), this.flattenRows = this.service.flattenTree(this.rows), this.filteredFlattenRows = [...this.flattenRows], !0;
|
|
542
|
-
}
|
|
543
|
-
toggleExpandCollapseAll(e) {
|
|
544
|
-
this.expandAllRecursive(this.rows, e), this.flattenRows = this.service.flattenTree(this.rows), this.doFiltering();
|
|
545
|
-
}
|
|
546
|
-
setAllParentsOk(e) {
|
|
547
|
-
return e.parent && (e.parent.keep = !0, this.setAllParentsOk(e.parent)), !1;
|
|
548
|
-
}
|
|
549
|
-
setValue(e, t, i) {
|
|
550
|
-
var r;
|
|
551
|
-
const s = (r = this.columnDefs[t]) == null ? void 0 : r.editInputPipe;
|
|
552
|
-
s && (i = s(i, e, t));
|
|
553
|
-
const o = this.getRowByIndex(e);
|
|
554
|
-
if (o) {
|
|
555
|
-
const n = o.data, l = this.columnDefs[t].property;
|
|
556
|
-
return l.includes(".") ? this.setPropertyValue(n, l.split("."), i) : (n[l] = i, !0);
|
|
557
|
-
}
|
|
558
|
-
return !1;
|
|
559
|
-
}
|
|
560
|
-
genericTreeTableSortComparator(e, t) {
|
|
561
|
-
return (i, s) => {
|
|
562
|
-
const o = this.getValueByT(i.data, e), r = this.getValueByT(s.data, e);
|
|
563
|
-
return this.sorterService.genericSortComparator(o, r, t);
|
|
564
|
-
};
|
|
565
|
-
}
|
|
566
|
-
expandAllRecursive(e, t) {
|
|
567
|
-
for (const i of e)
|
|
568
|
-
i.expanded = t, i.children && this.expandAllRecursive(i.children, t);
|
|
569
|
-
}
|
|
570
|
-
doFiltering() {
|
|
571
|
-
if (!this.lastPredictFn)
|
|
572
|
-
this.filteredFlattenRows = [...this.flattenRows ? this.flattenRows : []];
|
|
573
|
-
else {
|
|
574
|
-
this.flattenRows || (this.flattenRows = []);
|
|
575
|
-
let e = 0;
|
|
576
|
-
this.flattenRows.forEach((i) => {
|
|
577
|
-
e = Math.max(e, i.deep);
|
|
578
|
-
});
|
|
579
|
-
const t = this.flattenRows.filter(
|
|
580
|
-
(i, s, o) => this.lastPredictFn(i, s, o)
|
|
581
|
-
);
|
|
582
|
-
this.flattenRows.forEach((i) => i.keep = !1), this.flattenRows.forEach((i) => {
|
|
583
|
-
t.includes(i) && (i.keep = !0, this.setAllParentsOk(i));
|
|
584
|
-
}), this.filteredFlattenRows = this.flattenRows.filter(
|
|
585
|
-
(i, s, o) => i.keep
|
|
586
|
-
);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
getPropertyValue(e, t) {
|
|
590
|
-
const i = t.shift();
|
|
591
|
-
let s = e[i];
|
|
592
|
-
return s && t.length ? this.getPropertyValue(s, t) : s;
|
|
593
|
-
}
|
|
594
|
-
treeSort(e, t, i) {
|
|
595
|
-
e.sort(this.genericTreeTableSortComparator(t, i));
|
|
596
|
-
for (const s of e)
|
|
597
|
-
s.children && this.treeSort(s.children, t, i);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
class H {
|
|
486
|
+
class P {
|
|
601
487
|
constructor(e) {
|
|
602
488
|
this.getStorageKeyFn = e;
|
|
603
489
|
}
|
|
604
490
|
autoConvertMapToObject(e) {
|
|
605
491
|
const t = {};
|
|
606
492
|
if (e instanceof Map) {
|
|
607
|
-
const
|
|
608
|
-
for (const
|
|
493
|
+
const s = e;
|
|
494
|
+
for (const i of [...s]) {
|
|
609
495
|
const [
|
|
610
496
|
o,
|
|
611
497
|
r
|
|
612
|
-
] =
|
|
498
|
+
] = i;
|
|
613
499
|
t[o] = r;
|
|
614
500
|
}
|
|
615
501
|
}
|
|
616
502
|
return t;
|
|
617
503
|
}
|
|
618
504
|
checkAndPersistItem(e, t) {
|
|
619
|
-
const
|
|
620
|
-
if (
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
623
|
-
const o =
|
|
505
|
+
const s = this.getStorageKeyFn;
|
|
506
|
+
if (s) {
|
|
507
|
+
const i = s();
|
|
508
|
+
if (i) {
|
|
509
|
+
const o = i + e;
|
|
624
510
|
if ((t + "").includes("Map")) {
|
|
625
511
|
const r = this.autoConvertMapToObject(t);
|
|
626
512
|
this.persistItem(o, r);
|
|
@@ -672,7 +558,7 @@ class H {
|
|
|
672
558
|
// }
|
|
673
559
|
// }
|
|
674
560
|
}
|
|
675
|
-
class
|
|
561
|
+
class ie extends P {
|
|
676
562
|
constructor(e) {
|
|
677
563
|
super(e), this.SCROLL_STATE = "scrollState", this.scrollOffset = [0, 0], this.load();
|
|
678
564
|
}
|
|
@@ -687,21 +573,21 @@ class te extends H {
|
|
|
687
573
|
if (e) {
|
|
688
574
|
const t = e();
|
|
689
575
|
if (t) {
|
|
690
|
-
const
|
|
691
|
-
let
|
|
692
|
-
this.scrollOffset =
|
|
576
|
+
const s = t + this.SCROLL_STATE;
|
|
577
|
+
let i = this.loadFromLocalStorage(s);
|
|
578
|
+
this.scrollOffset = i || [0, 0];
|
|
693
579
|
}
|
|
694
580
|
}
|
|
695
581
|
}
|
|
696
582
|
}
|
|
697
|
-
class
|
|
698
|
-
constructor(e = "collapsed", t = [],
|
|
699
|
-
this.mode = e, this.rowIds = t, this.allCollapsed =
|
|
583
|
+
class oe {
|
|
584
|
+
constructor(e = "collapsed", t = [], s = !1, i = !1) {
|
|
585
|
+
this.mode = e, this.rowIds = t, this.allCollapsed = s, this.allExpanded = i;
|
|
700
586
|
}
|
|
701
587
|
}
|
|
702
|
-
class
|
|
588
|
+
class le extends P {
|
|
703
589
|
constructor(e) {
|
|
704
|
-
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new
|
|
590
|
+
super(e), this.COLLAPSED_EXPANDED_STATE = "collapsedExpandedState", this.collapsedExpandedState = new oe(), this.load();
|
|
705
591
|
}
|
|
706
592
|
collapsedExpandedStateGet() {
|
|
707
593
|
return this.collapsedExpandedState;
|
|
@@ -724,8 +610,8 @@ class se extends H {
|
|
|
724
610
|
if (e) {
|
|
725
611
|
const t = e();
|
|
726
612
|
if (t) {
|
|
727
|
-
const
|
|
728
|
-
|
|
613
|
+
const s = t + this.COLLAPSED_EXPANDED_STATE, i = this.loadFromLocalStorage(s);
|
|
614
|
+
i && (this.collapsedExpandedState = i);
|
|
729
615
|
}
|
|
730
616
|
}
|
|
731
617
|
}
|
|
@@ -733,7 +619,7 @@ class se extends H {
|
|
|
733
619
|
this.checkAndPersistItem(this.COLLAPSED_EXPANDED_STATE, this.collapsedExpandedState);
|
|
734
620
|
}
|
|
735
621
|
}
|
|
736
|
-
class
|
|
622
|
+
class re extends P {
|
|
737
623
|
constructor(e) {
|
|
738
624
|
super(e), this.SORTING_STATE = "sortingState", this.sortItems = [], this.load();
|
|
739
625
|
}
|
|
@@ -748,95 +634,95 @@ class oe extends H {
|
|
|
748
634
|
if (e) {
|
|
749
635
|
const t = e();
|
|
750
636
|
if (t) {
|
|
751
|
-
const
|
|
752
|
-
let
|
|
753
|
-
this.sortItems =
|
|
637
|
+
const s = t + this.SORTING_STATE;
|
|
638
|
+
let i = this.loadFromLocalStorage(s);
|
|
639
|
+
this.sortItems = i || [];
|
|
754
640
|
}
|
|
755
641
|
}
|
|
756
642
|
}
|
|
757
643
|
}
|
|
758
644
|
class T {
|
|
759
|
-
constructor(e = 0, t = 0,
|
|
760
|
-
this.left = e, this.width = t, this.height =
|
|
645
|
+
constructor(e = 0, t = 0, s = 0, i = 0, o) {
|
|
646
|
+
this.left = e, this.width = t, this.height = s, this.top = i, this.index = o;
|
|
761
647
|
}
|
|
762
648
|
}
|
|
763
|
-
class
|
|
764
|
-
constructor(e, t,
|
|
765
|
-
this.hostElement = e, this.tableModel = t, this.dom =
|
|
649
|
+
class ne {
|
|
650
|
+
constructor(e, t, s, i) {
|
|
651
|
+
this.hostElement = e, this.tableModel = t, this.dom = s, this.tableOptions = i, this.scrollTop = 0, this.areaBodyWestGeo = new T(), this.areaBodyCenterGeo = new T(), this.areaBodyEastGeo = new T();
|
|
766
652
|
const o = this.hostElement;
|
|
767
653
|
o.innerText = "", this.dom.setAttribute(o, "tabindex", "0"), this.dom.setStyle(
|
|
768
654
|
this.dom.addClass("ge-table", o),
|
|
769
655
|
"position",
|
|
770
656
|
"relative"
|
|
771
|
-
), this.hoverRow =
|
|
772
|
-
|
|
773
|
-
), this.hoverColumn =
|
|
774
|
-
|
|
775
|
-
), this.areaHeaderWest =
|
|
776
|
-
|
|
777
|
-
|
|
657
|
+
), this.hoverRow = s.applyStylePosistionAbsolute(
|
|
658
|
+
s.createDivWithClass("ge-table-hover-row", o)
|
|
659
|
+
), this.hoverColumn = s.applyStylePosistionAbsolute(
|
|
660
|
+
s.createDivWithClass("ge-table-hover-column", o)
|
|
661
|
+
), this.areaHeaderWest = s.appendRelativeChildDiv(
|
|
662
|
+
s.applyStylePosistionAbsolute(
|
|
663
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-west", o, "header", "west")
|
|
778
664
|
)
|
|
779
|
-
), this.areaHeaderCenter =
|
|
780
|
-
|
|
781
|
-
|
|
665
|
+
), this.areaHeaderCenter = s.appendRelativeChildDiv(
|
|
666
|
+
s.applyStylePosistionAbsolute(
|
|
667
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-center", o, "header", "center")
|
|
782
668
|
)
|
|
783
|
-
), this.areaHeaderEast =
|
|
784
|
-
|
|
785
|
-
|
|
669
|
+
), this.areaHeaderEast = s.appendRelativeChildDiv(
|
|
670
|
+
s.applyStylePosistionAbsolute(
|
|
671
|
+
s.createAreaDivWithClass("ge-table-header ge-table-header-east", o, "body", "east")
|
|
786
672
|
)
|
|
787
|
-
), this.areaBodyWest =
|
|
788
|
-
|
|
789
|
-
|
|
673
|
+
), this.areaBodyWest = s.appendRelativeChildDiv(
|
|
674
|
+
s.applyStylePosistionAbsolute(
|
|
675
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-west", o, "body", "west")
|
|
790
676
|
)
|
|
791
|
-
), this.areaBodyEast =
|
|
792
|
-
|
|
793
|
-
|
|
677
|
+
), this.areaBodyEast = s.appendRelativeChildDiv(
|
|
678
|
+
s.applyStylePosistionAbsolute(
|
|
679
|
+
s.createAreaDivWithClass("ge-table-body ge-table-body-east", o, "body", "east")
|
|
794
680
|
)
|
|
795
|
-
), this.areaFooterWest =
|
|
796
|
-
|
|
797
|
-
|
|
681
|
+
), this.areaFooterWest = s.appendRelativeChildDiv(
|
|
682
|
+
s.applyStylePosistionAbsolute(
|
|
683
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-west", o, "footer", "west")
|
|
798
684
|
)
|
|
799
|
-
), this.areaFooterCenter =
|
|
800
|
-
|
|
801
|
-
|
|
685
|
+
), this.areaFooterCenter = s.appendRelativeChildDiv(
|
|
686
|
+
s.applyStylePosistionAbsolute(
|
|
687
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-center", o, "footer", "center")
|
|
802
688
|
)
|
|
803
|
-
), this.areaFooterEast =
|
|
804
|
-
|
|
805
|
-
|
|
689
|
+
), this.areaFooterEast = s.appendRelativeChildDiv(
|
|
690
|
+
s.applyStylePosistionAbsolute(
|
|
691
|
+
s.createAreaDivWithClass("ge-table-footer ge-table-footer-east", o, "footer", "east")
|
|
806
692
|
)
|
|
807
|
-
), this.scrollViewport =
|
|
693
|
+
), this.scrollViewport = s.applyStyleOverflowAuto(
|
|
808
694
|
this.tableOptions.overflowX ?? "auto",
|
|
809
695
|
this.tableOptions.overflowY ?? "auto",
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
696
|
+
s.applyStyleNoPadding(
|
|
697
|
+
s.applyStylePosistionAbsolute(
|
|
698
|
+
s.createAreaDivWithClass("ge-table-scroll-viewport", o, "body", "center")
|
|
813
699
|
)
|
|
814
700
|
)
|
|
815
|
-
), this.contentWrapperDiv =
|
|
816
|
-
|
|
817
|
-
|
|
701
|
+
), this.contentWrapperDiv = s.applyStyleNoPadding(
|
|
702
|
+
s.applyStylePosistionRelative(
|
|
703
|
+
s.createDivWithClass("ge-table-scroll-content-wrapper", this.scrollViewport)
|
|
818
704
|
)
|
|
819
|
-
), this.contentDiv =
|
|
820
|
-
|
|
821
|
-
|
|
705
|
+
), this.contentDiv = s.applyStyleNoPadding(
|
|
706
|
+
s.applyStylePosistionRelative(
|
|
707
|
+
s.createDivWithClass("ge-table-scroll-content", this.contentWrapperDiv)
|
|
822
708
|
)
|
|
823
|
-
), this.areaBodyCenter =
|
|
824
|
-
|
|
825
|
-
), this.borderHeaderBottom =
|
|
826
|
-
|
|
827
|
-
), this.borderFixedWest =
|
|
828
|
-
|
|
829
|
-
), this.borderFixedEast =
|
|
830
|
-
|
|
831
|
-
), this.borderFooterTop =
|
|
832
|
-
|
|
709
|
+
), this.areaBodyCenter = s.appendRelativeChildDiv(
|
|
710
|
+
s.createDivWithClass("ge-table-body-center", this.contentDiv)
|
|
711
|
+
), this.borderHeaderBottom = s.applyStylePosistionAbsolute(
|
|
712
|
+
s.createDivWithClass("ge-table-header-border", o)
|
|
713
|
+
), this.borderFixedWest = s.applyStylePosistionAbsolute(
|
|
714
|
+
s.createDivWithClass("ge-table-west-fixed-column-border", o)
|
|
715
|
+
), this.borderFixedEast = s.applyStylePosistionAbsolute(
|
|
716
|
+
s.createDivWithClass("ge-table-east-fixed-column-border", o)
|
|
717
|
+
), this.borderFooterTop = s.applyStylePosistionAbsolute(
|
|
718
|
+
s.createDivWithClass("ge-table-footer-border", o)
|
|
833
719
|
);
|
|
834
720
|
}
|
|
835
721
|
adjustContainersAndRows() {
|
|
836
|
-
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth,
|
|
722
|
+
const e = this.tableModel.getPadding(), t = this.hostElement.clientWidth, s = this.hostElement.clientHeight;
|
|
837
723
|
this.dom.applyStyle(this.scrollViewport, {
|
|
838
724
|
width: `${t - e.left}px`,
|
|
839
|
-
height: `${
|
|
725
|
+
height: `${s - e.top}px`,
|
|
840
726
|
top: `${e.top}px`,
|
|
841
727
|
left: `${e.left}px`
|
|
842
728
|
}), this.scrollTop = this.scrollViewport.scrollTop, this.dom.applyStyle(this.contentDiv, {
|
|
@@ -844,21 +730,21 @@ class re {
|
|
|
844
730
|
height: `${this.scrollViewport.clientHeight}px`,
|
|
845
731
|
top: `${this.scrollTop}px`,
|
|
846
732
|
left: `${this.scrollViewport.scrollLeft}px`
|
|
847
|
-
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height =
|
|
733
|
+
}), this.areaBodyWestGeo.width = e.left, this.areaBodyWestGeo.height = s - e.top - e.bottom, this.areaBodyWestGeo.top = e.top, this.areaBodyWestGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyWest.parent, this.areaBodyWestGeo), this.tableOptions.fixedWestSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
848
734
|
this.dom.applyStyle(this.borderFixedWest, {
|
|
849
735
|
width: "1px",
|
|
850
736
|
height: `${this.areaBodyWestGeo.height}px`,
|
|
851
737
|
top: `${this.areaBodyWestGeo.top}px`,
|
|
852
738
|
left: `${this.areaBodyWestGeo.width}px`
|
|
853
739
|
})
|
|
854
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height =
|
|
740
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedWest), this.areaBodyEastGeo.width = e.right, this.areaBodyEastGeo.height = s - e.top - e.bottom, this.areaBodyEastGeo.top = e.top, this.areaBodyEastGeo.left = t - e.right, this.dom.applyStyleInPx(this.areaBodyEast.parent, this.areaBodyEastGeo), this.tableOptions.fixedEastSeparatorBorderVisible && this.tableModel.getFixedLeftColumnCount() ? this.dom.applyDisplayBlockStyle(
|
|
855
741
|
this.dom.applyStyle(this.borderFixedEast, {
|
|
856
742
|
width: "1px",
|
|
857
743
|
height: `${this.areaBodyEastGeo.height}px`,
|
|
858
744
|
top: `${this.areaBodyEastGeo.top}px`,
|
|
859
745
|
left: `${this.areaBodyEastGeo.left}px`
|
|
860
746
|
})
|
|
861
|
-
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height =
|
|
747
|
+
) : this.dom.applyDisplayNoneStyle(this.borderFixedEast), this.areaBodyCenterGeo.width = t - e.left - e.right, this.areaBodyCenterGeo.height = s - e.top - e.bottom, this.areaBodyCenterGeo.top = 0, this.areaBodyCenterGeo.left = 0, this.dom.applyStyleInPx(this.areaBodyCenter.parent, this.areaBodyCenterGeo), this.dom.applyStyle(this.areaHeaderCenter.parent, {
|
|
862
748
|
width: `${t - e.left - e.right}px`,
|
|
863
749
|
height: `${e.top}px`,
|
|
864
750
|
top: "0",
|
|
@@ -883,23 +769,23 @@ class re {
|
|
|
883
769
|
) : this.dom.applyDisplayNoneStyle(this.borderHeaderBottom), this.dom.applyStyle(this.areaFooterWest.parent, {
|
|
884
770
|
width: `${e.left}px`,
|
|
885
771
|
height: `${e.bottom}px`,
|
|
886
|
-
top: `${
|
|
772
|
+
top: `${s - e.bottom}px`,
|
|
887
773
|
left: "0"
|
|
888
774
|
}), this.dom.applyStyle(this.areaFooterCenter.parent, {
|
|
889
775
|
width: `${t - e.left - e.right}px`,
|
|
890
776
|
height: `${e.bottom}px`,
|
|
891
|
-
top: `${
|
|
777
|
+
top: `${s - e.bottom}px`,
|
|
892
778
|
left: `${e.left}px`
|
|
893
779
|
}), this.dom.applyStyle(this.areaFooterEast.parent, {
|
|
894
780
|
width: `${e.right}px`,
|
|
895
781
|
height: `${e.bottom}px`,
|
|
896
|
-
top: `${
|
|
782
|
+
top: `${s - e.bottom}px`,
|
|
897
783
|
left: `${t - e.right}px`
|
|
898
784
|
}), this.tableOptions.footerSeparatorBorderVisible && this.tableModel.isFooterVisibe() ? this.dom.applyDisplayBlockStyle(
|
|
899
785
|
this.dom.applyStyle(this.borderFooterTop, {
|
|
900
786
|
width: `${t}px`,
|
|
901
787
|
height: "1px",
|
|
902
|
-
top: `${
|
|
788
|
+
top: `${s - e.bottom}px`,
|
|
903
789
|
left: "0px"
|
|
904
790
|
})
|
|
905
791
|
) : this.dom.applyDisplayNoneStyle(this.borderFooterTop), this.adjustAfterScrolling();
|
|
@@ -911,12 +797,21 @@ class re {
|
|
|
911
797
|
this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", t);
|
|
912
798
|
}
|
|
913
799
|
}
|
|
914
|
-
class
|
|
915
|
-
|
|
916
|
-
|
|
800
|
+
class R {
|
|
801
|
+
/**
|
|
802
|
+
* Represents a constructor for a class.
|
|
803
|
+
* @constructor
|
|
804
|
+
* @param {number} r1 - The value for r1.
|
|
805
|
+
* @param {number} c1 - The value for c1.
|
|
806
|
+
* @param {number} r2 - The value for r2.
|
|
807
|
+
* @param {number} c2 - The value for c2.
|
|
808
|
+
* @param {boolean} [gammaRange=false] - The value for gammaRange. Defaults to false. gammaRange will be used for AreaModelCellGroups, but it's not implemented yet!
|
|
809
|
+
*/
|
|
810
|
+
constructor(e, t, s, i, o = !1) {
|
|
811
|
+
this.r1 = e, this.c1 = t, this.r2 = s, this.c2 = i, this.gammaRange = o;
|
|
917
812
|
}
|
|
918
813
|
static create(e) {
|
|
919
|
-
return e.gammaRange === void 0 && (e.gammaRange = !1), new
|
|
814
|
+
return e.gammaRange === void 0 && (e.gammaRange = !1), new R(
|
|
920
815
|
e.rowIndex1,
|
|
921
816
|
e.columnIndex1,
|
|
922
817
|
e.rowIndex2,
|
|
@@ -925,19 +820,19 @@ class A {
|
|
|
925
820
|
);
|
|
926
821
|
}
|
|
927
822
|
static singleCell(e, t) {
|
|
928
|
-
return new
|
|
823
|
+
return new R(e, t, e, t);
|
|
929
824
|
}
|
|
930
825
|
static singleRow(e) {
|
|
931
|
-
return new
|
|
826
|
+
return new R(e, 0, e, Number.MAX_SAFE_INTEGER);
|
|
932
827
|
}
|
|
933
828
|
static singleColumn(e) {
|
|
934
|
-
return new
|
|
829
|
+
return new R(0, e, Number.MAX_SAFE_INTEGER, e);
|
|
935
830
|
}
|
|
936
831
|
isInRange(e, t) {
|
|
937
832
|
return e >= this.r1 && e <= this.r2 && t >= this.c1 && t <= this.c2;
|
|
938
833
|
}
|
|
939
834
|
}
|
|
940
|
-
class
|
|
835
|
+
class ae {
|
|
941
836
|
constructor(e, t) {
|
|
942
837
|
this.tableModel = e, this.areaModel = t, this.colAndRowspanRanges = void 0;
|
|
943
838
|
}
|
|
@@ -946,14 +841,14 @@ class le {
|
|
|
946
841
|
return;
|
|
947
842
|
this.colAndRowspanRanges = [];
|
|
948
843
|
const e = this.areaModel.getRowCount(), t = this.tableModel.getColumnCount();
|
|
949
|
-
for (let
|
|
950
|
-
for (let
|
|
951
|
-
let o = this.areaModel.getColspanAt(
|
|
844
|
+
for (let s = 0; s < e; s++)
|
|
845
|
+
for (let i = 0; i < t; i++) {
|
|
846
|
+
let o = this.areaModel.getColspanAt(s, i), r = this.areaModel.getRowspanAt(s, i);
|
|
952
847
|
if (o > 1 || r > 1) {
|
|
953
848
|
o === 0 && (o = 1), r === 0 && (r = 1);
|
|
954
849
|
const n = this.areaModel.hasOwnProperty("gammaCells");
|
|
955
850
|
this.colAndRowspanRanges.push(
|
|
956
|
-
new
|
|
851
|
+
new R(s, i, s + r - 1, i + o - 1, n)
|
|
957
852
|
);
|
|
958
853
|
}
|
|
959
854
|
}
|
|
@@ -963,29 +858,29 @@ class le {
|
|
|
963
858
|
}
|
|
964
859
|
isInRange(e, t) {
|
|
965
860
|
if (this.colAndRowspanRanges) {
|
|
966
|
-
for (const
|
|
967
|
-
if (
|
|
861
|
+
for (const s of this.colAndRowspanRanges)
|
|
862
|
+
if (s.isInRange(e, t))
|
|
968
863
|
return !0;
|
|
969
864
|
}
|
|
970
865
|
return !1;
|
|
971
866
|
}
|
|
972
867
|
}
|
|
973
|
-
class
|
|
974
|
-
constructor(e, t,
|
|
975
|
-
this.header = e, this.body = t, this.footer =
|
|
868
|
+
class de {
|
|
869
|
+
constructor(e, t, s) {
|
|
870
|
+
this.header = e, this.body = t, this.footer = s;
|
|
976
871
|
}
|
|
977
872
|
}
|
|
978
|
-
class
|
|
979
|
-
constructor(e, t,
|
|
873
|
+
class he extends ne {
|
|
874
|
+
constructor(e, t, s, i) {
|
|
980
875
|
var r, n;
|
|
981
|
-
super(e, t,
|
|
876
|
+
super(e, t, s, i), this.scrollLeft = 0, this.scrollViewportLeft = 0, this.scrollFactorY = 0, this.scrollFactorX = 0, this.cleanupFunctions = {
|
|
982
877
|
header: [],
|
|
983
878
|
body: [],
|
|
984
879
|
footer: []
|
|
985
|
-
}, this.tree = !1, this.colAndRowspanModels = new
|
|
880
|
+
}, this.tree = !1, this.colAndRowspanModels = new de(), this.firstVisibleRowIndex = -1, this.draggingTargetColumnIndex = -1, this.removables = [], this.editing = !1, this.tableModel.getSelectionModel ? this.getSelectionModel = this.tableModel.getSelectionModel : (r = this.tableOptions) != null && r.getSelectionModel && (this.getSelectionModel = this.tableOptions.getSelectionModel), (n = this.tableOptions) != null && n.getFocusModel && (this.getFocusModel = this.tableOptions.getFocusModel), $(t.getAreaModel("body")) && (this.tree = !0), ["header", "body", "footer"].forEach(
|
|
986
881
|
(l) => {
|
|
987
882
|
var a;
|
|
988
|
-
this.colAndRowspanModels[l] = new
|
|
883
|
+
this.colAndRowspanModels[l] = new ae(t, t.getAreaModel(l)), (a = this.colAndRowspanModels[l]) == null || a.init();
|
|
989
884
|
}
|
|
990
885
|
);
|
|
991
886
|
}
|
|
@@ -1002,10 +897,10 @@ class ae extends re {
|
|
|
1002
897
|
}
|
|
1003
898
|
}
|
|
1004
899
|
initRenderEditor(e, t) {
|
|
1005
|
-
var
|
|
1006
|
-
let
|
|
1007
|
-
if (
|
|
1008
|
-
if (this.editorRenderer =
|
|
900
|
+
var i;
|
|
901
|
+
let s = (i = this.tableModel.getColumnDef(t)) == null ? void 0 : i.getEditRenderer;
|
|
902
|
+
if (s || (s = this.tableOptions.getEditRenderer), s)
|
|
903
|
+
if (this.editorRenderer = s(e, t), this.editorRenderer) {
|
|
1009
904
|
this.editorRendererRow = e, this.editorRendererColumn = t, this.editing = !0, this.repaint();
|
|
1010
905
|
const o = document.querySelector("input.ge-table-cell-editor-input");
|
|
1011
906
|
o && o.focus();
|
|
@@ -1041,16 +936,18 @@ class ae extends re {
|
|
|
1041
936
|
var e, t;
|
|
1042
937
|
this.storeScrollPosStateService && ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreScrollPosition) && this.storeScrollPosStateService.updateScrollOffset([this.scrollLeft, this.scrollTop]);
|
|
1043
938
|
}
|
|
1044
|
-
updateCells(e) {
|
|
939
|
+
updateCells(e, t = !1) {
|
|
1045
940
|
e.forEach(
|
|
1046
|
-
(
|
|
1047
|
-
|
|
941
|
+
(s) => {
|
|
942
|
+
this.tableModel.getAreaModel(s.area).setValue(s.rowIndex, s.columnIndex, s.value), t || this.rerenderCellContent(s);
|
|
943
|
+
}
|
|
944
|
+
), t && this.repaint();
|
|
1048
945
|
}
|
|
1049
946
|
getAreaAndSideIdentByAttr(e) {
|
|
1050
947
|
if (e) {
|
|
1051
|
-
const t = this.getStringByAttr(e, "data-area"),
|
|
1052
|
-
if (
|
|
1053
|
-
return [t,
|
|
948
|
+
const t = this.getStringByAttr(e, "data-area"), s = this.getStringByAttr(e, "data-side");
|
|
949
|
+
if (s && t)
|
|
950
|
+
return [t, s];
|
|
1054
951
|
}
|
|
1055
952
|
return [void 0, void 0];
|
|
1056
953
|
}
|
|
@@ -1084,105 +981,105 @@ class ae extends re {
|
|
|
1084
981
|
this.dom.setStyle(this.contentDiv, "top", `${this.scrollTop}px`), this.dom.setStyle(this.contentDiv, "left", `${this.scrollViewport.scrollLeft}px`), this.adjustArea("body", t);
|
|
1085
982
|
}
|
|
1086
983
|
getNumberByAttr(e, t) {
|
|
1087
|
-
var
|
|
984
|
+
var s;
|
|
1088
985
|
if (e) {
|
|
1089
|
-
const
|
|
1090
|
-
if (
|
|
1091
|
-
return Number(
|
|
986
|
+
const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
987
|
+
if (i)
|
|
988
|
+
return Number(i);
|
|
1092
989
|
}
|
|
1093
990
|
return -1;
|
|
1094
991
|
}
|
|
1095
992
|
getStringByAttr(e, t) {
|
|
1096
|
-
var
|
|
993
|
+
var s;
|
|
1097
994
|
if (e) {
|
|
1098
|
-
const
|
|
1099
|
-
if (
|
|
1100
|
-
return
|
|
995
|
+
const i = (s = e.closest("[" + t + "]")) == null ? void 0 : s.getAttribute(t);
|
|
996
|
+
if (i)
|
|
997
|
+
return i;
|
|
1101
998
|
}
|
|
1102
999
|
return "";
|
|
1103
1000
|
}
|
|
1104
1001
|
adjustArea(e, t = 0) {
|
|
1105
|
-
var
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1002
|
+
var c;
|
|
1003
|
+
const s = this.getArea(e, "west"), i = this.getArea(e, "center"), o = this.getArea(e, "east"), r = i.child.clientHeight;
|
|
1004
|
+
s.child.innerText = "", i.child.innerText = "", o.child.innerText = "";
|
|
1108
1005
|
const n = 0, l = this.areaBodyCenterGeo.width, a = this.tableModel.getPadding(), d = this.tableModel.getAreaModel(e), S = d.getRowCount();
|
|
1109
1006
|
for (; this.cleanupFunctions[e].length; ) {
|
|
1110
1007
|
const u = this.cleanupFunctions[e].shift();
|
|
1111
1008
|
u && u();
|
|
1112
1009
|
}
|
|
1113
1010
|
let g = t;
|
|
1114
|
-
const
|
|
1011
|
+
const m = this.tableModel.getColumnCount(), h = this.tableModel.getFixedRightColumnCount(), f = this.tableModel.getFixedLeftColumnCount();
|
|
1115
1012
|
for (let u = 0; u < S; u++) {
|
|
1116
|
-
const
|
|
1117
|
-
if (
|
|
1013
|
+
const w = g, C = u === S - 1, x = this.tableModel.getRowHeight(e, u);
|
|
1014
|
+
if (w + x > 0) {
|
|
1118
1015
|
this.firstVisibleRowIndex = u;
|
|
1119
|
-
let
|
|
1120
|
-
const
|
|
1016
|
+
let y = { left: n, width: l, height: x, top: w, index: u }, v = this.dom.addRowDiv(i, y, u, e, "center");
|
|
1017
|
+
const E = f;
|
|
1121
1018
|
if (this.adjustColumnsToRowParent({
|
|
1122
1019
|
areaIdent: e,
|
|
1123
1020
|
sideIdent: "center",
|
|
1124
1021
|
areaModel: d,
|
|
1125
|
-
geo:
|
|
1126
|
-
parent:
|
|
1022
|
+
geo: y,
|
|
1023
|
+
parent: v,
|
|
1127
1024
|
rowIndex: u,
|
|
1128
|
-
columnIndexStart:
|
|
1129
|
-
columnIndexEnd:
|
|
1025
|
+
columnIndexStart: E,
|
|
1026
|
+
columnIndexEnd: m - h - 1,
|
|
1130
1027
|
verticalFixed: !1,
|
|
1131
|
-
lastRowOfModel:
|
|
1132
|
-
}), a.left > 0 && (
|
|
1028
|
+
lastRowOfModel: C
|
|
1029
|
+
}), a.left > 0 && (y = { left: n, width: this.areaBodyWestGeo.width, height: x, top: w, index: u }, v = this.dom.addRowDiv(s, y, u, e, "west"), this.adjustColumnsToRowParent({
|
|
1133
1030
|
areaIdent: e,
|
|
1134
1031
|
sideIdent: "west",
|
|
1135
1032
|
areaModel: d,
|
|
1136
|
-
geo:
|
|
1137
|
-
parent:
|
|
1033
|
+
geo: y,
|
|
1034
|
+
parent: v,
|
|
1138
1035
|
rowIndex: u,
|
|
1139
1036
|
columnIndexStart: 0,
|
|
1140
|
-
columnIndexEnd:
|
|
1037
|
+
columnIndexEnd: E - 1,
|
|
1141
1038
|
verticalFixed: !0,
|
|
1142
|
-
lastRowOfModel:
|
|
1143
|
-
})), a.right > 0 && (
|
|
1039
|
+
lastRowOfModel: C
|
|
1040
|
+
})), a.right > 0 && (y = { left: n, width: this.areaBodyEastGeo.width, height: x, top: w, index: u }, v = this.dom.addRowDiv(o, y, u, e, "east"), this.adjustColumnsToRowParent({
|
|
1144
1041
|
areaIdent: e,
|
|
1145
1042
|
sideIdent: "east",
|
|
1146
1043
|
areaModel: d,
|
|
1147
|
-
geo:
|
|
1148
|
-
parent:
|
|
1044
|
+
geo: y,
|
|
1045
|
+
parent: v,
|
|
1149
1046
|
rowIndex: u,
|
|
1150
|
-
columnIndexStart:
|
|
1151
|
-
columnIndexEnd:
|
|
1047
|
+
columnIndexStart: m - h,
|
|
1048
|
+
columnIndexEnd: m - 1,
|
|
1152
1049
|
verticalFixed: !0,
|
|
1153
|
-
lastRowOfModel:
|
|
1050
|
+
lastRowOfModel: C
|
|
1154
1051
|
})), e === "header" && this.tree && u === S - 1) {
|
|
1155
|
-
const
|
|
1052
|
+
const A = this.dom.applyStyle(
|
|
1156
1053
|
this.dom.setAttribute(
|
|
1157
|
-
this.dom.addDiv(
|
|
1054
|
+
this.dom.addDiv(v, new T(16, 20, 20, 8)),
|
|
1158
1055
|
"data-ge-action",
|
|
1159
1056
|
"toggleExpandCollapseAll"
|
|
1160
1057
|
),
|
|
1161
1058
|
{ cursor: "pointer" }
|
|
1162
|
-
),
|
|
1163
|
-
if (
|
|
1164
|
-
const
|
|
1165
|
-
this.dom.domService.appendChild(
|
|
1059
|
+
), M = this.tableOptions.treeOptions.arrowExpandCollapseAll;
|
|
1060
|
+
if (M) {
|
|
1061
|
+
const I = this.dom.domService.createText(M.content);
|
|
1062
|
+
this.dom.domService.appendChild(A, I), M.style && this.dom.applyStyleString(A, M.style);
|
|
1166
1063
|
}
|
|
1167
1064
|
}
|
|
1168
1065
|
}
|
|
1169
|
-
if (g = g +
|
|
1066
|
+
if (g = g + x, g > r)
|
|
1170
1067
|
break;
|
|
1171
1068
|
}
|
|
1172
1069
|
if (this.colAndRowspanModels && this.colAndRowspanModels[e]) {
|
|
1173
|
-
const u = ((
|
|
1070
|
+
const u = ((c = this.colAndRowspanModels[e]) == null ? void 0 : c.getRanges()) ?? [];
|
|
1174
1071
|
if (u.length)
|
|
1175
|
-
for (const
|
|
1176
|
-
let
|
|
1177
|
-
if (
|
|
1178
|
-
|
|
1179
|
-
else if (
|
|
1180
|
-
|
|
1072
|
+
for (const w of u) {
|
|
1073
|
+
let C = 0, x = i.child, y = "center";
|
|
1074
|
+
if (w.c1 < f)
|
|
1075
|
+
x = s.child, y = "west";
|
|
1076
|
+
else if (h > 0 && w.c1 >= m - h)
|
|
1077
|
+
x = o.child, y = "east";
|
|
1181
1078
|
else {
|
|
1182
|
-
const
|
|
1183
|
-
|
|
1079
|
+
const v = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1080
|
+
C = this.scrollFactorX * v - this.areaBodyWestGeo.width, y = "center";
|
|
1184
1081
|
}
|
|
1185
|
-
this.drawBigCell(
|
|
1082
|
+
this.drawBigCell(w, C, t, d, x, y);
|
|
1186
1083
|
}
|
|
1187
1084
|
}
|
|
1188
1085
|
}
|
|
@@ -1196,58 +1093,58 @@ class ae extends re {
|
|
|
1196
1093
|
* @param sideIdent SideIdent (west,center,east)
|
|
1197
1094
|
* @protected
|
|
1198
1095
|
*/
|
|
1199
|
-
drawBigCell(e, t,
|
|
1200
|
-
const n =
|
|
1096
|
+
drawBigCell(e, t, s, i, o, r) {
|
|
1097
|
+
const n = s + this.getRowHeights(0, e.r1 - 1, i).reduce((c, u) => c + u, 0), l = this.tableModel.getColumnCount(), a = this.tableModel.getFixedRightColumnCount();
|
|
1201
1098
|
let d = 0;
|
|
1202
1099
|
a > 0 && e.c1 >= l - a && (d = l - a);
|
|
1203
|
-
const S = t + this.getColumnWidths(d, e.c1 - 1).reduce((
|
|
1204
|
-
let
|
|
1205
|
-
const
|
|
1206
|
-
|
|
1207
|
-
areaModel:
|
|
1208
|
-
areaIdent:
|
|
1100
|
+
const S = t + this.getColumnWidths(d, e.c1 - 1).reduce((c, u) => c + u, 0), g = this.getRowHeights(e.r1, e.r2, i).reduce((c, u) => c + u, 0), m = this.getColumnWidths(e.c1, e.c2).reduce((c, u) => c + u, 0);
|
|
1101
|
+
let h = !1;
|
|
1102
|
+
const f = this.getSelectionModel ? this.getSelectionModel() : void 0;
|
|
1103
|
+
f && (h = f.getSelectionCount(e.r1, e.c1) > 0), e.gammaRange ? (console.info("TODO here", e), this.renderCell({
|
|
1104
|
+
areaModel: i,
|
|
1105
|
+
areaIdent: i.areaIdent,
|
|
1209
1106
|
sideIdent: r,
|
|
1210
1107
|
rowIndex: e.r1,
|
|
1211
1108
|
columnIndex: e.c1,
|
|
1212
1109
|
left: S,
|
|
1213
1110
|
top: n,
|
|
1214
|
-
width:
|
|
1111
|
+
width: m,
|
|
1215
1112
|
height: g,
|
|
1216
1113
|
parent: o,
|
|
1217
|
-
cellSelected:
|
|
1114
|
+
cellSelected: h,
|
|
1218
1115
|
lastRowOfModel: !0,
|
|
1219
1116
|
gammaRange: e.gammaRange
|
|
1220
1117
|
})) : this.renderCell({
|
|
1221
|
-
areaModel:
|
|
1222
|
-
areaIdent:
|
|
1118
|
+
areaModel: i,
|
|
1119
|
+
areaIdent: i.areaIdent,
|
|
1223
1120
|
sideIdent: r,
|
|
1224
1121
|
rowIndex: e.r1,
|
|
1225
1122
|
columnIndex: e.c1,
|
|
1226
1123
|
left: S,
|
|
1227
1124
|
top: n,
|
|
1228
|
-
width:
|
|
1125
|
+
width: m,
|
|
1229
1126
|
height: g,
|
|
1230
1127
|
parent: o,
|
|
1231
|
-
cellSelected:
|
|
1128
|
+
cellSelected: h,
|
|
1232
1129
|
lastRowOfModel: !0,
|
|
1233
1130
|
gammaRange: e.gammaRange
|
|
1234
|
-
}),
|
|
1131
|
+
}), i.areaIdent === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1235
1132
|
rowIndex: e.r1,
|
|
1236
1133
|
columnIndex: e.c1,
|
|
1237
1134
|
cellLeft: S,
|
|
1238
1135
|
cellTop: n,
|
|
1239
|
-
cellWidth:
|
|
1136
|
+
cellWidth: m,
|
|
1240
1137
|
cellHeight: g,
|
|
1241
1138
|
parent: o
|
|
1242
1139
|
});
|
|
1243
1140
|
}
|
|
1244
|
-
findRowOfImportantRowspanCell(e, t,
|
|
1245
|
-
const
|
|
1141
|
+
findRowOfImportantRowspanCell(e, t, s) {
|
|
1142
|
+
const i = e.getMaxRowspan();
|
|
1246
1143
|
for (let o = t - 1; o > -1; o--) {
|
|
1247
|
-
const r = e.getRowspanAt(o,
|
|
1144
|
+
const r = e.getRowspanAt(o, s);
|
|
1248
1145
|
if (r > 1 && o + r + 1 >= t)
|
|
1249
1146
|
return o;
|
|
1250
|
-
if (t - o >
|
|
1147
|
+
if (t - o > i)
|
|
1251
1148
|
return -1;
|
|
1252
1149
|
}
|
|
1253
1150
|
return -1;
|
|
@@ -1255,8 +1152,8 @@ class ae extends re {
|
|
|
1255
1152
|
adjustColumnsToRowParent({
|
|
1256
1153
|
areaIdent: e,
|
|
1257
1154
|
sideIdent: t,
|
|
1258
|
-
areaModel:
|
|
1259
|
-
geo:
|
|
1155
|
+
areaModel: s,
|
|
1156
|
+
geo: i,
|
|
1260
1157
|
parent: o,
|
|
1261
1158
|
rowIndex: r,
|
|
1262
1159
|
columnIndexStart: n,
|
|
@@ -1264,59 +1161,59 @@ class ae extends re {
|
|
|
1264
1161
|
verticalFixed: a = !1,
|
|
1265
1162
|
lastRowOfModel: d = !1
|
|
1266
1163
|
}) {
|
|
1267
|
-
var
|
|
1164
|
+
var f;
|
|
1268
1165
|
this.scrollViewportLeft = this.scrollViewport.scrollLeft;
|
|
1269
1166
|
let S = 0;
|
|
1270
1167
|
if (!a) {
|
|
1271
|
-
const
|
|
1272
|
-
S = this.scrollFactorX *
|
|
1168
|
+
const c = this.areaBodyCenterGeo.width - this.tableModel.getContentWidthInPixel();
|
|
1169
|
+
S = this.scrollFactorX * c;
|
|
1273
1170
|
}
|
|
1274
|
-
const g = 0,
|
|
1275
|
-
let
|
|
1276
|
-
for (let
|
|
1277
|
-
const u =
|
|
1278
|
-
if (
|
|
1279
|
-
let
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
let
|
|
1283
|
-
|
|
1284
|
-
let
|
|
1285
|
-
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (
|
|
1286
|
-
this.renderDragTargetDiv(o, u, g,
|
|
1287
|
-
const
|
|
1288
|
-
this.dom.addColumnBorderDivs(this.tableOptions, o,
|
|
1171
|
+
const g = 0, m = !!(e === "body" && t);
|
|
1172
|
+
let h = S;
|
|
1173
|
+
for (let c = n; c <= l; c++) {
|
|
1174
|
+
const u = h, w = this.tableModel.getColumnWidth(c);
|
|
1175
|
+
if (w > 0 && u + w > 0) {
|
|
1176
|
+
let C = i.height;
|
|
1177
|
+
const x = s.getRowspanAt(r, c), y = s.getColspanAt(r, c);
|
|
1178
|
+
x > 1 && (C = this.getRowHeights(r, r + x - 1, s).reduce((A, M) => A + M, 0));
|
|
1179
|
+
let v = w;
|
|
1180
|
+
y > 1 && (v = this.getColumnWidths(c, c + y - 1).reduce((A, M) => A + M, 0));
|
|
1181
|
+
let E = !1;
|
|
1182
|
+
if (this.colAndRowspanModels && this.colAndRowspanModels[e] && (f = this.colAndRowspanModels[e]) != null && f.isInRange(r, c) && (E = !0), this.draggingTargetColumnIndex === c && e !== "header") {
|
|
1183
|
+
this.renderDragTargetDiv(o, u, g, v, C);
|
|
1184
|
+
const A = { left: u, top: g, width: v, height: C };
|
|
1185
|
+
this.dom.addColumnBorderDivs(this.tableOptions, o, A, e, t);
|
|
1289
1186
|
} else {
|
|
1290
|
-
const
|
|
1291
|
-
|
|
1292
|
-
areaModel:
|
|
1187
|
+
const A = this.renderSelectedBackgroundDiv(E, m, t, s, r, c, o, u, g, v, C);
|
|
1188
|
+
E || this.renderCell({
|
|
1189
|
+
areaModel: s,
|
|
1293
1190
|
areaIdent: e,
|
|
1294
1191
|
sideIdent: t,
|
|
1295
1192
|
rowIndex: r,
|
|
1296
|
-
columnIndex:
|
|
1193
|
+
columnIndex: c,
|
|
1297
1194
|
left: u,
|
|
1298
1195
|
top: g,
|
|
1299
|
-
width:
|
|
1300
|
-
height:
|
|
1196
|
+
width: v,
|
|
1197
|
+
height: C,
|
|
1301
1198
|
parent: o,
|
|
1302
|
-
cellSelected:
|
|
1199
|
+
cellSelected: A,
|
|
1303
1200
|
lastRowOfModel: d,
|
|
1304
1201
|
gammaRange: !0
|
|
1305
1202
|
}), e === "header" && this.tableOptions.columnsResizable && this.renderHeaderCellResizeHandle({
|
|
1306
1203
|
rowIndex: r,
|
|
1307
|
-
columnIndex:
|
|
1204
|
+
columnIndex: c,
|
|
1308
1205
|
cellLeft: u,
|
|
1309
1206
|
cellTop: g,
|
|
1310
|
-
cellWidth:
|
|
1311
|
-
cellHeight:
|
|
1207
|
+
cellWidth: v,
|
|
1208
|
+
cellHeight: C,
|
|
1312
1209
|
parent: o
|
|
1313
1210
|
});
|
|
1314
1211
|
}
|
|
1315
1212
|
}
|
|
1316
|
-
if (
|
|
1213
|
+
if (h = h + w, h > this.areaBodyCenterGeo.width)
|
|
1317
1214
|
break;
|
|
1318
1215
|
}
|
|
1319
|
-
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(
|
|
1216
|
+
this.tableOptions.verticalBorderVisible && this.dom.addVerticalBorder(new T(h - 1, 1, i.height, 0), o);
|
|
1320
1217
|
}
|
|
1321
1218
|
getTreeArrowColumnIndex() {
|
|
1322
1219
|
return this.tableOptions.showCheckboxWihoutExtraColumn ? 0 : this.tableModel.isRowCheckboxVisible() ? 1 : 0;
|
|
@@ -1324,78 +1221,103 @@ class ae extends re {
|
|
|
1324
1221
|
addAndRenderCellDiv({
|
|
1325
1222
|
areaModel: e,
|
|
1326
1223
|
areaIdent: t,
|
|
1327
|
-
sideIdent:
|
|
1328
|
-
rowIndex:
|
|
1224
|
+
sideIdent: s,
|
|
1225
|
+
rowIndex: i,
|
|
1329
1226
|
index: o,
|
|
1330
1227
|
left: r,
|
|
1331
1228
|
width: n,
|
|
1332
1229
|
height: l,
|
|
1333
1230
|
top: a,
|
|
1334
1231
|
parent: d,
|
|
1335
|
-
lastRowOfModel: S
|
|
1232
|
+
lastRowOfModel: S,
|
|
1233
|
+
gammaRange: g
|
|
1336
1234
|
}) {
|
|
1337
|
-
var
|
|
1338
|
-
const
|
|
1339
|
-
let
|
|
1340
|
-
if (o === this.getTreeArrowColumnIndex() &&
|
|
1341
|
-
const
|
|
1342
|
-
(
|
|
1235
|
+
var k;
|
|
1236
|
+
const h = this.editorRenderer && this.editorRendererRow === i && this.editorRendererColumn === o ? this.editorRenderer : e.getCellRenderer(i, o), f = { left: r, width: n, height: l, top: a, index: o }, c = e.getRowByIndex(i);
|
|
1237
|
+
let u = "none";
|
|
1238
|
+
if (o === this.getTreeArrowColumnIndex() && O(c)) {
|
|
1239
|
+
const b = c;
|
|
1240
|
+
(k = b.children) != null && k.length ? b.expanded ? u = "expanded" : u = "collapsed" : u = "hidden";
|
|
1343
1241
|
}
|
|
1344
|
-
let
|
|
1242
|
+
let C;
|
|
1345
1243
|
if (t === "header") {
|
|
1346
|
-
const
|
|
1347
|
-
(!(
|
|
1244
|
+
const b = this.tableModel.getColumnDef(o);
|
|
1245
|
+
(!(b != null && b.sortIconVisible) || b != null && b.sortIconVisible()) && (C = b == null ? void 0 : b.sortState);
|
|
1348
1246
|
}
|
|
1349
|
-
const x = e.getValueAt(
|
|
1247
|
+
const x = e.getValueAt(i, o), y = h ? "" : `${x}`, v = e.isRowChecked(i), E = this.dom.addColumnDiv(
|
|
1350
1248
|
d,
|
|
1351
|
-
|
|
1352
|
-
|
|
1249
|
+
f,
|
|
1250
|
+
i,
|
|
1353
1251
|
o,
|
|
1354
1252
|
t,
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1253
|
+
s,
|
|
1254
|
+
y,
|
|
1255
|
+
u,
|
|
1358
1256
|
this.tableOptions,
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
),
|
|
1362
|
-
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
let
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1369
|
-
const
|
|
1370
|
-
|
|
1257
|
+
v,
|
|
1258
|
+
C
|
|
1259
|
+
), A = e.getTooltipAt(i, o);
|
|
1260
|
+
A && this.dom.setAttribute(E, "title", A);
|
|
1261
|
+
const M = this.tableModel.getColumnDef(o);
|
|
1262
|
+
M && M.classes[t] && this.dom.addClasses(M.classes[t], E);
|
|
1263
|
+
let I;
|
|
1264
|
+
h && (I = h.render(E, i, o, t, e, x, this.dom.domService));
|
|
1265
|
+
const G = e.getCustomClassesAt(i, o);
|
|
1266
|
+
if (G.length && this.dom.addClasses(G, E), this.dom.addColumnBorderDivs(this.tableOptions, d, f, t, s), S && this.dom.addHorizontalBorder({ left: r, width: n, height: l, top: a + l }, d), this.getFocusModel && t === "body") {
|
|
1267
|
+
const b = this.getFocusModel();
|
|
1268
|
+
b != null && b.hasFocus(i, o) && this.dom.addFocusBorderDivs(d, f, {});
|
|
1371
1269
|
}
|
|
1372
|
-
t === "header" && this.dom.setAttribute(
|
|
1373
|
-
const
|
|
1374
|
-
if (
|
|
1375
|
-
for (const
|
|
1376
|
-
this.dom.setStyle(
|
|
1377
|
-
return [
|
|
1270
|
+
t === "header" && this.dom.setAttribute(E, "data-ge-action", "drag-column");
|
|
1271
|
+
const L = e.getCustomStyleAt(i, o);
|
|
1272
|
+
if (L)
|
|
1273
|
+
for (const b in L)
|
|
1274
|
+
this.dom.setStyle(E, b, L[b]);
|
|
1275
|
+
return [E, I];
|
|
1276
|
+
}
|
|
1277
|
+
applyCssClasses(e, t = {}) {
|
|
1278
|
+
e && Object.entries(t).forEach(([s, i]) => {
|
|
1279
|
+
i ? this.dom.addClass(s, e) : this.dom.removeClass(s, e);
|
|
1280
|
+
});
|
|
1378
1281
|
}
|
|
1379
|
-
|
|
1380
|
-
const
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1282
|
+
rerenderCellContent({ area: e, rowIndex: t, columnIndex: s, value: i, cssClasses: o }) {
|
|
1283
|
+
const r = this.tableModel.getAreaModel(e), n = 'div[data-col-index="' + s + '"][data-row-index="' + t + '"][data-area="' + e + '"]', l = document.querySelector(n);
|
|
1284
|
+
if (l) {
|
|
1285
|
+
let a;
|
|
1286
|
+
const S = this.editorRenderer && this.editorRendererRow === t && this.editorRendererColumn === s ? this.editorRenderer : r.getCellRenderer(t, s);
|
|
1287
|
+
if (l.innerText = "", this.applyCssClasses(l, o), S)
|
|
1288
|
+
a = S.render(l, t, s, e, r, i, this.dom.domService), a && this.cleanupFunctions[e].push(a);
|
|
1289
|
+
else {
|
|
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
|
+
}
|
|
1384
1300
|
}
|
|
1385
|
-
|
|
1301
|
+
getColumnWidths(e, t) {
|
|
1386
1302
|
const s = [];
|
|
1387
|
-
for (let
|
|
1388
|
-
s.push(
|
|
1303
|
+
for (let i = e; i <= t; i++)
|
|
1304
|
+
s.push(this.tableModel.getColumnWidth(i));
|
|
1389
1305
|
return s;
|
|
1390
1306
|
}
|
|
1307
|
+
getRowHeights(e, t, s) {
|
|
1308
|
+
const i = [];
|
|
1309
|
+
for (let o = e; o <= t; o++)
|
|
1310
|
+
i.push(s.getRowHeight(o));
|
|
1311
|
+
return i;
|
|
1312
|
+
}
|
|
1391
1313
|
adjustHoverRows(e) {
|
|
1392
1314
|
if (this.tableOptions.hoverRowVisible && e.rowIndex > -1) {
|
|
1393
|
-
const t = this.hostElement.clientWidth,
|
|
1315
|
+
const t = this.hostElement.clientWidth, s = this.tableModel.getAreaModel("body").getRowHeight(e.rowIndex), i = e.rowTop + this.areaHeaderCenter.parent.clientHeight - this.scrollTop;
|
|
1394
1316
|
this.dom.applyStyle(this.hoverRow, {
|
|
1395
1317
|
left: "0",
|
|
1396
|
-
top:
|
|
1318
|
+
top: i + "px",
|
|
1397
1319
|
width: t + "px",
|
|
1398
|
-
height:
|
|
1320
|
+
height: s + "px",
|
|
1399
1321
|
display: "block"
|
|
1400
1322
|
});
|
|
1401
1323
|
} else
|
|
@@ -1408,11 +1330,11 @@ class ae extends re {
|
|
|
1408
1330
|
}
|
|
1409
1331
|
adjustHoverColumns(e) {
|
|
1410
1332
|
if (this.tableOptions.hoverColumnVisible && e.rowIndex > -1) {
|
|
1411
|
-
const t = this.hostElement.clientHeight,
|
|
1333
|
+
const t = this.hostElement.clientHeight, s = this.tableModel.getColumnWidth(e.columnIndex), i = this.areaBodyWestGeo.width, o = e.columnLeft + this.tableModel.getPadding().left - this.scrollLeft - i;
|
|
1412
1334
|
this.dom.applyStyle(this.hoverColumn, {
|
|
1413
1335
|
left: o + "px",
|
|
1414
1336
|
top: "0px",
|
|
1415
|
-
width:
|
|
1337
|
+
width: s + "px",
|
|
1416
1338
|
height: t + "px",
|
|
1417
1339
|
display: "block"
|
|
1418
1340
|
});
|
|
@@ -1427,25 +1349,25 @@ class ae extends re {
|
|
|
1427
1349
|
debounce(e, t = 1e3) {
|
|
1428
1350
|
this.debounceTimeout && clearTimeout(this.debounceTimeout), this.debounceTimeout = setTimeout(e.bind(this), t);
|
|
1429
1351
|
}
|
|
1430
|
-
renderDragTargetDiv(e, t,
|
|
1352
|
+
renderDragTargetDiv(e, t, s, i, o) {
|
|
1431
1353
|
const r = this.dom.applyStylePosistionAbsolute(
|
|
1432
1354
|
this.dom.createDivWithClass("ge-table-drop-zone", e)
|
|
1433
1355
|
);
|
|
1434
|
-
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${
|
|
1356
|
+
return this.dom.setStyle(r, "left", `${t}px`), this.dom.setStyle(r, "top", `${s}px`), this.dom.setStyle(r, "width", `${i}px`), this.dom.setStyle(r, "height", `${o}px`), r;
|
|
1435
1357
|
}
|
|
1436
|
-
renderSelectedBackgroundDiv(e, t,
|
|
1358
|
+
renderSelectedBackgroundDiv(e, t, s, i, o, r, n, l, a, d, S) {
|
|
1437
1359
|
let g = !1;
|
|
1438
|
-
if (!e && t &&
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1441
|
-
const
|
|
1442
|
-
g =
|
|
1443
|
-
for (let
|
|
1444
|
-
const
|
|
1360
|
+
if (!e && t && i.isSelectable(o, r) && this.getSelectionModel) {
|
|
1361
|
+
const m = this.getSelectionModel();
|
|
1362
|
+
if (m) {
|
|
1363
|
+
const h = m.getSelectionCount(o, r);
|
|
1364
|
+
g = h > 0;
|
|
1365
|
+
for (let f = 0; f < h; f++) {
|
|
1366
|
+
const c = this.dom.applyStylePosistionAbsolute(
|
|
1445
1367
|
// ge-table-body-west-selected-range
|
|
1446
|
-
this.dom.createDivWithClass(`ge-table-${
|
|
1368
|
+
this.dom.createDivWithClass(`ge-table-${i.areaIdent}-${s}-selected-range`, n)
|
|
1447
1369
|
);
|
|
1448
|
-
this.dom.setStyle(
|
|
1370
|
+
this.dom.setStyle(c, "left", `${l}px`), this.dom.setStyle(c, "top", `${a}px`), this.dom.setStyle(c, "width", `${d}px`), this.dom.setStyle(c, "height", `${S}px`);
|
|
1449
1371
|
}
|
|
1450
1372
|
}
|
|
1451
1373
|
}
|
|
@@ -1454,8 +1376,8 @@ class ae extends re {
|
|
|
1454
1376
|
renderCell({
|
|
1455
1377
|
areaModel: e,
|
|
1456
1378
|
areaIdent: t,
|
|
1457
|
-
sideIdent:
|
|
1458
|
-
rowIndex:
|
|
1379
|
+
sideIdent: s,
|
|
1380
|
+
rowIndex: i,
|
|
1459
1381
|
columnIndex: o,
|
|
1460
1382
|
left: r,
|
|
1461
1383
|
top: n,
|
|
@@ -1464,13 +1386,13 @@ class ae extends re {
|
|
|
1464
1386
|
parent: d,
|
|
1465
1387
|
cellSelected: S,
|
|
1466
1388
|
lastRowOfModel: g,
|
|
1467
|
-
gammaRange:
|
|
1389
|
+
gammaRange: m
|
|
1468
1390
|
}) {
|
|
1469
|
-
const [
|
|
1391
|
+
const [h, f] = this.addAndRenderCellDiv({
|
|
1470
1392
|
areaModel: e,
|
|
1471
1393
|
areaIdent: t,
|
|
1472
|
-
sideIdent:
|
|
1473
|
-
rowIndex:
|
|
1394
|
+
sideIdent: s,
|
|
1395
|
+
rowIndex: i,
|
|
1474
1396
|
index: o,
|
|
1475
1397
|
left: r,
|
|
1476
1398
|
width: l,
|
|
@@ -1478,72 +1400,80 @@ class ae extends re {
|
|
|
1478
1400
|
top: n,
|
|
1479
1401
|
parent: d,
|
|
1480
1402
|
lastRowOfModel: g,
|
|
1481
|
-
gammaRange:
|
|
1403
|
+
gammaRange: m
|
|
1482
1404
|
});
|
|
1483
|
-
S && this.dom.addClass(`ge-table-${t}-${
|
|
1405
|
+
S && this.dom.addClass(`ge-table-${t}-${s}-selected-range`, h), f && this.cleanupFunctions[t].push(f);
|
|
1484
1406
|
}
|
|
1485
|
-
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft:
|
|
1407
|
+
renderHeaderCellResizeHandle({ rowIndex: e, columnIndex: t, cellLeft: s, cellTop: i, cellWidth: o, cellHeight: r, parent: n }) {
|
|
1486
1408
|
const l = this.dom.domService, a = this.tableOptions.columnResizeHandleWidthInPx ?? 2, d = l.createElement("div");
|
|
1487
|
-
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", `${
|
|
1409
|
+
l.setAttribute(d, "data-col-index", `${t}`), l.setAttribute(d, "data-row-index", `${e}`), l.setAttribute(d, "data-area", "header"), l.setAttribute(d, "data-ge-action", "resize-column"), l.addClass(d, "ge-table-column-resize-handle"), l.setStyle(d, "display", "clip"), l.setStyle(d, "position", "absolute"), l.setStyle(d, "cursor", "col-resize"), l.setStyle(d, "left", `${s + o - a}px`), l.setStyle(d, "top", `${i}px`), l.setStyle(d, "width", `${a}px`), l.setStyle(d, "height", `${r}px`), l.appendChild(n, d);
|
|
1488
1410
|
}
|
|
1489
1411
|
}
|
|
1490
|
-
class
|
|
1412
|
+
class ce {
|
|
1491
1413
|
constructor(e, t) {
|
|
1492
1414
|
this.columnIndex = e, this.sortState = t;
|
|
1493
1415
|
}
|
|
1494
1416
|
}
|
|
1495
|
-
class
|
|
1417
|
+
class pe {
|
|
1496
1418
|
constructor(e) {
|
|
1497
1419
|
this.tableScope = e, this.tableScope.hostElement.addEventListener("change", this.onHostElementChanged.bind(this));
|
|
1498
1420
|
}
|
|
1421
|
+
/**
|
|
1422
|
+
* Handles the onHostElementChanged event.
|
|
1423
|
+
* In case that the element is an input field, the tableScope.updateModelValueAfterEdit() method is triggered.
|
|
1424
|
+
*
|
|
1425
|
+
* @param {Event} event - The event object.
|
|
1426
|
+
*
|
|
1427
|
+
* @return {void}
|
|
1428
|
+
*/
|
|
1499
1429
|
onHostElementChanged(e) {
|
|
1500
1430
|
if (e.target instanceof HTMLInputElement || e.target instanceof HTMLSelectElement || e.target instanceof HTMLTextAreaElement) {
|
|
1501
|
-
const t = e.target,
|
|
1502
|
-
if (
|
|
1503
|
-
const r =
|
|
1431
|
+
const t = e.target, s = t.getAttribute("data-area"), i = t.getAttribute("data-row-index"), o = t.getAttribute("data-col-index");
|
|
1432
|
+
if (s && i && o) {
|
|
1433
|
+
const r = H(s), n = Number(i), l = Number(o);
|
|
1504
1434
|
this.tableScope.updateModelValueAfterEdit(r, n, l, t.value);
|
|
1505
1435
|
}
|
|
1506
1436
|
}
|
|
1507
1437
|
}
|
|
1508
1438
|
}
|
|
1509
|
-
class
|
|
1439
|
+
class ue {
|
|
1510
1440
|
constructor(e = -1, t = -1) {
|
|
1511
1441
|
this.rowIndex = e, this.columnIndex = t;
|
|
1512
1442
|
}
|
|
1513
1443
|
}
|
|
1514
|
-
class
|
|
1444
|
+
class V {
|
|
1515
1445
|
constructor(e) {
|
|
1516
1446
|
this.cells = e;
|
|
1517
1447
|
}
|
|
1518
1448
|
static createSingle(e, t) {
|
|
1519
|
-
return new
|
|
1449
|
+
return new V([new ue(e, t)]);
|
|
1520
1450
|
}
|
|
1521
1451
|
}
|
|
1522
|
-
class
|
|
1452
|
+
class Se {
|
|
1523
1453
|
constructor(e) {
|
|
1524
|
-
var t,
|
|
1525
|
-
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (
|
|
1454
|
+
var t, s;
|
|
1455
|
+
this.tableScope = e, (t = this.tableScope.tableOptions) != null && t.getSelectionModel && (this.getSelectionModel = this.tableScope.tableOptions.getSelectionModel), (s = this.tableScope.tableOptions) != null && s.getFocusModel && (this.getFocusModel = this.tableScope.tableOptions.getFocusModel);
|
|
1526
1456
|
}
|
|
1527
1457
|
onMouseClicked(e, t) {
|
|
1528
1458
|
var o, r, n, l, a, d, S;
|
|
1529
|
-
let
|
|
1459
|
+
let s = !1, i = !1;
|
|
1530
1460
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1531
|
-
const g = this.getSelectionModel(),
|
|
1532
|
-
g &&
|
|
1461
|
+
const g = this.getSelectionModel(), m = this.getFocusModel();
|
|
1462
|
+
g && m && (m.hasFocus(e.rowIndex, e.columnIndex) || (m.setFocus(e.rowIndex, e.columnIndex), s = !0), (o = e.originalEvent) != null && o.shiftKey || g.hasSelection() && (g.clear(), s = !0), (r = e.originalEvent) != null && r.shiftKey && this.previousEvt ? (g.addSelection(this.createRangeByEvents(e, this.previousEvt)), i = !0, s = !0) : (n = e.originalEvent) != null && n.ctrlKey || (l = e.originalEvent) != null && l.metaKey ? (g.addSelection(R.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0) : (a = e.originalEvent) != null && a.altKey && ((d = e.originalEvent) != null && d.ctrlKey || (S = e.originalEvent) != null && S.metaKey) && (g.removeSelection(R.singleCell(e.rowIndex, e.columnIndex)), i = !0, s = !0));
|
|
1533
1463
|
}
|
|
1534
|
-
return
|
|
1464
|
+
return i ? this.previousEvt = void 0 : this.previousEvt = e == null ? void 0 : e.clone(), s;
|
|
1535
1465
|
}
|
|
1536
1466
|
onActionTriggered(e) {
|
|
1537
1467
|
if (this.getSelectionModel && this.getFocusModel) {
|
|
1538
|
-
const t = this.getSelectionModel(),
|
|
1539
|
-
if (t &&
|
|
1468
|
+
const t = this.getSelectionModel(), s = this.getFocusModel();
|
|
1469
|
+
if (t && s) {
|
|
1540
1470
|
if (e === "SELECT_ALL")
|
|
1541
1471
|
return t.selectAll(), this.tableScope.repaint(), !0;
|
|
1542
1472
|
if (e === "DESELECT_ALL")
|
|
1543
1473
|
return t.clear(), this.tableScope.repaint(), !0;
|
|
1544
1474
|
if (e === "TOGGLE_SELECTION") {
|
|
1545
|
-
const [
|
|
1546
|
-
return t.togglePoint(
|
|
1475
|
+
const [i, o] = s.getFocus();
|
|
1476
|
+
return t.togglePoint(i, o), this.tableScope.repaint(), !0;
|
|
1547
1477
|
}
|
|
1548
1478
|
}
|
|
1549
1479
|
}
|
|
@@ -1551,16 +1481,16 @@ class pe {
|
|
|
1551
1481
|
}
|
|
1552
1482
|
createRangeByEvents(e, t) {
|
|
1553
1483
|
t || (t = e);
|
|
1554
|
-
const
|
|
1555
|
-
return
|
|
1556
|
-
rowIndex1:
|
|
1484
|
+
const s = Math.min(e.rowIndex, t == null ? void 0 : t.rowIndex), i = Math.max(e.rowIndex, t == null ? void 0 : t.rowIndex), o = Math.min(e.columnIndex, t == null ? void 0 : t.columnIndex), r = Math.max(e.columnIndex, t == null ? void 0 : t.columnIndex);
|
|
1485
|
+
return R.create({
|
|
1486
|
+
rowIndex1: s,
|
|
1557
1487
|
columnIndex1: o,
|
|
1558
|
-
rowIndex2:
|
|
1488
|
+
rowIndex2: i,
|
|
1559
1489
|
columnIndex2: r
|
|
1560
1490
|
});
|
|
1561
1491
|
}
|
|
1562
1492
|
}
|
|
1563
|
-
class
|
|
1493
|
+
class ge {
|
|
1564
1494
|
get() {
|
|
1565
1495
|
return {
|
|
1566
1496
|
f2: "START_EDITING",
|
|
@@ -1578,7 +1508,7 @@ class ue {
|
|
|
1578
1508
|
};
|
|
1579
1509
|
}
|
|
1580
1510
|
}
|
|
1581
|
-
class
|
|
1511
|
+
class me {
|
|
1582
1512
|
get() {
|
|
1583
1513
|
return {
|
|
1584
1514
|
f2: "START_EDITING",
|
|
@@ -1598,7 +1528,7 @@ class Se {
|
|
|
1598
1528
|
};
|
|
1599
1529
|
}
|
|
1600
1530
|
}
|
|
1601
|
-
class
|
|
1531
|
+
class fe {
|
|
1602
1532
|
constructor(e) {
|
|
1603
1533
|
this.tableScope = e, this.shortcutActionIdMapping = {}, this.listener = [], this.listener.push(e), this.init();
|
|
1604
1534
|
}
|
|
@@ -1606,7 +1536,7 @@ class ge {
|
|
|
1606
1536
|
this.listener.includes(e) || this.listener.push(e);
|
|
1607
1537
|
}
|
|
1608
1538
|
init() {
|
|
1609
|
-
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new
|
|
1539
|
+
this.isMacintosh() ? Object.assign(this.shortcutActionIdMapping, new me().get()) : Object.assign(this.shortcutActionIdMapping, new ge().get()), Object.assign(this.shortcutActionIdMapping, this.tableScope.tableOptions.shortcutActionIdMapping), this.isDebug() && console.debug("ShortcutService", this.shortcutActionIdMapping), this.tableScope.hostElement.addEventListener("keydown", this.onKeyDown.bind(this));
|
|
1610
1540
|
}
|
|
1611
1541
|
isMacintosh() {
|
|
1612
1542
|
return navigator.platform.indexOf("Mac") > -1;
|
|
@@ -1624,24 +1554,24 @@ class ge {
|
|
|
1624
1554
|
emit(e) {
|
|
1625
1555
|
this.isDebug() && console.debug("ShortcutService emit:", e);
|
|
1626
1556
|
let t = !1;
|
|
1627
|
-
for (const
|
|
1628
|
-
|
|
1557
|
+
for (const s of this.listener)
|
|
1558
|
+
s.onActionTriggered(e) && (t = !0);
|
|
1629
1559
|
return t;
|
|
1630
1560
|
}
|
|
1631
1561
|
findEnty(e) {
|
|
1632
1562
|
const t = this.getTokenByEvent(e);
|
|
1633
1563
|
this.isDebug() && console.debug("ShortcutService tokens:", t);
|
|
1634
|
-
for (const
|
|
1635
|
-
const
|
|
1636
|
-
if (this.areTokensEquals(t,
|
|
1637
|
-
return this.shortcutActionIdMapping[
|
|
1564
|
+
for (const s in this.shortcutActionIdMapping) {
|
|
1565
|
+
const i = s.replace(/opt/g, "alt").replace(/cmd/g, "meta").split(/[\+ ]/g).sort();
|
|
1566
|
+
if (this.areTokensEquals(t, i))
|
|
1567
|
+
return this.shortcutActionIdMapping[s];
|
|
1638
1568
|
}
|
|
1639
1569
|
}
|
|
1640
1570
|
areTokensEquals(e, t) {
|
|
1641
1571
|
if (e.length !== t.length || e.length === 0)
|
|
1642
1572
|
return !1;
|
|
1643
|
-
for (let
|
|
1644
|
-
if (e[
|
|
1573
|
+
for (let s = 0; s < e.length; s++)
|
|
1574
|
+
if (e[s] !== t[s])
|
|
1645
1575
|
return !1;
|
|
1646
1576
|
return !0;
|
|
1647
1577
|
}
|
|
@@ -1650,7 +1580,7 @@ class ge {
|
|
|
1650
1580
|
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();
|
|
1651
1581
|
}
|
|
1652
1582
|
}
|
|
1653
|
-
class
|
|
1583
|
+
class N {
|
|
1654
1584
|
onCheckboxChanged(e) {
|
|
1655
1585
|
}
|
|
1656
1586
|
onContextmenu(e) {
|
|
@@ -1666,19 +1596,164 @@ class fe {
|
|
|
1666
1596
|
onMouseMoved(e) {
|
|
1667
1597
|
}
|
|
1668
1598
|
}
|
|
1669
|
-
class
|
|
1670
|
-
|
|
1599
|
+
class K {
|
|
1600
|
+
setStyle(e, t, s) {
|
|
1601
|
+
return e.style[t] = s, e;
|
|
1602
|
+
}
|
|
1603
|
+
appendText(e, t) {
|
|
1604
|
+
const s = this.createText(t);
|
|
1605
|
+
return this.appendChild(e, s), s;
|
|
1606
|
+
}
|
|
1607
|
+
addClass(e, t) {
|
|
1608
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.add(s)) : e.classList.add(t), e;
|
|
1609
|
+
}
|
|
1610
|
+
removeClass(e, t) {
|
|
1611
|
+
return t.includes(" ") ? t.split(" ").forEach((s) => e.classList.remove(s)) : e.classList.remove(t), e;
|
|
1612
|
+
}
|
|
1613
|
+
appendChild(e, t) {
|
|
1614
|
+
e.appendChild(t);
|
|
1615
|
+
}
|
|
1616
|
+
createElement(e) {
|
|
1617
|
+
return document.createElement(e);
|
|
1618
|
+
}
|
|
1619
|
+
createText(e) {
|
|
1620
|
+
return document.createTextNode(e);
|
|
1621
|
+
}
|
|
1622
|
+
setAttribute(e, t, s) {
|
|
1623
|
+
e.setAttribute(t, s);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
class be {
|
|
1627
|
+
render(e, t, s, i, o, r, n) {
|
|
1628
|
+
if (o.isEditable(t, s)) {
|
|
1629
|
+
n.addClass(e, "ge-table-row-input-div");
|
|
1630
|
+
const l = o.getValueAt(t, s);
|
|
1631
|
+
e.innerHTML = `
|
|
1632
|
+
<input
|
|
1633
|
+
type="text"
|
|
1634
|
+
value="${l}"
|
|
1635
|
+
autofocus
|
|
1636
|
+
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1637
|
+
data-listen="change"
|
|
1638
|
+
data-area="${i}"
|
|
1639
|
+
data-row-index="${t}"
|
|
1640
|
+
data-col-index="${s}"
|
|
1641
|
+
data-input-type="text"
|
|
1642
|
+
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1643
|
+
class="ge-table-cell-editor-input">`;
|
|
1644
|
+
}
|
|
1645
|
+
}
|
|
1646
|
+
}
|
|
1647
|
+
class ye {
|
|
1648
|
+
constructor(e = "none", t = "single") {
|
|
1649
|
+
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1650
|
+
}
|
|
1651
|
+
getSelectionCount(e, t) {
|
|
1652
|
+
let s = 0;
|
|
1653
|
+
for (const i of this.ranges)
|
|
1654
|
+
i.isInRange(e, t) && s++;
|
|
1655
|
+
return this.allSelected && s++, this.isInNegativeRange(e, t) && (s = 0), s;
|
|
1656
|
+
}
|
|
1657
|
+
isInNegativeRange(e, t) {
|
|
1658
|
+
for (const s of this.negativeRanges)
|
|
1659
|
+
if (s.isInRange(e, t))
|
|
1660
|
+
return !0;
|
|
1661
|
+
return !1;
|
|
1662
|
+
}
|
|
1663
|
+
getRanges() {
|
|
1664
|
+
return this.ranges;
|
|
1665
|
+
}
|
|
1666
|
+
clear() {
|
|
1667
|
+
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1668
|
+
}
|
|
1669
|
+
hasSelection() {
|
|
1670
|
+
return !!this.ranges.length;
|
|
1671
|
+
}
|
|
1672
|
+
selectAll() {
|
|
1673
|
+
this.allSelected = !0;
|
|
1674
|
+
}
|
|
1675
|
+
addSelection(e) {
|
|
1676
|
+
this.addRange(e);
|
|
1677
|
+
}
|
|
1678
|
+
removeSelection(e) {
|
|
1679
|
+
if (this.selectionType === "none")
|
|
1680
|
+
return;
|
|
1681
|
+
let t = e;
|
|
1682
|
+
this.selectionType === "row" ? t = R.singleRow(e.r1) : this.selectionType === "column" && (t = R.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1683
|
+
}
|
|
1684
|
+
togglePoint(e, t) {
|
|
1685
|
+
this.getSelectionCount(e, t) > 0 ? this.removeSelection(R.singleCell(e, t)) : this.addSelection(R.singleCell(e, t));
|
|
1686
|
+
}
|
|
1687
|
+
addRange(e) {
|
|
1688
|
+
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
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
class ve {
|
|
1692
|
+
constructor(e = "none") {
|
|
1693
|
+
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1694
|
+
}
|
|
1695
|
+
clearChanged() {
|
|
1696
|
+
this.changed = !1;
|
|
1697
|
+
}
|
|
1698
|
+
hasChanged() {
|
|
1699
|
+
return this.changed;
|
|
1700
|
+
}
|
|
1701
|
+
clear() {
|
|
1702
|
+
this.rowIndex = -1, this.columnIndex = -1;
|
|
1703
|
+
}
|
|
1704
|
+
setFocus(e, t) {
|
|
1705
|
+
(this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
|
|
1706
|
+
}
|
|
1707
|
+
hasFocus(e, t) {
|
|
1708
|
+
return this.rowIndex === e && this.columnIndex === t;
|
|
1709
|
+
}
|
|
1710
|
+
getFocus() {
|
|
1711
|
+
return [this.rowIndex, this.columnIndex];
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
const Ce = new ye(), xe = new ve("cell");
|
|
1715
|
+
class Y {
|
|
1716
|
+
constructor() {
|
|
1717
|
+
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
|
+
header: 34,
|
|
1719
|
+
body: 34,
|
|
1720
|
+
footer: 34
|
|
1721
|
+
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new X(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new z(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new be(), this.getSelectionModel = () => Ce, this.getFocusModel = () => xe;
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
class _ extends he {
|
|
1725
|
+
constructor(e, t, s, i, o) {
|
|
1671
1726
|
var r;
|
|
1672
1727
|
if (super(
|
|
1673
1728
|
e,
|
|
1674
1729
|
t,
|
|
1675
|
-
new
|
|
1676
|
-
|
|
1677
|
-
), this.eventListener = o, this.selectionService = new
|
|
1730
|
+
new Z(s),
|
|
1731
|
+
i
|
|
1732
|
+
), this.eventListener = o, this.selectionService = new Se(this), this.api = new se(this), this.mouseStartAction = "", this.mouseStartWidth = -1, this.mouseStartColumnIndex = -1, this.dragFrom = -1, this.dragTo = -1, o || (this.eventListener = new N()), (r = this.tableOptions) != null && r.autoRestoreOptions) {
|
|
1678
1733
|
const n = this.tableOptions.autoRestoreOptions, l = n.getStorageKeyFn;
|
|
1679
|
-
l && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new
|
|
1734
|
+
l && (n.autoRestoreScrollPosition && (this.storeScrollPosStateService = new ie(l)), n.autoRestoreCollapsedExpandedState && (this.storeStateCollapsedExpandService = new le(l)), n.autoRestoreSortingState && (this.storeSortingService = new re(l)));
|
|
1680
1735
|
}
|
|
1681
|
-
this.mouseHandler = new
|
|
1736
|
+
this.mouseHandler = new te(this), this.inputHandler = new pe(this), this.shortcutService = new fe(this), this.shortcutService.addListener(this.selectionService);
|
|
1737
|
+
}
|
|
1738
|
+
/**
|
|
1739
|
+
* Creates a TableScope instance.
|
|
1740
|
+
*
|
|
1741
|
+
* @param {HTMLDivElement} hostElement - The HTML div element that will contain the table.
|
|
1742
|
+
* @param {TableModelIf} tableModel - The table model object.
|
|
1743
|
+
* @param {TableOptionsIf} [tableOptions=new TableOptions()] - The optional table options object.
|
|
1744
|
+
* @param {EventListenerIf} [eventListener=new EventAdapter()] - The optional event listener object.
|
|
1745
|
+
* @param {DomServiceIf} [domService=new SimpleDomService()] - The optional DOM service object.
|
|
1746
|
+
*
|
|
1747
|
+
* @return {TableScope} - The newly created TableScope instance.
|
|
1748
|
+
*/
|
|
1749
|
+
static create(e, t, s = new Y(), i = new N(), o = new K()) {
|
|
1750
|
+
return new _(
|
|
1751
|
+
e,
|
|
1752
|
+
t,
|
|
1753
|
+
o,
|
|
1754
|
+
s,
|
|
1755
|
+
i
|
|
1756
|
+
);
|
|
1682
1757
|
}
|
|
1683
1758
|
onActionTriggered(e) {
|
|
1684
1759
|
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))
|
|
@@ -1686,131 +1761,260 @@ class me extends ae {
|
|
|
1686
1761
|
if (e === "START_EDITING" && this.getFocusModel) {
|
|
1687
1762
|
const t = this.getFocusModel();
|
|
1688
1763
|
if (t) {
|
|
1689
|
-
const [
|
|
1690
|
-
this.tableModel.getBodyModel().isEditable(
|
|
1764
|
+
const [s, i] = t.getFocus();
|
|
1765
|
+
this.tableModel.getBodyModel().isEditable(s, i) && (this.clearSelection(), this.initRenderEditor(s, i));
|
|
1691
1766
|
}
|
|
1692
1767
|
return !0;
|
|
1693
1768
|
}
|
|
1694
1769
|
return !1;
|
|
1695
1770
|
}
|
|
1696
|
-
updateModelValueAfterEdit(e, t,
|
|
1697
|
-
e === "body" && this.tableModel.getAreaModel(e).setValue(t,
|
|
1771
|
+
updateModelValueAfterEdit(e, t, s, i) {
|
|
1772
|
+
e === "body" && this.tableModel.getAreaModel(e).setValue(t, s, i) && (this.resetEditorRenderer(), this.repaint(), this.eventListener.onModelChanged(V.createSingle(t, s)), this.hostElement.focus());
|
|
1698
1773
|
}
|
|
1774
|
+
/**
|
|
1775
|
+
* Retrieves the TableApi object.
|
|
1776
|
+
*
|
|
1777
|
+
* @return {TableApi} The TableApi object.
|
|
1778
|
+
*/
|
|
1699
1779
|
getApi() {
|
|
1700
1780
|
return this.api;
|
|
1701
1781
|
}
|
|
1702
|
-
|
|
1703
|
-
* Called by the table component
|
|
1782
|
+
/**
|
|
1783
|
+
* Initializes the table. Called by the table component.
|
|
1784
|
+
*
|
|
1785
|
+
* @function firstInit
|
|
1786
|
+
* @memberof TableScope
|
|
1787
|
+
*
|
|
1788
|
+
* @returns {TableScope} This instance of the table scope.
|
|
1704
1789
|
*/
|
|
1705
1790
|
firstInit() {
|
|
1706
1791
|
var e;
|
|
1707
|
-
this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition();
|
|
1792
|
+
return this.tableModel.init(), (e = this.tableOptions) != null && e.externalFilterFunction && this.externalFilterChanged(!1), this.autoRestoreCollapsedExpandedState(), this.autoRestoreSortingState(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows(), this.autoRestoreScrollPosition(), this;
|
|
1708
1793
|
}
|
|
1794
|
+
/**
|
|
1795
|
+
* Creates a GeMouseEvent object based on a MouseEvent.
|
|
1796
|
+
*
|
|
1797
|
+
* @param {MouseEvent} mouseEvent - The MouseEvent object to create the GeMouseEvent from.
|
|
1798
|
+
* @return {GeMouseEvent} - The created GeMouseEvent object.
|
|
1799
|
+
*/
|
|
1709
1800
|
createGeMouseEvent(e) {
|
|
1710
|
-
const t = new
|
|
1801
|
+
const t = new W();
|
|
1711
1802
|
if (t.originalEvent = e, e) {
|
|
1712
|
-
const
|
|
1713
|
-
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(
|
|
1714
|
-
const
|
|
1715
|
-
t.rowTop =
|
|
1803
|
+
const s = e.target;
|
|
1804
|
+
if ([t.areaIdent, t.sideIdent] = this.getAreaAndSideIdentByAttr(s), t.rowIndex = this.getNumberByAttr(s, "data-row-index"), t.columnIndex = this.getNumberByAttr(s, "data-col-index"), t.action = this.getStringByAttr(s, "data-ge-action"), t.areaIdent) {
|
|
1805
|
+
const i = this.tableModel.getAreaModel(t.areaIdent);
|
|
1806
|
+
t.rowTop = i.getYPosByRowIndex(t.rowIndex);
|
|
1716
1807
|
}
|
|
1717
1808
|
if (t.columnLeft = this.tableModel.getXPosByColumnIndex(t.columnIndex), e.ctrlKey && e.altKey) {
|
|
1718
|
-
const
|
|
1719
|
-
this.debugOnce(o,
|
|
1809
|
+
const i = e.clientY - this.hostElement.offsetTop - this.areaHeaderCenter.parent.clientHeight, o = e.clientX - this.hostElement.offsetLeft - this.areaBodyWestGeo.width;
|
|
1810
|
+
this.debugOnce(o, i);
|
|
1720
1811
|
}
|
|
1721
1812
|
}
|
|
1722
1813
|
return t;
|
|
1723
1814
|
}
|
|
1815
|
+
/**
|
|
1816
|
+
* Handles the mouse down event.
|
|
1817
|
+
*
|
|
1818
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
1819
|
+
* @return {void}
|
|
1820
|
+
*/
|
|
1724
1821
|
onMouseDown(e) {
|
|
1725
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));
|
|
1726
1823
|
}
|
|
1824
|
+
/**
|
|
1825
|
+
* Handles mouse dragging on the frame.
|
|
1826
|
+
*
|
|
1827
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
1828
|
+
*/
|
|
1727
1829
|
mouseDraggingOnFrame(e) {
|
|
1728
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());
|
|
1729
1831
|
}
|
|
1832
|
+
/**
|
|
1833
|
+
* Handles the end of mouse dragging event on a frame.
|
|
1834
|
+
*
|
|
1835
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event object.
|
|
1836
|
+
*
|
|
1837
|
+
* @returns {void}
|
|
1838
|
+
*/
|
|
1730
1839
|
mouseDraggingEndOnFrame(e) {
|
|
1731
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 = "";
|
|
1732
1841
|
}
|
|
1842
|
+
/**
|
|
1843
|
+
* Handles the mouse move event.
|
|
1844
|
+
*
|
|
1845
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
1846
|
+
* @return {void}
|
|
1847
|
+
*/
|
|
1733
1848
|
mouseMove(e) {
|
|
1734
1849
|
this.eventListener.onMouseMoved(e), this.adjustHoverRows(e), this.adjustHoverColumns(e);
|
|
1735
1850
|
}
|
|
1851
|
+
/**
|
|
1852
|
+
* Triggers the context menu event based on the mouse move event.
|
|
1853
|
+
*
|
|
1854
|
+
* @param {GeMouseEvent} mouseMoveEvent - The mouse move event object.
|
|
1855
|
+
* @return {void}
|
|
1856
|
+
*/
|
|
1736
1857
|
contextmenu(e) {
|
|
1737
1858
|
this.eventListener.onContextmenu(e);
|
|
1738
1859
|
}
|
|
1860
|
+
/**
|
|
1861
|
+
* Toggles the expand or collapse state of all items in the body area model.
|
|
1862
|
+
*
|
|
1863
|
+
* @param {boolean} [expand=true] - Whether to expand or collapse all items. Default is true.
|
|
1864
|
+
*
|
|
1865
|
+
* @return {void}
|
|
1866
|
+
*/
|
|
1739
1867
|
toggleExpandCollapseAll(e = !0) {
|
|
1740
|
-
var
|
|
1868
|
+
var s;
|
|
1741
1869
|
const t = this.tableModel.getBodyModel();
|
|
1742
|
-
t
|
|
1870
|
+
$(t) && (t.toggleExpandCollapseAll(e), this.repaint(), (s = this.storeStateCollapsedExpandService) == null || s.collapsedStateAll(e));
|
|
1743
1871
|
}
|
|
1744
|
-
|
|
1872
|
+
/**
|
|
1873
|
+
* Toggles the checkbox state of a specific row in a table.
|
|
1874
|
+
*
|
|
1875
|
+
* @param {number} rowIdx - The index of the row to toggle the checkbox state.
|
|
1876
|
+
* @param {number} _colIdx - The index of the column. This parameter is unused.
|
|
1877
|
+
* @param {AreaIdent} areaIdent - The identifier of the table area.
|
|
1878
|
+
*
|
|
1879
|
+
* @return {void} - This method does not return anything.
|
|
1880
|
+
*/
|
|
1881
|
+
toggleRowCheckbox(e, t, s) {
|
|
1745
1882
|
var l;
|
|
1746
|
-
const
|
|
1747
|
-
|
|
1748
|
-
const n = (l =
|
|
1883
|
+
const i = this.tableModel.getAreaModel(s), o = i.isRowChecked(e), r = o === void 0 || o === "semi" || o === "none";
|
|
1884
|
+
i.setRowChecked(e, r), this.repaint();
|
|
1885
|
+
const n = (l = i.rowSelectionModel) == null ? void 0 : l.getCheckedRows();
|
|
1749
1886
|
this.eventListener.onCheckboxChanged(n || []);
|
|
1750
1887
|
}
|
|
1888
|
+
/**
|
|
1889
|
+
* Handle mouse click events.
|
|
1890
|
+
*
|
|
1891
|
+
* @param {GeMouseEvent} evt - The mouse click event.
|
|
1892
|
+
* @param {GeMouseEvent | undefined} previousEvt - The previous mouse click event, if any.
|
|
1893
|
+
* @returns {void}
|
|
1894
|
+
*/
|
|
1751
1895
|
onMouseClicked(e, t) {
|
|
1752
|
-
let
|
|
1753
|
-
if (!
|
|
1754
|
-
const
|
|
1755
|
-
|
|
1896
|
+
let s = this.selectionService.onMouseClicked(e, t);
|
|
1897
|
+
if (!s && this.getFocusModel) {
|
|
1898
|
+
const i = this.getFocusModel();
|
|
1899
|
+
i && (s = i.hasChanged(), i.clearChanged(), s && this.resetEditorRenderer());
|
|
1756
1900
|
}
|
|
1757
|
-
this.eventListener.onMouseClicked(e),
|
|
1901
|
+
this.eventListener.onMouseClicked(e), s && this.debounce(this.repaint.bind(this), 10);
|
|
1758
1902
|
}
|
|
1903
|
+
/**
|
|
1904
|
+
* Updates the table (repaint) when an external filter is changed.
|
|
1905
|
+
*
|
|
1906
|
+
* @param {boolean} clearSelection - Indicates whether to clear the selection model or not. Default value is true.
|
|
1907
|
+
* @return {void}
|
|
1908
|
+
*/
|
|
1759
1909
|
externalFilterChanged(e = !0) {
|
|
1760
1910
|
const t = this.tableOptions.externalFilterFunction;
|
|
1761
1911
|
t && (e && this.clearSelectionModel(), this.tableModel.externalFilterChanged(t), this.scrollViewport.scrollTo(0, 0), this.tableModel.recalcHeightAndPadding(), this.resetSizeOfWrapperDiv(), this.repaint());
|
|
1762
1912
|
}
|
|
1763
|
-
|
|
1913
|
+
/**
|
|
1914
|
+
* Handle the double click event on the table header.
|
|
1915
|
+
*
|
|
1916
|
+
* @param {MouseEvent} event - The mouse event that triggered the double click.
|
|
1917
|
+
* @param {number} _rowIdx - The row index of the header.
|
|
1918
|
+
* @param {number} colIdx - The column index of the header.
|
|
1919
|
+
*
|
|
1920
|
+
* @return {void}
|
|
1921
|
+
*/
|
|
1922
|
+
onHeaderDblClicked(e, t, s) {
|
|
1764
1923
|
var o, r;
|
|
1765
|
-
const
|
|
1766
|
-
if (
|
|
1924
|
+
const i = this.tableModel.getColumnDef(s);
|
|
1925
|
+
if (i != null && i.sortable && i.sortable()) {
|
|
1767
1926
|
e.preventDefault(), e.stopPropagation();
|
|
1768
|
-
const n =
|
|
1769
|
-
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""),
|
|
1927
|
+
const n = i.sortStatesOrder ? i.sortStatesOrder : this.tableOptions.sortOrder, l = i.sortState ?? "", a = n[(n.indexOf(l) + 1) % n.length], d = new ce(s, a);
|
|
1928
|
+
this.tableModel.doSort([d]) && ((o = this.tableModel.getColumnDefs()) == null || o.forEach((g) => g.sortState = ""), i.sortState = a), this.repaint(), (r = this.storeSortingService) == null || r.setSortItems([d]);
|
|
1770
1929
|
}
|
|
1771
1930
|
}
|
|
1931
|
+
/**
|
|
1932
|
+
* Changes the focus cell using the specified deltas.
|
|
1933
|
+
*
|
|
1934
|
+
* @param {number} dx - The delta for the column index.
|
|
1935
|
+
* @param {number} dy - The delta for the row index.
|
|
1936
|
+
* @return {boolean} - True if the focus cell was changed, false otherwise.
|
|
1937
|
+
*/
|
|
1772
1938
|
changeFocusCell(e, t) {
|
|
1773
1939
|
if (!this.isEditing() && this.getFocusModel) {
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
const [
|
|
1777
|
-
return
|
|
1940
|
+
const s = this.getFocusModel();
|
|
1941
|
+
if (s) {
|
|
1942
|
+
const [i, o] = s.getFocus();
|
|
1943
|
+
return s.setFocus(i + t, o + e), this.repaint(), !0;
|
|
1778
1944
|
}
|
|
1779
1945
|
}
|
|
1780
1946
|
return !1;
|
|
1781
1947
|
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Resizes the column based on the mouse event.
|
|
1950
|
+
*
|
|
1951
|
+
* @param {GeMouseEvent} mouseEvent - The mouse event that triggered the resize.
|
|
1952
|
+
*/
|
|
1782
1953
|
resizeColumn(e) {
|
|
1783
1954
|
this.tableModel.setColumnWidth(this.mouseStartColumnIndex, this.mouseStartWidth + e.draggingX), this.tableModel.recalcPadding(), this.resetSizeOfWrapperDiv(), this.adjustContainersAndRows();
|
|
1784
1955
|
}
|
|
1956
|
+
/**
|
|
1957
|
+
* Clears the selection model, if available.
|
|
1958
|
+
*
|
|
1959
|
+
* @return {void}
|
|
1960
|
+
*/
|
|
1785
1961
|
clearSelectionModel() {
|
|
1786
1962
|
var e;
|
|
1787
1963
|
this.getSelectionModel && ((e = this.getSelectionModel()) == null || e.clear());
|
|
1788
1964
|
}
|
|
1789
1965
|
debugOnce(e, t) {
|
|
1790
|
-
var
|
|
1791
|
-
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", (
|
|
1966
|
+
var s;
|
|
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", (s = this.mouseHandler.mouseEvent) == null ? void 0 : s.clientX), console.info("this.hostElement.offsetLeft", this.hostElement.offsetLeft), console.info("this.areaBodyWestGeo.width", this.areaBodyWestGeo.width);
|
|
1792
1968
|
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Restores the scroll position of the table if auto restore options are enabled.
|
|
1971
|
+
*
|
|
1972
|
+
* @private
|
|
1973
|
+
* @memberof ClassName
|
|
1974
|
+
*
|
|
1975
|
+
* @returns {void}
|
|
1976
|
+
*/
|
|
1793
1977
|
autoRestoreScrollPosition() {
|
|
1794
1978
|
var e;
|
|
1795
1979
|
if ((e = this.tableOptions) != null && e.autoRestoreOptions && this.storeScrollPosStateService && this.tableOptions.autoRestoreOptions.autoRestoreScrollPosition) {
|
|
1796
|
-
const
|
|
1797
|
-
|
|
1980
|
+
const s = this.storeScrollPosStateService.getScrollOffset();
|
|
1981
|
+
s && this.scrollViewport.scrollTo(...s);
|
|
1798
1982
|
}
|
|
1799
1983
|
}
|
|
1984
|
+
/**
|
|
1985
|
+
* Automatically restores the sorting state of the table.
|
|
1986
|
+
*
|
|
1987
|
+
* @private
|
|
1988
|
+
* @function autoRestoreSortingState
|
|
1989
|
+
* @memberof ClassName
|
|
1990
|
+
*
|
|
1991
|
+
* @description
|
|
1992
|
+
* This method checks if the autoRestoreSortingState option is enabled in the tableOptions.
|
|
1993
|
+
* If enabled, it uses the storeSortingService to retrieve the sort items array.
|
|
1994
|
+
* If there are sort items present, it applies them to the table's body model using the doSort method.
|
|
1995
|
+
*
|
|
1996
|
+
* @returns {void}
|
|
1997
|
+
*/
|
|
1800
1998
|
autoRestoreSortingState() {
|
|
1801
1999
|
var e, t;
|
|
1802
2000
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.autoRestoreSortingState && this.storeSortingService) {
|
|
1803
|
-
const
|
|
1804
|
-
|
|
2001
|
+
const s = this.storeSortingService.getSortItems();
|
|
2002
|
+
s != null && s.length && this.tableModel.getBodyModel().doSort(s);
|
|
1805
2003
|
}
|
|
1806
2004
|
}
|
|
2005
|
+
/**
|
|
2006
|
+
* Restores the collapsed/expanded state of the rows in the table based on the autoRestoreOptions
|
|
2007
|
+
* specified in the tableOptions. This method is private and should not be called directly.
|
|
2008
|
+
*
|
|
2009
|
+
* @private
|
|
2010
|
+
*/
|
|
1807
2011
|
autoRestoreCollapsedExpandedState() {
|
|
1808
2012
|
var e, t;
|
|
1809
2013
|
if ((t = (e = this.tableOptions) == null ? void 0 : e.autoRestoreOptions) != null && t.getRowId && this.storeStateCollapsedExpandService) {
|
|
1810
|
-
const
|
|
1811
|
-
if (
|
|
2014
|
+
const s = this.tableOptions.autoRestoreOptions, i = s.getRowId;
|
|
2015
|
+
if (s.autoRestoreCollapsedExpandedState && i) {
|
|
1812
2016
|
const o = this.storeStateCollapsedExpandService.collapsedExpandedStateGet(), r = this.tableModel.getAreaModel("body");
|
|
1813
|
-
if (r
|
|
2017
|
+
if ($(r)) {
|
|
1814
2018
|
const n = r, l = r.getRowCount();
|
|
1815
2019
|
for (let a = 0; a < l; a++) {
|
|
1816
2020
|
const d = r.getRowByIndex(a);
|
|
@@ -1820,7 +2024,7 @@ class me extends ae {
|
|
|
1820
2024
|
else if (o.allCollapsed)
|
|
1821
2025
|
d.expanded = !1;
|
|
1822
2026
|
else {
|
|
1823
|
-
const S =
|
|
2027
|
+
const S = i(d.data);
|
|
1824
2028
|
o.mode === "expanded" ? d.expanded = this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S) : o.mode === "collapsed" && (d.expanded = !this.storeStateCollapsedExpandService.collapsedExpandedStateIncludes(S));
|
|
1825
2029
|
}
|
|
1826
2030
|
}
|
|
@@ -1830,178 +2034,56 @@ class me extends ae {
|
|
|
1830
2034
|
}
|
|
1831
2035
|
}
|
|
1832
2036
|
}
|
|
1833
|
-
|
|
1834
|
-
render(e, t, i, s, o, r, n) {
|
|
1835
|
-
if (o.isEditable(t, i)) {
|
|
1836
|
-
n.addClass(e, "ge-table-row-input-div");
|
|
1837
|
-
const l = o.getValueAt(t, i);
|
|
1838
|
-
e.innerHTML = `
|
|
1839
|
-
<input
|
|
1840
|
-
type="text"
|
|
1841
|
-
value="${l}"
|
|
1842
|
-
autofocus
|
|
1843
|
-
onfocus="this.setSelectionRange(0, this.value.length)"
|
|
1844
|
-
data-listen="change"
|
|
1845
|
-
data-area="${s}"
|
|
1846
|
-
data-row-index="${t}"
|
|
1847
|
-
data-col-index="${i}"
|
|
1848
|
-
data-input-type="text"
|
|
1849
|
-
style="width:calc(100% - 8px);height:100%;border:0;padding:0 0 0 8px;"
|
|
1850
|
-
class="ge-table-cell-editor-input">`;
|
|
1851
|
-
}
|
|
1852
|
-
}
|
|
1853
|
-
}
|
|
1854
|
-
class ye {
|
|
1855
|
-
constructor(e = "none", t = "single") {
|
|
1856
|
-
this.selectionType = e, this.selectionMode = t, this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1857
|
-
}
|
|
1858
|
-
getSelectionCount(e, t) {
|
|
1859
|
-
let i = 0;
|
|
1860
|
-
for (const s of this.ranges)
|
|
1861
|
-
s.isInRange(e, t) && i++;
|
|
1862
|
-
return this.allSelected && i++, this.isInNegativeRange(e, t) && (i = 0), i;
|
|
1863
|
-
}
|
|
1864
|
-
isInNegativeRange(e, t) {
|
|
1865
|
-
for (const i of this.negativeRanges)
|
|
1866
|
-
if (i.isInRange(e, t))
|
|
1867
|
-
return !0;
|
|
1868
|
-
return !1;
|
|
1869
|
-
}
|
|
1870
|
-
getRanges() {
|
|
1871
|
-
return this.ranges;
|
|
1872
|
-
}
|
|
1873
|
-
clear() {
|
|
1874
|
-
this.ranges = [], this.negativeRanges = [], this.allSelected = !1;
|
|
1875
|
-
}
|
|
1876
|
-
hasSelection() {
|
|
1877
|
-
return !!this.ranges.length;
|
|
1878
|
-
}
|
|
1879
|
-
selectAll() {
|
|
1880
|
-
this.allSelected = !0;
|
|
1881
|
-
}
|
|
1882
|
-
addSelection(e) {
|
|
1883
|
-
this.addRange(e);
|
|
1884
|
-
}
|
|
1885
|
-
removeSelection(e) {
|
|
1886
|
-
if (this.selectionType === "none")
|
|
1887
|
-
return;
|
|
1888
|
-
let t = e;
|
|
1889
|
-
this.selectionType === "row" ? t = A.singleRow(e.r1) : this.selectionType === "column" && (t = A.singleColumn(e.c1)), this.negativeRanges.push(t);
|
|
1890
|
-
}
|
|
1891
|
-
togglePoint(e, t) {
|
|
1892
|
-
this.getSelectionCount(e, t) > 0 ? this.removeSelection(A.singleCell(e, t)) : this.addSelection(A.singleCell(e, t));
|
|
1893
|
-
}
|
|
1894
|
-
addRange(e) {
|
|
1895
|
-
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));
|
|
1896
|
-
}
|
|
1897
|
-
}
|
|
1898
|
-
class we {
|
|
1899
|
-
constructor(e = "none") {
|
|
1900
|
-
this.selectionType = e, this.rowIndex = -1, this.columnIndex = -1, this.changed = !1;
|
|
1901
|
-
}
|
|
1902
|
-
clearChanged() {
|
|
1903
|
-
this.changed = !1;
|
|
1904
|
-
}
|
|
1905
|
-
hasChanged() {
|
|
1906
|
-
return this.changed;
|
|
1907
|
-
}
|
|
1908
|
-
clear() {
|
|
1909
|
-
this.rowIndex = -1, this.columnIndex = -1;
|
|
1910
|
-
}
|
|
1911
|
-
setFocus(e, t) {
|
|
1912
|
-
(this.rowIndex !== e || this.columnIndex !== t) && (this.rowIndex = e, this.columnIndex = t, this.changed = !0);
|
|
1913
|
-
}
|
|
1914
|
-
hasFocus(e, t) {
|
|
1915
|
-
return this.rowIndex === e && this.columnIndex === t;
|
|
1916
|
-
}
|
|
1917
|
-
getFocus() {
|
|
1918
|
-
return [this.rowIndex, this.columnIndex];
|
|
1919
|
-
}
|
|
1920
|
-
}
|
|
1921
|
-
const ve = new ye(), xe = new we("cell");
|
|
1922
|
-
class Ce {
|
|
1923
|
-
constructor() {
|
|
1924
|
-
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 = {
|
|
1925
|
-
header: 34,
|
|
1926
|
-
body: 34,
|
|
1927
|
-
footer: 34
|
|
1928
|
-
}, this.footerVerticalSeparator = !1, this.headerToggleExpandCollapseIcons = !1, this.headerVerticalSeparator = !1, this.treeOptions = new G(), this.showCheckboxWihoutExtraColumn = !1, this.externalFilterFunction = void 0, this.sortedOptions = new N(), this.sortOrder = ["asc", "desc"], this.getEditRenderer = (e, t) => new be(), this.getSelectionModel = () => ve, this.getFocusModel = () => xe;
|
|
1929
|
-
}
|
|
1930
|
-
}
|
|
1931
|
-
class Ee {
|
|
1932
|
-
setStyle(e, t, i) {
|
|
1933
|
-
return e.style[t] = i, e;
|
|
1934
|
-
}
|
|
1935
|
-
appendText(e, t) {
|
|
1936
|
-
const i = this.createText(t);
|
|
1937
|
-
return this.appendChild(e, i), i;
|
|
1938
|
-
}
|
|
1939
|
-
addClass(e, t) {
|
|
1940
|
-
return t.includes(" ") ? t.split(" ").forEach((i) => e.classList.add(i)) : e.classList.add(t), e;
|
|
1941
|
-
}
|
|
1942
|
-
appendChild(e, t) {
|
|
1943
|
-
e.appendChild(t);
|
|
1944
|
-
}
|
|
1945
|
-
createElement(e) {
|
|
1946
|
-
return document.createElement(e);
|
|
1947
|
-
}
|
|
1948
|
-
createText(e) {
|
|
1949
|
-
return document.createTextNode(e);
|
|
1950
|
-
}
|
|
1951
|
-
setAttribute(e, t, i) {
|
|
1952
|
-
e.setAttribute(t, i);
|
|
1953
|
-
}
|
|
1954
|
-
}
|
|
1955
|
-
function Te({
|
|
2037
|
+
function Re({
|
|
1956
2038
|
tableModel: p,
|
|
1957
|
-
tableOptions: e = new
|
|
2039
|
+
tableOptions: e = new Y(),
|
|
1958
2040
|
mouseMoved: t,
|
|
1959
|
-
checkboxChanged:
|
|
1960
|
-
contextmenu:
|
|
2041
|
+
checkboxChanged: s,
|
|
2042
|
+
contextmenu: i,
|
|
1961
2043
|
modelChanged: o,
|
|
1962
2044
|
mouseClicked: r,
|
|
1963
2045
|
mouseDragging: n,
|
|
1964
2046
|
mouseDraggingEnd: l,
|
|
1965
2047
|
tableReady: a
|
|
1966
2048
|
}) {
|
|
1967
|
-
const d =
|
|
2049
|
+
const d = U(null);
|
|
1968
2050
|
let S = !1;
|
|
1969
|
-
|
|
2051
|
+
J(() => {
|
|
1970
2052
|
d.current && !S && (g(d.current), S = !0);
|
|
1971
2053
|
});
|
|
1972
|
-
const g = (
|
|
1973
|
-
const
|
|
1974
|
-
onCheckboxChanged: (
|
|
1975
|
-
|
|
2054
|
+
const g = (m) => {
|
|
2055
|
+
const h = {
|
|
2056
|
+
onCheckboxChanged: (c) => {
|
|
2057
|
+
s && s(c);
|
|
1976
2058
|
},
|
|
1977
|
-
onContextmenu: (
|
|
1978
|
-
|
|
2059
|
+
onContextmenu: (c) => {
|
|
2060
|
+
i && i(c);
|
|
1979
2061
|
},
|
|
1980
|
-
onModelChanged: (
|
|
1981
|
-
o && o(
|
|
2062
|
+
onModelChanged: (c) => {
|
|
2063
|
+
o && o(c);
|
|
1982
2064
|
},
|
|
1983
|
-
onMouseClicked: (
|
|
1984
|
-
r && r(
|
|
2065
|
+
onMouseClicked: (c) => {
|
|
2066
|
+
r && r(c);
|
|
1985
2067
|
},
|
|
1986
|
-
onMouseDragging: (
|
|
1987
|
-
n && n(
|
|
2068
|
+
onMouseDragging: (c) => {
|
|
2069
|
+
n && n(c);
|
|
1988
2070
|
},
|
|
1989
|
-
onMouseDraggingEnd: (
|
|
1990
|
-
l && l(
|
|
2071
|
+
onMouseDraggingEnd: (c) => {
|
|
2072
|
+
l && l(c);
|
|
1991
2073
|
},
|
|
1992
|
-
onMouseMoved: (
|
|
1993
|
-
t && t(
|
|
2074
|
+
onMouseMoved: (c) => {
|
|
2075
|
+
t && t(c);
|
|
1994
2076
|
}
|
|
1995
|
-
},
|
|
1996
|
-
|
|
2077
|
+
}, f = new _(
|
|
2078
|
+
m,
|
|
1997
2079
|
p,
|
|
1998
|
-
new
|
|
2080
|
+
new K(),
|
|
1999
2081
|
e,
|
|
2000
|
-
|
|
2082
|
+
h
|
|
2001
2083
|
);
|
|
2002
|
-
|
|
2084
|
+
f.firstInit(), a && a(f.getApi());
|
|
2003
2085
|
};
|
|
2004
|
-
return /* @__PURE__ */
|
|
2086
|
+
return /* @__PURE__ */ q(
|
|
2005
2087
|
"div",
|
|
2006
2088
|
{
|
|
2007
2089
|
ref: d,
|
|
@@ -2009,46 +2091,46 @@ function Te({
|
|
|
2009
2091
|
style: {
|
|
2010
2092
|
width: "100%",
|
|
2011
2093
|
height: "100%",
|
|
2012
|
-
|
|
2094
|
+
background: "transparent",
|
|
2013
2095
|
padding: "0",
|
|
2014
2096
|
margin: "0"
|
|
2015
2097
|
}
|
|
2016
2098
|
}
|
|
2017
2099
|
);
|
|
2018
2100
|
}
|
|
2019
|
-
var
|
|
2101
|
+
var B, F = Q;
|
|
2020
2102
|
if (process.env.NODE_ENV === "production")
|
|
2021
|
-
|
|
2103
|
+
B = F.createRoot, F.hydrateRoot;
|
|
2022
2104
|
else {
|
|
2023
|
-
var
|
|
2024
|
-
|
|
2025
|
-
|
|
2105
|
+
var j = F.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
2106
|
+
B = function(p, e) {
|
|
2107
|
+
j.usingClientEntryPoint = !0;
|
|
2026
2108
|
try {
|
|
2027
2109
|
return F.createRoot(p, e);
|
|
2028
2110
|
} finally {
|
|
2029
|
-
|
|
2111
|
+
j.usingClientEntryPoint = !1;
|
|
2030
2112
|
}
|
|
2031
2113
|
};
|
|
2032
2114
|
}
|
|
2033
|
-
class
|
|
2115
|
+
class Me {
|
|
2034
2116
|
constructor(e) {
|
|
2035
2117
|
this.Component = e, console.info(e);
|
|
2036
2118
|
}
|
|
2037
|
-
render(e, t,
|
|
2119
|
+
render(e, t, s, i, o, r, n) {
|
|
2038
2120
|
const l = {
|
|
2039
2121
|
cellDiv: e,
|
|
2040
2122
|
rowIndex: t,
|
|
2041
|
-
columnIndex:
|
|
2042
|
-
areaIdent:
|
|
2123
|
+
columnIndex: s,
|
|
2124
|
+
areaIdent: i,
|
|
2043
2125
|
areaModel: o,
|
|
2044
2126
|
cellValue: r
|
|
2045
|
-
}, a =
|
|
2127
|
+
}, a = B(e, {});
|
|
2046
2128
|
return a.render(this.Component(l)), () => {
|
|
2047
2129
|
a.unmount();
|
|
2048
2130
|
};
|
|
2049
2131
|
}
|
|
2050
2132
|
}
|
|
2051
2133
|
export {
|
|
2052
|
-
|
|
2053
|
-
|
|
2134
|
+
Me as ComponentRendererWrapper,
|
|
2135
|
+
Re as GuiexpertTable
|
|
2054
2136
|
};
|